Cleanup bootstrap

This commit is contained in:
djmaze 2020-09-01 21:50:17 +02:00
parent 1802dda136
commit eb5fb5342e
34 changed files with 192 additions and 3044 deletions

View file

@ -84,23 +84,23 @@ Things might work in Edge 18, Firefox 50-62 and Chrome 54-68 due to one polyfill
|js/* |1.14.0 |native |
|----------- |--------: |--------: |
|admin.js |2.130.942 | 963.702 |
|app.js |4.184.455 |2.626.733 |
|admin.js |2.130.942 | 963.418 |
|app.js |4.184.455 |2.626.441 |
|boot.js | 671.522 | 43.824 |
|libs.js | 647.614 | 313.912 |
|libs.js | 647.614 | 313.017 |
|polyfills.js | 325.834 | 0 |
|TOTAL |7.960.367 |3.948.171 |
|TOTAL |7.960.367 |3.946.700 |
|js/min/* |1.14.0 |native |gzip 1.14 |gzip |brotli |
|--------------- |--------: |--------: |--------: |--------: |--------: |
|admin.min.js | 252.147 | 130.802 | 73.657 | 37.916 | 32.474 |
|app.min.js | 511.202 | 354.471 |140.462 | 93.386 | 74.944 |
|admin.min.js | 252.147 | 130.790 | 73.657 | 37.900 | 32.527 |
|app.min.js | 511.202 | 354.459 |140.462 | 93.370 | 74.823 |
|boot.min.js | 66.007 | 5.564 | 22.567 | 2.327 | 1.989 |
|libs.min.js | 572.545 | 297.403 |176.720 | 92.006 | 81.186 |
|libs.min.js | 572.545 | 296.508 |176.720 | 91.754 | 81.012 |
|polyfills.min.js | 32.452 | 0 | 11.312 | 0 | 0 |
|TOTAL |1.434.353 | 788.240 |424.718 |225.635 |190.593 |
|TOTAL |1.434.353 | 788.018 |424.718 |225.351 |190.351 |
646.113 bytes (199.083 gzip) is not much, but it feels faster.
646.335 bytes (199.367 gzip) is not much, but it feels faster.
### CSS changes
@ -125,8 +125,8 @@ Things might work in Edge 18, Firefox 50-62 and Chrome 54-68 due to one polyfill
|css/* |1.14.0 |native |
|-------------- |--------: |--------: |
|app.css | 340.334 | 265.871 |
|app.min.css | 274.791 | 211.493 |
|app.css | 340.334 | 265.090 |
|app.min.css | 274.791 | 210.876 |
### PHP73 branch

9
dev/External/ko.js vendored
View file

@ -119,13 +119,8 @@ ko.bindingHandlers.dropdownCloser = {
ko.bindingHandlers.popover = {
init: (element, fValueAccessor) => {
console.log('TODO: $(element).popover removed', element, fValueAccessor);
/*
$(element).popover(ko.unwrap(fValueAccessor()));
ko.utils.domNodeDisposal.addDisposeCallback(element, () => {
$(element).popover('destroy');
});
*/
const conf = ko.unwrap(fValueAccessor());
element.title = conf.content; // conf.title
}
};

View file

