? imagebrowser.patch
? js/emimage.js
? js/fckeditor.js
Index: imagebrowser.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/imagebrowser/imagebrowser.module,v
retrieving revision 1.3.2.9
diff -u -r1.3.2.9 imagebrowser.module
--- imagebrowser.module	3 Dec 2008 22:18:50 -0000	1.3.2.9
+++ imagebrowser.module	23 Feb 2009 14:59:50 -0000
@@ -265,6 +265,20 @@
   drupal_add_js(drupal_get_path('module', 'views') .'/js/base.js');
   drupal_add_js(drupal_get_path('module', 'imagebrowser') .'/js/ib_ajax_view.js');
   drupal_add_js(drupal_get_path('module', 'imagebrowser') .'/js/imagebrowser.js');
+  
+  if(!empty($_GET['app']) && $_GET['app'] == "emimage") {
+    drupal_add_js(drupal_get_path('module', 'imagebrowser') .'/js/emimage.js');
+    $base_root = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') ? 'https' : 'http';
+    $base_url = $base_root .= '://'. $_SERVER['HTTP_HOST'];
+    drupal_add_js("var base_url = '$base_url';", 'inline');
+    if(!empty($_GET['widget'])) {
+      drupal_add_js("var field_name = '" .check_plain(urldecode($_GET['widget'])). "';", 'inline');
+    }
+  }
+  else {
+  drupal_add_js(drupal_get_path('module', 'imagebrowser') .'/js/fckeditor.js');
+  }
+  
   drupal_add_js('misc/autocomplete.js');
   drupal_add_js('var ibpath = "'. url('imagebrowser/load/messages') .'";', 'inline');
 
@@ -367,6 +381,7 @@
       $rows[] = $row;
     }
   }
+ // $rows[] = array('test', $_GET['app']);
   $presets = theme('table', $header, $rows);
 
   //Get ImageCache presets
@@ -556,6 +571,11 @@
       ),
       'path' => $path,
     ),
+    'imagebrowser_textfield' => array(
+      'arguments' => array('element' => NULL),
+      'path' => $path,
+      'file' => 'theme.inc',
+    ),
   );
 }
 
@@ -658,4 +678,4 @@
     // Send to different url.
     $form_state['redirect'] = 'imagebrowser/edit/node/'. $form_state['nid'];
   }
-}
\ No newline at end of file
+}
Index: js/imagebrowser.js
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/imagebrowser/js/Attic/imagebrowser.js,v
retrieving revision 1.1.2.7
diff -u -r1.1.2.7 imagebrowser.js
--- js/imagebrowser.js	3 Dec 2008 22:18:51 -0000	1.1.2.7
+++ js/imagebrowser.js	17 Feb 2009 16:29:38 -0000
@@ -7,18 +7,6 @@
  */
 
 /**
- * FCKEditor insert function
- */
-function SelectFile( fileUrl, width, height, alt )
-{
-  if(window.opener) {
-    //url, width, height, alt
-    window.opener.SetUrl( fileUrl, null, null, alt );
-  }
-  window.close();
-}
-
-/**
  * Prepare links in the browser for insert overlay
  */
 function ib_prepareLinks() {
@@ -177,4 +165,4 @@
   $("#fade").fadeOut('slow', function() {
     $("#fade").css('background', '#000000');
   });
-});
\ No newline at end of file
+});
Index: theme/theme.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/imagebrowser/theme/Attic/theme.inc,v
retrieving revision 1.1.2.4
diff -u -r1.1.2.4 theme.inc
--- theme/theme.inc	3 Dec 2008 22:18:51 -0000	1.1.2.4
+++ theme/theme.inc	17 Feb 2009 14:53:18 -0000
@@ -18,4 +18,4 @@
   $vars['thumbnail'] = url('imagebrowser/view/image/'. $node->nid .'/thumbnail');
   $vars['path'] = url('imagebrowser/load/imagedetails/'. $node->nid);
   $vars['title'] = $node->title;
-}
\ No newline at end of file
+}
--- js/emimage.js
+++ js/emimage.js
@@ -0,0 +1,20 @@
+// $Id: imagebrowser.js,v 1.1.2.7 2008/12/03 22:18:51 starnox Exp $
+
+/**
+ * @file imagefield.js
+ *
+ * All the javascript to make Image Browser work with ImageField
+ */
+
+/**
+ * imagefield insert function
+ */
+function SelectFile( fileUrl, width, height, alt )
+{
+  if(window.opener) {
+    //url, width, height, alt
+    var field = "input[name='"+field_name+"[0][embed]']";
+    window.opener.$(field).attr('value', base_url+fileUrl);
+  }
+  //window.close();
+}

--- js/fckeditor.js
+++ js/fckeditor.js
@@ -0,0 +1,19 @@
+// $Id: imagebrowser.js,v 1.1.2.7 2008/12/03 22:18:51 starnox Exp $
+
+/**
+ * @file fckeditor.js
+ *
+ * All the javascript to make Image Browser work with FCKeditor
+ */
+
+/**
+ * FCKEditor insert function
+ */
+function SelectFile( fileUrl, width, height, alt )
+{
+  if(window.opener) {
+    //url, width, height, alt
+    window.opener.SetUrl( fileUrl, null, null, alt );
+  }
+  window.close();
+}

