Open-Source-Access-Control-.../public/wymeditor/jquery/jquery.rdfquery.rdfa.min-1.0.js

1 line
52 KiB
JavaScript
Raw Normal View History

2013-09-28 11:59:19 +00:00
(function(c){var d={},a=/^(([a-z][\-a-z0-9+\.]*):)?(\/\/([^\/?#]+))?([^?#]*)?(\?([^#]*))?(#(.*))?$/i,g,b=function(j){var h=j.match(a);if(h===null){throw"Malformed URI: "+j}return{scheme:h[1]?h[2].toLowerCase():undefined,authority:h[3]?h[4]:undefined,path:h[5]||"",query:h[6]?h[7]:undefined,fragment:h[8]?h[9]:undefined}},f=function(j){var k="",h=[];if(/\./.test(j)){while(j!==undefined&&j!==""){if(j==="."||j===".."){j=""}else{if(/^\.\.\//.test(j)){j=j.substring(3)}else{if(/^\.\//.test(j)){j=j.substring(2)}else{if(/^\/\.(\/|$)/.test(j)){j="/"+j.substring(3)}else{if(/^\/\.\.(\/|$)/.test(j)){j="/"+j.substring(4);k=k.replace(/\/?[^\/]+$/,"")}else{h=j.match(/^(\/?[^\/]*)(\/.*)?$/);j=h[2];k=k+h[1]}}}}}}return k}else{return j}},e=function(h,j){if(h.authority!==""&&(h.path===undefined||h.path==="")){return"/"+j}else{return h.path.replace(/[^\/]+$/,"")+j}};c.uri=function(k,j){var h;k=k||"";if(d[k]){return d[k]}j=j||c.uri.base();if(typeof j==="string"){j=c.uri.absolute(j)}h=new c.uri.fn.init(k,j);if(d[h]){return d[h]}else{d[h]=h;return h}};c.uri.fn=c.uri.prototype={scheme:undefined,authority:undefined,path:undefined,query:undefined,fragment:undefined,init:function(k,j){var h={};j=j||{};c.extend(this,b(k));if(this.scheme===undefined){this.scheme=j.scheme;if(this.authority!==undefined){this.path=f(this.path)}else{this.authority=j.authority;if(this.path===""){this.path=j.path;if(this.query===undefined){this.query=j.query}}else{if(!/^\//.test(this.path)){this.path=e(j,this.path)}this.path=f(this.path)}}}if(this.scheme===undefined){throw"Malformed URI: URI is not an absolute URI and no base supplied: "+k}return this},resolve:function(h){return c.uri(h,this)},relative:function(p){var n,o,m=0,k,l=[],h="";if(typeof p==="string"){p=c.uri(p,{})}if(p.scheme!==this.scheme||p.authority!==this.authority){return p.toString()}if(p.path!==this.path){n=p.path.split("/");o=this.path.split("/");if(n[1]!==o[1]){h=p.path}else{while(n[m]===o[m]){m+=1}k=m;for(;m<o.length-1;m+=1){l.push("..")}for(;k<n.length;k+=1){l.push(n[k])}h=l.join("/")}h=p.query===undefined?h:h+"?"+p.query;h=p.fragment===undefined?h:h+"#"+p.fragment;return h}if(p.query!==undefined&&p.query!==this.query){return"?"+p.query+(p.fragment===undefined?"":"#"+p.fragment)}if(p.fragment!==undefined&&p.fragment!==this.fragment){return"#"+p.fragment}return""},toString:function(){var h="";if(this._string){return this._string}else{h=this.scheme===undefined?h:(h+this.scheme+":");h=this.authority===undefined?h:(h+"//"+this.authority);h=h+this.path;h=this.query===undefined?h:(h+"?"+this.query);h=this.fragment===undefined?h:(h+"#"+this.fragment);this._string=h;return h}}};c.uri.fn.init.prototype=c.uri.fn;c.uri.absolute=function(h){return c.uri(h,{})};c.uri.resolve=function(j,h){return c.uri(j,h)};c.uri.relative=function(j,h){return c.uri(h,{}).relative(j)};c.uri.base=function(){return c(document).base()};c.fn.base=function(){var h=c(this).parents().andSelf().find("base").attr("href"),j=c(this)[0].ownerDocument||document,k=c.uri.absolute(j.location===null?document.location.href:j.location.href);return h===undefined?k:c.uri(h,k)}})(jQuery);(function(b){var a=/\sxmlns(?::([^ =]+))?\s*=\s*(?:"([^"]*)"|'([^']*)')/g;b.fn.xmlns=function(h,d,j){var f=this.eq(0),m=f.data("xmlns"),k=f[0],n,c,g,l=h?"xmlns:"+h:"xmlns",o,r,q=false;if(d===undefined){if(h===undefined){if(m===undefined){m={};if(k.attributes&&k.attributes.getNamedItemNS){for(g=0;g<k.attributes.length;g+=1){n=k.attributes[g];if(/^xmlns(:(.+))?$/.test(n.nodeName)){h=/^xmlns(:(.+))?$/.exec(n.nodeName)[2]||"";o=n.nodeValue;if(h===""||o!==""){m[h]=b.uri(n.nodeValue);q=true}}}}else{r=/<[^>]+>/.exec(k.outerHTML);n=a.exec(r);while(n!==null){h=n[1]||"";o=n[2]||n[3];if(h===""||o!==""){m[h]=b.uri(n[2]||n[3]);q=true}n=a.exec(r)}a.lastIndex=0}j=j||(k.parentNode.nodeType===1?f.parent().xmlns():{});m=q?b.extend({},j,m):j;f.data("xmlns",m)}return m}else{if(typeof h==="object"){for(c in h){if(typeof h[c]==="string"){this.xmlns(c,h[c])}}this.find("*").andSelf().removeData("xmlns");return this}else{if(m===undefined){m=f.xmlns()}return m[h]}}}else{this.find("*").andSelf().