Modified: stanbol/trunk/demos/webvie/src/main/resources/META-INF/resources/static/enhancervie/lib/backbone-min.js URL: http://svn.apache.org/viewvc/stanbol/trunk/demos/webvie/src/main/resources/META-INF/resources/static/enhancervie/lib/backbone-min.js?rev=1467253&r1=1467252&r2=1467253&view=diff ============================================================================== --- stanbol/trunk/demos/webvie/src/main/resources/META-INF/resources/static/enhancervie/lib/backbone-min.js (original) +++ stanbol/trunk/demos/webvie/src/main/resources/META-INF/resources/static/enhancervie/lib/backbone-min.js Fri Apr 12 12:40:44 2013 @@ -1,27 +1,33 @@ -// Backbone.js 0.3.3 +// Backbone.js 0.5.3 // (c) 2010 Jeremy Ashkenas, DocumentCloud Inc. // Backbone may be freely distributed under the MIT license. // For all details and documentation: // http://documentcloud.github.com/backbone -(function(){var e;e=typeof exports!=="undefined"?exports:this.Backbone={};e.VERSION="0.3.3";var f=this._;if(!f&&typeof require!=="undefined")f=require("underscore")._;var h=this.jQuery||this.Zepto;e.emulateHTTP=false;e.emulateJSON=false;e.Events={bind:function(a,b){this._callbacks||(this._callbacks={});(this._callbacks[a]||(this._callbacks[a]=[])).push(b);return this},unbind:function(a,b){var c;if(a){if(c=this._callbacks)if(b){c=c[a];if(!c)return this;for(var d=0,g=c.length;d<g;d++)if(b===c[d]){c.splice(d, -1);break}}else c[a]=[]}else this._callbacks={};return this},trigger:function(a){var b,c,d,g;if(!(c=this._callbacks))return this;if(b=c[a]){d=0;for(g=b.length;d<g;d++)b[d].apply(this,Array.prototype.slice.call(arguments,1))}if(b=c.all){d=0;for(g=b.length;d<g;d++)b[d].apply(this,arguments)}return this}};e.Model=function(a,b){a||(a={});if(this.defaults)a=f.extend({},this.defaults,a);this.attributes={};this._escapedAttributes={};this.cid=f.uniqueId("c");this.set(a,{silent:true});this._previousAttributes= -f.clone(this.attributes);if(b&&b.collection)this.collection=b.collection;this.initialize(a,b)};f.extend(e.Model.prototype,e.Events,{_previousAttributes:null,_changed:false,initialize:function(){},toJSON:function(){return f.clone(this.attributes)},get:function(a){return this.attributes[a]},escape:function(a){var b;if(b=this._escapedAttributes[a])return b;b=this.attributes[a];return this._escapedAttributes[a]=(b==null?"":b).replace(/&(?!\w+;)/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g, -""")},set:function(a,b){b||(b={});if(!a)return this;if(a.attributes)a=a.attributes;var c=this.attributes,d=this._escapedAttributes;if(!b.silent&&this.validate&&!this._performValidation(a,b))return false;if("id"in a)this.id=a.id;for(var g in a){var i=a[g];if(!f.isEqual(c[g],i)){c[g]=i;delete d[g];if(!b.silent){this._changed=true;this.trigger("change:"+g,this,i,b)}}}!b.silent&&this._changed&&this.change(b);return this},unset:function(a,b){b||(b={});var c={};c[a]=void 0;if(!b.silent&&this.validate&& -!this._performValidation(c,b))return false;delete this.attributes[a];delete this._escapedAttributes[a];if(!b.silent){this._changed=true;this.trigger("change:"+a,this,void 0,b);this.change(b)}return this},clear:function(a){a||(a={});var b=this.attributes,c={};for(attr in b)c[attr]=void 0;if(!a.silent&&this.validate&&!this._performValidation(c,a))return false;this.attributes={};this._escapedAttributes={};if(!a.silent){this._changed=true;for(attr in b)this.trigger("change:"+attr,this,void 0,a);this.change(a)}return this}, -fetch:function(a){a||(a={});var b=this,c=j(a.error,b,a);(this.sync||e.sync)("read",this,function(d){if(!b.set(b.parse(d),a))return false;a.success&&a.success(b,d)},c);return this},save:function(a,b){b||(b={});if(a&&!this.set(a,b))return false;var c=this,d=j(b.error,c,b),g=this.isNew()?"create":"update";(this.sync||e.sync)(g,this,function(i){if(!c.set(c.parse(i),b))return false;b.success&&b.success(c,i)},d);return this},destroy:function(a){a||(a={});var b=this,c=j(a.error,b,a);(this.sync||e.sync)("delete", -this,function(d){b.collection&&b.collection.remove(b);a.success&&a.success(b,d)},c);return this},url:function(){var a=k(this.collection);if(this.isNew())return a;return a+(a.charAt(a.length-1)=="/"?"":"/")+this.id},parse:function(a){return a},clone:function(){return new this.constructor(this)},isNew:function(){return!this.id},change:function(a){this.trigger("change",this,a);this._previousAttributes=f.clone(this.attributes);this._changed=false},hasChanged:function(a){if(a)return this._previousAttributes[a]!= -this.attributes[a];return this._changed},changedAttributes:function(a){a||(a=this.attributes);var b=this._previousAttributes,c=false,d;for(d in a)if(!f.isEqual(b[d],a[d])){c=c||{};c[d]=a[d]}return c},previous:function(a){if(!a||!this._previousAttributes)return null;return this._previousAttributes[a]},previousAttributes:function(){return f.clone(this._previousAttributes)},_performValidation:function(a,b){var c=this.validate(a);if(c){b.error?b.error(this,c):this.trigger("error",this,c,b);return false}return true}}); -e.Collection=function(a,b){b||(b={});if(b.comparator){this.comparator=b.comparator;delete b.comparator}this._boundOnModelEvent=f.bind(this._onModelEvent,this);this._reset();a&&this.refresh(a,{silent:true});this.initialize(a,b)};f.extend(e.Collection.prototype,e.Events,{model:e.Model,initialize:function(){},toJSON:function(){return this.map(function(a){return a.toJSON()})},add:function(a,b){if(f.isArray(a))for(var c=0,d=a.length;c<d;c++)this._add(a[c],b);else this._add(a,b);return this},remove:function(a, -b){if(f.isArray(a))for(var c=0,d=a.length;c<d;c++)this._remove(a[c],b);else this._remove(a,b);return this},get:function(a){if(a==null)return null;return this._byId[a.id!=null?a.id:a]},getByCid:function(a){return a&&this._byCid[a.cid||a]},at:function(a){return this.models[a]},sort:function(a){a||(a={});if(!this.comparator)throw Error("Cannot sort a set without a comparator");this.models=this.sortBy(this.comparator);a.silent||this.trigger("refresh",this,a);return this},pluck:function(a){return f.map(this.models, -function(b){return b.get(a)})},refresh:function(a,b){a||(a=[]);b||(b={});this._reset();this.add(a,{silent:true});b.silent||this.trigger("refresh",this,b);return this},fetch:function(a){a||(a={});var b=this,c=j(a.error,b,a);(this.sync||e.sync)("read",this,function(d){b.refresh(b.parse(d));a.success&&a.success(b,d)},c);return this},create:function(a,b){var c=this;b||(b={});if(a instanceof e.Model)a.collection=c;else a=new this.model(a,{collection:c});return a.save(null,{success:function(d,g){c.add(d); -b.success&&b.success(d,g)},error:b.error})},parse:function(a){return a},chain:function(){return f(this.models).chain()},_reset:function(){this.length=0;this.models=[];this._byId={};this._byCid={}},_add:function(a,b){b||(b={});a instanceof e.Model||(a=new this.model(a,{collection:this}));var c=this.getByCid(a);if(c)throw Error(["Can't add the same model to a set twice",c.id]);this._byId[a.id]=a;this._byCid[a.cid]=a;a.collection=this;this.models.splice(this.comparator?this.sortedIndex(a,this.comparator): -this.length,0,a);a.bind("all",this._boundOnModelEvent);this.length++;b.silent||a.trigger("add",a,this,b);return a},_remove:function(a,b){b||(b={});a=this.getByCid(a)||this.get(a);if(!a)return null;delete this._byId[a.id];delete this._byCid[a.cid];delete a.collection;this.models.splice(this.indexOf(a),1);this.length--;b.silent||a.trigger("remove",a,this,b);a.unbind("all",this._boundOnModelEvent);return a},_onModelEvent:function(a,b){if(a==="change:id"){delete this._byId[b.previous("id")];this._byId[b.id]= -b}this.trigger.apply(this,arguments)}});f.each(["forEach","each","map","reduce","reduceRight","find","detect","filter","select","reject","every","all","some","any","include","invoke","max","min","sortBy","sortedIndex","toArray","size","first","rest","last","without","indexOf","lastIndexOf","isEmpty"],function(a){e.Collection.prototype[a]=function(){return f[a].apply(f,[this.models].concat(f.toArray(arguments)))}});e.Controller=function(a){a||(a={});if(a.routes)this.routes=a.routes;this._bindRoutes(); -this.initialize(a)};var o=/:([\w\d]+)/g,p=/\*([\w\d]+)/g;f.extend(e.Controller.prototype,e.Events,{initialize:function(){},route:function(a,b,c){e.history||(e.history=new e.History);f.isRegExp(a)||(a=this._routeToRegExp(a));e.history.route(a,f.bind(function(d){d=this._extractParameters(a,d);c.apply(this,d);this.trigger.apply(this,["route:"+b].concat(d))},this))},saveLocation:function(a){e.history.saveLocation(a)},_bindRoutes:function(){if(this.routes)for(var a in this.routes){var b=this.routes[a]; -this.route(a,b,this[b])}},_routeToRegExp:function(a){a=a.replace(o,"([^/]*)").replace(p,"(.*?)");return RegExp("^"+a+"$")},_extractParameters:function(a,b){return a.exec(b).slice(1)}});e.History=function(){this.handlers=[];this.fragment=this.getFragment();f.bindAll(this,"checkUrl")};var l=/^#*/;f.extend(e.History.prototype,{interval:50,getFragment:function(a){return(a||window.location).hash.replace(l,"")},start:function(){var a=document.documentMode;if(a=h.browser.msie&&(!a||a<=7))this.iframe=h('<iframe src="javascript:0" tabindex="-1" />').hide().appendTo("body")[0].contentWindow; -"onhashchange"in window&&!a?h(window).bind("hashchange",this.checkUrl):setInterval(this.checkUrl,this.interval);return this.loadUrl()},route:function(a,b){this.handlers.push({route:a,callback:b})},checkUrl:function(){var a=this.getFragment();if(a==this.fragment&&this.iframe)a=this.getFragment(this.iframe.location);if(a==this.fragment||a==decodeURIComponent(this.fragment))return false;if(this.iframe)window.location.hash=this.iframe.location.hash=a;this.loadUrl()},loadUrl:function(){var a=this.fragment= -this.getFragment();return f.any(this.handlers,function(b){if(b.route.test(a)){b.callback(a);return true}})},saveLocation:function(a){a=(a||"").replace(l,"");if(this.fragment!=a){window.location.hash=this.fragment=a;if(this.iframe&&a!=this.getFragment(this.iframe.location)){this.iframe.document.open().close();this.iframe.location.hash=a}}}});e.View=function(a){this._configure(a||{});this._ensureElement();this.delegateEvents();this.initialize(a)};var q=/^(\w+)\s*(.*)$/;f.extend(e.View.prototype,e.Events, -{tagName:"div",$:function(a){return h(a,this.el)},initialize:function(){},render:function(){return this},remove:function(){h(this.el).remove();return this},make:function(a,b,c){a=document.createElement(a);b&&h(a).attr(b);c&&h(a).html(c);return a},delegateEvents:function(a){if(a||(a=this.events)){h(this.el).unbind();for(var b in a){var c=a[b],d=b.match(q),g=d[1];d=d[2];c=f.bind(this[c],this);d===""?h(this.el).bind(g,c):h(this.el).delegate(d,g,c)}}},_configure:function(a){if(this.options)a=f.extend({}, -this.options,a);if(a.model)this.model=a.model;if(a.collection)this.collection=a.collection;if(a.el)this.el=a.el;if(a.id)this.id=a.id;if(a.className)this.className=a.className;if(a.tagName)this.tagName=a.tagName;this.options=a},_ensureElement:function(){if(!this.el){var a={};if(this.id)a.id=this.id;if(this.className)a["class"]=this.className;this.el=this.make(this.tagName,a)}}});var m=function(a,b){var c=r(this,a,b);c.extend=m;return c};e.Model.extend=e.Collection.extend=e.Controller.extend=e.View.extend= -m;var s={create:"POST",update:"PUT","delete":"DELETE",read:"GET"};e.sync=function(a,b,c,d){var g=s[a];a=a==="create"||a==="update"?JSON.stringify(b.toJSON()):null;b={url:k(b),type:g,contentType:"application/json",data:a,dataType:"json",processData:false,success:c,error:d};if(e.emulateJSON){b.contentType="application/x-www-form-urlencoded";b.processData=true;b.data=a?{model:a}:{}}if(e.emulateHTTP)if(g==="PUT"||g==="DELETE"){if(e.emulateJSON)b.data._method=g;b.type="POST";b.beforeSend=function(i){i.setRequestHeader("X-HTTP-Method-Override", -g)}}h.ajax(b)};var n=function(){},r=function(a,b,c){var d;d=b&&b.hasOwnProperty("constructor")?b.constructor:function(){return a.apply(this,arguments)};n.prototype=a.prototype;d.prototype=new n;b&&f.extend(d.prototype,b);c&&f.extend(d,c);d.prototype.constructor=d;d.__super__=a.prototype;return d},k=function(a){if(!(a&&a.url))throw Error("A 'url' property or function must be specified");return f.isFunction(a.url)?a.url():a.url},j=function(a,b,c){return function(d){a?a(b,d):b.trigger("error",b,d,c)}}})(); +(function(){var h=this,p=h.Backbone,e;e=typeof exports!=="undefined"?exports:h.Backbone={};e.VERSION="0.5.3";var f=h._;if(!f&&typeof require!=="undefined")f=require("underscore")._;var g=h.jQuery||h.Zepto;e.noConflict=function(){h.Backbone=p;return this};e.emulateHTTP=!1;e.emulateJSON=!1;e.Events={bind:function(a,b,c){var d=this._callbacks||(this._callbacks={});(d[a]||(d[a]=[])).push([b,c]);return this},unbind:function(a,b){var c;if(a){if(c=this._callbacks)if(b){c=c[a];if(!c)return this;for(var d= +0,e=c.length;d<e;d++)if(c[d]&&b===c[d][0]){c[d]=null;break}}else c[a]=[]}else this._callbacks={};return this},trigger:function(a){var b,c,d,e,f=2;if(!(c=this._callbacks))return this;for(;f--;)if(b=f?a:"all",b=c[b])for(var g=0,h=b.length;g<h;g++)(d=b[g])?(e=f?Array.prototype.slice.call(arguments,1):arguments,d[0].apply(d[1]||this,e)):(b.splice(g,1),g--,h--);return this}};e.Model=function(a,b){var c;a||(a={});if(c=this.defaults)f.isFunction(c)&&(c=c.call(this)),a=f.extend({},c,a);this.attributes={}; +this._escapedAttributes={};this.cid=f.uniqueId("c");this.set(a,{silent:!0});this._changed=!1;this._previousAttributes=f.clone(this.attributes);if(b&&b.collection)this.collection=b.collection;this.initialize(a,b)};f.extend(e.Model.prototype,e.Events,{_previousAttributes:null,_changed:!1,idAttribute:"id",initialize:function(){},toJSON:function(){return f.clone(this.attributes)},get:function(a){return this.attributes[a]},escape:function(a){var b;if(b=this._escapedAttributes[a])return b;b=this.attributes[a]; +return this._escapedAttributes[a]=(b==null?"":""+b).replace(/&(?!\w+;|#\d+;|#x[\da-f]+;)/gi,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'").replace(/\//g,"/")},has:function(a){return this.attributes[a]!=null},set:function(a,b){b||(b={});if(!a)return this;if(a.attributes)a=a.attributes;var c=this.attributes,d=this._escapedAttributes;if(!b.silent&&this.validate&&!this._performValidation(a,b))return!1;if(this.idAttribute in a)this.id=a[this.idAttribute]; +var e=this._changing;this._changing=!0;for(var g in a){var h=a[g];if(!f.isEqual(c[g],h))c[g]=h,delete d[g],this._changed=!0,b.silent||this.trigger("change:"+g,this,h,b)}!e&&!b.silent&&this._changed&&this.change(b);this._changing=!1;return this},unset:function(a,b){if(!(a in this.attributes))return this;b||(b={});var c={};c[a]=void 0;if(!b.silent&&this.validate&&!this._performValidation(c,b))return!1;delete this.attributes[a];delete this._escapedAttributes[a];a==this.idAttribute&&delete this.id;this._changed= +!0;b.silent||(this.trigger("change:"+a,this,void 0,b),this.change(b));return this},clear:function(a){a||(a={});var b,c=this.attributes,d={};for(b in c)d[b]=void 0;if(!a.silent&&this.validate&&!this._performValidation(d,a))return!1;this.attributes={};this._escapedAttributes={};this._changed=!0;if(!a.silent){for(b in c)this.trigger("change:"+b,this,void 0,a);this.change(a)}return this},fetch:function(a){a||(a={});var b=this,c=a.success;a.success=function(d,e,f){if(!b.set(b.parse(d,f),a))return!1;c&& +c(b,d)};a.error=i(a.error,b,a);return(this.sync||e.sync).call(this,"read",this,a)},save:function(a,b){b||(b={});if(a&&!this.set(a,b))return!1;var c=this,d=b.success;b.success=function(a,e,f){if(!c.set(c.parse(a,f),b))return!1;d&&d(c,a,f)};b.error=i(b.error,c,b);var f=this.isNew()?"create":"update";return(this.sync||e.sync).call(this,f,this,b)},destroy:function(a){a||(a={});if(this.isNew())return this.trigger("destroy",this,this.collection,a);var b=this,c=a.success;a.success=function(d){b.trigger("destroy", +b,b.collection,a);c&&c(b,d)};a.error=i(a.error,b,a);return(this.sync||e.sync).call(this,"delete",this,a)},url:function(){var a=k(this.collection)||this.urlRoot||l();if(this.isNew())return a;return a+(a.charAt(a.length-1)=="/"?"":"/")+encodeURIComponent(this.id)},parse:function(a){return a},clone:function(){return new this.constructor(this)},isNew:function(){return this.id==null},change:function(a){this.trigger("change",this,a);this._previousAttributes=f.clone(this.attributes);this._changed=!1},hasChanged:function(a){if(a)return this._previousAttributes[a]!= +this.attributes[a];return this._changed},changedAttributes:function(a){a||(a=this.attributes);var b=this._previousAttributes,c=!1,d;for(d in a)f.isEqual(b[d],a[d])||(c=c||{},c[d]=a[d]);return c},previous:function(a){if(!a||!this._previousAttributes)return null;return this._previousAttributes[a]},previousAttributes:function(){return f.clone(this._previousAttributes)},_performValidation:function(a,b){var c=this.validate(a);if(c)return b.error?b.error(this,c,b):this.trigger("error",this,c,b),!1;return!0}}); +e.Collection=function(a,b){b||(b={});if(b.comparator)this.comparator=b.comparator;f.bindAll(this,"_onModelEvent","_removeReference");this._reset();a&&this.reset(a,{silent:!0});this.initialize.apply(this,arguments)};f.extend(e.Collection.prototype,e.Events,{model:e.Model,initialize:function(){},toJSON:function(){return this.map(function(a){return a.toJSON()})},add:function(a,b){if(f.isArray(a))for(var c=0,d=a.length;c<d;c++)this._add(a[c],b);else this._add(a,b);return this},remove:function(a,b){if(f.isArray(a))for(var c= +0,d=a.length;c<d;c++)this._remove(a[c],b);else this._remove(a,b);return this},get:function(a){if(a==null)return null;return this._byId[a.id!=null?a.id:a]},getByCid:function(a){return a&&this._byCid[a.cid||a]},at:function(a){return this.models[a]},sort:function(a){a||(a={});if(!this.comparator)throw Error("Cannot sort a set without a comparator");this.models=this.sortBy(this.comparator);a.silent||this.trigger("reset",this,a);return this},pluck:function(a){return f.map(this.models,function(b){return b.get(a)})}, +reset:function(a,b){a||(a=[]);b||(b={});this.each(this._removeReference);this._reset();this.add(a,{silent:!0});b.silent||this.trigger("reset",this,b);return this},fetch:function(a){a||(a={});var b=this,c=a.success;a.success=function(d,f,e){b[a.add?"add":"reset"](b.parse(d,e),a);c&&c(b,d)};a.error=i(a.error,b,a);return(this.sync||e.sync).call(this,"read",this,a)},create:function(a,b){var c=this;b||(b={});a=this._prepareModel(a,b);if(!a)return!1;var d=b.success;b.success=function(a,e,f){c.add(a,b); +d&&d(a,e,f)};a.save(null,b);return a},parse:function(a){return a},chain:function(){return f(this.models).chain()},_reset:function(){this.length=0;this.models=[];this._byId={};this._byCid={}},_prepareModel:function(a,b){if(a instanceof e.Model){if(!a.collection)a.collection=this}else{var c=a;a=new this.model(c,{collection:this});a.validate&&!a._performValidation(c,b)&&(a=!1)}return a},_add:function(a,b){b||(b={});a=this._prepareModel(a,b);if(!a)return!1;var c=this.getByCid(a);if(c)throw Error(["Can't add the same model to a set twice", +c.id]);this._byId[a.id]=a;this._byCid[a.cid]=a;this.models.splice(b.at!=null?b.at:this.comparator?this.sortedIndex(a,this.comparator):this.length,0,a);a.bind("all",this._onModelEvent);this.length++;b.silent||a.trigger("add",a,this,b);return a},_remove:function(a,b){b||(b={});a=this.getByCid(a)||this.get(a);if(!a)return null;delete this._byId[a.id];delete this._byCid[a.cid];this.models.splice(this.indexOf(a),1);this.length--;b.silent||a.trigger("remove",a,this,b);this._removeReference(a);return a}, +_removeReference:function(a){this==a.collection&&delete a.collection;a.unbind("all",this._onModelEvent)},_onModelEvent:function(a,b,c,d){(a=="add"||a=="remove")&&c!=this||(a=="destroy"&&this._remove(b,d),b&&a==="change:"+b.idAttribute&&(delete this._byId[b.previous(b.idAttribute)],this._byId[b.id]=b),this.trigger.apply(this,arguments))}});f.each(["forEach","each","map","reduce","reduceRight","find","detect","filter","select","reject","every","all","some","any","include","contains","invoke","max", +"min","sortBy","sortedIndex","toArray","size","first","rest","last","without","indexOf","lastIndexOf","isEmpty","groupBy"],function(a){e.Collection.prototype[a]=function(){return f[a].apply(f,[this.models].concat(f.toArray(arguments)))}});e.Router=function(a){a||(a={});if(a.routes)this.routes=a.routes;this._bindRoutes();this.initialize.apply(this,arguments)};var q=/:([\w\d]+)/g,r=/\*([\w\d]+)/g,s=/[-[\]{}()+?.,\\^$|#\s]/g;f.extend(e.Router.prototype,e.Events,{initialize:function(){},route:function(a, +b,c){e.history||(e.history=new e.History);f.isRegExp(a)||(a=this._routeToRegExp(a));e.history.route(a,f.bind(function(d){d=this._extractParameters(a,d);c.apply(this,d);this.trigger.apply(this,["route:"+b].concat(d))},this))},navigate:function(a,b){e.history.navigate(a,b)},_bindRoutes:function(){if(this.routes){var a=[],b;for(b in this.routes)a.unshift([b,this.routes[b]]);b=0;for(var c=a.length;b<c;b++)this.route(a[b][0],a[b][1],this[a[b][1]])}},_routeToRegExp:function(a){a=a.replace(s,"\\$&").replace(q, +"([^/]*)").replace(r,"(.*?)");return RegExp("^"+a+"$")},_extractParameters:function(a,b){return a.exec(b).slice(1)}});e.History=function(){this.handlers=[];f.bindAll(this,"checkUrl")};var j=/^#*/,t=/msie [\w.]+/,m=!1;f.extend(e.History.prototype,{interval:50,getFragment:function(a,b){if(a==null)if(this._hasPushState||b){a=window.location.pathname;var c=window.location.search;c&&(a+=c);a.indexOf(this.options.root)==0&&(a=a.substr(this.options.root.length))}else a=window.location.hash;return decodeURIComponent(a.replace(j, +""))},start:function(a){if(m)throw Error("Backbone.history has already been started");this.options=f.extend({},{root:"/"},this.options,a);this._wantsPushState=!!this.options.pushState;this._hasPushState=!(!this.options.pushState||!window.history||!window.history.pushState);a=this.getFragment();var b=document.documentMode;if(b=t.exec(navigator.userAgent.toLowerCase())&&(!b||b<=7))this.iframe=g('<iframe src="javascript:0" tabindex="-1" />').hide().appendTo("body")[0].contentWindow,this.navigate(a); +this._hasPushState?g(window).bind("popstate",this.checkUrl):"onhashchange"in window&&!b?g(window).bind("hashchange",this.checkUrl):setInterval(this.checkUrl,this.interval);this.fragment=a;m=!0;a=window.location;b=a.pathname==this.options.root;if(this._wantsPushState&&!this._hasPushState&&!b)return this.fragment=this.getFragment(null,!0),window.location.replace(this.options.root+"#"+this.fragment),!0;else if(this._wantsPushState&&this._hasPushState&&b&&a.hash)this.fragment=a.hash.replace(j,""),window.history.replaceState({}, +document.title,a.protocol+"//"+a.host+this.options.root+this.fragment);if(!this.options.silent)return this.loadUrl()},route:function(a,b){this.handlers.unshift({route:a,callback:b})},checkUrl:function(){var a=this.getFragment();a==this.fragment&&this.iframe&&(a=this.getFragment(this.iframe.location.hash));if(a==this.fragment||a==decodeURIComponent(this.fragment))return!1;this.iframe&&this.navigate(a);this.loadUrl()||this.loadUrl(window.location.hash)},loadUrl:function(a){var b=this.fragment=this.getFragment(a); +return f.any(this.handlers,function(a){if(a.route.test(b))return a.callback(b),!0})},navigate:function(a,b){var c=(a||"").replace(j,"");if(!(this.fragment==c||this.fragment==decodeURIComponent(c))){if(this._hasPushState){var d=window.location;c.indexOf(this.options.root)!=0&&(c=this.options.root+c);this.fragment=c;window.history.pushState({},document.title,d.protocol+"//"+d.host+c)}else if(window.location.hash=this.fragment=c,this.iframe&&c!=this.getFragment(this.iframe.location.hash))this.iframe.document.open().close(), +this.iframe.location.hash=c;b&&this.loadUrl(a)}}});e.View=function(a){this.cid=f.uniqueId("view");this._configure(a||{});this._ensureElement();this.delegateEvents();this.initialize.apply(this,arguments)};var u=/^(\S+)\s*(.*)$/,n=["model","collection","el","id","attributes","className","tagName"];f.extend(e.View.prototype,e.Events,{tagName:"div",$:function(a){return g(a,this.el)},initialize:function(){},render:function(){return this},remove:function(){g(this.el).remove();return this},make:function(a, +b,c){a=document.createElement(a);b&&g(a).attr(b);c&&g(a).html(c);return a},delegateEvents:function(a){if(a||(a=this.events))for(var b in f.isFunction(a)&&(a=a.call(this)),g(this.el).unbind(".delegateEvents"+this.cid),a){var c=this[a[b]];if(!c)throw Error('Event "'+a[b]+'" does not exist');var d=b.match(u),e=d[1];d=d[2];c=f.bind(c,this);e+=".delegateEvents"+this.cid;d===""?g(this.el).bind(e,c):g(this.el).delegate(d,e,c)}},_configure:function(a){this.options&&(a=f.extend({},this.options,a));for(var b= +0,c=n.length;b<c;b++){var d=n[b];a[d]&&(this[d]=a[d])}this.options=a},_ensureElement:function(){if(this.el){if(f.isString(this.el))this.el=g(this.el).get(0)}else{var a=this.attributes||{};if(this.id)a.id=this.id;if(this.className)a["class"]=this.className;this.el=this.make(this.tagName,a)}}});e.Model.extend=e.Collection.extend=e.Router.extend=e.View.extend=function(a,b){var c=v(this,a,b);c.extend=this.extend;return c};var w={create:"POST",update:"PUT","delete":"DELETE",read:"GET"};e.sync=function(a, +b,c){var d=w[a];c=f.extend({type:d,dataType:"json"},c);if(!c.url)c.url=k(b)||l();if(!c.data&&b&&(a=="create"||a=="update"))c.contentType="application/json",c.data=JSON.stringify(b.toJSON());if(e.emulateJSON)c.contentType="application/x-www-form-urlencoded",c.data=c.data?{model:c.data}:{};if(e.emulateHTTP&&(d==="PUT"||d==="DELETE")){if(e.emulateJSON)c.data._method=d;c.type="POST";c.beforeSend=function(a){a.setRequestHeader("X-HTTP-Method-Override",d)}}if(c.type!=="GET"&&!e.emulateJSON)c.processData= +!1;return g.ajax(c)};var o=function(){},v=function(a,b,c){var d;d=b&&b.hasOwnProperty("constructor")?b.constructor:function(){return a.apply(this,arguments)};f.extend(d,a);o.prototype=a.prototype;d.prototype=new o;b&&f.extend(d.prototype,b);c&&f.extend(d,c);d.prototype.constructor=d;d.__super__=a.prototype;return d},k=function(a){if(!a||!a.url)return null;return f.isFunction(a.url)?a.url():a.url},l=function(){throw Error('A "url" property or function must be specified');},i=function(a,b,c){return function(d){a? +a(b,d,c):b.trigger("error",b,d,c)}}}).call(this);
Modified: stanbol/trunk/demos/webvie/src/main/resources/META-INF/resources/static/enhancervie/lib/hallo/format.js URL: http://svn.apache.org/viewvc/stanbol/trunk/demos/webvie/src/main/resources/META-INF/resources/static/enhancervie/lib/hallo/format.js?rev=1467253&r1=1467252&r2=1467253&view=diff ============================================================================== --- stanbol/trunk/demos/webvie/src/main/resources/META-INF/resources/static/enhancervie/lib/hallo/format.js (original) +++ stanbol/trunk/demos/webvie/src/main/resources/META-INF/resources/static/enhancervie/lib/hallo/format.js Fri Apr 12 12:40:44 2013 @@ -1,64 +1,42 @@ - -/* Hallo - a rich text editing jQuery UI widget -# (c) 2011 Henri Bergius, IKS Consortium -# Hallo may be freely distributed under the MIT license -*/ - (function() { - + var __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; }; (function(jQuery) { return jQuery.widget("IKS.halloformat", { options: { editable: null, toolbar: null, uuid: "", - formattings: { - bold: true, - italic: true, - strikeThrough: true, - underline: true - } + formattings: ["bold", "italic"] }, _create: function() { - var buttonize, buttonset, enabled, format, widget, _ref, - _this = this; + var buttonize, buttonset, format, widget, _i, _len, _ref; widget = this; - buttonset = jQuery("<span class=\"" + widget.widgetName + "\"></span>"); - buttonize = function(format) { - var button, element, id, label, queryState; + buttonset = jQuery("<span></span>"); + buttonize = __bind(function(format) { + var button, id, label; label = format.substr(0, 1).toUpperCase(); - id = "" + _this.options.uuid + "-" + format; - buttonset.append(jQuery("<input id=\"" + id + "\" type=\"checkbox\" /><label for=\"" + id + "\" class=\"" + format + "_button\">" + label + "</label>").button()); + id = "" + this.options.uuid + "-" + format; + buttonset.append(jQuery("<input id=\"" + id + "\" type=\"checkbox\" /><label for=\"" + id + "\">" + label + "</label>").button()); button = jQuery("#" + id, buttonset); button.attr("hallo-command", format); - button.addClass(format); button.bind("change", function(event) { format = jQuery(this).attr("hallo-command"); return widget.options.editable.execute(format); }); - queryState = function(event) { + return this.element.bind("keyup paste change mouseup", function(event) { if (document.queryCommandState(format)) { button.attr("checked", true); - button.next("label").addClass("ui-state-clicked"); return button.button("refresh"); } else { button.attr("checked", false); - button.next("label").removeClass("ui-state-clicked"); return button.button("refresh"); } - }; - element = _this.element; - _this.element.bind("halloenabled", function() { - return element.bind("keyup paste change mouseup", queryState); - }); - return _this.element.bind("hallodisabled", function() { - return element.unbind("keyup paste change mouseup", queryState); }); - }; + }, this); _ref = this.options.formattings; - for (format in _ref) { - enabled = _ref[format]; - if (enabled) buttonize(format); + for (_i = 0, _len = _ref.length; _i < _len; _i++) { + format = _ref[_i]; + buttonize(format); } buttonset.buttonset(); return this.options.toolbar.append(buttonset); @@ -66,5 +44,4 @@ _init: function() {} }); })(jQuery); - }).call(this); Modified: stanbol/trunk/demos/webvie/src/main/resources/META-INF/resources/static/enhancervie/lib/hallo/hallo.js URL: http://svn.apache.org/viewvc/stanbol/trunk/demos/webvie/src/main/resources/META-INF/resources/static/enhancervie/lib/hallo/hallo.js?rev=1467253&r1=1467252&r2=1467253&view=diff ============================================================================== --- stanbol/trunk/demos/webvie/src/main/resources/META-INF/resources/static/enhancervie/lib/hallo/hallo.js (original) +++ stanbol/trunk/demos/webvie/src/main/resources/META-INF/resources/static/enhancervie/lib/hallo/hallo.js Fri Apr 12 12:40:44 2013 @@ -1,34 +1,15 @@ - -/* Hallo - a rich text editing jQuery UI widget -# (c) 2011 Henri Bergius, IKS Consortium -# Hallo may be freely distributed under the MIT license -*/ - (function() { - (function(jQuery) { return jQuery.widget("IKS.hallo", { toolbar: null, bound: false, originalContent: "", uuid: "", - selection: null, options: { editable: true, plugins: {}, - floating: true, - offset: { - x: 0, - y: 0 - }, - showAlways: false, activated: function() {}, - deactivated: function() {}, - selected: function() {}, - unselected: function() {}, - enabled: function() {}, - disabled: function() {}, - placeholder: '' + deactivated: function() {} }, _create: function() { var options, plugin, _ref, _results; @@ -39,7 +20,9 @@ _results = []; for (plugin in _ref) { options = _ref[plugin]; - if (!jQuery.isPlainObject(options)) options = {}; + if (!jQuery.isPlainObject(options)) { + options = {}; + } options["editable"] = this; options["toolbar"] = this.toolbar; options["uuid"] = this.id; @@ -58,100 +41,34 @@ this.element.attr("contentEditable", false); this.element.unbind("focus", this._activated); this.element.unbind("blur", this._deactivated); - this.element.unbind("keyup paste change", this._checkModified); - this.element.unbind("keyup", this._keys); - this.element.unbind("keyup mouseup", this._checkSelection); - this.bound = false; - return this._trigger("disabled", null); + this.element.unbind("keyup paste change", this, this._checkModified); + return this.bound = false; }, enable: function() { var widget; this.element.attr("contentEditable", true); - if (!this.element.html()) this.element.html(this.options.placeholder); if (!this.bound) { this.element.bind("focus", this, this._activated); - if (!this.options.showAlways) { - this.element.bind("blur", this, this._deactivated); - } + this.element.bind("blur", this, this._deactivated); this.element.bind("keyup paste change", this, this._checkModified); - this.element.bind("keyup", this, this._keys); - this.element.bind("keyup mouseup", this, this._checkSelection); widget = this; - this.bound = true; + return this.bound = true; } - return this._trigger("enabled", null); }, activate: function() { return this.element.focus(); }, - getSelection: function() { - var range, userSelection; - if (jQuery.browser.msie) { - range = document.selection.createRange(); - } else { - if (window.getSelection) { - userSelection = window.getSelection(); - } else if (document.selection) { - userSelection = document.selection.createRange(); - } else { - throw "Your browser does not support selection handling"; - } - if (userSelection.rangeCount > 0) { - range = userSelection.getRangeAt(0); - } else { - range = userSelection; - } - } - return range; - }, - restoreSelection: function(range) { - if (jQuery.browser.msie) { - return range.select(); - } else { - window.getSelection().removeAllRanges(); - return window.getSelection().addRange(range); - } - }, - replaceSelection: function(cb) { - var newTextNode, r, range, sel, t; - if (jQuery.browser.msie) { - t = document.selection.createRange().text; - r = document.selection.createRange(); - return r.pasteHTML(cb(t)); - } else { - sel = window.getSelection(); - range = sel.getRangeAt(0); - newTextNode = document.createTextNode(cb(range.extractContents())); - range.insertNode(newTextNode); - range.setStartAfter(newTextNode); - sel.removeAllRanges(); - return sel.addRange(range); - } - }, - removeAllSelections: function() { - if (jQuery.browser.msie) { - return range.empty(); - } else { - return window.getSelection().removeAllRanges(); - } - }, getContents: function() { return this.element.html(); }, - setContents: function(contents) { - return this.element.html(contents); - }, isModified: function() { return this.originalContent !== this.getContents(); }, setUnmodified: function() { return this.originalContent = this.getContents(); }, - restoreOriginalContent: function() { - return this.element.html(this.originalContent); - }, - execute: function(command, value) { - if (document.execCommand(command, false, value)) { + execute: function(command) { + if (document.execCommand(command, false, null)) { return this.element.trigger("change"); } }, @@ -162,80 +79,15 @@ }; return "" + (S4()) + (S4()) + "-" + (S4()) + "-" + (S4()) + "-" + (S4()) + "-" + (S4()) + (S4()) + (S4()); }, - _getToolbarPosition: function(event, selection) { - var offset; - if (!event) return; - if (this.options.floating) { - if (event.originalEvent instanceof KeyboardEvent) { - return this._getCaretPosition(selection); - } else if (event.originalEvent instanceof MouseEvent) { - return { - top: event.pageY, - left: event.pageX - }; - } - } else { - offset = parseFloat(this.element.css('outline-width')) + parseFloat(this.element.css('outline-offset')); - return { - top: this.element.offset().top - this.toolbar.outerHeight() - offset, - left: this.element.offset().left - offset - }; - } - }, - _getCaretPosition: function(range) { - var newRange, position, tmpSpan; - tmpSpan = jQuery("<span/>"); - newRange = document.createRange(); - newRange.setStart(range.endContainer, range.endOffset); - newRange.insertNode(tmpSpan.get(0)); - position = { - top: tmpSpan.offset().top, - left: tmpSpan.offset().left - }; - tmpSpan.remove(); - return position; - }, _prepareToolbar: function() { - var that; - that = this; - this.toolbar = jQuery('<div class="hallotoolbar"></div>').hide(); + this.toolbar = jQuery('<div></div>').hide(); this.toolbar.css("position", "absolute"); this.toolbar.css("top", this.element.offset().top - 20); this.toolbar.css("left", this.element.offset().left); jQuery('body').append(this.toolbar); - this.toolbar.bind("mousedown", function(event) { + return this.toolbar.bind("mousedown", function(event) { return event.preventDefault(); }); - if (this.options.showAlways) { - this.options.floating = false; - this.element.bind("halloactivated", function(event, data) { - that._updateToolbarPosition(that._getToolbarPosition(event)); - return that.toolbar.show(); - }); - this.element.bind("hallodeactivated", function(event, data) { - return that.toolbar.hide(); - }); - } else { - this.element.bind("halloselected", function(event, data) { - var position, widget; - widget = data.editable; - position = widget._getToolbarPosition(data.originalEvent, data.selection); - if (position) { - that._updateToolbarPosition(position); - return that.toolbar.show(); - } - }); - this.element.bind("hallounselected", function(event, data) { - return data.editable.toolbar.hide(); - }); - } - return jQuery(window).resize(function(event) { - return that._updateToolbarPosition(that._getToolbarPosition(event)); - }); - }, - _updateToolbarPosition: function(position) { - this.toolbar.css("top", position.top); - return this.toolbar.css("left", position.left); }, _checkModified: function(event) { var widget; @@ -247,86 +99,21 @@ }); } }, - _keys: function(event) { + _activated: function(event) { var widget; widget = event.data; - if (event.keyCode === 27) { - widget.restoreOriginalContent(); - return widget.turnOff(); + if (widget.toolbar.html() !== "") { + widget.toolbar.css("top", widget.element.offset().top - widget.toolbar.height()); + widget.toolbar.show(); } + return widget._trigger("activated", event); }, - _rangesEqual: function(r1, r2) { - return r1.startContainer === r2.startContainer && r1.startOffset === r2.startOffset && r1.endContainer === r2.endContainer && r1.endOffset === r2.endOffset; - }, - _checkSelection: function(event) { + _deactivated: function(event) { var widget; - if (event.keyCode === 27) return; widget = event.data; - return setTimeout(function() { - var sel; - sel = widget.getSelection(); - if (widget._isEmptySelection(sel) || widget._isEmptyRange(sel)) { - if (widget.selection) { - widget.selection = null; - widget._trigger("unselected", null, { - editable: widget, - originalEvent: event - }); - } - return; - } - if (!widget.selection || !widget._rangesEqual(sel, widget.selection)) { - widget.selection = sel.cloneRange(); - return widget._trigger("selected", null, { - editable: widget, - selection: widget.selection, - ranges: [widget.selection], - originalEvent: event - }); - } - }, 0); - }, - _isEmptySelection: function(selection) { - if (selection.type === "Caret") return true; - return false; - }, - _isEmptyRange: function(range) { - if (range.collapsed) return true; - if (range.isCollapsed) return range.isCollapsed(); - return false; - }, - turnOn: function() { - var el, widthToAdd; - if (this.getContents() === this.options.placeholder) this.setContents(''); - jQuery(this.element).addClass('inEditMode'); - if (!this.options.floating) { - el = jQuery(this.element); - widthToAdd = parseFloat(el.css('padding-left')); - widthToAdd += parseFloat(el.css('padding-right')); - widthToAdd += parseFloat(el.css('border-left-width')); - widthToAdd += parseFloat(el.css('border-right-width')); - widthToAdd += (parseFloat(el.css('outline-width'))) * 2; - widthToAdd += (parseFloat(el.css('outline-offset'))) * 2; - jQuery(this.toolbar).css("width", el.width() + widthToAdd); - } else { - this.toolbar.css("width", "auto"); - } - return this._trigger("activated", this); - }, - turnOff: function() { - this.toolbar.hide(); - jQuery(this.element).removeClass('inEditMode'); - if (this.options.showAlways) this.element.blur(); - this._trigger("deactivated", this); - if (!this.getContents()) return this.setContents(this.options.placeholder); - }, - _activated: function(event) { - return event.data.turnOn(); - }, - _deactivated: function(event) { - return event.data.turnOff(); + widget.toolbar.hide(); + return widget._trigger("deactivated", event); } }); })(jQuery); - }).call(this); Modified: stanbol/trunk/demos/webvie/src/main/resources/META-INF/resources/static/enhancervie/lib/jquery.rdfquery.debug.js URL: http://svn.apache.org/viewvc/stanbol/trunk/demos/webvie/src/main/resources/META-INF/resources/static/enhancervie/lib/jquery.rdfquery.debug.js?rev=1467253&r1=1467252&r2=1467253&view=diff ============================================================================== --- stanbol/trunk/demos/webvie/src/main/resources/META-INF/resources/static/enhancervie/lib/jquery.rdfquery.debug.js (original) +++ stanbol/trunk/demos/webvie/src/main/resources/META-INF/resources/static/enhancervie/lib/jquery.rdfquery.debug.js Fri Apr 12 12:40:44 2013 @@ -352,7 +352,7 @@ tag, found = false; if (uri === undefined) { if (prefix === undefined) { // get the in-scope declarations on the first element - if (!ns) { + if (ns === undefined) { ns = { // xml: $.uri(xmlNs) }; @@ -396,7 +396,7 @@ this.find('*').andSelf().removeData('xmlns'); return this; } else { // get the in-scope declaration associated with this prefix on the first element - if (!ns) { + if (ns === undefined) { ns = elem.xmlns(); } return ns[prefix]; @@ -727,7 +727,7 @@ }; $.typedValue.types['http://www.w3.org/2001/XMLSchema#duration'] = { - regex: /^([\-\+])?P(?:([0-9]+)Y)?(?:([0-9]+)M)?(?:([0-9]+)D)?(?:T(?:([0-9]+)H)?(?:([0-9]+)M)?(?:([0-9]+(?:\.[0-9]+)?)?S)?)$/, + regex: /^([\-\+])?P(?:([0-9]+)Y)?(?:([0-9]+)M)?(?:([0-9]+)D)?(?:T(?:([0-9]+)H)?(?:([0-9]+)M)?(?:([0-9]+(?:\.[0-9]+))?S)?)$/, /** @ignore */ validate: function (v) { var m = this.regex.exec(v); @@ -1321,7 +1321,7 @@ return $.map(compatibleMs, function (compatibleM) { return { bindings: $.extend({}, existingM.bindings, compatibleM.bindings), - triples: unique(existingM.triples.concat(compatibleM.triples)) + triples: $.unique(existingM.triples.concat(compatibleM.triples)) }; }); } else { @@ -1645,7 +1645,7 @@ return false; } return true; - }, + } dequeue = function (databank, url, result, args) { var callbacks = documentQueue[databank.id][url]; @@ -1653,21 +1653,7 @@ callbacks[result].call(databank, args); } documentQueue[databank.id][url] = undefined; - }, - - unique = function( b ) { - var a = []; - var l = b.length; - for(var i=0; i<l; i++) { - for(var j=i+1; j<l; j++) { - // If b[i] is found later in the array - if (b[i] === b[j]) - j = ++i; - } - a.push(b[i]); - } - return a; - }; + }; $.typedValue.types['http://www.w3.org/1999/02/22-rdf-syntax-ns#XMLLiteral'] = { regex: /^.*$/m, @@ -1723,7 +1709,7 @@ databanks = $.map(this.union, function (query) { return query.databank; }); - databanks = unique(databanks); + databanks = $.unique(databanks); if (databanks[1] !== undefined) { this.databank = $.rdf.databank(undefined, { union: databanks }); } else { @@ -2750,7 +2736,7 @@ $.each(this.union, function (i, databank) { triples = triples.concat(databank.triples().get()); }); - triples = unique(triples); + triples = $.unique(triples); } return $(triples); }, @@ -2799,7 +2785,7 @@ rhash[r] = true; } } - return unique(triples); + return $.unique(triples); }, /** @@ -4640,7 +4626,7 @@ p.prefix !== 'xml') { if (p.namespaceURI !== rdfNs) { property = $.rdf.resource('<' + p.namespaceURI + getLocalName(p) + '>'); - object = $.rdf.literal(literalOpts.lang ? p.nodeValue : '"' + p.nodeValue.replace(/"/g, '\\"') + '"', literalOpts); + object = $.rdf.literal(literalOpts.lang ? p.nodeValue : '"' + p.nodeValue + '"', literalOpts); triples.push($.rdf.triple(subject, property, object)); } else if (getLocalName(p) === 'type') { property = $.rdf.type; @@ -4649,7 +4635,6 @@ } } } - var parentLang = lang; for (i = 0; i < elem.childNodes.length; i += 1) { p = elem.childNodes[i]; if (p.nodeType === 1) { @@ -4659,11 +4644,9 @@ } else { property = $.rdf.resource('<' + p.namespaceURI + getLocalName(p) + '>'); } - lang = getAttributeNS(p, 'http://www.w3.org/XML/1998/namespace', 'lang') || parentLang; + lang = getAttributeNS(p, 'http://www.w3.org/XML/1998/namespace', 'lang') || lang; if (lang !== null && lang !== undefined && lang !== '') { literalOpts = { lang: lang }; - } else { - literalOpts = {}; } if (hasAttributeNS(p, rdfNs, 'resource')) { o = getAttributeNS(p, rdfNs, 'resource'); @@ -4725,7 +4708,7 @@ } } } else if (hasAttributeNS(p, rdfNs, 'datatype')) { - o = p.childNodes[0].nodeValue ? p.childNodes[0].nodeValue : ""; + o = p.childNodes[0].nodeValue; object = $.rdf.literal(o, { datatype: getAttributeNS(p, rdfNs, 'datatype') }); } else if (p.getElementsByTagName('*').length > 0) { for (j = 0; j < p.childNodes.length; j += 1) { @@ -4742,7 +4725,7 @@ } } else if (p.childNodes.length > 0) { o = p.childNodes[0].nodeValue; - object = $.rdf.literal(literalOpts.lang ? o : '"' + o.replace(/"/g, '\\"') + '"', literalOpts); + object = $.rdf.literal(literalOpts.lang ? o : '"' + o + '"', literalOpts); } else { oTriples = parseRdfXmlDescription(p, false, base, lang); if (oTriples.length > 0) { @@ -6287,12 +6270,7 @@ } blankNodeNum += 1; } else if ($.isFunction(this.rhs)) { - var results = q.map(this.rhs); - for (var t = 0; t < results.length; t++) { - if ((results[t]) instanceof $.rdf.triple) { - query.add(results[t]); - } - } + q.map(this.rhs); } else { for (j = 0; j < this.rhs.length; j += 1) { q.add(this.rhs[j]);
