forked from cheeaun/hackerweb
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
156 lines (144 loc) · 6.29 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>HackerWeb</title>
<meta name="apple-mobile-web-app-title" content="Cyber Ninja">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="mobile-web-app-capable" content="yes">
<link rel="shortcut icon" href="icons/favicon.ico">
<link rel="shortcut icon" sizes="196x196" href="icons/icon-196.png">
<link rel="apple-touch-icon-precomposed" href="icons/icon-180.png">
<link rel="manifest" href="manifest.json">
<style>body{ visibility: hidden; }</style>
<script>
// WP8 Viewport fix: http://trentwalton.com/2013/01/16/windows-phone-8-viewport-fix/
if (navigator.userAgent.match(/IEMobile\/10\.0/)){
var msViewportStyle = document.createElement('style');
msViewportStyle.appendChild(document.createTextNode('@-ms-viewport{width:auto!important}'));
document.getElementsByTagName('head')[0].appendChild(msViewportStyle);
}
</script>
<script>
if (window.location.host.indexOf('github.io') > -1 && window.location.protocol != 'https:'){
window.location.protocol = 'https'; // Force SSL
}
var RavenConfig = { dsn: 'https://[email protected]/6152' };
if (location.hostname == 'cheeaun.github.io' || location.hostname == 'cheeaun.github.com' || location.hostname == 'app.hackerwebapp.com' && !/preview/i.test(location.search)){
var ra = document.createElement('script');
ra.type = 'text/javascript'; ra.async = true;
ra.src = '//cdn.ravenjs.com/1.1.0/native/raven.min.js';
var s0 = document.getElementsByTagName('script')[0];
s0.parentNode.insertBefore(ra, s0);
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-36575624-2', 'auto');
ga('send', 'pageview');
// Track device pixel ratios
if (window.devicePixelRatio) ga('set', 'dimension1', window.devicePixelRatio);
}
</script>
</head>
<body>
<!--[if lt IE 10]>
<div id="outdated-browser">
<p>You are using an <strong>outdated</strong> browser. Please <a href="http://browsehappy.com/">upgrade your browser</a> to improve your experience.</p>
<p><small>Else, just go to <a href="https://news.ycombinator.com/">Hacker News</a> web site instead.</small></p>
</div>
<![endif]-->
<div id="apploader"></div>
<div class="view hidden" id="view-home">
<header>
<a href="#/about" class="header-button header-button-left"><button>About</button></a>
<h1 style="margin: 0 65px;">HackerWeb</h1>
<a class="header-button header-button-icon header-button-right" id="view-home-refresh"><button><i class="icon-refresh">Refresh</i></button></a>
</header>
<div class="scroll">
<section>
</section>
</div>
</div>
<div class="view hidden shaded" id="view-comments">
<header>
<a href="#/" class="header-button header-button-left header-back-button"><button>News</button></a>
<h1 style="margin: 0 75px;"></h1>
</header>
<div class="scroll">
<section>
</section>
</div>
</div>
<div class="view hidden shaded" id="view-about">
<header>
<a href="#/" class="header-button header-button-left"><button>Close</button></a>
<h1>About</h1>
</header>
<div class="scroll striped">
<section>
<div class="grouped-tableview cf">
<span id="y-icon"></span>
<p id="app-desc"><strong>HackerWeb</strong><br>A simply readable Hacker News app.</p>
</div>
<ul class="grouped-tableview grouped-tableview-links">
<li><a href="https://itunes.apple.com/us/app/id1084209377" target="_blank">🍎 Available on the App Store</a>
<li><a href="https://play.google.com/store/apps/details?id=cheeaun.hackerweb" target="_blank">🍏 Get it on Google Play</a></li>
<li><a href="https://donorbox.org/support-cheeaun" target="_blank">☕️ Buy me a cup of coffee</a></li>
</ul>
<ul class="grouped-tableview grouped-tableview-links">
<li><a href="https://hackerwebapp.com/" target="_blank" class="disclosure">HackerWeb homepage</a></li>
<li><a href="https://news.ycombinator.com/" target="_blank" class="disclosure">Hacker News homepage</a></li>
<li><a href="https://news.ycombinator.com/newsfaq.html" target="_blank" class="disclosure">Hacker News FAQ</a></li>
<li><a href="https://github.com/cheeaun/hackerweb" target="_blank" class="disclosure">HackerWeb on GitHub</a></li>
<li><a href="https://twitter.com/cheeaun" target="_blank" class="disclosure">Follow @cheeaun</a></li>
<li><a href="mailto:[email protected]?subject=HackerWeb feedback" class="disclosure">Send Feedback</a></li>
</ul>
<p class="foot-label">Built by Lim Chee Aun.<br>Not affiliated with Hacker News or YCombinator.</p>
</section>
</div>
</div>
<script>
(function(d, ua){
var hasLocalStorage = false;
try {
var testKey = '__hackerweb__test';
localStorage.setItem(testKey, testKey);
localStorage.removeItem(testKey);
hasLocalStorage = true;
} catch(e) {}
var theme = 'web';
if (ua && /iPhone|iPod|iPad/.test(ua)){
var version = parseInt((ua.match(/ OS (\d+)_/i) || [,0])[1], 10);
if (version >= 7){
theme = 'ios-2';
} else if (version >= 5){
theme = 'ios';
}
}
if (hasLocalStorage) theme = localStorage['hackerweb:options:theme'] || theme;
var head = d.head || d.getElementsByTagName('head')[0];
var link = d.createElement('link');
link.rel = 'stylesheet';
link.href = 'assets/css/hw-' + theme + '.min.css';
head.insertBefore(link, head.lastChild);
var script = d.createElement('script');
script.src = 'js/hw-' + theme + '.min.js';
head.insertBefore(script, head.lastChild);
if (typeof ga != 'undefined') setTimeout(function(){
ga('send', 'event', 'App', 'Theme', theme);
}, 2000);
})(document, navigator.userAgent);
if ('serviceWorker' in navigator){
navigator.serviceWorker.register('service-worker.js').then(function(registration){
console.log('ServiceWorker registration successful with scope: ', registration.scope);
}).catch(function(err){
console.log('ServiceWorker registration failed: ', err);
});
}
if (typeof ga != 'undefined') ga('send', 'event', 'App', 'ServiceWorker', 'serviceWorker' in navigator);
if (/preview/i.test(location.search)) document.querySelector('.scroll').style.height = 'auto';
</script>
</body>
</html>