From c9c33e8afd0b3da2e27f0b8266a6a5dee83c841b Mon Sep 17 00:00:00 2001 From: Yassine Guedidi Date: Sun, 19 Jan 2025 18:14:27 +0100 Subject: [PATCH 01/13] Move global js to material --- assets/_global/index.js | 124 --------------------------------------- assets/material/index.js | 123 +++++++++++++++++++++++++++++++++++++- 2 files changed, 121 insertions(+), 126 deletions(-) delete mode 100644 assets/_global/index.js diff --git a/assets/_global/index.js b/assets/_global/index.js deleted file mode 100644 index 06664e939..000000000 --- a/assets/_global/index.js +++ /dev/null @@ -1,124 +0,0 @@ -/* jQuery */ -import $ from 'jquery'; - -/* Annotations */ -import annotator from 'annotator'; - -import ClipboardJS from 'clipboard'; -import 'mathjax/es5/tex-svg'; - -/* Fonts */ -import 'material-design-icons-iconfont/dist/material-design-icons.css'; -import 'lato-font/css/lato-font.css'; -import 'open-dyslexic/open-dyslexic-regular.css'; -import '@fontsource/atkinson-hyperlegible'; -import '@fontsource/eb-garamond'; -import '@fontsource/montserrat'; -import '@fontsource/oswald'; -import './global.scss'; - -/* Shortcuts */ -import './js/shortcuts/entry'; -import './js/shortcuts/main'; - -/* Highlight */ -import './js/highlight'; - -import { savePercent, retrievePercent } from './js/tools'; - -/* ========================================================================== - Annotations & Remember position - ========================================================================== */ - -$(document).ready(() => { - if ($('#article').length) { - const app = new annotator.App(); - - app.include(annotator.ui.main, { - element: document.querySelector('article'), - }); - - const authorization = { - permits() { return true; }, - }; - app.registry.registerUtility(authorization, 'authorizationPolicy'); - - const x = JSON.parse($('#annotationroutes').html()); - app.include(annotator.storage.http, $.extend({}, x, { - onError(msg, xhr) { - if (!Object.prototype.hasOwnProperty.call(xhr, 'responseJSON')) { - annotator.notification.banner('An error occurred', 'error'); - return; - } - $.each(xhr.responseJSON.children, (k, v) => { - if (v.errors) { - $.each(v.errors, (n, errorText) => { - annotator.notification.banner(errorText, 'error'); - }); - } - }); - }, - })); - - app.start().then(() => { - app.annotations.load({ entry: x.entryId }); - }); - - $(window).scroll(() => { - const scrollTop = $(window).scrollTop(); - const docHeight = $(document).height(); - const scrollPercent = (scrollTop) / (docHeight); - const scrollPercentRounded = Math.round(scrollPercent * 100) / 100; - savePercent(x.entryId, scrollPercentRounded); - }); - - retrievePercent(x.entryId); - - $(window).resize(() => { - retrievePercent(x.entryId, true); - }); - } - - document.querySelectorAll('[data-handler=tag-rename]').forEach((item) => { - const current = item; - current.wallabag_edit_mode = false; - current.onclick = (event) => { - const target = event.currentTarget; - - if (target.wallabag_edit_mode === false) { - $(target.parentNode.querySelector('[data-handle=tag-link]')).addClass('hidden'); - $(target.parentNode.querySelector('[data-handle=tag-rename-form]')).removeClass('hidden'); - target.parentNode.querySelector('[data-handle=tag-rename-form] input').focus(); - target.querySelector('.material-icons').innerHTML = 'done'; - - target.wallabag_edit_mode = true; - } else { - target.parentNode.querySelector('[data-handle=tag-rename-form]').submit(); - } - }; - }); - - // mimic radio button because emailTwoFactor is a boolean - $('#update_user_googleTwoFactor').on('change', () => { - $('#update_user_emailTwoFactor').prop('checked', false); - }); - - $('#update_user_emailTwoFactor').on('change', () => { - $('#update_user_googleTwoFactor').prop('checked', false); - }); - - // same mimic for super admin - $('#user_googleTwoFactor').on('change', () => { - $('#user_emailTwoFactor').prop('checked', false); - }); - - $('#user_emailTwoFactor').on('change', () => { - $('#user_googleTwoFactor').prop('checked', false); - }); - - // handle copy to clipboard for developer stuff - const clipboard = new ClipboardJS('.btn'); - clipboard.on('success', (e) => { - e.clearSelection(); - }); -}); diff --git a/assets/material/index.js b/assets/material/index.js index 473a55c65..bd508f373 100755 --- a/assets/material/index.js +++ b/assets/material/index.js @@ -4,8 +4,30 @@ import $ from 'jquery'; import 'materialize-css/dist/css/materialize.css'; import 'materialize-css/dist/js/materialize'; -/* Global imports */ -import '../_global/index'; +/* Annotations */ +import annotator from 'annotator'; + +import ClipboardJS from 'clipboard'; +import 'mathjax/es5/tex-svg'; + +/* Fonts */ +import 'material-design-icons-iconfont/dist/material-design-icons.css'; +import 'lato-font/css/lato-font.css'; +import 'open-dyslexic/open-dyslexic-regular.css'; +import '@fontsource/atkinson-hyperlegible'; +import '@fontsource/eb-garamond'; +import '@fontsource/montserrat'; +import '@fontsource/oswald'; +import '../_global/global.scss'; + +/* Shortcuts */ +import '../_global/js/shortcuts/entry'; +import '../_global/js/shortcuts/main'; + +/* Highlight */ +import '../_global/js/highlight'; + +import { savePercent, retrievePercent } from '../_global/js/tools'; /* Tools */ import { @@ -21,6 +43,103 @@ import './css/index.scss'; const mobileMaxWidth = 993; +/* ========================================================================== + Annotations & Remember position + ========================================================================== */ + +$(document).ready(() => { + if ($('#article').length) { + const app = new annotator.App(); + + app.include(annotator.ui.main, { + element: document.querySelector('article'), + }); + + const authorization = { + permits() { return true; }, + }; + app.registry.registerUtility(authorization, 'authorizationPolicy'); + + const x = JSON.parse($('#annotationroutes').html()); + app.include(annotator.storage.http, $.extend({}, x, { + onError(msg, xhr) { + if (!Object.prototype.hasOwnProperty.call(xhr, 'responseJSON')) { + annotator.notification.banner('An error occurred', 'error'); + return; + } + $.each(xhr.responseJSON.children, (k, v) => { + if (v.errors) { + $.each(v.errors, (n, errorText) => { + annotator.notification.banner(errorText, 'error'); + }); + } + }); + }, + })); + + app.start().then(() => { + app.annotations.load({ entry: x.entryId }); + }); + + $(window).scroll(() => { + const scrollTop = $(window).scrollTop(); + const docHeight = $(document).height(); + const scrollPercent = (scrollTop) / (docHeight); + const scrollPercentRounded = Math.round(scrollPercent * 100) / 100; + savePercent(x.entryId, scrollPercentRounded); + }); + + retrievePercent(x.entryId); + + $(window).resize(() => { + retrievePercent(x.entryId, true); + }); + } + + document.querySelectorAll('[data-handler=tag-rename]').forEach((item) => { + const current = item; + current.wallabag_edit_mode = false; + current.onclick = (event) => { + const target = event.currentTarget; + + if (target.wallabag_edit_mode === false) { + $(target.parentNode.querySelector('[data-handle=tag-link]')).addClass('hidden'); + $(target.parentNode.querySelector('[data-handle=tag-rename-form]')).removeClass('hidden'); + target.parentNode.querySelector('[data-handle=tag-rename-form] input').focus(); + target.querySelector('.material-icons').innerHTML = 'done'; + + target.wallabag_edit_mode = true; + } else { + target.parentNode.querySelector('[data-handle=tag-rename-form]').submit(); + } + }; + }); + + // mimic radio button because emailTwoFactor is a boolean + $('#update_user_googleTwoFactor').on('change', () => { + $('#update_user_emailTwoFactor').prop('checked', false); + }); + + $('#update_user_emailTwoFactor').on('change', () => { + $('#update_user_googleTwoFactor').prop('checked', false); + }); + + // same mimic for super admin + $('#user_googleTwoFactor').on('change', () => { + $('#user_emailTwoFactor').prop('checked', false); + }); + + $('#user_emailTwoFactor').on('change', () => { + $('#user_googleTwoFactor').prop('checked', false); + }); + + // handle copy to clipboard for developer stuff + const clipboard = new ClipboardJS('.btn'); + clipboard.on('success', (e) => { + e.clearSelection(); + }); +}); + (function darkTheme() { const rootEl = document.querySelector('html'); const themeDom = { From 00e4868ee5349126d7467ec53bcfea7a6167a933 Mon Sep 17 00:00:00 2001 From: Yassine Guedidi Date: Sun, 19 Jan 2025 18:17:16 +0100 Subject: [PATCH 02/13] Move global scss to material --- assets/material/css/index.scss | 1 + assets/{_global/global.scss => material/css/material-icons.scss} | 0 assets/material/index.js | 1 - 3 files changed, 1 insertion(+), 1 deletion(-) rename assets/{_global/global.scss => material/css/material-icons.scss} (100%) diff --git a/assets/material/css/index.scss b/assets/material/css/index.scss index c90def53e..81f5b578f 100644 --- a/assets/material/css/index.scss +++ b/assets/material/css/index.scss @@ -1,3 +1,4 @@ +@use "material-icons"; @use "variables"; /* Style */ diff --git a/assets/_global/global.scss b/assets/material/css/material-icons.scss similarity index 100% rename from assets/_global/global.scss rename to assets/material/css/material-icons.scss diff --git a/assets/material/index.js b/assets/material/index.js index bd508f373..2d59fcc5f 100755 --- a/assets/material/index.js +++ b/assets/material/index.js @@ -18,7 +18,6 @@ import '@fontsource/atkinson-hyperlegible'; import '@fontsource/eb-garamond'; import '@fontsource/montserrat'; import '@fontsource/oswald'; -import '../_global/global.scss'; /* Shortcuts */ import '../_global/js/shortcuts/entry'; From 8c2df2859676841c68f6f44046841203d74def35 Mon Sep 17 00:00:00 2001 From: Yassine Guedidi Date: Sun, 19 Jan 2025 18:20:06 +0100 Subject: [PATCH 03/13] Move global shortcuts to material --- assets/_global/js/shortcuts/entry.js | 0 assets/_global/js/shortcuts/main.js | 15 --------------- assets/material/index.js | 4 ---- assets/material/js/shortcuts/main.js | 12 ++++++++++++ 4 files changed, 12 insertions(+), 19 deletions(-) delete mode 100644 assets/_global/js/shortcuts/entry.js delete mode 100644 assets/_global/js/shortcuts/main.js diff --git a/assets/_global/js/shortcuts/entry.js b/assets/_global/js/shortcuts/entry.js deleted file mode 100644 index e69de29bb..000000000 diff --git a/assets/_global/js/shortcuts/main.js b/assets/_global/js/shortcuts/main.js deleted file mode 100644 index b99fa802a..000000000 --- a/assets/_global/js/shortcuts/main.js +++ /dev/null @@ -1,15 +0,0 @@ -import Mousetrap from 'mousetrap'; - -/* Shortcuts */ - -/* Go to */ -Mousetrap.bind('g u', () => { window.location.href = Routing.generate('homepage'); }); -Mousetrap.bind('g s', () => { window.location.href = Routing.generate('starred'); }); -Mousetrap.bind('g r', () => { window.location.href = Routing.generate('archive'); }); -Mousetrap.bind('g a', () => { window.location.href = Routing.generate('all'); }); -Mousetrap.bind('g t', () => { window.location.href = Routing.generate('tag'); }); -Mousetrap.bind('g c', () => { window.location.href = Routing.generate('config'); }); -Mousetrap.bind('g i', () => { window.location.href = Routing.generate('import'); }); -Mousetrap.bind('g d', () => { window.location.href = Routing.generate('developer'); }); -Mousetrap.bind('?', () => { window.location.href = Routing.generate('howto'); }); -Mousetrap.bind('g l', () => { window.location.href = Routing.generate('fos_user_security_logout'); }); diff --git a/assets/material/index.js b/assets/material/index.js index 2d59fcc5f..9e335407b 100755 --- a/assets/material/index.js +++ b/assets/material/index.js @@ -19,10 +19,6 @@ import '@fontsource/eb-garamond'; import '@fontsource/montserrat'; import '@fontsource/oswald'; -/* Shortcuts */ -import '../_global/js/shortcuts/entry'; -import '../_global/js/shortcuts/main'; - /* Highlight */ import '../_global/js/highlight'; diff --git a/assets/material/js/shortcuts/main.js b/assets/material/js/shortcuts/main.js index 771cfb783..8033d9651 100644 --- a/assets/material/js/shortcuts/main.js +++ b/assets/material/js/shortcuts/main.js @@ -1,6 +1,18 @@ import Mousetrap from 'mousetrap'; import $ from 'jquery'; +/* Go to */ +Mousetrap.bind('g u', () => { window.location.href = Routing.generate('homepage'); }); +Mousetrap.bind('g s', () => { window.location.href = Routing.generate('starred'); }); +Mousetrap.bind('g r', () => { window.location.href = Routing.generate('archive'); }); +Mousetrap.bind('g a', () => { window.location.href = Routing.generate('all'); }); +Mousetrap.bind('g t', () => { window.location.href = Routing.generate('tag'); }); +Mousetrap.bind('g c', () => { window.location.href = Routing.generate('config'); }); +Mousetrap.bind('g i', () => { window.location.href = Routing.generate('import'); }); +Mousetrap.bind('g d', () => { window.location.href = Routing.generate('developer'); }); +Mousetrap.bind('?', () => { window.location.href = Routing.generate('howto'); }); +Mousetrap.bind('g l', () => { window.location.href = Routing.generate('fos_user_security_logout'); }); + function toggleFocus(cardToToogleFocus) { if (cardToToogleFocus) { $(cardToToogleFocus).toggleClass('z-depth-4'); From e63f7ab12eaa25f13f247fbef6400ce86cd1c0c3 Mon Sep 17 00:00:00 2001 From: Yassine Guedidi Date: Sun, 19 Jan 2025 18:22:26 +0100 Subject: [PATCH 04/13] Move global highlight to material --- assets/material/index.js | 2 +- assets/{_global => material}/js/highlight.js | 0 2 files changed, 1 insertion(+), 1 deletion(-) rename assets/{_global => material}/js/highlight.js (100%) diff --git a/assets/material/index.js b/assets/material/index.js index 9e335407b..b01abbda5 100755 --- a/assets/material/index.js +++ b/assets/material/index.js @@ -20,7 +20,7 @@ import '@fontsource/montserrat'; import '@fontsource/oswald'; /* Highlight */ -import '../_global/js/highlight'; +import './js/highlight'; import { savePercent, retrievePercent } from '../_global/js/tools'; diff --git a/assets/_global/js/highlight.js b/assets/material/js/highlight.js similarity index 100% rename from assets/_global/js/highlight.js rename to assets/material/js/highlight.js From 953f5ee1493d7688f89abf3074c5dba21dd438c9 Mon Sep 17 00:00:00 2001 From: Yassine Guedidi Date: Sun, 19 Jan 2025 18:25:03 +0100 Subject: [PATCH 05/13] Move global tools to material --- assets/_global/js/tools.js | 36 ------------------------------------ assets/material/index.js | 4 +--- assets/material/js/tools.js | 33 +++++++++++++++++++++++++++++++++ 3 files changed, 34 insertions(+), 39 deletions(-) delete mode 100644 assets/_global/js/tools.js diff --git a/assets/_global/js/tools.js b/assets/_global/js/tools.js deleted file mode 100644 index 7e5a2b271..000000000 --- a/assets/_global/js/tools.js +++ /dev/null @@ -1,36 +0,0 @@ -import $ from 'jquery'; -import './shortcuts/main'; -import './shortcuts/entry'; - -/* Allows inline call qr-code call */ -import jrQrcode from 'jr-qrcode'; // eslint-disable-line - -function supportsLocalStorage() { - try { - return 'localStorage' in window && window.localStorage !== null; - } catch (e) { - return false; - } -} - -function savePercent(id, percent) { - if (!supportsLocalStorage()) { return false; } - localStorage[`wallabag.article.${id}.percent`] = percent; - return true; -} - -function retrievePercent(id, resized) { - if (!supportsLocalStorage()) { return false; } - - const bheight = $(document).height(); - const percent = localStorage[`wallabag.article.${id}.percent`]; - const scroll = bheight * percent; - - if (!resized) { - $('html,body').animate({ scrollTop: scroll }, 'fast'); - } - - return true; -} - -export { savePercent, retrievePercent }; diff --git a/assets/material/index.js b/assets/material/index.js index b01abbda5..8ff6b334c 100755 --- a/assets/material/index.js +++ b/assets/material/index.js @@ -22,11 +22,9 @@ import '@fontsource/oswald'; /* Highlight */ import './js/highlight'; -import { savePercent, retrievePercent } from '../_global/js/tools'; - /* Tools */ import { - initExport, initFilters, initRandom, initPreviewText, + savePercent, retrievePercent, initExport, initFilters, initRandom, initPreviewText, } from './js/tools'; /* Import shortcuts */ diff --git a/assets/material/js/tools.js b/assets/material/js/tools.js index c497dee38..2fdd1c38d 100644 --- a/assets/material/js/tools.js +++ b/assets/material/js/tools.js @@ -1,5 +1,36 @@ import $ from 'jquery'; +/* Allows inline call qr-code call */ +import jrQrcode from 'jr-qrcode'; // eslint-disable-line + +function supportsLocalStorage() { + try { + return 'localStorage' in window && window.localStorage !== null; + } catch (e) { + return false; + } +} + +function savePercent(id, percent) { + if (!supportsLocalStorage()) { return false; } + localStorage[`wallabag.article.${id}.percent`] = percent; + return true; +} + +function retrievePercent(id, resized) { + if (!supportsLocalStorage()) { return false; } + + const bheight = $(document).height(); + const percent = localStorage[`wallabag.article.${id}.percent`]; + const scroll = bheight * percent; + + if (!resized) { + $('html,body').animate({ scrollTop: scroll }, 'fast'); + } + + return true; +} + function initFilters() { // no display if filters not available if ($('div').is('#filters')) { @@ -46,6 +77,8 @@ function initPreviewText() { } export { + savePercent, + retrievePercent, initExport, initFilters, initRandom, From 75151443cc899d9b115bc0fa4b0e83fc92e0d7e1 Mon Sep 17 00:00:00 2001 From: Yassine Guedidi Date: Sun, 19 Jan 2025 19:38:43 +0100 Subject: [PATCH 06/13] Move global images to material --- assets/material/css/icons.scss | 10 +++++----- .../img/icons/diaspora-icon--black.png | Bin assets/{_global => material}/img/icons/linkding.svg | 0 assets/{_global => material}/img/icons/scuttle.png | Bin assets/{_global => material}/img/icons/shaarli.png | Bin .../img/icons/unmark-icon--black.png | Bin 6 files changed, 5 insertions(+), 5 deletions(-) rename assets/{_global => material}/img/icons/diaspora-icon--black.png (100%) rename assets/{_global => material}/img/icons/linkding.svg (100%) rename assets/{_global => material}/img/icons/scuttle.png (100%) rename assets/{_global => material}/img/icons/shaarli.png (100%) rename assets/{_global => material}/img/icons/unmark-icon--black.png (100%) diff --git a/assets/material/css/icons.scss b/assets/material/css/icons.scss index f2e307434..4b96da0cf 100644 --- a/assets/material/css/icons.scss +++ b/assets/material/css/icons.scss @@ -125,24 +125,24 @@ a.icon-image { } &.diaspora::before { - background: url("../../_global/img/icons/diaspora-icon--black.png") no-repeat center/80%; + background: url("../img/icons/diaspora-icon--black.png") no-repeat center/80%; } &.unmark::before { - background: url("../../_global/img/icons/unmark-icon--black.png") no-repeat center/80%; + background: url("../img/icons/unmark-icon--black.png") no-repeat center/80%; } &.linkding::before { - background: url("../../_global/img/icons/linkding.svg") no-repeat center/80%; + background: url("../img/icons/linkding.svg") no-repeat center/80%; filter: grayscale(1); } &.shaarli::before { - background: url("../../_global/img/icons/shaarli.png") no-repeat center/80%; + background: url("../img/icons/shaarli.png") no-repeat center/80%; } &.scuttle::before { - background: url("../../_global/img/icons/scuttle.png") no-repeat center/80%; + background: url("../img/icons/scuttle.png") no-repeat center/80%; } } diff --git a/assets/_global/img/icons/diaspora-icon--black.png b/assets/material/img/icons/diaspora-icon--black.png similarity index 100% rename from assets/_global/img/icons/diaspora-icon--black.png rename to assets/material/img/icons/diaspora-icon--black.png diff --git a/assets/_global/img/icons/linkding.svg b/assets/material/img/icons/linkding.svg similarity index 100% rename from assets/_global/img/icons/linkding.svg rename to assets/material/img/icons/linkding.svg diff --git a/assets/_global/img/icons/scuttle.png b/assets/material/img/icons/scuttle.png similarity index 100% rename from assets/_global/img/icons/scuttle.png rename to assets/material/img/icons/scuttle.png diff --git a/assets/_global/img/icons/shaarli.png b/assets/material/img/icons/shaarli.png similarity index 100% rename from assets/_global/img/icons/shaarli.png rename to assets/material/img/icons/shaarli.png diff --git a/assets/_global/img/icons/unmark-icon--black.png b/assets/material/img/icons/unmark-icon--black.png similarity index 100% rename from assets/_global/img/icons/unmark-icon--black.png rename to assets/material/img/icons/unmark-icon--black.png From c0909b09b43fe3ac1e158e465a2f31be4496cdce Mon Sep 17 00:00:00 2001 From: Yassine Guedidi Date: Sun, 19 Jan 2025 19:40:13 +0100 Subject: [PATCH 07/13] Remove unused bookmarklet.js --- assets/_global/js/bookmarklet.js | 4 ---- 1 file changed, 4 deletions(-) delete mode 100644 assets/_global/js/bookmarklet.js diff --git a/assets/_global/js/bookmarklet.js b/assets/_global/js/bookmarklet.js deleted file mode 100644 index e1ee92234..000000000 --- a/assets/_global/js/bookmarklet.js +++ /dev/null @@ -1,4 +0,0 @@ -top['bookmarklet-url@wallabag.org'] = 'bag it!' - + '' - + ''; From 251de194c52367b259be411fbc2ef99ce2e9f60f Mon Sep 17 00:00:00 2001 From: Yassine Guedidi Date: Sun, 19 Jan 2025 19:45:02 +0100 Subject: [PATCH 08/13] Move global share to material --- app/config/webpack/common.js | 2 +- assets/_global/share.js | 1 - assets/{_global => material/css}/share.scss | 0 assets/material/share.js | 1 + 4 files changed, 2 insertions(+), 2 deletions(-) delete mode 100644 assets/_global/share.js rename assets/{_global => material/css}/share.scss (100%) create mode 100644 assets/material/share.js diff --git a/app/config/webpack/common.js b/app/config/webpack/common.js index bd4f3845d..17463f12b 100644 --- a/app/config/webpack/common.js +++ b/app/config/webpack/common.js @@ -7,7 +7,7 @@ const projectDir = path.resolve(__dirname, '../../../'); module.exports = { entry: { material: path.join(projectDir, './assets/material/index.js'), - public: path.join(projectDir, './assets/_global/share.js'), + public: path.join(projectDir, './assets/material/share.js'), }, output: { filename: '[name].js', diff --git a/assets/_global/share.js b/assets/_global/share.js deleted file mode 100644 index d70786165..000000000 --- a/assets/_global/share.js +++ /dev/null @@ -1 +0,0 @@ -import './share.scss'; diff --git a/assets/_global/share.scss b/assets/material/css/share.scss similarity index 100% rename from assets/_global/share.scss rename to assets/material/css/share.scss diff --git a/assets/material/share.js b/assets/material/share.js new file mode 100644 index 000000000..ead44f738 --- /dev/null +++ b/assets/material/share.js @@ -0,0 +1 @@ +import './css/share.scss'; From 22c9497cd79637f3696b2fc914cd2b8a4b1b24a6 Mon Sep 17 00:00:00 2001 From: Yassine Guedidi Date: Sun, 19 Jan 2025 19:47:24 +0100 Subject: [PATCH 09/13] Move material to assets root --- app/config/webpack/common.js | 4 ++-- assets/{material => }/css/article.scss | 0 assets/{material => }/css/cards.scss | 0 assets/{material => }/css/dark_theme.scss | 0 assets/{material => }/css/entries.scss | 0 assets/{material => }/css/filters.scss | 0 assets/{material => }/css/fonts.scss | 0 assets/{material => }/css/icons.scss | 0 assets/{material => }/css/index.scss | 0 assets/{material => }/css/layout.scss | 0 assets/{material => }/css/material-icons.scss | 0 assets/{material => }/css/media_queries.scss | 0 assets/{material => }/css/nav.scss | 0 assets/{material => }/css/print.scss | 0 assets/{material => }/css/share.scss | 0 assets/{material => }/css/sidenav.scss | 0 assets/{material => }/css/variables.scss | 0 assets/{material => }/css/various.scss | 0 .../img/icons/diaspora-icon--black.png | Bin assets/{material => }/img/icons/linkding.svg | 0 assets/{material => }/img/icons/scuttle.png | Bin assets/{material => }/img/icons/shaarli.png | Bin .../{material => }/img/icons/unmark-icon--black.png | Bin assets/{material => }/index.js | 0 assets/{material => }/js/highlight.js | 0 assets/{material => }/js/shortcuts/entry.js | 0 assets/{material => }/js/shortcuts/main.js | 0 assets/{material => }/js/tools.js | 0 assets/{material => }/share.js | 0 29 files changed, 2 insertions(+), 2 deletions(-) rename assets/{material => }/css/article.scss (100%) rename assets/{material => }/css/cards.scss (100%) rename assets/{material => }/css/dark_theme.scss (100%) rename assets/{material => }/css/entries.scss (100%) rename assets/{material => }/css/filters.scss (100%) rename assets/{material => }/css/fonts.scss (100%) rename assets/{material => }/css/icons.scss (100%) rename assets/{material => }/css/index.scss (100%) rename assets/{material => }/css/layout.scss (100%) rename assets/{material => }/css/material-icons.scss (100%) rename assets/{material => }/css/media_queries.scss (100%) rename assets/{material => }/css/nav.scss (100%) rename assets/{material => }/css/print.scss (100%) rename assets/{material => }/css/share.scss (100%) rename assets/{material => }/css/sidenav.scss (100%) rename assets/{material => }/css/variables.scss (100%) rename assets/{material => }/css/various.scss (100%) rename assets/{material => }/img/icons/diaspora-icon--black.png (100%) rename assets/{material => }/img/icons/linkding.svg (100%) rename assets/{material => }/img/icons/scuttle.png (100%) rename assets/{material => }/img/icons/shaarli.png (100%) rename assets/{material => }/img/icons/unmark-icon--black.png (100%) rename assets/{material => }/index.js (100%) rename assets/{material => }/js/highlight.js (100%) rename assets/{material => }/js/shortcuts/entry.js (100%) rename assets/{material => }/js/shortcuts/main.js (100%) rename assets/{material => }/js/tools.js (100%) rename assets/{material => }/share.js (100%) diff --git a/app/config/webpack/common.js b/app/config/webpack/common.js index 17463f12b..93045409d 100644 --- a/app/config/webpack/common.js +++ b/app/config/webpack/common.js @@ -6,8 +6,8 @@ const projectDir = path.resolve(__dirname, '../../../'); module.exports = { entry: { - material: path.join(projectDir, './assets/material/index.js'), - public: path.join(projectDir, './assets/material/share.js'), + material: path.join(projectDir, './assets/index.js'), + public: path.join(projectDir, './assets/share.js'), }, output: { filename: '[name].js', diff --git a/assets/material/css/article.scss b/assets/css/article.scss similarity index 100% rename from assets/material/css/article.scss rename to assets/css/article.scss diff --git a/assets/material/css/cards.scss b/assets/css/cards.scss similarity index 100% rename from assets/material/css/cards.scss rename to assets/css/cards.scss diff --git a/assets/material/css/dark_theme.scss b/assets/css/dark_theme.scss similarity index 100% rename from assets/material/css/dark_theme.scss rename to assets/css/dark_theme.scss diff --git a/assets/material/css/entries.scss b/assets/css/entries.scss similarity index 100% rename from assets/material/css/entries.scss rename to assets/css/entries.scss diff --git a/assets/material/css/filters.scss b/assets/css/filters.scss similarity index 100% rename from assets/material/css/filters.scss rename to assets/css/filters.scss diff --git a/assets/material/css/fonts.scss b/assets/css/fonts.scss similarity index 100% rename from assets/material/css/fonts.scss rename to assets/css/fonts.scss diff --git a/assets/material/css/icons.scss b/assets/css/icons.scss similarity index 100% rename from assets/material/css/icons.scss rename to assets/css/icons.scss diff --git a/assets/material/css/index.scss b/assets/css/index.scss similarity index 100% rename from assets/material/css/index.scss rename to assets/css/index.scss diff --git a/assets/material/css/layout.scss b/assets/css/layout.scss similarity index 100% rename from assets/material/css/layout.scss rename to assets/css/layout.scss diff --git a/assets/material/css/material-icons.scss b/assets/css/material-icons.scss similarity index 100% rename from assets/material/css/material-icons.scss rename to assets/css/material-icons.scss diff --git a/assets/material/css/media_queries.scss b/assets/css/media_queries.scss similarity index 100% rename from assets/material/css/media_queries.scss rename to assets/css/media_queries.scss diff --git a/assets/material/css/nav.scss b/assets/css/nav.scss similarity index 100% rename from assets/material/css/nav.scss rename to assets/css/nav.scss diff --git a/assets/material/css/print.scss b/assets/css/print.scss similarity index 100% rename from assets/material/css/print.scss rename to assets/css/print.scss diff --git a/assets/material/css/share.scss b/assets/css/share.scss similarity index 100% rename from assets/material/css/share.scss rename to assets/css/share.scss diff --git a/assets/material/css/sidenav.scss b/assets/css/sidenav.scss similarity index 100% rename from assets/material/css/sidenav.scss rename to assets/css/sidenav.scss diff --git a/assets/material/css/variables.scss b/assets/css/variables.scss similarity index 100% rename from assets/material/css/variables.scss rename to assets/css/variables.scss diff --git a/assets/material/css/various.scss b/assets/css/various.scss similarity index 100% rename from assets/material/css/various.scss rename to assets/css/various.scss diff --git a/assets/material/img/icons/diaspora-icon--black.png b/assets/img/icons/diaspora-icon--black.png similarity index 100% rename from assets/material/img/icons/diaspora-icon--black.png rename to assets/img/icons/diaspora-icon--black.png diff --git a/assets/material/img/icons/linkding.svg b/assets/img/icons/linkding.svg similarity index 100% rename from assets/material/img/icons/linkding.svg rename to assets/img/icons/linkding.svg diff --git a/assets/material/img/icons/scuttle.png b/assets/img/icons/scuttle.png similarity index 100% rename from assets/material/img/icons/scuttle.png rename to assets/img/icons/scuttle.png diff --git a/assets/material/img/icons/shaarli.png b/assets/img/icons/shaarli.png similarity index 100% rename from assets/material/img/icons/shaarli.png rename to assets/img/icons/shaarli.png diff --git a/assets/material/img/icons/unmark-icon--black.png b/assets/img/icons/unmark-icon--black.png similarity index 100% rename from assets/material/img/icons/unmark-icon--black.png rename to assets/img/icons/unmark-icon--black.png diff --git a/assets/material/index.js b/assets/index.js similarity index 100% rename from assets/material/index.js rename to assets/index.js diff --git a/assets/material/js/highlight.js b/assets/js/highlight.js similarity index 100% rename from assets/material/js/highlight.js rename to assets/js/highlight.js diff --git a/assets/material/js/shortcuts/entry.js b/assets/js/shortcuts/entry.js similarity index 100% rename from assets/material/js/shortcuts/entry.js rename to assets/js/shortcuts/entry.js diff --git a/assets/material/js/shortcuts/main.js b/assets/js/shortcuts/main.js similarity index 100% rename from assets/material/js/shortcuts/main.js rename to assets/js/shortcuts/main.js diff --git a/assets/material/js/tools.js b/assets/js/tools.js similarity index 100% rename from assets/material/js/tools.js rename to assets/js/tools.js diff --git a/assets/material/share.js b/assets/share.js similarity index 100% rename from assets/material/share.js rename to assets/share.js From 5e8ca0887e2ea257fff1132afddbfa17c69d346d Mon Sep 17 00:00:00 2001 From: Yassine Guedidi Date: Sun, 19 Jan 2025 19:49:50 +0100 Subject: [PATCH 10/13] Rename material entrypoint to main --- app/config/webpack/common.js | 2 +- templates/layout.html.twig | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/config/webpack/common.js b/app/config/webpack/common.js index 93045409d..ccf6c7262 100644 --- a/app/config/webpack/common.js +++ b/app/config/webpack/common.js @@ -6,7 +6,7 @@ const projectDir = path.resolve(__dirname, '../../../'); module.exports = { entry: { - material: path.join(projectDir, './assets/index.js'), + main: path.join(projectDir, './assets/index.js'), public: path.join(projectDir, './assets/share.js'), }, output: { diff --git a/templates/layout.html.twig b/templates/layout.html.twig index 98e1adfaa..b40cd1177 100644 --- a/templates/layout.html.twig +++ b/templates/layout.html.twig @@ -3,13 +3,13 @@ {% block css %} {{ parent() }} {% if not app.debug %} - + {% endif %} {% endblock %} {% block scripts %} {{ parent() }} - + {% endblock %} {% block header %} From c89878d88e4f3d73f54383449a5df2ba29f7d3df Mon Sep 17 00:00:00 2001 From: Yassine Guedidi Date: Sun, 19 Jan 2025 19:52:20 +0100 Subject: [PATCH 11/13] Rename wallassets to build --- .gitignore | 2 +- CHANGELOG.md | 4 ++++ app/config/webpack/common.js | 2 +- templates/Entry/share.html.twig | 4 ++-- templates/layout.html.twig | 4 ++-- 5 files changed, 10 insertions(+), 6 deletions(-) diff --git a/.gitignore b/.gitignore index 8cd6a2922..ea9619e9a 100644 --- a/.gitignore +++ b/.gitignore @@ -29,7 +29,7 @@ web/uploads/ !/web/bundles/.gitkeep /web/assets/images/* !web/assets/images/.gitkeep -/web/wallassets/* +/web/build/* # Build /app/build diff --git a/CHANGELOG.md b/CHANGELOG.md index 67aac594d..e6ea39762 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Changelog +## Upcoming changes + +* `wallassets/` folder renamed to `build/` + ## [2.6.10](https://github.com/wallabag/wallabag/tree/2.6.10) [Full Changelog](https://github.com/wallabag/wallabag/compare/2.6.9...2.6.10) diff --git a/app/config/webpack/common.js b/app/config/webpack/common.js index ccf6c7262..e2c194677 100644 --- a/app/config/webpack/common.js +++ b/app/config/webpack/common.js @@ -11,7 +11,7 @@ module.exports = { }, output: { filename: '[name].js', - path: path.resolve(projectDir, 'web/wallassets'), + path: path.resolve(projectDir, 'web/build'), publicPath: '', }, plugins: [ diff --git a/templates/Entry/share.html.twig b/templates/Entry/share.html.twig index c8cf32eaf..ecf94d547 100644 --- a/templates/Entry/share.html.twig +++ b/templates/Entry/share.html.twig @@ -18,9 +18,9 @@ {% if app.debug %} - + {% else %} - + {% endif %} diff --git a/templates/layout.html.twig b/templates/layout.html.twig index b40cd1177..1ac6769ed 100644 --- a/templates/layout.html.twig +++ b/templates/layout.html.twig @@ -3,13 +3,13 @@ {% block css %} {{ parent() }} {% if not app.debug %} - + {% endif %} {% endblock %} {% block scripts %} {{ parent() }} - + {% endblock %} {% block header %} From e96e920b733149313902f5f7d6d2cf6a58a4a936 Mon Sep 17 00:00:00 2001 From: Yassine Guedidi Date: Sun, 19 Jan 2025 19:57:13 +0100 Subject: [PATCH 12/13] Prefix non entry point SCSS files with underscore --- assets/css/{article.scss => _article.scss} | 0 assets/css/{cards.scss => _cards.scss} | 0 assets/css/{dark_theme.scss => _dark_theme.scss} | 0 assets/css/{entries.scss => _entries.scss} | 0 assets/css/{filters.scss => _filters.scss} | 0 assets/css/{fonts.scss => _fonts.scss} | 0 assets/css/{icons.scss => _icons.scss} | 0 assets/css/{layout.scss => _layout.scss} | 0 assets/css/{material-icons.scss => _material-icons.scss} | 0 assets/css/{media_queries.scss => _media_queries.scss} | 0 assets/css/{nav.scss => _nav.scss} | 0 assets/css/{print.scss => _print.scss} | 0 assets/css/{sidenav.scss => _sidenav.scss} | 0 assets/css/{variables.scss => _variables.scss} | 0 assets/css/{various.scss => _various.scss} | 0 15 files changed, 0 insertions(+), 0 deletions(-) rename assets/css/{article.scss => _article.scss} (100%) rename assets/css/{cards.scss => _cards.scss} (100%) rename assets/css/{dark_theme.scss => _dark_theme.scss} (100%) rename assets/css/{entries.scss => _entries.scss} (100%) rename assets/css/{filters.scss => _filters.scss} (100%) rename assets/css/{fonts.scss => _fonts.scss} (100%) rename assets/css/{icons.scss => _icons.scss} (100%) rename assets/css/{layout.scss => _layout.scss} (100%) rename assets/css/{material-icons.scss => _material-icons.scss} (100%) rename assets/css/{media_queries.scss => _media_queries.scss} (100%) rename assets/css/{nav.scss => _nav.scss} (100%) rename assets/css/{print.scss => _print.scss} (100%) rename assets/css/{sidenav.scss => _sidenav.scss} (100%) rename assets/css/{variables.scss => _variables.scss} (100%) rename assets/css/{various.scss => _various.scss} (100%) diff --git a/assets/css/article.scss b/assets/css/_article.scss similarity index 100% rename from assets/css/article.scss rename to assets/css/_article.scss diff --git a/assets/css/cards.scss b/assets/css/_cards.scss similarity index 100% rename from assets/css/cards.scss rename to assets/css/_cards.scss diff --git a/assets/css/dark_theme.scss b/assets/css/_dark_theme.scss similarity index 100% rename from assets/css/dark_theme.scss rename to assets/css/_dark_theme.scss diff --git a/assets/css/entries.scss b/assets/css/_entries.scss similarity index 100% rename from assets/css/entries.scss rename to assets/css/_entries.scss diff --git a/assets/css/filters.scss b/assets/css/_filters.scss similarity index 100% rename from assets/css/filters.scss rename to assets/css/_filters.scss diff --git a/assets/css/fonts.scss b/assets/css/_fonts.scss similarity index 100% rename from assets/css/fonts.scss rename to assets/css/_fonts.scss diff --git a/assets/css/icons.scss b/assets/css/_icons.scss similarity index 100% rename from assets/css/icons.scss rename to assets/css/_icons.scss diff --git a/assets/css/layout.scss b/assets/css/_layout.scss similarity index 100% rename from assets/css/layout.scss rename to assets/css/_layout.scss diff --git a/assets/css/material-icons.scss b/assets/css/_material-icons.scss similarity index 100% rename from assets/css/material-icons.scss rename to assets/css/_material-icons.scss diff --git a/assets/css/media_queries.scss b/assets/css/_media_queries.scss similarity index 100% rename from assets/css/media_queries.scss rename to assets/css/_media_queries.scss diff --git a/assets/css/nav.scss b/assets/css/_nav.scss similarity index 100% rename from assets/css/nav.scss rename to assets/css/_nav.scss diff --git a/assets/css/print.scss b/assets/css/_print.scss similarity index 100% rename from assets/css/print.scss rename to assets/css/_print.scss diff --git a/assets/css/sidenav.scss b/assets/css/_sidenav.scss similarity index 100% rename from assets/css/sidenav.scss rename to assets/css/_sidenav.scss diff --git a/assets/css/variables.scss b/assets/css/_variables.scss similarity index 100% rename from assets/css/variables.scss rename to assets/css/_variables.scss diff --git a/assets/css/various.scss b/assets/css/_various.scss similarity index 100% rename from assets/css/various.scss rename to assets/css/_various.scss From a4f02aec765cc993f01f8e38d96d2ce9d74b3ce3 Mon Sep 17 00:00:00 2001 From: Yassine Guedidi Date: Sun, 19 Jan 2025 19:58:48 +0100 Subject: [PATCH 13/13] Rename css folder to scss --- assets/index.js | 2 +- assets/{css => scss}/_article.scss | 0 assets/{css => scss}/_cards.scss | 0 assets/{css => scss}/_dark_theme.scss | 0 assets/{css => scss}/_entries.scss | 0 assets/{css => scss}/_filters.scss | 0 assets/{css => scss}/_fonts.scss | 0 assets/{css => scss}/_icons.scss | 0 assets/{css => scss}/_layout.scss | 0 assets/{css => scss}/_material-icons.scss | 0 assets/{css => scss}/_media_queries.scss | 0 assets/{css => scss}/_nav.scss | 0 assets/{css => scss}/_print.scss | 0 assets/{css => scss}/_sidenav.scss | 0 assets/{css => scss}/_variables.scss | 0 assets/{css => scss}/_various.scss | 0 assets/{css => scss}/index.scss | 0 assets/{css => scss}/share.scss | 0 assets/share.js | 2 +- 19 files changed, 2 insertions(+), 2 deletions(-) rename assets/{css => scss}/_article.scss (100%) rename assets/{css => scss}/_cards.scss (100%) rename assets/{css => scss}/_dark_theme.scss (100%) rename assets/{css => scss}/_entries.scss (100%) rename assets/{css => scss}/_filters.scss (100%) rename assets/{css => scss}/_fonts.scss (100%) rename assets/{css => scss}/_icons.scss (100%) rename assets/{css => scss}/_layout.scss (100%) rename assets/{css => scss}/_material-icons.scss (100%) rename assets/{css => scss}/_media_queries.scss (100%) rename assets/{css => scss}/_nav.scss (100%) rename assets/{css => scss}/_print.scss (100%) rename assets/{css => scss}/_sidenav.scss (100%) rename assets/{css => scss}/_variables.scss (100%) rename assets/{css => scss}/_various.scss (100%) rename assets/{css => scss}/index.scss (100%) rename assets/{css => scss}/share.scss (100%) diff --git a/assets/index.js b/assets/index.js index 8ff6b334c..83852e250 100755 --- a/assets/index.js +++ b/assets/index.js @@ -32,7 +32,7 @@ import './js/shortcuts/main'; import './js/shortcuts/entry'; /* Theme style */ -import './css/index.scss'; +import './scss/index.scss'; const mobileMaxWidth = 993; diff --git a/assets/css/_article.scss b/assets/scss/_article.scss similarity index 100% rename from assets/css/_article.scss rename to assets/scss/_article.scss diff --git a/assets/css/_cards.scss b/assets/scss/_cards.scss similarity index 100% rename from assets/css/_cards.scss rename to assets/scss/_cards.scss diff --git a/assets/css/_dark_theme.scss b/assets/scss/_dark_theme.scss similarity index 100% rename from assets/css/_dark_theme.scss rename to assets/scss/_dark_theme.scss diff --git a/assets/css/_entries.scss b/assets/scss/_entries.scss similarity index 100% rename from assets/css/_entries.scss rename to assets/scss/_entries.scss diff --git a/assets/css/_filters.scss b/assets/scss/_filters.scss similarity index 100% rename from assets/css/_filters.scss rename to assets/scss/_filters.scss diff --git a/assets/css/_fonts.scss b/assets/scss/_fonts.scss similarity index 100% rename from assets/css/_fonts.scss rename to assets/scss/_fonts.scss diff --git a/assets/css/_icons.scss b/assets/scss/_icons.scss similarity index 100% rename from assets/css/_icons.scss rename to assets/scss/_icons.scss diff --git a/assets/css/_layout.scss b/assets/scss/_layout.scss similarity index 100% rename from assets/css/_layout.scss rename to assets/scss/_layout.scss diff --git a/assets/css/_material-icons.scss b/assets/scss/_material-icons.scss similarity index 100% rename from assets/css/_material-icons.scss rename to assets/scss/_material-icons.scss diff --git a/assets/css/_media_queries.scss b/assets/scss/_media_queries.scss similarity index 100% rename from assets/css/_media_queries.scss rename to assets/scss/_media_queries.scss diff --git a/assets/css/_nav.scss b/assets/scss/_nav.scss similarity index 100% rename from assets/css/_nav.scss rename to assets/scss/_nav.scss diff --git a/assets/css/_print.scss b/assets/scss/_print.scss similarity index 100% rename from assets/css/_print.scss rename to assets/scss/_print.scss diff --git a/assets/css/_sidenav.scss b/assets/scss/_sidenav.scss similarity index 100% rename from assets/css/_sidenav.scss rename to assets/scss/_sidenav.scss diff --git a/assets/css/_variables.scss b/assets/scss/_variables.scss similarity index 100% rename from assets/css/_variables.scss rename to assets/scss/_variables.scss diff --git a/assets/css/_various.scss b/assets/scss/_various.scss similarity index 100% rename from assets/css/_various.scss rename to assets/scss/_various.scss diff --git a/assets/css/index.scss b/assets/scss/index.scss similarity index 100% rename from assets/css/index.scss rename to assets/scss/index.scss diff --git a/assets/css/share.scss b/assets/scss/share.scss similarity index 100% rename from assets/css/share.scss rename to assets/scss/share.scss diff --git a/assets/share.js b/assets/share.js index ead44f738..b4815d817 100644 --- a/assets/share.js +++ b/assets/share.js @@ -1 +1 @@ -import './css/share.scss'; +import './scss/share.scss';