Commit f1e4c9a4 authored by Jonathan Wilkes's avatar Jonathan Wilkes
Browse files

Merge branch 'prakhar/purr-data-short_native' into emscripten

parents 590707b2 827f99c2
Pipeline #3686 canceled with stage
...@@ -220,6 +220,7 @@ function add_shortcuts(cid){ ...@@ -220,6 +220,7 @@ function add_shortcuts(cid){
document.onkeydown = function (e){ document.onkeydown = function (e){
// Check modifiers // Check modifiers
var shortcut = e.ctrlKey ? "Ctrl+": ""; var shortcut = e.ctrlKey ? "Ctrl+": "";
shortcut += e.metaKey ? "Cmd+": "";
shortcut += e.shiftKey ? "Shift+": ""; shortcut += e.shiftKey ? "Shift+": "";
shortcut += e.altKey ? "Alt+": ""; shortcut += e.altKey ? "Alt+": "";
// Add key // Add key
......
...@@ -71,30 +71,30 @@ exports.menu = { ...@@ -71,30 +71,30 @@ exports.menu = {
// Webapp shortcuts // Webapp shortcuts
"new_web": { key: "N", modifiers: cmd_or_ctrl + "+Alt"}, "new_web": { key: "N", modifiers: cmd_or_ctrl },
"open_web": { key: "O", modifiers: cmd_or_ctrl + "+Alt"}, "open_web": { key: "O", modifiers: cmd_or_ctrl },
"save_web": { key: "S", modifiers: cmd_or_ctrl + "+Alt" }, "save_web": { key: "S", modifiers: cmd_or_ctrl },
"saveas_web": { key: "S", modifiers: cmd_or_ctrl + "+Shift" }, "saveas_web": { key: "S", modifiers: cmd_or_ctrl + "+Shift" },
"print_web": { key: "P", modifiers: cmd_or_ctrl + "+Alt" }, "print_web": { key: "P", modifiers: cmd_or_ctrl },
"message_web" : { key: "M", modifiers: cmd_or_ctrl + "+Alt"}, "message_web" : { key: "M", modifiers: cmd_or_ctrl },
"close_web": { key: "W", modifiers: cmd_or_ctrl + "+Alt" }, "close_web": { key: "W", modifiers: cmd_or_ctrl },
"undo_web": { key: "Z", modifiers: cmd_or_ctrl + "+Alt" }, "undo_web": { key: "Z", modifiers: cmd_or_ctrl },
"redo_web": { key: "Z", modifiers: cmd_or_ctrl + "+Shift+Alt" }, "redo_web": { key: "Z", modifiers: cmd_or_ctrl + "+Shift" },
"selectall_web":{ key: "Q", modifiers: cmd_or_ctrl + "+Shift"}, "selectall_web":{ key: "Q", modifiers: cmd_or_ctrl + "+Shift"},
"cut_web": { key: "X", modifiers: cmd_or_ctrl + "+Shift" }, "cut_web": { key: "X", modifiers: cmd_or_ctrl + "+Shift" },
"copy_web": { key: "C", modifiers: cmd_or_ctrl + "+Alt"}, "copy_web": { key: "C", modifiers: cmd_or_ctrl },
"paste_web": { key: "V", modifiers: cmd_or_ctrl + "+Alt" }, "paste_web": { key: "V", modifiers: cmd_or_ctrl },
"paste_clipboard_web": { key: "G", modifiers: cmd_or_ctrl + "+Shift+Alt" }, "paste_clipboard_web": { key: "G", modifiers: cmd_or_ctrl + "+Shift" },
"duplicate_web": { key: "D", modifiers: cmd_or_ctrl + "+Alt" }, "duplicate_web": { key: "D", modifiers: cmd_or_ctrl },
"reselect_web": { key: "Q", modifiers: cmd_or_ctrl + "+Shift+Alt" }, "reselect_web": { key: "Q", modifiers: cmd_or_ctrl + "+Shift" },
"clear_console_web": { key: "L", modifiers: cmd_or_ctrl + "+Shift+Alt" }, "clear_console_web": { key: "L", modifiers: cmd_or_ctrl + "+Shift" },
"tidyup_web": { key: "Y", modifiers: cmd_or_ctrl + "+Alt" }, "tidyup_web": { key: "Y", modifiers: cmd_or_ctrl },
"cordinspector_web": { key: "R", modifiers: cmd_or_ctrl + "+Shift+Alt" }, "cordinspector_web": { key: "R", modifiers: cmd_or_ctrl + "+Shift" },
"find_web": { key: "F", modifiers: cmd_or_ctrl + "+Alt"}, "find_web": { key: "F", modifiers: cmd_or_ctrl },
"findagain_web":{ key: "F", modifiers: cmd_or_ctrl + "+Shift+Alt"}, "findagain_web":{ key: "F", modifiers: cmd_or_ctrl + "+Shift"},
"editmode_web": { key: "E", modifiers: cmd_or_ctrl + "+Shift+Alt" }, "editmode_web": { key: "E", modifiers: cmd_or_ctrl + "+Shift" },
"preferences_web": { key: (process.platform === "darwin") ? "," : "P", "preferences_web": { key: (process.platform === "darwin") ? "," : "P",
modifiers: cmd_or_ctrl }, modifiers: cmd_or_ctrl },
...@@ -102,34 +102,34 @@ exports.menu = { ...@@ -102,34 +102,34 @@ exports.menu = {
"zoomout_web": { key: "-", modifiers: cmd_or_ctrl }, "zoomout_web": { key: "-", modifiers: cmd_or_ctrl },
"zoomreset_web": { key: "0", modifiers: cmd_or_ctrl }, "zoomreset_web": { key: "0", modifiers: cmd_or_ctrl },
"zoomoptimal_web": { key: "9", modifiers: cmd_or_ctrl }, "zoomoptimal_web": { key: "9", modifiers: cmd_or_ctrl },
"zoomhoriz_web": { key: "9", modifiers: cmd_or_ctrl + "+Alt" }, "zoomhoriz_web": { key: "9", modifiers: cmd_or_ctrl },
"zoomvert_web": { key: "9", modifiers: cmd_or_ctrl + "+Shift" }, "zoomvert_web": { key: "9", modifiers: cmd_or_ctrl + "+Shift" },
"fullscreen_web": { key: (process.platform === "darwin") ? "F" : "F11", "fullscreen_web": { key: (process.platform === "darwin") ? "F" : "F11",
modifiers: (process.platform === "darwin") ? "Cmd+Ctrl" : null }, modifiers: (process.platform === "darwin") ? "Cmd+Ctrl" : null },
"object_web": { key: "1", modifiers: cmd_or_ctrl + "+Alt" }, "object_web": { key: "1", modifiers: cmd_or_ctrl },
"msgbox_web": { key: "2", modifiers: cmd_or_ctrl + "+Alt" }, "msgbox_web": { key: "2", modifiers: cmd_or_ctrl },
"number_web": { key: "3", modifiers: cmd_or_ctrl + "+Alt" }, "number_web": { key: "3", modifiers: cmd_or_ctrl },
"symbol_web": { key: "4", modifiers: cmd_or_ctrl + "+Alt" }, "symbol_web": { key: "4", modifiers: cmd_or_ctrl },
"comment_web": { key: "5", modifiers: cmd_or_ctrl + "+Alt" }, "comment_web": { key: "5", modifiers: cmd_or_ctrl },
"dropdown_web": { key: "M", modifiers: cmd_or_ctrl + "+Shift+Alt" }, "dropdown_web": { key: "M", modifiers: cmd_or_ctrl + "+Shift" },
"bang_web": { key: "B", modifiers: cmd_or_ctrl + "+Shift+Alt" }, "bang_web": { key: "B", modifiers: cmd_or_ctrl + "+Shift" },
"toggle_web": { key: "T", modifiers: cmd_or_ctrl + "+Shift+Alt" }, "toggle_web": { key: "T", modifiers: cmd_or_ctrl + "+Shift" },
"number2_web": { key: "N", modifiers: cmd_or_ctrl + "+Shift+Alt" }, "number2_web": { key: "N", modifiers: cmd_or_ctrl + "+Shift" },
"vslider_web": { key: "V", modifiers: cmd_or_ctrl + "+Shift+Alt" }, "vslider_web": { key: "V", modifiers: cmd_or_ctrl + "+Shift" },
"hslider_web": { key: "H", modifiers: cmd_or_ctrl + "+Shift+Alt" }, "hslider_web": { key: "H", modifiers: cmd_or_ctrl + "+Shift" },
"vradio_web": { key: "D", modifiers: cmd_or_ctrl + "+Shift+Alt" }, "vradio_web": { key: "D", modifiers: cmd_or_ctrl + "+Shift" },
"hradio_web": { key: "I", modifiers: cmd_or_ctrl + "+Shift+Alt" }, "hradio_web": { key: "I", modifiers: cmd_or_ctrl + "+Shift" },
"vu_web": { key: "U", modifiers: cmd_or_ctrl + "+Shift+Alt" }, "vu_web": { key: "U", modifiers: cmd_or_ctrl + "+Shift" },
"cnv_web": { key: "C", modifiers: cmd_or_ctrl + "+Shift+Alt" }, "cnv_web": { key: "C", modifiers: cmd_or_ctrl + "+Shift" },
"nextwin_web": { key: "PageDown", modifiers: cmd_or_ctrl + "+Alt"}, "nextwin_web": { key: "PageDown", modifiers: cmd_or_ctrl },
"prevwin_web": { key: "PageUp", modifiers: cmd_or_ctrl + "+Alt"}, "prevwin_web": { key: "PageUp", modifiers: cmd_or_ctrl },
"pdwin_web": { key: "R", modifiers: cmd_or_ctrl }, "pdwin_web": { key: "R", modifiers: cmd_or_ctrl },
"audio_on_web": { key: "/", modifiers: cmd_or_ctrl + "+Alt"}, "audio_on_web": { key: "/", modifiers: cmd_or_ctrl },
"audio_off_web": { key: ".", modifiers: cmd_or_ctrl + "+Alt"}, "audio_off_web": { key: ".", modifiers: cmd_or_ctrl },
"browser_web": { key: "B", modifiers: cmd_or_ctrl + "+Alt" }, "browser_web": { key: "B", modifiers: cmd_or_ctrl },
} }
...@@ -12,8 +12,16 @@ function is_webapp(){ ...@@ -12,8 +12,16 @@ function is_webapp(){
} }
return true; return true;
} }
exports.is_webapp = is_webapp; exports.is_webapp = is_webapp;
if (is_webapp()) {
if (navigator.platform.toUpperCase().indexOf("MAC") > -1) {
process.platform = "darwin";
} else if (navigator.platform.toUpperCase().indexOf("WIN") > -1) {
process.platform = "win32";
}
}
exports.set_pwd = function(pwd_string) { exports.set_pwd = function(pwd_string) {
pwd = pwd_string; pwd = pwd_string;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment