aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/Wallabag/CoreBundle/Resources/public/themes/baggy/js
diff options
context:
space:
mode:
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