Commit ca2d5635 authored by ThorbenQuast's avatar ThorbenQuast
Browse files

[demo] some adjustments

parent 539e6f9a
......@@ -32,7 +32,7 @@ define(["vispa/extensions", "vispa/views/center", "jquery", "css!../css/style"],
value: "blue",
// optional
description: "The background color",
selection: ["blue", "yellow", "red"]
selection: ["#428bca", "#f0ad4e", "#d9534f", "#5cb85c"]
}
}, {
title: "Demo"
......@@ -46,7 +46,7 @@ define(["vispa/extensions", "vispa/views/center", "jquery", "css!../css/style"],
this.setDefaultShortcuts(DemoView, {
test: {
description: "some test shortcut",
value: "ctrl+s",
value: vispa.device.isMac ? "meta+s" : "ctrl+s",
callback: function() {
this.setModified(false);
this.alert("Instance " + this.getId() + " saved!");
......@@ -189,11 +189,7 @@ define(["vispa/extensions", "vispa/views/center", "jquery", "css!../css/style"],
this.node = node;
// set the icon
// this.static returns a path that is relative to the static
// vispa/extensions/<extensionName>/static
// there is also a method, this.dynamic, that returns paths relative to the
// extension folder itself, i.e., vispa/extensions/<extensionName>
this.setIcon(this.static("img/myicon.png"));
this.setIcon("fa fa-play-circle-o");
// show the loader overlay
......@@ -221,6 +217,9 @@ define(["vispa/extensions", "vispa/views/center", "jquery", "css!../css/style"],
// the keyword argument "files"
var content = $(tmpl).appendTo(node);
//Add a label to the view's tab
self.setLabel("Demo");
// set the background color which is already implemented in
// "applyPreferences"
self.applyPreferences();
......@@ -232,8 +231,10 @@ define(["vispa/extensions", "vispa/views/center", "jquery", "css!../css/style"],
// we can manually update the preferences and sync them with the server
// (and other instances of this view via "applyPreferences")
var rnd = parseInt(Math.random() * 3);
self.setPreference("backgroundColor", ["blue", "yellow", "red"][rnd]);
self.setPreference("backgroundColor", ["#428bca", "#f0ad4e", "#d9534f", "#5cb85c"][rnd]);
self.pushPreferences();
if (!self.isModified())
self.setModified(true);
});
//TODO: check if .getLogger is still an existing function
......@@ -257,7 +258,7 @@ define(["vispa/extensions", "vispa/views/center", "jquery", "css!../css/style"],
// in case there was a change to the content, we can mark the instance as
// modified via this.setModified(true|false)
self.setModified(true);
self.setModified(false);
});
},
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment