PageSourceSearch

https://www.mokuzai-nakagai.com/data/styles/js/jquery.advisor.js

js mokuzai-nakagai.com collected 2026-10-07 22:59:36 UTC 3,054 bytes, 78 lines download raw bytes

1/*
2Copyright (c) 2009 Pawe³ Miko³ajewski (http://gamma.mini.pw.edu.pl/~mikolajewskip)
3
4Permission is hereby granted, free of charge, to any person
5obtaining a copy of this software and associated documentation
6files (the "Software"), to deal in the Software without
7restriction, including without limitation the rights to use,
8copy, modify, merge, publish, distribute, sublicense, and/or sell
9copies of the Software, and to permit persons to whom the
10Software is furnished to do so, subject to the following
11conditions:
12
13The above copyright notice and this permission notice shall be
14included in all copies or substantial portions of the Software.
15
16THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
18OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
20HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
21WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
22FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
23OTHER DEALINGS IN THE SOFTWARE.
24
25*/
26
27(function($) {
28  $.fn.formAdvisor = function(settings) {
29
30    settings = jQuery.extend({
31      inputClass: 'show_advice', 		    //class for inputs that should be changed
32      inputBgChange: false, 			        //set false if you don't want to change input background
33      clearFieldBackground: '#fff', 		//set input background when not focused
34      currentFieldBackground: '#fffadd',  //set focused input background
35      side: 'right', 					          //where advisor occurs
36      offset: 0, 					              //sometimes you may want to set offset (X)
37      fadeTime: 800, 					          //time of fading in ms
38      staticMessage: false, 			      //if static set to true
39      staticId: 'advice_field'
40    }, settings);
41
42    var formWidth = $(this).width();
43
44    var inputElements = this.find('.' + settings.inputClass);
45    this.find('.' + settings.inputClass).focus(function() {
46      var title = $(this).attr('title').replace(/\n/g, "<br />");
47//      $('.formAdvisor').remove();
48      if (settings.inputBgChange) {
49        inputElements.css('background-color', settings.clearFieldBackground);
50        $(this).css('background-color', settings.currentFieldBackground);
51      }
52      if (settings.staticMessage) {
53        $('#' + settings.staticId).html(title);
54        return;
55      }
56      var position = $(this).offset();
57      var advisorElem = $("<div class='formAdvisor'>" + title + "</div>");
58      var left = position.left + settings.offset;
59      var advisorCss = {
60        'position': 'absolute',
61        'left': left + 'px',
62        'top': position.top + 'px',
63        'display': 'none'
64      }
65      advisorElem.css(advisorCss);
66      advisorElem.appendTo('body');
67      if (settings.side == 'left')
68        advisorElem.css(
69				{ 'left': left - formWidth - advisorElem.width() + 'px'
70				});
71
72      advisorElem.fadeIn(settings.fadeTime);
73
74    }).blur(function() {
75		$('.formAdvisor').remove();
76	 });
77  };
78})(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.