@breakside/jskit 2023.14.0 → 2023.14.2
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/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/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/UICollectionView.js +1 -0
- package/Root/Frameworks/UIKit/UIHTMLTextField.js +2 -1
- package/Root/Frameworks/UIKit/UIListView.js +1 -0
- package/Root/Frameworks/UIKit/UITextEditor.js +59 -8
- package/Root/Frameworks/UIKit/UITextField.js +1 -0
- package/Root/Frameworks/UIKit/UITokenField.js +1 -1
- package/Root/Frameworks/UIKit/UIToolbar.js +19 -11
- package/Root/Frameworks/UIKit/UIWindow.js +12 -6
- 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": "2023.14.
|
|
4
|
+
"JSBundleVersion": "2023.14.2",
|
|
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": "6f86f2573816ad42a61484b3628c92e9acd3f56d"
|
|
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": "2023.14.
|
|
6
|
+
"JSBundleVersion": "2023.14.2",
|
|
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": "6f86f2573816ad42a61484b3628c92e9acd3f56d"
|
|
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": "2023.14.
|
|
4
|
+
"JSBundleVersion": "2023.14.2",
|
|
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": "6f86f2573816ad42a61484b3628c92e9acd3f56d"
|
|
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": "2023.14.
|
|
6
|
+
"JSBundleVersion": "2023.14.2",
|
|
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": "6f86f2573816ad42a61484b3628c92e9acd3f56d"
|
|
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": "2023.14.
|
|
4
|
+
"JSBundleVersion": "2023.14.2",
|
|
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": "6f86f2573816ad42a61484b3628c92e9acd3f56d"
|
|
13
13
|
}
|
|
@@ -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": "2023.14.
|
|
6
|
+
"JSBundleVersion": "2023.14.2",
|
|
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": "6f86f2573816ad42a61484b3628c92e9acd3f56d"
|
|
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": "2023.14.
|
|
4
|
+
"JSBundleVersion": "2023.14.2",
|
|
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": "6f86f2573816ad42a61484b3628c92e9acd3f56d"
|
|
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": "2023.14.
|
|
6
|
+
"JSBundleVersion": "2023.14.2",
|
|
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": "6f86f2573816ad42a61484b3628c92e9acd3f56d"
|
|
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": "2023.14.
|
|
4
|
+
"JSBundleVersion": "2023.14.2",
|
|
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": "6f86f2573816ad42a61484b3628c92e9acd3f56d"
|
|
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": "2023.14.
|
|
6
|
+
"JSBundleVersion": "2023.14.2",
|
|
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": "6f86f2573816ad42a61484b3628c92e9acd3f56d"
|
|
14
14
|
},
|
|
15
15
|
"Resources": [
|
|
16
16
|
{
|
|
@@ -105,7 +105,7 @@ JSClass("UIHTMLTextField", UIControl, {
|
|
|
105
105
|
this._clipView.userInteractionEnabled = false;
|
|
106
106
|
this._clipView.backgroundColor = null;
|
|
107
107
|
this._clipView.clipsToBounds = true;
|
|
108
|
-
this.cursor = UICursor.
|
|
108
|
+
this.cursor = UICursor.systemDefault;
|
|
109
109
|
if (this._styler === null){
|
|
110
110
|
this._styler = UITextField.Styler.default;
|
|
111
111
|
}
|
|
@@ -784,6 +784,7 @@ JSClass("UIHTMLTextField", UIControl, {
|
|
|
784
784
|
|
|
785
785
|
windowDidChangeKeyStatus: function(){
|
|
786
786
|
this.updateInputElementFocus();
|
|
787
|
+
UIHTMLTextField.$super.windowDidChangeKeyStatus.call(this);
|
|
787
788
|
},
|
|
788
789
|
|
|
789
790
|
_inputElementFocused: false,
|
|
@@ -202,23 +202,51 @@ JSClass("UITextEditor", JSObject, {
|
|
|
202
202
|
}
|
|
203
203
|
this._draggingSelection = null;
|
|
204
204
|
},
|
|
205
|
+
_touchBeganInfo: null,
|
|
205
206
|
|
|
206
207
|
handleTouchesBeganAtLocation: function(location, touches, event){
|
|
207
208
|
this._setSingleSelectionAtLocation(location);
|
|
209
|
+
this._touchBeganInfo = {
|
|
210
|
+
timestamp: event.timestamp,
|
|
211
|
+
location: location,
|
|
212
|
+
moved: false
|
|
213
|
+
};
|
|
208
214
|
},
|
|
209
215
|
|
|
210
216
|
handleTouchesMovedAtLocation: function(location, touches, event){
|
|
211
217
|
this._setSingleSelectionAtLocation(location);
|
|
218
|
+
if (this._touchBeganInfo !== null){
|
|
219
|
+
this._touchBeganInfo.moved = this._touchBeganInfo.moved || location.distanceToPoint(this._touchBeganInfo.location) > 10;
|
|
220
|
+
}
|
|
212
221
|
},
|
|
213
222
|
|
|
214
223
|
handleTouchesEndedAtLocation: function(location, touches, event){
|
|
215
224
|
this._setSingleSelectionAtLocation(location);
|
|
225
|
+
if (this._touchBeganInfo !== null){
|
|
226
|
+
this._touchBeganInfo = null;
|
|
227
|
+
}
|
|
216
228
|
},
|
|
217
229
|
|
|
218
230
|
handleTouchesEnded: function(touches, event){
|
|
231
|
+
if (this._touchBeganInfo !== null){
|
|
232
|
+
if (this.selections.length === 1 && !this._touchBeganInfo.moved){
|
|
233
|
+
if ((event.timestamp - this._touchBeganInfo.timestamp) > JSTimeInterval.seconds(0.5)){
|
|
234
|
+
var selection = this.selections[0];
|
|
235
|
+
var range = this.textLayoutManager.textStorage.string.rangeForWordAtIndex(this.selections[0].range.location);
|
|
236
|
+
if (range.length > 0){
|
|
237
|
+
var wordSelection = this._createSelection(range);
|
|
238
|
+
this._setSingleSelection(wordSelection);
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
this._touchBeganInfo = null;
|
|
243
|
+
}
|
|
219
244
|
},
|
|
220
245
|
|
|
221
246
|
handleTouchesCanceled: function(touches, event){
|
|
247
|
+
if (this._touchBeganInfo !== null){
|
|
248
|
+
this._touchBeganInfo = null;
|
|
249
|
+
}
|
|
222
250
|
},
|
|
223
251
|
|
|
224
252
|
didBecomeFirstResponder: function(isWindowKey, shouldSelect){
|
|
@@ -436,6 +464,28 @@ JSClass("UITextEditor", JSObject, {
|
|
|
436
464
|
this._toggleBooleanAttribute("underline", "Underline");
|
|
437
465
|
},
|
|
438
466
|
|
|
467
|
+
strike: function(sender){
|
|
468
|
+
this._toggleBooleanAttribute("strike", "Strike");
|
|
469
|
+
},
|
|
470
|
+
|
|
471
|
+
setAttribute: function(name, value, undoName){
|
|
472
|
+
this.undoManager.beginUndoGrouping();
|
|
473
|
+
var i, l;
|
|
474
|
+
var selection;
|
|
475
|
+
var selections = this._selectionsCopy();
|
|
476
|
+
for (i = 0, l = selections.length; i < l; ++i){
|
|
477
|
+
selection = selections[i];
|
|
478
|
+
this._setAttributeValueForSelection(name, value, selection);
|
|
479
|
+
}
|
|
480
|
+
this._setSelectionsAllowingUndo(selections);
|
|
481
|
+
this.undoManager.endUndoGrouping();
|
|
482
|
+
this.undoManager.setActionName(undoName);
|
|
483
|
+
},
|
|
484
|
+
|
|
485
|
+
removeAttribute: function(name, undoName){
|
|
486
|
+
this.setAttribute(name, undefined, undoName);
|
|
487
|
+
},
|
|
488
|
+
|
|
439
489
|
removeParagraphAttribute: function(name, undoName){
|
|
440
490
|
this.setParagraphAttribute(name, undefined, undoName);
|
|
441
491
|
},
|
|
@@ -535,7 +585,7 @@ JSClass("UITextEditor", JSObject, {
|
|
|
535
585
|
var selections = this._selectionsCopy();
|
|
536
586
|
for (i = 0, l = selections.length; i < l; ++i){
|
|
537
587
|
selection = selections[i];
|
|
538
|
-
this.
|
|
588
|
+
this._setAttributeValueForSelection(name, !currentValue, selection);
|
|
539
589
|
}
|
|
540
590
|
this._setSelectionsAllowingUndo(selections);
|
|
541
591
|
this.undoManager.endUndoGrouping();
|
|
@@ -543,25 +593,26 @@ JSClass("UITextEditor", JSObject, {
|
|
|
543
593
|
this._resetSelectionAffinity();
|
|
544
594
|
},
|
|
545
595
|
|
|
546
|
-
|
|
596
|
+
_setAttributeValueForSelection: function(name, value, selection){
|
|
547
597
|
var textStorage = this.textLayoutManager.textStorage;
|
|
548
598
|
var replacementString;
|
|
549
599
|
if (selection.range.length > 0){
|
|
550
600
|
replacementString = textStorage.attributedSubstringInRange(selection.range);
|
|
551
|
-
if (value){
|
|
552
|
-
replacementString.addAttributeInRange(name,
|
|
601
|
+
if (value !== null && value !== undefined){
|
|
602
|
+
replacementString.addAttributeInRange(name, value, JSRange(0, replacementString.string.length));
|
|
553
603
|
}else{
|
|
554
604
|
replacementString.removeAttributeInRange(name, JSRange(0, replacementString.string.length));
|
|
555
605
|
}
|
|
556
606
|
this._replaceTextStorageRangeAllowingUndo(textStorage, selection.range, replacementString);
|
|
557
607
|
}else{
|
|
558
608
|
selection.attributes = this._insertAttributesForSelection(selection);
|
|
559
|
-
|
|
560
|
-
|
|
609
|
+
var currentValue = selection.attributes[name];
|
|
610
|
+
if (value !== null && value !== undefined){
|
|
611
|
+
selection.attributes[name] = value;
|
|
561
612
|
}else{
|
|
562
613
|
delete selection.attributes[name];
|
|
563
614
|
}
|
|
564
|
-
this.undoManager.registerUndo(this, this.
|
|
615
|
+
this.undoManager.registerUndo(this, this._setAttributeValueForSelection, name, currentValue, selection);
|
|
565
616
|
}
|
|
566
617
|
},
|
|
567
618
|
|
|
@@ -723,7 +774,7 @@ JSClass("UITextEditor", JSObject, {
|
|
|
723
774
|
}
|
|
724
775
|
var index = selection.range.location;
|
|
725
776
|
var iterator;
|
|
726
|
-
if (index > 0){
|
|
777
|
+
if (selection.range.length === 0 && index > 0){
|
|
727
778
|
iterator = this.textLayoutManager.textStorage.string.userPerceivedCharacterIterator(index);
|
|
728
779
|
iterator.decrement();
|
|
729
780
|
if (!iterator.isParagraphBreak){
|
|
@@ -201,7 +201,7 @@ JSClass("UITokenFieldTokenView", UIView, {
|
|
|
201
201
|
this.tokenLabel.cornerRadius = 3.0;
|
|
202
202
|
this.addSubview(this.tokenLabel);
|
|
203
203
|
this._tokenInsets = JSInsets(0, 1.5);
|
|
204
|
-
this.tokenLabel.cursor = UICursor.
|
|
204
|
+
this.tokenLabel.cursor = UICursor.systemDefault;
|
|
205
205
|
this.setNeedsLayout();
|
|
206
206
|
},
|
|
207
207
|
|
|
@@ -78,7 +78,7 @@ JSClass("UIToolbar", UIView, {
|
|
|
78
78
|
|
|
79
79
|
setItems: function(items){
|
|
80
80
|
var i, l;
|
|
81
|
-
for (i = this._items.length; i >= 0; --i){
|
|
81
|
+
for (i = this._items.length - 1; i >= 0; --i){
|
|
82
82
|
this.removeItemAtIndex(i);
|
|
83
83
|
}
|
|
84
84
|
for (i = 0, l = items.length; i < l; ++i){
|
|
@@ -218,7 +218,7 @@ JSClass("UIToolbarItemView", UIView, {
|
|
|
218
218
|
}else{
|
|
219
219
|
switch (item.identifier){
|
|
220
220
|
case UIToolbarItem.Identifier.space:
|
|
221
|
-
this.contentView = UIToolbarItemSpaceView.initWithWidth(item.
|
|
221
|
+
this.contentView = UIToolbarItemSpaceView.initWithWidth(item.minimumSize !== null ? item.minimumSize.width : item.toolbar.imageSize);
|
|
222
222
|
this._handlesEvents = false;
|
|
223
223
|
break;
|
|
224
224
|
case UIToolbarItem.Identifier.flexibleSpace:
|
|
@@ -267,10 +267,11 @@ JSClass("UIToolbarItemView", UIView, {
|
|
|
267
267
|
}
|
|
268
268
|
var width;
|
|
269
269
|
var height;
|
|
270
|
-
if (
|
|
271
|
-
width = this._item.minimumWidth;
|
|
272
|
-
}else if (this._item.view !== null){
|
|
270
|
+
if (this._item.view !== null){
|
|
273
271
|
width = this._item.view.intrinsicSize.width;
|
|
272
|
+
if (width === UIView.noIntrinsicSize){
|
|
273
|
+
width = bounds.size.width;
|
|
274
|
+
}
|
|
274
275
|
}else{
|
|
275
276
|
width = this._item.image.size.width * toolbar._imageSize / this._item.image.size.height;
|
|
276
277
|
}
|
|
@@ -292,10 +293,15 @@ JSClass("UIToolbarItemView", UIView, {
|
|
|
292
293
|
var toolbar = this._item.toolbar;
|
|
293
294
|
var width;
|
|
294
295
|
if (this._item.identifier == UIToolbarItem.Identifier.custom){
|
|
295
|
-
if (
|
|
296
|
-
width = this._item.minimumWidth;
|
|
297
|
-
}else if (this._item.view !== null){
|
|
296
|
+
if (this._item.view !== null){
|
|
298
297
|
width = this._item.view.intrinsicSize.width;
|
|
298
|
+
if (width === UIView.noIntrinsicSize){
|
|
299
|
+
if (this._item.minimumSize !== null){
|
|
300
|
+
width = this._item.minimumSize.width;
|
|
301
|
+
}else{
|
|
302
|
+
width = toolbar._imageSize;
|
|
303
|
+
}
|
|
304
|
+
}
|
|
299
305
|
}else{
|
|
300
306
|
width = this._item.image.size.width * toolbar._imageSize / this._item.image.size.height;
|
|
301
307
|
}
|
|
@@ -541,7 +547,7 @@ JSClass("UIToolbarCustomStyler", UIToolbarStyler, {
|
|
|
541
547
|
itemView.index = i;
|
|
542
548
|
itemView.item = item;
|
|
543
549
|
}
|
|
544
|
-
for (var j =
|
|
550
|
+
for (var j = props.itemViews.length - 1; j >= i; --j){
|
|
545
551
|
itemView = props.itemViews.pop();
|
|
546
552
|
itemView.removeFromSuperview();
|
|
547
553
|
}
|
|
@@ -593,7 +599,7 @@ JSClass("UIToolbarCustomStyler", UIToolbarStyler, {
|
|
|
593
599
|
},
|
|
594
600
|
|
|
595
601
|
createOverflowMenuForToolbar: function(toolbar){
|
|
596
|
-
var index = toolbar.stylerProperties.lastVisibleIndex;
|
|
602
|
+
var index = toolbar.stylerProperties.lastVisibleIndex + 1;
|
|
597
603
|
var overflowItems = [];
|
|
598
604
|
var i, l;
|
|
599
605
|
var item;
|
|
@@ -656,6 +662,8 @@ JSClass("UIToolbarCustomStyler", UIToolbarStyler, {
|
|
|
656
662
|
itemsWidth += size.width;
|
|
657
663
|
if (item.identifier === UIToolbarItem.Identifier.flexibleSpace){
|
|
658
664
|
flexibleItemSizes.push(size);
|
|
665
|
+
}else if (item.minimumSize !== null && item.maximumSize !== null && item.minimumSize.width < item.maximumSize.width){
|
|
666
|
+
flexibleItemSizes.push(size);
|
|
659
667
|
}
|
|
660
668
|
}
|
|
661
669
|
itemsWidth += (props.itemViews.length - 1) * this.itemSpacing;
|
|
@@ -691,7 +699,7 @@ JSClass("UIToolbarCustomStyler", UIToolbarStyler, {
|
|
|
691
699
|
if (flexibleItemSizes.length > 0){
|
|
692
700
|
var flexibleWidth = extraSpace / flexibleItemSizes.length;
|
|
693
701
|
for (i = 0, l = flexibleItemSizes.length; i < l; ++i){
|
|
694
|
-
flexibleItemSizes[i].width
|
|
702
|
+
flexibleItemSizes[i].width += flexibleWidth;
|
|
695
703
|
}
|
|
696
704
|
}
|
|
697
705
|
|
|
@@ -395,7 +395,7 @@ JSClass('UIWindow', UIView, {
|
|
|
395
395
|
|
|
396
396
|
makeKeyAndOrderFront: function(){
|
|
397
397
|
this.orderFront();
|
|
398
|
-
this.
|
|
398
|
+
this.makeKey();
|
|
399
399
|
},
|
|
400
400
|
|
|
401
401
|
receivesAllEvents: false,
|
|
@@ -821,9 +821,7 @@ JSClass('UIWindow', UIView, {
|
|
|
821
821
|
enters.push(area);
|
|
822
822
|
}
|
|
823
823
|
}
|
|
824
|
-
|
|
825
|
-
moves.push(area);
|
|
826
|
-
}
|
|
824
|
+
moves.push(area);
|
|
827
825
|
}else{
|
|
828
826
|
if (area._entered){
|
|
829
827
|
area._entered = false;
|
|
@@ -844,6 +842,12 @@ JSClass('UIWindow', UIView, {
|
|
|
844
842
|
area = exits[areaIndex];
|
|
845
843
|
area.mouseExited(event);
|
|
846
844
|
}
|
|
845
|
+
for (areaIndex = 0, areaCount = moves.length; areaIndex < areaCount; ++areaIndex){
|
|
846
|
+
area = moves[areaIndex];
|
|
847
|
+
if (area.cursor !== null){
|
|
848
|
+
area.cursor.set();
|
|
849
|
+
}
|
|
850
|
+
}
|
|
847
851
|
}
|
|
848
852
|
if (enters.length > 0){
|
|
849
853
|
event = UIEvent.initMouseEventWithType(UIEvent.Type.mouseEntered, timestamp, this, locationInWindow, modifiers, 0);
|
|
@@ -855,8 +859,10 @@ JSClass('UIWindow', UIView, {
|
|
|
855
859
|
if (moves.length > 0){
|
|
856
860
|
event = UIEvent.initMouseEventWithType(UIEvent.Type.mouseMoved, timestamp, this, locationInWindow, modifiers, 0);
|
|
857
861
|
for (areaIndex = 0, areaCount = moves.length; areaIndex < areaCount; ++areaIndex){
|
|
858
|
-
area
|
|
859
|
-
|
|
862
|
+
if ((area.trackingType & UIMouseTrackingArea.TrackingType.move) !== 0){
|
|
863
|
+
area = moves[areaIndex];
|
|
864
|
+
area.mouseMoved(event);
|
|
865
|
+
}
|
|
860
866
|
}
|
|
861
867
|
}
|
|
862
868
|
},
|