diff options
author | Kevin Decherf <kevin@kdecherf.com> | 2019-01-22 18:30:02 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-01-22 18:30:02 +0100 |
commit | 3527c300215e6e6010efb8bb840b8b6f5c63a1cc (patch) | |
tree | d3c23a18c966831ecd5f956d6365a2c7126c98c8 /app/Resources | |
parent | c73025ad8b684de1ac21ba7583f1af6f1d185159 (diff) | |
parent | fe5850d6e27f8cf20e7efc5c56672974b4779d9f (diff) | |
download | wallabag-3527c300215e6e6010efb8bb840b8b6f5c63a1cc.tar.gz wallabag-3527c300215e6e6010efb8bb840b8b6f5c63a1cc.tar.zst wallabag-3527c300215e6e6010efb8bb840b8b6f5c63a1cc.zip |
Merge pull request #3526 from wallabag/add-random-article
Add random feature
Diffstat (limited to 'app/Resources')
-rwxr-xr-x | app/Resources/static/themes/material/index.js | 4 | ||||
-rw-r--r-- | app/Resources/static/themes/material/js/tools.js | 14 |
2 files changed, 16 insertions, 2 deletions
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'; | |||
8 | import '../_global/index'; | 8 | import '../_global/index'; |
9 | 9 | ||
10 | /* Tools */ | 10 | /* Tools */ |
11 | import { initExport, initFilters } from './js/tools'; | 11 | import { initExport, initFilters, initRandom } from './js/tools'; |
12 | 12 | ||
13 | /* Import shortcuts */ | 13 | /* Import shortcuts */ |
14 | import './js/shortcuts/main'; | 14 | import './js/shortcuts/main'; |
@@ -32,8 +32,10 @@ $(document).ready(() => { | |||
32 | format: 'dd/mm/yyyy', | 32 | format: 'dd/mm/yyyy', |
33 | container: 'body', | 33 | container: 'body', |
34 | }); | 34 | }); |
35 | |||
35 | initFilters(); | 36 | initFilters(); |
36 | initExport(); | 37 | initExport(); |
38 | initRandom(); | ||
37 | 39 | ||
38 | const toggleNav = (toShow, toFocus) => { | 40 | const toggleNav = (toShow, toFocus) => { |
39 | $('.nav-panel-actions').hide(100); | 41 | $('.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() { | |||
8 | $('#clear_form_filters').on('click', () => { | 8 | $('#clear_form_filters').on('click', () => { |
9 | $('#filters input').val(''); | 9 | $('#filters input').val(''); |
10 | $('#filters :checked').removeAttr('checked'); | 10 | $('#filters :checked').removeAttr('checked'); |
11 | |||
11 | return false; | 12 | return false; |
12 | }); | 13 | }); |
13 | } | 14 | } |
@@ -21,4 +22,15 @@ function initExport() { | |||
21 | } | 22 | } |
22 | } | 23 | } |
23 | 24 | ||
24 | export { initExport, initFilters }; | 25 | function initRandom() { |
26 | // no display if export (ie: entries) not available | ||
27 | if ($('div').is('#export')) { | ||
28 | $('#button_random').show(); | ||
29 | } | ||
30 | } | ||
31 | |||
32 | export { | ||
33 | initExport, | ||
34 | initFilters, | ||
35 | initRandom, | ||
36 | }; | ||