281,7 → 281,7 |
{ |
KillProcess(downloader_id); //óáèâàåì ñòàðûé ïðîöåññ |
DeleteFile(#download_path); |
IF (URL[strlen(#URL)-1]=='/') URL[strlen(#URL)-1]=''; |
IF (URL[strlen(#URL)-1]=='/') URL[strlen(#URL)-1]=NULL; |
downloader_id = RunProgram("/sys/network/downloader", #URL); |
//Browser Hack v2.0 |
Pause(60); |
344,7 → 344,7 |
li_text = link = ignor_text = text_color_index = text_colors[0] = li_tab = 0; //îáíóëÿåì òåãè |
link_color = 0x0000FF; |
bg_color = 0xFFFFFF; |
line = ''; |
line = NULL; |
strcpy(#page_links,"|"); |
strcpy(#header, #version); |
|
364,7 → 364,7 |
case 0x0a: |
if (pre_text) |
{ |
bukva = temp = ''; |
bukva = temp = NULL; |
goto NEXT_MARK; |
} |
case '\9': |
402,26 → 402,9 |
strcat(#tag, #bukva); |
} |
|
for (j=0; unicode_tags[j]!=0; j+=2;) |
{ |
if (!strcmp(#tag, unicode_tags[j])) |
{ |
strcat(#line, unicode_tags[j+1]); |
break 1; |
} |
} |
|
rez = atoi(#tag + 1) - 1040; |
if (tag[1] == '1') && (rez>=0) && (rez<=72) && (strlen(#tag) == 5) |
{ |
bukva = unicode_chars[rez]; |
//GOTO DEFAULT_MARK; //îáðàáàòûâàåì áóêâó ëó÷øå íàâåðíî strcat(#line, unicode_tags[j+1]); è break 1; |
strcat(#line, #bukva); |
bukva = GetUnicodeSymbol(); |
if (bukva) goto DEFAULT_MARK; |
break; |
} |
|
strcat(#line,#tag); //âûâîäèì íà ýêðàí íåîáðàáîòàííûé òåã, òàê áðàóçåðû çà÷åì-òî äåëàþò |
break; |
case '<': |
bword++; //ïðîìîòàåì ñèìâîë < |
tag = parametr = tagparam = ignor_param = NULL; |
516,7 → 499,7 |
if (anchor) |
{ |
//åñëè ïîñðåäè òåêñòà ïîÿâèòñÿ íîâûé ÿêîðü - áóäåò áåñêîíå÷íûé öèêë |
anchor=''; |
anchor=NULL; |
lines.first=anchor_line_num; |
ParseHTML(buf); |
} |
597,10 → 580,10 |
rez = 0; |
strcpy(#tag, #tag+1); |
} |
else |
rez = 1; |
else rez = 1; |
|
if (!chTag("html")) { |
if (!chTag("html")) |
{ |
IF(!strcmp(#URL + strlen(#URL) - 4, ".mht")) IF (rez==0) ignor_text = 1; ELSE ignor_text = 0; |
return; |
} |
609,14 → 592,8 |
|
if(!chTag("title")) |
{ |
if (rez) |
{ |
header=0; |
} |
else //òåã çàêðûëñÿ - âûâåëè ñòðîêó |
{ |
if (stroka==0) DrawTitle(#header); |
} |
if (rez) header=NULL; |
else if (!stroka) DrawTitle(#header); //òåã çàêðûëñÿ - âûâåëè ñòðîêó |
return; |
} |
|
630,31 → 607,17 |
|
if (anchor) && (!strcmp(#parametr, "id=")) //î÷åíü ïëîõî!!! ïîòîìó ÷òî åñëè íå ïîñëåäíèé òåã, ðàáîòàòü íå áóäåò |
{ |
if (!strcmp(#anchor, #options)) |
{ |
anchor_line_num=lines.first+stroka; |
if (!strcmp(#anchor, #options)) anchor_line_num=lines.first+stroka; |
} |
} |
|
if (!chTag("body")) |
{ |
BODY_MARK: |
do{ |
if (!strcmp(#parametr, "link=")) link_color = GetColor(#options); |
if (!strcmp(#parametr, "text=")) text_colors[0]=GetColor(#options); |
if (!strcmp(#parametr, "bgcolor=")) bg_color=GetColor(#options); |
} while(GetNextParam()); |
|
if (!strcmp(#parametr, "link=")) |
link_color = GetColor(#options); |
|
if (!strcmp(#parametr, "text=")) |
text_colors[0]=GetColor(#options); |
|
if (!strcmp(#parametr, "bgcolor=")) |
bg_color=GetColor(#options); |
|
IF(tagparam) |
{ |
GetNextParam(); |
GOTO BODY_MARK; |
} |
|
return; |
} |
|
662,10 → 625,9 |
{ |
if (rez) |
{ |
|
if (link) IF(text_color_index > 0) text_color_index--; //åñëè ïðåäûäóùèé òåã à íå áûë çàêðûò |
|
_A_MARK: |
do{ |
if (!strcmp(#parametr, "href=")) |
{ |
if (stroka - 1 > lines.visible) || (stroka < -2) return; |
686,12 → 648,8 |
anchor_line_num=lines.first+stroka; |
} |
} |
if (tagparam) |
{ |
GetNextParam(); |
GOTO _A_MARK; |
} while(GetNextParam()); |
} |
} |
else { |
link = 0; |
IF(text_color_index > 0) text_color_index--; |
707,16 → 665,13 |
text_color_index++; |
text_colors[text_color_index] = text_colors[text_color_index-1]; |
|
COL_MARK: |
do{ |
if (strcmp(#parametr, "color=") == 0) //&& (parametr[1] == '#') |
{ |
text_colors[text_color_index] = GetColor(#options); |
} |
IF(tagparam) { |
GetNextParam(); |
GOTO COL_MARK; |
} while(GetNextParam()); |
} |
} |
else |
if (text_color_index > 0) text_color_index--; |
return; |
745,7 → 700,7 |
return; |
} |
else |
oldtag=''; |
oldtag=NULL; |
|
if (!chTag("b")) || (!chTag("strong")) || (!chTag("big")) { |
b_text = rez; |
795,7 → 750,7 |
if (!chTag("img")) |
{ |
if (GetFileInfo(libimg)<>0) return; //åñëè áèáëèîòåêè íåò |
IMG_TAG: |
do{ |
if (!strcmp(#parametr,"src=")) //íàäî îáúåäèíèòü ñ GetNewUrl() |
{ |
if (downloader_id) strcpy(#temp, #history_list[history_current-1].Item); |
816,11 → 771,7 |
strcat(#alt, "]"); |
} |
|
IF(tagparam) |
{ |
GetNextParam(); |
GOTO IMG_TAG; |
} |
} while(GetNextParam()); |
|
if (!image) |
{ |
855,7 → 806,7 |
|
if (!chTag("meta")) || (!chTag("?xml")) |
{ |
META: |
do{ |
if (!strcmp(#parametr, "charset=")) || (!strcmp(#parametr, "content=")) || (!strcmp(#parametr, "encoding=")) |
{ |
strcpy(#options, #options[strrchr(#options, '=')]); //ïîèñê â content= |
864,11 → 815,7 |
if (!strcmp(#options, "koi8-r")) || (!strcmp(#options, "koi8-u")) ReadHtml(_KOI); |
if (!strcmp(#options, "dos")) || (!strcmp(#options, "cp-866")) ReadHtml(_DOS); |
} |
if (tagparam) |
{ |
GetNextParam(); |
goto META; |
} |
} while(GetNextParam()); |
return; |
} |
} |