aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/Wallabag/CoreBundle/Resources/public/themes/baggy/js
diff options
context:
space:
mode:
authorThomas Citharel <tcit@tcit.fr>2016-03-08 17:02:34 +0100
committerThomas Citharel <tcit@tcit.fr>2016-06-09 17:12:51 +0200
commit5ecdfcd041767c9e3244a92bb0a6cc3c3f80fea3 (patch)
tree03ee1eab0d89d1857daca9e273fd8c9ca47e33c2 /src/Wallabag/CoreBundle/Resources/public/themes/baggy/js
parent9f95b14dec88cf083cefa38d5fbd84189e07acac (diff)
downloadwallabag-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 'src/Wallabag/CoreBundle/Resources/public/themes/baggy/js')
-rw-r--r--src/Wallabag/CoreBundle/Resources/public/themes/baggy/js/autoClose.js6
-rwxr-xr-xsrc/Wallabag/CoreBundle/Resources/public/themes/baggy/js/autoCompleteTags.js47
-rw-r--r--src/Wallabag/CoreBundle/Resources/public/themes/baggy/js/closeMessage.js17
-rwxr-xr-xsrc/Wallabag/CoreBundle/Resources/public/themes/baggy/js/init.js63
-rw-r--r--src/Wallabag/CoreBundle/Resources/public/themes/baggy/js/popupForm.js83
-rw-r--r--src/Wallabag/CoreBundle/Resources/public/themes/baggy/js/restoreScroll.js25
-rwxr-xr-xsrc/Wallabag/CoreBundle/Resources/public/themes/baggy/js/saveLink.js96
7 files changed, 0 insertions, 337 deletions
diff --git a/src/Wallabag/CoreBundle/Resources/public/themes/baggy/js/autoClose.js b/src/Wallabag/CoreBundle/Resources/public/themes/baggy/js/autoClose.js
deleted file mode 100644
index e9145b7e..00000000
--- a/src/Wallabag/CoreBundle/Resources/public/themes/baggy/js/autoClose.js
+++ /dev/null
@@ -1,6 +0,0 @@
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/src/Wallabag/CoreBundle/Resources/public/themes/baggy/js/autoCompleteTags.js b/src/Wallabag/CoreBundle/Resources/public/themes/baggy/js/autoCompleteTags.js
deleted file mode 100755
index 90bc982c..00000000
--- a/src/Wallabag/CoreBundle/Resources/public/themes/baggy/js/autoCompleteTags.js
+++ /dev/null
@@ -1,47 +0,0 @@
1jQuery(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/src/Wallabag/CoreBundle/Resources/public/themes/baggy/js/closeMessage.js b/src/Wallabag/CoreBundle/Resources/public/themes/baggy/js/closeMessage.js
deleted file mode 100644
index 527719d5..00000000
--- a/src/Wallabag/CoreBundle/Resources/public/themes/baggy/js/closeMessage.js
+++ /dev/null
@@ -1,17 +0,0 @@
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/src/Wallabag/CoreBundle/Resources/public/themes/baggy/js/init.js b/src/Wallabag/CoreBundle/Resources/public/themes/baggy/js/init.js
deleted file mode 100755
index 9bdc6f21..00000000
--- a/src/Wallabag/CoreBundle/Resources/public/themes/baggy/js/init.js
+++ /dev/null
@@ -1,63 +0,0 @@
1$.fn.ready(function() {
2
3 var $listmode = $('#listmode'),
4 $listentries = $("#list-entries");
5
6 /* ==========================================================================
7 Menu
8 ========================================================================== */
9
10 $("#menu").click(function(){
11 $("#links").toggleClass('menu--open');
12 if ($('#content').hasClass('opacity03')) {
13 $('#content').removeClass('opacity03');
14 }
15 });
16
17 /* ==========================================================================
18 List mode or Table Mode
19 ========================================================================== */
20
21 $listmode.click(function(){
22 if ( $.cookie("listmode") == 1 ) {
23 // Cookie
24 $.removeCookie("listmode");
25
26 $listentries.removeClass("listmode");
27 $listmode.removeClass("tablemode");
28 $listmode.addClass("listmode");
29 }
30 else {
31 // Cookie
32 $.cookie("listmode", 1, {expires: 365});
33
34 $listentries.addClass("listmode");
35 $listmode.removeClass("listmode");
36 $listmode.addClass("tablemode");
37 }
38
39 });
40
41 /* ==========================================================================
42 Cookie listmode
43 ========================================================================== */
44
45 if ( $.cookie("listmode") == 1 ) {
46 $listentries.addClass("listmode");
47 $listmode.removeClass("listmode");
48 $listmode.addClass("tablemode");
49 }
50
51 /* ==========================================================================
52 Add tag panel
53 ========================================================================== */
54
55
56 $('#nav-btn-add-tag').on('click', function(){
57 $(".nav-panel-add-tag").toggle(100);
58 $(".nav-panel-menu").addClass('hidden');
59 $("#tag_label").focus();
60 return false;
61 });
62
63});
diff --git a/src/Wallabag/CoreBundle/Resources/public/themes/baggy/js/popupForm.js b/src/Wallabag/CoreBundle/Resources/public/themes/baggy/js/popupForm.js
deleted file mode 100644
index b933acd1..00000000
--- a/src/Wallabag/CoreBundle/Resources/public/themes/baggy/js/popupForm.js
+++ /dev/null
@@ -1,83 +0,0 @@
1$(document).ready(function() {
2
3 $("#search-form").hide();
4 $("#bagit-form").hide();
5 $("#filter-form").hide();
6
7 //---------------------------------------------------------------------------
8 // Toggle the "Search" popup in the sidebar
9 //---------------------------------------------------------------------------
10 function toggleSearch() {
11 $("#search-form").toggle();
12 $("#search").toggleClass("current");
13 $("#search").toggleClass("active-current");
14 $("#search-arrow").toggleClass("arrow-down");
15 if ($("#search").hasClass("current")) {
16 $("#content").addClass("opacity03");
17 } else {
18 $("#content").removeClass("opacity03");
19 }
20 }
21
22 //---------------------------------------------------------------------------
23 // Toggle the "Filter" popup on entries list
24 //---------------------------------------------------------------------------
25 function toggleFilter() {
26 $("#filter-form").toggle();
27 }
28
29 //---------------------------------------------------------------------------
30 // Toggle the "Save a Link" popup in the sidebar
31 //---------------------------------------------------------------------------
32 function toggleBagit() {
33 $("#bagit-form").toggle();
34 $("#bagit").toggleClass("current");
35 $("#bagit").toggleClass("active-current");
36 $("#bagit-arrow").toggleClass("arrow-down");
37 if ($("#bagit").hasClass("current")) {
38 $("#content").addClass("opacity03");
39 } else {
40 $("#content").removeClass("opacity03");
41 }
42 }
43
44 //---------------------------------------------------------------------------
45 // Close all #links popups in the sidebar
46 //---------------------------------------------------------------------------
47 function closePopups() {
48 $("#links .messages").hide();
49 $("#links > li > a").removeClass("active-current");
50 $("#links > li > a").removeClass("current");
51 $("[id$=-arrow]").removeClass("arrow-down");
52 $("#content").removeClass("opacity03");
53 }
54
55 $("#search").click(function(){
56 closePopups();
57 toggleSearch();
58 $("#searchfield").focus();
59 });
60
61 $("#filter").click(function(){
62 closePopups();
63 toggleFilter();
64 });
65
66 $("#bagit").click(function(){
67 closePopups();
68 toggleBagit();
69 $("#plainurl").focus();
70 });
71
72 $("#search-form-close").click(function(){
73 toggleSearch();
74 });
75
76 $("#filter-form-close").click(function(){
77 toggleFilter();
78 });
79
80 $("#bagit-form-close").click(function(){
81 toggleBagit();
82 });
83});
diff --git a/src/Wallabag/CoreBundle/Resources/public/themes/baggy/js/restoreScroll.js b/src/Wallabag/CoreBundle/Resources/public/themes/baggy/js/restoreScroll.js
deleted file mode 100644
index 331c9e19..00000000
--- a/src/Wallabag/CoreBundle/Resources/public/themes/baggy/js/restoreScroll.js
+++ /dev/null
@@ -1,25 +0,0 @@
1function supportsLocalStorage() {
2 try {
3 return 'localStorage' in window && window['localStorage'] !== null;
4 } catch (e) {
5 return false;
6 }
7}
8
9function savePercent(id, percent) {
10 if (!supportsLocalStorage()) { return false; }
11 localStorage["poche.article." + id + ".percent"] = percent;
12 return true;
13}
14
15function retrievePercent(id) {
16 if (!supportsLocalStorage()) { return false; }
17
18 var bheight = $(document).height();
19 var percent = localStorage["poche.article." + id + ".percent"];
20 var scroll = bheight * percent;
21
22 $('html,body').animate({scrollTop: scroll}, 'fast');
23
24 return true;
25} \ No newline at end of file
diff --git a/src/Wallabag/CoreBundle/Resources/public/themes/baggy/js/saveLink.js b/src/Wallabag/CoreBundle/Resources/public/themes/baggy/js/saveLink.js
deleted file mode 100755
index 34e934cc..00000000
--- a/src/Wallabag/CoreBundle/Resources/public/themes/baggy/js/saveLink.js
+++ /dev/null
@@ -1,96 +0,0 @@
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 //---------------------------------------------------------------------------
40 // These two functions are now taken care of in popupForm.js
41 //---------------------------------------------------------------------------
42
43 // $bagit.click(function(){
44 // $bagit.toggleClass("current");
45 // $("#bagit-arrow").toggleClass("arrow-down");
46 // toggleSaveLinkForm();
47 // });
48
49 // $("#bagit-form-close").click(function(){
50 // $bagit.removeClass("current");
51 // $("#bagit-arrow").removeClass("arrow-down");
52 // toggleSaveLinkForm();
53 // });
54
55
56 //send "bag it link" form request via ajax
57 $bagitFormForm.submit( function(event) {
58 $("body").css("cursor", "wait");
59 $("#add-link-result").empty();
60
61 $.ajax({
62 type: $bagitFormForm.attr('method'),
63 url: $bagitFormForm.attr('action'),
64 data: $bagitFormForm.serialize(),
65 success: function(data) {
66 $('#add-link-result').html("Done!");
67 $('#plainurl').val('');
68 $('#plainurl').blur('');
69 $("body").css("cursor", "auto");
70 //setTimeout( function() { toggleSaveLinkForm(); }, 1000); //close form after 1000 delay
71 },
72 error: function(data) {
73 $('#add-link-result').html("Failed!");
74 $("body").css("cursor", "auto");
75 }
76 });
77
78 event.preventDefault();
79 });
80
81 /* ==========================================================================
82 Process all links inside an article
83 ========================================================================== */
84
85 $("article a[href^='http']").after(function() {
86 return " <a href=\"" + $(this).attr('href') + "\" class=\"add-to-wallabag-link-after\" alt=\"add to wallabag\" title=\"add to wallabag\"></a> ";
87 });
88
89 $(".add-to-wallabag-link-after").click(function(event){
90 toggleSaveLinkForm($(this).attr('href'), event);
91 event.preventDefault();
92 });
93
94});
95
96