Subversion Repositories Kolibri OS

Rev

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

Rev 6724 Rev 6730
Line 28... Line 28...
28
#include "..\lib\patterns\http_downloader.h"
28
#include "..\lib\patterns\http_downloader.h"
Line 29... Line 29...
29
 
29
 
Line 30... Line 30...
30
char homepage[] = FROM "html\\homepage.htm""\0";
30
char homepage[] = FROM "html\\homepage.htm""\0";
31
 
31
 
32
#ifdef LANG_RUS
32
#ifdef LANG_RUS
33
char version[]="’¥ªáâ®¢ë© ¡à ã§¥à 1.51";
33
char version[]="’¥ªáâ®¢ë© ¡à ã§¥à 1.52";
34
?define IMAGES_CACHE_CLEARED "Šíè ª à⨭®ª ®ç¨é¥­"
34
?define IMAGES_CACHE_CLEARED "Šíè ª à⨭®ª ®ç¨é¥­"
35
?define T_LAST_SLIDE "â® ¯®á«¥¤­¨© á« ©¤"
35
?define T_LAST_SLIDE "â® ¯®á«¥¤­¨© á« ©¤"
36
char loading[] = "‡ £à㧪  áâà ­¨æë...
";
36
char loading[] = "‡ £à㧪  áâà ­¨æë...
";
Line 41... Line 41...
41
¥¤ ªâ¨à®¢ âì ¨á室­¨ª
41
¥¤ ªâ¨à®¢ âì ¨á室­¨ª
42
ˆáâ®à¨ï
42
ˆáâ®à¨ï
43
Žç¨áâ¨âì ªíè ª à⨭®ª
43
Žç¨áâ¨âì ªíè ª à⨭®ª
44
Œ¥­¥¤¦¥à § £à㧮ª";
44
Œ¥­¥¤¦¥à § £à㧮ª";
45
#else
45
#else
46
char version[]="Text-based Browser 1.51";
46
char version[]="Text-based Browser 1.52";
47
?define IMAGES_CACHE_CLEARED "Images cache cleared"
47
?define IMAGES_CACHE_CLEARED "Images cache cleared"
48
?define T_LAST_SLIDE "This slide is the last"
48
?define T_LAST_SLIDE "This slide is the last"
49
char loading[] = "Loading...
";
49
char loading[] = "Loading...
";
50
char page_not_found[] = FROM "html\\page_not_found_en.htm""\0";
50
char page_not_found[] = FROM "html\\page_not_found_en.htm""\0";
51
char accept_language[]= "Accept-Language: en\n";
51
char accept_language[]= "Accept-Language: en\n";
Line 210... Line 210...
210
									do {
210
									do {
211
										$lodsb;
211
										$lodsb;
212
										$stosb;
212
										$stosb;
213
									} while (AL != 0) && (AL != 13) && (AL != 10);
213
									} while (AL != 0) && (AL != 13) && (AL != 10);
214
									DSBYTE[EDI-1]='\0';
214
									DSBYTE[EDI-1]='\0';
-
 
215
									if (!strcmp(#URL,"https://"))
-
 
216
									{
-
 
217
										notify("HTTPS protocol is not supported yet");
-
 
218
										StopLoading();		
-
 
219
									}
215
								}
220
								}
216
							}
221
							}
217
							else
222
							else
218
							{
223
							{
219
								notify("Too many redirects");
224
								notify("Too many redirects");
Line 311... Line 316...
311
				OpenPage();
316
				OpenPage();
312
			}
317
			}
313
			return;
318
			return;
314
		case GOTOURL_BUTTON:
319
		case GOTOURL_BUTTON:
315
		case SCAN_CODE_ENTER:
320
		case SCAN_CODE_ENTER:
-
 
