Electron-47

1. Fixed some issues with windows
2. Changed the arg from external to exclude
This commit is contained in:
Kiran Niranjan 2017-08-01 12:19:59 +05:30 committed by Kiran Niranjan
parent 95d3a43726
commit e21f7adfaa
4 changed files with 33 additions and 14 deletions

View File

@ -6,4 +6,19 @@ Test Window has been opened
<label for='tag'>tag:</label>
<input type='text' id='tag' value=''/>
</p>
<hr>
<p>Badge Count:<p>
<button id='inc-badge'>increment badge count</button>
<br>
<script>
var badgeCount = 0;
var incBadgeEl = document.getElementById('inc-badge');
incBadgeEl.addEventListener('click', function() {
badgeCount++;
ssf.setBadgeCount(badgeCount);
});
</script>
</html>

View File

@ -19,22 +19,26 @@ const apiCmds = apiEnums.cmds;
const apiName = apiEnums.apiName;
const getMediaSources = require('../desktopCapturer/getSources');
require('../downloadManager/downloadManager');
// bug in electron preventing us from using spellchecker in pop outs
// https://github.com/electron/electron/issues/4025
// so loading the spellchecker in try catch so that we don't
// block other method from loading
try {
const SpellCheckerHelper = require('../spellChecker/spellChecker').SpellCheckHelper;
// Method to initialize spell checker
const spellChecker = new SpellCheckerHelper();
spellChecker.initializeSpellChecker();
} catch (err){
/* eslint-disable no-console */
console.error('requiring spellchecker module: ' + err);
/* eslint-enable no-console */
}
require('../downloadManager/downloadManager');
document.addEventListener('DOMContentLoaded', () => {
try {
/* eslint-disable global-require */
const SpellCheckerHelper = require('../spellChecker/spellChecker').SpellCheckHelper;
/* eslint-enable global-require */
// Method to initialize spell checker
const spellChecker = new SpellCheckerHelper();
spellChecker.initializeSpellChecker();
} catch (err) {
/* eslint-disable no-console */
console.error('requiring spellchecker module: ' + err);
/* eslint-enable no-console */
}
});
const nodeURL = require('url');

View File

@ -17,7 +17,7 @@ class SpellCheckHelper {
const contextMenuBuilder = new ContextMenuBuilder(this.spellCheckHandler, null, false, SpellCheckHelper.processMenu);
this.contextMenuListener = new ContextMenuListener((info) => {
contextMenuBuilder.showPopupMenu(info);
}, null, null);
});
}
/**

View File

@ -14,7 +14,7 @@
"unpacked-win": "npm run prebuild && npm run test && build --win --x64 --dir",
"unpacked-win-x86": "npm run prebuild && npm run test && build --win --ia32",
"prebuild": "npm run rebuild && npm run browserify-preload",
"browserify-preload": "browserify -o js/preload/_preloadMain.js -x electron --insert-global-vars=__filename,__dirname js/preload/preloadMain.js --external electron-spellchecker js/preload/preloadMain.js > js/preload/_preloadMain.js",
"browserify-preload": "browserify -o js/preload/_preloadMain.js -x electron --insert-global-vars=__filename,__dirname js/preload/preloadMain.js --exclude electron-spellchecker",
"rebuild": "electron-rebuild -f",
"test": "npm run lint && jest --verbose --testPathPattern test && npm run rebuild",
"spectron-test": "jest --config tests/spectron/jest_spectron.json --runInBand && npm run rebuild",