Fix and Creative Commons license code for Wikipedia provider with Jquery Oembed

new $.fn.oembed.OEmbedProvider(“wikipedia”, “rich”, [“”], “http://$$2&format=json&section=0&callback=?”,{


templateData : function(data){if(!data.parse)return false;

var text1 = data.parse[‘text’][‘*’];

text2 =encodeURI(text1);

var regex = new RegExp(“/wiki/”, ‘gi’);

text3 = text2.replace(regex, “”);

text = decodeURI(text3);

var css = document.createElement(“style”);

css.type = “text/css”;

css.innerHTML = “,.metadata.plainlinks.ambox.ambox-content.ambox-Refimprove,.dablink { display: none; } .infobox{float: right; }”;


return ‘<div id=”content”><h3><a class=”nav-link” href=”’+data.parse[‘displaytitle’]+'”>’+data.parse[‘displaytitle’]+'</a></h3>’+text+'<br /></div><ul>Text is available under the <a href=”//”>Creative Commons Attribution-ShareAlike License</a><a href=”//” “></a> additional terms may apply.</ul>’;



Leave a Reply

Your email address will not be published.

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>