@breakside/jskit 2023.22.0 → 2023.28.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/JS/DOMElement.js +8 -0
- package/Frameworks/DOM.jsframework/JS/XMLSerializer.js +29 -3
- 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/JS/JSTextLayoutManager.js +3 -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/DOMElement.js +8 -0
- package/Root/Frameworks/DOM/Info.yaml +1 -1
- package/Root/Frameworks/DOM/XMLSerializer.js +29 -3
- 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/Foundation/JSTextLayoutManager.js +3 -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/UIButton.js +1 -1
- package/Root/Frameworks/UIKit/UIPopupWindow.js +1 -0
- package/Root/Frameworks/UIKit/UITextEditor.js +15 -7
- package/Root/Frameworks/UIKit/UITextField.js +9 -0
- package/Root/Frameworks/UIKit/UITextLayer.js +4 -2
- package/Root/Frameworks/UIKit/UITokenField.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": "2023.
|
|
4
|
+
"JSBundleVersion": "2023.28.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": "0e1ac6ead47e74227fb1b44b3437a90e5e63871f"
|
|
13
13
|
}
|
|
@@ -14,6 +14,7 @@
|
|
|
14
14
|
// limitations under the License.
|
|
15
15
|
|
|
16
16
|
// #import "DOMNode.js"
|
|
17
|
+
/* global XMLSerializer */
|
|
17
18
|
'use strict';
|
|
18
19
|
|
|
19
20
|
DOM.Element.prototype = Object.create(DOM.Node.prototype, {
|
|
@@ -107,6 +108,13 @@ DOM.Element.prototype = Object.create(DOM.Node.prototype, {
|
|
|
107
108
|
delete this._attributeMap[':global:'][name];
|
|
108
109
|
}
|
|
109
110
|
}
|
|
111
|
+
},
|
|
112
|
+
|
|
113
|
+
innerHTML: {
|
|
114
|
+
get: function DOMElement_innerHTML(){
|
|
115
|
+
var serializer = new XMLSerializer();
|
|
116
|
+
return serializer._serializeToString(this, true);
|
|
117
|
+
}
|
|
110
118
|
}
|
|
111
119
|
|
|
112
120
|
});
|
|
@@ -21,7 +21,12 @@ JSGlobalObject.XMLSerializer = function XMLSerializer(){
|
|
|
21
21
|
|
|
22
22
|
XMLSerializer.prototype = {
|
|
23
23
|
|
|
24
|
-
serializeToString: function(
|
|
24
|
+
serializeToString: function(node){
|
|
25
|
+
return this._serializeToString(node, false);
|
|
26
|
+
},
|
|
27
|
+
|
|
28
|
+
_serializeToString: function(node, childrenOnly){
|
|
29
|
+
var document = node.ownerDocument || node;
|
|
25
30
|
var doctype = document.doctype;
|
|
26
31
|
var isHTML = doctype && doctype.name == "html";
|
|
27
32
|
var str = "";
|
|
@@ -127,10 +132,31 @@ XMLSerializer.prototype = {
|
|
|
127
132
|
}
|
|
128
133
|
};
|
|
129
134
|
|
|
130
|
-
if (!isHTML){
|
|
135
|
+
if (!isHTML && !childrenOnly){
|
|
131
136
|
str += '<?xml version="1.0" encoding="utf-8"?>\n';
|
|
132
137
|
}
|
|
133
|
-
|
|
138
|
+
if (childrenOnly){
|
|
139
|
+
var namespaces = {':global:': null};
|
|
140
|
+
if (node.nodeType === DOM.Node.ELEMENT_NODE){
|
|
141
|
+
if (node.namespaceURI !== null){
|
|
142
|
+
if (node.prefix !== null){
|
|
143
|
+
if (namespaces[node.prefix] != node.namespaceURI){
|
|
144
|
+
namespaces[node.prefix] = node.namespaceURI;
|
|
145
|
+
}
|
|
146
|
+
}else{
|
|
147
|
+
if (namespaces[':global:'] !== node.namespaceURI){
|
|
148
|
+
namespaces[':global:'] = node.namespaceURI;
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
var i, l;
|
|
154
|
+
for (i = 0, l = node.childNodes.length; i < l; ++i){
|
|
155
|
+
writeNode(node.childNodes[i], namespaces);
|
|
156
|
+
}
|
|
157
|
+
}else{
|
|
158
|
+
writeNode(node, {':global:': null});
|
|
159
|
+
}
|
|
134
160
|
|
|
135
161
|
return str;
|
|
136
162
|
}
|
|
@@ -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.
|
|
6
|
+
"JSBundleVersion": "2023.28.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": "0e1ac6ead47e74227fb1b44b3437a90e5e63871f"
|
|
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.
|
|
4
|
+
"JSBundleVersion": "2023.28.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": "0e1ac6ead47e74227fb1b44b3437a90e5e63871f"
|
|
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.
|
|
6
|
+
"JSBundleVersion": "2023.28.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": "0e1ac6ead47e74227fb1b44b3437a90e5e63871f"
|
|
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.
|
|
4
|
+
"JSBundleVersion": "2023.28.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": "0e1ac6ead47e74227fb1b44b3437a90e5e63871f"
|
|
13
13
|
}
|
|
@@ -360,7 +360,7 @@ JSClass("JSAttributedString", JSObject, {
|
|
|
360
360
|
var run = this._runs[runRange.location];
|
|
361
361
|
run.attributes = JSCopy(attributes);
|
|
362
362
|
if (runRange.length > 1){
|
|
363
|
-
run.range.length = this._runs[runRange.end - 1].end - run.range.location;
|
|
363
|
+
run.range.length = this._runs[runRange.end - 1].range.end - run.range.location;
|
|
364
364
|
this._runs.splice(runRange.location + 1, runRange.length - 1);
|
|
365
365
|
}
|
|
366
366
|
this._fixRunsInRunRange(JSRange(runRange.location, 1));
|
|
@@ -72,6 +72,9 @@ JSClass("JSTextLayoutManager", JSObject, {
|
|
|
72
72
|
|
|
73
73
|
replaceTextStorage: function(storage){
|
|
74
74
|
var originalStorage = this._textStorage;
|
|
75
|
+
if (storage === originalStorage){
|
|
76
|
+
return;
|
|
77
|
+
}
|
|
75
78
|
if (originalStorage !== null){
|
|
76
79
|
var managers = originalStorage.layoutManagers;
|
|
77
80
|
originalStorage.removeAllLayoutManagers();
|
|
@@ -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.
|
|
6
|
+
"JSBundleVersion": "2023.28.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": "0e1ac6ead47e74227fb1b44b3437a90e5e63871f"
|
|
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.
|
|
4
|
+
"JSBundleVersion": "2023.28.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": "0e1ac6ead47e74227fb1b44b3437a90e5e63871f"
|
|
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.
|
|
6
|
+
"JSBundleVersion": "2023.28.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": "0e1ac6ead47e74227fb1b44b3437a90e5e63871f"
|
|
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.
|
|
4
|
+
"JSBundleVersion": "2023.28.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": "0e1ac6ead47e74227fb1b44b3437a90e5e63871f"
|
|
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.
|
|
6
|
+
"JSBundleVersion": "2023.28.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": "0e1ac6ead47e74227fb1b44b3437a90e5e63871f"
|
|
14
14
|
},
|
|
15
15
|
"Resources": [
|
|
16
16
|
{
|
|
@@ -14,6 +14,7 @@
|
|
|
14
14
|
// limitations under the License.
|
|
15
15
|
|
|
16
16
|
// #import "DOMNode.js"
|
|
17
|
+
/* global XMLSerializer */
|
|
17
18
|
'use strict';
|
|
18
19
|
|
|
19
20
|
DOM.Element.prototype = Object.create(DOM.Node.prototype, {
|
|
@@ -107,6 +108,13 @@ DOM.Element.prototype = Object.create(DOM.Node.prototype, {
|
|
|
107
108
|
delete this._attributeMap[':global:'][name];
|
|
108
109
|
}
|
|
109
110
|
}
|
|
111
|
+
},
|
|
112
|
+
|
|
113
|
+
innerHTML: {
|
|
114
|
+
get: function DOMElement_innerHTML(){
|
|
115
|
+
var serializer = new XMLSerializer();
|
|
116
|
+
return serializer._serializeToString(this, true);
|
|
117
|
+
}
|
|
110
118
|
}
|
|
111
119
|
|
|
112
120
|
});
|
|
@@ -21,7 +21,12 @@ JSGlobalObject.XMLSerializer = function XMLSerializer(){
|
|
|
21
21
|
|
|
22
22
|
XMLSerializer.prototype = {
|
|
23
23
|
|
|
24
|
-
serializeToString: function(
|
|
24
|
+
serializeToString: function(node){
|
|
25
|
+
return this._serializeToString(node, false);
|
|
26
|
+
},
|
|
27
|
+
|
|
28
|
+
_serializeToString: function(node, childrenOnly){
|
|
29
|
+
var document = node.ownerDocument || node;
|
|
25
30
|
var doctype = document.doctype;
|
|
26
31
|
var isHTML = doctype && doctype.name == "html";
|
|
27
32
|
var str = "";
|
|
@@ -127,10 +132,31 @@ XMLSerializer.prototype = {
|
|
|
127
132
|
}
|
|
128
133
|
};
|
|
129
134
|
|
|
130
|
-
if (!isHTML){
|
|
135
|
+
if (!isHTML && !childrenOnly){
|
|
131
136
|
str += '<?xml version="1.0" encoding="utf-8"?>\n';
|
|
132
137
|
}
|
|
133
|
-
|
|
138
|
+
if (childrenOnly){
|
|
139
|
+
var namespaces = {':global:': null};
|
|
140
|
+
if (node.nodeType === DOM.Node.ELEMENT_NODE){
|
|
141
|
+
if (node.namespaceURI !== null){
|
|
142
|
+
if (node.prefix !== null){
|
|
143
|
+
if (namespaces[node.prefix] != node.namespaceURI){
|
|
144
|
+
namespaces[node.prefix] = node.namespaceURI;
|
|
145
|
+
}
|
|
146
|
+
}else{
|
|
147
|
+
if (namespaces[':global:'] !== node.namespaceURI){
|
|
148
|
+
namespaces[':global:'] = node.namespaceURI;
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
var i, l;
|
|
154
|
+
for (i = 0, l = node.childNodes.length; i < l; ++i){
|
|
155
|
+
writeNode(node.childNodes[i], namespaces);
|
|
156
|
+
}
|
|
157
|
+
}else{
|
|
158
|
+
writeNode(node, {':global:': null});
|
|
159
|
+
}
|
|
134
160
|
|
|
135
161
|
return str;
|
|
136
162
|
}
|
|
@@ -360,7 +360,7 @@ JSClass("JSAttributedString", JSObject, {
|
|
|
360
360
|
var run = this._runs[runRange.location];
|
|
361
361
|
run.attributes = JSCopy(attributes);
|
|
362
362
|
if (runRange.length > 1){
|
|
363
|
-
run.range.length = this._runs[runRange.end - 1].end - run.range.location;
|
|
363
|
+
run.range.length = this._runs[runRange.end - 1].range.end - run.range.location;
|
|
364
364
|
this._runs.splice(runRange.location + 1, runRange.length - 1);
|
|
365
365
|
}
|
|
366
366
|
this._fixRunsInRunRange(JSRange(runRange.location, 1));
|
|
@@ -72,6 +72,9 @@ JSClass("JSTextLayoutManager", JSObject, {
|
|
|
72
72
|
|
|
73
73
|
replaceTextStorage: function(storage){
|
|
74
74
|
var originalStorage = this._textStorage;
|
|
75
|
+
if (storage === originalStorage){
|
|
76
|
+
return;
|
|
77
|
+
}
|
|
75
78
|
if (originalStorage !== null){
|
|
76
79
|
var managers = originalStorage.layoutManagers;
|
|
77
80
|
originalStorage.removeAllLayoutManagers();
|
|
@@ -214,7 +214,7 @@ JSClass("UIButton", UIControl, {
|
|
|
214
214
|
this.active = false;
|
|
215
215
|
}
|
|
216
216
|
var location = event.locationInView(this);
|
|
217
|
-
this.over = this.window !== null && this.containsPoint(location);
|
|
217
|
+
this.over = this.enabled && this.window !== null && this.containsPoint(location);
|
|
218
218
|
return;
|
|
219
219
|
}
|
|
220
220
|
UIButton.$super.mouseUp.call(this, event);
|
|
@@ -394,6 +394,7 @@ JSClass("UIPopupWindowStyler", UIWindowStyler, {
|
|
|
394
394
|
},
|
|
395
395
|
|
|
396
396
|
layoutWindow: function(window){
|
|
397
|
+
UIPopupWindowStyler.$super.layoutWindow.call(this, window);
|
|
397
398
|
var contentInsets = JSInsets(window.contentInsets);
|
|
398
399
|
if (window._showsSourceArrow){
|
|
399
400
|
var popupBacking = window.stylerProperties.popupBacking;
|
|
@@ -475,7 +475,7 @@ JSClass("UITextEditor", JSObject, {
|
|
|
475
475
|
var selections = this._selectionsCopy();
|
|
476
476
|
for (i = 0, l = selections.length; i < l; ++i){
|
|
477
477
|
selection = selections[i];
|
|
478
|
-
this._setAttributeValueForSelection(name, value, selection);
|
|
478
|
+
this._setAttributeValueForSelection(name, value, selection, false);
|
|
479
479
|
}
|
|
480
480
|
this._setSelectionsAllowingUndo(selections);
|
|
481
481
|
this.undoManager.endUndoGrouping();
|
|
@@ -585,7 +585,7 @@ JSClass("UITextEditor", JSObject, {
|
|
|
585
585
|
var selections = this._selectionsCopy();
|
|
586
586
|
for (i = 0, l = selections.length; i < l; ++i){
|
|
587
587
|
selection = selections[i];
|
|
588
|
-
this._setAttributeValueForSelection(name, !currentValue, selection);
|
|
588
|
+
this._setAttributeValueForSelection(name, !currentValue, selection, true);
|
|
589
589
|
}
|
|
590
590
|
this._setSelectionsAllowingUndo(selections);
|
|
591
591
|
this.undoManager.endUndoGrouping();
|
|
@@ -593,17 +593,25 @@ JSClass("UITextEditor", JSObject, {
|
|
|
593
593
|
this._resetSelectionAffinity();
|
|
594
594
|
},
|
|
595
595
|
|
|
596
|
-
_setAttributeValueForSelection: function(name, value, selection){
|
|
596
|
+
_setAttributeValueForSelection: function(name, value, selection, expandingSelection){
|
|
597
597
|
var textStorage = this.textLayoutManager.textStorage;
|
|
598
|
+
var str = textStorage.string;
|
|
599
|
+
var range = selection.range;
|
|
600
|
+
if (expandingSelection && selection.range.length === 0){
|
|
601
|
+
range = str.rangeForWordAtIndex(selection.range.location);
|
|
602
|
+
if (selection.range.location === range.location || selection.range.location === range.end){
|
|
603
|
+
range = selection.range;
|
|
604
|
+
}
|
|
605
|
+
}
|
|
598
606
|
var replacementString;
|
|
599
|
-
if (
|
|
600
|
-
replacementString = textStorage.attributedSubstringInRange(
|
|
607
|
+
if (range.length > 0){
|
|
608
|
+
replacementString = textStorage.attributedSubstringInRange(range);
|
|
601
609
|
if (value !== null && value !== undefined){
|
|
602
610
|
replacementString.addAttributeInRange(name, value, JSRange(0, replacementString.string.length));
|
|
603
611
|
}else{
|
|
604
612
|
replacementString.removeAttributeInRange(name, JSRange(0, replacementString.string.length));
|
|
605
613
|
}
|
|
606
|
-
this._replaceTextStorageRangeAllowingUndo(textStorage,
|
|
614
|
+
this._replaceTextStorageRangeAllowingUndo(textStorage, range, replacementString);
|
|
607
615
|
}else{
|
|
608
616
|
selection.attributes = this._insertAttributesForSelection(selection);
|
|
609
617
|
var currentValue = selection.attributes[name];
|
|
@@ -612,7 +620,7 @@ JSClass("UITextEditor", JSObject, {
|
|
|
612
620
|
}else{
|
|
613
621
|
delete selection.attributes[name];
|
|
614
622
|
}
|
|
615
|
-
this.undoManager.registerUndo(this, this._setAttributeValueForSelection, name, currentValue, selection);
|
|
623
|
+
this.undoManager.registerUndo(this, this._setAttributeValueForSelection, name, currentValue, selection, expandingSelection);
|
|
616
624
|
}
|
|
617
625
|
},
|
|
618
626
|
|
|
@@ -1407,6 +1407,7 @@ JSClass("UITextFieldCustomStyler", UITextFieldStyler, {
|
|
|
1407
1407
|
disabledBorderColor: null,
|
|
1408
1408
|
borderWidth: 0,
|
|
1409
1409
|
textColor: null,
|
|
1410
|
+
disabledTextColor: null,
|
|
1410
1411
|
placeholderColor: null,
|
|
1411
1412
|
cornerRadius: 0,
|
|
1412
1413
|
textInsets: null,
|
|
@@ -1442,6 +1443,11 @@ JSClass("UITextFieldCustomStyler", UITextFieldStyler, {
|
|
|
1442
1443
|
}else{
|
|
1443
1444
|
this.textColor = JSColor.text;
|
|
1444
1445
|
}
|
|
1446
|
+
if (spec.containsKey("disabledTextColor")){
|
|
1447
|
+
this.disabledTextColor = spec.valueForKey("disabledTextColor", JSColor);
|
|
1448
|
+
}else{
|
|
1449
|
+
this.disabledTextColor = this.textColor;
|
|
1450
|
+
}
|
|
1445
1451
|
if (spec.containsKey("placeholderColor")){
|
|
1446
1452
|
this.placeholderColor = spec.valueForKey("placeholderColor", JSColor);
|
|
1447
1453
|
}
|
|
@@ -1486,6 +1492,7 @@ JSClass("UITextFieldCustomStyler", UITextFieldStyler, {
|
|
|
1486
1492
|
if (textField.active){
|
|
1487
1493
|
textField.backgroundColor = this.activeBackgroundColor || this.backgroundColor;
|
|
1488
1494
|
textField.borderColor = this.activeBorderColor || this.borderColor;
|
|
1495
|
+
textField.textColor = this.textColor;
|
|
1489
1496
|
}else if (textField.enabled){
|
|
1490
1497
|
if (textField.over){
|
|
1491
1498
|
textField.backgroundColor = this.overBackgroundColor || this.backgroundColor;
|
|
@@ -1494,9 +1501,11 @@ JSClass("UITextFieldCustomStyler", UITextFieldStyler, {
|
|
|
1494
1501
|
textField.backgroundColor = this.backgroundColor;
|
|
1495
1502
|
textField.borderColor = this.borderColor;
|
|
1496
1503
|
}
|
|
1504
|
+
textField.textColor = this.textColor;
|
|
1497
1505
|
}else{
|
|
1498
1506
|
textField.backgroundColor = this.disabledBackgroundColor || this.backgroundColor;
|
|
1499
1507
|
textField.borderColor = this.disabledBorderColor || this.borderColor;
|
|
1508
|
+
textField.textColor = this.disabledTextColor;
|
|
1500
1509
|
}
|
|
1501
1510
|
},
|
|
1502
1511
|
|
|
@@ -167,8 +167,10 @@ JSClass("UITextLayer", UILayer, {
|
|
|
167
167
|
if (!text.isKindOfClass(JSTextStorage)){
|
|
168
168
|
text = JSTextStorage.initWithAttributedString(text);
|
|
169
169
|
}
|
|
170
|
-
this._textStorage
|
|
171
|
-
|
|
170
|
+
if (text !== this._textStorage){
|
|
171
|
+
this._textStorage = text;
|
|
172
|
+
this._textLayoutManager.replaceTextStorage(this._textStorage);
|
|
173
|
+
}
|
|
172
174
|
this.setNeedsDisplay();
|
|
173
175
|
this._displayQueued = true;
|
|
174
176
|
},
|
|
@@ -143,6 +143,7 @@ JSClass("UITokenField", UITextField, {
|
|
|
143
143
|
this.attributedText.replaceCharactersInRangeWithAttributedString(JSRange(range.location + indexAdjustment, range.length), attachmentString);
|
|
144
144
|
}
|
|
145
145
|
}
|
|
146
|
+
this.sendActionsForEvents(UIControl.Event.primaryAction | UIControl.Event.valueChanged);
|
|
146
147
|
},
|
|
147
148
|
|
|
148
149
|
_convertStringToRepresentedObject: function(string, range){
|