Merge "Implement mediawiki.cookie module"
authorRobmoen <rmoen@wikimedia.org>
Wed, 14 May 2014 18:17:55 +0000 (18:17 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Wed, 14 May 2014 18:17:55 +0000 (18:17 +0000)
1  2 
RELEASE-NOTES-1.23
includes/resourceloader/ResourceLoaderStartUpModule.php
maintenance/jsduck/categories.json
resources/Resources.php
tests/qunit/QUnitTestResources.php

diff --combined RELEASE-NOTES-1.23
@@@ -39,12 -39,6 +39,12 @@@ production
  * $wgPasswordSenderName has been removed and is no longer functional. To set a
    custom mailer name, the system message 'emailsender' should be modified
    (default: "{{SITENAME}}").
 +* (bug 63269) Email notifications were not correctly handling the
 +  [[MediaWiki:Helppage]] message being set to a full URL (the default).
 +  If you customized [[MediaWiki:Enotif body]] (the text of email notifications),
 +  you'll need to edit it locally to include the URL via the new variable
 +  $HELPPAGE instead of the parser functions fullurl and canonicalurl; otherwise
 +  you don't have to do anything.
  * $wgDBAhandler was removed as the only class using it was also removed
  * The 'max threads' setting was removed from $wgDBservers.
  * Support for AdminSettings.php has been completely removed. All configuration
    in StartProfiler.php instead of using this.
  * (bug 63444) Made it possible to change the indent string (default: 4 spaces)
    used by FormatJson::encode().
+ * (bug 49156) Added the mediawiki.cookie ResourceLoader module, which wraps
+   jQuery.cookie so that getting/setting a cookie is syntactically and functionally
+   similar to using the WebRequest#getCookie/WebResponse#setcookie methods.
  
  === Bug fixes in 1.23 ===
  * (bug 41759) The "updated since last visit" markers (on history pages, recent
@@@ -295,14 -292,14 +298,14 @@@ changes to languages because of Bugzill
  * (bug 52812) Removed "Disable search suggestions" from Preference.
  * (bug 52809) Removed "Disable browser page caching" from Preference.
  * Three new modules intended for use by custom skins were added:
 -  'skins.common.elements', 'skins.common.content', and 'skins.common.interface',
 -  representing three levels of standard MediaWiki styling. Previously skin
 -  creators wishing to use them had to refer to the file names of appropriate
 -  files directly, which is now discouraged.
 +  'mediawiki.skinning.elements', 'mediawiki.skinning.content', and
 +  'mediawiki.skinning.interface', representing three levels of standard
 +  MediaWiki styling. Previously skin creators wishing to use them had to refer
 +  to the file names of appropriate files directly, which is now discouraged.
  * The modules 'skins.vector' and 'skins.monobook' have been renamed to
    'skins.vector.styles' and 'skins.monobook.styles', respectively,
    and their definition was changed not to include the common*.css files;
 -  the two skins now load the 'skins.common.interface' module instead.
 +  the two skins now load the 'mediawiki.skinning.interface' module instead.
  * A page_links_updated field has been added to the page table.
  * SpecialPage::getTitle has been deprecated in favor of
    SpecialPage::getPageTitle.
@@@ -516,7 -513,7 +519,7 @@@ Don't forget to always back up your dat
  
  See the file UPGRADE for more detailed upgrade instructions.
  
 -For notes on 1.21.x and older releases, see HISTORY.
 +For notes on 1.22.x and older releases, see HISTORY.
  
  == Online documentation ==
  
@@@ -44,11 -44,12 +44,12 @@@ class ResourceLoaderStartUpModule exten
                }
  
                global $wgLoadScript, $wgScript, $wgStylePath, $wgScriptExtension,
 -                      $wgArticlePath, $wgScriptPath, $wgServer, $wgContLang,
 -                      $wgVariantArticlePath, $wgActionPaths, $wgVersion,
 +                      $wgArticlePath, $wgScriptPath, $wgServer, $wgServerName,
 +                      $wgContLang, $wgVariantArticlePath, $wgActionPaths, $wgVersion,
                        $wgEnableAPI, $wgEnableWriteAPI, $wgDBname,
                        $wgSitename, $wgFileExtensions, $wgExtensionAssetsPath,
-                       $wgCookiePrefix, $wgResourceLoaderMaxQueryLength,
+                       $wgCookiePrefix, $wgCookieDomain, $wgCookiePath,
+                       $wgCookieExpiration, $wgResourceLoaderMaxQueryLength,
                        $wgResourceLoaderStorageEnabled, $wgResourceLoaderStorageVersion,
                        $wgSearchType;
  
@@@ -85,7 -86,6 +86,7 @@@
                        // becoming [] instead of {} in JS (bug 34604)
                        'wgActionPaths' => (object)$wgActionPaths,
                        'wgServer' => $wgServer,
 +                      'wgServerName' => $wgServerName,
                        'wgUserLanguage' => $context->getLanguage(),
                        'wgContentLanguage' => $wgContLang->getCode(),
                        'wgVersion' => $wgVersion,
                        'wgExtensionAssetsPath' => $wgExtensionAssetsPath,
                        // MediaWiki sets cookies to have this prefix by default
                        'wgCookiePrefix' => $wgCookiePrefix,
+                       'wgCookieDomain' => $wgCookieDomain,
+                       'wgCookiePath' => $wgCookiePath,
+                       'wgCookieExpiration' => $wgCookieExpiration,
                        'wgResourceLoaderMaxQueryLength' => $wgResourceLoaderMaxQueryLength,
                        'wgCaseSensitiveNamespaces' => $caseSensitiveNamespaces,
                        'wgLegalTitleChars' => Title::convertByteClassToUnicodeClass( Title::legalChars() ),
@@@ -25,7 -25,8 +25,8 @@@
                                        "mw.Notification_",
                                        "mw.user",
                                        "mw.util",
-                                       "mw.plugin.*"
+                                       "mw.plugin.*",
+                                       "mw.cookie"
                                ]
                        },
                        {
                                        "mw.Feedback"
                                ]
                        },
 +                      {
 +                              "name": "Special",
 +                              "classes": [
 +                                      "mw.special*"
 +                              ]
 +                      },
                        {
                                "name": "Development",
                                "classes": [
diff --combined resources/Resources.php
@@@ -50,8 -50,6 +50,8 @@@ return array
        // Scripts for the dynamic language specific data, like grammar forms.
        'mediawiki.language.data' => array( 'class' => 'ResourceLoaderLanguageDataModule' ),
  
 +      /* MediaWiki base skinning modules */
 +
        /**
         * Common skin styles, grouped into three graded levels.
         *
         *     common to MonoBook clones. And since practically every skin that currently exists within
         *     core is a MonoBook clone, all our core skins currently use this level.
         *
 -       * These modules are typically loaded by addModuleStyles which has absolutely no concept of
 -       * dependency management. As a result, the skins.common.* modules contain duplicate stylesheet
 -       * references instead of setting 'dependencies' to the lower level the module is based on. For
 -       * this reason avoid including multiple skins.common.* modules into your skin as this will
 -       * result in duplicate css.
 +       * These modules are typically loaded by addModuleStyles(), which has absolutely no concept of
 +       * dependency management. As a result they contain duplicate stylesheet references instead of
 +       * setting 'dependencies' to the lower level the module is based on. For this reason avoid
 +       * including more than one of them into your skin as this will result in duplicate CSS.
         */
 +      'mediawiki.skinning.elements' => array(
 +              'styles' => array(
 +                      'common/commonElements.css' => array( 'media' => 'screen' ),
 +              ),
 +              'remoteBasePath' => $GLOBALS['wgStylePath'],
 +              'localBasePath' => $GLOBALS['wgStyleDirectory'],
 +      ),
 +      'mediawiki.skinning.content' => array(
 +              'styles' => array(
 +                      'common/commonElements.css' => array( 'media' => 'screen' ),
 +                      'common/commonContent.css' => array( 'media' => 'screen' ),
 +              ),
 +              'remoteBasePath' => $GLOBALS['wgStylePath'],
 +              'localBasePath' => $GLOBALS['wgStyleDirectory'],
 +      ),
 +      'mediawiki.skinning.interface' => array(
 +              // Used in the web installer. Test it after modifying this definition!
 +              'styles' => array(
 +                      'common/commonElements.css' => array( 'media' => 'screen' ),
 +                      'common/commonContent.css' => array( 'media' => 'screen' ),
 +                      'common/commonInterface.css' => array( 'media' => 'screen' ),
 +              ),
 +              'remoteBasePath' => $GLOBALS['wgStylePath'],
 +              'localBasePath' => $GLOBALS['wgStyleDirectory'],
 +      ),
 +
 +      // Temporarily kept for backwards-compatibility with generated HTML
        'skins.common.elements' => array(
                'styles' => array(
                        'common/commonElements.css' => array( 'media' => 'screen' ),
                'localBasePath' => $GLOBALS['wgStyleDirectory'],
        ),
        'skins.common.interface' => array(
 -              // Used in the web installer. Test it after modifying this definition!
                'styles' => array(
                        'common/commonElements.css' => array( 'media' => 'screen' ),
                        'common/commonContent.css' => array( 'media' => 'screen' ),
                'localBasePath' => $GLOBALS['wgStyleDirectory'],
        ),
  
 +
        /**
         * Skins
         * Be careful not to add 'scripts' to these modules,
                'remoteBasePath' => $GLOBALS['wgStylePath'],
                'localBasePath' => $GLOBALS['wgStyleDirectory'],
        ),
 -      'skins.vector.collapsibleNav' => array(
 -              'scripts' => array(
 -                      'vector/collapsibleNav.js',
 -              ),
 -              'messages' => array(
 -                      'vector-collapsiblenav-more',
 -              ),
 -              'dependencies' => array(
 -                      'jquery.client',
 -                      'jquery.cookie',
 -                      'jquery.tabIndex',
 -              ),
 -              'remoteBasePath' => $GLOBALS['wgStylePath'],
 -              'localBasePath' => $GLOBALS['wgStyleDirectory'],
 -              'position' => 'bottom',
 -      ),
  
        /* jQuery */
  
        'jquery' => array(
                'scripts' => 'resources/lib/jquery/jquery.js',
 +              'debugScripts' => 'resources/lib/jquery/jquery.migrate.js',
                'debugRaw' => false,
                'targets' => array( 'desktop', 'mobile' ),
        ),
                'scripts' => 'resources/src/jquery/jquery.accessKeyLabel.js',
                'dependencies' => array(
                        'jquery.client',
 +                      'jquery.mwExtension',
                ),
 +              'messages' => array( 'brackets', 'word-separator' ),
                'targets' => array( 'mobile', 'desktop' ),
        ),
        'jquery.appear' => array(
        'jquery.colorUtil' => array(
                'scripts' => 'resources/src/jquery/jquery.colorUtil.js',
        ),
+       // Use mediawiki.cookie in new code, rather than jquery.cookie.
        'jquery.cookie' => array(
                'scripts' => 'resources/lib/jquery/jquery.cookie.js',
                'targets' => array( 'desktop', 'mobile' ),
                        'jquery.accessKeyLabel',
                        'jquery.mwExtension',
                        'mediawiki.notify',
 +                      'mediawiki.toc', // bug 64765
                ),
                'position' => 'top', // For $wgPreloadJavaScriptMwUtil
                'targets' => array( 'desktop', 'mobile' ),
        ),
+       'mediawiki.cookie' => array(
+               'scripts' => 'resources/src/mediawiki/mediawiki.cookie.js',
+               'dependencies' => array(
+                       'jquery.cookie',
+               ),
+       ),
  
        /* MediaWiki Action */
  
                        'mediawiki.jqueryMsg'
                ),
                'messages' => array(
 -                      'postedit-confirmation',
 +                      'postedit-confirmation-created',
 +                      'postedit-confirmation-restored',
 +                      'postedit-confirmation-saved',
                ),
        ),
        'mediawiki.action.view.redirectToFragment' => array(
                )
        ),
  
 +      'mediawiki.language.names' => array( 'class' => 'ResourceLoaderLanguageNamesModule' ),
 +
        /* MediaWiki Libs */
  
        'mediawiki.libs.jpegmeta' => array(
        'mediawiki.page.watch.ajax' => array(
                'scripts' => 'resources/src/mediawiki.page/mediawiki.page.watch.ajax.js',
                'dependencies' => array(
 -                      'mediawiki.page.startup',
                        'mediawiki.api.watch',
 -                      'mediawiki.util',
                        'mediawiki.notify',
 +                      'mediawiki.util',
 +                      'jquery.accessKeyLabel',
                        'jquery.mwExtension',
                ),
                'messages' => array(
@@@ -71,12 -71,12 +71,13 @@@ return array
                        'tests/qunit/suites/resources/mediawiki/mediawiki.user.test.js',
                        'tests/qunit/suites/resources/mediawiki/mediawiki.util.test.js',
                        'tests/qunit/suites/resources/mediawiki.api/mediawiki.api.test.js',
 +                      'tests/qunit/suites/resources/mediawiki.api/mediawiki.api.category.test.js',
                        'tests/qunit/suites/resources/mediawiki.api/mediawiki.api.parse.test.js',
                        'tests/qunit/suites/resources/mediawiki.api/mediawiki.api.watch.test.js',
                        'tests/qunit/suites/resources/mediawiki.special/mediawiki.special.recentchanges.test.js',
                        'tests/qunit/suites/resources/mediawiki/mediawiki.language.test.js',
                        'tests/qunit/suites/resources/mediawiki/mediawiki.cldr.test.js',
+                       'tests/qunit/suites/resources/mediawiki/mediawiki.cookie.test.js',
                ),
                'dependencies' => array(
                        'jquery.accessKeyLabel',
@@@ -97,7 -97,6 +98,7 @@@
                        'jquery.tablesorter',
                        'jquery.textSelection',
                        'mediawiki.api',
 +                      'mediawiki.api.category',
                        'mediawiki.api.parse',
                        'mediawiki.api.watch',
                        'mediawiki.jqueryMsg',
                        'mediawiki.special.recentchanges',
                        'mediawiki.language',
                        'mediawiki.cldr',
+                       'mediawiki.cookie',
                        'test.mediawiki.qunit.testrunner',
                ),
        )