Skip to content

Commit b28c16f

Browse files
committed
1.2.1
1. 修复快速新建项目问题 2. 优化任务执行交互 3. 更换统计代码 4. 全新的 macOS 安装界面
1 parent f85d5a4 commit b28c16f

File tree

7 files changed

+181
-37
lines changed

7 files changed

+181
-37
lines changed

about.html

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,82 @@
55
<title></title>
66
<link rel="stylesheet" href="assets/css/reset.css">
77
<link rel="stylesheet" href="assets/css/app.css">
8+
9+
<script type="text/javascript">
10+
11+
window.nodeRequire = require;
12+
delete window.require;
13+
delete window.exports;
14+
delete window.module;
15+
16+
// Pretend that cookies work
17+
(function (document) {
18+
var cookies = {};
19+
document.__defineGetter__('cookie', function () {
20+
var output = [];
21+
for (var cookieName in cookies) {
22+
output.push(cookieName + "=" + cookies[cookieName]);
23+
}
24+
return output.join(";");
25+
});
26+
document.__defineSetter__('cookie', function (s) {
27+
var indexOfSeparator = s.indexOf("=");
28+
var key = s.substr(0, indexOfSeparator);
29+
var value = s.substring(indexOfSeparator + 1);
30+
cookies[key] = value;
31+
return key + "=" + value;
32+
});
33+
document.clearCookies = function () {
34+
cookies = {};
35+
};
36+
37+
originalLocation = document.location;
38+
// Pretend that we're hosted on an Internet Website
39+
document.__defineGetter__('location', function () {
40+
return {
41+
href: 'http://weflow.app/',
42+
protocol: 'http:',
43+
host: 'weflow.app',
44+
port: '',
45+
pathname: '/',
46+
search: '',
47+
hash: '',
48+
username: '',
49+
password: '',
50+
origin: 'http://weflow.app',
51+
reload: function () {
52+
return originalLocation.reload.apply(originalLocation, arguments);
53+
}
54+
};
55+
});
56+
57+
// Nobody sets location
58+
document.__defineSetter__('location', function () {
59+
})
60+
})(document);
61+
62+
(function (i, s, o, g, r, a, m) {
63+
i['GoogleAnalyticsObject'] = r;
64+
i[r] = i[r] || function () {
65+
(i[r].q = i[r].q || []).push(arguments)
66+
}, i[r].l = 1 * new Date();
67+
a = s.createElement(o),
68+
m = s.getElementsByTagName(o)[0];
69+
a.async = 1;
70+
a.src = g;
71+
m.parentNode.insertBefore(a, m)
72+
})(window, document, 'script', 'https://o4jiepyc4.qnssl.com/analytics.js', 'ga');
73+
// qiniu CDN for speeding up ga.js -> https://www.google-analytics.com/analytics.js
74+
75+
// Get using version of WeFlow
76+
var version = nodeRequire('./package.json').version;
77+
78+
ga('create', 'UA-24431632-7', 'auto');
79+
ga('set', 'checkProtocolTask', null); // Disable file protocol checking.
80+
ga('set', 'location', '/about.html'); // Allow file:// request for GA
81+
ga('send', 'pageview');
82+
83+
</script>
884
</head>
985
<body>
1086

app.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
<link rel="stylesheet" href="assets/css/reset.css">
77
<link rel="stylesheet" href="assets/css/app.css">
88

9-
<script type="text/javascript" src="http://tajs.qq.com/stats?sId=56909571" charset="UTF-8"></script>
109
<script type="text/javascript">
1110

1211
window.nodeRequire = require;
@@ -134,7 +133,7 @@
134133

135134
<div class="setting hide" id="js-setting">
136135
<a href="javascript:;" id="js-setting-close" class="icon icon-close"></a>
137-
<a href="javascript:;" id="js-help" class="icon icon-help"></a>
136+
<a href="https://github.com/weixin/weflow" id="js-help" class="icon icon-help"></a>
138137

139138
<div class="setting__section" id="js-workspace">
140139
<div class="setting__hd">工作区路径</div>
@@ -222,5 +221,6 @@
222221
<script src="./assets/js/jquery.min.js"></script>
223222
<script src="./src/app.js"></script>
224223
<script src="./src/menu.js"></script>
224+
<script type="text/javascript" src="http://pingjs.qq.com/h5/stats.js" name="MTAH5" sid="500140708"></script>
225225
</body>
226226
</html>

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "WeFlow",
3-
"version": "1.2.0",
3+
"version": "1.2.1",
44
"release": "1.2.0",
55
"description": "A minimal Electron application",
66
"main": "main.js",

src/_tasks/dist.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -239,6 +239,11 @@ function dist(projectPath, log, callback) {
239239
gulp.src(paths.tmp.dirAll)
240240
.pipe(revAll.revision())
241241
.pipe(gulp.dest(paths.tmp.dir))
242+
.pipe(revDel({
243+
exclude: /(.html|.htm)$/
244+
}))
245+
.pipe(revAll.manifestFile())
246+
.pipe(gulp.dest(paths.tmp.dir))
242247
.on('end', function () {
243248
console.log('reversion success.');
244249
log('reversion success.');

src/_tasks/ftp.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
const path = require('path');
44
const async = require('async');
5+
const gulp = require('gulp');
56
const _ = require('lodash');
67
const del = require('del');
78
const ftp = require('gulp-ftp');
@@ -19,6 +20,13 @@ module.exports = function (projectPath, log, callback) {
1920
config = Common.requireUncached(path.join(__dirname, '../../weflow.config.json'));
2021
}
2122

23+
let configFTP = config.ftp;
24+
25+
if(configFTP.host === '' || configFTP.port === '' || configFTP.user === ''){
26+
callback('ftp config');
27+
return;
28+
}
29+
2230
let projectName = path.basename(projectPath);
2331

2432
//清除目标目录
@@ -36,7 +44,7 @@ module.exports = function (projectPath, log, callback) {
3644
let distPath = config['ftp']['includeHtml'] ? path.join(projectPath, './dist/**/*') : [path.join(projectPath, './dist/**/*'), path.join(projectPath, '!./dist/html/**/*.html')];
3745

3846

39-
vfs.src(distPath, {base: '.'})
47+
gulp.src(distPath, {base: '.'})
4048
.pipe(ftp(ftpConfig))
4149
.on('end', function () {
4250
console.log('ftp success.');

0 commit comments

Comments
 (0)