imce_wysiwyg.js 638 B

123456789101112131415161718192021222324
  1. /**
  2. * Wysiwyg API integration helper function.
  3. */
  4. function imceImageBrowser(field_name, url, type, win) {
  5. // TinyMCE.
  6. if (win !== 'undefined') {
  7. win.open(Drupal.settings.imce.url + encodeURIComponent(field_name), '', 'width=760,height=560,resizable=1');
  8. }
  9. }
  10. /**
  11. * CKeditor integration.
  12. */
  13. var imceCkeditSendTo = function (file, win) {
  14. var parts = /\?(?:.*&)?CKEditorFuncNum=(\d+)(?:&|$)/.exec(win.location.href);
  15. if (parts && parts.length > 1) {
  16. CKEDITOR.tools.callFunction(parts[1], file.url);
  17. win.close();
  18. }
  19. else {
  20. throw 'CKEditorFuncNum parameter not found or invalid: ' + win.location.href;
  21. }
  22. };