Commit 59a121f4 authored by Prakhar Agarwal's avatar Prakhar Agarwal 🎯
Browse files

Merge branch 'emscripten' into toggle_sidebar

parents b695f617 0d47f179
......@@ -67,7 +67,7 @@ build: $(BUILD_PATH)
project: $(INSTALL_PATH)
cp -rf $(PD_PATH)/nw/dialog_*.html $</components/dialogs/
cp -rf $(PD_PATH)/nw/css/*.css $</css/
cd $< && npm install && npm run-script build && npm start
cd $< && npm install && npm run build && npm start
clean:
find $(PURR_DIR)/externals -name "*.wasm" -type f -delete
......
......@@ -66,7 +66,22 @@ cd purr-data
git checkout emscripten
make emscripten
```
### Setting up the project (Windows)
```
Method 1
- git clone https://git.purrdata.net/jwilkes/purr-data.git
- cd purr-data
- run command npm install.
- Change directory to purr-data/emscripten/project/purr-data.
- run command npm run build.
- run command npm start.
Method 2
- Follow the steps given in the link inorder to install Ubuntu LTS (https://docs.microsoft.com/en-us/windows/wsl/) .
- Then follow the steps mentioned in above sections for Linux.
```
### Running Purr Data in a web browser
- After the building is successfully completed, visit http://localhost:5000 in your browser.
- You can run `npm start` under `purr-data/emscripten/project/purr-data` to run the app again.
......
......@@ -28,11 +28,11 @@
<li id="edit-reselect"></li>
<li id="edit-tidyup"></li>
<li id="edit-font"></li>
<li id="edit-cordinspector"><input type="checkbox" id="cordinspector"></li>
<li id="edit-cordinspector"><input type="checkbox" class= "ml-2" id="cordinspector"></li>
<li id="edit-find"></li>
<li id="edit-findagain"></li>
<li id="edit-finderror"></li>
<li id="edit-editmode"><input type="checkbox" id="editmode"></li>
<li id="edit-editmode"><input type="checkbox" class= "ml-2" id="editmode"></li>
</ul>
</li>
......
......@@ -8,42 +8,42 @@
<label>
<li id="file-open">
</li>
<input id="uploadPatch" type="file" onchange="pdbundle.pdgui.upload_patch(this.files)" multiple>
<input id="uploadPatch" type="file" onchange="pdbundle.pdgui.upload_patch(this.files)" multiple>
</label>
<!-- Recent Files submenu -->
<li id="file-recent-files">
</li>
<!-- End canvas specific -->
<li id="file-message"></li>
<li id="file-close"></li>
<li id="file-quit"></li>
</ul>
</li>
<!-- Edit section -->
<li id="menu-edit">
<ul>
<li id="edit-copy"></li>
<li id="edit-selectall"></li>
<li id="edit-clear-console"></li>
<ul>
<li id="edit-copy"></li>
<li id="edit-selectall"></li>
<li id="edit-clear-console"></li>
<li id="edit-find"></li>
<li id="edit-preferences"></li>
</ul>
</li>
<!-- View Section -->
<li id="menu-view">
<ul>
<li id="view-zoomin"></li>
<li id="view-zoomout"></li>
<li id="view-zoomout"></li>
<li id="view-zoomreset"></li>
<li id="view-fullscreen"></li>
</ul>
</li>
<!-- Media section -->
<li id="menu-media">
<ul>
......@@ -54,7 +54,7 @@
<li id="media-loadmeter"></li>
</ul>
</li>
<!-- Window section -->
<li id="menu-window">
<ul>
......@@ -62,7 +62,7 @@
<li id="window-prevwin"></li>
</ul>
</li>
<!-- Help section -->
<li id="menu-help">
<ul>
......@@ -77,8 +77,5 @@
</ul>
</li>
</ul>
</nav>
</div>
\ No newline at end of file
</nav>
</div>
\ No newline at end of file
This diff is collapsed.
......@@ -134,11 +134,11 @@ function add_shortcuts(cid){
document.onkeydown = function (e){
// Check modifiers
var shortcut = e.ctrlKey ? "ctrl+": "";
shortcut += e.shiftKey ? "shift+": "";
shortcut += e.altKey ? "alt+": "";
var shortcut = e.ctrlKey ? "Ctrl+": "";
shortcut += e.shiftKey ? "Shift+": "";
shortcut += e.altKey ? "Alt+": "";
// Add key
shortcut += e.key.toLowerCase();
shortcut += e.key.toUpperCase();
if(window.shortkeys[cid].hasOwnProperty(shortcut)){
window.shortkeys[cid][shortcut].click();
}
......
"use strict";
var cmd_or_ctrl = (process.platform === "darwin") ? "cmd" : "ctrl";
var cmd_or_ctrl = (process.platform === "darwin") ? "Cmd" : "Ctrl";
exports.menu = {
"new": { key: "n", modifiers: cmd_or_ctrl },
"open": { key: "o", modifiers: cmd_or_ctrl },
"save": { key: "s", modifiers: cmd_or_ctrl },
"saveas": { key: "s", modifiers: cmd_or_ctrl + "+shift" },
"print": { key: "p", modifiers: cmd_or_ctrl + "+shift" },
"message" : { key: "m", modifiers: cmd_or_ctrl },
"close": { key: "w", modifiers: cmd_or_ctrl },
"quit": { key: "q", modifiers: cmd_or_ctrl },
"undo": { key: "z", modifiers: cmd_or_ctrl },
"redo": { key: "z", modifiers: cmd_or_ctrl + "+shift" },
"selectall":{ key: "a", modifiers: cmd_or_ctrl },
"cut": { key: "x", modifiers: cmd_or_ctrl },
"copy": { key: "c", modifiers: cmd_or_ctrl },
"paste": { key: "v", modifiers: cmd_or_ctrl },
"paste_clipboard": { key: "v", modifiers: cmd_or_ctrl + "+alt" },
"duplicate": { key: "d", modifiers: cmd_or_ctrl },
"undo": { key: "z", modifiers: cmd_or_ctrl },
"new": { key: "N", modifiers: cmd_or_ctrl },
"open": { key: "O", modifiers: cmd_or_ctrl },
"save": { key: "S", modifiers: cmd_or_ctrl },
"saveas": { key: "S", modifiers: cmd_or_ctrl + "+Shift" },
"print": { key: "P", modifiers: cmd_or_ctrl + "+Shift" },
"message" : { key: "M", modifiers: cmd_or_ctrl },
"close": { key: "W", modifiers: cmd_or_ctrl },
"quit": { key: "Q", modifiers: cmd_or_ctrl },
"undo": { key: "Z", modifiers: cmd_or_ctrl },
"redo": { key: "Z", modifiers: cmd_or_ctrl + "+Shift" },
"selectall":{ key: "A", modifiers: cmd_or_ctrl },
"cut": { key: "X", modifiers: cmd_or_ctrl },
"copy": { key: "C", modifiers: cmd_or_ctrl },
"paste": { key: "V", modifiers: cmd_or_ctrl },
"paste_clipboard": { key: "V", modifiers: cmd_or_ctrl + "+Alt" },
"duplicate": { key: "D", modifiers: cmd_or_ctrl },
"undo": { key: "Z", modifiers: cmd_or_ctrl },
"reselect": { key: String.fromCharCode(10), modifiers: cmd_or_ctrl },
"clear_console": { key: "l", modifiers: cmd_or_ctrl + "+shift" },
"tidyup": { key: "y", modifiers: cmd_or_ctrl },
"cordinspector": { key: "r", modifiers: cmd_or_ctrl + "+shift" },
"find": { key: "f", modifiers: cmd_or_ctrl },
"findagain":{ key: "g", modifiers: cmd_or_ctrl },
"editmode": { key: "e", modifiers: cmd_or_ctrl },
"preferences": { key: (process.platform === "darwin") ? "," : "p",
"clear_console": { key: "L", modifiers: cmd_or_ctrl + "+Shift" },
"tidyup": { key: "Y", modifiers: cmd_or_ctrl },
"cordinspector": { key: "R", modifiers: cmd_or_ctrl + "+Shift" },
"find": { key: "F", modifiers: cmd_or_ctrl },
"findagain":{ key: "G", modifiers: cmd_or_ctrl },
"editmode": { key: "E", modifiers: cmd_or_ctrl },
"preferences": { key: (process.platform === "darwin") ? "," : "P",
modifiers: cmd_or_ctrl },
"zoomin": { key: "=", modifiers: cmd_or_ctrl },
"zoomout": { key: "-", modifiers: cmd_or_ctrl },
"zoomreset": { key: "0", modifiers: cmd_or_ctrl },
"zoomoptimal": { key: "9", modifiers: cmd_or_ctrl },
"zoomhoriz": { key: "9", modifiers: cmd_or_ctrl + "+alt" },
"zoomvert": { key: "9", modifiers: cmd_or_ctrl + "+shift" },
"fullscreen": { key: (process.platform === "darwin") ? "f" : "F11",
modifiers: (process.platform === "darwin") ? "cmd+ctrl" : null },
"zoomhoriz": { key: "9", modifiers: cmd_or_ctrl + "+Alt" },
"zoomvert": { key: "9", modifiers: cmd_or_ctrl + "+Shift" },
"fullscreen": { key: (process.platform === "darwin") ? "F" : "F11",
modifiers: (process.platform === "darwin") ? "Cmd+Ctrl" : null },
"object": { key: "1", modifiers: cmd_or_ctrl },
"msgbox": { key: "2", modifiers: cmd_or_ctrl },
......@@ -47,89 +47,89 @@ exports.menu = {
"symbol": { key: "4", modifiers: cmd_or_ctrl },
"comment": { key: "5", modifiers: cmd_or_ctrl },
"dropdown": { key: "6", modifiers: cmd_or_ctrl },
"bang": { key: "b", modifiers: cmd_or_ctrl + "+shift" },
"toggle": { key: "t", modifiers: cmd_or_ctrl + "+shift" },
"number2": { key: "n", modifiers: cmd_or_ctrl + "+shift" },
"vslider": { key: "v", modifiers: cmd_or_ctrl + "+shift" },
"hslider": { key: "h", modifiers: cmd_or_ctrl + "+shift" },
"vradio": { key: "d", modifiers: cmd_or_ctrl + "+shift" },
"hradio": { key: "i", modifiers: cmd_or_ctrl + "+shift" },
"vu": { key: "u", modifiers: cmd_or_ctrl + "+shift" },
"cnv": { key: "c", modifiers: cmd_or_ctrl + "+shift" },
"bang": { key: "B", modifiers: cmd_or_ctrl + "+Shift" },
"toggle": { key: "T", modifiers: cmd_or_ctrl + "+Shift" },
"number2": { key: "N", modifiers: cmd_or_ctrl + "+Shift" },
"vslider": { key: "V", modifiers: cmd_or_ctrl + "+Shift" },
"hslider": { key: "H", modifiers: cmd_or_ctrl + "+Shift" },
"vradio": { key: "D", modifiers: cmd_or_ctrl + "+Shift" },
"hradio": { key: "I", modifiers: cmd_or_ctrl + "+Shift" },
"vu": { key: "U", modifiers: cmd_or_ctrl + "+Shift" },
"cnv": { key: "C", modifiers: cmd_or_ctrl + "+Shift" },
"nextwin": { key: "PageDown", modifiers: cmd_or_ctrl },
"prevwin": { key: "PageUp", modifiers: cmd_or_ctrl },
"pdwin": { key: "r", modifiers: cmd_or_ctrl },
"pdwin": { key: "R", modifiers: cmd_or_ctrl },
"audio_on": { key: "/", modifiers: cmd_or_ctrl },
"audio_off": { key: ".", modifiers: cmd_or_ctrl },
"browser": { key: "b", modifiers: cmd_or_ctrl },
"browser": { key: "B", modifiers: cmd_or_ctrl },
"audio_off": { key: ".", modifiers: cmd_or_ctrl },
"audio_off": { key: ".", modifiers: cmd_or_ctrl },
"audio_off": { key: ".", modifiers: cmd_or_ctrl },
// Webapp shortcuts
"new_web": { key: "n", modifiers: cmd_or_ctrl + "+alt"},
"open_web": { key: "o", modifiers: cmd_or_ctrl + "+alt"},
"save_web": { key: "s", modifiers: cmd_or_ctrl + "+alt" },
"saveas_web": { key: "s", modifiers: cmd_or_ctrl + "+shift" },
"print_web": { key: "p", modifiers: cmd_or_ctrl + "+alt" },
"message_web" : { key: "m", modifiers: cmd_or_ctrl + "+alt"},
"close_web": { key: "w", modifiers: cmd_or_ctrl + "+alt" },
"undo_web": { key: "z", modifiers: cmd_or_ctrl + "+alt" },
"redo_web": { key: "z", modifiers: cmd_or_ctrl + "+shift+alt" },
"selectall_web":{ key: "q", modifiers: cmd_or_ctrl + "+shift"},
"cut_web": { key: "x", modifiers: cmd_or_ctrl + "+shift" },
"copy_web": { key: "c", modifiers: cmd_or_ctrl + "+alt"},
"paste_web": { key: "v", modifiers: cmd_or_ctrl + "+alt" },
"paste_clipboard_web": { key: "g", modifiers: cmd_or_ctrl + "+shift+alt" },
"duplicate_web": { key: "d", modifiers: cmd_or_ctrl + "+alt" },
"reselect_web": { key: "q", modifiers: cmd_or_ctrl + "+shift+alt" },
"clear_console_web": { key: "l", modifiers: cmd_or_ctrl + "+shift+alt" },
"tidyup_web": { key: "y", modifiers: cmd_or_ctrl + "+alt" },
"cordinspector_web": { key: "r", modifiers: cmd_or_ctrl + "+shift+alt" },
"find_web": { key: "f", modifiers: cmd_or_ctrl + "+alt"},
"findagain_web":{ key: "f", modifiers: cmd_or_ctrl + "+shift+alt"},
"editmode_web": { key: "e", modifiers: cmd_or_ctrl + "+shift+alt" },
"preferences_web": { key: (process.platform === "darwin") ? "," : "p",
"new_web": { key: "N", modifiers: cmd_or_ctrl + "+Alt"},
"open_web": { key: "O", modifiers: cmd_or_ctrl + "+Alt"},
"save_web": { key: "S", modifiers: cmd_or_ctrl + "+Alt" },
"saveas_web": { key: "S", modifiers: cmd_or_ctrl + "+Shift" },
"print_web": { key: "P", modifiers: cmd_or_ctrl + "+Alt" },
"message_web" : { key: "M", modifiers: cmd_or_ctrl + "+Alt"},
"close_web": { key: "W", modifiers: cmd_or_ctrl + "+Alt" },
"undo_web": { key: "Z", modifiers: cmd_or_ctrl + "+Alt" },
"redo_web": { key: "Z", modifiers: cmd_or_ctrl + "+Shift+Alt" },
"selectall_web":{ key: "Q", modifiers: cmd_or_ctrl + "+Shift"},
"cut_web": { key: "X", modifiers: cmd_or_ctrl + "+Shift" },
"copy_web": { key: "C", modifiers: cmd_or_ctrl + "+Alt"},
"paste_web": { key: "V", modifiers: cmd_or_ctrl + "+Alt" },
"paste_clipboard_web": { key: "G", modifiers: cmd_or_ctrl + "+Shift+Alt" },
"duplicate_web": { key: "D", modifiers: cmd_or_ctrl + "+Alt" },
"reselect_web": { key: "Q", modifiers: cmd_or_ctrl + "+Shift+Alt" },
"clear_console_web": { key: "L", modifiers: cmd_or_ctrl + "+Shift+Alt" },
"tidyup_web": { key: "Y", modifiers: cmd_or_ctrl + "+Alt" },
"cordinspector_web": { key: "R", modifiers: cmd_or_ctrl + "+Shift+Alt" },
"find_web": { key: "F", modifiers: cmd_or_ctrl + "+Alt"},
"findagain_web":{ key: "F", modifiers: cmd_or_ctrl + "+Shift+Alt"},
"editmode_web": { key: "E", modifiers: cmd_or_ctrl + "+Shift+Alt" },
"preferences_web": { key: (process.platform === "darwin") ? "," : "P",
modifiers: cmd_or_ctrl },
"zoomin_web": { key: "=", modifiers: cmd_or_ctrl },
"zoomout_web": { key: "-", modifiers: cmd_or_ctrl },
"zoomreset_web": { key: "0", modifiers: cmd_or_ctrl },
"zoomoptimal_web": { key: "9", modifiers: cmd_or_ctrl },
"zoomhoriz_web": { key: "9", modifiers: cmd_or_ctrl + "+alt" },
"zoomvert_web": { key: "9", modifiers: cmd_or_ctrl + "+shift" },
"fullscreen_web": { key: (process.platform === "darwin") ? "f" : "F11",
modifiers: (process.platform === "darwin") ? "cmd+ctrl" : null },
"object_web": { key: "1", modifiers: cmd_or_ctrl + "+alt" },
"msgbox_web": { key: "2", modifiers: cmd_or_ctrl + "+alt" },
"number_web": { key: "3", modifiers: cmd_or_ctrl + "+alt" },
"symbol_web": { key: "4", modifiers: cmd_or_ctrl + "+alt" },
"comment_web": { key: "5", modifiers: cmd_or_ctrl + "+alt" },
"dropdown_web": { key: "m", modifiers: cmd_or_ctrl + "+shift+alt" },
"bang_web": { key: "b", modifiers: cmd_or_ctrl + "+shift+alt" },
"toggle_web": { key: "t", modifiers: cmd_or_ctrl + "+shift+alt" },
"number2_web": { key: "n", modifiers: cmd_or_ctrl + "+shift+alt" },
"vslider_web": { key: "v", modifiers: cmd_or_ctrl + "+shift+alt" },
"hslider_web": { key: "h", modifiers: cmd_or_ctrl + "+shift+alt" },
"vradio_web": { key: "d", modifiers: cmd_or_ctrl + "+shift+alt" },
"hradio_web": { key: "i", modifiers: cmd_or_ctrl + "+shift+alt" },
"vu_web": { key: "u", modifiers: cmd_or_ctrl + "+shift+alt" },
"cnv_web": { key: "c", modifiers: cmd_or_ctrl + "+shift+alt" },
"nextwin_web": { key: "PageDown", modifiers: cmd_or_ctrl + "+alt"},
"prevwin_web": { key: "PageUp", modifiers: cmd_or_ctrl + "+alt"},
"pdwin_web": { key: "r", modifiers: cmd_or_ctrl },
"audio_on_web": { key: "/", modifiers: cmd_or_ctrl + "+alt"},
"audio_off_web": { key: ".", modifiers: cmd_or_ctrl + "+alt"},
"browser_web": { key: "b", modifiers: cmd_or_ctrl + "+alt" },
"zoomhoriz_web": { key: "9", modifiers: cmd_or_ctrl + "+Alt" },
"zoomvert_web": { key: "9", modifiers: cmd_or_ctrl + "+Shift" },
"fullscreen_web": { key: (process.platform === "darwin") ? "F" : "F11",
modifiers: (process.platform === "darwin") ? "Cmd+Ctrl" : null },
"object_web": { key: "1", modifiers: cmd_or_ctrl + "+Alt" },
"msgbox_web": { key: "2", modifiers: cmd_or_ctrl + "+Alt" },
"number_web": { key: "3", modifiers: cmd_or_ctrl + "+Alt" },
"symbol_web": { key: "4", modifiers: cmd_or_ctrl + "+Alt" },
"comment_web": { key: "5", modifiers: cmd_or_ctrl + "+Alt" },
"dropdown_web": { key: "m", modifiers: cmd_or_ctrl + "+Shift+Alt" },
"bang_web": { key: "B", modifiers: cmd_or_ctrl + "+Shift+Alt" },
"toggle_web": { key: "T", modifiers: cmd_or_ctrl + "+Shift+Alt" },
"number2_web": { key: "N", modifiers: cmd_or_ctrl + "+Shift+Alt" },
"vslider_web": { key: "V", modifiers: cmd_or_ctrl + "+Shift+Alt" },
"hslider_web": { key: "H", modifiers: cmd_or_ctrl + "+Shift+Alt" },
"vradio_web": { key: "D", modifiers: cmd_or_ctrl + "+Shift+Alt" },
"hradio_web": { key: "I", modifiers: cmd_or_ctrl + "+Shift+Alt" },
"vu_web": { key: "U", modifiers: cmd_or_ctrl + "+Shift+Alt" },
"cnv_web": { key: "C", modifiers: cmd_or_ctrl + "+Shift+Alt" },
"nextwin_web": { key: "PageDown", modifiers: cmd_or_ctrl + "+Alt"},
"prevwin_web": { key: "PageUp", modifiers: cmd_or_ctrl + "+Alt"},
"pdwin_web": { key: "R", modifiers: cmd_or_ctrl },
"audio_on_web": { key: "/", modifiers: cmd_or_ctrl + "+Alt"},
"audio_off_web": { key: ".", modifiers: cmd_or_ctrl + "+Alt"},
"browser_web": { key: "B", modifiers: cmd_or_ctrl + "+Alt" },
}
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