diff --git a/programs/cmm/TWB/TWB.c b/programs/cmm/TWB/TWB.c index 40ade19f0d..d6154afe6b 100644 --- a/programs/cmm/TWB/TWB.c +++ b/programs/cmm/TWB/TWB.c @@ -16,10 +16,10 @@ struct TWebBrowser { void GetNewUrl(); void Prepare(); void Parse(); - void WhatTextStyle(); + void SetTextStyle(); void DrawPage(); void DrawScroller(); - void TextGoDown(); + void NewLine(); }; TWebBrowser WB1; @@ -302,11 +302,11 @@ void TWebBrowser::Parse(){ if (stroka-1 > list.visible) && (list.first <>0) break 1; //єїюфшь... DrawPage(); strcpy(#line, #temp); - TextGoDown(list.x + 5, stroka * 10 + list.y + 5, list.w - 20); //чръЁр°штрхь ёыхфє∙є■ ёЄЁюъє + NewLine(list.x + 5, stroka * 10 + list.y + 5); //чръЁр°штрхь ёыхфє∙є■ ёЄЁюъє } DrawPage(); line=NULL; - if (tag) WhatTextStyle(list.x + 5, stroka * 10 + list.y + 5, list.w - 20); //юсЁрсюЄър Єхуют + if (tag) SetTextStyle(list.x + 5, stroka * 10 + list.y + 5); //юсЁрсюЄър Єхуют tag = parametr = tagparam = ignor_param = NULL; break; default: @@ -329,13 +329,13 @@ void TWebBrowser::Parse(){ if (stroka-1 > list.visible) && (list.first <>0) break 1; //єїюфшь... DrawPage(); strcpy(#line, #temp); - TextGoDown(list.x + 5, stroka * 10 + list.y + 5, list.w - 20); //чръЁр°штрхь ёыхфє∙є■ ёЄЁюъє + NewLine(list.x + 5, stroka * 10 + list.y + 5); //чръЁр°штрхь ёыхфє∙є■ ёЄЁюъє } } } DrawPage(); //ЁшёєхЄ яюёыхфэ■■ ёЄЁюъє, яюЄюь ¤Єю эрфю єсЁрЄ№, юяЄшьшчшЁютрт ъюф - TextGoDown(list.x + 5, stroka * 10 + list.y + 5, list.w - 20); //чръЁр°штрхь ёыхфє∙є■ ёЄЁюъє + NewLine(list.x + 5, stroka * 10 + list.y + 5); //чръЁр°штрхь ёыхфє∙є■ ёЄЁюъє if (list.visible * 10 + 25 <= list.h) DrawBar(list.x, list.visible * 10 + list.y + 25, list.w, -list.visible * 10 + list.h - 25, bg_color); @@ -354,7 +354,7 @@ void TWebBrowser::Parse(){ char oldtag[100]; -void TWebBrowser::WhatTextStyle(int left1, top1, width1) { +void TWebBrowser::SetTextStyle(int left1, top1) { dword hr_color; byte opened; byte meta_encoding; @@ -388,13 +388,13 @@ void TWebBrowser::WhatTextStyle(int left1, top1, width1) { { if (opened) { - TextGoDown(left1, top1, width1); + NewLine(left1, top1); strcat(#line, ' \"'); } if (!opened) { chrcat(#line, '\"'); - TextGoDown(left1, top1, width1); + NewLine(left1, top1); } } @@ -478,63 +478,70 @@ void TWebBrowser::WhatTextStyle(int left1, top1, width1) { return; } if (isTag("br")) { - TextGoDown(left1, top1, width1); + NewLine(left1, top1); return; } if (isTag("div")) || (isTag("header")) || (isTag("footer")) { - IF(oldtag[0] <>'h') TextGoDown(left1, top1, width1); + IF(oldtag[0] <>'h') NewLine(left1, top1); return; } if (isTag("p")) { IF(oldtag[0] == 'h') return; - TextGoDown(left1, top1, width1); - IF(opened) TextGoDown(left1, top1 + 10, width1); + NewLine(left1, top1); + IF(opened) NewLine(left1, top1 + 10); return; } - if(isTag("table")) { - if (opened) - { - table.active = true; - TextGoDown(left1, top1, width1); - table.NewTable(); - } - else - { - table.active = false; - TextGoDown(left1, top1, width1); - } + table.active = opened; + NewLine(left1, top1); + if (opened) table.NewTable(); } + if(isTag("td")) { if (opened) { - // + table.cur_col++; + table.row_h = 0; + do { + if (!strcmp(#parametr, "width=")) + { + table.col_w[table.cur_col] = atoi(#options); + // NewLine(left1, top1); + // strcpy(#line, #options); + // NewLine(left1, top1); + } + } while(GetNextParam()); } else { - // + if (table.row_h > table.row_max_h) table.row_max_h = table.row_h; } } + if(isTag("tr")) { if (opened) { - // + table.cur_col = 0; + table.row_max_h = 0; + table.row_start = stroka; } else { - TextGoDown(left1, top1, width1); + NewLine(left1, top1); if (table.cur_row == 0) table.max_cols = table.cur_col; table.cur_row++; + table.max_cols = table.cur_col; } } + /* if (isTag("center")) { if (opened) text_align = ALIGN_CENTER; if (!opened) { - TextGoDown(left1, top1, width1); + NewLine(left1, top1); text_align = ALIGN_LEFT; } return; @@ -544,15 +551,15 @@ void TWebBrowser::WhatTextStyle(int left1, top1, width1) { if (opened) text_align = ALIGN_RIGHT; if (!opened) { - TextGoDown(left1, top1, width1); + NewLine(left1, top1); text_align = ALIGN_LEFT; } return; } */ if (isTag("h1")) || (isTag("h2")) || (isTag("h3")) || (isTag("h4")) { - TextGoDown(left1, top1, width1); - if (opened) && (stroka>1) TextGoDown(left1, top1 + 10, width1); + NewLine(left1, top1); + if (opened) && (stroka>1) NewLine(left1, top1 + 10); strcpy(#oldtag, #tag); if (opened) { @@ -582,7 +589,7 @@ void TWebBrowser::WhatTextStyle(int left1, top1, width1) { { li_text = opened; IF(opened == 0) return; - TextGoDown(left1, top1, width1); + NewLine(left1, top1); return; } if (isTag("condition")) @@ -596,7 +603,7 @@ void TWebBrowser::WhatTextStyle(int left1, top1, width1) { li_text = opened; if (opened) { - TextGoDown(left1, top1, width1); + NewLine(left1, top1); if (stroka > -1) && (stroka - 2 < list.visible) DrawBuf.DrawBar(li_tab * 5 * 6 + left1 - 5, list.line_h/2-3, 2, 2, 0x555555); } return; @@ -607,7 +614,7 @@ void TWebBrowser::WhatTextStyle(int left1, top1, width1) { { li_text = opened; li_tab--; - TextGoDown(left1, top1, width1); + NewLine(left1, top1); } ELSE li_tab++; if (isTag("dd")) stolbec += 5; if (isTag("blockquote")) blq_text = opened; @@ -620,13 +627,13 @@ void TWebBrowser::WhatTextStyle(int left1, top1, width1) { return; } if (strcmp(#parametr, "color=") == 0) hr_color = GetColor(#options); else hr_color = 0x999999; - TextGoDown(left1, top1, width1); + NewLine(left1, top1); DrawBuf.DrawBar(5, list.line_h/2, list.w-10, 1, hr_color); - TextGoDown(left1, top1+list.line_h, width1); + NewLine(left1, top1+list.line_h); } if (isTag("img")) { - ImgCache.Images( left1, top1, width1); + ImgCache.Images( left1, top1); return; } if (isTag("meta")) || (isTag("?xml")) @@ -664,7 +671,7 @@ void TWebBrowser::DrawScroller() // } -void TWebBrowser::TextGoDown(int left1, top1, width1) +void TWebBrowser::NewLine(int left1, top1) { if (!stroka) DrawBar(list.x, list.y, list.w, 5, bg_color); //чръЁр°штрхь Їюэ эрф яхЁтющ ёЄЁюъющ if (t_html) && (!t_body) return; diff --git a/programs/cmm/TWB/table.h b/programs/cmm/TWB/table.h index 82c771f635..8e5fdd445e 100644 --- a/programs/cmm/TWB/table.h +++ b/programs/cmm/TWB/table.h @@ -5,8 +5,8 @@ struct Table byte max_rows; byte cur_col; byte cur_row; - int col_w[255]; - int col_h[255]; + int col_w[32]; + int row_start, row_h, row_max_h; void NewTable(); } table; diff --git a/programs/cmm/browser/HTMLv.c b/programs/cmm/browser/HTMLv.c index ae38205095..a314638cb8 100644 --- a/programs/cmm/browser/HTMLv.c +++ b/programs/cmm/browser/HTMLv.c @@ -30,14 +30,14 @@ #include "img\URLgoto.txt"; #ifdef LANG_RUS - char version[]=" Текстовый браузер 0.99.73"; + char version[]=" Текстовый браузер 0.99.74"; ?define IMAGES_CACHE_CLEARED "Кэш картинок очищен" ?define T_LAST_SLIDE "Это последний слайд" char loading[] = "Загрузка страницы...
"; unsigned char page_not_found[] = FROM "html\page_not_found_ru.htm"; char accept_language[]= "Accept-Language: ru\n"; #else - char version[]=" Text-based Browser 0.99.73"; + char version[]=" Text-based Browser 0.99.74"; ?define IMAGES_CACHE_CLEARED "Images cache cleared" ?define T_LAST_SLIDE "This slide is the last" char loading[] = "Loading...
"; @@ -469,6 +469,7 @@ void StopLoading() mem_Free(EAX); // free data http_transfer=0; bufsize = 0; + bufpointer = mem_Free(bufpointer); } PutPaletteImage(#toolbar,200,42,0,0,8,#toolbar_pal); } @@ -499,6 +500,7 @@ void OpenPage() { StopLoading(); bufsize = 0; + bufpointer = mem_Free(bufpointer); ShowPage(); return; } @@ -507,11 +509,13 @@ void OpenPage() { file_size stdcall (#URL); bufsize = EBX; - if (!bufsize) return; - mem_Free(bufpointer); - bufpointer = mem_Alloc(bufsize); - SetPageDefaults(); - ReadFile(0, bufsize, bufpointer, #URL); + if (bufsize) + { + bufpointer = mem_Free(bufpointer); + bufpointer = mem_Alloc(bufsize); + SetPageDefaults(); + ReadFile(0, bufsize, bufpointer, #URL); + } ShowPage(); } } diff --git a/programs/cmm/browser/html/page_not_found_en.htm b/programs/cmm/browser/html/page_not_found_en.htm index 3b6cd3fa9b..ab5730e2db 100644 --- a/programs/cmm/browser/html/page_not_found_en.htm +++ b/programs/cmm/browser/html/page_not_found_en.htm @@ -3,15 +3,15 @@ Page not found -

Webpage Not Available

-

What could be done:

+

 Webpage Not Available

+

 What could be done: