From 8b53b189f83d0997ea2f5d875ed69a4ccffa56d7 Mon Sep 17 00:00:00 2001 From: djmaze Date: Sun, 13 Sep 2020 14:13:16 +0200 Subject: [PATCH] Cleanup CSS and fix SquireUI css --- README.md | 4 ++-- dev/External/SquireUI.js | 10 +++++----- dev/Styles/SquireUI.less | 14 ++++++++++++++ dev/Styles/_BootstrapFix.less | 4 ---- dev/boot.js | 22 ++++++++++------------ rainloop/v/0.0.0/app/templates/Index.html | 2 +- vendors/normalize.css/normalize.css | 15 +-------------- 7 files changed, 33 insertions(+), 38 deletions(-) diff --git a/README.md b/README.md index 9a9d765a0..490a45bdc 100644 --- a/README.md +++ b/README.md @@ -53,7 +53,7 @@ This fork has the following changes: * CRLF => LF line endings * Embed boot.js and boot.css into index.html * Ongoing removal of old JavaScript code (things are native these days) -* Added modified Squire HTML editor as replacement for CKEditor +* Added modified [Squire](https://github.com/neilj/Squire) HTML editor as replacement for CKEditor ### Removal of old JavaScript @@ -136,7 +136,7 @@ Things might work in Edge 18, Firefox 50-62 and Chrome 54-68 due to one polyfill ### Squire vs CKEditor -The [squire](https://github.com/neilj/Squire) implementation is not 100% compatible yet, but is shows the massive overhead of CKEditor. +The [Squire](https://github.com/neilj/Squire) implementation is not 100% compatible yet, but is shows the massive overhead of CKEditor. Still TODO: diff --git a/dev/External/SquireUI.js b/dev/External/SquireUI.js index 256e0ea46..a983c87b3 100644 --- a/dev/External/SquireUI.js +++ b/dev/External/SquireUI.js @@ -12,7 +12,7 @@ const doc = document, i18n = (str, def) => rl.i18n(str) || def, - ctrlKey = /Mac OS X/.test( navigator.userAgent ) ? 'meta + ' : 'Ctrl + ', + ctrlKey = /Mac OS X/.test( navigator.userAgent ) ? '⌘ + ' : 'Ctrl + ', getFragmentOfChildren = parent => { let frag = doc.createDocumentFragment(); @@ -200,13 +200,13 @@ class SquireUI */ inline: { bold: { - html: '𝐁', + html: 'B', cmd: () => this.doAction('bold','B'), key: 'B', hint: 'Bold' }, italic: { - html: '𝐼', + html: 'I', cmd: () => this.doAction('italic','I'), key: 'I', hint: 'Italic' @@ -224,13 +224,13 @@ class SquireUI hint: 'Strikethrough' }, sub: { - html: 'Sx', + html: 'Xₙ', cmd: () => this.doAction('subscript','SUB'), key: 'Shift + 5', hint: 'Subscript' }, sup: { - html: 'Sx', + html: 'Xⁿ', cmd: () => this.doAction('superscript','SUP'), key: 'Shift + 6', hint: 'Superscript' diff --git a/dev/Styles/SquireUI.less b/dev/Styles/SquireUI.less index 028f8bd5c..02006bbf9 100644 --- a/dev/Styles/SquireUI.less +++ b/dev/Styles/SquireUI.less @@ -34,6 +34,20 @@ .squire-toolgroup select[data-action="fontSize"] { width: 4em; } +.squire-toolgroup select[data-action="bold"] { + font-weight: bold; +} +.squire-toolgroup select[data-action="italic"] { + font-style: italic; +} +/* +.squire-toolgroup select[data-action="underline"] { + text-decoration: underline; +} +.squire-toolgroup select[data-action="strikethrough"] { + text-decoration: line-through; +} +*/ .squire-wysiwyg { box-sizing: border-box; diff --git a/dev/Styles/_BootstrapFix.less b/dev/Styles/_BootstrapFix.less index 2d381b47b..65b80beee 100644 --- a/dev/Styles/_BootstrapFix.less +++ b/dev/Styles/_BootstrapFix.less @@ -283,10 +283,6 @@ select { color: #555; } -html.no-rgba .modal { - border-width: 0 !important; -} - .modal.loginContent .modal-body, .modal.loginAdminContent .modal-body { background-color: transparent !important; } diff --git a/dev/boot.js b/dev/boot.js index 19c827b02..33b8ffafb 100644 --- a/dev/boot.js +++ b/dev/boot.js @@ -3,8 +3,9 @@ const doc = document, - html = doc.documentElement, - app = doc.getElementById('rl-app'), + eId = id => doc.getElementById(id), + htmlCL = doc.documentElement.classList, + app = eId('rl-app'), options = app && app.dataset.boot && JSON.parse(app.dataset.boot) || {}, Storage = type => { @@ -41,8 +42,8 @@ const setTimestamp = () => storage().setItem(TIME_KEY, timestamp()), showError = () => { - doc.getElementById('rl-loading').hidden = true; - doc.getElementById('rl-loading-error').hidden = false; + eId('rl-loading').hidden = true; + eId('rl-loading-error').hidden = false; p.end(); }, @@ -88,7 +89,7 @@ const }; if (!navigator || !navigator.cookieEnabled) { - doc.location.replace('./?/NoCookie'); + doc.location.href = './?/NoCookie'; } let container = doc.querySelector('.progressjs'), @@ -152,7 +153,7 @@ win.__initAppData = appData => { if (appData) { if (appData.NewThemeLink) { - doc.getElementById('app-theme-link').href = appData.NewThemeLink; + eId('app-theme-link').href = appData.NewThemeLink; } appData.IncludeCss && writeCSS(appData.IncludeCss); @@ -160,7 +161,7 @@ win.__initAppData = appData => { if (appData.IncludeBackground) { const img = appData.IncludeBackground.replace('{{USER}}', rl.hash.get() || '0'); if (img) { - html.classList.add('UserBackground'); + htmlCL.add('UserBackground'); doc.body.style.backgroundImage = "url("+img+")"; } } @@ -217,12 +218,9 @@ Storage('session'); // init section setInterval(setTimestamp, 60000); // 1m -html.classList.add(options.mobileDevice ? 'mobile' : 'no-mobile'); +htmlCL.add(options.mobileDevice ? 'mobile' : 'no-mobile'); -['app-css','app-theme-link'].forEach(css => { - css = doc.getElementById(css); - css.href = css.dataset.href; -}); +['app-css','app-theme-link'].forEach(css => eId(css).href = css.dataset.href); loadScript('./?/' + (options.admin ? 'Admin' : '') diff --git a/rainloop/v/0.0.0/app/templates/Index.html b/rainloop/v/0.0.0/app/templates/Index.html index 704b3a3bf..ecee085d2 100644 --- a/rainloop/v/0.0.0/app/templates/Index.html +++ b/rainloop/v/0.0.0/app/templates/Index.html @@ -17,7 +17,7 @@ - + diff --git a/vendors/normalize.css/normalize.css b/vendors/normalize.css/normalize.css index a27102b1d..0b015230c 100644 --- a/vendors/normalize.css/normalize.css +++ b/vendors/normalize.css/normalize.css @@ -39,13 +39,11 @@ h1 { /** * 1. Add the correct box sizing in Firefox. - * 2. Show the overflow in Edge and IE. */ hr { box-sizing: content-box; /* 1 */ height: 0; /* 1 */ - overflow: visible; /* 2 */ } /** @@ -54,7 +52,7 @@ hr { */ pre { - font-family: monospace, monospace; /* 1 */ + font-family: monospace; /* 1 */ font-size: 1em; /* 2 */ } @@ -68,7 +66,6 @@ pre { abbr[title] { border-bottom: none; /* 1 */ - text-decoration: underline; /* 2 */ text-decoration: underline dotted; /* 2 */ } @@ -141,16 +138,6 @@ textarea { margin: 0; /* 2 */ } -/** - * Show the overflow in IE. - * 1. Show the overflow in Edge. - */ - -button, -input { /* 1 */ - overflow: visible; -} - /** * Remove the inheritance of text transform in Edge, Firefox, and IE. * 1. Remove the inheritance of text transform in Firefox.