From 8c562972062fbf3d750bd62893de248022850c23 Mon Sep 17 00:00:00 2001 From: Marien Fressinaud Date: Tue, 12 Mar 2013 19:59:33 +0100 Subject: thème spécifique pour les grandes images MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/javascript/main.phtml | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) (limited to 'app/views/javascript/main.phtml') diff --git a/app/views/javascript/main.phtml b/app/views/javascript/main.phtml index 7ea16737b..d8e15bca7 100644 --- a/app/views/javascript/main.phtml +++ b/app/views/javascript/main.phtml @@ -103,11 +103,21 @@ function mark_favorite (active) { }); } +function init_img () { + var imgs = $(".post.flux .content img").each (function () { + if ($(this).width () > ($("#stream").width()) / 2) { + $(this).addClass("big"); + } + }); +} + function init_posts () { + init_img (); + if (hide_posts) { $(".post.flux:not(.active) .content").slideUp (); } - + $(".post.flux").click (function () { old_active = $(".post.flux.active"); new_active = $(this); @@ -116,21 +126,21 @@ function init_posts () { slide (new_active, old_active); } }); - - + $(".post.flux a.read").click (function () { active = $(this).parents (".post.flux"); mark_read (active); return false; }); + $(".post.flux a.bookmark").click (function () { active = $(this).parents (".post.flux"); mark_favorite (active); return false; }); - + $(".post.flux .content a").click (function () { $(this).attr ('target', '_blank'); }); -- cgit v1.2.3