From 6394cd8100927da255ff9d64cb4b53e4c5cbdad3 Mon Sep 17 00:00:00 2001 From: Shish Date: Wed, 15 Aug 2012 20:42:56 +0100 Subject: [PATCH] make shm-thumb use consistent across themes, with data-tags and data-post-id --- README.txt | 4 ++++ core/basethemelet.class.php | 6 +++--- ext/index/script.js | 8 +------- ext/mass_tagger/script.js | 32 ++++-------------------------- themes/danbooru/themelet.class.php | 4 +++- themes/futaba/themelet.class.php | 4 +++- themes/lite/themelet.class.php | 4 ++-- 7 files changed, 20 insertions(+), 42 deletions(-) diff --git a/README.txt b/README.txt index 30e22af2..f25c4e40 100644 --- a/README.txt +++ b/README.txt @@ -107,6 +107,10 @@ ui-* cookies are for the client-side scripts only; in some configurations shm-* CSS classes are for javascript to hook into; if you're customising themes, be careful with these, and avoid styling them +- shm-thumb = outermost element of a thumbnail + - data-tags + - data-post-id + http://shimmie.shishnet.org/doc/ Please tell me if those docs are lacking in any way, so that they can be diff --git a/core/basethemelet.class.php b/core/basethemelet.class.php index ef9b3a42..70e01ab1 100644 --- a/core/basethemelet.class.php +++ b/core/basethemelet.class.php @@ -54,9 +54,9 @@ class BaseThemelet { $tsize = get_thumbnail_size($image->width, $image->height); } - return ''. - ''.$h_tip.''. - ''. + return "". + "$h_tip". + "". "\n"; } diff --git a/ext/index/script.js b/ext/index/script.js index c220d53b..4a3663bf 100644 --- a/ext/index/script.js +++ b/ext/index/script.js @@ -1,16 +1,10 @@ $(function() { var blocked_tags = ($.cookie("ui-blocked-tags") || "").split(" "); - var themecheck = $(".thumb[data-tags]").parent().attr('class'); var needs_refresh = false; for(i=0; i'); img.attr( "src", image_link+'/ext/mass_tagger/toggle.gif' ); diff --git a/themes/danbooru/themelet.class.php b/themes/danbooru/themelet.class.php index 7880429f..6ef57ee8 100644 --- a/themes/danbooru/themelet.class.php +++ b/themes/danbooru/themelet.class.php @@ -5,6 +5,8 @@ class Themelet extends BaseThemelet { $h_view_link = make_link("post/view/{$image->id}", $query); $h_thumb_link = $image->get_thumb_link(); $h_tip = html_escape($image->get_tooltip()); + $i_id = int_escape($image->id); + $h_tags = strtolower($image->get_tag_list()); // If file is flash or svg then sets thumbnail to max size. if($image->ext == 'swf' || $image->ext == 'svg') { @@ -14,7 +16,7 @@ class Themelet extends BaseThemelet { $tsize = get_thumbnail_size($image->width, $image->height); } - return "$h_tip$h_tip"; } diff --git a/themes/futaba/themelet.class.php b/themes/futaba/themelet.class.php index 7d4955e6..cfff9d50 100644 --- a/themes/futaba/themelet.class.php +++ b/themes/futaba/themelet.class.php @@ -9,6 +9,8 @@ class Themelet extends BaseThemelet { $h_view_link = make_link("post/view/{$image->id}", $query); $h_thumb_link = $image->get_thumb_link(); $h_tip = html_escape($image->get_tooltip()); + $i_id = int_escape($image->id); + $h_tags = strtolower($image->get_tag_list()); // If file is flash or svg then sets thumbnail to max size. if($image->ext == 'swf' || $image->ext == 'svg') { @@ -18,7 +20,7 @@ class Themelet extends BaseThemelet { $tsize = get_thumbnail_size($image->width, $image->height); } - return "$h_tip$h_tip"; } diff --git a/themes/lite/themelet.class.php b/themes/lite/themelet.class.php index 3633860b..c61c9e4a 100644 --- a/themes/lite/themelet.class.php +++ b/themes/lite/themelet.class.php @@ -21,8 +21,8 @@ class Themelet extends BaseThemelet { $tsize = get_thumbnail_size($image->width, $image->height); } - return '