-
+ Welcome!
+
+
diff --git a/web/js/CacheUMLExplorer.js b/web/js/CacheUMLExplorer.js
index ffcf0d8..9ea06a6 100644
--- a/web/js/CacheUMLExplorer.js
+++ b/web/js/CacheUMLExplorer.js
@@ -8,15 +8,20 @@
*/
var CacheUMLExplorer = function (treeViewContainer, classViewContainer) {
+ var id = function (e) { return document.getElementById(e); };
+
this.elements = {
- className: document.getElementById("className"),
+ uiBody: id("ui-body"),
+ className: id("className"),
treeViewContainer: treeViewContainer,
classViewContainer: classViewContainer,
- zoomInButton: document.getElementById("button.zoomIn"),
- zoomOutButton: document.getElementById("button.zoomOut"),
- zoomNormalButton: document.getElementById("button.zoomNormal")
+ zoomInButton: id("button.zoomIn"),
+ zoomOutButton: id("button.zoomOut"),
+ zoomNormalButton: id("button.zoomNormal"),
+ infoButton: id("button.showInfo")
};
+ this.UI = new UI(this);
this.source = new Source();
this.classTree = new ClassTree(this, treeViewContainer);
this.classView = new ClassView(this, classViewContainer);
@@ -43,6 +48,19 @@ CacheUMLExplorer.prototype.init = function () {
}
}
+ this.elements.infoButton.addEventListener("click", function () {
+ self.UI.displayMessage(
+ "Caché UML explorer v"
+ + "[NOT-BUILT]"/*build.replace:"pkg.version"*/
+ + "
for InterSystems Caché"
+ + "
By Nikita Savchenko"
+ + "
"
+ + "Project page /
Bug tracker"
+ + "
Enjoy!"
+ );
+ });
+
enableSVGDownload(this.classTree);
};
\ No newline at end of file
diff --git a/web/js/UI.js b/web/js/UI.js
new file mode 100644
index 0000000..42f9916
--- /dev/null
+++ b/web/js/UI.js
@@ -0,0 +1,56 @@
+/**
+ * User interface functions.
+ * @param {CacheUMLExplorer} cacheUMLExplorer
+ * @constructor
+ */
+var UI = function (cacheUMLExplorer) {
+
+ this.cacheUMLExplorer = cacheUMLExplorer;
+ this.BODY = cacheUMLExplorer.elements.uiBody;
+
+ /**
+ * @type {HTMLElement}
+ * @private
+ */
+ this.messageElement = null;
+
+};
+
+/**
+ * Display hovering message.
+ *
+ * @param {string} text
+ * @param {boolean} [removeByClick] - Define whether user be able to remove message by clicking on
+ * it.
+ */
+UI.prototype.displayMessage = function (text, removeByClick) {
+
+ this.removeMessage();
+
+ var self = this,
+ d1 = document.createElement("div"),
+ d2 = document.createElement("div"),
+ d3 = document.createElement("div");
+
+ d1.className = "central message";
+ d1.style.opacity = 0;
+ d3.innerHTML = text;
+ d2.appendChild(d3);
+ d1.appendChild(d2);
+ this.BODY.appendChild(d1);
+ this.messageElement = d1;
+ setTimeout(function () { if (d1) d1.style.opacity = 1; }, 25);
+ if (removeByClick === undefined || removeByClick) d1.addEventListener("click", function () {
+ self.removeMessage();
+ });
+
+};
+
+UI.prototype.removeMessage = function () {
+
+ if (this.messageElement) {
+ this.messageElement.parentNode.removeChild(this.messageElement);
+ this.messageElement = null;
+ }
+
+};
\ No newline at end of file
diff --git a/web/jsLib/joint.js b/web/jsLib/joint.js
index 9e8085c..40cba43 100644
--- a/web/jsLib/joint.js
+++ b/web/jsLib/joint.js
@@ -17222,9 +17222,9 @@ if ( typeof window === "object" && typeof window.document === "object" ) {
tspan.node.style[j] = setup["STYLES"][j];
}
}
- if (opt.clickHandler) {
- tspan.node.onclick = opt.clickHandler;
- }
+ }
+ if (opt.clickHandler) {
+ tspan.node.onclick = opt.clickHandler;
}
// Make sure the textContent is never empty. If it is, add an additional
// space (an invisible character) so that following lines are correctly
diff --git a/web/jsLib/joint.shapes.uml.js b/web/jsLib/joint.shapes.uml.js
index 2be2234..d4cec50 100644
--- a/web/jsLib/joint.shapes.uml.js
+++ b/web/jsLib/joint.shapes.uml.js
@@ -103,7 +103,9 @@ joint.shapes.uml.Class = joint.shapes.basic.Generic.extend({
attrs['.uml-class-' + rect.type + '-text'].text = lines.join('\n');
if (nameClickHandler) {
- if (rect.type === "name") attrs['.uml-class-' + rect.type + '-text'].clickHandler = nameClickHandler;
+ if (rect.type === "name") {
+ attrs['.uml-class-' + rect.type + '-text'].clickHandler = nameClickHandler;
+ }
}
attrs['.uml-class-' + rect.type + '-rect'].height = rectHeight;
attrs['.uml-class-' + rect.type + '-rect'].transform = 'translate(0,'+ offsetY + ')';