diff options
author | Jeremy Benoist <jeremy.benoist@gmail.com> | 2016-01-22 13:45:10 +0100 |
---|---|---|
committer | Jeremy Benoist <jeremy.benoist@gmail.com> | 2016-01-22 13:45:14 +0100 |
commit | 30d81a47c689e1d7d963fcd3fd42af9958805e31 (patch) | |
tree | cf1e1ccb801842cf4acc51c353bb481ede37d364 /src/Wallabag/CoreBundle/Resources/public/themes/material/js/init.js | |
parent | 124f8091cbb1e5cccd7972fa368f8e7c434e0e5b (diff) | |
download | wallabag-30d81a47c689e1d7d963fcd3fd42af9958805e31.tar.gz wallabag-30d81a47c689e1d7d963fcd3fd42af9958805e31.tar.zst wallabag-30d81a47c689e1d7d963fcd3fd42af9958805e31.zip |
Move public assets for themes
So they can be installed using the `assets:install` command and there'll no longer symlink in the repo
They moved from `web/themes/...` to `bundles/wallabagcore/themes/...`
Diffstat (limited to 'src/Wallabag/CoreBundle/Resources/public/themes/material/js/init.js')
-rwxr-xr-x | src/Wallabag/CoreBundle/Resources/public/themes/material/js/init.js | 79 |
1 files changed, 79 insertions, 0 deletions
diff --git a/src/Wallabag/CoreBundle/Resources/public/themes/material/js/init.js b/src/Wallabag/CoreBundle/Resources/public/themes/material/js/init.js new file mode 100755 index 00000000..491a7916 --- /dev/null +++ b/src/Wallabag/CoreBundle/Resources/public/themes/material/js/init.js | |||
@@ -0,0 +1,79 @@ | |||
1 | function init_filters() { | ||
2 | // no display if filters not aviable | ||
3 | if ($("div").is("#filters")) { | ||
4 | $('#button_filters').show(); | ||
5 | $('.button-collapse-right').sideNav({ edge: 'right' }); | ||
6 | $('#clear_form_filters').on('click', function(){ | ||
7 | $('#filters input').val(''); | ||
8 | $('#filters :checked').removeAttr('checked'); | ||
9 | return false; | ||
10 | }); | ||
11 | } | ||
12 | } | ||
13 | |||
14 | function init_export() { | ||
15 | // no display if export not aviable | ||
16 | if ($("div").is("#export")) { | ||
17 | $('#button_export').show(); | ||
18 | $('.button-collapse-right').sideNav({ edge: 'right' }); | ||
19 | } | ||
20 | } | ||
21 | |||
22 | $(document).ready(function(){ | ||
23 | // sideNav | ||
24 | $('.button-collapse').sideNav(); | ||
25 | $('select').material_select(); | ||
26 | $('.collapsible').collapsible({ | ||
27 | accordion : false | ||
28 | }); | ||
29 | $('.datepicker').pickadate({ | ||
30 | selectMonths: true, | ||
31 | selectYears: 15, | ||
32 | formatSubmit: 'dd/mm/yyyy', | ||
33 | hiddenName: true, | ||
34 | format: 'dd/mm/yyyy', | ||
35 | }); | ||
36 | init_filters(); | ||
37 | init_export(); | ||
38 | |||
39 | $('#nav-btn-add-tag').on('click', function(){ | ||
40 | $(".nav-panel-add-tag").toggle(100); | ||
41 | $(".nav-panel-menu").addClass('hidden'); | ||
42 | $("#tag_label").focus(); | ||
43 | return false; | ||
44 | }); | ||
45 | $('#nav-btn-add').on('click', function(){ | ||
46 | $(".nav-panel-buttom").hide(100); | ||
47 | $(".nav-panel-add").show(100); | ||
48 | $(".nav-panels .action").hide(100); | ||
49 | $(".nav-panel-menu").addClass('hidden'); | ||
50 | $(".nav-panels").css('background', 'white'); | ||
51 | $("#entry_url").focus(); | ||
52 | return false; | ||
53 | }); | ||
54 | $('#nav-btn-search').on('click', function(){ | ||
55 | $(".nav-panel-buttom").hide(100); | ||
56 | $(".nav-panel-search").show(100); | ||
57 | $(".nav-panels .action").hide(100); | ||
58 | $(".nav-panel-menu").addClass('hidden'); | ||
59 | $(".nav-panels").css('background', 'white'); | ||
60 | $("#searchfield").focus(); | ||
61 | return false; | ||
62 | }); | ||
63 | $('.mdi-navigation-close').on('click', function(){ | ||
64 | $(".nav-panel-add").hide(100); | ||
65 | $(".nav-panel-search").hide(100); | ||
66 | $(".nav-panel-buttom").show(100); | ||
67 | $(".nav-panels .action").show(100); | ||
68 | $(".nav-panel-menu").removeClass('hidden'); | ||
69 | $(".nav-panels").css('background', 'transparent'); | ||
70 | return false; | ||
71 | }); | ||
72 | $(window).scroll(function () { | ||
73 | var s = $(window).scrollTop(), | ||
74 | d = $(document).height(), | ||
75 | c = $(window).height(); | ||
76 | var scrollPercent = (s / (d-c)) * 100; | ||
77 | $(".progress .determinate").css('width', scrollPercent+'%'); | ||
78 | }); | ||
79 | }); | ||