Subversion Repositories Kolibri OS

Rev

Rev 2433 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 2433 Rev 2605
Line 1... Line 1...
1
struct UrlsHistory {
1
struct UrlsHistory {
2
	byte UrlHistory[6000];	
2
	dword CurrentUrl();
3
	void AddUrl();
3
	void AddUrl();
4
	void GoBack();
4
	void GoBack();
5
	dword CurrentUrl();
5
	void GoForward();
6
};
6
};
Line 7... Line 7...
7
 
7
 
Line 8... Line 8...
8
UrlsHistory BrowserHistory;
8
UrlsHistory BrowserHistory;
-
 
9
 
9
 
10
struct path_string {
10
void UrlsHistory::GoBack()
-
 
11
{
-
 
12
	j = find_symbol(#UrlHistory, '|') -1; //òåêóùàÿ ñòðàíèöà
-
 
13
	if (j<=0) return;
-
 
14
	UrlHistory[j] = 0x00;
-
 
Line 15... Line 11...
15
	j = find_symbol(#UrlHistory, '|'); //ïðåäûäóùàÿ ñòðàíèöà -> îíà íàì è íóæíà
11
char Item[4096];
-
 
12
};
-
 
13
 
16
	copystr(#UrlHistory + j, #URL);
14
#define MAX_HISTORY_NUM 40
-
 
15
path_string history_list[MAX_HISTORY_NUM];
17
	
16
int history_num;
-
 
17
int history_current;
18
	copystr(#URL, #editURL);
18
 
19
	za_kadrom = count = 0;
19
dword UrlsHistory::CurrentUrl()
Line 20... Line 20...
20
	if (!strcmp(get_URL_part(5),"http:"))) HttpLoad();
20
{
21
	WB1.ShowPage(#URL);
21
	return #history_list[history_current].Item;
22
}
22
}
Line 23... Line 23...
23
 
23
 
-
 
24
void UrlsHistory::AddUrl() //òóò íóæåí ââîäèìûé ýëåìåíò - äëÿ óíèâåðñàëüíîñòè
-
 
25
{
24
void UrlsHistory::AddUrl()
26
	if (history_num>0) && (strcmp(#URL,#history_list[history_current].Item)==0) return;
-
 
27
		
-
 
28
	if (history_current>=MAX_HISTORY_NUM-1)
-
 
29
	{
-
 
30
		history_current/=2;
-
 
31
		for (i=0; i
25
{
32
		{
-
 
33
			copystr(#history_list[MAX_HISTORY_NUM-i].Item, #history_list[i].Item);
26
	if (strcmp(BrowserHistory.CurrentUrl(), #URL)==0) return; //åñëè íîâûé àäðåññ = òåêóùåìó
34
		}	
Line -... Line 35...
-
 
35
	}
-
 
36
	history_current++;
-
 
37
	copystr(#URL,#history_list[history_current].Item);
-
 
38
	history_num=history_current;
-
 
39
}
-
 
40
 
-
 
41
 
-
 
42
void UrlsHistory::GoBack()
-
 
43
{
27
	
44
	if (history_current<=2) return;
28
	IF (strlen(#UrlHistory)>6000) copystr(#UrlHistory+5000,#UrlHistory);
45
	history_current--;
-
 
46
	copystr(#history_list[history_current].Item,#URL);
-
 
47
}
29
	copystr("|", #UrlHistory + strlen(#UrlHistory));
48
 
30
	copystr(#URL, #UrlHistory + strlen(#UrlHistory));
49