Skip to content

Instantly share code, notes, and snippets.

@nissicreative
Created July 31, 2017 13:05
Show Gist options
  • Save nissicreative/cc8d4f8d3580d32604b213c686e72e97 to your computer and use it in GitHub Desktop.
Save nissicreative/cc8d4f8d3580d32604b213c686e72e97 to your computer and use it in GitHub Desktop.
Config for TinyMCE
var editor_config = {
path_absolute: "/",
selector: "textarea.rte",
plugins: 'code hr link image paste',
toolbar: [
'undo redo | cut copy paste pastetext | bold italic removeformat | bullist numlist | link unlink image | hr | code',
],
relative_urls: false,
menubar: false,
file_browser_callback: function (field_name, url, type, win) {
var x = window.innerWidth || document.documentElement.clientWidth || document.getElementsByTagName('body')[0].clientWidth;
var y = window.innerHeight || document.documentElement.clientHeight || document.getElementsByTagName('body')[0].clientHeight;
var cmsURL = editor_config.path_absolute + 'laravel-filemanager?field_name=' + field_name;
if (type == 'image') {
cmsURL = cmsURL + "&type=Images";
} else {
cmsURL = cmsURL + "&type=Files";
}
tinyMCE.activeEditor.windowManager.open({
file: cmsURL,
title: 'Filemanager',
width: x * 0.8,
height: y * 0.8,
resizable: "yes",
close_previous: "no"
});
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment