tracking: tracking.js -> usage.js
To work around some ad blockers that might block this otherwise - which
is kinda funny since the js file doesn't do any tracking, it just
makes the setup wizard for the opt-in functional 🤦♀️
This commit is contained in:
1 parent
0a3ad8a880
commit
edd4d90b12
3 files changed
+7
-7
No files matched your search
@@ -136,7 +136,7 @@ class TrackingPlugin(octoprint.plugin.SettingsPlugin,
|
||||
##~~ AssetPlugin
|
||||
|
||||
def get_assets(self):
|
||||
return dict(js=["js/tracking.js"])
|
||||
return dict(js=["js/usage.js"])
|
||||
|
||||
##~~ WizardPlugin
|
||||
|
||||
|
||||
+4
-4
@@ -1,5 +1,5 @@
|
||||
$(function() {
|
||||
function TrackingViewModel(parameters) {
|
||||
function UsageViewModel(parameters) {
|
||||
var self = this;
|
||||
|
||||
self.settingsViewModel = parameters[0];
|
||||
@@ -10,13 +10,13 @@ $(function() {
|
||||
self.required = false;
|
||||
self.active = false;
|
||||
|
||||
self.enableTracking = function() {
|
||||
self.enableUsage = function() {
|
||||
self.settingsViewModel.settings.plugins.tracking.enabled(true);
|
||||
self.decision(true);
|
||||
self._sendData();
|
||||
};
|
||||
|
||||
self.disableTracking = function() {
|
||||
self.disableUsage = function() {
|
||||
self.settingsViewModel.settings.plugins.tracking.enabled(false);
|
||||
self.decision(false);
|
||||
self._sendData();
|
||||
@@ -78,7 +78,7 @@ $(function() {
|
||||
}
|
||||
|
||||
OCTOPRINT_VIEWMODELS.push([
|
||||
TrackingViewModel,
|
||||
UsageViewModel,
|
||||
["settingsViewModel"],
|
||||
"#wizard_plugin_tracking"
|
||||
]);
|
||||
@@ -9,8 +9,8 @@
|
||||
</p>
|
||||
|
||||
<div class="row-fluid">
|
||||
<a href="javascript:void(0)" class="btn span6" data-bind="click: function() { if(!setup()){disableTracking()}}, enable: !setup(), css: {disabled: setup()}">{{ _('Disable Anonymous Usage Tracking') }}</a>
|
||||
<a href="javascript:void(0)" class="btn btn-primary span6" data-bind="click: function() { if(!setup()){enableTracking()}}, enable: !setup(), css: {disabled: setup()}">{{ _('Enable Anonymous Usage Tracking') }}</a>
|
||||
<a href="javascript:void(0)" class="btn span6" data-bind="click: function() { if(!setup()){disableUsage()}}, enable: !setup(), css: {disabled: setup()}">{{ _('Disable Anonymous Usage Tracking') }}</a>
|
||||
<a href="javascript:void(0)" class="btn btn-primary span6" data-bind="click: function() { if(!setup()){enableUsage()}}, enable: !setup(), css: {disabled: setup()}">{{ _('Enable Anonymous Usage Tracking') }}</a>
|
||||
</div>
|
||||
|
||||
<div class="tracking_decision" style="display: none" data-bind="visible: setup()">
|
||||
|
||||
Reference in new issue
Block a user