PageSourceSearch

https://vaultpress.com/js/jquery.placeholder-1.0.1.js?m=1698068824

js vaultpress.com collected 2026-10-02 02:29:17 UTC 2,384 bytes, 60 lines download raw bytes

1/**
2 * jQuery.placeholder - Placeholder plugin for input fields
3 * Written by Blair Mitchelmore (blair DOT mitchelmore AT gmail DOT com)
4 * Licensed under the WTFPL (http://sam.zoy.org/wtfpl/).
5 * Date: 2008/10/14
6 *
7 * Modified by aldenta 03/25/2010 to keep styles when reloading in browsers like FF
8 *
9 * @author Blair Mitchelmore
10 * @version 1.0.1
11 *
12 **/
13new function($) {
14    $.fn.placeholder = function(settings) {
15        settings = settings || {};
16        var key = settings.dataKey || "placeholderValue";
17        var attr = settings.attr || "placeholder";
18        var className = settings.className || "placeholder";
19        var values = settings.values || [];
20        var block = settings.blockSubmit || false;
21        var blank = settings.blankSubmit || false;
22        var submit = settings.onSubmit || false;
23        var value = settings.value || "";
24        var position = settings.cursor_position || 0;
25
26        
27        return this.filter(":input").each(function(index) { 
28            $.data(this, key, values[index] || $(this).attr(attr)); 
29        }).each(function() {
30            if ($.trim($(this).val()) === "" || $.trim($(this).val()) === $.data(this, key))
31                $(this).addClass(className).val($.data(this, key));
32        }).focus(function() {
33            if ($.trim($(this).val()) === $.data(this, key)) 
34                $(this).removeClass(className).val(value)
35                if ($.fn.setCursorPosition) {
36                  $(this).setCursorPosition(position);
37                }
38        }).blur(function() {
39            if ($.trim($(this).val()) === value)
40                $(this).addClass(className).val($.data(this, key));
41        }).each(function(index, elem) {
42            if (block)
43                new function(e) {
44                    $(e.form).submit(function() {
45                        return $.trim($(e).val()) != $.data(e, key)
46                    });
47                }(elem);
48            else if (blank)
49                new function(e) {
50                    $(e.form).submit(function() {
51                        if ($.trim($(e).val()) == $.data(e, key)) 
52                            $(e).removeClass(className).val("");
53                        return true;
54                    });
55                }(elem);
56            else if (submit)
57                new function(e) { $(e.form).submit(submit); }(elem);
58        });
59    };
60}(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.