321
			if (!strncmp(#editURL,"http:",5)) || (editURL[0]=='/') 
316
			if (!strncmp(#editURL,"http:",5)) || (editURL[0]=='/') || (!strncmp(#editURL,"WebView:",9))
322
			|| (!strncmp(#editURL,"https:",6)) || (!strncmp(#editURL,"WebView:",8))
317
			{
323
			{
318
				strcpy(#URL, #editURL);
324
				strcpy(#URL, #editURL);
319
			}
325
			}
320
			else
326
			else
321
			{
327
			{
Line 464... Line 470...
464
	}
470
	}
465
	else
471
	else
466
	{
472
	{
467
		WB1.Prepare();
473
		WB1.Prepare();
468
	}
474
	}
469
	//if (!header) strcpy(#header, #version);
-
 
470
	if (!strcmp(#version, #header)) DrawTitle(#header);
475
	if (!strcmp(#version, #header)) DrawTitle(#header);
471
}
476
}
Line 472... Line 477...
472
 
477
 
473
byte UrlExtIs(dword ext)
478
byte UrlExtIs(dword ext)
Line 508... Line 513...
508
 
513
 
509
	strcpy(#URL, PageLinks.GetURL(PageLinks.active));	
514
	strcpy(#URL, PageLinks.GetURL(PageLinks.active));	
510
	//#1
515
	//#1
511
	if (URL[0] == '#')
516
	if (URL[0] == '#')
-
 
517
	{
-
 
518
		if (URL[1] == NULL) {
-
 
519
			WB1.list.first = 0;
-
 
520
			strcpy(#URL, history.current());
-
 
521
		}
512
	{
522
		else {
513
		strcpy(#anchor, #URL+strrchr(#URL, '#'));		
523
			strlcpy(#anchor, #URL+strrchr(#URL, '#'), sizeof(anchor));
514
		strcpy(#URL, history.current());
-
 
-
 
524
			strcpy(#URL, history.current());
515
		WB1.list.first=WB1.list.count-WB1.list.visible;
525
		}
516
		ShowPage();
526
		ShowPage();			
517
		return;
527
		return;
518
	}
528
	}
519
	//liner.ru#1
529
	//liner.ru#1
520
	if (strrchr(#URL, '#')!=-1)
530
	if (strrchr(#URL, '#')!=0)
521
	{
531
	{
522
		strcpy(#anchor, #URL+strrchr(#URL, '#'));
532
		strcpy(#anchor, #URL+strrchr(#URL, '#'));
523
		URL[strrchr(#URL, '#')-1] = 0x00;
533
		URL[strrchr(#URL, '#')-1] = 0x00;
Line -... Line 534...
-
 
534
	}
-
 
535
 
-
 
536
	if (!strncmp(#URL,"mailto:", 7))
-
 
537
	{
-
 
538
		notify(#URL);
-
 
539
		strcpy(#editURL, history.current());
-
 
540
		strcpy(#URL, history.current());
-
 
541
		return;
-
 
542
	}
-
 
543
 
-
 
544
	if (!strcmp(#URL,"https://"))
-
 
545
	{
-
 
546
		notify("HTTPS protocol is not supported yet");	
524
	}
547
	}
Line 525... Line -...
525
	
-
 
526
	GetAbsoluteURL(#URL);
548
	
527
	
549
	GetAbsoluteURL(#URL);
528
	if (UrlExtIs(".png")==1) || (UrlExtIs(".gif")==1) || (UrlExtIs(".jpg")==1) || (UrlExtIs(".zip")==1) || (UrlExtIs(".kex")==1)
-
 
529
	|| (UrlExtIs(".7z")==1) || (UrlExtIs("netcfg")==1) 
550
 
530
	{
551
	if (strncmp(#URL,"http://",7)!=0)
531
		//notify(#URL);
-
 
532
		if (!strncmp(#URL,"http://", 7))
-
 
533
		{
-
 
534
			strcpy(#downloader_edit, #URL);
552
	{
535
			CreateThread(#Downloader,#downloader_stak+4092);
553
		if (UrlExtIs(".htm")!=true) && (UrlExtIs(".html")!=true)
536
		}
554
		{	
537
		else RunProgram("@open", #URL);
555
			RunProgram("/sys/@open", #URL);
538
		strcpy(#editURL, history.current());
556
			strcpy(#editURL, history.current());
-
 
557
			strcpy(#URL, history.current());
539
		strcpy(#URL, history.current());
558
			return;
540
		return;
559
		}
-
 
560
	}
-
 
561
	else	
-
 
562
	{
541
	}
563
		if (UrlExtIs(".png")==true) || (UrlExtIs(".gif")==true) || (UrlExtIs(".jpg")==true) 
-
 
564
		|| (UrlExtIs(".zip")==true) || (UrlExtIs(".kex")==true)
542
	if (!strncmp(#URL,"mailto:", 7))
565
		|| (UrlExtIs(".7z")==true) || (UrlExtIs("netcfg")==true) {		
543
	{
566
			strcpy(#downloader_edit, #URL);
544
		notify(#URL);
567
			CreateThread(#Downloader,#downloader_stak+4092);
545
		strcpy(#editURL, history.current());
568
			strcpy(#editURL, history.current());
-
 
569
			strcpy(#URL, history.current());
546
		strcpy(#URL, history.current());
570
			return;
547
		return;
-
 
548
	}
571
		}
Line 549... Line 572...
549
	OpenPage();
572
	}
550
	return;
573
	OpenPage();