diff options
Diffstat (limited to 'app/Resources/static/themes/material')
4 files changed, 238 insertions, 10 deletions
diff --git a/app/Resources/static/themes/material/css/main.css b/app/Resources/static/themes/material/css/main.css index 408fe14c..8f7b7a3d 100755 --- a/app/Resources/static/themes/material/css/main.css +++ b/app/Resources/static/themes/material/css/main.css | |||
@@ -150,6 +150,11 @@ | |||
150 | background-image: url("../../_global/img/icons/diaspora-icon--black.png"); | 150 | background-image: url("../../_global/img/icons/diaspora-icon--black.png"); |
151 | } | 151 | } |
152 | 152 | ||
153 | /* Unmark.it */ | ||
154 | .icon-image--unmark { | ||
155 | background-image: url("../../_global/img/icons/unmark-icon--black.png"); | ||
156 | } | ||
157 | |||
153 | /* Shaarli */ | 158 | /* Shaarli */ |
154 | .icon-image--shaarli { | 159 | .icon-image--shaarli { |
155 | background-image: url("../../_global/img/icons/shaarli.png"); | 160 | background-image: url("../../_global/img/icons/shaarli.png"); |
@@ -159,7 +164,7 @@ body { | |||
159 | display: flex; | 164 | display: flex; |
160 | min-height: 100vh; | 165 | min-height: 100vh; |
161 | flex-direction: column; | 166 | flex-direction: column; |
162 | background: #f0f0f0; | 167 | background: #fafafa; |
163 | } | 168 | } |
164 | 169 | ||
165 | body.login main { | 170 | body.login main { |
@@ -189,7 +194,6 @@ main, | |||
189 | 194 | ||
190 | .results { | 195 | .results { |
191 | height: 1em; | 196 | height: 1em; |
192 | line-height: 30px; | ||
193 | } | 197 | } |
194 | 198 | ||
195 | .results .nb-results, | 199 | .results .nb-results, |
@@ -198,6 +202,14 @@ main, | |||
198 | margin-bottom: 0; | 202 | margin-bottom: 0; |
199 | } | 203 | } |
200 | 204 | ||
205 | .results .nb-results { | ||
206 | display: inline-flex; | ||
207 | } | ||
208 | |||
209 | .results a { | ||
210 | color: #444; | ||
211 | } | ||
212 | |||
201 | .pagination { | 213 | .pagination { |
202 | float: right; | 214 | float: right; |
203 | } | 215 | } |
@@ -317,11 +329,13 @@ nav input { | |||
317 | color: #444; | 329 | color: #444; |
318 | } | 330 | } |
319 | 331 | ||
320 | .input-field.nav-panel-add label { | 332 | .input-field.nav-panel-add label, |
333 | .input-field.nav-panel-search label { | ||
321 | left: 1rem; | 334 | left: 1rem; |
322 | } | 335 | } |
323 | 336 | ||
324 | .input-field.nav-panel-add .close { | 337 | .input-field.nav-panel-add .close, |
338 | .input-field.nav-panel-search .close { | ||
325 | position: absolute; | 339 | position: absolute; |
326 | top: 0; | 340 | top: 0; |
327 | right: 1rem; | 341 | right: 1rem; |
@@ -340,7 +354,9 @@ nav input { | |||
340 | } | 354 | } |
341 | 355 | ||
342 | .input-field.nav-panel-add, | 356 | .input-field.nav-panel-add, |
343 | .input-field.nav-panel-add form { | 357 | .input-field.nav-panel-add form, |
358 | .input-field.nav-panel-search, | ||
359 | .input-field.nav-panel-search form { | ||
344 | height: 100%; | 360 | height: 100%; |
345 | } | 361 | } |
346 | 362 | ||
@@ -535,6 +551,18 @@ a.original { | |||
535 | line-height: 24px; | 551 | line-height: 24px; |
536 | } | 552 | } |
537 | 553 | ||
554 | .card .card-action ul.tools li a.tool { | ||
555 | margin-right: 5px !important; | ||
556 | } | ||
557 | |||
558 | .card-stacked:hover ul.tools-list { | ||
559 | display: block; | ||
560 | } | ||
561 | |||
562 | .card-stacked ul.tools-list { | ||
563 | display: none; | ||
564 | } | ||
565 | |||
538 | .card .card-action a { | 566 | .card .card-action a { |
539 | color: #fff; | 567 | color: #fff; |
540 | margin: 0; | 568 | margin: 0; |
@@ -587,7 +615,55 @@ a.original { | |||
587 | #article { | 615 | #article { |
588 | font-size: 20px; | 616 | font-size: 20px; |
589 | margin: 0 auto; | 617 | margin: 0 auto; |
590 | max-width: 40em; | 618 | max-width: 45em; |
619 | } | ||
620 | |||
621 | #article article { | ||
622 | color: #424242; | ||
623 | font-size: 18px; | ||
624 | line-height: 1.7em; | ||
625 | } | ||
626 | |||
627 | #article article h1, | ||
628 | #article article h2, | ||
629 | #article article h3, | ||
630 | #article article h4, | ||
631 | #article article h5, | ||
632 | #article article h6 { | ||
633 | color: #212121; | ||
634 | } | ||
635 | |||
636 | #article article h1 strong, | ||
637 | #article article h2 strong, | ||
638 | #article article h3 strong, | ||
639 | #article article h4 strong, | ||
640 | #article article h5 strong, | ||
641 | #article article h6 strong { | ||
642 | font-weight: 500; | ||
643 | } | ||
644 | |||
645 | #article article h6 { | ||
646 | font-size: 1.2rem; | ||
647 | } | ||
648 | |||
649 | #article article h5 { | ||
650 | font-size: 1.6rem; | ||
651 | } | ||
652 | |||
653 | #article article h4 { | ||
654 | font-size: 1.9rem; | ||
655 | } | ||
656 | |||
657 | #article article h3 { | ||
658 | font-size: 2.2rem; | ||
659 | } | ||
660 | |||
661 | #article article h2 { | ||
662 | font-size: 2.5rem; | ||
663 | } | ||
664 | |||
665 | #article article h1 { | ||
666 | font-size: 2.7rem; | ||
591 | } | 667 | } |
592 | 668 | ||
593 | #article img, | 669 | #article img, |
@@ -596,6 +672,46 @@ a.original { | |||
596 | height: auto; | 672 | height: auto; |
597 | } | 673 | } |
598 | 674 | ||
675 | #article article a { | ||
676 | border-bottom: 1px dotted #03a9f4; | ||
677 | text-decoration: none; | ||
678 | } | ||
679 | |||
680 | #article article a:hover { | ||
681 | border-bottom-style: solid; | ||
682 | } | ||
683 | |||
684 | #article article ul { | ||
685 | padding-left: 30px; | ||
686 | } | ||
687 | |||
688 | #article article ul, | ||
689 | #article article ul li { | ||
690 | list-style-type: disc; | ||
691 | } | ||
692 | |||
693 | #article article blockquote { | ||
694 | font-style: italic; | ||
695 | } | ||
696 | |||
697 | #article article strong { | ||
698 | font-weight: bold; | ||
699 | } | ||
700 | |||
701 | #article article pre { | ||
702 | box-sizing: border-box; | ||
703 | margin: 0 0 1.75em; | ||
704 | border: #e3f2fd 1px solid; | ||
705 | width: 100%; | ||
706 | padding: 10px; | ||
707 | font-family: monospace; | ||
708 | font-size: 0.8em; | ||
709 | white-space: pre; | ||
710 | overflow: auto; | ||
711 | background: #f5f5f5; | ||
712 | border-radius: 3px; | ||
713 | } | ||
714 | |||
599 | #article > header > h1 { | 715 | #article > header > h1 { |
600 | font-size: 2em; | 716 | font-size: 2em; |
601 | margin: 2.1rem 0 0.68rem; | 717 | margin: 2.1rem 0 0.68rem; |
diff --git a/app/Resources/static/themes/material/js/init.js b/app/Resources/static/themes/material/js/init.js index a68269e0..0b2832c0 100755 --- a/app/Resources/static/themes/material/js/init.js +++ b/app/Resources/static/themes/material/js/init.js | |||
@@ -1,10 +1,21 @@ | |||
1 | /* jQuery */ | ||
2 | import $ from 'jquery'; | ||
3 | |||
4 | /* Annotations */ | ||
5 | import annotator from 'annotator'; | ||
6 | |||
7 | /* Tools */ | ||
1 | import { savePercent, retrievePercent, initFilters, initExport } from '../../_global/js/tools'; | 8 | import { savePercent, retrievePercent, initFilters, initExport } from '../../_global/js/tools'; |
2 | 9 | ||
3 | const $ = require('jquery'); | 10 | /* Import shortcuts */ |
11 | import './shortcuts/main'; | ||
12 | import './shortcuts/entry'; | ||
13 | import '../../_global/js/shortcuts/main'; | ||
14 | import '../../_global/js/shortcuts/entry'; | ||
4 | 15 | ||
5 | global.jQuery = $; | ||
6 | require('materialize'); // eslint-disable-line | 16 | require('materialize'); // eslint-disable-line |
7 | const annotator = require('annotator'); | 17 | |
18 | global.jQuery = $; | ||
8 | 19 | ||
9 | $(document).ready(() => { | 20 | $(document).ready(() => { |
10 | // sideNav | 21 | // sideNav |
@@ -44,7 +55,7 @@ $(document).ready(() => { | |||
44 | $('.nav-panels .action').hide(100); | 55 | $('.nav-panels .action').hide(100); |
45 | $('.nav-panel-menu').addClass('hidden'); | 56 | $('.nav-panel-menu').addClass('hidden'); |
46 | $('.nav-panels').css('background', 'white'); | 57 | $('.nav-panels').css('background', 'white'); |
47 | $('#searchfield').focus(); | 58 | $('#search_entry_term').focus(); |
48 | return false; | 59 | return false; |
49 | }); | 60 | }); |
50 | $('.close').on('click', () => { | 61 | $('.close').on('click', () => { |
diff --git a/app/Resources/static/themes/material/js/shortcuts/entry.js b/app/Resources/static/themes/material/js/shortcuts/entry.js new file mode 100644 index 00000000..e19800bd --- /dev/null +++ b/app/Resources/static/themes/material/js/shortcuts/entry.js | |||
@@ -0,0 +1,26 @@ | |||
1 | import Mousetrap from 'mousetrap'; | ||
2 | import $ from 'jquery'; | ||
3 | |||
4 | $(document).ready(() => { | ||
5 | if ($('#article').length > 0) { | ||
6 | /* open original article */ | ||
7 | Mousetrap.bind('o', () => { | ||
8 | $('ul.side-nav a.original i')[0].click(); | ||
9 | }); | ||
10 | |||
11 | /* mark as favorite */ | ||
12 | Mousetrap.bind('f', () => { | ||
13 | $('ul.side-nav a.favorite i')[0].click(); | ||
14 | }); | ||
15 | |||
16 | /* mark as read */ | ||
17 | Mousetrap.bind('a', () => { | ||
18 | $('ul.side-nav a.markasread i')[0].click(); | ||
19 | }); | ||
20 | |||
21 | /* delete */ | ||
22 | Mousetrap.bind('del', () => { | ||
23 | $('ul.side-nav a.delete i')[0].click(); | ||
24 | }); | ||
25 | } | ||
26 | }); | ||
diff --git a/app/Resources/static/themes/material/js/shortcuts/main.js b/app/Resources/static/themes/material/js/shortcuts/main.js new file mode 100644 index 00000000..0a2d2a69 --- /dev/null +++ b/app/Resources/static/themes/material/js/shortcuts/main.js | |||
@@ -0,0 +1,75 @@ | |||
1 | import Mousetrap from 'mousetrap'; | ||
2 | import $ from 'jquery'; | ||
3 | |||
4 | function toggleFocus(cardToToogleFocus) { | ||
5 | if (cardToToogleFocus) { | ||
6 | $(cardToToogleFocus).toggleClass('z-depth-4'); | ||
7 | } | ||
8 | } | ||
9 | |||
10 | $(document).ready(() => { | ||
11 | const cards = $('#content').find('.card'); | ||
12 | const cardNumber = cards.length; | ||
13 | let cardIndex = 0; | ||
14 | /* If we come from next page */ | ||
15 | if (window.location.hash === '#prev') { | ||
16 | cardIndex = cardNumber - 1; | ||
17 | } | ||
18 | let card = cards[cardIndex]; | ||
19 | const pagination = $('.pagination'); | ||
20 | |||
21 | /* Show nothing on quickstart */ | ||
22 | if ($('#content > div.quickstart').length > 0) { | ||
23 | return; | ||
24 | } | ||
25 | |||
26 | /* Focus current card */ | ||
27 | toggleFocus(card); | ||
28 | |||
29 | /* Actions */ | ||
30 | Mousetrap.bind('g n', () => { | ||
31 | $('#nav-btn-add').trigger('click'); | ||
32 | return false; | ||
33 | }); | ||
34 | |||
35 | Mousetrap.bind('s', () => { | ||
36 | $('#nav-btn-search').trigger('click'); | ||
37 | return false; | ||
38 | }); | ||
39 | |||
40 | Mousetrap.bind('esc', () => { | ||
41 | $('.close').trigger('click'); | ||
42 | }); | ||
43 | |||
44 | /* Select right card. If there's a next page, go to next page */ | ||
45 | Mousetrap.bind('right', () => { | ||
46 | if (cardIndex >= 0 && cardIndex < cardNumber - 1) { | ||
47 | toggleFocus(card); | ||
48 | cardIndex += 1; | ||
49 | card = cards[cardIndex]; | ||
50 | toggleFocus(card); | ||
51 | return; | ||
52 | } | ||
53 | if (pagination.length > 0 && pagination.find('li.next:not(.disabled)').length > 0 && cardIndex === cardNumber - 1) { | ||
54 | window.location.href = window.location.origin + $(pagination).find('li.next a').attr('href'); | ||
55 | } | ||
56 | }); | ||
57 | |||
58 | /* Select previous card. If there's a previous page, go to next page */ | ||
59 | Mousetrap.bind('left', () => { | ||
60 | if (cardIndex > 0 && cardIndex < cardNumber) { | ||
61 | toggleFocus(card); | ||
62 | cardIndex -= 1; | ||
63 | card = cards[cardIndex]; | ||
64 | toggleFocus(card); | ||
65 | return; | ||
66 | } | ||
67 | if (pagination.length > 0 && $(pagination).find('li.prev:not(.disabled)').length > 0 && cardIndex === 0) { | ||
68 | window.location.href = `${window.location.origin + $(pagination).find('li.prev a').attr('href')}#prev`; | ||
69 | } | ||
70 | }); | ||
71 | |||
72 | Mousetrap.bind('enter', () => { | ||
73 | window.location.href = window.location.origin + $(card).find('span.card-title a').attr('href'); | ||
74 | }); | ||
75 | }); | ||