Heim >Web-Frontend >js-Tutorial >JCALCULATOR
(function(window, $, undefiniert) {
(function() {
var VERSION = '1.0',
PluginName = 'Rechner',
autoInitSelector = '.calculator-here',
$body, $calculatorsContainer,
containerBuilt = false,
baseTemplate = ''
'
displayMode: 'erweitert', showIcon: false, Symbol: 'Fa-Rechner', Position: 'unten links', textAlignment: 'rtl', Thema: „Material“, buttonStyle: null, showMethod: 'klick', showEvent: 'Fokus', Versatz: 12, KeyboardNav: wahr, clearKey: null, plsmnsKey: null, percKey: null, readOnly: wahr, Klassen: '', inline: false, autoClose: false, // calcID: null, // Ereignisse onInput: function() {}, onResult: function() {}, onSelect: '', onShow: '', onHide: '', }, Kalkulator; var Rechner = function(el, Optionen) { this.el = el; this.$el = $(el); this.opts = $.extend(true, {}, defaults, options, this.$el.data()); if ($body === undefiniert) { $body = $('body'); } if (this.el.nodeName == 'INPUT') { this.elIsInput = true; } this.inited = false; this.visible = false; this.silent = false; // Unnötiges Rendern muss verhindert werden this.keys = []; // this._createShortCuts(); this.init() }; Rechner = Rechner; Rechner.prototype = { VERSION: VERSION, init: function() { if (!containerBuilt && !this.opts.inline && this.elIsInput) { this._buildCalculatorsContainer(); } this._buildBaseHtml(); if (this.elIsInput) { if (!this.opts.inline) { // Zusätzliche Klassen für ordnungsgemäße Übergänge festlegen this._setPositionClasses(this.opts.position); this._bindEvents() } this.$calculator.on('mousedown', this._onMouseDownCalculator.bind(this)); this.$calculator.on('mouseup', this._onMouseUpCalculator.bind(this)); } if (this.opts.classes) { this.$calculator.addClass(this.opts.classes) } if (this.opts.keyboardNav) { this._bindKeyboardEvents(); } // this.opts.calcID = 'jCalc_' Math.floor(Math.random() * 10000000 10000); new $.fn.calculator.Body(this, '', this.opts); this.inited = true; }, /* Tastaturbindung */ _bindKeyboardEvents: function() { this.$el.on('keydown.adp', this._onKeyDown.bind(this)); this.$el.on('keyup.adp', this._onKeyUp.bind(this)); this.$el.on('hotKey.adp', this._onHotKey.bind(this)); }, _onKeyDown: function(e) { var code = e.which; this._registerKey(code); if ((code >= 96 && code <p>})(window, jQuery);</p>
Das obige ist der detaillierte Inhalt vonJCALCULATOR. Für weitere Informationen folgen Sie bitte anderen verwandten Artikeln auf der PHP chinesischen Website!