Subversion Repositories Kolibri OS

Compare Revisions

Regard whitespace Rev 7742 → Rev 7743

/programs/cmm/browser/WebView.c
28,14 → 28,15
 
_http http = {0, 0, 0, 0, 0, 0, 0};
 
char homepage[] = FROM "html\\homepage.htm""\0";
 
#ifdef LANG_RUS
char version[]="’¥ªáâ®¢ë© ¡à ã§¥à 1.84";
char version[]="’¥ªáâ®¢ë© ¡à ã§¥à 1.85";
?define IMAGES_CACHE_CLEARED "Šíè ª à⨭®ª ®ç¨é¥­"
?define T_LAST_SLIDE "â® ¯®á«¥¤­¨© á« ©¤"
char loading[] = "‡ £à㧪  áâà ­¨æë...<br>";
char page_not_found[] = FROM "html\\page_not_found_ru.htm""\0";
char homepage[] = FROM "html\\homepage_ru.htm""\0";
char help[] = FROM "html\\help_ru.htm""\0";
char accept_language[]= "Accept-Language: ru\n";
char rmb_menu[] =
"®á¬®âà¥âì ¨á室­¨ª
46,11 → 47,13
"Š®¯¨à®¢ âì áá뫪ã
‘ª ç âì ᮤ¥à¦¨¬®¥ áá뫪¨";
#else
char version[]="Text-based Browser 1.84";
char version[]="Text-based Browser 1.85";
?define IMAGES_CACHE_CLEARED "Images cache cleared"
?define T_LAST_SLIDE "This slide is the last"
char loading[] = "Loading...<br>";
char page_not_found[] = FROM "html\\page_not_found_en.htm""\0";
char homepage[] = FROM "html\\homepage_en.htm""\0";
char help[] = FROM "html\\help_en.htm""\0";
char accept_language[]= "Accept-Language: en\n";
char rmb_menu[] =
"View source
64,7 → 67,8
 
 
#define URL_SERVICE_HISTORY "WebView://history"
#define URL_SERVICE_HOME "WebView://home"
#define URL_SERVICE_HOMEPAGE "WebView://home"
#define URL_SERVICE_HELP "WebView://help"
#define URL_SERVICE_SOURCE "WebView://source:"
 
