From 4806297fdead3a4c6e16234aa18722322127f9fa Mon Sep 17 00:00:00 2001 From: evazion Date: Thu, 15 Jun 2017 21:50:48 -0500 Subject: [PATCH 1/3] /static/bookmarklet: use HTTPS in bookmarklet if connected via HTTPS. --- app/views/static/bookmarklet.html.erb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/views/static/bookmarklet.html.erb b/app/views/static/bookmarklet.html.erb index bdd68178e..26755a4a8 100644 --- a/app/views/static/bookmarklet.html.erb +++ b/app/views/static/bookmarklet.html.erb @@ -2,13 +2,13 @@

Bookmarklet

-

<%= link_to "Post to #{Danbooru.config.app_name}", "javascript:location.href='http://#{Danbooru.config.hostname}/uploads/new?url='+encodeURIComponent(location.href)+'&ref='+encodeURIComponent(document.referrer)" %>

+

<%= link_to "Post to #{Danbooru.config.app_name}", "javascript:location.href='#{request.protocol + request.host_with_port}/uploads/new?url='+encodeURIComponent(location.href)+'&ref='+encodeURIComponent(document.referrer)" %>

Bookmark this link. Next time you are directly viewing an image (that is, the JPG/PNG/GIF file is in the URL bar) you can open this bookmarklet and you will be taken to the upload page. Depending on the site you are uploading from you may also see some options for fetching metadata.

The bookmarklet can also intelligently fetch artist/tag data from specific sites like Pixiv, Nico Seiga, Twitter, DeviantArt, and others. If you wish to preserve an HTML link for the source, you can use the bookmarklet on the HTML page containing the image. The bookmarklet will find the image URL and automatically download the largest version.

-

<%= link_to "Batch to #{Danbooru.config.app_name}", "javascript:location.href='http://#{Danbooru.config.hostname}/uploads/batch?url='+encodeURIComponent(location.href)" %>

+

<%= link_to "Batch to #{Danbooru.config.app_name}", "javascript:location.href='#{request.protocol + request.host_with_port}/uploads/batch?url='+encodeURIComponent(location.href)" %>

Use this bookmarklet for Twitter and Pixiv galleries. Use it on the HTML page.

From b80111ea058652f06a4f94c0a77cd78bab0e3cd1 Mon Sep 17 00:00:00 2001 From: evazion Date: Thu, 15 Jun 2017 22:00:15 -0500 Subject: [PATCH 2/3] /static/bookmarklet: fix typo in page id. --- app/views/static/bookmarklet.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/static/bookmarklet.html.erb b/app/views/static/bookmarklet.html.erb index 26755a4a8..2b2d57500 100644 --- a/app/views/static/bookmarklet.html.erb +++ b/app/views/static/bookmarklet.html.erb @@ -1,5 +1,5 @@
-
+

Bookmarklet

<%= link_to "Post to #{Danbooru.config.app_name}", "javascript:location.href='#{request.protocol + request.host_with_port}/uploads/new?url='+encodeURIComponent(location.href)+'&ref='+encodeURIComponent(document.referrer)" %>

From aef7fcd34cacaf91b532a7e0b32c5d3cef5e1f56 Mon Sep 17 00:00:00 2001 From: evazion Date: Thu, 15 Jun 2017 22:26:04 -0500 Subject: [PATCH 3/3] /static/bookmarklet: update bookmarklet description. Better explain what the bookmarklet does, why it should be used, and how to install it. --- app/views/static/bookmarklet.html.erb | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/app/views/static/bookmarklet.html.erb b/app/views/static/bookmarklet.html.erb index 2b2d57500..7c22609ce 100644 --- a/app/views/static/bookmarklet.html.erb +++ b/app/views/static/bookmarklet.html.erb @@ -4,13 +4,24 @@

<%= link_to "Post to #{Danbooru.config.app_name}", "javascript:location.href='#{request.protocol + request.host_with_port}/uploads/new?url='+encodeURIComponent(location.href)+'&ref='+encodeURIComponent(document.referrer)" %>

-

Bookmark this link. Next time you are directly viewing an image (that is, the JPG/PNG/GIF file is in the URL bar) you can open this bookmarklet and you will be taken to the upload page. Depending on the site you are uploading from you may also see some options for fetching metadata.

+

Bookmark this link by dragging it to your browser's bookmarks toolbar. + Next time you are directly viewing an image (that is, the JPG/PNG/GIF file + is in the URL bar) use this bookmarklet to be taken to the upload page.

+ +

The upload page will contain an image preview, along with the artist, + translated tags, and commentary, and it will also run a dupe check + automatically.

-

The bookmarklet can also intelligently fetch artist/tag data from specific sites like Pixiv, Nico Seiga, Twitter, DeviantArt, and others. If you wish to preserve an HTML link for the source, you can use the bookmarklet on the HTML page containing the image. The bookmarklet will find the image URL and automatically download the largest version.

+

The bookmarklet also works on the HTML page for most sites, including Pixiv, + Nico Seiga, Twitter, DeviantArt, and others. Use the bookmarklet on the + HTML page to have it automatically find and upload the best available image + for you.

<%= link_to "Batch to #{Danbooru.config.app_name}", "javascript:location.href='#{request.protocol + request.host_with_port}/uploads/batch?url='+encodeURIComponent(location.href)" %>

-

Use this bookmarklet for Twitter and Pixiv galleries. Use it on the HTML page.

+

Use this bookmarklet on the HTML page of Twitter, Pixiv, or ArtStation + galleries. It will open a page containing every image in the gallery, ready + for upload.