tinymce.js 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. /*
  2. * elFinder Integration
  3. *
  4. * Copyright (c) 2010-2018, Alexey Sukhotin. All rights reserved.
  5. */
  6. // $Id$
  7. /*function elfinder_tinymce_browse_callback(field_name, url, type, win) {
  8. var w = window.open(tinymce.settings.file_browser_url, null, 'toolbar=yes,menubar=yes,width=600,height=500, inline=yes');
  9. w.tinymceFileField = field_name;
  10. w.tinymceFileWin = win;
  11. }*/
  12. // MAKE INLINE POPUP WORK
  13. function elfinder_tinymce_browse_callback(field_name, url, type, win) {
  14. /*var w = window.open(tinymce.settings.file_browser_url, null, 'toolbar=yes,menubar=yes,width=600,height=500, inline=yes');
  15. w.tinymceFileField = field_name;
  16. w.tinymceFileWin = win;*/
  17. var cmsURL = tinymce.settings.file_browser_url; // script URL - use an absolute path!
  18. if (cmsURL.indexOf("?") < 0) {
  19. //add the type as the only query parameter
  20. cmsURL = cmsURL + "?type=" + type;
  21. } else {
  22. //add the type as an additional query parameter
  23. // (PHP session ID is now included if there is one at all)
  24. cmsURL = cmsURL + "&type=" + type;
  25. }
  26. tinyMCE.activeEditor.windowManager.open({
  27. file: cmsURL,
  28. title: 'File Manager',
  29. width: 900,
  30. height: 450,
  31. resizable: "yes",
  32. inline: "yes", // This parameter only has an effect if you use the inlinepopups plugin!
  33. popup_css: false, // Disable TinyMCE's default popup CSS
  34. close_previous: "no"
  35. }, {
  36. window: win,
  37. input: field_name
  38. });
  39. return false;
  40. }