-
Notifications
You must be signed in to change notification settings - Fork 128
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #182 from helios-ag/fm_tinymce
fm_tinymce_bundle
- Loading branch information
Showing
2 changed files
with
54 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
{% if includeAssets %} | ||
{% include "FMElfinderBundle:Elfinder:helper/assets_css.html.twig" %} | ||
{% endif %} | ||
</head> | ||
<body> | ||
{% if includeAssets %} | ||
{% include "FMElfinderBundle:Elfinder:helper/assets_js.html.twig" %} | ||
{% endif %} | ||
<script type="text/javascript" charset="utf-8"> | ||
var FileBrowserDialogue = { | ||
mySubmit: function (file, elf) { | ||
// pass selected file data to TinyMCE | ||
parent.tinymce.activeEditor.windowManager.getParams().oninsert(file, elf); | ||
// close popup window | ||
parent.tinymce.activeEditor.windowManager.close(); | ||
} | ||
}; | ||
$(document).ready(function() { | ||
var elf = $('.elfinder').elfinder({ | ||
// set your elFinder options here | ||
url: '{{ path('ef_connect', {'instance': instance, 'homeFolder': homeFolder }) }}', // connector URL | ||
lang : '{{ locale }}', | ||
getFileCallback: function(file) { // editor callback | ||
{% if relative_path %} | ||
file.url = '{{ pathPrefix }}' + file.url.replace("{{ app.request.schemeAndHttpHost }}/", ""); | ||
FileBrowserDialogue.mySubmit(file, elf); // pass selected file path to TinyMCE | ||
{% else %} | ||
FileBrowserDialogue.mySubmit(file, elf); // pass selected file path to TinyMCE | ||
{% endif %} | ||
} | ||
}).elfinder('instance'); | ||
}); | ||
</script> | ||
<div class="elfinder"></div> | ||
</body> | ||
</html> |