PageSourceSearch

https://satruck.org/scripts/devnext.bootstrap.widgets.js?t=134347155885596314

js satruck.org collected 2026-09-24 09:27:13 UTC 19,985 bytes, 608 lines download raw bytes

1/* ========================================================================
2 * Bootstrap: spinner.js v3.1.1
3 * http://github.com/indigojs
4 * ========================================================================
5 * Copyright 2014 Márk Sági-Kazár
6 * Licensed under MIT (https://github.com/indigojs/bootstrap-spinner/blob/master/LICENSE)
7 * ======================================================================== */
8
9+function ($) {
10  'use strict';
11
12  // SPINNER CLASS DEFINITION
13  // =========================
14
15  var Spinner = function (element, options) {
16    var $this = this;
17    this.$element = $(element)
18    this.options  = $.extend({}, Spinner.DEFAULTS, this.$element.data(), options)
19
20    // Check for insane values
21    var value = new Number(this.$element.val())
22    if (isNaN(value)) this.$element.val(this.options.min)
23
24    // Strict check entered value
25    if (this.options.strict == true) {
26      this.$element.on('keypress', function (e) {
27        var prevent = false
28
29        if (e.which == 45 || e.keyCode == 40) {
30          $this.decrease()
31          return false
32        } else if (e.which == 43 || e.keyCode == 38) {
33          $this.increase()
34          return false
35        }
36
37        // Allow: backspace, delete, tab, escape, enter, home, end, left, right
38        // Allow: Ctrl+A
39        // Allow: home, end, left, right
40        // Allow . if precision is gt 0
41        if ($.inArray(e.keyCode, [8, 46, 9, 27, 13, 36, 35, 37, 39]) !== -1 ||
42            (e.which == 65 && e.ctrlKey === true) ||
43            ($this.options.precision > 0 && $this.$element.val().indexOf('.') == -1 && e.which == 46)) {
44                 return
45        }
46
47        // Ensure that it is a number and stop the keypress
48        if (e.which < 48 || e.which > 57) return false
49      });
50
51      // Validate after focus lost
52      this.$element.on('blur', function (e) {
53        $this.change($this.$element.val())
54      })
55    }
56  }
57
58  Spinner.DEFAULTS = {
59    step: 1,
60    min: 0,
61    max: Infinity,
62    precision: 0,
63    strict: true
64  }
65
66  Spinner.prototype.increase = function() {
67    this.step(this.options.step)
68  }
69
70  Spinner.prototype.decrease = function() {
71    this.step(-this.options.step)
72  }
73
74  Spinner.prototype.step = function (value) {
75    if (typeof value !== 'number') value = new Number(value)
76    if (isNaN(value)) return
77
78    var current = new Number(this.$element.val())
79    if (isNaN(current)) current = this.options.min
80
81    this.change(current + value)
82  }
83
84  Spinner.prototype.change = function(value) {
85    if (typeof value !== 'number') value = new Number(value)
86    if (isNaN(value)) value = this.options.min
87
88    if (value < this.options.min) value = this.options.min
89    if (value > this.options.max) value = this.options.max
90
91    var e = $.Event('change.bs.spinner', { value: value })
92    this.$element.trigger(e)
93
94    e = $.Event('changed.bs.spinner')
95
96    this.$element.val(value.toFixed(this.options.precision)).change().trigger(e)
97  }
98
99  Spinner.prototype.setOptions = function(options) {
100    if (typeof options == 'object') this.options = $.extend({}, this.options, options)
101  }
102
103  // SPINNER PLUGIN DEFINITION
104  // =========================
105
106  var old = $.fn.spinner
107
108  $.fn.spinner = function (option, arg) {
109    return this.each(function () {
110      var $this   = $(this)
111      var data    = $this.data('bs.spinner')
112      var isNew   = (typeof data == 'object')
113      var options = typeof option == 'object' && option
114
115      if (!data) $this.data('bs.spinner', (data = new Spinner(this, options)))
116
117      if (typeof option == 'object' && isNew == false) data.setOptions(option)
118      else if (typeof option == 'number') data.step(option)
119      else if (typeof option == 'string') data[option](arg)
120    })
121  }
122
123  $.fn.spinner.Constructor = Spinner
124
125  // SPINNER NO CONFLICT
126  // ===================
127
128  var trigger = function (event) {
129    var $this   = $(this)
130    var href    = $this.attr('href')
131    var $target = $($this.attr('data-target') || (href && href.replace(/.*(?=#[^\s]+$)/, ''))) //strip for ie7
132    var value   = $this.data('value')
133
134    if ($this.is('a')) event.preventDefault()
135
136    $target.spinner(value)
137  }
138
139  $.fn.spinner.noConflict = function () {
140    $.fn.spinner = old
141    return this
142  }
143
144  // SPINNER DATA-API
145  // ================
146
147  $(document)
148    .on('click.bs.spinner.data-api', '[data-toggle="spinner"][data-on!="mousehold"]', trigger)
149    .on('mousehold.bs.spinner.data-api', '[data-toggle="spinner"]', trigger)
150
151  $(window).on('load', function () {
152    $('[data-ride="spinner"]').each(function () {
153      $(this).spinner()
154    })
155  })
156
157}(jQuery);
158
159/* =============================================================
160 * bootstrap-combobox.js v1.1.6
161 * =============================================================
162 * Copyright 2012 Daniel Farrell
163 *
164 * Licensed under the Apache License, Version 2.0 (the "License");
165 * you may not use this file except in compliance with the License.
166 * You may obtain a copy of the License at
167 *
168 * http://www.apache.org/licenses/LICENSE-2.0
169 *
170 * Unless required by applicable law or agreed to in writing, software
171 * distributed under the License is distributed on an "AS IS" BASIS,
172 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
173 * See the License for the specific language governing permissions and
174 * limitations under the License.
175 * ============================================================ */
176
177!function( $ ) {
178
179 "use strict";
180
181 /* COMBOBOX PUBLIC CLASS DEFINITION
182  * ================================ */
183
184  var Combobox = function ( element, options ) {
185    this.options = $.extend({}, $.fn.combobox.defaults, options);
186    this.$source = $(element);
187    this.$container = this.setup();
188    this.$element = this.$container.find('input[type=text]');
189    this.$target = this.$container.find('input[type=hidden]');
190    this.$button = this.$container.find('.dropdown-toggle');
191    this.$menu = $(this.options.menu).appendTo('body');
192    this.template = this.options.template || this.template
193    this.matcher = this.options.matcher || this.matcher;
194    this.sorter = this.options.sorter || this.sorter;
195    this.highlighter = this.options.highlighter || this.highlighter;
196    this.shown = false;
197    this.selected = false;
198    this.refresh();
199    this.transferAttributes();
200    this.listen();
201  };
202
203  Combobox.prototype = {
204
205    constructor: Combobox
206
207  , setup: function () {
208      var combobox = $(this.template());
209      this.$source.before(combobox);
210      this.$source.hide();
211      return combobox;
212    }
213
214  , disable: function() {
215      this.$element.prop('disabled', true);
216      this.$button.attr('disabled', true);
217      this.disabled = true;
218      this.$container.addClass('combobox-disabled');
219    }
220
221  , enable: function() {
222      this.$element.prop('disabled', false);
223      this.$button.attr('disabled', false);
224      this.disabled = false;
225      this.$container.removeClass('combobox-disabled');
226    }
227  , parse: function () {
228      var that = this
229        , map = {}
230        , source = []
231        , selected = false
232        , selectedValue = '';
233      this.$source.find('option').each(function() {
234        var option = $(this);
235        if (option.val() === '') {
236          that.options.placeholder = option.text();
237          return;
238        }
239        map[option.text()] = option.val();
240        source.push(option.text());
241        if (option.prop('selected')) {
242          selected = option.text();
243          selectedValue = option.val();
244        }
245      })
246      this.map = map;
247      if (selected) {
248        this.$element.val(selected);
249        this.$target.val(selectedValue);
250        this.$container.addClass('combobox-selected');
251        this.selected = true;
252      }
253      return source;
254    }
255
256  , transferAttributes: function() {
257    this.options.placeholder = this.$source.attr('data-placeholder') || this.options.placeholder
258    this.$element.attr('placeholder', this.options.placeholder)
259    this.$target.prop('name', this.$source.prop('name'))
260    this.$target.val(this.$source.val())
261    this.$source.removeAttr('name')  // Remove from source otherwise form will pass parameter twice.
262    this.$element.attr('required', this.$source.attr('required'))
263    this.$element.attr('rel', this.$source.attr('rel'))
264    this.$element.attr('title', this.$source.attr('title'))
265    this.$element.attr('class', this.$source.attr('class'))
266    this.$element.attr('tabindex', this.$source.attr('tabindex'))
267    this.$source.removeAttr('tabindex')
268    if (this.$source.attr('disabled')!==undefined)
269      this.disable();
270  }
271
272  , select: function () {
273      var val = this.$menu.find('.active').attr('data-value');
274      this.$element.val(this.updater(val)).trigger('change');
275      this.$target.val(this.map[val]).trigger('change');
276      this.$source.val(this.map[val]).trigger('change');
277      this.$container.addClass('combobox-selected');
278      this.selected = true;
279      return this.hide();
280    }
281
282  , updater: function (item) {
283      return item;
284    }
285
286  , show: function () {
287      var pos = $.extend({}, this.$element.position(), {
288        height: this.$element[0].offsetHeight
289      });
290
291      this.$menu
292        .insertAfter(this.$element)
293        .css({
294          top: pos.top + pos.height
295        , left: pos.left
296        })
297        .show();
298
299      $('.dropdown-menu').on('mousedown', $.proxy(this.scrollSafety, this));
300
301      this.shown = true;
302      return this;
303    }
304
305  , hide: function () {
306      this.$menu.hide();
307      $('.dropdown-menu').off('mousedown', $.proxy(this.scrollSafety, this));
308      this.$element.on('blur', $.proxy(this.blur, this));
309      this.shown = false;
310      return this;
311    }
312
313  , lookup: function (event) {
314      this.query = this.$element.val();
315      return this.process(this.source);
316    }
317
318  , process: function (items) {
319      var that = this;
320
321      items = $.grep(items, function (item) {
322        return that.matcher(item);
323      })
324
325      items = this.sorter(items);
326
327      if (!items.length) {
328        return this.shown ? this.hide() : this;
329      }
330
331      return this.render(items.slice(0, this.options.items)).show();
332    }
333
334  , template: function() {
335      if (this.options.bsVersion == '2') {
336        return '<div class="combobox-container"><input type="hidden" /> <div class="input-append"> <input type="text" autocomplete="off" /> <span class="add-on dropdown-toggle" data-dropdown="dropdown"> <span class="caret"/> <i class="icon-remove"/>
336 </span> </div> </div>'
337      } else {
338        return '<div class="combobox-container"> <input type="hidden" /> <div class="input-group"> <input type="text" autocomplete="off" /> <span class="input-group-addon dropdown-toggle" data-dropdown="dropdown"> <span class="caret" /> <span class="glyphicon glyphicon-remove" /> </span> </div> </div>'
339      }
340    }
341
342  , matcher: function (item) {
343      return ~item.toLowerCase().indexOf(this.query.toLowerCase());
344    }
345
346  , sorter: function (items) {
347      var beginswith = []
348        , caseSensitive = []
349        , caseInsensitive = []
350        , item;
351
352      while (item = items.shift()) {
353        if (!item.toLowerCase().indexOf(this.query.toLowerCase())) {beginswith.push(item);}
354        else if (~item.indexOf(this.query)) {caseSensitive.push(item);}
355        else {caseInsensitive.push(item);}
356      }
357
358      return beginswith.concat(caseSensitive, caseInsensitive);
359    }
360
361  , highlighter: function (item) {
362      var query = this.query.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g, '\\$&');
363      return item.replace(new RegExp('(' + query + ')', 'ig'), function ($1, match) {
364        return '<strong>' + match + '</strong>';
365      })
366    }
367
368  , render: function (items) {
369      var that = this;
370
371      items = $(items).map(function (i, item) {
372        i = $(that.options.item).attr('data-value', item);
373        i.find('a').html(that.highlighter(item));
374        return i[0];
375      })
376
377      items.first().addClass('active');
378      this.$menu.html(items);
379      return this;
380    }
381
382  , next: function (event) {
383      var active = this.$menu.find('.active').removeClass('active')
384        , next = active.next();
385
386      if (!next.length) {
387        next = $(this.$menu.find('li')[0]);
388      }
389
390      next.addClass('active');
391    }
392
393  , prev: function (event) {
394      var active = this.$menu.find('.active').removeClass('active')
395        , prev = active.prev();
396
397      if (!prev.length) {
398        prev = this.$menu.find('li').last();
399      }
400
401      prev.addClass('active');
402    }
403
404  , toggle: function () {
405    if (!this.disabled) {
406      if (this.$container.hasClass('combobox-selected')) {
407        this.clearTarget();
408        this.triggerChange();
409        this.clearElement();
410      } else {
411        if (this.shown) {
412          this.hide();
413        } else {
414          this.clearElement();
415          this.lookup();
416        }
417      }
418    }
419  }
420
421  , scrollSafety: function(e) {
422      if (e.target.tagName == 'UL') {
423          this.$element.off('blur');
424      }
425  }
426  , clearElement: function () {
427    this.$element.val('').focus();
428  }
429
430  , clearTarget: function () {
431    this.$source.val('');
432    this.$target.val('');
433    this.$container.removeClass('combobox-selected');
434    this.selected = false;
435  }
436
437  , triggerChange: function () {
438    this.$source.trigger('change');
439  }
440
441  , refresh: function () {
442    this.source = this.parse();
443    this.options.items = this.source.length;
444  }
445
446  , listen: function () {
447      this.$element
448        .on('focus',    $.proxy(this.focus, this))
449        .on('blur',     $.proxy(this.blur, this))
450        .on('keypress', $.proxy(this.keypress, this))
451        .on('keyup',    $.proxy(this.keyup, this));
452
453      if (this.eventSupported('keydown')) {
454        this.$element.on('keydown', $.proxy(this.keydown, this));
455      }
456
457      this.$menu
458        .on('click', $.proxy(this.click, this))
459        .on('mouseenter', 'li', $.proxy(this.mouseenter, this))
460        .on('mouseleave', 'li', $.proxy(this.mouseleave, this));
461
462      this.$button
463        .on('click', $.proxy(this.toggle, this));
464    }
465
466  , eventSupported: function(eventName) {
467      var isSupported = eventName in this.$element;
468      if (!isSupported) {
469        this.$element.setAttribute(eventName, 'return;');
470        isSupported = typeof this.$element[eventName] === 'function';
471      }
472      return isSupported;
473    }
474
475  , move: function (e) {
476      if (!this.shown) {return;}
477
478      switch(e.keyCode) {
479        case 9: // tab
480        case 13: // enter
481        case 27: // escape
482          e.preventDefault();
483          break;
484
485        case 38: // up arrow
486          e.preventDefault();
487          this.prev();
488          break;
489
490        case 40: // down arrow
491          e.preventDefault();
492          this.next();
493          break;
494      }
495
496      e.stopPropagation();
497    }
498
499  , keydown: function (e) {
500      this.suppressKeyPressRepeat = ~$.inArray(e.keyCode, [40,38,9,13,27]);
501      this.move(e);
502    }
503
504  , keypress: function (e) {
505      if (this.suppressKeyPressRepeat) {return;}
506      this.move(e);
507    }
508
509  , keyup: function (e) {
510      switch(e.keyCode) {
511        case 40: // down arrow
512        case 39: // right arrow
513        case 38: // up arrow
514        case 37: // left arrow
515        case 36: // home
516        case 35: // end
517        case 16: // shift
518        case 17: // ctrl
519        case 18: // alt
520          break;
521
522        case 9: // tab
523        case 13: // enter
524          if (!this.shown) {return;}
525          this.select();
526          break;
527
528        case 27: // escape
529          if (!this.shown) {return;}
530          this.hide();
531          break;
532
533        default:
534          this.clearTarget();
535          this.lookup();
536      }
537
538      e.stopPropagation();
539      e.preventDefault();
540  }
541
542  , focus: function (e) {
543      this.focused = true;
544    }
545
546  , blur: function (e) {
547      var that = this;
548      this.focused = false;
549      var val = this.$element.val();
550      if (!this.selected && val !== '' ) {
551        this.$element.val('');
552        this.$source.val('').trigger('change');
553        this.$target.val('').trigger('change');
554      }
555      if (!this.mousedover && this.shown) {setTimeout(function () { that.hide(); }, 200);}
556    }
557
558  , click: function (e) {
559      e.stopPropagation();
560      e.preventDefault();
561      this.select();
562      this.$element.focus();
563    }
564
565  , mouseenter: function (e) {
566      this.mousedover = true;
567      this.$menu.find('.active').removeClass('active');
568      $(e.currentTarget).addClass('active');
569    }
570
571  , mouseleave: function (e) {
572      this.mousedover = false;
573    }
574  };
575
576  /* COMBOBOX PLUGIN DEFINITION
577   * =========================== */
578  $.fn.combobox = function ( option ) {
579    return this.each(function () {
580      var $this = $(this)
581        , data = $this.data('combobox')
582        , options = typeof option == 'object' && option;
583      if(!data) {$this.data('combobox', (data = new Combobox(this, options)));}
584      if (typeof option == 'string') {data[option]();}
585    });
586  };
587
588  $.fn.combobox.defaults = {
589    bsVersion: '3'
590  , menu: '<ul class="typeahead typeahead-long dropdown-menu"></ul>'
591  , item: '<li><a href="#"></a></li>'
592  };
593
594  $.fn.combobox.Constructor = Combobox;
595
596}( window.jQuery );
597
598/**
599 * jQuery.browser.mobile (http://detectmobilebrowser.com/)
600 *
601 * jQuery.browser.mobile will be true if the browser is a mobile device
602 *
603 **/
604(function(a)
605{
606	(jQuery.browser=jQuery.browser||{}).mobile=/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/i.test(a)
607		|| /1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(a.substr(0,4))
608})(navigator.userAgent||navigator.vendor||window.opera);

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.