Browse Source

Fixed gulp bugs

master
Igor Zhukov 11 years ago
parent
commit
e362ff26da
  1. 10
      .gitignore
  2. 2
      app/css/app.css
  3. 8
      app/index.html
  4. 8
      app/js/app.js
  5. 2
      app/js/background.js
  6. 2
      app/js/controllers.js
  7. 2
      app/js/directives.js
  8. 2
      app/js/filters.js
  9. 2
      app/js/lib/aes_worker.js
  10. 8
      app/js/lib/mtproto.js
  11. 4
      app/js/lib/pq_worker.js
  12. 6
      app/js/lib/sha1_worker.js
  13. 2
      app/js/services.js
  14. 2
      app/js/util.js
  15. 75
      gulpfile.js
  16. 2
      package.json

10
.gitignore vendored

@ -1,11 +1,11 @@ @@ -1,11 +1,11 @@
.DS_Store
.idea
*.sublime-workspace
# Node.js package manager
/node_modules
/npm-debug.log
node_modules
npm-debug.log
dist
package_dist
releases
webogram*.zip
app/js/partials.js
*.sublime-workspace
app/js/templates.js

2
app/css/app.css

@ -484,7 +484,7 @@ input[type="number"]::-webkit-inner-spin-button { @@ -484,7 +484,7 @@ input[type="number"]::-webkit-inner-spin-button {
margin-right: -7px;
}
.im_dialogs_col .nano > .pane {
background : rgba(0,0,0,.0);
background : rgba(0,0,0,0.0);
width : 12px;
right: 0px;
-webkit-transition : .2s;

8
app/index.html

@ -44,13 +44,17 @@ @@ -44,13 +44,17 @@
<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/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/services.js"></script>
<script type="text/javascript" src="js/controllers.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>
<!-- endbuild -->

8
app/js/app.js

@ -1,5 +1,5 @@ @@ -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
* Copyright (C) 2014 Igor Zhukov <igor.beatle@gmail.com>
* https://github.com/zhukov/webogram/blob/master/LICENSE
@ -30,10 +30,12 @@ angular.module('myApp', [ @@ -30,10 +30,12 @@ angular.module('myApp', [
'ngAnimate',
'ngSanitize',
'ui.bootstrap',
'partials',
'mtproto.services',
'myApp.filters',
'myApp.services',
'mtproto.services',
/*PRODUCTION_ONLY_BEGIN
'myApp.templates',
PRODUCTION_ONLY_END*/
'myApp.directives',
'myApp.controllers'
]).

2
app/js/background.js

@ -1,5 +1,5 @@ @@ -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
* Copyright (C) 2014 Igor Zhukov <igor.beatle@gmail.com>
* https://github.com/zhukov/webogram/blob/master/LICENSE

2
app/js/controllers.js

@ -1,5 +1,5 @@ @@ -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
* Copyright (C) 2014 Igor Zhukov <igor.beatle@gmail.com>
* https://github.com/zhukov/webogram/blob/master/LICENSE

2
app/js/directives.js

@ -1,5 +1,5 @@ @@ -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
* Copyright (C) 2014 Igor Zhukov <igor.beatle@gmail.com>
* https://github.com/zhukov/webogram/blob/master/LICENSE

2
app/js/filters.js

@ -1,5 +1,5 @@ @@ -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
* Copyright (C) 2014 Igor Zhukov <igor.beatle@gmail.com>
* https://github.com/zhukov/webogram/blob/master/LICENSE

2
app/js/lib/aes_worker.js

@ -1,5 +1,5 @@ @@ -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
* Copyright (C) 2014 Igor Zhukov <igor.beatle@gmail.com>
* https://github.com/zhukov/webogram/blob/master/LICENSE

8
app/js/lib/mtproto.js

@ -1,5 +1,5 @@ @@ -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
* Copyright (C) 2014 Igor Zhukov <igor.beatle@gmail.com>
* https://github.com/zhukov/webogram/blob/master/LICENSE
@ -1122,7 +1122,7 @@ factory('MtpAuthorizer', function (MtpDcConfigurator, MtpRsaKeysManager, MtpSecu @@ -1122,7 +1122,7 @@ factory('MtpAuthorizer', function (MtpDcConfigurator, MtpRsaKeysManager, MtpSecu
console.log('PQ factorization start');
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) {
auth.p = e.data[0];
@ -1416,7 +1416,7 @@ factory('MtpAesService', function ($q) { @@ -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,
awaiting = {};
@ -1468,7 +1468,7 @@ factory('MtpSha1Service', function ($q) { @@ -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,
awaiting = {};

4
app/js/lib/pq_worker.js

@ -1,12 +1,12 @@ @@ -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
* Copyright (C) 2014 Igor Zhukov <igor.beatle@gmail.com>
* https://github.com/zhukov/webogram/blob/master/LICENSE
*/
importScripts(
'../../vendor/console-polyfill/console-polyfill.js?1',
'../../vendor/console-polyfill/console-polyfill.js',
'mtproto.js',
'../../vendor/jsbn/jsbn_combined.js'
);

6
app/js/lib/sha1_worker.js

@ -1,14 +1,14 @@ @@ -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
* Copyright (C) 2014 Igor Zhukov <igor.beatle@gmail.com>
* https://github.com/zhukov/webogram/blob/master/LICENSE
*/
importScripts(
'../../vendor/console-polyfill/console-polyfill.js?1',
'../../vendor/console-polyfill/console-polyfill.js',
'mtproto.js',
'../../vendor/cryptoJS/crypto.js?1'
'../../vendor/cryptoJS/crypto.js'
);
onmessage = function (e) {

2
app/js/services.js

@ -1,5 +1,5 @@ @@ -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
* Copyright (C) 2014 Igor Zhukov <igor.beatle@gmail.com>
* https://github.com/zhukov/webogram/blob/master/LICENSE

2
app/js/util.js

@ -1,5 +1,5 @@ @@ -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
* Copyright (C) 2014 Igor Zhukov <igor.beatle@gmail.com>
* https://github.com/zhukov/webogram/blob/master/LICENSE

75
gulpfile.js

@ -4,28 +4,29 @@ var pj = require('./package.json'); @@ -4,28 +4,29 @@ var pj = require('./package.json');
var $ = require('gulp-load-plugins')();
var concat = require('gulp-concat');
gulp.task('usemin', ['templates'], function() {
return gulp.src('app/index.html')
.pipe($.usemin({
html: [$.minifyHtml({empty: true})],
js: ['concat', $.rev()],
css: [$.minifyCss(), 'concat']
}))
.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', {
.pipe($.angularTemplatecache('templates.js', {
root: 'partials',
module: 'partials',
module: 'myApp.templates',
standalone: true
}))
.pipe(gulp.dest('app/js'));
});
gulp.task('usemin', ['templates', 'enable-production'], function() {
return gulp.src('app/index.html')
.pipe($.usemin({
html: [$.minifyHtml({empty: true})],
js: ['concat', $.rev()],
css: [$.minifyCss(), 'concat']
}))
.pipe(gulp.dest('dist'));
});
gulp.task('copy', function() {
return es.concat(
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() { @@ -46,13 +47,13 @@ gulp.task('copy', function() {
});
gulp.task('compress-dist', ['add-csp'], function() {
return es.concat(
gulp.src('dist/*')
.pipe($.zip('webogram_v' + pj.version + '.zip'))
.pipe(gulp.dest('package')),
gulp.src('package/*.zip')
.pipe(gulp.dest('.'))
);
return gulp.src('dist/**/*')
.pipe($.zip('webogram_v' + pj.version + '.zip'))
.pipe(gulp.dest('releases'));
});
gulp.task('cleanup-dist', ['compress-dist'], function() {
return gulp.src(['releases/**/*', '!releases/*.zip']).pipe($.clean());
});
gulp.task('add-csp', ['build'], function() {
@ -74,22 +75,48 @@ gulp.task('update-version-settings', function() { @@ -74,22 +75,48 @@ gulp.task('update-version-settings', function() {
});
gulp.task('update-version-comments', function() {
return gulp.src('app/**/*')
.pipe($.grepStream('Webogram v'))
return gulp.src('app/**/*.js')
.pipe($.replace(/Webogram v[0-9.]*/, 'Webogram v' + pj.version))
.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() {
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('build', ['templates', 'usemin', 'copy']);
gulp.task('package', ['compress-dist'], function() {
gulp.src('package').pipe($.clean());
gulp.task('build', ['templates', 'usemin', 'copy'], function () {
gulp.start('disable-production');
});
gulp.task('package', ['cleanup-dist']);
gulp.task('default', ['clean'], function() {
gulp.start('build');

2
package.json

@ -1,6 +1,6 @@ @@ -1,6 +1,6 @@
{
"name": "webogram",
"version": "0.0.1",
"version": "0.0.19",
"description": "UNOFFICIAL Telegram Web App.",
"main": "server.js",
"scripts": {

Loading…
Cancel
Save