@breakside/jskit 2021.39.0 → 2021.40.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/JSImage.js +9 -3
- package/Frameworks/Foundation.jsframework/JS/JSURLRequest.js +4 -1
- 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/JSImage.js +9 -3
- package/Root/Frameworks/Foundation/JSURLRequest.js +4 -1
- package/Root/Frameworks/ImageKit/IKHTMLCanvasBitmapContext.js +1 -1
- 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/PDFKit/PDFColorSpace.js +1 -1
- package/Root/Frameworks/PDFKit/PDFReader.js +8 -3
- 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/UIButton.js +1 -1
- package/Root/Frameworks/UIKit/UIColorPanel.js +2 -0
- package/Root/Frameworks/UIKit/UIColorWell.js +12 -2
- package/Root/Frameworks/UIKit/UIPopupButton.js +9 -1
- package/Root/Frameworks/UIKit/UIPopupWindow.js +6 -0
- package/Root/Frameworks/UIKit/UISlider.js +9 -1
- package/Root/Frameworks/UIKit/UIWindow.js +39 -31
- package/Root/Frameworks/UIKitTesting/Info.yaml +1 -1
- package/package.json +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"JSBundleType": "framework",
|
|
3
3
|
"JSBundleIdentifier": "io.breakside.JSKit.DOM",
|
|
4
|
-
"JSBundleVersion": "2021.
|
|
4
|
+
"JSBundleVersion": "2021.40.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": "e972edc24398ba5aea3b6910ec3e199a88814774"
|
|
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": "2021.
|
|
6
|
+
"JSBundleVersion": "2021.40.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": "e972edc24398ba5aea3b6910ec3e199a88814774"
|
|
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": "2021.
|
|
4
|
+
"JSBundleVersion": "2021.40.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": "e972edc24398ba5aea3b6910ec3e199a88814774"
|
|
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": "2021.
|
|
6
|
+
"JSBundleVersion": "2021.40.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": "e972edc24398ba5aea3b6910ec3e199a88814774"
|
|
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": "2021.
|
|
4
|
+
"JSBundleVersion": "2021.40.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": "e972edc24398ba5aea3b6910ec3e199a88814774"
|
|
13
13
|
}
|
|
@@ -233,6 +233,7 @@ JSClass("_JSResourceImage", JSImage, {
|
|
|
233
233
|
_JSResourceImage.$super.copy.call(this, image);
|
|
234
234
|
image.bundle = this.bundle;
|
|
235
235
|
image.metadata = this.metadata;
|
|
236
|
+
image.contentType = this.contentType;
|
|
236
237
|
return image;
|
|
237
238
|
},
|
|
238
239
|
|
|
@@ -252,8 +253,11 @@ JSClass("_JSDataImage", JSImage, {
|
|
|
252
253
|
return null;
|
|
253
254
|
}
|
|
254
255
|
this.data = data;
|
|
255
|
-
this.contentType =
|
|
256
|
-
if (size === undefined
|
|
256
|
+
this.contentType = JSImage.contentTypeOfData(data);
|
|
257
|
+
if (size === undefined){
|
|
258
|
+
if (this.contentType === null){
|
|
259
|
+
return null;
|
|
260
|
+
}
|
|
257
261
|
switch (this.contentType.subtype){
|
|
258
262
|
case "png":
|
|
259
263
|
size = _JSDataImage.sizeFromPNGData(data);
|
|
@@ -264,6 +268,8 @@ JSClass("_JSDataImage", JSImage, {
|
|
|
264
268
|
case "svg+xml":
|
|
265
269
|
size = _JSDataImage.sizeFromSVGData(data);
|
|
266
270
|
break;
|
|
271
|
+
default:
|
|
272
|
+
return null;
|
|
267
273
|
}
|
|
268
274
|
}
|
|
269
275
|
_JSDataImage.$super._initWithPixelSize.call(this, size, scale);
|
|
@@ -286,7 +292,7 @@ JSClass("_JSDataImage", JSImage, {
|
|
|
286
292
|
|
|
287
293
|
});
|
|
288
294
|
|
|
289
|
-
|
|
295
|
+
JSImage.contentTypeOfData = function(data){
|
|
290
296
|
if (data.length >= 24 &&
|
|
291
297
|
// magic
|
|
292
298
|
data[0] == 0x89 &&
|
|
@@ -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": "2021.
|
|
6
|
+
"JSBundleVersion": "2021.40.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": "e972edc24398ba5aea3b6910ec3e199a88814774"
|
|
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": "2021.
|
|
4
|
+
"JSBundleVersion": "2021.40.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": "e972edc24398ba5aea3b6910ec3e199a88814774"
|
|
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": "2021.
|
|
6
|
+
"JSBundleVersion": "2021.40.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": "e972edc24398ba5aea3b6910ec3e199a88814774"
|
|
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": "2021.
|
|
4
|
+
"JSBundleVersion": "2021.40.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": "e972edc24398ba5aea3b6910ec3e199a88814774"
|
|
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": "2021.
|
|
6
|
+
"JSBundleVersion": "2021.40.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": "e972edc24398ba5aea3b6910ec3e199a88814774"
|
|
14
14
|
},
|
|
15
15
|
"Resources": [
|
|
16
16
|
{
|
|
@@ -233,6 +233,7 @@ JSClass("_JSResourceImage", JSImage, {
|
|
|
233
233
|
_JSResourceImage.$super.copy.call(this, image);
|
|
234
234
|
image.bundle = this.bundle;
|
|
235
235
|
image.metadata = this.metadata;
|
|
236
|
+
image.contentType = this.contentType;
|
|
236
237
|
return image;
|
|
237
238
|
},
|
|
238
239
|
|
|
@@ -252,8 +253,11 @@ JSClass("_JSDataImage", JSImage, {
|
|
|
252
253
|
return null;
|
|
253
254
|
}
|
|
254
255
|
this.data = data;
|
|
255
|
-
this.contentType =
|
|
256
|
-
if (size === undefined
|
|
256
|
+
this.contentType = JSImage.contentTypeOfData(data);
|
|
257
|
+
if (size === undefined){
|
|
258
|
+
if (this.contentType === null){
|
|
259
|
+
return null;
|
|
260
|
+
}
|
|
257
261
|
switch (this.contentType.subtype){
|
|
258
262
|
case "png":
|
|
259
263
|
size = _JSDataImage.sizeFromPNGData(data);
|
|
@@ -264,6 +268,8 @@ JSClass("_JSDataImage", JSImage, {
|
|
|
264
268
|
case "svg+xml":
|
|
265
269
|
size = _JSDataImage.sizeFromSVGData(data);
|
|
266
270
|
break;
|
|
271
|
+
default:
|
|
272
|
+
return null;
|
|
267
273
|
}
|
|
268
274
|
}
|
|
269
275
|
_JSDataImage.$super._initWithPixelSize.call(this, size, scale);
|
|
@@ -286,7 +292,7 @@ JSClass("_JSDataImage", JSImage, {
|
|
|
286
292
|
|
|
287
293
|
});
|
|
288
294
|
|
|
289
|
-
|
|
295
|
+
JSImage.contentTypeOfData = function(data){
|
|
290
296
|
if (data.length >= 24 &&
|
|
291
297
|
// magic
|
|
292
298
|
data[0] == 0x89 &&
|
|
@@ -67,7 +67,7 @@ JSClass("IKHTMLCanvasBitmapContext", IKBitmapContext, {
|
|
|
67
67
|
}
|
|
68
68
|
canvas.toBlob(function(blob){
|
|
69
69
|
opCompletion.call(opTarget);
|
|
70
|
-
var reader = FileReader();
|
|
70
|
+
var reader = new FileReader();
|
|
71
71
|
reader.addEventListener("loadend", function(){
|
|
72
72
|
if (reader.error){
|
|
73
73
|
logger.error("Error reading blob: %{error}", reader.error);
|
|
@@ -170,7 +170,7 @@ PDFColorSpace.deviceCMYK = {
|
|
|
170
170
|
var a = 0;
|
|
171
171
|
var b = 0;
|
|
172
172
|
for (i = 0, l = offsets.length; i < l; ++i){
|
|
173
|
-
if (offsets[i].offset >= CMYKToLabLookup.length) return;
|
|
173
|
+
if (offsets[i].offset >= CMYKToLabLookup.length) return JSColor.black;
|
|
174
174
|
L += CMYKToLabLookup[offsets[i].offset] / 255.0 * offsets[i].pct;
|
|
175
175
|
a += CMYKToLabLookup[offsets[i].offset + 1] / 255.0 * offsets[i].pct;
|
|
176
176
|
b += CMYKToLabLookup[offsets[i].offset + 2] / 255.0 * offsets[i].pct;
|
|
@@ -48,9 +48,14 @@ JSClass("PDFReader", JSObject, {
|
|
|
48
48
|
completion = Promise.completion();
|
|
49
49
|
}
|
|
50
50
|
this._crossReferenceTable = [];
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
51
|
+
try{
|
|
52
|
+
this._readVersion();
|
|
53
|
+
var offset = this._readEndOfFile();
|
|
54
|
+
this._readCrossReferenceEntries(offset);
|
|
55
|
+
}catch (e){
|
|
56
|
+
completion.call(target, PDFReader.Status.error, null);
|
|
57
|
+
return;
|
|
58
|
+
}
|
|
54
59
|
var encrypt = this._trailer.Encrypt;
|
|
55
60
|
if (!encrypt){
|
|
56
61
|
this._readObjectStreams(function(){
|
|
@@ -30,7 +30,7 @@ JSClass("UIColorWell", UIControl, {
|
|
|
30
30
|
this._color = spec.valueForKey("color", JSColor).rgbaColor();
|
|
31
31
|
}
|
|
32
32
|
if (spec.containsKey("allowsAlpha")){
|
|
33
|
-
this.
|
|
33
|
+
this.allowsAlpha = spec.valueForKey("allowsAlpha", JSColor);
|
|
34
34
|
}
|
|
35
35
|
this.update();
|
|
36
36
|
},
|
|
@@ -58,8 +58,8 @@ JSClass("UIColorWell", UIControl, {
|
|
|
58
58
|
|
|
59
59
|
_changeColor: function(color){
|
|
60
60
|
this.color = color;
|
|
61
|
-
this.sendActionsForEvents(UIControl.Event.valueChanged);
|
|
62
61
|
this.didChangeValueForBinding('color');
|
|
62
|
+
this.sendActionsForEvents(UIControl.Event.valueChanged);
|
|
63
63
|
},
|
|
64
64
|
|
|
65
65
|
// ----------------------------------------------------------------------
|
|
@@ -304,15 +304,23 @@ JSClass("UIColorWellDefaultStyler", UIColorWellStyler, {
|
|
|
304
304
|
}
|
|
305
305
|
if (spec.containsKey("normalBorderColor")){
|
|
306
306
|
this.normalBorderColor = spec.valueForKey("normalBorderColor", JSColor);
|
|
307
|
+
}else{
|
|
308
|
+
this.normalBorderColor = JSColor.black.colorWithAlpha(0.2);
|
|
307
309
|
}
|
|
308
310
|
if (spec.containsKey("activeBorderColor")){
|
|
309
311
|
this.activeBorderColor = spec.valueForKey("activeBorderColor", JSColor);
|
|
312
|
+
}else{
|
|
313
|
+
this.activeBorderColor = JSColor.black.colorWithAlpha(0.4);
|
|
310
314
|
}
|
|
311
315
|
if (spec.containsKey("dropTargetBorderColor")){
|
|
312
316
|
this.dropTargetBorderColor = spec.valueForKey("dropTargetBorderColor", JSColor);
|
|
317
|
+
}else{
|
|
318
|
+
this.dropTargetBorderColor = JSColor.black.colorWithAlpha(0.2);
|
|
313
319
|
}
|
|
314
320
|
if (spec.containsKey("disabledBorderColor")){
|
|
315
321
|
this.disabledBorderColor = spec.valueForKey("disabledBorderColor", JSColor);
|
|
322
|
+
}else{
|
|
323
|
+
this.disabledBorderColor = JSColor.clear;
|
|
316
324
|
}
|
|
317
325
|
if (spec.containsKey("normalBorderWidth")){
|
|
318
326
|
this.normalBorderWidth = spec.valueForKey("normalBorderWidth");
|
|
@@ -341,6 +349,8 @@ JSClass("UIColorWellDefaultStyler", UIColorWellStyler, {
|
|
|
341
349
|
}
|
|
342
350
|
if (spec.containsKey("wellInnerShadowColor")){
|
|
343
351
|
this.wellInnerShadowColor = spec.valueForKey("wellInnerShadowColor", JSColor);
|
|
352
|
+
}else{
|
|
353
|
+
this.wellInnerShadowColor = JSColor.black.colorWithAlpha(0.4);
|
|
344
354
|
}
|
|
345
355
|
if (spec.containsKey("wellInnerShadowOffset")){
|
|
346
356
|
this.wellInnerShadowOffset = spec.valueForKey("wellInnerShadowOffset", JSPoint);
|
|
@@ -65,6 +65,9 @@ JSClass("UIPopupButton", UIControl, {
|
|
|
65
65
|
this.addItemWithTitle(options.valueForKey(i));
|
|
66
66
|
}
|
|
67
67
|
}
|
|
68
|
+
if (spec.containsKey("menuAdoptsTitleFont")){
|
|
69
|
+
this.menuAdoptsTitleFont = spec.valueForKey("menuAdoptsTitleFont");
|
|
70
|
+
}
|
|
68
71
|
},
|
|
69
72
|
|
|
70
73
|
commonUIControlInit: function(){
|
|
@@ -274,9 +277,13 @@ JSClass("UIPopupButton", UIControl, {
|
|
|
274
277
|
// -------------------------------------------------------------------------
|
|
275
278
|
// MARK: - Menu
|
|
276
279
|
|
|
280
|
+
menuAdoptsTitleFont: true,
|
|
281
|
+
|
|
277
282
|
openMenu: function(){
|
|
278
283
|
if (this.menu.items.length > 0){
|
|
279
|
-
|
|
284
|
+
if (this.menuAdoptsTitleFont){
|
|
285
|
+
this.menu.font = this.titleLabel.font;
|
|
286
|
+
}
|
|
280
287
|
this.menu.delegate = this;
|
|
281
288
|
if (this._pullsDown){
|
|
282
289
|
this.menu.minimumWidth = this.frame.size.width;
|
|
@@ -448,6 +455,7 @@ JSClass("UIPopupButtonStyler", UIControlStyler, {
|
|
|
448
455
|
},
|
|
449
456
|
|
|
450
457
|
initWithSpec: function(spec){
|
|
458
|
+
UIPopupButtonStyler.$super.initWithSpec.call(this, spec);
|
|
451
459
|
if (spec.containsKey("menuStyler")){
|
|
452
460
|
this.menuStyler = spec.valueForKey("menuStyler", UIMenu.Styler);
|
|
453
461
|
}else{
|
|
@@ -278,9 +278,15 @@ JSClass("UIPopupWindow", UIWindow, {
|
|
|
278
278
|
|
|
279
279
|
},
|
|
280
280
|
|
|
281
|
+
modalIndicationClosesWindow: false,
|
|
282
|
+
|
|
281
283
|
_modalAnimator: null,
|
|
282
284
|
|
|
283
285
|
indicateModalStatus: function(){
|
|
286
|
+
if (this.modalIndicationClosesWindow){
|
|
287
|
+
this.close();
|
|
288
|
+
return;
|
|
289
|
+
}
|
|
284
290
|
if (this._modalAnimator !== null){
|
|
285
291
|
return;
|
|
286
292
|
}
|
|
@@ -290,7 +290,15 @@ JSClass("UISliderLayerBasedStyler", UIControlStyler, {
|
|
|
290
290
|
return knobLayer.containsPoint(point);
|
|
291
291
|
},
|
|
292
292
|
|
|
293
|
-
|
|
293
|
+
sizeControlToFitSize: function(slider, maxSize){
|
|
294
|
+
var size = JSSize(slider.bounds.size.width, this.intrinsicSizeOfControl(slider).height);
|
|
295
|
+
if (size.width > maxSize.width){
|
|
296
|
+
size.width = maxSize.width;
|
|
297
|
+
}
|
|
298
|
+
slider.bounds = JSRect(JSPoint.Zero, size);
|
|
299
|
+
},
|
|
300
|
+
|
|
301
|
+
intrinsicSizeOfControl: function(slider){
|
|
294
302
|
return JSSize(UIView.noIntrinsicSize, Math.max(this.trackWidth, this.knobSize.height));
|
|
295
303
|
}
|
|
296
304
|
|
|
@@ -433,6 +433,7 @@ JSClass('UIWindow', UIView, {
|
|
|
433
433
|
}else if (this._contentViewController){
|
|
434
434
|
this._contentViewController.viewWillAppear(false);
|
|
435
435
|
}
|
|
436
|
+
this._shouldCallDidAppear = true;
|
|
436
437
|
}
|
|
437
438
|
this.windowServer.orderWindowFront(this);
|
|
438
439
|
if (!this._isOpen){
|
|
@@ -443,15 +444,19 @@ JSClass('UIWindow', UIView, {
|
|
|
443
444
|
}
|
|
444
445
|
},
|
|
445
446
|
|
|
447
|
+
_shouldCallDidAppear: false,
|
|
446
448
|
_isVisible: false,
|
|
447
449
|
|
|
448
450
|
didBecomeVisible: function(){
|
|
449
451
|
this._application._windows.push(this);
|
|
450
452
|
this._isVisible = true;
|
|
451
|
-
if (this.
|
|
452
|
-
this.
|
|
453
|
-
|
|
454
|
-
|
|
453
|
+
if (this._shouldCallDidAppear){
|
|
454
|
+
this._shouldCallDidAppear = false;
|
|
455
|
+
if (this.viewController){
|
|
456
|
+
this.viewController.viewDidAppear(false);
|
|
457
|
+
}else if (this._contentViewController){
|
|
458
|
+
this._contentViewController.viewDidAppear(false);
|
|
459
|
+
}
|
|
455
460
|
}
|
|
456
461
|
if (this._initialFirstResponder !== null){
|
|
457
462
|
var responder = this._initialFirstResponder;
|
|
@@ -521,36 +526,22 @@ JSClass('UIWindow', UIView, {
|
|
|
521
526
|
return;
|
|
522
527
|
}
|
|
523
528
|
var window = this;
|
|
524
|
-
var
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
window.
|
|
529
|
+
var transform = this.transform;
|
|
530
|
+
this._modalAnimator = UIViewPropertyAnimator.initWithDuration(0.075);
|
|
531
|
+
this._modalAnimator.addAnimations(function(){
|
|
532
|
+
window.transform = transform.scaledBy(1.15);
|
|
528
533
|
});
|
|
529
|
-
|
|
530
|
-
window._modalAnimator = UIViewPropertyAnimator.initWithDuration(0.
|
|
534
|
+
this._modalAnimator.addCompletion(function(){
|
|
535
|
+
window._modalAnimator = UIViewPropertyAnimator.initWithDuration(0.075);
|
|
531
536
|
window._modalAnimator.addAnimations(function(){
|
|
532
|
-
window.
|
|
537
|
+
window.transform = transform;
|
|
533
538
|
});
|
|
534
539
|
window._modalAnimator.addCompletion(function(){
|
|
535
|
-
window._modalAnimator =
|
|
536
|
-
window._modalAnimator.addAnimations(function(){
|
|
537
|
-
window.alpha = alpha * 0.8;
|
|
538
|
-
});
|
|
539
|
-
window._modalAnimator.addCompletion(function(){
|
|
540
|
-
window._modalAnimator = UIViewPropertyAnimator.initWithDuration(0.05);
|
|
541
|
-
window._modalAnimator.addAnimations(function(){
|
|
542
|
-
window.alpha = alpha;
|
|
543
|
-
});
|
|
544
|
-
window._modalAnimator.addCompletion(function(){
|
|
545
|
-
window._modalAnimator = null;
|
|
546
|
-
});
|
|
547
|
-
window._modalAnimator.start();
|
|
548
|
-
});
|
|
549
|
-
window._modalAnimator.start();
|
|
540
|
+
window._modalAnimator = null;
|
|
550
541
|
});
|
|
551
542
|
window._modalAnimator.start();
|
|
552
543
|
});
|
|
553
|
-
|
|
544
|
+
this._modalAnimator.start();
|
|
554
545
|
},
|
|
555
546
|
|
|
556
547
|
// -------------------------------------------------------------------------
|
|
@@ -629,7 +620,27 @@ JSClass('UIWindow', UIView, {
|
|
|
629
620
|
}
|
|
630
621
|
return;
|
|
631
622
|
}
|
|
632
|
-
|
|
623
|
+
var next = this._nextKeyResponder();
|
|
624
|
+
if (next !== null){
|
|
625
|
+
next.keyDown(event);
|
|
626
|
+
}
|
|
627
|
+
},
|
|
628
|
+
|
|
629
|
+
keyUp: function(event){
|
|
630
|
+
var next = this._nextKeyResponder();
|
|
631
|
+
if (next !== null){
|
|
632
|
+
next.keyUp(event);
|
|
633
|
+
}
|
|
634
|
+
},
|
|
635
|
+
|
|
636
|
+
_nextKeyResponder: function(){
|
|
637
|
+
var responder = this.getNextResponder();
|
|
638
|
+
if (responder === this._application){
|
|
639
|
+
if (this.isKeyWindow && this.windowServer.mainWindow !== null && this.windowServer.mainWindow !== this){
|
|
640
|
+
return this.windowServer.mainWindow;
|
|
641
|
+
}
|
|
642
|
+
}
|
|
643
|
+
return responder;
|
|
633
644
|
},
|
|
634
645
|
|
|
635
646
|
// -------------------------------------------------------------------------
|
|
@@ -684,9 +695,6 @@ JSClass('UIWindow', UIView, {
|
|
|
684
695
|
if (this.viewController !== null){
|
|
685
696
|
return this.viewController;
|
|
686
697
|
}
|
|
687
|
-
if (this.isKeyWindow && this.windowServer.mainWindow !== null && this.windowServer.mainWindow !== this){
|
|
688
|
-
return this.windowServer.mainWindow;
|
|
689
|
-
}
|
|
690
698
|
return this._application;
|
|
691
699
|
},
|
|
692
700
|
|