From: Ævar Arnfjörð Bjarmason Date: Thu, 5 May 2005 21:00:49 +0000 (+0000) Subject: * (bug 2064) Configurable JavaScript mimetype with $wgJsMimeType X-Git-Tag: 1.5.0alpha2~296 X-Git-Url: https://git.cyclocoop.org//%22%7B%7Blocalurle:Project:Pol%C3%ADtica_de_imagens%7D%7D/%22?a=commitdiff_plain;h=2880bdfb8e0438ac8872d9a3a5aa6fefbb0267a1;p=lhc%2Fweb%2Fwiklou.git * (bug 2064) Configurable JavaScript mimetype with $wgJsMimeType --- diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 32b0e67c38..06ce3e6e5a 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -147,6 +147,7 @@ Various bugfixes, small features, and a few experimental things: * (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. diff --git a/includes/DefaultSettings.php b/includes/DefaultSettings.php index c34a8c5f1f..587870c2af 100644 --- a/includes/DefaultSettings.php +++ b/includes/DefaultSettings.php @@ -374,6 +374,7 @@ $wgEditEncoding = ''; $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'; diff --git a/includes/EditPage.php b/includes/EditPage.php index 0696872bc0..093a9c4c07 100644 --- a/includes/EditPage.php +++ b/includes/EditPage.php @@ -628,7 +628,8 @@ class EditPage { * it will fall through to the normal form submission method. */ if( $wgLivePreview ) { - $wgOut->addHTML( '' . "\n" ); $liveAction = $wgTitle->getLocalUrl( 'action=submit&wpPreview=true&live=true' ); @@ -923,7 +924,7 @@ END * 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 @@ -1015,7 +1016,7 @@ END 'key' => 'R' ) ); - $toolbar ="\n"; + global $wgStylePath, $wgUser, $wgContLang, $wgAllowUserJs, $wgJsMimeType; + $r = "\n"; if( $wgAllowUserJs && $wgUser->isLoggedIn() ) { $userpage = $wgUser->getUserPage(); $userjs = htmlspecialchars( $this->makeUrl( $userpage->getPrefixedText().'/'.$this->getSkinName().'.js', - 'action=raw&ctype=text/javascript')); - $r .= '\n"; + 'action=raw&ctype='.$wgJsMimeType)); + $r .= '\n"; } return $r; } diff --git a/includes/SkinTemplate.php b/includes/SkinTemplate.php index 9e346013e0..6f71eaa418 100644 --- a/includes/SkinTemplate.php +++ b/includes/SkinTemplate.php @@ -145,7 +145,7 @@ class SkinTemplate extends Skin { 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; @@ -218,6 +218,7 @@ class SkinTemplate extends Skin { $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 ); @@ -898,7 +899,7 @@ class SkinTemplate extends Skin { $fname = 'SkinTemplate::setupUserJs'; wfProfileIn( $fname ); - global $wgRequest, $wgAllowUserJs; + global $wgRequest, $wgAllowUserJs, $wgJsMimeType; $action = $wgRequest->getText('action'); if( $wgAllowUserJs && $this->loggedin ) { @@ -906,7 +907,7 @@ class SkinTemplate extends Skin { # XXX: additional security check/prompt? $this->userjsprev = '/*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 ); diff --git a/skins/MonoBook.php b/skins/MonoBook.php index f0c4f30f90..952b86d3c6 100644 --- a/skins/MonoBook.php +++ b/skins/MonoBook.php @@ -61,13 +61,13 @@ class MonoBookTemplate extends QuickTemplate { - - data['jsvarurl' ]) { ?> - + data['jsvarurl' ]) { ?> + data['usercss' ]) { ?> - data['userjs' ]) { ?> - data['userjsprev']) { ?> + data['userjs' ]) { ?> + data['userjsprev']) { ?> data['body_ondblclick']) { ?>ondblclick="text('body_ondblclick') ?>" data['body_onload' ]) { ?>onload="text('body_onload') ?>" @@ -122,7 +122,7 @@ class MonoBookTemplate extends QuickTemplate { href="data['nav_urls']['mainpage']['href'])?>" title="msg('mainpage') ?>"> - +
msg('navigation') ?>
diff --git a/skins/Standard.php b/skins/Standard.php index 1c72f0dfbe..44c1a4fe3c 100644 --- a/skins/Standard.php +++ b/skins/Standard.php @@ -21,11 +21,11 @@ class SkinStandard extends Skin { * */ function getHeadScripts() { - global $wgStylePath; + global $wgStylePath, $wgJsMimeType; $s = parent::getHeadScripts(); if ( 3 == $this->qbSetting() ) { # Floating left - $s .= "\n"; } return $s; diff --git a/skins/disabled/Amethyst.pt b/skins/disabled/Amethyst.pt index 48a698b1c4..aa2c10df8f 100644 --- a/skins/disabled/Amethyst.pt +++ b/skins/disabled/Amethyst.pt @@ -7,13 +7,13 @@ - - + + - +
@@ -59,7 +59,7 @@ - +
Navigation
diff --git a/skins/disabled/Chick.pt b/skins/disabled/Chick.pt index f6d7092e47..9ea755c945 100644 --- a/skins/disabled/Chick.pt +++ b/skins/disabled/Chick.pt @@ -5,11 +5,11 @@
Exciting xhtml slimfast - - + + - + diff --git a/skins/disabled/HTMLDump.php b/skins/disabled/HTMLDump.php index 5d943892d2..d933591bce 100644 --- a/skins/disabled/HTMLDump.php +++ b/skins/disabled/HTMLDump.php @@ -105,10 +105,10 @@ class HTMLDumpTemplate extends QuickTemplate { - - data['jsvarurl' ]) { ?> - + data['jsvarurl' ]) { ?> + data['nsclass' ]) { ?>class="text('nsclass') ?>"> @@ -148,7 +148,7 @@ class HTMLDumpTemplate extends QuickTemplate { href="data['nav_urls']['mainpage']['href'])?>" title="msg('mainpage') ?>">
- +
msg('navigation') ?>
diff --git a/skins/disabled/MonoBook.pt b/skins/disabled/MonoBook.pt index 2bb67eb755..56179f164c 100644 --- a/skins/disabled/MonoBook.pt +++ b/skins/disabled/MonoBook.pt @@ -9,13 +9,13 @@ - - - + + - +
@@ -61,7 +61,7 @@ - +
Navigation
diff --git a/skins/disabled/WikimediaWiki.pt b/skins/disabled/WikimediaWiki.pt index 06f8761a8f..27e434e0f6 100644 --- a/skins/disabled/WikimediaWiki.pt +++ b/skins/disabled/WikimediaWiki.pt @@ -7,13 +7,13 @@ - - + + - +
@@ -59,7 +59,7 @@ - +
Navigation