Opened 18 years ago
Closed 18 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)
Change History (4)
Changed 18 years ago by
| Attachment: | template.html added |
|---|
comment:1 Changed 18 years ago by
Forgot: in FCKeditor.php, add:
$wgAjaxExportList[] = 'wfSajaxSearchTemplateFCKeditor';
comment:2 Changed 18 years ago by
| Keywords: | HasPatch added |
|---|---|
| Version: | → SVN |
comment:3 Changed 18 years ago by
| Resolution: | → fixed |
|---|---|
| Status: | new → closed |
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.

Patched to template file with template doc preview