r70615 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r70614‎ | r70615 | r70616 >
Date:01:59, 7 August 2010
Author:kaldari
Status:ok
Tags:
Comment:
adding component insertion to editing interface
Modified paths:
  • /trunk/extensions/CentralNotice/SpecialNoticeTemplate.php (modified) (history)
  • /trunk/extensions/CentralNotice/centralnotice.js (modified) (history)

Diff [purge]

Index: trunk/extensions/CentralNotice/SpecialNoticeTemplate.php
@@ -221,9 +221,11 @@
222222 * View or edit an individual banner
223223 */
224224 private function showView() {
225 - global $wgOut, $wgUser, $wgRequest, $wgContLanguageCode;
226 -
 225+ global $wgOut, $wgUser, $wgRequest, $wgContLanguageCode, $wgScriptPath;
 226+
 227+ $scriptPath = "$wgScriptPath/extensions/CentralNotice";
227228 $sk = $wgUser->getSkin();
 229+
228230 if ( $this->editable ) {
229231 $readonly = array();
230232 } else {
@@ -394,16 +396,11 @@
395397 }
396398 $htmlOut .= Xml::fieldset( wfMsg( 'centralnotice-edit-template' ) );
397399 $htmlOut .= wfMsg( 'centralnotice-edit-template-summary' );
398 - $htmlOut .= Xml::openElement( 'table',
399 - array(
400 - 'cellpadding' => 9,
401 - 'width' => '100%'
402 - )
 400+ $htmlOut .= Xml::tags( 'div',
 401+ array( 'style' => 'margin-bottom: 0.2em;' ),
 402+ '<img src="'.$scriptPath.'/down-arrow.png" style="vertical-align:baseline;"/>' . wfMsg( 'centralnotice-insert' ) . ': <a href="#" onclick="insertButton(\'hide\');return false;">' . wfMsg( 'centralnotice-hide-button' ) . '</a>, <a href="#" onclick="insertButton(\'translate\');return false;">' . wfMsg( 'centralnotice-translate-button' ) . '</a>'
403403 );
404 - $htmlOut .= Xml::tags( 'tr', null,
405 - Xml::tags( 'td', null, Xml::textarea( 'templateBody', $body, 60, 20, $readonly ) )
406 - );
407 - $htmlOut .= Xml::closeElement( 'table' );
 404+ $htmlOut .= Xml::textarea( 'templateBody', $body, 60, 20, $readonly );
408405 if ( $this->editable ) {
409406 $htmlOut .= Xml::hidden( 'authtoken', $wgUser->editToken() );
410407 $htmlOut .= Xml::tags( 'div',
Index: trunk/extensions/CentralNotice/centralnotice.js
@@ -40,4 +40,5 @@
4141 } else {
4242 bannerField.value += buttonValue;
4343 }
 44+ bannerField.focus();
4445 }
\ No newline at end of file

Status & tagging log