@breakside/jskit 2022.32.0 → 2022.49.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 +1 -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/JSAttributedString.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/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/TestKit/TKTestRun.js +1 -1
- package/Root/Frameworks/UIKit/Info.yaml +1 -1
- package/Root/Frameworks/UIKit/UIAnimationTransaction.js +6 -0
- package/Root/Frameworks/UIKit/UIHTMLWindowServer.js +8 -1
- package/Root/Frameworks/UIKit/UILayer.js +10 -3
- package/Root/Frameworks/UIKit/UIListView.js +79 -61
- package/Root/Frameworks/UIKit/UIPopupWindow.js +3 -1
- package/Root/Frameworks/UIKit/UIView.js +21 -2
- package/Root/Frameworks/UIKit/UIViewPropertyAnimator.js +1 -0
- 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": "2022.
|
|
4
|
+
"JSBundleVersion": "2022.49.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": "115cb8f3373561b8f20dc12b628bb8742aabecdc"
|
|
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": "2022.
|
|
6
|
+
"JSBundleVersion": "2022.49.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": "115cb8f3373561b8f20dc12b628bb8742aabecdc"
|
|
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": "2022.
|
|
4
|
+
"JSBundleVersion": "2022.49.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": "115cb8f3373561b8f20dc12b628bb8742aabecdc"
|
|
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": "2022.
|
|
6
|
+
"JSBundleVersion": "2022.49.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": "115cb8f3373561b8f20dc12b628bb8742aabecdc"
|
|
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": "2022.
|
|
4
|
+
"JSBundleVersion": "2022.49.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": "115cb8f3373561b8f20dc12b628bb8742aabecdc"
|
|
13
13
|
}
|
|
@@ -487,7 +487,7 @@ JSClass("JSAttributedString", JSObject, {
|
|
|
487
487
|
adjustment += replacement.length - range.length;
|
|
488
488
|
if (argIndex >= 0){
|
|
489
489
|
var attrs = attributes[argIndex];
|
|
490
|
-
if (attrs){
|
|
490
|
+
if (attrs && replacement.length > 0){
|
|
491
491
|
attributedString.addAttributesInRange(attrs, JSRange(range.location, replacement.length));
|
|
492
492
|
}
|
|
493
493
|
}
|
|
@@ -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": "2022.
|
|
6
|
+
"JSBundleVersion": "2022.49.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": "115cb8f3373561b8f20dc12b628bb8742aabecdc"
|
|
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": "2022.
|
|
4
|
+
"JSBundleVersion": "2022.49.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": "115cb8f3373561b8f20dc12b628bb8742aabecdc"
|
|
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": "2022.
|
|
6
|
+
"JSBundleVersion": "2022.49.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": "115cb8f3373561b8f20dc12b628bb8742aabecdc"
|
|
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": "2022.
|
|
4
|
+
"JSBundleVersion": "2022.49.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": "115cb8f3373561b8f20dc12b628bb8742aabecdc"
|
|
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": "2022.
|
|
6
|
+
"JSBundleVersion": "2022.49.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": "115cb8f3373561b8f20dc12b628bb8742aabecdc"
|
|
14
14
|
},
|
|
15
15
|
"Resources": [
|
|
16
16
|
{
|
|
@@ -487,7 +487,7 @@ JSClass("JSAttributedString", JSObject, {
|
|
|
487
487
|
adjustment += replacement.length - range.length;
|
|
488
488
|
if (argIndex >= 0){
|
|
489
489
|
var attrs = attributes[argIndex];
|
|
490
|
-
if (attrs){
|
|
490
|
+
if (attrs && replacement.length > 0){
|
|
491
491
|
attributedString.addAttributesInRange(attrs, JSRange(range.location, replacement.length));
|
|
492
492
|
}
|
|
493
493
|
}
|
|
@@ -151,7 +151,7 @@ JSClass('TKTestRun', JSObject, {
|
|
|
151
151
|
args = [];
|
|
152
152
|
}else{
|
|
153
153
|
fn = suiteInstance[parts[0]].test;
|
|
154
|
-
args = suiteInstance[parts[0]].inputs[parts
|
|
154
|
+
args = suiteInstance[parts[0]].inputs[parts.slice(1).join(".")];
|
|
155
155
|
}
|
|
156
156
|
var promise = fn.apply(suiteInstance, args);
|
|
157
157
|
if (promise){
|
|
@@ -92,6 +92,12 @@ JSClass('UIAnimationTransaction', JSObject, {
|
|
|
92
92
|
},
|
|
93
93
|
|
|
94
94
|
_flush: function(){
|
|
95
|
+
if (this.animations.length === 0){
|
|
96
|
+
if (this.completionFunction){
|
|
97
|
+
this.completionFunction();
|
|
98
|
+
}
|
|
99
|
+
return;
|
|
100
|
+
}
|
|
95
101
|
var animation;
|
|
96
102
|
for (var i = 0, l = this.animations.length; i < l; ++i){
|
|
97
103
|
animation = this.animations[i];
|
|
@@ -349,7 +349,14 @@ JSClass("UIHTMLWindowServer", UIWindowServer, {
|
|
|
349
349
|
_createScrollEventFromDOMEvent: function(e, type){
|
|
350
350
|
var timestamp = e.timeStamp / 1000.0;
|
|
351
351
|
var modifiers = this._modifiersFromDOMEvent(e);
|
|
352
|
-
|
|
352
|
+
var deltaX = e.deltaX;
|
|
353
|
+
var deltaY = e.deltaY;
|
|
354
|
+
if (UIPlatform.shared.identifier !== UIPlatform.Identifier.mac){
|
|
355
|
+
var scale = e.view.devicePixelRatio;
|
|
356
|
+
deltaX = Math.round(deltaX / scale);
|
|
357
|
+
deltaY = Math.round(deltaY / scale);
|
|
358
|
+
}
|
|
359
|
+
this.createScrollEvent(type, timestamp, this.mouseLocation, deltaX, deltaY, modifiers);
|
|
353
360
|
},
|
|
354
361
|
|
|
355
362
|
// --------------------------------------------------------------------
|
|
@@ -188,6 +188,10 @@ JSClass("UILayer", JSObject, {
|
|
|
188
188
|
this.model.bounds = JSRect(bounds);
|
|
189
189
|
}
|
|
190
190
|
this.didChangeProperty('bounds.origin');
|
|
191
|
+
this.didChangeOrigin();
|
|
192
|
+
}
|
|
193
|
+
if (this.needsDisplayOnBoundsChange){
|
|
194
|
+
this.setNeedsDisplay();
|
|
191
195
|
}
|
|
192
196
|
},
|
|
193
197
|
|
|
@@ -240,14 +244,17 @@ JSClass("UILayer", JSObject, {
|
|
|
240
244
|
},
|
|
241
245
|
|
|
242
246
|
didChangeSize: function(){
|
|
243
|
-
if (this.needsDisplayOnBoundsChange){
|
|
244
|
-
this.setNeedsDisplay();
|
|
245
|
-
}
|
|
246
247
|
if (this.delegate && this.delegate.layerDidChangeSize){
|
|
247
248
|
this.delegate.layerDidChangeSize(this);
|
|
248
249
|
}
|
|
249
250
|
},
|
|
250
251
|
|
|
252
|
+
didChangeOrigin: function(){
|
|
253
|
+
if (this.delegate && this.delegate.layerDidChangeOrigin){
|
|
254
|
+
this.delegate.layerDidChangeOrigin(this);
|
|
255
|
+
}
|
|
256
|
+
},
|
|
257
|
+
|
|
251
258
|
setHidden: function(hidden){
|
|
252
259
|
if (hidden === this.model.hidden){
|
|
253
260
|
return;
|
|
@@ -335,6 +335,9 @@ JSClass("UIListView", UIScrollView, {
|
|
|
335
335
|
if (this._visibleItems.length === 0){
|
|
336
336
|
return;
|
|
337
337
|
}
|
|
338
|
+
if (this._edit !== null){
|
|
339
|
+
return;
|
|
340
|
+
}
|
|
338
341
|
var firstVisibleItem = this._visibleItems[0];
|
|
339
342
|
var lastVisibleItem = this._visibleItems[this._visibleItems.length - 1];
|
|
340
343
|
var searcher = JSBinarySearcher(this._visibleItems, VisibleItem.cellIndexPathCompare);
|
|
@@ -603,31 +606,11 @@ JSClass("UIListView", UIScrollView, {
|
|
|
603
606
|
animation = UIListView.RowAnimation.left;
|
|
604
607
|
}
|
|
605
608
|
this._beginEditIfNeeded(animation);
|
|
606
|
-
var items = this._visibleItems;
|
|
607
|
-
var itemIndex = 0;
|
|
608
|
-
var itemCount = items.length;
|
|
609
|
-
indexPaths = JSCopy(indexPaths);
|
|
610
|
-
indexPaths.sort(JSIndexPath.compare);
|
|
611
609
|
var indexPath;
|
|
612
|
-
var
|
|
613
|
-
var i, l;
|
|
614
|
-
var j;
|
|
615
|
-
for (i = 0, l = indexPaths.length; i < l; ++i){
|
|
610
|
+
for (var i = 0, l = indexPaths.length; i < l; ++i){
|
|
616
611
|
indexPath = indexPaths[i];
|
|
617
612
|
this._edit.deletedIndexPaths.push({indexPath: JSIndexPath(indexPath), animation: animation});
|
|
618
613
|
this._edit.didDeleteSelectedItem = this._edit.didDeleteSelectedItem || this._selectionContainsIndexPath(indexPath);
|
|
619
|
-
parent = indexPath.removingLastIndex();
|
|
620
|
-
while (itemIndex < itemCount && VisibleItem.cellIndexPathCompare(indexPath, items[itemIndex]) > 0){
|
|
621
|
-
++itemIndex;
|
|
622
|
-
}
|
|
623
|
-
if (itemIndex < itemCount && VisibleItem.cellIndexPathCompare(indexPath, items[itemIndex]) === 0){
|
|
624
|
-
items[itemIndex].state = VisibleItem.State.deleting;
|
|
625
|
-
items[itemIndex].animation = animation;
|
|
626
|
-
++itemIndex;
|
|
627
|
-
}
|
|
628
|
-
for (j = itemIndex; j < itemCount && items[j].indexPath.length > parent.length && items[j].indexPath.startsWith(parent); ++j){
|
|
629
|
-
items[j].indexPath[parent.length] -= 1;
|
|
630
|
-
}
|
|
631
614
|
}
|
|
632
615
|
},
|
|
633
616
|
|
|
@@ -643,7 +626,6 @@ JSClass("UIListView", UIScrollView, {
|
|
|
643
626
|
for (var i = 0, l = sections.length; i < l; ++i){
|
|
644
627
|
this._edit.insertedSections.push({section: sections[i], animation: animation});
|
|
645
628
|
}
|
|
646
|
-
this.__numberOfSections += sections.length;
|
|
647
629
|
},
|
|
648
630
|
|
|
649
631
|
deleteSection: function(section, animation){
|
|
@@ -655,30 +637,10 @@ JSClass("UIListView", UIScrollView, {
|
|
|
655
637
|
animation = UIListView.RowAnimation.left;
|
|
656
638
|
}
|
|
657
639
|
this._beginEditIfNeeded(animation);
|
|
658
|
-
sections = JSCopy(sections);
|
|
659
|
-
sections.sort();
|
|
660
640
|
var i, l;
|
|
661
|
-
var j;
|
|
662
|
-
var section;
|
|
663
|
-
var items = this._visibleItems;
|
|
664
|
-
var itemIndex;
|
|
665
|
-
var itemCount = items.length;
|
|
666
641
|
for (i = 0, l = sections.length; i < l; ++i){
|
|
667
|
-
section
|
|
668
|
-
this._edit.deletedSections.push({section: section, animation: animation});
|
|
669
|
-
while (itemIndex < itemCount && VisibleItem.sectionCompare(section, items[itemIndex]) > 0){
|
|
670
|
-
++itemIndex;
|
|
671
|
-
}
|
|
672
|
-
while (itemIndex < itemCount && VisibleItem.sectionCompare(section, items[itemIndex]) === 0){
|
|
673
|
-
items[itemIndex].state = VisibleItem.State.deleting;
|
|
674
|
-
items[itemIndex].animation = animation;
|
|
675
|
-
++itemIndex;
|
|
676
|
-
}
|
|
677
|
-
for (j = itemIndex; j < itemIndex && items[j].indexPath.section > section; ++j){
|
|
678
|
-
items[j].indexPath.section -= 1;
|
|
679
|
-
}
|
|
642
|
+
this._edit.deletedSections.push({section: sections[i], animation: animation});
|
|
680
643
|
}
|
|
681
|
-
this.__numberOfSections -= sections.length;
|
|
682
644
|
},
|
|
683
645
|
|
|
684
646
|
// --------------------------------------------------------------------
|
|
@@ -1153,6 +1115,7 @@ JSClass("UIListView", UIScrollView, {
|
|
|
1153
1115
|
return a.indexPath.compare(b.indexPath);
|
|
1154
1116
|
});
|
|
1155
1117
|
|
|
1118
|
+
this.__numberOfSections = this.__numberOfSections + edit.insertedSections.length - edit.deletedSections.length;
|
|
1156
1119
|
this._updateVisibleIndexPathsForEdit(edit);
|
|
1157
1120
|
this._updateSelectedIndexPathsForEdit(edit);
|
|
1158
1121
|
if (edit.didDeleteSelectedItem){
|
|
@@ -1257,6 +1220,15 @@ JSClass("UIListView", UIScrollView, {
|
|
|
1257
1220
|
this._updateVisibleCellStates();
|
|
1258
1221
|
this._updateRowCount();
|
|
1259
1222
|
|
|
1223
|
+
// remove deleted items from this._visibleItems
|
|
1224
|
+
this._visibleItems = JSCopy(items);
|
|
1225
|
+
for (i = this._visibleItems.length - 1; i >= 0; --i){
|
|
1226
|
+
item = this._visibleItems[i];
|
|
1227
|
+
if (item.state === VisibleItem.State.deleted){
|
|
1228
|
+
this._visibleItems.splice(i, 1);
|
|
1229
|
+
}
|
|
1230
|
+
}
|
|
1231
|
+
|
|
1260
1232
|
// Animate changes
|
|
1261
1233
|
var listView = this;
|
|
1262
1234
|
var animations = function(){
|
|
@@ -1270,13 +1242,12 @@ JSClass("UIListView", UIScrollView, {
|
|
|
1270
1242
|
var completion = function(){
|
|
1271
1243
|
var i, l;
|
|
1272
1244
|
var item;
|
|
1273
|
-
// enqueue deleted views
|
|
1245
|
+
// enqueue deleted views
|
|
1274
1246
|
for (i = items.length - 1; i >= 0; --i){
|
|
1275
1247
|
item = items[i];
|
|
1276
1248
|
if (item.state === VisibleItem.State.deleted){
|
|
1277
1249
|
item.view.alpha = 1;
|
|
1278
1250
|
listView._enqueueVisibleItem(item);
|
|
1279
|
-
items.splice(i, 1);
|
|
1280
1251
|
}
|
|
1281
1252
|
}
|
|
1282
1253
|
|
|
@@ -1310,36 +1281,83 @@ JSClass("UIListView", UIScrollView, {
|
|
|
1310
1281
|
},
|
|
1311
1282
|
|
|
1312
1283
|
_updateVisibleIndexPathsForEdit: function(edit){
|
|
1313
|
-
// account for inserted sections
|
|
1314
1284
|
var items = this._visibleItems;
|
|
1315
|
-
var itemIndex = 0;
|
|
1316
1285
|
var itemCount = items.length;
|
|
1286
|
+
var itemIndex = 0;
|
|
1317
1287
|
var i, l;
|
|
1318
1288
|
var j;
|
|
1319
|
-
var
|
|
1289
|
+
var indexPath;
|
|
1290
|
+
var parent;
|
|
1291
|
+
var info;
|
|
1292
|
+
var item;
|
|
1293
|
+
|
|
1294
|
+
// account for deleted index paths
|
|
1295
|
+
itemIndex = items.length - 1;
|
|
1296
|
+
for (i = edit.deletedIndexPaths.length - 1; i >= 0; --i){
|
|
1297
|
+
info = edit.deletedIndexPaths[i];
|
|
1298
|
+
parent = info.indexPath.removingLastIndex();
|
|
1299
|
+
while (itemIndex >= 0 && (items[itemIndex].kind !== VisibleItem.Kind.cell || (items[itemIndex].indexPath.isGreaterThan(info.indexPath) && !items[itemIndex].indexPath.startsWith(info.indexPath)))){
|
|
1300
|
+
--itemIndex;
|
|
1301
|
+
}
|
|
1302
|
+
while (itemIndex >= 0 && items[itemIndex].indexPath.startsWith(info.indexPath)){
|
|
1303
|
+
items[itemIndex].state = VisibleItem.State.deleting;
|
|
1304
|
+
items[itemIndex].animation = info.animation;
|
|
1305
|
+
items[itemIndex].indexPath = null;
|
|
1306
|
+
--itemIndex;
|
|
1307
|
+
}
|
|
1308
|
+
for (j = itemIndex + 1; j < itemCount && (items[j].indexPath === null || (items[j].indexPath.length > parent.length && items[j].indexPath.startsWith(parent))); ++j){
|
|
1309
|
+
if (items[j].kind === VisibleItem.Kind.cell && items[j].indexPath !== null){
|
|
1310
|
+
items[j].indexPath[parent.length] -= 1;
|
|
1311
|
+
}
|
|
1312
|
+
}
|
|
1313
|
+
}
|
|
1314
|
+
|
|
1315
|
+
// account for deleted sections
|
|
1316
|
+
itemIndex = items.length - 1;
|
|
1317
|
+
for (i = edit.deletedSections.length - 1; i >= 0; --i){
|
|
1318
|
+
info = edit.deletedSections[i];
|
|
1319
|
+
while (itemIndex >= 0 && (items[itemIndex].indexPath === null || items[itemIndex].indexPath.section > info.section)){
|
|
1320
|
+
--itemIndex;
|
|
1321
|
+
}
|
|
1322
|
+
while (itemIndex >= 0 && (items[itemIndex].indexPath === null || items[itemIndex].indexPath.section === info.section)){
|
|
1323
|
+
items[itemIndex].state = VisibleItem.State.deleting;
|
|
1324
|
+
items[itemIndex].animation = info.animation;
|
|
1325
|
+
items[itemIndex].indexPath = null;
|
|
1326
|
+
--itemIndex;
|
|
1327
|
+
}
|
|
1328
|
+
for (j = itemIndex + 1; j < itemCount; ++j){
|
|
1329
|
+
if (items[j].indexPath !== null){
|
|
1330
|
+
items[j].indexPath.section -= 1;
|
|
1331
|
+
}
|
|
1332
|
+
}
|
|
1333
|
+
}
|
|
1334
|
+
|
|
1335
|
+
// account for inserted sections
|
|
1336
|
+
itemIndex = 0;
|
|
1320
1337
|
for (i = 0, l = edit.insertedSections.length; i < l; ++i){
|
|
1321
|
-
|
|
1322
|
-
while (itemIndex < itemCount && (items[itemIndex].
|
|
1338
|
+
info = edit.insertedSections[i];
|
|
1339
|
+
while (itemIndex < itemCount && (items[itemIndex].indexPath === null || items[itemIndex].indexPath.section < info.section)){
|
|
1323
1340
|
++itemIndex;
|
|
1324
1341
|
}
|
|
1325
1342
|
for (j = itemIndex; j < itemCount; ++j){
|
|
1326
|
-
items[j].indexPath
|
|
1343
|
+
if (items[j].indexPath !== null){
|
|
1344
|
+
items[j].indexPath.section += 1;
|
|
1345
|
+
}
|
|
1327
1346
|
}
|
|
1328
1347
|
}
|
|
1329
1348
|
|
|
1330
1349
|
// account for inserted index paths
|
|
1331
1350
|
itemIndex = 0;
|
|
1332
|
-
var indexPath;
|
|
1333
|
-
var parent;
|
|
1334
|
-
var info;
|
|
1335
1351
|
for (i = 0, l = edit.insertedIndexPaths.length; i < l; ++i){
|
|
1336
1352
|
info = edit.insertedIndexPaths[i];
|
|
1337
1353
|
parent = info.indexPath.removingLastIndex();
|
|
1338
|
-
while (itemIndex < itemCount && (items[itemIndex].
|
|
1354
|
+
while (itemIndex < itemCount && (items[itemIndex].indexPath === null || items[itemIndex].indexPath.isLessThan(info.indexPath))){
|
|
1339
1355
|
++itemIndex;
|
|
1340
1356
|
}
|
|
1341
|
-
for (j = itemIndex; j < itemCount && items[j].indexPath.length > parent.length && items[j].indexPath.startsWith(parent); ++j){
|
|
1342
|
-
items[j].
|
|
1357
|
+
for (j = itemIndex; j < itemCount && (items[j].indexPath === null || (items[j].indexPath.length > parent.length && items[j].indexPath.startsWith(parent))); ++j){
|
|
1358
|
+
if (items[j].kind === VisibleItem.Kind.cell && items[j].indexPath !== null){
|
|
1359
|
+
items[j].indexPath[parent.length] += 1;
|
|
1360
|
+
}
|
|
1343
1361
|
}
|
|
1344
1362
|
}
|
|
1345
1363
|
|
|
@@ -1583,7 +1601,7 @@ JSClass("UIListView", UIScrollView, {
|
|
|
1583
1601
|
|
|
1584
1602
|
_adoptCell: function(cell, indexPath){
|
|
1585
1603
|
cell.listView = this;
|
|
1586
|
-
cell.indexPath = indexPath;
|
|
1604
|
+
cell.indexPath = JSIndexPath(indexPath);
|
|
1587
1605
|
cell.accessibilityRowIndex = this._rowForIndexPath(indexPath);
|
|
1588
1606
|
cell.postAccessibilityElementChangedNotification();
|
|
1589
1607
|
},
|
|
@@ -1755,6 +1773,9 @@ JSClass("UIListView", UIScrollView, {
|
|
|
1755
1773
|
_setSelectedIndexPaths: function(selectedIndexPaths, options){
|
|
1756
1774
|
var indexPaths = JSCopy(selectedIndexPaths);
|
|
1757
1775
|
indexPaths.sort(JSIndexPath.compare);
|
|
1776
|
+
if (this._edit !== null){
|
|
1777
|
+
this._edit.selectionChanged = true;
|
|
1778
|
+
}
|
|
1758
1779
|
if (indexPaths.length === this._selectedIndexPaths.length){
|
|
1759
1780
|
for (var i = 0, l = this._selectedIndexPaths.length; i < l; ++i){
|
|
1760
1781
|
if (!indexPaths[i].isEqual(this._selectedIndexPaths[i])){
|
|
@@ -1769,9 +1790,6 @@ JSClass("UIListView", UIScrollView, {
|
|
|
1769
1790
|
return;
|
|
1770
1791
|
}
|
|
1771
1792
|
this._selectedIndexPaths = indexPaths;
|
|
1772
|
-
if (this._edit !== null){
|
|
1773
|
-
this._edit.selectionChanged = true;
|
|
1774
|
-
}
|
|
1775
1793
|
this._updateSelectedIndexPaths(options);
|
|
1776
1794
|
},
|
|
1777
1795
|
|
|
@@ -284,7 +284,9 @@ JSClass("UIPopupWindow", UIWindow, {
|
|
|
284
284
|
|
|
285
285
|
indicateModalStatus: function(){
|
|
286
286
|
if (this.modalIndicationClosesWindow){
|
|
287
|
-
this.
|
|
287
|
+
if (this.openAnimator.percentComplete > 0.9){
|
|
288
|
+
this.close();
|
|
289
|
+
}
|
|
288
290
|
return;
|
|
289
291
|
}
|
|
290
292
|
if (this._modalAnimator !== null){
|
|
@@ -413,7 +413,13 @@ JSClass('UIView', UIResponder, {
|
|
|
413
413
|
|
|
414
414
|
getNextValidKeyView: function(){
|
|
415
415
|
if (this._nextKeyView !== null){
|
|
416
|
-
|
|
416
|
+
var hidden = this._nextKeyView.hidden || this._nextKeyView.window === null;
|
|
417
|
+
var superview = this._nextKeyView.superview;
|
|
418
|
+
while (!hidden && superview !== null){
|
|
419
|
+
hidden = superview.hidden;
|
|
420
|
+
superview = superview.superview;
|
|
421
|
+
}
|
|
422
|
+
if (hidden || !this._nextKeyView.canBecomeFirstResponder()){
|
|
417
423
|
return this._nextKeyView.nextValidKeyView;
|
|
418
424
|
}
|
|
419
425
|
return this._nextKeyView;
|
|
@@ -423,7 +429,13 @@ JSClass('UIView', UIResponder, {
|
|
|
423
429
|
|
|
424
430
|
getPreviousValidKeyView: function(){
|
|
425
431
|
if (this._previousKeyView !== null){
|
|
426
|
-
|
|
432
|
+
var hidden = this._previousKeyView.hidden || this._previousKeyView.window === null;
|
|
433
|
+
var superview = this._previousKeyView.superview;
|
|
434
|
+
while (!hidden && superview !== null){
|
|
435
|
+
hidden = superview.hidden;
|
|
436
|
+
superview = superview.superview;
|
|
437
|
+
}
|
|
438
|
+
if (hidden || !this._previousKeyView.canBecomeFirstResponder()){
|
|
427
439
|
return this._previousKeyView.previousValidKeyView;
|
|
428
440
|
}
|
|
429
441
|
return this._previousKeyView;
|
|
@@ -550,6 +562,13 @@ JSClass('UIView', UIResponder, {
|
|
|
550
562
|
}
|
|
551
563
|
},
|
|
552
564
|
|
|
565
|
+
layerDidChangeOrigin: function(layer){
|
|
566
|
+
if (layer === this.layer){
|
|
567
|
+
this.invalidateFocusRingPath();
|
|
568
|
+
this.updateMouseTrackingAreas();
|
|
569
|
+
}
|
|
570
|
+
},
|
|
571
|
+
|
|
553
572
|
// -------------------------------------------------------------------------
|
|
554
573
|
// MARK: - Constraints
|
|
555
574
|
|