Commit d2d4ed23 authored by Steffen Vogel's avatar Steffen Vogel 🎅🏼
Browse files

fix some jekyll build errors

parent c3ae5d15
Pipeline #14996 passed with stages
in 24 seconds
;(function(e,t,n){function i(n,s){if(!t[n]){if(!e[n]){var o=typeof require=="function"&&require;if(!s&&o)return o(n,!0);if(r)return r(n,!0);throw new Error("Cannot find module '"+n+"'")}var u=t[n]={exports:{}};e[n][0].call(u.exports,function(t){var r=e[n][1][t];return i(r?r:t)},u,u.exports)}return t[n].exports}var r=typeof require=="function"&&require;for(var s=0;s<n.length;s++)i(n[s]);return i})({1:[function(require,module,exports){
var DataProjector, Info, Menu, Observer, Palette, Projector, Storage, Subject, Toolbar, Utility, dataProjector,
__hasProp = {}.hasOwnProperty,
__extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };
Subject = require('./Subject.coffee');
Observer = require('./Observer.coffee');
Utility = require('./Utility.coffee');
Palette = require('./Palette.coffee');
Storage = require('./Storage.coffee');
Toolbar = require('./Toolbar.coffee');
Menu = require('./Menu.coffee');
Info = require('./Info.coffee');
Projector = require('./Projector.coffee');
DataProjector = (function(_super) {
__extends(DataProjector, _super);
DataProjector.prototype.storage = null;
DataProjector.prototype.toolbar = null;
DataProjector.prototype.menu = null;
DataProjector.prototype.info = null;
DataProjector.prototype.projector = null;
DataProjector.prototype.palette = null;
DataProjector.prototype.colors = null;
function DataProjector() {
this.storage = new Storage();
this.storage.attach(this);
this.storage.requestData();
this.toolbar = new Toolbar('#toolbar');
this.toolbar.attach(this);
this.menu = new Menu('#menu');
this.menu.attach(this);
this.info = new Info('#info');
this.info.attach(this);
this.projector = new Projector();
this.projector.attach(this);
}
DataProjector.prototype.update = function(subject, type, data) {
if (subject instanceof Storage) {
this.onStorageEvent(type, data);
}
if (subject instanceof Toolbar) {
this.onToolbarEvent(type, data);
}
if (subject instanceof Menu) {
this.onMenuEvent(type, data);
}
if (subject instanceof Projector) {
return this.onProjectorEvent(type, data);
}
};
DataProjector.prototype.onStorageEvent = function(type, data) {
switch (type) {
case Storage.EVENT_DATA_READY:
this.info.display("Processed " + (this.storage.getPoints()) + " points.");
this.info.display("Found " + (this.storage.getClusters()) + " clusters.");
return this.initialize();
case Storage.EVENT_SCREENSHOT_OK:
return this.info.display("Screenshot " + (this.storage.getSaved()) + " saved.");
}
};
DataProjector.prototype.onToolbarEvent = function(type, data) {
var state;
switch (type) {
case Toolbar.EVENT_MENU:
state = this.menu.toggle();
return this.toolbar.setMenuButtonSelected(state);
case Toolbar.EVENT_INFO:
state = this.info.toggle();
return this.toolbar.setInfoButtonSelected(state);
case Toolbar.EVENT_PERSPECTIVE:
this.projector.setMode(Projector.VIEW.PERSPECTIVE);
return this.toolbar.setCameraButtonSelected(true, false, false);
case Toolbar.EVENT_ORTHOGRAPHIC:
this.projector.setMode(Projector.VIEW.ORTHOGRAPHIC);
return this.toolbar.setCameraButtonSelected(false, true, false);
case Toolbar.EVENT_DUAL:
this.projector.setMode(Projector.VIEW.DUAL);
return this.toolbar.setCameraButtonSelected(false, false, true);
case Toolbar.EVENT_RESET:
this.projector.resetCamera(true);
return this.toolbar.blinkResetButton();
case Toolbar.EVENT_CLEAR:
this.info.clear();
return this.toolbar.blinkClearButton();
case Toolbar.EVENT_BOX:
state = this.projector.toggleBox();
return this.toolbar.setBoxButtonSelected(state);
case Toolbar.EVENT_VIEWPORT:
state = this.projector.toggleViewport();
return this.toolbar.setViewportButtonSelected(state);
case Toolbar.EVENT_SELECT:
state = this.projector.toggleSelector();
return this.toolbar.setSelectButtonSelected(state);
case Toolbar.EVENT_VIEW_TOP:
this.projector.changeView(Utility.DIRECTION.TOP);
return this.toolbar.setViewButtonSelected(true, false, false);
case Toolbar.EVENT_VIEW_FRONT:
this.projector.changeView(Utility.DIRECTION.FRONT);
return this.toolbar.setViewButtonSelected(false, true, false);
case Toolbar.EVENT_VIEW_SIDE:
this.projector.changeView(Utility.DIRECTION.SIDE);
return this.toolbar.setViewButtonSelected(false, false, true);
case Toolbar.EVENT_SPIN_LEFT:
this.projector.setSpin(Projector.SPIN.LEFT);
return this.toolbar.setSpinButtonSelected(true, false, false);
case Toolbar.EVENT_SPIN_STOP:
this.projector.setSpin(Projector.SPIN.NONE);
return this.toolbar.setSpinButtonSelected(false, true, false);
case Toolbar.EVENT_SPIN_RIGHT:
this.projector.setSpin(Projector.SPIN.RIGHT);
return this.toolbar.setSpinButtonSelected(false, false, true);
case Toolbar.EVENT_ANIMATE:
state = this.projector.toggleAnimation();
return this.toolbar.setAnimateButtonSelected(state);
case Toolbar.EVENT_PRINT:
this.storage.saveImage(this.projector.getImage());
return this.toolbar.blinkPrintButton();
}
};
DataProjector.prototype.onMenuEvent = function(type, data) {
switch (type) {
case Menu.EVENT_TOGGLE_ALL_ON:
return this.projector.setAllClustersVisible(true);
case Menu.EVENT_TOGGLE_ALL_OFF:
return this.projector.setAllClustersVisible(false);
case Menu.EVENT_TOGGLE_ID:
return this.projector.toggleClusterVisibility(data.id);
case Menu.EVENT_CLUSTER_ID:
return this.projector.toggleClusterSelection(data.id);
}
};
DataProjector.prototype.onProjectorEvent = function(type, data) {
console.log("DataProjector.onProjectorEvent " + type + " : " + data);
switch (type) {
case Projector.EVENT_DATA_LOADED:
return console.log("DataProjector.onProjectorEvent " + type);
case Projector.EVENT_POINTS_SELECTED:
return this.info.display("Selected " + data.points + " points.");
case Projector.EVENT_CLUSTER_SELECTED:
if (data.id > -1) {
return this.info.display("Cluster " + data.id + " selected");
} else {
return this.info.display("No cluster selected");
}
}
};
DataProjector.prototype.initialize = function() {
this.palette = new Palette(this.storage.getClusters());
this.colors = this.palette.getColors();
this.menu.create(this.storage.getClusters(), this.palette.getColors());
this.projector.setColors(this.colors);
this.projector.load(this.storage);
return this.onToolbarEvent(Toolbar.EVENT_SPIN_RIGHT);
};
return DataProjector;
})(Observer);
dataProjector = new DataProjector();
},{"./Info.coffee":2,"./Menu.coffee":3,"./Observer.coffee":4,"./Palette.coffee":5,"./Projector.coffee":7,"./Storage.coffee":9,"./Subject.coffee":10,"./Toolbar.coffee":11,"./Utility.coffee":12}],2:[function(require,module,exports){
var Info, Panel,
__hasProp = {}.hasOwnProperty,
__extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };
Panel = require('./Panel.coffee');
Info = (function(_super) {
__extends(Info, _super);
function Info(id) {
Info.__super__.constructor.call(this, id);
}
Info.prototype.display = function(message) {
return $('#message').append(message + "<br/>");
};
Info.prototype.clear = function() {
return $('#message').text("");
};
return Info;
})(Panel);
module.exports = Info;
},{"./Panel.coffee":6}],3:[function(require,module,exports){
var Menu, Panel,
__bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; },
__hasProp = {}.hasOwnProperty,
__extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };
Panel = require('./Panel.coffee');
Menu = (function(_super) {
__extends(Menu, _super);
Menu.EVENT_TOGGLE_ALL_ON = "EVENT_TOGGLE_ALL_ON";
Menu.EVENT_TOGGLE_ALL_OFF = "EVENT_TOGGLE_ALL_OFF";
Menu.EVENT_TOGGLE_ID = "EVENT_TOGGLE_ID";
Menu.EVENT_CLUSTER_ID = "EVENT_CLUSTER_ID";
Menu.TOGGLE_ON = "[+]";
Menu.TOGGLE_OFF = "[-]";
Menu.TOGGLE_MIX = "[/]";
Menu.prototype.clusters = 0;
Menu.prototype.selected = -1;
Menu.prototype.colors = null;
function Menu(id) {
this.onCluster = __bind(this.onCluster, this);
this.onToggle = __bind(this.onToggle, this);
this.onToggleAll = __bind(this.onToggleAll, this);
Menu.__super__.constructor.call(this, id);
}
Menu.prototype.onToggleAll = function(event) {
var i, state, _i, _j, _ref, _ref1;
state = $("#toggleAll").text();
switch (state) {
case Menu.TOGGLE_OFF:
case Menu.TOGGLE_MIX:
$("#toggleAll").text(Menu.TOGGLE_ON);
for (i = _i = 0, _ref = this.clusters; 0 <= _ref ? _i < _ref : _i > _ref; i = 0 <= _ref ? ++_i : --_i) {
$("#t" + String(i)).text(Menu.TOGGLE_ON);
}
return this.notify(Menu.EVENT_TOGGLE_ALL_ON);
case Menu.TOGGLE_ON:
$("#toggleAll").text(Menu.TOGGLE_OFF);
for (i = _j = 0, _ref1 = this.clusters; 0 <= _ref1 ? _j < _ref1 : _j > _ref1; i = 0 <= _ref1 ? ++_j : --_j) {
$("#t" + String(i)).text(Menu.TOGGLE_OFF);
}
return this.notify(Menu.EVENT_TOGGLE_ALL_OFF);
}
};
Menu.prototype.onToggle = function(event) {
var id, identifier, index;
identifier = event.target.id;
id = identifier.replace("t", "");
index = parseInt(id);
this.doToggle(index);
return this.notify(Menu.EVENT_TOGGLE_ID, {
id: index
});
};
Menu.prototype.onCluster = function(event) {
var index;
index = parseInt(event.target.id.replace("b", ""));
if (this.selected === index) {
this.selected = -1;
} else {
this.selected = index;
}
this.updateSwatches();
this.updateButtons();
return this.notify(Menu.EVENT_CLUSTER_ID, {
id: index
});
};
Menu.prototype.doToggle = function(index) {
var state, tag;
tag = "#t" + String(index);
state = $(tag).text();
switch (state) {
case Menu.TOGGLE_ON:
$(tag).text(Menu.TOGGLE_OFF);
break;
case Menu.TOGGLE_OFF:
$(tag).text(Menu.TOGGLE_ON);
}
return this.updateMasterToggle();
};
Menu.prototype.create = function(clusters, colors) {
var html, i, _i, _j, _ref, _ref1;
this.clusters = clusters;
this.colors = colors;
for (i = _i = 0, _ref = this.clusters; 0 <= _ref ? _i < _ref : _i > _ref; i = 0 <= _ref ? ++_i : --_i) {
html = "<span class='toggle' id='t" + i + "'>[+]</span><span class='button' id='b" + i + "'> Cluster</span><span class='color' id='c" + i + "'> " + i + " </span><br/>";
$("#menu").append(html);
}
$("#toggleAll").click(this.onToggleAll);
for (i = _j = 0, _ref1 = this.clusters; 0 <= _ref1 ? _j < _ref1 : _j > _ref1; i = 0 <= _ref1 ? ++_j : --_j) {
$("#t" + String(i)).click(this.onToggle);
$("#b" + String(i)).click(this.onCluster);
}
return this.updateSwatches();
};
Menu.prototype.togglesOn = function() {
var i, result, state, tag, _i, _ref;
result = 0;
for (i = _i = 0, _ref = this.clusters; 0 <= _ref ? _i < _ref : _i > _ref; i = 0 <= _ref ? ++_i : --_i) {
tag = "#t" + String(i);
state = $(tag).text();
if (state === Menu.TOGGLE_ON) {
result++;
}
}
return result;
};
Menu.prototype.updateMasterToggle = function() {
var shown;
shown = this.togglesOn();
switch (shown) {
case 0:
return $("#toggleAll").text(Menu.TOGGLE_OFF);
case this.clusters:
return $("#toggleAll").text(Menu.TOGGLE_ON);
default:
return $("#toggleAll").text(Menu.TOGGLE_MIX);
}
};
Menu.prototype.updateSwatches = function() {
var i, _i, _ref, _results;
_results = [];
for (i = _i = 0, _ref = this.clusters; 0 <= _ref ? _i < _ref : _i > _ref; i = 0 <= _ref ? ++_i : --_i) {
if (i === this.selected) {
_results.push($("#c" + String(i)).css('color', Palette.HIGHLIGHT.getStyle()));
} else {
_results.push($("#c" + String(i)).css('color', this.colors[i].getStyle()));
}
}
return _results;
};
Menu.prototype.updateButtons = function() {
var i, _i, _ref, _results;
_results = [];
for (i = _i = 0, _ref = this.clusters; 0 <= _ref ? _i < _ref : _i > _ref; i = 0 <= _ref ? ++_i : --_i) {
if (i === this.selected) {
_results.push($("#b" + String(i)).css('color', Palette.HIGHLIGHT.getStyle()));
} else {
_results.push($("#b" + String(i)).css('color', Palette.BUTTON.getStyle()));
}
}
return _results;
};
return Menu;
})(Panel);
module.exports = Menu;
},{"./Panel.coffee":6}],4:[function(require,module,exports){
var Observer;
Observer = (function() {
function Observer() {}
Observer.prototype.update = function(subject, type, data) {};
return Observer;
})();
module.exports = Observer;
},{}],5:[function(require,module,exports){
var Palette;
Palette = (function() {
Palette.BACKGROUND = new THREE.Color(0x202020);
Palette.HIGHLIGHT = new THREE.Color(0xFFFFFF);
Palette.SELECTOR = new THREE.Color(0xCC0000);
Palette.BUTTON = new THREE.Color(0xCCCCCC);
Palette.BUTTON_SELECTED = new THREE.Color(0xFF9C00);
Palette.prototype.colors = null;
function Palette(size) {
this.colors = new Array();
this.generate(size);
}
Palette.prototype.generate = function(size) {
var color, hue, i, lightness, saturation, step, _i, _results;
hue = 0;
saturation = 0.7;
lightness = 0.45;
step = 1 / size;
_results = [];
for (i = _i = 0; 0 <= size ? _i < size : _i > size; i = 0 <= size ? ++_i : --_i) {
hue = (i + 1) * step;
color = new THREE.Color();
color.setHSL(hue, saturation, lightness);
_results.push(this.colors.push(color));
}
return _results;
};
Palette.prototype.getColors = function() {
return this.colors;
};
Palette.prototype.print = function() {
var c, css, hsl, hue, i, lightness, saturation, _i, _len, _ref, _results;
i = 0;
_ref = this.colors;
_results = [];
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
c = _ref[_i];
css = c.getStyle();
hsl = c.getHSL();
hue = hsl.h.toFixed(1);
saturation = hsl.s.toFixed(1);
lightness = hsl.l.toFixed(1);
_results.push(console.log(i++ + " > " + hue + " : " + saturation + " : " + lightness + " | " + css));
}
return _results;
};
return Palette;
})();
module.exports = Palette;
},{}],6:[function(require,module,exports){
var Panel, Subject,
__hasProp = {}.hasOwnProperty,
__extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };
Subject = require('./Subject.coffee');
Panel = (function(_super) {
__extends(Panel, _super);
Panel.EVENT_PANEL_SHOWN = "EVENT_PANEL_SHOWN";
Panel.EVENT_PANEL_HIDDEN = "EVENT_PANEL_HIDDEN";
Panel.prototype.visible = true;
function Panel(id) {
this.id = id;
Panel.__super__.constructor.call(this);
}
Panel.prototype.show = function() {
$(this.id).show();
this.visible = true;
return this.notify(Panel.EVENT_PANEL_SHOWN);
};
Panel.prototype.hide = function() {
$(this.id).hide();
this.visible = false;
return this.notify(Panel.EVENT_PANEL_HIDDEN);
};
Panel.prototype.toggle = function() {
if (this.visible) {
this.hide();
} else {
this.show();
}
return this.visible;
};
return Panel;
})(Subject);
module.exports = Panel;
},{"./Subject.coffee":10}],7:[function(require,module,exports){
var Palette, Projector, Selector, Subject, Utility,
__bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; },
__hasProp = {}.hasOwnProperty,
__extends = function(child, parent) { for (var key in parent) { if (__hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; };
Subject = require('./Subject.coffee');
Utility = require('./Utility.coffee');
Palette = require('./Palette.coffee');
Selector = require('./Selector.coffee');
Projector = (function(_super) {
__extends(Projector, _super);
Projector.EVENT_DATA_LOADED = "EVENT_DATA_LOADED";
Projector.EVENT_POINTS_SELECTED = "EVENT_POINTS_SELECTED";
Projector.EVENT_CLUSTER_SELECTED = "EVENT_CLUSTER_SELECTED";
Projector.VIEW = {
NONE: -1,
PERSPECTIVE: 0,
ORTHOGRAPHIC: 1,
DUAL: 2
};
Projector.SPIN = {
LEFT: -1,
NONE: 0,
RIGHT: +1
};
Projector.SPIN_STEP = Utility.DEGREE / 10;
Projector.prototype.SCREEN_WIDTH = window.innerWidth;
Projector.prototype.SCREEN_HEIGHT = window.innerHeight;
Projector.prototype.mode = Projector.VIEW.PERSPECTIVE;
Projector.prototype.storage = null;
Projector.prototype.colors = null;
Projector.prototype.scene = null;
Projector.prototype.cameraPerspective = null;
Projector.prototype.cameraOrthographic = null;
Projector.prototype.renderer = null;
Projector.prototype.mouse = new THREE.Vector3();
Projector.prototype.mouseStart = new THREE.Vector3();
Projector.prototype.mouseEnd = new THREE.Vector3();
Projector.prototype.dragging = false;
Projector.prototype.selector = null;