proc_info Form;
132,7 → 136,7
CreateThread(#Downloader,#downloader_stak+4092);
ExitProcess();
}
else if (param) strcpy(#URL, #param); else strcpy(#URL, URL_SERVICE_HOME);
else if (param) strcpy(#URL, #param); else strcpy(#URL, URL_SERVICE_HOMEPAGE);
WB1.list.SetFont(8, 14, 10011000b);
WB1.list.no_selection = true;
SetEventMask(EVM_REDRAW + EVM_KEY + EVM_BUTTON + EVM_MOUSE + EVM_MOUSE_FILTER + EVM_STACK);
169,7 → 173,14
|| (key_scancode == SCAN_CODE_KEY_N) RunProgram(#program_path, NULL);
if (key_scancode == SCAN_CODE_KEY_W) ExitProcess();
if (key_scancode == SCAN_CODE_KEY_J) ProcessEvent(DOWNLOAD_MANAGER);
if (key_scancode == SCAN_CODE_KEY_R) ProcessEvent(REFRESH_BUTTON);
if (key_scancode == SCAN_CODE_ENTER) EventSeachWeb();
if (key_scancode == SCAN_CODE_LEFT) ProcessEvent(BACK_BUTTON);
if (key_scancode == SCAN_CODE_RIGHT) ProcessEvent(FORWARD_BUTTON);
}
if (key_scancode == SCAN_CODE_F5) ProcessEvent(REFRESH_BUTTON);
if (address_box.flags & ed_focus)
{
if (key_scancode == SCAN_CODE_ENTER) {
185,6 → 196,7
#define KEY_SCROLL_N 11
if (SCAN_CODE_UP == key_scancode) for (i=0;i<KEY_SCROLL_N;i++) WB1.list.KeyUp();
if (SCAN_CODE_DOWN == key_scancode) for (i=0;i<KEY_SCROLL_N;i++) WB1.list.KeyDown();
if (key_scancode == SCAN_CODE_F6) {address_box.flags=ed_focus; DrawOmnibox();}
if (WB1.list.ProcessKey(key_scancode)) WB1.DrawPage();
else ProcessEvent(key_scancode);
}
224,7 → 236,7
GetAbsoluteURL(#http.redirect_url);
history.back();
strcpy(#editURL, #URL);
DrawEditBoxWebView();
DrawOmnibox();
OpenPage();
//ProcessLink(history.current());
}
280,7 → 292,7
OpenPage();
else {
WB1.DrawPage();
DrawEditBoxWebView();
DrawOmnibox();
}
DrawRectangle(scroll_wv.start_x, scroll_wv.start_y, scroll_wv.size_x, scroll_wv.size_y-1, scroll_wv.bckg_col);
DrawProgress();
388,7 → 400,7
bufpointer = free(bufpointer);
}
wv_progress_bar.value = 0;
DrawEditBoxWebView();
DrawOmnibox();
}
 
void SetPageDefaults()
423,10 → 435,11
if (!strncmp(#URL,"WebView:",8))
{
SetPageDefaults();
if (!strcmp(#URL, URL_SERVICE_HOME)) WB1.LoadInternalPage(#homepage, sizeof(homepage));
if (!strcmp(#URL, URL_SERVICE_HOMEPAGE)) WB1.LoadInternalPage(#homepage, sizeof(homepage));
else if (!strcmp(#URL, URL_SERVICE_HELP)) WB1.LoadInternalPage(#help, sizeof(help));
else if (!strcmp(#URL, URL_SERVICE_HISTORY)) ShowHistory();
else {bufsize=0; ShowPage();} //page not found
DrawEditBoxWebView();
DrawOmnibox();
return;
}
if (!strncmp(#URL,"http:",5)) || (!strncmp(#URL,"https://",8))
497,7 → 510,7
WB1.DrawPage();
strcpy(#editURL, #URL);
strcat(#editURL, #anchor);
DrawEditBoxWebView();
DrawOmnibox();
}
 
void EventSubmitOmnibox()
593,7 → 606,7
open_in_a_new_window = false;
}
 
void DrawEditBoxWebView()
void DrawOmnibox()
{
int skin_x_offset;
DrawBar(address_box.left-2, address_box.top-2, address_box.width+3, 2, address_box.color);
609,7 → 622,7
 
void ShowPage()
{
DrawEditBoxWebView();
DrawOmnibox();
if (!bufsize)
{
if (http.transfer) WB1.LoadInternalPage(#loading, sizeof(loading));
655,6 → 668,12
}
}
 
void EventSeachWeb()
{
sprintf(#URL, "https://www.google.com/search?q=%s", #editURL);
ProcessLink();
}
 
void DrawStatusBar(dword _status_text)
{
status_text.start_x = wv_progress_bar.left + wv_progress_bar.width + 10;
/programs/cmm/browser/history.h
1,3 → 1,26
#ifdef LANG_RUS
#define HISTORY_HEADER "<html>
<head>
<title>ˆáâ®à¨ï</title>
</head>
<body>
<h1>ˆáâ®à¨ï</h1>
<br>
<b>®á¥é¥­­ë¥ áâà ­¨æë</b><br>
"
#else
#define HISTORY_HEADER "<html>
<head>
<title>History</title>
</head>
<body>
<h1>History</h1>
<br>
<b>Visited pages</b><br>
"
#endif
 
 
ShowHistory()
{
int i;
6,16 → 29,16
free(history_pointer);
history_pointer = malloc(history.items.data_size+256);
strcat(history_pointer, "<html><head><title>History</title></head><body><h1>History</h1>");
strcat(history_pointer, "<br><b>Visited pages</b><br>");
strcat(history_pointer, HISTORY_HEADER);
for (i=0; i<history.items.count; i++)
{
strcat(history_pointer, "<a href='");
strcat(history_pointer, "\t<a href='");
strcat(history_pointer, history.items.get(i));
strcat(history_pointer, "'>");
strcat(history_pointer, history.items.get(i));
strcat(history_pointer, "</a><br>");
}
/*
strcat(history_pointer, "<br><b>Cached images</b><br>");
for (i=1; i<ImgCache.pics_count; i++)
{
24,13 → 47,13
strcat(history_pointer, "'>");
strcat(history_pointer, #pics[i].path);
strcat(history_pointer, "</a><br>");
/*
strcat(history_pointer, "<img src='");
strcat(history_pointer, #pics[i].path);
strcat(history_pointer, "'><br>");
strcat(history_pointer, #pics[i].path);
// strcat(history_pointer, "<img src='");
// strcat(history_pointer, #pics[i].path);
// strcat(history_pointer, "'><br>");
// strcat(history_pointer, #pics[i].path);
}
*/
}
strcat(history_pointer, "</body></html>");
WB1.LoadInternalPage(history_pointer, strlen(history_pointer));
}
/programs/cmm/browser/html/homepage.htm
File deleted
\ No newline at end of file
/programs/cmm/browser/html/help_en.htm
0,0 → 1,23
<html>
<head>
<meta charset="uft">
<title>WebView Help</title>
</head>
<body><pre><h1>WebView Help</h1>
 
<b>Shortcut keys</b>
<font bg="#C7CEE4">[CTRL + N or CTRL + T]</font> New window
<font bg="#C7CEE4">[CTRL + R or F5]</font> Refresh the current page
<font bg="#C7CEE4">[CTRL + U]</font> View a web page's source code
<font bg="#C7CEE4">[CTRL + H]</font> Open browser history
<font bg="#C7CEE4">[CTRL + J]</font> Display the file downloader
<font bg="#C7CEE4">[CTRL + W]</font> Exit browser
<font bg="#C7CEE4">[CTRL + ENTER]</font> Submit a web search
<font bg="#C7CEE4">[CTRL + LEFT]</font> Back a page.
<font bg="#C7CEE4">[CTRL + RIGHT]</font> Forward a page.
<font bg="#C7CEE4">[F6]</font> Moves a text cursor to the omnibox
 
</pre>
</body>
</html>
/programs/cmm/browser/html/help_ru.htm
0,0 → 1,20
<html>
<head>
<meta charset="cp-866">
<title>‘¯à ¢ª  WebView</title>
</head>
<body><pre><h1>‘¯à ¢ª  WebView</h1>
<font bg="#C7CEE4">[CTRL + N ¨«¨ CTRL + T]</font> ®¢®¥ ®ª­®
<font bg="#C7CEE4">[CTRL + R ¨«¨ F5]</font> ¥à¥§ £à㧨âì áâà ­¨æã
<font bg="#C7CEE4">[CTRL + U]</font> ‘¬®âà¥âì ¨á室­ë© ª®¤ áâà ­¨æë
<font bg="#C7CEE4">[CTRL + H]</font> ‘¬®âà¥âì ¨áâ®à¨î ¯®á¥é¥­­ëå áâà ­¨æ
<font bg="#C7CEE4">[CTRL + J]</font> Žâªàëâì § £àã§ç¨ª ä ©«®¢
<font bg="#C7CEE4">[CTRL + W]</font> ‡ ªàëâì ¡à ã§¥à
<font bg="#C7CEE4">[CTRL + ENTER]</font> ®¨áª ¢ ¨­â¥à­¥â¥ á ¯®¬®éìî Google
<font bg="#C7CEE4">[CTRL + ‚‹…‚Ž]</font> €­ «®£¨ç­® ª­®¯ª¥ " § ¤" ¢ ¡à ã§¥à¥
<font bg="#C7CEE4">[CTRL + ‚€‚Ž]</font> €­ «®£¨ç­® ª­®¯ª¥ "‚¯¥à¥¤"
<font bg="#C7CEE4">[F6]</font> ¥à¥¬¥é ¥â ⥪áâ®¢ë© ªãàá®à ¢ ®¬­¨¡®ªá
 
</pre>
</body>
</html>
/programs/cmm/browser/html/homepage_en.htm
0,0 → 1,17
<html>
<head>
<meta charset="uft">
<title>Homepage</title>
</head>
<body><pre>Bookmarks:
1. <a href="http://kolibrios.org" id="valera">KolibriOS homepage</a>
2. <a href="http://kolibri-n.org" id="hodor">KolibriN homepage</a>
3. <a href="http://store.kolibri-n.org">Kolibri Stuff</a>
 
<font color="#555555">Hint: to run a web search, type a text in the adress box
and press Ctrl+Enter. You can also use other <a href="WebView://help"><font color="#555555">Hotkeys</font></a>.</font>
 
 
</pre>
</body>
</html>
/programs/cmm/browser/html/homepage_ru.htm
0,0 → 1,17
<html>
<head>
<meta charset="cp-866">
<title>„®¬ è­ïï áâà ­¨æ </title>
</head>
<body><pre>‡ ª« ¤ª¨:
1. <a href="http://kolibrios.org" id="valera">„®¬ è­ïï áâà ­¨æ  KolibriOS</a>
2. <a href="http://kolibri-n.org" id="hodor">KolibriN10</a>
3. <a href="http://store.kolibri-n.org">Kolibri Store</a>
 
<font color="#555555">„«ï ¯®¨áª  ¢ Google ­ ¡¥à¨â¥ â¥áâ ¢  ¤à¥á­®© áâப¥
¨ ­ ¦¬¨â¥ Ctrl+Enter. …áâì â ª¦¥ ¤à㣨¥ <a href="WebView://help"><font color="#555555">ƒ®àï稥 ª« ¢¨è¨</font></a>.</font>
 
 
</pre>
</body>
</html>