r95529 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r95528‎ | r95529 | r95530 >
Date:21:34, 25 August 2011
Author:yaron
Status:ok
Tags:
Comment:
Fixes for more recent versions of MediaWiki
Modified paths:
  • /trunk/extensions/MeanEditor/MeanEditor.php (modified) (history)

Diff [purge]

Index: trunk/extensions/MeanEditor/MeanEditor.php
@@ -38,7 +38,6 @@
3939 function deny_visual_because_of($reason, &$edit_context)
4040 {
4141 global $wgOut;
42 - wfLoadExtensionMessages('MeanEditor');
4342 $wgOut->addHTML('<p class="visual_editing_denied errorbox">' . wfMsg('no_visual') . '<em class="visual_editing_denied_reason">'.$reason.'</em></p>');
4443 # FIXME: Doesn't work. Why?
4544 #$edit_context->editFormTextBeforeContent .= '<p class="visual_editing_denied errorbox">The visual editor can\'t be used for this page. Most likely, it contains advanced or unsopported features. If you can, try editing smaller paragraphs.<br /><br />Reason: <em class="visual_editing_denied_reason">'.$reason.'</em></p>';
@@ -50,7 +49,6 @@
5150 function meaneditor_wiki2html($article, $user, &$edit_context, &$wiki_text)
5251 {
5352 global $wgUploadPath, $wgArticlePath;
54 - wfLoadExtensionMessages('MeanEditor');
5553 $meaneditor_page_src = str_replace('$1', '', $wgArticlePath);
5654
5755 # Detect code sections (lines beginning with whitespace)
@@ -102,9 +100,9 @@
103101 #$wiki_text=preg_replace('/\'\'\'(.*?)\'\'\'/','<strong>$1</strong>',$wiki_text);
104102 #$wiki_text=preg_replace('/\'\'(.*?)\'\'/','<em>$1</em>',$wiki_text);
105103 $obp = new Parser;
106 - $obp->clearState();
107104 $obp->setTitle('');
108105 $obp->mOptions = new ParserOptions;
 106+ $obp->clearState();
109107 $wiki_text = $obp->doAllQuotes($wiki_text);
110108
111109 #Substitute ===
@@ -262,8 +260,6 @@
263261 function meaneditor_showBox(&$edit_context, $html_text, $rows, $cols, $ew)
264262 {
265263 global $wgOut, $wgArticlePath, $wgStylePath, $wgUploadPath, $wgLang;
266 - wfLoadExtensionMessages('MeanEditor');
267 - $sk = new Skin;
268264 $wiki_path = str_replace('$1', '', $wgArticlePath);
269265 $wgOut->addScriptFile('../../extensions/MeanEditor/wymeditor/jquery/jquery.js');
270266 $wgOut->addScriptFile('../../extensions/MeanEditor/wymeditor/wymeditor/jquery.wymeditor.pack.js');
@@ -308,7 +304,7 @@
309305 + "</body>",
310306 dialogImageHtml: "<body class=\'wym_dialog wym_dialog_image\'"
311307 + " onload=\'WYMeditor.INIT_DIALOG(" + WYMeditor.INDEX + ")\'"
312 - + ">' . preg_replace('/[\r\n]+/', "", str_replace('</script>','</scr"+"ipt>',str_replace('"','\\"',str_replace('\'','\\\'',$sk->makeGlobalVariablesScript(false))))) . '"
 308+ + ">"
313309 + "<script type=\'text/javascript\' src=\''.$wgStylePath.'/common/ajax.js\'></scr"+"ipt>"
314310 + "<script type=\'text/javascript\'>function meaneditor_responder(e) {"
315311 + " divwait=document.getElementById(\'meaneditor_ajax_wait\');"
@@ -475,7 +471,6 @@
476472 $return_empty = false;
477473 }
478474 if ($return_empty) {
479 - wfLoadExtensionMessages('MeanEditor');
480475 return '<tr><td colspan="2"><strong>' . wfMsgWikiHtml('no_recent_images') . '</strong>' . ($u->isLoggedIn() ? '' : wfMsgWikiHtml('try_login')) . '</td></tr>';
481476 } else return $return_text;
482477 }
@@ -503,7 +498,6 @@
504499 # Regular Editpage hooks
505500 function meaneditor_checkboxes(&$editpage, &$checkboxes, &$tabindex)
506501 {
507 - wfLoadExtensionMessages('MeanEditor');
508502 $checkboxes['want_traditional_editor'] = '';
509503 $attribs = array(
510504 'tabindex' => ++$tabindex,

Status & tagging log