Werdna has submitted this change and it was merged.
Change subject: Move navigation out of drop down menu
......................................................................
Move navigation out of drop down menu
Change-Id: Ideb0af3cd6ef2d1b1434ba470183fa70346c0d29
---
M templates/Skin.php
M templates/sidebar.template
2 files changed, 35 insertions(+), 40 deletions(-)
Approvals:
Werdna: Verified; Looks good to me, approved
diff --git a/templates/Skin.php b/templates/Skin.php
index b6d8f14..bafa36d 100644
--- a/templates/Skin.php
+++ b/templates/Skin.php
@@ -3,11 +3,10 @@
'flags' => array(
'jstrue' => false,
'jsobj' => false,
- 'spvar' => false,
+ 'spvar' => true,
'prop' => false,
'method' => false,
'mustlok' => true,
- 'mustsec' => true,
'echo' => false,
'debug' => $debugopt,
),
@@ -28,7 +27,7 @@
'blockhelpers' => array(),
'hbhelpers' => array(),
'partials' => array(),
- 'scopes' => array($in),
+ 'scopes' => array(),
'sp_vars' => array('root' => $in),
'funcs' => array(
'v' => function ($cx, $base, $path) {
@@ -60,10 +59,14 @@
return $v;
}
$count--;
- if ($count >= 0) {
- $base = $cx['scopes'][$count];
- } else {
- return null;
+ switch ($count) {
+ case -1:
+ $base = $cx['sp_vars']['root'];
+ break;
+ case -2;
+ return null;
+ default:
+ $base = $cx['scopes'][$count];
}
}
},
@@ -76,7 +79,10 @@
$isObj = false;
if ($isAry && $else !== null && count($v) === 0) {
- return $else($cx, $in);
+ $cx['scopes'][] = $in;
+ $ret = $else($cx, $in);
+ array_pop($cx['scopes']);
+ return $ret;
}
// #var, detect input type is object or not
@@ -140,13 +146,9 @@
return '';
}
if ($isAry) {
- if ($cx['flags']['mustsec']) {
- $cx['scopes'][] = $v;
- }
+ $cx['scopes'][] = $in;
$ret = $cb($cx, $v);
- if ($cx['flags']['mustsec']) {
- array_pop($cx['scopes']);
- }
+ array_pop($cx['scopes']);
return $ret;
}
@@ -159,13 +161,16 @@
}
if ($else !== null) {
- return $else($cx, $in);
+ $cx['scopes'][] = $in;
+ $ret = $else($cx, $in);
+ array_pop($cx['scopes']);
+ return $ret;
}
return '';
},
'ifvar' => function ($cx, $v) {
- return !is_null($v) && ($v !== false) && ($v !== 0) && ($v !== '') &&
(is_array($v) ? (count($v) > 0) : true);
+ return !is_null($v) && ($v !== false) && ($v !== 0) && ($v !== 0.0) &&
($v !== '') && (is_array($v) ? (count($v) > 0) : true);
},
'ch' => function ($cx, $ch, $vars, $op) {
return $cx['funcs']['chret'](call_user_func_array($cx['helpers'][$ch],
$vars), $op);
@@ -194,17 +199,6 @@
<div id="off-navigation">
'.' <div class="dropdown">
- <button class="btn btn-default dropdown-toggle" type="button"
id="navigation" data-toggle="dropdown" aria-expanded="true">
- <span class="glyphicon glyphicon-th"></span>
- <span class="caret"></span>
- </button>
- <ul class="dropdown-menu" role="menu"
aria-labelledby="navigation">
-'.$cx['funcs']['sec']($cx, $cx['funcs']['v']($cx, $in,
array('sidebar','navigation')), $in, true, function($cx, $in) {return '
<li id="'.htmlentities((string)$cx['funcs']['v']($cx, $in,
array('id')), ENT_QUOTES, 'UTF-8').'">
- <a
href="'.htmlentities((string)$cx['funcs']['v']($cx, $in, array('href')),
ENT_QUOTES, 'UTF-8').'">'.htmlentities((string)$cx['funcs']['v']($cx, $in,
array('text')), ENT_QUOTES, 'UTF-8').'</a>
- </li>
-';}).' </ul>
- </div>
- <div class="dropdown">
<button class="btn btn-default dropdown-toggle" type="button"
id="account" data-toggle="dropdown" aria-expanded="true">
<span class="glyphicon glyphicon-user"></span>
<span class="caret"></span>
@@ -213,6 +207,12 @@
'.$cx['funcs']['sec']($cx, $cx['funcs']['v']($cx, $in,
array('personal_urls')), $in, true, function($cx, $in) {return '
<li><a href="'.htmlentities((string)$cx['funcs']['v']($cx, $in,
array('href')), ENT_QUOTES, 'UTF-8').'"
class="'.htmlentities((string)$cx['funcs']['v']($cx, $in, array('class')),
ENT_QUOTES, 'UTF-8').'">'.htmlentities((string)$cx['funcs']['v']($cx, $in,
array('text')), ENT_QUOTES, 'UTF-8').'</a></li>
';}).' </ul>
</div>
+ <h2 id="navigation-header">Navigation</h2>
+ <ul aria-labelledby="navigation-header">
+'.$cx['funcs']['sec']($cx, $cx['funcs']['v']($cx, $in,
array('sidebar','navigation')), $in, true, function($cx, $in) {return '
<li id="'.htmlentities((string)$cx['funcs']['v']($cx, $in,
array('id')), ENT_QUOTES, 'UTF-8').'">
+ <a
href="'.htmlentities((string)$cx['funcs']['v']($cx, $in, array('href')),
ENT_QUOTES, 'UTF-8').'">'.htmlentities((string)$cx['funcs']['v']($cx, $in,
array('text')), ENT_QUOTES, 'UTF-8').'</a>
+ </li>
+';}).' </ul>
'.' </div>
<div id="site-wrap">
diff --git a/templates/sidebar.template b/templates/sidebar.template
index f5d9b2e..8be93f0 100644
--- a/templates/sidebar.template
+++ b/templates/sidebar.template
@@ -1,17 +1,4 @@
<div class="dropdown">
- <button class="btn btn-default dropdown-toggle" type="button"
id="navigation" data-toggle="dropdown" aria-expanded="true">
- <span class="glyphicon glyphicon-th"></span>
- <span class="caret"></span>
- </button>
- <ul class="dropdown-menu" role="menu" aria-labelledby="navigation">
- {{#each sidebar.navigation}}
- <li id="{{id}}">
- <a href="{{href}}">{{text}}</a>
- </li>
- {{/each}}
- </ul>
-</div>
-<div class="dropdown">
<button class="btn btn-default dropdown-toggle" type="button"
id="account" data-toggle="dropdown" aria-expanded="true">
<span class="glyphicon glyphicon-user"></span>
<span class="caret"></span>
@@ -22,3 +9,11 @@
{{/each}}
</ul>
</div>
+<h2 id="navigation-header">Navigation</h2>
+<ul aria-labelledby="navigation-header">
+ {{#each sidebar.navigation}}
+ <li id="{{id}}">
+ <a href="{{href}}">{{text}}</a>
+ </li>
+ {{/each}}
+</ul>
--
To view, visit https://gerrit.wikimedia.org/r/190428
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: Ideb0af3cd6ef2d1b1434ba470183fa70346c0d29
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/skins/LivingStyleGuide
Gerrit-Branch: master
Gerrit-Owner: Werdna <[email protected]>
Gerrit-Reviewer: Werdna <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits