add events for posts pages
This commit is contained in:
@@ -78,4 +78,12 @@
|
|||||||
<% end %>
|
<% end %>
|
||||||
<%= missed_post_search_count_js %>
|
<%= missed_post_search_count_js %>
|
||||||
<%= render "posts/partials/index/seo_meta_tags" %>
|
<%= render "posts/partials/index/seo_meta_tags" %>
|
||||||
|
<script>
|
||||||
|
$(function() {
|
||||||
|
window.Danbooru.mixpanelEvent("Post Search", {
|
||||||
|
"tags": <%= params[:tags].to_json %>,
|
||||||
|
"page": <%= params[:page].to_json %>
|
||||||
|
});
|
||||||
|
});
|
||||||
|
</script>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|||||||
@@ -13,19 +13,3 @@
|
|||||||
<%= hidden_field_tag "ms", "1" %>
|
<%= hidden_field_tag "ms", "1" %>
|
||||||
<% end %>
|
<% end %>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
<% content_for(:html_header) do %>
|
|
||||||
<script>
|
|
||||||
/*$(function() {
|
|
||||||
$("#tags").on("keypress autocompleteclose", function(e) {
|
|
||||||
if (!$(this).data("fakeWidth")) {
|
|
||||||
$(this).data("fakeWidth", $('<span>').hide().appendTo(document.body));
|
|
||||||
}
|
|
||||||
var width = $(this).data("fakeWidth").text($(this).val()).css('font', $(this).css("font")).width() + 15;
|
|
||||||
if (width > $(this).width()) {
|
|
||||||
$(this).width(width);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
});*/
|
|
||||||
</script>
|
|
||||||
<% end %>
|
|
||||||
|
|||||||
@@ -192,6 +192,19 @@
|
|||||||
<%= tag.meta name: "og:site", content: Danbooru.config.app_name %>
|
<%= tag.meta name: "og:site", content: Danbooru.config.app_name %>
|
||||||
|
|
||||||
<%= auto_discovery_link_tag(:atom, comments_url(:atom, search: { post_id: @post.id }), title: "Comments for post ##{@post.id}") %>
|
<%= auto_discovery_link_tag(:atom, comments_url(:atom, search: { post_id: @post.id }), title: "Comments for post ##{@post.id}") %>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
$(function() {
|
||||||
|
window.Danbooru.mixpanelEvent("Post View", {
|
||||||
|
"id": <%= @post.id %>,
|
||||||
|
"rating": '<%= @post.rating %>',
|
||||||
|
"size": <%= @post.file_size %>,
|
||||||
|
"fav_count": <%= @post.fav_count %>,
|
||||||
|
"created_at": <%= @post.created_at.strftime('%F %T').to_json %>,
|
||||||
|
"tags": <%= @post.presenter.humanized_essential_tag_string.to_json %>
|
||||||
|
});
|
||||||
|
});
|
||||||
|
</script>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
<%= render "posts/partials/common/secondary_links" %>
|
<%= render "posts/partials/common/secondary_links" %>
|
||||||
|
|||||||
@@ -6,12 +6,10 @@
|
|||||||
<% content_for(:html_header) do %>
|
<% content_for(:html_header) do %>
|
||||||
<script>
|
<script>
|
||||||
$(function() {
|
$(function() {
|
||||||
$("#sign-up-link").click(function() {
|
if (typeof window.mixpanel === 'object') {
|
||||||
window.Danbooru.mixpanelEvent("clicked sign up");
|
window.mixpanel.track_links('#sign-up-link', 'clicked sign up');
|
||||||
});
|
window.mixpanel.track_links('#hide-sign-up-notice', 'hide sign up notice');
|
||||||
$("#hide-sign-up-notice").click(function() {
|
}
|
||||||
window.Danbooru.mixpanelEvent("hide sign up notice");
|
});
|
||||||
});
|
|
||||||
})
|
|
||||||
</script>
|
</script>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|||||||
@@ -6,12 +6,10 @@
|
|||||||
<% content_for(:html_header) do %>
|
<% content_for(:html_header) do %>
|
||||||
<script>
|
<script>
|
||||||
$(function() {
|
$(function() {
|
||||||
$("#goto-upgrade-account").click(function() {
|
if (typeof window.mixpanel === 'object') {
|
||||||
window.Danbooru.mixpanelEvent("clicked upgrade notice");
|
window.mixpanel.track_links('#goto-upgrade-account', 'clicked upgrade notice');
|
||||||
});
|
window.mixpanel.track_links('#hide-upgrade-account-notice', 'hide upgrade notice');
|
||||||
$("#hide-upgrade-account-notice").click(function() {
|
}
|
||||||
window.Danbooru.mixpanelEvent("hide upgrade notice");
|
});
|
||||||
});
|
|
||||||
})
|
|
||||||
</script>
|
</script>
|
||||||
<% end %>
|
<% end %>
|
||||||
Reference in New Issue
Block a user