Subversion Repositories Kolibri OS

Rev

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

Rev 8278 Rev 8291
Line 32... Line 32...
32
 
32
 
Line 33... Line 33...
33
char editbox_icons[] = FROM "res/editbox_icons.raw";
33
char editbox_icons[] = FROM "res/editbox_icons.raw";
Line 34... Line 34...
34
 
34
 
Line 35... Line 35...
35
#define URL_SIZE 4000
35
#define URL_SIZE 4000
36
 
36
 
37
char version[]="WebView 2.66";
37
char version[]="WebView 2.7";
Line 238... Line 238...
238
			
238
			
239
		case evNetwork:
239
		case evNetwork:
240
			if (http.transfer <= 0) break;
240
			if (http.transfer <= 0) break;
241
			http.receive();
241
			http.receive();
-
 
242
			EventUpdateProgressBar();
-
 
243
			if (http.check_content_type()) && (!strncmp(#http.content_type,"application",11)) {
-
 
244
				EventOpenDownloader(history.current());
-
 
245
				StopLoading();
-
 
246
				history.back();
-
 
247
				EventRefreshPage();
242
			EventUpdateProgressBar();
248
			}
243
			if (http.receive_result != 0) break;
249
			if (http.receive_result != 0) break;
244
			if (http.status_code >= 300) && (http.status_code < 400)
250
			if (http.status_code >= 300) && (http.status_code < 400)
245
			{
251
			{
246
				// Handle redirects
252
				// Handle redirects
247
				if (redirect_count<=5) {
253
				if (redirect_count<=5) {
248
					redirect_count++;
254
					redirect_count++;
249
					http.handle_redirect();
-
 
250
					http.free();
-
 
251
					GetAbsoluteURL(#http.redirect_url, history.current());
255
					http.handle_redirect();
252
					history.back();
256
					history.back();
253
					if (http_get_type==PAGE) OpenPage(#http.redirect_url);
257
					if (http_get_type==PAGE) OpenPage(#http.redirect_url);
254
					else if (http_get_type==IMG) http.get(#http.redirect_url);
258
					else if (http_get_type==IMG) http.get(#http.redirect_url);
255
				} else {
259
				} else {
Line 258... Line 262...
258
					redirect_count = 0;
262
					redirect_count = 0;
259
				}
263
				}
260
			} else {
264
			} else {
261
				// Loading the page is complete, free resources
265
				// Loading the page is complete, free resources
262
				redirect_count = 0;
266
				redirect_count = 0;
263
				http.free();
267
				http.hfree();
264
				if (http_get_type==PAGE) {
268
				if (http_get_type==PAGE) {
265
					cache.add(history.current(), http.content_pointer, http.content_received, PAGE);
269
					cache.add(history.current(), http.content_pointer, http.content_received, PAGE);
266
					LoadInternalPage(http.content_pointer, http.content_received);
270
					LoadInternalPage(http.content_pointer, http.content_received);
267
				}
271
				}
268
				else if (http_get_type==IMG) {
272
				else if (http_get_type==IMG) {
Line 949... Line 953...
949
dword GetAbsoluteActiveURL()
953
dword GetAbsoluteActiveURL()
950
{
954
{
951
	char abs_url[URL_SIZE];
955
	char abs_url[URL_SIZE];
952
	if (links.active_url) {
956
	if (links.active_url) {
953
		strncpy(#abs_url, links.active_url, URL_SIZE);
957
		strncpy(#abs_url, links.active_url, URL_SIZE);
954
		GetAbsoluteURL(#abs_url, history.current());		
958
		get_absolute_url(#abs_url, history.current());		
955
		return #abs_url;
959
		return #abs_url;
956
	}
960
	}
957
	return 0;
961
	return 0;
958
}
962
}