fnp
/
wolnelektury.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
190a12c
)
Track HTML events.
author
Radek Czajka
<rczajka@rczajka.pl>
Tue, 13 Sep 2022 07:38:02 +0000
(09:38 +0200)
committer
Radek Czajka
<rczajka@rczajka.pl>
Tue, 13 Sep 2022 07:38:02 +0000
(09:38 +0200)
src/wolnelektury/static/js/book_text/menu.js
patch
|
blob
|
history
src/wolnelektury/static/js/book_text/references.js
patch
|
blob
|
history
src/wolnelektury/static/js/book_text/settings.js
patch
|
blob
|
history
diff --git
a/src/wolnelektury/static/js/book_text/menu.js
b/src/wolnelektury/static/js/book_text/menu.js
index
5bbc1a8
..
eff64a0
100644
(file)
--- a/
src/wolnelektury/static/js/book_text/menu.js
+++ b/
src/wolnelektury/static/js/book_text/menu.js
@@
-30,6
+30,7
@@
$('#menu-toggle-on').click(function(e) {
if (!$("#menu").is(":visible")) {
body.addClass("menu-showed");
}
if (!$("#menu").is(":visible")) {
body.addClass("menu-showed");
}
+ _paq.push(['trackEvent', 'html', 'menu-on']);
});
/* Hide menu */
});
/* Hide menu */
@@
-42,6
+43,7
@@
$('#menu-toggle-off').click(function(e) {
if ($("#menu").is(":visible")) {
$("body").addClass("menu-hidden");
}
if ($("#menu").is(":visible")) {
$("body").addClass("menu-hidden");
}
+ _paq.push(['trackEvent', 'html', 'menu-off']);
});
});
@@
-53,7
+55,7
@@
$("#box-underlay").click(release_menu);
$("#menu a").each(function() {
var boxid = $(this).attr("data-box");
if (boxid) {
$("#menu a").each(function() {
var boxid = $(this).attr("data-box");
if (boxid) {
- $("#" +
$(this).attr("data-box")
).hide();
+ $("#" +
boxid
).hide();
$(this).click(function(e) {
e.preventDefault();
$(this).click(function(e) {
e.preventDefault();
@@
-63,9
+65,10
@@
$("#menu a").each(function() {
$("body").addClass("menu-showed");
$(this).addClass("active");
$("#box-underlay").show();
$("body").addClass("menu-showed");
$(this).addClass("active");
$("#box-underlay").show();
- $("#" +
$(this).attr("data-box")
).show();
+ $("#" +
boxid
).show();
}
});
}
});
+ _paq.push(['trackEvent', 'html', boxid]);
}
else if ($(this).hasClass('dropdown')) {
$(this).click(function(e) {
}
else if ($(this).hasClass('dropdown')) {
$(this).click(function(e) {
@@
-107,6
+110,7
@@
$(".display-other").click(function(e) {
loaded_text($("#other-text-body"));
}
});
loaded_text($("#other-text-body"));
}
});
+ _paq.push(['trackEvent', 'html', 'other-text']);
});
});
@@
-117,11
+121,15
@@
$(".other-text-close").click(function(e) {
$("#other-text").hide();
$("body").removeClass('with-other-text');
$("#other-text-body").html("");
$("#other-text").hide();
$("body").removeClass('with-other-text');
$("#other-text-body").html("");
+ _paq.push(['trackEvent', 'html', 'other-text-close']);
});
/* Release menu after clicking inside TOC. */
});
/* Release menu after clicking inside TOC. */
-$("#toc a").click(release_menu);
+ $("#toc a").click(function(){
+ release_menu();
+ _paq.push(['trackEvent', 'html', 'toc-item']);
+ });
if ($('#nota_red').length > 0) {
if ($('#nota_red').length > 0) {
diff --git
a/src/wolnelektury/static/js/book_text/references.js
b/src/wolnelektury/static/js/book_text/references.js
index
b9fc40f
..
795c737
100644
(file)
--- a/
src/wolnelektury/static/js/book_text/references.js
+++ b/
src/wolnelektury/static/js/book_text/references.js
@@
-97,5
+97,7
@@
$("#reference-link").text(ref.label);
$("#reference-link").attr('href', ref.wikipedia_link);
$("#reference-link").text(ref.label);
$("#reference-link").attr('href', ref.wikipedia_link);
+
+ _paq.push(['trackEvent', 'html', 'reference']);
});
})})(jQuery);
});
})})(jQuery);
diff --git
a/src/wolnelektury/static/js/book_text/settings.js
b/src/wolnelektury/static/js/book_text/settings.js
index
e398ba3
..
96fb6c4
100644
(file)
--- a/
src/wolnelektury/static/js/book_text/settings.js
+++ b/
src/wolnelektury/static/js/book_text/settings.js
@@
-6,6
+6,7
@@
$("#menu-settings").show();
$(".settings-switch").click(function(e) {
e.preventDefault();
$("body").toggleClass($(this).attr("data-setting"));
$(".settings-switch").click(function(e) {
e.preventDefault();
$("body").toggleClass($(this).attr("data-setting"));
+ _paq.push(['trackEvent', 'html', $(this).attr("data-setting")]);
});
});