(function(){
// ##########
window.Switch = {
// ----------
get name() {
var chunks = window.location.toString().split('/');
var myName = chunks[chunks.length - 2];
return myName;
},
// ----------
insert: function(selector, style) {
var myName = this.name;
var html = '
Candy: ';
$(selector).prepend(html);
$('#visualization-select').change(function () {
var name = $(this).val();
if(name)
location.href = '../' + name + '/index.html';
else
location.href = '../../index.html';
});
});
}
};
})();