* (bug 1739) A new magicword, {{REVISIONID}} give you the article or diff database
revision id, useful for proper citation.
* (bug 1998) Updated the Russian translation.
+* (bug 2064) Configurable JavaScript mimetype with $wgJsMimeType
* It's now possible to invert the namespace selection at Special:Allpages and Special:Contributions
* No longer using sorbs.net to check for open proxies by default.
* What was $wgDisableUploads is now $wgEnableUploads, and should be set to true if one wishes to enable uploads.
$wgLegacyEncoding = false;
$wgMimeType = 'text/html';
+$wgJsMimeType = 'text/javascript';
$wgDocType = '-//W3C//DTD XHTML 1.0 Transitional//EN';
$wgDTD = 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd';
* it will fall through to the normal form submission method.
*/
if( $wgLivePreview ) {
- $wgOut->addHTML( '<script type="text/javascript" src="' .
+ global $wgJsMimeType;
+ $wgOut->addHTML( '<script type="'.$wgJsMimeType.'" src="' .
htmlspecialchars( $wgStylePath . '/common/preview.js' ) .
'"></script>' . "\n" );
$liveAction = $wgTitle->getLocalUrl( 'action=submit&wpPreview=true&live=true' );
* The necessary JavaScript code can be found in style/wikibits.js.
*/
function getEditToolbar() {
- global $wgStylePath, $wgLang, $wgMimeType;
+ global $wgStylePath, $wgLang, $wgMimeType, $wgJsMimeType;
/**
* toolarray an array of arrays which each include the filename of
'key' => 'R'
)
);
- $toolbar ="<script type='text/javascript'>\n/*<![CDATA[*/\n";
+ $toolbar ="<script type='$wgJsMimeType'>\n/*<![CDATA[*/\n";
$toolbar.="document.writeln(\"<div id='toolbar'>\");\n";
foreach($toolarray as $tool) {
/** @todo document */
function tocList($toc) {
+ global $wgJsMimeType;
return "<table id='toc' class='toc'><tr><td>"
. "<div id='toctitle'><h2>" . wfMsgForContent('toc') . "</h2></div>\n"
. $toc
. "</ul>\n</td></tr></table>\n"
- . '<script type="text/javascript">'
+ . '<script type="'.$wgJsMimeType.'">'
. ' if (window.showTocToggle) {'
. ' var tocShowText = "' . wfEscapeJsString( wfMsgForContent('showtoc') ) . '";'
. ' var tocHideText = "' . wfEscapeJsString( wfMsgForContent('hidetoc') ) . '";'
class RawPage {
function RawPage( $article ) {
- global $wgRequest, $wgInputEncoding, $wgSquidMaxage;
- $allowedCTypes = array('text/x-wiki', 'text/javascript', 'text/css', 'application/x-zope-edit');
+ global $wgRequest, $wgInputEncoding, $wgSquidMaxage, $wgJsMimeType;
+ $allowedCTypes = array('text/x-wiki', $wgJsMimeType, 'text/css', 'application/x-zope-edit');
$this->mArticle =& $article;
$this->mTitle =& $article->mTitle;
} else if ($gen == 'js') {
$this->mGen = $gen;
if($smaxage == '') $smaxage = $wgSquidMaxage;
- if($ctype == '') $ctype = 'text/javascript';
+ if($ctype == '') $ctype = $wgJsMimeType;
} else {
$this->mGen = false;
}
}
function getHeadScripts() {
- global $wgStylePath, $wgUser, $wgContLang, $wgAllowUserJs;
- $r = "<script type=\"text/javascript\" src=\"{$wgStylePath}/common/wikibits.js\"></script>\n";
+ global $wgStylePath, $wgUser, $wgContLang, $wgAllowUserJs, $wgJsMimeType;
+ $r = "<script type=\"{$wgJsMimeType}\" src=\"{$wgStylePath}/common/wikibits.js\"></script>\n";
if( $wgAllowUserJs && $wgUser->isLoggedIn() ) {
$userpage = $wgUser->getUserPage();
$userjs = htmlspecialchars( $this->makeUrl(
$userpage->getPrefixedText().'/'.$this->getSkinName().'.js',
- 'action=raw&ctype=text/javascript'));
- $r .= '<script type="text/javascript" src="'.$userjs."\"></script>\n";
+ 'action=raw&ctype='.$wgJsMimeType));
+ $r .= '<script type="'.$wgJsMimeType.'" src="'.$userjs."\"></script>\n";
}
return $r;
}
function outputPage( &$out ) {
global $wgTitle, $wgArticle, $wgUser, $wgLang, $wgContLang, $wgOut;
global $wgScript, $wgStylePath, $wgLanguageCode, $wgContLanguageCode, $wgUseNewInterlanguage;
- global $wgMimeType, $wgOutputEncoding, $wgUseDatabaseMessages, $wgRequest;
+ global $wgMimeType, $wgJsMimeType, $wgOutputEncoding, $wgUseDatabaseMessages, $wgRequest;
global $wgDisableCounters, $wgLogo, $action, $wgFeedClasses;
global $wgMaxCredits, $wgShowCreditsIfMax;
global $wgPageShowWatchingUsers;
$tpl->set( 'feeds', false );
}
$tpl->setRef( 'mimetype', $wgMimeType );
+ $tpl->setRef( 'jsmimetype', $wgJsMimeType );
$tpl->setRef( 'charset', $wgOutputEncoding );
$tpl->set( 'headlinks', $out->getHeadLinks() );
$tpl->setRef( 'wgScript', $wgScript );
$fname = 'SkinTemplate::setupUserJs';
wfProfileIn( $fname );
- global $wgRequest, $wgAllowUserJs;
+ global $wgRequest, $wgAllowUserJs, $wgJsMimeType;
$action = $wgRequest->getText('action');
if( $wgAllowUserJs && $this->loggedin ) {
# XXX: additional security check/prompt?
$this->userjsprev = '/*<![CDATA[*/ ' . $wgRequest->getText('wpTextbox1') . ' /*]]>*/';
} else {
- $this->userjs = $this->makeUrl($this->userpage.'/'.$this->skinname.'.js', 'action=raw&ctype=text/javascript&dontcountme=s');
+ $this->userjs = $this->makeUrl($this->userpage.'/'.$this->skinname.'.js', 'action=raw&ctype='.$wgJsMimeType.'&dontcountme=s');
}
}
wfProfileOut( $fname );
<!--[if lt IE 5.5000]><style type="text/css">@import "<?php $this->text('stylepath') ?>/<?php $this->text('stylename') ?>/IE50Fixes.css";</style><![endif]-->
<!--[if IE 5.5000]><style type="text/css">@import "<?php $this->text('stylepath') ?>/<?php $this->text('stylename') ?>/IE55Fixes.css";</style><![endif]-->
<!--[if IE 6]><style type="text/css">@import "<?php $this->text('stylepath') ?>/<?php $this->text('stylename') ?>/IE60Fixes.css";</style><![endif]-->
- <!--[if IE]><script type="text/javascript" src="<?php $this->text('stylepath') ?>/common/IEFixes.js"></script>
+ <!--[if IE]><script type="<?php $this->text('jsmimetype') ?>" src="<?php $this->text('stylepath') ?>/common/IEFixes.js"></script>
<meta http-equiv="imagetoolbar" content="no" /><![endif]-->
- <?php if($this->data['jsvarurl' ]) { ?><script type="text/javascript" src="<?php $this->text('jsvarurl' ) ?>"></script><?php } ?>
- <script type="text/javascript" src="<?php $this->text('stylepath' ) ?>/common/wikibits.js"></script>
+ <?php if($this->data['jsvarurl' ]) { ?><script type="<?php $this->text('jsmimetype') ?>" src="<?php $this->text('jsvarurl' ) ?>"></script><?php } ?>
+ <script type="<?php $this->text('jsmimetype') ?>" src="<?php $this->text('stylepath' ) ?>/common/wikibits.js"></script>
<?php if($this->data['usercss' ]) { ?><style type="text/css"><?php $this->html('usercss' ) ?></style><?php } ?>
- <?php if($this->data['userjs' ]) { ?><script type="text/javascript" src="<?php $this->text('userjs' ) ?>"></script><?php } ?>
- <?php if($this->data['userjsprev']) { ?><script type="text/javascript"><?php $this->html('userjsprev') ?></script><?php } ?>
+ <?php if($this->data['userjs' ]) { ?><script type="<?php $this->text('jsmimetype') ?>" src="<?php $this->text('userjs' ) ?>"></script><?php } ?>
+ <?php if($this->data['userjsprev']) { ?><script type="<?php $this->text('jsmimetype') ?>"><?php $this->html('userjsprev') ?></script><?php } ?>
</head>
<body <?php if($this->data['body_ondblclick']) { ?>ondblclick="<?php $this->text('body_ondblclick') ?>"<?php } ?>
<?php if($this->data['body_onload' ]) { ?>onload="<?php $this->text('body_onload') ?>"<?php } ?>
href="<?php echo htmlspecialchars($this->data['nav_urls']['mainpage']['href'])?>"
title="<?php $this->msg('mainpage') ?>"></a>
</div>
- <script type="text/javascript"> if (window.isMSIE55) fixalpha(); </script>
+ <script type="<?php $this->text('jsmimetype') ?>"> if (window.isMSIE55) fixalpha(); </script>
<div class="portlet" id="p-nav">
<h5><?php $this->msg('navigation') ?></h5>
<div class="pBody">
*
*/
function getHeadScripts() {
- global $wgStylePath;
+ global $wgStylePath, $wgJsMimeType;
$s = parent::getHeadScripts();
if ( 3 == $this->qbSetting() ) { # Floating left
- $s .= "<script language='javascript' type='text/javascript' " .
+ $s .= "<script language='javascript' type='$wgJsMimeType' " .
"src='{$wgStylePath}/common/sticky.js'></script>\n";
}
return $s;
<style type="text/css" media="screen,projection">/*<![CDATA[*/ @import "${stylepath}/${stylename}/main.css"; /*]]>*/</style>
<link rel="stylesheet" type="text/css" media="print" href="${stylepath}/common/commonPrint.css" />
<!--[if IE]><style type="text/css" media="all">@import "${stylepath}/${stylename}/IEFixes.css";</style>
- <script type="text/javascript" src="${stylepath}/common/IEFixes.js"></script>
+ <script type="${jsmimetype}" src="${stylepath}/common/IEFixes.js"></script>
<meta http-equiv="imagetoolbar" content="no" /><![endif]-->
- <script tal:condition="jsvarurl" type="text/javascript" tal:attributes="src jsvarurl"></script>
- <script type="text/javascript" src="${stylepath}/common/wikibits.js"></script>
+ <script tal:condition="jsvarurl" type="${jsmimetype}" tal:attributes="src jsvarurl"></script>
+ <script type="${jsmimetype}" src="${stylepath}/common/wikibits.js"></script>
<style tal:condition="usercss" type="text/css">/*<![CDATA[*/ ${usercss} /*]]>*/</style>
- <script tal:condition="userjs" type="text/javascript" tal:attributes="src userjs"></script><script
- tal:condition="userjsprev" type="text/javascript">/*<![CDATA[*/${userjsprev}/*]]>*/</script>
+ <script tal:condition="userjs" type="${jsmimetype}" tal:attributes="src userjs"></script><script
+ tal:condition="userjsprev" type="${jsmimetype}">/*<![CDATA[*/${userjsprev}/*]]>*/</script>
</head>
<body tal:attributes="ondblclick body-ondblclick|default; class nsclass|default">
<div id="globalWrapper">
<div class="portlet" id="p-logo">
<a style="background-image: url(${logopath});" href="${nav_urls/mainpage/href}" i18n:attributes="title string:mainpage"></a>
</div>
- <script type="text/javascript"> if (window.isMSIE55) fixalpha(); </script>
+ <script type="${jsmimetype}"> if (window.isMSIE55) fixalpha(); </script>
<div class="portlet" id="p-nav">
<h5 i18n:translate="string:navigation">Navigation</h5>
<div class="pBody">
<div tal:replace="structure headlinks"></div>
<title tal:content="pagetitle">Exciting xhtml slimfast</title>
<style type="text/css" media="screen,projection">/*<![CDATA[*/ @import "${stylepath}/${stylename}/main.css"; /*]]>*/</style>
- <script tal:condition="jsvarurl" type="text/javascript" tal:attributes="src jsvarurl"></script>
- <script type="text/javascript" src="${stylepath}/common/wikibits.js"></script>
+ <script tal:condition="jsvarurl" type="${jsmimetype}" tal:attributes="src jsvarurl"></script>
+ <script type="${jsmimetype}" src="${stylepath}/common/wikibits.js"></script>
<style tal:condition="usercss" tal:content="structure usercss" type="text/css"></style>
- <script tal:condition="userjs" type="text/javascript" tal:attributes="src userjs"></script><script
- tal:condition="userjsprev" tal:content="structure userjsprev" type="text/javascript"></script>
+ <script tal:condition="userjs" type="${jsmimetype}" tal:attributes="src userjs"></script><script
+ tal:condition="userjsprev" tal:content="structure userjsprev" type="${jsmimetype}"></script>
</head>
<body>
<a name="top"></a>
<!--[if lt IE 5.5000]><style type="text/css">@import "<?php $this->text('stylepath') ?>/<?php $this->text('stylename') ?>/IE50Fixes.css";</style><![endif]-->
<!--[if IE 5.5000]><style type="text/css">@import "<?php $this->text('stylepath') ?>/<?php $this->text('stylename') ?>/IE55Fixes.css";</style><![endif]-->
<!--[if IE 6]><style type="text/css">@import "<?php $this->text('stylepath') ?>/<?php $this->text('stylename') ?>/IE60Fixes.css";</style><![endif]-->
- <!--[if IE]><script type="text/javascript" src="<?php $this->text('stylepath') ?>/common/IEFixes.js"></script>
+ <!--[if IE]><script type="<?php $this->text('jsmimetype') ?>" src="<?php $this->text('stylepath') ?>/common/IEFixes.js"></script>
<meta http-equiv="imagetoolbar" content="no" /><![endif]-->
- <?php if($this->data['jsvarurl' ]) { ?><script type="text/javascript" src="<?php $this->text('jsvarurl' ) ?>"></script><?php } ?>
- <script type="text/javascript" src="<?php $this->text('stylepath' ) ?>/common/wikibits.js"></script>
+ <?php if($this->data['jsvarurl' ]) { ?><script type="<?php $this->text('jsmimetype') ?>" src="<?php $this->text('jsvarurl' ) ?>"></script><?php } ?>
+ <script type="<?php $this->text('jsmimetype') ?>" src="<?php $this->text('stylepath' ) ?>/common/wikibits.js"></script>
</head>
<body
<?php if($this->data['nsclass' ]) { ?>class="<?php $this->text('nsclass') ?>"<?php } ?>>
href="<?php echo htmlspecialchars($this->data['nav_urls']['mainpage']['href'])?>"
title="<?php $this->msg('mainpage') ?>"></a>
</div>
- <script type="text/javascript"> if (window.isMSIE55) fixalpha(); </script>
+ <script type="<?php $this->text('jsmimetype') ?>"> if (window.isMSIE55) fixalpha(); </script>
<div class="portlet" id="p-nav">
<h5><?php $this->msg('navigation') ?></h5>
<div class="pBody">
<!--[if lt IE 5.5000]><style type="text/css"> @import "${stylepath}/${stylename}/IE50Fixes.css"; </style><![endif]-->
<!--[if IE 5.5000]><style type="text/css"> @import "${stylepath}/${stylename}/IE55Fixes.css"; </style><![endif]-->
<!--[if IE 6]><style type="text/css"> @import "${stylepath}/${stylename}/IE60Fixes.css"; </style><![endif]-->
- <!--[if IE]><script type="text/javascript" src="${stylepath}/common/IEFixes.js"></script>
+ <!--[if IE]><script type="${jsmimetype}" src="${stylepath}/common/IEFixes.js"></script>
<meta http-equiv="imagetoolbar" content="no" /><![endif]-->
- <script tal:condition="jsvarurl" type="text/javascript" tal:attributes="src jsvarurl"></script>
- <script type="text/javascript" src="${stylepath}/common/wikibits.js"></script>
+ <script tal:condition="jsvarurl" type="${jsmimetype}" tal:attributes="src jsvarurl"></script>
+ <script type="${jsmimetype}" src="${stylepath}/common/wikibits.js"></script>
<style tal:condition="usercss" tal:content="structure usercss" type="text/css"></style>
- <script tal:condition="userjs" type="text/javascript" tal:attributes="src userjs"></script><script
- tal:condition="userjsprev" tal:content="structure userjsprev" type="text/javascript"></script>
+ <script tal:condition="userjs" type="${jsmimetype}" tal:attributes="src userjs"></script><script
+ tal:condition="userjsprev" tal:content="structure userjsprev" type="${jsmimetype}"></script>
</head>
<body tal:attributes="ondblclick body_ondblclick|default; class nsclass|default">
<div id="globalWrapper">
<div class="portlet" id="p-logo">
<a style="background-image: url(${logopath});" href="${nav_urls/mainpage/href}" i18n:attributes="title string:mainpage"></a>
</div>
- <script type="text/javascript"> if (window.isMSIE55) fixalpha(); </script>
+ <script type="${jsmimetype}"> if (window.isMSIE55) fixalpha(); </script>
<div class="portlet" id="p-nav">
<h5 i18n:translate="string:navigation">Navigation</h5>
<div class="pBody">
<style type="text/css" media="screen,projection">/*<![CDATA[*/ @import "${stylepath}/${stylename}/main.css"; /*]]>*/</style>
<link rel="stylesheet" type="text/css" media="print" href="${stylepath}/common/commonPrint.css" />
<!--[if IE]><style type="text/css" media="all">@import "${stylepath}/${stylename}/common/IEFixes.css";</style>
- <script type="text/javascript" src="${stylepath}/IEFixes.js"></script>
+ <script type="${jsmimetype}" src="${stylepath}/IEFixes.js"></script>
<meta http-equiv="imagetoolbar" content="no" /><![endif]-->
- <script tal:condition="jsvarurl" type="text/javascript" tal:attributes="src jsvarurl"></script>
- <script type="text/javascript" src="${stylepath}/common/wikibits.js"></script>
+ <script tal:condition="jsvarurl" type="${jsmimetype}" tal:attributes="src jsvarurl"></script>
+ <script type="${jsmimetype}" src="${stylepath}/common/wikibits.js"></script>
<style tal:condition="usercss" type="text/css">/*<![CDATA[*/ ${usercss} /*]]>*/</style>
- <script tal:condition="userjs" type="text/javascript" tal:attributes="src userjs"></script><script
- tal:condition="userjsprev" type="text/javascript">/*<![CDATA[*/${userjsprev}/*]]>*/</script>
+ <script tal:condition="userjs" type="${jsmimetype}" tal:attributes="src userjs"></script><script
+ tal:condition="userjsprev" type="${jsmimetype}">/*<![CDATA[*/${userjsprev}/*]]>*/</script>
</head>
<body tal:attributes="ondblclick body-ondblclick|default; class nsclass|default">
<div id="globalWrapper">
<div class="portlet" id="p-logo">
<a style="background-image: url(${logopath});" href="${nav_urls/mainpage/href}" i18n:attributes="title string:mainpage"></a>
</div>
- <script type="text/javascript"> if (window.isMSIE55) fixalpha(); </script>
+ <script type="${jsmimetype}"> if (window.isMSIE55) fixalpha(); </script>
<div class="portlet" id="p-nav">
<h5 i18n:translate="string:navigation">Navigation</h5>
<div class="pBody">