Opened 16 years ago

Closed 16 years ago

#1432 closed Bug (fixed)

Patch for template: line breaks in IE and documentation preview

Reported by: barns Owned by:
Priority: Normal Milestone:
Component: Project : MediaWiki+FCKeditor Version: SVN (FCKeditor) - Retired
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 (1)

template.html (5.7 KB) - added by barns 16 years ago.
Patched to template file with template doc preview

Download all attachments as: .zip

Change History (4)

Changed 16 years ago by barns

Attachment: template.html added

Patched to template file with template doc preview

comment:1 Changed 16 years ago by barns

Forgot: in FCKeditor.php, add:

$wgAjaxExportList[] = 'wfSajaxSearchTemplateFCKeditor';

comment:2 Changed 16 years ago by Wojciech Olchawa

Keywords: HasPatch added
Version: SVN

comment:3 Changed 16 years ago by Wiktor Walc

Resolution: fixed
Status: newclosed

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.
© 2003 – 2022, CKSource sp. z o.o. sp.k. All rights reserved. | Terms of use | Privacy policy