o: ActiveSupport::Cache::Entry :@compressedF:@expires_in0:@created_atf1373188285.6883388: @value"8 {I" class:EFI"ProcessedAsset;FI"logical_path;F""jquery/watermark/watermark.jsI" pathname;F"d/home/bigxiang/RubyMineWorkspace/bs-helper/app/assets/javascripts/jquery/watermark/watermark.jsI"content_type;FI"application/javascript;FI" mtime;FI"2013-04-22T14:20:53+08:00;FI" length;FiùI" digest;F"%31f7ae1f87a0f582f480097b2b7ddbebI" source;FI"ù/* * jQuery Form Watermark * * Author: Damian Janowski * E-mail: damian.janowski@citrusbyte.com */ $.widget("ui.watermark", { _create:function () { if ($.ui.watermark.nativePlaceholderSupported) return this.element; var watermark = this; var form = this.element; this.elements = $("input:not(:checkbox,:radio,:file,:submit,:reset), textarea", form); var ignoreDefaultValue = this.options["ignoreDefaultValue"]; this.elements.each(function () { this.ignoreDefaultValue = ignoreDefaultValue; //IE 默认值问题 this.defaultValue = ''; // if (!$(this).hasClass("watermark")) { // this.defaultValue = this.value; // } }); this.elements.focus(this.handlerOff); this.elements.blur(this.handlerOn); this.refresh(); $(form).submit(function () { watermark.elements.each(watermark.handlerOff); return true; }); window.onbeforeunload = function () { watermark.elements.each(watermark.handlerOff); } return this.element; }, refresh:function () { this.elements.each(this.handlerOn); }, handlerOn:function () { var placeholder = this.getAttribute("placeholder"); if (placeholder && placeholder != '' && (this.value == '' || this.value == placeholder)) { $(this).addClass("watermark"); this.value = placeholder; if (this.type == "password") { this.isPassword = true; this.type = "text"; } } return true; }, handlerOff:function () { var placeholder = this.getAttribute("placeholder"); if (this.type == 'text' || this.type == 'textarea') { if (this.value == placeholder && placeholder && placeholder != '') { this.value = this.defaultValue || ''; $(this).removeClass("watermark"); if (this.isPassword) { this.type = "password"; } } } return true; } }); $.extend($.ui.watermark, { nativePlaceholderSupported:("placeholder" in document.createElement("input")) }); ;TI"dependency_digest;F"%2ceaf06cdfadf4b9295c28bb3590de43I"required_paths;F["d/home/bigxiang/RubyMineWorkspace/bs-helper/app/assets/javascripts/jquery/watermark/watermark.jsI"dependency_paths;F[{I" path;F"d/home/bigxiang/RubyMineWorkspace/bs-helper/app/assets/javascripts/jquery/watermark/watermark.jsI" mtime;FI"2013-04-22T14:20:53+08:00;FI" digest;F"%d409b9aadc85d5a4b5e86879e7cbf770I" _version;F"%6776f581a4329e299531e1d52aa59832