Просмотр исходного кода

Improvements, bug fixes, and changelog additions

Tom Hutchison 9 лет назад
Родитель
Сommit
7fd35029e2
6 измененных файлов с 106 добавлено и 46 удалено
  1. 12 0
      CHANGELOG.md
  2. 9 5
      Foreground.skin.php
  3. 14 11
      assets/scripts/foreground.js
  4. 62 21
      assets/stylesheets/foreground.css
  5. 4 4
      foreground.php
  6. 5 5
      skin.json

+ 12 - 0
CHANGELOG.md

@@ -1,3 +1,15 @@
+## Version 2.0
+
+* [feature] Upgrade to Foundation 5.5.3
+* [icons] Update to Font Awesome 4.5
+* [icons] Missing icons for Visual Editor, CiteThisPage, et al were added
+* [feature] Support of more menu items in top-bar, flows automatically
+* [code] Hard set of logo icon in top-bar now controlled by CSS in foreground.css file (can be overridden)
+* [code] Actions button on_hover is using native Foundation 5 on_hover (regression in Foundation 5 caused move on_hover to left instead of bottom) 
+* [code] Echo div container divided with div for alerts and div for messages (MW Flow extension compatible)
+* [bug fix] Visual Editor z-index issue, toolbar and widget sizing
+* [code] z-index values for z-indexed elements re-indexed appropriately
+
 ## Version 1.2
 
 * [compatibility] Update skin for skin registration on MW 1.25 and higher

+ 9 - 5
Foreground.skin.php

