WebView 1.73: user can download link contents

git-svn-id: svn://kolibrios.org@7208 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
Kirill Lipatov (Leency) 2018-03-23 15:04:20 +00:00
parent e974c281d5
commit 2644460def
2 changed files with 18 additions and 8 deletions

View File

@ -295,7 +295,8 @@ void TWebBrowser::SetStyle() {
debugln("Document has no information about encoding, UTF will be used");
}
if (opened) {
if (!strcmp(#header, #version)) {
if (strcmp(#header, #version) != 0) {
debugln("!!!!!!!!!!!!!!!!!!!!!!");
ChangeCharset(charsets[cur_encoding], "CP866", #header);
sprintf(#header, "%s - %s", #header, #version);
}
@ -355,7 +356,7 @@ void TWebBrowser::SetStyle() {
if (istag("blockquote")) { style.blq = opened; return; }
if (istag("pre")) || (istag("code")) { style.pre = opened; return; }
if (istag("img")) { ImgCache.Images( left1, draw_y, WB1.list.w); return; }
if (istag("h1")) || (istag("h2")) || (istag("h3")) || (istag("h4")) || (istag("caption")) {
if (istag("h1")) || (istag("h2")) || (istag("h3")) || (istag("caption")) {
style.h = opened;
if (opened)
{

View File

@ -31,7 +31,7 @@
char homepage[] = FROM "html\\homepage.htm""\0";
#ifdef LANG_RUS
char version[]="’¥ªáâ®¢ë© ¡à ã§¥à 1.72";
char version[]="’¥ªáâ®¢ë© ¡à ã§¥à 1.73";
?define IMAGES_CACHE_CLEARED "Šíè ª à⨭®ª ®ç¨é¥­"
?define T_LAST_SLIDE "<EFBFBD>â® ¯®á«¥¤­¨© á« ©¤"
char loading[] = "‡ £à㧪  áâà ­¨æë...<br>";
@ -43,9 +43,10 @@ char rmb_menu[] =
ˆáâ®à¨ï
Œ¥­¥¤¦¥à § £à㧮ª";
char link_menu[] =
"Š®¯¨à®¢ âì áá뫪ã";
"Š®¯¨à®¢ âì áá뫪ã
ª ç âì ᮤ¥à¦¨¬®¥ áá뫪¨";
#else
char version[]="Text-based Browser 1.72";
char version[]="Text-based Browser 1.73";
?define IMAGES_CACHE_CLEARED "Images cache cleared"
?define T_LAST_SLIDE "This slide is the last"
char loading[] = "Loading...<br>";
@ -57,7 +58,8 @@ Edit source
History
Download Manager";
char link_menu[] =
"Copy link";
"Copy link
Download link contents";
#endif
@ -98,7 +100,8 @@ enum {
VIEW_HISTORY,
//FREE_IMG_CACHE,
DOWNLOAD_MANAGER,
COPY_LINK=1200
COPY_LINK=1200,
DOWNLOAD_LINK_CONTENTS,
};
#include "..\TWB\TWB.c"
@ -378,6 +381,12 @@ void ProcessEvent(dword id__)
Clipboard__CopyText(PageLinks.GetURL(PageLinks.active));
notify("'URL copied to clipboard'O");
return;
case DOWNLOAD_LINK_CONTENTS:
if (!downloader_opened) {
strcpy(#downloader_edit, PageLinks.GetURL(PageLinks.active));
CreateThread(#Downloader,#downloader_stak+4092);
}
return;
}
}
@ -600,7 +609,7 @@ void EventShowPageMenu(dword _left, _top)
void EventShowLinkMenu(dword _left, _top)
{
menu.show(Form.left+_left-6,Form.top+_top+skin_height+3, 180, #link_menu, COPY_LINK);
menu.show(Form.left+_left-6,Form.top+_top+skin_height+3, 220, #link_menu, COPY_LINK);
}