Commit 7707c922 authored by Boris Kocherov's avatar Boris Kocherov Committed by Romain Courteaud

erp5_only_office: rename view folders to view_folder folders

parent 6b0c87de
...@@ -244,7 +244,7 @@ DocsAPI.DocEditor.version = function () { ...@@ -244,7 +244,7 @@ DocsAPI.DocEditor.version = function () {
return ""; return "";
}) })
.push(function (portal_type) { .push(function (portal_type) {
var value; var value, documentType, magic;
portal_type = portal_type || options.portal_type; portal_type = portal_type || options.portal_type;
g.props.binary_loader = false; g.props.binary_loader = false;
g.props.jio_key = options.jio_key; g.props.jio_key = options.jio_key;
...@@ -288,11 +288,6 @@ DocsAPI.DocEditor.version = function () { ...@@ -288,11 +288,6 @@ DocsAPI.DocEditor.version = function () {
}); });
} }
} }
return value;
})
.push(function (value) {
var magic, documentType,
app_url, sdk_deps = ["promise!sdk_async_loader"];
g.props.value = value; g.props.value = value;
if (!g.props.documentType && value === "") { if (!g.props.documentType && value === "") {
throw "can not create empty document " + throw "can not create empty document " +
...@@ -322,6 +317,54 @@ DocsAPI.DocEditor.version = function () { ...@@ -322,6 +317,54 @@ DocsAPI.DocEditor.version = function () {
g.props.documentType = documentType; g.props.documentType = documentType;
} }
} }
})
.push(function () {
return jIO.util.ajax({
type: "GET",
url: "onlyoffice.gadget.appcache"
});
})
.push(function (response) {
/*configure requeryjs for rename
view and edit to view_folder and edit_folder
in dependencies
*/
var text = response.target.responseText,
relative_url_list = text.split('\r\n'),
i,
new_url,
old_url,
config = {};
if (relative_url_list.length === 1) {
relative_url_list = text.split('\n');
}
if (relative_url_list.length === 1) {
relative_url_list = text.split('\r');
}
for (i = 0; i < relative_url_list.length; i += 1) {
if (
relative_url_list[i] !== "" &&
relative_url_list[i].charAt(0) !== '#' &&
relative_url_list[i].charAt(0) !== ' ') {
relative_url_list[i].replace("\r", "");
new_url = relative_url_list[i]
.replace('onlyoffice/web-apps/apps/', '')
.replace(/\.[^.]*$/, '');
old_url = new_url
.replace(/(^|\/)view_folder\//g,"$1view/")
.replace(/(^|\/)edit_folder\//g,"$1edit/");
if (old_url !== new_url) {
config[old_url] = [
new_url,
old_url
];
}
}
}
require.config({paths: config});
})
.push(function () {
var app_url, sdk_deps = ["promise!sdk_async_loader"];
if (!g.props.value_zip_storage) { if (!g.props.value_zip_storage) {
g.props.value_zip_storage = jIO.createJIO({type: "zipfile"}); g.props.value_zip_storage = jIO.createJIO({type: "zipfile"});
} }
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
</item> </item>
<item> <item>
<key> <string>id</string> </key> <key> <string>id</string> </key>
<value> <string>view</string> </value> <value> <string>view_folder</string> </value>
</item> </item>
<item> <item>
<key> <string>title</string> </key> <key> <string>title</string> </key>
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
</item> </item>
<item> <item>
<key> <string>id</string> </key> <key> <string>id</string> </key>
<value> <string>view</string> </value> <value> <string>view_folder</string> </value>
</item> </item>
<item> <item>
<key> <string>title</string> </key> <key> <string>title</string> </key>
......
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