Merge "Deprecate WebRequest::escapeAppendQuery()"
authorDemon <chadh@wikimedia.org>
Wed, 25 Apr 2012 13:59:10 +0000 (13:59 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Wed, 25 Apr 2012 13:59:10 +0000 (13:59 +0000)
includes/PathRouter.php
maintenance/refreshLinks.php
resources/Resources.php
skins/vector/screen-hd.css [new file with mode: 0644]
skins/vector/screen.css

index 9700b90..a80e04b 100644 (file)
@@ -34,7 +34,7 @@
  *     the relevant contents
  *   - The default behavior is equivalent to `array( 'title' => '$1' )`,
  *     if you don't want the title parameter you can explicitly use `array( 'title' => false )`
- *   - You can specify a value that won't have replacements in it 
+ *   - You can specify a value that won't have replacements in it
  *     using `'foo' => array( 'value' => 'bar' );`
  *
  * Options:
  */
 class PathRouter {
 
+       /**
+        * @var array
+        */
+       private $patterns = array();
+
        /**
         * Protected helper to do the actual bulk work of adding a single pattern.
         * This is in a separate method so that add() can handle the difference between
         * a single string $path and an array() $path that contains multiple path
         * patterns each with an associated $key to pass on.
+        * @param $path string
+        * @param $params array
+        * @param $options array
+        * @param $key null|string
         */
        protected function doAdd( $path, $params, $options, $key = null ) {
                // Make sure all paths start with a /
@@ -140,6 +149,9 @@ class PathRouter {
        /**
         * Add a new path pattern to the path router with the strict option on
         * @see self::add
+        * @param $path string|array
+        * @param $params array
+        * @param $options array
         */
        public function addStrict( $path, $params = array(), $options = array() ) {
                $options['strict'] = true;
@@ -158,6 +170,10 @@ class PathRouter {
                array_multisort( $weights, SORT_DESC, SORT_NUMERIC, $this->patterns );
        }
 
+       /**
+        * @param $pattern object
+        * @return float|int
+        */
        protected static function makeWeight( $pattern ) {
                # Start with a weight of 0
                $weight = 0;
@@ -202,7 +218,7 @@ class PathRouter {
                // Make sure our patterns are sorted by weight so the most specific
                // matches are tested first
                $this->sortByWeight();
-               
+
                $matches = null;
 
                foreach ( $this->patterns as $pattern ) {
@@ -219,6 +235,11 @@ class PathRouter {
                return is_null( $matches ) ? array() : $matches;
        }
 
+       /**
+        * @param $path string
+        * @param $pattern string
+        * @return array|null
+        */
        protected static function extractTitle( $path, $pattern ) {
                // Convert the path pattern into a regexp we can match with
                $regexp = preg_quote( $pattern->path, '#' );
@@ -321,6 +342,8 @@ class PathRouterPatternReplacer {
         * We do this inside of a replacement callback because after replacement we can't tell the
         * difference between a $1 that was not replaced and a $1 that was part of
         * the content a $1 was replaced with.
+        * @param $value string
+        * @return string
         */
        public function replace( $value ) {
                $this->error = false;
@@ -331,6 +354,10 @@ class PathRouterPatternReplacer {
                return $value;
        }
 
+       /**
+        * @param $m array
+        * @return string
+        */
        protected function callback( $m ) {
                if ( $m[1] == "key" ) {
                        if ( is_null( $this->key ) ) {
index 7abbc90..a7c7ec4 100644 (file)
@@ -201,7 +201,7 @@ class RefreshLinks extends Maintenance {
         * @param $id int The page_id
         */
        public static function fixLinksFromArticle( $id ) {
-               global $wgParser;
+               global $wgParser, $wgContLang;
 
                $title = Title::newFromID( $id );
                $dbw = wfGetDB( DB_MASTER );
@@ -219,7 +219,7 @@ class RefreshLinks extends Maintenance {
 
                $dbw->begin( __METHOD__ );
 
-               $options = new ParserOptions;
+               $options = ParserOptions::newFromUserAndLang( new User, $wgContLang );
                $parserOutput = $wgParser->parse( $revision->getText(), $title, $options, true, true, $revision->getId() );
                $update = new LinksUpdate( $title, $parserOutput, false );
                $update->doUpdate();
index 2855f9a..909cb6e 100644 (file)
@@ -75,6 +75,7 @@ return array(
                        'common/commonContent.css' => array( 'media' => 'screen' ),
                        'common/commonInterface.css' => array( 'media' => 'screen' ),
                        'vector/screen.css' => array( 'media' => 'screen' ),
+                       'vector/screen-hd.css' => array( 'media' => 'screen and (min-width: 900px)' ),
                ),
                'scripts' => 'vector/vector.js',
                'remoteBasePath' => $GLOBALS['wgStylePath'],
diff --git a/skins/vector/screen-hd.css b/skins/vector/screen-hd.css
new file mode 100644 (file)
index 0000000..ebb639b
--- /dev/null
@@ -0,0 +1,31 @@
+/* Vector screen styles for high definition displays */
+
+div#content {
+       margin-left: 11em;
+       padding: 1.25em 1.5em 1.5em 1.5em;
+}
+#p-logo {
+       left: 0.5em;
+}
+div#footer {
+       margin-left: 11em;
+       padding: 1.25em;
+}
+div#mw-panel div.portal div.body {
+       padding-left: 0.5em;
+}
+div#mw-panel div.portal h5 {
+       padding-left: 2.25em;
+}
+#p-search {
+       margin-right: 1em;
+}
+#left-navigation {
+       left: 11em;
+}
+#p-personal {
+       right: 1em;
+}
+#mw-head-base {
+       margin-left: 11em;
+}
index d48b5f8..b309d15 100644 (file)
@@ -72,7 +72,7 @@ div.emptyPortlet {
 /* Personal */
 #p-personal {
        position: absolute;
-       top: 0;
+       top: 0.33em;
        right: 0.75em;
 }
 #p-personal h5 {
@@ -844,3 +844,45 @@ div.vectorTabs ul {
 .tipsy {
        font-size: 0.8em;
 }
+
+/* Animate between standard and high definition layouts */
+
+div#content,
+div#footer {
+       transition: margin-left 250ms, padding 250ms;
+       -moz-transition: margin-left 250ms, padding 250ms;
+       -webkit-transition: margin-left 250ms, padding 250ms;
+       -o-transition: margin-left 250ms, padding 250ms;
+}
+#p-logo,
+#left-navigation {
+       transition: left 250ms;
+       -moz-transition: left 250ms;
+       -webkit-transition: left 250ms;
+       -o-transition: left 250ms;
+}
+div#mw-panel div.portal div.body,
+div#mw-panel div.portal h5 {
+       transition: padding-left 250ms;
+       -moz-transition: padding-left 250ms;
+       -webkit-transition: padding-left 250ms;
+       -o-transition: padding-left 250ms;
+}
+#p-search {
+       transition: margin-right 250ms;
+       -moz-transition: margin-right 250ms;
+       -webkit-transition: margin-right 250ms;
+       -o-transition: margin-right 250ms;
+}
+#p-personal {
+       transition: right 250ms;
+       -moz-transition: right 250ms;
+       -webkit-transition: right 250ms;
+       -o-transition: right 250ms;
+}
+#mw-head-base {
+       transition: margin-left 250ms;
+       -moz-transition: margin-left 250ms;
+       -webkit-transition: margin-left 250ms;
+       -o-transition: margin-left 250ms;
+}