WebView: fix issues with anchors

Eolite: use Shift+Enter to open all selected files

git-svn-id: svn://kolibrios.org@8417 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
Kirill Lipatov (Leency) 2020-12-16 10:23:59 +00:00
parent 08aecd42a8
commit c987c0d2d5
4 changed files with 37 additions and 17 deletions

View File

@ -41,7 +41,7 @@
// DATA // // DATA //
// // // //
//===================================================// //===================================================//
char version[]="WebView 3.03"; char version[]="WebView 3.04";
#define DEFAULT_URL URL_SERVICE_HOMEPAGE #define DEFAULT_URL URL_SERVICE_HOMEPAGE
@ -599,6 +599,7 @@ bool EventClickAnchor()
if (anchors.get_pos_by_name(aURL+1)!=-1) { if (anchors.get_pos_by_name(aURL+1)!=-1) {
WB1.list.first = anchors.get_pos_by_name(aURL+1); WB1.list.first = anchors.get_pos_by_name(aURL+1);
WB1.list.CheckDoesValuesOkey();
strcpy(#editURL, history.current()); strcpy(#editURL, history.current());
strcat(#editURL, aURL); strcat(#editURL, aURL);
DrawOmnibox(); DrawOmnibox();
@ -842,6 +843,7 @@ void DrawStatusBar(dword _msg)
{ {
dword status_y = Form.cheight - STATUSBAR_H + 4; dword status_y = Form.cheight - STATUSBAR_H + 4;
dword status_w = Form.cwidth - 90; dword status_w = Form.cwidth - 90;
if (Form.status_window>2) return;
DrawBar(0,Form.cheight - STATUSBAR_H+1, Form.cwidth,STATUSBAR_H-1, sc.work); DrawBar(0,Form.cheight - STATUSBAR_H+1, Form.cwidth,STATUSBAR_H-1, sc.work);
if (_msg) { if (_msg) {
ESI = math.min(status_w/6, strlen(_msg)); ESI = math.min(status_w/6, strlen(_msg));

View File

@ -3,15 +3,15 @@
// 70.5 - get volume info and label // 70.5 - get volume info and label
#define TITLE "Eolite File Manager 4.48" #define TITLE "Eolite File Manager 4.49"
#define ABOUT_TITLE "EOLITE 4.48" #define ABOUT_TITLE "EOLITE 4.49"
#ifndef AUTOBUILD #ifndef AUTOBUILD
#include "lang.h--" #include "lang.h--"
#endif #endif
//libraries //libraries
#define MEMSIZE 1024 * 720 #define MEMSIZE 1024 * 250
#include "../lib/clipboard.h" #include "../lib/clipboard.h"
#include "../lib/strings.h" #include "../lib/strings.h"
#include "../lib/mem.h" #include "../lib/mem.h"
@ -266,7 +266,7 @@ void main()
DrawStatusBar(); DrawStatusBar();
List_ReDraw(); List_ReDraw();
} else { } else {
if (mouse.y - files.y / files.item_h + files.first == files.cur_y) Open(0); if (mouse.y - files.y / files.item_h + files.first == files.cur_y) EventOpen(0);
} }
} }
//file menu //file menu
@ -342,7 +342,7 @@ void main()
break; break;
//Button pressed----------------------------------------------------------------------------- //Button pressed-----------------------------------------------------------------------------
case evButton: case evButton:
id = @GetButtonID(); id = GetButtonID();
if (new_element_active) || (del_active) { if (new_element_active) || (del_active) {
if (POPUP_BTN1==id) && (del_active) EventDelete(); if (POPUP_BTN1==id) && (del_active) EventDelete();
@ -424,6 +424,12 @@ void main()
} }
if (key_modifier&KEY_LSHIFT) || (key_modifier&KEY_RSHIFT) { if (key_modifier&KEY_LSHIFT) || (key_modifier&KEY_RSHIFT) {
if (key_scancode == SCAN_CODE_ENTER) {
EventOpenSelected();
break;
}
old_cur_y = files.cur_y; old_cur_y = files.cur_y;
files.ProcessKey(key_scancode); files.ProcessKey(key_scancode);
EventChooseFilesRange(old_cur_y, files.cur_y); EventChooseFilesRange(old_cur_y, files.cur_y);
@ -478,7 +484,7 @@ void main()
break; break;
case SCAN_CODE_ENTER: case SCAN_CODE_ENTER:
if (!itdir) ShowOpenWithDialog(); if (!itdir) ShowOpenWithDialog();
else Open(1); else EventOpen(1);
break; break;
case SCAN_CODE_KEY_A: case SCAN_CODE_KEY_A:
EventChooseAllFiles(true); EventChooseAllFiles(true);
@ -497,7 +503,7 @@ void main()
Dir_Up(); Dir_Up();
break; break;
case SCAN_CODE_ENTER: case SCAN_CODE_ENTER:
Open(0); EventOpen(0);
break; break;
case SCAN_CODE_TAB: case SCAN_CODE_TAB:
if (!two_panels.checked) break; if (!two_panels.checked) break;
@ -960,15 +966,25 @@ void Dir_Up()
SelectFileByName(#old_folder_name); SelectFileByName(#old_folder_name);
} }
void Open(byte rez) void EventOpenSelected()
{ {
byte temp[4096]; int i;
selected_count = 0; dword file_off;
if (rez) for (i=0; i<files.count; i++) if (getElementSelectedFlag(i)) {
EDX = items.get(i)*304 + buf+32;
if (TestBit(ESDWORD[EDX], 4)) continue; //is foder
sprintf(#param,"%s/%s",#path, EDX+40);
RunProgram("/sys/@open", #param);
}
}
void EventOpen(byte _new_window)
{
if (selected_count) && (!itdir) notify(T_USE_SHIFT_ENTER);
if (_new_window)
{ {
if (!strncmp(#file_name,"..",3)) return; if (streq(#file_name,"..")) return;
strcpy(#temp, #file_path); RunProgram(I_Path, #file_path);
RunProgram(I_Path, #temp);
return; return;
} }
if (!files.count) return; if (!files.count) return;

View File

@ -98,7 +98,7 @@ void EventMenuClick(dword _id)
case 1: EventPaste(); break; case 1: EventPaste(); break;
} }
if (active_menu == MENU_FILE) switch(_id) { if (active_menu == MENU_FILE) switch(_id) {
case 1: Open(0); break; case 1: EventOpen(0); break;
case 2: ShowOpenWithDialog(); break; case 2: ShowOpenWithDialog(); break;
case 3: EventCopy(NOCUT); break; case 3: EventCopy(NOCUT); break;
case 4: EventCopy(CUT); break; case 4: EventCopy(CUT); break;
@ -108,7 +108,7 @@ void EventMenuClick(dword _id)
case 8: FnProcess(8); break; case 8: FnProcess(8); break;
} }
if (active_menu == MENU_DIR) switch(_id) { if (active_menu == MENU_DIR) switch(_id) {
case 1: Open(0); break; case 1: EventOpen(0); break;
case 2: EventCopy(NOCUT); break; case 2: EventCopy(NOCUT); break;
case 3: EventCopy(CUT); break; case 3: EventCopy(CUT); break;
case 4: EventPaste(); break; case 4: EventPaste(); break;

View File

@ -27,6 +27,7 @@
?define T_STATUS_SELECTED "‚뤥«¥­­®: %d" ?define T_STATUS_SELECTED "‚뤥«¥­­®: %d"
?define COPY_PATH_STR "'<27>ãâì ¯ ¯ª¨ ᪮¯¨à®¢ ­ ¢ ¡ãä¥à ®¡¬¥­ ' -I" ?define COPY_PATH_STR "'<27>ãâì ¯ ¯ª¨ ᪮¯¨à®¢ ­ ¢ ¡ãä¥à ®¡¬¥­ ' -I"
?define T_ABOUT "Ž ¯à®£à ¬¬¥" ?define T_ABOUT "Ž ¯à®£à ¬¬¥"
?define T_USE_SHIFT_ENTER "'ˆá¯®«ì§ã©â¥ Shift+Enter çâ®¡ë ®âªàëâì ¢á¥ ¢ë¤¥«¥­­ë¥ ä ©«ë.' -I"
#else #else
?define T_FILE "File" ?define T_FILE "File"
?define T_TYPE "Type" ?define T_TYPE "Type"
@ -57,4 +58,5 @@
?define T_STATUS_SELECTED "Selected: %d" ?define T_STATUS_SELECTED "Selected: %d"
?define COPY_PATH_STR "'Directory path copied to clipboard' -I" ?define COPY_PATH_STR "'Directory path copied to clipboard' -I"
?define T_ABOUT "About" ?define T_ABOUT "About"
?define T_USE_SHIFT_ENTER "'Use Shift+Enter to open all selected files.' -I"
#endif #endif