Extension talk:WYSIWYG

From MediaWiki.org
Jump to: navigation, search
Start a new discussion
First page
First page
Previous page
Previous page
Last page
Last page

Next version release date?

Hello.

When will the next version be released ? To support Mediawiki 1.19.x.

89.238.206.23007:25, 23 May 2012

I'd like to know this as well. Is there any sort of development log/blog or target dates? It would really help me plan my activities if I knew when to expect things.

72.34.128.25020:00, 24 May 2012
 

Indent button missing in 1.7

I've been testing the latest version (1.7) before I install it, and it appears a key feature (indent) may have been dropped. Both on my test install as well as on http://dailywikibuilds.ontoprise.com/smw170 , if you go into the WYSIWYG editor, you'll see that the indent left & right button is missing.

This wrecks havoc with my ability to edit & format bulleted lists. Was this intentional or just an oversight? (I looked in the release notes but didn't see anything mentioned)

Larryc (talk)12:41, 24 May 2012

Editor not showing up (fresh MW 1.17.4)

I'm trying to get the editor (1.7.0_1) to work in a freshly installed MediaWiki following the instructions on this page. The extension shows up in Special:Version, but the editor does not show up when editing a page. Any advice would be much appreciated!

Vlehdonv (talk)20:27, 17 May 2012

i am in the same position. My install is not fresh, but i see the same results: no editor. when i click edit, the URL bar shows "&mode=wysiwyg" at the end, but it is just the wiki markup editor, not WYSIWYG. PLEASE help.

50.47.60.14122:11, 18 May 2012

Same here on a fresh MW 1.17.4 install. Help would be cool. :) Cheers

[[kgh]] (talk)21:20, 21 May 2012
 
 

Patch for MW 1.19

Disclaimer: This is a patch against a slightly customized variant of version 1.6.0, so it might not apply cleanly. It is not tested very much and it might not be backwards compliant with older MediaWiki releases.

Also, please note that to support self links correctly, it will be necessary to either modify core or to copy and paste the method 'replaceInternalLinks2' from the core parser.

=== modified file 'extensions/WYSIWYG/CKeditor.body.php'
--- extensions/WYSIWYG/CKeditor.body.php        2012-02-27 13:33:51 +0000
+++ extensions/WYSIWYG/CKeditor.body.php        2012-03-05 07:37:32 +0000
@@ -130,7 +130,9 @@
        }
 
        public static function onParserBeforeStrip( &$parser, &$text, &$stripState ) {
-               $text = $parser->strip( $text, $stripState );
+               if (get_class($parser) == 'CKeditorParser') {
+                       $text = $parser->strip( $text, $stripState );
+               }
                return true;
        }
 
