From 0580672a6cc594d9f54cced881b5623b35c403ef Mon Sep 17 00:00:00 2001 From: "Kirill Lipatov (Leency)" Date: Sun, 4 Dec 2016 18:51:23 +0000 Subject: [PATCH] WebView: fix
 tag process, fix definition of  tag
 in document

git-svn-id: svn://kolibrios.org@6783 a494cfbc-eb01-0410-851d-a64ba20cac60
---
 programs/cmm/TWB/TWB.c                        | 24 +++++++++----------
 programs/cmm/browser/WebView.c                |  5 ++--
 programs/cmm/eolite/Eolite.c                  |  4 ++--
 programs/cmm/eolite/include/progress_dialog.h |  2 +-
 4 files changed, 17 insertions(+), 18 deletions(-)

diff --git a/programs/cmm/TWB/TWB.c b/programs/cmm/TWB/TWB.c
index 6c2080fef5..254c43ad06 100644
--- a/programs/cmm/TWB/TWB.c
+++ b/programs/cmm/TWB/TWB.c
@@ -46,7 +46,6 @@ dword text_color_index;
 dword link_color_inactive;
 dword link_color_active;
 dword bg_color;
-dword block_bg_color;
 
 int stroka;
 int stolbec;
@@ -80,7 +79,7 @@ void TWebBrowser::DrawStyle()
 	{
 		ChangeCharset("UTF-8", "CP866", #line);
 		strcpy(#header, #line);
-		strcat(#header, " -");
+		strcat(#header, " - ");
 		strcat(#header, #version);
 		line = 0;
 		return;
@@ -125,7 +124,7 @@ void TWebBrowser::Prepare(){
 	style.align = ALIGN_LEFT;
 	link_color_inactive = 0x0000FF;
 	link_color_active = 0xFF0000;
-	bg_color = block_bg_color = 0xFFFFFF;
+	bg_color = 0xFFFFFF;
 	DrawBuf.Fill(bg_color);
 	PageLinks.Clear();
 	strcpy(#header, #version);
@@ -133,14 +132,16 @@ void TWebBrowser::Prepare(){
 	stolbec = 0;
 	line = 0;
 	//for plaint text use CP866 for other UTF
-	if (strstri(bufpointer, "html")) 
+	if (strstri(bufpointer, "html")!=-1) 
 	{
-		style.pre = 0;
+		debugln(" found");
+		style.pre = false;
 		cur_encoding = CH_NULL;
 	}
 	else
 	{
-		style.pre = 1;
+		debugln("no ");
+		style.pre = true;
 		cur_encoding = CH_NULL;
 	}
 	for (bufpos=bufpointer ; (bufpos < bufpointer+bufsize) && (ESBYTE[bufpos]!=0) ; bufpos++;)
@@ -153,9 +154,11 @@ void TWebBrowser::Prepare(){
 			if (style.pre)
 			{
 				DrawStyle();
+				line = NULL;
 				NewLine();
 				break;
 			}
+			goto DEFAULT_MARK;
 		case '\9':
 			if (style.pre) //otherwise go to 0x0d	
 			{
@@ -164,7 +167,7 @@ void TWebBrowser::Prepare(){
 				for (j=0; j= 0) && ( stroka + 1 * list.item_h + 5 < list.h) && (!anchor)
 	{
 		if (style.align == ALIGN_CENTER) && (DrawBuf.zoom==1) DrawBuf.AlignCenter(onleft,ontop,list.w,list.item_h,stolbec * list.font_w);
diff --git a/programs/cmm/browser/WebView.c b/programs/cmm/browser/WebView.c
index e0779b7bf6..7b0ad90197 100644
--- a/programs/cmm/browser/WebView.c
+++ b/programs/cmm/browser/WebView.c
@@ -30,7 +30,7 @@
 char homepage[] = FROM "html\\homepage.htm""\0";
 
 #ifdef LANG_RUS
-char version[]="Текстовый браузер 1.55";
+char version[]="Текстовый браузер 1.56";
 ?define IMAGES_CACHE_CLEARED "Кэш картинок очищен"
 ?define T_LAST_SLIDE "Это последний слайд"
 char loading[] = "Загрузка страницы...
"; @@ -43,7 +43,7 @@ char rmb_menu[] = Очистить кэш картинок Менеджер загрузок"; #else -char version[]="Text-based Browser 1.55"; +char version[]="Text-based Browser 1.56"; ?define IMAGES_CACHE_CLEARED "Images cache cleared" ?define T_LAST_SLIDE "This slide is the last" char loading[] = "Loading...
"; @@ -464,6 +464,7 @@ DrawEditBoxWebView() void ShowPage() { DrawEditBoxWebView(); + debugval("bufsize", bufsize); if (!bufsize) { if (http_transfer) WB1.LoadInternalPage(#loading, sizeof(loading)); diff --git a/programs/cmm/eolite/Eolite.c b/programs/cmm/eolite/Eolite.c index 5b6e395c6d..2162ef6438 100644 --- a/programs/cmm/eolite/Eolite.c +++ b/programs/cmm/eolite/Eolite.c @@ -570,9 +570,9 @@ void DrawStatusBar() int go_up_folder_exists=0; if (!show_status_bar) return; if (files.count>0) && (strcmp(file_mas[0]*304+buf+72,"..")==0) go_up_folder_exists=1; - DrawBar(1, Form.cheight - status_bar_h-1, Form.cwidth-2, status_bar_h, col_work); + DrawBar(1, Form.cheight - status_bar_h-1, Form.cwidth-2, status_bar_h, system.color.work); sprintf(#status_bar_str, STATUS_STR, files.count-go_up_folder_exists, count_dir-go_up_folder_exists, files.count-count_dir, selected_count); - WriteText(6,Form.cheight - 13,0x80,0x000000,#status_bar_str); + WriteText(6,Form.cheight - 13,0x80,system.color.work_text,#status_bar_str); } void DrawFilePanels() diff --git a/programs/cmm/eolite/include/progress_dialog.h b/programs/cmm/eolite/include/progress_dialog.h index 59a4e77fc1..9305faebfd 100644 --- a/programs/cmm/eolite/include/progress_dialog.h +++ b/programs/cmm/eolite/include/progress_dialog.h @@ -59,7 +59,7 @@ void Operation_Draw_Progress(dword filename) { DisplayOperationForm(); DrawIconByExtension(filename, filename+strrchr(filename,'.'), 16, 19, system.color.work); DrawBar(45, 32, Dialog_Form.cwidth-45, 15, system.color.work); - WriteText(45, 32, 0x90, 0x000000, filename); + WriteText(45, 32, 0x90, system.color.work_text, filename); progressbar_draw stdcall (#copy_bar); progressbar_progress stdcall (#copy_bar); //copy_bar.value++;