++ Dokumente
Bewerbungverhindern
Test
admin
ajaxtabs
bewerbung
ckeditor5
classes
config
datepicker
fancybox-2.1.7
hogrefe
jquery
external
images
jqx
number
build
wan-spinner.css
wan-spinner.js
demo
numbertor
README.md
AUTHORS.txt
LICENSE.txt
bootstrap.min.css
bootstrap.min.js
controls.js
font-awesome.min.css
globalize.culture.de-DE.js
globalize.js
googletag.js
index.html
jquery-1.12.4.js
jquery-1.9.1.js
jquery-3.2.1.min.js
jquery-3.4.1.min.js
jquery-timepicker-1.3.5.zip
jquery-ui-1.12.1.zip
jquery-ui.css
jquery-ui.js
jquery-ui.min.css
jquery-ui.min.js
jquery-ui.structure.css
jquery-ui.structure.min.css
jquery-ui.theme.css
jquery-ui.theme.min.css
jquery.dm-uploader.min.css
jquery.dm-uploader.min.js
jquery.min.js
jquery.mousewheel.js
jquery.timepicker.js
jquery.timepicker.min.css
jquery.timepicker.min.js
jquery.zip
main.css
modernizr-custom.js
modernizr-custom_input.js
modernizr.min.js
package.json
prism-coy.min.css
prism-javascript.min.js
prism.min.js
prx_search.js
style.css
ui-main.js
ui-multiple.js
language
lib
media
mpdf
old_CKEditor_4.6.1
overlib
phpspreadsheet-1.13_php-7.4
phpspreadsheet_1.8.1.0_php-7.0
praxisstelle
status
templates
templates_c
upload
uploads
.gitignore
PHPExcel-1.8.zip
aufl.html
config.inc.php
cr_test.php
cron_remember_mail_dummy.php
cron_remember_mail_kehl.php
cron_remember_mail_lubu.php
cron_remember_upload.php
fetch_gebdat.php
func_age.php
func_fetch_tan.php
func_get_parameter.php
func_get_restplatz.php
func_id.php
func_notenskala.php
func_standard_hs.php
func_tangen.php
func_terminwahl.php
my.jpg
phpoffice_phpspreadsheet_1.13.0.0_require.zip
sepa-ueberweisung.jpg
sepa-ueberweisung2.jpg
tanimport.php
test.pdf
test.php
test1.php
ueberweisungstraeger.png
114 lines
4.0 KiB
JavaScript
Executable File
114 lines
4.0 KiB
JavaScript
Executable File
;
|
|
(function($, window, document, undefined) {
|
|
'use strict';
|
|
|
|
var output = function(msg) {
|
|
window.console && console.log(msg);
|
|
};
|
|
|
|
var WanSpinner = function(element, options) {
|
|
this.defaults = {
|
|
maxValue: 999,
|
|
minValue: -999,
|
|
step: 1,
|
|
start: 1,
|
|
inputWidth: 40,
|
|
plusClick: function(element, val) {
|
|
return true;
|
|
},
|
|
minusClick: function(element, val) {
|
|
return true;
|
|
},
|
|
exceptionFun: function(element, exp) {
|
|
return true;
|
|
},
|
|
valueChanged: function(element, val) {
|
|
return true;
|
|
}
|
|
};
|
|
this.options = $.extend({}, this.defaults, options);
|
|
this.options.stepLength = ((+this.options.step).toString().split('.')[1] || '').length;
|
|
this.options.stepFloat = parseInt(1 * Math.pow(10, this.options.stepLength) / this.options.step) || 1;
|
|
this.element = $(element);
|
|
|
|
this.options.exceptionFunEnable = (typeof(this.options.exceptionFun) === 'function');
|
|
this.options.plusClickEnable = (typeof(this.options.plusClick) === 'function');
|
|
this.options.minusClickEnable = (typeof(this.options.minusClick) === 'function');
|
|
this.options.valueChangedEnable = (typeof(this.options.valueChanged) === 'function');
|
|
|
|
this.element.each(function(index, dt) {
|
|
var input = $(dt).children('input');
|
|
var initValue = input.val() || this.options.start;
|
|
input.val(initValue);
|
|
});
|
|
|
|
this.element.children('input').css('width', this.options.inputWidth);
|
|
|
|
this.EXCEPTION = {
|
|
TOO_LARGE: 1,
|
|
NORMAL: 0,
|
|
TOO_SMALL: -1
|
|
};
|
|
};
|
|
|
|
WanSpinner.prototype.bind = function() {
|
|
var self = this;
|
|
$(self.element).delegate('.minus', 'click', function() {
|
|
var val;
|
|
var input = $(this).siblings('input');
|
|
if (self.options.stepFloat > 1) {
|
|
val = (+input.val() || 0) * self.options.stepFloat - self.options.step * self.options.stepFloat;
|
|
val = Math.round(val) / self.options.stepFloat;
|
|
} else {
|
|
val = (+input.val() || 0) - self.options.step;
|
|
}
|
|
val = val.toFixed(self.options.stepLength);
|
|
if (val < self.options.minValue) {
|
|
self.options.exceptionFunEnable && self.options.exceptionFun($(this).parent(), self.EXCEPTION.TOO_SMALL);
|
|
} else {
|
|
input.val(val);
|
|
self.options.minusClickEnable && self.options.minusClick($(this).parent(), val);
|
|
self.options.valueChangedEnable && self.options.valueChanged($(this).parent(), val);
|
|
}
|
|
return false;
|
|
}).delegate('.plus', 'click', function() {
|
|
var val;
|
|
var input = $(this).siblings('input');
|
|
if (self.options.stepFloat > 1) {
|
|
val = (+input.val() || 0) * self.options.stepFloat + self.options.step * self.options.stepFloat;
|
|
val = Math.round(val) / self.options.stepFloat;
|
|
} else {
|
|
val = (+input.val() || 0) + self.options.step;
|
|
}
|
|
val = val.toFixed(self.options.stepLength);
|
|
if (val > self.options.maxValue) {
|
|
self.options.exceptionFunEnable && self.options.exceptionFun($(this).parent(), self.EXCEPTION.TOO_LARGE);
|
|
} else {
|
|
input.val(val);
|
|
self.options.plusClickEnable && self.options.plusClick($(this).parent(), val);
|
|
self.options.valueChangedEnable && self.options.valueChanged($(this).parent(), val);
|
|
}
|
|
return false;
|
|
}).delegate('input', 'change', function() {
|
|
var val = +$(this).val() || 0;
|
|
if (val > self.options.maxValue) {
|
|
val = self.options.maxValue;
|
|
self.options.exceptionFunEnable && self.options.exceptionFun($(this).parent(), self.EXCEPTION.TOO_LARGE);
|
|
} else if (val < self.options.minValue) {
|
|
val = self.options.minValue;
|
|
self.options.exceptionFunEnable && self.options.exceptionFun($(this).parent(), self.EXCEPTION.TOO_SMALL);
|
|
}
|
|
$(this).val(val);
|
|
self.options.valueChangedEnable && self.options.valueChanged($(this).parent(), val);
|
|
});
|
|
}
|
|
|
|
|
|
$.fn.WanSpinner = function(options) {
|
|
var wanSpinner = new WanSpinner(this, options);
|
|
wanSpinner.bind();
|
|
return this;
|
|
};
|
|
|
|
})(jQuery, window, document);
|