@@ -219,25 +221,22 @@
  
 
        public function onCustomEditor( $article, $user ) {
-               global $wgRequest, $mediaWiki;
+               global $wgRequest, $wgUseExternalEditor;
 
-               $action = $mediaWiki->getVal( 'Action' );
+               $action = $wgRequest->getVal( 'action', 'view' );
 
                $internal = $wgRequest->getVal( 'internaledit' );
                $external = $wgRequest->getVal( 'externaledit' );
                $section = $wgRequest->getVal( 'section' );
                $oldid = $wgRequest->getVal( 'oldid' );
-               if( !$mediaWiki->getVal( 'UseExternalEditor' ) || $action == 'submit' || $internal ||
+               if( !$wgUseExternalEditor || $action == 'submit' || $internal ||
                $section || $oldid || ( !$user->getOption( 'externaleditor' ) && !$external ) ) {
                        $editor = new CKeditorEditPage( $article );
-                       $editor->submit();
-               } elseif( $mediaWiki->getVal( 'UseExternalEditor' ) && ( $external || $user->getOption( 'externaleditor' ) ) ) {
-                       $mode = $wgRequest->getVal( 'mode' );
-                       $extedit = new ExternalEdit( $article, $mode );
-                       $extedit->edit();
+                       $editor->edit();
+                       return false;
+               } else {
+                       return true;
                }
-
-               return false;
        }
 
     public static function onDoEditSectionLink ($skin, $title, $section, $tooltip, $result, $lang = false ) {
@@ -491,7 +490,7 @@
                $skin->mTitle =& $wgTitle;
                $skin->initPage( $wgOut );
                $skin->userpage = $wgUser->getUserPage()->getPrefixedText();
-               $skin->setupUserCss( $wgOut );
+               $skin->setupSkinUserCss( $wgOut );
 
                if( !empty( $skin->usercss ) && preg_match_all( '/@import "([^"]+)";/', $skin->usercss, $matches ) ) {
                        $userStyles = $matches[1];
@@ -692,13 +691,6 @@
     */
        if( showFCKEditor & RTE_VISIBLE ){
                if ( toolbar ){ // insert wiki buttons
-                       // Remove the mwSetupToolbar onload hook to avoid a JavaScript error with FF.
-                       if ( window.removeEventListener )
-                               window.removeEventListener( 'load', mwSetupToolbar, false );
-                       else if ( window.detachEvent )
-                               window.detachEvent( 'onload', mwSetupToolbar );
-                       mwSetupToolbar = function(){ return false ; };
-
                        for( var i = 0; i < mwEditButtons.length; i++ ) {
                                mwInsertEditButton(toolbar, mwEditButtons[i]);
                        }

=== added file 'extensions/WYSIWYG/CKeditorLinker.php'
--- extensions/WYSIWYG/CKeditorLinker.php       1970-01-01 00:00:00 +0000
+++ extensions/WYSIWYG/CKeditorLinker.php       2012-03-05 07:52:14 +0000
@@ -0,0 +1,448 @@
+<?php
+
+/**
+ * Since the core parser have moved to use a static method pattern for
+ * rendering links, the functionality from CKeditorSkin has been moved
+ * here and now relies on hooks.
+ *
+ * The methods in the skin that as of 1.19 are no longer called from
+ * core has been ignored, which means that some extensions might break.
+ *
+ * The method 'makeSelfLinkObj' is called directly from the core
+ * parser, but no hook is available for it, so a patch to core is
+ * required to support it.
+ *
+ * The public methods of CKeditorSkin are:
+ * 
+ * makeImageLink2 - used in core, hook available: ImageBeforeProduceHTML
+ * makeLinkObj - deprecated, unused in core
+ * makeKnownLinkObj - deprecated, unused in core
+ * makeColouredLinkObj - deprecated, unused in core
+ * makeBrokenLinkObj - only used in makeImageLink2
+ * makeSelfLinkObj - used by core parser, impossible to hook
+ * makeMediaLinkObj - only used by formatComment in core
+ * makeExternalLink - used in core, hook available: LinkerMakeExternalLink
+ */
+class CKeditorLinker {
+
+       public static function addHooks() {
+               global $wgHooks;
+
+               $wgHooks['ImageBeforeProduceHTML'][] = 'CKeditorLinker::makeImageLink2';
+               $wgHooks['LinkerMakeExternalLink'][] = 'CKeditorLinker::makeExternalLink';
+               $wgHooks['LinkEnd'][]                = 'CKeditorLinker::linkEnd';
+               $wgHooks['LinkBegin'][]              = 'CKeditorLinker::linkBegin';
+       }
+
+       public static function removeHooks() {
+               self::removeHook('ImageBeforeProduceHTML', 'CKeditorLinker::makeImageLink2');
+               self::removeHook('LinkerMakeExternalLink', 'CKeditorLinker::makeExternalLink');
+               self::removeHook('LinkEnd', 'CKeditorLinker::linkEnd');
+               self::removeHook('LinkBegin', 'CKeditorLinker::linkBegin');
+       }
+
+       private static function removeHook($hookName, $function) {
+               global $wgHooks;
+               $hook = $wgHooks[$hookName];
+               $i = array_search($function, $hook);
+               if ($i) {
+                       $wgHooks[$hookName] = array_splice($hook, $i, 1);
+               }
+       }
+
+       /**
+        * Make an image link in MediaWiki 1.11
+        * @param Title $title Title object
+        * @param File $file File object, or false if it doesn't exist
+        *
+        * @param array $frameParams Associative array of parameters external to the media handler.
+        *     Boolean parameters are indicated by presence or absence, the value is arbitrary and
+        *     will often be false.
+        *          thumbnail       If present, downscale and frame
+        *          manualthumb     Image name to use as a thumbnail, instead of automatic scaling
+        *          framed          Shows image in original size in a frame
+        *          frameless       Downscale but don't frame
+        *          upright         If present, tweak default sizes for portrait orientation
+        *          upright_factor  Fudge factor for "upright" tweak (default 0.75)
+        *          border          If present, show a border around the image
+        *          align           Horizontal alignment (left, right, center, none)
+        *          valign          Vertical alignment (baseline, sub, super, top, text-top, middle,
+        *                          bottom, text-bottom)
+        *          alt             Alternate text for image (i.e. alt attribute). Plain text.
+        *          caption         HTML for image caption.
+        *
+        * @param array $handlerParams Associative array of media handler parameters, to be passed
+        *       to transform(). Typical keys are "width" and "page".
+        */
+       static function makeImageLink2( $skin, Title $nt, $file, $frameParams = array(), $handlerParams = array(), $time, &$ret ) {
+               $orginal = $nt->getText();
+               $file = RepoGroup::singleton()->getLocalRepo()->newFile( $nt );
+               $found = $file->exists();
+
+               if( !empty( $frameParams['alt'] ) && $frameParams['alt'] == 'RTENOTITLE' ){ // 2223
+                       $frameParams['alt'] = '';
+               }
+               if( $found ) {
+                       $type = 'image';
+                       if ($file->getMediaType() == MEDIATYPE_VIDEO) {
+                               $type = 'video';
+                       } else if ($file->getMediaType() == MEDIATYPE_AUDIO) {
+                               $type = 'audio';
+                       }
+                       if ($type == 'image') {
+                               $url = $file->getUrl();
+                       } else {
+                               $url = $file->createThumb( 230 );
+                       }
+               }
+
+               // Shortcuts
+               $fp =& $frameParams;
+               $hp =& $handlerParams;
+
+               if( !isset( $fp['align'] ) ) {
+                       $fp['align'] = '';
+               }
+
+               $ret = '<img ';
+
+               if( $found ) {
+                       $ret .= "src=\"{$url}\" ";
+               } else {
+                       $ret .= "_fck_mw_valid=\"false"."\" ";
+               }
+               $ret .= "_fck_mw_filename=\"{$orginal}\" ";
+
+               if( $fp['align'] ) {
+                       $ret .= "_fck_mw_location=\"" . strtolower( $fp['align'] ) . "\" ";
+               }
+               if( !empty( $hp ) ) {
+                       if( isset( $hp['width'] ) ) {
+                               $ret .= "_fck_mw_width=\"" . $hp['width'] . "\" ";
+                       }
+                       if( isset( $hp['height'] ) ) {
+                               $ret .= "_fck_mw_height=\"" . $hp['height'] . "\" ";
+                       }
+               }
+               $class = '';
+               if( isset( $fp['thumbnail'] ) ) {
+                       $ret .= "_fck_mw_type=\"thumb" . "\" ";
+                       $class .= 'fck_mw_frame';
+               } else if( isset( $fp['border'] ) ) {
+                       $ret .= "_fck_mw_type=\"border" . "\" ";
+                       $class .= 'fck_mw_border';
+               } else if( isset( $fp['framed'] ) ) {
+                       $ret .= "_fck_mw_type=\"frame" . "\" ";
+                       $class .= 'fck_mw_frame';
+               }
+
+               if( $fp['align'] == 'right' ) {
+                       $class .= ( $class ? ' ': '' ) . 'fck_mw_right';
+               } else if( $fp['align'] == 'center' ) {
+                       $class .= ( $class ? ' ' : ''  ) . 'fck_mw_center';
+               } else if( $fp['align'] == 'left' ) {
+                       $class .= ( $class ? ' ': '' ) . 'fck_mw_left';
+               } else if( isset( $fp['framed'] ) || isset( $fp['thumbnail'] ) ) {
+                       $class .= ( $class ? ' ' : '' ) . 'fck_mw_right';
+               }
+
+               if( !$found ) {
+                       $class .= ( $class ? ' ' : '' ) . 'fck_mw_notfound';
+               }
+
+               if( isset( $fp['alt'] ) && !empty( $fp['alt'] ) && $fp['alt'] != 'Image:' . $orginal ) {
+                       $ret .= "alt=\"" . htmlspecialchars( $fp['alt'] ) . "\" ";
+               } else {
+                       $ret .= "alt=\"\" ";
+               }
+
+               if( $class ) {
+                       $ret .= "class=\"$class\" ";
+               }
+        if (isset($fp['no-link']))
+            $ret .= 'no-link="1" ';
+        if (isset($fp['link-title']) && is_object($fp['link-title']))
+            $ret .= 'link="'.htmlentities ($fp['link-title']->getFullText()).'" ';
+        if (isset($fp['link-url']))
+            $ret .= 'link="'.$fp['link-url'].'" ';
+
+               $ret .= '/>';
+
+               return false;
+       }
+
+       static function makeExternalLink( $url, $text, &$link, &$attribs, $linktype ) {
+               $url = htmlspecialchars( $url );
+               $text = htmlspecialchars( $text );
+               $url = preg_replace( "/^RTECOLON/", ":", $url ); // change 'RTECOLON' => ':'
+               $args = '';
+               if( $text == 'RTENOTITLE' ){ // 2223
+                       $args .= '_fcknotitle="true" ';
+                       $text = $url;
+               }
+               $link= '<a ' . $args . 'href="' . $url . '">' . $text . '</a>';
+
+               return false;
+       }
+
+       function makeColouredLinkObj( $nt, $colour, $text = '', $query = '', $trail = '', $prefix = '' ) {
+               return self::makeKnownLinkObj( $nt, $text, $query, $trail, $prefix, '', $style );
+       }
+
+       function makeKnownLinkObj( $nt, $text = '', $query = '', $trail = '', $prefix = '' , $aprops = '', $style = '' ) {
+               wfProfileIn( __METHOD__ );
+
+               $args = '';
+               if ( !is_object( $nt ) ) {
+                       wfProfileOut( __METHOD__ );
+                       return $text;
+               }
+
+               $u = $nt->getFullText();
+               $u = rawurlencode($u);  // Fix for links containing "
+               //#Updating links tables -> #Updating_links_tables
+               $u = str_replace( "#" . $nt->getFragment(), $nt->getFragmentForURL(), $u );
+
+               if ( $nt->getFragment() != '' ) {
+                       if( $nt->getPrefixedDBkey() == '' ) {
+                               $u = '';
+                               if ( '' == $text ) {
+                                       $text = htmlspecialchars( $nt->getFragment() );
+                               }
+                       }
+
+                       /**
+                        * See tickets 1386 and 1690 before changing anything
+                        */
+                       if( $nt->getPartialUrl() == '' ) {
+                               $u .= $nt->getFragmentForURL();
+                       }
+               }
+               if ( $text == '' ) {
+                       $text = htmlspecialchars( $nt->getPrefixedText() );
+               }
+
+               if( $nt->getNamespace() == NS_CATEGORY ) {
+                       $u = ':' . $u;
+               }
+
+               list( $inside, $trail ) = Linker::splitTrail( $trail );
+               $title = "{$prefix}{$text}{$inside}";
+
+               $u = preg_replace( "/^RTECOLON/", ":", $u ); // change 'RTECOLON' => ':'
+               if( substr( $text, 0, 10 ) == 'RTENOTITLE' ){ // starts with RTENOTITLE
+                       $args .= '_fcknotitle="true" ';
+                       $title = rawurldecode($u);
+                       $trail = substr( $text, 10 ) . $trail;
+               }
+
+               $r = "<a {$args}href=\"{$u}\">{$title}</a>{$trail}";
+               wfProfileOut( __METHOD__ );
+               return $r;
+       }
+
+       function makeBrokenLinkObj( $nt, $text = '', $query = '', $trail = '', $prefix = '' ) {
+               # Fail gracefully
+               if ( !isset( $nt ) ) {
+                       # throw new MWException();
+                       return "<!-- ERROR -->{$prefix}{$text}{$trail}";
+               }
+               $args = '';
+
+               wfProfileIn( __METHOD__ );
+
+               $u = $nt->getFullText();
+               $u = rawurlencode($u);  // Fix for links containing "
+               
+               //#Updating links tables -> #Updating_links_tables
+               $u = str_replace( "#" . $nt->getFragment(), $nt->getFragmentForURL(), $u );
+
+               if ( '' == $text ) {
+                       $text = htmlspecialchars( $nt->getPrefixedText() );
+               }
+               if( $nt->getNamespace() == NS_CATEGORY ) {
+                       $u = ':' . $u;
+               }
+
+               list( $inside, $trail ) = Linker::splitTrail( $trail );
+               $title = "{$prefix}{$text}{$inside}";
+
+               $u = preg_replace( "/^RTECOLON/", ":", $u ); // change 'RTECOLON' => ':'
+               if( substr( $text, 0, 10 ) == 'RTENOTITLE' ){   // starts with RTENOTITLE
+                       $args .= '_fcknotitle="true" ';
+                       $title = rawurldecode($u);
+                       $trail = substr( $text, 10 ) . $trail;
+               }
+               $s = "<a {$args}href=\"{$u}\">{$title}</a>{$trail}";
+
+               wfProfileOut( __METHOD__ );
+               return $s;
+       }
+
+       static function makeSelfLinkObj( $nt, $text = '', $query = '', $trail = '', $prefix = '' ) {
+               $args = '';
+               if ( '' == $text ) {
+                       $text = $nt->mDbkeyform;
+               }
+               list( $inside, $trail ) = Linker::splitTrail( $trail );
+               $title = "{$prefix}{$text}";
+               if( $text == 'RTENOTITLE' ){ // 2223
+                       $args .= '_fcknotitle="true" ';
+                       $title = $nt->mDbkeyform;
+               }
+               return "<a {$args}href=\"".$nt->mDbkeyform."\" class=\"selflink\">{$title}</a>{$inside}{$trail}";
+       }
+
+       /**
+        * Create a direct link to a given uploaded file.
+        *
+        * @param $title Title object.
+        * @param $text  String: pre-sanitized HTML
+        * @return string HTML
+        *
+        * @todo Handle invalid or missing images better.
+        */
+       static function makeMediaLinkObj( $title, $text = '' ) {
+               if( is_null( $title ) ) {
+                       ### HOTFIX. Instead of breaking, return empty string.
+                       return $text;
+               } else {
+                       $args = '';
+                       $orginal = $title->getPartialURL();
+                       $img = wfFindFile( $title );
+                       if( $img ) {
+                               $url  = $img->getURL();
+                               $class = 'internal';
+                       } else {
+                               $upload = SpecialPage::getTitleFor( 'Upload' );
+                               $url = $upload->getLocalUrl( 'wpDestFile=' . urlencode( $title->getDBkey() ) );
+                               $class = 'new';
+                       }
+                       $alt = htmlspecialchars( $title->getText() );
+                       if( $text == '' ) {
+                               $text = $alt;
+                       }
+                       $orginal = preg_replace( "/^RTECOLON/", ":", $orginal ); // change 'RTECOLON' => ':'
+                       if( $text == 'RTENOTITLE' ){ // 2223
+                               $args .= '_fcknotitle="true" ';
+                               $text = $orginal;
+                               $alt = $orginal;
+                       }
+                       return "<a href=\"{$orginal}\" class=\"$class\" {$args} _fck_mw_filename=\"{$orginal}\" _fck_mw_type=\"media\" title=\"{$alt}\">{$text}</a>";
+               }
+       }
+
+       static function linkBegin( $skin, Title $target, &$text, array &$attribs, &$query, &$options, &$ret) {
+               if ( $target->isExternal() ) {
+                       $args = '';
+                       $u = $target->getFullURL();
+                       $link = $target->getPrefixedURL();
+                       if ( '' == $text ) {
+                               $text = $target->getPrefixedText();
+                       }
+                       $style = Linker::getInterwikiLinkAttributes( $link, $text, 'extiw' );
+
+                       if( $text == 'RTENOTITLE' ) { // 2223
+                               $text = $u = $link;
+                               $args .= '_fcknotitle="true" ';
+                       }
+                       $t = "<a {$args}href=\"{$u}\"{$style}>{$text}</a>";
+
+                       wfProfileOut( __METHOD__ );
+                       $ret = $t;
+                       return false;
+               }
+
+               return true;
+       }
+
+       static function linkEnd(  $skin, Title $target, array $options, &$text, array &$attribs, &$ret ) {
+
+               if ( in_array('known', $options) ) {
+                       $args = '';
+                       if ( !is_object( $target ) ) {
+                               wfProfileOut( __METHOD__ );
+                               return $text;
+                       }
+
+                       $u = $target->getFullText();
+                       $u = rawurlencode($u);  // Fix for links containing "
+                       //#Updating links tables -> #Updating_links_tables
+                       $u = str_replace( "#" . $target->getFragment(), $target->getFragmentForURL(), $u );
+
+                       if ( $target->getFragment() != '' ) {
+                               if( $target->getPrefixedDBkey() == '' ) {
+                                       $u = '';
+                                       if ( '' == $text ) {
+                                               $text = htmlspecialchars( $target->getFragment() );
+                                       }
+                               }
+
+                               /**
+                                * See tickets 1386 and 1690 before changing anything
+                                */
+                               if( $target->getPartialUrl() == '' ) {
+                                       $u .= $target->getFragmentForURL();
+                               }
+                       }
+                       if ( $text == '' ) {
+                               $text = htmlspecialchars( $target->getPrefixedText() );
+                       }
+
+                       if( $target->getNamespace() == NS_CATEGORY ) {
+                               $u = ':' . $u;
+                       }
+
+                       $u = preg_replace( "/^RTECOLON/", ":", $u ); // change 'RTECOLON' => ':'
+                       if( substr( $text, 0, 10 ) == 'RTENOTITLE' ){ // starts with RTENOTITLE
+                               $args .= '_fcknotitle="true" ';
+                               $text = rawurldecode($u);
+                       }
+
+                       $r = "<a {$args}href=\"{$u}\">{$text}</a>";
+                       wfProfileOut( __METHOD__ );
+
+                       $ret = $r;
+
+                       return false;
+               }
+
+
+               if (in_array('broken', $options)) {
+                       if ( !isset( $target ) ) {
+                               # throw new MWException();
+                               return "<!-- ERROR -->{$prefix}{$text}";
+                       }
+                       $args = '';
+
+                       wfProfileIn( __METHOD__ );
+
+                       $u = $target->getFullText();
+                       $u = rawurlencode($u);  // Fix for links containing "
+               
+                       //#Updating links tables -> #Updating_links_tables
+                       $u = str_replace( "#" . $target->getFragment(), $target->getFragmentForURL(), $u );
+
+                       if ( '' == $text ) {
+                               $text = htmlspecialchars( $target->getPrefixedText() );
+                       }
+                       if( $target->getNamespace() == NS_CATEGORY ) {
+                               $u = ':' . $u;
+                       }
+
+                       $u = preg_replace( "/^RTECOLON/", ":", $u ); // change 'RTECOLON' => ':'
+                       if( substr( $text, 0, 10 ) == 'RTENOTITLE' ){   // starts with RTENOTITLE
+                               $args .= '_fcknotitle="true" ';
+                               $text = rawurldecode($u);
+                       }
+                       $s = "<a {$args}href=\"{$u}\">{$text}</a>";
+
+                       wfProfileOut( __METHOD__ );
+                       $ret = $s;
+                       return false;
+               }
+               
+               return true;
+       }
+
+}
\ No newline at end of file

=== modified file 'extensions/WYSIWYG/CKeditorParser.body.php'
--- extensions/WYSIWYG/CKeditorParser.body.php  2012-02-27 13:33:51 +0000
+++ extensions/WYSIWYG/CKeditorParser.body.php  2012-03-02 11:17:39 +0000
@@ -391,17 +390,11 @@
       if (!$stripcomments && $element == '!--') {
         $commentState->setPair($marker, $output);
       } elseif ($element == 'html' || $element == 'nowiki') {
-        $nowikiItems[$marker] = $output;
+               $state->addNoWiki($marker, $output);
       } else {
-        $generalItems[$marker] = $output;
+               $state->addGeneral($marker, $output);
       }
     }
-    # Add the new items to the state
-    # We do this after the loop instead of during it to avoid slowing
-    # down the recursive unstrip
-    $state->nowiki->mergeArray($nowikiItems);
-    $state->general->mergeArray($generalItems);
-
     # Unstrip comments unless explicitly told otherwise.
     # (The comments are always stripped prior to this point, so as to
     # not invoke any extension tags / parser hooks contained within
@@ -728,66 +721,73 @@
   }
 
   function parse($text, Title $title, ParserOptions $options, $linestart = true, $clearState = true, $revid = null) {
-    $text = preg_replace("/^#REDIRECT/", '<!--FCK_REDIRECT-->', $text);
-    $text = preg_replace("/\<(noinclude|includeonly|onlyinclude)\>/i", '%%%start-$1%%%', $text);
-    $text = preg_replace("/\<\/(noinclude|includeonly|onlyinclude)\>/i", '%%%end-$1%%%', $text);
-    $parserOutput = parent::parse($text, $title, $options, $linestart, $clearState, $revid);
-
-
-    $parserOutput->setText(strtr($parserOutput->getText(), array('FCKLR_fcklr_FCKLR' => '<br fcklr="true"/>')));
-    $parserOutput->setText(strtr($parserOutput->getText(), array('--~~~~' => '<span class="fck_mw_signature">_</span>')));
-
-    if (!empty($this->fck_mw_strtr_span)) {
-      global $leaveRawTemplates;
-      if (!empty($leaveRawTemplates)) {
-        foreach ($leaveRawTemplates as $l) {
-          $this->fck_mw_strtr_span[$l] = substr($this->fck_mw_strtr_span[$l], 30, -7);
-        }
-      }
-      $text = strtr($parserOutput->getText(), $this->fck_mw_strtr_span);
-      $parserOutput->setText(strtr($text, $this->fck_mw_strtr_span));
-
-      //replace fckLR strings with empty strings
-//                        $parserOutput->setText( strtr( $parserOutput->getText(), array('fckLR' => '') ) );
-    }
-
-    // there were properties, look for the placeholder FCK_PROPERTY_X_FOUND and replace
-    // it with <span class="fck_mw_property">property string without brakets</span>
-    if (count($this->fck_mw_propertyAtPage) > 0) {
-      $tmpText = $parserOutput->getText();
-      foreach ($this->fck_mw_propertyAtPage as $p => $val)
-        $tmpText = str_replace('FCK_PROPERTY_' . $p . '_FOUND', $val, $tmpText);
-      $parserOutput->setText($tmpText);
-    }
-    // there were Richmedia links, look for the placeholder FCK_RICHMEDIA_X_FOUND and replace
-    // it with <a title="My Document.doc" _fck_mw_type="Document" _fck_mw_filename="My Document.doc"
-    // _fcksavedurl="Document:MyDocument.doc" href="My_Document.doc">Document:My Document.doc</a>
-    if (count($this->fck_mw_richmediaLinkAtPage) > 0) {
-      $tmpText = $parserOutput->getText();
-      foreach ($this->fck_mw_richmediaLinkAtPage as $p => $val)
-        $tmpText = str_replace('FCK_RICHMEDIA_' . $p . '_FOUND', $val, $tmpText);
-      $parserOutput->setText($tmpText);
-    }
-
-    if (!empty($this->fck_matches)) {
-      $text = $parserOutput->getText();
-      foreach ($this->fck_matches as $key => $m) {
-        $text = str_replace($key, $m[3], $text);
-      }
-      $parserOutput->setText($text);
-    }
-
-    if (!empty($parserOutput->mLanguageLinks)) {
-      foreach ($parserOutput->mLanguageLinks as $l) {
-        $parserOutput->setText($parserOutput->getText() . "\n" . '<a href="' . $l . '">' . $l . '</a>');
-      }
-    }
-
-    $parserOutput->setText(str_replace('<!--FCK_REDIRECT-->', '#REDIRECT', $parserOutput->getText()));
-    $parserOutput->setText(preg_replace('/%%%start\-(noinclude|includeonly|onlyinclude)%%%/i', '<span class="fck_mw_$1" _fck_mw_tagname="$1" startTag="true"></span>', $parserOutput->getText()));
-    $parserOutput->setText(preg_replace('/%%%end\-(noinclude|includeonly|onlyinclude)%%%/i', 'fckLR<span class="fck_mw_$1" _fck_mw_tagname="$1" endTag="true"></span>', $parserOutput->getText()));
-    return $parserOutput;
+    CKeditorLinker::addHooks();
+       try {
+               $text = preg_replace("/^#REDIRECT/", '<!--FCK_REDIRECT-->', $text);
+               $text = preg_replace("/\<(noinclude|includeonly|onlyinclude)\>/i", '%%%start-$1%%%', $text);
+               $text = preg_replace("/\<\/(noinclude|includeonly|onlyinclude)\>/i", '%%%end-$1%%%', $text);
+               $parserOutput = parent::parse($text, $title, $options, $linestart, $clearState, $revid);
+
+
+               $parserOutput->setText(strtr($parserOutput->getText(), array('FCKLR_fcklr_FCKLR' => '<br fcklr="true"/>')));
+               $parserOutput->setText(strtr($parserOutput->getText(), array('--~~~~' => '<span class="fck_mw_signature">_</span>')));
+
+               if (!empty($this->fck_mw_strtr_span)) {
+                       global $leaveRawTemplates;
+                       if (!empty($leaveRawTemplates)) {
+                               foreach ($leaveRawTemplates as $l) {
+                                       $this->fck_mw_strtr_span[$l] = substr($this->fck_mw_strtr_span[$l], 30, -7);
+                               }
+                       }
+                       $text = strtr($parserOutput->getText(), $this->fck_mw_strtr_span);
+                       $parserOutput->setText(strtr($text, $this->fck_mw_strtr_span));
+
+                       //replace fckLR strings with empty strings
+                       //                        $parserOutput->setText( strtr( $parserOutput->getText(), array('fckLR' => '') ) );
+               }
+
+               // there were properties, look for the placeholder FCK_PROPERTY_X_FOUND and replace
+               // it with <span class="fck_mw_property">property string without brakets</span>
+               if (count($this->fck_mw_propertyAtPage) > 0) {
+                       $tmpText = $parserOutput->getText();
+                       foreach ($this->fck_mw_propertyAtPage as $p => $val)
+                               $tmpText = str_replace('FCK_PROPERTY_' . $p . '_FOUND', $val, $tmpText);
+                       $parserOutput->setText($tmpText);
+               }
+               // there were Richmedia links, look for the placeholder FCK_RICHMEDIA_X_FOUND and replace
+               // it with <a title="My Document.doc" _fck_mw_type="Document" _fck_mw_filename="My Document.doc"
+               // _fcksavedurl="Document:MyDocument.doc" href="My_Document.doc">Document:My Document.doc</a>
+               if (count($this->fck_mw_richmediaLinkAtPage) > 0) {
+                       $tmpText = $parserOutput->getText();
+                       foreach ($this->fck_mw_richmediaLinkAtPage as $p => $val)
+                               $tmpText = str_replace('FCK_RICHMEDIA_' . $p . '_FOUND', $val, $tmpText);
+                       $parserOutput->setText($tmpText);
+               }
+
+               if (!empty($this->fck_matches)) {
+                       $text = $parserOutput->getText();
+                       foreach ($this->fck_matches as $key => $m) {
+                               $text = str_replace($key, $m[3], $text);
+                       }
+                       $parserOutput->setText($text);
+               }
+
+               if (!empty($parserOutput->mLanguageLinks)) {
+                       foreach ($parserOutput->mLanguageLinks as $l) {
+                               $parserOutput->setText($parserOutput->getText() . "\n" . '<a href="' . $l . '">' . $l . '</a>');
+                       }
+               }
+
+               $parserOutput->setText(str_replace('<!--FCK_REDIRECT-->', '#REDIRECT', $parserOutput->getText()));
+               $parserOutput->setText(preg_replace('/%%%start\-(noinclude|includeonly|onlyinclude)%%%/i', '<span class="fck_mw_$1" _fck_mw_tagname="$1" startTag="true"></span>', $parserOutput->getText()));
+               $parserOutput->setText(preg_replace('/%%%end\-(noinclude|includeonly|onlyinclude)%%%/i', 'fckLR<span class="fck_mw_$1" _fck_mw_tagname="$1" endTag="true"></span>', $parserOutput->getText()));
+               CKeditorLinker::removeHooks();
+               return $parserOutput;
+       } catch (Exception $e) {
+               CKeditorLinker::removeHooks();
+               throw $e;
+       }
   }
 
   /**

=== modified file 'extensions/WYSIWYG/CKeditorSajax.body.php'
--- extensions/WYSIWYG/CKeditorSajax.body.php   2012-02-27 13:33:51 +0000
+++ extensions/WYSIWYG/CKeditorSajax.body.php   2012-03-02 10:15:19 +0000
@@ -3,6 +3,53 @@
  * AJAX functions used by CKeditor extension
  */
 
+/**
+ * Function converts an Javascript escaped string back into a string with
+ * specified charset (default is UTF-8).
+ * Modified function from http://pure-essence.net/stuff/code/utf8RawUrlDecode.phps
+ *
+ * @param $source String escaped with Javascript's escape() function
+ * @param $iconv_to String destination character set will be used as second parameter
+ * in the iconv function. Default is UTF-8.
+ * @return string
+ */
+function js_unescape( $source, $iconv_to = 'UTF-8' ) {
+        $decodedStr = '';
+        $pos = 0;
+        $len = strlen ( $source );
+
+        while ( $pos < $len ) {
+                $charAt = substr ( $source, $pos, 1 );
+                if ( $charAt == '%' ) {
+                        $pos++;
+                        $charAt = substr ( $source, $pos, 1 );
+
+                        if ( $charAt == 'u' ) {
+                                // we got a unicode character
+                                $pos++;
+                                $unicodeHexVal = substr ( $source, $pos, 4 );
+                                $unicode = hexdec ( $unicodeHexVal );
+                                $decodedStr .= code2utf( $unicode );
+                                $pos += 4;
+                        } else {
+                                // we have an escaped ascii character
+                                $hexVal = substr ( $source, $pos, 2 );
+                                $decodedStr .= chr ( hexdec ( $hexVal ) );
+                                $pos += 2;
+                        }
+                } else {
+                        $decodedStr .= $charAt;
+                        $pos++;
+                }
+        }
+
+        if ( $iconv_to != "UTF-8" ) {
+                $decodedStr = iconv( "utf-8", $iconv_to, $decodedStr );
+        }
+
+        return $decodedStr;
+}
+
 function wfSajaxGetMathUrl( $term ) {
        $originalLink = MathRenderer::renderMath( $term );
 
@@ -124,8 +171,8 @@
        global $wgContLang, $wgExtraNamespaces;
        $limit = 30;
        $ns = array(NS_MAIN, NS_CATEGORY, NS_IMAGE, NS_TEMPLATE, NS_USER, NS_HELP);
-    if (defined(SF_NS_FORM)) $ns[]= SF_NS_FORM;
-    if (defined(SMW_NS_PROPERTY)) $ns[]= SMW_NS_PROPERTY;
+    if (defined('SF_NS_FORM')) $ns[]= SF_NS_FORM;
+    if (defined('SMW_NS_PROPERTY')) $ns[]= SMW_NS_PROPERTY;
 
        $term = $wgContLang->checkTitleEncoding( $wgContLang->recodeInput( js_unescape( $term ) ) );
     $prefix = "";

=== modified file 'extensions/WYSIWYG/WYSIWYG.php'
--- extensions/WYSIWYG/WYSIWYG.php      2012-02-27 13:33:51 +0000
+++ extensions/WYSIWYG/WYSIWYG.php      2012-03-02 10:09:52 +0000
@@ -99,6 +99,7 @@
 $wgAutoloadClasses['CKeditorParser'] = $dir . 'CKeditorParser.body.php';
 $wgAutoloadClasses['CKeditorParserOptions'] = $dir . 'CKeditorParserOptions.body.php';
 $wgAutoloadClasses['CKeditorParserWrapper'] = $dir . 'CKeditorParserWrapper.body.php';
+$wgAutoloadClasses['CKeditorLinker'] = $dir . 'CKeditorLinker.php';
 $wgAutoloadClasses['CKeditorSkin'] = $dir . 'CKeditorSkin.body.php';
 $wgAutoloadClasses['CKeditorEditPage'] = $dir . 'CKeditorEditPage.body.php';
 $wgAutoloadClasses['CKeditor_MediaWiki'] = $dir . 'CKeditor.body.php';


Andreas Jonsson (talk)08:22, 5 March 2012

It'd be great if you could regenerate your patch separately from your customizations!

50.0.205.10006:47, 13 March 2012
 

Works fine for MW1.18 too.

93.159.249.6610:29, 13 March 2012
 
Edited by 2 users.
Last edit: 12:09, 22 March 2012

very good...works also on my 1.18 however, I have got some few problems using Syntaxhighlight_geshi extension with it. after editing, all source code goes from multiline to singleline. After hacking code, I noticed that geshi was syntaxhighlight and source hooks. I modified this extension to also take into account syntaxhighlight hook . works only a little bit better, but the problem is not solved for the following reason: If you want to use geshi within ckeditor, a syntaxhighlighter plugin in ckeditor must be setted up.

So, I think it would only be useful displaying a special tag, at the moment.

Special tag does not display as it should for unknown tags to fckeditor. this is mainly because $wgParser is used. used $this in classes that overloads the parser will solve this issue.

however, once you managed to display the special block, when you switch to source . all the code is displayed, but linefeeds are removed !!!!

sancelot@free.fr

80.15.165.816:34, 13 March 2012
 

Thanks for taking the time to detail those many changes.

I have gone through each of your 'diffs' and new file additions and following your very detailed instructions created a new WYSIWYG extension adding only those changes. It works perfectly with my recent 1.18 addition and can be downloaded from our wiki at : http://wiki.linuxmatter.com/index.php/Ckeditor:central

Compumatter (talk)20:17, 15 March 2012

Compumatter - your patch works great.

However, if you try to insert an image via an external link, the following attributes are missing at the bottom:

Alignment Height Width

Hence, one does not have the ability to alight the image

67.164.20.719:17, 14 April 2012
 

I copied and pasted the code exactly, creating a new CKeditor.body.php but mediawiki is telling me there is a parser/synthax error on line 101 of the patch....anyone have the same problem?

I dont see what the error is

67.164.20.720:16, 14 April 2012

Hi,

I use 1.18 and receive the following error:

Notice: Undefined index: riched_load_semantic_toolbar in [..]\xampp-win32-1.7.7-usb-lite\xampp\htdocs\smwp3\extensions\WYSIWYG\CKeditor.body.php on line 436

And Ideas?

Thanks, peter

212.227.35.7515:02, 16 May 2012
 
 

Autocomplete dialog do not list images from commons wiki

Edited by 2 users.
Last edit: 16:12, 15 May 2012

We have two wiki sites (say http://localwiki and http://localcommonwiki) with shared upload. While inserting image using WYSIWYG editor, the extension searches and lists the uploaded images from the wiki site(http://localwiki) where it is deployed, but we would also like to see the images from commons wiki site (http://localcommonwiki) which is primarily hosted for image uploads. We have a shared upload directory(E:\wiki-commons\images) to store the uploaded images. The upload settings in LocalSettings.php is as follows:

#settings for using a shared upload.
$wgUploadNavigationUrl = "http://localcommonwiki/wiki/index.php?title=Special:Upload";
$wgUseSharedUploads = true;
$wgSharedUploadPath = 'http://localcommonwiki/wiki/images';
#$wgSharedUploadDirectory = '//pni6w1359/wiki-commons$/wiki-commons/images';
$wgSharedUploadDirectory = 'E:\wiki-commons\images';
$wgHashedSharedUploadDirectory = true;
$wgFetchCommonsDescriptions = true;
$wgSharedUploadDBname = 'commons';  # DB-Name of PoolWiki
$wgSharedUploadDBprefix = 'cmns_'; # Table name prefix for PoolWiki
$wgRepositoryBaseUrl = "http://localcommonwiki/wiki/index.php?title=Image:";

Please advise how can we search and list uploaded images from other wiki sites in Automatic search results making them available for insertion. I can get the images from other wiki in the list after running the importImages.php file, but this is the manual way and not sure how to automate it if this is right way. Appreciate your help in this regards. Please let me know if you need any other details.

Greetings Shrinivas Gangal

121.241.69.19405:57, 11 May 2012

Did anyone get a chance to look into this? This issue is causing an obstacle to proceed with an important release on production. Please help. Thanks and Regards, Shrinivas Gangal

121.241.69.19407:23, 15 May 2012
 

Copying and pasting rows in a table

Currently, rows don't paste correctly. For example, if I copy 5 rows (via ctrl+C), they'll get pasted as one row with many columns instead. Is there an easy way to copy and paste rows with the editor?

Jupiler (talk)20:13, 8 May 2012

Bulleted list and text style problems

Hello,

first of all, thanks for this awesome extension!

However, I have a little big problem that is making me crazy. :-)

When I use bulleted lists, there are some issues when I save the page. Before saving the page it seems perfect, but when I save it the editor adds some breakpoints and it doesn't always keep the correct identation.

I'm posting some screenshots to explain the problems I see. I'm using Mediawiki version 1.17.0 and I see these problems with Firefox and Chrome browsers.

  1. Here I'm creating a bulleted list and here is what I see [correct]: screen 1
  2. Here is what I see when I save the page: screen 2. As you can see this is not what I wanted.
  3. This is what I see when I try to edit the page again with the editor :screen 3
  4. This is what I see when I switch to the wiki editor: screen 4
  5. Now, I'm adding some bold style and italic style: screen 5
  6. And this is what I get when I save the page: screen 6. As you can see the bold and italic style have changed the bulleted list a bit, making it a little messy.
  7. Here is what I see when I try to edit the page again: screen 7 ...
  8. ...and this is what the wiki editor shows me: screen 8

May anyone can help me with this problem? I hope my description is not confusing...

Thanks in advance,

KykuAlma (talk)10:56, 5 April 2012

Hi KykuAlma,
your description is perfect!
What version of WYSIWYG are you using?
I was unable to reproduce this on 1.6.0_18

Ridmi07:33, 7 April 2012

Oh! I'm sorry, forgot to mention that... I'm using version 1.6.0_17.

Thanks for your help!

KykuAlma (talk)08:04, 10 April 2012

Then there is a good chance this issue has already been fixed.
Please update to the latest version and try again.

Ridmi08:06, 10 April 2012

I've just updated it and tested some cases. Seems working perfectly. :-)

Thanks a lot!

KykuAlma (talk)08:33, 10 April 2012
 

I'm seeing the same exact issues as the OP and I'm running 1.6.0_19. Can anyone else reproduce this?

Larryc (talk)22:39, 18 April 2012

Hi Larryc,
the OP has just confirmed the issue is resolved.
Are you seeing this in all browsers or just IE8?

Ridmi07:10, 19 April 2012
 
 
 
 

I have a similar problem with bullets. It seems to happen whenever we have nested bullets. My steps were:

  1. Create a page with nested bullets: http://public-share-485.s3.amazonaws.com/WYSI%20bug%20report%20-%20bullets%20-%20creating%20page.jpg
  2. After saving, it shows up incorrectly. http://public-share-485.s3.amazonaws.com/WYSI%20bug%20report%20-%20bullets%20-%20page%20result.jpg
  3. This is what it looks like when editing it again in WYSIWYG editor: http://public-share-485.s3.amazonaws.com/WYSI%20bug%20report%20-%20bullets%20-%20wysi%20editor.jpg
  4. and the text editor: http://public-share-485.s3.amazonaws.com/WYSI%20bug%20report%20-%20bullets%20-%20text%20editor.jpg

I'm using Firefox 9.0.1 on Windows XP. Editor version is 1.6.0_20

Jupiler (talk)20:08, 25 April 2012

Ridmi, are you able to reproduce this?

Jupiler (talk)19:06, 27 April 2012

Hi Jupiler.
No I can't.
I've used this installation: dailywikibuilds.ontoprise.com/smw160.
Try clearing your browser cache and updating to the latest build 1.6.0_22.

Ridmi07:13, 28 April 2012

I've cleared the browser cache and updated to latest build 1.6.0_22. The problem still persists in Firefox 9.0.1. It does seems to work fine in Chrome. When you said you couldn't reproduce it, I want to make sure you tested on Firefox, right? At this point, it seems to affect Firefox but not Chrome. But since most of our users use Firefox, it would be helpful if it worked in Firefox.

Jupiler (talk)16:47, 8 May 2012
 
 
 
 

Unable to browse Local Images

Hello, I installed the WYSIWYG extension and everything seems to be ok, but when I try to insert an image, the input window is different from the one in the sandbox and also I can't find images by start inserting name as in the sandbox version. My wiki is 1.17 and I downloded WYSIWYG 1.6.

Thanks

FrancoR (talk)11:59, 24 April 2012

Hi FrankoR,
please update your WYSIWYG extension to the latest version (1.6.0_22).
If the problem remains then post some screenshots of the input window

Ridmi07:16, 28 April 2012

Hi, I'm experiencing similar results. Where do I find a copy of 1.6.0_22? The download table on the main page only offers a link to 1.6.0_0.

Gurce

203.39.222.507:36, 30 April 2012
Edited by 2 users.
Last edit: 08:07, 2 May 2012

Hi Gurce,
here I've put together a thread for this: How to update WYSIWYG extension

Ridmi12:37, 30 April 2012
 

Hi Rdmi, I downoaded the extension directly from http://www.smwplus.com/index.php/Download#MEDIAWIKI_EXTENSIONS, after that looking at Special:Version page I got the 1.6.0_0 (B8) version for WYSIWYG. Reading the discussion I suppose the existence of newer versions so I tried to search but nothing. As for Gurce the download table on the main page only offers a link to 1.6.0_0. So I downloaded and installed the 1.7.0 but it wont run; with this version I haven't the [Rich Text] link, so I'm not able to change from standard to WYSIWYG editor. Also unfortunately, my wiky is not exposed to internet so I cant use Wiki Administrator Tool to perform upgrade or installation. Is there anothe way to download version 1.6.0_22 ?

Thanks a lot.

P.S: Despite this problem, I think it's a great extension.

FrancoR (talk)18:49, 30 April 2012

Hi to all, I just updated the download links to point to the latest stable version of the WYSIWYG extension. Thus it is possible to download it without the use of the Wiki Administration Tool. Thank you, Ridmi, for providing this information. This extensions rocks, and so does everybody involved with its development. :)

[[kgh]] (talk)20:40, 30 April 2012

Thanks Ridmi, kgh,

I've tried the 1.6.0_22 version on our mw1.17.0, it still shows the 'Image Properties' popup from the original ckeditor (containing the 'Image Info', 'Link' and 'Advanced' tabs), but not the wiki-image-specific popup as in your sandbox.

I also tried the 1.7.0_1 version, as FrancoR experienced, with it, I don't see any wysiwyg at all, just the standard mediawiki editor via standard wikitext, and no option to switch over to a rich-text editor.

Oh, now that I've explored 1.6.0_22 a bit more, I noticed that even the 'link' button shows the standard popup from the original ckeditor, and doesn't provide the wiki-specific popup. So it seems like I'm seeing just the standard ckeditor, and not the wiki-specific ckeditor behaviour?

I also noticed that during an edit, I see this message at the top of the page:

"Notice: Undefined index: riched_load_semantic_toolbar in .../extensions/WYSIWYG/CKeditor.body.php on line 437". I noticed this has a thread below about it too, although it mentions this issue was resolved in earlier versions than this.

Gurce

203.39.222.523:37, 30 April 2012

Aha, figured it out. It was due to the install instructions provided next to the download-table were omitting a step I needed, which I found on the install-page's 'discussion' page.

define('SMW_HALO_VERSION',true);

Once I added the suggested line into my 'LocalSettings.php' file, the issues I observed before have gone now, yay :)

Gurce (talk)00:23, 1 May 2012
 
 

Hi FrancoR,
in 1.7.0 the [Rich Text] link is disabled by default.
You can enable it in the editing preferences or just use a WikiText button to view/edit the wiki markup.
HTH.

Ridmi08:11, 2 May 2012

Hi Rdmi, I did a check on a new environmet and after installed WYSIWYG 1.7 and anabled [Rich Text] link in the preferences, the link doesn't appear. When I've just a ciuple o minute, I'll try to install also HaloACL ArcLibrary eand ScriptManager on this machine one at time and check if the link start running (appear).

Bye FrancoR

FrancoR (talk)12:45, 3 May 2012
 

Hi Rdmi, I did a check on a new environmet and after installed WYSIWYG 1.7 and anabled [Rich Text] link in the preferences, the link doesn't appear. When I've just a ciuple o minute, I'll try to install also HaloACL ArcLibrary eand ScriptManager on this machine one at time and check if the link start running (appear).

Bye FrancoR

FrancoR (talk)12:45, 3 May 2012
 
 
 
 

Patch for CKeditor.body.php to make it work in MW 1.18

[josm@localhost extensions]$ diff -w -c 1 WYSIWYG/CKeditor.body.php extensions/WYSIWYG/CKeditor.body.php
diff: extra operand `extensions/WYSIWYG/CKeditor.body.php'
diff: Try `diff --help' for more information.
[josm@localhost extensions]$ diff -w -C 1 WYSIWYG/CKeditor.body.php extensions/WYSIWYG/CKeditor.body.php
*** WYSIWYG/CKeditor.body.php   2012-01-20 18:07:57.000000000 +0100
--- extensions/WYSIWYG/CKeditor.body.php        2011-12-01 16:51:48.000000000 +0100
***************
*** 132,134 ****
        public static function onParserBeforeStrip( &$parser, &$text, &$stripState ) {
!               $text = $parser->replaceVariables( $text );
                return true;
--- 132,134 ----
        public static function onParserBeforeStrip( &$parser, &$text, &$stripState ) {
!               $text = $parser->strip( $text, $stripState );
                return true;
***************
*** 216,221 ****

          public function onCustomEditor( $article, $user ) {
!                 global $wgRequest, $wgUseExternalEditor;

!                 $action = $wgRequest->getVal( 'action', 'view' );

--- 216,222 ----

+
        public function onCustomEditor( $article, $user ) {
!               global $wgRequest, $mediaWiki;

!               $action = $mediaWiki->getVal( 'Action' );

***************
*** 225,234 ****
                  $oldid = $wgRequest->getVal( 'oldid' );
!                 if( !$wgUseExternalEditor || $action == 'submit' || $internal ||
                  $section || $oldid || ( !$user->getOption( 'externaleditor' ) && !$external ) ) {
                          $editor = new CKeditorEditPage( $article );
!                         $editor->edit();
!                         return false;
!                 } else {
!                         return true;
                  }
          }
--- 226,238 ----
                $oldid = $wgRequest->getVal( 'oldid' );
!               if( !$mediaWiki->getVal( 'UseExternalEditor' ) || $action == 'submit' || $internal ||
                $section || $oldid || ( !$user->getOption( 'externaleditor' ) && !$external ) ) {
                        $editor = new CKeditorEditPage( $article );
!                       $editor->submit();
!               } elseif( $mediaWiki->getVal( 'UseExternalEditor' ) && ( $external || $user->getOption( 'externaleditor' ) ) ) {
!                       $mode = $wgRequest->getVal( 'mode' );
!                       $extedit = new ExternalEdit( $article, $mode );
!                       $extedit->edit();
                }
+
+               return false;
        }


213.236.68.7217:29, 20 January 2012

Thanks!
I've added it to the bugzilla entry

Ridmi15:24, 21 January 2012
 

hi. i don't know anything about patches and diffs, and i'm on windows.

can you simply post the file itself? or add it to the repository?

thank you.

85.64.207.24408:34, 23 January 2012
 

Am I missing something? In terminal I tried

user@speedy:extensions# diff -w -C 1 WYSIWYG/CKeditor.body.php extensions/WYSIWYG/CKeditor.body.php and got the error diff: extensions/WYSIWYG/CKeditor.body.php: No such file or directory

Am I meant to have another version of CKeditor.body.php? and if so where would I get that from?

Thanks from a n00b.

Gregology00:56, 24 January 2012
 

The solution seems to work.

217.235.209.19611:07, 24 January 2012

Yes it works, but in my wikis I got a problems. I use "pretty URLs" like Wikipedia does ... and all the internal (wiki) links are broken after an edit.

129.194.31.3114:38, 24 January 2012

I don't use pretty URL and my internal links are broken too.. and replaced by "RTENOTITLE"

83.176.228.19822:43, 25 January 2012

Hi there,
please provide more details about this, i.e. WYSIWYG version, SMW, MW versions etc.
Does this happen in all browsers?
Does this happen to links with labels or without?
Thanks for reporting this, your feedback is important!

Ridmi08:08, 26 January 2012

I have got the same problem with RTENOTITLE. It happens with mediawiki 1.18 and this extension, but also with the FCKeditor extension. WYSIWYG version 1.6.0, mediawiki 1.18 which has been upgraded from a 1.17.

All the internal links with or without labels are modified... Example: [[Link title]] -> [[/mediawiki-1.18.0/index.php?title=Link_title&action=edit&redlink=1|RTENOTITLE]]

And if I switch a lot between classic editor and WYSISYG, I obtain much bigger things like : "[[/mediawiki-1.18.0/index.php?title=/mediawiki-1.18.0/index.php?title=/mediawiki-1.18.0/index.php?title=/mediawiki-1.18.0/index.php?title=/mediawiki-1.18.0/index.php?title=Link_title&action=edit&redlink=1&action=edit&redlink=1&action=edit&redlink=1&action=edit&redlink=1&action=edit&redlink=1]]"

It happens the same with a link and a label, except that the label is kept instead of RTENOTITLE.

Tested in Chrome and Firefox.

82.150.248.2814:03, 26 January 2012
 

I just realised that the modification seem to happen when the wikisyntax is *loaded* into the page, not when is submitted/saved or loaded into the editor component. I have traced back through the javascript and it seems like the php code at CKeditorParser.body.php overrides the replaceInternalLinks method and always converts internal links. I don't have time to dig further until later, but this is the only place in all the code where something is replaced by RTENOTITLE. It seems that this is a somewhat too indiscriminate conversion to always make.

 function replaceInternalLinks($text) {
   $text = preg_replace("/\[\[([^|\[\]]*?)\]\]/", "RTENOTITLE", $text); // #2223: ()      =>   RTENOTITLE
   $text = preg_replace("/\[\[:(.*?)\]\]/", "RTECOLON$1", $text); // change ':' => 'RTECOLON' in links
   $text = parent::replaceInternalLinks($text);
   $text = preg_replace("/\|RTENOTITLE\]\]/", "]]", $text); // remove unused RTENOTITLE

   return $text;
 }
85.229.113.25101:16, 2 March 2012
 
 
 
 
 

How to update WYSIWYG extension

The best way to update/add/remove any extension would be by using Wiki Administration Tool: http://www.smwplus.com/index.php/Help:Installing_the_Wiki_Administration_Tool_1.6.0.
The default repository is the latest stable one.
The list of all repositories together with test wiki installations can be found here: http://dailywikibuilds.ontoprise.com

Ridmi08:07, 1 March 2012

Unfortunately at this moment http://dailywikibuilds.ontoprise.com is down because of defected hard drive.
It should be back in a day or two.

(update) It's back up and running.

Ridmi08:19, 1 March 2012
 

Not centering images properly

If you insert a image on Rich text mode, and you center it, then, after saving the page, it will be on the left side, not centered, i've inspectioned the html code, and I can see a correct '<p...' tag with center attribute, but image is on a div outside,so not affected by center attribute either '<p...' tag.
Thanks by this great extension :)

213.97.234.22008:28, 12 April 2012

Hi there,
I've just filed an issue 16925 - image aligning fails.
Thanks for reporting this!

Ridmi13:23, 12 April 2012
 

Rich Media Extention and Image Inserting Error

Hi all. First of all this is a great extension but I have too significant issues: (a) When inserting an image if I provide a URL, the image appears fine on the editor, but when I save it in the text it provides the link and not the actual image. Even worse, when this image also has a link assigned to it (if clicked that is) then not even the URL mentioned before is inserted on the actual page, (b) I want to enable uploading of images as well, but I get the notification about the Rich Media Extension. However I cannot seem to find an installation that would work under my environment or an integration with CKFinder. Any tips on this? These are both important and urgent issues. The versions I am using are: MediaWiki 1.16.0 PHP 5.3.5 (cgi-fcgi) MySQL 5.0.67-community-nt WYSIWYG extension (Version 1.6.0_0 [B8], CKEditor 3.6 (revision 6902))

Thanks.

Charis

195.134.66.23310:42, 2 March 2012

Hi there. You are right, CKEditor allows pasting images into html as data URI, but mediawiki doesn't know how to handle it.
There is an open issue about it: Issue 15629 - Pasting images from clipboard into ckeditor is misleading
You have to upload image file to your wiki to be able to assign a link to it.
You don't have to install RichMedia Extension for uploading simple images. Uploading is done on a special wiki page: Special:Upload.
After you have uploaded your image you can select it in WYSIWYG image dialog.
Just start typing your image file name in the "image file name" field.
HTH.

Ridmi09:09, 5 March 2012

Thanks Ridmi for you advice. I have tried a lot of things over the past few days and I am getting rather frustrated at this point. I have eventually ended up to follow your advice. However, the last problem I face is with the image and link dialogs. I have not installed HALO ACL (I could not make it to work) or SMW+. The issue now is that by clicking the image or link toolbar images, brings up the Image Properties and the Link Properties dialogs and not the MediaWiki Image Properties and the MediaWiki Links Properties as you are referring or how it is present in the Sandbox. I have tried to "hack" the extensions\WYSIWYG\ckeditor\plugins\mediawiki\plugin.js, but no luck. I am currently using: config.toolbar = 'Full'; in the config.js in the ckeditor path. Any prompt help is highly appreciated. Thanks a million Ridmi.

62.1.22.15810:42, 6 March 2012
Edited by 2 users.
Last edit: 18:04, 15 March 2012

Hi.
The wrong dialog issue is fixed already.
Please update your WYSIWYG extension.
The instructions are here: How to update WYSIWYG extension

Ridmi12:18, 6 March 2012

Hi Ridmi. Thanks again for the prompt response. Unfortunately I have used both wysiwyg-1.5.6_18 and wysiwyg-1.6.0_14 from the update site you have sent me. Unfortunately none of them fixed the dialog issue I have mentioned above. This still brings up the Image Properties dialog rather than the Mediawiki Image dialog. Am I doing something wrong? Is there any other setting I need to update? I am using the following: MediaWiki: 1.16.0 PHP: 5.3.5 (cgi-fcgi) MySQL: 5.0.67-community-nt Semantic Forms (Version 2.4) Semantic MediaWiki (Version 1.7.0.2) WYSIWYG extension (Version 1.6.0_14 [B7], CKEditor 3.6 (revision 6902))

Thanks for your help!

Charis

62.1.22.15813:14, 6 March 2012

Please post some screenshots of a dialogs to make sure we are talking about the same thing.
Also I've noticed you are using the latest Semantic Mediawiki and Semantic Forms, but an old MediaWiki.
I would also suggest updating your MediaWiki.

Ridmi15:19, 6 March 2012
 
 
 

Ridmi said: You don't have to install RichMedia Extension for uploading simple images. Uploading is done on a special wiki page: Special:Upload. After you have uploaded your image you can select it in WYSIWYG image dialog. Just start typing your image file name in the image file name field.

Hi, I have a problem with this, I dont have "image file name" field, I only have URL and "Alternative text", and URL field does not have autocompletion help for find the desired image file, so....

MW version: 1.17.3, WYSIWYG version: 1.6.0_0 (CKEditor 3.6), I have downloaded and installed today, so I imagine the version is up to date...
Thanks.

213.97.234.22010:43, 11 April 2012

Sorry Ridmi, I've found the link to 1.16.0_19 zip, i though that last version on the web included patches, now it works flawlesly :)

213.97.234.22013:23, 11 April 2012
 
 
 

No textbox, everything else is fine

No problems using older versions of WYSIWYG but I tried 1.6.0_18 just to fix the images issue and I can't get it work fine. Toolbar looks fine and no PHP errors messages. Just a grey box on the text area.

Screen: http://imgur.com/FJ9BW

I am using:

  • MediaWiki: 1.16.4
  • PHP: 5.3.8
  • MySQL: 5.5.11
  • WYSIWYG extension (Versión 1.6.0_18 [B56], CKEditor 3.6 (revision 6902))

Javascript console reports:

mw.config is undefined
extensions/WYSIWYG/ckeditor/ckeditor.js
Line: 148

Thanks!

186.137.157.21704:56, 10 April 2012

Hi.
You are right, mw.config was introduced in Mediawiki 1.17.
I'll let you know when it's fixed.

Ridmi07:41, 10 April 2012
 

Hi again.
It's fixed in 1.6.0_19.
Please update your WYSIWYG installation.

Ridmi08:00, 10 April 2012
 

Issue "undefined index: 'rich_load_semantic_toolbar' in \WYSIWYG\CKeditor.body.php on line 435"

Hi, I'm using MW 1.16.5 and WYSIWYG 1.6.0 and after installing WYSIWYG extension I have this PHP error report : "undefined index: 'rich_load_semantic_toolbar' in \WYSIWYG\CKeditor.body.php on line 435" when I load the modification page. Why? The WYSIWYG extension is well installed.

91.135.180.21514:08, 6 March 2012

Hi.
This is supposed to be fixed a while ago.
Please update your WYSIWYG extension: How to update WYSIWYG extension.
Or, since it's a notice and not an error, you may also change your php error reporting settings to display errors only.

Ridmi15:25, 6 March 2012

Hi Ridmi, Thank you. I have download (yesterday) the WYSIWYG version for MW 1.16. Should I download the version for MW 1.17? Mehdi

91.135.180.21511:20, 7 March 2012

Hi Mehdi, this issue is fixed in WYSIWYG 1.6.0_14.

Ridmi08:21, 8 March 2012

Hi Ridmi, Thank you. Mehdi

91.135.180.21515:28, 13 March 2012
 

Hi Ridmi, Where Could I find the WYSIWYG 1.6.0_14?, I am now on MW 1.17.2 and I tried the WYSIWYG 1.6.0_17 but I still have this notice, moreover I have another issue: an error on the footer of my IE 8 browser which says "Error on the page" and when I click It shows the error on ckeditor.js (18). For example, i can't cancel or close the window of inserting an image when I click on it. Thanks Mehdi

91.135.184.21514:41, 27 March 2012

Hi Mehdi.
You don't have to find 1.6.0_14 anywhere, just update your existing version of WYSIWYG extension.
Read the instruction here: How to update WYSIWYG extension

Ridmi07:40, 28 March 2012
 
 
 
 
 

Error (Call to undefined method Parser...) after installation

Edited by author.
Last edit: 11:05, 10 December 2011

I get an error after activating the extension and the Wiki doesn't work anymore:

Fatal error: Call to undefined method Parser::strip() in /home/wiki/public_html/extensions/WYSIWYG/CKeditor.body.php on line 133

Mediawiki 1.18.0 WYSIWYG 1.6.0

Wbs10:51, 10 December 2011

Hi, do not forget to tell which versions of MediaWiki and WYSIWYG you are using. Cheers

[[kgh]]10:54, 10 December 2011

Sorry, edited!

Wbs11:05, 10 December 2011

Hi, this extension is not yet compatible with MW 1.18.0. I am sure that your observation will help preparing the release for MW 1.18.0. Let's see what the developers say. Cheers

[[kgh]]11:12, 10 December 2011
 
 

As kgh said, WYSIWYG is just migrated to and tested with MW 1.17.0.
But feel free to file this issue in bugzilla.
We will definitely address it when working on WYSIWYG compatibility with MW 1.18.
Thanks for reporting this.

Ridmi21:13, 10 December 2011

Hi,

I just update to MW 1.18, when do you believe WYSIWYG will be compatible with this version of wiki?

Thank you

68.179.124.19315:39, 13 December 2011

Hi there. It's currently not in the near future plans. So I would say some when in 2012.

Ridmi07:47, 14 December 2011

Welcome to 2012 !!!

79.242.20.17216:36, 20 January 2012

I'd have to agree with 79.242.20.172. It is actually 2012.

85.229.113.25123:22, 1 March 2012
 
 
 
 
 

own special tags

Is it possible to define your own special tags like <iframe> or <pageby> ?

93.159.249.6613:53, 14 March 2012

I'm almost sure it's possible.
But not in WYSIWYG.
WYSIWYG can only use tags which are already defined.

Ridmi08:25, 15 March 2012

Do you know how to define in WYSIWYG?

93.159.249.6614:36, 15 March 2012

Are you still talking about special tags?

Ridmi16:27, 15 March 2012
 
 
 

Can't get WYSIWYG to work on fresh install of 1.18

When I put the line in LocalSettings I get a blank white screen in both IE and Firefox

require_once("$IP/extensions/WYSIWYG/WYSIWYG.php");

gotta be something easy but I'm new to mediawiki.

Thanks

63.133.185.11421:19, 8 March 2012

Hi.
WYSIWYG is not yet compatible with MW 1.18.
You might want to downgrade to MW 1.17 or read through this page to get an idea how to try and fix it yourself.

Ridmi08:39, 9 March 2012
 

Problem: latest version (1.6.0_7) breaks HTML characters when switching from text editor to WYSIWYG editor

Problem: whenever I switch from the text editor to the WYSIWYG editor (by clicking on the link "Show RichTextEditor"), all special characters such as ">" and "<" become escaped, breaking all HTML tags. For example, "<" becomes "& l t ;" (without the spaces). Worse, when this happens if I use IE7 to save the page, it becomes a blank page; if I save it using FireFox, I get the page with broken HTML tags.

Steps to reproduce:

1. Locate a wiki page that contains HTML characters such as ">" and "<".

2. Go to another page (not the page in step 1), click on EDIT, and make sure the text editor is what comes up by default. If not and the rich text editor is what shows up, click on the "show WikiTextEditor" link to switch to the text editor, then go back to the page in step 1.

3. Now click on EDIT. The source code should look fine.

4. Now click on the "show RichTextEditor" link. Now, the WYSIWYG editor will show the broken HTML tag.

5. Switch back to the text editor. Now it will show the source of the broken HTML tag.

Here is a screenshot that shows the entire problem: http://public-share-485.s3.amazonaws.com/WYSI%20bug%20report.jpg

Jupiler (talk)00:18, 22 February 2012

Hi Jupiler,
I've filed a bug Issue 16724 - wikitext to html conversion problem.
We'll take care of it as soon as possible.
Thanks for reporting this.

Ridmi (talk)10:00, 22 February 2012

Thanks Dmitry.

Jupiler (talk)15:53, 22 February 2012

I am also having this problem... I noticed that the bug shows fixed... What methods should I use to fix the bug in my wiki? Thanks!

173.198.108.8520:40, 29 February 2012

Hi there.
Sorry, there is no patch.
But WYSIWYG extension can be easily updated.
See this thread for details: How to update WYSIWYG extension.

Ridmi08:11, 1 March 2012

I'm not sure if this is the same issue or not, but my links keep disappearing in IE9 with Compatability View turned off. Steps to repeat: edit page with links, click on show WIKI editor, publish, and links are gone.

http://i43.tinypic.com/10541kw.jpg http://i41.tinypic.com/vowtqx.jpg http://i41.tinypic.com/33p59b5.jpg

I'm using mediawiki 1.16.5 and WYSIWYG editor version 1.4.0_3.

Thank you for your help!!

EPiSKiNG (talk)19:44, 1 March 2012
 
 
 
 
 

Which browsers does WYSIWYG support

The WYSIWYG extension 1.6 has been approved for the following browsers:

  • Firefox
  • Internet Explorer 8
  • Google Chrome

http://www.smwplus.com/index.php/Help:WYSIWYG_extension_1.6.0

Ridmi07:42, 2 March 2012

Question: how to re-enable automatic bullet list after disabling it

I disabled the automatic number list when you type something like "1. blah blah blah" and press enter. Now I would like to re-enable it. Can I?

Jupiler (talk)15:20, 24 February 2012

Hi Jupiler,
I would have to know more details.
How did you disabled it and what functionality is missing now?

Ridmi (talk)16:55, 24 February 2012

When it was enabled by default, if I typed something like "1. blah blah" and press enter, it would automatically get converted to a number list. Along with that, it triggered a small menu at the beginning of the list. If you click on that menu, you could disable the automatic list. That's how I did it. What's missing now is that if I type something like "1. blah blah" and press enter, it doesn't automatically get converted to a number list.

Jupiler (talk)17:53, 24 February 2012

I'm sorry, I never heard about this "automatic bullet list" feature. Not as part of WYSIWYG extension anyway.
Please post the content of your Special:Version page here - this functionality might be added by some third other extension.

Ridmi (talk)14:41, 27 February 2012
 
 
 
First page
First page
Previous page
Previous page
Last page
Last page
Personal tools
Namespaces

Variants
Actions
Navigation
Support
Download
Development
Communication
Print/export
Toolbox