Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Small feature for uploading using a bookmark.

  • Loading branch information...
commit f93b86261eac078599d7773ea913f388d80f9d26 1 parent db59cb1
@jgen jgen authored
Showing with 5 additions and 4 deletions.
  1. +5 −4 ext/upload/theme.php
View
9 ext/upload/theme.php
@@ -63,7 +63,8 @@ public function display_page(Page $page) {
if($tl_enabled) {
$link = make_http(make_link("upload"));
- $title = "Upload to " . $config->get_string('title');
+ $home = make_http(make_link());
+ $title = $config->get_string('title');
if($config->get_bool('nice_urls')){
$delimiter = '?';
@@ -71,9 +72,9 @@ public function display_page(Page $page) {
$delimiter = '&';
}
- $html .= '<p><a href="javascript:location.href=&quot;' .
- $link . $delimiter . 'url=&quot;+location.href+&quot;&amp;tags=&quot;+prompt(&quot;enter tags&quot;)">' .
- $title . '</a> (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="'. $home .'";}else if(typeof document=="undefined"||!document.body){window.location="'. $home .'?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 .= '<p><a href=\''.$js.'\'>Upload to '.$title.'</a> (Drag & drop onto your bookmarks toolbar, then click when looking at an image)';
}
$page->set_title("Upload");
Please sign in to comment.
Something went wrong with that request. Please try again.