diff options
author | Nicolas LÅ“uillet <nicolas@loeuillet.org> | 2016-10-03 09:09:45 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-10-03 09:09:45 +0200 |
commit | ab809de18415a9ce3bbc95d3a0a1af6c50a41c4f (patch) | |
tree | bee406df7af4b6e024764e153d8844dfe69aeda1 /app/Resources/static/themes/material | |
parent | dfbbf0e18ad585e318c2609e46963e4b9fd198ef (diff) | |
parent | 49f25d6ee820619a15851b12a33667d707e4edf7 (diff) | |
download | wallabag-ab809de18415a9ce3bbc95d3a0a1af6c50a41c4f.tar.gz wallabag-ab809de18415a9ce3bbc95d3a0a1af6c50a41c4f.tar.zst wallabag-ab809de18415a9ce3bbc95d3a0a1af6c50a41c4f.zip |
Merge pull request #2314 from wallabag/assets
Assets work
Diffstat (limited to 'app/Resources/static/themes/material')
-rwxr-xr-x | app/Resources/static/themes/material/css/main.css | 40 | ||||
-rwxr-xr-x | app/Resources/static/themes/material/css/print.css | 6 | ||||
-rwxr-xr-x | app/Resources/static/themes/material/js/init.js | 70 |
3 files changed, 55 insertions, 61 deletions
diff --git a/app/Resources/static/themes/material/css/main.css b/app/Resources/static/themes/material/css/main.css index 005cc302..00d7a869 100755 --- a/app/Resources/static/themes/material/css/main.css +++ b/app/Resources/static/themes/material/css/main.css | |||
@@ -19,12 +19,7 @@ | |||
19 | 19 | ||
20 | @font-face { | 20 | @font-face { |
21 | font-family: icomoon; | 21 | font-family: icomoon; |
22 | src: url("../fonts/icomoon.eot"); | 22 | src: url("../fonts/IcoMoon-Free.ttf"); |
23 | src: | ||
24 | url("../fonts/icomoon.eot#iefix") format("embedded-opentype"), | ||
25 | url("../fonts/icomoon.ttf") format("truetype"), | ||
26 | url("../fonts/icomoon.woff") format("woff"), | ||
27 | url("../fonts/icomoon.svg#icomoon") format("svg"); | ||
28 | font-weight: normal; | 23 | font-weight: normal; |
29 | font-style: normal; | 24 | font-style: normal; |
30 | } | 25 | } |
@@ -174,7 +169,7 @@ div.pagination ul .next.disabled { | |||
174 | 169 | ||
175 | footer.page-footer { | 170 | footer.page-footer { |
176 | margin-top: 10px; | 171 | margin-top: 10px; |
177 | padding-top: 0px; | 172 | padding-top: 0; |
178 | } | 173 | } |
179 | 174 | ||
180 | footer .row { | 175 | footer .row { |
@@ -257,8 +252,9 @@ nav input { | |||
257 | display: none; | 252 | display: none; |
258 | } | 253 | } |
259 | 254 | ||
260 | .input-field.nav-panel-add, .input-field.nav-panel-add form { | 255 | .input-field.nav-panel-add, |
261 | height: 100%; | 256 | .input-field.nav-panel-add form { |
257 | height: 100%; | ||
262 | } | 258 | } |
263 | 259 | ||
264 | /* ========================================================================== | 260 | /* ========================================================================== |
@@ -354,8 +350,9 @@ main ul.row { | |||
354 | max-height: 64px; | 350 | max-height: 64px; |
355 | } | 351 | } |
356 | 352 | ||
357 | .card .card-content i.right, .card .card-reveal i.right { | 353 | .card .card-content i.right, |
358 | margin-left: 0; | 354 | .card .card-reveal i.right { |
355 | margin-left: 0; | ||
359 | } | 356 | } |
360 | 357 | ||
361 | .card .card-entry-labels { | 358 | .card .card-entry-labels { |
@@ -527,30 +524,38 @@ main ul.row { | |||
527 | footer { | 524 | footer { |
528 | padding-left: 0; | 525 | padding-left: 0; |
529 | } | 526 | } |
527 | |||
530 | nav, | 528 | nav, |
531 | main, | 529 | main, |
532 | footer { | 530 | footer { |
533 | padding-left: 0; | 531 | padding-left: 0; |
534 | } | 532 | } |
533 | |||
535 | .pagination { | 534 | .pagination { |
536 | width: auto; | 535 | width: auto; |
537 | } | 536 | } |
537 | |||
538 | .reader-mode { | 538 | .reader-mode { |
539 | width: 240px !important; | 539 | width: 240px !important; |
540 | } | 540 | } |
541 | |||
541 | .reader-mode span { | 542 | .reader-mode span { |
542 | opacity: 1; | 543 | opacity: 1; |
543 | } | 544 | } |
545 | |||
544 | .tabs { | 546 | .tabs { |
545 | display: inline-block; | 547 | display: inline-block; |
546 | height: auto; | 548 | height: auto; |
547 | } | 549 | } |
550 | |||
548 | .tab { | 551 | .tab { |
549 | min-width: 100%; | 552 | min-width: 100%; |
550 | } | 553 | } |
554 | |||
551 | .indicator { | 555 | .indicator { |
552 | display: none; | 556 | display: none; |
553 | } | 557 | } |
558 | |||
554 | .pagination li.prev, | 559 | .pagination li.prev, |
555 | .pagination li.next { | 560 | .pagination li.next { |
556 | width: auto; | 561 | width: auto; |
@@ -568,38 +573,47 @@ main ul.row { | |||
568 | width: 25%; | 573 | width: 25%; |
569 | margin-left: 0; | 574 | margin-left: 0; |
570 | } | 575 | } |
576 | |||
571 | .row .col.l2 { | 577 | .row .col.l2 { |
572 | width: 33.33333%; | 578 | width: 33.33333%; |
573 | margin-left: 0; | 579 | margin-left: 0; |
574 | } | 580 | } |
581 | |||
575 | .row .col.l3 { | 582 | .row .col.l3 { |
576 | width: 41.66667%; | 583 | width: 41.66667%; |
577 | margin-left: 0; | 584 | margin-left: 0; |
578 | } | 585 | } |
586 | |||
579 | .row .col.l4 { | 587 | .row .col.l4 { |
580 | width: 50%; | 588 | width: 50%; |
581 | margin-left: 0; | 589 | margin-left: 0; |
582 | } | 590 | } |
591 | |||
583 | .row .col.l5 { | 592 | .row .col.l5 { |
584 | width: 58.33333%; | 593 | width: 58.33333%; |
585 | margin-left: 0; | 594 | margin-left: 0; |
586 | } | 595 | } |
596 | |||
587 | .row .col.l6 { | 597 | .row .col.l6 { |
588 | width: 66.66667%; | 598 | width: 66.66667%; |
589 | margin-left: 0; | 599 | margin-left: 0; |
590 | } | 600 | } |
601 | |||
591 | .row .col.l7 { | 602 | .row .col.l7 { |
592 | width: 75%; | 603 | width: 75%; |
593 | margin-left: 0; | 604 | margin-left: 0; |
594 | } | 605 | } |
606 | |||
595 | .row .col.l8 { | 607 | .row .col.l8 { |
596 | width: 83.33333%; | 608 | width: 83.33333%; |
597 | margin-left: 0; | 609 | margin-left: 0; |
598 | } | 610 | } |
611 | |||
599 | .row .col.l9 { | 612 | .row .col.l9 { |
600 | width: 91.66667%; | 613 | width: 91.66667%; |
601 | margin-left: 0; | 614 | margin-left: 0; |
602 | } | 615 | } |
616 | |||
603 | .row .col.l10 { | 617 | .row .col.l10 { |
604 | width: 100%; | 618 | width: 100%; |
605 | margin-left: 0; | 619 | margin-left: 0; |
@@ -645,7 +659,7 @@ main ul.row { | |||
645 | } | 659 | } |
646 | 660 | ||
647 | .icon-link::before { | 661 | .icon-link::before { |
648 | content: "\e9cb"; | 662 | content: "\e9cb"; |
649 | } | 663 | } |
650 | 664 | ||
651 | footer [class^="icon-"], | 665 | footer [class^="icon-"], |
@@ -676,5 +690,5 @@ div.settings div.file-field div { | |||
676 | } | 690 | } |
677 | 691 | ||
678 | .input-field label.active { | 692 | .input-field label.active { |
679 | font-size: 1rem; | 693 | font-size: 1rem; |
680 | } | 694 | } |
diff --git a/app/Resources/static/themes/material/css/print.css b/app/Resources/static/themes/material/css/print.css index 1eb96735..98505aae 100755 --- a/app/Resources/static/themes/material/css/print.css +++ b/app/Resources/static/themes/material/css/print.css | |||
@@ -28,10 +28,10 @@ | |||
28 | .messages, | 28 | .messages, |
29 | .entry + .results, | 29 | .entry + .results, |
30 | #slide-out, | 30 | #slide-out, |
31 | .progress, .hide-on-large-only, | 31 | .progress, |
32 | .hide-on-large-only, | ||
32 | #article > aside, | 33 | #article > aside, |
33 | #article .mbm a | 34 | #article .mbm a { |
34 | { | ||
35 | display: none !important; | 35 | display: none !important; |
36 | } | 36 | } |
37 | 37 | ||
diff --git a/app/Resources/static/themes/material/js/init.js b/app/Resources/static/themes/material/js/init.js index d6a87941..18f7b40a 100755 --- a/app/Resources/static/themes/material/js/init.js +++ b/app/Resources/static/themes/material/js/init.js | |||
@@ -1,29 +1,10 @@ | |||
1 | var $ = require('jquery'); | 1 | const $ = require('jquery'); |
2 | require('materialize'); | 2 | global.jQuery = $; |
3 | var annotator = require('annotator'); | 3 | require('materialize'); // eslint-disable-line |
4 | const annotator = require('annotator'); | ||
5 | import { savePercent, retrievePercent, initFilters, initExport } from '../../_global/js/tools.js'; | ||
4 | 6 | ||
5 | function initFilters() { | 7 | $(document).ready(() => { |
6 | // no display if filters not aviable | ||
7 | if ($('div').is('#filters')) { | ||
8 | $('#button_filters').show(); | ||
9 | $('.button-collapse-right').sideNav({ edge: 'right' }); | ||
10 | $('#clear_form_filters').on('click', function () { | ||
11 | $('#filters input').val(''); | ||
12 | $('#filters :checked').removeAttr('checked'); | ||
13 | return false; | ||
14 | }); | ||
15 | } | ||
16 | } | ||
17 | |||
18 | function initExport() { | ||
19 | // no display if export not aviable | ||
20 | if ($('div').is('#export')) { | ||
21 | $('#button_export').show(); | ||
22 | $('.button-collapse-right').sideNav({ edge: 'right' }); | ||
23 | } | ||
24 | } | ||
25 | |||
26 | $(document).ready(function () { | ||
27 | // sideNav | 8 | // sideNav |
28 | $('.button-collapse').sideNav(); | 9 | $('.button-collapse').sideNav(); |
29 | $('select').material_select(); | 10 | $('select').material_select(); |
@@ -40,13 +21,13 @@ $(document).ready(function () { | |||
40 | initFilters(); | 21 | initFilters(); |
41 | initExport(); | 22 | initExport(); |
42 | 23 | ||
43 | $('#nav-btn-add-tag').on('click', function () { | 24 | $('#nav-btn-add-tag').on('click', () => { |
44 | $('.nav-panel-add-tag').toggle(100); | 25 | $('.nav-panel-add-tag').toggle(100); |
45 | $('.nav-panel-menu').addClass('hidden'); | 26 | $('.nav-panel-menu').addClass('hidden'); |
46 | $('#tag_label').focus(); | 27 | $('#tag_label').focus(); |
47 | return false; | 28 | return false; |
48 | }); | 29 | }); |
49 | $('#nav-btn-add').on('click', function () { | 30 | $('#nav-btn-add').on('click', () => { |
50 | $('.nav-panel-buttom').hide(100); | 31 | $('.nav-panel-buttom').hide(100); |
51 | $('.nav-panel-add').show(100); | 32 | $('.nav-panel-add').show(100); |
52 | $('.nav-panels .action').hide(100); | 33 | $('.nav-panels .action').hide(100); |
@@ -55,7 +36,7 @@ $(document).ready(function () { | |||
55 | $('#entry_url').focus(); | 36 | $('#entry_url').focus(); |
56 | return false; | 37 | return false; |
57 | }); | 38 | }); |
58 | $('#nav-btn-search').on('click', function () { | 39 | $('#nav-btn-search').on('click', () => { |
59 | $('.nav-panel-buttom').hide(100); | 40 | $('.nav-panel-buttom').hide(100); |
60 | $('.nav-panel-search').show(100); | 41 | $('.nav-panel-search').show(100); |
61 | $('.nav-panels .action').hide(100); | 42 | $('.nav-panels .action').hide(100); |
@@ -64,7 +45,7 @@ $(document).ready(function () { | |||
64 | $('#searchfield').focus(); | 45 | $('#searchfield').focus(); |
65 | return false; | 46 | return false; |
66 | }); | 47 | }); |
67 | $('.close').on('click', function () { | 48 | $('.close').on('click', () => { |
68 | $('.nav-panel-add').hide(100); | 49 | $('.nav-panel-add').hide(100); |
69 | $('.nav-panel-search').hide(100); | 50 | $('.nav-panel-search').hide(100); |
70 | $('.nav-panel-buttom').show(100); | 51 | $('.nav-panel-buttom').show(100); |
@@ -73,12 +54,12 @@ $(document).ready(function () { | |||
73 | $('.nav-panels').css('background', 'transparent'); | 54 | $('.nav-panels').css('background', 'transparent'); |
74 | return false; | 55 | return false; |
75 | }); | 56 | }); |
76 | $(window).scroll(function () { | 57 | $(window).scroll(() => { |
77 | var s = $(window).scrollTop(); | 58 | const s = $(window).scrollTop(); |
78 | var d = $(document).height(); | 59 | const d = $(document).height(); |
79 | var c = $(window).height(); | 60 | const c = $(window).height(); |
80 | var scrollPercent = (s / (d - c)) * 100; | 61 | const scrollPercent = (s / (d - c)) * 100; |
81 | $('.progress .determinate').css('width', scrollPercent + '%'); | 62 | $('.progress .determinate').css('width', `${scrollPercent}%`); |
82 | }); | 63 | }); |
83 | 64 | ||
84 | /* ========================================================================== | 65 | /* ========================================================================== |
@@ -86,9 +67,8 @@ $(document).ready(function () { | |||
86 | ========================================================================== */ | 67 | ========================================================================== */ |
87 | 68 | ||
88 | if ($('article').length) { | 69 | if ($('article').length) { |
89 | var app = new annotator.App(); | 70 | const app = new annotator.App(); |
90 | var x = JSON.parse($('#annotationroutes').html()); | 71 | const x = JSON.parse($('#annotationroutes').html()); |
91 | |||
92 | 72 | ||
93 | app.include(annotator.ui.main, { | 73 | app.include(annotator.ui.main, { |
94 | element: document.querySelector('article'), | 74 | element: document.querySelector('article'), |
@@ -96,21 +76,21 @@ $(document).ready(function () { | |||
96 | 76 | ||
97 | app.include(annotator.storage.http, x); | 77 | app.include(annotator.storage.http, x); |
98 | 78 | ||
99 | app.start().then(function () { | 79 | app.start().then(() => { |
100 | app.annotations.load({ entry: x.entryId }); | 80 | app.annotations.load({ entry: x.entryId }); |
101 | }); | 81 | }); |
102 | 82 | ||
103 | $(window).scroll(function (e) { | 83 | $(window).scroll(() => { |
104 | var scrollTop = $(window).scrollTop(); | 84 | const scrollTop = $(window).scrollTop(); |
105 | var docHeight = $(document).height(); | 85 | const docHeight = $(document).height(); |
106 | var scrollPercent = (scrollTop) / (docHeight); | 86 | const scrollPercent = (scrollTop) / (docHeight); |
107 | var scrollPercentRounded = Math.round(scrollPercent * 100) / 100; | 87 | const scrollPercentRounded = Math.round(scrollPercent * 100) / 100; |
108 | savePercent(x.entryId, scrollPercentRounded); | 88 | savePercent(x.entryId, scrollPercentRounded); |
109 | }); | 89 | }); |
110 | 90 | ||
111 | retrievePercent(x.entryId); | 91 | retrievePercent(x.entryId); |
112 | 92 | ||
113 | $(window).resize(function () { | 93 | $(window).resize(() => { |
114 | retrievePercent(x.entryId); | 94 | retrievePercent(x.entryId); |
115 | }); | 95 | }); |
116 | } | 96 | } |