Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

adding log element for development..

  • Loading branch information...
commit 17856ea22f697b287f0d9a490da36bfe04110530 1 parent 09ddfc4
Szaby Grünwald authored
Showing with 18 additions and 2 deletions.
  1. +18 −2 annotate.html
View
20 annotate.html
@@ -17,6 +17,10 @@
.new-enhancement {
border-bottom:1px dotted;
}
+ #log {
+ border: 1px solid #ccc;
+ padding: 10px;
+ }
</style>
<!-- 3rd-party libs -->
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.5.1/jquery.min.js" type="text/javascript"></script>
@@ -48,7 +52,7 @@
<!-- VIE^2 -->
<script type="text/javascript" src="lib/vie2/vie2-latest.debug.js"></script>
- <script type="text/javascript">VIE2.logLevels = ["info", "error" ]//, "warn"];</script>
+ <script type="text/javascript">VIE2.logLevels = ["info", "error", "warn"];</script>
<script type="text/javascript" src="lib/VIEwidgets/editable.js"></script>
<script type="text/javascript" src="src/annotate.js"></script>
@@ -106,13 +110,18 @@
}
}
+ log('initialize..');
$('#annotatebutton').click(function(){
+ log('Start vie2.analyze()..wait');
$('#content').vie2().vie2('analyze', function(data){
+ log('analization finished.');
var element = this[0];// http://fise.iks-project.eu/ontology/selection-context
- console.info(VIE2.globalCache.where("?subj <http://www.semanticdesktop.org/ontologies/2007/01/19/nie#plainTextContent> ?text")[0].text.toString());
+
+ // console.info(VIE2.globalCache.where("?subj <http://www.semanticdesktop.org/ontologies/2007/01/19/nie#plainTextContent> ?text")[0].text.toString());
var occurrences = VIE2.globalCache.where('?s fise:selected-text ?occurrence');
var flatOccurrences = _(occurrences).map(function(oc){return oc.occurrence.value})
var uniqueOccurrences = _(flatOccurrences).uniq();
+ log(uniqueOccurrences);
_(uniqueOccurrences).each(function(occurrence){
console.info(occurrence);
@@ -127,6 +136,7 @@
createElement: 'span',
}
);
+ log('put annotation widget on dom element with "' + occurrence + '"');
$(foundEntityDomEl)
.addClass('new-enhancement')
.annotate({
@@ -141,6 +151,9 @@
});
});
+ var log = function(msg){
+ $('#log').append($('<div>' + msg + '</div>'));
+ }
</script>
</head>
@@ -150,5 +163,8 @@
<div id="content" property="foo" editable="true">
The Papal Basilica of Saint Peter (Latin: Basilica Sancti Petri), officially known in Italian as Basilica Papale di San Pietro in Vaticano and commonly known as St. Peter's Basilica, is a Late Renaissance church located within the Vatican City. St. Peter's Basilica has the largest interior of any Christian church in the world.[1] It is regarded as one of the holiest Catholic sites. It has been described as 'holding a unique position in the Christian world'[2] and as 'the greatest of all churches of Christendom'.[3]
</div>
+ <div id='log'>
+ <h2>Log</h2>
+ </div>
</body>
</html>
Please sign in to comment.
Something went wrong with that request. Please try again.