/* html5 placeholder jquery plugin - v2.1.1 * copyright (c)2015 mathias bynens * 2015-03-11 */ !function(a){"function"==typeof define&&define.amd?define(["jquery"],a):a("object"==typeof module&&module.exports?require("jquery"):jquery)}(function(a){function b(b){var c={},d=/^jquery\d+$/;return a.each(b.attributes,function(a,b){b.specified&&!d.test(b.name)&&(c[b.name]=b.value)}),c}function c(b,c){var d=this,f=a(d);if(d.value==f.attr("placeholder")&&f.hasclass(m.customclass))if(f.data("placeholder-password")){if(f=f.hide().nextall('input[type="password"]:first').show().attr("id",f.removeattr("id").data("placeholder-id")),b===!0)return f[0].value=c;f.focus()}else d.value="",f.removeclass(m.customclass),d==e()&&d.select()}function d(){var d,e=this,f=a(e),g=this.id;if(""===e.value){if("password"===e.type){if(!f.data("placeholder-textinput")){try{d=f.clone().attr({type:"text"})}catch(h){d=a("").attr(a.extend(b(this),{type:"text"}))}d.removeattr("name").data({"placeholder-password":f,"placeholder-id":g}).bind("focus.placeholder",c),f.data({"placeholder-textinput":d,"placeholder-id":g}).before(d)}f=f.removeattr("id").hide().prevall('input[type="text"]:first').attr("id",g).show()}f.addclass(m.customclass),f[0].value=f.attr("placeholder")}else f.removeclass(m.customclass)}function e(){try{return document.activeelement}catch(a){}}var f,g,h="[object operamini]"==object.prototype.tostring.call(window.operamini),i="placeholder"in document.createelement("input")&&!h,j="placeholder"in document.createelement("textarea")&&!h,k=a.valhooks,l=a.prophooks;if(i&&j)g=a.fn.placeholder=function(){return this},g.input=g.textarea=!0;else{var m={};g=a.fn.placeholder=function(b){var e={customclass:"placeholder"};m=a.extend({},e,b);var f=this;return f.filter((i?"textarea":":input")+"[placeholder]").not("."+m.customclass).bind({"focus.placeholder":c,"blur.placeholder":d}).data("placeholder-enabled",!0).trigger("blur.placeholder"),f},g.input=i,g.textarea=j,f={get:function(b){var c=a(b),d=c.data("placeholder-password");return d?d[0].value:c.data("placeholder-enabled")&&c.hasclass(m.customclass)?"":b.value},set:function(b,f){var g=a(b),h=g.data("placeholder-password");return h?h[0].value=f:g.data("placeholder-enabled")?(""===f?(b.value=f,b!=e()&&d.call(b)):g.hasclass(m.customclass)?c.call(b,!0,f)||(b.value=f):b.value=f,g):b.value=f}},i||(k.input=f,l.value=f),j||(k.textarea=f,l.value=f),a(function(){a(document).delegate("form","submit.placeholder",function(){var b=a("."+m.customclass,this).each(c);settimeout(function(){b.each(d)},10)})}),a(window).bind("beforeunload.placeholder",function(){a("."+m.customclass).each(function(){this.value=""})})}}); //# sourcemappingurl=jquery.placeholder.min.js.map