Skip to content

Commit

Permalink
update few bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
leftstick committed Aug 12, 2015
1 parent 0eda5ef commit 1ace636
Show file tree
Hide file tree
Showing 13 changed files with 190 additions and 159 deletions.
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# 保密局 ![](http://img.shields.io/badge/version-v1.2.4-green.svg) #
# 保密局 ![](http://img.shields.io/badge/version-v1.2.6-green.svg) #
===============

在信息极速膨胀的时代,我们都面临着大量的敏感信息,最重要的莫过于自己各种网站、卡的账号和密码了。因为众所周知的一些云存储泄漏丑闻,以及人类本能的自我保护意识,相信大家都不会放心把自己的众多银行卡密码保存在一个Online的“云”里,随时有可能被盗哦!
Expand All @@ -11,10 +11,10 @@

## 下载 ##

* **v1.2.4** (2015-03-09)
* **v1.2.6** (2015-08-12)

* Windows: [64bit](https://github.com/leftstick/windtalker/releases/download/1.2.4/windtalker-v1.2.4-win-x64.tar.gz)
* Mac 10.7+: [64bit](https://github.com/leftstick/windtalker/releases/download/1.2.4/windtalker-v1.2.4-darwin-x64.tar.gz)
* Windows: [64bit](https://github.com/leftstick/windtalker/releases/download/1.2.6/windtalker-v1.2.6-win-x64.tar.gz)
* Mac 10.7+: [64bit](https://github.com/leftstick/windtalker/releases/download/1.2.6/windtalker-v1.2.6-darwin-x64.tar.gz)


## 本地源码编译 ##
Expand Down Expand Up @@ -49,4 +49,4 @@

> `Release build` 必须指定`-p`参数,详情参考[password](http://nodejs.org/api/crypto.html#crypto_crypto_createcipher_algorithm_password)
> 编译后的可执行文件在`build/windtalker/<OS>/`下,双击`windtalker.app`或者`windtalker.exe`即可打开
> 编译后的可执行文件在`build/windtalker/<OS>/`下,双击`windtalker.app`或者`windtalker.exe`即可打开
26 changes: 13 additions & 13 deletions bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "windtalker",
"version": "1.2.5",
"version": "1.2.6",
"homepage": "https://github.com/leftstick/windtalker",
"description": "windtalker helps people managing security cared information",
"keywords": [
Expand All @@ -20,23 +20,23 @@
"tests"
],
"dependencies": {
"angular": "1.3.15",
"angular-route": "1.3.15",
"angular-animate": "1.3.15",
"lodash": "3.9.3-amd",
"requirejs": "2.1.15",
"jquery": "2.1.3",
"angular": "1.4.3",
"angular-route": "1.4.3",
"angular-animate": "1.4.3",
"lodash": "3.10.1-amd",
"requirejs": "2.1.20",
"jquery": "2.1.4",
"requirejs-tpl": "*",
"require-css": "0.1.8",
"bootstrap": "3.3.4",
"angular-strap": "2.2.2",
"angular-local-storage": "0.1.5",
"bootstrap": "3.3.5",
"angular-strap": "2.3.1",
"angular-local-storage": "0.2.2",
"noty": "2.3.5",
"angular-smart-table": "2.0.3",
"angular-smart-table": "2.1.2",
"ngAnimate": "*",
"animate.css": "~3.3.0",
"animate.css": "~3.4.0",
"keymaster": "~1.6.3",
"angular-motion": "0.4.2",
"angular-theme-spinner": "~1.1.0"
"angular-theme-spinner": "~1.2.0"
}
}
51 changes: 25 additions & 26 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,14 @@
var gulp = require('gulp');
var os = require('os');

var SYSTEMS = {
darwin: 'osx',
win32: 'win'
};
var SYSTEMS = {darwin: 'osx', win32: 'win'};

var argv = require('minimist')(process.argv.slice(2));

var devBuild = !argv.prod;
var password = argv.p;

if(!devBuild && !password){
if (!devBuild && !password) {
console.warn('WARNING: you have to specify -p');
process.exit(0);
}
Expand All @@ -27,39 +24,31 @@ gulp.task('less', ['clean'], function() {
var less = require('gulp-less');
var LessPluginAutoPrefix = require('less-plugin-autoprefix');
var autoprefix = new LessPluginAutoPrefix({
browsers: ['last 5 versions']
browsers: [
'last 5 versions'
]
});

return gulp.src('src/less/main.less')
.pipe(less({
plugins: [autoprefix]
}))
.pipe(less({plugins: [autoprefix]}))
.pipe(gulp.dest('src/css/'));
});

gulp.task('gen-pkg', function() {
var template = require('gulp-template');
var rename = require('gulp-rename');
return gulp.src('src/package.json_vm')
.pipe(template({
devBuild: devBuild
}))
.pipe(rename({
extname: '.json'
}))
.pipe(template({devBuild: devBuild}))
.pipe(rename({extname: '.json'}))
.pipe(gulp.dest('src/'));
});

gulp.task('gen-util',['gen-pkg'], function() {
gulp.task('gen-util', ['gen-pkg'], function() {
var template = require('gulp-template');
var rename = require('gulp-rename');
return gulp.src('src/js/fw/service/utils.js_vm')
.pipe(template({
password: password ? password : 'xpM9h6TJK72'
}))
.pipe(rename({
extname: '.js'
}))
.pipe(template({password: password ? password : 'xpM9h6TJK72'}))
.pipe(rename({extname: '.js'}))
.pipe(gulp.dest('src/js/fw/service/'));
});

Expand All @@ -71,13 +60,23 @@ gulp.task('install', ['less', 'gen-util'], function() {

gulp.task('default', ['install'], function() {
var NwBuilder = require('node-webkit-builder');
var platforms = devBuild ? [SYSTEMS[os.platform()] + os.arch().substring(1)] : ['osx64', 'win64'];
var platforms = devBuild ? [
SYSTEMS[os.platform()] + os.arch().substring(1)
] : ['osx64', 'win64'];
var nw = new NwBuilder({
files: ['./src/css/**/*.*', './src/fonts/**/*.*', './src/img/**/*.*', './src/js/**/*.*', './src/node_modules/**/*.*', './src/index.html', './src/package.json'],
version: 'v0.11.6',
files: [
'./src/css/**/*.*',
'./src/fonts/**/*.*',
'./src/img/**/*.*',
'./src/js/**/*.*',
'./src/node_modules/**/*.*',
'./src/index.html',
'./src/package.json'
],
version: 'v0.12.3',
macZip: true,
platforms: platforms
// platforms: ['osx32', 'osx64', 'win32', 'win64']
// platforms: ['osx32', 'osx64', 'win32', 'win64']
});

nw.build().then(function() {
Expand Down
20 changes: 10 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "windtalker",
"version": "1.2.5",
"version": "1.2.6",
"description": "windtalker helps people managing security cared information",
"repository": {
"type": "git",
Expand All @@ -18,14 +18,14 @@
},
"homepage": "https://github.com/leftstick/windtalker",
"devDependencies": {
"gulp": "^3.8.11",
"gulp-install": "^0.4.0",
"gulp-less": "^3.0.3",
"gulp-rename": "^1.2.2",
"gulp-template": "^3.0.0",
"less-plugin-autoprefix": "^1.4.2",
"minimist": "^1.1.1",
"node-webkit-builder": "^1.0.11",
"rimraf": "^2.3.4"
"gulp": "^3.9.0",
"gulp-install": "^0.4.0",
"gulp-less": "^3.0.3",
"gulp-rename": "^1.2.2",
"gulp-template": "^3.0.0",
"less-plugin-autoprefix": "^1.4.2",
"minimist": "^1.1.3",
"node-webkit-builder": "^1.0.13",
"rimraf": "^2.4.2"
}
}
39 changes: 23 additions & 16 deletions src/js/common/logic/CloseBlocker.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,30 +17,37 @@

var win = global.gui.Window.get();

module.run(['events', 'auth', function(events, auth) {
module.run([
'events',
'auth',
function(events, auth) {

win.on('close', function() {
win.on('close', function() {

if (!auth.currentUser()) {
win.close(true);
return;
}

events.emit('confirm', {
content: '您确定要退出保密局么?',
onConfirm: function() {
if (!auth.currentUser()) {
win.close(true);
return;
}
});

if (angular.element('#exit.modal').length > 0) {
return;
}

events.emit('confirm', {
id: 'exit',
content: '您确定要退出保密局么?',
onConfirm: function() {
win.close(true);
}
});


});
});

}]);
}
]);

return {
name: modulename
};
return {name: modulename};

});

Expand Down
31 changes: 17 additions & 14 deletions src/js/common/logic/Exit.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,33 +9,36 @@
(function(define, global) {
'use strict';

define(['angular'], function(angular) {
define(['angular', 'lodash'], function(angular, _) {

var modulename = 'ExitModule';

var module = angular.module(modulename, []);

var win = global.gui.Window.get();

module.run(['auth', 'key', 'utils', function(auth, key, utils) {
module.run([
'auth',
'key',
'utils',
function(auth, key, utils) {

key.on('esc', function(e) {
key.on('esc', _.debounce(function(e) {

if (!auth.currentUser()) {
win.close(true);
return;
}
if (!auth.currentUser()) {
win.close(true);
return;
}

utils.stopEvent(e);
win.close();
});
utils.stopEvent(e);
win.close();
}, 150));


}]);
}
]);

return {
name: modulename
};
return {name: modulename};

});

Expand Down
4 changes: 2 additions & 2 deletions src/js/common/ui/confirm.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<div class="modal" role="dialog">
<div class="modal" role="dialog" id="{{ id }}">
<div class="modal-dialog modal-sm">
<div class="modal-content">
<div class="modal-header" ng-show="title">
Expand All @@ -12,4 +12,4 @@ <h4 class="modal-title color-primary" ng-bind="title"></h4>
</div>
</div>
</div>
</div>
</div>
58 changes: 31 additions & 27 deletions src/js/common/ui/confirm.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,37 +16,41 @@

var common = angular.module(moduleName, []);

common.run(['events', '$rootScope', function(events, $rootScope) {

events.on('confirm', function(opts) {
if (!opts) {
return;
}

var scope = $rootScope.$new();

scope.confirm = function($hide) {
$hide();
if (angular.isFunction(opts.onConfirm)) {
opts.onConfirm();
common.run([
'events',
'$rootScope',
function(events, $rootScope) {

events.on('confirm', function(opts) {
if (!opts) {
return;
}
};

events.emit('modal', {
scope: scope,
title: '确认',
content: opts.content,
animation: 'am-fade-and-slide-top',
template: commonBase + '/ui/confirm.html'

var scope = $rootScope.$new();

scope.confirm = function($hide) {
$hide();
if (angular.isFunction(opts.onConfirm)) {
opts.onConfirm();
}
};

scope.id = opts.id;

events.emit('modal', {
scope: scope,
id: opts.id,
title: '确认',
content: opts.content,
animation: 'am-fade-and-slide-top',
templateUrl: commonBase + '/ui/confirm.html'
});
});
});

}]);
}
]);

return {
type: 'feature',
name: moduleName
};
return {type: 'feature', name: moduleName};

});

Expand Down
4 changes: 2 additions & 2 deletions src/js/common/ui/info.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<div class="modal" role="dialog">
<div class="modal" role="dialog" id="{{ id }}">
<div class="modal-dialog modal-sm">
<div class="modal-content">
<div class="modal-header" ng-show="title">
Expand All @@ -11,4 +11,4 @@ <h4 class="modal-title color-primary" ng-bind="title"></h4>
</div>
</div>
</div>
</div>
</div>
Loading

0 comments on commit 1ace636

Please sign in to comment.