Subversion Repositories Kolibri OS

Rev

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

Rev 7755 Rev 7756
Line 56... Line 56...
56
char link_menu[] =
56
char link_menu[] =
57
"Copy link
57
"Copy link
58
Download link contents";
58
Download link contents";
59
#endif
59
#endif
Line 60... Line 60...
60
 
60
 
Line 61... Line 61...
61
#define URL_SIZE 4000;
61
#define URL_SIZE 4000
62
 
62
 
63
dword col_bg = 0xE3E2E2;
63
dword col_bg = 0xE3E2E2;
Line 398... Line 398...
398
	}
398
	}
399
	wv_progress_bar.value = 0;
399
	wv_progress_bar.value = 0;
400
	DrawOmnibox();
400
	DrawOmnibox();
401
}
401
}
Line 402... Line 402...
402
 
402
 
-
 
403
//rewrite into 
403
/*
404
//bool strrpl(dword dst, from, to, dst_len); !!!!!!!!
404
void ReplaceSpaceInUrl() {
405
void ReplaceSpaceInUrl(dword url, size) {
405
	int i;
-
 
406
	char new_url[URL_SIZE];
-
 
407
	strcpy(#new_url, history.current());
406
	unsigned int i, j;
408
	while (i = strchr(#new_url, ' '))
407
	for (i=size-3; i>0; i--)
409
	{
408
	{
410
		i -= #new_url;
409
		if (ESBYTE[i]!=' ') continue;
-
 
410
		for (j=size-3; j>i; j--) {
-
 
411
			ESBYTE[j+2]=ESBYTE[j+1];
-
 
412
			ESBYTE[j+1]=ESBYTE[j];
411
		strlcpy(#new_url+i+3, #new_url+i+1, URL_SIZE);
413
		}
412
		URL[i] = '%';
414
		ESBYTE[i] = '%';
413
		URL[i+1] = '2';
415
		ESBYTE[i+1] = '2';
414
		URL[i+2] = '0';
416
		ESBYTE[i+2] = '0';
415
	}
417
	}
416
	strcpy(#editURL, #new_url);
418
	debugln(url);
Line 417... Line -...
417
}
-
 
418
 
-
 
419
//bool strrpl(dword dst, from, to, dst_len); !!!!!!!!
-
 
420
 
-
 
421
*/
419
}
422
 
420
 
423
bool GetLocalFileData(dword _path)
421
bool GetLocalFileData(dword _path)
424
{
422
{
425
	dword data, size;
423
	dword data, size;
Line 459... Line 457...
459
		else if (!strcmp(#new_url, URL_SERVICE_HELP)) LoadInternalPage(#help, sizeof(help));
457
		else if (!strcmp(#new_url, URL_SERVICE_HELP)) LoadInternalPage(#help, sizeof(help));
460
		else if (!strcmp(#new_url, URL_SERVICE_HISTORY)) ShowHistory();
458
		else if (!strcmp(#new_url, URL_SERVICE_HISTORY)) ShowHistory();
461
		else LoadInternalPage(#page_not_found, sizeof(page_not_found));
459
		else LoadInternalPage(#page_not_found, sizeof(page_not_found));
462
	} else if (!strncmp(#new_url,"http:",5)) || (!strncmp(#new_url,"https:",6)) {
460
	} else if (!strncmp(#new_url,"http:",5)) || (!strncmp(#new_url,"https:",6)) {
463
		//WEB PAGE
461
		//WEB PAGE
464
		//ReplaceSpaceInUrl(); !!!!!!!!
-
 
465
		img_draw stdcall(skin.image, address_box.left+address_box.width+1, 
462
		img_draw stdcall(skin.image, address_box.left+address_box.width+1, 
466
			address_box.top-3, 17, skin.h, 85, SKIN_Y);
463
			address_box.top-3, 17, skin.h, 85, SKIN_Y);
Line -... Line 464...
-
 
464
 
467
 
465
		//ReplaceSpaceInUrl(#new_url, URL_SIZE);
468
		if (!strncmp(#new_url,"http:",5)) {
466
		if (!strncmp(#new_url,"http:",5)) {
469
			http.get(#new_url);
467
			http.get(#new_url);
470
		} else if (!strncmp(#new_url,"https://",8)) {
468
		} else if (!strncmp(#new_url,"https://",8)) {
471
			strcpy(#new_url, "http://gate.aspero.pro/?site=");
469
			strcpy(#new_url, "http://gate.aspero.pro/?site=");
Line 484... Line 482...
484
	}
482
	}
485
}
483
}
Line 486... Line 484...
486
 
484
 
487
void EventClickLink(dword _click_URL)
485
void EventClickLink(dword _click_URL)
488
{
486
{
Line 489... Line 487...
489
	char new_url[URL_SIZE];
487
	char new_url[URL_SIZE+1];
490
 
488
 
491
	if (ESBYTE[_click_URL]=='#') {
489
	if (ESBYTE[_click_URL]=='#') {
492
		if (anchors.get_pos_by_name(_click_URL+1)!=-1) {
490
		if (anchors.get_pos_by_name(_click_URL+1)!=-1) {
Line 583... Line 581...
583
}
581
}
Line 584... Line 582...
584
 
582
 
585
void LoadInternalPage(dword _bufdata, _in_bufsize){
583
void LoadInternalPage(dword _bufdata, _in_bufsize){
586
	if (!_bufdata) || (!_in_bufsize) {
584
	if (!_bufdata) || (!_in_bufsize) {
587
		LoadInternalPage(#page_not_found, sizeof(page_not_found));
-
 
588
	} else if (source_mode) {
-
 
589
		source_mode = false;
-
 
590
		//WB1.ParseHtml();
-
 
591
		ShowSource(_bufdata, _in_bufsize);
585
		LoadInternalPage(#page_not_found, sizeof(page_not_found));
592
	} else {
586
	} else {
593
		bufsize = _in_bufsize;
587
		bufsize = _in_bufsize;
594
		if (bufpointer!=_bufdata) free(bufpointer);
588
		if (bufpointer!=_bufdata) free(bufpointer);
595
		bufpointer = malloc(bufsize);
589
		bufpointer = malloc(bufsize);
Line 598... Line 592...
598
		DrawOmnibox();
592
		DrawOmnibox();
599
		if(!strrchr(#editURL, '#')) {
593
		if(!strrchr(#editURL, '#')) {
600
			strcat(#editURL, #anchors.current);
594
			strcat(#editURL, #anchors.current);
601
			DrawOmnibox();
595
			DrawOmnibox();
602
		}
596
		}
-
 
597
		if (source_mode) {
-
 
598
			source_mode = false;
-
 
599
			WB1.ParseHtml();
-
 
600
			ShowSource(bufpointer, bufsize);
-
 
601
			return;
-
 
602
		}
603
		WB1.ParseHtml();
603
		WB1.ParseHtml();
604
		WB1.DrawPage();
604
		WB1.DrawPage();
605
	}
605
	}
606
}
606
}