@@ -92,7 +92,7 @@ class foregroundTemplate extends BaseTemplate {
 					<h1 class="title-name">
 					<a href="<?php echo $this->data['nav_urls']['mainpage']['href']; ?>">
 					<?php if ($wgForegroundFeatures['navbarIcon'] != '0') { ?>
-						<img alt="<?php echo $this->text('sitename'); ?>" src="<?php echo $this->text('logopath') ?>" style="max-width: 64px;height:auto; max-height:36px; display: inline-block; vertical-align:middle;">
+						<img alt="<?php echo $this->text('sitename'); ?>" class="top-bar-logo" src="<?php echo $this->text('logopath') ?>">
 					<?php } ?>					
 					<div class="title-name" style="display: inline-block;"><?php echo $wgForegroundFeatures['wikiName']; ?></div>
 					</a>
@@ -106,7 +106,7 @@ class foregroundTemplate extends BaseTemplate {
 		<section class="top-bar-section">
 
 			<ul id="top-bar-left" class="left">
-				<li class="divider"></li>
+				<li class="divider show-for-small"></li>
 					<?php foreach ( $this->getSidebar() as $boxName => $box ) { if ( ($box['header'] != wfMessage( 'toolbox' )->text())  ) { ?>
 				<li class="has-dropdown active"  id='<?php echo Sanitizer::escapeId( $box['id'] ) ?>'<?php echo Linker::tooltip( $box['id'] ) ?>>
 					<a href="#"><?php echo htmlspecialchars( $box['header'] ); ?></a>
@@ -162,6 +162,7 @@ class foregroundTemplate extends BaseTemplate {
 			</ul>
 		</section>
 		</nav>
+		
 		<?php if ($wgForegroundFeatures['NavWrapperType'] != '0') echo "</div>"; ?>
 		
 		<div id="page-content">
@@ -181,15 +182,18 @@ class foregroundTemplate extends BaseTemplate {
 		<div class="row">
 				<div id="p-cactions" class="large-12 columns">
 					<?php if ($wgUser->isLoggedIn() || $wgForegroundFeatures['showActionsForAnon']): ?>
-						<a href="#" data-dropdown="drop1" class="button dropdown small secondary radius"><i class="fa fa-cog"><span class="show-for-medium-up">&nbsp;<?php echo wfMessage( 'actions' )->text() ?></span></i></a>
+						<a id="actions-button" href="#" data-dropdown="actions" data-options="align:left; is_hover: true; hover_timeout:700" class="button small secondary radius"><i class="fa fa-cog"><span class="show-for-medium-up">&nbsp;<?php echo wfMessage( 'actions' )->text() ?></span></i></a>
 						<!--RTL -->
-						<ul id="drop1" class="views large-12 columns right f-dropdown">
+						<ul id="actions" class="f-dropdown" data-dropdown-content>
 							<?php foreach( $this->data['content_actions'] as $key => $item ) { echo preg_replace(array('/\sprimary="1"/','/\scontext="[a-z]+"/','/\srel="archives"/'),'',$this->makeListItem($key, $item)); } ?>
 							<?php wfRunHooks( 'SkinTemplateToolboxEnd', array( &$this, true ) );  ?>
 						</ul>
 						<!--RTL -->
 						<?php if ($wgUser->isLoggedIn()): ?>
-							<div id="echo-notifications"></div>
+							<div id="echo-notifications">
+							<div id="echo-notifications-alerts"></div>
+							<div id="echo-notifications-messages"></div>
+							</div>
 						<?php endif; ?>
 					<?php endif;
 					$namespace = str_replace('_', ' ', $this->getSkin()->getTitle()->getNsText());

+ 14 - 11
assets/scripts/foreground.js

@@ -4,20 +4,22 @@ jQuery(document).ready(function() {
   if (!jQuery.support.cssFloat) { jQuery('html').addClass('lt-ie9').addClass('no-js'); }
 
 
-  jQuery(document).foundation(function ( response ) {
-    // console.log(errors); < this line will produce error in ie9!
-    if (window.console) window.console.log( response.errors );
+  jQuery(document).foundation(function (response) {
+    // console.log(response.errors); < this line will produce error in ie9!
+    if (window.console) console.log(response.errors);
   });
   
   // The Echo extension puts an item in personal tools that Foreground really should have in the top menu
   // to make this easier, we move it here and loaded earlier to speed up transform
-  jQuery("#pt-notifications").prependTo("#echo-notifications");
-  jQuery("#pt-notifications-alert").prependTo("#echo-notifications");
+  jQuery("#pt-notifications").prependTo("#echo-notifications-alerts");
+  jQuery("#pt-notifications-message").prependTo("#echo-notifications-messages");
+  jQuery("#pt-notifications-alert").prependTo("#echo-notifications-alerts");
   
   // Append font-awesome icons
   jQuery('[id^=ca-nstab] a').prepend('<div class="drop-icon"><i class="fa fa-file fa-fw"></i></div>')
   jQuery('li#ca-talk a').prepend('<div class="drop-icon"><i class="fa fa-comments-o fa-fw"></i></div>')
   jQuery('li#ca-edit a').prepend('<div class="drop-icon"><i class="fa fa-pencil-square-o fa-fw"></i></div>')
+  jQuery('li#ca-ve-edit a').prepend('<div class="drop-icon"><i class="fa fa-pencil fa-fw"></i></div>')
   jQuery('li#ca-viewsource a').prepend('<div class="drop-icon"><i class="fa fa-book fa-fw"></i></div>')
   jQuery('li#ca-form_edit a').prepend('<div class="drop-icon"><i class="fa fa-pencil-square fa-fw"></i></div>')
   jQuery('li#ca-history a').prepend('<div class="drop-icon"><i class="fa fa-history fa-fw"></i></div>')
@@ -30,6 +32,7 @@ jQuery(document).ready(function() {
   jQuery('li#ca-purge a').prepend('<div class="drop-icon"><i class="fa fa-refresh fa-fw"></i></div>')
   jQuery('li#ca-undelete a').prepend('<div class="drop-icon"><i class="fa fa-undo fa-fw"></i></div>')
   jQuery('li#ca-ask_delete_permanently a').prepend('<div class="drop-icon"><i class="fa fa-cut fa-fw"></i></div>')
+  jQuery('li#t-cite a').prepend('<div class="drop-icon"><i class="fa fa-graduation-cap fa-fw"></i></div>')
 
 if ( jQuery( '#ca-addsection' ).length ) {
   jQuery('li#ca-addsection a').html('<div class="drop-icon"><i class="fa fa-plus fa-fw"></i></div>' + jQuery('li#ca-addsection a').attr('title').replace(/\[.+/g,""))
@@ -42,7 +45,7 @@ if ( jQuery( '#ca-addsection' ).length ) {
   jQuery('li#pt-preferences a').prepend('<div class="drop-icon"><i class="fa fa-ellipsis-h fa-fw"></i></div>')
   jQuery('li#pt-watchlist a').prepend('<div class="drop-icon"><i class="fa fa-th-list fa-fw"></i></div>')
   jQuery('li#pt-mycontris a').prepend('<div class="drop-icon"><i class="fa fa-smile-o fa-fw"></i></div>')
-  jQuery('li#pt-logout a').prepend('<div class="drop-icon"><i class="fa fa-power-off fa-fw"></i></div>')
+  jQuery('li#pt-logout a').prepend('<div class="drop-icon"><i class="fa fa-sign-out fa-fw"></i></div>')
 
   jQuery('li#t-smwbrowselink a').prepend('<div class="drop-icon"><i class="fa fa-eye fa-fw"></i></div>')
   jQuery('li#t-whatlinkshere a').prepend('<div class="drop-icon"><i class="fa fa-arrows fa-fw"></i></div>')
@@ -67,11 +70,11 @@ if ( jQuery( '#ca-addsection' ).length ) {
   jQuery('#mw-normal-catlinks ul li a').addClass('label');
 
   // Make the Page Action button respond to hover
-  // jQuery('a.button.dropdown').mouseenter(function(){
+  //jQuery('button.button').mouseenter(function(){
   //  jQuery('ul#drop1').addClass('open').addClass('right').css('top', '32px').css('left', '785px');
-  // });
-  // jQuery('ul#drop1').mouseleave(function(){
-  // jQuery('ul#drop1').removeClass('open').css('top', '-9999px').css('left', '785px');
-  // });
+  //});
+  //jQuery('ul#drop1').mouseleave(function(){
+  //  jQuery('ul#drop1').removeClass('open').css('top', '-9999px').css('left', '785px');
+  //});
 
 });

+ 62 - 21
assets/stylesheets/foreground.css

@@ -10,6 +10,10 @@ p {
     margin: 2rem 0 0;
 }
 
+.row {
+	max-width: 75em;
+}
+
 a.label:hover,
 a.label:focus {
   color: white;
@@ -17,10 +21,10 @@ a.label:focus {
 
 a.label.new { background-color: #d0d0d0; }
 
-a.button.dropdown { float:right;}
+a#actions-button { float:right; z-index: 499; }
 
 /* Hide the page actions button for special pages (cuz there's nothing in it) */
-.mw-special-FormEdit a.button.dropdown, .ns-special a.button.dropdown { display:none; }
+.mw-special-FormEdit a#actions-button, .ns-special a#actions-button { display:none; }
 
 /* Hide some rows on form-edit (e.g. a thing's title) */
 body.action-formedit .row.hide-on-form-edit { display: none;}
@@ -31,21 +35,21 @@ body.action-formedit .row.hide-on-form-edit { display: none;}
 }
 
 /* Also adjust z-index of action menu to force it on top */
-#p-cactions #drop1 {
-  z-index: 100000;
+#p-cactions #actions {
+  z-index: 500;
   white-space: nowrap;
 }
-#p-cactions #drop1 a {
+#p-cactions #actions a {
   width: 100%;
   text-align: left;
 }
 
 /* Make sure top bar is even more z-indx! */
 #toolbox-dropdown {
-  z-index: 10000000;
+  z-index: 601;
 }
 #personal-tools-dropdown {
-  z-index: 10000000;
+  z-index: 601;
 }
 
 /* Dropdown Icon Alignment */
@@ -139,10 +143,9 @@ div#userloginprompt, p#userloginlink {
 
 }
 
-
 /* LISTS */
 
-ul#drop1.f-dropdown {
+ul#actions.f-dropdown {
   margin-left:0;
   margin-top:.5em;
   margin-bottom:.25em;
@@ -230,7 +233,7 @@ margin: 0;
 text-align: center;
 }
 
-@media only screen and (max-width: 768px) {
+@media only screen and (max-width: 641px) {
 #footer-left { font-size: 85%; text-align: center;}
 #footer-right-icons { font-size: 80%;}
 li#footer-privacy { float: none; margin-right: 0;}
@@ -381,7 +384,7 @@ table.wikitable > * > tr > td {
   padding: 0.4125em 0.5em 0.55em 0.5em;
 }
 
- .novalue {
+.novalue {
   color: #999999;
   font-style:italic;
   font-size:small;
@@ -496,8 +499,21 @@ button, .button {
   padding: 0.3em 0.75em 0.4em 0.75em;
 }
 
+.top-bar-logo {
+	max-width: 100%;
+	height:auto;
+	max-height:2.8125rem; /* Important! max-height must not be higher than line-height */
+	display: inline-block;
+	vertical-align:middle;
+}
+
 .top-bar .button.search {
-  top: 0px;
+	top: 0px;
+}
+
+.top-bar .button, .top-bar button {
+	padding-top: .35rem;
+	padding-bottom: .35rem;
 }
 
 .top-bar .button.search {
@@ -508,15 +524,17 @@ button, .button {
   top: 0px;
 }
 
-@media only screen and (min-width: 768px) {
+@media only screen and (min-width: 641px) {
 .top-bar .button.search {
-  top: 1px; }
+  top: 0px; }
 .top-bar .button.search {
   margin-left: -4px; }
+.top-bar {
+	height: auto; }
 }
 
 .top-bar-section .dropdown {
-  z-index: 100;
+  z-index: 600;
 }
 
 input[type="submit"] {
@@ -710,6 +728,12 @@ body.mw-special-Userlogin h2.title {
 }
 */
 
+.vertical-divider {
+    width: 100%;
+    display: block;
+    background: #1A1A1A;
+    height: 1px;
+}
 
 .top-bar-section li.active:not(.has-form) a:not(.button),
 .top-bar-section li.active:not(.has-form) a:hover:not(.button) {
@@ -723,6 +747,10 @@ body.mw-special-Userlogin h2.title {
 
 /* Add improved styling for the Echo extension */
 
+#echo-notifications .mw-echo-ui-notificationBadgeButtonPopupWidget > .oo-ui-popupWidget  {
+    font-size: 80%;
+}
+
 #echo-notifications {
   float: right;
   display: inline-block;
@@ -730,15 +758,17 @@ body.mw-special-Userlogin h2.title {
 }
 
 #echo-notifications #pt-notifications,
-#echo-notifications #pt-notifications-alert {
+#echo-notifications #pt-notifications-alert,
+#echo-notifications #pt-notifications-message {
   position: relative;
   list-style: none;
+  border-radius: 6px;
+  background-color: #E7E7E7;
+  z-index: 499;
 }
 
 #echo-notifications #pt-notifications .mw-echo-notifications-badge
 {
-  width: 30px;
-  height: 35px;
   text-align: center;
   border-radius: 6px;
   margin: 0;
@@ -747,8 +777,6 @@ body.mw-special-Userlogin h2.title {
 
 #echo-notifications #pt-notifications-alert .mw-echo-notifications-badge
 {
-  width: 50px;
-  height: 30px;
   text-align: center;
   border-radius: 6px;
   margin: 0;
@@ -821,7 +849,7 @@ body.mw-special-Userlogin h2.title {
 /* Make Echo extension more mobile friendly on small widths */
 
 @media only screen and (min-width: 550px) {
-#echo-notifications .mw-echo-overlay { left: -420px; width: 450px; }
+#echo-notifications .mw-echo-overlay { left: -420px; width: 350px; }
 #echo-notifications #mw-echo-overlay-pref-link { padding: 10px 0 10px 30px; }
 #echo-notifications #mw-echo-overlay-link { border-right: 1px solid #DDDDDD; margin-right: 2em; }
 }
@@ -829,4 +857,17 @@ body.mw-special-Userlogin h2.title {
 /*Fix ULS CSS */
 #pt-uls a.uls-trigger {
   padding-left:15px !important;
+}
+
+/*Fixes Visual Editor */
+#content .oo-ui-widget {
+    height: 45px;
+}
+
+#content .oo-ui-toolbar-tools {
+    font-size: 90%;
+}
+
+#content .oo-ui-toolbar-actions > .oo-ui-buttonElement.oo-ui-labelElement > .oo-ui-buttonElement-button > .oo-ui-labelElement-label {
+    line-height: 2.75em !important;
 }

+ 4 - 4
foreground.php

@@ -30,7 +30,7 @@ $wgExtensionCredits['skin'][] = array(
 		'Tom Hutchison',
 		'...'
 	),
-	'version' => '2.0.0 beta 6',
+	'version' => '2.0.0 (Albert)',
 	'descriptionmsg' => 'foreground-desc'
 );
 
@@ -70,19 +70,19 @@ $wgResourceModules['skins.foreground.js'] = array(
 		'foreground/assets/scripts/vendor/fastclick.js',
 		'foreground/assets/scripts/vendor/placeholder.js',
 		'foreground/assets/scripts/foundation/foundation.js',
+		'foreground/assets/scripts/foundation/foundation.topbar.js',
+		'foreground/assets/scripts/foundation/foundation.dropdown.js',
+		'foreground/assets/scripts/foundation/foundation.joyride.js',
 		'foreground/assets/scripts/foundation/foundation.accordion.js',
 		'foreground/assets/scripts/foundation/foundation.alert.js',
 		'foreground/assets/scripts/foundation/foundation.clearing.js',
-		'foreground/assets/scripts/foundation/foundation.dropdown.js',
 		'foreground/assets/scripts/foundation/foundation.equalizer.js',
 		'foreground/assets/scripts/foundation/foundation.interchange.js',
-		'foreground/assets/scripts/foundation/foundation.joyride.js',
 		'foreground/assets/scripts/foundation/foundation.offcanvas.js',
 		'foreground/assets/scripts/foundation/foundation.orbit.js',
 		'foreground/assets/scripts/foundation/foundation.reveal.js',
 		'foreground/assets/scripts/foundation/foundation.tab.js',
 		'foreground/assets/scripts/foundation/foundation.tooltip.js',
-		'foreground/assets/scripts/foundation/foundation.topbar.js',
 		'foreground/assets/scripts/foreground.js',
 	),
 	'dependencies'   => array(

+ 5 - 5
skin.json

@@ -1,6 +1,6 @@
 {
 	"name": "Foreground",
-	"version": "2.0.0 beta 6",
+	"version": "2.0.0 (Albert)",
 	"author": [
 		"Garrick Van Buren",
 		"Jamie Thingelstad",
@@ -45,19 +45,19 @@
 				"assets/scripts/vendor/fastclick.js",
 				"assets/scripts/vendor/placeholder.js",
 				"assets/scripts/foundation/foundation.js",
+				"assets/scripts/foundation/foundation.topbar.js",
+				"assets/scripts/foundation/foundation.dropdown.js",
+				"assets/scripts/foundation/foundation.joyride.js",
 				"assets/scripts/foundation/foundation.accordion.js",
+				"assets/scripts/foundation/foundation.offcanvas.js",
 				"assets/scripts/foundation/foundation.alert.js",
 				"assets/scripts/foundation/foundation.clearing.js",
-				"assets/scripts/foundation/foundation.dropdown.js",
 				"assets/scripts/foundation/foundation.equalizer.js",
 				"assets/scripts/foundation/foundation.interchange.js",
-				"assets/scripts/foundation/foundation.joyride.js",
-				"assets/scripts/foundation/foundation.offcanvas.js",
 				"assets/scripts/foundation/foundation.orbit.js",
 				"assets/scripts/foundation/foundation.reveal.js",
 				"assets/scripts/foundation/foundation.tab.js",
 				"assets/scripts/foundation/foundation.tooltip.js",
-				"assets/scripts/foundation/foundation.topbar.js",
 				"assets/scripts/foreground.js"
 			],
 			"dependencies": [