From 9b0aef9171389aa9cdc39e8434df0f912ee5bdae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20HULARD?= Date: Wed, 24 Jan 2018 17:29:26 +0100 Subject: Update tag list template to allow renaming. * Add a form on each tag to handle rename action. * Add JavaScript to handle action on the corresponding page inside the global index.js file. * Add support for the 2 active themes : material / baggy The form solution is cleaner than an Ajax one because it let the browser validate input data and make the POST easier without the need to handle JSON response. --- app/Resources/static/themes/_global/index.js | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'app/Resources/static') diff --git a/app/Resources/static/themes/_global/index.js b/app/Resources/static/themes/_global/index.js index ae598e56..bb3e95b6 100644 --- a/app/Resources/static/themes/_global/index.js +++ b/app/Resources/static/themes/_global/index.js @@ -70,4 +70,23 @@ $(document).ready(() => { 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(); + } + }; + }); }); -- cgit v1.2.3 From 32968bd30e907dcb681831c149a9afcc12a664da Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20HULARD?= Date: Wed, 24 Jan 2018 17:30:06 +0100 Subject: Add specific styles for the card tag form element. Also add a `.hidden` class in the baggy theme to have consistency with material. --- app/Resources/static/themes/baggy/css/layout.scss | 11 ++++++++++- app/Resources/static/themes/material/css/cards.scss | 11 +++++++++++ 2 files changed, 21 insertions(+), 1 deletion(-) (limited to 'app/Resources/static') diff --git a/app/Resources/static/themes/baggy/css/layout.scss b/app/Resources/static/themes/baggy/css/layout.scss index cb14e62d..0293ebe5 100644 --- a/app/Resources/static/themes/baggy/css/layout.scss +++ b/app/Resources/static/themes/baggy/css/layout.scss @@ -295,6 +295,15 @@ div.pagination ul { } } -.hide { +.card-tag-form { + display: inline-block; +} + +.card-tag-form input[type="text"] { + min-width: 20em; +} + +.hide, +.hidden { display: none; } diff --git a/app/Resources/static/themes/material/css/cards.scss b/app/Resources/static/themes/material/css/cards.scss index 8f7f8f7b..f3319f3d 100644 --- a/app/Resources/static/themes/material/css/cards.scss +++ b/app/Resources/static/themes/material/css/cards.scss @@ -180,6 +180,17 @@ a.original:not(.waves-effect) { flex-grow: 1; } +.card-tag-form { + display: flex; + min-width: 100px; + flex-grow: 1; +} + +.card-tag-form input { + margin-bottom: 0; + height: 2rem; +} + .card-tag-rss { display: flex; } -- cgit v1.2.3 From 50f35f0db2be9586205e793f315608eec59c9666 Mon Sep 17 00:00:00 2001 From: Jeremy Benoist Date: Sat, 19 Jan 2019 22:08:29 +0100 Subject: Move icon into the top menu bar Change the way to select a random entry: - select all ids from the given user (with filters) - choose randomly one in php - find that entry --- app/Resources/static/themes/material/index.js | 4 +++- app/Resources/static/themes/material/js/tools.js | 14 +++++++++++++- 2 files changed, 16 insertions(+), 2 deletions(-) (limited to 'app/Resources/static') diff --git a/app/Resources/static/themes/material/index.js b/app/Resources/static/themes/material/index.js index 96310d81..05794597 100755 --- a/app/Resources/static/themes/material/index.js +++ b/app/Resources/static/themes/material/index.js @@ -8,7 +8,7 @@ import 'materialize-css/dist/js/materialize'; import '../_global/index'; /* Tools */ -import { initExport, initFilters } from './js/tools'; +import { initExport, initFilters, initRandom } from './js/tools'; /* Import shortcuts */ import './js/shortcuts/main'; @@ -32,8 +32,10 @@ $(document).ready(() => { format: 'dd/mm/yyyy', container: 'body', }); + initFilters(); initExport(); + initRandom(); const toggleNav = (toShow, toFocus) => { $('.nav-panel-actions').hide(100); diff --git a/app/Resources/static/themes/material/js/tools.js b/app/Resources/static/themes/material/js/tools.js index 39398fd8..0b3d3038 100644 --- a/app/Resources/static/themes/material/js/tools.js +++ b/app/Resources/static/themes/material/js/tools.js @@ -8,6 +8,7 @@ function initFilters() { $('#clear_form_filters').on('click', () => { $('#filters input').val(''); $('#filters :checked').removeAttr('checked'); + return false; }); } @@ -21,4 +22,15 @@ function initExport() { } } -export { initExport, initFilters }; +function initRandom() { + // no display if export (ie: entries) not available + if ($('div').is('#export')) { + $('#button_random').show(); + } +} + +export { + initExport, + initFilters, + initRandom, +}; -- cgit v1.2.3 From a6b242a1fd6f8900d80354361449f1bf62506ef9 Mon Sep 17 00:00:00 2001 From: Jeremy Benoist Date: Sun, 2 Dec 2018 12:43:05 +0100 Subject: Enable OTP 2FA - Update SchebTwoFactorBundle to version 3 - Enable Google 2fa on the bundle - Disallow ability to use both email and google as 2fa - Update Ocramius Proxy Manager to handle typed function & attributes (from PHP 7) - use `$this->addFlash` shortcut instead of `$this->get('session')->getFlashBag()->add` - update admin to be able to create/reset the 2fa --- app/Resources/static/themes/_global/index.js | 18 ++++++++++++++++++ app/Resources/static/themes/material/index.js | 5 +++++ 2 files changed, 23 insertions(+) (limited to 'app/Resources/static') diff --git a/app/Resources/static/themes/_global/index.js b/app/Resources/static/themes/_global/index.js index bb3e95b6..9ad96fc0 100644 --- a/app/Resources/static/themes/_global/index.js +++ b/app/Resources/static/themes/_global/index.js @@ -89,4 +89,22 @@ $(document).ready(() => { } }; }); + + // 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); + }); }); diff --git a/app/Resources/static/themes/material/index.js b/app/Resources/static/themes/material/index.js index 05794597..2926cad1 100755 --- a/app/Resources/static/themes/material/index.js +++ b/app/Resources/static/themes/material/index.js @@ -50,25 +50,30 @@ $(document).ready(() => { $('#tag_label').focus(); return false; }); + $('#nav-btn-add').on('click', () => { toggleNav('.nav-panel-add', '#entry_url'); return false; }); + const materialAddForm = $('.nav-panel-add'); materialAddForm.on('submit', () => { materialAddForm.addClass('disabled'); $('input#entry_url', materialAddForm).prop('readonly', true).trigger('blur'); }); + $('#nav-btn-search').on('click', () => { toggleNav('.nav-panel-search', '#search_entry_term'); return false; }); + $('.close').on('click', (e) => { $(e.target).parent('.nav-panel-item').hide(100); $('.nav-panel-actions').show(100); $('.nav-panels').css('background', 'transparent'); return false; }); + $(window).scroll(() => { const s = $(window).scrollTop(); const d = $(document).height(); -- cgit v1.2.3 From fb7dedf36c115b8658a014a7a50b003ea3b58f67 Mon Sep 17 00:00:00 2001 From: Kevin Decherf Date: Sat, 2 Mar 2019 22:48:43 +0100 Subject: material: move a media query from cards to dedicated scss file Signed-off-by: Kevin Decherf --- app/Resources/static/themes/material/css/cards.scss | 6 ------ app/Resources/static/themes/material/css/media_queries.scss | 4 ++++ 2 files changed, 4 insertions(+), 6 deletions(-) (limited to 'app/Resources/static') diff --git a/app/Resources/static/themes/material/css/cards.scss b/app/Resources/static/themes/material/css/cards.scss index 4f67e038..4cbeb7bd 100644 --- a/app/Resources/static/themes/material/css/cards.scss +++ b/app/Resources/static/themes/material/css/cards.scss @@ -272,9 +272,3 @@ a.original:not(.waves-effect) { .settings .div_tabs { padding-bottom: 15px; } - -@media only screen and (min-width: 992px) { - .card-tag-labels li { - max-width: 50%; - } -} diff --git a/app/Resources/static/themes/material/css/media_queries.scss b/app/Resources/static/themes/material/css/media_queries.scss index 72584426..56e6fd0f 100644 --- a/app/Resources/static/themes/material/css/media_queries.scss +++ b/app/Resources/static/themes/material/css/media_queries.scss @@ -12,6 +12,10 @@ .pagination { margin-left: auto; } + + .card-tag-labels li { + max-width: 50%; + } } @media only screen and (max-width: 992px) { -- cgit v1.2.3 From 05232afe3223242ef9563bb8a6ae13a462a043b0 Mon Sep 17 00:00:00 2001 From: Kevin Decherf Date: Sat, 2 Mar 2019 23:46:00 +0100 Subject: material: fix left padding of content on medium screens Fixes #3877 Signed-off-by: Kevin Decherf --- app/Resources/static/themes/material/css/media_queries.scss | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'app/Resources/static') diff --git a/app/Resources/static/themes/material/css/media_queries.scss b/app/Resources/static/themes/material/css/media_queries.scss index 56e6fd0f..1626365e 100644 --- a/app/Resources/static/themes/material/css/media_queries.scss +++ b/app/Resources/static/themes/material/css/media_queries.scss @@ -12,12 +12,18 @@ .pagination { margin-left: auto; } - + .card-tag-labels li { max-width: 50%; } } +@media screen and (min-width: 993px) { + main #content { + padding-left: 70px; + } +} + @media only screen and (max-width: 992px) { header, main, -- cgit v1.2.3 From f1f1efb5def331721e03bc55ac3be81fbae8fd01 Mon Sep 17 00:00:00 2001 From: Kevin Decherf Date: Sun, 3 Mar 2019 02:13:14 +0100 Subject: material: wrap card actions, remove class hiding of creation date Signed-off-by: Kevin Decherf --- app/Resources/static/themes/material/css/cards.scss | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'app/Resources/static') diff --git a/app/Resources/static/themes/material/css/cards.scss b/app/Resources/static/themes/material/css/cards.scss index 4cbeb7bd..68001a01 100644 --- a/app/Resources/static/themes/material/css/cards.scss +++ b/app/Resources/static/themes/material/css/cards.scss @@ -102,6 +102,11 @@ main { display: inline-flex; vertical-align: middle; + .card-reading-time, + .card-created-at { + display: inline-flex; + } + span { margin-right: 5px; } -- cgit v1.2.3 From 246cc9ac939f076fb7b2453e1b616a8b3500e1d1 Mon Sep 17 00:00:00 2001 From: Kevin Decherf Date: Sun, 3 Mar 2019 02:16:19 +0100 Subject: material: add media queries to hide creation date from card actions Hide the creation date from card actions on specific sizes when there's not enough space for all parts. Fixes #3851 Signed-off-by: Kevin Decherf --- app/Resources/static/themes/material/css/media_queries.scss | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'app/Resources/static') diff --git a/app/Resources/static/themes/material/css/media_queries.scss b/app/Resources/static/themes/material/css/media_queries.scss index 1626365e..32d8c484 100644 --- a/app/Resources/static/themes/material/css/media_queries.scss +++ b/app/Resources/static/themes/material/css/media_queries.scss @@ -174,3 +174,12 @@ padding: 0; } } + +@media screen and (max-width: 310px), + screen and (min-width: 601px) and (max-width: 660px), + screen and (min-width: 993px) and (max-width: 1050px), + screen and (min-width: 1201px) and (max-width: 1250px) { + .card .card-action .reading-time .card-created-at { + display: none; + } +} -- cgit v1.2.3 From cf0010cf4adbefb8fc73d55474a1446a3a2f2f36 Mon Sep 17 00:00:00 2001 From: Kevin Decherf Date: Sat, 9 Mar 2019 00:27:50 +0100 Subject: material: fix left padding on non-entry pages introduced by #3893 Signed-off-by: Kevin Decherf --- app/Resources/static/themes/material/css/media_queries.scss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'app/Resources/static') diff --git a/app/Resources/static/themes/material/css/media_queries.scss b/app/Resources/static/themes/material/css/media_queries.scss index 32d8c484..491eedce 100644 --- a/app/Resources/static/themes/material/css/media_queries.scss +++ b/app/Resources/static/themes/material/css/media_queries.scss @@ -19,7 +19,7 @@ } @media screen and (min-width: 993px) { - main #content { + body.entry main #content { padding-left: 70px; } } -- cgit v1.2.3 From 531c8d0a5c55fa93438e227a7d349235fbd31d28 Mon Sep 17 00:00:00 2001 From: Thomas Citharel Date: Tue, 13 Jun 2017 18:48:10 +0200 Subject: Changed RSS to Atom feed and improve paging --- app/Resources/static/themes/baggy/css/article.scss | 6 +++--- app/Resources/static/themes/baggy/css/pictos.scss | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'app/Resources/static') diff --git a/app/Resources/static/themes/baggy/css/article.scss b/app/Resources/static/themes/baggy/css/article.scss index 9094ad55..d203ce31 100644 --- a/app/Resources/static/themes/baggy/css/article.scss +++ b/app/Resources/static/themes/baggy/css/article.scss @@ -85,7 +85,7 @@ blockquote { color: #999; } -.icon-rss { +.icon-feed { background-color: #000; color: #fff; padding: 0.2em 0.5em; @@ -101,8 +101,8 @@ blockquote { margin-bottom: 0.5em; } - .icon-rss:hover, - .icon-rss:focus { + .icon-feed:hover, + .icon-feed:focus { background-color: #fff; color: #000; text-decoration: none; diff --git a/app/Resources/static/themes/baggy/css/pictos.scss b/app/Resources/static/themes/baggy/css/pictos.scss index 2ff01937..b6ebf311 100644 --- a/app/Resources/static/themes/baggy/css/pictos.scss +++ b/app/Resources/static/themes/baggy/css/pictos.scss @@ -136,7 +136,7 @@ content: "\ea3a"; } -.icon-rss::before { +.icon-feed::before { content: "\e808"; } -- cgit v1.2.3 From 4b5b228650cd109db7b21fd754581416e7f7d97e Mon Sep 17 00:00:00 2001 From: Kevin Decherf Date: Sat, 27 Apr 2019 22:48:28 +0200 Subject: material: add metadata to list view Add reading time and creation date to rows of list view. Refactor styles using a sass mixin. Fixes #3838 Signed-off-by: Kevin Decherf --- .../static/themes/material/css/cards.scss | 52 ++++++++++++++++------ .../static/themes/material/css/media_queries.scss | 4 ++ 2 files changed, 42 insertions(+), 14 deletions(-) (limited to 'app/Resources/static') diff --git a/app/Resources/static/themes/material/css/cards.scss b/app/Resources/static/themes/material/css/cards.scss index 68001a01..0cdc7457 100644 --- a/app/Resources/static/themes/material/css/cards.scss +++ b/app/Resources/static/themes/material/css/cards.scss @@ -18,6 +18,24 @@ main { overflow: hidden; } +@mixin mixin-reading-time { + .reading-time { + display: inline-flex; + vertical-align: middle; + + .card-reading-time, + .card-created-at { + display: inline-flex; + } + + span { + margin-right: 5px; + } + + @content; + } +} + .card { .card-content .card-title, .card-reveal .card-title { @@ -98,19 +116,7 @@ main { margin-right: 5px !important; } - .reading-time { - display: inline-flex; - vertical-align: middle; - - .card-reading-time, - .card-created-at { - display: inline-flex; - } - - span { - margin-right: 5px; - } - } + @include mixin-reading-time; } .card-image { @@ -224,10 +230,18 @@ a.original:not(.waves-effect) { } div.metadata { + overflow: hidden; + height: 1.5em; + display: flex; + + ul.tags { + margin-left: 4px; + } + .chip { background-color: $blueAccentColor; padding: 0 7px; - margin: auto 2px; + margin: auto 1px; border-radius: 6px; line-height: 22px; height: 22px; @@ -244,6 +258,16 @@ a.original:not(.waves-effect) { padding-left: 8px; } } + + @include mixin-reading-time { + padding: 0 5px; + flex-wrap: wrap; + margin-left: auto; + + i.material-icons { + font-size: 20px; + } + } } div.card-content { diff --git a/app/Resources/static/themes/material/css/media_queries.scss b/app/Resources/static/themes/material/css/media_queries.scss index 491eedce..6f9d2a95 100644 --- a/app/Resources/static/themes/material/css/media_queries.scss +++ b/app/Resources/static/themes/material/css/media_queries.scss @@ -173,6 +173,10 @@ .row .col { padding: 0; } + + .card-stacked div.metadata .reading-time { + display: none; + } } @media screen and (max-width: 310px), -- cgit v1.2.3 From 66fa0c26ab74467645e2cc63a4f48ef82e3f5748 Mon Sep 17 00:00:00 2001 From: Jeremy Benoist Date: Tue, 9 Jul 2019 13:22:50 +0200 Subject: Copy client info to clipboard From the listing page and the create summary page, you can now copy client info to the clipboard using dedicated buttons. --- app/Resources/static/themes/_global/index.js | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'app/Resources/static') diff --git a/app/Resources/static/themes/_global/index.js b/app/Resources/static/themes/_global/index.js index 9ad96fc0..66ac063b 100644 --- a/app/Resources/static/themes/_global/index.js +++ b/app/Resources/static/themes/_global/index.js @@ -4,6 +4,8 @@ import $ from 'jquery'; /* Annotations */ import annotator from 'annotator'; +import ClipboardJS from 'clipboard'; + /* Fonts */ import 'material-design-icons-iconfont/dist/material-design-icons.css'; import 'lato-font/css/lato-font.css'; @@ -107,4 +109,12 @@ $(document).ready(() => { $('#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) => { + console.info(e.text); + + e.clearSelection(); + }); }); -- cgit v1.2.3 From df45126a1475ea2051a8285d89f3693c0bc61cd3 Mon Sep 17 00:00:00 2001 From: Jeremy Benoist Date: Tue, 9 Jul 2019 15:54:59 +0200 Subject: Update translations Remove log --- app/Resources/static/themes/_global/index.js | 2 -- 1 file changed, 2 deletions(-) (limited to 'app/Resources/static') diff --git a/app/Resources/static/themes/_global/index.js b/app/Resources/static/themes/_global/index.js index 66ac063b..315fc0ad 100644 --- a/app/Resources/static/themes/_global/index.js +++ b/app/Resources/static/themes/_global/index.js @@ -113,8 +113,6 @@ $(document).ready(() => { // handle copy to clipboard for developer stuff const clipboard = new ClipboardJS('.btn'); clipboard.on('success', (e) => { - console.info(e.text); - e.clearSelection(); }); }); -- cgit v1.2.3 From 2f5fa30aadf1ae3394750b6b8a6b2492609d3f66 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20L=C5=93uillet?= Date: Fri, 27 Sep 2019 16:01:55 +0200 Subject: Added MathJax support --- app/Resources/static/themes/_global/index.js | 1 + 1 file changed, 1 insertion(+) (limited to 'app/Resources/static') diff --git a/app/Resources/static/themes/_global/index.js b/app/Resources/static/themes/_global/index.js index 315fc0ad..88365270 100644 --- a/app/Resources/static/themes/_global/index.js +++ b/app/Resources/static/themes/_global/index.js @@ -5,6 +5,7 @@ import $ from 'jquery'; import annotator from 'annotator'; import ClipboardJS from 'clipboard'; +import 'mathjax/es5/tex-svg'; /* Fonts */ import 'material-design-icons-iconfont/dist/material-design-icons.css'; -- cgit v1.2.3 From 0a81f9b9d990734810a571d43f44db6c67e7cd5e Mon Sep 17 00:00:00 2001 From: Simounet Date: Sun, 19 Jan 2020 10:54:56 +0100 Subject: Sidebar sub entries not conditioned by hover anymore --- app/Resources/static/themes/material/css/article.scss | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'app/Resources/static') diff --git a/app/Resources/static/themes/material/css/article.scss b/app/Resources/static/themes/material/css/article.scss index 75658a58..f1a11da0 100644 --- a/app/Resources/static/themes/material/css/article.scss +++ b/app/Resources/static/themes/material/css/article.scss @@ -172,18 +172,18 @@ &:hover { width: 260px !important; - .collapsible-body { - height: auto; - - li a i.material-icons { - margin: auto 5px auto -8px; - } - } - span { opacity: 1; } } + + .collapsible-body { + height: auto; + + li a i.material-icons { + margin: auto 5px auto -8px; + } + } } .progress { -- cgit v1.2.3 From cfd77d1c2abca28c346af4697fb92db98a42f40a Mon Sep 17 00:00:00 2001 From: Simounet Date: Sun, 19 Jan 2020 12:50:08 +0100 Subject: Sticky nav on entry action button click --- app/Resources/static/themes/material/css/nav.scss | 5 +++++ app/Resources/static/themes/material/index.js | 8 ++++++++ 2 files changed, 13 insertions(+) (limited to 'app/Resources/static') diff --git a/app/Resources/static/themes/material/css/nav.scss b/app/Resources/static/themes/material/css/nav.scss index 147f163f..b7288278 100644 --- a/app/Resources/static/themes/material/css/nav.scss +++ b/app/Resources/static/themes/material/css/nav.scss @@ -131,6 +131,11 @@ nav { display: none; } +.entry-nav-top--sticky { + position: sticky; + top: 0; +} + @media (min-width: 993px) { .button-collapse { display: none; diff --git a/app/Resources/static/themes/material/index.js b/app/Resources/static/themes/material/index.js index 2926cad1..4b194d00 100755 --- a/app/Resources/static/themes/material/index.js +++ b/app/Resources/static/themes/material/index.js @@ -17,6 +17,13 @@ import './js/shortcuts/entry'; /* Theme style */ import './css/index.scss'; +const stickyNav = () => { + const nav = $('.js-entry-nav-top'); + $('[data-toggle="actions"]').click(() => { + nav.toggleClass('entry-nav-top--sticky'); + }); +}; + $(document).ready(() => { // sideNav $('.button-collapse').sideNav(); @@ -36,6 +43,7 @@ $(document).ready(() => { initFilters(); initExport(); initRandom(); + stickyNav(); const toggleNav = (toShow, toFocus) => { $('.nav-panel-actions').hide(100); -- cgit v1.2.3 From dc23bf9f29b2cff5c27ee8d2d251f435d00e6652 Mon Sep 17 00:00:00 2001 From: Simounet Date: Sun, 19 Jan 2020 17:49:54 +0100 Subject: Entry action buttons displayed on page end reached --- .../static/themes/material/css/article.scss | 1 + app/Resources/static/themes/material/index.js | 32 ++++++++++++++++------ 2 files changed, 25 insertions(+), 8 deletions(-) (limited to 'app/Resources/static') diff --git a/app/Resources/static/themes/material/css/article.scss b/app/Resources/static/themes/material/css/article.scss index f1a11da0..755372c9 100644 --- a/app/Resources/static/themes/material/css/article.scss +++ b/app/Resources/static/themes/material/css/article.scss @@ -5,6 +5,7 @@ #article { font-size: 20px; margin: 0 auto; + padding-bottom: 80px; max-width: 45em; article { diff --git a/app/Resources/static/themes/material/index.js b/app/Resources/static/themes/material/index.js index 4b194d00..e808d75c 100755 --- a/app/Resources/static/themes/material/index.js +++ b/app/Resources/static/themes/material/index.js @@ -24,6 +24,29 @@ const stickyNav = () => { }); }; +const articleScroll = () => { + const articleEl = $('#article'); + if (articleEl.length > 0) { + $(window).scroll(() => { + const s = $(window).scrollTop(); + const d = $(document).height(); + const c = $(window).height(); + const articleElBottom = articleEl.offset().top + articleEl.height(); + const scrollPercent = (s / (d - c)) * 100; + $('.progress .determinate').css('width', `${scrollPercent}%`); + const fixedActionBtn = $('.js-fixed-action-btn'); + const toggleScrollDataName = 'toggle-auto'; + if ((s + c) > articleElBottom) { + fixedActionBtn.data(toggleScrollDataName, true); + fixedActionBtn.openFAB(); + } else if (fixedActionBtn.data(toggleScrollDataName) === true) { + fixedActionBtn.data(toggleScrollDataName, false); + fixedActionBtn.closeFAB(); + } + }); + } +}; + $(document).ready(() => { // sideNav $('.button-collapse').sideNav(); @@ -44,6 +67,7 @@ $(document).ready(() => { initExport(); initRandom(); stickyNav(); + articleScroll(); const toggleNav = (toShow, toFocus) => { $('.nav-panel-actions').hide(100); @@ -81,12 +105,4 @@ $(document).ready(() => { $('.nav-panels').css('background', 'transparent'); return false; }); - - $(window).scroll(() => { - const s = $(window).scrollTop(); - const d = $(document).height(); - const c = $(window).height(); - const scrollPercent = (s / (d - c)) * 100; - $('.progress .determinate').css('width', `${scrollPercent}%`); - }); }); -- cgit v1.2.3 From 45582f29927ca3d2271a64f1a8621a2fa1e7001c Mon Sep 17 00:00:00 2001 From: Kevin Decherf Date: Sat, 25 Jan 2020 15:40:29 +0100 Subject: material: replace display: flex with block in print mode This change is a workaround for a reported issue with printing flex items on Firefox See: https://bugzilla.mozilla.org/show_bug.cgi?id=939897 Fixes #4251 Signed-off-by: Kevin Decherf --- app/Resources/static/themes/material/css/media_queries.scss | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'app/Resources/static') diff --git a/app/Resources/static/themes/material/css/media_queries.scss b/app/Resources/static/themes/material/css/media_queries.scss index 6f9d2a95..4242ead2 100644 --- a/app/Resources/static/themes/material/css/media_queries.scss +++ b/app/Resources/static/themes/material/css/media_queries.scss @@ -187,3 +187,9 @@ display: none; } } + +@media only print { + body { + display: block; + } +} -- cgit v1.2.3 From 3dcb701975f94b656ca80f7b2a7528dd5166c69f Mon Sep 17 00:00:00 2001 From: Kevin Decherf Date: Sat, 25 Jan 2020 15:42:43 +0100 Subject: baggy: remove logo from printed pages Signed-off-by: Kevin Decherf --- app/Resources/static/themes/baggy/css/media_queries.scss | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'app/Resources/static') diff --git a/app/Resources/static/themes/baggy/css/media_queries.scss b/app/Resources/static/themes/baggy/css/media_queries.scss index c33db0b3..a08f369f 100755 --- a/app/Resources/static/themes/baggy/css/media_queries.scss +++ b/app/Resources/static/themes/baggy/css/media_queries.scss @@ -170,3 +170,9 @@ width: 100%; } } + +@media only print { + header h1.logo { + display: none; + } +} -- cgit v1.2.3