Skip to content

Commit d6f2e94

Browse files
fixed click when dragging classes, show queries option add
1 parent 32ae835 commit d6f2e94

File tree

6 files changed

+39
-4
lines changed

6 files changed

+39
-4
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "CacheUMLExplorer",
3-
"version": "1.7.1",
3+
"version": "1.7.3",
44
"description": "An UML Class explorer for InterSystems Caché",
55
"directories": {
66
"test": "test"

web/css/settingsView.css

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,4 +29,9 @@
2929

3030
#settingsView table td {
3131
text-align: left;
32+
}
33+
34+
#settingsView table td:nth-child(3) {
35+
color: #888;
36+
padding-left: 1em;
3237
}

web/index.html

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,26 +98,37 @@ <h1>
9898
<tbody>
9999
<tr>
100100
<td><input id="setting.showDataTypesOnDiagram" type="checkbox"/></td>
101-
<td><label for="setting.showDataTypesOnDiagram">Show Data Types</label></td>
101+
<td><label for="setting.showDataTypesOnDiagram">Render Data Types</label></td>
102+
<td>Show data type classes on diagram</td>
103+
</tr>
104+
<tr>
105+
<td><input id="setting.showClassIcons" type="checkbox"/></td>
106+
<td><label for="setting.showClassIcons">Show Icons Over Class Name</label></td>
107+
<td>Visualize class keywords</td>
102108
</tr>
103109
<tr>
104110
<td><input id="setting.showParameters" type="checkbox"/></td>
105111
<td><label for="setting.showParameters">Show Parameters</label></td>
112+
<td>Display block with class parameters</td>
106113
</tr>
107114
<tr>
108115
<td><input id="setting.showProperties" type="checkbox"/></td>
109116
<td><label for="setting.showProperties">Show Properties</label></td>
117+
<td>Display block with class properties</td>
110118
</tr>
111119
<tr>
112120
<td><input id="setting.showMethods" type="checkbox"/></td>
113121
<td><label for="setting.showMethods">Show Methods</label></td>
122+
<td>Display block with class methods</td>
114123
</tr>
115124
<tr>
116125
<td><input id="setting.showQueries" type="checkbox"/></td>
117126
<td><label for="setting.showQueries">Show Queries</label></td>
127+
<td>Display block with class queries</td>
118128
</tr>
119129
</tbody>
120130
</table>
131+
<p id="settingsExtraText"></p>
121132
</div>
122133
</div>
123134
</div>

web/js/CacheUMLExplorer.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,10 @@ var CacheUMLExplorer = function (treeViewContainer, classViewContainer) {
3737
diagramSearchButton: id("button.diagramSearch"),
3838
settingsView: id("settingsView"),
3939
closeSettings: id("closeSettings"),
40+
settingsExtraText: id("settingsExtraText"),
4041
settings: {
4142
showDataTypesOnDiagram: id("setting.showDataTypesOnDiagram"),
43+
showClassIcons: id("setting.showClassIcons"),
4244
showParameters: id("setting.showParameters"),
4345
showProperties: id("setting.showProperties"),
4446
showMethods: id("setting.showMethods"),
@@ -54,6 +56,7 @@ var CacheUMLExplorer = function (treeViewContainer, classViewContainer) {
5456
// note: this.elements is required to be modified with the same name as settings keys
5557
this.settings = {
5658
showDataTypesOnDiagram: settingsValue("showDataTypesOnDiagram"),
59+
showClassIcons: settingsValue("showClassIcons", true),
5760
showParameters: settingsValue("showParameters", true),
5861
showProperties: settingsValue("showProperties", true),
5962
showMethods: settingsValue("showMethods", true),
@@ -73,12 +76,14 @@ var CacheUMLExplorer = function (treeViewContainer, classViewContainer) {
7376

7477
CacheUMLExplorer.prototype.initSettings = function () {
7578

76-
var self = this;
79+
var self = this,
80+
textChanged = "Please, re-render diagram to make changes apply.";
7781

7882
for (var st in this.elements.settings) {
7983
this.elements.settings[st].checked = this.settings[st];
8084
this.elements.settings[st].addEventListener("change", (function (st) {
8185
return function (e) {
86+
self.elements.settingsExtraText.innerHTML = textChanged;
8287
localStorage.setItem(
8388
st,
8489
self.settings[st] = (e.target || e.srcElement).checked
@@ -200,6 +205,7 @@ CacheUMLExplorer.prototype.init = function () {
200205
self.elements.settingsView.classList.add("active");
201206
});
202207
this.elements.closeSettings.addEventListener("click", function () {
208+
self.elements.settingsExtraText.textContent = "";
203209
self.elements.settingsView.classList.remove("active");
204210
});
205211

web/js/ClassView.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -310,6 +310,8 @@ ClassView.prototype.getClassSigns = function (classMetaData) {
310310

311311
var signs = [], ct;
312312

313+
if (!this.cacheUMLExplorer.settings.showClassIcons) return signs;
314+
313315
if (ct = classMetaData["$classType"]) {
314316
if (ct !== "Serial" && ct !== "Registered" && ct !== "Persistent" && ct !== "DataType") {
315317
signs.push({

web/jsLib/joint.js

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17229,7 +17229,18 @@ if ( typeof window === "object" && typeof window.document === "object" ) {
1722917229
}
1723017230
}
1723117231
if (typeof lines[i]["clickHandler"] === "function") {
17232-
tspan.node.addEventListener("click", lines[i]["clickHandler"]);
17232+
tspan.node.addEventListener("click", (function (el, handler) {
17233+
var clickable = true;
17234+
el.addEventListener("mousemove", function () {
17235+
clickable = false;
17236+
});
17237+
el.addEventListener("mousedown", function () {
17238+
clickable = true;
17239+
});
17240+
return function (e) {
17241+
if (clickable) handler(e);
17242+
};
17243+
})(tspan.node, lines[i]["clickHandler"]));
1723317244
tspan.node["clickHandler"] = lines[i]["clickHandler"];
1723417245
tspan.addClass('line-clickable');
1723517246
}

0 commit comments

Comments
 (0)