Skip to content
This repository was archived by the owner on Jun 7, 2023. It is now read-only.

Commit 3f8e627

Browse files
committed
move logging functions to RunestoneBase
1 parent f42abaf commit 3f8e627

File tree

1 file changed

+3
-15
lines changed

1 file changed

+3
-15
lines changed

runestone/common/js/bookfuncs.js

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -29,19 +29,6 @@
2929
// Logging functions
3030
//
3131

32-
function logBookEvent(eventInfo) {
33-
eventInfo.course = eBookConfig.course;
34-
if (eBookConfig.logLevel > 0) {
35-
jQuery.get(eBookConfig.ajaxURL + 'hsblog', eventInfo); // Log the run event
36-
}
37-
}
38-
39-
function logRunEvent(eventInfo) {
40-
eventInfo.course = eBookConfig.course;
41-
if (eBookConfig.logLevel > 0) {
42-
jQuery.post(eBookConfig.ajaxURL + 'runlog', eventInfo); // Log the run event
43-
}
44-
}
4532

4633

4734
//
@@ -75,6 +62,7 @@ function sendComment(comment, sid, acid, id) {
7562
// User login and page decoration functions
7663
//
7764

65+
var rb = new RunestoneBase();
7866

7967
function gotUser(data, status, whatever) {
8068
var mess = '';
@@ -112,7 +100,7 @@ function gotUser(data, status, whatever) {
112100
}
113101
}
114102
$(".loggedinuser").html(mess);
115-
logBookEvent({
103+
rb.logBookEvent({
116104
'event': 'page',
117105
'act': 'view',
118106
'div_id': window.location.pathname
@@ -185,7 +173,7 @@ function setupNavbarLoggedOut() {
185173
$('#passwordlink').hide();
186174
$('li.loginout').html('<a href="' + eBookConfig.app + '/default/user/login">Login</a>')
187175
$(".footer").html('user not logged in');
188-
logBookEvent({'event': 'page', 'act': 'view', 'div_id': window.location.pathname})
176+
rb.logBookEvent({'event': 'page', 'act': 'view', 'div_id': window.location.pathname})
189177
}
190178
$(document).bind("runestone:logout",setupNavbarLoggedOut);
191179

0 commit comments

Comments
 (0)