diff --git a/programs/cmm/TWB/TWB.c b/programs/cmm/TWB/TWB.c index fc4aa0a413..d38cecaedd 100644 --- a/programs/cmm/TWB/TWB.c +++ b/programs/cmm/TWB/TWB.c @@ -13,6 +13,8 @@ bool button, image, align; +dword + bg_color; }; struct TWebBrowser { @@ -47,7 +49,7 @@ dword text_colors[300]; dword text_color_index; dword link_color_inactive; dword link_color_active; -dword bg_color; +dword page_bg; int draw_y; int stolbec; @@ -93,8 +95,12 @@ void TWebBrowser::DrawStyle() stolbec_len = strlen(#line) * zoom; line_length = stolbec_len * list.font_w; + if (style.bg_color!=page_bg) { + DrawBuf.DrawBar(start_x, draw_y, line_length, list.item_h-1, style.bg_color); + } + if (style.image) { - DrawBuf.DrawBar(start_x, draw_y, line_length, list.item_h, 0xF9DBCB); + DrawBuf.DrawBar(start_x, draw_y, line_length, list.item_h-1, 0xF9DBCB); } if (style.button) { DrawBuf.DrawBar(start_x, draw_y, line_length, list.item_h - calc(zoom*2), 0xCCCccc); @@ -130,8 +136,9 @@ void TWebBrowser::Prepare(){ style.align = ALIGN_LEFT; link_color_inactive = 0x0000FF; link_color_active = 0xFF0000; - bg_color = 0xFFFFFF; - DrawBuf.Fill(0, bg_color); + page_bg = 0xFFFFFF; + style.bg_color = page_bg; + DrawBuf.Fill(0, page_bg); PageLinks.Clear(); strcpy(#header, #version); draw_y = body_magrin; @@ -300,8 +307,8 @@ void TWebBrowser::SetStyle() { if (isattr("text=")) text_colors[0]=GetColor(#val); if (isattr("bgcolor=")) { - bg_color = GetColor(#val); - DrawBuf.Fill(0, bg_color); + style.bg_color = page_bg = GetColor(#val); + DrawBuf.Fill(0, page_bg); } } while(GetNextParam()); if (opened) && (cur_encoding==CH_NULL) { @@ -340,12 +347,14 @@ void TWebBrowser::SetStyle() { return; } if (istag("font")) { + style.bg_color = page_bg; if (opened) { text_color_index++; text_colors[text_color_index] = text_colors[text_color_index-1]; do{ if (isattr("color=")) text_colors[text_color_index] = GetColor(#val); + if (isattr("bg=")) style.bg_color = GetColor(#val); } while(GetNextParam()); } else if (text_color_index > 0) text_color_index--; @@ -426,8 +435,9 @@ void TWebBrowser::SetStyle() { if (opened) { NewLine(); + stolbec = style.li_tab * 5 - 2; strcpy(#line, "\31 "); - stolbec-=2; + //stolbec-=2; } return; } diff --git a/programs/cmm/TWB/img_cache.h b/programs/cmm/TWB/img_cache.h index 5d4767fd4d..bd3e521929 100644 --- a/programs/cmm/TWB/img_cache.h +++ b/programs/cmm/TWB/img_cache.h @@ -67,8 +67,8 @@ void ImageCache::Images(dword left1, top1, width1) if (imgh<=0) return; img_draw stdcall (pics[cur_pic].image, left1-5, top1, imgw, imgh,0,img_lines_first); - DrawBar(left1+imgw - 5, top1, WB1.list.w-imgw, imgh, bg_color); - DrawBar(WB1.list.x, top1+imgh, WB1.list.w, -imgh % WB1.list.item_h + WB1.list.item_h, bg_color); + DrawBar(left1+imgw - 5, top1, WB1.list.w-imgw, imgh, page_bg); + DrawBar(WB1.list.x, top1+imgh, WB1.list.w, -imgh % WB1.list.item_h + WB1.list.item_h, page_bg); if (link) { //UnsafeDefineButton(left1 - 5, top1, imgw, imgh-1, PageLinks.count + 400 + BT_HIDE, 0xB5BFC9); diff --git a/programs/cmm/TWB/links.h b/programs/cmm/TWB/links.h index de8d232020..63fd1ec41c 100644 --- a/programs/cmm/TWB/links.h +++ b/programs/cmm/TWB/links.h @@ -93,7 +93,7 @@ bool LinksArray::HoverAndProceed(dword mx, my) if (links[active].underline) DrawBar(links[active].x, -WB1.list.first + links[active].y + links[active].h, links[active].w, links[active].underline_h, link_color_inactive); if (links[i].underline) DrawBar(links[i].x, -WB1.list.first + links[i].y - + links[i].h, links[i].w, links[i].underline_h, bg_color); + + links[i].h, links[i].w, links[i].underline_h, page_bg); active = i; DrawStatusBar(links[active].link); return true; diff --git a/programs/cmm/browser/WebView.c b/programs/cmm/browser/WebView.c index e594ece7e4..8ddf16dd1d 100644 --- a/programs/cmm/browser/WebView.c +++ b/programs/cmm/browser/WebView.c @@ -28,14 +28,15 @@ _http http = {0, 0, 0, 0, 0, 0, 0}; -char homepage[] = FROM "html\\homepage.htm""\0"; #ifdef LANG_RUS -char version[]="Текстовый браузер 1.84"; +char version[]="Текстовый браузер 1.85"; ?define IMAGES_CACHE_CLEARED "Кэш картинок очищен" ?define T_LAST_SLIDE "Это последний слайд" char loading[] = "Загрузка страницы...
"; char page_not_found[] = FROM "html\\page_not_found_ru.htm""\0"; +char homepage[] = FROM "html\\homepage_ru.htm""\0"; +char help[] = FROM "html\\help_ru.htm""\0"; char accept_language[]= "Accept-Language: ru\n"; char rmb_menu[] = "Посмотреть исходник @@ -46,11 +47,13 @@ char link_menu[] = "Копировать ссылку Скачать содержимое ссылки"; #else -char version[]="Text-based Browser 1.84"; +char version[]="Text-based Browser 1.85"; ?define IMAGES_CACHE_CLEARED "Images cache cleared" ?define T_LAST_SLIDE "This slide is the last" char loading[] = "Loading...
"; char page_not_found[] = FROM "html\\page_not_found_en.htm""\0"; +char homepage[] = FROM "html\\homepage_en.htm""\0"; +char help[] = FROM "html\\help_en.htm""\0"; char accept_language[]= "Accept-Language: en\n"; char rmb_menu[] = "View source @@ -64,7 +67,8 @@ Download link contents"; #define URL_SERVICE_HISTORY "WebView://history" -#define URL_SERVICE_HOME "WebView://home" +#define URL_SERVICE_HOMEPAGE "WebView://home" +#define URL_SERVICE_HELP "WebView://help" #define URL_SERVICE_SOURCE "WebView://source:" proc_info Form; @@ -132,7 +136,7 @@ void main() CreateThread(#Downloader,#downloader_stak+4092); ExitProcess(); } - else if (param) strcpy(#URL, #param); else strcpy(#URL, URL_SERVICE_HOME); + else if (param) strcpy(#URL, #param); else strcpy(#URL, URL_SERVICE_HOMEPAGE); WB1.list.SetFont(8, 14, 10011000b); WB1.list.no_selection = true; SetEventMask(EVM_REDRAW + EVM_KEY + EVM_BUTTON + EVM_MOUSE + EVM_MOUSE_FILTER + EVM_STACK); @@ -169,7 +173,14 @@ void main() || (key_scancode == SCAN_CODE_KEY_N) RunProgram(#program_path, NULL); if (key_scancode == SCAN_CODE_KEY_W) ExitProcess(); if (key_scancode == SCAN_CODE_KEY_J) ProcessEvent(DOWNLOAD_MANAGER); + if (key_scancode == SCAN_CODE_KEY_R) ProcessEvent(REFRESH_BUTTON); + if (key_scancode == SCAN_CODE_ENTER) EventSeachWeb(); + if (key_scancode == SCAN_CODE_LEFT) ProcessEvent(BACK_BUTTON); + if (key_scancode == SCAN_CODE_RIGHT) ProcessEvent(FORWARD_BUTTON); } + + if (key_scancode == SCAN_CODE_F5) ProcessEvent(REFRESH_BUTTON); + if (address_box.flags & ed_focus) { if (key_scancode == SCAN_CODE_ENTER) { @@ -185,6 +196,7 @@ void main() #define KEY_SCROLL_N 11 if (SCAN_CODE_UP == key_scancode) for (i=0;i + + История + + +

История

+
+ Посещенные страницы
+" +#else +#define HISTORY_HEADER " + + History + + +

History

+
+ Visited pages
+" +#endif + + ShowHistory() { int i; @@ -6,16 +29,16 @@ ShowHistory() free(history_pointer); history_pointer = malloc(history.items.data_size+256); - strcat(history_pointer, "History

History

"); - strcat(history_pointer, "
Visited pages
"); + strcat(history_pointer, HISTORY_HEADER); for (i=0; i"); strcat(history_pointer, history.items.get(i)); strcat(history_pointer, "
"); } + /* strcat(history_pointer, "
Cached images
"); for (i=1; i"); strcat(history_pointer, #pics[i].path); strcat(history_pointer, "
"); - /* - strcat(history_pointer, "
"); - strcat(history_pointer, #pics[i].path); - */ + + // strcat(history_pointer, "
"); + // strcat(history_pointer, #pics[i].path); } + */ strcat(history_pointer, ""); WB1.LoadInternalPage(history_pointer, strlen(history_pointer)); } \ No newline at end of file diff --git a/programs/cmm/browser/html/help_en.htm b/programs/cmm/browser/html/help_en.htm new file mode 100644 index 0000000000..c9cbacf8bb --- /dev/null +++ b/programs/cmm/browser/html/help_en.htm @@ -0,0 +1,23 @@ + + + +WebView Help + +

WebView Help

+ +Shortcut keys + +[CTRL + N or CTRL + T] New window +[CTRL + R or F5] Refresh the current page +[CTRL + U] View a web page's source code +[CTRL + H] Open browser history +[CTRL + J] Display the file downloader +[CTRL + W] Exit browser +[CTRL + ENTER] Submit a web search +[CTRL + LEFT] Back a page. +[CTRL + RIGHT] Forward a page. +[F6] Moves a text cursor to the omnibox + +
+ + \ No newline at end of file diff --git a/programs/cmm/browser/html/help_ru.htm b/programs/cmm/browser/html/help_ru.htm new file mode 100644 index 0000000000..2d228bdbaf --- /dev/null +++ b/programs/cmm/browser/html/help_ru.htm @@ -0,0 +1,20 @@ + + + +Справка WebView + +

Справка WebView

+[CTRL + N или CTRL + T] Новое окно +[CTRL + R или F5] Перезагрузить страницу +[CTRL + U] Смотреть исходный код страницы +[CTRL + H] Смотреть историю посещенных страниц +[CTRL + J] Открыть загрузчик файлов +[CTRL + W] Закрыть браузер +[CTRL + ENTER] Поиск в интернете с помощью Google +[CTRL + ВЛЕВО] Аналогично кнопке "Назад" в браузере +[CTRL + ВПРАВО] Аналогично кнопке "Вперед" +[F6] Перемещает текстовый курсор в омнибокс + +
+ + \ No newline at end of file diff --git a/programs/cmm/browser/html/homepage.htm b/programs/cmm/browser/html/homepage.htm deleted file mode 100644 index 91a2a0d3c4..0000000000 --- a/programs/cmm/browser/html/homepage.htm +++ /dev/null @@ -1,15 +0,0 @@ - - -Homepage - - - -
-Bookmarks:
-1. KolibriOS homepage
-2. KolibriN homepage
-3. Kolibri Stuff - - - - \ No newline at end of file diff --git a/programs/cmm/browser/html/homepage_en.htm b/programs/cmm/browser/html/homepage_en.htm new file mode 100644 index 0000000000..eacaebbd26 --- /dev/null +++ b/programs/cmm/browser/html/homepage_en.htm @@ -0,0 +1,17 @@ + + + +Homepage + +
Bookmarks:
+1. KolibriOS homepage
+2. KolibriN homepage
+3. Kolibri Stuff
+
+Hint: to run a web search, type a text in the adress box
+and press Ctrl+Enter. You can also use other Hotkeys.
+
+
+
+ + \ No newline at end of file diff --git a/programs/cmm/browser/html/homepage_ru.htm b/programs/cmm/browser/html/homepage_ru.htm new file mode 100644 index 0000000000..803a12b56d --- /dev/null +++ b/programs/cmm/browser/html/homepage_ru.htm @@ -0,0 +1,17 @@ + + + +Домашняя страница + +
Закладки:
+1. Домашняя страница KolibriOS
+2. KolibriN10
+3. Kolibri Store
+
+Для поиска в Google наберите тест в адресной строке
+и нажмите Ctrl+Enter. Есть также другие Горячие клавиши.
+
+
+
+ + \ No newline at end of file diff --git a/programs/cmm/eolite/include/menu.h b/programs/cmm/eolite/include/menu.h index 506fdb0a57..1123108df6 100644 --- a/programs/cmm/eolite/include/menu.h +++ b/programs/cmm/eolite/include/menu.h @@ -3,8 +3,6 @@ char *file_captions[] = { "Открыть", "Enter",100, "Открыть с помощью...", "CrlEnt",201, - "Открыть как текст", "F3",202, - "Открыть как HEX", "F4",203, "Копировать", "Crl+C",104, "Вырезать", "Crl+X",105, "Вставить", "Crl+V",106, @@ -17,8 +15,6 @@ char *file_captions[] = { char *file_captions[] = { "Ava", "Enter",100, "Ava ...", "CrlEnt",201, - "Vaata tekstina", "F3",202, - "Vaata HEX", "F4",203, "Kopeeri", "Crl+C",104, "Lїika", "Crl+X",105, "Aseta", "Crl+V",106, @@ -31,8 +27,6 @@ char *file_captions[] = { char *file_captions[] = { "Open", "Enter",100, "Open with...", "CrlEnt",201, - "View as text", "F3",202, - "View as HEX", "F4",203, "Copy", "Crl+C",104, "Cut", "Crl+X",105, "Paste", "Crl+V",106, diff --git a/programs/cmm/lib/patterns/http_downloader.h b/programs/cmm/lib/patterns/http_downloader.h index 083939c1a8..7103fd178f 100644 --- a/programs/cmm/lib/patterns/http_downloader.h +++ b/programs/cmm/lib/patterns/http_downloader.h @@ -176,6 +176,7 @@ int check_is_the_url_absolute(dword _in) if(!strncmp(_in,"mailto:",7)) return true; if(!strncmp(_in,"tel:",4)) return true; if(!strncmp(_in,"#",1)) return true; + if(!strncmp(_in,"WebView:",8)) return true; if(check_is_the_adress_local(_in)) return true; return false; } diff --git a/programs/cmm/pixie2/pixieskn.png b/programs/cmm/pixie2/pixieskn.png index 92c02bd666..d7c24ebed2 100644 Binary files a/programs/cmm/pixie2/pixieskn.png and b/programs/cmm/pixie2/pixieskn.png differ