Igor Zhukov
10 years ago
15 changed files with 367 additions and 43 deletions
@ -0,0 +1,107 @@
@@ -0,0 +1,107 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> |
||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en" style="display:block; overflow: auto; background: #f8f8f8;"> |
||||
<head> |
||||
<meta charset="utf-8"> |
||||
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no"> |
||||
<title>Telegram Web</title> |
||||
|
||||
<!-- build:css css/app.css --> |
||||
<link rel="stylesheet" href="vendor/angular/angular-csp.css"/> |
||||
<link rel="stylesheet" href="vendor/bootstrap/css/bootstrap.css"/> |
||||
<link rel="stylesheet" href="css/app.css"/> |
||||
<!-- endbuild --> |
||||
|
||||
<link rel="icon" href="favicon.ico" type="image/x-icon" /> |
||||
|
||||
</head> |
||||
<body class="non_osx is_1x"> |
||||
|
||||
|
||||
<div class="tg_page_head" style="clear: both;"> |
||||
<div class="navbar navbar-static-top navbar-inverse navbar_peer_not_selected" role="navigation"> |
||||
<div class="container"> |
||||
|
||||
<div class="navbar-header pull-left"> |
||||
<a class="navbar-brand" href=""><span class="tg_head_logo"></span></a> |
||||
</div> |
||||
|
||||
<div class="navbar-menu pull-right"> |
||||
|
||||
<ul class="nav navbar-nav navbar-right" style="margin: 0;"> |
||||
<li ng-if="!isLoggedIn"><a href="https://github.com/zhukov/webogram" target="_blank">About</a></li> |
||||
</ul> |
||||
|
||||
</div> |
||||
|
||||
</div> |
||||
</div> |
||||
</div> |
||||
|
||||
|
||||
<div class="welcome_form" style="padding-bottom: 50px; clear: both;"> |
||||
<img class="welcome_logo" src="img/decentralization.png"/> |
||||
|
||||
<h3 class="welcome_header"><strong>Telegram</strong> Web</h3> |
||||
|
||||
<!-- <div class="welcome_text"> |
||||
<p>This is an unofficial web-client for the <strong>Telegram Messenger</strong>.</p> |
||||
<p>It's still an <strong>alpha-version</strong> and may not be 200% reliable</p> |
||||
</div> --> |
||||
|
||||
<div class="bad_browser_wrap"> |
||||
|
||||
<h2>You are using outdated browser!</h2> |
||||
|
||||
<div class="bad_browser_text"> |
||||
<p>Sorry, your browser is not supported by <strong>Telegram Web</strong>.</p> |
||||
<p>In order to use Telegram secure messaging protocol - MTProto, <strong>Telegram Web</strong> utilizes modern HTML5 technologies.</p> |
||||
<p>Your browser doesn't support these features. Please download a modern browser and come back soon!</p> |
||||
</div> |
||||
|
||||
|
||||
<a class="btn btn-primary btn-lg pull-right" href="//firefox.com" target="_blank">Download Mozilla Firefox</a> |
||||
<a class="btn btn-primary btn-lg" href="//google.com/chrome" target="_blank">Download Google Chrome</a> |
||||
|
||||
</div> |
||||
|
||||
</div> |
||||
|
||||
<div class="welcome_footer"> |
||||
<div class="welcome_cards_wrap clearfix"> |
||||
|
||||
<div class="container-fluid"> |
||||
<div class="row"> |
||||
<div class="col-md-4 col-sm-4" style="width: 33.33333333%; float: left;"> |
||||
<div class="welcome_footer_card_wrap row"> |
||||
<div class="welcome_footer_card welcome_footer_card_messaging"></div> |
||||
<h4>Fast messaging</h4> |
||||
<div class="welcome_footer_card_lead">Send messages with rich emoji support right from your desktop or laptop computer</div> |
||||
</div> |
||||
</div> |
||||
|
||||
<div class="col-md-4 col-sm-4" style="width: 33.33333333%; float: left;"> |
||||
<div class="welcome_footer_card_wrap"> |
||||
<div class="welcome_footer_card welcome_footer_card_filesharing"></div> |
||||
<h4>Easy file sharing</h4> |
||||
<div class="welcome_footer_card_lead">Share files of any type using drag-and-drop or the attachment icon</div> |
||||
</div> |
||||
</div> |
||||
|
||||
<div class="col-md-4 col-sm-4" style="width: 33.33333333%; float: left;"> |
||||
<div class="welcome_footer_card_wrap"> |
||||
<div class="welcome_footer_card welcome_footer_card_powerful"></div> |
||||
<h4>Powerful tools</h4> |
||||
<div class="welcome_footer_card_lead">Browse shared media and files by type \n and set custom notifications</div> |
||||
</div> |
||||
</div> |
||||
|
||||
</div> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
|
||||
</div> |
||||
|
||||
|
||||
</body> |
||||
</html> |
@ -0,0 +1,98 @@
@@ -0,0 +1,98 @@
|
||||
// Console-polyfill. MIT license.
|
||||
// https://github.com/paulmillr/console-polyfill
|
||||
// Make it safe to do console.log() always.
|
||||
(function (con) { |
||||
'use strict'; |
||||
var prop, method; |
||||
var empty = {}; |
||||
var dummy = function() {}; |
||||
var properties = 'memory'.split(','); |
||||
var methods = ('assert,count,debug,dir,dirxml,error,exception,group,' + |
||||
'groupCollapsed,groupEnd,info,log,markTimeline,profile,profileEnd,' + |
||||
'time,timeEnd,trace,warn').split(','); |
||||
while (prop = properties.pop()) con[prop] = con[prop] || empty; |
||||
while (method = methods.pop()) con[method] = con[method] || dummy; |
||||
})(this.console = this.console || {}); |
||||
|
||||
|
||||
/* Array.indexOf polyfill */ |
||||
if (!Array.prototype.indexOf) { |
||||
Array.prototype.indexOf = function(searchElement, fromIndex) { |
||||
var k; |
||||
if (this == null) { |
||||
throw new TypeError('"this" is null or not defined'); |
||||
} |
||||
|
||||
var O = Object(this); |
||||
var len = O.length >>> 0; |
||||
if (len === 0) { |
||||
return -1; |
||||
} |
||||
var n = +fromIndex || 0; |
||||
|
||||
if (Math.abs(n) === Infinity) { |
||||
n = 0; |
||||
} |
||||
if (n >= len) { |
||||
return -1; |
||||
} |
||||
k = Math.max(n >= 0 ? n : len - Math.abs(n), 0); |
||||
while (k < len) { |
||||
if (k in O && O[k] === searchElement) { |
||||
return k; |
||||
} |
||||
k++; |
||||
} |
||||
return -1; |
||||
}; |
||||
} |
||||
|
||||
/* Array.isArray polyfill */ |
||||
if (!Array.isArray) { |
||||
Array.isArray = function(arg) { |
||||
return Object.prototype.toString.call(arg) === '[object Array]'; |
||||
}; |
||||
} |
||||
|
||||
/* Object.create polyfill */ |
||||
if (typeof Object.create != 'function') { |
||||
Object.create = (function() { |
||||
var Object = function() {}; |
||||
return function (prototype) { |
||||
if (arguments.length > 1) { |
||||
throw Error('Second argument not supported'); |
||||
} |
||||
if (typeof prototype != 'object') { |
||||
throw TypeError('Argument must be an object'); |
||||
} |
||||
Object.prototype = prototype; |
||||
var result = new Object(); |
||||
Object.prototype = null; |
||||
return result; |
||||
}; |
||||
})(); |
||||
} |
||||
|
||||
/* Function.bind polyfill */ |
||||
if (!Function.prototype.bind) { |
||||
Function.prototype.bind = function (oThis) { |
||||
if (typeof this !== "function") { |
||||
throw new TypeError("Function.prototype.bind - what is trying to be bound is not callable"); |
||||
} |
||||
|
||||
var aArgs = Array.prototype.slice.call(arguments, 1), |
||||
fToBind = this, |
||||
fNOP = function () {}, |
||||
fBound = function () { |
||||
return fToBind.apply(this instanceof fNOP && oThis |
||||
? this |
||||
: oThis, |
||||
aArgs.concat(Array.prototype.slice.call(arguments))); |
||||
}; |
||||
|
||||
fNOP.prototype = this.prototype; |
||||
fBound.prototype = new fNOP(); |
||||
|
||||
return fBound; |
||||
}; |
||||
} |
@ -0,0 +1,94 @@
@@ -0,0 +1,94 @@
|
||||
var fs = require('fs'), path = require('path'); |
||||
var uaList = fs.readFileSync(path.join(__dirname, 'ua.txt')); |
||||
|
||||
|
||||
uaList = uaList.toString().split('\n'); |
||||
|
||||
|
||||
var OSs = {}; |
||||
var browsers = {}; |
||||
var browserVersions = {}; |
||||
var unknown = []; |
||||
|
||||
var osMatch = { |
||||
ios: /iOS|iPhone OS/i, |
||||
android: /Android/i, |
||||
linux: /Linux/i, |
||||
win: /Windows/i, |
||||
osx: /Mac|OS X/i, |
||||
blackberry: /BlackBerry|BB10/i, |
||||
series60: /Series 60|Series60/i, |
||||
series40: /Series 40|Series40/i, |
||||
j2me: /J2ME|MIDP/i |
||||
}; |
||||
|
||||
var browserMatch = { |
||||
opera: /opera/i, |
||||
ie: /msie|trident\//i, |
||||
chrome: /chrome/i, |
||||
chromium: /chromium/i, |
||||
safari: /safari|AppleWebKit/i, |
||||
firefox: /firefox/i, |
||||
blackberry: /BlackBerry/i |
||||
}; |
||||
|
||||
var featureMatch = { |
||||
ipad: /ipad/i, |
||||
opera_mobile: /opera mini|opera mobi/i, |
||||
opera_mini: /opera mini/i, |
||||
blackberry: /blackberry/i |
||||
}; |
||||
|
||||
uaList.forEach(function (uaName) { |
||||
var os = 'unknown'; |
||||
for (var curOs in osMatch) { |
||||
if (uaName.match(osMatch[curOs])) { |
||||
os = curOs; |
||||
break; |
||||
} |
||||
} |
||||
|
||||
var browser = 'unknown'; |
||||
for (var curBrowser in browserMatch) { |
||||
if (uaName.match(browserMatch[curBrowser])) { |
||||
browser = curBrowser; |
||||
break; |
||||
} |
||||
} |
||||
|
||||
var version = ( |
||||
uaName.match(/MSIE ([\d.]+)/) || |
||||
uaName.match( /.+(?:me|ox|on|rv|it|era|opr|ie)[\/: ]([\d.]+)/) || |
||||
[0,'0'] |
||||
)[1]; |
||||
|
||||
if (!OSs[os]) { |
||||
OSs[os] = 1; |
||||
} else { |
||||
OSs[os]++; |
||||
} |
||||
|
||||
if (!browsers[os + ' ' + browser]) { |
||||
browsers[os + ' ' + browser] = 1; |
||||
} else { |
||||
browsers[os + ' ' + browser]++; |
||||
} |
||||
|
||||
if (os == 'unknown' || browser == 'unknown') { |
||||
unknown.push(uaName); |
||||
} |
||||
|
||||
if (!browserVersions[os + ' ' + browser + ' ' + version]) { |
||||
browserVersions[os + ' ' + browser + ' ' + version] = 1; |
||||
} else { |
||||
browserVersions[os + ' ' + browser + ' ' + version]++; |
||||
} |
||||
|
||||
}) |
||||
|
||||
|
||||
console.log(OSs); |
||||
console.log(browsers); |
||||
console.log(browserVersions); |
||||
// console.log(unknown);
|
||||
|
Loading…
Reference in new issue