aboutsummaryrefslogtreecommitdiffhomepage
path: root/assets/default
diff options
context:
space:
mode:
Diffstat (limited to 'assets/default')
-rw-r--r--assets/default/js/base.js19
-rw-r--r--assets/default/scss/shaarli.scss38
2 files changed, 30 insertions, 27 deletions
diff --git a/assets/default/js/base.js b/assets/default/js/base.js
index 27938823..d9933152 100644
--- a/assets/default/js/base.js
+++ b/assets/default/js/base.js
@@ -10,7 +10,7 @@ import Awesomplete from 'awesomplete';
10 * @returns Found element or null. 10 * @returns Found element or null.
11 */ 11 */
12function findParent(element, tagName, attributes) { 12function findParent(element, tagName, attributes) {
13 const parentMatch = key => attributes[key] !== '' && element.getAttribute(key).indexOf(attributes[key]) !== -1; 13 const parentMatch = (key) => attributes[key] !== '' && element.getAttribute(key).indexOf(attributes[key]) !== -1;
14 while (element) { 14 while (element) {
15 if (element.tagName.toLowerCase() === tagName) { 15 if (element.tagName.toLowerCase() === tagName) {
16 if (Object.keys(attributes).find(parentMatch)) { 16 if (Object.keys(attributes).find(parentMatch)) {
@@ -101,7 +101,7 @@ function updateAwesompleteList(selector, tags, instances) {
101 * @see http://stackoverflow.com/questions/18749591/encode-html-entities-in-javascript 101 * @see http://stackoverflow.com/questions/18749591/encode-html-entities-in-javascript
102 */ 102 */
103function htmlEntities(str) { 103function htmlEntities(str) {
104 return str.replace(/[\u00A0-\u9999<>&]/gim, i => `&#${i.charCodeAt(0)};`); 104 return str.replace(/[\u00A0-\u9999<>&]/gim, (i) => `&#${i.charCodeAt(0)};`);
105} 105}
106 106
107/** 107/**
@@ -194,8 +194,8 @@ function removeClass(element, classname) {
194function init(description) { 194function init(description) {
195 function resize() { 195 function resize() {
196 /* Fix jumpy resizing: https://stackoverflow.com/a/18262927/1484919 */ 196 /* Fix jumpy resizing: https://stackoverflow.com/a/18262927/1484919 */
197 const scrollTop = window.pageYOffset || 197 const scrollTop = window.pageYOffset
198 (document.documentElement || document.body.parentNode || document.body).scrollTop; 198 || (document.documentElement || document.body.parentNode || document.body).scrollTop;
199 199
200 description.style.height = 'auto'; 200 description.style.height = 'auto';
201 description.style.height = `${description.scrollHeight + 10}px`; 201 description.style.height = `${description.scrollHeight + 10}px`;
@@ -490,9 +490,10 @@ function init(description) {
490 }); 490 });
491 }); 491 });
492 492
493 const ids = links.map(item => item.id); 493 const ids = links.map((item) => item.id);
494 window.location = 494 window.location = (
495 `${basePath}/admin/shaare/visibility?token=${token.value}&newVisibility=${visibility}&id=${ids.join('+')}`; 495 `${basePath}/admin/shaare/visibility?token=${token.value}&newVisibility=${visibility}&id=${ids.join('+')}`
496 );
496 }); 497 });
497 }); 498 });
498 } 499 }
@@ -575,7 +576,7 @@ function init(description) {
575 .setAttribute('href', `${basePath}/admin/tags?fromtag=${encodeURIComponent(totag)}`); 576 .setAttribute('href', `${basePath}/admin/tags?fromtag=${encodeURIComponent(totag)}`);
576 577
577 // Refresh awesomplete values 578 // Refresh awesomplete values
578 existingTags = existingTags.map(tag => (tag === fromtag ? totag : tag)); 579 existingTags = existingTags.map((tag) => (tag === fromtag ? totag : tag));
579 awesomepletes = updateAwesompleteList('.rename-tag-input', existingTags, awesomepletes); 580 awesomepletes = updateAwesompleteList('.rename-tag-input', existingTags, awesomepletes);
580 } 581 }
581 }; 582 };
@@ -614,7 +615,7 @@ function init(description) {
614 xhr.send(encodeURI(`deletetag=1&fromtag=${tag}&token=${refreshedToken}`)); 615 xhr.send(encodeURI(`deletetag=1&fromtag=${tag}&token=${refreshedToken}`));
615 refreshToken(basePath); 616 refreshToken(basePath);
616 617
617 existingTags = existingTags.filter(tagItem => tagItem !== tag); 618 existingTags = existingTags.filter((tagItem) => tagItem !== tag);
618 awesomepletes = updateAwesompleteList('.rename-tag-input', existingTags, awesomepletes); 619 awesomepletes = updateAwesompleteList('.rename-tag-input', existingTags, awesomepletes);
619 } 620 }
620 }); 621 });
diff --git a/assets/default/scss/shaarli.scss b/assets/default/scss/shaarli.scss
index 7ab09d3f..f3782875 100644
--- a/assets/default/scss/shaarli.scss
+++ b/assets/default/scss/shaarli.scss
@@ -69,20 +69,22 @@ pre {
69 font-family: 'Roboto'; 69 font-family: 'Roboto';
70 font-weight: 400; 70 font-weight: 400;
71 font-style: normal; 71 font-style: normal;
72 src: local('Roboto'), 72 src:
73 local('Roboto-Regular'), 73 local('Roboto'),
74 url('../fonts/Roboto-Regular.woff2') format('woff2'), 74 local('Roboto-Regular'),
75 url('../fonts/Roboto-Regular.woff') format('woff'); 75 url('../fonts/Roboto-Regular.woff2') format('woff2'),
76 url('../fonts/Roboto-Regular.woff') format('woff');
76} 77}
77 78
78@font-face { 79@font-face {
79 font-family: 'Roboto'; 80 font-family: 'Roboto';
80 font-weight: 700; 81 font-weight: 700;
81 font-style: normal; 82 font-style: normal;
82 src: local('Roboto'), 83 src:
83 local('Roboto-Bold'), 84 local('Roboto'),
84 url('../fonts/Roboto-Bold.woff2') format('woff2'), 85 local('Roboto-Bold'),
85 url('../fonts/Roboto-Bold.woff') format('woff'); 86 url('../fonts/Roboto-Bold.woff2') format('woff2'),
87 url('../fonts/Roboto-Bold.woff') format('woff');
86} 88}
87 89
88body, 90body,
@@ -375,7 +377,7 @@ body,
375} 377}
376 378
377@media screen and (max-width: 64em) { 379@media screen and (max-width: 64em) {
378 .header-search , 380 .header-search,
379 .header-search * { 381 .header-search * {
380 visibility: hidden; 382 visibility: hidden;
381 } 383 }
@@ -554,7 +556,6 @@ body,
554 color: $dark-grey; 556 color: $dark-grey;
555 font-size: .9em; 557 font-size: .9em;
556 558
557
558 a { 559 a {
559 display: inline-block; 560 display: inline-block;
560 margin: 3px 0; 561 margin: 3px 0;
@@ -620,7 +621,7 @@ body,
620 &.selected { 621 &.selected {
621 background: var(--main-color); 622 background: var(--main-color);
622 color: $white; 623 color: $white;
623 } 624 }
624 } 625 }
625 626
626 input { 627 input {
@@ -1609,13 +1610,14 @@ form {
1609 1610
1610 > div { 1611 > div {
1611 border-radius: 10px; 1612 border-radius: 10px;
1612 background: repeating-linear-gradient( 1613 background:
1613 -45deg, 1614 repeating-linear-gradient(
1614 $almost-white, 1615 -45deg,
1615 $almost-white 6px, 1616 $almost-white,
1616 var(--background-color) 6px, 1617 $almost-white 6px,
1617 var(--background-color) 12px 1618 var(--background-color) 6px,
1618 ); 1619 var(--background-color) 12px
1620 );
1619 width: 0%; 1621 width: 0%;
1620 height: 10px; 1622 height: 10px;
1621 } 1623 }