Sha256: 9e91e4081a6adbed8249b6ee1d700b1bfe831a3e747addd51803380c3331046b

Contents?: true

Size: 1.59 KB

Versions: 2

Compression:

Stored size: 1.59 KB

Contents

/*!
 * jQuery Placeholder 1.1.1
 * 
 * Copyright (c) 2010 Michael J. Ryan (http://tracker1.info/)
 * 
 * Dual licensed under the MIT and GPL licenses:
 * 	http://www.opensource.org/licenses/mit-license.php
 * 	http://www.gnu.org/licenses/gpl.html
 */
(function(e){var g="PLACEHOLDER-INPUT";var f="PLACEHOLDER-LABEL";var a=false;var d={labelClass:"placeholder"};var i=document.createElement("input");if("placeholder" in i){e.fn.placeholder=e.fn.unplaceholder=function(){};delete i;return}delete i;e.fn.placeholder=function(j){c();var k=e.extend(d,j);this.each(function(){var n=Math.random().toString(32).replace(/\./,""),l=e(this),m=e('<label style="position:absolute;display:none;top:0;left:0;"></label>');if(!l.attr("placeholder")||l.data(g)===g){return}if(!l.attr("id")){l.attr("id")="input_"+n}m.attr("id",l.attr("id")+"_placeholder").data(g,"#"+l.attr("id")).attr("for",l.attr("id")).addClass(k.labelClass).addClass(k.labelClass+"-for-"+this.tagName.toLowerCase()).addClass(f).text(l.attr("placeholder"));l.data(f,"#"+m.attr("id")).data(g,g).addClass(g).after(m);b.call(this);h.call(this)})};e.fn.unplaceholder=function(){this.each(function(){var j=e(this),k=e(j.data(f));if(j.data(g)!==g){return}k.remove();j.removeData(g).removeData(f).removeClass(g)})};function c(){if(a){return}e("."+g).live("click",b).live("focusin",b).live("focusout",h);bound=true;a=true}function b(){var j=e(this),k=e(j.data(f));k.css("display","none")}function h(){var j=this;setTimeout(function(){var k=e(j);e(k.data(f)).css("top",k.position().top+"px").css("left",k.position().left+"px").css("display",!!k.val()?"none":"block")},200)}}(jQuery));

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
unity-captcha-1.1.0 vendor/assets/javascripts/jquery.placeholder.1.1.1.min.js
unity-captcha-1.0.1 vendor/assets/javascripts/jquery.placeholder.1.1.1.min.js