[cc-commits] [CC SVN] r14078 - metadata_scraper/trunk/javascript
webmaster at creativecommons.org
webmaster at creativecommons.org
Tue Feb 2 19:00:28 EST 2010
Author: john
Date: 2010-02-03 00:00:28 +0000 (Wed, 03 Feb 2010)
New Revision: 14078
Modified:
metadata_scraper/trunk/javascript/deed.js
Log:
Updated compressed deed javascript
Modified: metadata_scraper/trunk/javascript/deed.js
===================================================================
--- metadata_scraper/trunk/javascript/deed.js 2010-02-02 23:37:00 UTC (rev 14077)
+++ metadata_scraper/trunk/javascript/deed.js 2010-02-03 00:00:28 UTC (rev 14078)
@@ -1 +1 @@
-var SIOC=function(a){return"http://rdfs.org/sioc/ns#"+a};var SIOC_SERVICE=function(a){return"http://rdfs.org/sioc/services#"+a};var POWDER=function(a){return"http://www.w3.org/2007/05/powder#"+a};var DCT=function(a){return"http://purl.org/dc/terms/"+a};YAHOO.namespace("cc");YAHOO.namespace("cc.plus");YAHOO.namespace("cc.network");YAHOO.namespace("cc.attribution");function parseUri(e){var d=parseUri.options,a=d.parser[d.strictMode?"strict":"loose"].exec(e),c={},b=14;while(b--){c[d.key[b]]=a[b]||""}c[d.q.name]={};c[d.key[12]].replace(d.q.parser,function(g,f,h){if(f){c[d.q.name][f]=h}});return c}parseUri.options={strictMode:false,key:["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"],q:{name:"queryKey",parser:/(?:^|&)([^&=]*)=?([^&]*)/g},parser:{strict:/^(?:([^:\/?#]+):)?(?:\/\/((?:(([^:@]*):?([^:@]*))?@)?([^:\/?#]*)(?::(\d*))?))?((((?:[^?#\/]*\/)*)([^?#]*))(?:\?([^#]*))?(?:#(.*))?)/,loose:/^(?:(?![
^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@]*):?([^:@]*))?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/}};function addQSParameter(b,c,d){var f=b;var e="";var a=(b.indexOf("#"));if(a!=-1){f=b.substring(0,a);e=b.substring(a)}f+=(b.indexOf("?")==-1)?"?":"&";f+=c+"="+d;return f+e}YAHOO.cc.index_of=function(a,c){if(a.index_of){return a.index_of(c)}for(var b=0;b<a.length;b++){if(a[b]==c){return b}}return -1};YAHOO.cc.license_uri=function(a){if(a==null){a=document.URL}return a;if(a.charAt(a.length-1)=="/"){return a}return a.substring(0,a.lastIndexOf("/")+1)};YAHOO.cc.get_license=function(b,a){if(!b[a]){return null}var c=b[a]["http://www.w3.org/1999/xhtml/vocab#license"]||b[a]["http://purl.org/dc/terms/license"]||b[a]["http://creativecommons.org/ns#license"]||null;if(c){return c[0]}return null};YAHOO.cc.network.lookup_uri=function(d,e,c){if(!d[e]){return null}services=d[e]["http://rdfs.org/sioc/services#ha
s_service"];if(services){for(var b=0;b<services.length;b++){if(d[services[b]]&&d[services[b]]["http://rdfs.org/sioc/services#service_protocol"]){protocols=d[services[b]]["http://rdfs.org/sioc/services#service_protocol"];for(var a=0;a<protocols.length;a++){if(protocols[a]=="http://wiki.creativecommons.org/work-lookup"){if(c){return services[b]+"?uri="+c}return services[b]}}}}}return null};YAHOO.cc.network.show_info=function(d,c,a){owner_name=d[a][SIOC("name")][0];network_url=d[a][SIOC("member_of")][0];network_name=d[network_url][DCT("title")][0];lookup_uri=YAHOO.cc.network.lookup_uri(d,network_url,c)||c;var e='<a href="'+a+'">'+owner_name+'</a> has registered <a href="'+lookup_uri+'">this work</a> at the <nobr><a href="'+network_url+'">'+network_name+"</a></nobr>.";var b=new YAHOO.widget.Module("network",{visible:true});b.setBody(e);b.render(YAHOO.util.Dom.getAncestorBy(YAHOO.util.Dom.get("work-attribution-container"),function(f){return true}));YAHOO.util.Dom.addClass(b.body,
"network");b.show()};YAHOO.cc.network.match_iriset=function(c,a,b){var d=0;if(c[a][POWDER("includeregex")]){for(d=0;d<c[a][POWDER("includeregex")].length;d++){if(!(new RegExp(c[a][POWDER("includeregex")][d])).test(b)){return false}}}if(c[a][POWDER("excluderegex")]){for(d=0;d<c[a][POWDER("excluderegex")].length;d++){if((new RegExp(c[a][POWDER("excluderegex")][d])).test(b)){return false}}}return true};YAHOO.cc.network.process_metadata=function(d,c){if(d[c][SIOC("has_owner")]){owner_url=d[c][SIOC("has_owner")][0];if(d[owner_url]&&d[owner_url][SIOC("owner_of")]){for(var f=0;f<d[owner_url][SIOC("owner_of")].length;f++){var b=d[owner_url][SIOC("owner_of")][f];if(b==c){YAHOO.cc.network.show_info(d,b,owner_url)}}for(var f=0;f<d[owner_url][SIOC("owner_of")].length;f++){var b=d[owner_url][SIOC("owner_of")][f];if(YAHOO.cc.get_license(d,b)==YAHOO.cc.license_uri(null)){if(d[b][SIOC("has_parent")]&&d[d[b][SIOC("has_parent")][0]][POWDER("iriset")]){parent_url=d[b][SIOC("has_parent")][0];fo
r(var e=0;e<d[parent_url][POWDER("iriset")].length;e++){var a=d[parent_url][POWDER("iriset")][e];if(YAHOO.cc.network.match_iriset(d,a,c)){YAHOO.cc.network.show_info(d,b,owner_url)}}}}}}}};YAHOO.cc.plus.insert=function(e,d){var c=e[d]["http://creativecommons.org/ns#morePermissions"]||[];var g=e[d]["http://creativecommons.org/ns#commercialLicense"]||false;var b=false;if(g){b=e[g]["http://purl.org/dc/elements/1.1/publisher"]||false;if(b){b=e[b]["http://purl.org/dc/elements/1.1/title"]||false}}var a="";if(c.length>0){a="<strong>Permissions beyond</strong> the scope of this public license are available at "}for(var f=0;f<c.length;f++){a+=" <strong><a href='"+addQSParameter(c[f],"cc-referrer",document.referrer)+"'>";a+=parseUri(c[f])["host"];a+="</a></strong>"}if(g&&b){if(a){a+="<br/>"}a+="<strong>Commerciële Rechten</strong>. ";a+="Licenties voor commercieel gebruik zijn via";a+=' <strong><a href="'+g+'">';a+=b+"</a></strong> verkrijgbaar."}if(a){document.getElementById("more-co
ntainer").innerHTML=a;document.getElementById("more-container").setAttribute("class","license more")}};YAHOO.cc.attribution.add_details=function(c,b){var d=c[b]["http://creativecommons.org/ns#attributionName"]||false;var a=c[b]["http://creativecommons.org/ns#attributionURL"]||false;if(d.length>1||a.length>1){return}if(d&&a){document.getElementById("attribution-container").innerHTML="You must attribute this work to <strong><a href='"+a+"'>"+d+"</a></strong> (with link)."}};YAHOO.cc.attribution.add_copy_paste=function(f,e){var g=f[e]["http://creativecommons.org/ns#attributionName"]||false;var d=f[e]["http://creativecommons.org/ns#attributionURL"]||false;if(g.length>1||d.length>1){return}var a=document.getElementById("license-code").value;var c=document.getElementById("license-url").value;var b=null;if(g&&d){b='<div xmlns:cc="http://creativecommons.org/ns#" about="'+e+'"><a rel="cc:attributionURL" property="cc:attributionName" href="'+d+'">'+g+'</a> / <a rel="license" href="'+c
+'">'+a+"</a></div>"}else{if(g){b='<div xmlns:cc="http://creativecommons.org/ns#" about="'+e+'"><span property="cc:attributionName">'+g+'</span> / <a rel="license" href="'+c+'">'+a+"</a></div>"}else{if(d){b='<div xmlns:cc="http://creativecommons.org/ns#" about="'+e+'"><a rel="cc:attributionURL" href="'+d+'">'+d+'</a> / <a rel="license" href="'+c+'">'+a+"</a></div>"}}}if(b!=null){document.getElementById("work-attribution").value=b;document.getElementById("work-attribution-container").style.display="block"}};YAHOO.cc.success=function(a){if(a.status!=200){return}var g=a.argument;var b=YAHOO.cc.license_uri(document.URL);var e=YAHOO.lang.JSON.parse(a.responseText);var d=null;if((YAHOO.cc.index_of(e.subjects,g)>-1)&&(YAHOO.cc.get_license(e.triples,g)==b)){d=g}else{var f=[];for(var c=0;c<e.subjects.length;c++){if(YAHOO.cc.get_license(e.triples,e.subjects[c])==b){f.push(e.subjects[c])}}if(f.length==1){d=f[0]}}YAHOO.cc.network.process_metadata(e.triples,d);YAHOO.cc.plus.insert(e.trip
les,d);YAHOO.cc.attribution.add_details(e.triples,d);YAHOO.cc.attribution.add_copy_paste(e.triples,d)};YAHOO.cc.failure=function(){};YAHOO.cc.load=function(){if(document.referrer.match("^http://")){var b={success:YAHOO.cc.success,failure:YAHOO.cc.failure,argument:document.referrer};YAHOO.util.Connect.initHeader("Referer",document.URL,true);var a="/apps/triples?url="+encodeURIComponent(document.referrer);YAHOO.util.Connect.asyncRequest("GET",a,b,null)}};YAHOO.util.Event.onDOMReady(YAHOO.cc.load);
\ No newline at end of file
+YAHOO.namespace("cc");YAHOO.namespace("cc.plus");YAHOO.namespace("cc.network");YAHOO.namespace("cc.attribution");YAHOO.cc.attribution.show_info=function(a){document.getElementById("work-attribution").value=a.marking;document.getElementById("work-attribution-container").style.display="block";if(a.details!=null){document.getElementById("attribution-container").innerHTML=a.details}return};YAHOO.cc.network.show_info=function(a){var b=new YAHOO.widget.Module("network",{visible:true});b.setBody(a);b.render(YAHOO.util.Dom.getAncestorBy(YAHOO.util.Dom.get("work-attribution-container"),function(c){return true}));YAHOO.util.Dom.addClass(b.body,"network");b.show()};YAHOO.cc.plus.show_info=function(a){document.getElementById("more-container").innerHTML=a;document.getElementById("more-container").setAttribute("class","license more")};YAHOO.cc.success=function(a){if(a.status!=200){return}var b=YAHOO.lang.JSON.parse(a.responseText);if(b.attribution!=null){YAHOO.cc.attribution.show_info(b.a
ttribution)}if(b.registration!=null){YAHOO.cc.network.show_info(b.registration)}if(b.more_permissions!=null){YAHOO.cc.plus.show_info(b.more_permissions)}return};YAHOO.cc.failure=function(){};YAHOO.cc.load=function(){if(document.referrer.match("^http://")){var b={success:YAHOO.cc.success,failure:YAHOO.cc.failure,argument:document.referrer};YAHOO.util.Connect.initHeader("Referer",document.URL,true);var a="/apps/deed?url="+encodeURIComponent(document.referrer);YAHOO.util.Connect.asyncRequest("GET",a,b,null)}};YAHOO.util.Event.onDOMReady(YAHOO.cc.load);
\ No newline at end of file
More information about the cc-commits
mailing list