forked from KolibriOS/kolibrios
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:
parent
5286e836d2
commit
6c90f5d75e
@ -180,9 +180,14 @@ void TWebBrowser::Prepare(){
|
||||
bufpos++;
|
||||
if (!strncmp(bufpos,"!--",3))
|
||||
{
|
||||
if (!strncmp(bufpos,"-->",3)) || (bufpointer + bufsize <= bufpos) break;
|
||||
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) //ïîëó÷àåì òåã è åãî ïàðàìåòðû
|
||||
{
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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) {
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
@ -19,17 +19,25 @@ dword ShowSource()
|
||||
switch (ww)
|
||||
{
|
||||
case '<':
|
||||
if (mode == COMMENT)
|
||||
{
|
||||
strcpy(new_buf, "<");
|
||||
new_buf+=4;
|
||||
break;
|
||||
}
|
||||
if (ESBYTE[i+1]=='!') && (ESBYTE[i+2]=='-') && (ESBYTE[i+3]=='-')
|
||||
{
|
||||
strcpy(new_buf, "<font color=#bbb><");
|
||||
new_buf+=21;
|
||||
mode = COMMENT;
|
||||
break;
|
||||
}
|
||||
if (mode != COMMENT)
|
||||
{
|
||||
strcpy(new_buf, "<font color=#00f><");
|
||||
new_buf+=21;
|
||||
mode = TAG;
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case '>':
|
||||
@ -38,18 +46,27 @@ dword ShowSource()
|
||||
strcpy(new_buf, ""</font>");
|
||||
new_buf+=13;
|
||||
mode = TAG;
|
||||
break;
|
||||
}
|
||||
if (mode == COMMENT) && (ESBYTE[i-1]=='-') && (ESBYTE[i-2]=='-')
|
||||
{
|
||||
strcpy(new_buf, "></font>");
|
||||
new_buf+=11;
|
||||
mode = TEXT;
|
||||
break;
|
||||
}
|
||||
if (mode == COMMENT)
|
||||
{
|
||||
strcpy(new_buf, ">");
|
||||
new_buf+=4;
|
||||
break;
|
||||
}
|
||||
if (mode == TAG)
|
||||
{
|
||||
strcpy(new_buf, "></font>");
|
||||
new_buf+=11;
|
||||
mode = TEXT;
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case '\"':
|
||||
|
Loading…
Reference in New Issue
Block a user