Subversion Repositories Kolibri OS

Rev

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

Rev 5445 Rev 5493
Line 27... Line 27...
27
#include "..\lib\lib.obj\http.h"
27
#include "..\lib\lib.obj\http.h"
Line 28... Line 28...
28
 
28
 
29
//useful patterns
29
//useful patterns
Line 30... Line 30...
30
#include "..\lib\patterns\libimg_load_skin.h"
30
#include "..\lib\patterns\libimg_load_skin.h"
Line 31... Line 31...
31
 
31
 
32
char homepage[] = FROM "html\homepage.htm";
32
char homepage[] = FROM "html\\homepage.htm";
33
 
33
 
34
#ifdef LANG_RUS
34
#ifdef LANG_RUS
35
	char version[]=" ’¥ªáâ®¢ë© ¡à ã§¥à 1.0 Beta 6.2";
35
	char version[]=" ’¥ªáâ®¢ë© ¡à ã§¥à 1.0";
36
	?define IMAGES_CACHE_CLEARED "Šíè ª à⨭®ª ®ç¨é¥­"
36
	?define IMAGES_CACHE_CLEARED "Šíè ª à⨭®ª ®ç¨é¥­"
37
	?define T_LAST_SLIDE "â® ¯®á«¥¤­¨© á« ©¤"
37
	?define T_LAST_SLIDE "â® ¯®á«¥¤­¨© á« ©¤"
38
	char loading[] = "‡ £à㧪  áâà ­¨æë...
";
38
	char loading[] = "‡ £à㧪  áâà ­¨æë...
";
39
	char page_not_found[] = FROM "html\page_not_found_ru.htm";
39
	char page_not_found[] = FROM "html\page_not_found_ru.htm";
40
	char accept_language[]= "Accept-Language: ru\n";
40
	char accept_language[]= "Accept-Language: ru\n";
41
#else
41
#else
42
	char version[]=" Text-based Browser 1.0 Beta 6.2";
42
	char version[]=" Text-based Browser 1.0";
43
	?define IMAGES_CACHE_CLEARED "Images cache cleared"
43
	?define IMAGES_CACHE_CLEARED "Images cache cleared"
44
	?define T_LAST_SLIDE "This slide is the last"
44
	?define T_LAST_SLIDE "This slide is the last"
Line 75... Line 75...
75
 
75
 
76
#include "..\TWB\TWB.c"
76
#include "..\TWB\TWB.c"
77
#include "menu_rmb.h"
77
#include "menu_rmb.h"
78
#include "history.h"
78
#include "history.h"
-
 
79
#include "show_src.h"
Line 79... Line 80...
79
#include "show_src.h"
80
#include "downloader.h"
80
 
81
 
81
char editURL[sizeof(URL)];
82
char editURL[sizeof(URL)];
Line 131... Line 132...
131
	SetSkinColors();
132
	SetSkinColors();
Line 132... Line 133...
132
	
133
	
133
	Form.width=WIN_W;
134
	Form.width=WIN_W;
134
	Form.height=WIN_H;
135
	Form.height=WIN_H;
135
	SetElementSizes();
136
	SetElementSizes();
