addthis: update script, hide when not enabled.
* Hide 'Share' section from sidebar when Addthis isn't enabled. * Don't show popup menu until click.
This commit is contained in:
@@ -71,6 +71,8 @@
|
|||||||
window._paq.push(["setCustomVariable", 3, "postUpdateCount", <%= CurrentUser.post_update_count.to_i / 100 %>, "visit"]);
|
window._paq.push(["setCustomVariable", 3, "postUpdateCount", <%= CurrentUser.post_update_count.to_i / 100 %>, "visit"]);
|
||||||
window._paq.push(["setCustomVariable", 4, "favoriteCount", <%= CurrentUser.favorite_count.to_i / 100 %>, "visit"]);
|
window._paq.push(["setCustomVariable", 4, "favoriteCount", <%= CurrentUser.favorite_count.to_i / 100 %>, "visit"]);
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
|
window.addthis_config = { ui_click: true };
|
||||||
</script>
|
</script>
|
||||||
<%= yield :html_header %>
|
<%= yield :html_header %>
|
||||||
<%= raw Danbooru.config.custom_html_header_content %>
|
<%= raw Danbooru.config.custom_html_header_content %>
|
||||||
|
|||||||
@@ -10,10 +10,12 @@
|
|||||||
<%= @post_set.presenter.tag_list_html(current_query: params[:tags], show_extra_links: CurrentUser.user.is_gold?) %>
|
<%= @post_set.presenter.tag_list_html(current_query: params[:tags], show_extra_links: CurrentUser.user.is_gold?) %>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
<section id="post-share">
|
<% if Danbooru.config.addthis_key.present? %>
|
||||||
<h1>Share</h1>
|
<section id="post-share">
|
||||||
<%= render "posts/partials/index/share" %>
|
<h1>Share</h1>
|
||||||
</section>
|
<%= render "posts/partials/index/share" %>
|
||||||
|
</section>
|
||||||
|
<% end %>
|
||||||
|
|
||||||
<%= render "posts/partials/index/options" %>
|
<%= render "posts/partials/index/options" %>
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
<% if Danbooru.config.addthis_key %>
|
<div class="addthis_toolbox addthis_default_style addthis_32x32_style"
|
||||||
|
addthis:title="Find more art about <%= @post_set.humanized_tag_string %> on <%= Danbooru.config.app_name %>">
|
||||||
<div class="addthis_toolbox addthis_default_style addthis_32x32_style">
|
|
||||||
<a class="addthis_button_twitter"></a>
|
<a class="addthis_button_twitter"></a>
|
||||||
<a class="addthis_button_facebook"></a>
|
<a class="addthis_button_facebook"></a>
|
||||||
<a class="addthis_button_reddit"></a>
|
<a class="addthis_button_reddit"></a>
|
||||||
@@ -8,24 +7,4 @@
|
|||||||
<a class="addthis_button_compact"></a>
|
<a class="addthis_button_compact"></a>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<script type="text/javascript">
|
<script type="text/javascript" src="//s7.addthis.com/js/300/addthis_widget.js#pubid=<%= Danbooru.config.addthis_key %>" async="async"></script>
|
||||||
window.addthis_config = {"data_track_addressbar": false, "pubid": "<%= Danbooru.config.addthis_key %>"};
|
|
||||||
<% if params[:tags].present? %>
|
|
||||||
window.addthis_share = {
|
|
||||||
"url":"<%= j posts_url(tags: params[:tags]) %>",
|
|
||||||
"title": "Find more art about <%= escape_javascript @post_set.humanized_tag_string %> on <%= Danbooru.config.app_name %>"
|
|
||||||
};
|
|
||||||
<% else %>
|
|
||||||
window.addthis_share = {
|
|
||||||
"url":"<%= j posts_url %>",
|
|
||||||
"title": "Find good anime art fast on <%= Danbooru.config.app_name %>"
|
|
||||||
};
|
|
||||||
<% end %>
|
|
||||||
$(function() {
|
|
||||||
addthis.init();
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<script type="text/javascript" src="https://s7.addthis.com/js/300/addthis_widget.js#async=1"></script>
|
|
||||||
|
|
||||||
<% end %>
|
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
<% if Danbooru.config.addthis_key %>
|
<div class="addthis_toolbox addthis_default_style addthis_32x32_style"
|
||||||
|
addthis:title="<%= post.presenter.humanized_essential_tag_string.html_safe %>">
|
||||||
<div class="addthis_toolbox addthis_default_style addthis_32x32_style">
|
|
||||||
<a class="addthis_button_twitter"></a>
|
<a class="addthis_button_twitter"></a>
|
||||||
<a class="addthis_button_facebook"></a>
|
<a class="addthis_button_facebook"></a>
|
||||||
<a class="addthis_button_reddit"></a>
|
<a class="addthis_button_reddit"></a>
|
||||||
@@ -8,17 +7,4 @@
|
|||||||
<a class="addthis_button_compact"></a>
|
<a class="addthis_button_compact"></a>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<script type="text/javascript">
|
<script type="text/javascript" src="//s7.addthis.com/js/300/addthis_widget.js#pubid=<%= Danbooru.config.addthis_key %>" async="async"></script>
|
||||||
window.addthis_config = {"data_track_addressbar": false, "pubid": "<%= Danbooru.config.addthis_key %>"};
|
|
||||||
window.addthis_share = {
|
|
||||||
"url":"<%= j post_url(post) %>",
|
|
||||||
"title": "<%= escape_javascript post.presenter.humanized_essential_tag_string.html_safe %> on <%= Danbooru.config.app_name %>"
|
|
||||||
};
|
|
||||||
$(function() {
|
|
||||||
addthis.init();
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<script type="text/javascript" src="https://s7.addthis.com/js/300/addthis_widget.js#async=1"></script>
|
|
||||||
|
|
||||||
<% end %>
|
|
||||||
|
|||||||
@@ -12,10 +12,12 @@
|
|||||||
<%= render "posts/partials/show/information", :post => @post %>
|
<%= render "posts/partials/show/information", :post => @post %>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
<section id="post-share">
|
<% if Danbooru.config.addthis_key.present? %>
|
||||||
<h1>Share</h1>
|
<section id="post-share">
|
||||||
<%= render "posts/partials/show/share", :post => @post %>
|
<h1>Share</h1>
|
||||||
</section>
|
<%= render "posts/partials/show/share", post: @post %>
|
||||||
|
</section>
|
||||||
|
<% end %>
|
||||||
|
|
||||||
<section id="post-options">
|
<section id="post-options">
|
||||||
<h1>Options</h1>
|
<h1>Options</h1>
|
||||||
|
|||||||
Reference in New Issue
Block a user