-
Notifications
You must be signed in to change notification settings - Fork 4
/
template_bootstrap2.html
160 lines (145 loc) · 6.42 KB
/
template_bootstrap2.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
<link type="text/css" rel="stylesheet" href="http://annotorious.github.io/latest/themes/dark/annotorious-dark.css"/>
<div class="row skeleton">
<div class="span12">
<p class="lead"> Tag all the faces people that you know <button id="btn-submit" class="btn btn-large btn-answer pull-right" value='NoTag'><i class="icon-repeat"></i> I don't recognize any person, try next one</button></p>
</div>
<div id="img-details" class="span4">
<h4 id="title"></h4>
<p id="description"></p>
<p><i class="icon icon-time"></i> Date taken: <span id="date_taken"></span></p>
<p><i class="icon icon-tag"></i> Tags: <span id="tags"></span></p>
</div>
<div class="span8">
<span id="photo-link">
<img id="photo" src="http://i.imgur.com/GeHxzb7.png" style="max-width=100%">
</span>
</div>
</div><!-- End of Skeleton Row -->
<div class="row skeleton">
<div class="span12">
<div id="disqus_show_btn" style="margin-top:5px;">
<button class="btn btn-primary btn-large btn-disqus" onclick="loadDisqus()"><i class="icon-comments"></i> Show comments</button>
<button class="btn btn-large btn-disqus" onclick="loadDisqus()" style="display:none"><i class="icon-comments"></i> Hide comments</button>
</div><!-- End of Disqus Button section -->
<!-- Disqus thread for the given task -->
<div id="disqus_thread" style="margin-top:5px;display:none"></div>
</div>
</div>
<div class="row">
<!-- Success and Error Messages for the user -->
<div class="span6 offset2" style="height:50px">
<div id="success" class="alert alert-success" style="display:none;">
<a class="close">×</a>
<strong>Well done!</strong> Your answer has been saved
</div>
<div id="loading" class="alert alert-info" style="display:none;">
<a class="close">×</a>
Loading next task...
</div>
<div id="taskcompleted" class="alert alert-info" style="display:none;">
<strong>The task has been completed!</strong> Thanks a lot!
</div>
<div id="finish" class="alert alert-success" style="display:none;">
<strong>Congratulations!</strong> You have participated in all available tasks!
<br/>
<div class="alert-actions">
<a class="btn small" href="/">Go back</a>
<a class="btn small" href="/app">or, Check other applications</a>
</div>
</div>
<div id="error" class="alert alert-error" style="display:none;">
<a class="close">×</a>
<strong>Error!</strong> Something went wrong, please contact the site administrators
</div>
</div> <!-- End Success and Error Messages for the user -->
</div> <!-- End of Row -->
<script type="text/javascript">
/* * * CONFIGURATION VARIABLES: EDIT BEFORE PASTING INTO YOUR WEBPAGE * * */
/* * * DON'T EDIT BELOW THIS LINE * * */
function loadDisqus() {
$("#disqus_thread").toggle();
$(".btn-disqus").toggle();
var disqus_shortname = 'pybossa'; // required: replace example with your forum shortname
//var disqus_identifier = taskId;
var disqus_developer = 1;
(function() {
var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true;
dsq.src = 'http://' + disqus_shortname + '.disqus.com/embed.js';
(document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq);
})();
}
</script>
<noscript>Please enable JavaScript to view the <a href="http://disqus.com/?ref_noscript">comments powered by Disqus.</a></noscript>
<script type="text/javascript" src="http://annotorious.github.io/latest/annotorious.min.js"></script>
<script type="text/javascript" src="/static/vendor/jquery.js"></script>
<script type="text/javascript" src="http://annotorious.github.io/demos/semantic-tagging-plugin.js"></script>
<script>
//anno.addPlugin('SemanticTagging', { endpoint_url: 'http://samos.mminf.univie.ac.at:8080/wikipediaminer' });
</script>
<script>
pybossa.taskLoaded(function(task, deferred) {
if ( ! $.isEmptyObject(task) ) {
// load image from flickr
var img = $('<img />');
img.load(function() {
// continue as soon as the image is loaded
deferred.resolve(task);
});
var url_raw = task.info.url_raw || genericFlickrURL(task.info.url);
img.attr('src', url_raw + "_z.jpg");
img.attr('id', 'anno_' + task.id);
img.addClass('img-polaroid');
img.addClass('annotable');
task.info.image = img;
}
else {
deferred.resolve(task);
}
});
function genericFlickrURL(url) {
var splittedURL = url.split(".");
splittedURL.pop();
return splittedURL.join(".");
}
pybossa.presentTask(function(task, deferred) {
if ( !$.isEmptyObject(task) ) {
$('#photo-link').html('').append(task.info.image);
$('#task-id').html(task.id);
$("#btn-submit").html("<i class='icon-repeat'></i> I don't recognize any person, try next one");
$("#btn-submit").removeClass("btn-success");
// Load data details
$("#title").text(task.info.title);
$("#description").html(task.info.description);
$("#date_taken").html(task.info.date_taken);
$("#tags").html(task.info.tags);
anno.makeAnnotatable(document.getElementById('anno_' + task.id));
anno.addHandler('onAnnotationCreated', function(annotation) {
$("#btn-submit").html("<i class='icon icon-save'></i> Save current annotations");
$("#btn-submit").addClass("btn-success");
});
$('.btn-answer').off('click').on('click', function(evt) {
var answer = $(evt.target).attr("value");
if (typeof answer != 'undefined') {
pybossa.saveTask(task.id, anno.getAnnotations()).done(function() {
deferred.resolve();
});
$("#loading").fadeIn(500);
if ($("#disqus_thread").is(":visible")) {
$('#disqus_thread').toggle();
$('.btn-disqus').toggle();
}
}
else {
$("#error").show();
}
});
$("#loading").hide();
}
else {
$(".skeleton").hide();
$("#loading").hide();
$("#finish").fadeIn(500);
}
});
pybossa.run('taggingpictures');
</script>