(function($){ $.fn.WPStealthAds = function(fn, params) { if(fn == 'config'){ return this.each(function() { return this.config(params); }); }else if(fn == 'ads'){ return this.each(function() { return this.ads(params); }); }else if(fn == 'update'){ return this.each(function() { return this.update(); }); } return this.each(function() { function escape_html(html){ var text = document.createTextNode(html); var div = document.createElement('div'); div.appendChild(text); return div.innerHTML; } function render_single(text, image, url) { var template = "\r\n
<\/div>\r\n
%text%<\/div>\r\n<\/a>"; return template .replace(/%text%/g, escape_html(text)) .replace(/%image%/g, image) .replace(/%url%/g, url); } function render_html(){ var template = " \r\n