Subversion Repositories Kolibri OS

Rev

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

Rev 5678 Rev 5718
Line 22... Line 22...
22
	void AddLink();
22
	void AddLink();
23
	void AddText();
23
	void AddText();
24
	dword GetURL();
24
	dword GetURL();
25
	void Clear();
25
	void Clear();
26
	void GetAbsoluteURL();
26
	void GetAbsoluteURL();
-
 
27
	int UrlAbsolute();
27
};
28
} PageLinks;
Line 28... Line 29...
28
 
29
 
29
void LinksArray::AddLink(dword new_link, int link_x, link_y)
30
void LinksArray::AddLink(dword new_link, int link_x, link_y)
30
{
31
{
31
	links[count].x = link_x;
32
	links[count].x = link_x;
Line 96... Line 97...
96
		DrawBar(status_text.start_x, status_text.start_y, status_text.area_size_x, 9, col_bg);
97
		DrawBar(status_text.start_x, status_text.start_y, status_text.area_size_x, 9, col_bg);
97
		active = -1;
98
		active = -1;
98
	}
99
	}
99
}
100
}
Line -... Line 101...
-
 
101
 
-
 
102
int LinksArray::UrlAbsolute(dword in_URL)
-
 
103
{
-
 
104
	if(!strncmp(in_URL,"http:",5)) return 1;
100
 
105
	if(!strncmp(in_URL,"https:",6)) return 1;
-
 
106
	if(!strncmp(in_URL,"mailto:",7)) return 1;
-
 
107
	if(!strncmp(in_URL,"ftp:",4)) return 1;
-
 
108
	if(!strncmp(in_URL,"WebView:",8)) return 1;
-
 
109
	if(!strncmp(in_URL,"/sys/",5)) return 1;
-
 
110
	if(!strncmp(in_URL,"/hd/",4)) return 1;
-
 
111
	if(!strncmp(in_URL,"/fd/",4)) return 1;
-
 
112
	if(!strncmp(in_URL,"/rd/",4)) return 1;
-
 
113
	if(!strncmp(in_URL,"/tmp/",5)) return 1;
-
 
114
	if(!strncmp(in_URL,"/cd/",4)) return 1;
101
char *ABSOLUTE_LINKS[]={ "http:", "mailto:", "ftp:", "/sys/", 
115
	if(!strncmp(in_URL,"/bd/",4)) return 1;
-
 
116
	if(!strncmp(in_URL,"/usbhd/",7)) return 1;
-
 
117
	if(!strncmp(in_URL,"/kolibrios/",11)) return 1;
-
 
118
	return 0;
-
 
119
}
102
"/kolibrios/", "/rd/", "/bd", "/hd", "/cd", "/tmp", "/usbhd", "WebView:", 0};
120
 
-
 
121
void LinksArray::GetAbsoluteURL(dword in_URL)
103
void LinksArray::GetAbsoluteURL(dword in_URL){
122
{
104
	int i, len;
123
	int i;
105
	dword orig_URL = in_URL;
124
	dword orig_URL = in_URL;
Line 106... Line -...
106
	char newurl[sizeof(URL)];
-
 
107
	
-
 
108
	for (i=0; ABSOLUTE_LINKS[i]; i++)
-
 
109
	{
125
	char newurl[sizeof(URL)];
110
		len=strlen(ABSOLUTE_LINKS[i]);
126
 
111
		if (!strcmpn(in_URL, ABSOLUTE_LINKS[i], len)) return;
127
	if (UrlAbsolute(in_URL)) return;
112
	}
128
	
Line 113... Line 129...
113
	IF (!strcmpn(in_URL,"./", 2)) in_URL+=2;
129
	IF (!strcmpn(in_URL,"./", 2)) in_URL+=2;
114
	strcpy(#newurl, BrowserHistory.CurrentUrl());
130
	strcpy(#newurl, BrowserHistory.CurrentUrl());
Line 139... Line 155...
139
	strcat(#newurl, in_URL);
155
	strcat(#newurl, in_URL);
140
	strcpy(orig_URL, #newurl);
156
	strcpy(orig_URL, #newurl);
141
}
157
}
Line 142... Line -...
142
 
-
 
143
 
-