@ -198,45 +198,6 @@ select {
box-shadow: 0px 1px 2px rgba(0,0,0,0.2);
}
.tooltip {
font-size: 14px;
z-index: 2000 !important;
overflow: hidden;
text-overflow: ellipsis;
&.show {
opacity: 1;
}
.tooltip-inner {
max-width: 380px;
text-shadow: 0px 0px 5px rgba(0, 0, 0, 0.2);
padding: 5px 10px;
border-radius: 2px;
overflow: hidden;
text-overflow: ellipsis;
}
.tooltip-big {
font-size: 18px;
padding: 0 10px;
white-space: nowrap;
}
}
.popover {
width: auto;
min-width: 250px;
max-width: 550px;
.popover-content pre {
border: none;
background: rgba(0, 0, 0, 0);
padding: 0;
word-break: normal;
}
}
.btn-group > .btn {
border-radius: 0 !important;
}
@ -322,10 +283,6 @@ select {
color: #555;
}
.popover {
z-index: 2000;
}
html.no-rgba .modal {
border-width: 0px !important;
}
@ -364,12 +321,7 @@ html.no-rgba .modal {
}
.modal.fade {
.transition(none);
top: 0;
}
.modal.fade.show {
top: 0;
transition: none;
}
.modal-backdrop {

View file

@ -1,5 +1,5 @@
<div class="popups">
<div class="modal hide b-domain-content g-ui-user-select-none"
<div class="modal b-domain-content g-ui-user-select-none"
data-bind="modal: modalVisibility, css: {'domain-edit': edit, 'domain-second-page': 'main' !== page()}">
<div class="modal-header">
<button type="button" class="close" data-bind="command: cancelCommand">&times;</button>

View file

@ -1,5 +1,5 @@
<div class="popups">
<div class="modal hide b-plugin-content" data-bind="modal: modalVisibility">
<div class="modal b-plugin-content" data-bind="modal: modalVisibility">
<div class="modal-header">
<button type="button" class="close" data-bind="command: cancelCommand">&times;</button>
<h4>
@ -38,4 +38,4 @@
</a>
</div>
</div>
</div>
</div>

View file

@ -1,5 +1,5 @@
<div class="popups">
<div class="modal hide b-ask-content g-ui-user-select-none" data-bind="modal: modalVisibility">
<div class="modal b-ask-content g-ui-user-select-none" data-bind="modal: modalVisibility">
<div>
<div class="modal-body">
<br />

View file

@ -1,5 +1,5 @@
<div class="popups">
<div class="modal hide b-shortcuts-content" data-bind="modal: modalVisibility">
<div class="modal b-shortcuts-content" data-bind="modal: modalVisibility">
<div class="modal-header">
<button type="button" class="close" data-bind="command: cancelCommand">&times;</button>
<h3 class="i18n" data-i18n="SHORTCUTS_HELP/LEGEND_SHORTCUTS_HELP"></h3>

View file

@ -1,5 +1,5 @@
<div class="popups">
<div class="modal hide b-languages-content g-ui-user-select-none" data-bind="modal: modalVisibility">
<div class="modal b-languages-content g-ui-user-select-none" data-bind="modal: modalVisibility">
<div class="modal-header">
<button type="button" class="close" data-bind="command: cancelCommand">&times;</button>
<h3>
@ -19,4 +19,4 @@
</div>
</div>
</div>
</div>
</div>

View file

@ -1,5 +1,5 @@
<div class="popups">
<div class="modal hide b-account-add-content g-ui-user-select-none" data-bind="modal: modalVisibility">
<div class="modal b-account-add-content g-ui-user-select-none" data-bind="modal: modalVisibility">
<div>
<div class="modal-header">
<button type="button" class="close" data-bind="command: cancelCommand">&times;</button>

View file

@ -1,5 +1,5 @@
<div class="popups">
<div class="modal hide b-open-pgp-key-add-content g-ui-user-select-none" data-bind="modal: modalVisibility">
<div class="modal b-open-pgp-key-add-content g-ui-user-select-none" data-bind="modal: modalVisibility">
<div>
<div class="modal-header">
<button type="button" class="close" data-bind="command: cancelCommand">&times;</button>

View file

@ -1,5 +1,5 @@
<div class="popups">
<div class="modal hide b-advanced-search-content g-ui-user-select-none" data-bind="modal: modalVisibility">
<div class="modal b-advanced-search-content g-ui-user-select-none" data-bind="modal: modalVisibility">
<div class="modal-header">
<button type="button" class="close" data-bind="command: cancelCommand">&times;</button>
<h3>
@ -104,4 +104,4 @@
</a>
</div>
</div>
</div>
</div>

View file

@ -1,5 +1,5 @@
<div class="popups">
<div class="modal hide b-compose" data-backdrop="static" data-bind="modal: modalVisibility, css: {'loading': saving() || sending()}">
<div class="modal b-compose" data-backdrop="static" data-bind="modal: modalVisibility, css: {'loading': saving() || sending()}">
<div class="modal-header b-header-toolbar g-ui-user-select-none">
<a class="btn btn-large button-send" data-bind="command: sendCommand, tooltipErrorTip: sendErrorDesc, css: {'btn-success': sendButtonSuccess, 'btn-danger': sendError, 'btn-warning': sendSuccessButSaveError }">
<i class="icon-white" data-bind="css: {'icon-paper-plane': !sending(), 'icon-spinner animated big': sending()}"></i>

View file

@ -1,5 +1,5 @@
<div class="popups">
<div class="modal hide b-compose-open-pgp-content g-ui-user-select-none" data-bind="modal: modalVisibility">
<div class="modal b-compose-open-pgp-content g-ui-user-select-none" data-bind="modal: modalVisibility">
<div>
<div class="modal-header">
<button type="button" class="close" data-bind="command: cancelCommand">&times;</button>

View file

@ -1,5 +1,5 @@
<div class="popups">
<div class="modal hide b-contacts-content" data-bind="modal: modalVisibility">
<div class="modal b-contacts-content" data-bind="modal: modalVisibility">
<div class="modal-header b-header-toolbar g-ui-user-select-none">
<button type="button" class="close" data-bind="command: cancelCommand">&times;</button>

View file

@ -1,5 +1,5 @@
<div class="popups">
<div class="modal hide b-filter-content g-ui-user-select-none" data-bind="modal: modalVisibility">
<div class="modal b-filter-content g-ui-user-select-none" data-bind="modal: modalVisibility">
<div>
<div class="modal-header">
<button type="button" class="close" data-bind="command: cancelCommand">&times;</button>

View file

@ -1,5 +1,5 @@
<div class="popups">
<div class="modal hide b-folder-clear-content g-ui-user-select-none" data-bind="modal: modalVisibility">
<div class="modal b-folder-clear-content g-ui-user-select-none" data-bind="modal: modalVisibility">
<div>
<div class="modal-header">
<button type="button" class="close" data-bind="command: cancelCommand">&times;</button>

View file

@ -1,5 +1,5 @@
<div class="popups">
<div class="modal hide b-folder-create-content g-ui-user-select-none" data-bind="modal: modalVisibility">
<div class="modal b-folder-create-content g-ui-user-select-none" data-bind="modal: modalVisibility">
<div>
<div class="modal-header">
<button type="button" class="close" data-bind="command: cancelCommand">&times;</button>

View file

@ -1,5 +1,5 @@
<div class="popups">
<div class="modal hide b-folder-system-content g-ui-user-select-none" data-bind="modal: modalVisibility">
<div class="modal b-folder-system-content g-ui-user-select-none" data-bind="modal: modalVisibility">
<div class="modal-header">
<button type="button" class="close" data-bind="command: cancelCommand">&times;</button>
<h3>
@ -60,4 +60,4 @@
</div>
</div>
</div>
</div>
</div>

View file

@ -1,5 +1,5 @@
<div class="popups">
<div class="modal hide b-identity-content" data-bind="modal: modalVisibility">
<div class="modal b-identity-content" data-bind="modal: modalVisibility">
<div>
<div class="modal-header g-ui-user-select-none">
<button type="button" class="close" data-bind="command: cancelCommand">&times;</button>

View file

@ -1,5 +1,5 @@
<div class="popups">
<div class="modal hide b-message-open-pgp-content g-ui-user-select-none" data-bind="modal: modalVisibility">
<div class="modal b-message-open-pgp-content g-ui-user-select-none" data-bind="modal: modalVisibility">
<div>
<div class="modal-header">
<button type="button" class="close" data-bind="command: cancelCommand">&times;</button>

View file

@ -1,5 +1,5 @@
<div class="popups">
<div class="modal hide b-open-pgp-key-generate-content g-ui-user-select-none" data-bind="modal: modalVisibility">
<div class="modal b-open-pgp-key-generate-content g-ui-user-select-none" data-bind="modal: modalVisibility">
<div>
<div class="modal-header">
<button type="button" class="close" data-bind="command: cancelCommand">&times;</button>

View file

@ -1,5 +1,5 @@
<div class="popups">
<div class="modal hide b-template-add-content" data-bind="modal: modalVisibility">
<div class="modal b-template-add-content" data-bind="modal: modalVisibility">
<div>
<div class="modal-header g-ui-user-select-none">
<button type="button" class="close" data-bind="command: cancelCommand">&times;</button>

View file

@ -1,5 +1,5 @@
<div class="popups">
<div class="modal hide b-two-factor-content g-ui-user-select-none" data-bind="modal: modalVisibility">
<div class="modal b-two-factor-content g-ui-user-select-none" data-bind="modal: modalVisibility">
<div>
<div class="modal-header">
<button type="button" class="close" data-bind="visible: viewEnable() || !lock(), command: cancelCommand">&times;</button>

View file

@ -1,5 +1,5 @@
<div class="popups">
<div class="modal hide b-two-factor-test-content g-ui-user-select-none" data-bind="modal: modalVisibility">
<div class="modal b-two-factor-test-content g-ui-user-select-none" data-bind="modal: modalVisibility">
<div>
<div class="modal-header">
<button type="button" class="close" data-bind="command: cancelCommand">&times;</button>

View file

@ -1,5 +1,5 @@
<div class="popups">
<div class="modal hide b-open-pgp-key-view-content" data-bind="modal: modalVisibility">
<div class="modal b-open-pgp-key-view-content" data-bind="modal: modalVisibility">
<div>
<div class="modal-header g-ui-user-select-none">
<button type="button" class="close" data-bind="command: cancelCommand">&times;</button>

View file

@ -1,452 +0,0 @@
/* ============================================================
* bootstrap-dropdown.js v2.3.2
* bootstrap-modal.js v2.3.2
* bootstrap-tab.js v2.3.2
* http://getbootstrap.com/2.3.2/javascript.html
* ============================================================
* Copyright 2013 Twitter, Inc.
*
* 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.
* ============================================================ */
($ => {
"use strict"; // jshint ;_;
const doc = document;
/* DROPDOWN CLASS DEFINITION
* ========================= */
var toggle = '[data-toggle=dropdown]';
class Dropdown {
constructor (element) {
var $el = $(element).on('click.dropdown.data-api', this.toggle)
$('html').on('click.dropdown.data-api', () => $el.parent().removeClass('open'))
}
toggle () {
var $this = $(this)
, $parent
, isActive
if ($this.is('.disabled, :disabled')) return
$parent = getParent($this)
isActive = $parent.hasClass('open')
clearMenus()
if (!isActive) {
if ('ontouchstart' in doc.documentElement) {
// if mobile we we use a backdrop because click events don't delegate
$('<div class="dropdown-backdrop"/>').insertBefore($(this)).on('click', clearMenus)
}
$parent.toggleClass('open')
}
$this.focus();
return false
}
keydown (e) {
var $this
, $items
, $parent
, isActive
, index
if (!/(38|40|27)/.test(e.keyCode)) return
$this = $(this)
e.preventDefault()
e.stopPropagation()
if ($this.is('.disabled, :disabled')) return
$parent = getParent($this)
isActive = $parent.hasClass('open')
if (!isActive || (isActive && e.keyCode == 27)) {
if (e.which == 27) $parent.find(toggle).focus()
return $this.click()
}
$items = $('[role=menu] li:not(.divider):visible a', $parent)
if ($items.length) {
index = $items.index($items.filter(':focus'))
if (e.keyCode == 38 && index > 0) index-- // up
if (e.keyCode == 40 && index < $items.length - 1) index++ // down
if (!~index) index = 0
$items
.eq(index)
.focus()
}
}
}
function clearMenus() {
$('.dropdown-backdrop').remove()
$(toggle).each(function () {
getParent($(this)).removeClass('open')
})
}
function getParent($this) {
var selector = $this.attr('data-target')
, $parent
if (!selector) {
selector = $this.attr('href')
selector = selector && /#/.test(selector) && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7
}
$parent = selector && 1 < selector.length && $(selector)
if (!$parent || !$parent.length) $parent = $this.parent()
return $parent
}
/* DROPDOWN PLUGIN DEFINITION
* ========================== */
$.fn.dropdown = function (option) {
return this.each(function () {
var $this = $(this)
, data = $this.data('dropdown')
if (!data) $this.data('dropdown', (data = new Dropdown(this)))
if (typeof option == 'string') data[option].call($this)
})
}
/* APPLY TO STANDARD DROPDOWN ELEMENTS
* =================================== */
$(doc)
.on('click.dropdown.data-api', clearMenus)
.on('click.dropdown.data-api', '.dropdown form', e => e.stopPropagation())
.on('click.dropdown.data-api' , toggle, Dropdown.prototype.toggle)
.on('keydown.dropdown.data-api', toggle + ', [role=menu]' , Dropdown.prototype.keydown)
/* MODAL CLASS DEFINITION
* ====================== */
class Modal {
constructor (element, options) {
this.options = options
this.$element = $(element)
.on('click.dismiss.modal', '[data-dismiss="modal"]', this.hide.bind(this))
this.options.remote && this.$element.find('.modal-body').on('load', this.options.remote)
}
toggle () {
return this[!this.isShown ? 'show' : 'hide']()
}
show () {
var that = this
, e = $.Event('show')
this.$element.trigger(e)
if (this.isShown || e.isDefaultPrevented()) return
this.isShown = true
this.escape()
this.backdrop(() => {
var transition = that.$element.hasClass('fade')
if (!that.$element.parent().length) {
that.$element.appendTo(doc.body) //don't move modals dom position
}
that.$element.show()
if (transition) {
that.$element[0].offsetWidth // force reflow
}
that.$element
.addClass('in')
.attr('aria-hidden', false)
that.enforceFocus()
transition ?
that.$element.one('transitionend', () => that.$element.focus().trigger('shown')) :
that.$element.focus().trigger('shown')
})
}
hide (e) {
e && e.preventDefault()
e = $.Event('hide')
this.$element.trigger(e)
if (!this.isShown || e.isDefaultPrevented()) return
this.isShown = false
this.escape()
$(doc).off('focusin.modal')
this.$element
.removeClass('in')
.attr('aria-hidden', true)
this.$element.hasClass('fade') ?
this.hideWithTransition() :
this.hideModal()
}
enforceFocus () {
var that = this
$(doc).on('focusin.modal', e => {
if (that.$element[0] !== e.target && !that.$element.has(e.target).length) {
that.$element.focus()
}
})
}
escape () {
var that = this
if (this.isShown && this.options.keyboard) {
this.$element.on('keyup.dismiss.modal', e => e.which == 27 && that.hide())
} else if (!this.isShown) {
this.$element.off('keyup.dismiss.modal')
}
}
hideWithTransition () {
var that = this
, timeout = setTimeout(() => {
that.$element.off('transitionend')
that.hideModal()
}, 500)
this.$element.one('transitionend', () => {
clearTimeout(timeout)
that.hideModal()
})
}
hideModal () {
var that = this
this.$element.hide()
this.backdrop(() => {
that.removeBackdrop()
that.$element.trigger('hidden')
})
}
removeBackdrop () {
this.$backdrop && this.$backdrop.remove()
this.$backdrop = null
}
backdrop (callback) {
var animate = this.$element.hasClass('fade') ? 'fade' : ''
if (this.isShown && this.options.backdrop) {
this.$backdrop = $('<div class="modal-backdrop ' + animate + '" />')
.appendTo(doc.body)
this.$backdrop.click(
this.options.backdrop == 'static' ?
this.$element[0].focus.bind(this.$element[0])
: this.hide.bind(this)
)
if (animate) this.$backdrop[0].offsetWidth // force reflow
this.$backdrop.addClass('in')
if (!callback) return
animate ?
this.$backdrop.one('transitionend', callback) :
callback()
} else if (!this.isShown && this.$backdrop) {
this.$backdrop.removeClass('in')
this.$element.hasClass('fade')?
this.$backdrop.one('transitionend', callback) :
callback()
} else if (callback) {
callback()
}
}
}
/* MODAL PLUGIN DEFINITION
* ======================= */
$.fn.modal = function (option) {
return this.each(function () {
var $this = $(this)
, data = $this.data('modal')
, options = $.extend({}, $.fn.modal.defaults, $this.data(), typeof option == 'object' && option)
if (!data) $this.data('modal', (data = new Modal(this, options)))
if (typeof option == 'string') data[option]()
else if (options.show) data.show()
})
}
$.fn.modal.defaults = {
backdrop: true
, keyboard: true
, show: true
}
/* MODAL DATA-API
* ============== */
$(doc).on('click.modal.data-api', '[data-toggle="modal"]', function (e) {
var $this = $(this)
, href = $this.attr('href')
, $target = $($this.attr('data-target') || (href && href.replace(/.*(?=#[^\s]+$)/, ''))) //strip for ie7
, option = $target.data('modal') ? 'toggle' : $.extend({ remote:!/#/.test(href) && href }, $target.data(), $this.data())
e.preventDefault()
$target
.modal(option)
.one('hide', () => $this.focus())
})
/* TAB CLASS DEFINITION
* ==================== */
var activate = ( element, container, callback) => {
var $active = container.find('> .active')
, transition = callback
&& $active.hasClass('fade')
, next = () => {
$active
.removeClass('active')
.find('> .dropdown-menu > .active')
.removeClass('active')
element.addClass('active')
if (transition) {
element[0].offsetWidth // reflow for transition
element.addClass('in')
} else {
element.removeClass('fade')
}
if ( element.parent('.dropdown-menu') ) {
element.closest('li.dropdown').addClass('active')
}
callback && callback()
}
transition ?
$active.one('transitionend', next) :
next()
$active.removeClass('in')
}
class Tab {
constructor (element) {
this.element = $(element)
}
show () {
var $this = this.element
, $ul = $this.closest('ul:not(.dropdown-menu)')
, selector = $this.attr('data-target')
, previous
, $target
, e
if (!selector) {
selector = $this.attr('href')
selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7
}
if ( $this.parent('li').hasClass('active') ) return
previous = $ul.find('.active:last a')[0]
e = $.Event('show', {
relatedTarget: previous
})
$this.trigger(e)
if (e.isDefaultPrevented()) return
$target = $(selector)
activate($this.parent('li'), $ul)
activate($target, $target.parent(), () => {
$this.trigger({
type: 'shown'
, relatedTarget: previous
})
})
}
}
/* TAB PLUGIN DEFINITION
* ===================== */
$.fn.tab = function ( option ) {
return this.each(function () {
var $this = $(this)
, data = $this.data('tab')
if (!data) $this.data('tab', (data = new Tab(this)))
if (typeof option == 'string') data[option]()
})
}
/* TAB DATA-API
* ============ */
$(doc).on('click.tab.data-api', '[data-toggle="tab"], [data-toggle="pill"]', function (e) {
e.preventDefault()
$(this).tab('show')
})
})(jQuery);

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -7,200 +7,160 @@
window.BSN = (() => {
'use strict';
const transitionEndEvent = 'transitionend',
doc = document,
const doc = document,
body = doc.body,
setFocus = element => element.focus ? element.focus() : element.setActive();
function emulateTransitionEnd(element,handler) {
var called = 0, duration = parseFloat(getComputedStyle(element).transitionDuration),
transitionEndWrapper = e => {
!called && handler(e), called = 1;
element.removeEventListener( transitionEndEvent, transitionEndWrapper);
};
(isFinite(duration) && duration)
? element.addEventListener( transitionEndEvent, transitionEndWrapper )
: setTimeout(() => { !called && handler(), called = 1; }, 17);
}
function Dropdown(element) {
var self = this,
parent, menu, menuItems = [];
function preventEmptyAnchor(ev, anchor) {
const p = anchor.parentNode;
((anchor.href && anchor.href.slice(-1) === '#') || (p && p.href && p.href.slice(-1) === '#'))
&& ev.preventDefault();
}
function toggleEvents() {
let action = element.open ? 'addEventListener' : 'removeEventListener';
doc[action]('click',dismissHandler,false);
doc[action]('keydown',preventScroll,false);
doc[action]('keyup',keyHandler,false);
doc[action]('focus',dismissHandler,false);
}
function dismissHandler(e) {
let eventTarget = e.target,
hasData = eventTarget && (eventTarget.getAttribute('data-toggle')
|| (eventTarget.parentNode && eventTarget.parentNode.getAttribute('data-toggle')));
if ( e.type === 'focus' && (eventTarget === element || eventTarget === menu || menu.contains(eventTarget) ) ) {
return;
}
if ( hasData && (eventTarget === menu || menu.contains(eventTarget)) ) { return; }
self.hide();
preventEmptyAnchor(e,eventTarget);
}
function clickHandler(e) {
self.show();
preventEmptyAnchor(e,e.target);
}
function preventScroll(e) {
( e.code === 'ArrowUp' || e.code === 'ArrowDown' ) && e.preventDefault();
}
function keyHandler(e) {
var activeItem = doc.activeElement,
isSameElement = activeItem === element,
isInsideMenu = menu.contains(activeItem),
isMenuItem = activeItem.parentNode === menu || activeItem.parentNode.parentNode === menu,
idx = menuItems.indexOf(activeItem);
if ( isMenuItem ) {
idx = isSameElement ? 0
: e.code === 'ArrowUp' ? (idx>1?idx-1:0)
: e.code === 'ArrowDown' ? (idx<menuItems.length-1?idx+1:idx) : idx;
menuItems[idx] && setFocus(menuItems[idx]);
}
if ( (menuItems.length && isMenuItem
|| !menuItems.length && (isInsideMenu || isSameElement)
|| !isInsideMenu )
&& element.open && e.code === 'Escape'
) {
self.toggle();
}
}
self.show = () => {
menu = parent.querySelector('.dropdown-menu');
menuItems = [];
Array.from(menu.children).forEach(child => {
child.children.length && (child.children[0].tagName === 'A' && menuItems.push(child.children[0]));
child.tagName === 'A' && menuItems.push(child);
});
!('tabindex' in menu) && menu.setAttribute('tabindex', '0');
menu.classList.add('show');
parent.classList.add('show');
element.setAttribute('aria-expanded',true);
element.open = true;
element.removeEventListener('click',clickHandler,false);
setTimeout(() => {
setFocus( menu.getElementsByTagName('INPUT')[0] || element );
toggleEvents();
},1);
};
self.hide = () => {
menu.classList.remove('show');
parent.classList.remove('show');
element.setAttribute('aria-expanded',false);
element.open = false;
toggleEvents();
setFocus(element);
setTimeout(() => element.Dropdown && element.addEventListener('click',clickHandler,false), 1);
};
self.toggle = () => (parent.classList.contains('show') && element.open) ? self.hide() : self.show();
parent = element.parentNode;
element.addEventListener('click',clickHandler,false);
element.open = false;
element.Dropdown = self;
}
function Modal(modal) {
var scrollBarWidth;
function setScrollbar() {
var openModal = body.classList.contains('modal-open'),
bodyPad = parseInt(getComputedStyle(body).paddingRight),
bodyOverflow = doc.documentElement.clientHeight !== doc.documentElement.scrollHeight
|| body.clientHeight !== body.scrollHeight,
modalOverflow = modal.clientHeight !== modal.scrollHeight;
scrollBarWidth = measureScrollbar();
modal.style.paddingRight = !modalOverflow && scrollBarWidth ? scrollBarWidth + "px" : '';
body.style.paddingRight = modalOverflow || bodyOverflow
? (bodyPad + (openModal ? 0:scrollBarWidth)) + "px"
: '';
}
function resetScrollbar() {
body.style.paddingRight = '';
modal.style.paddingRight = '';
}
function measureScrollbar() {
var scrollDiv = doc.createElement('div'), widthValue;
scrollDiv.className = 'modal-scrollbar-measure';
body.appendChild(scrollDiv);
widthValue = scrollDiv.offsetWidth - scrollDiv.clientWidth;
body.removeChild(scrollDiv);
return widthValue;
}
function toggleEvents(action) {
window[action ? 'addEventListener' : 'removeEventListener']( 'resize',
() => modal.classList.contains('show') && setScrollbar(), { passive: true });
}
function beforeShow() {
modal.style.display = 'block';
setScrollbar();
!doc.getElementsByClassName('modal show')[0] && body.classList.add('modal-open');
modal.classList.add('show');
modal.setAttribute('aria-hidden', false);
modal.classList.contains('fade') ? emulateTransitionEnd(modal, triggerShow) : triggerShow();
}
function triggerShow() {
setFocus(modal);
modal.isAnimating = false;
toggleEvents(1);
}
function triggerHide() {
modal.style.display = '';
body.classList.remove('modal-open');
resetScrollbar();
toggleEvents();
modal.isAnimating = false;
}
this.show = () => {
if (!modal.classList.contains('show') || !modal.isAnimating) {
modal.isAnimating = true;
doc.getElementsByClassName('modal show')[0] ? beforeShow() : setTimeout( beforeShow, 0 );
}
};
this.hide = () => {
if (modal.classList.contains('show') ) {
modal.isAnimating = true;
modal.classList.remove('show');
modal.setAttribute('aria-hidden', true);
modal.classList.contains('fade') ? emulateTransitionEnd(modal, triggerHide) : triggerHide();
}
};
modal.isAnimating = false;
modal.Modal = this;
}
class Tab {
constructor(element) {
this.element = element
element.Tab = this;
element.addEventListener('click', e => {e.preventDefault();this.show();});
}
show() {
const el = this.element, li = el.closest('li');
if (!li.classList.contains('active')) {
const previous = el.closest('ul').querySelector('.active a');
previous.closest('li').classList.remove('active');
doc.querySelector(previous.getAttribute('href')).classList.remove('active');
li.classList.add('active');
doc.querySelector(el.getAttribute('href')).classList.add('active');
}
}
}
return {
Dropdown: Dropdown,
Modal: Modal,
Tab: Tab
Dropdown: function(element) {
let menu, menuItems = [];
const self = this,
parent = element.parentNode,
preventEmptyAnchor = e => {
const t = e.target, href = t.href || (t.parentNode && t.parentNode.href);
(href && href.slice(-1) === '#') && e.preventDefault();
},
toggleEvents = () => {
let action = element.open ? 'addEventListener' : 'removeEventListener';
doc[action]('click',dismissHandler,false);
doc[action]('keydown',preventScroll,false);
doc[action]('keyup',keyHandler,false);
doc[action]('focus',dismissHandler,false);
},
dismissHandler = e => {
let eventTarget = e.target,
inside = menu.contains(eventTarget),
hasData = eventTarget && (eventTarget.getAttribute('data-toggle')
|| (eventTarget.parentNode && eventTarget.parentNode.getAttribute('data-toggle')));
if ((e.type === 'focus' && (eventTarget === element || inside))
|| (hasData && inside)
) {
return;
}
self.hide();
preventEmptyAnchor(e);
},
clickHandler = e => {
self.show();
preventEmptyAnchor(e);
},
preventScroll = e => (e.code === 'ArrowUp' || e.code === 'ArrowDown') && e.preventDefault(),
keyHandler = e => {
let activeItem = doc.activeElement,
isSameElement = activeItem === element,
isInsideMenu = menu.contains(activeItem),
isMenuItem = activeItem.parentNode === menu || activeItem.parentNode.parentNode === menu,
idx = menuItems.indexOf(activeItem);
if ( isMenuItem ) {
idx = isSameElement ? 0
: e.code === 'ArrowUp' ? (idx>1?idx-1:0)
: e.code === 'ArrowDown' ? (idx<menuItems.length-1?idx+1:idx) : idx;
menuItems[idx] && setFocus(menuItems[idx]);
}
if ( (menuItems.length && isMenuItem
|| !menuItems.length && (isInsideMenu || isSameElement)
|| !isInsideMenu )
&& element.open && e.code === 'Escape'
) {
self.toggle();
}
};
self.show = () => {
menu = parent.querySelector('.dropdown-menu');
menuItems = [];
Array.from(menu.children).forEach(child => {
child.children.length && (child.children[0].tagName === 'A' && menuItems.push(child.children[0]));
child.tagName === 'A' && menuItems.push(child);
});
!('tabindex' in menu) && menu.setAttribute('tabindex', '0');
menu.classList.add('show');
parent.classList.add('show');
element.setAttribute('aria-expanded',true);
element.open = true;
element.removeEventListener('click',clickHandler,false);
setTimeout(() => {
setFocus( menu.getElementsByTagName('INPUT')[0] || element );
toggleEvents();
},1);
};
self.hide = () => {
menu.classList.remove('show');
parent.classList.remove('show');
element.setAttribute('aria-expanded',false);
element.open = false;
toggleEvents();
setFocus(element);
setTimeout(() => element.Dropdown && element.addEventListener('click',clickHandler,false), 1);
};
self.toggle = () => (parent.classList.contains('show') && element.open) ? self.hide() : self.show();
element.addEventListener('click',clickHandler,false);
element.open = false;
element.Dropdown = self;
},
Modal: function(modal) {
let isAnimating = false;
const mcl = modal.classList,
emulateTransitionEnd = (element,handler) => {
let transitionEndEvent = 'transitionend',
duration = parseFloat(getComputedStyle(element).transitionDuration),
transitionEndWrapper = e => {
handler && handler(e), handler = 0;
element.removeEventListener( transitionEndEvent, transitionEndWrapper);
};
(isFinite(duration) && duration)
? element.addEventListener( transitionEndEvent, transitionEndWrapper )
: setTimeout(() => { handler && handler(), handler = 0; }, 17);
},
beforeShow = () => {
!doc.getElementsByClassName('modal show')[0] && body.classList.add('modal-open');
mcl.add('show');
modal.setAttribute('aria-hidden', false);
mcl.contains('fade') ? emulateTransitionEnd(modal, triggerShow) : triggerShow();
},
triggerShow = () => {
setFocus(modal);
isAnimating = false;
},
triggerHide = () => {
body.classList.remove('modal-open');
isAnimating = false;
};
this.show = () => {
if (!mcl.contains('show') || !isAnimating) {
isAnimating = true;
doc.getElementsByClassName('modal show')[0] ? beforeShow() : setTimeout( beforeShow, 0 );
}
};
this.hide = () => {
if (mcl.contains('show') ) {
isAnimating = true;
mcl.remove('show');
modal.setAttribute('aria-hidden', true);
mcl.contains('fade') ? emulateTransitionEnd(modal, triggerHide) : triggerHide();
}
};
modal.Modal = this;
},
Tab: class {
constructor(element) {
this.element = element
element.Tab = this;
element.addEventListener('click', e => {e.preventDefault();this.show();});
}
show() {
const el = this.element, li = el.closest('li');
if (!li.classList.contains('active')) {
const previous = el.closest('ul').querySelector('.active a');
previous.closest('li').classList.remove('active');
doc.querySelector(previous.getAttribute('href')).classList.remove('active');
li.classList.add('active');
doc.querySelector(el.getAttribute('href')).classList.add('active');
}
}
}
};
})();

View file

@ -4,4 +4,4 @@
* Licensed under MIT (https://github.com/thednp/bootstrap.native/blob/master/LICENSE)
*/
window.BSN=(()=>{"use strict";const e="transitionend",t=document,s=t.body,i=e=>e.focus?e.focus():e.setActive();function n(t,s){var i=0,n=parseFloat(getComputedStyle(t).transitionDuration),o=n=>{!i&&s(n),i=1,t.removeEventListener(e,o)};isFinite(n)&&n?t.addEventListener(e,o):setTimeout(()=>{!i&&s(),i=1},17)}return{Dropdown:function(e){var s,n,o=this,a=[];function c(e,t){const s=t.parentNode;(t.href&&"#"===t.href.slice(-1)||s&&s.href&&"#"===s.href.slice(-1))&&e.preventDefault()}function r(){let s=e.open?"addEventListener":"removeEventListener";t[s]("click",l,!1),t[s]("keydown",h,!1),t[s]("keyup",u,!1),t[s]("focus",l,!1)}function l(t){let s=t.target,i=s&&(s.getAttribute("data-toggle")||s.parentNode&&s.parentNode.getAttribute("data-toggle"));("focus"!==t.type||s!==e&&s!==n&&!n.contains(s))&&(i&&(s===n||n.contains(s))||(o.hide(),c(t,s)))}function d(e){o.show(),c(e,e.target)}function h(e){("ArrowUp"===e.code||"ArrowDown"===e.code)&&e.preventDefault()}function u(s){var c=t.activeElement,r=c===e,l=n.contains(c),d=c.parentNode===n||c.parentNode.parentNode===n,h=a.indexOf(c);d&&(h=r?0:"ArrowUp"===s.code?h>1?h-1:0:"ArrowDown"===s.code&&h<a.length-1?h+1:h,a[h]&&i(a[h])),(a.length&&d||!a.length&&(l||r)||!l)&&e.open&&"Escape"===s.code&&o.toggle()}o.show=(()=>{n=s.querySelector(".dropdown-menu"),a=[],Array.from(n.children).forEach(e=>{e.children.length&&"A"===e.children[0].tagName&&a.push(e.children[0]),"A"===e.tagName&&a.push(e)}),!("tabindex"in n)&&n.setAttribute("tabindex","0"),n.classList.add("show"),s.classList.add("show"),e.setAttribute("aria-expanded",!0),e.open=!0,e.removeEventListener("click",d,!1),setTimeout(()=>{i(n.getElementsByTagName("INPUT")[0]||e),r()},1)}),o.hide=(()=>{n.classList.remove("show"),s.classList.remove("show"),e.setAttribute("aria-expanded",!1),e.open=!1,r(),i(e),setTimeout(()=>e.Dropdown&&e.addEventListener("click",d,!1),1)}),o.toggle=(()=>s.classList.contains("show")&&e.open?o.hide():o.show()),s=e.parentNode,e.addEventListener("click",d,!1),e.open=!1,e.Dropdown=o},Modal:function(e){var o;function a(){var i,n,a=s.classList.contains("modal-open"),c=parseInt(getComputedStyle(s).paddingRight),r=t.documentElement.clientHeight!==t.documentElement.scrollHeight||s.clientHeight!==s.scrollHeight,l=e.clientHeight!==e.scrollHeight;(n=t.createElement("div")).className="modal-scrollbar-measure",s.appendChild(n),i=n.offsetWidth-n.clientWidth,s.removeChild(n),o=i,e.style.paddingRight=!l&&o?o+"px":"",s.style.paddingRight=l||r?c+(a?0:o)+"px":""}function c(t){window[t?"addEventListener":"removeEventListener"]("resize",()=>e.classList.contains("show")&&a(),{passive:!0})}function r(){e.style.display="block",a(),!t.getElementsByClassName("modal show")[0]&&s.classList.add("modal-open"),e.classList.add("show"),e.setAttribute("aria-hidden",!1),e.classList.contains("fade")?n(e,l):l()}function l(){i(e),e.isAnimating=!1,c(1)}function d(){e.style.display="",s.classList.remove("modal-open"),s.style.paddingRight="",e.style.paddingRight="",c(),e.isAnimating=!1}this.show=(()=>{e.classList.contains("show")&&e.isAnimating||(e.isAnimating=!0,t.getElementsByClassName("modal show")[0]?r():setTimeout(r,0))}),this.hide=(()=>{e.classList.contains("show")&&(e.isAnimating=!0,e.classList.remove("show"),e.setAttribute("aria-hidden",!0),e.classList.contains("fade")?n(e,d):d())}),e.isAnimating=!1,e.Modal=this},Tab:class{constructor(e){this.element=e,e.Tab=this,e.addEventListener("click",e=>{e.preventDefault(),this.show()})}show(){const e=this.element,s=e.closest("li");if(!s.classList.contains("active")){const i=e.closest("ul").querySelector(".active a");i.closest("li").classList.remove("active"),t.querySelector(i.getAttribute("href")).classList.remove("active"),s.classList.add("active"),t.querySelector(e.getAttribute("href")).classList.add("active")}}}}})();
window.BSN=(()=>{"use strict";const e=document,t=e.body,s=e=>e.focus?e.focus():e.setActive();return{Dropdown:function(t){let o,n=[];const a=this,i=t.parentNode,r=e=>{const t=e.target,s=t.href||t.parentNode&&t.parentNode.href;s&&"#"===s.slice(-1)&&e.preventDefault()},d=()=>{let s=t.open?"addEventListener":"removeEventListener";e[s]("click",c,!1),e[s]("keydown",h,!1),e[s]("keyup",u,!1),e[s]("focus",c,!1)},c=e=>{let s=e.target,n=o.contains(s),i=s&&(s.getAttribute("data-toggle")||s.parentNode&&s.parentNode.getAttribute("data-toggle"));"focus"===e.type&&(s===t||n)||i&&n||(a.hide(),r(e))},l=e=>{a.show(),r(e)},h=e=>("ArrowUp"===e.code||"ArrowDown"===e.code)&&e.preventDefault(),u=i=>{let r=e.activeElement,d=r===t,c=o.contains(r),l=r.parentNode===o||r.parentNode.parentNode===o,h=n.indexOf(r);l&&(h=d?0:"ArrowUp"===i.code?h>1?h-1:0:"ArrowDown"===i.code&&h<n.length-1?h+1:h,n[h]&&s(n[h])),(n.length&&l||!n.length&&(c||d)||!c)&&t.open&&"Escape"===i.code&&a.toggle()};a.show=(()=>{o=i.querySelector(".dropdown-menu"),n=[],Array.from(o.children).forEach(e=>{e.children.length&&"A"===e.children[0].tagName&&n.push(e.children[0]),"A"===e.tagName&&n.push(e)}),!("tabindex"in o)&&o.setAttribute("tabindex","0"),o.classList.add("show"),i.classList.add("show"),t.setAttribute("aria-expanded",!0),t.open=!0,t.removeEventListener("click",l,!1),setTimeout(()=>{s(o.getElementsByTagName("INPUT")[0]||t),d()},1)}),a.hide=(()=>{o.classList.remove("show"),i.classList.remove("show"),t.setAttribute("aria-expanded",!1),t.open=!1,d(),s(t),setTimeout(()=>t.Dropdown&&t.addEventListener("click",l,!1),1)}),a.toggle=(()=>i.classList.contains("show")&&t.open?a.hide():a.show()),t.addEventListener("click",l,!1),t.open=!1,t.Dropdown=a},Modal:function(o){let n=!1;const a=o.classList,i=(e,t)=>{let s=parseFloat(getComputedStyle(e).transitionDuration),o=s=>{t&&t(s),t=0,e.removeEventListener("transitionend",o)};isFinite(s)&&s?e.addEventListener("transitionend",o):setTimeout(()=>{t&&t(),t=0},17)},r=()=>{!e.getElementsByClassName("modal show")[0]&&t.classList.add("modal-open"),a.add("show"),o.setAttribute("aria-hidden",!1),a.contains("fade")?i(o,d):d()},d=()=>{s(o),n=!1},c=()=>{t.classList.remove("modal-open"),n=!1};this.show=(()=>{a.contains("show")&&n||(n=!0,e.getElementsByClassName("modal show")[0]?r():setTimeout(r,0))}),this.hide=(()=>{a.contains("show")&&(n=!0,a.remove("show"),o.setAttribute("aria-hidden",!0),a.contains("fade")?i(o,c):c())}),o.Modal=this},Tab:class{constructor(e){this.element=e,e.Tab=this,e.addEventListener("click",e=>{e.preventDefault(),this.show()})}show(){const t=this.element,s=t.closest("li");if(!s.classList.contains("active")){const o=t.closest("ul").querySelector(".active a");o.closest("li").classList.remove("active"),e.querySelector(o.getAttribute("href")).classList.remove("active"),s.classList.add("active"),e.querySelector(t.getAttribute("href")).classList.add("active")}}}}})();

File diff suppressed because it is too large Load diff

View file

@ -7,8 +7,6 @@
.modal-open {
.dropdown-menu { z-index: @zindexDropdown + @zindexModal; }
.dropdown.open { *z-index: @zindexDropdown + @zindexModal; }
.popover { z-index: @zindexPopover + @zindexModal; }
.tooltip { z-index: @zindexTooltip + @zindexModal; }
}
// Background
@ -49,7 +47,7 @@
.transition(e('opacity .3s linear, top .3s ease-out'));
top: -25%;
}
&.fade.show { top: 50%; }
&.fade.show { top: 0; }
}
.modal-header {
padding: 9px 15px;

View file

@ -12,9 +12,6 @@
}
// Toggling content
.hide {
display: none;
}
.show {
display: block;
}

View file

@ -1,10 +0,0 @@
/*
Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or http://ckeditor.com/license
*/
(function(a){if("undefined"==typeof a)throw Error("jQuery should be loaded before CKEditor jQuery adapter.");if("undefined"==typeof CKEDITOR)throw Error("CKEditor should be loaded before CKEditor jQuery adapter.");CKEDITOR.config.jqueryOverrideVal="undefined"==typeof CKEDITOR.config.jqueryOverrideVal?!0:CKEDITOR.config.jqueryOverrideVal;a.extend(a.fn,{ckeditorGet:function(){var a=this.eq(0).data("ckeditorInstance");if(!a)throw"CKEditor is not initialized yet, use ckeditor() with a callback.";return a},
ckeditor:function(g,d){if(!CKEDITOR.env.isCompatible)throw Error("The environment is incompatible.");if(!a.isFunction(g)){var m=d;d=g;g=m}var k=[];d=d||{};this.each(function(){var b=a(this),c=b.data("ckeditorInstance"),f=b.data("_ckeditorInstanceLock"),h=this,l=new a.Deferred;k.push(l.promise());if(c&&!f)g&&g.apply(c,[this]),l.resolve();else if(f)c.once("instanceReady",function(){setTimeout(function(){c.element?(c.element.$==h&&g&&g.apply(c,[h]),l.resolve()):setTimeout(arguments.callee,100)},0)},
null,null,9999);else{if(d.autoUpdateElement||"undefined"==typeof d.autoUpdateElement&&CKEDITOR.config.autoUpdateElement)d.autoUpdateElementJquery=!0;d.autoUpdateElement=!1;b.data("_ckeditorInstanceLock",!0);c=a(this).is("textarea")?CKEDITOR.replace(h,d):CKEDITOR.inline(h,d);b.data("ckeditorInstance",c);c.on("instanceReady",function(d){var e=d.editor;setTimeout(function(){if(e.element){d.removeListener();e.on("dataReady",function(){b.trigger("dataReady.ckeditor",[e])});e.on("setData",function(a){b.trigger("setData.ckeditor",
[e,a.data])});e.on("getData",function(a){b.trigger("getData.ckeditor",[e,a.data])},999);e.on("destroy",function(){b.trigger("destroy.ckeditor",[e])});e.on("save",function(){a(h.form).submit();return!1},null,null,20);if(e.config.autoUpdateElementJquery&&b.is("textarea")&&a(h.form).length){var c=function(){b.ckeditor(function(){e.updateElement()})};a(h.form).submit(c);a(h.form).bind("form-pre-serialize",c);b.bind("destroy.ckeditor",function(){a(h.form).unbind("submit",c);a(h.form).unbind("form-pre-serialize",
c)})}e.on("destroy",function(){b.removeData("ckeditorInstance")});b.removeData("_ckeditorInstanceLock");b.trigger("instanceReady.ckeditor",[e]);g&&g.apply(e,[h]);l.resolve()}else setTimeout(arguments.callee,100)},0)},null,null,9999)}});var f=new a.Deferred;this.promise=f.promise();a.when.apply(this,k).then(function(){f.resolve()});this.editor=this.eq(0).data("ckeditorInstance");return this}});CKEDITOR.config.jqueryOverrideVal&&(a.fn.val=CKEDITOR.tools.override(a.fn.val,function(g){return function(d){if(arguments.length){var m=
this,k=[],f=this.each(function(){var b=a(this),c=b.data("ckeditorInstance");if(b.is("textarea")&&c){var f=new a.Deferred;c.setData(d,function(){f.resolve()});k.push(f.promise());return!0}return g.call(b,d)});if(k.length){var b=new a.Deferred;a.when.apply(this,k).done(function(){b.resolveWith(m)});return b.promise()}return f}var f=a(this).eq(0),c=f.data("ckeditorInstance");return f.is("textarea")&&c?c.getData():g.call(f)}}))})(window.jQuery);