diff options
author | Thomas Citharel <tcit@tcit.fr> | 2016-10-27 01:57:27 +0200 |
---|---|---|
committer | Thomas Citharel <tcit@tcit.fr> | 2016-11-15 21:54:41 +0100 |
commit | af61cb80eb600618df95a01a15a08e87fc878c2a (patch) | |
tree | 3e5ba0c9935b5aace5e5c58a8d3fd84621d4b0db /app/Resources/static | |
parent | f9cded7dd2acab3af8ff8481941e0c199daf8270 (diff) | |
download | wallabag-af61cb80eb600618df95a01a15a08e87fc878c2a.tar.gz wallabag-af61cb80eb600618df95a01a15a08e87fc878c2a.tar.zst wallabag-af61cb80eb600618df95a01a15a08e87fc878c2a.zip |
es6 imports
Signed-off-by: Thomas Citharel <tcit@tcit.fr>
Diffstat (limited to 'app/Resources/static')
6 files changed, 44 insertions, 39 deletions
diff --git a/app/Resources/static/themes/_global/js/bookmarklet.js b/app/Resources/static/themes/_global/js/bookmarklet.js index 5174ff47..a497628b 100644 --- a/app/Resources/static/themes/_global/js/bookmarklet.js +++ b/app/Resources/static/themes/_global/js/bookmarklet.js | |||
@@ -1,4 +1,3 @@ | |||
1 | |||
2 | top['bookmarklet-url@wallabag.org'] = | 1 | top['bookmarklet-url@wallabag.org'] = |
3 | '<!DOCTYPE html><html><head><title>bag it!</title>' + | 2 | '<!DOCTYPE html><html><head><title>bag it!</title>' + |
4 | '<link rel="icon" href="tpl/img/favicon.ico" />' + | 3 | '<link rel="icon" href="tpl/img/favicon.ico" />' + |
diff --git a/app/Resources/static/themes/_global/js/tools.js b/app/Resources/static/themes/_global/js/tools.js index d6a2d803..96d9fcf6 100644 --- a/app/Resources/static/themes/_global/js/tools.js +++ b/app/Resources/static/themes/_global/js/tools.js | |||
@@ -1,5 +1,5 @@ | |||
1 | const $ = require('jquery'); | 1 | import $ from 'jquery'; |
2 | require('mousetrap'); | 2 | import Mousetrap from 'mousetrap'; |
3 | 3 | ||
4 | /* Allows inline call qr-code call */ | 4 | /* Allows inline call qr-code call */ |
5 | import jrQrcode from 'jr-qrcode'; // eslint-disable-line | 5 | import jrQrcode from 'jr-qrcode'; // eslint-disable-line |
@@ -56,45 +56,45 @@ export { savePercent, retrievePercent, initFilters, initExport }; | |||
56 | /** Shortcuts **/ | 56 | /** Shortcuts **/ |
57 | 57 | ||
58 | /* Go to */ | 58 | /* Go to */ |
59 | Mousetrap.bind('g u', function() { window.location.href = Routing.generate('homepage') }); | 59 | Mousetrap.bind('g u', () => { window.location.href = Routing.generate('homepage'); }); |
60 | Mousetrap.bind('g s', function() { window.location.href = Routing.generate('starred') }); | 60 | Mousetrap.bind('g s', () => { window.location.href = Routing.generate('starred'); }); |
61 | Mousetrap.bind('g r', function() { window.location.href = Routing.generate('archive') }); | 61 | Mousetrap.bind('g r', () => { window.location.href = Routing.generate('archive'); }); |
62 | Mousetrap.bind('g a', function() { window.location.href = Routing.generate('all') }); | 62 | Mousetrap.bind('g a', () => { window.location.href = Routing.generate('all'); }); |
63 | Mousetrap.bind('g t', function() { window.location.href = Routing.generate('tag') }); | 63 | Mousetrap.bind('g t', () => { window.location.href = Routing.generate('tag'); }); |
64 | Mousetrap.bind('g c', function() { window.location.href = Routing.generate('config') }); | 64 | Mousetrap.bind('g c', () => { window.location.href = Routing.generate('config'); }); |
65 | Mousetrap.bind('g i', function() { window.location.href = Routing.generate('import') }); | 65 | Mousetrap.bind('g i', () => { window.location.href = Routing.generate('import'); }); |
66 | Mousetrap.bind('g d', function() { window.location.href = Routing.generate('developer') }); | 66 | Mousetrap.bind('g d', () => { window.location.href = Routing.generate('developer'); }); |
67 | Mousetrap.bind('g h', function() { window.location.href = Routing.generate('howto') }); | 67 | Mousetrap.bind('g h', () => { window.location.href = Routing.generate('howto'); }); |
68 | Mousetrap.bind('g l', function() { window.location.href = Routing.generate('logout') }); | 68 | Mousetrap.bind('g l', () => { window.location.href = Routing.generate('logout'); }); |
69 | 69 | ||
70 | 70 | ||
71 | /* Actions */ | 71 | /* Actions */ |
72 | Mousetrap.bind('g n', function() { | 72 | Mousetrap.bind('g n', () => { |
73 | $("#nav-btn-add").trigger("click"); | 73 | $('#nav-btn-add').trigger('click'); |
74 | }); | 74 | }); |
75 | 75 | ||
76 | Mousetrap.bind('esc', function() { | 76 | Mousetrap.bind('esc', () => { |
77 | $(".close").trigger("click"); | 77 | $('.close').trigger('click'); |
78 | }); | 78 | }); |
79 | 79 | ||
80 | // Display the first element of the current view | 80 | // Display the first element of the current view |
81 | Mousetrap.bind('right', function() { | 81 | Mousetrap.bind('right', () => { |
82 | $("ul.data li:first-child span.dot-ellipsis a")[0].click(); | 82 | $('ul.data li:first-child span.dot-ellipsis a')[0].click(); |
83 | }); | 83 | }); |
84 | 84 | ||
85 | /* Article view */ | 85 | /* Article view */ |
86 | Mousetrap.bind('o', function() { | 86 | Mousetrap.bind('o', () => { |
87 | $("ul.side-nav li:nth-child(2) a i")[0].click(); | 87 | $('ul.side-nav li:nth-child(2) a i')[0].click(); |
88 | }); | 88 | }); |
89 | 89 | ||
90 | Mousetrap.bind('s', function() { | 90 | Mousetrap.bind('s', () => { |
91 | $("ul.side-nav li:nth-child(5) a i")[0].click(); | 91 | $('ul.side-nav li:nth-child(5) a i')[0].click(); |
92 | }); | 92 | }); |
93 | 93 | ||
94 | Mousetrap.bind('a', function() { | 94 | Mousetrap.bind('a', () => { |
95 | $("ul.side-nav li:nth-child(4) a i")[0].click(); | 95 | $('ul.side-nav li:nth-child(4) a i')[0].click(); |
96 | }); | 96 | }); |
97 | 97 | ||
98 | Mousetrap.bind('del', function() { | 98 | Mousetrap.bind('del', () => { |
99 | $("ul.side-nav li:nth-child(6) a i")[0].click(); | 99 | $('ul.side-nav li:nth-child(6) a i')[0].click(); |
100 | }); | 100 | }); |
diff --git a/app/Resources/static/themes/baggy/js/autoCompleteTags.js b/app/Resources/static/themes/baggy/js/autoCompleteTags.js index f287ebfa..64fdaa92 100755 --- a/app/Resources/static/themes/baggy/js/autoCompleteTags.js +++ b/app/Resources/static/themes/baggy/js/autoCompleteTags.js | |||
@@ -5,4 +5,4 @@ function extractLast(term) { | |||
5 | return split(term).pop(); | 5 | return split(term).pop(); |
6 | } | 6 | } |
7 | 7 | ||
8 | export { split, extractLast }; | 8 | export default { split, extractLast }; |
diff --git a/app/Resources/static/themes/baggy/js/init.js b/app/Resources/static/themes/baggy/js/init.js index dc11043a..b7347f7c 100755 --- a/app/Resources/static/themes/baggy/js/init.js +++ b/app/Resources/static/themes/baggy/js/init.js | |||
@@ -1,11 +1,17 @@ | |||
1 | import { savePercent, retrievePercent } from '../../_global/js/tools'; | 1 | import $ from 'jquery'; |
2 | import { toggleSaveLinkForm } from './uiTools'; | 2 | |
3 | /* eslint-disable no-unused-vars */ | ||
4 | /* jquery has default scope */ | ||
5 | import cookie from 'jquery.cookie'; | ||
6 | import ui from 'jquery-ui-browserify'; | ||
7 | /* eslint-enable no-unused-vars */ | ||
3 | 8 | ||
4 | const $ = global.jquery = require('jquery'); | 9 | import annotator from 'annotator'; |
5 | require('jquery.cookie'); | 10 | |
6 | require('jquery-ui-browserify'); | 11 | import { savePercent, retrievePercent } from '../../_global/js/tools'; |
7 | const annotator = require('annotator'); | 12 | import toggleSaveLinkForm from './uiTools'; |
8 | 13 | ||
14 | global.jquery = $; | ||
9 | 15 | ||
10 | $.fn.ready(() => { | 16 | $.fn.ready(() => { |
11 | const $listmode = $('#listmode'); | 17 | const $listmode = $('#listmode'); |
diff --git a/app/Resources/static/themes/baggy/js/uiTools.js b/app/Resources/static/themes/baggy/js/uiTools.js index 900b2707..713c53f7 100644 --- a/app/Resources/static/themes/baggy/js/uiTools.js +++ b/app/Resources/static/themes/baggy/js/uiTools.js | |||
@@ -1,4 +1,4 @@ | |||
1 | const $ = require('jquery'); | 1 | import $ from 'jquery'; |
2 | 2 | ||
3 | function toggleSaveLinkForm(url, event) { | 3 | function toggleSaveLinkForm(url, event) { |
4 | $('#add-link-result').empty(); | 4 | $('#add-link-result').empty(); |
@@ -32,4 +32,4 @@ function toggleSaveLinkForm(url, event) { | |||
32 | plainUrl.focus(); | 32 | plainUrl.focus(); |
33 | } | 33 | } |
34 | 34 | ||
35 | export { toggleSaveLinkForm }; | 35 | export default toggleSaveLinkForm; |
diff --git a/app/Resources/static/themes/material/js/init.js b/app/Resources/static/themes/material/js/init.js index a68269e0..d8edeed1 100755 --- a/app/Resources/static/themes/material/js/init.js +++ b/app/Resources/static/themes/material/js/init.js | |||
@@ -1,10 +1,10 @@ | |||
1 | import $ from 'jquery'; | ||
2 | import annotator from 'annotator'; | ||
1 | import { savePercent, retrievePercent, initFilters, initExport } from '../../_global/js/tools'; | 3 | import { savePercent, retrievePercent, initFilters, initExport } from '../../_global/js/tools'; |
2 | 4 | ||
3 | const $ = require('jquery'); | 5 | require('materialize'); // eslint-disable-line |
4 | 6 | ||
5 | global.jQuery = $; | 7 | global.jQuery = $; |
6 | require('materialize'); // eslint-disable-line | ||
7 | const annotator = require('annotator'); | ||
8 | 8 | ||
9 | $(document).ready(() => { | 9 | $(document).ready(() => { |
10 | // sideNav | 10 | // sideNav |