Pārlūkot izejas kodu

Update 'src/app/app.js'

Added information about iGeomJS version
Added iGeom/LInE header, improved indentation
leo 2 gadi atpakaļ
vecāks
revīzija
3187fcbb2c
1 mainītis faili ar 53 papildinājumiem un 29 dzēšanām
  1. 53 29
      src/app/app.js

+ 53 - 29
src/app/app.js

@@ -1,3 +1,17 @@
+/*
+ * iGeom by LInE
+ * Free software to student private data
+ *
+ * http://www.matematica.br/igeom
+ * http://www.usp.br/line
+ *
+ * Starting point of iGeomJS
+ *
+ * ./app/app.js
+ *
+ * @version 2020/06/16
+ */
+
 import { APP_STATE } from "./core/enums/app-state-enum";
 import { stageManager as Stages } from "./core/application/stage-manager";
 import { objects as Objects } from "./core/application/objects";
@@ -7,9 +21,17 @@ import { menu as Menu } from "./core/application/menu";
 import Konva from "konva";
 import { COMPONENT_TYPE } from "./core/enums/component-type-enum";
 import { headerMenu } from "./core/application/header-menu";
+
+
+const iGeomVersion = "2023/08/26";
+console.log("app.js: starting iGeomJS version " + iGeomVersion);
+
 export const app = (function () {
+
   let _selectedTool = [];
-  function _bootstrap() {
+
+  function _bootstrap () {
+    console.log("app.js!_bootstrap(): starting");
     Konva.showWarnings = false;
     headerMenu.bootstrap();
     Selector.bootstrap();
@@ -18,71 +40,73 @@ export const app = (function () {
     $("body").on("mouseenter", ".li-content", e => $(e.currentTarget).parent().find('.level-1').css("background-color", "#d4d4d4"));
     $("body").on("mouseleave", ".li-content", e => $(e.currentTarget).parent().find('.level-1').css("background-color", "transparent"));
     ;
-  }
+    }
 
-  function _currentLayer() {
+  function _currentLayer () {
     return Stages.getCurrentKonvaLayer();
-  }
+    }
 
-  function _setSelectedTool(tool) {
+  function _setSelectedTool (tool) {
     _clearSelectedTool(tool != undefined);
     _setState(APP_STATE.TOOL_SELECTED);
     if (tool.options.id != undefined) {
       document.getElementById("btn-" + tool.options.id).disabled = true;
-    }
+      }
     _selectedTool.push(tool);
-  }
+    }
 
-  function _clearSelectedTool(force) {
+  function _clearSelectedTool (force) {
     let tool = _getSelectedTool();
     if (tool != undefined) {
       if (!force && tool.options.type == COMPONENT_TYPE.SELECTOR) {
         return;
-      }
+        }
       if (tool.options.id != undefined) {
         document.getElementById("btn-" + tool.options.id).disabled = false;
+        }
       }
-    }
     _selectedTool = [];
     _setStatus("");
     _setState(APP_STATE.NONE);
-  }
+    }
 
-  function _getSelectedTool() {
+  function _getSelectedTool () {
     if (_selectedTool.length > 0) return _selectedTool[0];
     return undefined;
-  }
+    }
 
-  function _getRelativePointerPosition() {
+  function _getRelativePointerPosition () {
     const stage = Stages.getCurrentKonvaStage();
     return stage.getPointerPosition();
-  }
+    }
 
-  function _setStatus(status) {
+  function _setStatus (status) {
     document.getElementById("status").innerHTML = status;
-  }
+    }
 
-  function _pushObject(object) {
+  function _pushObject (object) {
     return;
     Objects.add(object);
-  }
+    }
 
-  function _getObjects() {
+  function _getObjects () {
     return Objects.get();
-  }
+    }
 
-  function _setState(e) {
+  function _setState (e) {
     State.setState(e);
-  }
+    }
 
-  function _refreshMenu() {
+  function _refreshMenu () {
     Menu.refresh();
-  }
-  function requireAll(r) {
+    }
+
+  function requireAll (r) {
     r.keys().forEach(r);
-  }
+    }
 
   _bootstrap();
+
   return {
     stage: Stages.getCurrentKonvaStage,
     currentLayer: _currentLayer,
@@ -95,5 +119,5 @@ export const app = (function () {
     pushObject: _pushObject,
     getObjects: _getObjects,
     setState: _setState
-  };
-})();
+    };
+  })();