diff sites/all/modules/imce_wysiwyg/js/imce_wysiwyg.js @ 0:ff03f76ab3fe

initial version
author danieleb <danielebarchiesi@me.com>
date Wed, 21 Aug 2013 18:51:11 +0100
parents
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/sites/all/modules/imce_wysiwyg/js/imce_wysiwyg.js	Wed Aug 21 18:51:11 2013 +0100
@@ -0,0 +1,24 @@
+
+/**
+ * Wysiwyg API integration helper function.
+ */
+function imceImageBrowser(field_name, url, type, win) {
+  // TinyMCE.
+  if (win !== 'undefined') {
+    win.open(Drupal.settings.imce.url + encodeURIComponent(field_name), '', 'width=760,height=560,resizable=1');
+  }
+}
+
+/**
+ * CKeditor integration.
+ */
+var imceCkeditSendTo = function (file, win) {
+  var parts = /\?(?:.*&)?CKEditorFuncNum=(\d+)(?:&|$)/.exec(win.location.href);
+  if (parts && parts.length > 1) {
+    CKEDITOR.tools.callFunction(parts[1], file.url);
+    win.close();
+  }
+  else {
+    throw 'CKEditorFuncNum parameter not found or invalid: ' + win.location.href;
+  }
+};