Skip to content

Commit

Permalink
Merge pull request #154 from helios-ag/relative_path
Browse files Browse the repository at this point in the history
reworked on relative(absolute from root) paths
  • Loading branch information
helios-ag committed Jul 14, 2015
2 parents 160b8ca + 4b0a3a4 commit 1292ed2
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Resources/views/Elfinder/ckeditor.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
getFileCallback : function(file) {
if (funcNum) {
{% if relative_path %}
window.opener.CKEDITOR.tools.callFunction(funcNum, '{{ pathPrefix }}'+file.path);
window.opener.CKEDITOR.tools.callFunction(funcNum, '{{ pathPrefix }}'+file.url.replace("{{ app.request.schemeAndHttpHost }}/", ""));
{% else %}
window.opener.CKEDITOR.tools.callFunction(funcNum, file.url);
{% endif %}
Expand Down
2 changes: 1 addition & 1 deletion Resources/views/Elfinder/elfinder_type.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
lang : '{{locale}}',
getFileCallback: function(file) {
{% if relative_path %}
window.opener.setValue('{{ pathPrefix }}'+file.path, "{{ id }}");
window.opener.setValue('{{ pathPrefix }}'+file.url.replace("{{ app.request.schemeAndHttpHost }}/", ""), "{{ id }}");
{% else %}
window.opener.setValue(file.url, "{{ id }}");
{% endif %}
Expand Down
2 changes: 1 addition & 1 deletion Resources/views/Elfinder/tinymce.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
folders : false
},
getFileCallback : function(url) {
path = '/' + url.path;
path = '/' + url.replace("{{ app.request.schemeAndHttpHost }}/", "");
FileBrowserDialogue.mySubmit(path);
}
}).elfinder('instance');
Expand Down
2 changes: 1 addition & 1 deletion Resources/views/Elfinder/tinymce4.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
lang : '{{ locale }}',
getFileCallback: function(file) { // editor callback
{% if relative_path %}
FileBrowserDialogue.mySubmit('{{ pathPrefix }}'+file.path); // pass selected file path to TinyMCE
FileBrowserDialogue.mySubmit('{{ pathPrefix }}'+file.url.replace("{{ app.request.schemeAndHttpHost }}/", "")); // pass selected file path to TinyMCE
{% else %}
FileBrowserDialogue.mySubmit(file.url); // pass selected file path to TinyMCE
{% endif %}
Expand Down

0 comments on commit 1292ed2

Please sign in to comment.