diff options
| author | 2013-03-11 20:26:22 +0100 | |
|---|---|---|
| committer | 2013-03-11 20:26:22 +0100 | |
| commit | e405af1049a6abbee717db0d4e289f4cd4862b67 (patch) | |
| tree | 6f2551ca2ea2f95bd31fd045a86e85caa79a7898 /public/scripts | |
| parent | 53aef139b8c61f41fede93b3f58659820b10ccf4 (diff) | |
Màj design + suppression endless_mode + suppression read_mode (reviendra sous une autre forme ?)
Diffstat (limited to 'public/scripts')
| -rw-r--r-- | public/scripts/endless_mode.js | 41 | ||||
| -rw-r--r-- | public/scripts/read_mode.js | 85 |
2 files changed, 0 insertions, 126 deletions
diff --git a/public/scripts/endless_mode.js b/public/scripts/endless_mode.js deleted file mode 100644 index 7a9840cd4..000000000 --- a/public/scripts/endless_mode.js +++ /dev/null @@ -1,41 +0,0 @@ -var url_next_page = ""; -var load = false; - -function load_more_refresh () { - if (url_next_page === undefined) { - $("#load_more").html ("Il n'y a rien à charger"); - $("#load_more").addClass ("disable"); - } else { - $("#load_more").html ("Charger plus d'articles"); - } -} - -function load_more_posts (f_callback) { - load = true; - $.get (url_next_page, function (data) { - $("#load_more").before ($("#stream .post", data)); - - url_next_page = $(".pagination:last li.pager-next a", data).attr ("href"); - - init_posts (); - load_more_refresh (); - if (typeof f_callback == 'function') { - f_callback.call (this); - } - load = false; - }); -} - -$(document).ready (function () { - url_next_page = $(".pagination:last li.pager-next a").attr ("href"); - $(".pagination:last").remove (); - - $("#stream").append ("<a id=\"load_more\" href=\"#\"></a>"); - load_more_refresh (); - - $("#load_more").click (function () { - load_more_posts (); - - return false; - }); -}); diff --git a/public/scripts/read_mode.js b/public/scripts/read_mode.js deleted file mode 100644 index 13b3ecf5a..000000000 --- a/public/scripts/read_mode.js +++ /dev/null @@ -1,85 +0,0 @@ -var read_mode_on = false; -var scroll_auto = false; - -function read_mode () { - read_mode_on = true; - - // global - $('#global').css({ - 'background': '#ddd' - }); - $('#main_aside').animate ({width: 0}, 500, function () { - $('#main_aside').hide (); - }); - $('#top').animate ({height: 0}, 500, function () { - $('#top').hide (); - }); - $('#main').animate({ - 'width': 800, - 'padding-left': ($(window).width() - 800) / 2, - }); - $('#main').css({ - 'background': '#ddd' - }); - $('#stream').addClass ('read_mode'); - $('ul.pagination').fadeOut (500); - - // posts - $('.post.flux .content').slideDown (500); - - // mode endless auto - scroll_auto = true; - $(window).scroll (function () { - offset = $('#load_more').offset (); - - if (offset.top - $(window).height () <= $(window).scrollTop () - && !load - && url_next_page !== undefined - && scroll_auto) { - load_more_posts (); - } - }); -} -function un_read_mode () { - read_mode_on = false; - - // global - $('#global').css({ - 'background': '#fafafa' - }); - $('#main_aside').show (); - $('#main_aside').animate ({width: 250}); - $('#top').show (); - $('#top').animate ({height: 50}); - $('#main').animate({ - 'width': '100%', - 'padding-left': 250, - }); - $('#main').css({ - 'background': '#fafafa' - }); - $('#stream').removeClass ('read_mode'); - $('ul.pagination').fadeIn (500); - - // posts - if (hide_posts) { - $('.post.flux .content').slideUp (500); - } - - // mode endless auto desactivé - scroll_auto = false; -} - -$(document).ready (function () { - $('#global').append ('<a id="read_mode" href="#"> </a>'); - - $('a#read_mode').click (function () { - if (read_mode_on) { - un_read_mode (); - } else { - read_mode (); - } - - return false; - }); -}); |
