1/** 2* HTML5 placeholder polyfill 3* @requires jQuery - tested with 1.6.2 but might as well work with older versions 4* 5* code: https://github.com/ginader/HTML5-placeholder-polyfill 6* please report issues at: https://github.com/ginader/HTML5-placeholder-polyfill/issues 7* 8* Copyright (c) 2012 Dirk Ginader (ginader.de) 9* Dual licensed under the MIT and GPL licenses: 10* http://www.opensource.org/licenses/mit-license.php 11* http://www.gnu.org/licenses/gpl.html 12* 13*/ 14(function(a){function m(a,c){""===a.val()?a.data("placeholder").removeClass(c.hideClass):a.data("placeholder").addClass(c.hideClass)}function e(a,c){var g=c.is("textarea"),e=parseFloat(c.css("padding-top")),k=parseFloat(c.css("padding-left")),b=c.offset();e&&(b.top+=e);k&&(b.left+=k);a.css({width:c.innerWidth()-(g?20:4),height:c.innerHeight()-6,lineHeight:c.css("line-height"),whiteSpace:g?"normal":"nowrap",overflow:"hidden"}).offset(b)}function g(a){p&&(window.console&&window.console.log)&&window.console.log(a)} 15var p=!1,l;a.fn.placeHolder=function(n){g("init placeHolder");var c=this,p=a(this).length;this.options=a.extend({className:"placeholder",visibleToScreenreaders:!0,visibleToScreenreadersHideClass:"placeholder-hide-except-screenreader",visibleToNoneHideClass:"placeholder-hide",hideOnFocus:!1,removeLabelClass:"visuallyhidden",hiddenOverrideClass:"visuallyhidden-with-placeholder",forceHiddenOverride:!0,forceApply:!1,autoInit:!0},n);this.options.hideClass=this.options.visibleToScreenreaders?this.options.visibleToScreenreadersHideClass: 16this.options.visibleToNoneHideClass;return a(this).each(function(n){function k(){if(!c.options.hideOnFocus&&window.requestAnimationFrame){var a=b,d=c.options,f=a.val();(function q(){l=requestAnimationFrame(q);a.val()!==f&&(a.data("placeholder").addClass(d.hideClass),cancelAnimationFrame(l),function r(){l=requestAnimationFrame(r);m(a,d)}())})()}else{var g=c.options;b.data("placeholder").addClass(g.hideClass)}}var b=a(this),h=b.attr("placeholder"),j=b.attr("id"),d,f;if(""===h||void 0===h)h=b[0].attributes.placeholder.value; 17d=b.closest("label");b.removeAttr("placeholder");if(!d.length&&!j)g("the input element with the placeholder needs an id!");else if(d=d.length?d:a('label[for="'+j+'"]').first(),d.length){j=a(d).find(".placeholder");if(j.length)return e(j,b),j.text(h),b;d.hasClass(c.options.removeLabelClass)&&d.removeClass(c.options.removeLabelClass).addClass(c.options.hiddenOverrideClass);f=a("<span>").addClass(c.options.className).text(h).appendTo(d);(d=f.width()>b.width())&&f.attr("title",h);e(f,b);b.data("placeholder", 18f);f.data("input",b);f.click(function(){a(this).data("input").focus()});b.focusin(k);b.focusout(function(){m(a(this),c.options);!c.options.hideOnFocus&&window.cancelAnimationFrame&&cancelAnimationFrame(l)});m(b,c.options);a(document).bind("fontresize resize",function(){e(f,b)});a.event.special.resize?a("textarea").bind("resize",function(){e(f,b)}):a("textarea").css("resize","none");n>=p-1&&"undefined"!==typeof a.attrHooks&&(a.attrHooks.placeholder={get:function(b){if("input"===b.nodeName.toLowerCase()|| 19"textarea"===b.nodeName.toLowerCase())return a(b).data("placeholder")?a(a(b).data("placeholder")).text():a(b)[0].placeholder},set:function(b,c){return a(a(b).data("placeholder")).text(c)}});b.is(":focus")&&k()}else g("the input element with the placeholder needs a label!")})};a(function(){var e=window.placeHolderConfig||{};!1===e.autoInit?g("placeholder:abort because autoInit is off"):("placeholder"in a("<input>")[0]||"placeHolder"in a("<input>")[0])&&!e.forceApply?g("placeholder:abort because browser has native support"): 20a("input[placeholder], textarea[placeholder]").placeHolder(e)})})(jQuery);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.