From 5a07a91b507ebeb77677adc4649c28e6ad4933a2 Mon Sep 17 00:00:00 2001 From: RuoYi Date: Fri, 7 Apr 2023 19:38:29 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8D=87=E7=BA=A7jasny-bootstrap=E5=88=B0?= =?UTF-8?q?=E6=9C=80=E6=96=B0=E7=89=884.0.0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../static/ajax/libs/jasny/jasny-bootstrap.js | 1029 +++-------------- .../ajax/libs/jasny/jasny-bootstrap.min.js | 4 +- 2 files changed, 166 insertions(+), 867 deletions(-) diff --git a/ruoyi-admin/src/main/resources/static/ajax/libs/jasny/jasny-bootstrap.js b/ruoyi-admin/src/main/resources/static/ajax/libs/jasny/jasny-bootstrap.js index 6aa66807..870ad9f3 100644 --- a/ruoyi-admin/src/main/resources/static/ajax/libs/jasny/jasny-bootstrap.js +++ b/ruoyi-admin/src/main/resources/static/ajax/libs/jasny/jasny-bootstrap.js @@ -1,848 +1,9 @@ /*! - * Jasny Bootstrap v3.1.3 (http://jasny.github.io/bootstrap) + * Jasny Bootstrap v4.0.0 (http://jasny.github.io/bootstrap) * Copyright 2012-2014 Arnold Daniels * Licensed under Apache-2.0 (https://github.com/jasny/bootstrap/blob/master/LICENSE) */ -if (typeof jQuery === 'undefined') { throw new Error('Jasny Bootstrap\'s JavaScript requires jQuery') } - -/* ======================================================================== - * Bootstrap: transition.js v3.1.3 - * http://getbootstrap.com/javascript/#transitions - * ======================================================================== - * Copyright 2011-2014 Twitter, Inc. - * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) - * ======================================================================== */ - - -+function ($) { - 'use strict'; - - // CSS TRANSITION SUPPORT (Shoutout: http://www.modernizr.com/) - // ============================================================ - - function transitionEnd() { - var el = document.createElement('bootstrap') - - var transEndEventNames = { - WebkitTransition : 'webkitTransitionEnd', - MozTransition : 'transitionend', - OTransition : 'oTransitionEnd otransitionend', - transition : 'transitionend' - } - - for (var name in transEndEventNames) { - if (el.style[name] !== undefined) { - return { end: transEndEventNames[name] } - } - } - - return false // explicit for ie8 ( ._.) - } - - if ($.support.transition !== undefined) return // Prevent conflict with Twitter Bootstrap - - // http://blog.alexmaccaw.com/css-transitions - $.fn.emulateTransitionEnd = function (duration) { - var called = false, $el = this - $(this).one($.support.transition.end, function () { called = true }) - var callback = function () { if (!called) $($el).trigger($.support.transition.end) } - setTimeout(callback, duration) - return this - } - - $(function () { - $.support.transition = transitionEnd() - }) - -}(window.jQuery); - -/* ======================================================================== - * Bootstrap: offcanvas.js v3.1.3 - * http://jasny.github.io/bootstrap/javascript/#offcanvas - * ======================================================================== - * Copyright 2013-2014 Arnold Daniels - * - * 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. - * ======================================================================== */ - -+function ($) { "use strict"; - - // OFFCANVAS PUBLIC CLASS DEFINITION - // ================================= - - var OffCanvas = function (element, options) { - this.$element = $(element) - this.options = $.extend({}, OffCanvas.DEFAULTS, options) - this.state = null - this.placement = null - - if (this.options.recalc) { - this.calcClone() - $(window).on('resize', $.proxy(this.recalc, this)) - } - - if (this.options.autohide) - $(document).on('click', $.proxy(this.autohide, this)) - - if (this.options.toggle) this.toggle() - - if (this.options.disablescrolling) { - this.options.disableScrolling = this.options.disablescrolling - delete this.options.disablescrolling - } - } - - OffCanvas.DEFAULTS = { - toggle: true, - placement: 'auto', - autohide: true, - recalc: true, - disableScrolling: true - } - - OffCanvas.prototype.offset = function () { - switch (this.placement) { - case 'left': - case 'right': return this.$element.outerWidth() - case 'top': - case 'bottom': return this.$element.outerHeight() - } - } - - OffCanvas.prototype.calcPlacement = function () { - if (this.options.placement !== 'auto') { - this.placement = this.options.placement - return - } - - if (!this.$element.hasClass('in')) { - this.$element.css('visiblity', 'hidden !important').addClass('in') - } - - var horizontal = $(window).width() / this.$element.width() - var vertical = $(window).height() / this.$element.height() - - var element = this.$element - function ab(a, b) { - if (element.css(b) === 'auto') return a - if (element.css(a) === 'auto') return b - - var size_a = parseInt(element.css(a), 10) - var size_b = parseInt(element.css(b), 10) - - return size_a > size_b ? b : a - } - - this.placement = horizontal >= vertical ? ab('left', 'right') : ab('top', 'bottom') - - if (this.$element.css('visibility') === 'hidden !important') { - this.$element.removeClass('in').css('visiblity', '') - } - } - - OffCanvas.prototype.opposite = function (placement) { - switch (placement) { - case 'top': return 'bottom' - case 'left': return 'right' - case 'bottom': return 'top' - case 'right': return 'left' - } - } - - OffCanvas.prototype.getCanvasElements = function() { - // Return a set containing the canvas plus all fixed elements - var canvas = this.options.canvas ? $(this.options.canvas) : this.$element - - var fixed_elements = canvas.find('*').filter(function() { - return $(this).css('position') === 'fixed' - }).not(this.options.exclude) - - return canvas.add(fixed_elements) - } - - OffCanvas.prototype.slide = function (elements, offset, callback) { - // Use jQuery animation if CSS transitions aren't supported - if (!$.support.transition) { - var anim = {} - anim[this.placement] = "+=" + offset - return elements.animate(anim, 350, callback) - } - - var placement = this.placement - var opposite = this.opposite(placement) - - elements.each(function() { - if ($(this).css(placement) !== 'auto') - $(this).css(placement, (parseInt($(this).css(placement), 10) || 0) + offset) - - if ($(this).css(opposite) !== 'auto') - $(this).css(opposite, (parseInt($(this).css(opposite), 10) || 0) - offset) - }) - - this.$element - .one($.support.transition.end, callback) - .emulateTransitionEnd(350) - } - - OffCanvas.prototype.disableScrolling = function() { - var bodyWidth = $('body').width() - var prop = 'padding-' + this.opposite(this.placement) - - if ($('body').data('offcanvas-style') === undefined) { - $('body').data('offcanvas-style', $('body').attr('style') || '') - } - - $('body').css('overflow', 'hidden') - - if ($('body').width() > bodyWidth) { - var padding = parseInt($('body').css(prop), 10) + $('body').width() - bodyWidth - - setTimeout(function() { - $('body').css(prop, padding) - }, 1) - } - } - - OffCanvas.prototype.show = function () { - if (this.state) return - - var startEvent = $.Event('show.bs.offcanvas') - this.$element.trigger(startEvent) - if (startEvent.isDefaultPrevented()) return - - this.state = 'slide-in' - this.calcPlacement(); - - var elements = this.getCanvasElements() - var placement = this.placement - var opposite = this.opposite(placement) - var offset = this.offset() - - if (elements.index(this.$element) !== -1) { - $(this.$element).data('offcanvas-style', $(this.$element).attr('style') || '') - this.$element.css(placement, -1 * offset) - this.$element.css(placement); // Workaround: Need to get the CSS property for it to be applied before the next line of code - } - - elements.addClass('canvas-sliding').each(function() { - if ($(this).data('offcanvas-style') === undefined) $(this).data('offcanvas-style', $(this).attr('style') || '') - if ($(this).css('position') === 'static') $(this).css('position', 'relative') - if (($(this).css(placement) === 'auto' || $(this).css(placement) === '0px') && - ($(this).css(opposite) === 'auto' || $(this).css(opposite) === '0px')) { - $(this).css(placement, 0) - } - }) - - if (this.options.disableScrolling) this.disableScrolling() - - var complete = function () { - if (this.state != 'slide-in') return - - this.state = 'slid' - - elements.removeClass('canvas-sliding').addClass('canvas-slid') - this.$element.trigger('shown.bs.offcanvas') - } - - setTimeout($.proxy(function() { - this.$element.addClass('in') - this.slide(elements, offset, $.proxy(complete, this)) - }, this), 1) - } - - OffCanvas.prototype.hide = function (fast) { - if (this.state !== 'slid') return - - var startEvent = $.Event('hide.bs.offcanvas') - this.$element.trigger(startEvent) - if (startEvent.isDefaultPrevented()) return - - this.state = 'slide-out' - - var elements = $('.canvas-slid') - var placement = this.placement - var offset = -1 * this.offset() - - var complete = function () { - if (this.state != 'slide-out') return - - this.state = null - this.placement = null - - this.$element.removeClass('in') - - elements.removeClass('canvas-sliding') - elements.add(this.$element).add('body').each(function() { - $(this).attr('style', $(this).data('offcanvas-style')).removeData('offcanvas-style') - }) - - this.$element.trigger('hidden.bs.offcanvas') - } - - elements.removeClass('canvas-slid').addClass('canvas-sliding') - - setTimeout($.proxy(function() { - this.slide(elements, offset, $.proxy(complete, this)) - }, this), 1) - } - - OffCanvas.prototype.toggle = function () { - if (this.state === 'slide-in' || this.state === 'slide-out') return - this[this.state === 'slid' ? 'hide' : 'show']() - } - - OffCanvas.prototype.calcClone = function() { - this.$calcClone = this.$element.clone() - .html('') - .addClass('offcanvas-clone').removeClass('in') - .appendTo($('body')) - } - - OffCanvas.prototype.recalc = function () { - if (this.$calcClone.css('display') === 'none' || (this.state !== 'slid' && this.state !== 'slide-in')) return - - this.state = null - this.placement = null - var elements = this.getCanvasElements() - - this.$element.removeClass('in') - - elements.removeClass('canvas-slid') - elements.add(this.$element).add('body').each(function() { - $(this).attr('style', $(this).data('offcanvas-style')).removeData('offcanvas-style') - }) - } - - OffCanvas.prototype.autohide = function (e) { - if ($(e.target).closest(this.$element).length === 0) this.hide() - } - - // OFFCANVAS PLUGIN DEFINITION - // ========================== - - var old = $.fn.offcanvas - - $.fn.offcanvas = function (option) { - return this.each(function () { - var $this = $(this) - var data = $this.data('bs.offcanvas') - var options = $.extend({}, OffCanvas.DEFAULTS, $this.data(), typeof option === 'object' && option) - - if (!data) $this.data('bs.offcanvas', (data = new OffCanvas(this, options))) - if (typeof option === 'string') data[option]() - }) - } - - $.fn.offcanvas.Constructor = OffCanvas - - - // OFFCANVAS NO CONFLICT - // ==================== - - $.fn.offcanvas.noConflict = function () { - $.fn.offcanvas = old - return this - } - - - // OFFCANVAS DATA-API - // ================= - - $(document).on('click.bs.offcanvas.data-api', '[data-toggle=offcanvas]', function (e) { - var $this = $(this), href - var target = $this.attr('data-target') - || e.preventDefault() - || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '') //strip for ie7 - var $canvas = $(target) - var data = $canvas.data('bs.offcanvas') - var option = data ? 'toggle' : $this.data() - - e.stopPropagation() - - if (data) data.toggle() - else $canvas.offcanvas(option) - }) - -}(window.jQuery); - -/* ============================================================ - * Bootstrap: rowlink.js v3.1.3 - * http://jasny.github.io/bootstrap/javascript/#rowlink - * ============================================================ - * Copyright 2012-2014 Arnold Daniels - * - * 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. - * ============================================================ */ - -+function ($) { "use strict"; - - var Rowlink = function (element, options) { - this.$element = $(element) - this.options = $.extend({}, Rowlink.DEFAULTS, options) - - this.$element.on('click.bs.rowlink', 'td:not(.rowlink-skip)', $.proxy(this.click, this)) - } - - Rowlink.DEFAULTS = { - target: "a" - } - - Rowlink.prototype.click = function(e) { - var target = $(e.currentTarget).closest('tr').find(this.options.target)[0] - if ($(e.target)[0] === target) return - - e.preventDefault(); - - if (target.click) { - target.click() - } else if (document.createEvent) { - var evt = document.createEvent("MouseEvents"); - evt.initMouseEvent("click", true, true, window, 0, 0, 0, 0, 0, false, false, false, false, 0, null); - target.dispatchEvent(evt); - } - } - - - // ROWLINK PLUGIN DEFINITION - // =========================== - - var old = $.fn.rowlink - - $.fn.rowlink = function (options) { - return this.each(function () { - var $this = $(this) - var data = $this.data('bs.rowlink') - if (!data) $this.data('bs.rowlink', (data = new Rowlink(this, options))) - }) - } - - $.fn.rowlink.Constructor = Rowlink - - - // ROWLINK NO CONFLICT - // ==================== - - $.fn.rowlink.noConflict = function () { - $.fn.rowlink = old - return this - } - - - // ROWLINK DATA-API - // ================== - - $(document).on('click.bs.rowlink.data-api', '[data-link="row"]', function (e) { - if ($(e.target).closest('.rowlink-skip').length !== 0) return - - var $this = $(this) - if ($this.data('bs.rowlink')) return - $this.rowlink($this.data()) - $(e.target).trigger('click.bs.rowlink') - }) - -}(window.jQuery); - -/* =========================================================== - * Bootstrap: inputmask.js v3.1.0 - * http://jasny.github.io/bootstrap/javascript/#inputmask - * - * Based on Masked Input plugin by Josh Bush (digitalbush.com) - * =========================================================== - * Copyright 2012-2014 Arnold Daniels - * - * 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. - * ========================================================== */ - -+function ($) { "use strict"; - - var isIphone = (window.orientation !== undefined) - var isAndroid = navigator.userAgent.toLowerCase().indexOf("android") > -1 - var isIE = window.navigator.appName == 'Microsoft Internet Explorer' - - // INPUTMASK PUBLIC CLASS DEFINITION - // ================================= - - var Inputmask = function (element, options) { - if (isAndroid) return // No support because caret positioning doesn't work on Android - - this.$element = $(element) - this.options = $.extend({}, Inputmask.DEFAULTS, options) - this.mask = String(this.options.mask) - - this.init() - this.listen() - - this.checkVal() //Perform initial check for existing values - } - - Inputmask.DEFAULTS = { - mask: "", - placeholder: "_", - definitions: { - '9': "[0-9]", - 'a': "[A-Za-z]", - 'w': "[A-Za-z0-9]", - '*': "." - } - } - - Inputmask.prototype.init = function() { - var defs = this.options.definitions - var len = this.mask.length - - this.tests = [] - this.partialPosition = this.mask.length - this.firstNonMaskPos = null - - $.each(this.mask.split(""), $.proxy(function(i, c) { - if (c == '?') { - len-- - this.partialPosition = i - } else if (defs[c]) { - this.tests.push(new RegExp(defs[c])) - if (this.firstNonMaskPos === null) - this.firstNonMaskPos = this.tests.length - 1 - } else { - this.tests.push(null) - } - }, this)) - - this.buffer = $.map(this.mask.split(""), $.proxy(function(c, i) { - if (c != '?') return defs[c] ? this.options.placeholder : c - }, this)) - - this.focusText = this.$element.val() - - this.$element.data("rawMaskFn", $.proxy(function() { - return $.map(this.buffer, function(c, i) { - return this.tests[i] && c != this.options.placeholder ? c : null - }).join('') - }, this)) - } - - Inputmask.prototype.listen = function() { - if (this.$element.attr("readonly")) return - - var pasteEventName = (isIE ? 'paste' : 'input') + ".mask" - - this.$element - .on("unmask.bs.inputmask", $.proxy(this.unmask, this)) - - .on("focus.bs.inputmask", $.proxy(this.focusEvent, this)) - .on("blur.bs.inputmask", $.proxy(this.blurEvent, this)) - - .on("keydown.bs.inputmask", $.proxy(this.keydownEvent, this)) - .on("keypress.bs.inputmask", $.proxy(this.keypressEvent, this)) - - .on(pasteEventName, $.proxy(this.pasteEvent, this)) - } - - //Helper Function for Caret positioning - Inputmask.prototype.caret = function(begin, end) { - if (this.$element.length === 0) return - if (typeof begin == 'number') { - end = (typeof end == 'number') ? end : begin - return this.$element.each(function() { - if (this.setSelectionRange) { - this.setSelectionRange(begin, end) - } else if (this.createTextRange) { - var range = this.createTextRange() - range.collapse(true) - range.moveEnd('character', end) - range.moveStart('character', begin) - range.select() - } - }) - } else { - if (this.$element[0].setSelectionRange) { - begin = this.$element[0].selectionStart - end = this.$element[0].selectionEnd - } else if (document.selection && document.selection.createRange) { - var range = document.selection.createRange() - begin = 0 - range.duplicate().moveStart('character', -100000) - end = begin + range.text.length - } - return { - begin: begin, - end: end - } - } - } - - Inputmask.prototype.seekNext = function(pos) { - var len = this.mask.length - while (++pos <= len && !this.tests[pos]); - - return pos - } - - Inputmask.prototype.seekPrev = function(pos) { - while (--pos >= 0 && !this.tests[pos]); - - return pos - } - - Inputmask.prototype.shiftL = function(begin,end) { - var len = this.mask.length - - if (begin < 0) return - - for (var i = begin, j = this.seekNext(end); i < len; i++) { - if (this.tests[i]) { - if (j < len && this.tests[i].test(this.buffer[j])) { - this.buffer[i] = this.buffer[j] - this.buffer[j] = this.options.placeholder - } else - break - j = this.seekNext(j) - } - } - this.writeBuffer() - this.caret(Math.max(this.firstNonMaskPos, begin)) - } - - Inputmask.prototype.shiftR = function(pos) { - var len = this.mask.length - - for (var i = pos, c = this.options.placeholder; i < len; i++) { - if (this.tests[i]) { - var j = this.seekNext(i) - var t = this.buffer[i] - this.buffer[i] = c - if (j < len && this.tests[j].test(t)) - c = t - else - break - } - } - }, - - Inputmask.prototype.unmask = function() { - this.$element - .unbind(".mask") - .removeData("inputmask") - } - - Inputmask.prototype.focusEvent = function() { - this.focusText = this.$element.val() - var len = this.mask.length - var pos = this.checkVal() - this.writeBuffer() - - var that = this - var moveCaret = function() { - if (pos == len) - that.caret(0, pos) - else - that.caret(pos) - } - - moveCaret() - setTimeout(moveCaret, 50) - } - - Inputmask.prototype.blurEvent = function() { - this.checkVal() - if (this.$element.val() !== this.focusText) - this.$element.trigger('change') - } - - Inputmask.prototype.keydownEvent = function(e) { - var k = e.which - - //backspace, delete, and escape get special treatment - if (k == 8 || k == 46 || (isIphone && k == 127)) { - var pos = this.caret(), - begin = pos.begin, - end = pos.end - - if (end - begin === 0) { - begin = k != 46 ? this.seekPrev(begin) : (end = this.seekNext(begin - 1)) - end = k == 46 ? this.seekNext(end) : end - } - this.clearBuffer(begin, end) - this.shiftL(begin, end - 1) - - return false - } else if (k == 27) {//escape - this.$element.val(this.focusText) - this.caret(0, this.checkVal()) - return false - } - } - - Inputmask.prototype.keypressEvent = function(e) { - var len = this.mask.length - - var k = e.which, - pos = this.caret() - - if (e.ctrlKey || e.altKey || e.metaKey || k < 32) {//Ignore - return true - } else if (k) { - if (pos.end - pos.begin !== 0) { - this.clearBuffer(pos.begin, pos.end) - this.shiftL(pos.begin, pos.end - 1) - } - - var p = this.seekNext(pos.begin - 1) - if (p < len) { - var c = String.fromCharCode(k) - if (this.tests[p].test(c)) { - this.shiftR(p) - this.buffer[p] = c - this.writeBuffer() - var next = this.seekNext(p) - this.caret(next) - } - } - return false - } - } - - Inputmask.prototype.pasteEvent = function() { - var that = this - - setTimeout(function() { - that.caret(that.checkVal(true)) - }, 0) - } - - Inputmask.prototype.clearBuffer = function(start, end) { - var len = this.mask.length - - for (var i = start; i < end && i < len; i++) { - if (this.tests[i]) - this.buffer[i] = this.options.placeholder - } - } - - Inputmask.prototype.writeBuffer = function() { - return this.$element.val(this.buffer.join('')).val() - } - - Inputmask.prototype.checkVal = function(allow) { - var len = this.mask.length - //try to place characters where they belong - var test = this.$element.val() - var lastMatch = -1 - - for (var i = 0, pos = 0; i < len; i++) { - if (this.tests[i]) { - this.buffer[i] = this.options.placeholder - while (pos++ < test.length) { - var c = test.charAt(pos - 1) - if (this.tests[i].test(c)) { - this.buffer[i] = c - lastMatch = i - break - } - } - if (pos > test.length) - break - } else if (this.buffer[i] == test.charAt(pos) && i != this.partialPosition) { - pos++ - lastMatch = i - } - } - if (!allow && lastMatch + 1 < this.partialPosition) { - this.$element.val("") - this.clearBuffer(0, len) - } else if (allow || lastMatch + 1 >= this.partialPosition) { - this.writeBuffer() - if (!allow) this.$element.val(this.$element.val().substring(0, lastMatch + 1)) - } - return (this.partialPosition ? i : this.firstNonMaskPos) - } - - - // INPUTMASK PLUGIN DEFINITION - // =========================== - - var old = $.fn.inputmask - - $.fn.inputmask = function (options) { - return this.each(function () { - var $this = $(this) - var data = $this.data('bs.inputmask') - - if (!data) $this.data('bs.inputmask', (data = new Inputmask(this, options))) - }) - } - - $.fn.inputmask.Constructor = Inputmask - - - // INPUTMASK NO CONFLICT - // ==================== - - $.fn.inputmask.noConflict = function () { - $.fn.inputmask = old - return this - } - - - // INPUTMASK DATA-API - // ================== - - $(document).on('focus.bs.inputmask.data-api', '[data-mask]', function (e) { - var $this = $(this) - if ($this.data('bs.inputmask')) return - $this.inputmask($this.data()) - }) - -}(window.jQuery); - -/* =========================================================== - * Bootstrap: fileinput.js v3.1.3 - * http://jasny.github.com/bootstrap/javascript/#fileinput - * =========================================================== - * Copyright 2012-2014 Arnold Daniels - * - * 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. - * ========================================================== */ - +function ($) { "use strict"; var isIE = window.navigator.appName == 'Microsoft Internet Explorer' @@ -852,11 +13,11 @@ if (typeof jQuery === 'undefined') { throw new Error('Jasny Bootstrap\'s JavaScr var Fileinput = function (element, options) { this.$element = $(element) - + + this.options = $.extend({}, Fileinput.DEFAULTS, options) this.$input = this.$element.find(':file') if (this.$input.length === 0) return - alert(this.$input.attr('name')); this.name = this.$input.attr('name') || options.name this.$hidden = this.$element.find('input[type=hidden][name="' + this.name + '"]') @@ -869,31 +30,62 @@ if (typeof jQuery === 'undefined') { throw new Error('Jasny Bootstrap\'s JavaScr if (this.$preview.css('display') !== 'inline' && height !== '0px' && height !== 'none') { this.$preview.css('line-height', height) } - + this.original = { exists: this.$element.hasClass('fileinput-exists'), preview: this.$preview.html(), hiddenVal: this.$hidden.val() } - + this.listen() + this.reset() } - + + Fileinput.DEFAULTS = { + clearName: true + } + Fileinput.prototype.listen = function() { this.$input.on('change.bs.fileinput', $.proxy(this.change, this)) $(this.$input[0].form).on('reset.bs.fileinput', $.proxy(this.reset, this)) - + this.$element.find('[data-trigger="fileinput"]').on('click.bs.fileinput', $.proxy(this.trigger, this)) this.$element.find('[data-dismiss="fileinput"]').on('click.bs.fileinput', $.proxy(this.clear, this)) }, + Fileinput.prototype.verifySizes = function(files) { + if (typeof this.options.maxSize === 'undefined') return true + + var max = parseFloat(this.options.maxSize) + if (max !== this.options.maxSize) return true + + for (var i = 0; i < files.length; i++) { + var size = typeof files[i].size !== 'undefined' ? files[i].size : null + if (size === null) continue + + size = size / 1000 / 1000 /* convert from bytes to MB */ + if (size > max) return false + } + + return true + } + Fileinput.prototype.change = function(e) { var files = e.target.files === undefined ? (e.target && e.target.value ? [{ name: e.target.value.replace(/^.+\\/, '')}] : []) : e.target.files - + e.stopPropagation() if (files.length === 0) { this.clear() + this.$element.trigger('clear.bs.fileinput') + return + } + + if (!this.verifySizes(files)) { + this.$element.trigger('max_size.bs.fileinput') + + this.clear() + this.$element.trigger('clear.bs.fileinput') return } @@ -903,7 +95,8 @@ if (typeof jQuery === 'undefined') { throw new Error('Jasny Bootstrap\'s JavaScr var file = files[0] - if (this.$preview.length > 0 && (typeof file.type !== "undefined" ? file.type.match(/^image\/(gif|png|jpeg)$/) : file.name.match(/\.(gif|png|jpe?g)$/i)) && typeof FileReader !== "undefined") { + if (this.$preview.length > 0 && (typeof file.type !== "undefined" ? file.type.match(/^image\/(gif|png|jpeg|svg\+xml)$/) : file.name.match(/\.(gif|png|jpe?g|svg)$/i)) && typeof FileReader !== "undefined") { + var Fileinput = this var reader = new FileReader() var preview = this.$preview var element = this.$element @@ -912,13 +105,25 @@ if (typeof jQuery === 'undefined') { throw new Error('Jasny Bootstrap\'s JavaScr var $img = $('') $img[0].src = re.target.result files[0].result = re.target.result - + element.find('.fileinput-filename').text(file.name) - + // if parent has max-height, using `(max-)height: 100%` on child doesn't take padding and border into account - if (preview.css('max-height') != 'none') $img.css('max-height', parseInt(preview.css('max-height'), 10) - parseInt(preview.css('padding-top'), 10) - parseInt(preview.css('padding-bottom'), 10) - parseInt(preview.css('border-top'), 10) - parseInt(preview.css('border-bottom'), 10)) - + if (preview.css('max-height') != 'none') { + var mh = parseInt(preview.css('max-height'), 10) || 0 + var pt = parseInt(preview.css('padding-top'), 10) || 0 + var pb = parseInt(preview.css('padding-bottom'), 10) || 0 + var bt = parseInt(preview.css('border-top'), 10) || 0 + var bb = parseInt(preview.css('border-bottom'), 10) || 0 + + $img.css('max-height', mh - pt - pb - bt - bb) + } + preview.html($img) + if (Fileinput.options.exif) { + //Fix image tranformation if this is possible + Fileinput.setImageTransform($img, file); + } element.addClass('fileinput-exists').removeClass('fileinput-new') element.trigger('change.bs.fileinput', files) @@ -926,24 +131,118 @@ if (typeof jQuery === 'undefined') { throw new Error('Jasny Bootstrap\'s JavaScr reader.readAsDataURL(file) } else { - this.$element.find('.fileinput-filename').text(file.name) + var text = file.name + var $nameView = this.$element.find('.fileinput-filename') + + if (files.length > 1) { + text = $.map(files, function(file) { + return file.name; + }).join(', ') + } + + $nameView.text(text) this.$preview.text(file.name) - this.$element.addClass('fileinput-exists').removeClass('fileinput-new') - this.$element.trigger('change.bs.fileinput') } }, + Fileinput.prototype.setImageTransform = function($img, file) { + var Fileinput = this; + var reader = new FileReader(); + reader.onload = function(me) { + var transform = false; + var view = new DataView(reader.result); + var exif = Fileinput.getImageExif(view); + if (exif) { + Fileinput.resetOrientation($img, exif); + } + } + + reader.readAsArrayBuffer(file); + } + + Fileinput.prototype.getImageExif = function(view) { + if (view.getUint16(0, false) != 0xFFD8) { + return -2; + } + var length = view.byteLength, offset = 2; + while (offset < length) { + var marker = view.getUint16(offset, false); + offset += 2; + if (marker == 0xFFE1) { + if (view.getUint32(offset += 2, false) != 0x45786966) { + return -1; + } + var little = view.getUint16(offset += 6, false) == 0x4949; + offset += view.getUint32(offset + 4, little); + var tags = view.getUint16(offset, little); + offset += 2; + for (var i = 0; i < tags; i++) { + if (view.getUint16(offset + (i * 12), little) == 0x0112) { + return view.getUint16(offset + (i * 12) + 8, little); + } + } + } + else if ((marker & 0xFF00) != 0xFF00){ + break; + } else { + offset += view.getUint16(offset, false); + } + } + + return -1; + } + + Fileinput.prototype.resetOrientation = function($img, transform) { + var img = new Image(); + + img.onload = function() { + var width = img.width, + height = img.height, + canvas = document.createElement('canvas'), + ctx = canvas.getContext("2d"); + + // set proper canvas dimensions before transform & export + if ([5,6,7,8].indexOf(transform) > -1) { + canvas.width = height; + canvas.height = width; + } else { + canvas.width = width; + canvas.height = height; + } + + // transform context before drawing image + switch (transform) { + case 2: ctx.transform(-1, 0, 0, 1, width, 0); break; + case 3: ctx.transform(-1, 0, 0, -1, width, height ); break; + case 4: ctx.transform(1, 0, 0, -1, 0, height ); break; + case 5: ctx.transform(0, 1, 1, 0, 0, 0); break; + case 6: ctx.transform(0, 1, -1, 0, height , 0); break; + case 7: ctx.transform(0, -1, -1, 0, height , width); break; + case 8: ctx.transform(0, -1, 1, 0, 0, width); break; + default: ctx.transform(1, 0, 0, 1, 0, 0); + } + + // draw image + ctx.drawImage(img, 0, 0); + + // export base64 + $img.attr('src', canvas.toDataURL()); + }; + + img.src = $img.attr('src'); +}; + Fileinput.prototype.clear = function(e) { if (e) e.preventDefault() - + this.$hidden.val('') this.$hidden.attr('name', this.name) - this.$input.attr('name', '') + if (this.options.clearName) this.$input.attr('name', '') //ie8+ doesn't support changing the value of input with type=file so clone instead - if (isIE) { + if (isIE) { var inputClone = this.$input.clone(true); this.$input.after(inputClone); this.$input.remove(); @@ -955,7 +254,7 @@ if (typeof jQuery === 'undefined') { throw new Error('Jasny Bootstrap\'s JavaScr this.$preview.html('') this.$element.find('.fileinput-filename').text('') this.$element.addClass('fileinput-new').removeClass('fileinput-exists') - + if (e !== undefined) { this.$input.trigger('change') this.$element.trigger('clear.bs.fileinput') @@ -971,8 +270,8 @@ if (typeof jQuery === 'undefined') { throw new Error('Jasny Bootstrap\'s JavaScr if (this.original.exists) this.$element.addClass('fileinput-exists').removeClass('fileinput-new') else this.$element.addClass('fileinput-new').removeClass('fileinput-exists') - - this.$element.trigger('reset.bs.fileinput') + + this.$element.trigger('reseted.bs.fileinput') }, Fileinput.prototype.trigger = function(e) { @@ -980,12 +279,12 @@ if (typeof jQuery === 'undefined') { throw new Error('Jasny Bootstrap\'s JavaScr e.preventDefault() } - + // FILEUPLOAD PLUGIN DEFINITION // =========================== var old = $.fn.fileinput - + $.fn.fileinput = function (options) { return this.each(function () { var $this = $(this), @@ -1014,7 +313,7 @@ if (typeof jQuery === 'undefined') { throw new Error('Jasny Bootstrap\'s JavaScr var $this = $(this) if ($this.data('bs.fileinput')) return $this.fileinput($this.data()) - + var $target = $(e.target).closest('[data-dismiss="fileinput"],[data-trigger="fileinput"]'); if ($target.length > 0) { e.preventDefault() @@ -1022,4 +321,4 @@ if (typeof jQuery === 'undefined') { throw new Error('Jasny Bootstrap\'s JavaScr } }) -}(window.jQuery); +}(window.jQuery); \ No newline at end of file diff --git a/ruoyi-admin/src/main/resources/static/ajax/libs/jasny/jasny-bootstrap.min.js b/ruoyi-admin/src/main/resources/static/ajax/libs/jasny/jasny-bootstrap.min.js index 6eb17562..e0f7b8fb 100644 --- a/ruoyi-admin/src/main/resources/static/ajax/libs/jasny/jasny-bootstrap.min.js +++ b/ruoyi-admin/src/main/resources/static/ajax/libs/jasny/jasny-bootstrap.min.js @@ -1,6 +1,6 @@ /*! - * Jasny Bootstrap v3.1.3 (http://jasny.github.io/bootstrap) + * Jasny Bootstrap v4.0.0 (http://jasny.github.io/bootstrap) * Copyright 2012-2014 Arnold Daniels * Licensed under Apache-2.0 (https://github.com/jasny/bootstrap/blob/master/LICENSE) */ -if("undefined"==typeof jQuery)throw new Error("Jasny Bootstrap's JavaScript requires jQuery");+function(a){"use strict";function b(){var a=document.createElement("bootstrap"),b={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"};for(var c in b)if(void 0!==a.style[c])return{end:b[c]};return!1}void 0===a.support.transition&&(a.fn.emulateTransitionEnd=function(b){var c=!1,d=this;a(this).one(a.support.transition.end,function(){c=!0});var e=function(){c||a(d).trigger(a.support.transition.end)};return setTimeout(e,b),this},a(function(){a.support.transition=b()}))}(window.jQuery),+function(a){"use strict";var b=function(c,d){this.$element=a(c),this.options=a.extend({},b.DEFAULTS,d),this.state=null,this.placement=null,this.options.recalc&&(this.calcClone(),a(window).on("resize",a.proxy(this.recalc,this))),this.options.autohide&&a(document).on("click",a.proxy(this.autohide,this)),this.options.toggle&&this.toggle(),this.options.disablescrolling&&(this.options.disableScrolling=this.options.disablescrolling,delete this.options.disablescrolling)};b.DEFAULTS={toggle:!0,placement:"auto",autohide:!0,recalc:!0,disableScrolling:!0},b.prototype.offset=function(){switch(this.placement){case"left":case"right":return this.$element.outerWidth();case"top":case"bottom":return this.$element.outerHeight()}},b.prototype.calcPlacement=function(){function b(a,b){if("auto"===e.css(b))return a;if("auto"===e.css(a))return b;var c=parseInt(e.css(a),10),d=parseInt(e.css(b),10);return c>d?b:a}if("auto"!==this.options.placement)return void(this.placement=this.options.placement);this.$element.hasClass("in")||this.$element.css("visiblity","hidden !important").addClass("in");var c=a(window).width()/this.$element.width(),d=a(window).height()/this.$element.height(),e=this.$element;this.placement=c>=d?b("left","right"):b("top","bottom"),"hidden !important"===this.$element.css("visibility")&&this.$element.removeClass("in").css("visiblity","")},b.prototype.opposite=function(a){switch(a){case"top":return"bottom";case"left":return"right";case"bottom":return"top";case"right":return"left"}},b.prototype.getCanvasElements=function(){var b=this.options.canvas?a(this.options.canvas):this.$element,c=b.find("*").filter(function(){return"fixed"===a(this).css("position")}).not(this.options.exclude);return b.add(c)},b.prototype.slide=function(b,c,d){if(!a.support.transition){var e={};return e[this.placement]="+="+c,b.animate(e,350,d)}var f=this.placement,g=this.opposite(f);b.each(function(){"auto"!==a(this).css(f)&&a(this).css(f,(parseInt(a(this).css(f),10)||0)+c),"auto"!==a(this).css(g)&&a(this).css(g,(parseInt(a(this).css(g),10)||0)-c)}),this.$element.one(a.support.transition.end,d).emulateTransitionEnd(350)},b.prototype.disableScrolling=function(){var b=a("body").width(),c="padding-"+this.opposite(this.placement);if(void 0===a("body").data("offcanvas-style")&&a("body").data("offcanvas-style",a("body").attr("style")||""),a("body").css("overflow","hidden"),a("body").width()>b){var d=parseInt(a("body").css(c),10)+a("body").width()-b;setTimeout(function(){a("body").css(c,d)},1)}},b.prototype.show=function(){if(!this.state){var b=a.Event("show.bs.offcanvas");if(this.$element.trigger(b),!b.isDefaultPrevented()){this.state="slide-in",this.calcPlacement();var c=this.getCanvasElements(),d=this.placement,e=this.opposite(d),f=this.offset();-1!==c.index(this.$element)&&(a(this.$element).data("offcanvas-style",a(this.$element).attr("style")||""),this.$element.css(d,-1*f),this.$element.css(d)),c.addClass("canvas-sliding").each(function(){void 0===a(this).data("offcanvas-style")&&a(this).data("offcanvas-style",a(this).attr("style")||""),"static"===a(this).css("position")&&a(this).css("position","relative"),"auto"!==a(this).css(d)&&"0px"!==a(this).css(d)||"auto"!==a(this).css(e)&&"0px"!==a(this).css(e)||a(this).css(d,0)}),this.options.disableScrolling&&this.disableScrolling();var g=function(){"slide-in"==this.state&&(this.state="slid",c.removeClass("canvas-sliding").addClass("canvas-slid"),this.$element.trigger("shown.bs.offcanvas"))};setTimeout(a.proxy(function(){this.$element.addClass("in"),this.slide(c,f,a.proxy(g,this))},this),1)}}},b.prototype.hide=function(){if("slid"===this.state){var b=a.Event("hide.bs.offcanvas");if(this.$element.trigger(b),!b.isDefaultPrevented()){this.state="slide-out";var c=a(".canvas-slid"),d=(this.placement,-1*this.offset()),e=function(){"slide-out"==this.state&&(this.state=null,this.placement=null,this.$element.removeClass("in"),c.removeClass("canvas-sliding"),c.add(this.$element).add("body").each(function(){a(this).attr("style",a(this).data("offcanvas-style")).removeData("offcanvas-style")}),this.$element.trigger("hidden.bs.offcanvas"))};c.removeClass("canvas-slid").addClass("canvas-sliding"),setTimeout(a.proxy(function(){this.slide(c,d,a.proxy(e,this))},this),1)}}},b.prototype.toggle=function(){"slide-in"!==this.state&&"slide-out"!==this.state&&this["slid"===this.state?"hide":"show"]()},b.prototype.calcClone=function(){this.$calcClone=this.$element.clone().html("").addClass("offcanvas-clone").removeClass("in").appendTo(a("body"))},b.prototype.recalc=function(){if("none"!==this.$calcClone.css("display")&&("slid"===this.state||"slide-in"===this.state)){this.state=null,this.placement=null;var b=this.getCanvasElements();this.$element.removeClass("in"),b.removeClass("canvas-slid"),b.add(this.$element).add("body").each(function(){a(this).attr("style",a(this).data("offcanvas-style")).removeData("offcanvas-style")})}},b.prototype.autohide=function(b){0===a(b.target).closest(this.$element).length&&this.hide()};var c=a.fn.offcanvas;a.fn.offcanvas=function(c){return this.each(function(){var d=a(this),e=d.data("bs.offcanvas"),f=a.extend({},b.DEFAULTS,d.data(),"object"==typeof c&&c);e||d.data("bs.offcanvas",e=new b(this,f)),"string"==typeof c&&e[c]()})},a.fn.offcanvas.Constructor=b,a.fn.offcanvas.noConflict=function(){return a.fn.offcanvas=c,this},a(document).on("click.bs.offcanvas.data-api","[data-toggle=offcanvas]",function(b){var c,d=a(this),e=d.attr("data-target")||b.preventDefault()||(c=d.attr("href"))&&c.replace(/.*(?=#[^\s]+$)/,""),f=a(e),g=f.data("bs.offcanvas"),h=g?"toggle":d.data();b.stopPropagation(),g?g.toggle():f.offcanvas(h)})}(window.jQuery),+function(a){"use strict";var b=function(c,d){this.$element=a(c),this.options=a.extend({},b.DEFAULTS,d),this.$element.on("click.bs.rowlink","td:not(.rowlink-skip)",a.proxy(this.click,this))};b.DEFAULTS={target:"a"},b.prototype.click=function(b){var c=a(b.currentTarget).closest("tr").find(this.options.target)[0];if(a(b.target)[0]!==c)if(b.preventDefault(),c.click)c.click();else if(document.createEvent){var d=document.createEvent("MouseEvents");d.initMouseEvent("click",!0,!0,window,0,0,0,0,0,!1,!1,!1,!1,0,null),c.dispatchEvent(d)}};var c=a.fn.rowlink;a.fn.rowlink=function(c){return this.each(function(){var d=a(this),e=d.data("bs.rowlink");e||d.data("bs.rowlink",e=new b(this,c))})},a.fn.rowlink.Constructor=b,a.fn.rowlink.noConflict=function(){return a.fn.rowlink=c,this},a(document).on("click.bs.rowlink.data-api",'[data-link="row"]',function(b){if(0===a(b.target).closest(".rowlink-skip").length){var c=a(this);c.data("bs.rowlink")||(c.rowlink(c.data()),a(b.target).trigger("click.bs.rowlink"))}})}(window.jQuery),+function(a){"use strict";var b=void 0!==window.orientation,c=navigator.userAgent.toLowerCase().indexOf("android")>-1,d="Microsoft Internet Explorer"==window.navigator.appName,e=function(b,d){c||(this.$element=a(b),this.options=a.extend({},e.DEFAULTS,d),this.mask=String(this.options.mask),this.init(),this.listen(),this.checkVal())};e.DEFAULTS={mask:"",placeholder:"_",definitions:{9:"[0-9]",a:"[A-Za-z]",w:"[A-Za-z0-9]","*":"."}},e.prototype.init=function(){var b=this.options.definitions,c=this.mask.length;this.tests=[],this.partialPosition=this.mask.length,this.firstNonMaskPos=null,a.each(this.mask.split(""),a.proxy(function(a,d){"?"==d?(c--,this.partialPosition=a):b[d]?(this.tests.push(new RegExp(b[d])),null===this.firstNonMaskPos&&(this.firstNonMaskPos=this.tests.length-1)):this.tests.push(null)},this)),this.buffer=a.map(this.mask.split(""),a.proxy(function(a){return"?"!=a?b[a]?this.options.placeholder:a:void 0},this)),this.focusText=this.$element.val(),this.$element.data("rawMaskFn",a.proxy(function(){return a.map(this.buffer,function(a,b){return this.tests[b]&&a!=this.options.placeholder?a:null}).join("")},this))},e.prototype.listen=function(){if(!this.$element.attr("readonly")){var b=(d?"paste":"input")+".mask";this.$element.on("unmask.bs.inputmask",a.proxy(this.unmask,this)).on("focus.bs.inputmask",a.proxy(this.focusEvent,this)).on("blur.bs.inputmask",a.proxy(this.blurEvent,this)).on("keydown.bs.inputmask",a.proxy(this.keydownEvent,this)).on("keypress.bs.inputmask",a.proxy(this.keypressEvent,this)).on(b,a.proxy(this.pasteEvent,this))}},e.prototype.caret=function(a,b){if(0!==this.$element.length){if("number"==typeof a)return b="number"==typeof b?b:a,this.$element.each(function(){if(this.setSelectionRange)this.setSelectionRange(a,b);else if(this.createTextRange){var c=this.createTextRange();c.collapse(!0),c.moveEnd("character",b),c.moveStart("character",a),c.select()}});if(this.$element[0].setSelectionRange)a=this.$element[0].selectionStart,b=this.$element[0].selectionEnd;else if(document.selection&&document.selection.createRange){var c=document.selection.createRange();a=0-c.duplicate().moveStart("character",-1e5),b=a+c.text.length}return{begin:a,end:b}}},e.prototype.seekNext=function(a){for(var b=this.mask.length;++a<=b&&!this.tests[a];);return a},e.prototype.seekPrev=function(a){for(;--a>=0&&!this.tests[a];);return a},e.prototype.shiftL=function(a,b){var c=this.mask.length;if(!(0>a)){for(var d=a,e=this.seekNext(b);c>d;d++)if(this.tests[d]){if(!(c>e&&this.tests[d].test(this.buffer[e])))break;this.buffer[d]=this.buffer[e],this.buffer[e]=this.options.placeholder,e=this.seekNext(e)}this.writeBuffer(),this.caret(Math.max(this.firstNonMaskPos,a))}},e.prototype.shiftR=function(a){for(var b=this.mask.length,c=a,d=this.options.placeholder;b>c;c++)if(this.tests[c]){var e=this.seekNext(c),f=this.buffer[c];if(this.buffer[c]=d,!(b>e&&this.tests[e].test(f)))break;d=f}},e.prototype.unmask=function(){this.$element.unbind(".mask").removeData("inputmask")},e.prototype.focusEvent=function(){this.focusText=this.$element.val();var a=this.mask.length,b=this.checkVal();this.writeBuffer();var c=this,d=function(){b==a?c.caret(0,b):c.caret(b)};d(),setTimeout(d,50)},e.prototype.blurEvent=function(){this.checkVal(),this.$element.val()!==this.focusText&&this.$element.trigger("change")},e.prototype.keydownEvent=function(a){var c=a.which;if(8==c||46==c||b&&127==c){var d=this.caret(),e=d.begin,f=d.end;return f-e===0&&(e=46!=c?this.seekPrev(e):f=this.seekNext(e-1),f=46==c?this.seekNext(f):f),this.clearBuffer(e,f),this.shiftL(e,f-1),!1}return 27==c?(this.$element.val(this.focusText),this.caret(0,this.checkVal()),!1):void 0},e.prototype.keypressEvent=function(a){var b=this.mask.length,c=a.which,d=this.caret();if(a.ctrlKey||a.altKey||a.metaKey||32>c)return!0;if(c){d.end-d.begin!==0&&(this.clearBuffer(d.begin,d.end),this.shiftL(d.begin,d.end-1));var e=this.seekNext(d.begin-1);if(b>e){var f=String.fromCharCode(c);if(this.tests[e].test(f)){this.shiftR(e),this.buffer[e]=f,this.writeBuffer();var g=this.seekNext(e);this.caret(g)}}return!1}},e.prototype.pasteEvent=function(){var a=this;setTimeout(function(){a.caret(a.checkVal(!0))},0)},e.prototype.clearBuffer=function(a,b){for(var c=this.mask.length,d=a;b>d&&c>d;d++)this.tests[d]&&(this.buffer[d]=this.options.placeholder)},e.prototype.writeBuffer=function(){return this.$element.val(this.buffer.join("")).val()},e.prototype.checkVal=function(a){for(var b=this.mask.length,c=this.$element.val(),d=-1,e=0,f=0;b>e;e++)if(this.tests[e]){for(this.buffer[e]=this.options.placeholder;f++c.length)break}else this.buffer[e]==c.charAt(f)&&e!=this.partialPosition&&(f++,d=e);return!a&&d+1=this.partialPosition)&&(this.writeBuffer(),a||this.$element.val(this.$element.val().substring(0,d+1))),this.partialPosition?e:this.firstNonMaskPos};var f=a.fn.inputmask;a.fn.inputmask=function(b){return this.each(function(){var c=a(this),d=c.data("bs.inputmask");d||c.data("bs.inputmask",d=new e(this,b))})},a.fn.inputmask.Constructor=e,a.fn.inputmask.noConflict=function(){return a.fn.inputmask=f,this},a(document).on("focus.bs.inputmask.data-api","[data-mask]",function(){var b=a(this);b.data("bs.inputmask")||b.inputmask(b.data())})}(window.jQuery),+function(a){"use strict";var b="Microsoft Internet Explorer"==window.navigator.appName,c=function(b,c){if(this.$element=a(b),this.$input=this.$element.find(":file"),0!==this.$input.length){this.name=this.$input.attr("name")||c.name,this.$hidden=this.$element.find('input[type=hidden][name="'+this.name+'"]'),0===this.$hidden.length&&(this.$hidden=a('').insertBefore(this.$input)),this.$preview=this.$element.find(".fileinput-preview");var d=this.$preview.css("height");"inline"!==this.$preview.css("display")&&"0px"!==d&&"none"!==d&&this.$preview.css("line-height",d),this.original={exists:this.$element.hasClass("fileinput-exists"),preview:this.$preview.html(),hiddenVal:this.$hidden.val()},this.listen()}};c.prototype.listen=function(){this.$input.on("change.bs.fileinput",a.proxy(this.change,this)),a(this.$input[0].form).on("reset.bs.fileinput",a.proxy(this.reset,this)),this.$element.find('[data-trigger="fileinput"]').on("click.bs.fileinput",a.proxy(this.trigger,this)),this.$element.find('[data-dismiss="fileinput"]').on("click.bs.fileinput",a.proxy(this.clear,this))},c.prototype.change=function(b){var c=void 0===b.target.files?b.target&&b.target.value?[{name:b.target.value.replace(/^.+\\/,"")}]:[]:b.target.files;if(b.stopPropagation(),0===c.length)return void this.clear();this.$hidden.val(""),this.$hidden.attr("name",""),this.$input.attr("name",this.name);var d=c[0];if(this.$preview.length>0&&("undefined"!=typeof d.type?d.type.match(/^image\/(gif|png|jpeg)$/):d.name.match(/\.(gif|png|jpe?g)$/i))&&"undefined"!=typeof FileReader){var e=new FileReader,f=this.$preview,g=this.$element;e.onload=function(b){var e=a("");e[0].src=b.target.result,c[0].result=b.target.result,g.find(".fileinput-filename").text(d.name),"none"!=f.css("max-height")&&e.css("max-height",parseInt(f.css("max-height"),10)-parseInt(f.css("padding-top"),10)-parseInt(f.css("padding-bottom"),10)-parseInt(f.css("border-top"),10)-parseInt(f.css("border-bottom"),10)),f.html(e),g.addClass("fileinput-exists").removeClass("fileinput-new"),g.trigger("change.bs.fileinput",c)},e.readAsDataURL(d)}else this.$element.find(".fileinput-filename").text(d.name),this.$preview.text(d.name),this.$element.addClass("fileinput-exists").removeClass("fileinput-new"),this.$element.trigger("change.bs.fileinput")},c.prototype.clear=function(a){if(a&&a.preventDefault(),this.$hidden.val(""),this.$hidden.attr("name",this.name),this.$input.attr("name",""),b){var c=this.$input.clone(!0);this.$input.after(c),this.$input.remove(),this.$input=c}else this.$input.val("");this.$preview.html(""),this.$element.find(".fileinput-filename").text(""),this.$element.addClass("fileinput-new").removeClass("fileinput-exists"),void 0!==a&&(this.$input.trigger("change"),this.$element.trigger("clear.bs.fileinput"))},c.prototype.reset=function(){this.clear(),this.$hidden.val(this.original.hiddenVal),this.$preview.html(this.original.preview),this.$element.find(".fileinput-filename").text(""),this.original.exists?this.$element.addClass("fileinput-exists").removeClass("fileinput-new"):this.$element.addClass("fileinput-new").removeClass("fileinput-exists"),this.$element.trigger("reset.bs.fileinput")},c.prototype.trigger=function(a){this.$input.trigger("click"),a.preventDefault()};var d=a.fn.fileinput;a.fn.fileinput=function(b){return this.each(function(){var d=a(this),e=d.data("bs.fileinput");e||d.data("bs.fileinput",e=new c(this,b)),"string"==typeof b&&e[b]()})},a.fn.fileinput.Constructor=c,a.fn.fileinput.noConflict=function(){return a.fn.fileinput=d,this},a(document).on("click.fileinput.data-api",'[data-provides="fileinput"]',function(b){var c=a(this);if(!c.data("bs.fileinput")){c.fileinput(c.data());var d=a(b.target).closest('[data-dismiss="fileinput"],[data-trigger="fileinput"]');d.length>0&&(b.preventDefault(),d.trigger("click.bs.fileinput"))}})}(window.jQuery); \ No newline at end of file ++function($){var isIE=window.navigator.appName=="Microsoft Internet Explorer";var Fileinput=function(element,options){this.$element=$(element);this.options=$.extend({},Fileinput.DEFAULTS,options);this.$input=this.$element.find(":file");if(this.$input.length===0){return}this.name=this.$input.attr("name")||options.name;this.$hidden=this.$element.find('input[type=hidden][name="'+this.name+'"]');if(this.$hidden.length===0){this.$hidden=$('').insertBefore(this.$input)}this.$preview=this.$element.find(".fileinput-preview");var height=this.$preview.css("height");if(this.$preview.css("display")!=="inline"&&height!=="0px"&&height!=="none"){this.$preview.css("line-height",height)}this.original={exists:this.$element.hasClass("fileinput-exists"),preview:this.$preview.html(),hiddenVal:this.$hidden.val()};this.listen();this.reset()};Fileinput.DEFAULTS={clearName:true};Fileinput.prototype.listen=function(){this.$input.on("change.bs.fileinput",$.proxy(this.change,this));$(this.$input[0].form).on("reset.bs.fileinput",$.proxy(this.reset,this));this.$element.find('[data-trigger="fileinput"]').on("click.bs.fileinput",$.proxy(this.trigger,this));this.$element.find('[data-dismiss="fileinput"]').on("click.bs.fileinput",$.proxy(this.clear,this))},Fileinput.prototype.verifySizes=function(files){if(typeof this.options.maxSize==="undefined"){return true}var max=parseFloat(this.options.maxSize);if(max!==this.options.maxSize){return true}for(var i=0;imax){return false}}return true};Fileinput.prototype.change=function(e){var files=e.target.files===undefined?(e.target&&e.target.value?[{name:e.target.value.replace(/^.+\\/,"")}]:[]):e.target.files;e.stopPropagation();if(files.length===0){this.clear();this.$element.trigger("clear.bs.fileinput");return}if(!this.verifySizes(files)){this.$element.trigger("max_size.bs.fileinput");this.clear();this.$element.trigger("clear.bs.fileinput");return}this.$hidden.val("");this.$hidden.attr("name","");this.$input.attr("name",this.name);var file=files[0];if(this.$preview.length>0&&(typeof file.type!=="undefined"?file.type.match(/^image\/(gif|png|jpeg|svg\+xml)$/):file.name.match(/\.(gif|png|jpe?g|svg)$/i))&&typeof FileReader!=="undefined"){var Fileinput=this;var reader=new FileReader();var preview=this.$preview;var element=this.$element;reader.onload=function(re){var $img=$("");$img[0].src=re.target.result;files[0].result=re.target.result;element.find(".fileinput-filename").text(file.name);if(preview.css("max-height")!="none"){var mh=parseInt(preview.css("max-height"),10)||0;var pt=parseInt(preview.css("padding-top"),10)||0;var pb=parseInt(preview.css("padding-bottom"),10)||0;var bt=parseInt(preview.css("border-top"),10)||0;var bb=parseInt(preview.css("border-bottom"),10)||0;$img.css("max-height",mh-pt-pb-bt-bb)}preview.html($img);if(Fileinput.options.exif){Fileinput.setImageTransform($img,file)}element.addClass("fileinput-exists").removeClass("fileinput-new");element.trigger("change.bs.fileinput",files)};reader.readAsDataURL(file)}else{var text=file.name;var $nameView=this.$element.find(".fileinput-filename");if(files.length>1){text=$.map(files,function(file){return file.name}).join(", ")}$nameView.text(text);this.$preview.text(file.name);this.$element.addClass("fileinput-exists").removeClass("fileinput-new");this.$element.trigger("change.bs.fileinput")}},Fileinput.prototype.setImageTransform=function($img,file){var Fileinput=this;var reader=new FileReader();reader.onload=function(me){var transform=false;var view=new DataView(reader.result);var exif=Fileinput.getImageExif(view);if(exif){Fileinput.resetOrientation($img,exif)}};reader.readAsArrayBuffer(file)};Fileinput.prototype.getImageExif=function(view){if(view.getUint16(0,false)!=65496){return -2}var length=view.byteLength,offset=2;while(offset-1){canvas.width=height;canvas.height=width}else{canvas.width=width;canvas.height=height}switch(transform){case 2:ctx.transform(-1,0,0,1,width,0);break;case 3:ctx.transform(-1,0,0,-1,width,height);break;case 4:ctx.transform(1,0,0,-1,0,height);break;case 5:ctx.transform(0,1,1,0,0,0);break;case 6:ctx.transform(0,1,-1,0,height,0);break;case 7:ctx.transform(0,-1,-1,0,height,width);break;case 8:ctx.transform(0,-1,1,0,0,width);break;default:ctx.transform(1,0,0,1,0,0)}ctx.drawImage(img,0,0);$img.attr("src",canvas.toDataURL())};img.src=$img.attr("src")};Fileinput.prototype.clear=function(e){if(e){e.preventDefault()}this.$hidden.val("");this.$hidden.attr("name",this.name);if(this.options.clearName){this.$input.attr("name","")}if(isIE){var inputClone=this.$input.clone(true);this.$input.after(inputClone);this.$input.remove();this.$input=inputClone}else{this.$input.val("")}this.$preview.html("");this.$element.find(".fileinput-filename").text("");this.$element.addClass("fileinput-new").removeClass("fileinput-exists");if(e!==undefined){this.$input.trigger("change");this.$element.trigger("clear.bs.fileinput")}},Fileinput.prototype.reset=function(){this.clear();this.$hidden.val(this.original.hiddenVal);this.$preview.html(this.original.preview);this.$element.find(".fileinput-filename").text("");if(this.original.exists){this.$element.addClass("fileinput-exists").removeClass("fileinput-new")}else{this.$element.addClass("fileinput-new").removeClass("fileinput-exists")}this.$element.trigger("reseted.bs.fileinput")},Fileinput.prototype.trigger=function(e){this.$input.trigger("click");e.preventDefault()};var old=$.fn.fileinput;$.fn.fileinput=function(options){return this.each(function(){var $this=$(this),data=$this.data("bs.fileinput");if(!data){$this.data("bs.fileinput",(data=new Fileinput(this,options)))}if(typeof options=="string"){data[options]()}})};$.fn.fileinput.Constructor=Fileinput;$.fn.fileinput.noConflict=function(){$.fn.fileinput=old;return this};$(document).on("click.fileinput.data-api",'[data-provides="fileinput"]',function(e){var $this=$(this);if($this.data("bs.fileinput")){return}$this.fileinput($this.data());var $target=$(e.target).closest('[data-dismiss="fileinput"],[data-trigger="fileinput"]');if($target.length>0){e.preventDefault();$target.trigger("click.bs.fileinput")}})}(window.jQuery); \ No newline at end of file