Commit b7ab52b7 authored by Sven Franck's avatar Sven Franck

app/data: add external HTML file the ugly way...

parent 7d4abb2b
......@@ -297,6 +297,13 @@
]
}
]
}, {
"type": "a",
"direct": {
"className": "ui-btn ui-btn-inline ui-shadow ui-btn-icon-right translate center ui-icon-carat-r",
"href": "#subscription/external"
},
"attributes": {"data-i18n": "global_dict.load_more"}
}
]
},
......
......@@ -33,6 +33,10 @@
}],
"validate_order": [{
"href": "validate_order"
}],
"external": [{
"href": "page_snippet.html",
"override": true
}]
}
}
......
......@@ -6039,7 +6039,7 @@
**/
// TODO: change this to widget, state and status
app.content.set = function (content_dict, url_dict, create) {
var pass;
var pass, is_html, is_href;
// pack
pass = {
......@@ -6049,10 +6049,35 @@
"create": create
};
is_href = pass.url_dict.href;
// waste of performance
if (is_href) {
is_html = is_href.split(".").length > 1 &&
is_href.split(".")[1] === "html";
}
// flag static content and skip loading config
pass.skip = !pass.url_dict.href && !pass.content_dict.portal_type_source;
pass.no_config = pass.skip || !!pass.content_dict.portal_type_source;
// HACK for Thierry
if (is_html) {
return util.ajax(
{"url": "data/" + pass.url_dict.href}
).then(function(e) {
// Don't look...
var i, len, fragment, response = $.parseHTML(e.target.response);
fragment = document.createDocumentFragment();
for (i = 0, len = response.length; i < len; i += 1) {
fragment.appendChild(response[i]);
}
return fragment;
});
}
// and go
return storage.fetchConfigAttachment({
"storage": app.storage_dict.settings,
......
{
"global_dict": {
"load_more": "Load more",
"external":"Additional Content",
"subscription": "Subscription",
"personal_data": "Personal Data",
"home": "bip&go",
......
{
"global_dict": {
"load_more": "Encore plus",
"external": "A plus",
"subscription": "Abonnement",
"personal_data": "Données personnelles",
"home": "bip&go",
......
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