projects
/
pwl6.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
iojs adds Math.sign, still lacks Object.assign.
[pwl6.git]
/
src
/
yuu
/
core.js
diff --git
a/src/yuu/core.js
b/src/yuu/core.js
index
25d3ed2
..
d34d201
100644
(file)
--- a/
src/yuu/core.js
+++ b/
src/yuu/core.js
@@
-7,13
+7,12
@@
(function (yuu) {
"use strict";
(function (yuu) {
"use strict";
-
yuu.require = function (m) {
try { return require(m); }
catch (exc) { return null; }
};
yuu.require = function (m) {
try { return require(m); }
catch (exc) { return null; }
};
- if (!
Math.
sign)
+ if (!
Object.as
sign)
require("./pre");
var yT = this.yT || require("./yT");
require("./pre");
var yT = this.yT || require("./yT");
@@
-70,6
+69,9
@@
/** Initialize Yuu and call all registered hooks
*/
/** Initialize Yuu and call all registered hooks
*/
+ document.body.className += (navigator.standalone || gui)
+ ? " standalone" : " browser";
+
if (gui) {
var win = gui.Window.get();
var nativeMenuBar = new gui.Menu({ type: "menubar" });
if (gui) {
var win = gui.Window.get();
var nativeMenuBar = new gui.Menu({ type: "menubar" });
@@
-89,6
+91,14
@@
wkdoc.hidden = false;
wkdoc.dispatchEvent(ev);
});
wkdoc.hidden = false;
wkdoc.dispatchEvent(ev);
});
+ win.on('new-win-policy', function (frame, url, policy) {
+ if (url.startsWith('chrome')) {
+ policy.forceNewPopup();
+ } else {
+ policy.ignore();
+ gui.Shell.openExternal(url);
+ }
+ });
}
return new Promise(function (resolve) {
}
return new Promise(function (resolve) {
@@
-145,7
+155,7
@@
req[k] = params[k];
req.onload = function () {
var status = this.status;
req[k] = params[k];
req.onload = function () {
var status = this.status;
- // status === 0 is given by
node-webkit
for success.
+ // status === 0 is given by
NW.js
for success.
if ((status >= 200 && status < 300) || status === 0)
resolve(this.response);
else
if ((status >= 200 && status < 300) || status === 0)
resolve(this.response);
else