Igor Zhukov 11 years ago
parent
commit
7875517e47
  1. 2
      app/app.manifest
  2. 14
      app/css/app.css
  3. BIN
      app/img/card_share.png
  4. BIN
      app/img/icons/DialogListGroupChatIcon@2x.png
  5. BIN
      app/img/icons/DialogListGroupChatIcon_Highlighted@2x.png
  6. 64
      app/index.html
  7. 4
      app/js/lib/aes_worker.js
  8. 6
      app/js/lib/mtproto.js
  9. 2
      app/partials/login.html
  10. 6
      gulpfile.js
  11. 4
      server.js

2
app/app.manifest

@ -1,4 +1,6 @@ @@ -1,4 +1,6 @@
CACHE MANIFEST
# 1
NETWORK:
*

14
app/css/app.css

@ -728,20 +728,6 @@ a.im_dialog:hover .im_dialog_date { @@ -728,20 +728,6 @@ a.im_dialog:hover .im_dialog_date {
text-overflow: ellipsis;
}
.icon-group {
display: inline-block;
width: 18px;
height: 12px;
margin-top: 3px;
line-height: 14px;
vertical-align: text-top;
background: url(../img/icons/DialogListGroupChatIcon@2x.png) 0 0 no-repeat;
background-size: 18px 12px;
}
.active .icon-group {
background-image: url(../img/icons/DialogListGroupChatIcon_Highlighted@2x.png);
}
/* IM history */
.im_history_col {
}

BIN
app/img/card_share.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 82 KiB

BIN
app/img/icons/DialogListGroupChatIcon@2x.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.2 KiB

BIN
app/img/icons/DialogListGroupChatIcon_Highlighted@2x.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 529 B

64
app/index.html

@ -20,6 +20,40 @@ @@ -20,6 +20,40 @@
<meta property="og:site_name" content="Webogram">
<meta property="og:description" content="Welcome to an experimental web-client of Telegram messenger. See https://github.com/zhukov/webogram for more info.">
<script type="text/javascript">
(function () {
if (!window.applicationCache || !window.addEventListener) {
return;
}
var appCache = window.applicationCache,
declined = false,
updateTimeout = false,
scheduleUpdate = function (delay) {
clearTimeout(updateTimeout);
updateTimeout = setTimeout(function () {
appCache.update();
}, delay || 300000);
},
attach = function () {
appCache.addEventListener('updateready', function(e) {
if (appCache.status == appCache.UPDATEREADY) {
if (!declined && confirm('A new version of Webogram is available. Load it?')) {
window.location.reload();
} else {
declined = true;
scheduleUpdate();
}
}
}, false);
appCache.addEventListener('noupdate', function () {scheduleUpdate()}, false);
appCache.addEventListener('error', function () {scheduleUpdate()}, false);
};
scheduleUpdate(3000);
window.addEventListener('load', attach);
})();
</script>
</head>
<body>
@ -59,35 +93,5 @@ @@ -59,35 +93,5 @@
<script type="text/javascript" src="js/directives.js"></script>
<!-- endbuild -->
<script type="text/javascript">
(function () {
if (!window.applicationCache || !window.addEventListener) {
return;
}
var appCache = window.applicationCache,
canceled = false,
scheduleUpdate = function () {
setTimeout(function () {
appCache.update();
}, 300000);
};
window.addEventListener('load', function(e) {
appCache.addEventListener('updateready', function(e) {
if (appCache.status == appCache.UPDATEREADY) {
if (!canceled && confirm('A new version of Webogram is available. Load it?')) {
window.location.reload();
} else {
canceled = true;
scheduleUpdate();
}
}
}, false);
appCache.addEventListener('noupdate', scheduleUpdate, false);
appCache.addEventListener('error', scheduleUpdate, false);
});
})();
</script>
</body>
</html>

4
app/js/lib/aes_worker.js

@ -6,10 +6,10 @@ @@ -6,10 +6,10 @@
*/
importScripts(
'../../vendor/console-polyfill/console-polyfill.js?1',
'../../vendor/console-polyfill/console-polyfill.js',
'mtproto.js',
'../../vendor/jsbn/jsbn_combined.js',
'../../vendor/cryptoJS/crypto.js?1'
'../../vendor/cryptoJS/crypto.js'
);
onmessage = function (e) {

6
app/js/lib/mtproto.js

@ -2392,7 +2392,7 @@ factory('MtpApiManager', function (AppConfigManager, MtpAuthorizer, MtpNetworker @@ -2392,7 +2392,7 @@ factory('MtpApiManager', function (AppConfigManager, MtpAuthorizer, MtpNetworker
}
if (!options.createNetworker) {
return $q.reject({type: 'AUTH_KEY_EMPTY', code: 500});
return $q.reject({type: 'AUTH_KEY_EMPTY', code: 401});
}
return MtpAuthorizer.auth(dcID).then(function (auth) {
@ -2456,9 +2456,7 @@ factory('MtpApiManager', function (AppConfigManager, MtpAuthorizer, MtpNetworker @@ -2456,9 +2456,7 @@ factory('MtpApiManager', function (AppConfigManager, MtpAuthorizer, MtpNetworker
cachedExportPromise[dcID] = exportDeferred.promise;
}
// console.log('promise', cachedExportPromise[dcID]);
cachedExportPromise[dcID] = cachedExportPromise[dcID].then(function () {
cachedExportPromise[dcID].then(function () {
(cachedNetworker = networker).wrapApiCall(method, params, options).then(function (result) {
deferred.resolve(result);
}, function (error) {

2
app/partials/login.html

@ -17,7 +17,7 @@ @@ -17,7 +17,7 @@
</form>
<form name="myLoginForm" ng-if="credentials.phone_code_hash" ng-submit="logIn()">
<h3 class="login_form_head">{{ credentials.phone_number | phoneNumber }} <small>(<a href="#/login">edit</a>)</small></h3>
<h3 class="login_form_head">{{ credentials.phone_number | phoneNumber }} <small>(<a ng-click="credentials.phone_code_hash = ''">edit</a>)</small></h3>
<p class="login_form_lead">We have sent you a code via SMS.<br/>Please enter it below.</p>
<p class="login_form_lead">

6
gulpfile.js

@ -21,7 +21,7 @@ gulp.task('usemin', ['templates', 'enable-production'], function() { @@ -21,7 +21,7 @@ gulp.task('usemin', ['templates', 'enable-production'], function() {
return gulp.src('app/index.html')
.pipe($.usemin({
html: [$.minifyHtml({empty: true})],
js: [$.ngmin(), $.uglify(), 'concat', $.rev()],
js: [$.ngmin(), $.uglify(), 'concat'],
css: [$.minifyCss(), 'concat']
}))
.pipe(gulp.dest('dist'));
@ -49,8 +49,6 @@ gulp.task('copy', function() { @@ -49,8 +49,6 @@ gulp.task('copy', function() {
.pipe(gulp.dest('dist/vendor/console-polyfill')),
gulp.src('app/js/lib/mtproto.js')
.pipe(gulp.dest('dist/js/lib')),
gulp.src('app/js/lib/config.js')
.pipe(gulp.dest('dist/js/lib')),
gulp.src('app/vendor/jsbn/jsbn_combined.js')
.pipe(gulp.dest('dist/vendor/jsbn')),
gulp.src('app/vendor/cryptoJS/crypto.js')
@ -124,7 +122,7 @@ gulp.task('disable-production', function() { @@ -124,7 +122,7 @@ gulp.task('disable-production', function() {
});
gulp.task('add-appcache-manifest', function() {
return gulp.src(['./dist/**/*', '!dist/manifest.json', '!dist/manifest.json', '!dist/index.html'])
return gulp.src(['./dist/**/*', '!dist/manifest.*', '!dist/index.html', '!dist/fonts/*', '!dist/img/icons/icon*.png', '!dist/js/background.js'])
.pipe($.manifest({
timestamp: true,
network: ['http://*', 'https://*', '*'],

4
server.js

@ -80,6 +80,7 @@ StaticServlet.MimeMap = { @@ -80,6 +80,7 @@ StaticServlet.MimeMap = {
'xml': 'application/xml',
'json': 'application/json',
'js': 'application/javascript',
'manifest': 'text/cache-manifest',
'jpg': 'image/jpeg',
'jpeg': 'image/jpeg',
'gif': 'image/gif',
@ -175,6 +176,9 @@ StaticServlet.prototype.sendFile_ = function(req, res, path) { @@ -175,6 +176,9 @@ StaticServlet.prototype.sendFile_ = function(req, res, path) {
'Content-Type': StaticServlet.
MimeMap[path.split('.').pop()] || 'text/plain'
});
// console.log(path.split('.').pop(), StaticServlet.MimeMap[path.split('.').pop()] || 'text/plain');
if (req.method === 'HEAD') {
res.end();
} else {

Loading…
Cancel
Save