forked from formula1/NodeOS-Blog
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy patharticle.html
308 lines (282 loc) · 9.85 KB
/
article.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
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
<!doctype html>
<html>
<head>
<link rel="stylesheet" href="http://netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap.min.css"/>
<link rel="stylesheet" href="http://netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap-theme.min.css"/>
<link rel="stylesheet" href="http://node-os.com/css/default.css"/>
<script type="application/javascript" src="http://cloud.github.com/downloads/wycats/handlebars.js/handlebars-1.0.0.beta.6.js"></script>
<style>
.more {display:none}
#articles img{max-width:100%}
#articles article .title img{height:50px}
</style>
</head>
<body>
<header class="navbar navbar-default navbar-fixed-top" role="navigation">
<!-- Brand and toggle get grouped for better mobile display -->
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-ex1-collapse">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="http://node-os.com">NodeOS</a>
</div>
<!-- Collect the nav links, forms, and other content for toggling -->
<div class="collapse navbar-collapse navbar-ex1-collapse">
<ul class="nav navbar-nav">
<li>
<a href="http://node-os.com/GitBlog">Blog</a>
</li>
<li>
<a href="http://node-os.com/blog">Old blog</a>
</li>
<li>
<a href="http://pipes.yahoo.com/pipes/pipe.run?_id=d98a965ba7d3f6555b939d707b18dc39&_render=rss&label=blog&owner=NodeOS&repo=NodeOS">RSS</a>
</li>
</ul>
</div>
<!-- /.navbar-collapse -->
</header>
<!-- START: ISSUES ITEM TEMPLATE -->
<section ng-app="NodeOsBlog" id="articles" class="section">
<div class="container error">
</div>
<script type="text/html" class="template error">
<article class="row" data-unique="{{unique}}">
<div class="col-sm-8 col-sm-offset-2 {{class}}" >
<header class="alert alert-danger" role="alert">
<h3 class="title">{{name}}</h3>
<a href="#" class="remove">To remove this message, click here</a>
</header>
<div class="content">{{{message}}}</div>
<footer>
Don't worry, it probably was not your fault... probably...<br/>
Even if it was,
<a target="_blank" href="https://github.com/NodeOS/GitBlog/issues">just submit an issue :)</a>
</footer>
</div>
</article>
</script>
<div id="westoredata" class="jumbotron">
<h1>We store data on your computer</h1>
<div>
<p>
If you login: We store your access token we retrieve from github on your computer as a cookie.
<a class="btn btn-primary" href="https://github.com/formula1/AuthProvider/blob/master/index.js#L87">See the Code</a>
</p>
<p class="more">
This is done so that we can access the github api in a verified manner.<br/>
This is purely optional and we never use your user information.<br/>
This is done to avoid server operations.
</p>
<p>
By Using the Blog: We store data we get from github on your available local storage.
<a class="btn btn-primary" href="https://github.com/NodeOS/GitBlog/blob/master/js/cacheOrLoad.js">See the Code</a>
</p>
<p class="more" >
This is done so that you may avoid as many calls to github as possible.<br/>
Without this, you would have to request github every time you wanted to view a page.<br/>
This is not optional.
</p>
</div>
<p>
<a class="btn btn-primary btn-lg" href="#" role="button">Learn more</a>
</p>
</div>
<div class="container blogsingle" ></div>
<script type="text/html" class="template blogsingle" >
<article class="row">
<div class="col-sm-8 col-sm-offset-2">
<header class="{{state}}">
<h3 class="title">
<a href="article.html#!{{number}}">{{title}}</a>
</h3>
<a href="{{html_url}}">View on Github</a>
</header>
<div class="content" >{{{bodyHTML}}}</div>
</div>
</article>
</script>
<div class="container comments" ></div>
<script type="text/html" class="template comments">
<article class="row">
<div class="col-sm-8 col-sm-offset-2">
<header class="{{state}}">
<h3 class="title">
<a href="{{user.html_url}}">
<img src="{{user.avatar_url}}"/>
<span>{{user.login}}</span>
</a>
</h3>
<a href="{{html_url}}">View on Github</a>
</header>
<div class="content">{{{bodyHTML}}}</div>
</div>
</article>
</script>
</section>
<!-- END: ISSUES ITEM TEMPLATE -->
<div class="section inverse trampstamp">
<div class="row">
<div class="col-xs-12">
<img src="http://node-os.com/images/nodeos-update.png">
</div>
</div>
</div>
<footer>
<div class="container" id="footer">
<div class="row">
<div class="col-sm-7">
<h3 class="footer-title">Share</h3>
<p>NodeOS is a work in progress.</p>
<p>If you would like to support us, please share NodeOS via Twitter</p>
<p class="pvl">
<a href="https://twitter.com/TheNodeOS"
class="twitter-follow-button"
data-show-count="false"
data-size="large">Follow @TheNodeOS</a>
<script type="text/javascript">
(function(d,s,id){
var js;
fjs=d.getElementsByTagName(s)[0];
p= /^http\:/.test(d.location)?'http':'https';
if(!d.getElementById(id)){
js=d.createElement(s);
js.id=id;
js.src=p+'://platform.twitter.com/widgets.js';
fjs.parentNode.insertBefore(js,fjs);
}
})(document, 'script', 'twitter-wjs');
</script>
<a href="https://twitter.com/share"
class="twitter-share-button"
data-url="http://node-os.com/blog/OS-flavors"
data-text="NodeOS - The NodeJS Powered Operating System"
data-via="TheNodeOS" data-size="large">Tweet</a>
</p>
</div>
</div>
</div>
</footer>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
<script type="text/javascript" src="http://netdna.bootstrapcdn.com/bootstrap/3.0.0/js/bootstrap.min.js"></script>
<script type="text/javascript" src="api.js"></script>
<script type="text/javascript">
var num = (function(){
var temp = document.location.href.split("#!")[1];
console.log(temp);
if(/[0-9]+/.test(temp)) return temp;
temp = document.location.href.split("?");
if(temp.length == 1){
return add404();
}
temp = require("querystring").parse(temp[1]);
if(!temp._escaped_fragment_){
return add404();
}
return temp._escaped_fragment_;
})();
var singleHandler;
jQuery(function($){
if(!num) return;
var Template = require("template");
var cacheOrUriIterator = require("cache-or-load");
singleHandler = new Template(
"script.template.blogsingle",
"div.container.blogsingle"
);
singleHandler._x = {
uri: "https://api.github.com/repos/NodeOS/NodeOS/issues/"+num,
last: void(0)
};
cacheOrUriIterator(
"issue-"+num,
{
timestamp2URI: function(timestamp,next){
if(Date.now() - timestamp < 1000*60*60*24) return;
user.asAuthority(singleHandler._x.uri,next);
},
prep: function(item, next){
item.timestamp = Date.now();
var l = item.labels.length;
while(l--){
if(item.labels[l].name === "blog"){
break;
}
}
if(l < 0){
return addError({
name:"Trying to load a non-blog?",
message: "I technically can't stop you since this is clientside."+
" Hopefully my code feels clean enough to hack"
});
}
parseMarkdown(item,next);
},
ready: function(item,next){
singleHandler.add(item);
next();
},
done: function(date){
singleHandler._x.last = date;
},
error: function(error){
if(error.status && error.status === 403){
add403();
}else{
addError(error);
}
}
}
);
});
var commentHandler;
jQuery(function($){
if(!num) return;
var Template = require("template");
var cacheOrUriIterator = require("cache-or-load");
commentHandler = new Template(
"script.template.comments",
"div.container.comments"
);
commentHandler._x = {
uri: "https://api.github.com/repos/NodeOS/NodeOS/issues/"+num+"/comments",
last: void(0)
};
cacheOrUriIterator(
"issue-comments-"+num,
{
timestamp2URI: function(timestamp,next){
var uri = commentHandler._x.uri;
if(timestamp) {
uri += "?since="+(new Date(timestamp+1000)).toISOString();
}
user.asAuthority(uri,next);
},
prep: function(item, next){
item.timestamp = (new Date(item.created_at)).getTime();
parseMarkdown(item,next);
},
ready: function(item,next){
commentHandler.add(item);
setTimeout(next,1);
},
done: function(date){
commentHandler._x.last = date;
},
error: function(error){
if(error.status && error.status === 403){
add403();
}else{
addError(error);
}
}
}
);
});
</script>
<!-- END: BIND DATA TO VIEW -->
</body>
</html>