diff options
author | Thomas Citharel <tcit@tcit.fr> | 2016-03-08 17:02:34 +0100 |
---|---|---|
committer | Thomas Citharel <tcit@tcit.fr> | 2016-06-09 17:12:51 +0200 |
commit | 5ecdfcd041767c9e3244a92bb0a6cc3c3f80fea3 (patch) | |
tree | 03ee1eab0d89d1857daca9e273fd8c9ca47e33c2 /app/Resources/static/themes/baggy/js | |
parent | 9f95b14dec88cf083cefa38d5fbd84189e07acac (diff) | |
download | wallabag-5ecdfcd041767c9e3244a92bb0a6cc3c3f80fea3.tar.gz wallabag-5ecdfcd041767c9e3244a92bb0a6cc3c3f80fea3.tar.zst wallabag-5ecdfcd041767c9e3244a92bb0a6cc3c3f80fea3.zip |
manage assets through npm
first draft
remote assetic totally
work
nearly there
use at least nodejs > 0.12
use proper version of grunt
bump nodejs version for travis
update npm
workaround for materialize
install node 5.0
add grunt-cli
baggy theme & cache node modules
cache bower & npm
make travis build assets on php7 only
exclude installing node & npm if not needed & use bash
clean & try to make icomoon work on baggy
ready
config for travis
rebase
make travis work
more travis work
impove travis & update deps
add missing pixrem deps
add module through oddly lost
ui updates
install latest nodejs
add install_dev.sh, link local binaries for npm/bower/grunt
ui improvements (mostly baggy)
fix travis build
no need to install on travis
Add unread filter to entries pages
Add the ability to filter for unread pages in the filters menu.
Add unread filter test to EntryControllerTest
Add a new test to the EntryControllerTest collection which checks that
only entries which have not been archived (and are treated as "unread")
are retrieved.
Improve English translation
Update FAQ
-Fix grammar
-Add notes about MTA, firewall, and SELinux
Update installation instructions
-Fix grammar
-Add SELinux section
add screenshots of android docu in English
Fix the deletion of Tags/Entries relation when delete an entry
Fix #2121
Move fixtures to the right place
Display a message when saving an entry failed
When saving an entry fail because of database error we previously just returned `false`.
Now we got an error in the log and the displayed notice to the user is updated too.
Change ManyToMany between entry & tag
Following https://gist.github.com/Ocramius/3121916
Be sure to remove the related entity when removing an entity.
Let say you have Entry -> EntryTag -> Tag.
If you remove the entry:
- before that commit, the EntryTag will stay (at least using SQLite).
- with that commit, the related entity is removed
Prepare wallabag 2.0.5
enforce older materialize version
Diffstat (limited to 'app/Resources/static/themes/baggy/js')
-rw-r--r-- | app/Resources/static/themes/baggy/js/autoClose.js | 6 | ||||
-rwxr-xr-x | app/Resources/static/themes/baggy/js/autoCompleteTags.js | 47 | ||||
-rw-r--r-- | app/Resources/static/themes/baggy/js/closeMessage.js | 17 | ||||
-rwxr-xr-x | app/Resources/static/themes/baggy/js/init.js | 101 | ||||
-rw-r--r-- | app/Resources/static/themes/baggy/js/popupForm.js | 100 | ||||
-rwxr-xr-x | app/Resources/static/themes/baggy/js/saveLink.js | 78 |
6 files changed, 349 insertions, 0 deletions
diff --git a/app/Resources/static/themes/baggy/js/autoClose.js b/app/Resources/static/themes/baggy/js/autoClose.js new file mode 100644 index 00000000..e9145b7e --- /dev/null +++ b/app/Resources/static/themes/baggy/js/autoClose.js | |||
@@ -0,0 +1,6 @@ | |||
1 | $(document).ready(function() { | ||
2 | current_url = window.location.href | ||
3 | if (current_url.match("&closewin=true")) { | ||
4 | window.close(); | ||
5 | } | ||
6 | }); | ||
diff --git a/app/Resources/static/themes/baggy/js/autoCompleteTags.js b/app/Resources/static/themes/baggy/js/autoCompleteTags.js new file mode 100755 index 00000000..90bc982c --- /dev/null +++ b/app/Resources/static/themes/baggy/js/autoCompleteTags.js | |||
@@ -0,0 +1,47 @@ | |||
1 | jQuery(function($) { | ||
2 | |||
3 | function split( val ) { | ||
4 | return val.split( /,\s*/ ); | ||
5 | } | ||
6 | function extractLast( term ) { | ||
7 | return split( term ).pop(); | ||
8 | } | ||
9 | |||
10 | |||
11 | $("#value").bind("keydown", function(event) { | ||
12 | if (event.keyCode === $.ui.keyCode.TAB && $(this).data("ui-autocomplete").menu.active) { | ||
13 | event.preventDefault(); | ||
14 | } | ||
15 | }).autocomplete({ | ||
16 | source : function(request, response) { | ||
17 | $.getJSON("./?view=tags", { | ||
18 | term : extractLast(request.term), | ||
19 | //id: $(':hidden#entry_id').val() | ||
20 | }, response); | ||
21 | }, | ||
22 | search : function() { | ||
23 | // custom minLength | ||
24 | var term = extractLast(this.value); | ||
25 | if (term.length < 1) { | ||
26 | return false; | ||
27 | } | ||
28 | }, | ||
29 | focus : function() { | ||
30 | // prevent value inserted on focus | ||
31 | return false; | ||
32 | }, | ||
33 | select : function(event, ui) { | ||
34 | var terms = split(this.value); | ||
35 | // remove the current input | ||
36 | terms.pop(); | ||
37 | // add the selected item | ||
38 | terms.push(ui.item.value); | ||
39 | // add placeholder to get the comma-and-space at the end | ||
40 | terms.push(""); | ||
41 | this.value = terms.join(", "); | ||
42 | return false; | ||
43 | } | ||
44 | }); | ||
45 | |||
46 | |||
47 | }); | ||
diff --git a/app/Resources/static/themes/baggy/js/closeMessage.js b/app/Resources/static/themes/baggy/js/closeMessage.js new file mode 100644 index 00000000..527719d5 --- /dev/null +++ b/app/Resources/static/themes/baggy/js/closeMessage.js | |||
@@ -0,0 +1,17 @@ | |||
1 | $(function(){ | ||
2 | //--------------------------------------------------------------------------- | ||
3 | // Show the close icon when the user hover over a message | ||
4 | //--------------------------------------------------------------------------- | ||
5 | // $('.messages').on('mouseenter', function(){ | ||
6 | // $(this).find('a.closeMessage').stop(true, true).show(); | ||
7 | // }).on('mouseleave', function(){ | ||
8 | // $(this).find('a.closeMessage').stop(true, true).hide(); | ||
9 | // }); | ||
10 | //--------------------------------------------------------------------------- | ||
11 | // Close the message box when the user clicks the close icon | ||
12 | //--------------------------------------------------------------------------- | ||
13 | $('a.closeMessage').on('click', function(){ | ||
14 | $(this).parents('div.messages').slideUp(300, function(){ $(this).remove(); }); | ||
15 | return false; | ||
16 | }); | ||
17 | }); \ No newline at end of file | ||
diff --git a/app/Resources/static/themes/baggy/js/init.js b/app/Resources/static/themes/baggy/js/init.js new file mode 100755 index 00000000..1721ae41 --- /dev/null +++ b/app/Resources/static/themes/baggy/js/init.js | |||
@@ -0,0 +1,101 @@ | |||
1 | var $ = global.jquery = require('jquery'); | ||
2 | require('jquery.cookie'); | ||
3 | require('jquery-ui'); | ||
4 | var annotator = require('annotator'); | ||
5 | |||
6 | |||
7 | $.fn.ready(function() { | ||
8 | |||
9 | var $listmode = $('#listmode'), | ||
10 | $listentries = $("#list-entries"); | ||
11 | |||
12 | /* ========================================================================== | ||
13 | Menu | ||
14 | ========================================================================== */ | ||
15 | |||
16 | $("#menu").click(function(){ | ||
17 | $("#links").toggleClass('menu--open'); | ||
18 | if ($('#content').hasClass('opacity03')) { | ||
19 | $('#content').removeClass('opacity03'); | ||
20 | } | ||
21 | }); | ||
22 | |||
23 | /* ========================================================================== | ||
24 | List mode or Table Mode | ||
25 | ========================================================================== */ | ||
26 | |||
27 | $listmode.click(function(){ | ||
28 | if ( jquery.cookie("listmode") == 1 ) { | ||
29 | // Cookie | ||
30 | $.removeCookie("listmode"); | ||
31 | |||
32 | $listentries.removeClass("listmode"); | ||
33 | $listmode.removeClass("tablemode"); | ||
34 | $listmode.addClass("listmode"); | ||
35 | } | ||
36 | else { | ||
37 | // Cookie | ||
38 | jquery.cookie("listmode", 1, {expires: 365}); | ||
39 | |||
40 | $listentries.addClass("listmode"); | ||
41 | $listmode.removeClass("listmode"); | ||
42 | $listmode.addClass("tablemode"); | ||
43 | } | ||
44 | |||
45 | }); | ||
46 | |||
47 | /* ========================================================================== | ||
48 | Cookie listmode | ||
49 | ========================================================================== */ | ||
50 | |||
51 | if ( jquery.cookie("listmode") == 1 ) { | ||
52 | $listentries.addClass("listmode"); | ||
53 | $listmode.removeClass("listmode"); | ||
54 | $listmode.addClass("tablemode"); | ||
55 | } | ||
56 | |||
57 | /* ========================================================================== | ||
58 | Add tag panel | ||
59 | ========================================================================== */ | ||
60 | |||
61 | |||
62 | $('#nav-btn-add-tag').on('click', function(){ | ||
63 | $(".nav-panel-add-tag").toggle(100); | ||
64 | $(".nav-panel-menu").addClass('hidden'); | ||
65 | $("#tag_label").focus(); | ||
66 | return false; | ||
67 | }); | ||
68 | |||
69 | /* ========================================================================== | ||
70 | Annotations & Remember position | ||
71 | ========================================================================== */ | ||
72 | |||
73 | if ($("article").length) { | ||
74 | var app = new annotator.App(); | ||
75 | |||
76 | app.include(annotator.ui.main, { | ||
77 | element: document.querySelector('article') | ||
78 | }); | ||
79 | |||
80 | var x = JSON.parse($('#annotationroutes').html()); | ||
81 | app.include(annotator.storage.http, x); | ||
82 | |||
83 | app.start().then(function () { | ||
84 | app.annotations.load({entry: x.entryId}); | ||
85 | }); | ||
86 | |||
87 | $(window).scroll(function(e){ | ||
88 | var scrollTop = $(window).scrollTop(); | ||
89 | var docHeight = $(document).height(); | ||
90 | var scrollPercent = (scrollTop) / (docHeight); | ||
91 | var scrollPercentRounded = Math.round(scrollPercent*100)/100; | ||
92 | savePercent(x.entryId, scrollPercentRounded); | ||
93 | }); | ||
94 | |||
95 | retrievePercent(x.entryId); | ||
96 | |||
97 | $(window).resize(function(){ | ||
98 | retrievePercent(x.entryId); | ||
99 | }); | ||
100 | } | ||
101 | }); | ||
diff --git a/app/Resources/static/themes/baggy/js/popupForm.js b/app/Resources/static/themes/baggy/js/popupForm.js new file mode 100644 index 00000000..0b478fad --- /dev/null +++ b/app/Resources/static/themes/baggy/js/popupForm.js | |||
@@ -0,0 +1,100 @@ | |||
1 | $(document).ready(function() { | ||
2 | |||
3 | $("#search-form").hide(); | ||
4 | $("#bagit-form").hide(); | ||
5 | $("#filter-form").hide(); | ||
6 | $("#download-form").hide(); | ||
7 | |||
8 | //--------------------------------------------------------------------------- | ||
9 | // Toggle the "Search" popup in the sidebar | ||
10 | //--------------------------------------------------------------------------- | ||
11 | function toggleSearch() { | ||
12 | $("#search-form").toggle(); | ||
13 | $("#search").toggleClass("current"); | ||
14 | $("#search").toggleClass("active-current"); | ||
15 | $("#search-arrow").toggleClass("arrow-down"); | ||
16 | if ($("#search").hasClass("current")) { | ||
17 | $("#content").addClass("opacity03"); | ||
18 | } else { | ||
19 | $("#content").removeClass("opacity03"); | ||
20 | } | ||
21 | } | ||
22 | |||
23 | //--------------------------------------------------------------------------- | ||
24 | // Toggle the "Filter" popup on entries list | ||
25 | //--------------------------------------------------------------------------- | ||
26 | function toggleFilter() { | ||
27 | $("#filter-form").toggle(); | ||
28 | } | ||
29 | |||
30 | //--------------------------------------------------------------------------- | ||
31 | // Toggle the "Download" popup on entries list | ||
32 | //--------------------------------------------------------------------------- | ||
33 | function toggleDownload() { | ||
34 | $("#download-form").toggle(); | ||
35 | } | ||
36 | |||
37 | //--------------------------------------------------------------------------- | ||
38 | // Toggle the "Save a Link" popup in the sidebar | ||
39 | //--------------------------------------------------------------------------- | ||
40 | function toggleBagit() { | ||
41 | $("#bagit-form").toggle(); | ||
42 | $("#bagit").toggleClass("current"); | ||
43 | $("#bagit").toggleClass("active-current"); | ||
44 | $("#bagit-arrow").toggleClass("arrow-down"); | ||
45 | if ($("#bagit").hasClass("current")) { | ||
46 | $("#content").addClass("opacity03"); | ||
47 | } else { | ||
48 | $("#content").removeClass("opacity03"); | ||
49 | } | ||
50 | } | ||
51 | |||
52 | //--------------------------------------------------------------------------- | ||
53 | // Close all #links popups in the sidebar | ||
54 | //--------------------------------------------------------------------------- | ||
55 | function closePopups() { | ||
56 | $("#links .messages").hide(); | ||
57 | $("#links > li > a").removeClass("active-current"); | ||
58 | $("#links > li > a").removeClass("current"); | ||
59 | $("[id$=-arrow]").removeClass("arrow-down"); | ||
60 | $("#content").removeClass("opacity03"); | ||
61 | } | ||
62 | |||
63 | $("#search").click(function(){ | ||
64 | closePopups(); | ||
65 | toggleSearch(); | ||
66 | $("#searchfield").focus(); | ||
67 | }); | ||
68 | |||
69 | $(".filter-btn").click(function(){ | ||
70 | closePopups(); | ||
71 | toggleFilter(); | ||
72 | }); | ||
73 | |||
74 | $(".download-btn").click(function(){ | ||
75 | closePopups(); | ||
76 | toggleDownload(); | ||
77 | }); | ||
78 | |||
79 | $("#bagit").click(function(){ | ||
80 | closePopups(); | ||
81 | toggleBagit(); | ||
82 | $("#plainurl").focus(); | ||
83 | }); | ||
84 | |||
85 | $("#search-form-close").click(function(){ | ||
86 | toggleSearch(); | ||
87 | }); | ||
88 | |||
89 | $("#filter-form-close").click(function(){ | ||
90 | toggleFilter(); | ||
91 | }); | ||
92 | |||
93 | $("#download-form-close").click(function(){ | ||
94 | toggleDownload(); | ||
95 | }); | ||
96 | |||
97 | $("#bagit-form-close").click(function(){ | ||
98 | toggleBagit(); | ||
99 | }); | ||
100 | }); | ||
diff --git a/app/Resources/static/themes/baggy/js/saveLink.js b/app/Resources/static/themes/baggy/js/saveLink.js new file mode 100755 index 00000000..91cc2c3f --- /dev/null +++ b/app/Resources/static/themes/baggy/js/saveLink.js | |||
@@ -0,0 +1,78 @@ | |||
1 | $.fn.ready(function() { | ||
2 | |||
3 | var $bagit = $('#bagit'), | ||
4 | $bagitForm = $('#bagit-form'), | ||
5 | $bagitFormForm = $('#bagit-form-form'); | ||
6 | |||
7 | /* ========================================================================== | ||
8 | bag it link and close button | ||
9 | ========================================================================== */ | ||
10 | |||
11 | function toggleSaveLinkForm(url, event) { | ||
12 | $("#add-link-result").empty(); | ||
13 | |||
14 | $bagit.toggleClass("active-current"); | ||
15 | |||
16 | //only if bag-it link is not presented on page | ||
17 | if ( $bagit.length === 0 ) { | ||
18 | if ( event !== 'undefined' && event ) { | ||
19 | $bagitForm.css( {position:"absolute", top:event.pageY, left:event.pageX-200}); | ||
20 | } | ||
21 | else { | ||
22 | $bagitForm.css( {position:"relative", top:"auto", left:"auto"}); | ||
23 | } | ||
24 | } | ||
25 | |||
26 | if ($("#search-form").length != 0) { | ||
27 | $("#search").removeClass("current"); | ||
28 | $("#search-arrow").removeClass("arrow-down"); | ||
29 | $("#search-form").hide(); | ||
30 | } | ||
31 | $bagitForm.toggle(); | ||
32 | $('#content').toggleClass("opacity03"); | ||
33 | if (url !== 'undefined' && url) { | ||
34 | $('#plainurl').val(url); | ||
35 | } | ||
36 | $('#plainurl').focus(); | ||
37 | } | ||
38 | |||
39 | //send "bag it link" form request via ajax | ||
40 | $bagitFormForm.submit( function(event) { | ||
41 | $("body").css("cursor", "wait"); | ||
42 | $("#add-link-result").empty(); | ||
43 | |||
44 | $.ajax({ | ||
45 | type: $bagitFormForm.attr('method'), | ||
46 | url: $bagitFormForm.attr('action'), | ||
47 | data: $bagitFormForm.serialize(), | ||
48 | success: function(data) { | ||
49 | $('#add-link-result').html("Done!"); | ||
50 | $('#plainurl').val(''); | ||
51 | $('#plainurl').blur(''); | ||
52 | $("body").css("cursor", "auto"); | ||
53 | }, | ||
54 | error: function(data) { | ||
55 | $('#add-link-result').html("Failed!"); | ||
56 | $("body").css("cursor", "auto"); | ||
57 | } | ||
58 | }); | ||
59 | |||
60 | event.preventDefault(); | ||
61 | }); | ||
62 | |||
63 | /* ========================================================================== | ||
64 | Process all links inside an article | ||
65 | ========================================================================== */ | ||
66 | |||
67 | $("article a[href^='http']").after(function() { | ||
68 | return " <a href=\"" + $(this).attr('href') + "\" class=\"add-to-wallabag-link-after\" alt=\"add to wallabag\" title=\"add to wallabag\"></a> "; | ||
69 | }); | ||
70 | |||
71 | $(".add-to-wallabag-link-after").click(function(event){ | ||
72 | toggleSaveLinkForm($(this).attr('href'), event); | ||
73 | event.preventDefault(); | ||
74 | }); | ||
75 | |||
76 | }); | ||
77 | |||
78 | |||