Browse Source

merged with master

gh-pages
Igor Zhukov 11 years ago
parent
commit
008812008d
  1. 4
      app.manifest
  2. 2
      css/app.css
  3. 28
      index.html
  4. 31
      js/app-29e2169d.js
  5. 38487
      js/app-2c7788ba.js
  6. 41
      js/lib/mtproto.js

4
app.manifest

@ -1,5 +1,5 @@
CACHE MANIFEST
# Time: Mon Mar 24 2014 21:41:22 GMT+0400 (MSK)
# Time: Wed Mar 26 2014 15:02:35 GMT+0400 (MSK)
CACHE:
@ -28,7 +28,7 @@ img/emojisprite_4.png
img/logo_dogogram.png
img/logo_share.png
img/sound_a.wav
js/app-2c7788ba.js
js/app-29e2169d.js
js/background.js
img/icons/Checks1_1x.png
img/icons/Checks1_2x.png

2
css/app.css

File diff suppressed because one or more lines are too long

28
index.html

@ -1 +1,27 @@
<!doctype html><html lang=en ng-app=myApp manifest=app.manifest><head><meta charset=utf-8><meta name=viewport content="width=device-width, user-scalable=no"><title>Webogram</title><link rel=stylesheet href=css/app.css><link rel=icon href=favicon.ico type=image/x-icon><meta property=og:title content=Webogram><meta property=og:url content="http://zhukov.github.io/webogram/"><meta property=og:image content=http://zhukov.github.io/webogram/img/logo_share.png><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."></head><body><div ng-view=""></div><script src=js/app-2c7788ba.js></script></body></html>
<!doctype html><html lang=en ng-app=myApp manifest=app.manifest><head><meta charset=utf-8><meta name=viewport content="width=device-width, user-scalable=no"><title>Webogram</title><link rel=stylesheet href=css/app.css><link rel=icon href=favicon.ico type=image/x-icon><meta property=og:title content=Webogram><meta property=og:url content="http://zhukov.github.io/webogram/"><meta property=og:image content=http://zhukov.github.io/webogram/img/logo_share.png><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."></head><body><div ng-view=""></div><script src=js/app-29e2169d.js></script><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>

31
js/app-29e2169d.js

File diff suppressed because one or more lines are too long

38487
js/app-2c7788ba.js

File diff suppressed because one or more lines are too long

41
js/lib/mtproto.js

@ -997,7 +997,9 @@ factory('MtpRsaKeysManager', function () {
};
}).
service('MtpSecureRandom', SecureRandom).
service('MtpSecureRandom', function () {
return new SecureRandom();
}).
factory('MtpMessageIdGenerator', function (AppConfigManager) {
var lastMessageID = [0, 0],
@ -1525,7 +1527,7 @@ factory('MtpNetworkerFactory', function (MtpDcConfigurator, MtpMessageIdGenerato
this.serverSalt = serverSalt;
this.upload = options.upload || false;
this.upload = options.fileUpload || options.fileDownload || false;
this.updateSession();
@ -2356,8 +2358,12 @@ factory('MtpApiManager', function (AppConfigManager, MtpAuthorizer, MtpNetworker
});
}
function mtpGetNetworker (dcID, upload) {
var cache = upload ? cachedUploadNetworkers : cachedNetworkers;
function mtpGetNetworker (dcID, options) {
options = options || {};
var cache = (options.fileUpload || options.fileDownload)
? cachedUploadNetworkers
: cachedNetworkers;
if (!dcID) {
throw new Exception('get Networker without dcID');
}
@ -2382,7 +2388,11 @@ factory('MtpApiManager', function (AppConfigManager, MtpAuthorizer, MtpNetworker
var authKey = bytesFromHex(authKeyHex);
var serverSalt = bytesFromHex(serverSaltHex);
return cache[dcID] = MtpNetworkerFactory.getNetworker(dcID, authKey, serverSalt, {upload: upload});
return cache[dcID] = MtpNetworkerFactory.getNetworker(dcID, authKey, serverSalt, options);
}
if (!options.createNetworker) {
return $q.reject({type: 'AUTH_KEY_EMPTY', code: 500});
}
return MtpAuthorizer.auth(dcID).then(function (auth) {
@ -2391,7 +2401,7 @@ factory('MtpApiManager', function (AppConfigManager, MtpAuthorizer, MtpNetworker
storeObj[ssk] = bytesToHex(auth.serverSalt);
AppConfigManager.set(storeObj);
return cache[dcID] = MtpNetworkerFactory.getNetworker(dcID, auth.authKey, auth.serverSalt, {upload: upload});
return cache[dcID] = MtpNetworkerFactory.getNetworker(dcID, auth.authKey, auth.serverSalt, options);
}, function (error) {
console.log('Get networker error', error, error.stack);
return $q.reject(error);
@ -2404,14 +2414,13 @@ factory('MtpApiManager', function (AppConfigManager, MtpAuthorizer, MtpNetworker
var deferred = $q.defer(),
dcID,
upload = options.fileDownload || options.fileUpload,
networkerPromise;
if (dcID = options.dcID) {
networkerPromise = mtpGetNetworker(dcID, upload);
networkerPromise = mtpGetNetworker(dcID, options);
} else {
networkerPromise = AppConfigManager.get('dc').then(function (baseDcID) {
return mtpGetNetworker(dcID = baseDcID || 1, upload);
return mtpGetNetworker(dcID = baseDcID || 1, options);
});
}
@ -2468,7 +2477,7 @@ factory('MtpApiManager', function (AppConfigManager, MtpAuthorizer, MtpNetworker
AppConfigManager.set({dc: baseDcID = newDcID});
}
mtpGetNetworker(newDcID).then(function (networker) {
mtpGetNetworker(newDcID, options).then(function (networker) {
networker.wrapApiCall(method, params, options).then(function (result) {
deferred.resolve(result);
}, function (error) {
@ -2697,7 +2706,8 @@ factory('MtpApiFileManager', function (MtpApiManager, $q, $window) {
limit: 0
}, {
dcID: location.dc_id,
fileDownload: true
fileDownload: true,
createNetworker: true
});
});
@ -2734,7 +2744,8 @@ factory('MtpApiFileManager', function (MtpApiManager, $q, $window) {
limit: 0
}, {
dcID: location.dc_id,
fileDownload: true
fileDownload: true,
createNetworker: true
});
}).then(function (result) {
deferred.resolve(cachedDownloads[fileName] = 'data:image/jpeg;base64,' + bytesToBase64(result.bytes))
@ -2784,7 +2795,8 @@ factory('MtpApiFileManager', function (MtpApiManager, $q, $window) {
limit: limit
}, {
dcID: dcID,
fileDownload: true
fileDownload: true,
createNetworker: true
});
}, 6).then(function (result) {
@ -2855,7 +2867,8 @@ factory('MtpApiFileManager', function (MtpApiManager, $q, $window) {
limit: limit
}, {
dcID: dcID,
fileDownload: true
fileDownload: true,
createNetworker: true
});
}, 6).then(function (result) {
writeBlobPromise.then(function () {

Loading…
Cancel
Save