@breakside/jskit 2022.25.0 → 2022.26.1
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/JSURL.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/AuthKit/OAService.js +8 -0
- package/Root/Frameworks/AuthKit/Services.yaml +2 -0
- 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/JSURL.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/UICursor.js +19 -4
- package/Root/Frameworks/UIKit/UIHTMLApplication.js +52 -14
- package/Root/Frameworks/UIKit/UIHTMLDisplayServerCanvasContext.js +2 -48
- package/Root/Frameworks/UIKit/UIHTMLDisplayServerContext.js +0 -6
- package/Root/Frameworks/UIKit/UIHTMLDisplayServerSVGContext.js +6 -77
- package/Root/Frameworks/UIKit/UIHTMLTextField.js +9 -3
- package/Root/Frameworks/UIKit/UIHTMLTextTypesetter.js +2 -29
- package/Root/Frameworks/UIKit/UIHTMLWindowServer.js +6 -79
- package/Root/Frameworks/UIKit/UIKit.js +1 -0
- package/Root/Frameworks/UIKit/UILabel.js +74 -1
- package/Root/Frameworks/UIKit/UIMouseTrackingArea.js +55 -0
- package/Root/Frameworks/UIKit/UIState.js +25 -0
- package/Root/Frameworks/UIKit/UITextEditor.js +277 -76
- package/Root/Frameworks/UIKit/UITextEditorDelegate.js +3 -1
- package/Root/Frameworks/UIKit/UITextLayer.js +1 -1
- package/Root/Frameworks/UIKit/UIView.js +118 -46
- package/Root/Frameworks/UIKit/UIViewController.js +6 -0
- package/Root/Frameworks/UIKit/UIWindow.js +89 -0
- package/Root/Frameworks/UIKit/UIWindowServer.js +20 -79
- 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.26.1",
|
|
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": "9d04712d10f1be8390f8c389202f712f7376865f"
|
|
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.26.1",
|
|
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": "9d04712d10f1be8390f8c389202f712f7376865f"
|
|
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.26.1",
|
|
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": "9d04712d10f1be8390f8c389202f712f7376865f"
|
|
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.26.1",
|
|
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": "9d04712d10f1be8390f8c389202f712f7376865f"
|
|
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.26.1",
|
|
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": "9d04712d10f1be8390f8c389202f712f7376865f"
|
|
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": "2022.
|
|
6
|
+
"JSBundleVersion": "2022.26.1",
|
|
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": "9d04712d10f1be8390f8c389202f712f7376865f"
|
|
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.26.1",
|
|
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": "9d04712d10f1be8390f8c389202f712f7376865f"
|
|
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.26.1",
|
|
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": "9d04712d10f1be8390f8c389202f712f7376865f"
|
|
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.26.1",
|
|
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": "9d04712d10f1be8390f8c389202f712f7376865f"
|
|
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.26.1",
|
|
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": "9d04712d10f1be8390f8c389202f712f7376865f"
|
|
14
14
|
},
|
|
15
15
|
"Resources": [
|
|
16
16
|
{
|
|
@@ -135,6 +135,14 @@ Object.defineProperties(OAService, {
|
|
|
135
135
|
return service;
|
|
136
136
|
}
|
|
137
137
|
},
|
|
138
|
+
facebook: {
|
|
139
|
+
configurable: true,
|
|
140
|
+
get: function(){
|
|
141
|
+
var service = OAService.initWithIdentifier('facebook');
|
|
142
|
+
Object.defineProperty(this, 'facebook', {value: service});
|
|
143
|
+
return service;
|
|
144
|
+
}
|
|
145
|
+
},
|
|
138
146
|
authPrivacy: {
|
|
139
147
|
configurable: true,
|
|
140
148
|
get: function(){
|
|
@@ -85,7 +85,16 @@ JSClass("UICursor", JSObject, {
|
|
|
85
85
|
|
|
86
86
|
pop: function(){
|
|
87
87
|
UICursor.pop();
|
|
88
|
+
},
|
|
89
|
+
|
|
90
|
+
set: function(){
|
|
91
|
+
UICursor.set(this);
|
|
92
|
+
},
|
|
93
|
+
|
|
94
|
+
unset: function(){
|
|
95
|
+
UICursor.set(UICursor.systemDefault);
|
|
88
96
|
}
|
|
97
|
+
|
|
89
98
|
});
|
|
90
99
|
|
|
91
100
|
UICursor.hide = function(){
|
|
@@ -107,17 +116,22 @@ UICursor.unhide = function(){
|
|
|
107
116
|
|
|
108
117
|
UICursor.push = function(cursor){
|
|
109
118
|
UICursor._stack.push(cursor);
|
|
110
|
-
UICursor.
|
|
119
|
+
UICursor.update();
|
|
111
120
|
};
|
|
112
121
|
|
|
113
122
|
UICursor.pop = function(){
|
|
114
123
|
if (UICursor._stack.length > 1){
|
|
115
124
|
UICursor._stack.pop();
|
|
116
|
-
UICursor.
|
|
125
|
+
UICursor.update();
|
|
117
126
|
}
|
|
118
127
|
};
|
|
119
128
|
|
|
120
|
-
UICursor.
|
|
129
|
+
UICursor.set = function(cursor){
|
|
130
|
+
UICursor._stack[0] = cursor;
|
|
131
|
+
UICursor.update();
|
|
132
|
+
};
|
|
133
|
+
|
|
134
|
+
UICursor.update = function(){
|
|
121
135
|
if (this._hideCount === 0){
|
|
122
136
|
UIApplication.shared.windowServer.setCursor(UICursor.currentCursor);
|
|
123
137
|
}
|
|
@@ -160,4 +174,5 @@ UICursor.dragCopy = UICursor.initWithSystemIdentifier(UICursor.SystemIdentifier.
|
|
|
160
174
|
UICursor.crosshair = UICursor.initWithSystemIdentifier(UICursor.SystemIdentifier.crosshair);
|
|
161
175
|
|
|
162
176
|
UICursor._hideCount = 0;
|
|
163
|
-
UICursor.
|
|
177
|
+
UICursor.systemDefault = UICursor.arrow;
|
|
178
|
+
UICursor._stack = [UICursor.systemDefault];
|
|
@@ -29,6 +29,7 @@ JSClass("UIHTMLApplication", UIApplication, {
|
|
|
29
29
|
initWithBundle: function(bundle, windowServer){
|
|
30
30
|
UIHTMLApplication.$super.initWithBundle.call(this, bundle, windowServer);
|
|
31
31
|
this.domWindow = this.windowServer.domWindow;
|
|
32
|
+
this.rememberStateInPath = this.bundle.info.UIHTMLUseURLPathForState === true;
|
|
32
33
|
},
|
|
33
34
|
|
|
34
35
|
setup: function(completion, target){
|
|
@@ -93,17 +94,15 @@ JSClass("UIHTMLApplication", UIApplication, {
|
|
|
93
94
|
this.stop(reload);
|
|
94
95
|
},
|
|
95
96
|
|
|
96
|
-
baseURL: JSReadOnlyProperty('_baseURL'),
|
|
97
|
+
baseURL: JSReadOnlyProperty('_baseURL', null),
|
|
98
|
+
rememberStateInPath: false,
|
|
97
99
|
|
|
98
100
|
setState: function(state){
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
if (!this._isHandlingHashChange){
|
|
105
|
-
var href = url.encodedString;
|
|
106
|
-
if (href != this.domWindow.location.href){
|
|
101
|
+
if (!state.isEqual(this.state)){
|
|
102
|
+
UIHTMLApplication.$super.setState.call(this, state);
|
|
103
|
+
if (!this._isHandlingBrowserStateChange){
|
|
104
|
+
var url = this.urlForState(state);
|
|
105
|
+
var href = url.encodedString;
|
|
107
106
|
this.domWindow.history.pushState(null, null, url.encodedString);
|
|
108
107
|
}
|
|
109
108
|
}
|
|
@@ -111,11 +110,20 @@ JSClass("UIHTMLApplication", UIApplication, {
|
|
|
111
110
|
|
|
112
111
|
setStateReplacingHTMLState: function(state){
|
|
113
112
|
UIHTMLApplication.$super.setState.call(this, state);
|
|
113
|
+
var url = this.urlForState(state);
|
|
114
|
+
this.domWindow.history.replaceState(null, null, url.encodedString);
|
|
115
|
+
},
|
|
116
|
+
|
|
117
|
+
urlForState: function(state){
|
|
114
118
|
var url = JSURL.initWithURL(this.baseURL);
|
|
115
|
-
if (state.
|
|
116
|
-
|
|
119
|
+
if (state.pathComponents.length > 1){
|
|
120
|
+
if (this.rememberStateInPath){
|
|
121
|
+
url.appendPathComponents(state.pathComponents.slice(1));
|
|
122
|
+
}else{
|
|
123
|
+
url.fragment = state.path;
|
|
124
|
+
}
|
|
117
125
|
}
|
|
118
|
-
|
|
126
|
+
return url;
|
|
119
127
|
},
|
|
120
128
|
|
|
121
129
|
addEventListeners: function(){
|
|
@@ -123,6 +131,7 @@ JSClass("UIHTMLApplication", UIApplication, {
|
|
|
123
131
|
this.domWindow.addEventListener("unhandledrejection", this);
|
|
124
132
|
this.domWindow.addEventListener("beforeunload", this);
|
|
125
133
|
this.domWindow.addEventListener("hashchange", this);
|
|
134
|
+
this.domWindow.addEventListener("popstate", this);
|
|
126
135
|
},
|
|
127
136
|
|
|
128
137
|
handleEvent: function(e){
|
|
@@ -160,7 +169,10 @@ JSClass("UIHTMLApplication", UIApplication, {
|
|
|
160
169
|
},
|
|
161
170
|
|
|
162
171
|
_event_hashchange: function(e){
|
|
163
|
-
this.
|
|
172
|
+
if (this.rememberStateInPath){
|
|
173
|
+
return;
|
|
174
|
+
}
|
|
175
|
+
this._isHandlingBrowserStateChange = true;
|
|
164
176
|
try{
|
|
165
177
|
var requestedURL = JSURL.initWithString(this.domWindow.location.href);
|
|
166
178
|
var requestedFragment = requestedURL.fragment;
|
|
@@ -185,7 +197,33 @@ JSClass("UIHTMLApplication", UIApplication, {
|
|
|
185
197
|
}
|
|
186
198
|
this.setStateReplacingHTMLState(state);
|
|
187
199
|
}finally{
|
|
188
|
-
this.
|
|
200
|
+
this._isHandlingBrowserStateChange = false;
|
|
201
|
+
}
|
|
202
|
+
},
|
|
203
|
+
|
|
204
|
+
_event_popstate: function(e){
|
|
205
|
+
if (!this.rememberStateInPath){
|
|
206
|
+
return;
|
|
207
|
+
}
|
|
208
|
+
this._isHandlingBrowserStateChange = true;
|
|
209
|
+
try{
|
|
210
|
+
var requestedURL = JSURL.initWithString(this.domWindow.location.href);
|
|
211
|
+
var relativeURL = JSURL.initWithString(requestedURL.encodedStringRelativeTo(this._baseURL));
|
|
212
|
+
var requestedState = UIState.initWithPath(relativeURL.path);
|
|
213
|
+
var state = null;
|
|
214
|
+
if (this.delegate && this.delegate.applicationDidRequestState){
|
|
215
|
+
state = this.delegate.applicationDidRequestState(this, requestedState);
|
|
216
|
+
}
|
|
217
|
+
if (state === null || state === undefined){
|
|
218
|
+
state = this.state;
|
|
219
|
+
}
|
|
220
|
+
if (state.isEqual(requestedState)){
|
|
221
|
+
UIHTMLApplication.$super.setState.call(this, state);
|
|
222
|
+
}else{
|
|
223
|
+
this.setStateReplacingHTMLState(state);
|
|
224
|
+
}
|
|
225
|
+
}finally{
|
|
226
|
+
this._isHandlingBrowserStateChange = false;
|
|
189
227
|
}
|
|
190
228
|
},
|
|
191
229
|
|