/*----------------------------------------------------------------------------\ | Range Class | |-----------------------------------------------------------------------------| | Created by Erik Arvidsson | | (http://webfx.eae.net/contact.html#erik) | | For WebFX (http://webfx.eae.net/) | |-----------------------------------------------------------------------------| | Used to model the data used when working with sliders, scrollbars and | | progress bars. Based on the ideas of the javax.swing.BoundedRangeModel | | interface defined by Sun for Java; http://java.sun.com/products/jfc/ | | swingdoc-api-1.0.3/com/sun/java/swing/BoundedRangeModel.html | |-----------------------------------------------------------------------------| | Copyright (c) 2002, 2005, 2006 Erik Arvidsson | |-----------------------------------------------------------------------------| | Licensed under the Apache License, Version 2.0 (the "License"); you may not | | use this file except in compliance with the License. You may obtain a copy | | of the License at http://www.apache.org/licenses/LICENSE-2.0 | | - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - | | Unless required by applicable law or agreed to in writing, software | | distributed under the License is distributed on an "AS IS" BASIS, WITHOUT | | WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the | | License for the specific language governing permissions and limitations | | under the License. | |-----------------------------------------------------------------------------| | 2002-10-14 | Original version released | | 2005-10-27 | Use Math.round instead of Math.floor | | 2006-05-28 | Changed license to Apache Software License 2.0. | |-----------------------------------------------------------------------------| | Created 2002-10-14 | All changes are in the log above. | Updated 2006-05-28 | \----------------------------------------------------------------------------*/ function Range() { this._value = 0; this._minimum = 0; this._maximum = 100; this._extent = 0; this._isChanging = false; } Range.prototype.setValue = function (value) { value = Math.round(parseFloat(value)); if (isNaN(value)) return; if (this._value != value) { if (value + this._extent > this._maximum) this._value = this._maximum - this._extent; else if (value < this._minimum) this._value = this._minimum; else this._value = value; if (!this._isChanging && typeof this.onchange == "function") this.onchange(); } }; Range.prototype.getValue = function () { return this._value; }; Range.prototype.setExtent = function (extent) { if (this._extent != extent) { if (extent < 0) this._extent = 0; else if (this._value + extent > this._maximum) this._extent = this._maximum - this._value; else this._extent = extent; if (!this._isChanging && typeof this.onchange == "function") this.onchange(); } }; Range.prototype.getExtent = function () { return this._extent; }; Range.prototype.setMinimum = function (minimum) { if (this._minimum != minimum) { var oldIsChanging = this._isChanging; this._isChanging = true; this._minimum = minimum; if (minimum > this._value) this.setValue(minimum); if (minimum > this._maximum) { this._extent = 0; this.setMaximum(minimum); this.setValue(minimum) } if (minimum + this._extent > this._maximum) this._extent = this._maximum - this._minimum; this._isChanging = oldIsChanging; if (!this._isChanging && typeof this.onchange == "function") this.onchange(); } }; Range.prototype.getMinimum = function () { return this._minimum; }; Range.prototype.setMaximum = function (maximum) { if (this._maximum != maximum) { var oldIsChanging = this._isChanging; this._isChanging = true; this._maximum = maximum; if (maximum < this._value) this.setValue(maximum - this._extent); if (maximum < this._minimum) { this._extent = 0; this.setMinimum(maximum); this.setValue(this._maximum); } if (maximum < this._minimum + this._extent) this._extent = this._maximum - this._minimum; if (maximum < this._value + this._extent) this._extent = this._maximum - this._value; this._isChanging = oldIsChanging; if (!this._isChanging && typeof this.onchange == "function") this.onchange(); } }; Range.prototype.getMaximum = function () { return this._maximum; };
Name | Type | Size | Permission | Actions |
---|---|---|---|---|
help | Folder | 0755 |
|
|
images | Folder | 0755 |
|
|
lang | Folder | 0755 |
|
|
CHANGELOG | File | 1.92 KB | 0644 |
|
acl_security.pl | File | 958 B | 0755 |
|
apply_hdparm.cgi | File | 1.17 KB | 0755 |
|
blink.cgi | File | 384 B | 0755 |
|
cgi_args.pl | File | 483 B | 0755 |
|
config | File | 13 B | 0644 |
|
config.info | File | 144 B | 0644 |
|
config.info.bg | File | 235 B | 0644 |
|
config.info.ca | File | 167 B | 0644 |
|
config.info.de | File | 148 B | 0644 |
|
config.info.fr | File | 167 B | 0644 |
|
config.info.nl | File | 138 B | 0644 |
|
config.info.no | File | 151 B | 0644 |
|
defaultacl | File | 26 B | 0644 |
|
edit_disk.cgi | File | 4.91 KB | 0755 |
|
edit_hdparm.cgi | File | 4.36 KB | 0755 |
|
edit_part.cgi | File | 8.26 KB | 0755 |
|
edit_relabel.cgi | File | 1.32 KB | 0755 |
|
fdisk-lib.pl | File | 48.16 KB | 0755 |
|
feedback_files.pl | File | 115 B | 0755 |
|
fsck.cgi | File | 604 B | 0755 |
|
fsck_form.cgi | File | 700 B | 0755 |
|
index.cgi | File | 2.41 KB | 0755 |
|
log_parser.pl | File | 1.53 KB | 0755 |
|
make_tags.pl | File | 210 B | 0755 |
|
mkfs.cgi | File | 820 B | 0755 |
|
mkfs_form.cgi | File | 832 B | 0755 |
|
module.info | File | 238 B | 0644 |
|
module.info.af | File | 0 B | 0644 |
|
module.info.af.auto | File | 153 B | 0644 |
|
module.info.ar | File | 0 B | 0644 |
|
module.info.ar.auto | File | 209 B | 0644 |
|
module.info.be | File | 0 B | 0644 |
|
module.info.be.auto | File | 249 B | 0644 |
|
module.info.bg | File | 0 B | 0644 |
|
module.info.bg.auto | File | 236 B | 0644 |
|
module.info.ca | File | 119 B | 0644 |
|
module.info.ca.auto | File | 29 B | 0644 |
|
module.info.cs | File | 40 B | 0644 |
|
module.info.cs.auto | File | 130 B | 0644 |
|
module.info.da | File | 0 B | 0644 |
|
module.info.da.auto | File | 149 B | 0644 |
|
module.info.de | File | 131 B | 0644 |
|
module.info.de.auto | File | 26 B | 0644 |
|
module.info.el | File | 0 B | 0644 |
|
module.info.el.auto | File | 299 B | 0644 |
|
module.info.es | File | 38 B | 0644 |
|
module.info.es.auto | File | 112 B | 0644 |
|
module.info.eu | File | 0 B | 0644 |
|
module.info.eu.auto | File | 146 B | 0644 |
|
module.info.fa | File | 0 B | 0644 |
|
module.info.fa.auto | File | 233 B | 0644 |
|
module.info.fi | File | 0 B | 0644 |
|
module.info.fi.auto | File | 149 B | 0644 |
|
module.info.fr | File | 35 B | 0644 |
|
module.info.fr.auto | File | 133 B | 0644 |
|
module.info.he | File | 0 B | 0644 |
|
module.info.he.auto | File | 188 B | 0644 |
|
module.info.hr | File | 0 B | 0644 |
|
module.info.hr.auto | File | 160 B | 0644 |
|
module.info.hu | File | 79 B | 0644 |
|
module.info.hu.auto | File | 26 B | 0644 |
|
module.info.it | File | 0 B | 0644 |
|
module.info.it.auto | File | 152 B | 0644 |
|
module.info.ja | File | 58 B | 0644 |
|
module.info.ja.auto | File | 179 B | 0644 |
|
module.info.ko | File | 36 B | 0644 |
|
module.info.ko.auto | File | 137 B | 0644 |
|
module.info.lt | File | 0 B | 0644 |
|
module.info.lt.auto | File | 163 B | 0644 |
|
module.info.lv | File | 0 B | 0644 |
|
module.info.lv.auto | File | 167 B | 0644 |
|
module.info.ms | File | 120 B | 0644 |
|
module.info.ms.auto | File | 23 B | 0644 |
|
module.info.mt | File | 0 B | 0644 |
|
module.info.mt.auto | File | 153 B | 0644 |
|
module.info.nl | File | 39 B | 0644 |
|
module.info.nl.auto | File | 111 B | 0644 |
|
module.info.no | File | 38 B | 0644 |
|
module.info.no.auto | File | 112 B | 0644 |
|
module.info.pl | File | 38 B | 0644 |
|
module.info.pl.auto | File | 120 B | 0644 |
|
module.info.pt | File | 37 B | 0644 |
|
module.info.pt.auto | File | 116 B | 0644 |
|
module.info.pt_BR | File | 0 B | 0644 |
|
module.info.pt_BR.auto | File | 162 B | 0644 |
|
module.info.ro | File | 0 B | 0644 |
|
module.info.ro.auto | File | 157 B | 0644 |
|
module.info.ru | File | 60 B | 0644 |
|
module.info.ru.auto | File | 185 B | 0644 |
|
module.info.sk | File | 0 B | 0644 |
|
module.info.sk.auto | File | 166 B | 0644 |
|
module.info.sl | File | 0 B | 0644 |
|
module.info.sl.auto | File | 155 B | 0644 |
|
module.info.sv | File | 28 B | 0644 |
|
module.info.sv.auto | File | 116 B | 0644 |
|
module.info.th | File | 0 B | 0644 |
|
module.info.th.auto | File | 303 B | 0644 |
|
module.info.tr | File | 34 B | 0644 |
|
module.info.tr.auto | File | 123 B | 0644 |
|
module.info.uk | File | 0 B | 0644 |
|
module.info.uk.auto | File | 245 B | 0644 |
|
module.info.ur | File | 0 B | 0644 |
|
module.info.ur.auto | File | 266 B | 0644 |
|
module.info.vi | File | 0 B | 0644 |
|
module.info.vi.auto | File | 187 B | 0644 |
|
module.info.zh | File | 27 B | 0644 |
|
module.info.zh.auto | File | 104 B | 0644 |
|
module.info.zh_TW | File | 33 B | 0644 |
|
module.info.zh_TW.auto | File | 110 B | 0644 |
|
range.js | File | 4.7 KB | 0644 |
|
reboot.cgi | File | 261 B | 0755 |
|
relabel.cgi | File | 417 B | 0755 |
|
save_part.cgi | File | 3.75 KB | 0755 |
|
slider.js | File | 14.48 KB | 0644 |
|
timer.js | File | 2.86 KB | 0644 |
|
tunefs.cgi | File | 689 B | 0755 |
|
tunefs_form.cgi | File | 722 B | 0755 |
|
winclassic.css | File | 1.72 KB | 0644 |
|