@qooxdoo/framework 7.5.0 → 7.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Manifest.json +1 -1
- package/bin/deploy/qx +7 -5
- package/lib/compiler/compile-info.json +75 -75
- package/lib/compiler/index.js +412 -393
- package/lib/resource/qx/tool/cli/templates/skeleton/desktop/source/class/custom/Application.tmpl.js +7 -7
- package/lib/resource/qx/tool/cli/templates/skeleton/desktop/source/class/custom/test/DemoTest.tmpl.js +10 -10
- package/lib/resource/qx/tool/cli/templates/skeleton/mobile/source/class/custom/Application.tmpl.js +6 -6
- package/lib/resource/qx/tool/cli/templates/skeleton/mobile/source/class/custom/page/Login.tmpl.js +9 -9
- package/lib/resource/qx/tool/cli/templates/skeleton/mobile/source/class/custom/page/Overview.tmpl.js +5 -5
- package/lib/resource/qx/tool/cli/templates/skeleton/package/source/class/custom/demo/Application.tmpl.js +7 -7
- package/lib/resource/qx/tool/cli/templates/skeleton/package/source/class/custom/test/DemoTest.tmpl.js +10 -10
- package/lib/resource/qx/tool/cli/templates/skeleton/server/source/class/custom/Application.tmpl.js +6 -6
- package/lib/resource/qx/tool/cli/templates/skeleton/server/source/class/custom/test/DemoTest.tmpl.js +12 -12
- package/lib/resource/qx/tool/website/src/about.md +1 -1
- package/package.json +2 -2
- package/source/class/qx/test/io/transport/Websocket.js +1 -1
- package/source/class/qx/theme/IndigoDark.js +1 -1
- package/source/class/qx/theme/indigo/DecorationDark.js +30 -0
- package/source/class/qx/tool/cli/Application.js +4 -1
- package/source/class/qx/tool/cli/Cli.js +22 -23
- package/source/class/qx/tool/cli/Watch.js +5 -6
- package/source/class/qx/tool/cli/commands/Compile.js +2 -1
- package/source/class/qx/tool/cli/commands/Lint.js +1 -1
- package/source/class/qx/tool/cli/commands/Run.js +6 -7
- package/source/class/qx/tool/cli/commands/Serve.js +29 -36
- package/source/class/qx/tool/cli/commands/Test.js +3 -2
- package/source/class/qx/tool/cli/commands/add/Script.js +3 -1
- package/source/class/qx/tool/cli/commands/package/Install.js +3 -0
- package/source/class/qx/tool/compiler/ClassFile.js +2 -1
- package/source/class/qx/tool/compiler/app/Cldr.js +63 -26
- package/source/class/qx/ui/basic/Image.js +6 -2
- package/source/class/qx/ui/core/Widget.js +13 -42
- package/source/resource/qx/mobile/scss/common/_gradients.scss +1 -1
- package/source/resource/qx/tool/cli/templates/skeleton/desktop/source/class/custom/Application.tmpl.js +7 -7
- package/source/resource/qx/tool/cli/templates/skeleton/desktop/source/class/custom/test/DemoTest.tmpl.js +10 -10
- package/source/resource/qx/tool/cli/templates/skeleton/mobile/source/class/custom/Application.tmpl.js +6 -6
- package/source/resource/qx/tool/cli/templates/skeleton/mobile/source/class/custom/page/Login.tmpl.js +9 -9
- package/source/resource/qx/tool/cli/templates/skeleton/mobile/source/class/custom/page/Overview.tmpl.js +5 -5
- package/source/resource/qx/tool/cli/templates/skeleton/package/source/class/custom/demo/Application.tmpl.js +7 -7
- package/source/resource/qx/tool/cli/templates/skeleton/package/source/class/custom/test/DemoTest.tmpl.js +10 -10
- package/source/resource/qx/tool/cli/templates/skeleton/server/source/class/custom/Application.tmpl.js +6 -6
- package/source/resource/qx/tool/cli/templates/skeleton/server/source/class/custom/test/DemoTest.tmpl.js +12 -12
- package/source/resource/qx/tool/website/src/about.md +1 -1
|
@@ -68,12 +68,12 @@ qx.Class.define("qx.tool.cli.commands.Run", {
|
|
|
68
68
|
let config = this.getCompilerApi().getConfiguration();
|
|
69
69
|
if (!config.run) {
|
|
70
70
|
qx.tool.compiler.Console.print("qx.tool.cli.run.noRunConfig");
|
|
71
|
-
process.exit(
|
|
71
|
+
process.exit(1);
|
|
72
72
|
}
|
|
73
73
|
|
|
74
74
|
if (!config.run.application) {
|
|
75
75
|
qx.tool.compiler.Console.print("qx.tool.cli.run.noAppName");
|
|
76
|
-
process.exit(
|
|
76
|
+
process.exit(1);
|
|
77
77
|
}
|
|
78
78
|
|
|
79
79
|
let maker = null;
|
|
@@ -85,14 +85,14 @@ qx.Class.define("qx.tool.cli.commands.Run", {
|
|
|
85
85
|
if (apps.length) {
|
|
86
86
|
if (maker) {
|
|
87
87
|
qx.tool.compiler.Console.print("qx.tool.cli.run.tooManyMakers");
|
|
88
|
-
process.exit(
|
|
88
|
+
process.exit(1);
|
|
89
89
|
}
|
|
90
90
|
if (apps.length != 1) {
|
|
91
91
|
qx.tool.compiler.Console.print(
|
|
92
92
|
"qx.tool.cli.run.tooManyApplications"
|
|
93
93
|
);
|
|
94
94
|
|
|
95
|
-
process.exit(
|
|
95
|
+
process.exit(1);
|
|
96
96
|
}
|
|
97
97
|
maker = tmp;
|
|
98
98
|
app = apps[0];
|
|
@@ -100,11 +100,11 @@ qx.Class.define("qx.tool.cli.commands.Run", {
|
|
|
100
100
|
});
|
|
101
101
|
if (!app) {
|
|
102
102
|
qx.tool.compiler.Console.print("qx.tool.cli.run.noAppName");
|
|
103
|
-
process.exit(
|
|
103
|
+
process.exit(1);
|
|
104
104
|
}
|
|
105
105
|
if (app.getType() != "node") {
|
|
106
106
|
qx.tool.compiler.Console.print("qx.tool.cli.run.mustBeNode");
|
|
107
|
-
process.exit(
|
|
107
|
+
process.exit(1);
|
|
108
108
|
}
|
|
109
109
|
|
|
110
110
|
let target = maker.getTarget();
|
|
@@ -150,7 +150,6 @@ qx.Class.define("qx.tool.cli.commands.Run", {
|
|
|
150
150
|
child.stdout.on("data", function (data) {
|
|
151
151
|
console.log(data);
|
|
152
152
|
});
|
|
153
|
-
|
|
154
153
|
child.stderr.setEncoding("utf8");
|
|
155
154
|
child.stderr.on("data", function (data) {
|
|
156
155
|
console.error(data);
|
|
@@ -90,9 +90,6 @@ qx.Class.define("qx.tool.cli.commands.Serve", {
|
|
|
90
90
|
},
|
|
91
91
|
|
|
92
92
|
members: {
|
|
93
|
-
/** @type {qx.tool.utils.Website} the Website instance */
|
|
94
|
-
_website: null,
|
|
95
|
-
|
|
96
93
|
/*
|
|
97
94
|
* @Override
|
|
98
95
|
*/
|
|
@@ -100,18 +97,19 @@ qx.Class.define("qx.tool.cli.commands.Serve", {
|
|
|
100
97
|
this.argv.watch = true;
|
|
101
98
|
this.argv["machine-readable"] = false;
|
|
102
99
|
this.argv["feedback"] = false;
|
|
103
|
-
await super.process();
|
|
104
100
|
|
|
105
101
|
// build website if it hasn't been built yet.
|
|
106
|
-
const website =
|
|
102
|
+
const website = new qx.tool.utils.Website();
|
|
107
103
|
if (!(await fs.existsAsync(website.getTargetDir()))) {
|
|
108
104
|
qx.tool.compiler.Console.info(">>> Building startpage...");
|
|
109
|
-
await
|
|
105
|
+
await website.rebuildAll();
|
|
110
106
|
} else if (this.argv.rebuildStartpage) {
|
|
111
|
-
|
|
107
|
+
website.startWatcher();
|
|
112
108
|
}
|
|
113
|
-
|
|
114
|
-
|
|
109
|
+
this.addListenerOnce("made", () => {
|
|
110
|
+
this.runWebServer();
|
|
111
|
+
});
|
|
112
|
+
return super.process();
|
|
115
113
|
},
|
|
116
114
|
|
|
117
115
|
/**
|
|
@@ -210,36 +208,31 @@ qx.Class.define("qx.tool.cli.commands.Serve", {
|
|
|
210
208
|
res.send(JSON.stringify(appsData, null, 2));
|
|
211
209
|
});
|
|
212
210
|
}
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
server.on("error", e => {
|
|
222
|
-
if (e.code === "EADDRINUSE") {
|
|
223
|
-
qx.tool.compiler.Console.print(
|
|
224
|
-
"qx.tool.cli.serve.webAddrInUse",
|
|
225
|
-
config.serve.listenPort
|
|
226
|
-
);
|
|
227
|
-
|
|
228
|
-
process.exit(-1);
|
|
229
|
-
} else {
|
|
230
|
-
qx.tool.compiler.Console.log(
|
|
231
|
-
"Error when starting web server: " + e
|
|
232
|
-
);
|
|
233
|
-
}
|
|
234
|
-
});
|
|
235
|
-
server.listen(config.serve.listenPort, () => {
|
|
211
|
+
let server = http.createServer(app);
|
|
212
|
+
this.fireDataEvent("beforeStart", {
|
|
213
|
+
server: server,
|
|
214
|
+
application: app,
|
|
215
|
+
outputdir: defaultMaker.getTarget().getOutputDir()
|
|
216
|
+
});
|
|
217
|
+
server.on("error", e => {
|
|
218
|
+
if (e.code === "EADDRINUSE") {
|
|
236
219
|
qx.tool.compiler.Console.print(
|
|
237
|
-
"qx.tool.cli.serve.
|
|
238
|
-
|
|
220
|
+
"qx.tool.cli.serve.webAddrInUse",
|
|
221
|
+
config.serve.listenPort
|
|
239
222
|
);
|
|
240
223
|
|
|
241
|
-
|
|
242
|
-
}
|
|
224
|
+
process.exit(1);
|
|
225
|
+
} else {
|
|
226
|
+
qx.tool.compiler.Console.log("Error when starting web server: " + e);
|
|
227
|
+
}
|
|
228
|
+
});
|
|
229
|
+
server.listen(config.serve.listenPort, () => {
|
|
230
|
+
qx.tool.compiler.Console.print(
|
|
231
|
+
"qx.tool.cli.serve.webStarted",
|
|
232
|
+
"http://localhost:" + config.serve.listenPort
|
|
233
|
+
);
|
|
234
|
+
|
|
235
|
+
this.fireEvent("afterStart");
|
|
243
236
|
});
|
|
244
237
|
},
|
|
245
238
|
|
|
@@ -188,7 +188,7 @@ qx.Class.define("qx.tool.cli.commands.Test", {
|
|
|
188
188
|
See documentation at https://qooxdoo.org/docs/#/development/testing/`
|
|
189
189
|
);
|
|
190
190
|
|
|
191
|
-
process.exit(
|
|
191
|
+
process.exit(1);
|
|
192
192
|
}
|
|
193
193
|
});
|
|
194
194
|
|
|
@@ -206,6 +206,7 @@ qx.Class.define("qx.tool.cli.commands.Test", {
|
|
|
206
206
|
await test.execute();
|
|
207
207
|
}
|
|
208
208
|
// for bash exitcode is not allowed to be more then 255!
|
|
209
|
+
// We must exit the process here because serve runs infinite!
|
|
209
210
|
process.exit(Math.min(255, this.getExitCode()));
|
|
210
211
|
});
|
|
211
212
|
|
|
@@ -216,7 +217,7 @@ qx.Class.define("qx.tool.cli.commands.Test", {
|
|
|
216
217
|
// compile only
|
|
217
218
|
await qx.tool.cli.commands.Compile.prototype.process.call(this);
|
|
218
219
|
// since the server is not started, manually fire the event necessary for firing the "runTests" event
|
|
219
|
-
this.
|
|
220
|
+
await this.fireDataEventAsync("afterStart");
|
|
220
221
|
}
|
|
221
222
|
},
|
|
222
223
|
|
|
@@ -140,7 +140,9 @@ qx.Class.define("qx.tool.cli.commands.add.Script", {
|
|
|
140
140
|
}
|
|
141
141
|
// save
|
|
142
142
|
this.debug(script_list);
|
|
143
|
-
manifestModel
|
|
143
|
+
await manifestModel
|
|
144
|
+
.setValue("externalResources.script", script_list)
|
|
145
|
+
.save();
|
|
144
146
|
}
|
|
145
147
|
}
|
|
146
148
|
});
|
|
@@ -677,6 +677,9 @@ qx.Class.define("qx.tool.cli.commands.package.Install", {
|
|
|
677
677
|
|
|
678
678
|
return false;
|
|
679
679
|
}
|
|
680
|
+
// relaod config. We need a fresh model here because data will be verified.
|
|
681
|
+
// The original model is enriched during parsing so validate will fail.
|
|
682
|
+
compileConfigModel.setLoaded(false);
|
|
680
683
|
await compileConfigModel.load();
|
|
681
684
|
let app = compileConfigModel.getValue("applications").find(app => {
|
|
682
685
|
if (manifestApp.name && app.name) {
|
|
@@ -854,7 +854,8 @@ qx.Class.define("qx.tool.compiler.ClassFile", {
|
|
|
854
854
|
if (sectionName === "members" || sectionName === "statics") {
|
|
855
855
|
if (
|
|
856
856
|
node.type == "ObjectMethod" ||
|
|
857
|
-
node.value.type === "FunctionExpression"
|
|
857
|
+
node.value.type === "FunctionExpression" ||
|
|
858
|
+
node.value.type === "MemberExpression"
|
|
858
859
|
) {
|
|
859
860
|
meta.type = "function";
|
|
860
861
|
} else {
|
|
@@ -28,7 +28,9 @@ var path = require("path");
|
|
|
28
28
|
var xml2js = require("xml2js");
|
|
29
29
|
const CLDR = require("cldr");
|
|
30
30
|
const { promisify } = require("util");
|
|
31
|
+
const process = require("process");
|
|
31
32
|
const readFile = promisify(fs.readFile);
|
|
33
|
+
const readDir = promisify(fs.readdir);
|
|
32
34
|
|
|
33
35
|
var log = qx.tool.utils.LogManager.createLog("cldr");
|
|
34
36
|
|
|
@@ -59,9 +61,39 @@ qx.Class.define("qx.tool.compiler.app.Cldr", {
|
|
|
59
61
|
}
|
|
60
62
|
log.debug("Loading CLDR " + cldrPath);
|
|
61
63
|
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
64
|
+
const fullDir = path.join(cldrPath, data_path);
|
|
65
|
+
|
|
66
|
+
return readDir(fullDir)
|
|
67
|
+
.then(
|
|
68
|
+
names =>
|
|
69
|
+
new Promise((resolve, reject) => {
|
|
70
|
+
const searchedName = locale.toLowerCase() + ".xml";
|
|
71
|
+
const realName = names.find(
|
|
72
|
+
name => name.toLowerCase() === searchedName
|
|
73
|
+
);
|
|
74
|
+
|
|
75
|
+
if (realName) {
|
|
76
|
+
resolve(realName);
|
|
77
|
+
} else {
|
|
78
|
+
reject(
|
|
79
|
+
new Error(
|
|
80
|
+
'Cannot find XML file for locale "' +
|
|
81
|
+
locale +
|
|
82
|
+
'" in CLDR folder'
|
|
83
|
+
)
|
|
84
|
+
);
|
|
85
|
+
}
|
|
86
|
+
})
|
|
87
|
+
)
|
|
88
|
+
.then(fileName =>
|
|
89
|
+
readFile(path.join(fullDir, fileName), {
|
|
90
|
+
encoding: "utf-8"
|
|
91
|
+
})
|
|
92
|
+
)
|
|
93
|
+
.catch(err => {
|
|
94
|
+
qx.tool.compiler.Console.error(err);
|
|
95
|
+
process.exit(1);
|
|
96
|
+
})
|
|
65
97
|
.then(data =>
|
|
66
98
|
qx.tool.utils.Utils.promisifyThis(parser.parseString, parser, data)
|
|
67
99
|
)
|
|
@@ -564,30 +596,35 @@ qx.Class.define("qx.tool.compiler.app.Cldr", {
|
|
|
564
596
|
});
|
|
565
597
|
|
|
566
598
|
var monthContext = get("months[0].monthContext", cal);
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
cldr["cldr_month_format_abbreviated_" + m["$"].type] =
|
|
572
|
-
getText(m);
|
|
573
|
-
}
|
|
574
|
-
});
|
|
575
|
-
});
|
|
576
|
-
find(monthContext, "type", "format", function (row) {
|
|
577
|
-
find(row.monthWidth, "type", "wide", function (row) {
|
|
578
|
-
for (var i = 0; i < row.month.length; i++) {
|
|
579
|
-
var m = row.month[i];
|
|
580
|
-
cldr["cldr_month_format_wide_" + m["$"].type] = getText(m);
|
|
581
|
-
}
|
|
582
|
-
});
|
|
583
|
-
});
|
|
584
|
-
find(monthContext, "type", "stand-alone", function (row) {
|
|
585
|
-
for (var i = 0; i < row.monthWidth[0].month.length; i++) {
|
|
586
|
-
var m = row.monthWidth[0].month[i];
|
|
587
|
-
cldr["cldr_month_stand-alone_narrow_" + m["$"].type] =
|
|
588
|
-
getText(m);
|
|
599
|
+
|
|
600
|
+
const parseMonth = (months, cldrProperty) => {
|
|
601
|
+
if (!months) {
|
|
602
|
+
return;
|
|
589
603
|
}
|
|
590
|
-
|
|
604
|
+
months.forEach(month => {
|
|
605
|
+
cldr[cldrProperty + "_" + month["$"].type] = getText(month);
|
|
606
|
+
});
|
|
607
|
+
};
|
|
608
|
+
|
|
609
|
+
const parseMonthContext = sectionNameInLocaleFile => {
|
|
610
|
+
find(monthContext, "type", "format", row =>
|
|
611
|
+
find(row.monthWidth, "type", sectionNameInLocaleFile, row =>
|
|
612
|
+
parseMonth(
|
|
613
|
+
row.month,
|
|
614
|
+
"cldr_month_format_" + sectionNameInLocaleFile
|
|
615
|
+
)
|
|
616
|
+
)
|
|
617
|
+
);
|
|
618
|
+
};
|
|
619
|
+
|
|
620
|
+
parseMonthContext("abbreviated");
|
|
621
|
+
parseMonthContext("wide");
|
|
622
|
+
find(monthContext, "type", "stand-alone", row =>
|
|
623
|
+
parseMonth(
|
|
624
|
+
row.monthWidth[0].month,
|
|
625
|
+
"cldr_month_stand-alone_narrow"
|
|
626
|
+
)
|
|
627
|
+
);
|
|
591
628
|
|
|
592
629
|
function getTimeFormatPattern(row) {
|
|
593
630
|
return row.timeFormat.pattern;
|
|
@@ -634,7 +634,8 @@ qx.Class.define("qx.ui.basic.Image", {
|
|
|
634
634
|
}
|
|
635
635
|
|
|
636
636
|
// Don't transfer background image when switching from image to icon font
|
|
637
|
-
|
|
637
|
+
var mode = this.__getMode();
|
|
638
|
+
if (mode === "font" || mode === "scaled") {
|
|
638
639
|
delete styles.backgroundImage;
|
|
639
640
|
}
|
|
640
641
|
|
|
@@ -785,7 +786,10 @@ qx.Class.define("qx.ui.basic.Image", {
|
|
|
785
786
|
if (this.getScale()) {
|
|
786
787
|
el.setStyle("fontSize", (width > height ? height : width) + "px");
|
|
787
788
|
} else {
|
|
788
|
-
var source = qx.util.AliasManager.getInstance().resolve(
|
|
789
|
+
var source = qx.util.AliasManager.getInstance().resolve(
|
|
790
|
+
this.getSource()
|
|
791
|
+
);
|
|
792
|
+
|
|
789
793
|
var sparts = source.split("/");
|
|
790
794
|
var font = this.__getFont(source);
|
|
791
795
|
var size = parseInt(sparts[2] || font.getSize());
|
|
@@ -2122,24 +2122,17 @@ qx.Class.define("qx.ui.core.Widget", {
|
|
|
2122
2122
|
// property apply
|
|
2123
2123
|
_applyTextColor(value, old) {
|
|
2124
2124
|
// empty template
|
|
2125
|
-
},
|
|
2126
|
-
|
|
2127
|
-
// property apply
|
|
2125
|
+
}, // property apply
|
|
2128
2126
|
_applyZIndex(value, old) {
|
|
2129
2127
|
this.getContentElement().setStyle("zIndex", value == null ? 0 : value);
|
|
2130
|
-
},
|
|
2131
|
-
|
|
2132
|
-
// property apply
|
|
2128
|
+
}, // property apply
|
|
2133
2129
|
_applyVisibility(value, old) {
|
|
2134
2130
|
var content = this.getContentElement();
|
|
2135
|
-
|
|
2136
2131
|
if (value === "visible") {
|
|
2137
2132
|
content.show();
|
|
2138
2133
|
} else {
|
|
2139
2134
|
content.hide();
|
|
2140
|
-
}
|
|
2141
|
-
|
|
2142
|
-
// only force a layout update if visibility change from/to "exclude"
|
|
2135
|
+
} // only force a layout update if visibility change from/to "exclude"
|
|
2143
2136
|
var parent = this.$$parent;
|
|
2144
2137
|
if (
|
|
2145
2138
|
parent &&
|
|
@@ -2187,31 +2180,19 @@ qx.Class.define("qx.ui.core.Widget", {
|
|
|
2187
2180
|
// property apply
|
|
2188
2181
|
_applyFont(value, old) {
|
|
2189
2182
|
// empty template
|
|
2190
|
-
},
|
|
2191
|
-
|
|
2192
|
-
|
|
2193
|
-
---------------------------------------------------------------------------
|
|
2194
|
-
DYNAMIC THEME SWITCH SUPPORT
|
|
2195
|
-
---------------------------------------------------------------------------
|
|
2196
|
-
*/
|
|
2197
|
-
|
|
2183
|
+
}, // ---------------------------------------------------------------------------
|
|
2184
|
+
// DYNAMIC THEME SWITCH SUPPORT
|
|
2185
|
+
// ---------------------------------------------------------------------------
|
|
2198
2186
|
// overridden
|
|
2199
2187
|
_onChangeTheme() {
|
|
2200
2188
|
if (this.isDisposed()) {
|
|
2201
2189
|
return;
|
|
2202
2190
|
}
|
|
2203
|
-
|
|
2204
|
-
|
|
2205
|
-
|
|
2206
|
-
// update the appearance
|
|
2207
|
-
this.updateAppearance();
|
|
2208
|
-
|
|
2209
|
-
// DECORATOR //
|
|
2191
|
+
super._onChangeTheme(); // update the appearance
|
|
2192
|
+
this.updateAppearance(); // DECORATOR //
|
|
2210
2193
|
var value = this.getDecorator();
|
|
2211
2194
|
this._applyDecorator(null, value);
|
|
2212
|
-
this._applyDecorator(value);
|
|
2213
|
-
|
|
2214
|
-
// FONT //
|
|
2195
|
+
this._applyDecorator(value); // FONT //
|
|
2215
2196
|
value = this.getFont();
|
|
2216
2197
|
if (qx.lang.Type.isString(value)) {
|
|
2217
2198
|
this._applyFont(value, value);
|
|
@@ -2561,30 +2542,24 @@ qx.Class.define("qx.ui.core.Widget", {
|
|
|
2561
2542
|
syncWidget(jobs) {
|
|
2562
2543
|
// empty implementation
|
|
2563
2544
|
},
|
|
2564
|
-
|
|
2565
2545
|
/*
|
|
2566
2546
|
---------------------------------------------------------------------------
|
|
2567
|
-
|
|
2547
|
+
EVENT SUPPORT
|
|
2568
2548
|
---------------------------------------------------------------------------
|
|
2569
|
-
*/
|
|
2570
|
-
|
|
2571
|
-
/**
|
|
2549
|
+
*/ /**
|
|
2572
2550
|
* Returns the next event target in the parent chain. May
|
|
2573
2551
|
* also return the widget itself if it is not anonymous.
|
|
2574
2552
|
*
|
|
2575
2553
|
* @return {qx.ui.core.Widget} A working event target of this widget.
|
|
2576
2554
|
* May be <code>null</code> as well.
|
|
2577
|
-
*/
|
|
2578
|
-
getEventTarget() {
|
|
2555
|
+
*/ getEventTarget() {
|
|
2579
2556
|
var target = this;
|
|
2580
|
-
|
|
2581
2557
|
while (target.getAnonymous()) {
|
|
2582
2558
|
target = target.getLayoutParent();
|
|
2583
2559
|
if (!target) {
|
|
2584
2560
|
return null;
|
|
2585
2561
|
}
|
|
2586
2562
|
}
|
|
2587
|
-
|
|
2588
2563
|
return target;
|
|
2589
2564
|
},
|
|
2590
2565
|
|
|
@@ -2751,17 +2726,13 @@ qx.Class.define("qx.ui.core.Widget", {
|
|
|
2751
2726
|
// property apply
|
|
2752
2727
|
_applyNativeContextMenu(value, old, name) {
|
|
2753
2728
|
// empty body to allow overriding
|
|
2754
|
-
},
|
|
2755
|
-
|
|
2756
|
-
// property apply
|
|
2729
|
+
}, // property apply
|
|
2757
2730
|
_applyContextMenu(value, old) {
|
|
2758
2731
|
if (old) {
|
|
2759
2732
|
old.removeState("contextmenu");
|
|
2760
|
-
|
|
2761
2733
|
if (old.getOpener() == this) {
|
|
2762
2734
|
old.resetOpener();
|
|
2763
2735
|
}
|
|
2764
|
-
|
|
2765
2736
|
if (!value) {
|
|
2766
2737
|
this.removeListener("contextmenu", this._onContextMenuOpen);
|
|
2767
2738
|
this.removeListener("longtap", this._onContextMenuOpen);
|
|
@@ -28,15 +28,15 @@ qx.Class.define("${namespace}.Application",
|
|
|
28
28
|
members :
|
|
29
29
|
{
|
|
30
30
|
/**
|
|
31
|
-
* This method contains the initial application code and gets called
|
|
31
|
+
* This method contains the initial application code and gets called
|
|
32
32
|
* during startup of the application
|
|
33
|
-
*
|
|
33
|
+
*
|
|
34
34
|
* @lint ignoreDeprecated(alert)
|
|
35
35
|
*/
|
|
36
|
-
main
|
|
36
|
+
main()
|
|
37
37
|
{
|
|
38
38
|
// Call super class
|
|
39
|
-
|
|
39
|
+
super.main();
|
|
40
40
|
|
|
41
41
|
// Enable logging in debug variant
|
|
42
42
|
if (qx.core.Environment.get("qx.debug"))
|
|
@@ -54,10 +54,10 @@ qx.Class.define("${namespace}.Application",
|
|
|
54
54
|
*/
|
|
55
55
|
|
|
56
56
|
// Create a button
|
|
57
|
-
|
|
57
|
+
const button1 = new qx.ui.form.Button("Click me", "${namespace_as_path}/test.png");
|
|
58
58
|
|
|
59
59
|
// Document is the application root
|
|
60
|
-
|
|
60
|
+
const doc = this.getRoot();
|
|
61
61
|
|
|
62
62
|
// Add button to document at fixed coordinates
|
|
63
63
|
doc.add(button1, {left: 100, top: 50});
|
|
@@ -69,4 +69,4 @@ qx.Class.define("${namespace}.Application",
|
|
|
69
69
|
});
|
|
70
70
|
}
|
|
71
71
|
}
|
|
72
|
-
});
|
|
72
|
+
});
|
|
@@ -11,13 +11,13 @@
|
|
|
11
11
|
/**
|
|
12
12
|
* This class demonstrates how to define unit tests for your application.
|
|
13
13
|
*
|
|
14
|
-
* Execute <code>qx test</code> to generate a testrunner application
|
|
14
|
+
* Execute <code>qx test</code> to generate a testrunner application
|
|
15
15
|
* and open it from <tt>test/index.html</tt>
|
|
16
16
|
*
|
|
17
|
-
* The methods that contain the tests are instance methods with a
|
|
18
|
-
* <code>test</code> prefix. You can create an arbitrary number of test
|
|
19
|
-
* classes like this one. They can be organized in a regular class hierarchy,
|
|
20
|
-
* i.e. using deeper namespaces and a corresponding file structure within the
|
|
17
|
+
* The methods that contain the tests are instance methods with a
|
|
18
|
+
* <code>test</code> prefix. You can create an arbitrary number of test
|
|
19
|
+
* classes like this one. They can be organized in a regular class hierarchy,
|
|
20
|
+
* i.e. using deeper namespaces and a corresponding file structure within the
|
|
21
21
|
* <tt>test</tt> folder.
|
|
22
22
|
*/
|
|
23
23
|
qx.Class.define("${namespace}.test.DemoTest",
|
|
@@ -31,11 +31,11 @@ qx.Class.define("${namespace}.test.DemoTest",
|
|
|
31
31
|
TESTS
|
|
32
32
|
---------------------------------------------------------------------------
|
|
33
33
|
*/
|
|
34
|
-
|
|
34
|
+
|
|
35
35
|
/**
|
|
36
36
|
* Here are some simple tests
|
|
37
37
|
*/
|
|
38
|
-
testSimple
|
|
38
|
+
testSimple()
|
|
39
39
|
{
|
|
40
40
|
this.assertEquals(4, 3+1, "This should never fail!");
|
|
41
41
|
this.assertFalse(false, "Can false be true?!");
|
|
@@ -44,10 +44,10 @@ qx.Class.define("${namespace}.test.DemoTest",
|
|
|
44
44
|
/**
|
|
45
45
|
* Here are some more advanced tests
|
|
46
46
|
*/
|
|
47
|
-
testAdvanced
|
|
47
|
+
testAdvanced()
|
|
48
48
|
{
|
|
49
|
-
|
|
50
|
-
|
|
49
|
+
let a = 3;
|
|
50
|
+
let b = a;
|
|
51
51
|
this.assertIdentical(a, b, "A rose by any other name is still a rose");
|
|
52
52
|
this.assertInRange(3, 1, 10, "You must be kidding, 3 can never be outside [1,10]!");
|
|
53
53
|
}
|
|
@@ -25,10 +25,10 @@ qx.Class.define("${namespace}.Application",
|
|
|
25
25
|
* This method contains the initial application code and gets called
|
|
26
26
|
* during startup of the application
|
|
27
27
|
*/
|
|
28
|
-
main
|
|
28
|
+
main()
|
|
29
29
|
{
|
|
30
30
|
// Call super class
|
|
31
|
-
|
|
31
|
+
super.main();
|
|
32
32
|
|
|
33
33
|
// Enable logging in debug variant
|
|
34
34
|
if (qx.core.Environment.get("qx.debug"))
|
|
@@ -47,11 +47,11 @@ qx.Class.define("${namespace}.Application",
|
|
|
47
47
|
-------------------------------------------------------------------------
|
|
48
48
|
*/
|
|
49
49
|
|
|
50
|
-
|
|
51
|
-
|
|
50
|
+
const login = new ${namespace}.page.Login();
|
|
51
|
+
const overview = new ${namespace}.page.Overview();
|
|
52
52
|
|
|
53
53
|
// Add the pages to the page manager.
|
|
54
|
-
|
|
54
|
+
const manager = new qx.ui.mobile.page.Manager(false);
|
|
55
55
|
manager.addDetail([
|
|
56
56
|
login,
|
|
57
57
|
overview
|
|
@@ -69,7 +69,7 @@ qx.Class.define("${namespace}.Application",
|
|
|
69
69
|
* Default behaviour when a route matches. Displays the corresponding page on screen.
|
|
70
70
|
* @param data {Map} the animation properties
|
|
71
71
|
*/
|
|
72
|
-
_show
|
|
72
|
+
_show(data) {
|
|
73
73
|
this.show(data.customData);
|
|
74
74
|
}
|
|
75
75
|
}
|
package/source/resource/qx/tool/cli/templates/skeleton/mobile/source/class/custom/page/Login.tmpl.js
CHANGED
|
@@ -15,9 +15,9 @@ qx.Class.define("${namespace}.page.Login",
|
|
|
15
15
|
{
|
|
16
16
|
extend : qx.ui.mobile.page.NavigationPage,
|
|
17
17
|
|
|
18
|
-
construct
|
|
18
|
+
construct()
|
|
19
19
|
{
|
|
20
|
-
|
|
20
|
+
super();
|
|
21
21
|
this.setTitle("Login");
|
|
22
22
|
},
|
|
23
23
|
|
|
@@ -28,22 +28,22 @@ qx.Class.define("${namespace}.page.Login",
|
|
|
28
28
|
|
|
29
29
|
|
|
30
30
|
// overridden
|
|
31
|
-
_initialize
|
|
32
|
-
|
|
31
|
+
_initialize() {
|
|
32
|
+
super._initialize();
|
|
33
33
|
|
|
34
34
|
// Username
|
|
35
|
-
|
|
35
|
+
const user = new qx.ui.mobile.form.TextField();
|
|
36
36
|
user.setRequired(true);
|
|
37
37
|
|
|
38
38
|
// Password
|
|
39
|
-
|
|
39
|
+
const pwd = new qx.ui.mobile.form.PasswordField();
|
|
40
40
|
pwd.setRequired(true);
|
|
41
41
|
|
|
42
42
|
// Login Button
|
|
43
|
-
|
|
43
|
+
const loginButton = new qx.ui.mobile.form.Button("Login");
|
|
44
44
|
loginButton.addListener("tap", this._onButtonTap, this);
|
|
45
45
|
|
|
46
|
-
|
|
46
|
+
const loginForm = this.__form = new qx.ui.mobile.form.Form();
|
|
47
47
|
loginForm.add(user, "Username");
|
|
48
48
|
loginForm.add(pwd, "Password");
|
|
49
49
|
|
|
@@ -56,7 +56,7 @@ qx.Class.define("${namespace}.page.Login",
|
|
|
56
56
|
/**
|
|
57
57
|
* Event handler for <code>tap</code> on the login button.
|
|
58
58
|
*/
|
|
59
|
-
_onButtonTap
|
|
59
|
+
_onButtonTap() {
|
|
60
60
|
// use form validation
|
|
61
61
|
if (this.__form.validate()) {
|
|
62
62
|
qx.core.Init.getApplication().getRouting().executeGet("/overview");
|
|
@@ -15,9 +15,9 @@ qx.Class.define("${namespace}.page.Overview",
|
|
|
15
15
|
{
|
|
16
16
|
extend : qx.ui.mobile.page.NavigationPage,
|
|
17
17
|
|
|
18
|
-
construct
|
|
18
|
+
construct()
|
|
19
19
|
{
|
|
20
|
-
|
|
20
|
+
super();
|
|
21
21
|
this.setTitle("Overview");
|
|
22
22
|
this.setShowBackButton(true);
|
|
23
23
|
this.setBackButtonText("Back");
|
|
@@ -27,16 +27,16 @@ qx.Class.define("${namespace}.page.Overview",
|
|
|
27
27
|
members :
|
|
28
28
|
{
|
|
29
29
|
// overridden
|
|
30
|
-
_initialize
|
|
30
|
+
_initialize()
|
|
31
31
|
{
|
|
32
|
-
|
|
32
|
+
super._initialize(arguments);
|
|
33
33
|
|
|
34
34
|
this.getContent().add(new qx.ui.mobile.basic.Label("Your first app."));
|
|
35
35
|
},
|
|
36
36
|
|
|
37
37
|
|
|
38
38
|
// overridden
|
|
39
|
-
_back
|
|
39
|
+
_back(triggeredByKeyEvent)
|
|
40
40
|
{
|
|
41
41
|
qx.core.Init.getApplication().getRouting().back();
|
|
42
42
|
}
|