Ticket #1432 (closed Bug: fixed)

Opened 12 months ago

Last modified 6 months ago

Patch for template: line breaks in IE and documentation preview

Reported by: ycombarnous Owned by:
Priority: Normal Milestone:
Component: Project : MediaWiki+FCKeditor Version: SVN
Keywords: HasPatch Cc:

Description

IE does not seem to retain line breaks in templates. In addition, I added a tab to the template dialog to see the templates page (it will display a documentation on the selected template if there is a noinclude part).

In FCKeditorParser.body.php

$this->fck_mw_strtr_span['Fckmw'.$this->fck_mw_strtr_span_counter.'fckmw'] = '<span class="fck_mw_template">'.str_replace(array("\r\n", "\n", "\r"),"fckLR",$inner).'</span>';

In fckplugin.js:

case 'fck_mw_template' :		
stringBuilder.push( FCKTools.HTMLDecode(htmlNode.innerHTML).replace(/fckLR/g,'\r\n') ) ;
return ;

In FCKeditorSjax.body.php, add:

function wfSajaxSearchTemplateFCKeditor($empty)
{
    global $wgContLang, $wgOut; 
    $ns = NS_TEMPLATE;

    $db =& wfGetDB( DB_SLAVE );
    $res = $db->select( 'page', 'page_title',
    array(  'page_namespace' => $ns),
    "wfSajaxSearch"
    );

    $ret = "";
    while ( $row = $db->fetchObject( $res ) ) {
        $ret .= $row->page_title ."\n";
    }

    return $ret;
}

The patched template.html is in attachment.

Attachments

template.html (5.7 kB) - added by ycombarnous 12 months ago.
Patched to template file with template doc preview

Change History

Changed 12 months ago by ycombarnous

Patched to template file with template doc preview

Changed 12 months ago by ycombarnous

Forgot: in FCKeditor.php, add:

$wgAjaxExportList[] = 'wfSajaxSearchTemplateFCKeditor';

Changed 8 months ago by w.olchawa

  • keywords HasPatch added
  • version set to SVN

Changed 6 months ago by wwalc

  • status changed from new to closed
  • resolution set to fixed

Nice job. Fixed with [1829].

I have corrected just a minor things:

  • hardcoded /wiki/index.php in SetUrl()
  • when template is selected raw template definition is automatically updated.
Note: See TracTickets for help on using tickets.