* Always set 'userjs' and 'userjsprev' items to false since they are now incorporated...
authorAlexandre Emsenhuber <ialex@users.mediawiki.org>
Mon, 2 Jan 2012 12:19:24 +0000 (12:19 +0000)
committerAlexandre Emsenhuber <ialex@users.mediawiki.org>
Mon, 2 Jan 2012 12:19:24 +0000 (12:19 +0000)
* Removed SkinTemplate::setupUserJs() since it's no longer used and marked OutputPage::isUserJsAllowed() for removal in 1.20 since its last call is now gone

includes/OutputPage.php
includes/SkinTemplate.php

index 84fe1e9..f975a1f 100644 (file)
@@ -1208,9 +1208,11 @@ class OutputPage extends ContextSource {
         * Return whether user JavaScript is allowed for this page
         * @deprecated since 1.18 Load modules with ResourceLoader, and origin and
         *     trustworthiness is identified and enforced automagically.
+        *     Will be removed in 1.20.
         * @return Boolean
         */
        public function isUserJsAllowed() {
+               wfDeprecated( __METHOD__, '1.18' );
                return $this->getAllowedModules( ResourceLoaderModule::TYPE_SCRIPTS ) >= ResourceLoaderModule::ORIGIN_USER_INDIVIDUAL;
        }
 
index d23ced4..096393b 100644 (file)
@@ -194,12 +194,8 @@ class SkinTemplate extends Skin {
                        $tpl->set( 'pagecss', false );
                        $tpl->set( 'usercss', false );
 
-                       $this->userjs = $this->userjsprev = false;
-                       # @todo FIXME: This is the only use of OutputPage::isUserJsAllowed() anywhere; can we
-                       # get rid of it?  For that matter, why is any of this here at all?
-                       $this->setupUserJs( $out->isUserJsAllowed() );
-                       $tpl->setRef( 'userjs', $this->userjs );
-                       $tpl->setRef( 'userjsprev', $this->userjsprev );
+                       $tpl->set( 'userjs', false );
+                       $tpl->set( 'userjsprev', false );
 
                        $tpl->set( 'jsvarurl', false );
 
@@ -1219,25 +1215,6 @@ class SkinTemplate extends Skin {
                return $this->getTitle()->getNamespaceKey();
        }
 
-       /**
-        * @private
-        * @todo FIXME: Why is this duplicated in/from OutputPage::getHeadScripts()??
-        */
-       function setupUserJs( $allowUserJs ) {
-               global $wgJsMimeType;
-               wfProfileIn( __METHOD__ );
-
-               if( $allowUserJs && $this->loggedin ) {
-                       if( $this->getTitle()->isJsSubpage() and $this->getOutput()->userCanPreview() ) {
-                               # XXX: additional security check/prompt?
-                               $this->userjsprev = '/*<![CDATA[*/ ' . $this->getRequest()->getText( 'wpTextbox1' ) . ' /*]]>*/';
-                       } else {
-                               $this->userjs = self::makeUrl( $this->userpage . '/' . $this->skinname . '.js', 'action=raw&ctype=' . $wgJsMimeType );
-                       }
-               }
-               wfProfileOut( __METHOD__ );
-       }
-
        public function commonPrintStylesheet() {
                return false;
        }