Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion examples/gsheets/data-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ var data_config = {

content_based: true,
is_evaluation: true,
evaluation_service: ["matomo"],

is_force_areas: true,
area_force_alpha: 0.03,
Expand Down
1 change: 0 additions & 1 deletion examples/project_website/data-config_base.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ var data_config = {
show_keywords: true,

is_evaluation: true,
evaluation_service: ["matomo"],

use_hypothesis: true,

Expand Down
1 change: 0 additions & 1 deletion examples/project_website/data-config_pubmed.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ var data_config = {
show_keywords: true,

is_evaluation: true,
evaluation_service: ["matomo"],

use_hypothesis: true,

Expand Down
1 change: 0 additions & 1 deletion examples/viper/js/data-config_openaire.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@ var data_config = {
},

is_evaluation: true,
evaluation_service: ["ga", "matomo"],

use_hypothesis: true,

Expand Down
2 changes: 0 additions & 2 deletions vis/js/default-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,6 @@ var config = {
show_loading_screen: false,
//evaluation mode/events logging
is_evaluation: false,
//which evaluation service to use. can also be an array. currently possible: "log", "matomo" and "ga"
evaluation_service: "log",
//enable logging of mouseover events (use only temporarily as it creates A LOT of logging events)
enable_mouseover_evaluation: false,
//whether to embed the okmaps credit
Expand Down
62 changes: 0 additions & 62 deletions vis/js/headstart.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,68 +32,6 @@ HeadstartFSM.prototype = {
}
},

// TODO delete this completely
recordAction: function(id, category, action, user, timestamp, additional_params, post_data) {

if(!config.is_evaluation) {
return;
}

let services = config.evaluation_service;

if(typeof services === "string") {
services = [services];
}

if (services.includes("log")) {
this.recordActionLog(category, action, id, user, timestamp, additional_params, post_data);
}
if (services.includes("ga")) {
this.recordActionGA(category, action, id, user, timestamp, additional_params, post_data);
}
},

recordActionLog: function(id, category, action, user, type, timestamp, additional_params, post_data) {
timestamp = (typeof timestamp !== 'undefined') ? (escape(timestamp)) : ("");
additional_params = (typeof additional_params !== 'undefined') ? ('&' + additional_params) : ("");
if(typeof post_data !== 'undefined') {
post_data = {post_data:post_data};
} else {
post_data = {};
}

let php_script = config.server_url + "services/writeActionToLog.php";

$.ajax({
url: php_script +
'?user=' + user +
'&category=' + category +
'&action=' + action +
'&item=' + encodeURI(id) +
'&type=' + type +
'&item_timestamp=' + timestamp + additional_params + '&jsoncallback=?',
type: "POST",
data: post_data,
dataType: "json",
success: function(output) {
console.log(output);
}
});
},

recordActionGA: function(category, action, id) {
//gtag.js
if(typeof gtag === "function") {
gtag('event', action, {
'event_category': category,
'event_label': id
});
//analytics.js
} else if (typeof ga === "function") {
ga('send', 'event', category, action, id);
}
},

markProjectChanged: function (id) {

let php_script = config.server_url + "services/markProjectChanged.php";
Expand Down
9 changes: 1 addition & 8 deletions vis/js/mediator.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ var MyMediator = function() {
this.fileData = [];
this.mediator = new Mediator();
this.manager = new ModuleManager();
this.intermediate_layer = new Intermediate(this.rescale_map, this.record_action);
this.intermediate_layer = new Intermediate(this.rescale_map);
this.init();
this.init_state();
};
Expand All @@ -55,9 +55,6 @@ MyMediator.prototype = {

// bubbles events
this.mediator.subscribe("bubbles_update_data_and_areas", this.bubbles_update_data_and_areas);

// misc
this.mediator.subscribe("record_action", this.record_action);
},

init_state: function() {
Expand Down Expand Up @@ -151,10 +148,6 @@ MyMediator.prototype = {
mediator.render_frontend();
},

record_action: function(id, category, action, user, type, timestamp, additional_params, post_data) {
window.headstartInstance.recordAction(id, category, action, user, type, timestamp, additional_params, post_data);
},

dimensions_update: function() {
mediator.intermediate_layer.updateDimensions(config, io.context);
},
Expand Down