From 88e1108f117581de492106db371185d9f8064e5a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20L=C5=93uillet?= Date: Fri, 20 Sep 2013 14:30:07 +0200 Subject: upgrading themes --- themes | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'themes/default/js') diff --git a/themes b/themes index 689dcedf..c6406013 160000 --- a/themes +++ b/themes @@ -1 +1 @@ -Subproject commit 689dcedf8d6c7cf5e8424654fef4fd9687288dc1 +Subproject commit c6406013d58dc3808b2544356b28a4816ae9747a -- cgit v1.2.3 From dfbbc14b335925072f71fdd7ec630e0244fc3ad7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20L=C5=93uillet?= Date: Thu, 3 Oct 2013 14:05:50 +0200 Subject: remove themes --- themes | 1 - 1 file changed, 1 deletion(-) delete mode 160000 themes (limited to 'themes/default/js') diff --git a/themes b/themes deleted file mode 160000 index c6406013..00000000 --- a/themes +++ /dev/null @@ -1 +0,0 @@ -Subproject commit c6406013d58dc3808b2544356b28a4816ae9747a -- cgit v1.2.3 From eb44ca42139c6d68698a6c87eddaa818e5079853 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20L=C5=93uillet?= Date: Thu, 3 Oct 2013 14:06:20 +0200 Subject: embed themes with poche --- themes | 1 + 1 file changed, 1 insertion(+) create mode 160000 themes (limited to 'themes/default/js') diff --git a/themes b/themes new file mode 160000 index 00000000..e8f5283a --- /dev/null +++ b/themes @@ -0,0 +1 @@ +Subproject commit e8f5283a723b09164f24aa494baa965566328cc0 -- cgit v1.2.3 From 66e074b43dd4efc9f63c8fee784b99bcce51ab93 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20L=C5=93uillet?= Date: Thu, 3 Oct 2013 14:09:58 +0200 Subject: remove themes --- themes | 1 - 1 file changed, 1 deletion(-) delete mode 160000 themes (limited to 'themes/default/js') diff --git a/themes b/themes deleted file mode 160000 index e8f5283a..00000000 --- a/themes +++ /dev/null @@ -1 +0,0 @@ -Subproject commit e8f5283a723b09164f24aa494baa965566328cc0 -- cgit v1.2.3 From 4cc3c2ac1735196e4e6a18d1a1124cd0d9a0ed5c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20L=C5=93uillet?= Date: Thu, 3 Oct 2013 14:10:44 +0200 Subject: embed themes --- themes/default/js/restoreScroll.js | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 themes/default/js/restoreScroll.js (limited to 'themes/default/js') diff --git a/themes/default/js/restoreScroll.js b/themes/default/js/restoreScroll.js new file mode 100644 index 00000000..331c9e19 --- /dev/null +++ b/themes/default/js/restoreScroll.js @@ -0,0 +1,25 @@ +function supportsLocalStorage() { + try { + return 'localStorage' in window && window['localStorage'] !== null; + } catch (e) { + return false; + } +} + +function savePercent(id, percent) { + if (!supportsLocalStorage()) { return false; } + localStorage["poche.article." + id + ".percent"] = percent; + return true; +} + +function retrievePercent(id) { + if (!supportsLocalStorage()) { return false; } + + var bheight = $(document).height(); + var percent = localStorage["poche.article." + id + ".percent"]; + var scroll = bheight * percent; + + $('html,body').animate({scrollTop: scroll}, 'fast'); + + return true; +} \ No newline at end of file -- cgit v1.2.3