WebView 1.7: a lot of various fixes: parsing tag, parsing comment, displaying '<' and '>' symbols in source code view, do not allow multiple downloaders. Thanks hidnplayr for reporting.

git-svn-id: svn://kolibrios.org@6986 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
Kirill Lipatov (Leency) 2017-09-17 12:35:45 +00:00
parent 5286e836d2
commit 6c90f5d75e
4 changed files with 35 additions and 9 deletions

View File

@ -180,8 +180,13 @@ void TWebBrowser::Prepare(){
bufpos++;
if (!strncmp(bufpos,"!--",3))
{
if (!strncmp(bufpos,"-->",3)) || (bufpointer + bufsize <= bufpos) break;
bufpos++;
bufpos+=3;
while (strncmp(bufpos,"-->",3)!=0) && (bufpos < bufpointer + bufsize)
{
bufpos++;
}
bufpos+=3;
break;
}
tag = attr = tagparam = ignor_param = NULL;
while (ESBYTE[bufpos] !='>') && (bufpos < bufpointer + bufsize) //ïîëó÷àåì òåã è åãî ïàðàìåòðû

View File

@ -14,7 +14,7 @@ unsigned int GetNextParam()
if (kavichki)
{
i=strrchr(#tagparam, kavichki);
i = strrchr(#tagparam, kavichki);
strlcpy(#val, #tagparam + i, sizeof(val));
}
else
@ -24,6 +24,7 @@ unsigned int GetNextParam()
strlcpy(#val, #tagparam + i, sizeof(val));
WHILE (val[0] == ' ') strcpy(#val, #val+1);
ESBYTE[strchr(#val, ' ')] = NULL;
}
tagparam[i] = 0x00;

View File

@ -30,7 +30,7 @@
char homepage[] = FROM "html\\homepage.htm""\0";
#ifdef LANG_RUS
char version[]="’¥ªáâ®¢ë© ¡à ã§¥à 1.62";
char version[]="’¥ªáâ®¢ë© ¡à ã§¥à 1.7";
?define IMAGES_CACHE_CLEARED "Šíè ª à⨭®ª ®ç¨é¥­"
?define T_LAST_SLIDE "<EFBFBD>â® ¯®á«¥¤­¨© á« ©¤"
char loading[] = "‡ £à㧪  áâà ­¨æë...<br>";
@ -43,7 +43,7 @@ char rmb_menu[] =
Žç¨áâ¨âì ªíè ª à⨭®ª
Œ¥­¥¤¦¥à § £à㧮ª";
#else
char version[]="Text-based Browser 1.62";
char version[]="Text-based Browser 1.7";
?define IMAGES_CACHE_CLEARED "Images cache cleared"
?define T_LAST_SLIDE "This slide is the last"
char loading[] = "Loading...<br>";
@ -569,10 +569,13 @@ void ClickLink()
if (UrlExtIs(".png")==true) || (UrlExtIs(".gif")==true) || (UrlExtIs(".jpg")==true)
|| (UrlExtIs(".zip")==true) || (UrlExtIs(".kex")==true) || (UrlExtIs(".pdf")==true)
|| (UrlExtIs(".7z")==true) {
strcpy(#downloader_edit, #URL);
CreateThread(#Downloader,#downloader_stak+4092);
strcpy(#editURL, history.current());
strcpy(#URL, history.current());
if (!downloader_opened) {
strcpy(#downloader_edit, #URL);
CreateThread(#Downloader,#downloader_stak+4092);
strcpy(#editURL, history.current());
strcpy(#URL, history.current());
}
else notify("'WebView\nPlease, start a new download only when previous ended.'Et");
return;
}
}

View File

@ -19,17 +19,25 @@ dword ShowSource()
switch (ww)
{
case '<':
if (mode == COMMENT)
{
strcpy(new_buf, "&lt;");
new_buf+=4;
break;
}
if (ESBYTE[i+1]=='!') && (ESBYTE[i+2]=='-') && (ESBYTE[i+3]=='-')
{
strcpy(new_buf, "<font color=#bbb>&lt;");
new_buf+=21;
mode = COMMENT;
break;
}
if (mode != COMMENT)
{
strcpy(new_buf, "<font color=#00f>&lt;");
new_buf+=21;
mode = TAG;
break;
}
break;
case '>':
@ -38,18 +46,27 @@ dword ShowSource()
strcpy(new_buf, "&quot;</font>");
new_buf+=13;
mode = TAG;
break;
}
if (mode == COMMENT) && (ESBYTE[i-1]=='-') && (ESBYTE[i-2]=='-')
{
strcpy(new_buf, "&gt;</font>");
new_buf+=11;
mode = TEXT;
break;
}
if (mode == COMMENT)
{
strcpy(new_buf, "&gt;");
new_buf+=4;
break;
}
if (mode == TAG)
{
strcpy(new_buf, "&gt;</font>");
new_buf+=11;
mode = TEXT;
break;
}
break;
case '\"':