@breakside/jskit 2025.8.0 → 2025.10.0
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/Frameworks/DOM.jsframework/Info.json +2 -2
- package/Frameworks/DOM.jsframework/io.breakside.JSKit.DOM-bundle.js +2 -2
- package/Frameworks/FontKit.jsframework/Info.json +2 -2
- package/Frameworks/FontKit.jsframework/io.breakside.JSKit.FontKit-bundle.js +2 -2
- package/Frameworks/Foundation.jsframework/Info.json +2 -2
- package/Frameworks/Foundation.jsframework/JS/JSAttributedString.js +6 -0
- package/Frameworks/Foundation.jsframework/io.breakside.JSKit.Foundation-bundle.js +2 -2
- package/Frameworks/SecurityKit.jsframework/Info.json +2 -2
- package/Frameworks/SecurityKit.jsframework/io.breakside.JSKit.SecurityKit-bundle.js +2 -2
- package/Info.json +2 -2
- package/Node/io.breakside.jskit-bundle.js +2 -2
- package/Root/Frameworks/APIKit/Info.yaml +1 -1
- package/Root/Frameworks/APIKitTesting/Info.yaml +1 -1
- package/Root/Frameworks/AuthKit/Info.yaml +1 -1
- package/Root/Frameworks/CSSOM/Info.yaml +1 -1
- package/Root/Frameworks/ChartKit/Info.yaml +1 -1
- package/Root/Frameworks/ConferenceKit/Info.yaml +1 -1
- package/Root/Frameworks/DBKit/Info.yaml +1 -1
- package/Root/Frameworks/DOM/Info.yaml +1 -1
- package/Root/Frameworks/Dispatch/Info.yaml +1 -1
- package/Root/Frameworks/FontKit/Info.yaml +1 -1
- package/Root/Frameworks/Foundation/Info.yaml +1 -1
- package/Root/Frameworks/Foundation/JSAttributedString.js +6 -0
- package/Root/Frameworks/ImageKit/Info.yaml +1 -1
- package/Root/Frameworks/MediaKit/Info.yaml +1 -1
- package/Root/Frameworks/MediaKitUI/Info.yaml +1 -1
- package/Root/Frameworks/NotificationKit/Info.yaml +1 -1
- package/Root/Frameworks/PDFKit/Info.yaml +1 -1
- package/Root/Frameworks/QRKit/Info.yaml +1 -1
- package/Root/Frameworks/SearchKit/Info.yaml +1 -1
- package/Root/Frameworks/SecurityKit/Info.yaml +1 -1
- package/Root/Frameworks/ServerKit/Info.yaml +1 -1
- package/Root/Frameworks/ServerKitTesting/Info.yaml +1 -1
- package/Root/Frameworks/TestKit/Info.yaml +1 -1
- package/Root/Frameworks/UIKit/Info.yaml +1 -1
- package/Root/Frameworks/UIKit/UIAnimationTransaction.js +5 -4
- package/Root/Frameworks/UIKit/UIApplication.js +1 -1
- package/Root/Frameworks/UIKit/UIHTMLApplication.js +8 -4
- package/Root/Frameworks/UIKit/UIHTMLContentEditableTextInputManager.js +23 -15
- package/Root/Frameworks/UIKit/UIHTMLOpenPanel.js +19 -4
- package/Root/Frameworks/UIKit/UIHTMLWindowServer.js +49 -2
- package/Root/Frameworks/UIKit/UIListView.js +1 -1
- package/Root/Frameworks/UIKit/UIPopupWindow.js +1 -20
- package/Root/Frameworks/UIKit/UITextEditor.js +6 -0
- package/Root/Frameworks/UIKit/UITextField.js +3 -1
- package/Root/Frameworks/UIKit/UIWindow.js +3 -0
- package/Root/Frameworks/UIKitTesting/Info.yaml +1 -1
- package/Root/Templates/html/${PROJECT_NAME}/www/HTMLAppBootstrapper.js +198 -89
- package/Root/Templates/html/${PROJECT_NAME}/www/index.html +1 -10
- package/package.json +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"JSBundleType": "framework",
|
|
3
3
|
"JSBundleIdentifier": "io.breakside.JSKit.DOM",
|
|
4
|
-
"JSBundleVersion": "2025.
|
|
4
|
+
"JSBundleVersion": "2025.10.0",
|
|
5
5
|
"JSDevelopmentLanguage": "en",
|
|
6
6
|
"JSCopyright": "Copyright © 2020 Breakside Inc.",
|
|
7
7
|
"JSBundleEnvironments": {
|
|
@@ -9,5 +9,5 @@
|
|
|
9
9
|
"node": "DOM+Node.js"
|
|
10
10
|
},
|
|
11
11
|
"JSLicenseNotice": "Licensed under the Breakside Public License, Version 1.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nIf a copy of the License was not distributed with this file, you may\nobtain a copy at\n\n http://breakside.io/licenses/LICENSE-1.0.txt\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n",
|
|
12
|
-
"GitRevision": "
|
|
12
|
+
"GitRevision": "5812a1dd94c9bf9b769a5911e6de85e02afbef0a"
|
|
13
13
|
}
|
|
@@ -3,7 +3,7 @@ JSBundle.bundles['io.breakside.JSKit.DOM'] = {
|
|
|
3
3
|
"Info": {
|
|
4
4
|
"JSBundleType": "framework",
|
|
5
5
|
"JSBundleIdentifier": "io.breakside.JSKit.DOM",
|
|
6
|
-
"JSBundleVersion": "2025.
|
|
6
|
+
"JSBundleVersion": "2025.10.0",
|
|
7
7
|
"JSDevelopmentLanguage": "en",
|
|
8
8
|
"JSCopyright": "Copyright © 2020 Breakside Inc.",
|
|
9
9
|
"JSBundleEnvironments": {
|
|
@@ -11,7 +11,7 @@ JSBundle.bundles['io.breakside.JSKit.DOM'] = {
|
|
|
11
11
|
"node": "DOM+Node.js"
|
|
12
12
|
},
|
|
13
13
|
"JSLicenseNotice": "Licensed under the Breakside Public License, Version 1.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nIf a copy of the License was not distributed with this file, you may\nobtain a copy at\n\n http://breakside.io/licenses/LICENSE-1.0.txt\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n",
|
|
14
|
-
"GitRevision": "
|
|
14
|
+
"GitRevision": "5812a1dd94c9bf9b769a5911e6de85e02afbef0a"
|
|
15
15
|
},
|
|
16
16
|
"Resources": [],
|
|
17
17
|
"ResourceLookup": {
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"JSBundleType": "framework",
|
|
3
3
|
"JSBundleIdentifier": "io.breakside.JSKit.FontKit",
|
|
4
|
-
"JSBundleVersion": "2025.
|
|
4
|
+
"JSBundleVersion": "2025.10.0",
|
|
5
5
|
"JSDevelopmentLanguage": "en",
|
|
6
6
|
"JSCopyright": "Copyright © 2020 Breakside Inc.",
|
|
7
7
|
"JSBundleEnvironments": {
|
|
8
8
|
"html": "FontKit+HTML.js"
|
|
9
9
|
},
|
|
10
10
|
"JSLicenseNotice": "Licensed under the Breakside Public License, Version 1.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nIf a copy of the License was not distributed with this file, you may\nobtain a copy at\n\n http://breakside.io/licenses/LICENSE-1.0.txt\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n",
|
|
11
|
-
"GitRevision": "
|
|
11
|
+
"GitRevision": "5812a1dd94c9bf9b769a5911e6de85e02afbef0a"
|
|
12
12
|
}
|
|
@@ -3,14 +3,14 @@ JSBundle.bundles['io.breakside.JSKit.FontKit'] = {
|
|
|
3
3
|
"Info": {
|
|
4
4
|
"JSBundleType": "framework",
|
|
5
5
|
"JSBundleIdentifier": "io.breakside.JSKit.FontKit",
|
|
6
|
-
"JSBundleVersion": "2025.
|
|
6
|
+
"JSBundleVersion": "2025.10.0",
|
|
7
7
|
"JSDevelopmentLanguage": "en",
|
|
8
8
|
"JSCopyright": "Copyright © 2020 Breakside Inc.",
|
|
9
9
|
"JSBundleEnvironments": {
|
|
10
10
|
"html": "FontKit+HTML.js"
|
|
11
11
|
},
|
|
12
12
|
"JSLicenseNotice": "Licensed under the Breakside Public License, Version 1.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nIf a copy of the License was not distributed with this file, you may\nobtain a copy at\n\n http://breakside.io/licenses/LICENSE-1.0.txt\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n",
|
|
13
|
-
"GitRevision": "
|
|
13
|
+
"GitRevision": "5812a1dd94c9bf9b769a5911e6de85e02afbef0a"
|
|
14
14
|
},
|
|
15
15
|
"Resources": [],
|
|
16
16
|
"ResourceLookup": {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"JSBundleType": "framework",
|
|
3
3
|
"JSBundleIdentifier": "io.breakside.JSKit.Foundation",
|
|
4
|
-
"JSBundleVersion": "2025.
|
|
4
|
+
"JSBundleVersion": "2025.10.0",
|
|
5
5
|
"JSDevelopmentLanguage": "en",
|
|
6
6
|
"JSCopyright": "Copyright © 2020 Breakside Inc.",
|
|
7
7
|
"JSBundleEnvironments": {
|
|
@@ -9,5 +9,5 @@
|
|
|
9
9
|
"node": "Foundation+Node.js"
|
|
10
10
|
},
|
|
11
11
|
"JSLicenseNotice": "Licensed under the Breakside Public License, Version 1.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nIf a copy of the License was not distributed with this file, you may\nobtain a copy at\n\n http://breakside.io/licenses/LICENSE-1.0.txt\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n",
|
|
12
|
-
"GitRevision": "
|
|
12
|
+
"GitRevision": "5812a1dd94c9bf9b769a5911e6de85e02afbef0a"
|
|
13
13
|
}
|
|
@@ -35,6 +35,9 @@ JSClass("JSAttributedString", JSObject, {
|
|
|
35
35
|
},
|
|
36
36
|
|
|
37
37
|
initWithString: function(string, attributes){
|
|
38
|
+
if (typeof(string) !== "string" && !(string instanceof String)){
|
|
39
|
+
throw new Error("JSAttributedString.initWithString() called with non-string");
|
|
40
|
+
}
|
|
38
41
|
if (attributes === undefined){
|
|
39
42
|
attributes = {};
|
|
40
43
|
}
|
|
@@ -178,6 +181,9 @@ JSClass("JSAttributedString", JSObject, {
|
|
|
178
181
|
},
|
|
179
182
|
|
|
180
183
|
initWithAttributedString: function(attributedString, defaultAttributes){
|
|
184
|
+
if (!(attributedString instanceof JSAttributedString)){
|
|
185
|
+
throw new Error("JSAttributedString.initWithAttributedString called with non-JSAttributedString");
|
|
186
|
+
}
|
|
181
187
|
this._string = attributedString.string;
|
|
182
188
|
this._runs = [];
|
|
183
189
|
var run;
|
|
@@ -3,7 +3,7 @@ JSBundle.bundles['io.breakside.JSKit.Foundation'] = {
|
|
|
3
3
|
"Info": {
|
|
4
4
|
"JSBundleType": "framework",
|
|
5
5
|
"JSBundleIdentifier": "io.breakside.JSKit.Foundation",
|
|
6
|
-
"JSBundleVersion": "2025.
|
|
6
|
+
"JSBundleVersion": "2025.10.0",
|
|
7
7
|
"JSDevelopmentLanguage": "en",
|
|
8
8
|
"JSCopyright": "Copyright © 2020 Breakside Inc.",
|
|
9
9
|
"JSBundleEnvironments": {
|
|
@@ -11,7 +11,7 @@ JSBundle.bundles['io.breakside.JSKit.Foundation'] = {
|
|
|
11
11
|
"node": "Foundation+Node.js"
|
|
12
12
|
},
|
|
13
13
|
"JSLicenseNotice": "Licensed under the Breakside Public License, Version 1.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nIf a copy of the License was not distributed with this file, you may\nobtain a copy at\n\n http://breakside.io/licenses/LICENSE-1.0.txt\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n",
|
|
14
|
-
"GitRevision": "
|
|
14
|
+
"GitRevision": "5812a1dd94c9bf9b769a5911e6de85e02afbef0a"
|
|
15
15
|
},
|
|
16
16
|
"Resources": [
|
|
17
17
|
{
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"JSBundleType": "framework",
|
|
3
3
|
"JSBundleIdentifier": "io.breakside.JSKit.SecurityKit",
|
|
4
|
-
"JSBundleVersion": "2025.
|
|
4
|
+
"JSBundleVersion": "2025.10.0",
|
|
5
5
|
"JSDevelopmentLanguage": "en",
|
|
6
6
|
"JSCopyright": "Copyright © 2020 Breakside Inc.",
|
|
7
7
|
"JSBundleEnvironments": {
|
|
@@ -9,5 +9,5 @@
|
|
|
9
9
|
"node": "SecurityKit+Node.js"
|
|
10
10
|
},
|
|
11
11
|
"JSLicenseNotice": "Licensed under the Breakside Public License, Version 1.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nIf a copy of the License was not distributed with this file, you may\nobtain a copy at\n\n http://breakside.io/licenses/LICENSE-1.0.txt\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n",
|
|
12
|
-
"GitRevision": "
|
|
12
|
+
"GitRevision": "5812a1dd94c9bf9b769a5911e6de85e02afbef0a"
|
|
13
13
|
}
|
|
@@ -3,7 +3,7 @@ JSBundle.bundles['io.breakside.JSKit.SecurityKit'] = {
|
|
|
3
3
|
"Info": {
|
|
4
4
|
"JSBundleType": "framework",
|
|
5
5
|
"JSBundleIdentifier": "io.breakside.JSKit.SecurityKit",
|
|
6
|
-
"JSBundleVersion": "2025.
|
|
6
|
+
"JSBundleVersion": "2025.10.0",
|
|
7
7
|
"JSDevelopmentLanguage": "en",
|
|
8
8
|
"JSCopyright": "Copyright © 2020 Breakside Inc.",
|
|
9
9
|
"JSBundleEnvironments": {
|
|
@@ -11,7 +11,7 @@ JSBundle.bundles['io.breakside.JSKit.SecurityKit'] = {
|
|
|
11
11
|
"node": "SecurityKit+Node.js"
|
|
12
12
|
},
|
|
13
13
|
"JSLicenseNotice": "Licensed under the Breakside Public License, Version 1.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nIf a copy of the License was not distributed with this file, you may\nobtain a copy at\n\n http://breakside.io/licenses/LICENSE-1.0.txt\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n",
|
|
14
|
-
"GitRevision": "
|
|
14
|
+
"GitRevision": "5812a1dd94c9bf9b769a5911e6de85e02afbef0a"
|
|
15
15
|
},
|
|
16
16
|
"Resources": [],
|
|
17
17
|
"ResourceLookup": {
|
package/Info.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"JSBundleType": "node",
|
|
3
3
|
"JSBundleIdentifier": "io.breakside.jskit",
|
|
4
|
-
"JSBundleVersion": "2025.
|
|
4
|
+
"JSBundleVersion": "2025.10.0",
|
|
5
5
|
"JSExecutableName": "jskit",
|
|
6
6
|
"NPMOrganization": "breakside",
|
|
7
7
|
"JSResources": [
|
|
8
8
|
"Tests/HTMLTestRunner.js",
|
|
9
9
|
"Tests/NodeTestRunner.js"
|
|
10
10
|
],
|
|
11
|
-
"GitRevision": "
|
|
11
|
+
"GitRevision": "5812a1dd94c9bf9b769a5911e6de85e02afbef0a"
|
|
12
12
|
}
|
|
@@ -3,14 +3,14 @@ JSBundle.bundles['io.breakside.jskit'] = {
|
|
|
3
3
|
"Info": {
|
|
4
4
|
"JSBundleType": "node",
|
|
5
5
|
"JSBundleIdentifier": "io.breakside.jskit",
|
|
6
|
-
"JSBundleVersion": "2025.
|
|
6
|
+
"JSBundleVersion": "2025.10.0",
|
|
7
7
|
"JSExecutableName": "jskit",
|
|
8
8
|
"NPMOrganization": "breakside",
|
|
9
9
|
"JSResources": [
|
|
10
10
|
"Tests/HTMLTestRunner.js",
|
|
11
11
|
"Tests/NodeTestRunner.js"
|
|
12
12
|
],
|
|
13
|
-
"GitRevision": "
|
|
13
|
+
"GitRevision": "5812a1dd94c9bf9b769a5911e6de85e02afbef0a"
|
|
14
14
|
},
|
|
15
15
|
"Resources": [
|
|
16
16
|
{
|
|
@@ -35,6 +35,9 @@ JSClass("JSAttributedString", JSObject, {
|
|
|
35
35
|
},
|
|
36
36
|
|
|
37
37
|
initWithString: function(string, attributes){
|
|
38
|
+
if (typeof(string) !== "string" && !(string instanceof String)){
|
|
39
|
+
throw new Error("JSAttributedString.initWithString() called with non-string");
|
|
40
|
+
}
|
|
38
41
|
if (attributes === undefined){
|
|
39
42
|
attributes = {};
|
|
40
43
|
}
|
|
@@ -178,6 +181,9 @@ JSClass("JSAttributedString", JSObject, {
|
|
|
178
181
|
},
|
|
179
182
|
|
|
180
183
|
initWithAttributedString: function(attributedString, defaultAttributes){
|
|
184
|
+
if (!(attributedString instanceof JSAttributedString)){
|
|
185
|
+
throw new Error("JSAttributedString.initWithAttributedString called with non-JSAttributedString");
|
|
186
|
+
}
|
|
181
187
|
this._string = attributedString.string;
|
|
182
188
|
this._runs = [];
|
|
183
189
|
var run;
|
|
@@ -94,7 +94,7 @@ JSClass('UIAnimationTransaction', JSObject, {
|
|
|
94
94
|
_flush: function(){
|
|
95
95
|
if (this.animations.length === 0){
|
|
96
96
|
if (this.completionFunction){
|
|
97
|
-
this.completionFunction
|
|
97
|
+
UIApplication.shared.windowServer.displayServer.schedule(this.completionFunction, this);
|
|
98
98
|
}
|
|
99
99
|
return;
|
|
100
100
|
}
|
|
@@ -122,11 +122,12 @@ UIAnimationTransaction.commit = function(){
|
|
|
122
122
|
UIAnimationTransaction.committed.push(transaction);
|
|
123
123
|
if (UIAnimationTransaction.stack.length === 0){
|
|
124
124
|
UIAnimationTransaction.currentTransaction = null;
|
|
125
|
-
|
|
126
|
-
|
|
125
|
+
var committed = UIAnimationTransaction.committed;
|
|
126
|
+
UIAnimationTransaction.committed = [];
|
|
127
|
+
for (var i = 0, l = committed.length; i < l; ++i){
|
|
128
|
+
transaction = committed[i];
|
|
127
129
|
transaction._flush();
|
|
128
130
|
}
|
|
129
|
-
UIAnimationTransaction.committed = [];
|
|
130
131
|
}else{
|
|
131
132
|
UIAnimationTransaction.currentTransaction = UIAnimationTransaction.stack[UIAnimationTransaction.stack.length - 1];
|
|
132
133
|
}
|
|
@@ -426,7 +426,7 @@ JSClass('UIApplication', UIResponder, {
|
|
|
426
426
|
target = undefined;
|
|
427
427
|
}
|
|
428
428
|
if (target instanceof JSObject){
|
|
429
|
-
actionLogger.debug("sendAction " + (action.name || ("anonymousfn")) + " to %{public}#%d from %{public}#%d", target.$class.className, target.
|
|
429
|
+
actionLogger.debug("sendAction " + (action.name || ("anonymousfn")) + " to %{public}#%d from %{public}#%d", target.$class.className, target.objectID, sender.$class.className, sender.objectID);
|
|
430
430
|
}else{
|
|
431
431
|
actionLogger.debug("sendAction " + (action.name || ("anonymousfn")) + " from %{public}#%d", sender.$class.className, sender.objectID);
|
|
432
432
|
}
|
|
@@ -80,11 +80,15 @@ JSClass("UIHTMLApplication", UIApplication, {
|
|
|
80
80
|
};
|
|
81
81
|
this.stop(open);
|
|
82
82
|
}else{
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
if (
|
|
86
|
-
this.delegate.applicationBrowserBlockedWindowForURL
|
|
83
|
+
try{
|
|
84
|
+
var child = this.domWindow.open(url.encodedString);
|
|
85
|
+
if ((url.scheme == "http" || url.scheme == "https") && !child){
|
|
86
|
+
if (this.delegate && this.delegate.applicationBrowserBlockedWindowForURL){
|
|
87
|
+
this.delegate.applicationBrowserBlockedWindowForURL(this, url);
|
|
88
|
+
}
|
|
87
89
|
}
|
|
90
|
+
}catch (e){
|
|
91
|
+
logger.warning("unable to open URL `%{public}`: %{error}", url.encodedString, e);
|
|
88
92
|
}
|
|
89
93
|
}
|
|
90
94
|
},
|
|
@@ -394,21 +394,29 @@ JSClass('UIHTMLContentEditableTextInputManager', UITextInputManager, {
|
|
|
394
394
|
// We don't want to preventDefault on anything that looks like
|
|
395
395
|
// it'll cause input
|
|
396
396
|
var text = null;
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
}else if (e.key
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
397
|
+
if (e.key === null){
|
|
398
|
+
logger.warn("got a null key value for keydown code:%{public} keyCode:%d", e.code, e.keyCode);
|
|
399
|
+
}else if (e.key === undefined){
|
|
400
|
+
logger.warn("got an undefined key value for keydown code:%{public} keyCode:%d", e.code, e.keyCode);
|
|
401
|
+
}else if (e.key === ""){
|
|
402
|
+
logger.warn("got an empty key value for keydown code:%{public} keyCode:%d", e.code, e.keyCode);
|
|
403
|
+
}else{
|
|
404
|
+
var iterator = e.key.userPerceivedCharacterIterator();
|
|
405
|
+
if (iterator.nextIndex === e.key.length){
|
|
406
|
+
text = e.key;
|
|
407
|
+
preventDefault = false;
|
|
408
|
+
}else if (e.key.startsWith(".") && e.key.length > 1){
|
|
409
|
+
// iOS has keys for ".com", ".org", etc. They don't follow
|
|
410
|
+
// the key string (https://www.w3.org/TR/uievents-key/#key-string)
|
|
411
|
+
// specification, in that they are more than one user percived
|
|
412
|
+
// character long. But since they always start with a ".", we
|
|
413
|
+
// can special case it and assume when key = ".anything", it's
|
|
414
|
+
// meant to be inserted
|
|
415
|
+
text = e.key;
|
|
416
|
+
preventDefault = false;
|
|
417
|
+
}else if (e.key == "Backspace" || e.key == "Delete"){
|
|
418
|
+
preventDefault = false;
|
|
419
|
+
}
|
|
412
420
|
}
|
|
413
421
|
this.windowServer._createKeyEventFromDOMEvent(e, UIEvent.Type.keyDown, preventDefault);
|
|
414
422
|
if (!this.supportsBeforeinputEvent && this.textInputClient !== null && text !== null && text !== ""){
|
|
@@ -44,7 +44,13 @@ JSClass("UIHTMLOpenPanel", UIOpenPanel, {
|
|
|
44
44
|
}
|
|
45
45
|
}
|
|
46
46
|
var panel = this;
|
|
47
|
-
|
|
47
|
+
var hasCompleted = false;
|
|
48
|
+
var handleChange = function(){
|
|
49
|
+
fileInput.removeEventListener("change", handleChange);
|
|
50
|
+
fileInput.removeEventListener("cancel", handleCancel);
|
|
51
|
+
if (hasCompleted){
|
|
52
|
+
return;
|
|
53
|
+
}
|
|
48
54
|
if (panel.allowsMultipleSelection || panel.chooseDirectories){
|
|
49
55
|
if (fileInput.webkitEntries && fileInput.webkitEntries.length > 0){
|
|
50
56
|
panel._fileEnumerator = JSHTMLFileSystemEntryFileEnumerator.initWithHTMLEntries(fileInput.webkitEntries);
|
|
@@ -57,13 +63,22 @@ JSClass("UIHTMLOpenPanel", UIOpenPanel, {
|
|
|
57
63
|
}
|
|
58
64
|
}
|
|
59
65
|
action.call(target, panel);
|
|
66
|
+
hasCompleted = true;
|
|
60
67
|
fileInput.parentNode.removeChild(fileInput);
|
|
61
68
|
UIHTMLOpenPanel.fileInput = null;
|
|
62
|
-
}
|
|
63
|
-
|
|
69
|
+
};
|
|
70
|
+
var handleCancel = function(){
|
|
71
|
+
fileInput.removeEventListener("change", handleChange);
|
|
72
|
+
fileInput.removeEventListener("cancel", handleCancel);
|
|
73
|
+
if (hasCompleted){
|
|
74
|
+
return;
|
|
75
|
+
}
|
|
76
|
+
hasCompleted = true;
|
|
64
77
|
fileInput.parentNode.removeChild(fileInput);
|
|
65
78
|
UIHTMLOpenPanel.fileInput = null;
|
|
66
|
-
}
|
|
79
|
+
};
|
|
80
|
+
fileInput.addEventListener("change", handleChange);
|
|
81
|
+
fileInput.addEventListener("cancel", handleCancel);
|
|
67
82
|
fileInput.click();
|
|
68
83
|
}
|
|
69
84
|
|