diff --git a/app/html/blank.html b/app/html/blank.html new file mode 100644 index 0000000..b5c6a14 --- /dev/null +++ b/app/html/blank.html @@ -0,0 +1,6 @@ + + + +
+ + diff --git a/app/html/css/fontello/config.json b/app/html/css/fontello/config.json index a209694..f85ad44 100644 --- a/app/html/css/fontello/config.json +++ b/app/html/css/fontello/config.json @@ -71,6 +71,18 @@ "css": "calendar", "code": 59398, "src": "elusive" + }, + { + "uid": "15739f3032c2aa3df67efc96b3ffef56", + "css": "cancel-circle", + "code": 59403, + "src": "websymbols" + }, + { + "uid": "994eaa764b3f30721f3839c64c390ce3", + "css": "minus-circle", + "code": 59404, + "src": "websymbols" } ] } \ No newline at end of file diff --git a/app/html/css/fontello/css/elodie.css b/app/html/css/fontello/css/elodie.css index af246c9..1fea48b 100644 --- a/app/html/css/fontello/css/elodie.css +++ b/app/html/css/fontello/css/elodie.css @@ -1,10 +1,10 @@ @font-face { font-family: 'elodie'; - src: url('../font/elodie.eot?43975196'); - src: url('../font/elodie.eot?43975196#iefix') format('embedded-opentype'), - url('../font/elodie.woff?43975196') format('woff'), - url('../font/elodie.ttf?43975196') format('truetype'), - url('../font/elodie.svg?43975196#elodie') format('svg'); + src: url('../font/elodie.eot?99803888'); + src: url('../font/elodie.eot?99803888#iefix') format('embedded-opentype'), + url('../font/elodie.woff?99803888') format('woff'), + url('../font/elodie.ttf?99803888') format('truetype'), + url('../font/elodie.svg?99803888#elodie') format('svg'); font-weight: normal; font-style: normal; } @@ -14,7 +14,7 @@ @media screen and (-webkit-min-device-pixel-ratio:0) { @font-face { font-family: 'elodie'; - src: url('../font/elodie.svg?43975196#elodie') format('svg'); + src: url('../font/elodie.svg?99803888#elodie') format('svg'); } } */ @@ -64,4 +64,6 @@ .icon-title:before { content: '\e807'; } /* '' */ .icon-media-add:before { content: '\e808'; } /* '' */ .icon-folder-open:before { content: '\e809'; } /* '' */ -.icon-folder-closed:before { content: '\e80a'; } /* '' */ \ No newline at end of file +.icon-folder-closed:before { content: '\e80a'; } /* '' */ +.icon-cancel-circle:before { content: '\e80b'; } /* '' */ +.icon-minus-circle:before { content: '\e80c'; } /* '' */ \ No newline at end of file diff --git a/app/html/css/fontello/font/elodie.svg b/app/html/css/fontello/font/elodie.svg index 25f32ea..8da579b 100644 --- a/app/html/css/fontello/font/elodie.svg +++ b/app/html/css/fontello/font/elodie.svg @@ -17,6 +17,8 @@ + + \ No newline at end of file diff --git a/app/html/css/styles.css b/app/html/css/styles.css index db3d0f7..9ead916 100644 --- a/app/html/css/styles.css +++ b/app/html/css/styles.css @@ -1,3 +1,12 @@ +body { + -webkit-animation: fadein 1s; +} +/* Safari, Chrome and Opera > 12.1 */ +@-webkit-keyframes fadein { + from { opacity: 0; } + to { opacity: 1; } +} + *, body, div { font-family: 'Lato', 'Helvetica'; font-weight: 300; @@ -23,9 +32,30 @@ body { .titlebar a { font-weight: 300; - font-size:.9em; + font-size:.7em; + padding-top:5px; +} + +.titlebar a.right { float:right; - padding-top:3px; +} + +.titlebar a.left { + float:left; +} + +.titlebar a.quit i { + color: #ff4136 !important; +} + +.titlebar a.minus i { + color: #ffba00 !important; +} + +.x-titlebar em { + padding-right: 28px; + background: url("../img/logo@18x22.png") no-repeat right 4px; + } .content, .content-index { diff --git a/app/html/img/logo@18x22xbw.png b/app/html/img/logo@18x22xbw.png new file mode 100644 index 0000000..1573df7 Binary files /dev/null and b/app/html/img/logo@18x22xbw.png differ diff --git a/app/html/index.html b/app/html/index.html index bbb6d33..b32c823 100644 --- a/app/html/index.html +++ b/app/html/index.html @@ -10,8 +10,9 @@
+ How can I help you? -- Elodie -
@@ -19,12 +20,12 @@ Let me know where your photos are and where you'd like me to put them as I sort them.

- + Hint: Right clicking on your folder in Finder, pressing option and clicking "Copy as Pathname" will put the full path on your clipboard
- +
diff --git a/app/html/js/handlers.js b/app/html/js/handlers.js index dbe7d7b..f073529 100644 --- a/app/html/js/handlers.js +++ b/app/html/js/handlers.js @@ -18,6 +18,10 @@ if(typeof(require) === 'function') { handlers.removeProgressIcons(); handlers.addSuccessImportMessage(args); }); + ipc.on('update-import-no-photos', function(args) { + //var response = JSON.parse(args['stdout']); + handlers.removeProgressIcons(); + }); ipc.on('update-photos-success', function(args) { var response = JSON.parse(args['stdout']); handlers.setSuccessTitle(); @@ -58,17 +62,26 @@ function Handlers() { ev.preventDefault(); broadcast.send('launch-finder', tgt); }; + this.click.quitProgram = function(ev) { + //ev.preventDefault(); + console.log('quit'); + broadcast.send('program-quit'); + }; // SUBMIT this.submit.importPhotos = function(ev) { var el = ev.target, cls = el.className, params; ev.preventDefault(); - document.querySelector('button.push i').className = 'icon-spin animate-spin'; params = {}; params['source'] = document.querySelector('input[name="source"]').value params['destination'] = document.querySelector('input[name="destination"]').value + if(params['destination'].length === 0 || params['source'].length === 0) { + return; + } + + document.querySelector('button.push i').className = 'icon-spin animate-spin'; broadcast.send('import-photos', params); }; this.submit.updatePhotos = function(ev) { diff --git a/app/html/location.html b/app/html/location.html index a19ee2b..21037ff 100644 --- a/app/html/location.html +++ b/app/html/location.html @@ -10,8 +10,12 @@
+
+ +
How can I help you? -- Elodie - +
diff --git a/app/index.js b/app/index.js index 354feb4..dcb80b2 100644 --- a/app/index.js +++ b/app/index.js @@ -1,7 +1,9 @@ var menubar = require('menubar'), + menu = require("menu"), tray = require('tray'), ipc = require('ipc'), - exec = require('child_process').exec;; + exec = require('child_process').exec, + loadUrl = null; /* * The main process listens for events from the web renderer. @@ -19,6 +21,7 @@ ipc.on('import-photos', function(event, args) { console.log(args); if(typeof(args['source']) === 'undefined' || args['source'].length === 0 || typeof(args['destination']) === 'undefined' || args['destination'].length === 0) { console.log('no source or destination passed in to import-photos'); + event.sender.send('update-import-no-photos', null); return; } @@ -94,37 +97,60 @@ ipc.on('update-photos', function(event, args) { }); }); - ipc.on('launch-finder', function(event, path) { console.log(path); var shell = require('shell'); shell.showItemInFolder(path); }); +ipc.on('program-quit', function(event, path) { + console.log('program-quit'); + //mb.tray.destroy(); + mb.quit(); +}); + var mb = menubar( { preloadWindow: true, dir: __dirname + '/html', index: 'index.html', pages: { + 'blank': 'blank.html', 'location': 'location.html' }, width: 400, - height: 500 + height: 500, + 'window-position': 'trayCenter' } - ) + ); mb.on('ready', function ready () { console.log('app is ready') + var template = [{ + label: "Application", + submenu: [ + { label: "Quit", accelerator: "Command+Q", click: function() { app.quit(); }} + ]}, { + label: "Edit", + submenu: [ + { label: "Undo", accelerator: "CmdOrCtrl+Z", selector: "undo:" }, + { label: "Redo", accelerator: "Shift+CmdOrCtrl+Z", selector: "redo:" }, + { label: "Cut", accelerator: "CmdOrCtrl+X", selector: "cut:" }, + { label: "Copy", accelerator: "CmdOrCtrl+C", selector: "copy:" }, + { label: "Paste", accelerator: "CmdOrCtrl+V", selector: "paste:" }, + { label: "Select All", accelerator: "CmdOrCtrl+A", selector: "selectAll:" } + ]} + ]; + menu.setApplicationMenu(menu.buildFromTemplate(template)); + this.tray.setToolTip('Drag and drop files here') - //this.tray.setImage('img/logo.png') + this.tray.setImage(mb.getOption('dir') + '/img/logo@18x22xbw.png') this.tray.on('clicked', function clicked () { console.log('tray-clicked') }) this.tray.on('drop-files', function dropFiles (ev, files) { - mb.showWindow() - console.log('window file name ' + mb.window.getRepresentedFilename()) - mb.window.loadUrl('file://' + mb.getOption('dir') + '/' + mb.getOption('pages')['location']) + loadUrl = mb.getOption('pages')['location']; + mb.showWindow(); //mb.window.openDevTools(); mb.window.webContents.on('did-finish-load', function() { mb.window.webContents.send('files', files); @@ -140,9 +166,14 @@ mb.on('create-window', function createWindow () { mb.on('after-create-window', function afterCreateWindow () { }) +var loaded = false; mb.on('show', function show () { - //this.window.openDevTools(); - this.window.loadUrl('file://' + this.getOption('dir') + '/' + this.getOption('index')) + if(loadUrl === null) { + loadUrl = this.getOption('index'); + } + this.window.loadUrl('file://' + this.getOption('dir') + '/' + loadUrl); + loadUrl = null; + //mb.window.openDevTools(); }) mb.on('after-show', function afterShow () { @@ -155,4 +186,5 @@ mb.on('hide', function hide () { mb.on('after-hide', function afterHide () { console.log('after-hide') + this.window.loadUrl('file://' + this.getOption('dir') + '/' + this.getOption('pages')['blank']); })