Icon and prebuilt query fixes

master
Rohan Vazarkar 2016-08-06 00:47:56 -07:00
parent 90c1a6f9c9
commit 9b04873271
8 changed files with 29 additions and 12 deletions

14
main.js
View File

@ -1,6 +1,8 @@
const electron = require('electron')
var platform = require('os').platform()
// Module to control application life.
const app = electron.app
const Tray = electron.Tray
// Module to create native browser window.
const BrowserWindow = electron.BrowserWindow
@ -10,13 +12,21 @@ let mainWindow
function createWindow () {
// Create the browser window.
mainWindow = new BrowserWindow({width: 1280, height: 800, icon:__dirname + '/src/img/favicon.ico'})
mainWindow = new BrowserWindow({width: 1280, height: 800, icon: __dirname + '/src/img/icon.ico'})
var trayIcon;
if (platform == 'darwin'){
trayIcon = __dirname + '/src/img/icon.png'
}else{
trayIcon = __dirname + '/src/img/icon.ico'
}
appIcon = new Tray(trayIcon)
// and load the index.html of the app.
mainWindow.loadURL(`file://${__dirname}/index.html`)
// Open the DevTools.
//mainWindow.webContents.openDevTools()
mainWindow.webContents.openDevTools()
// Emitted when the window is closed.
mainWindow.on('closed', function () {

View File

@ -23,7 +23,7 @@
"start": "set ENV=development & electron .",
"dev": "concurrently -k \"babel-node server.js\" \"npm start\"",
"build": "webpack --config webpack.config.production.js && electron-packager . Bloodhound --platform=all --arch=all --overwrite --prune",
"winbuild": "webpack --config webpack.config.production.js && electron-packager . Bloodhound --platform=win32 --arch=all --overwrite --prune"
"winbuild": "webpack --config webpack.config.production.js && electron-packager . BloodHound --platform=win32 --arch=x64 --overwrite --prune"
},
"babel": {
"presets": [

View File

@ -12,16 +12,20 @@ export default class PrebuiltQueriesDisplay extends Component {
}
componentWillMount() {
fs.readFile('src/components/SearchContainer/Tabs/PrebuiltQueries.json', 'utf8', function(err, data){
var x = JSON.parse(data)
var y = []
$.ajax({
url: 'src/components/SearchContainer/Tabs/prebuiltqueries.json',
type: 'GET',
success: function(response){
var x = JSON.parse(response)
var y = []
$.each(x.queries, function(index, el) {
y.push(el)
});
$.each(x.queries, function(index, el) {
y.push(el)
});
this.setState({queries: y})
}.bind(this))
this.setState({queries: y})
}.bind(this)
})
}
render() {

BIN
src/img/icon.icns Normal file

Binary file not shown.

BIN
src/img/icon.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 361 KiB

BIN
src/img/icon.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 661 B

BIN
src/img/icon@2x.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

View File

@ -25,7 +25,10 @@ var config = {
},
plugins: [
new webpack.HotModuleReplacementPlugin(),
]
],
node: {
__dirname: true
}
};
config.target = webpackTargetElectronRenderer(config);