Skip to content

Commit 33142aa

Browse files
Merge remote-tracking branch 'upstream/master'
2 parents 2948926 + 0bcac39 commit 33142aa

File tree

11 files changed

+158
-17
lines changed

11 files changed

+158
-17
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
# CacheUMLExplorer
2-
An UML Class explorer for InterSystems Caché. It can build UML class diagram for any class or even for whole package in Caché.
2+
An UML Class explorer for InterSystems Caché. It is able to build UML class diagram for any class or even for whole package in Caché.
33

44
## Screenshots
55

6-
![2015-04-21_214058](https://cloud.githubusercontent.com/assets/4989256/7260103/6c1e2a20-e870-11e4-8bf0-9832885be9ab.png)
6+
![2015-04-21_214058](https://cloud.githubusercontent.com/assets/4989256/7396518/65ba1924-eeaa-11e4-808b-5f648c0011e4.png)
77

88
## Installation
99

cache/projectTemplate.xml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<Class name="UMLExplorer.ClassView">
44
<Description>
55
Class contains methods that return structured class data.</Description>
6-
<TimeChanged>63670,72515.130814</TimeChanged>
6+
<TimeChanged>63671,64479.682329</TimeChanged>
77
<TimeCreated>63653,67019.989197</TimeCreated>
88

99
<Method name="getClassTree">
@@ -60,6 +60,7 @@ return structured data about class</Description>
6060
6161
set oProperties = ##class(%ZEN.proxyObject).%New()
6262
set oClass.NAMESPACE = $NAMESPACE
63+
set oClass.ABSTRACT = classDefinition.Abstract
6364
set oClass.super = classDefinition.Super
6465
set oClass.properties = oProperties
6566
set count = classDefinition.Properties.Count()
@@ -220,7 +221,7 @@ return structured data about class</Description>
220221
</Class>
221222

222223

223-
<Project name="UMLExplorer" LastModified="2015-04-28 19:55:49.450783">
224+
<Project name="UMLExplorer" LastModified="2015-04-28 23:30:37.941872">
224225
<Items>
225226
<ProjectItem name="UMLExplorer.ClassView" type="CLS"></ProjectItem>
226227
<ProjectItem name="UMLExplorer.Router" type="CLS"></ProjectItem>

gulpfile.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,10 @@ gulp.task("gatherLibs", ["clean"], function () {
6060
gulp.task("gatherScripts", ["clean", "gatherLibs"], function () {
6161
return gulp.src("web/js/*.js")
6262
.pipe(concat("CacheUMLExplorer.js"))
63-
.pipe(replace(/[^\s]+\/\*build.replace:(.*)\*\//g, "$1"))
63+
.pipe(replace(/[^\s]+\/\*build\.replace:(.*)\*\//g, function (part, match) {
64+
var s = match.toString();
65+
return s.replace(/pkg\.([a-zA-Z]+)/g, function (p,a) { return pkg[a]; });
66+
}))
6467
.pipe(wrap("CacheUMLExplorer = (function(){<%= contents %> return CacheUMLExplorer;}());"))
6568
.pipe(uglify({
6669
output: {

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "CacheUMLExplorer",
3-
"version": "0.5.0",
3+
"version": "0.5.2",
44
"description": "An UML Class explorer for InterSystems Caché",
55
"directories": {
66
"test": "test"
@@ -18,7 +18,7 @@
1818
"gulp-minify-css": "^0.3.11",
1919
"gulp-postcss": "^5.1.3",
2020
"gulp-rename": "^1.2.0",
21-
"gulp-replace": "^0.5.0",
21+
"gulp-replace": "^0.5.3",
2222
"gulp-strip-comments": "^1.0.1",
2323
"gulp-uglify": "^1.2.0",
2424
"gulp-wrap": "^0.5.0",

web/css/extras.css

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,28 @@
140140
left: 9px;
141141
}
142142

143+
.icon.info:after {
144+
content: "";
145+
background-color: #fff;
146+
width: 4px;
147+
height: 10px;
148+
border-radius: 1px;
149+
position: absolute;
150+
top: 10px;
151+
left: 10px;
152+
}
153+
154+
.icon.info:before {
155+
content: "";
156+
background-color: #fff;
157+
width: 4px;
158+
height: 4px;
159+
border-radius: 2px;
160+
position: absolute;
161+
top: 4px;
162+
left: 10px;
163+
}
164+
143165
.icon.scaleNormal:after {
144166
content: "1:1";
145167
position: absolute;

web/css/interface.css

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,41 @@ html, body {
4848
padding: .5em;
4949
}
5050

51+
.ui-topRightToolBar {
52+
position: absolute;
53+
top: 0;
54+
right: 0;
55+
padding: .5em;
56+
}
57+
5158
#className {
5259
text-shadow: 1px 1px 0 white, -1px -1px 0 white, 1px -1px 0 white, -1px 1px 0 white;
60+
}
61+
62+
.central {
63+
position: absolute;
64+
left: 0;
65+
top: 0;
66+
width: 100%;
67+
height: 100%;
68+
display: table;
69+
}
70+
71+
.central > div {
72+
display: table-cell;
73+
vertical-align: middle;
74+
text-align: center;
75+
}
76+
77+
.central > div > div {
78+
display: inline-block;
79+
}
80+
81+
.message {
82+
font-size: 14pt;
83+
background: rgba(245, 245, 245, 0.9);
84+
-webkit-transition: all .2s ease;
85+
-moz-transition: all .2s ease;
86+
-o-transition: all .2s ease;
87+
transition: all .2s ease;
5388
}

web/index.html

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,18 +20,22 @@
2020
<script type="text/javascript" src="js/CacheUMLExplorer.js"></script>
2121
<script type="text/javascript" src="js/ClassTree.js"></script>
2222
<script type="text/javascript" src="js/Source.js"></script>
23+
<script type="text/javascript" src="js/UI.js"></script>
2324
<!-- endbuild -->
2425
</head>
2526
<body onload="cue = new CacheUMLExplorer(document.getElementById('treeView'), document.getElementById('classView'))">
26-
<div class="ui-body">
27+
<div class="ui-body" id="ui-body">
2728
<div class="ui-sideBlock">
2829
<div id="treeView">
2930

3031
</div>
3132
</div>
3233
<div class="ui-mainBlock">
3334
<div class="ui-ClassInfo">
34-
<span id="className"></span>
35+
<span id="className">Welcome!</span>
36+
</div>
37+
<div class="ui-topRightToolBar">
38+
<div id="button.showInfo" class="icon info"></div>
3539
</div>
3640
<div class="ui-leftBottomToolBar">
3741
<div id="button.downloadSVG" class="icon download"></div>

web/js/CacheUMLExplorer.js

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,20 @@
88
*/
99
var CacheUMLExplorer = function (treeViewContainer, classViewContainer) {
1010

11+
var id = function (e) { return document.getElementById(e); };
12+
1113
this.elements = {
12-
className: document.getElementById("className"),
14+
uiBody: id("ui-body"),
15+
className: id("className"),
1316
treeViewContainer: treeViewContainer,
1417
classViewContainer: classViewContainer,
15-
zoomInButton: document.getElementById("button.zoomIn"),
16-
zoomOutButton: document.getElementById("button.zoomOut"),
17-
zoomNormalButton: document.getElementById("button.zoomNormal")
18+
zoomInButton: id("button.zoomIn"),
19+
zoomOutButton: id("button.zoomOut"),
20+
zoomNormalButton: id("button.zoomNormal"),
21+
infoButton: id("button.showInfo")
1822
};
1923

24+
this.UI = new UI(this);
2025
this.source = new Source();
2126
this.classTree = new ClassTree(this, treeViewContainer);
2227
this.classView = new ClassView(this, classViewContainer);
@@ -43,6 +48,19 @@ CacheUMLExplorer.prototype.init = function () {
4348
}
4449
}
4550

51+
this.elements.infoButton.addEventListener("click", function () {
52+
self.UI.displayMessage(
53+
"Cach&eacute; UML explorer v"
54+
+ "[NOT-BUILT]"/*build.replace:"pkg.version"*/
55+
+ "<br/>for InterSystems Cach&eacute;"
56+
+ "<br/>By Nikita Savchenko"
57+
+ "<br/><a target=\"_blank\" href=\"https://github.com/intersystems-ru/UMLExplorer\">"
58+
+ "Project page</a> / <a target=\"_blank\" "
59+
+ "href=\"https://github.com/intersystems-ru/UMLExplorer/issues\">Bug tracker</a>"
60+
+ "<br/><br/>Enjoy!"
61+
);
62+
});
63+
4664
enableSVGDownload(this.classTree);
4765

4866
};

web/js/UI.js

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
/**
2+
* User interface functions.
3+
* @param {CacheUMLExplorer} cacheUMLExplorer
4+
* @constructor
5+
*/
6+
var UI = function (cacheUMLExplorer) {
7+
8+
this.cacheUMLExplorer = cacheUMLExplorer;
9+
this.BODY = cacheUMLExplorer.elements.uiBody;
10+
11+
/**
12+
* @type {HTMLElement}
13+
* @private
14+
*/
15+
this.messageElement = null;
16+
17+
};
18+
19+
/**
20+
* Display hovering message.
21+
*
22+
* @param {string} text
23+
* @param {boolean} [removeByClick] - Define whether user be able to remove message by clicking on
24+
* it.
25+
*/
26+
UI.prototype.displayMessage = function (text, removeByClick) {
27+
28+
this.removeMessage();
29+
30+
var self = this,
31+
d1 = document.createElement("div"),
32+
d2 = document.createElement("div"),
33+
d3 = document.createElement("div");
34+
35+
d1.className = "central message";
36+
d1.style.opacity = 0;
37+
d3.innerHTML = text;
38+
d2.appendChild(d3);
39+
d1.appendChild(d2);
40+
this.BODY.appendChild(d1);
41+
this.messageElement = d1;
42+
setTimeout(function () { if (d1) d1.style.opacity = 1; }, 25);
43+
if (removeByClick === undefined || removeByClick) d1.addEventListener("click", function () {
44+
self.removeMessage();
45+
});
46+
47+
};
48+
49+
UI.prototype.removeMessage = function () {
50+
51+
if (this.messageElement) {
52+
this.messageElement.parentNode.removeChild(this.messageElement);
53+
this.messageElement = null;
54+
}
55+
56+
};

web/jsLib/joint.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17222,9 +17222,9 @@ if ( typeof window === "object" && typeof window.document === "object" ) {
1722217222
tspan.node.style[j] = setup["STYLES"][j];
1722317223
}
1722417224
}
17225-
if (opt.clickHandler) {
17226-
tspan.node.onclick = opt.clickHandler;
17227-
}
17225+
}
17226+
if (opt.clickHandler) {
17227+
tspan.node.onclick = opt.clickHandler;
1722817228
}
1722917229
// Make sure the textContent is never empty. If it is, add an additional
1723017230
// space (an invisible character) so that following lines are correctly

0 commit comments

Comments
 (0)