Subversion Repositories Kolibri OS

Rev

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

Rev 7970 Rev 7976
Line 590... Line 590...
590
		anchors.take_anchor_from(#new_url);
590
		anchors.take_anchor_from(#new_url);
591
	}
591
	}
Line 592... Line 592...
592
 
592
 
Line -... Line 593...
-
 
593
	history.add(#new_url);
-
 
594
 
-
 
595
	/*
-
 
596
	There could be several possible types of addresses:
-
 
597
	- cached page (only http/https)
-
 
598
	- internal page
-
 
599
	- web page
-
 
600
	- local file
-
 
601
	So we need to detect what incoming address is
-
 
602
	and then halndle it in the propper way.
593
	history.add(#new_url);
603
	*/
594
 
604
 
595
	if (pages_cache.has(#new_url)) {
605
	if (pages_cache.has(#new_url)) {
Line 596... Line 606...
596
		//CACHED PAGE
606
		//CACHED PAGE
597
		LoadInternalPage(pages_cache.current_page_buf, pages_cache.current_page_size);
607
		LoadInternalPage(pages_cache.current_page_buf, pages_cache.current_page_size);
598
 
608
 
599
	} else if (!strncmp(#new_url,"WebView:",8)) {
609
	} else if (!strncmp(#new_url,"WebView:",8)) {
600
		//INTERNAL PAGE
610
		//INTERNAL PAGE
601
		if (!strcmp(#new_url, URL_SERVICE_HOMEPAGE)) LoadInternalPage(#homepage, sizeof(homepage));
611
		if (streq(#new_url, URL_SERVICE_HOMEPAGE)) LoadInternalPage(#buidin_page_home, sizeof(buidin_page_home));
Line 602... Line 612...
602
		else if (!strcmp(#new_url, URL_SERVICE_HELP)) LoadInternalPage(#help, sizeof(help));
612
		else if (streq(#new_url, URL_SERVICE_HELP)) LoadInternalPage(#buidin_page_help, sizeof(buidin_page_help));
603
		else if (!strcmp(#new_url, URL_SERVICE_HISTORY)) ShowHistory();
613
		else if (streq(#new_url, URL_SERVICE_HISTORY)) ShowHistory();
604
		else LoadInternalPage(#page_not_found, sizeof(page_not_found));
614
		else LoadInternalPage(#buidin_page_error, sizeof(buidin_page_error));
605
 
615
 
Line 619... Line 629...
619
 
629
 
Line 620... Line 630...
620
		DrawOmnibox();
630
		DrawOmnibox();
621
 
631
 
622
		if (!http.transfer) {
632
		if (!http.transfer) {
623
			StopLoading();
633
			StopLoading();
624
			LoadInternalPage(#page_not_found, sizeof(page_not_found));
634
			LoadInternalPage(#buidin_page_error, sizeof(buidin_page_error));
625
		}
635
		}
626
	} else {
636
	} else {
627
		//LOCAL PAGE
637
		//LOCAL PAGE
Line 631... Line 641...
631
			unz_id = RunProgram("/sys/unz", sprintf(#param, "-o \"/tmp0/1/temp\" -h \"%s\"", #new_url));
641
			unz_id = RunProgram("/sys/unz", sprintf(#param, "-o \"/tmp0/1/temp\" -h \"%s\"", #new_url));
632
			while (GetProcessSlot(unz_id)) pause(2);
642
			while (GetProcessSlot(unz_id)) pause(2);
633
			strcpy(#new_url, "/tmp0/1/temp/word/document.xml");
643
			strcpy(#new_url, "/tmp0/1/temp/word/document.xml");
634
		} 
644
		} 
635
		if (!GetLocalFileData(#new_url)) {
645
		if (!GetLocalFileData(#new_url)) {
636
			LoadInternalPage(#page_not_found, sizeof(page_not_found));
646
			LoadInternalPage(#buidin_page_error, sizeof(buidin_page_error));
637
		}
647
		}
638
	}
648
	}
639
}
649
}
Line 748... Line 758...
748
	}
758
	}
749
}
759
}
Line 750... Line 760...
750
 
760
 
751
void LoadInternalPage(dword _bufdata, _in_bufsize){
761
void LoadInternalPage(dword _bufdata, _in_bufsize){
752
	if (!_bufdata) || (!_in_bufsize) {
762
	if (!_bufdata) || (!_in_bufsize) {
753
		LoadInternalPage(#page_not_found, sizeof(page_not_found));
763
		LoadInternalPage(#buidin_page_error, sizeof(buidin_page_error));
754
	} else {
764
	} else {
755
		WB1.list.first = 0; //scroll page to the top
765
		WB1.list.first = 0; //scroll page to the top
756
		DrawOmnibox();
766
		DrawOmnibox();
757
		if(!strrchr(#editURL, '#')) {
767
		if(!strrchr(#editURL, '#')) {