-
Notifications
You must be signed in to change notification settings - Fork 26
/
index.html
505 lines (472 loc) · 26.2 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
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
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
<!DOCTYPE html>
<html lang="en" ng-app="CimbaApp">
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<meta charset="utf-8">
<title>Cimba</title>
<meta name="generator" content="Cimba">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<!-- prod
<link href="//netdna.bootstrapcdn.com/bootstrap/3.0.2/css/bootstrap.min.css" rel="stylesheet">
-->
<link href="//netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.css" rel="stylesheet">
<!-- dev -->
<link href="dev/css/bootstrap.min.css" rel="stylesheet">
<!-- local -->
<link href="css/style.css" rel="stylesheet">
<link href="css/proxima-nova.css" rel="stylesheet">
<!-- prod
<script type='text/javascript' src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<script type='text/javascript' src="//netdna.bootstrapcdn.com/bootstrap/3.0.2/js/bootstrap.min.js"></script>
<script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jqueryui/1/jquery-ui.js"></script>
-->
<!-- dev -->
<script type='text/javascript' src="dev/js/jquery.min.js"></script>
<script type='text/javascript' src="dev/js/bootstrap.min.js"></script>
<script type="text/javascript" src="dev/js/jquery-ui.js"></script>
<script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/showdown/0.3.1/showdown.min.js"></script>
<script src="dev/js/angular.min.js"></script>
<script src="dev/js/angular-ui.min.js"></script>
<script src="dev/js/rdflib.js"></script>
<!-- local -->
<script type='text/javascript' src="js/jquery.notify.js"></script>
<!-- <script type='text/javascript' src="js/rdflib.min.js"></script> -->
<script type='text/javascript' src="js/common.js"></script>
<script type='text/javascript' src="js/moment.min.js"></script>
<script type='text/javascript' src="js/sanitize.js"></script>
<script type='text/javascript' src="js/app.js"></script>
<!--[if lt IE 9]>
<script src="//html5shim.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<link rel="shortcut icon" type="img/png" href="favicon.png">
</head>
<body ng-cloak>
<div ng-controller="CimbaCtrl">
<div class="navbar navbar-default" id="subnav">
<div class="col-md-12">
<div class="navbar-header">
<img src="img/cimba-logo.png" class="logo">
<button id="menuToggle" type="button" class="navbar-toggle pull-right" data-toggle="collapse" data-target="#navbar-collapse2">
<span class="sr-only">Toggle navigation</span>
<i class="fa fa-bars fa-2x blue"></i>
</button>
<!-- TODO!
<div ng-show="me.pic" class="user-thumb"><a href="{{me.webid}}" target="_blank"><img class="r3" src="{{me.pic}}" rel="tooltip" data-placement="top" title="{{me.name}}"></a></div>
-->
</div>
<div class="collapse navbar-collapse" id="navbar-collapse2">
<ul class="nav navbar-nav navbar-right">
<li ng-hide="!me.channels[0]"><a href="#" ng-click="updatePosts()"><i class="fa fa-refresh"></i> Refresh </a></li>
<li ng-show="loggedin"><a href="#subsModal" role="button" data-toggle="modal"><i class="fa fa-rss"></i> Channels</a></li>
<!-- QCRI Filtering Start -->
<li ng-hide="!me.channels[0]" ng-class="filterFlag==true?'active':''" rel="tooltip" data-placement="top" title="Toggle language filter"><a href="#" ng-click="toggleFilter()"><i class="fa fa-filter"></i> {{languageFilter}}</a></li>
<!-- QCRI Filtering End -->
<li ng-hide="loggedin"><a href="#loginModal" role="button" data-toggle="modal"><i class="fa fa-sign-in"></i> Login</a></li>
<li ng-show="loggedin"><a href="#" ng-click="clearSession()" role="button"><i class="fa fa-sign-out"></i> Logout</a></li>
</ul>
</div>
</div>
</div>
<!--main-->
<!-- new post -->
<div class="container" id="newpost">
<div class="row">
<div class="clear-70"></div>
<div class="col-md-12">
<!-- new post -->
<div class="panel panel-default" ng-show="loggedin">
<div class="panel-heading dark-blue">
<div class="pull-left">
<a id="pic" class="thumbnail pull-right" href="{{me.webid}}">
<img class="media-object" ng-src="{{me.pic}}" rel="tooltip" data-placement="top" title="{{me.name}}">
</a>
</div>
</div>
<div class="panel-body">
<div class="panel-body-textmail">
<div id="spinner" ng-hide="me.name"></div>
<h3 class="bold" ng-show="profileloading">Loading profile...</h3>
<h3 class="bold" ng-show="me.name && !me.chspace">Hello {{me.name}}!</h3>
<h3 class="bold" ng-show="me.chspace">What's new<span ng-show="me.name != ''">, </span><a ng-show="me.name != ''" href="{{me.webid}}">{{me.name}}</a>?</h3>
<form ng-hide="me.webid && !me.chspace">
<textarea name="message" ng-model="postbody" class="form-control message" placeholder="Type your message here.." required></textarea>
<div class="btn-group">
<button id="audience" class="btn btn-primary" disabled><i class="fa {{audience.icon}} fa-2x white"></i></button><button class="btn dropdown-toggle" data-toggle="dropdown" data-target="#" href="#"> <small class="drop" rel="tooltip" data-placement="top" title="Audience"><i class="fa fa-chevron-down fa-2x"></i></small></button>
<ul class="dropdown-menu" role="menu" aria-labelledby="audience">
<li><a href="#" ng-click="setAudience('public')"><i id="public" class="fa fa-globe fa-2x blue"></i> Public</a></li>
<li><a href="#" ng-click="setAudience('private')"> <i id="private" class="fa fa-lock fa-2x blue"></i> Private</a></li>
<!-- <li><a href="#" ng-click="setAudience('friends')"><i id="friends" class="fa fa-user fa-2x blue"></i> Friends</a></li> -->
</ul>
</div>
<div class="btn-group" ng-show="me.channels.length > 0" rel="tooltip" data-placement="top" title="Channels">
<button id="chs" class="btn btn-primary" disabled>{{defaultChannel.title}}</button><button class="btn dropdown-toggle" data-toggle="dropdown" data-target="#" href="#"> <small class="drop" rel="tooltip" data-placement="top" title="Channels"><i class="fa fa-chevron-down fa-2x"></i></small></button>
<ul class="dropdown-menu" role="menu" aria-labelledby="chs">
<li ng-repeat="channel in me.channels | orderBy:'title'">
<a href="#" ng-click="setChannel(channel.title)">{{channel.title}}</a>
</li>
</ul>
</div>
<div class="pull-right">
<button class="btn btn-primary pull-right w60" ng-click="newPost()" ng-disabled="!postbody">
<div ng-show="!publishing">Post</div>
<div ng-show="publishing" class="dots"></div>
</button>
</div>
</form>
</div>
</div>
</div>
<!-- end new post -->
</div>
</div>
</div>
<!-- WebID authentication failed/missing -->
<div id="setup" class="container" ng-show="testwebid">
<div class="row">
<div class="col-md-12">
<div class="panel panel-default">
<div class="panel-heading dark-blue">
</div>
<div class="panel-body">
<div class="panel-body">
<h2 class="text-center">We were unable to authentify you using WebID-TLS!</h2>
<div class="text-center">
<a href="https://auth.my-profile.eu/auth/index.php?verbose=on" target="_blank"><button class="btn btn-primary btn-sep-right">Test your WebID</button></a>
<a href="#loginModal" role="button" data-toggle="modal"><button class="btn btn-primary">Sign up for a WebID</button></a>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- login/signup -->
<div id="setup" class="container" ng-show="!me.webid">
<div class="row">
<div class="col-md-12">
<div class="panel panel-default">
<div class="panel-heading dark-blue">
</div>
<div class="panel-body">
<div class="panel-body">
<h2 class="text-center">Welcome to <img src="img/cimba-logo.png" height="50"></h2>
<div class="text-center">
<h3>You must be authenticated in order to use this microblogging application.</h3>
<a href="#loginModal" role="button" data-toggle="modal"><button class="btn btn-primary btn-sep-right">Login / Sign Up</button></a>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- new storage modal -->
<div id="setup" class="container" ng-show="me.webid && !me.storagespace">
<div class="row">
<div class="col-md-12">
<div class="panel panel-default text-center">
<h3>Hi {{me.name}}! We could not find a shared storage space in your WebID profile.</h3>
<p><a href="#newStorageModal" role="button" data-toggle="modal"><button class="btn btn-primary">Please provide one here</button></a></p>
</div>
</div>
</div>
</div>
<!-- new uB modal -->
<div id="setup" class="container" ng-show="me.webid && me.storagespace && me.mbspace == false">
<div class="row">
<div class="col-md-12">
<div class="panel panel-default text-center">
<h3>To start using Cimba, you will need a microblogging space.</h3>
<p><a href="#newMBModal" role="button" data-toggle="modal"><button class="btn btn-primary">Click here to create one</button></a></p>
</div>
</div>
</div>
</div>
<!-- no channels found -->
<div id="setup" class="container" ng-show="me.webid && me.storagespace && me.mbspace && me.chspace == false">
<div class="row">
<div class="col-md-12">
<div class="panel panel-default text-center">
<h3>You're almost there! Now you just need to create a channel for your posts.</h3>
<p><a href="#newChannelModal" role="button" data-toggle="modal"><button class="btn btn-primary">Click here to create a channel</button></a></p>
</div>
</div>
</div>
</div>
<!-- no posts found -->
<div id="setup" class="container" ng-show="me.gotposts == false">
<div class="row">
<div class="col-md-12">
<div class="panel panel-default text-center">
<h3>You haven't posted anything. Try writing a new post or <a href="#subscribeModal" role="button" data-toggle="modal"><button class="btn btn-primary"><i class="fa fa-rss white"></i> subscribe</button></a> to someone's channels!</h3>
</div>
</div>
</div>
</div>
<!-- posts viewer -->
<div id="posts" class="container">
<div class="row">
<div class="col-md-12">
<!-- Loading animation -->
<div class="panel panel-default text-center" ng-show="loading">
<!-- <div class="spinner"> -->
<div class="clear-40">
<div class="circle circle-large"></div><div class="circle1 circle1-large"></div>
</div>
<!-- <div class="gear"></div> -->
</div>
<!-- All posts go into <posts-viewer> -->
<posts-viewer ng-show="loggedin"></posts-viewer>
</div>
</div>
</div>
<!--new storage modal-->
<div id="newStorageModal" class="modal fade" tabindex="-1" role="dialog" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">x</button>
<h3 class="text-center">Provide a URI for your storage</h3>
</div>
<div class="modal-body">
<form class="m10">
<p><small>Full storage location URI. Must start with http(s)://</small></p>
<input type="text" id="storageuri" name="storageuri" ng-model="storageuri" class="form-control" placeholder="http.." required ng-pattern="/^http[A-Za-z0-9_.:/]*$/">
<div ng-show="storageuri" class="text-center">
<br>
<p>Alternatively, if your WebID profile is not Web writable, you can manually add the following triple at the end of your profile:</p>
<br>
<textarea class="triples"><{{me.webid}}>
<http://www.w3.org/ns/pim/space#storage>
<{{storageuri}}> .</textarea>
</div>
</form>
</div>
<div class="modal-footer">
<div class="col-md-12">
<button class="btn btn-primary" ng-click="newStorage(true)" ng-disabled="!storageuri" tooltip="Skip all configuration">{{addstoragebtn}} (simple)</button>
<button class="btn btn-primary" ng-click="newStorage()" ng-disabled="!storageuri" rel="tooltip" data-placement="top" title="Choose configuration options">{{addstoragebtn}} (advanced)</button>
<button class="btn btn-info btn-sep-right" data-dismiss="modal" aria-hidden="true">Close</button>
</div>
</div>
</div>
</div>
</div>
<!--new microblogging workspace modal-->
<div id="newMBModal" class="modal fade" tabindex="-1" role="dialog" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">x</button>
<h3 class="text-center">Create a new microblog workspace</h3>
</div>
<div class="modal-body">
<form class="m10">
<input type="text" id="mburi" name="mburi" ng-model="mburi" class="form-control" placeholder="mb, blog, etc.." required ng-pattern="/^[A-Za-z0-9_ ]*$/">
</form>
</div>
<div class="modal-footer">
<div class="col-md-12">
<button class="btn btn-primary" ng-click="newMB()" ng-disabled="!mburi">{{createbtn}}</button>
<button class="btn btn-info btn-sep-right" data-dismiss="modal" aria-hidden="true">Close</button>
</div>
</div>
</div>
</div>
</div>
<!--new channel modal-->
<div id="newChannelModal" class="modal fade" tabindex="-1" role="dialog" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h2 class="text-center">Create a new channel</h2>
</div>
<div class="modal-body">
<form class="m10">
<p>The name you provide will be used to create a new channel inside your microblog.</p>
<p><input type="text" id="channelname" name="channelname" ng-model="channelname" class="form-control" placeholder="Name (Main, Work, etc.).." required ng-pattern="/^[A-Za-z0-9_ ]*$/"></p>
<div class="btn-group">
<button id="audience" class="btn btn-primary" disabled><i class="fa {{audience.icon}} fa-2x white"></i></button><button class="btn dropdown-toggle" data-toggle="dropdown" data-target="#" href="#"> <small class="drop" rel="tooltip" data-placement="top" title="Audience"><i class="fa fa-chevron-down fa-2x"></i></small></button>
<ul class="dropdown-menu" role="menu" aria-labelledby="audience">
<li><a href="#" ng-click="setAudience('public')"><i id="public" class="fa fa-globe fa-2x blue"></i> Public</a></li>
<li><a href="#" ng-click="setAudience('private')"> <i id="private" class="fa fa-lock fa-2x blue"></i> Private</a></li>
<!-- <li><a href="#" ng-click="setAudience('friends')"><i id="friends" class="fa fa-user fa-2x blue"></i> Friends</a></li> -->
</ul>
</div>
</form>
</div>
<div class="modal-footer">
<div class="col-md-12">
<button class="btn btn-primary" ng-click="newChannel()" ng-disabled="!channelname">{{createbtn}}</button>
<button class="btn btn-info btn-sep-right" data-dismiss="modal" aria-hidden="true">Close</button>
</div>
</div>
</div>
</div>
</div>
<!--channels modal-->
<div id="subsModal" class="modal fade" tabindex="-1" role="dialog" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header text-center">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h2 class="text-center"><i class="fa fa-rss"></i> Manage channels</h2>
<a href="#newChannelModal" role="button" data-toggle="modal" onclick="$('#subsModal').modal('hide')"><button class="btn btn-primary btn-sep-right"><i class="fa fa-plus"></i> New channel</button></a>
<a href="#subscribeModal" role="button" data-toggle="modal" ><button class="btn btn-primary btn-sep-right"><i class="fa fa-search"></i> Find channels</button></a>
<h2 class="text-center">Available channels:</h2>
</div>
<div class="modal-body">
<channelslist></channelslist>
</div>
<div class="modal-footer">
<div class="col-md-12">
<button class="btn btn-info" data-dismiss="modal" aria-hidden="true">Close</button>
</div>
</div>
</div>
</div>
</div>
<!--subscribe modal-->
<div id="subscribeModal" class="modal fade" tabindex="-1" role="dialog" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h2 class="text-center"><i class="fa fa-search"></i> Find channels</h2>
<form>
<p class="text-center">Search by name, email or WebID..</p>
<div class="input-group">
<div class="input-group-btn text-center">
<input type="search" id="search" name="search" class="form-control" ng-model="search.query" ng-change="lookupWebID(search.query)" ng-pattern="/^[A-Za-z0-9_#.:/]*$/">
<button class="btn btn-primary searchbutton" ng-click="getInfo(search.webid); searchbtn='Searching...'" ng-disabled="!search.webid"><i class="fa fa-search"></i> {{searchbtn}}</button>
</div>
</div>
<div ng-show="search.loading" class="mt30">
<div class="circle circle-large"></div><div class="circle1 circle1-large"></div>
</div>
<searchResults></searchResults>
<h4 class="black text-center" ng-show="!found">No WebID found at given location.</h4>
</form>
</div>
<div class="modal-body">
<div class="searchresults" ng-show="gotresults">
<div class="panel-heading dark-blue">
<div class="pull-left">
<a class="thumbnail thumbnail-sm pull-right" href="{{search.webid}}">
<img class="media-object" ng-src="{{search.pic}}" rel="tooltip" data-placement="top" title="{{search.name}}">
</a>
</div>
</div>
<div class="panel-body-text">
<h4 class="black bold">{{search.name}}</h4>
<h4 class="black">Has {{search.channels.length}} channels.</h4>
</div>
<div class="panel-body">
<h4 class="black" ng-repeat="ch in search.channels">
<button class="btn" ng-class="ch.css" ng-click="channelToggle(ch, search)" rel="tooltip" data-placement="top" title="{{ch.action}}"><i class="fa {{ch.button}} fa-2x"></i></button>
<a href="{{ch.uri}}" target="_blank">{{ch.title}}</a>
</h4>
</div>
</div>
</div>
<div class="modal-footer">
<div class="col-md-12">
<button class="btn btn-info" data-dismiss="modal" aria-hidden="true">Close</button>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- bottom -->
<div class="col-md-12 text-center">
<hr>
<p>Powered by <a href="https://github.com/social-webarch/cimba" target="_blank">CIMBA</a> v1.0 alpha | <a href="https://github.com/social-webarch/cimba/issues" target="_blank">Bug tracker</a> | <a href="#aboutModal" role="button" data-toggle="modal">About</a></p>
</div>
<!--/main-->
<!-- set the notifications container hidden when the page first loads -->
<div id="notification" style="display:none">
<div id="basic-template">
<a class="ui-notify-cross ui-notify-close" href="#">x</a>
<h1>#{title}</h1>
<p>#{text}</p>
</div>
</div>
<!-- OTHER -->
<!--about modal-->
<div id="aboutModal" class="modal fade" tabindex="-1" role="dialog" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h2 class="text-center">About</h2>
</div>
<div class="modal-body">
<div class="col-md-12 text-center">
<h3>This microblogging app is powered by Cimba v1.0 alpha</h3>
<br>
<h3><a href="https://github.com/linkeddata/cimba" target="_blank">Fork on GitHub</a></h3>
</div>
</div>
<div class="modal-footer">
<button class="btn btn-info btn-sep-right" data-dismiss="modal" aria-hidden="true">Close</button>
</div>
</div>
</div>
</div>
<!--login modal-->
<div id="loginModal" class="modal fade" tabindex="-1" role="dialog" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h2 class="text-center">Login / Sign Up</h2>
</div>
<div class="modal-body">
<iframe id="signup" src="" sandbox="allow-same-origin allow-scripts allow-forms" frameborder="0"></iframe>
</div>
<div class="modal-footer">
<div class="col-md-12">
<button class="btn btn-info" data-dismiss="modal" aria-hidden="true">Close</button>
</div>
</div>
</div>
</div>
</div>
<script type='text/javascript'>
$(document).ready(function() {
/* toggle layout */
$('#btnToggle').click(function(){
if ($(this).hasClass('on')) {
$('#main .col-md-6').addClass('col-md-4').removeClass('col-md-6');
$(this).removeClass('on');
}
else {
$('#main .col-md-4').addClass('col-md-6').removeClass('col-md-4');
$(this).addClass('on');
}
});
// auto close menu after click
$('#navbar-collapse2').click(function () {
if (!$("#menuToggle").hasClass('collapsed')) {
$('.navbar-collapse').collapse('hide');
}
});
// load login/signup
//$('#login-body').load("//example.org/onboard/signup.html");
//angular.bootstrap(document.getElementById('ob-app'), ['ob-app']);
// init tooltip plugin
$('#audience').tooltip();
// login/signup widget source
var providerURI = '//linkeddata.github.io/signup/index.html?ref=';
// set the parameter in the src of iframe
document.getElementById('signup').src = providerURI+window.location.protocol+'//'+window.location.host;
//document.getElementById('directLogin').href = providerURI+window.location.protocol+'//'+window.location.host+'#login';
//document.getElementById('directSignup').href = providerURI+window.location.protocol+'//'+window.location.host+'#signup';
});
</script>
</body>
</html>