public/js/jquery.enablePlaceholder.min.js in sequenceserver-0.8.4 vs public/js/jquery.enablePlaceholder.min.js in sequenceserver-0.8.5
- old
+ new
@@ -1,11 +1,10 @@
/*
* EnablePlaceholder jQuery plugin.
* https://github.com/marioizquierdo/enablePlaceholder
- * version 1.0.1 (May 11 2011)
+ * version 1.2.2 (Oct 02, 2011)
*
* Copyright (c) 2011 Mario Izquierdo
* Dual licensed under the MIT (http://www.opensource.org/licenses/mit-license.php)
* and GPL (http://www.opensource.org/licenses/gpl-license.php) licenses.
*/
-(function($){$.support.placeholder=('placeholder'in document.createElement('input'));var defaults={"withPlaceholderClass":"placeholder"};$.fn.enablePlaceholder=function(options){if(!$.support.placeholder){var settings=$.extend({},defaults,options);var showPlaceholder=function(input,placeholder){return input.val(placeholder).addClass(settings["withPlaceholderClass"]).data('hasPlaceholder',true);};var clearPlaceholder=function(input,placeholder){if(input.data('hasPlaceholder')){return input.val("").removeClass(settings["withPlaceholderClass"]).data('hasPlaceholder',false);};};return this.each(function(){var input=$(this);var placeholder=input.attr("placeholder");if(placeholder!=""){if(input.val()==""||input.val()==placeholder){showPlaceholder(input,placeholder);}
-input.bind('focus keydown paste',function(){clearPlaceholder(input,placeholder);});input.bind('blur',function(){if(input.val()==""){showPlaceholder(input,input.attr("placeholder"));}});input.parents('form').first().submit(function(){clearPlaceholder(input,placeholder);return true;});}});};};})(jQuery)
+(function(){var a,c,b,d;a=jQuery;a.support.placeholder=document.createElement("input").placeholder!=null;a.EnablePlaceholder={defaults:{withPlaceholderClass:"placeholder"},alsoForModernBrowsers:false};c=function(h,f,e){var g;if(!a.support.placeholder||a.EnablePlaceholder.alsoForModernBrowsers){g=a.extend({},a.EnablePlaceholder.defaults,f);return h.each(function(){return e(a(this),g)})}};b=function(e,f){return e.bind("focus focusin keydown paste",function(){return e.clearPlaceholder(f)})};d=function(e,f){return e.bind("blur focusout",function(){return e.showPlaceholder(f)})};a.fn.enablePlaceholder=function(e){return c(this,e,function(f,g){b(f,g);d(f,g);f.parents("form").submit(function(){f.clearPlaceholder(g);return true});a(window).unload(function(){f.clearPlaceholder(g);return true});return f.showPlaceholder(g)})};a.fn.showPlaceholder=function(e){return c(this,e,function(f,g){if(f.val()===""){return f.val(f.attr("placeholder")).addClass(g.withPlaceholderClass).data("ph_active",true)}})};a.fn.clearPlaceholder=function(e){return c(this,e,function(f,g){if(f.data("ph_active")){return f.val("").removeClass(g.withPlaceholderClass).data("ph_active",false)}})};a.fn.updatePlaceholder=function(f,e){return this.clearPlaceholder(e).attr("placeholder",f).showPlaceholder(e)}}).call(this);
\ No newline at end of file