Skip to content

Commit

Permalink
Merge pull request #34 from rixombea/master
Browse files Browse the repository at this point in the history
fix typo, input hints, clean up & polishing
  • Loading branch information
rixombea committed Oct 2, 2018
2 parents 8569165 + 6d64776 commit ba96e9c
Show file tree
Hide file tree
Showing 27 changed files with 868 additions and 448 deletions.
72 changes: 72 additions & 0 deletions .jshintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
{
"maxerr" : 50,
"bitwise" : true,
"camelcase" : false,
"curly" : false,
"eqeqeq" : true,
"forin" : true,
"freeze" : true,
"immed" : false,
"latedef" : false,
"newcap" : false,
"noarg" : true,
"noempty" : true,
"nonbsp" : true,
"nonew" : false,
"plusplus" : false,
"quotmark" : false,
"undef" : true,
"unused" : true,
"strict" : "implied",
"maxparams" : false,
"maxdepth" : false,
"maxstatements" : false,
"maxcomplexity" : false,
"maxlen" : false,
"varstmt" : false,
"asi" : false,
"boss" : false,
"debug" : false,
"eqnull" : false,
"esversion" : 6,
"moz" : false,
"evil" : false,
"expr" : false,
"funcscope" : false,
"globalstrict" : false,
"iterator" : false,
"lastsemic" : false,
"laxbreak" : false,
"laxcomma" : false,
"loopfunc" : false,
"multistr" : false,
"noyield" : false,
"notypeof" : false,
"proto" : false,
"scripturl" : false,
"shadow" : false,
"sub" : false,
"supernew" : false,
"validthis" : true,
"browser" : true,
"browserify" : false,
"couch" : false,
"devel" : true,
"dojo" : false,
"jasmine" : false,
"jquery" : false,
"mocha" : true,
"mootools" : false,
"node" : true,
"nonstandard" : false,
"phantom" : false,
"prototypejs" : false,
"qunit" : false,
"rhino" : false,
"shelljs" : false,
"typed" : false,
"worker" : false,
"wsh" : false,
"yui" : false,
"globals" : {}
}
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ This wallet contains the basic functions required to manage your TurtleCoin wall
* Display transaction detail
* Incoming Transaction notification
* Send TurtleCoin to single recipient address, allow to set payment id and custom fee. Provides address lookup from addressbook.
* Perform wallet optimization by creating fusion transaction
* Provides utility to generate payment id and integrated address
* Address book
* Add/Edit/Delete address entry (label/name, address and payment id)
* Listing/sorting/searching existing entries
Expand All @@ -34,7 +36,7 @@ This wallet contains the basic functions required to manage your TurtleCoin wall
* Provides setting to use system tray (on closing/minimizing wallet)
* Provides list of public nodes, fetch/updated daily from turtlecoin-nodes-json repo. Display order of public nodes will be shuffled on every access to settings page, to give relatively fair opportunity for node operators to be on top of the list
* Custom node address that is not on the list will be added/remembered for future use
* Dark/Night Mode
* Theme: Day & Night Mode
* [Keyboard shortcuts](docs/shortcut.md)


Expand Down
35 changes: 24 additions & 11 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,11 @@ const DEFAULT_SETTINGS = {
pubnodes_custom: ['127.0.0.1:11898'],
tray_minimize: false,
tray_close: false
}
};
const DEFAULT_SIZE = {
width: (platform == 'win32' ? 840 : 800),
width: (platform === 'win32' ? 840 : 800),
height: 690
}
};

app.prompExit = true;
app.prompShown = false;
Expand Down Expand Up @@ -76,7 +76,7 @@ function createWindow () {
// maximizable: false,
// minimizable: true,
// resizable: false
}
};

win = splash.initSplashScreen({
windowOpts: winOpts,
Expand Down Expand Up @@ -105,7 +105,20 @@ function createWindow () {
tray.setToolTip(DEFAULT_TRAY_TIP);
tray.setContextMenu(contextMenu);
tray.on('click', () => {
win.isVisible() ? win.hide() : win.show();
if(settings.get('tray_minimize', false)){
if(win.isVisible()){
win.hide();
}else{
win.show();
}
}else{
if(win.isMinimized()){
win.restore();
}else{
win.minimize();
}
}

});

win.on('show', () => {
Expand Down Expand Up @@ -160,7 +173,7 @@ function createWindow () {
//win.show();
win.setTitle(DEFAULT_TITLE);
tray.setToolTip(DEFAULT_TRAY_TIP);
})
});

win.on('close', (e) => {
if(settings.get('tray_close') && !app.needToExit){
Expand Down Expand Up @@ -196,14 +209,14 @@ function createWindow () {
win.setMenu(null);

// misc handler
win.webContents.on('crashed', (event, killed) => {
win.webContents.on('crashed', () => {
// todo: prompt to restart
log.debug('webcontent was crashed');
});

win.on('unresponsive', (even) => {
win.on('unresponsive', () => {
// todo: prompt to restart
log.debug('webcontent is unresponsive')
log.debug('webcontent is unresponsive');
});
}

Expand Down Expand Up @@ -256,7 +269,7 @@ function initSettings(){
}

const silock = app.requestSingleInstanceLock();
app.on('second-instance', (commandLine, workingDirectory) => {
app.on('second-instance', () => {
if (win) {
if (!win.isVisible()) win.show();
if (win.isMinimized()) win.restore();
Expand Down Expand Up @@ -285,7 +298,7 @@ app.on('ready', () => {

let today = new Date();
let last_checked = new Date(settings.get('pubnodes_date'));
diff_d = parseInt((today-last_checked)/(1000*60*60*24),10);
let diff_d = parseInt((today-last_checked)/(1000*60*60*24),10);
if(diff_d >= 1){
log.info('Performing daily public-node list update.');
doNodeListUpdate();
Expand Down
Loading

0 comments on commit ba96e9c

Please sign in to comment.