| Summary: | Remove ThemeStore JavaScript Wrapper | ||
|---|---|---|---|
| Product: | [RT] RAP | Reporter: | Holger Staudacher <holger.staudacher> |
| Component: | RWT | Assignee: | Project Inbox <rap-inbox> |
| Status: | RESOLVED FIXED | QA Contact: | |
| Severity: | enhancement | ||
| Priority: | P1 | CC: | jeick, tbuschto |
| Version: | 2.0 | ||
| Target Milestone: | 2.0 M3 | ||
| Hardware: | PC | ||
| OS: | Mac OS X | ||
| Whiteboard: | protocol | ||
| Bug Depends on: | 391671 | ||
| Bug Blocks: | |||
|
Description
Holger Staudacher
*** Bug 391585 has been marked as a duplicate of this bug. *** I suggest that we register plain .json instead of .js files, i.e. without the wrapping JavaScript code. The web client should then read the JSON in an XHR request and apply it to the theme store. +1 I also noticed that there could be several theme files. So, what about to include them in the initial json? Any discovery method would be sufficient ;) I implented a ThemeStore protocol adapter that can load the themes from any URL.
It is in commit 426d84c6f393e7c9ac607b9c4ff3dcb7e72694c5, ThemeStoreAdapter.js
The old way to load the theme is also still supported.
When no longer required, remove the "currentTheme" property from DisplayAdapter.js and Display.js.
The tests will also have to be fixed to load the themes in Startup.js. The code is already in place, ideally only the URLs have to be changed.
The file returned by the server should have this format:
{
"values" : <values-map>,
"theme" : <css-values-map>
}
This commit also removed the various no-chaching mechanisms in Request.js, as the themes are supposed to be cached, and the POST (ajax) requests should never be cached anyway.
Fixed in master with commit d1dc77375b7f88bad63205624834cd5fbb4c0d5b.
- Themes (fallback and current) are registered as json files like "rwt-resources/rap-rwt.theme.Fallback.json".
- ThemeStore protocol object is used to load the themes. Startup JSON message looks like:
{
"head": {
"url": "controls"
},
"operations": [ [ "call", "rwt.theme.ThemeStore", "loadFallbackTheme", {
"url": "rwt-resources/rap-rwt.theme.Fallback.json"
} ], [ "call", "rwt.theme.ThemeStore", "loadActiveTheme", {
"url": "rwt-resources/rap-rwt.theme.Default.json"
} ], [ "create", "w1", "rwt.widgets.Display" ] ]
}
- Removed rendering of "currentTheme" property from DisplayLCA
- Removed "currentTheme" property from DisplayAdapter.js and Display.js
- Adjusted the Startup.js URLs for loading the themes - both URLs points to Fallback theme
|