Fixed gulp bugs
This commit is contained in:
parent
96525d4933
commit
e362ff26da
10
.gitignore
vendored
10
.gitignore
vendored
@ -1,11 +1,11 @@
|
|||||||
.DS_Store
|
.DS_Store
|
||||||
.idea
|
.idea
|
||||||
|
*.sublime-workspace
|
||||||
|
|
||||||
# Node.js package manager
|
# Node.js package manager
|
||||||
/node_modules
|
node_modules
|
||||||
/npm-debug.log
|
npm-debug.log
|
||||||
dist
|
dist
|
||||||
package_dist
|
releases
|
||||||
webogram*.zip
|
webogram*.zip
|
||||||
app/js/partials.js
|
app/js/templates.js
|
||||||
*.sublime-workspace
|
|
@ -484,7 +484,7 @@ input[type="number"]::-webkit-inner-spin-button {
|
|||||||
margin-right: -7px;
|
margin-right: -7px;
|
||||||
}
|
}
|
||||||
.im_dialogs_col .nano > .pane {
|
.im_dialogs_col .nano > .pane {
|
||||||
background : rgba(0,0,0,.0);
|
background : rgba(0,0,0,0.0);
|
||||||
width : 12px;
|
width : 12px;
|
||||||
right: 0px;
|
right: 0px;
|
||||||
-webkit-transition : .2s;
|
-webkit-transition : .2s;
|
||||||
|
@ -44,16 +44,20 @@
|
|||||||
|
|
||||||
<script type="text/javascript" src="js/lib/config.js"></script>
|
<script type="text/javascript" src="js/lib/config.js"></script>
|
||||||
<script type="text/javascript" src="js/lib/mtproto.js"></script>
|
<script type="text/javascript" src="js/lib/mtproto.js"></script>
|
||||||
|
|
||||||
<script type="text/javascript" src="js/util.js"></script>
|
<script type="text/javascript" src="js/util.js"></script>
|
||||||
<script type="text/javascript" src="js/partials.js"></script>
|
|
||||||
<script type="text/javascript" src="js/app.js"></script>
|
<script type="text/javascript" src="js/app.js"></script>
|
||||||
<script type="text/javascript" src="js/services.js"></script>
|
<script type="text/javascript" src="js/services.js"></script>
|
||||||
<script type="text/javascript" src="js/controllers.js"></script>
|
<script type="text/javascript" src="js/controllers.js"></script>
|
||||||
<script type="text/javascript" src="js/filters.js"></script>
|
<script type="text/javascript" src="js/filters.js"></script>
|
||||||
|
|
||||||
|
<!--PRODUCTION_ONLY_BEGIN
|
||||||
|
<script type="text/javascript" src="js/templates.js"></script>
|
||||||
|
PRODUCTION_ONLY_END-->
|
||||||
|
|
||||||
<script type="text/javascript" src="js/directives.js"></script>
|
<script type="text/javascript" src="js/directives.js"></script>
|
||||||
<!-- endbuild -->
|
<!-- endbuild -->
|
||||||
|
|
||||||
|
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
@ -1,5 +1,5 @@
|
|||||||
/*!
|
/*!
|
||||||
* Webogram v0.0.1 - messaging web application for MTProto
|
* Webogram v0.0.19 - messaging web application for MTProto
|
||||||
* https://github.com/zhukov/webogram
|
* https://github.com/zhukov/webogram
|
||||||
* Copyright (C) 2014 Igor Zhukov <igor.beatle@gmail.com>
|
* Copyright (C) 2014 Igor Zhukov <igor.beatle@gmail.com>
|
||||||
* https://github.com/zhukov/webogram/blob/master/LICENSE
|
* https://github.com/zhukov/webogram/blob/master/LICENSE
|
||||||
@ -30,10 +30,12 @@ angular.module('myApp', [
|
|||||||
'ngAnimate',
|
'ngAnimate',
|
||||||
'ngSanitize',
|
'ngSanitize',
|
||||||
'ui.bootstrap',
|
'ui.bootstrap',
|
||||||
'partials',
|
'mtproto.services',
|
||||||
'myApp.filters',
|
'myApp.filters',
|
||||||
'myApp.services',
|
'myApp.services',
|
||||||
'mtproto.services',
|
/*PRODUCTION_ONLY_BEGIN
|
||||||
|
'myApp.templates',
|
||||||
|
PRODUCTION_ONLY_END*/
|
||||||
'myApp.directives',
|
'myApp.directives',
|
||||||
'myApp.controllers'
|
'myApp.controllers'
|
||||||
]).
|
]).
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*!
|
/*!
|
||||||
* Webogram v0.0.1 - messaging web application for MTProto
|
* Webogram v0.0.19 - messaging web application for MTProto
|
||||||
* https://github.com/zhukov/webogram
|
* https://github.com/zhukov/webogram
|
||||||
* Copyright (C) 2014 Igor Zhukov <igor.beatle@gmail.com>
|
* Copyright (C) 2014 Igor Zhukov <igor.beatle@gmail.com>
|
||||||
* https://github.com/zhukov/webogram/blob/master/LICENSE
|
* https://github.com/zhukov/webogram/blob/master/LICENSE
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*!
|
/*!
|
||||||
* Webogram v0.0.1 - messaging web application for MTProto
|
* Webogram v0.0.19 - messaging web application for MTProto
|
||||||
* https://github.com/zhukov/webogram
|
* https://github.com/zhukov/webogram
|
||||||
* Copyright (C) 2014 Igor Zhukov <igor.beatle@gmail.com>
|
* Copyright (C) 2014 Igor Zhukov <igor.beatle@gmail.com>
|
||||||
* https://github.com/zhukov/webogram/blob/master/LICENSE
|
* https://github.com/zhukov/webogram/blob/master/LICENSE
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*!
|
/*!
|
||||||
* Webogram v0.0.1 - messaging web application for MTProto
|
* Webogram v0.0.19 - messaging web application for MTProto
|
||||||
* https://github.com/zhukov/webogram
|
* https://github.com/zhukov/webogram
|
||||||
* Copyright (C) 2014 Igor Zhukov <igor.beatle@gmail.com>
|
* Copyright (C) 2014 Igor Zhukov <igor.beatle@gmail.com>
|
||||||
* https://github.com/zhukov/webogram/blob/master/LICENSE
|
* https://github.com/zhukov/webogram/blob/master/LICENSE
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*!
|
/*!
|
||||||
* Webogram v0.0.1 - messaging web application for MTProto
|
* Webogram v0.0.19 - messaging web application for MTProto
|
||||||
* https://github.com/zhukov/webogram
|
* https://github.com/zhukov/webogram
|
||||||
* Copyright (C) 2014 Igor Zhukov <igor.beatle@gmail.com>
|
* Copyright (C) 2014 Igor Zhukov <igor.beatle@gmail.com>
|
||||||
* https://github.com/zhukov/webogram/blob/master/LICENSE
|
* https://github.com/zhukov/webogram/blob/master/LICENSE
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*!
|
/*!
|
||||||
* Webogram v0.0.1 - messaging web application for MTProto
|
* Webogram v0.0.19 - messaging web application for MTProto
|
||||||
* https://github.com/zhukov/webogram
|
* https://github.com/zhukov/webogram
|
||||||
* Copyright (C) 2014 Igor Zhukov <igor.beatle@gmail.com>
|
* Copyright (C) 2014 Igor Zhukov <igor.beatle@gmail.com>
|
||||||
* https://github.com/zhukov/webogram/blob/master/LICENSE
|
* https://github.com/zhukov/webogram/blob/master/LICENSE
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*!
|
/*!
|
||||||
* Webogram v0.0.1 - messaging web application for MTProto
|
* Webogram v0.0.19 - messaging web application for MTProto
|
||||||
* https://github.com/zhukov/webogram
|
* https://github.com/zhukov/webogram
|
||||||
* Copyright (C) 2014 Igor Zhukov <igor.beatle@gmail.com>
|
* Copyright (C) 2014 Igor Zhukov <igor.beatle@gmail.com>
|
||||||
* https://github.com/zhukov/webogram/blob/master/LICENSE
|
* https://github.com/zhukov/webogram/blob/master/LICENSE
|
||||||
@ -1122,7 +1122,7 @@ factory('MtpAuthorizer', function (MtpDcConfigurator, MtpRsaKeysManager, MtpSecu
|
|||||||
|
|
||||||
console.log('PQ factorization start');
|
console.log('PQ factorization start');
|
||||||
if (!!window.Worker) {
|
if (!!window.Worker) {
|
||||||
var worker = new Worker('js/lib/pq_worker.js?1');
|
var worker = new Worker('js/lib/pq_worker.js');
|
||||||
|
|
||||||
worker.onmessage = function (e) {
|
worker.onmessage = function (e) {
|
||||||
auth.p = e.data[0];
|
auth.p = e.data[0];
|
||||||
@ -1416,7 +1416,7 @@ factory('MtpAesService', function ($q) {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
var worker = new Worker('js/lib/aes_worker.js?2'),
|
var worker = new Worker('js/lib/aes_worker.js'),
|
||||||
taskID = 0,
|
taskID = 0,
|
||||||
awaiting = {};
|
awaiting = {};
|
||||||
|
|
||||||
@ -1468,7 +1468,7 @@ factory('MtpSha1Service', function ($q) {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
var worker = new Worker('js/lib/sha1_worker.js?2'),
|
var worker = new Worker('js/lib/sha1_worker.js'),
|
||||||
taskID = 0,
|
taskID = 0,
|
||||||
awaiting = {};
|
awaiting = {};
|
||||||
|
|
||||||
|
@ -1,12 +1,12 @@
|
|||||||
/*!
|
/*!
|
||||||
* Webogram v0.0.1 - messaging web application for MTProto
|
* Webogram v0.0.19 - messaging web application for MTProto
|
||||||
* https://github.com/zhukov/webogram
|
* https://github.com/zhukov/webogram
|
||||||
* Copyright (C) 2014 Igor Zhukov <igor.beatle@gmail.com>
|
* Copyright (C) 2014 Igor Zhukov <igor.beatle@gmail.com>
|
||||||
* https://github.com/zhukov/webogram/blob/master/LICENSE
|
* https://github.com/zhukov/webogram/blob/master/LICENSE
|
||||||
*/
|
*/
|
||||||
|
|
||||||
importScripts(
|
importScripts(
|
||||||
'../../vendor/console-polyfill/console-polyfill.js?1',
|
'../../vendor/console-polyfill/console-polyfill.js',
|
||||||
'mtproto.js',
|
'mtproto.js',
|
||||||
'../../vendor/jsbn/jsbn_combined.js'
|
'../../vendor/jsbn/jsbn_combined.js'
|
||||||
);
|
);
|
||||||
|
@ -1,14 +1,14 @@
|
|||||||
/*!
|
/*!
|
||||||
* Webogram v0.0.1 - messaging web application for MTProto
|
* Webogram v0.0.19 - messaging web application for MTProto
|
||||||
* https://github.com/zhukov/webogram
|
* https://github.com/zhukov/webogram
|
||||||
* Copyright (C) 2014 Igor Zhukov <igor.beatle@gmail.com>
|
* Copyright (C) 2014 Igor Zhukov <igor.beatle@gmail.com>
|
||||||
* https://github.com/zhukov/webogram/blob/master/LICENSE
|
* https://github.com/zhukov/webogram/blob/master/LICENSE
|
||||||
*/
|
*/
|
||||||
|
|
||||||
importScripts(
|
importScripts(
|
||||||
'../../vendor/console-polyfill/console-polyfill.js?1',
|
'../../vendor/console-polyfill/console-polyfill.js',
|
||||||
'mtproto.js',
|
'mtproto.js',
|
||||||
'../../vendor/cryptoJS/crypto.js?1'
|
'../../vendor/cryptoJS/crypto.js'
|
||||||
);
|
);
|
||||||
|
|
||||||
onmessage = function (e) {
|
onmessage = function (e) {
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*!
|
/*!
|
||||||
* Webogram v0.0.1 - messaging web application for MTProto
|
* Webogram v0.0.19 - messaging web application for MTProto
|
||||||
* https://github.com/zhukov/webogram
|
* https://github.com/zhukov/webogram
|
||||||
* Copyright (C) 2014 Igor Zhukov <igor.beatle@gmail.com>
|
* Copyright (C) 2014 Igor Zhukov <igor.beatle@gmail.com>
|
||||||
* https://github.com/zhukov/webogram/blob/master/LICENSE
|
* https://github.com/zhukov/webogram/blob/master/LICENSE
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*!
|
/*!
|
||||||
* Webogram v0.0.1 - messaging web application for MTProto
|
* Webogram v0.0.19 - messaging web application for MTProto
|
||||||
* https://github.com/zhukov/webogram
|
* https://github.com/zhukov/webogram
|
||||||
* Copyright (C) 2014 Igor Zhukov <igor.beatle@gmail.com>
|
* Copyright (C) 2014 Igor Zhukov <igor.beatle@gmail.com>
|
||||||
* https://github.com/zhukov/webogram/blob/master/LICENSE
|
* https://github.com/zhukov/webogram/blob/master/LICENSE
|
||||||
|
79
gulpfile.js
79
gulpfile.js
@ -4,7 +4,20 @@ var pj = require('./package.json');
|
|||||||
var $ = require('gulp-load-plugins')();
|
var $ = require('gulp-load-plugins')();
|
||||||
var concat = require('gulp-concat');
|
var concat = require('gulp-concat');
|
||||||
|
|
||||||
gulp.task('usemin', ['templates'], function() {
|
|
||||||
|
// The generated file is being created at src
|
||||||
|
// so it can be fetched by usemin.
|
||||||
|
gulp.task('templates', function() {
|
||||||
|
return gulp.src('app/partials/*.html')
|
||||||
|
.pipe($.angularTemplatecache('templates.js', {
|
||||||
|
root: 'partials',
|
||||||
|
module: 'myApp.templates',
|
||||||
|
standalone: true
|
||||||
|
}))
|
||||||
|
.pipe(gulp.dest('app/js'));
|
||||||
|
});
|
||||||
|
|
||||||
|
gulp.task('usemin', ['templates', 'enable-production'], function() {
|
||||||
return gulp.src('app/index.html')
|
return gulp.src('app/index.html')
|
||||||
.pipe($.usemin({
|
.pipe($.usemin({
|
||||||
html: [$.minifyHtml({empty: true})],
|
html: [$.minifyHtml({empty: true})],
|
||||||
@ -14,18 +27,6 @@ gulp.task('usemin', ['templates'], function() {
|
|||||||
.pipe(gulp.dest('dist'));
|
.pipe(gulp.dest('dist'));
|
||||||
});
|
});
|
||||||
|
|
||||||
// The generated file is being created at src
|
|
||||||
// so it can be fetched by usemin.
|
|
||||||
gulp.task('templates', function() {
|
|
||||||
return gulp.src('app/partials/*.html')
|
|
||||||
.pipe($.angularTemplatecache('partials.js', {
|
|
||||||
root: 'partials',
|
|
||||||
module: 'partials',
|
|
||||||
standalone: true
|
|
||||||
}))
|
|
||||||
.pipe(gulp.dest('app/js'));
|
|
||||||
});
|
|
||||||
|
|
||||||
gulp.task('copy', function() {
|
gulp.task('copy', function() {
|
||||||
return es.concat(
|
return es.concat(
|
||||||
gulp.src(['app/favicon.ico', 'app/favicon_unread.ico', 'app/manifest.webapp', 'app/manifest.json', 'app/**/*worker.js'])
|
gulp.src(['app/favicon.ico', 'app/favicon_unread.ico', 'app/manifest.webapp', 'app/manifest.json', 'app/**/*worker.js'])
|
||||||
@ -46,13 +47,13 @@ gulp.task('copy', function() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
gulp.task('compress-dist', ['add-csp'], function() {
|
gulp.task('compress-dist', ['add-csp'], function() {
|
||||||
return es.concat(
|
return gulp.src('dist/**/*')
|
||||||
gulp.src('dist/*')
|
.pipe($.zip('webogram_v' + pj.version + '.zip'))
|
||||||
.pipe($.zip('webogram_v' + pj.version + '.zip'))
|
.pipe(gulp.dest('releases'));
|
||||||
.pipe(gulp.dest('package')),
|
});
|
||||||
gulp.src('package/*.zip')
|
|
||||||
.pipe(gulp.dest('.'))
|
gulp.task('cleanup-dist', ['compress-dist'], function() {
|
||||||
);
|
return gulp.src(['releases/**/*', '!releases/*.zip']).pipe($.clean());
|
||||||
});
|
});
|
||||||
|
|
||||||
gulp.task('add-csp', ['build'], function() {
|
gulp.task('add-csp', ['build'], function() {
|
||||||
@ -74,22 +75,48 @@ gulp.task('update-version-settings', function() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
gulp.task('update-version-comments', function() {
|
gulp.task('update-version-comments', function() {
|
||||||
return gulp.src('app/**/*')
|
return gulp.src('app/**/*.js')
|
||||||
.pipe($.grepStream('Webogram v'))
|
|
||||||
.pipe($.replace(/Webogram v[0-9.]*/, 'Webogram v' + pj.version))
|
.pipe($.replace(/Webogram v[0-9.]*/, 'Webogram v' + pj.version))
|
||||||
.pipe(gulp.dest('app'));
|
.pipe(gulp.dest('app'));
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
gulp.task('enable-production', function() {
|
||||||
|
return es.concat(
|
||||||
|
gulp.src('app/**/*.html')
|
||||||
|
.pipe($.replace(/PRODUCTION_ONLY_BEGIN/g, 'PRODUCTION_ONLY_BEGIN-->'))
|
||||||
|
.pipe($.replace(/PRODUCTION_ONLY_END/, '<!--PRODUCTION_ONLY_END'))
|
||||||
|
.pipe(gulp.dest('app')),
|
||||||
|
gulp.src('app/**/*.js')
|
||||||
|
.pipe($.replace(/PRODUCTION_ONLY_BEGIN(\*\/)?/g, 'PRODUCTION_ONLY_BEGIN*/'))
|
||||||
|
.pipe($.replace(/(\/\*)?PRODUCTION_ONLY_END/g, '/*PRODUCTION_ONLY_END'))
|
||||||
|
.pipe(gulp.dest('app'))
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
|
gulp.task('disable-production', function() {
|
||||||
|
return es.concat(
|
||||||
|
gulp.src('app/index.html')
|
||||||
|
.pipe($.replace(/PRODUCTION_ONLY_BEGIN-->/g, 'PRODUCTION_ONLY_BEGIN'))
|
||||||
|
.pipe($.replace(/<!--PRODUCTION_ONLY_END/g, 'PRODUCTION_ONLY_END'))
|
||||||
|
.pipe(gulp.dest('app')),
|
||||||
|
gulp.src('app/**/*.js')
|
||||||
|
.pipe($.replace(/PRODUCTION_ONLY_BEGIN(\*\/)?/g, 'PRODUCTION_ONLY_BEGIN'))
|
||||||
|
.pipe($.replace(/(\/\*)?PRODUCTION_ONLY_END/g, 'PRODUCTION_ONLY_END'))
|
||||||
|
.pipe(gulp.dest('app'))
|
||||||
|
);
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
gulp.task('clean', function() {
|
gulp.task('clean', function() {
|
||||||
return gulp.src('dist').pipe($.clean());
|
return gulp.src(['dist/*', '!dist/.git']).pipe($.clean());
|
||||||
});
|
});
|
||||||
|
|
||||||
gulp.task('bump', ['update-version-manifests', 'update-version-settings', 'update-version-comments']);
|
gulp.task('bump', ['update-version-manifests', 'update-version-settings', 'update-version-comments']);
|
||||||
gulp.task('build', ['templates', 'usemin', 'copy']);
|
gulp.task('build', ['templates', 'usemin', 'copy'], function () {
|
||||||
gulp.task('package', ['compress-dist'], function() {
|
gulp.start('disable-production');
|
||||||
gulp.src('package').pipe($.clean());
|
|
||||||
});
|
});
|
||||||
|
gulp.task('package', ['cleanup-dist']);
|
||||||
|
|
||||||
gulp.task('default', ['clean'], function() {
|
gulp.task('default', ['clean'], function() {
|
||||||
gulp.start('build');
|
gulp.start('build');
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "webogram",
|
"name": "webogram",
|
||||||
"version": "0.0.1",
|
"version": "0.0.19",
|
||||||
"description": "UNOFFICIAL Telegram Web App.",
|
"description": "UNOFFICIAL Telegram Web App.",
|
||||||
"main": "server.js",
|
"main": "server.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user