Commit 8dcc7d23 authored by Yusei Tahara's avatar Yusei Tahara

[erp5_web_renderjs_ui] Use absolute wallpaper image URL to support firefox.

parent 08637332
...@@ -11,7 +11,11 @@ ...@@ -11,7 +11,11 @@
setting_id: "setting/" + document.head.querySelector( setting_id: "setting/" + document.head.querySelector(
'script[data-renderjs-configuration="application_title"]' 'script[data-renderjs-configuration="application_title"]'
).textContent ).textContent
}); }),
index,
styleSheet,
wallpaper_url,
a_element;
function renderMainGadget(gadget, url, options) { function renderMainGadget(gadget, url, options) {
var page_gadget; var page_gadget;
...@@ -825,5 +829,27 @@ ...@@ -825,5 +829,27 @@
return displayError(this, new Error("Unexpected form submit")); return displayError(this, new Error("Unexpected form submit"));
}); });
//
// For Firefox, Wallpaper URL must be absolute one.
//
if (navigator.userAgent.toLowerCase().indexOf('firefox') > -1) {
for (index = 0; index < document.styleSheets.length; index += 1) {
styleSheet = document.styleSheets[index];
if (styleSheet.href.startsWith('data:text/css;')) {
wallpaper_url = styleSheet.cssRules[0].style
.backgroundImage.slice(4, -1).replace(/["']/g, '');
a_element = document.createElement('a');
a_element.href = wallpaper_url;
styleSheet.cssRules[0].style.backgroundImage =
'url("' + a_element.href + '")';
break;
}
}
index = null;
styleSheet = null;
wallpaper_url = null;
a_element = null;
}
}(window, document, RSVP, rJS, }(window, document, RSVP, rJS,
XMLHttpRequest, location, console, navigator, Event)); XMLHttpRequest, location, console, navigator, Event));
\ No newline at end of file
...@@ -228,7 +228,7 @@ ...@@ -228,7 +228,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>975.29292.10042.3754</string> </value> <value> <string>978.15396.60577.50107</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -246,7 +246,7 @@ ...@@ -246,7 +246,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1556870187.8</float> <float>1567690058.72</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment