public $editFormTextAfterWarn;
public $editFormTextAfterTools;
public $editFormTextBottom;
+ public $editFormTextAfterContent;
+ public $previewTextAfterContent;
/* $didSave should be set to true whenever an article was succesfully altered. */
public $didSave = false;
$this->editFormTextAfterWarn =
$this->editFormTextAfterTools =
$this->editFormTextBottom =
+ $this->editFormTextAfterContent =
+ $this->previewTextAfterContent =
$this->mPreloadText = "";
}
$wgMessageCache->loadAllMessages( $lang );
$text = wfMsgGetKey( $message, false, $lang, false );
if( wfEmptyMsg( $message, $text ) )
- $text = '';
+ $text = $this->getPreloadedText( $preload );
} else {
# If requested, preload some text.
$text = $this->getPreloadedText( $preload );
END
);
$this->showTextbox1( $classes );
+
+ $wgOut->addHTML( $this->editFormTextAfterContent );
$wgOut->wrapWikiMsg( "<div id=\"editpage-copywarn\">\n$1\n</div>", $copywarnMsg );
$wgOut->addHTML( <<<END
$wgOut->parse( $note ) . $conflict . "</div>\n";
wfProfileOut( __METHOD__ );
- return $previewhead . $previewHTML;
+ return $previewhead . $previewHTML . $this->previewTextAfterContent;
}
function getTemplates() {
* @return array
*/
public function getEditButtons(&$tabindex) {
- global $wgLivePreview, $wgUser;
-
$buttons = array();
$temp = array(
$buttons['save'] = Xml::element('input', $temp, '');
++$tabindex; // use the same for preview and live preview
- if ( $wgLivePreview && $wgUser->getOption( 'uselivepreview' ) ) {
+ if ( $this->useLivePreview() ) {
$this->doLivePreviewScript(); // Add to output
$temp = array(
'value' => wfMsg('showpreview'),
'accesskey' => '',
'title' => wfMsg( 'tooltip-preview' ).' ['.wfMsg( 'accesskey-preview' ).']',
- 'style' => 'display: none;',
);
$buttons['preview'] = Xml::element('input', $temp, '');
'value' => wfMsg('showlivepreview'),
'accesskey' => wfMsg('accesskey-preview'),
'title' => '',
+ 'style' => 'display: none;',
);
$buttons['live'] = Xml::element('input', $temp, '');
return $buttons;
}
+ /**
+ * Whether to use live preview for this page
+ * This disables live preview when editing css/js user subpages so that the
+ * user can preview them (bug 3421)
+ *
+ * @return Boolean
+ */
+ public function useLivePreview() {
+ global $wgLivePreview, $wgUser;
+
+ return $wgLivePreview && $wgUser->getOption( 'uselivepreview' ) &&
+ !( ( $this->mTitle->isCssSubpage() && $this->mTitle->userCanEditCssSubpage() ) ||
+ ( $this->mTitle->isJsSubpage() && $this->mTitle->userCanEditCssSubpage() ) );
+ }
+
/**
* Output preview text only. This can be sucked into the edit page
* via JavaScript, and saves the server time rendering the skin as