From: ArthurHoaro Date: Tue, 20 Oct 2020 08:14:28 +0000 (+0200) Subject: Merge pull request #1567 from ArthurHoaro/feature/async-title-retrieval X-Git-Tag: v0.12.1^2~32 X-Git-Url: https://git.immae.eu/?p=github%2Fshaarli%2FShaarli.git;a=commitdiff_plain;h=9b3c1270bcbe4f8e30e0160da8badd43dd94871a;hp=-c Merge pull request #1567 from ArthurHoaro/feature/async-title-retrieval --- 9b3c1270bcbe4f8e30e0160da8badd43dd94871a diff --combined assets/default/js/base.js index aadffc13,31688815..7f6b9637 --- a/assets/default/js/base.js +++ b/assets/default/js/base.js @@@ -1,4 -1,5 +1,5 @@@ import Awesomplete from 'awesomplete'; + import he from 'he'; /** * Find a parent element according to its tag and its attributes @@@ -95,15 -96,6 +96,6 @@@ function updateAwesompleteList(selector return instances; } - /** - * html_entities in JS - * - * @see http://stackoverflow.com/questions/18749591/encode-html-entities-in-javascript - */ - function htmlEntities(str) { - return str.replace(/[\u00A0-\u9999<>&]/gim, (i) => `&#${i.charCodeAt(0)};`); - } - /** * Add the class 'hidden' to city options not attached to the current selected continent. * @@@ -302,7 -294,7 +294,7 @@@ function init(description) const deleteLinks = document.querySelectorAll('.confirm-delete'); [...deleteLinks].forEach((deleteLink) => { deleteLink.addEventListener('click', (event) => { - if (!confirm(document.getElementById('translation-delete-link').innerHTML)) { + if (!confirm(document.getElementById('translation-delete-tag').innerHTML)) { event.preventDefault(); } }); @@@ -569,7 -561,7 +561,7 @@@ input.setAttribute('name', totag); input.setAttribute('value', totag); findParent(input, 'div', { class: 'rename-tag-form' }).style.display = 'none'; - block.querySelector('a.tag-link').innerHTML = htmlEntities(totag); + block.querySelector('a.tag-link').innerHTML = he.encode(totag); block .querySelector('a.tag-link') .setAttribute('href', `${basePath}/?searchtags=${encodeURIComponent(totag)}`); diff --combined assets/default/scss/shaarli.scss index 2f49bbd2,df9c867b..286ac83b --- a/assets/default/scss/shaarli.scss +++ b/assets/default/scss/shaarli.scss @@@ -671,10 -671,6 +671,10 @@@ body content: ''; } } + + .search-highlight { + background-color: yellow; + } } .linklist-item-buttons { @@@ -1273,6 -1269,57 +1273,57 @@@ form } } + .loading-input { + position: relative; + + @keyframes around { + 0% { + transform: rotate(0deg); + } + + 100% { + transform: rotate(360deg); + } + } + + .icon-container { + position: absolute; + right: 60px; + top: calc(50% - 10px); + } + + .loader { + position: relative; + height: 20px; + width: 20px; + display: inline-block; + animation: around 5.4s infinite; + + &::after, + &::before { + content: ""; + background: $form-input-background; + position: absolute; + display: inline-block; + width: 100%; + height: 100%; + border-width: 2px; + border-color: #333 #333 transparent transparent; + border-style: solid; + border-radius: 20px; + box-sizing: border-box; + top: 0; + left: 0; + animation: around 0.7s ease-in-out infinite; + } + + &::after { + animation: around 0.7s ease-in-out 0.1s infinite; + background: transparent; + } + } + } + // LOGIN .login-form-container { .remember-me {