Subversion Repositories Kolibri OS

Rev

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

Rev 5978 Rev 5990
Line 18... Line 18...
18
	void Hover();
18
	void Hover();
19
	void AddLink();
19
	void AddLink();
20
	void AddText();
20
	void AddText();
21
	dword GetURL();
21
	dword GetURL();
22
	void Clear();
22
	void Clear();
23
	void GetAbsoluteURL();
-
 
24
	int UrlAbsolute();
-
 
25
} PageLinks;
23
} PageLinks;
Line 26... Line 24...
26
 
24
 
27
void LinksArray::AddLink(dword lpath, int link_x, link_y)
25
void LinksArray::AddLink(dword lpath, int link_x, link_y)
28
{
26
{
Line 96... Line 94...
96
		if (links[active].underline) DrawBar(links[active].x, WBY + links[active].y  + links[active].h,links[active].w, WB1.DrawBuf.zoom, link_col_in);
94
		if (links[active].underline) DrawBar(links[active].x, WBY + links[active].y  + links[active].h,links[active].w, WB1.DrawBuf.zoom, link_col_in);
97
		DrawBar(status_text.start_x, status_text.start_y, status_text.area_size_x, 9, col_bg);
95
		DrawBar(status_text.start_x, status_text.start_y, status_text.area_size_x, 9, col_bg);
98
		active = -1;
96
		active = -1;
99
	}
97
	}
100
}
98
}
101
 
-
 
102
int LinksArray::UrlAbsolute(dword in_URL)
-
 
103
{
-
 
104
	if(!strncmp(in_URL,"http:",5)) return 1;
-
 
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;
-
 
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
}
-
 
120
 
-
 
121
void LinksArray::GetAbsoluteURL(dword in_URL)
-
 
122
{
-
 
123
	int i;
-
 
124
	dword orig_URL = in_URL;
-
 
125
	char newurl[sizeof(URL)];
-
 
126
 
-
 
127
	if (UrlAbsolute(in_URL)) return;
-
 
128
	
-
 
129
	IF (!strcmpn(in_URL,"./", 2)) in_URL+=2;
-
 
130
	if (!http_transfer) 
-
 
131
	{
-
 
132
		strcpy(#newurl, History.current());
-
 
133
	}
-
 
134
	else
-
 
135
	{
-
 
136
		strcpy(#newurl, History.items.get(History.active-2)); 
-
 
137
	}
-
 
138
 
-
 
139
	if (ESBYTE[in_URL] == '/') //remove everything after site domain name
-
 
140
	{
-
 
141
		i = strchr(#newurl+8, '/');
-
 
142
		if (i) ESBYTE[i]=0;
-
 
143
		in_URL+=1;
-
 
144
	}
-
 
145
		
-
 
146
	_CUT_ST_LEVEL_MARK:
-
 
147
		
-
 
148
	if (newurl[strrchr(#newurl, '/')-2]<>'/')
-
 
149
	{
-
 
150
		newurl[strrchr(#newurl, '/')] = 0x00;
-
 
151
	}
-
 
152
	
-
 
153
	IF (!strncmp(in_URL,"../",3))
-
 
154
	{
-
 
155
		in_URL+=3;
-
 
156
		newurl[strrchr(#newurl, '/')-1] = 0x00;
-
 
157
		goto _CUT_ST_LEVEL_MARK;
-
 
158
	}
-
 
159
	
-
 
160
	if (newurl[strlen(#newurl)-1]<>'/') strcat(#newurl, "/"); 
-
 
161
	
-
 
162
	strcat(#newurl, in_URL);
-
 
163
	strcpy(orig_URL, #newurl);
-
 
164
}
-
 
165
>
-