Author: szabyg
Date: Tue Apr 30 11:44:53 2013
New Revision: 1477575

URL: http://svn.apache.org/r1477575
Log:
Enabling live annotation. STANBOL-981

Modified:
    
stanbol/trunk/demos/webvie/src/main/resources/META-INF/resources/static/enhancervie/lib/annotate.js
    
stanbol/trunk/demos/webvie/src/main/resources/templates/html/org/apache/stanbol/commons/web/vie/resource/EnhancerVieRootResource/index.ftl

Modified: 
stanbol/trunk/demos/webvie/src/main/resources/META-INF/resources/static/enhancervie/lib/annotate.js
URL: 
http://svn.apache.org/viewvc/stanbol/trunk/demos/webvie/src/main/resources/META-INF/resources/static/enhancervie/lib/annotate.js?rev=1477575&r1=1477574&r2=1477575&view=diff
==============================================================================
--- 
stanbol/trunk/demos/webvie/src/main/resources/META-INF/resources/static/enhancervie/lib/annotate.js
 (original)
+++ 
stanbol/trunk/demos/webvie/src/main/resources/META-INF/resources/static/enhancervie/lib/annotate.js
 Tue Apr 30 11:44:53 2013
@@ -1,4 +1,5 @@
-// Generated by CoffeeScript 1.6.2
+// Generated by CoffeeScript 1.3.3
+
 /*   Annotate - a text enhancement interaction jQuery UI widget
 #     (c) 2011 Szaby Gruenwald, IKS Consortium
 #     Annotate may be freely distributed under the MIT license
@@ -42,6 +43,7 @@
   }
 
   EntityCache = (function() {
+
     function EntityCache(opts) {
       this.vie = opts.vie;
       this.logger = opts.logger;
@@ -49,14 +51,12 @@
 
     EntityCache.prototype._entities = function() {
       var _ref1;
-
       return (_ref1 = window.entityCache) != null ? _ref1 : window.entityCache 
= {};
     };
 
     EntityCache.prototype.get = function(uri, scope, success, error) {
       var cache,
         _this = this;
-
       uri = uri.replace(/^<|>$/g, "");
       if (this._entities()[uri] && this._entities()[uri].status === "done") {
         if (typeof success === "function") {
@@ -77,7 +77,6 @@
         }).using('stanbol').execute().success(function(entityArr) {
           return _.defer(function() {
             var cacheEntry, entity;
-
             cacheEntry = _this._entities()[uri];
             entity = _.detect(entityArr, function(e) {
               if (e.getSubject() === ("<" + uri + ">")) {
@@ -96,7 +95,6 @@
         }).fail(function(e) {
           return _.defer(function() {
             var cacheEntry;
-
             _this.logger.error("couldn't load " + uri);
             cacheEntry = _this._entities()[uri];
             cacheEntry.status = "error";
@@ -123,7 +121,6 @@
 
   uriSuffix = function(uri) {
     var res;
-
     res = uri.substring(uri.lastIndexOf("#") + 1);
     return res.substring(res.lastIndexOf("/") + 1);
   };
@@ -135,7 +132,7 @@
       vieServices: ["stanbol"],
       autoAnalyze: false,
       continuousChecking: false,
-      throttleDistance: 5000,
+      throttleDistance: 3000,
       showTooltip: true,
       debug: false,
       depictionProperties: ["foaf:depiction", "schema:thumbnail"],
@@ -145,7 +142,6 @@
           property: "skos:broader",
           makeLabel: function(propertyValueArr) {
             var labels;
-
             labels = _(propertyValueArr).map(function(termUri) {
               return termUri.replace(/<.*[\/#](.*)>/, "$1").replace(/_/g, 
"&nbsp;");
             });
@@ -155,7 +151,6 @@
           property: "dcterms:subject",
           makeLabel: function(propertyValueArr) {
             var labels;
-
             labels = _(propertyValueArr).map(function(termUri) {
               return termUri.replace(/<.*[\/#](.*)>/, "$1").replace(/_/g, 
"&nbsp;");
             });
@@ -201,7 +196,6 @@
     },
     _create: function() {
       var widget;
-
       widget = this;
       this.pendingrequests = 0;
       this.errorcollector = [];
@@ -236,12 +230,11 @@
     enable: function() {
       var checkerFn,
         _this = this;
-
       if (this.options.continuousChecking) {
         checkerFn = delayThrottle(function() {
           return _this._checkForChanges();
         }, this.options.throttleDistance);
-        $(this.element).bind('keyup', function() {
+        $(this.element).bind('keyup click', function() {
           return checkerFn();
         });
       }
@@ -249,19 +242,22 @@
     },
     _checkForChanges: function() {
       var el, hash, _i, _len, _ref1, _results;
-
       _ref1 = this._findElementsToAnalyze();
       _results = [];
       for (_i = 0, _len = _ref1.length; _i < _len; _i++) {
         el = _ref1[_i];
-        hash = this._elementHash(el);
-        if (!jQuery(el).data('hash')) {
-          console.info(el, "wasn't analized yet.");
-          this._analyze(el);
-        }
-        if (jQuery(el).data('hash') && jQuery(el).data('hash') !== hash) {
-          console.info(el, 'changed, try to get annotations for it.');
-          _results.push(this._analyze(el));
+        if (!$(el).has(window.getSelection().anchorNode).length) {
+          hash = this._elementHash(el);
+          if (!jQuery(el).data('hash')) {
+            console.info(el, "wasn't analized yet.");
+            this._analyze(el);
+          }
+          if (jQuery(el).data('hash') && jQuery(el).data('hash') !== hash) {
+            console.info(el, 'changed, try to get annotations for it.');
+            _results.push(this._analyze(el));
+          } else {
+            _results.push(void 0);
+          }
         } else {
           _results.push(void 0);
         }
@@ -277,7 +273,6 @@
     _analyze: function(el) {
       var hash, lastRequestDone,
         _this = this;
-
       hash = this._elementHash(el);
       lastRequestDone = function() {
         _this.errorcollector = _(_this.errorcollector).uniq();
@@ -292,14 +287,16 @@
         element: jQuery(el)
       
}).using(this.options.vieServices).execute().success(function(enhancements) {
         _this.pendingrequests--;
-        if (_this._elementHash(el) === hash) {
-          console.info('applying suggestions to', el, enhancements);
-          _this._applyEnhancements(el, enhancements);
-          jQuery(el).data('hash', hash);
-        } else {
-          console.info(el, 'changed in the meantime.');
+        if (!$(el).has(window.getSelection().anchorNode).length) {
+          if (_this._elementHash(el) === hash) {
+            console.info('applying suggestions to', el, enhancements);
+            _this._applyEnhancements(el, enhancements);
+            jQuery(el).data('hash', hash);
+          } else {
+            console.info(el, 'changed in the meantime.');
+          }
+          _this._trigger("success", true);
         }
-        _this._trigger("success", true);
         if (_this.pendingrequests === 0) {
           return lastRequestDone();
         }
@@ -315,10 +312,8 @@
     },
     _applyEnhancements: function(el, enhancements) {
       var _this = this;
-
       return _.defer(function() {
         var entAnn, entityAnnotations, textAnn, textAnnotations, textAnns, _i, 
_j, _len, _len1, _ref1;
-
         entityAnnotations = Stanbol.getEntityAnnotations(enhancements);
         for (_i = 0, _len = entityAnnotations.length; _i < _len; _i++) {
           entAnn = entityAnnotations[_i];
@@ -360,7 +355,6 @@
     },
     disable: function() {
       var el, _i, _len, _ref1;
-
       _ref1 = this._findElementsToAnalyze();
       for (_i = 0, _len = _ref1.length; _i < _len; _i++) {
         el = _ref1[_i];
@@ -383,14 +377,12 @@
     },
     acceptAll: function(reportCallback) {
       var report;
-
       report = {
         updated: [],
         accepted: 0
       };
       $(':IKS-annotationSelector', this.element).each(function() {
         var res;
-
         if ($(this).data().annotationSelector || 
$(this).data().IKSAnnotationSelector) {
           res = $(this).annotationSelector('acceptBestCandidate');
           if (res) {
@@ -404,10 +396,8 @@
     _listNonblockElements: function(el) {
       var isDevidable, res,
         _this = this;
-
       isDevidable = function(el) {
         var child, sum, _i, _len, _ref1;
-
         sum = "";
         _ref1 = jQuery(el).children();
         for (_i = 0, _len = _ref1.length; _i < _len; _i++) {
@@ -429,7 +419,6 @@
     _processTextEnhancement: function(textEnh, parentEl) {
       var eEnh, eEnhUri, el, options, sType, type, widget, _i, _j, _len, 
_len1, _ref1,
         _this = this;
-
       if (!textEnh.getSelectedText()) {
         this._logger.warn("textEnh", textEnh, "doesn't have selected-text!");
         return;
@@ -470,13 +459,11 @@
     },
     _filterByType: function(textAnnotations) {
       var _this = this;
-
       if (!this.options.typeFilter) {
         return textAnnotations;
       }
       return _.filter(textAnnotations, function(ta) {
         var type, _i, _len, _ref1, _ref2;
-
         if (_ref1 = _this.options.typeFilter, __indexOf.call(ta.getType(), 
_ref1) >= 0) {
           return true;
         }
@@ -491,13 +478,11 @@
     },
     _getOrCreateDomElement: function(element, text, options) {
       var domEl, len, nearest, nearestPosition, newElement, occurrences, pos, 
start, textContentOf, textToCut;
-
       if (options == null) {
         options = {};
       }
       occurrences = function(str, s) {
         var last, next, res, _results;
-
         res = [];
         last = 0;
         _results = [];
@@ -513,7 +498,6 @@
       };
       nearestPosition = function(str, s, ind) {
         var arr, d0, d1, i0, i1;
-
         arr = occurrences(str, s);
         i1 = nearest(arr, ind);
         if (arr.length === 1) {
@@ -545,7 +529,6 @@
       while (textContentOf(domEl).indexOf(text) !== -1 && domEl.nodeName !== 
'#text') {
         domEl = _(domEl.childNodes).detect(function(el) {
           var p;
-
           p = textContentOf(el).lastIndexOf(text);
           if (p >= start - pos) {
             return true;
@@ -576,7 +559,6 @@
 
   String.prototype.hashCode = function() {
     var char, hash, i;
-
     hash = 0;
     if (this.length === 0) {
       return hash;
@@ -593,7 +575,6 @@
 
   delayThrottle = function(cb, timeout) {
     var resFn, timeoutHandler;
-
     timeoutHandler = null;
     return resFn = function() {
       if (timeoutHandler) {
@@ -644,7 +625,6 @@
     },
     _create: function() {
       var _this = this;
-
       this._logger = this.options.debug ? console : {
         info: function() {},
         warn: function() {},
@@ -663,7 +643,6 @@
     _initTooltip: function() {
       var widget,
         _this = this;
-
       widget = this;
       this._logger.info("init tooltip for", this.element);
       if (this.options.showTooltip) {
@@ -679,7 +658,6 @@
           },
           content: function(response) {
             var uri;
-
             uri = _this.element.attr("resource");
             _this._logger.info("tooltip uri:", uri);
             return widget._createPreview(uri);
@@ -689,7 +667,6 @@
     },
     _createPreview: function(uri) {
       var depictionUrl, descr, html, picSize;
-
       html = "";
       picSize = 100;
       depictionUrl = this._getDepiction(this.entity, picSize);
@@ -708,13 +685,11 @@
     _loadEntity: function(callback) {
       var uri,
         _this = this;
-
       uri = this.element.attr('resource');
       return this.vie.load({
         entity: uri
       }).using("stanbol").execute().success(function(res) {
         var loadedEntity;
-
         loadedEntity = _(res).detect(function(e) {
           return e.getSubject().replace(/^<|>$/g, '') === uri;
         });
@@ -725,13 +700,11 @@
     },
     _getUserLang: function() {
       var navigatorLanguage;
-
       navigatorLanguage = window.navigator.language || 
window.navigator.userLanguage;
       return navigatorLanguage.split("-")[0];
     },
     _getDepiction: function(entity, picSize) {
       var depictionUrl, field, fieldValue, preferredFields;
-
       preferredFields = this.options.depictionProperties;
       field = _(preferredFields).detect(function(field) {
         if (entity.get(field)) {
@@ -753,14 +726,12 @@
     },
     _getLabel: function(entity) {
       var preferredFields, preferredLanguages;
-
       preferredFields = this.options.labelProperties;
       preferredLanguages = [this._getUserLang(), 
this.options.fallbackLanguage];
       return VIE.Util.getPreferredLangForPreferredProperty(entity, 
preferredFields, preferredLanguages);
     },
     _getDescription: function(entity) {
       var preferredFields, preferredLanguages;
-
       preferredFields = this.options.descriptionProperties;
       preferredLanguages = [this._getUserLang(), 
this.options.fallbackLanguage];
       return VIE.Util.getPreferredLangForPreferredProperty(entity, 
preferredFields, preferredLanguages);
@@ -805,7 +776,6 @@
     },
     _create: function() {
       var _this = this;
-
       this.enableEditing();
       this._logger = this.options.debug ? console : {
         info: function() {},
@@ -820,7 +790,6 @@
         };
         return this.options.cache.get(this.linkedEntity.uri, this, 
function(cachedEntity) {
           var navigatorLanguage, userLang;
-
           navigatorLanguage = window.navigator.language || 
window.navigator.userLanguage;
           userLang = navigatorLanguage.split("-")[0];
           return _this.linkedEntity.label = 
VIE.Util.getPreferredLangForPreferredProperty(cachedEntity, ["skos:prefLabel", 
"rdfs:label"], [userLang, "en"]);
@@ -829,7 +798,6 @@
     },
     enableEditing: function() {
       var _this = this;
-
       return this.element.click(function(e) {
         _this._logger.log("click", e, e.isDefaultPrevented());
         if (_this.dialog || !_this.dialog) {
@@ -870,7 +838,6 @@
     },
     remove: function(event) {
       var el;
-
       el = this.element.parent();
       this._logger.info("destroy tooltip");
       if (this.element.data().tooltip || this.element.data().uiTooltip) {
@@ -908,7 +875,6 @@
     },
     annotate: function(entityEnhancement, options) {
       var entityClass, entityHtml, entityType, entityUri, newElement, rel, 
sType, type, ui, _i, _len, _ref1, _ref2;
-
       entityUri = entityEnhancement.getUri();
       entityType = entityEnhancement.getTextEnhancement().getType() || "";
       entityHtml = this.element.html();
@@ -954,7 +920,6 @@
     },
     select: function(ui) {
       var e;
-
       e = new jQuery.Event("select");
       e.ui = ui;
       this._trigger('select', e, ui);
@@ -962,7 +927,6 @@
     },
     acceptBestCandidate: function() {
       var eEnhancements;
-
       eEnhancements = this._getEntityEnhancements();
       if (!eEnhancements.length) {
         return;
@@ -982,7 +946,6 @@
     },
     close: function() {
       var _ref1;
-
       if ((_ref1 = this.dialog) != null) {
         if (typeof _ref1.close === "function") {
           _ref1.close();
@@ -993,7 +956,6 @@
     _initTooltip: function() {
       var widget,
         _this = this;
-
       widget = this;
       if (this.options.showTooltip) {
         this._logger.info("init tooltip for", this.element);
@@ -1009,7 +971,6 @@
           },
           content: function(response) {
             var uri;
-
             uri = _this.element.attr("resource");
             _this._logger.info("tooltip uri:", uri);
             widget._createPreview(uri, response);
@@ -1020,7 +981,6 @@
     },
     _getEntityEnhancements: function() {
       var eEnhancements, enhancement, textEnh, _i, _j, _len, _len1, _ref1, 
_ref2, _tempUris;
-
       eEnhancements = [];
       _ref1 = this.textEnhancements;
       for (_i = 0, _len = _ref1.length; _i < _len; _i++) {
@@ -1034,7 +994,6 @@
       _tempUris = [];
       eEnhancements = _(eEnhancements).filter(function(eEnh) {
         var uri;
-
         uri = eEnh.getUri();
         if (_.indexOf(_tempUris, uri) === -1) {
           _tempUris.push(uri);
@@ -1050,7 +1009,6 @@
     _typeLabels: function(types) {
       var allKnownPrefixes, knownMapping, knownPrefixes,
         _this = this;
-
       knownMapping = this.options.getTypes();
       allKnownPrefixes = _(knownMapping).map(function(x) {
         return x.uri;
@@ -1058,7 +1016,6 @@
       knownPrefixes = _.intersection(allKnownPrefixes, types);
       return _(knownPrefixes).map(function(key) {
         var foundPrefix;
-
         foundPrefix = _(knownMapping).detect(function(x) {
           return x.uri === key;
         });
@@ -1067,7 +1024,6 @@
     },
     _sourceLabel: function(src) {
       var sourceObj, sources;
-
       if (!src) {
         this._logger.warn("No source");
       }
@@ -1087,7 +1043,6 @@
     _createDialog: function() {
       var dialogEl, label, widget,
         _this = this;
-
       label = this.element.text();
       jQuery(".annotateselector-dialog-content").dialog("destroy").remove();
       dialogEl = $("<div class='annotateselector-dialog-content'><span 
class='entity-link'></span></div>").attr("tabIndex", 
-1).addClass().keydown(function(event) {
@@ -1132,7 +1087,6 @@
     },
     _setButtons: function() {
       var _this = this;
-
       return this.dialog.element.dialog('option', 'buttons', {
         rem: {
           text: this.isAnnotated() ? 'Remove' : 'Decline',
@@ -1148,7 +1102,6 @@
     },
     _updateTitle: function() {
       var title;
-
       if (this.dialog) {
         if (this.isAnnotated()) {
           title = "" + this.linkedEntity.label + " <small>@ " + 
(this._sourceLabel(this.linkedEntity.uri)) + "</small>";
@@ -1161,7 +1114,6 @@
     _createMenu: function() {
       var selectHandler, ul, widget,
         _this = this;
-
       widget = this;
       ul = $('<ul 
class="suggestion-menu"></ul>').appendTo(this.dialog.element);
       this._renderMenu(ul, this.entityEnhancements);
@@ -1193,7 +1145,6 @@
           },
           content: function(response) {
             var uri;
-
             uri = jQuery(this).attr("entityuri");
             widget._createPreview(uri, response);
             return "loading...";
@@ -1205,10 +1156,8 @@
     _createPreview: function(uri, response) {
       var fail, success,
         _this = this;
-
       success = function(cacheEntity) {
         var depictionUrl, descr, html, picSize;
-
         html = "";
         picSize = 100;
         depictionUrl = _this._getDepiction(cacheEntity, picSize);
@@ -1235,13 +1184,11 @@
     },
     _getUserLang: function() {
       var navigatorLanguage;
-
       navigatorLanguage = window.navigator.language || 
window.navigator.userLanguage;
       return navigatorLanguage.split("-")[0];
     },
     _getDepiction: function(entity, picSize) {
       var depictionUrl, field, fieldValue, preferredFields;
-
       preferredFields = this.options.depictionProperties;
       field = _(preferredFields).detect(function(field) {
         if (entity.get(field)) {
@@ -1263,21 +1210,18 @@
     },
     _getLabel: function(entity) {
       var preferredFields, preferredLanguages;
-
       preferredFields = this.options.labelProperties;
       preferredLanguages = [this._getUserLang(), 
this.options.fallbackLanguage];
       return VIE.Util.getPreferredLangForPreferredProperty(entity, 
preferredFields, preferredLanguages);
     },
     _getDescription: function(entity) {
       var preferredFields, preferredLanguages;
-
       preferredFields = this.options.descriptionProperties;
       preferredLanguages = [this._getUserLang(), 
this.options.fallbackLanguage];
       return VIE.Util.getPreferredLangForPreferredProperty(entity, 
preferredFields, preferredLanguages);
     },
     _renderMenu: function(ul, entityEnhancements) {
       var enhancement, _i, _len;
-
       entityEnhancements = _(entityEnhancements).sortBy(function(ee) {
         return -1 * ee.getConfidence();
       });
@@ -1289,7 +1233,6 @@
     },
     _renderItem: function(ul, eEnhancement) {
       var active, item, label, source, type;
-
       label = eEnhancement.getLabel().replace(/^\"|\"$/g, "");
       type = this._typeLabels(eEnhancement.getTypes()).toString() || "Other";
       source = this._sourceLabel(eEnhancement.getUri());
@@ -1299,7 +1242,6 @@
     _createSearchbox: function() {
       var sugg, widget,
         _this = this;
-
       this.searchEntryField = $('<span style="background: fff;"><label 
for="search">Search:</label> <input id="search" 
class="search"></span>').appendTo(this.dialog.element);
       sugg = this.textEnhancements[0];
       widget = this;
@@ -1308,7 +1250,6 @@
         urifield: jQuery("#urifield"),
         select: function(e, ui) {
           var item;
-
           item = ui.item;
           item.getUri = function() {
             return this.key;
@@ -1334,7 +1275,6 @@
       if (!this.entityEnhancements.length && !this.isAnnotated()) {
         setTimeout(function() {
           var label;
-
           label = _this.element.html();
           _this.searchbox.val(label);
           return _this.searchbox.autocomplete("search", label);
@@ -1351,7 +1291,6 @@
     },
     _cloneCopyEvent1_6: function(src, dest) {
       var curData, events, i, internalKey, l, oldData, type;
-
       if (dest.nodeType !== 1 || !jQuery.hasData(src)) {
         return;
       }
@@ -1378,7 +1317,6 @@
     },
     _cloneCopyEvent1_7: function(src, dest) {
       var curData, events, i, l, oldData, type;
-
       if (dest.nodeType !== 1 || !jQuery.hasData(src)) {
         return;
       }
@@ -1418,13 +1356,11 @@
 
   Stanbol.getTextAnnotations = function(enhList) {
     var res;
-
     res = _(enhList).filter(function(e) {
       return e.isof("<" + ns.enhancer + "TextAnnotation>");
     });
     res = _(res).sortBy(function(e) {
       var conf;
-
       if (e.get("enhancer:confidence")) {
         conf = Number(e.get("enhancer:confidence"));
       }
@@ -1442,6 +1378,7 @@
   };
 
   Stanbol.TextEnhancement = (function() {
+
     function TextEnhancement(enhancement, enhList) {
       this._enhancement = enhancement;
       this._enhList = enhList;
@@ -1450,7 +1387,6 @@
 
     TextEnhancement.prototype.getSelectedText = function() {
       var res;
-
       res = this._vals("enhancer:selected-text");
       if (typeof res === "string") {
         return res;
@@ -1467,7 +1403,6 @@
     TextEnhancement.prototype.getEntityEnhancements = function() {
       var rawList,
         _this = this;
-
       rawList = this._enhancement.get("entityAnnotation");
       if (!rawList) {
         return [];
@@ -1496,7 +1431,6 @@
 
     TextEnhancement.prototype.getOrigText = function() {
       var ciUri;
-
       ciUri = this._vals("enhancer:extracted-from");
       return 
this._enhList[ciUri]["http://www.semanticdesktop.org/ontologies/2007/01/19/nie#plainTextContent"][0].value;
     };
@@ -1507,7 +1441,6 @@
 
     TextEnhancement.prototype._uriTrim = function(uriRef) {
       var bbColl, mod;
-
       if (!uriRef) {
         return [];
       }
@@ -1515,7 +1448,6 @@
         bbColl = uriRef;
         return (function() {
           var _i, _len, _ref1, _results;
-
           _ref1 = bbColl.models;
           _results = [];
           for (_i = 0, _len = _ref1.length; _i < _len; _i++) {
@@ -1537,10 +1469,12 @@
   })();
 
   Stanbol.EntityEnhancement = (function() {
+
     function EntityEnhancement(ee, textEnh) {
       this._enhancement = ee;
       this._textEnhancement = textEnh;
       this;
+
     }
 
     EntityEnhancement.prototype.getLabel = function() {
@@ -1565,7 +1499,6 @@
 
     EntityEnhancement.prototype._vals = function(key) {
       var res;
-
       res = this._enhancement.get(key);
       if (!res) {
         return [];
@@ -1579,7 +1512,6 @@
 
     EntityEnhancement.prototype._uriTrim = function(uriRef) {
       var bbColl, mod;
-
       if (!uriRef) {
         return [];
       }
@@ -1587,7 +1519,6 @@
         bbColl = uriRef;
         return (function() {
           var _i, _len, _ref1, _results;
-
           _ref1 = bbColl.models;
           _results = [];
           for (_i = 0, _len = _ref1.length; _i < _len; _i++) {
@@ -1631,7 +1562,6 @@
           property: "skos:broader",
           makeLabel: function(propertyValueArr) {
             var labels;
-
             labels = _(propertyValueArr).map(function(termUri) {
               return termUri.replace(/<.*[\/#](.*)>/, "$1").replace(/_/g, 
"&nbsp;");
             });
@@ -1641,7 +1571,6 @@
           property: "dcterms:subject",
           makeLabel: function(propertyValueArr) {
             var labels;
-
             labels = _(propertyValueArr).map(function(termUri) {
               return termUri.replace(/<.*[\/#](.*)>/, "$1").replace(/_/g, 
"&nbsp;");
             });
@@ -1683,7 +1612,6 @@
       source: function(req, resp) {
         var getSuccessCallback, listOfResultLists, mergedEntityList, 
properties, term, waitingfor,
           _this = this;
-
         this._logger.info("req:", req);
         properties = _.flatten([this.options.labelProperties, 
this.options.descriptionProperties, this.options.depictionProperties]);
         properties = _(properties).map(function(prop) {
@@ -1700,7 +1628,6 @@
           return function(entityList) {
             return _.defer(function() {
               var limit, res;
-
               waitingfor--;
               _this._logger.info(term, priority, "resp:", entityList);
               limit = 10;
@@ -1716,10 +1643,8 @@
                 console.info("listOfResultLists", listOfResultLists);
                 _.chain(listOfResultLists).compact().each(function(resultList) 
{
                   var sortedList;
-
                   sortedList = _(resultList).sortBy(function(e) {
                     var s;
-
                     s = 
e.get('<http://stanbol.apache.org/ontology/entityhub/query#score>');
                     if (typeof s === "object") {
                       s = _.max(s);
@@ -1729,10 +1654,10 @@
                   return mergedEntityList = 
mergedEntityList.concat(sortedList);
                 });
                 /*
-                @_logger.info _(mergedEntityList).map (e) ->
-                  uri = e.getSubject()
-                  s = e.get 
'<http://stanbol.apache.org/ontology/entityhub/query#score>'
-                  return "#{uri}: #{s}"
+                                  @_logger.info _(mergedEntityList).map (e) ->
+                                    uri = e.getSubject()
+                                    s = e.get 
'<http://stanbol.apache.org/ontology/entityhub/query#score>'
+                                    return "#{uri}: #{s}"
                 */
 
                 _this._logger.info(mergedEntityList);