136
	if (!URL) strcpy(#URL, URL_SERVICE_HOME);
137
	if (param) strcpy(#URL, #param); else strcpy(#URL, URL_SERVICE_HOME);
Line -... Line 138...
-
 
138
	OpenPage();
-
 
139
 
137
	OpenPage();
140
	CreateDir("/tmp0/1/downloads");
138
 
141
 
139
	SetEventMask(0xa7);
142
	SetEventMask(0xa7);
140
	loop()
143
	loop()
141
	{
144
	{
Line 374... Line 377...
374
		case 003: //history
377
		case 003: //history
375
			strcpy(#URL, URL_SERVICE_HISTORY);
378
			strcpy(#URL, URL_SERVICE_HISTORY);
376
			OpenPage();
379
			OpenPage();
377
			return;
380
			return;
Line -... Line 381...
-
 
381
 
-
 
382
		case 006: //download manager
-
 
383
			DL_URL[0] = 0;
-
 
384
			CreateThread(#Downloader,#downloader_stak+4092);
-
 
385
			return;
378
 
386
 
379
		case BACK:
387
		case BACK:
380
			if (!BrowserHistory.GoBack()) return;
388
			if (!BrowserHistory.GoBack()) return;
381
			OpenPage();
389
			OpenPage();
382
			return;
390
			return;
Line 414... Line 422...
414
		case 020:
422
		case 020:
415
		case NEWTAB:
423
		case NEWTAB:
416
			MoveSize(190,80,OLD,OLD);
424
			MoveSize(190,80,OLD,OLD);
417
			RunProgram(#program_path, #URL);
425
			RunProgram(#program_path, #URL);
418
			return;
426
			return;
419
			
-
 
420
		case HOME:
-
 
421
			strcpy(#editURL, "http://kolibrios.org/");
-
 
422
		case GOTOURL:
427
		case GOTOURL:
423
		case 0x0D: //enter
428
		case 0x0D: //enter
424
			if (!editURL[0]) return;
429
			if (!editURL[0]) return;
425
			if ((strncmp(#editURL,"http:",5)!=0) && (editURL[0]!='/') && ((strncmp(#editURL,"WebView:",8)!=0))
430
			if ((strncmp(#editURL,"http:",5)!=0) && (editURL[0]!='/') && ((strncmp(#editURL,"WebView:",8)!=0))
426
			{
431
			{
Line 523... Line 528...
523
		URL[strrchr(#URL, '#')-1] = 0x00;
528
		URL[strrchr(#URL, '#')-1] = 0x00;
524
	}
529
	}
Line 525... Line 530...
525
	
530
	
Line 526... Line 531...
526
	PageLinks.GetAbsoluteURL(#URL);
531
	PageLinks.GetAbsoluteURL(#URL);
-
 
532
	
-
 
533
	if (UrlExtIs(".png")==1) || (UrlExtIs(".gif")==1) || (UrlExtIs(".jpg")==1) || (UrlExtIs(".zip")==1)
-
 
534
	|| (UrlExtIs(".7z")==1) || (UrlExtIs("netcfg")==1) 
-
 
535
	{
-
 
536
		notify(#URL);
-
 
537
		if (strcmpn(#URL,"http://:", 8)==0)
-
 
538
		{
-
 
539
			strcpy(#DL_URL, #URL);
-
 
540
			CreateThread(#Downloader,#downloader_stak+4092);
527
	
541
		}
528
	if (!strcmp(#URL + strlen(#URL) - 4, ".gif")) || (!strcmp(#URL + strlen(#URL) - 4, ".png")) || (!strcmp(#URL + strlen(#URL) - 4, ".jpg"))
-
 
529
	{
542
		else
-
 
543
		{
530
		//if (strstr(#URL,"http:")) 
544
			RunProgram("@open", #URL);
531
		RunProgram("/sys/media/kiv", #URL);
545
		}
532
		strcpy(#editURL, BrowserHistory.CurrentUrl());
546
		strcpy(#editURL, BrowserHistory.CurrentUrl());
533
		strcpy(#URL, BrowserHistory.CurrentUrl());
547
		strcpy(#URL, BrowserHistory.CurrentUrl());
534
		return;
548
		return;
Line 649... Line 663...
649
 
663
 
650
	if (!header) strcpy(#header, #version);
664
	if (!header) strcpy(#header, #version);
651
	if (!strcmp(#version, #header)) DrawTitle(#header);
665
	if (!strcmp(#version, #header)) DrawTitle(#header);
Line -... Line 666...
-
 
666
}
-
 
667
 
-
 
668
byte UrlExtIs(dword ext)
-
 
669
{
-
 
670
	if (strcmpi(#URL + strlen(#URL) - strlen(ext), ext)==0) return 1; else return 0;
Line 652... Line 671...
652
}
671
}
-
 
672
 
-
 
673