diff options
| author | Pliable Pixels <pliablepixels@gmail.com> | 2018-09-19 20:07:00 -0400 |
|---|---|---|
| committer | Pliable Pixels <pliablepixels@gmail.com> | 2018-09-19 20:07:00 -0400 |
| commit | 5a6e55155a74e3d6d07b826263f682c22999e99c (patch) | |
| tree | c210907c68713313987302446f27c17094c64a98 | |
| parent | 0580c6319a424e21c7a071f3ce741fa7e9e5de70 (diff) | |
sneak in a new window mechanism #706
37 files changed, 165 insertions, 101 deletions
diff --git a/build-auto.json b/build-auto.json new file mode 100644 index 00000000..39f73603 --- /dev/null +++ b/build-auto.json @@ -0,0 +1,26 @@ +{ + "ios": { + "debug": { + "codeSignIdentity": "iPhone Developer", + "developmentTeam": "EN3PJ8YF59", + "packageType": "development", + "automaticProvisioning": true, + "buildFlag": [ + "EMBEDDED_CONTENT_CONTAINS_SWIFT = YES", + "ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES=NO", + "LD_RUNPATH_SEARCH_PATHS = \"@executable_path/Frameworks\"" + ] + }, + "release": { + "codeSignIdentity": "iPhone Developer", + "developmentTeam": "EN3PJ8YF59", + "packageType": "app-store", + "automaticProvisioning": true, + "buildFlag": [ + "EMBEDDED_CONTENT_CONTAINS_SWIFT = YES", + "ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES=NO", + "LD_RUNPATH_SEARCH_PATHS = \"@executable_path/Frameworks\"" + ] + } + } +} diff --git a/build_ios.sh b/build_ios.sh new file mode 100755 index 00000000..b3ecc31c --- /dev/null +++ b/build_ios.sh @@ -0,0 +1,4 @@ +echo "*** Using old build system due to XCode 10 issues ** " +echo "see https://forum.ionicframework.com/t/how-to-build-ionic-cordova-with-xcode-10/142044" + +ionic cordova build ios -- --buildFlag="-UseModernBuildSystem=0" @@ -1,5 +1,5 @@ <?xml version='1.0' encoding='utf-8'?> -<widget android-packageName="com.pliablepixels.zmninja_pro" id="com.pliablepixels.zmninja_pro" ios-CFBundleIdentifier="com.pliablepixels.zmninja-pro" version="1.3.020" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0"> +<widget android-packageName="com.pliablepixels.zmninja_pro" id="com.pliablepixels.zmninja_pro" ios-CFBundleIdentifier="com.pliablepixels.zmninja-pro" version="1.3.021" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0"> <name>zmNinja</name> <description> High performance ZoneMinder client @@ -150,6 +150,6 @@ <variable name="FCM_VERSION" value="11.6.2" /> </plugin> <plugin name="cordova-plugin-certificates" spec="^0.6.4" /> - <engine name="ios" spec="^4.5.5" /> + <engine name="ios" spec="latest" /> <engine name="android" spec="^6.3.0" /> </widget> diff --git a/electron_js/main.js b/electron_js/main.js index 9e2a9028..10124bbf 100644 --- a/electron_js/main.js +++ b/electron_js/main.js @@ -42,6 +42,35 @@ if (shouldQuit) { return; } +function newWindow() { + createAlternateWindow(); +} + + + +function createAlternateWindow() { + + + var newWin = new BrowserWindow({ + x: 10, + y: 10, + width: 800, + height: 800, + icon: path.join(__dirname, '/../icon.png'), + webPreferences:{nodeIntegration:false}}); + + const startUrl = process.env.ELECTRON_START_URL || url.format({ + pathname: path.join(__dirname, '/../www/index.html'), + protocol: 'file:', + slashes: true + }); + + newWin.loadURL(startUrl); + +} + + + function createWindow() { @@ -58,9 +87,15 @@ const mx = globalShortcut.register('CommandOrControl+Alt+F', () => { win.webContents.openDevTools(); }) + const newwinx = globalShortcut.register('CommandOrControl+Alt+N', () => { + console.log('CommandOrControl+Alt+N is pressed'); + createAlternateWindow(); + }) + // Create the browser window. let mainWindowState = windowStateKeeper({ + //file: 'main.json', defaultWidth: 1000, defaultHeight: 800, webPreferences:{nodeIntegration:false} @@ -118,104 +153,104 @@ const mx = globalShortcut.register('CommandOrControl+Alt+F', () => { // Menu.setApplicationMenu(menu) - const template = [ - { - label: 'Edit', - submenu: [ - {role: 'undo'}, - {role: 'redo'}, - {type: 'separator'}, - {role: 'cut'}, - {role: 'copy'}, - {role: 'paste'}, - {role: 'pasteandmatchstyle'}, - {role: 'delete'}, - {role: 'selectall'} - ] - }, - { - label: 'View', - submenu: [ - {role: 'reload'}, - {role: 'forcereload'}, - {role: 'toggledevtools'}, - {type: 'separator'}, - {role: 'resetzoom'}, - {role: 'zoomin'}, - {role: 'zoomout'}, - {type: 'separator'}, - {role: 'togglefullscreen'} - ] - }, - { - role: 'window', - submenu: [ - {role: 'minimize'}, - {role: 'quit'} - ] - }, - { - role: 'help', - submenu: [ - { - label: 'Learn More', - click () { require('electron').shell.openExternal('https://electronjs.org') } - } - ] - } - ] - - if (process.platform === 'darwin') { - template.unshift({ - label: app.getName(), - submenu: [ - {role: 'about'}, - {type: 'separator'}, - {role: 'services', submenu: []}, - {type: 'separator'}, - {role: 'hide'}, - {role: 'hideothers'}, - {role: 'unhide'}, - {type: 'separator'}, - {role: 'quit'} - ] - }) - - // Edit menu - template[1].submenu.push( + const template = [ + { + label: 'Edit', + submenu: [ + {role: 'undo'}, + {role: 'redo'}, + {type: 'separator'}, + {role: 'cut'}, + {role: 'copy'}, + {role: 'paste'}, + {role: 'pasteandmatchstyle'}, + {role: 'delete'}, + {role: 'selectall'} + ] + }, + { + label: 'View', + submenu: [ + {role: 'reload'}, + {role: 'forcereload'}, + {role: 'toggledevtools'}, + {type: 'separator'}, + {role: 'resetzoom'}, + {role: 'zoomin'}, + {role: 'zoomout'}, {type: 'separator'}, + {role: 'togglefullscreen'} + ] + }, + { + role: 'window', + submenu: [ + {role: 'minimize'}, + {role: 'quit'} + ] + }, + { + role: 'help', + submenu: [ { - label: 'Speech', - submenu: [ - {role: 'startspeaking'}, - {role: 'stopspeaking'} - ] + label: 'Learn More', + click () { require('electron').shell.openExternal('https://electronjs.org') } } - ) - - // Window menu - template[3].submenu = [ - {role: 'close'}, - {role: 'minimize'}, - {role: 'zoom'}, - {type: 'separator'}, - {role: 'front'} ] } - - const menu = Menu.buildFromTemplate(template); - Menu.setApplicationMenu(menu); - - // Open the DevTools. - //win.webContents.openDevTools(); - // Emitted when the window is closed. - win.on('closed', () => { - // Dereference the window object, usually you would store windows - // in an array if your app supports multi windows, this is the time - // when you should delete the corresponding element. - win.removeAllListeners(); - win = null; - }); +] + +if (process.platform === 'darwin') { + template.unshift({ + label: app.getName(), + submenu: [ + {role: 'about'}, + {type: 'separator'}, + {role: 'services', submenu: []}, + {type: 'separator'}, + {role: 'hide'}, + {role: 'hideothers'}, + {role: 'unhide'}, + {type: 'separator'}, + {role: 'quit'} + ] + }) + + // Edit menu + template[1].submenu.push( + {type: 'separator'}, + { + label: 'Speech', + submenu: [ + {role: 'startspeaking'}, + {role: 'stopspeaking'} + ] + } + ) + + // Window menu + template[3].submenu = [ + {role: 'close'}, + {role: 'minimize'}, + {role: 'zoom'}, + {type: 'separator'}, + {role: 'front'} + ] +} + +const menu = Menu.buildFromTemplate(template); +Menu.setApplicationMenu(menu); + +// Open the DevTools. +//win.webContents.openDevTools(); +// Emitted when the window is closed. +win.on('closed', () => { + // Dereference the window object, usually you would store windows + // in an array if your app supports multi windows, this is the time + // when you should delete the corresponding element. + win.removeAllListeners(); + win = null; +}); } // This method will be called when Electron has finished diff --git a/package.json b/package.json index 59643e59..41c0621e 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "zmninjapro", "description": "Home security mobile app for ZoneMinder", - "version":"1.3.020", + "version": "1.3.020", "displayName": "zmNinja", "author": "Pliable Pixels", "license": "custom see LICENSE.md", @@ -43,7 +43,6 @@ "cordova-plugin-media-pp-fork": {}, "cordova-plugin-email": {}, "cordova-plugin-statusbar": {}, - "cordova-plugin-certificates": {}, "cordova-library-helper-pp-fork": {}, "cordova-plugin-multi-window": {}, "cordova-plugin-ignore-lint-translation": {}, @@ -53,14 +52,15 @@ }, "phonegap-plugin-push": { "FCM_VERSION": "11.6.2" - } + }, + "cordova-plugin-certificates": {} } }, "dependencies": { "clivas": "^0.2.0", "com.telerik.plugins.nativepagetransitions": "^0.6.5", "cordova-android": "^6.3.0", - "cordova-ios": "^4.5.5", + "cordova-ios": "latest", "cordova-library-helper-pp-fork": "^1.0.1", "cordova-plugin-add-swift-support": "^1.7.2", "cordova-plugin-android-fingerprint-auth": "^1.4.0", @@ -143,7 +143,6 @@ "node_modules/clivas/**/*", "node_modules/keypress/**/*" ], - "mac": { "category": "productivity", "target": "dmg", @@ -175,4 +174,4 @@ ] } } -} +}
\ No newline at end of file diff --git a/resources/ios/icon/icon-1024.png b/resources/ios/icon/icon-1024.png Binary files differindex 226815e3..5c87b211 100644 --- a/resources/ios/icon/icon-1024.png +++ b/resources/ios/icon/icon-1024.png diff --git a/resources/ios/icon/icon-40.png b/resources/ios/icon/icon-40.png Binary files differindex 608822ea..96f65fcd 100644 --- a/resources/ios/icon/icon-40.png +++ b/resources/ios/icon/icon-40.png diff --git a/resources/ios/icon/icon-40@2x.png b/resources/ios/icon/icon-40@2x.png Binary files differindex 68064df0..0a17c18a 100644 --- a/resources/ios/icon/icon-40@2x.png +++ b/resources/ios/icon/icon-40@2x.png diff --git a/resources/ios/icon/icon-40@3x.png b/resources/ios/icon/icon-40@3x.png Binary files differindex f4a5f11b..bf182ff5 100644 --- a/resources/ios/icon/icon-40@3x.png +++ b/resources/ios/icon/icon-40@3x.png diff --git a/resources/ios/icon/icon-50.png b/resources/ios/icon/icon-50.png Binary files differindex 0e1443fb..4339bbaa 100644 --- a/resources/ios/icon/icon-50.png +++ b/resources/ios/icon/icon-50.png diff --git a/resources/ios/icon/icon-50@2x.png b/resources/ios/icon/icon-50@2x.png Binary files differindex 3b60ba19..d8403da5 100644 --- a/resources/ios/icon/icon-50@2x.png +++ b/resources/ios/icon/icon-50@2x.png diff --git a/resources/ios/icon/icon-60.png b/resources/ios/icon/icon-60.png Binary files differindex 98e7a296..362d5f8a 100644 --- a/resources/ios/icon/icon-60.png +++ b/resources/ios/icon/icon-60.png diff --git a/resources/ios/icon/icon-60@2x.png b/resources/ios/icon/icon-60@2x.png Binary files differindex f4a5f11b..b3816683 100644 --- a/resources/ios/icon/icon-60@2x.png +++ b/resources/ios/icon/icon-60@2x.png diff --git a/resources/ios/icon/icon-60@3x.png b/resources/ios/icon/icon-60@3x.png Binary files differindex 8bf8a4d6..7a93e00b 100644 --- a/resources/ios/icon/icon-60@3x.png +++ b/resources/ios/icon/icon-60@3x.png diff --git a/resources/ios/icon/icon-72.png b/resources/ios/icon/icon-72.png Binary files differindex ad224fe6..ddf822fa 100644 --- a/resources/ios/icon/icon-72.png +++ b/resources/ios/icon/icon-72.png diff --git a/resources/ios/icon/icon-72@2x.png b/resources/ios/icon/icon-72@2x.png Binary files differindex c15c01e4..f3e2a473 100644 --- a/resources/ios/icon/icon-72@2x.png +++ b/resources/ios/icon/icon-72@2x.png diff --git a/resources/ios/icon/icon-76.png b/resources/ios/icon/icon-76.png Binary files differindex 1d234673..10344b6e 100644 --- a/resources/ios/icon/icon-76.png +++ b/resources/ios/icon/icon-76.png diff --git a/resources/ios/icon/icon-76@2x.png b/resources/ios/icon/icon-76@2x.png Binary files differindex fb76e62e..945a766a 100644 --- a/resources/ios/icon/icon-76@2x.png +++ b/resources/ios/icon/icon-76@2x.png diff --git a/resources/ios/icon/icon-83.5@2x.png b/resources/ios/icon/icon-83.5@2x.png Binary files differindex c1fc5d6f..8562bcc9 100644 --- a/resources/ios/icon/icon-83.5@2x.png +++ b/resources/ios/icon/icon-83.5@2x.png diff --git a/resources/ios/icon/icon-small.png b/resources/ios/icon/icon-small.png Binary files differindex c4ca3d0f..b452e267 100644 --- a/resources/ios/icon/icon-small.png +++ b/resources/ios/icon/icon-small.png diff --git a/resources/ios/icon/icon-small@2x.png b/resources/ios/icon/icon-small@2x.png Binary files differindex 75f3e4c4..a8155f16 100644 --- a/resources/ios/icon/icon-small@2x.png +++ b/resources/ios/icon/icon-small@2x.png diff --git a/resources/ios/icon/icon-small@3x.png b/resources/ios/icon/icon-small@3x.png Binary files differindex 3d76abef..d6016351 100644 --- a/resources/ios/icon/icon-small@3x.png +++ b/resources/ios/icon/icon-small@3x.png diff --git a/resources/ios/icon/icon.png b/resources/ios/icon/icon.png Binary files differindex c9ac6cdb..3e8a8e6d 100644 --- a/resources/ios/icon/icon.png +++ b/resources/ios/icon/icon.png diff --git a/resources/ios/icon/icon@2x.png b/resources/ios/icon/icon@2x.png Binary files differindex 0b474eb5..39a380ee 100644 --- a/resources/ios/icon/icon@2x.png +++ b/resources/ios/icon/icon@2x.png diff --git a/resources/ios/splash/Default-568h@2x~iphone.png b/resources/ios/splash/Default-568h@2x~iphone.png Binary files differindex 27ba518f..a0c71b5f 100644 --- a/resources/ios/splash/Default-568h@2x~iphone.png +++ b/resources/ios/splash/Default-568h@2x~iphone.png diff --git a/resources/ios/splash/Default-667h.png b/resources/ios/splash/Default-667h.png Binary files differindex e3ca9e5a..f9ca582d 100644 --- a/resources/ios/splash/Default-667h.png +++ b/resources/ios/splash/Default-667h.png diff --git a/resources/ios/splash/Default-736h.png b/resources/ios/splash/Default-736h.png Binary files differindex 016fee3e..b7cfda65 100644 --- a/resources/ios/splash/Default-736h.png +++ b/resources/ios/splash/Default-736h.png diff --git a/resources/ios/splash/Default-Landscape-736h.png b/resources/ios/splash/Default-Landscape-736h.png Binary files differindex ac52d756..727fae1f 100644 --- a/resources/ios/splash/Default-Landscape-736h.png +++ b/resources/ios/splash/Default-Landscape-736h.png diff --git a/resources/ios/splash/Default-Landscape@2x~ipad.png b/resources/ios/splash/Default-Landscape@2x~ipad.png Binary files differindex 24bee974..27941eb7 100644 --- a/resources/ios/splash/Default-Landscape@2x~ipad.png +++ b/resources/ios/splash/Default-Landscape@2x~ipad.png diff --git a/resources/ios/splash/Default-Landscape@~ipadpro.png b/resources/ios/splash/Default-Landscape@~ipadpro.png Binary files differindex afdb5fd0..8d79a027 100644 --- a/resources/ios/splash/Default-Landscape@~ipadpro.png +++ b/resources/ios/splash/Default-Landscape@~ipadpro.png diff --git a/resources/ios/splash/Default-Landscape~ipad.png b/resources/ios/splash/Default-Landscape~ipad.png Binary files differindex 2c4e7be2..c8b69387 100644 --- a/resources/ios/splash/Default-Landscape~ipad.png +++ b/resources/ios/splash/Default-Landscape~ipad.png diff --git a/resources/ios/splash/Default-Portrait@2x~ipad.png b/resources/ios/splash/Default-Portrait@2x~ipad.png Binary files differindex aee6ffb1..9ed9c1cc 100644 --- a/resources/ios/splash/Default-Portrait@2x~ipad.png +++ b/resources/ios/splash/Default-Portrait@2x~ipad.png diff --git a/resources/ios/splash/Default-Portrait@~ipadpro.png b/resources/ios/splash/Default-Portrait@~ipadpro.png Binary files differindex c6534f17..61ecae87 100644 --- a/resources/ios/splash/Default-Portrait@~ipadpro.png +++ b/resources/ios/splash/Default-Portrait@~ipadpro.png diff --git a/resources/ios/splash/Default-Portrait~ipad.png b/resources/ios/splash/Default-Portrait~ipad.png Binary files differindex 621a62fa..66b338a4 100644 --- a/resources/ios/splash/Default-Portrait~ipad.png +++ b/resources/ios/splash/Default-Portrait~ipad.png diff --git a/resources/ios/splash/Default@2x~iphone.png b/resources/ios/splash/Default@2x~iphone.png Binary files differindex 7c97b61f..95f01435 100644 --- a/resources/ios/splash/Default@2x~iphone.png +++ b/resources/ios/splash/Default@2x~iphone.png diff --git a/resources/ios/splash/Default@2x~universal~anyany.png b/resources/ios/splash/Default@2x~universal~anyany.png Binary files differindex 9631b76b..c327a79e 100644 --- a/resources/ios/splash/Default@2x~universal~anyany.png +++ b/resources/ios/splash/Default@2x~universal~anyany.png diff --git a/resources/ios/splash/Default~iphone.png b/resources/ios/splash/Default~iphone.png Binary files differindex 8588f75a..25337e28 100644 --- a/resources/ios/splash/Default~iphone.png +++ b/resources/ios/splash/Default~iphone.png |
