forked from szabyg/annotate.js
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
199 lines (185 loc) · 10.6 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
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<link rel="stylesheet" href="lib/jquery/jquery-ui.min.css" />
<link rel="stylesheet" href="lib/Smoothness/jquery.ui.all.css" />
<link rel="stylesheet" href="annotate.css" />
<script type="text/javascript" src="lib/jquery/jquery-1.7.1.js"></script>
<script type="text/javascript" src="lib/jquery-ui.1.9m5.js"></script>
<!-- <script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.16/jquery-ui.min.js"></script>-->
<script type="text/javascript" src="lib/underscore-min.js"></script>
<script type="text/javascript" src="lib/backbone.js"></script>
<script type="text/javascript" src="lib/hallo/hallo.js"></script>
<script type="text/javascript" src="lib/hallo/format.js"></script>
<script type="text/javascript" src="lib/jquery.rdfquery.debug.js"></script>
<script type="text/javascript" src="lib/vie/vie-latest.debug.js"></script>
<script type="text/javascript" src="lib/annotate.js"></script>
<style>
article {
padding: 10px;
}
#loadingDiv {
position: absolute;
top: 10px;
right: 10px;
}
</style>
<script>
if (window.JSON === undefined ) {
document.write('<' + 'script src="lib/json/json2.js">/script>"></' + 'script>');
}
$(document).ready(function(){ _.defer(function(){
$('#loadingDiv')
.hide() // hide it initially
.ajaxStart(function() {
$(this).show();
})
.ajaxStop(function() {
$(this).hide();
});
var z = new VIE();
z.use(new z.StanbolService({
url : "http://dev.iks-project.eu:8081",
proxyDisabled: true
}));
// make the content element editable
$('.content').hallo({
plugins: {
// 'halloformat': {}
},
editable: true
});
function enable(){
$('.content')
.each(function(){
$(this)
.annotate('enable', function(success){
if(success){
$('.enhanceButton')
.button('enable')
.button('option', 'label', 'Done');
$('.acceptAllButton')
.show()
.button('enable')
} else {
$('.enhanceButton')
.button('enable')
.button('option', 'label', 'error, see the log.. Try to enhance again!');
}
});
});
}
function instantiate(){
$('.content').annotate({
vie: z,
// typeFilter: ["http://dbpedia.org/ontology/Place", "http://dbpedia.org/ontology/Organisation", "http://dbpedia.org/ontology/Person"],
debug: false,
//autoAnalyze: true,
showTooltip: true,
decline: function(event, ui){
console.info('decline event', event, ui);
},
select: function(event, ui){
console.info('select event', event, ui);
},
remove: function(event, ui){
console.info('remove event', event, ui);
},
success: function(event, ui){
console.info('success event', event, ui);
},
error: function(event, ui){
console.info('error event', event, ui);
}
});
}
instantiate();
$('.acceptAllButton')
.button()
.hide()
.click(function(){
$('.content')
.each(function(){
$(this)
.annotate('acceptAll', function(report){
console.log('AcceptAll finished with the report:', report);
});
})
$('.acceptAllButton')
.button('disable');
});
$('.enhanceButton')
.button({enhState: 'passiv'})
.click(function(){
// Button with two states
var oldState = $(this).button('option', 'enhState');
var newState = oldState === 'passiv' ? 'active' : 'passiv';
$('.enhanceButton').button('option', 'enhState', newState);
if($(this).button('option', 'enhState') === 'active'){
// annotate.enable()
try {
console.info(".content", $('.content'));
enable()
$('.enhanceButton')
.button('disable')
.button('option', 'label', 'in progress...')
} catch (e) {
alert(e);
}
} else {
// annotate.disable()
$('.content').annotate('disable');
$('.enhanceButton').button('option', 'label', 'Enhance!');
$('.acceptAllButton')
.hide()
}
});
jQuery('.instantiate').button().click(instantiate);
jQuery('.destroy').button().click(function(){
jQuery('.content').annotate('destroy');
});
jQuery('.enable').button().click(function(){
enable();
});
jQuery('.disable').button().click(function(){
jQuery('.content').annotate('disable');
});
});});
</script>
</head>
<body xmlns:sioc = "http://rdfs.org/sioc/ns#"
xmlns:skos = "http://www.w3.org/2004/02/skos/core#"
xmlns:schema = "http://www.schema.org/">
<div class="panel" id="webview">
<h2>Test annotate.js on itself</h2>
<button class="enhanceButton">Enhance!</button>
<button class="acceptAllButton" style="display:none;">Accept all</button>
<article typeof="schema:CreativeWork" about="http://stanbol.apache.org/enhancertest">
<div property="sioc:content" class="content">
Turkey, known officially as the Republic of Turkey, is a Eurasian country that stretches across the Anatolian peninsula in western Asia and Thrace in the Balkan region of southeastern Europe. Turkey is one of the six independent Turkic states. Turkey is bordered by eight countries: Bulgaria to the northwest; Greece to the west; Georgia to the northeast; Armenia, Azerbaijan and Iran to the east; and Iraq and Syria to the southeast. The Mediterranean Sea and Cyprus are to the south; the Aegean Sea to the west; and the Black Sea is to the north. The Sea of Marmara, the Bosphorus and the Dardanelles (which together form the Turkish <a href="http://dbpedia.org/resource/Strait" about="http://dbpedia.org/resource/Strait" typeof="" rel="skos:related" class="entity other acknowledged" title="">Straits</a>) demarcate the boundary between Eastern Thrace and Anatolia; they also separate Europe and Asia. Turks began migrating into the area now called Turkey ("land of the Turks") in the eleventh century.
<!--
</div><div>
-->
The process was greatly accelerated by the Seljuk victory over the Byzantine Empire at the Battle of Manzikert. Several small beyliks and the Seljuk Sultanate of Rûm ruled Anatolia until the Mongol Empire's invasion. Starting from the thirteenth century, the Ottoman beylik united Anatolia and created an empire encompassing much of Southeastern Europe, Western Asia and North Africa. After the Ottoman Empire collapsed following its defeat in World War I, parts of it were occupied by the victorious Allies. A cadre of young military officers, led by Mustafa Kemal Atatürk, organized a successful resistance to the Allies; in 1923, they would establish the modern Republic of Turkey with Atatürk as its first president. Turkey's location at the crossroads of Europe and Asia makes it a country of significant geostrategic importance. The predominant religion in Turkey is Islam with small minorities of Christianity and Judaism.
The country's official language is Turkish, whereas Kurdish and Zazaki languages are spoken by Kurds and Zazas which comprise 18% of the population. Turkey is a democratic, secular, unitary, constitutional republic, with an ancient cultural heritage. Turkey has become increasingly integrated with the West through membership in organizations such as the Council of Europe, NATO, OECD, OSCE and the G-20 major economies. Turkey began full membership negotiations with the European Union in 2005, having been an associate member of the European Economic Community since 1963 and having reached a customs union agreement in 1995. Turkey has also fostered close cultural, political, economic and industrial relations with the Middle East, the Turkic states of Central Asia and the African countries through membership in organizations such as the Organisation of the Islamic Conference and Economic Cooperation Organization. Given its strategic location, large economy and army, Turkey is classified as a regional power.
Actress Angelina Jolie, a longtime goodwill ambassador for the United Nations' refugee agency, will be headed to Turkey this week to visit Syrian refugees, Turkey's Foreign Ministry said Wednesday.
Jolie is expected to arrive in Istanbul and head to Hatay on Friday, according to the ministry, which accepted an application for her visit on Wednesday.
More than 8,000 Syrians have fled their country for Turkey to escape violence, including a military offensive in the Jisr al-Shugur area.
Jolie was named a goodwill ambassador for the Office of the High Commissioner for Refugees in early 2001 and has visited more than 20 countries "to highlight the plight of millions of uprooted people and to advocate for their protection."
The office said her interest in "humanitarian affairs was piqued in 2000 when she went to Cambodia to film the adventure film 'Tomb Raider.' "
Jolie has won numerous acting awards, including a best supporting actress Academy Award for her performance in 1999's "Girl, Interrupted."
</div>
</article>
<button class="enhanceButton">Enhance!</button>
<button class="acceptAllButton" style="display:none;">Accept all</button>
</div>
<div>
<h2>Debug the widget states</h2>
<button class="destroy">Destroy</button>
<button class="instantiate">Instantiate</button>
<button class="enable">Enable</button>
<button class="disable">Disable</button>
</div>
<div id="loadingDiv" style="display:none;"><img src="spinner.gif"/></div>
</body>
</html>