Permalink
Browse files

initial commit

  • Loading branch information...
0 parents commit da444a8c681e7ed1298f349cd773234c59b8c5ab @Autre31415 Autre31415 committed Jun 16, 2016
Showing with 180 additions and 0 deletions.
  1. +22 −0 .gitignore
  2. +70 −0 README.md
  3. +7 −0 bower.json
  4. +10 −0 build.js
  5. BIN images/appicon.icns
  6. BIN images/appicon.ico
  7. BIN images/appicon.png
  8. +37 −0 main.js
  9. +14 −0 package.json
  10. +20 −0 renderer.js
@@ -0,0 +1,22 @@
+lib-cov
+*.seed
+*.log
+*.csv
+*.dat
+*.out
+*.pid
+*.gz
+
+pids
+logs
+results
+
+npm-debug.log
+.DS_Store
+node_modules
+bower_components
+build
+
+.jshintrc
+
+Glyphr_Studio_Autohacked_For_Electron.html
@@ -0,0 +1,70 @@
+Glyphr Studio Desktop
+===
+
+Glyphr Studio was just begging to be a desktop application so here it is!
+
+How to run from source
+===
+
+Be sure to have [Node.js](https://nodejs.org) and [git](https://git-scm.com) installed.
+
+Then:
+
+```
+git clone https://github.com/Autre31415/Glyphr-Studio-Desktop.git
+cd Glyphr-Studio-Desktop
+npm i
+bower i
+node build.js
+```
+
+Build
+===
+
+Be sure to have [Node.js](https://nodejs.org) and [git](https://git-scm.com) installed.
+
+Then:
+
+```
+git clone https://github.com/Autre31415/Glyphr-Studio-Desktop.git
+cd Glyphr-Studio-Desktop
+npm i
+bower i
+node build.js
+```
+
+Then using [electron-packager](https://github.com/maxogden/electron-packager):
+
+Mac 64-bit:
+
+```
+electron-packager ./ "Glyphr Studio" --app-bundle-id=glyphr-studio-desktop --icon=images/appicon.icns --out=build --overwrite=true --platform=darwin --arch=x64 --version=1.2.1 --app-version=0.1.0
+```
+
+Linux 32-bit:
+
+```
+electron-packager ./ "Glyphr Studio" --app-bundle-id=glyphr-studio-desktop --out=build --overwrite=true --platform=linux --arch=ia32 --version=1.2.1 --app-version=0.1.0
+```
+
+Linux 64-bit:
+
+```
+electron-packager ./ "Glyphr Studio" --app-bundle-id=glyphr-studio-desktop --out=build --overwrite=true --platform=linux --arch=x64 --version=1.2.1 --app-version=0.1.0
+```
+Windows 64-bit:
+
+```
+electron-packager ./ "Glyphr Studio" --app-bundle-id=glyphr-studio-desktop --version-string.FileDescription="Glyphr Studio Desktop" --icon=images/appicon.ico --out=build --overwrite=true --platform=win32 --arch=x64 --version=1.2.1 --app-version=0.1.0
+```
+
+Windows 32-bit:
+
+```
+electron-packager ./ "Glyphr Studio" --app-bundle-id=glyphr-studio-desktop --version-string.FileDescription="Glyphr Studio Desktop" --icon=images/appicon.ico --out=build --overwrite=true --platform=win32 --arch=ia32 --version=1.2.1 --app-version=0.1.0
+```
+
+Known Issues
+===
+
+popOut button not working as intended.
@@ -0,0 +1,7 @@
+{
+ "name": "glyphr-studio-desktop",
+ "private": false,
+ "dependencies": {
+ "glyphr-studio": "git://github.com/mattlag/Glyphr-Studio.git#v1.04.04"
+ }
+}
@@ -0,0 +1,10 @@
+const fs = require('fs');
+
+var html,
+ injectScript,
+ htmlPath = 'bower_components/glyphr-studio/dev/Glyphr_Studio.html',
+ autoHackPath = 'bower_components/glyphr-studio/dev/Glyphr_Studio_Autohacked_For_Electron.html';
+
+html = fs.readFileSync(htmlPath).toString();
+injectScript = html.replace('<\/body>', '<script>require(\'..\/..\/..\/renderer.js\')<\/script><\/body>');
+fs.writeFileSync(autoHackPath, injectScript);
Binary file not shown.
Binary file not shown.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@@ -0,0 +1,37 @@
+const electron = require('electron'),
+ {app} = electron,
+ {BrowserWindow} = electron,
+ open = require('open');
+
+let win;
+
+function createWindow () {
+ win = new BrowserWindow({width: 1000, height: 800, minWidth: 1000, minHeight: 800,});
+ win.loadURL('file://' + __dirname + '/bower_components/glyphr-studio/dev/Glyphr_Studio_Autohacked_For_Electron.html');
+
+ let webContents = win.webContents;
+
+ webContents.on('new-window', function(event, url){
+ event.preventDefault();
+ open(url);
+ });
+
+ // webContents.openDevTools()
+
+ win.on('closed', function () {
+ win = null;
+ });
+};
+
+app.on('ready', createWindow);
+
+app.on('window-all-closed', function () {
+ if (process.platform != 'darwin')
+ app.quit();
+});
+
+app.on('activate', function () {
+ if (win === null) {
+ createWindow();
+ }
+});
@@ -0,0 +1,14 @@
+{
+ "name": "glyphr-studio-desktop",
+ "version": "0.1.0",
+ "description": "A desktop client for Glyphr",
+ "main": "main.js",
+ "dependencies": {
+ "open": "0.0.5"
+ },
+ "devDependencies": {
+ "electron-prebuilt": "^1.2.0",
+ "electron-packager": "^7.0.0",
+ "bower": "1.7.9"
+ }
+}
@@ -0,0 +1,20 @@
+const {dialog} = require('electron').remote;
+
+window.addEventListener('beforeunload', function (event) {
+ window.onbeforeunload = confirmClose();
+});
+
+function confirmClose (event) {
+ var confirm = dialog.showMessageBox({
+ type: 'question',
+ buttons: ['No', 'Yes', 'Cancel'],
+ message: 'Would you like to save before closing?'
+ });
+
+ if (confirm === 1) {
+ saveGlyphrProjectFile();
+ }
+ if (confirm === 2) {
+ event.preventDefault;
+ };
+};

0 comments on commit da444a8

Please sign in to comment.