From dcf96456f1bbf15a982717baf088f4a6309fb8ab Mon Sep 17 00:00:00 2001 From: "green-ponies (jgen)" Date: Sun, 8 Jan 2012 16:50:35 -0500 Subject: [PATCH] Fixed issue with Cancelling Transloads. Also added some features to the Bookmarklet. --- ext/upload/theme.php | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/ext/upload/theme.php b/ext/upload/theme.php index fae6501f..4d701eea 100644 --- a/ext/upload/theme.php +++ b/ext/upload/theme.php @@ -98,17 +98,18 @@ class UploadTheme extends Themelet { "; if($tl_enabled) { - $link = make_http(make_link("upload")); + $link = make_http(make_link("upload")); + $main_page = make_http(make_link()); + $title = $config->get_string('title'); + if($config->get_bool('nice_urls')){ $delimiter = '?'; } else { $delimiter = '&'; } - { - $title = "Upload to " . $config->get_string('title'); - $html .= '

' . - $title . ' (Drag & drop onto your bookmarks toolbar, then click when looking at an image)'; + { + $js='javascript:(function(){if(typeof window=="undefined"||!window.location||window.location.href=="about:blank"){window.location="'. $main_page .'";}else if(typeof document=="undefined"||!document.body){window.location="'. $main_page .'?url="+encodeURIComponent(window.location.href);} else if(window.location.href.match("\/\/'. $_SERVER["HTTP_HOST"] .'.*")){alert("You are already at '. $title .'!");} else{var tags=prompt("Please enter tags","tagme");if(tags!=""&&tags!=null){var link="'. $link . $delimiter .'url="+location.href+"&tags="+tags;var w=window.open(link,"_blank");}}})();'; + $html .= '

Upload to '.$title.' (Drag & drop onto your bookmarks toolbar, then click when looking at an image)'; } { /* Danbooru > Shimmie Bookmarklet.