/usr/share/javascript/jquery-watermark/jquery.watermark.min.js is in libjs-jquery-watermark 3.1.4-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | /*
Watermark plugin for jQuery
Version: 3.1.4
http://jquery-watermark.googlecode.com/
Copyright (c) 2009-2012 Todd Northrop
http://www.speednet.biz/
August 13, 2012
Requires: jQuery 1.2.3+
Dual licensed under the MIT or GPL Version 2 licenses.
See mit-license.txt and gpl2-license.txt in the project root for details.
------------------------------------------------------*/(function(a,b,c){var d="watermark",e="watermarkClass",f="watermarkFocus",g="watermarkSubmit",h="watermarkMaxLength",i="watermarkPassword",j="watermarkText",k=/\r/g,l=/^(button|checkbox|hidden|image|radio|range|reset|submit)$/i,m="input:data("+d+"),textarea:data("+d+")",n=":watermarkable",o=["Page_ClientValidate"],p=!1,q="placeholder"in document.createElement("input");a.watermark=a.watermark||{version:"3.1.4",runOnce:!0,options:{className:"watermark",useNative:!0,hideBeforeUnload:!0},hide:function(b){a(b).filter(m).each(function(){a.watermark._hide(a(this))})},_hide:function(a,c){var d=a[0],f=(d.value||"").replace(k,""),g=a.data(j)||"",l=a.data(h)||0,m=a.data(e);if(g.length&&f==g){d.value="";if(a.data(i)&&(a.attr("type")||"")==="text"){var n=a.data(i)||[],o=a.parent()||[];n.length&&o.length&&(o[0].removeChild(a[0]),o[0].appendChild(n[0]),a=n)}l&&(a.attr("maxLength",l),a.removeData(h)),c&&(a.attr("autocomplete","off"),b.setTimeout(function(){a.select()},1))}m&&a.removeClass(m)},show:function(b){a(b).filter(m).each(function(){a.watermark._show(a(this))})},_show:function(b){var c=b[0],d=(c.value||"").replace(k,""),g=b.data(j)||"",l=b.attr("type")||"",m=b.data(e);if(d.length!=0&&d!=g||!!b.data(f))a.watermark._hide(b);else{p=!0;if(b.data(i)&&l==="password"){var n=b.data(i)||[],o=b.parent()||[];n.length&&o.length&&(o[0].removeChild(b[0]),o[0].appendChild(n[0]),b=n,b.attr("maxLength",g.length),c=b[0])}if(l==="text"||l==="search"){var q=b.attr("maxLength")||0;q>0&&g.length>q&&(b.data(h,q),b.attr("maxLength",g.length))}m&&b.addClass(m),c.value=g}},hideAll:function(){p&&(a.watermark.hide(n),p=!1)},showAll:function(){a.watermark.show(n)}},a.fn.watermark=a.fn.watermark||function(c,h){if(!this.length)return this;var l=!1,m=typeof c=="string";return m&&(c=c.replace(k,"")),typeof h=="object"?(l=typeof h.className=="string",h=a.extend({},a.watermark.options,h)):typeof h=="string"?(l=!0,h=a.extend({},a.watermark.options,{className:h})):h=a.watermark.options,typeof h.useNative!="function"&&(h.useNative=h.useNative?function(){return!0}:function(){return!1}),this.each(function(){var o=a(this);if(!o.is(n))return;if(o.data(d)){if(m||l)a.watermark._hide(o),m&&o.data(j,c),l&&o.data(e,h.className)}else{if(q&&h.useNative.call(this,o)&&(o.attr("tagName")||"")!=="TEXTAREA"){m&&o.attr("placeholder",c);return}o.data(j,m?c:""),o.data(e,h.className),o.data(d,1);if((o.attr("type")||"")==="password"){var p=o.wrap("<span>").parent(),r=a(p.html().replace(/type=["']?password["']?/i,'type="text"'));r.data(j,o.data(j)),r.data(e,o.data(e)),r.data(d,1),r.attr("maxLength",c.length),r.focus(function(){a.watermark._hide(r,!0)}).bind("dragenter",function(){a.watermark._hide(r)}).bind("dragend",function(){b.setTimeout(function(){r.blur()},1)}),o.blur(function(){a.watermark._show(o)}).bind("dragleave",function(){a.watermark._show(o)}),r.data(i,o),o.data(i,r)}else o.focus(function(){o.data(f,1),a.watermark._hide(o,!0)}).blur(function(){o.data(f,0),a.watermark._show(o)}).bind("dragenter",function(){a.watermark._hide(o)}).bind("dragleave",function(){a.watermark._show(o)}).bind("dragend",function(){b.setTimeout(function(){a.watermark._show(o)},1)}).bind("drop",function(a){var b=o[0],c=a.originalEvent.dataTransfer.getData("Text");(b.value||"").replace(k,"").replace(c,"")===o.data(j)&&(b.value=c),o.focus()});if(this.form){var s=this.form,t=a(s);t.data(g)||(t.submit(a.watermark.hideAll),s.submit?(t.data(g,s.submit),s.submit=function(b,c){return function(){var d=c.data(g);a.watermark.hideAll(),d.apply?d.apply(b,Array.prototype.slice.call(arguments)):d()}}(s,t)):(t.data(g,1),s.submit=function(b){return function(){a.watermark.hideAll(),delete b.submit,b.submit()}}(s)))}}a.watermark._show(o)})},a.watermark.runOnce&&(a.watermark.runOnce=!1,a.extend(a.expr[":"],{data:a.expr.createPseudo?a.expr.createPseudo(function(b){return function(c){return!!a.data(c,b)}}):function(b,c,d){return!!a.data(b,d[3])},watermarkable:function(a){var b,c=a.nodeName;return c==="TEXTAREA"?!0:c!=="INPUT"?!1:(b=a.getAttribute("type"),!b||!l.test(b))}}),function(b){a.fn.val=function(){var e=Array.prototype.slice.call(arguments);if(!this.length)return e.length?this:c;if(!e.length){if(this.data(d)){var f=(this[0].value||"").replace(k,"");return f===(this.data(j)||"")?"":f}return b.apply(this)}return b.apply(this,e),a.watermark.show(this),this}}(a.fn.val),o.length&&a(function(){var c,d,e;for(c=o.length-1;c>=0;c--)d=o[c],e=b[d],typeof e=="function"&&(b[d]=function(b){return function(){return a.watermark.hideAll(),b.apply(null,Array.prototype.slice.call(arguments))}}(e))}),a(b).bind("beforeunload",function(){a.watermark.options.hideBeforeUnload&&a.watermark.hideAll()}))})(jQuery,window);
|