@@ -1802,7 +1727,6 @@
     _instantiateAutocomplete: function() {
       var widget,
         _this = this;
-
       widget = this;
       return this.element.autocomplete({
         source: function(req, resp) {
@@ -1811,13 +1735,11 @@
         open: function(e, ui) {
           var uiMenu, _ref1,
             _this = this;
-
           widget._logger.info("autocomplete.open", e, ui);
           if (widget.options.showTooltip) {
             uiMenu = ((_ref1 = $(this).data().autocomplete) != null ? 
_ref1.menu : void 0) || $(this).data().uiAutocomplete.menu;
             $('.ui-menu-item', uiMenu.activeMenu).each(function() {
               var item, uri;
-
               item = $(this).data()["item.autocomplete"] || 
$(this).data()["uiAutocompleteItem"] || $(this).data()["ui-autocomplete-item"];
               uri = item.getUri();
               return $(this).entitypreview({
@@ -1842,7 +1764,6 @@
         },
         select: function(e, ui) {
           var uiMenu, _ref1;
-
           uiMenu = ((_ref1 = $(e.target).data().autocomplete) != null ? 
_ref1.menu : void 0) || $(e.target).data().uiAutocomplete.menu;
           $('.ui-menu-item', uiMenu.activeMenu).each(function() {
             return $(this).entitypreview('destroy');
@@ -1864,14 +1785,12 @@
     },
     _getLabel: function(entity) {
       var preferredFields, preferredLanguages;
-
       preferredFields = this.options.labelProperties;
       preferredLanguages = [this._getUserLang(), 
this.options.fallbackLanguage];
       return VIE.Util.getPreferredLangForPreferredProperty(entity, 
preferredFields, preferredLanguages);
     },
     _sourceLabel: function(src) {
       var sourceObj, sources;
-
       if (!src) {
         this._logger.warn("No source");
       }

Modified: 
stanbol/trunk/demos/webvie/src/main/resources/templates/html/org/apache/stanbol/commons/web/vie/resource/EnhancerVieRootResource/index.ftl
URL: 
http://svn.apache.org/viewvc/stanbol/trunk/demos/webvie/src/main/resources/templates/html/org/apache/stanbol/commons/web/vie/resource/EnhancerVieRootResource/index.ftl?rev=1477575&r1=1477574&r2=1477575&view=diff
==============================================================================
--- 
stanbol/trunk/demos/webvie/src/main/resources/templates/html/org/apache/stanbol/commons/web/vie/resource/EnhancerVieRootResource/index.ftl
 (original)
+++ 
stanbol/trunk/demos/webvie/src/main/resources/templates/html/org/apache/stanbol/commons/web/vie/resource/EnhancerVieRootResource/index.ftl
 Tue Apr 30 11:44:53 2013
@@ -123,6 +123,7 @@ article {
                 vie: z,
                 // typeFilter: ["http://dbpedia.org/ontology/Place";, 
"http://dbpedia.org/ontology/Organisation";, 
"http://dbpedia.org/ontology/Person";],
                 debug: true,
+                continuousChecking: true,
                 //autoAnalyze: true,
                 showTooltip: true,
                 decline: function (event, ui) {


Reply via email to