diff --git a/CHANGELOG.md b/CHANGELOG.md index acfffb8c7..6e8befec9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,18 @@ ## SikhiToTheMax Desktop App +### 4.1.0 - _180824_ + +#### Improved + * **User Interface** - Wow! What is this beautiful new software that lets me present Gurbani and looks amazing? Actually, it's the same SikhiToTheMax, but Guru Sahib has done Kirpa on Sevadars to deliver a new version that is much more intuitive. It's the first step in a brand new experience that is coming. In this iteration, controls are closer to where you need them. + * **Search by Ang** - Searching by Ang or page number has its own dedicated field + * Bug Fixes + * Style Fixes + +#### Added + * **Scripture Filtering** - Narrow down your search to different scriptures + * **Single Screen Presenter View** - Get the benefits of presenter view without having to connect a second screen + * **Bani Overlay** - Overlay Editor now provides a way to adjust the background size and opacity and the text size. Gurbani can also be coloured separately from the other text + ### 4.0.6 - _180718_ #### Improved * **Search speed** - _First Letter Start (Gurmukhi)_ search has gotten a huge performance boost, nearing instant from the time you type a letter to when results are shown diff --git a/app.js b/app.js index 66faec8fd..d6c562fe6 100644 --- a/app.js +++ b/app.js @@ -14,9 +14,27 @@ const io = require('socket.io')(http); expressApp.use(express.static(path.join(__dirname, 'www', 'obs'))); -http.listen(1397); // TODO: move to config file - const { app, BrowserWindow, dialog, ipcMain } = electron; + +const op = require('openport'); + +op.find( + { + // Re: http://www.sikhiwiki.org/index.php/Gurgadi + ports: [1397, 1469, 1539, 1552, 1574, 1581, 1606, 1644, 1661, 1665, 1675, 1708], + count: 1, + }, + (err, port) => { + if (err) { + dialog.showErrorBox('Overlay Error', 'No free ports available. Close other applications and Reboot the machine'); + app.exit(-1); + return; + } + global.overlayPort = port; + // console.log(`Overlay Port No ${port}`); + http.listen(port); + }); + const store = new Store({ configName: 'user-preferences', defaults: defaultPrefs, @@ -45,22 +63,28 @@ const viewerWindowPos = {}; function openSecondaryWindow(windowName) { const window = secondaryWindows[windowName]; - window.obj = new BrowserWindow({ - width: 725, - height: 800, - show: false, - }); - window.obj.webContents.on('did-finish-load', () => { - window.obj.show(); - }); - window.obj.loadURL(window.url); + const openWindow = BrowserWindow.getAllWindows().filter(item => item.getURL() === window.url); - window.obj.on('close', () => { - window.obj = false; - if (window.onClose) { - window.onClose(); - } - }); + if (openWindow.length > 0) { + openWindow[0].show(); + } else { + window.obj = new BrowserWindow({ + width: 725, + height: 800, + show: false, + }); + window.obj.webContents.on('did-finish-load', () => { + window.obj.show(); + }); + window.obj.loadURL(window.url); + + window.obj.on('close', () => { + window.obj = false; + if (window.onClose) { + window.onClose(); + } + }); + } } autoUpdater.logger = log; @@ -101,7 +125,7 @@ autoUpdater.on('update-downloaded', () => { message: 'Update available.', detail: 'Update downloaded and ready to install', cancelId: 0, - }, (response) => { + }, response => { if (response === 1) { autoUpdater.quitAndInstall(); } @@ -126,7 +150,7 @@ function checkForExternalDisplay() { const electronScreen = electron.screen; const displays = electronScreen.getAllDisplays(); let externalDisplay = null; - Object.keys(displays).forEach((i) => { + Object.keys(displays).forEach(i => { if (displays[i].bounds.x !== 0 || displays[i].bounds.y !== 0) { externalDisplay = displays[i]; } @@ -187,6 +211,7 @@ function createViewer(ipcData) { }); }); } + mainWindow.webContents.send('presenter-view'); } app.on('ready', () => { @@ -299,6 +324,25 @@ ipcMain.on('show-line', (event, arg) => { } }); +ipcMain.on('show-empty-slide', () => { + const overlayPrefs = store.get('obs'); + const emptyLine = { + Line: { + Gurmukhi: '', + English: '', + PunjabiUni: '', + Transliteration: '', + }, + }; + const payload = Object.assign(emptyLine, overlayPrefs); + + io.emit('show-line', payload); + + if (overlayPrefs.live) { + createBroadcastFiles(emptyLine); + } +}); + ipcMain.on('show-text', (event, arg) => { if (viewerWindow) { viewerWindow.webContents.send('show-text', arg); @@ -331,6 +375,7 @@ ipcMain.on('update-settings', () => { if (viewerWindow) { viewerWindow.webContents.send('update-settings'); } + mainWindow.webContents.send('sync-settings'); }); module.exports = { diff --git a/package-lock.json b/package-lock.json index e14687697..599fe14cf 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "sttm-desktop", - "version": "4.0.0-beta.1", + "version": "4.0.6", "lockfileVersion": 1, "requires": true, "dependencies": { @@ -720,8 +720,8 @@ "resolved": "https://registry.npmjs.org/ascli/-/ascli-0.3.0.tgz", "integrity": "sha1-XmYjDlIZ/j6JUqTvtPIPrllqgTo=", "requires": { - "colour": "^0.7.1", - "optjs": "^3.2.2" + "colour": "latest", + "optjs": "latest" } }, "asn1": { @@ -3200,12 +3200,6 @@ "resolved": "https://registry.npmjs.org/browser-split/-/browser-split-0.0.0.tgz", "integrity": "sha1-QUGcrvdpdVkp3VGJZ9PuwKYmJ3E=" }, - "browser-stdout": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/browser-stdout/-/browser-stdout-1.3.0.tgz", - "integrity": "sha1-81HTKWnTL6XXpVZxVCY9korjvR8=", - "dev": true - }, "browserslist": { "version": "1.7.7", "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-1.7.7.tgz", @@ -5061,12 +5055,6 @@ "integrity": "sha1-WiBc48Ky73e2I41roXnrdMag6Bg=", "dev": true }, - "diff": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/diff/-/diff-3.2.0.tgz", - "integrity": "sha1-yc45Okt8vQsFinJck98pkCeGj/k=", - "dev": true - }, "dmg-builder": { "version": "4.1.3", "resolved": "https://registry.npmjs.org/dmg-builder/-/dmg-builder-4.1.3.tgz", @@ -9363,12 +9351,6 @@ "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.11.tgz", "integrity": "sha1-Dovf5NHduIVNZOBOp8AOKgJuVlg=" }, - "graceful-readlink": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/graceful-readlink/-/graceful-readlink-1.0.1.tgz", - "integrity": "sha1-TK+tdrxi8C+gObL5Tpo906ORpyU=", - "dev": true - }, "gray-matter": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/gray-matter/-/gray-matter-3.1.1.tgz", @@ -9461,12 +9443,6 @@ } } }, - "growl": { - "version": "1.9.2", - "resolved": "https://registry.npmjs.org/growl/-/growl-1.9.2.tgz", - "integrity": "sha1-Dqd0NxXbjY3ixe3hd14bRayFwC8=", - "dev": true - }, "gulp-choose-files": { "version": "0.1.3", "resolved": "https://registry.npmjs.org/gulp-choose-files/-/gulp-choose-files-0.1.3.tgz", @@ -9659,12 +9635,6 @@ "sntp": "2.x.x" } }, - "he": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/he/-/he-1.1.1.tgz", - "integrity": "sha1-k0EP0hsAlzUVH4howvJx80J+I/0=", - "dev": true - }, "helper-cache": { "version": "0.7.2", "resolved": "https://registry.npmjs.org/helper-cache/-/helper-cache-0.7.2.tgz", @@ -10920,12 +10890,6 @@ "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", "integrity": "sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus=" }, - "json3": { - "version": "3.3.2", - "resolved": "https://registry.npmjs.org/json3/-/json3-3.3.2.tgz", - "integrity": "sha1-PAQ0dD35Pi9cQq7nsZvLSDV19OE=", - "dev": true - }, "json5": { "version": "0.5.1", "resolved": "https://registry.npmjs.org/json5/-/json5-0.5.1.tgz", @@ -11352,16 +11316,6 @@ "resolved": "https://registry.npmjs.org/lodash._arrayfilter/-/lodash._arrayfilter-3.0.0.tgz", "integrity": "sha1-LevhHuxp5dzG9LhhNxKKSPFSQjc=" }, - "lodash._baseassign": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/lodash._baseassign/-/lodash._baseassign-3.2.0.tgz", - "integrity": "sha1-jDigmVAPIVrQnlnxci/QxSv+Ck4=", - "dev": true, - "requires": { - "lodash._basecopy": "^3.0.0", - "lodash.keys": "^3.0.0" - } - }, "lodash._basecallback": { "version": "3.3.1", "resolved": "https://registry.npmjs.org/lodash._basecallback/-/lodash._basecallback-3.3.1.tgz", @@ -11373,18 +11327,6 @@ "lodash.pairs": "^3.0.0" } }, - "lodash._basecopy": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/lodash._basecopy/-/lodash._basecopy-3.0.1.tgz", - "integrity": "sha1-jaDmqHbPNEwK2KVIghEd08XHyjY=", - "dev": true - }, - "lodash._basecreate": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/lodash._basecreate/-/lodash._basecreate-3.0.3.tgz", - "integrity": "sha1-G8ZhYU2qf8MRt9A78WgGoCE8+CE=", - "dev": true - }, "lodash._baseeach": { "version": "3.0.4", "resolved": "https://registry.npmjs.org/lodash._baseeach/-/lodash._baseeach-3.0.4.tgz", @@ -11446,12 +11388,6 @@ "resolved": "https://registry.npmjs.org/lodash._getnative/-/lodash._getnative-3.9.1.tgz", "integrity": "sha1-VwvH3t5G1hzc3mh9ZdPuy6o6r/U=" }, - "lodash._isiterateecall": { - "version": "3.0.9", - "resolved": "https://registry.npmjs.org/lodash._isiterateecall/-/lodash._isiterateecall-3.0.9.tgz", - "integrity": "sha1-UgOte6Ql+uhCRg5pbbnPPmqsBXw=", - "dev": true - }, "lodash._replaceholders": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/lodash._replaceholders/-/lodash._replaceholders-3.0.0.tgz", @@ -11483,16 +11419,10 @@ "integrity": "sha1-4j8/nE+Pvd6HJSnBBxhXoIblzO8=", "dev": true }, - "lodash.create": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/lodash.create/-/lodash.create-3.1.1.tgz", - "integrity": "sha1-1/KEnw29p+BGgruM1yqwIkYd6+c=", - "dev": true, - "requires": { - "lodash._baseassign": "^3.0.0", - "lodash._basecreate": "^3.0.0", - "lodash._isiterateecall": "^3.0.0" - } + "lodash.debounce": { + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/lodash.debounce/-/lodash.debounce-4.0.8.tgz", + "integrity": "sha1-gteb/zCmfEAF/9XiUVMArZyk168=" }, "lodash.defaultsdeep": { "version": "4.6.0", @@ -12370,84 +12300,6 @@ } } }, - "mocha": { - "version": "3.5.3", - "resolved": "https://registry.npmjs.org/mocha/-/mocha-3.5.3.tgz", - "integrity": "sha512-/6na001MJWEtYxHOV1WLfsmR4YIynkUEhBwzsb+fk2qmQ3iqsi258l/Q2MWHJMImAcNpZ8DEdYAK72NHoIQ9Eg==", - "dev": true, - "requires": { - "browser-stdout": "1.3.0", - "commander": "2.9.0", - "debug": "2.6.8", - "diff": "3.2.0", - "escape-string-regexp": "1.0.5", - "glob": "7.1.1", - "growl": "1.9.2", - "he": "1.1.1", - "json3": "3.3.2", - "lodash.create": "3.1.1", - "mkdirp": "0.5.1", - "supports-color": "3.1.2" - }, - "dependencies": { - "commander": { - "version": "2.9.0", - "resolved": "https://registry.npmjs.org/commander/-/commander-2.9.0.tgz", - "integrity": "sha1-nJkJQXbhIkDLItbFFGCYQA/g99Q=", - "dev": true, - "requires": { - "graceful-readlink": ">= 1.0.0" - } - }, - "debug": { - "version": "2.6.8", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.8.tgz", - "integrity": "sha1-5zFTHKLt4n0YgiJCfaF4IdaP9Pw=", - "dev": true, - "requires": { - "ms": "2.0.0" - } - }, - "glob": { - "version": "7.1.1", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.1.tgz", - "integrity": "sha1-gFIR3wT6rxxjo2ADBs31reULLsg=", - "dev": true, - "requires": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.0.2", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" - } - }, - "minimist": { - "version": "0.0.8", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", - "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=", - "dev": true - }, - "mkdirp": { - "version": "0.5.1", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", - "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", - "dev": true, - "requires": { - "minimist": "0.0.8" - } - }, - "supports-color": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-3.1.2.tgz", - "integrity": "sha1-cqJiiU2dQIuVbKBf83su2KbiotU=", - "dev": true, - "requires": { - "has-flag": "^1.0.0" - } - } - } - }, "moment": { "version": "2.22.1", "resolved": "https://registry.npmjs.org/moment/-/moment-2.22.1.tgz", @@ -13298,6 +13150,11 @@ "resolved": "http://registry.npmjs.org/onetime/-/onetime-1.1.0.tgz", "integrity": "sha1-ofeDj4MUxRbwXs78vEzP4EtO14k=" }, + "openport": { + "version": "0.0.5", + "resolved": "https://registry.npmjs.org/openport/-/openport-0.0.5.tgz", + "integrity": "sha1-YcasuoMprtdjfmKWTvtYYk6YJlw=" + }, "optimist": { "version": "0.6.1", "resolved": "https://registry.npmjs.org/optimist/-/optimist-0.6.1.tgz", diff --git a/package.json b/package.json index 14e4d7b1c..2ab396617 100644 --- a/package.json +++ b/package.json @@ -1,13 +1,12 @@ { "productName": "SikhiToTheMax", "name": "sttm-desktop", - "version": "4.0.6", - "description": "The SikhiToTheMax 4 desktop app", + "version": "4.1.0", + "description": "The SikhiToTheMax desktop app", "main": "app.js", "scripts": { "precommit": "npm test", "test": "htmlhint --config .htmlhintrc www && eslint app.js packaging/ www/js www/core/js && stylelint \"www/src/scss/*.scss\" --syntax scss --fix", - "test:app": "mocha", "start": "concurrently --kill-others \"npm run watch-css\" \"cross-env NODE_ENV=development electron .\"", "build": "npm run build-css", "pack:mac": "npm run build && build --mac", @@ -44,7 +43,6 @@ "eslint-plugin-import": "^2.2.0", "htmlhint": "^0.9.13", "husky": "^0.13.3", - "mocha": "^3.2.0", "node-sass": "^4.5.0", "nodemon": "^1.11.0", "npm-run-all": "^4.1.3", @@ -65,12 +63,14 @@ "hyperscript": "^2.0.2", "ip": "^1.1.5", "is-online": "^7.0.0", + "lodash.debounce": "^4.0.8", "lodash.defaultsdeep": "^4.6.0", "lodash.get": "^4.4.2", "lodash.set": "^4.3.2", "marked": "^0.3.6", "moment": "^2.22.1", "noty": "^3.2.0-beta", + "openport": "0.0.5", "request": "^2.81.0", "request-progress": "^3.0.0", "scroll": "^2.0.1", @@ -81,6 +81,7 @@ }, "build": { "appId": "org.khalisfoundation.sttm", + "copyright": "Copyright © 2018 Khalis Foundation , SikhiToTheMax Trademark SHARE Charity, UK\n", "files": [ "**/*", "!assets${/*}", diff --git a/test/test.js b/test/test.js deleted file mode 100644 index 7471b81a5..000000000 --- a/test/test.js +++ /dev/null @@ -1,27 +0,0 @@ -const Application = require('spectron').Application; -const assert = require('assert'); - -describe('application launch', function cb() { - this.timeout(10000); - - beforeEach(function be() { - this.app = new Application({ - path: `${__dirname}/../node_modules/.bin/electron`, - args: ['app.js'], - }); - return this.app.start(); - }); - - afterEach(function ae() { - if (this.app && this.app.isRunning()) { - return this.app.stop(); - } - return false; - }); - - it('shows an initial window', function itcb() { - return this.app.client.getWindowCount().then((count) => { - assert.equal(count, 1); - }); - }); -}); diff --git a/www/index.html b/www/index.html index e3631150d..c8eb6f00c 100644 --- a/www/index.html +++ b/www/index.html @@ -55,26 +55,16 @@