From 1724d03e803820279c3b64e72b8aa39f971cb0cd Mon Sep 17 00:00:00 2001 From: Povilas Kanapickas Date: Mon, 6 Feb 2017 17:27:04 +0200 Subject: [PATCH 01/11] Skins: Mention what skin cppreference2 is based on --- skins/Cppreference2.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/skins/Cppreference2.php b/skins/Cppreference2.php index 4dad82928..a325931a5 100644 --- a/skins/Cppreference2.php +++ b/skins/Cppreference2.php @@ -1,5 +1,7 @@ Date: Mon, 6 Feb 2017 17:27:05 +0200 Subject: [PATCH 02/11] Skins: Replace spaces with tabs to minimize diff with stock skin --- skins/Cppreference2.php | 406 ++++++++++++++++++++-------------------- 1 file changed, 203 insertions(+), 203 deletions(-) diff --git a/skins/Cppreference2.php b/skins/Cppreference2.php index a325931a5..c99224977 100644 --- a/skins/Cppreference2.php +++ b/skins/Cppreference2.php @@ -134,208 +134,208 @@ public function execute() { // Output HTML Page $this->html( 'headelement' ); - global $Cppreference2SkinRootLink; - $root_link = '/'; - if (isset($Cppreference2SkinRootLink)) { - $root_link = htmlspecialchars($Cppreference2SkinRootLink); - } + global $Cppreference2SkinRootLink; + $root_link = '/'; + if (isset($Cppreference2SkinRootLink)) { + $root_link = htmlspecialchars($Cppreference2SkinRootLink); + } ?> - -
-
-
-
- -
- -
- renderNavigation( 'PERSONAL' ); ?> -
- -
-
-
-
-
- renderNavigation( array( 'NAMESPACES', 'VARIANTS' ) ); ?> -
-
- renderNavigation( array( 'VIEWS', 'ACTIONS' ) ); ?> -
-
-
-
- - -
-
- - - data['sitenotice'] ): ?> - -
html( 'sitenotice' ) ?>
- - - -

html( 'title' ) ?>

- - -
- data['isarticle'] ): ?> - -
msg( 'tagline' ) ?>
- - - -
html( 'userlangattributes' ) ?>>html( 'subtitle' ) ?>
- - data['undelete'] ): ?> - -
html( 'undelete' ) ?>
- - - data['newtalk'] ): ?> - -
html( 'newtalk' ) ?>
- - - - html( 'bodycontent' ) ?> - - data['printfooter'] ): ?> - -
- html( 'printfooter' ); ?> -
- - - data['catlinks'] ): ?> - - html( 'catlinks' ); ?> - - - data['dataAfterContent'] ): ?> - - html( 'dataAfterContent' ); ?> - - -
- - html( 'debughtml' ); ?> - -
- -
-
- - - - - printTrail(); ?> + +
+
+
+
+ +
+ +
+ renderNavigation( 'PERSONAL' ); ?> +
+ +
+
+
+
+
+ renderNavigation( array( 'NAMESPACES', 'VARIANTS' ) ); ?> +
+
+ renderNavigation( array( 'VIEWS', 'ACTIONS' ) ); ?> +
+
+
+
+ + +
+
+ + + data['sitenotice'] ): ?> + +
html( 'sitenotice' ) ?>
+ + + +

html( 'title' ) ?>

+ + +
+ data['isarticle'] ): ?> + +
msg( 'tagline' ) ?>
+ + + +
html( 'userlangattributes' ) ?>>html( 'subtitle' ) ?>
+ + data['undelete'] ): ?> + +
html( 'undelete' ) ?>
+ + + data['newtalk'] ): ?> + +
html( 'newtalk' ) ?>
+ + + + html( 'bodycontent' ) ?> + + data['printfooter'] ): ?> + +
+ html( 'printfooter' ); ?> +
+ + + data['catlinks'] ): ?> + + html( 'catlinks' ); ?> + + + data['dataAfterContent'] ): ?> + + html( 'dataAfterContent' ); ?> + + +
+ + html( 'debughtml' ); ?> + +
+ +
+
+ + + + + printTrail(); ?> getToolbox(); - - $msg = 'toolbox'; - $msg_obj = wfMessage( $msg ); - $message = htmlspecialchars($msg_obj->exists() ? $msg_obj->text() : $msg); - - ?> -
-
- -
+ private function renderToolbox() + { + $name = 'tb'; + + $content = $this->getToolbox(); + + $msg = 'toolbox'; + $msg_obj = wfMessage( $msg ); + $message = htmlspecialchars($msg_obj->exists() ? $msg_obj->text() : $msg); + + ?> +
+
+ +
data['sidebar']['navigation']; - - $msg = 'navigation'; - $msg_obj = wfMessage( $msg ); - $message = htmlspecialchars($msg_obj->exists() ? $msg_obj->text() : $msg); - - ?> -
-
- -
+ } + + private function renderBottomNavigation() + { + $content = $this->data['sidebar']['navigation']; + + $msg = 'navigation'; + $msg_obj = wfMessage( $msg ); + $message = htmlspecialchars($msg_obj->exists() ? $msg_obj->text() : $msg); + + ?> +
+
+ +
data['language_urls']; - - $msg = 'otherlanguages'; - $msg_obj = wfMessage( $msg ); - $message = htmlspecialchars($msg_obj->exists() ? $msg_obj->text() : $msg); - - ?> -
-
-
    - $val ): - echo $this->makeListItem( $key, $val ); - endforeach; ?> -
