-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathjquery.pir.min.js
1 lines (1 loc) · 1.14 KB
/
jquery.pir.min.js
1
(function($){$.fn.pir=function(options){return $(this).hide().each(function(){$.pir(this,options);}).show();};$.pir=function(elem,options){var $e=$(elem),meta=($.metadata)?$(elem).metadata():{},o=$.extend({size:$e.css("font-size"),color:$e.css("color"),bgColor:$e.css("background-color"),text:$e.text().split("'").join("'")},$.pir.options,meta,options),e=encodeURIComponent;$e.html("");$.each(o.wrap?o.text.split(" "):[o.text],function(){if($.trim(this)!=""){$e.append("<img alt='"+e(this)+"' src='"+o.php+"?text="+e(this)+"&font="+e(o.font)+"&size="+e(o.size)+"&color="+e(o.color)+"&bgcolor="+e(o.bgColor)+"'>");$e.append(" ");}});if(o.prettyPrint){$("img",$e).addClass("pir-prettyprint-image");$("<span>"+o.text+"</span>").addClass("pir-prettyprint-text").appendTo($e);$("<style type='text/css' media='print'></style>").text(".pir-prettyprint-image { display: none; }").appendTo("head");$("<style type='text/css' media='screen'></style>").text(".pir-prettyprint-text { display: none; }").appendTo("head");};return $e;};$.pir.options={php:"/pir.php",font:"denmark.ttf",wrap:false,prettyPrint:false};$.pir.version="0.1";$(function(){$(".pir").pir();});})(jQuery);