Browse Source

merged with master

gh-pages
Igor Zhukov 11 years ago
parent
commit
d36358e652
  1. 14
      app.manifest
  2. 10
      css/app.css
  3. BIN
      img/TLogo2_1x.png
  4. BIN
      img/TLogo2_2x.png
  5. BIN
      img/TLogo_1x.png
  6. BIN
      img/T_LogoM.png
  7. BIN
      img/T_LogoM_1x.png
  8. BIN
      img/Tlogo_2x.png
  9. BIN
      img/icons/IconsetW.png
  10. BIN
      img/icons/IconsetW_1x.png
  11. BIN
      img/iphone_home120.png
  12. BIN
      img/iphone_startup.png
  13. 2
      index.html
  14. 33
      js/app.js
  15. 2
      js/app.js.map
  16. 2
      js/background.js
  17. 26
      js/lib/aes_worker.js
  18. 27
      js/lib/bin_utils.js
  19. 47
      js/lib/crypto_worker.js
  20. 18
      js/lib/pq_worker.js
  21. 18
      js/lib/sha1_worker.js
  22. 2
      manifest.json
  23. 14
      manifest.webapp
  24. 14
      webogram.appcache

14
app.manifest

@ -1,15 +1,13 @@
CACHE MANIFEST CACHE MANIFEST
# Time: Thu Jul 03 2014 00:10:19 GMT+0400 (MSK) # Time: Fri Jul 25 2014 19:06:23 GMT+0400 (MSK)
CACHE: CACHE:
favicon.ico favicon.ico
favicon_unread.ico favicon_unread.ico
css/app.css css/app.css
img/TLogo2_1x.png img/T_LogoM.png
img/TLogo2_2x.png img/T_LogoM_1x.png
img/TLogo_1x.png
img/Tlogo_2x.png
img/WebIntro1.png img/WebIntro1.png
img/WebIntro1_1x.png img/WebIntro1_1x.png
img/WebIntro2.png img/WebIntro2.png
@ -24,6 +22,8 @@ img/emojisprite_1.png
img/emojisprite_2.png img/emojisprite_2.png
img/emojisprite_3.png img/emojisprite_3.png
img/emojisprite_4.png img/emojisprite_4.png
img/iphone_home120.png
img/iphone_startup.png
img/logo_dogogram.png img/logo_dogogram.png
img/logo_share.png img/logo_share.png
img/sound_a.wav img/sound_a.wav
@ -62,10 +62,8 @@ img/placeholders/UserAvatar7@2x.png
img/placeholders/UserAvatar8@2x.png img/placeholders/UserAvatar8@2x.png
img/placeholders/VideoThumbConversation.gif img/placeholders/VideoThumbConversation.gif
img/placeholders/VideoThumbModal.gif img/placeholders/VideoThumbModal.gif
js/lib/aes_worker.js
js/lib/bin_utils.js js/lib/bin_utils.js
js/lib/pq_worker.js js/lib/crypto_worker.js
js/lib/sha1_worker.js
vendor/closure/long.js vendor/closure/long.js
vendor/console-polyfill/console-polyfill.js vendor/console-polyfill/console-polyfill.js
vendor/cryptoJS/crypto.js vendor/cryptoJS/crypto.js

10
css/app.css

File diff suppressed because one or more lines are too long

BIN
img/TLogo2_1x.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

BIN
img/TLogo2_2x.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.3 KiB

BIN
img/TLogo_1x.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

BIN
img/T_LogoM.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.1 KiB

BIN
img/T_LogoM_1x.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

BIN
img/Tlogo_2x.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.1 KiB

BIN
img/icons/IconsetW.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 23 KiB

After

Width:  |  Height:  |  Size: 24 KiB

BIN
img/icons/IconsetW_1x.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 12 KiB

BIN
img/iphone_home120.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

BIN
img/iphone_startup.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

2
index.html

@ -1 +1 @@
<!doctype html><html lang=en ng-app=myApp manifest=webogram.appcache><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><link rel=apple-touch-icon href=img/icons/icon90.png><link rel=apple-touch-icon sizes=90x90 href=img/icons/icon90.png><link rel=apple-touch-icon sizes=120x120 href=img/icons/icon120.png><meta name=apple-mobile-web-app-title content=Webogram><meta name=mobile-web-app-capable content=yes><meta name=apple-mobile-web-app-capable content=yes><meta name=apple-mobile-web-app-status-bar-style content=black-translucent><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 class=page_wrap ng-view=""></div><script src=js/app.js></script></body></html> <!doctype html><html lang=en ng-app=myApp manifest=webogram.appcache ng-csp=""><head><meta charset=utf-8><meta name=viewport content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no"><title>Webogram</title><link rel=stylesheet href=css/app.css><link rel=icon href=favicon.ico type=image/x-icon><link rel=apple-touch-icon href=img/iphone_home120.png><link rel=apple-touch-icon sizes=120x120 href=img/iphone_home120.png><link rel=apple-touch-startup-image media="(device-width: 320px)" href=img/iphone_startup.png><meta name=apple-mobile-web-app-title content="Telegram Web"><meta name=mobile-web-app-capable content=yes><meta name=apple-mobile-web-app-capable content=yes><meta name=apple-mobile-web-app-status-bar-style content=black-translucent><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 class=page_wrap ng-view=""></div><script src=js/app.js></script></body></html>

