Subversion Repositories Kolibri OS

Rev

Rev 2418 | Go to most recent revision | Blame | Last modification | View Log | Download | RSS feed

  1. struct UrlsHistory {
  2.         byte UrlHistory[6000]; 
  3.         void AddUrl();
  4.         void GoBack();
  5.         dword CurrentUrl();
  6. };
  7.  
  8. UrlsHistory BrowserHistory;
  9.  
  10. void UrlsHistory::GoBack()
  11. {
  12.         j = find_symbol(#UrlHistory, '|') -1; //òåêóùàÿ ñòðàíèöà
  13.         if (j<=0) return;
  14.         UrlHistory[j] = 0x00;
  15.         j = find_symbol(#UrlHistory, '|'); //ïðåäûäóùàÿ ñòðàíèöà -> îíà íàì è íóæíà
  16.         copystr(#UrlHistory + j, #URL);
  17.         copystr(#URL, #editURL);
  18.         if (!strcmp(get_URL_part(5),"http:"))) HttpLoad();
  19.         WB1.ShowPage(#URL);
  20. }
  21.  
  22. void UrlsHistory::AddUrl()
  23. {
  24.         if (strcmp(BrowserHistory.CurrentUrl(), #URL)==0) return; //åñëè íîâûé àäðåññ = òåêóùåìó
  25.        
  26.         IF (strlen(#UrlHistory)>6000) copystr(#UrlHistory+5000,#UrlHistory);
  27.         copystr("|", #UrlHistory + strlen(#UrlHistory));
  28.         copystr(#URL, #UrlHistory + strlen(#UrlHistory));
  29. }
  30.  
  31. dword UrlsHistory::CurrentUrl()
  32. {
  33.         EAX=#UrlHistory + find_symbol(#UrlHistory, '|');
  34. }
  35.