Isarra has uploaded a new change for review.
https://gerrit.wikimedia.org/r/255939
Change subject: A bunch of changes I randomly found, plus some other stuff
......................................................................
A bunch of changes I randomly found, plus some other stuff
Change-Id: Id6dc6f834b6c20d3a39226e0fc7f0f8b904386a4
---
M Example.skin.php
M ExampleTemplate.php
A resources/print.css
M resources/screen-common.less
M resources/screen-desktop.less
M resources/screen-mobile.less
M resources/variables.less
M skin.json
8 files changed, 55 insertions(+), 39 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/skins/Example
refs/changes/39/255939/1
diff --git a/Example.skin.php b/Example.skin.php
index 8c3b165..e8b6b27 100644
--- a/Example.skin.php
+++ b/Example.skin.php
@@ -13,8 +13,7 @@
*
* @param $out OutputPage
*/
- function setupSkinUserCss( OutputPage $out ) {
- parent::setupSkinUserCss( $out );
+ public function initPage( OutputPage $out ) {
$out->addMeta( 'viewport', 'width=device-width,
initial-scale=1.0' );
@@ -23,6 +22,15 @@
'mediawiki.skinning.content.externallinks',
'skins.example'
) );
- $out->addModules( array( 'skins.example.js' ) );
+ $out->addModules( array(
+ 'skins.example.js'
+ ) );
+ }
+
+ /**
+ * @param $out OutputPage
+ */
+ function setupSkinUserCss( OutputPage $out ) {
+ parent::setupSkinUserCss( $out );
}
}
diff --git a/ExampleTemplate.php b/ExampleTemplate.php
index b6bc96a..9231a16 100644
--- a/ExampleTemplate.php
+++ b/ExampleTemplate.php
@@ -79,11 +79,11 @@
</div>
<div id="mw-footer">
- <ul id="footer-icons" class="noprint"
role="contentinfo">
+ <ul id="footer-icons" role="contentinfo">
<?php
foreach ( $this->getFooterIcons(
'icononly' ) as $blockName => $footerIcons ) {
?>
- <li id="footer-<?php echo
htmlspecialchars( $blockName ); ?>ico">
+ <li id="footer-<?php echo
htmlspecialchars( $blockName, ENT_QUOTES ) ?>ico">
<?php
foreach ( $footerIcons
as $icon ) {
echo
$this->getSkin()->makeFooterIcon( $icon );
@@ -97,11 +97,11 @@
<?php
foreach ( $this->getFooterLinks() as $category
=> $links ) {
?>
- <ul id="footer-<?php echo $category ?>"
role="contentinfo">
+ <ul id="footer-<?php echo
htmlspecialchars( $category, ENT_QUOTES ) ?>" role="contentinfo">
<?php
foreach ( $links as $key ) {
?>
- <li id="footer-<?php
echo $category ?>-<?php echo $key ?>"><?php $this->html( $key ) ?></li>
+ <li id="footer-<?php
echo htmlspecialchars( $category, ENT_QUOTES ) ?>-<?php echo htmlspecialchars(
$key, ENT_QUOTES ) ?>"><?php $this->html( $key ) ?></li>
<?php
}
?>
@@ -139,7 +139,7 @@
if ( isset( $box['headerMessage'] ) ) {
echo $this->getMsg(
$box['headerMessage'] )->escaped();
} else {
- echo htmlspecialchars( $box['header'] );
+ echo htmlspecialchars( $box['header'],
ENT_QUOTES );
}
?>
</h3>
@@ -161,19 +161,19 @@
/**
* Outputs the logo and (optionally) site title
*/
- private function outputLogo( $id = 'p-logo', $imageonly = false ) {
+ private function outputLogo( $id = 'p-logo', $imageOnly = false ) {
?>
- <div id="<?php echo $id ?>" class="mw-portlet noprint"
role="banner">
+ <div id="<?php echo $id ?>" class="mw-portlet" role="banner">
<a
class="mw-wiki-logo"
- href="<?php echo htmlspecialchars(
$this->data['nav_urls']['mainpage']['href'] )
+ href="<?php echo htmlspecialchars(
$this->data['nav_urls']['mainpage']['href'], ENT_QUOTES )
?>" <?php
echo Xml::expandAttributes(
Linker::tooltipAndAccesskeyAttribs( 'p-logo' ) )
?>></a>
<?php
- if ( !$imageonly ) {
+ if ( !$imageOnly ) {
?>
- <a id="p-banner" class="mw-wiki-title"
href="<?php echo htmlspecialchars( $this->data['nav_urls']['mainpage']['href']
) ?>">
+ <a id="p-banner" class="mw-wiki-title"
href="<?php echo htmlspecialchars( $this->data['nav_urls']['mainpage']['href'],
ENT_QUOTES ) ?>">
<?php echo $this->getMsg( 'sitetitle'
)->escaped() ?>
</a>
<?php
@@ -198,9 +198,9 @@
<h3>
<label for="searchInput"><?php echo
$this->getMsg( 'search' )->escaped() ?></label>
</h3>
- <?php echo $this->makeSearchInput( array( "id" =>
"searchInput" ) ) ?>
+ <?php echo $this->makeSearchInput( array( 'id' =>
'searchInput' ) ) ?>
<?php echo $this->makeSearchButton( 'go', array( 'id'
=> 'searchGoButton', 'class' => 'searchButton' ) ) ?>
- <input type='hidden' name="title" value="<?php
$this->text( 'searchtitle' ) ?>"/>
+ <input type="hidden" name="title" value="<?php
$this->text( 'searchtitle' ) ?>"/>
</form>
<?php
}
diff --git a/resources/print.css b/resources/print.css
new file mode 100644
index 0000000..0272959
--- /dev/null
+++ b/resources/print.css
@@ -0,0 +1,7 @@
+/* Hide some extra stuff from print view (some of the navigation is already
hidden automatically, but not all) */
+
+.mw-indicators,
+#p-logo,
+#mw-footer {
+ display: none;
+}
diff --git a/resources/screen-common.less b/resources/screen-common.less
index 08d1ac1..ff6ba7f 100644
--- a/resources/screen-common.less
+++ b/resources/screen-common.less
@@ -1,11 +1,11 @@
-/**
- * Basic styling for the Example skin.
- */
+/* Common styling for the Example skin */
@import "variables.less";
-/* Page layout */
+// Page layout
+
#mw-wrapper {
+ max-width: @width;
margin: 0 auto;
position: relative;
padding: 1em;
@@ -15,10 +15,8 @@
width: 10em;
float: right;
- /*
- * Make logo image show up
- * (the class sets the background image from $wgLogo, but we still need
to give it a size to show up)
- */
+ // Make logo image show up
+ // (the class sets the background image from $wgLogo, but we still need
to give it a size to show up)
a.mw-wiki-logo {
display: block;
content: '';
@@ -30,9 +28,10 @@
}
.mw-body {
position: relative;
+ word-wrap: break-word;
}
-/* Some content stuff */
+// Some content stuff
.firstHeading {
margin-top: 0;
}
@@ -41,7 +40,7 @@
margin: 1.5em 0 0 1em;
}
-/* Splatter the menus and tools at the bottom */
+// Splatter the menus and tools at the bottom
#mw-footer,
#page-tools,
#p-personal {
@@ -63,7 +62,7 @@
margin: 1em 0;
}
-/* Footer */
+// Footer
#mw-footer {
clear: both;
border-top: 1px solid @border;
@@ -77,7 +76,7 @@
margin: 0 0 1em 1em;
}
-/* hidden stuff */
+// hidden stuff
#page-tools h3,
#p-search h3,
#p-personal h3 {
diff --git a/resources/screen-desktop.less b/resources/screen-desktop.less
index b78092b..c677d3b 100644
--- a/resources/screen-desktop.less
+++ b/resources/screen-desktop.less
@@ -2,12 +2,6 @@
@import "variables.less";
-/* Contain the width on huge displays */
-#mw-wrapper {
- max-width: @width;
-}
-
-/* Splatter the site navigation at the bottom because why not */
#site-navigation {
ul {
list-style-type: none;
diff --git a/resources/screen-mobile.less b/resources/screen-mobile.less
index 4804cbc..1a04179 100644
--- a/resources/screen-mobile.less
+++ b/resources/screen-mobile.less
@@ -1,11 +1,12 @@
/* Styles appear on displays 750 pixels wide and below */
-/* @import "variables.less"; */ // Not used here
+// @import "variables.less"; (Not used here)
-/* Make the logo smaller because we're dealing with less space here */
#p-logo {
width: 6em;
+ // Make the logo smaller because we're dealing with less space here
+ // Note that background-size doesn't necessarily work in older
browsers, but whatever
a.mw-wiki-logo {
margin: 0 0 1em 1em;
width: 5em;
@@ -17,7 +18,7 @@
display: none;
}
-/* Full-width thumbnails (to avoid really squished text around them) */
+// Full-width thumbnails (to avoid having really squished text around them)
div.thumb {
float: none;
}
@@ -47,8 +48,12 @@
margin: 0 auto .5em;
}
-/* Keep images from overflowing */
+// Keep images from overflowing
.mw-body-content a > img {
height: auto !important;
max-width: 100% !important;
}
+
+.nomobile {
+ display: none;
+}
diff --git a/resources/variables.less b/resources/variables.less
index bb33602..caa158d 100644
--- a/resources/variables.less
+++ b/resources/variables.less
@@ -1,9 +1,9 @@
-/* @import "mediawiki.mixins"; */ // Not used yet
+// @import "mediawiki.mixins"; Not used yet
@width: 66em;
@border: #ccc;
-/* To hide objects, but keep them accessible for screen-readers */
+// To hide objects, but keep them accessible for screen-readers
.hidden() {
position: absolute;
top: -9999px;
diff --git a/skin.json b/skin.json
index 68bb621..393ca33 100644
--- a/skin.json
+++ b/skin.json
@@ -31,6 +31,9 @@
},
"resources/screen-mobile.less": {
"media": "screen and (max-width: 750px)"
+ },
+ "resources/print.css": {
+ "media": "print"
}
}
},
--
To view, visit https://gerrit.wikimedia.org/r/255939
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Id6dc6f834b6c20d3a39226e0fc7f0f8b904386a4
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/skins/Example
Gerrit-Branch: master
Gerrit-Owner: Isarra <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits