Index: /MediaWiki/trunk/extensions/FCKeditor/FCKeditor.body.php
===================================================================
--- /MediaWiki/trunk/extensions/FCKeditor/FCKeditor.body.php	(revision 530)
+++ /MediaWiki/trunk/extensions/FCKeditor/FCKeditor.body.php	(revision 531)
@@ -301,9 +301,11 @@
 		oFCKeditor.BasePath = '$wgScriptPath/$wgFCKEditorDir/' ;
 		oFCKeditor.Config['CustomConfigurationsPath'] = '$wgScriptPath/$wgFCKEditorExtDir/fckeditor_config.js' ;
-		oFCKeditor.Config['EditorAreaCSS'] = sEditorAreaCSS;
+		//oFCKeditor.Config['EditorAreaCSS'] = sEditorAreaCSS;        
+		//oFCKeditor.Config['EditorAreaCSS'] = '/mediawiki/allinone.css?{$wgStyleVersion}';
 		oFCKeditor.Height = '$wgFCKEditorHeight' ;
 		oFCKeditor.ToolbarSet = '$wgFCKEditorToolbarSet' ;
 		oFCKeditor.ReplaceTextarea() ;
 		document.getElementById('toolbar').style.cssText = 'display:none;' ;
+	    //alert(oFCKeditor.Config['EditorAreaCSS']);
 	}
 }
@@ -368,9 +370,9 @@
 
     if ( strlen( str_replace( '_', '', $term ) )<3 )
-    return "  <input type=\"hidden\" name=\"wfSajaxSearchImageFCKeditor\" value=\"\"><br /><b>\"".$term2."\"</b>: Type one more character ...";
+    return "";
 
     $db =& wfGetDB( DB_SLAVE );
     $res = $db->select( 'page', 'page_title',
-    array(  'page_namespace' => 6,
+    array(  'page_namespace' => NS_IMAGE,
     "LCASE(page_title) LIKE '%". $db->strencode( $term2 ) ."%'" ),
     "wfSajaxSearch",
@@ -378,27 +380,46 @@
     );
 
-    $r = "";
-
+    $ret = "";
     $i=0;
-    while ( ( $row = $db->fetchObject( $res ) ) && ( ++$i <= $limit ) ) {
-
-        $im = Image::newFromName($row->page_title);
-        $url = $im->getURL();
-
-        $ti = Title::makeTitle(6, $row->page_title);
-
-        $tiURL = "";
-        $tiName= "";
-        if (is_object($ti)) {
-            $tiURL  = $ti->getLocalURL();
-            $tiName = $ti->getPrefixedDBkey();
-        }
-
-        $r .= '<li>' . "<div style=\"background-color: #DFDFDF; cursor: pointer;\" onMouseover=\"this.style.backgroundColor='#0099FF'\" onMouseout=\"this.style.backgroundColor='#DFDFDF'\" onclick=\"clickOnList('".$row->page_title."','".$url."','".$tiURL."','".$tiName."')\">".htmlspecialchars( $row->page_title ) .'</div>'. "</li>\n";
-    }
-
-    $term = htmlspecialchars( $term );
-
-    return "  <input type=\"hidden\" name=\"wfSajaxSearchImageFCKeditor\" value=\"\"><br />Images containing <b>\"".$term2."\"</b><br /><ul>" .$r ."</ul>";
+    while ( ( $row = $db->fetchObject( $res ) ) && ( ++$i <= $limit ) ) {        
+        $ret .= $row->page_title ."\n";
+    }
+
+    $term = htmlspecialchars( $term );    
+    
+    return $ret;
+}
+
+function wfSajaxSearchArticleFCKeditor( $term )
+{
+    global $wgContLang, $wgOut;
+    $limit = 10;
+
+    $term = $wgContLang->checkTitleEncoding( $wgContLang->recodeInput( js_unescape( $term ) ) );
+    $term1 = str_replace( ' ', '_', $wgContLang->ucfirst( $term ) );
+    $term2 = str_replace( ' ', '_', $wgContLang->lc( $term ) );
+    $term3 = str_replace( ' ', '_', $wgContLang->uc( $term ) );
+    $term = $term1;
+
+    if ( strlen( str_replace( '_', '', $term ) )<3 )
+    return "";
+
+    $db =& wfGetDB( DB_SLAVE );
+    $res = $db->select( 'page', 'page_title',
+    array(  'page_namespace' => NS_MAIN,
+    "LCASE(page_title) LIKE '%". $db->strencode( $term2 ) ."%'" ),
+    "wfSajaxSearch",
+    array( 'LIMIT' => $limit+1 )
+    );
+
+    $ret = "";
+    $i=0;
+    while ( ( $row = $db->fetchObject( $res ) ) && ( ++$i <= $limit ) ) {        
+        $ret .= $row->page_title ."\n";
+    }
+
+    $term = htmlspecialchars( $term );    
+    
+    return $ret;
 }
 
Index: /MediaWiki/trunk/extensions/FCKeditor/FCKeditor.php
===================================================================
--- /MediaWiki/trunk/extensions/FCKeditor/FCKeditor.php	(revision 530)
+++ /MediaWiki/trunk/extensions/FCKeditor/FCKeditor.php	(revision 531)
@@ -46,4 +46,5 @@
 $wgUseAjax = true;
 $wgAjaxExportList[] = 'wfSajaxSearchImageFCKeditor';
+$wgAjaxExportList[] = 'wfSajaxSearchArticleFCKeditor';
 $wgAjaxExportList[] = 'wfSajaxWikiToHTML';
 
