New JS files
Slight change in autocomplete for bug fix
Separated the old script.js in function-oriented different files
diff --git a/js/camera.js b/js/camera.js
new file mode 100644
index 0000000..ac4894f
--- /dev/null
+++ b/js/camera.js
@@ -0,0 +1,22 @@
+window.addEventListener('load', initCamera);
+
+function cameraGoto(nodeX, nodeY) {
+ sigma.misc.animation.camera( s.camera,
+ { x: nodeX, y: nodeY, ratio: 1 },
+ { duration: s.settings('animationsTime') || 300 }
+ );
+}
+
+function initCamera() {
+ document.querySelector("#zoomin").addEventListener("click", function() {
+ s.camera.goTo({
+ ratio: Math.max(s.camera.settings("zoomMin"), s.camera.ratio / Math.sqrt(2))
+ });
+ });
+
+ document.querySelector("#zoomout").addEventListener("click", function() {
+ s.camera.goTo({
+ ratio: Math.min(s.camera.settings("zoomMax"), s.camera.ratio * Math.sqrt(2))
+ });
+ });
+}