Skip to content

Commit d054dd7

Browse files
moving to REST phase almost complete, build improvements, themes update
1 parent 2c1735f commit d054dd7

File tree

11 files changed

+262
-194
lines changed

11 files changed

+262
-194
lines changed
File renamed without changes.
File renamed without changes.

export/template.xml

Lines changed: 212 additions & 167 deletions
Large diffs are not rendered by default.

gulpfile.js

Lines changed: 34 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,20 @@ var gulp = require("gulp"),
1212
source = "webSource",
1313
buildTo = "build2";
1414

15+
var themes = fs.readdirSync("./" + buildTo + "/web/css/terminal-theme");
16+
17+
var extra = {
18+
themes:
19+
themes.map(function (n) {
20+
return ', "' + n.replace(/\..*$/, "") + '": "css/terminal-theme/' + n + '"';
21+
}).join("")
22+
};
23+
1524
var specialReplace = function () {
16-
return replace(/[^\s]+\/\*build\.replace:(.*)\*\//g, function (part, match) {
25+
return replace(/[^\s]*\/\*build\.replace:(.*)\*\//g, function (part, match) {
1726
var s = match.toString();
18-
return s.replace(/pkg\.([a-zA-Z]+)/g, function (p,a) { return pkg[a]; });
27+
return s.replace(/pkg\.([a-zA-Z]+)/g, function (p,a) { return pkg[a]; })
28+
.replace(/extra\.([a-zA-Z]+)/g, function (p,a) { return extra[a]; });
1929
});
2030
};
2131

@@ -52,20 +62,22 @@ gulp.task("copy-js", ["clean"], function () {
5262

5363
gulp.task("copy-css-basic", ["clean"], function () {
5464
return gulp.src([
55-
"./" + source + "/css/base.css",
56-
"./" + source + "/css/terminal.css",
57-
"./" + source + "/css/terminal-extra.css",
58-
"./" + source + "/css/terminal-graphic.css"
65+
"./" + source + "/css/*.css"
5966
]).pipe(concat("terminal.css"))
6067
.pipe(minifyCSS({ keepSpecialComments: 0 }))
6168
.pipe(gulp.dest("./" + buildTo + "/web/css/"));
6269
});
6370

6471
gulp.task("copy-css-themes", ["clean"], function () {
6572
return gulp.src([
66-
"./" + source + "/css/terminal-theme-cache.css"
73+
"./" + source + "/css/terminal-theme/*.css"
6774
]).pipe(minifyCSS({ keepSpecialComments: 0 }))
68-
.pipe(gulp.dest("./" + buildTo + "/web/css/"));
75+
.pipe(gulp.dest("./" + buildTo + "/web/css/terminal-theme/"));
76+
});
77+
78+
gulp.task("copy-export", ["clean"], function () {
79+
return gulp.src(["./export/*.*", "!./export/template.xml"])
80+
.pipe(gulp.dest("./" + buildTo + "/etc"));
6981
});
7082

7183
gulp.task("export", ["copy-html", "copy-js", "copy-css-themes", "copy-css-basic" ], function () {
@@ -87,8 +99,21 @@ gulp.task("export", ["copy-html", "copy-js", "copy-css-themes", "copy-css-basic"
8799
/\{\{replace:html}}/,
88100
function () { return fs.readFileSync("./" + buildTo + "/web/index.html", "utf-8"); }
89101
))
102+
.pipe(replace(
103+
/\{\{replace:themes}}([^]*)\{\{replace:end}}/g,
104+
function (p, content) {
105+
return themes.map(function (n) {
106+
return content.replace("{{replace:themeName}}", n.replace(/\..*$/, ""))
107+
.replace("{{replace:themeData}}", function () {
108+
return fs.readFileSync(
109+
"./" + buildTo + "/web/css/terminal-theme/" + n
110+
);
111+
});
112+
}).join("\n\n");
113+
}
114+
))
90115
.pipe(rename(function (path) { path.basename = "CacheWebTerminal-v" + pkg["version"]; }))
91116
.pipe(gulp.dest("./" + buildTo));
92117
});
93118

94-
gulp.task("default", ["export"]);
119+
gulp.task("default", ["export", "copy-export"]);

package.json

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,15 @@
33
"title": "Cache WEB Terminal",
44
"description": "Web-based terminal emulator for Caché administering.",
55
"author": "ZitRo",
6-
"version": "3.0.0-alpha.1",
7-
"releaseNumber": "10",
6+
"version": "3.0.0-alpha.2",
7+
"releaseNumber": 11,
88
"repository": {
99
"type": "git",
1010
"url": "https://github.com/intersystems-ru/webterminal.git"
1111
},
12+
"scripts": {
13+
"test": "node localServer/run.js"
14+
},
1215
"devDependencies": {
1316
"express": "^4.13.3",
1417
"gulp-concat": "^2.6.0",

webSource/js/CacheWebTerminalServer.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ var CacheWebTerminalServer = function (CONTROLLER, WS_PROTOCOL, IP, PORT) {
1818
/**
1919
* @type {string}
2020
*/
21-
this.CACHE_CLASS_NAME = "WebTerminal.Engine.cls";
21+
this.CACHE_CLASS_NAME = "%WebTerminal.Engine.cls";
2222

2323
/**
2424
* @type {string}

webSource/js/Globals.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,6 @@ window.createTerminal = function (authKey, namespace) {
7171

7272
var term;
7373

74-
console.log(authKey, namespace);
75-
7674
term = new Terminal({
7775
container: document.body,
7876
authKey: authKey || null,

webSource/js/Terminal.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,12 +48,12 @@ var Terminal = function (setting) {
4848
/**
4949
* @type {string}
5050
*/
51-
this.VERSION = "".concat(/* @echo VERSION */) || "*-dev";
51+
this.VERSION = "(dev)"/*build.replace:"pkg.version"*/;
5252

5353
/**
5454
* @type {number}
5555
*/
56-
this.RELEASE_NUMBER = parseInt("".concat(/* @echo RELEASE_NUMBER */)) || 0;
56+
this.RELEASE_NUMBER = 0/*build.replace:pkg.releaseNumber*/;
5757

5858
/**
5959
* @type {Array} of { function: function () {}, this: Object, args: Array }

webSource/js/TerminalLocalization.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -293,11 +293,11 @@ var TerminalLocalization = function (TERMINAL) {
293293
en: "Caché WEB Terminal v" + terminal.VERSION + "\r\nAuthor:\x1B[20GZitRo " +
294294
"(+NikitaSavchenko)\r\nProject:\x1B[20Ghttp://intersystems-ru.github.io/" +
295295
"webterminal\r\nRepository:\x1B[20Ghttps://github.com/intersystems-ru/" +
296-
"webterminal\r\n2013-2014 ©",
296+
"webterminal\r\n2013-2016 ©",
297297
ru: "Caché WEB Terminal v" + terminal.VERSION + "\r\nАвтор:\x1B[20GZitRo " +
298298
"(+NikitaSavchenko)\r\nПроект:\x1B[20Ghttp://intersystems-ru.github.io/" +
299299
"webterminal\r\nРепозиторий:\x1B[20Ghttps://github.com/intersystems-ru/" +
300-
"webterminal\r\n2013-2014 ©"
300+
"webterminal\r\n2013-2016 ©"
301301
},
302302
44: {
303303
en: "Syntax highlighting enabled.",

0 commit comments

Comments
 (0)