-
+ } + + private function renderLanguages() + { + $content = $this->data['language_urls']; + + $msg = 'otherlanguages'; + $msg_obj = wfMessage( $msg ); + $message = htmlspecialchars($msg_obj->exists() ? $msg_obj->text() : $msg); + + ?> +
+
+
    + $val ): + echo $this->makeListItem( $key, $val ); + endforeach; ?> +
+
data['language_urls'] ) { $this->renderLanguages(); } - foreach( $this->getFooterLinks() as $category => $links ): ?> - - - getFooterIcons("icononly"); - if ( count( $footericons ) > 0 ): ?> - - -
-
+ } + + private function renderFooter() + { + if ( $this->data['language_urls'] ) { $this->renderLanguages(); } + foreach( $this->getFooterLinks() as $category => $links ): ?> + + + getFooterIcons("icononly"); + if ( count( $footericons ) > 0 ): ?> + + +
+
getPersonalTools(); - $item = reset($tools); - $key = key($tools); - array_shift($tools); + $tools = $this->getPersonalTools(); + $item = reset($tools); + $key = key($tools); + array_shift($tools); - echo $this->makeListItem( $key, $item, array( 'tag' => 'span' ) ); - if ( count( $tools ) > 0 ) { + echo $this->makeListItem( $key, $item, array( 'tag' => 'span' ) ); + if ( count( $tools ) > 0 ) { ?> + html( 'userlangattributes' ) ?>> + $item ) { + echo $this->makeListItem( $key, $item ); + } ?> + +
Date: Mon, 6 Feb 2017 17:27:06 +0200 Subject: [PATCH 03/11] Skins: Apply changes to base skin from 1.18 to 1.19 --- skins/Cppreference2.php | 66 +++++++++++++++++++---------------------- 1 file changed, 30 insertions(+), 36 deletions(-) diff --git a/skins/Cppreference2.php b/skins/Cppreference2.php index c99224977..70777017e 100644 --- a/skins/Cppreference2.php +++ b/skins/Cppreference2.php @@ -1,6 +1,6 @@ getFuzzyBool( 'debug' ) ? '' : '.min'; + $min = $this->getRequest()->getFuzzyBool( 'debug' ) ? '' : '.min'; $out->addHeadItem( 'csshover', '
-
+
data['sitenotice'] ): ?> @@ -179,7 +169,9 @@ public function execute() { -

html( 'title' ) ?>

+

+ html( 'title' ) ?> +

@@ -326,7 +318,7 @@ private function renderFooter() $footerIcons ): ?> @@ -340,16 +332,18 @@ private function renderFooter() /** * Render one or more navigations elements by name, automatically reveresed * when UI is in RTL mode + * + * @param $elements array */ private function renderNavigation( $elements ) { - global $wgVectorUseSimpleSearch, $wgVectorShowVariantName, $wgUser, $wgLang; + global $wgVectorUseSimpleSearch; // If only one element was given, wrap it in an array, allowing more // flexible arguments if ( !is_array( $elements ) ) { $elements = array( $elements ); // If there's a series of elements, reverse them when in RTL mode - } elseif ( $wgLang->isRTL() ) { + } elseif ( $this->data['rtl'] ) { $elements = array_reverse( $elements ); } // Render elements @@ -371,15 +365,13 @@ private function renderNavigation( $elements ) { case 'VARIANTS': ?>
- -

- data['variant_urls'] as $link ): ?> - - - - -

- +

+ data['variant_urls'] as $link ): ?> + + + + +

msg( 'variants' ) ?>