33
js/app.js

File diff suppressed because one or more lines are too long

2
js/app.js.map

File diff suppressed because one or more lines are too long

2
js/background.js

@ -1,5 +1,5 @@
/*! /*!
* Webogram v0.1.9 - messaging web application for MTProto * Webogram v0.2.5 - 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

26
js/lib/aes_worker.js

@ -1,26 +0,0 @@
/*!
* Webogram v0.1.9 - 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',
'bin_utils.js',
'../../vendor/jsbn/jsbn_combined.js',
'../../vendor/cryptoJS/crypto.js'
);
onmessage = function (e) {
// console.log('AES worker in', e.data);
var taskID = e.data.taskID,
result;
if (e.data.task == 'encrypt') {
result = aesEncrypt(e.data.bytes, e.data.keyBytes, e.data.ivBytes);
} else {
result = aesDecrypt(e.data.encryptedBytes, e.data.keyBytes, e.data.ivBytes);
}
postMessage({taskID: taskID, result: result});
}

27
js/lib/bin_utils.js

@ -1,5 +1,5 @@
/*! /*!
* Webogram v0.1.9 - messaging web application for MTProto * Webogram v0.2.5 - 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
@ -281,12 +281,11 @@ function pqPrimeFactorization (pqBytes) {
var what = new BigInteger(pqBytes), var what = new BigInteger(pqBytes),
result = false; result = false;
console.log('PQ start', pqBytes, what.bitLength()); console.log('PQ start', pqBytes, what.toString(16), what.bitLength());
try { try {
result = pqPrimeLeemon(str2bigInt(what.toString(16), 16, Math.ceil(64 / bpe) + 1)) result = pqPrimeLeemon(str2bigInt(what.toString(16), 16, Math.ceil(64 / bpe) + 1))
} catch (e) { } catch (e) {
console.error(e);
console.error('Pq leemon Exception', e); console.error('Pq leemon Exception', e);
} }
@ -366,7 +365,7 @@ function pqPrimeBigInteger (what) {
Q = f; Q = f;
} }
return [bytesFromBigInt(P), bytesFromBigInt(Q)]; return [bytesFromBigInt(P), bytesFromBigInt(Q), it];
} }
function gcdLong(a, b) { function gcdLong(a, b) {
@ -440,7 +439,7 @@ function pqPrimeLong(what) {
Q = f; Q = f;
} }
return [bytesFromHex(P.toString(16)), bytesFromHex(Q.toString(16))]; return [bytesFromHex(P.toString(16)), bytesFromHex(Q.toString(16)), it];
} }
@ -515,5 +514,19 @@ function pqPrimeLeemon (what) {
// console.log(dT(), 'done', bigInt2str(what, 10), bigInt2str(P, 10), bigInt2str(Q, 10)); // console.log(dT(), 'done', bigInt2str(what, 10), bigInt2str(P, 10), bigInt2str(Q, 10));
return [bytesFromLeemonBigInt(P), bytesFromLeemonBigInt(Q)]; return [bytesFromLeemonBigInt(P), bytesFromLeemonBigInt(Q), it];
} }
function bytesModPow (x, y, m) {
try {
var xBigInt = str2bigInt(x, 64),
yBigInt = str2bigInt(y, 64),
mBigInt = str2bigInt(bytesToHex(m), 16, 2),
resBigInt = powMod(xBigInt, yBigInt, mBigInt);
return bytesFromHex(bigInt2str(resBigInt, 16));
} catch (e) {}
return bytesFromBigInt(new BigInteger(x).modPow(new BigInteger(y), new BigInteger(m)));
}

47
js/lib/crypto_worker.js

@ -0,0 +1,47 @@
/*!
* Webogram v0.2.5 - 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',
'bin_utils.js',
'../../vendor/jsbn/jsbn_combined.js',
'../../vendor/leemon_bigint/bigint.js',
'../../vendor/closure/long.js',
'../../vendor/cryptoJS/crypto.js'
);
onmessage = function (e) {
var taskID = e.data.taskID,
result;
switch (e.data.task) {
case 'factorize':
result = pqPrimeFactorization(e.data.bytes);
break;
case 'mod-pow':
result = bytesModPow(e.data.x, e.data.y, e.data.m);
break;
case 'sha1-hash':
result = sha1Hash(e.data.bytes);
break;
case 'aes-encrypt':
result = aesEncrypt(e.data.bytes, e.data.keyBytes, e.data.ivBytes);
break;
case 'aes-decrypt':
result = aesDecrypt(e.data.encryptedBytes, e.data.keyBytes, e.data.ivBytes);
break;
default:
throw new Error('Unknown task: ' + e.data.task);
}
postMessage({taskID: taskID, result: result});
}

18
js/lib/pq_worker.js

@ -1,18 +0,0 @@
/*!
* Webogram v0.1.9 - 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',
'bin_utils.js',
'../../vendor/leemon_bigint/bigint.js',
'../../vendor/closure/long.js',
'../../vendor/jsbn/jsbn_combined.js'
);
onmessage = function (e) {
postMessage(pqPrimeFactorization(e.data));
}

18
js/lib/sha1_worker.js

@ -1,18 +0,0 @@
/*!
* Webogram v0.1.9 - 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',
'bin_utils.js',
'../../vendor/cryptoJS/crypto.js'
);
onmessage = function (e) {
var taskID = e.data.taskID;
postMessage({taskID: taskID, result: sha1Hash(e.data.bytes)});
}

2
manifest.json

@ -1,6 +1,6 @@
{ {
"name": "Telegram UNOFFICIAL", "name": "Telegram UNOFFICIAL",
"version": "0.1.9", "version": "0.2.5",
"short_name": "Webogram", "short_name": "Webogram",
"manifest_version": 2, "manifest_version": 2,
"app": { "app": {

14
manifest.webapp

@ -1,7 +1,7 @@
{ {
"name": "Webogram", "name": "Telegram",
"description": "Webogram – UNOFFICIAL Telegram Web App.\nMore info & source code here: https://github.com/zhukov/webogram", "description": "UNOFFICIAL Telegram Web App.\nMore info & source code here: https://github.com/zhukov/webogram",
"version": "0.1.9", "version": "0.2.5",
"type": "privileged", "type": "privileged",
"launch_path": "/index.html", "launch_path": "/index.html",
"developer": { "developer": {
@ -11,6 +11,11 @@
"installs_allowed_from": [ "installs_allowed_from": [
"*" "*"
], ],
"messages": [{
"push": "/index.html"
}, {
"push-register": "/index.html"
}],
"permissions": { "permissions": {
"desktop-notification": { "desktop-notification": {
"description": "Required to show new message notifications" "description": "Required to show new message notifications"
@ -18,6 +23,9 @@
"contacts": { "contacts": {
"description": "Required to import phonebook contacts", "description": "Required to import phonebook contacts",
"access": "readonly" "access": "readonly"
},
"push": {
"description": "Required for notifications"
} }
}, },
"icons": { "icons": {

14
webogram.appcache

@ -1,15 +1,13 @@
CACHE MANIFEST CACHE MANIFEST
# Time: Thu Jul 03 2014 00:10:19 GMT+0400 (MSK) # Time: Fri Jul 25 2014 19:06:23 GMT+0400 (MSK)
CACHE: CACHE:
favicon.ico favicon.ico
favicon_unread.ico favicon_unread.ico
css/app.css css/app.css
img/TLogo2_1x.png img/T_LogoM.png
img/TLogo2_2x.png img/T_LogoM_1x.png
img/TLogo_1x.png
img/Tlogo_2x.png
img/WebIntro1.png img/WebIntro1.png
img/WebIntro1_1x.png img/WebIntro1_1x.png
img/WebIntro2.png img/WebIntro2.png
@ -24,6 +22,8 @@ img/emojisprite_1.png
img/emojisprite_2.png img/emojisprite_2.png
img/emojisprite_3.png img/emojisprite_3.png
img/emojisprite_4.png img/emojisprite_4.png
img/iphone_home120.png
img/iphone_startup.png
img/logo_dogogram.png img/logo_dogogram.png
img/logo_share.png img/logo_share.png
img/sound_a.wav img/sound_a.wav
@ -62,10 +62,8 @@ img/placeholders/UserAvatar7@2x.png
img/placeholders/UserAvatar8@2x.png img/placeholders/UserAvatar8@2x.png
img/placeholders/VideoThumbConversation.gif img/placeholders/VideoThumbConversation.gif
img/placeholders/VideoThumbModal.gif img/placeholders/VideoThumbModal.gif
js/lib/aes_worker.js
js/lib/bin_utils.js js/lib/bin_utils.js
js/lib/pq_worker.js js/lib/crypto_worker.js
js/lib/sha1_worker.js
vendor/closure/long.js vendor/closure/long.js
vendor/console-polyfill/console-polyfill.js vendor/console-polyfill/console-polyfill.js
vendor/cryptoJS/crypto.js vendor/cryptoJS/crypto.js

Loading…
Cancel
Save