forked from KolibriOS/kolibrios
HTMLv 0.8: forward button start work.
git-svn-id: svn://kolibrios.org@2605 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
parent
705460f746
commit
9fa539dadc
@ -1,10 +1,11 @@
|
||||
хх.хх.12 -- v0.80
|
||||
13.04.12 -- v0.80
|
||||
- поддержка <body> "bgcolor=" и "text=";
|
||||
- обработка перехода вверх "../";
|
||||
- jpg, gif, png открываются через kiv.
|
||||
- теперь изображения легко могут быть ссылками;
|
||||
- 2 небольших фикса для изображений, кнопки BackSpace;
|
||||
- чуток улучшена обработка урлов, содержащих #.
|
||||
- чуток улучшена обработка урлов, содержащих #;
|
||||
- заработала кнопка "Вперёд".
|
||||
|
||||
|
||||
|
||||
|
@ -15,7 +15,7 @@ dword j,
|
||||
char download_path[]="/rd/1/.download";
|
||||
//char search_path[]="http://nova.rambler.ru/search?words=";
|
||||
char search_path[]="http://nigma.ru/index.php?s=";
|
||||
char version[]=" Text-based Browser 0.78";
|
||||
char version[]=" Text-based Browser 0.80";
|
||||
|
||||
|
||||
struct TWebBrowser {
|
||||
@ -36,7 +36,7 @@ byte rez, b_text, i_text, u_text, s_text, pre_text, blq_text, li_text, link, ign
|
||||
|
||||
|
||||
dword text_colors[10],
|
||||
text_color_index = 0,
|
||||
text_color_index,
|
||||
link_color,
|
||||
bg_color=0xFFFFFF;
|
||||
|
||||
@ -108,9 +108,19 @@ void TWebBrowser::Scan(dword id) {
|
||||
break;
|
||||
case BACK:
|
||||
BrowserHistory.GoBack();
|
||||
|
||||
copystr(#URL, #editURL);
|
||||
za_kadrom = count = 0;
|
||||
if (!strcmp(get_URL_part(5),"http:"))) HttpLoad();
|
||||
ShowPage(#URL);
|
||||
return;
|
||||
case FORWARD:
|
||||
RunProgram("@notify", "Forward button is not realized yet");
|
||||
BrowserHistory.GoForward();
|
||||
|
||||
copystr(#URL, #editURL);
|
||||
za_kadrom = count = 0;
|
||||
if (!strcmp(get_URL_part(5),"http:"))) HttpLoad();
|
||||
ShowPage(#URL);
|
||||
return;
|
||||
case 054: //F5
|
||||
IF(edit1.flags == 66) break;
|
||||
@ -309,7 +319,7 @@ void TWebBrowser::ParseHTML(dword bword, fsize){
|
||||
temp = '';
|
||||
goto NEXT_MARK;
|
||||
}
|
||||
CASE '\9':
|
||||
case '\9':
|
||||
if (pre_text == 1) //èíà÷å èä¸ì íà 0x0d
|
||||
{
|
||||
tab_len=strlen(#line)/8;
|
||||
@ -712,10 +722,10 @@ void TWebBrowser::WhatTextStyle(int left1, top1, width1) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!chTag("meta"))
|
||||
if (!chTag("meta")) || (!chTag("?xml"))
|
||||
{
|
||||
META:
|
||||
if (!strcmp(#parametr, "charset=")) || (!strcmp(#parametr, "content="))
|
||||
if (!strcmp(#parametr, "charset=")) || (!strcmp(#parametr, "content=")) || (!strcmp(#parametr, "encoding="))
|
||||
{
|
||||
copystr(#options[find_symbol(#options, '=')],#options); //ïîèñê â content=
|
||||
|
||||
|
@ -2,4 +2,4 @@
|
||||
del HTMLv
|
||||
rename HTMLv.com HTMLv
|
||||
rem ..\C--\kpack HTMLv
|
||||
rem pause
|
||||
pause
|
||||
|
@ -1,36 +1,55 @@
|
||||
struct UrlsHistory {
|
||||
byte UrlHistory[6000];
|
||||
dword CurrentUrl();
|
||||
void AddUrl();
|
||||
void GoBack();
|
||||
dword CurrentUrl();
|
||||
void GoForward();
|
||||
};
|
||||
|
||||
UrlsHistory BrowserHistory;
|
||||
|
||||
void UrlsHistory::GoBack()
|
||||
{
|
||||
j = find_symbol(#UrlHistory, '|') -1; //ňĺęóůŕ˙ ńňđŕíčöŕ
|
||||
if (j<=0) return;
|
||||
UrlHistory[j] = 0x00;
|
||||
j = find_symbol(#UrlHistory, '|'); //ďđĺäűäóůŕ˙ ńňđŕíčöŕ -> îíŕ íŕě č íóćíŕ
|
||||
copystr(#UrlHistory + j, #URL);
|
||||
struct path_string {
|
||||
char Item[4096];
|
||||
};
|
||||
|
||||
copystr(#URL, #editURL);
|
||||
za_kadrom = count = 0;
|
||||
if (!strcmp(get_URL_part(5),"http:"))) HttpLoad();
|
||||
WB1.ShowPage(#URL);
|
||||
}
|
||||
|
||||
void UrlsHistory::AddUrl()
|
||||
{
|
||||
if (strcmp(BrowserHistory.CurrentUrl(), #URL)==0) return; //ĺńëč íîâűé ŕäđĺńń = ňĺęóůĺěó
|
||||
|
||||
IF (strlen(#UrlHistory)>6000) copystr(#UrlHistory+5000,#UrlHistory);
|
||||
copystr("|", #UrlHistory + strlen(#UrlHistory));
|
||||
copystr(#URL, #UrlHistory + strlen(#UrlHistory));
|
||||
}
|
||||
#define MAX_HISTORY_NUM 40
|
||||
path_string history_list[MAX_HISTORY_NUM];
|
||||
int history_num;
|
||||
int history_current;
|
||||
|
||||
dword UrlsHistory::CurrentUrl()
|
||||
{
|
||||
EAX=#UrlHistory + find_symbol(#UrlHistory, '|');
|
||||
return #history_list[history_current].Item;
|
||||
}
|
||||
|
||||
void UrlsHistory::AddUrl() //òóò íóæåí ââîäèìûé ýëåìåíò - äëÿ óíèâåðñàëüíîñòè
|
||||
{
|
||||
if (history_num>0) && (strcmp(#URL,#history_list[history_current].Item)==0) return;
|
||||
|
||||
if (history_current>=MAX_HISTORY_NUM-1)
|
||||
{
|
||||
history_current/=2;
|
||||
for (i=0; i<history_current; i++;)
|
||||
{
|
||||
copystr(#history_list[MAX_HISTORY_NUM-i].Item, #history_list[i].Item);
|
||||
}
|
||||
}
|
||||
history_current++;
|
||||
copystr(#URL,#history_list[history_current].Item);
|
||||
history_num=history_current;
|
||||
}
|
||||
|
||||
|
||||
void UrlsHistory::GoBack()
|
||||
{
|
||||
if (history_current<=2) return;
|
||||
history_current--;
|
||||
copystr(#history_list[history_current].Item,#URL);
|
||||
}
|
||||
|
||||
|
||||
void UrlsHistory::GoForward()
|
||||
{
|
||||
if (history_current==history_num) return;
|
||||
history_current++;
|
||||
copystr(#history_list[history_current].Item,#URL);
|
||||
}
|
Loading…
Reference in New Issue
Block a user