Cleanup CSS and JS code

This commit is contained in:
djmaze 2020-10-01 11:10:40 +02:00
parent 0eea2cb5ad
commit 6c75dd12f8
19 changed files with 82 additions and 146 deletions

View file

@ -1,18 +1,15 @@
/* eslint max-len: 0 */
(() => {
'use strict';
const doc = document,
(doc => {
const
removeElements = 'HEAD,LINK,META,NOSCRIPT,SCRIPT,TEMPLATE,TITLE',
allowedElements = 'A,B,BLOCKQUOTE,BR,DIV,FONT,H1,H2,H3,H4,H5,H6,HR,IMG,LI,OL,P,SPAN,STRONG,TABLE,TD,TH,TR,U,UL',
allowedAttributes = 'abbr,align,background,bgcolor,border,cellpadding,cellspacing,class,color,colspan,dir,face,frame,height,href,hspace,id,lang,rowspan,rules,scope,size,src,style,target,type,usemap,valign,vspace,width'.split(','),
i18n = (str, def) => rl.i18n(str) || def,
ctrlKey = /Mac OS X/.test( navigator.userAgent ) ? '⌘ + ' : 'Ctrl + ',
ctrlKey = shortcuts.getMetaKey().replace('meta','⌘') + ' + ',
tpl = doc.createElement('template'),
clr = doc.createElement('input'),
@ -568,6 +565,6 @@ class SquireUI
}
}
window.SquireUI = SquireUI;
this.SquireUI = SquireUI;
})();
})(document);

View file

@ -281,8 +281,13 @@ html:not(.rl-left-panel-disabled) #rl-left.resizable > .resizer,
}
}
.visible-on-ctrl,
.visible-on-ctrl-btn,
.hidden-on-ctrl-btn,
.visible-on-ctrl-btn {
display: inline-block;
}
html:not(.rl-ctrl-key-pressed) .visible-on-ctrl-btn,
html.rl-ctrl-key-pressed .hidden-on-ctrl-btn,
.show-on-panel-disabled {
display: none;
}
@ -314,26 +319,14 @@ html.rl-left-panel-disabled {
}
}
html.rl-left-panel-short {
#rl-left {
width: 60px !important;
}
#rl-right {
left: 60px !important;
}
html.rl-left-panel-short #rl-left,
html.rl-left-panel-short #rl-right {
width: 60px !important;
}
html.rl-left-panel-none {
#rl-left {
width: 10px !important;
}
#rl-right {
left: 10px !important;
}
html.rl-left-panel-none #rl-left,
html.rl-left-panel-none #rl-right {
width: 10px !important;
}
html.rl-no-preview-pane {
@ -391,37 +384,11 @@ html.rl-bottom-preview-pane {
}
}
.hidden-on-ctrl-btn {
display: inline-block;
}
html.rl-ctrl-key-pressed {
.visible-on-ctrl {
display: inline-block;
}
.btn-group.open .visible-on-ctrl-btn {
display: inline-block;
}
.hidden-on-ctrl {
display: none;
}
.btn-group.open .hidden-on-ctrl-btn {
display: none;
}
}
.show-on-mobile,
html.rl-mobile .hide-on-mobile {
display: none !important;
}
.show-on-mobile {
display: none !important;
}
html.rl-mobile .show-on-mobile {
display: initial !important;
}

View file

@ -6,8 +6,6 @@
*/
(doc => {
'use strict';
let ua = navigator.userAgent.toLowerCase(),
dropEffect = 'move',

View file

@ -1,3 +1,5 @@
'use strict';
(w=>{
Array.prototype.flat || Object.defineProperty(Array.prototype, 'flat', {
@ -30,4 +32,4 @@ w.ResizeObserver || (w.ResizeObserver = class {
}
});
})(window);
})(this);