WebView 1.0 Beta 5: fixes in ViewSource
git-svn-id: svn://kolibrios.org@4719 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
parent
cb9906f10d
commit
4de8ce80c2
@ -29,14 +29,14 @@
|
|||||||
char homepage[] = FROM "html\homepage.htm";
|
char homepage[] = FROM "html\homepage.htm";
|
||||||
|
|
||||||
#ifdef LANG_RUS
|
#ifdef LANG_RUS
|
||||||
char version[]=" ’¥ªáâ®¢ë© ¡à 㧥à 1.0 Beta 4";
|
char version[]=" ’¥ªáâ®¢ë© ¡à 㧥à 1.0 Beta 5";
|
||||||
?define IMAGES_CACHE_CLEARED "Šíè ª à⨮ª ®ç¨é¥"
|
?define IMAGES_CACHE_CLEARED "Šíè ª à⨮ª ®ç¨é¥"
|
||||||
?define T_LAST_SLIDE "<EFBFBD>â® ¯®á«¥¤¨© á« ©¤"
|
?define T_LAST_SLIDE "<EFBFBD>â® ¯®á«¥¤¨© á« ©¤"
|
||||||
char loading[] = "‡ £à㧪 áâà ¨æë...<br>";
|
char loading[] = "‡ £à㧪 áâà ¨æë...<br>";
|
||||||
char page_not_found[] = FROM "html\page_not_found_ru.htm";
|
char page_not_found[] = FROM "html\page_not_found_ru.htm";
|
||||||
char accept_language[]= "Accept-Language: ru\n";
|
char accept_language[]= "Accept-Language: ru\n";
|
||||||
#else
|
#else
|
||||||
char version[]=" Text-based Browser 1.0 Beta 4";
|
char version[]=" Text-based Browser 1.0 Beta 5";
|
||||||
?define IMAGES_CACHE_CLEARED "Images cache cleared"
|
?define IMAGES_CACHE_CLEARED "Images cache cleared"
|
||||||
?define T_LAST_SLIDE "This slide is the last"
|
?define T_LAST_SLIDE "This slide is the last"
|
||||||
char loading[] = "Loading...<br>";
|
char loading[] = "Loading...<br>";
|
||||||
@ -390,6 +390,7 @@ void Scan(int id)
|
|||||||
return;
|
return;
|
||||||
case 052: //F3
|
case 052: //F3
|
||||||
ShowSource();
|
ShowSource();
|
||||||
|
WB1.Parse();
|
||||||
break;
|
break;
|
||||||
case 053: //F4
|
case 053: //F4
|
||||||
if (strncmp(#URL,"http:",5)==0)
|
if (strncmp(#URL,"http:",5)==0)
|
||||||
|
@ -1,8 +1,10 @@
|
|||||||
|
enum { TAG, OPTION_VALUE, TEXT, COMMENT };
|
||||||
|
|
||||||
//you are butifull, you are butifull
|
//you are butifull, you are butifull
|
||||||
dword ShowSource()
|
dword ShowSource()
|
||||||
{
|
{
|
||||||
dword new_buf, new_buf_start, i;
|
dword new_buf, new_buf_start, i;
|
||||||
byte ww, param, comment;
|
byte ww, mode;
|
||||||
|
|
||||||
if (souce_mode) return;
|
if (souce_mode) return;
|
||||||
souce_mode = true;
|
souce_mode = true;
|
||||||
@ -19,46 +21,51 @@ dword ShowSource()
|
|||||||
{
|
{
|
||||||
strcat(new_buf, "<font color=#ccc><");
|
strcat(new_buf, "<font color=#ccc><");
|
||||||
new_buf+=20;
|
new_buf+=20;
|
||||||
|
mode = COMMENT;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
strcat(new_buf, "<font color=#00f><");
|
strcat(new_buf, "<font color=#00f><");
|
||||||
new_buf+=20;
|
new_buf+=20;
|
||||||
|
mode = TAG;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case '>':
|
case '>':
|
||||||
if (!param) //fix non-closed quote
|
if (mode == OPTION_VALUE) //fix non-closed quote in TAG
|
||||||
{
|
{
|
||||||
param = 1;
|
|
||||||
strcat(new_buf, ""</font>");
|
strcat(new_buf, ""</font>");
|
||||||
new_buf+=12;
|
new_buf+=12;
|
||||||
|
mode = TAG;
|
||||||
}
|
}
|
||||||
if (ESBYTE[i-1]=='-') && (ESBYTE[i-2]=='-')
|
if (mode == COMMENT) && (ESBYTE[i-1]=='-') && (ESBYTE[i-2]=='-')
|
||||||
{
|
{
|
||||||
strcat(new_buf, "></font>");
|
strcat(new_buf, "></font>");
|
||||||
new_buf+=10;
|
new_buf+=10;
|
||||||
|
mode = TEXT;
|
||||||
}
|
}
|
||||||
else
|
if (mode == TAG)
|
||||||
{
|
{
|
||||||
strcat(new_buf, "></font>");
|
strcat(new_buf, "></font>");
|
||||||
new_buf+=10;
|
new_buf+=10;
|
||||||
|
mode = TEXT;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case '\"':
|
case '\"':
|
||||||
case '\'':
|
case '\'':
|
||||||
if (param)
|
if (mode == TAG)
|
||||||
{
|
{
|
||||||
param = 0;
|
|
||||||
strcat(new_buf, "<font color=#f0f>"");
|
strcat(new_buf, "<font color=#f0f>"");
|
||||||
new_buf+=22;
|
new_buf+=22;
|
||||||
|
mode = OPTION_VALUE;
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
else
|
if (mode == OPTION_VALUE)
|
||||||
{
|
{
|
||||||
param = 1;
|
|
||||||
strcat(new_buf, ""</font>");
|
strcat(new_buf, ""</font>");
|
||||||
new_buf+=12;
|
new_buf+=12;
|
||||||
}
|
mode = TAG;
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
default:
|
default:
|
||||||
chrcat(new_buf, ww);
|
chrcat(new_buf, ww);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user