Skip to content

Instantly share code, notes, and snippets.

@andik
Created March 23, 2015 12:20
Show Gist options
  • Save andik/5e8d01efe27b58f7b452 to your computer and use it in GitHub Desktop.
Save andik/5e8d01efe27b58f7b452 to your computer and use it in GitHub Desktop.
tinymce file browser
tinymce.init({
file_browser_callback: function(field_name, url, type, win) {
tinymce.activeEditor.windowManager.open({
title: "My file browser",
url: "myfilebrowser.html",
width: 800,
height: 600
}, {
oninsert: function(url) {
win.document.getElementById(field_name).value = url;
}
});
}
});
// Then in your myfilebrowser.html file call:
top.tinymce.activeEditor.windowManager.getParams().oninsert("someurl.html");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment