Bläddra i källkod

Merge branch 'develop'

Tom Hutchison 9 år sedan
förälder
incheckning
44667e9e93
11 ändrade filer med 178 tillägg och 33 borttagningar
  1. 18 0
      .travis.yml
  2. 17 0
      CHANGELOG.md
  3. 13 9
      Foreground.skin.php
  4. 7 2
      README.md
  5. 1 0
      assets/scripts/foreground.js
  6. 16 15
      assets/stylesheets/foreground.css
  7. BIN
      assets/stylesheets/indicator.gif
  8. 10 0
      composer.json
  9. 22 7
      foreground.php
  10. 11 0
      i18n/fr.json
  11. 63 0
      skin.json

+ 18 - 0
.travis.yml

@@ -0,0 +1,18 @@
+language: php
+
+php:
+  - 7
+  - 5.6
+  - 5.5
+  - 5.4
+  - 5.3
+  - hhvm
+  - nightly
+  
+sudo: false
+
+install:
+  - travis_retry composer update --no-progress --prefer-dist --profile
+
+script:
+  - composer test

+ 17 - 0
CHANGELOG.md

@@ -1,3 +1,20 @@
+## Version 1.2
+
+* [compatibility] Update skin for skin registration on MW 1.25 and higher
+* [compatibility] Backwards compatibility with MediaWiki Versions prior to 1.25
+* [bug fix] Fixed Echo extension compatibility with recent release
+* [documentation] Update Readme.md
+* [language] Update Fr-fr translation string
+* [development] Addition of Travis and Scrutinizer
+* [code] Resource module position explicitly set
+* [code] Fixes for execution paths
+* [feature] Support for Visual Editor
+* [icons] Font Awesome update to 4.2, better icons for ULS and page history
+* [code] CSS fix for invasive ULS CSS, removed style for SiteNotice now user controlled
+* [language] Update to language files, now uses .json files to load translations
+* [bug fix] H3 larger than H2 on small screens
+* [bug fix] Missing indicator.gif spinner image
+
 ## Version 1.1
 
 * [feature] Addition of Social Media Follow Icons using AddThis horizontal follow bar

+ 13 - 9
Foreground.skin.php

@@ -39,7 +39,7 @@ class Skinforeground extends SkinTemplate {
 					header('X-UA-Compatible: IE=edge');
 				break;
 		}
-		$out->addModuleStyles('skins.foreground');
+		$out->addModuleStyles('skins.foreground.styles');
 	}
 
 	public function initPage( OutputPage $out ) {
@@ -48,7 +48,7 @@ class Skinforeground extends SkinTemplate {
 
 		$viewport_meta = 'width=device-width, user-scalable=yes, initial-scale=1.0';
 	  $out->addMeta('viewport', $viewport_meta);
-		$out->addModuleScripts('skins.foreground');
+		$out->addModules('skins.foreground.js');
 	}
 
 }
@@ -183,10 +183,12 @@ class foregroundTemplate extends BaseTemplate {
 				<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>
-						<ul id="drop1" class="views large-12 columns f-dropdown">
+						<!--RTL -->
+						<ul id="drop1" class="views large-12 columns right f-dropdown">
 							<?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 ) );  ?>
+							<?php wfRunHooks( 'SkinTemplateToolboxEnd', array( &$this, true ) );  ?>
 						</ul>
+						<!--RTL -->
 						<?php if ($wgUser->isLoggedIn()): ?>
 							<div id="echo-notifications"></div>
 						<?php endif; ?>
@@ -198,16 +200,18 @@ class foregroundTemplate extends BaseTemplate {
 						$newtitle = str_replace($namespace.':', '', $pagetitle);
 						$displaytitle = str_replace($pagetitle, $newtitle, $displaytitle);
 					?><h4 class="namespace label"><?php print $namespace; ?></h4><?php } ?>
-					<h2 class="title"><?php print $displaytitle; ?></h2>
+					<div id="content">
+					<h2  id="firstHeading" class="title"><?php print $displaytitle; ?></h2>
 					<?php if ( $this->data['isarticle'] ) { ?><h3 id="tagline"><?php $this->msg( 'tagline' ) ?></h3><?php } ?>
-					<h5 class="subtitle"><?php $this->html('subtitle') ?></h5>
-					<div class="clear_both"></div>
-					<div class="mw-bodytext">
+					<h5 id="siteSub" class="subtitle"><?php $this->html('subtitle') ?></h5>
+					<div id="contentSub" class="clear_both"></div>
+					<div id="bodyContent" class="mw-bodytext">
 						<?php $this->html('bodytext') ?>
 						<div class="clear_both"></div>
 					</div>
 		    	<div class="group"><?php $this->html('catlinks'); ?></div>
 		    	<?php $this->html('dataAfterContent'); ?>
+				</div>
 		    </div>
 		</div>
 
@@ -253,4 +257,4 @@ class foregroundTemplate extends BaseTemplate {
 		wfRestoreWarnings();
 	}
 }
-?>
+?>

+ 7 - 2
README.md

@@ -2,6 +2,9 @@
 
 [MediaWiki](http://www.mediawiki.org) skin that focuses on putting your content in the *foreground*. Supports responsive layouts and has classes predefined for [Semantic MediaWiki](http://semantic-mediawiki.org/wiki/Semantic_MediaWiki). Built on the [Zurb Foundation](http://foundation.zurb.com) CSS framework.
 
+[![Build Status](https://travis-ci.org/thingles/foreground.svg?branch=develop)](https://travis-ci.org/thingles/foreground) [![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/thingles/foreground/badges/quality-score.png?b=develop)](https://scrutinizer-ci.com/g/thingles/foreground/?branch=develop)
+
+
 ## Download
 
 First, copy the Foreground source files into your MediaWiki skins directory (see [skinning](https://www.mediawiki.org/wiki/Manual:Skinning) for general information on MediaWiki skins). You can either download the files and extract them from:
@@ -18,9 +21,11 @@ After that, you can issue `git pull` to update the code at anytime.
 
 ## Setup
 
-Once the skin is in place add the following line to your `LocalSettings.php` file.
+Once the skin is in place add one the following lines to your `LocalSettings.php` file depending on the version of MediaWiki you are using.
 
-    require_once "$IP/skins/foreground/foreground.php";
+    require_once "$IP/skins/foreground/foreground.php"; //MW versions < 1.25.x
+	
+	wfLoadSkin( 'foreground' ); //MW versions 1.25 and higher
 
 This will activate Foreground in your installation. At this point you can select it as a user skin in your user preferences.
 

+ 1 - 0
assets/scripts/foreground.js

@@ -12,6 +12,7 @@ jQuery(document).ready(function() {
   // 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");
   
   // Append font-awesome icons
   jQuery('[id^=ca-nstab] a').prepend('<div class="drop-icon"><i class="fa fa-file fa-fw"></i></div>')

+ 16 - 15
assets/stylesheets/foreground.css

@@ -285,18 +285,6 @@ h1,h2,h3,h4,h5,h6 {
   font-size: 0.4em;
 }
 
-h3 {
-  font-weight: normal;
-  font-size:1em;
-}
-
-.ns-subject h3,
-.ns-special h3,
-.page-Main_Page h3 {
-  font-weight: bold;
-  font-size: 2em;
-}
-
 p.title {
   padding: 0.9375em;
 }
@@ -730,7 +718,8 @@ body.mw-special-Userlogin h2.title {
   margin: .5em 1em;
 }
 
-#echo-notifications #pt-notifications {
+#echo-notifications #pt-notifications,
+#echo-notifications #pt-notifications-alert {
   position: relative;
   list-style: none;
 }
@@ -745,13 +734,25 @@ body.mw-special-Userlogin h2.title {
   padding:6px;
 }
 
-#echo-notifications #pt-notifications a.mw-echo-short-link .mw-badge
+#echo-notifications #pt-notifications-alert .mw-echo-notifications-badge
+{
+  width: 50px;
+  height: 30px;
+  text-align: center;
+  border-radius: 6px;
+  margin: 0;
+}
+
+#echo-notifications #pt-notifications a.mw-echo-short-link .mw-badge,
+#echo-notifications #pt-notifications-alert a.mw-echo-short-link .mw-badge
 {
   margin:0;
   padding:6px;
 }
 
-#echo-notifications #pt-notifications .mw-badge-content {
+#echo-notifications #pt-notifications .mw-badge-content,
+#echo-notifications #pt-notifications-alert .mw-badge-content
+{
   font-size: 1.3em;
   line-height: 1.1;
 }

BIN
assets/stylesheets/indicator.gif


+ 10 - 0
composer.json

@@ -0,0 +1,10 @@
+{
+	"require-dev": {
+		"jakub-onderka/php-parallel-lint": "0.9"
+	},
+	"scripts": {
+		"test": [
+			"parallel-lint . --exclude vendor"
+		]
+	}
+}

+ 22 - 7
foreground.php

@@ -9,21 +9,30 @@
  * @license 2-clause BSD
  */
 
-if( !defined( 'MEDIAWIKI' ) ) {
-   die( 'This is a skin to the MediaWiki package and cannot be run standalone.' );
+if ( function_exists( 'wfLoadSkin' ) ) {
+	wfLoadSkin( 'foreground' );
+	// Keep i18n globals so mergeMessageFileList.php doesn't break
+	$wgMessagesDirs['SkinForeground'] = __DIR__ . '/i18n';
+	/* wfWarn(
+		'Deprecated PHP entry point used for foreground skin. Please use wfLoadSkin instead, ' .
+		'see https://www.mediawiki.org/wiki/Extension_registration for more details.'
+	); */
+	return;
 }
 
+// Note: Don't forget when updating to update the skin.json file with the same change.
+
 $wgExtensionCredits['skin'][] = array(
 	'path'		 => __FILE__,
 	'name'		 => 'Foreground',
 	'url'		 => 'http://foreground.thingelstad.com/',
-	'version'	 => '1.2-alpha',
+	'version'	 => '1.2.0',
 	'author'	 => array(
 		'Garrick Van Buren',
 		'Jamie Thingelstad',
 		'Tom Hutchison',
 		'...'
-		),
+	),
 	'descriptionmsg' => 'foreground-desc'
 );
 
@@ -34,7 +43,8 @@ $wgAutoloadClasses['SkinForeground'] = __DIR__ . '/Foreground.skin.php';
 $wgMessagesDirs['SkinForeground'] = __DIR__ . '/i18n';
 $wgExtensionMessagesFiles['SkinForeground'] = __DIR__ . '/Foreground.i18n.php';
 
-$wgResourceModules['skins.foreground'] = array(
+$wgResourceModules['skins.foreground.styles'] = array(
+	'position'       => 'top',
 	'styles'         => array(
 		'foreground/assets/stylesheets/normalize.css',
 		'foreground/assets/stylesheets/font-awesome.css',
@@ -44,6 +54,12 @@ $wgResourceModules['skins.foreground'] = array(
 		'foreground/assets/stylesheets/jquery.autocomplete.css',
 		'foreground/assets/stylesheets/responsive-tables.css'
 	),
+	'remoteBasePath' => &$GLOBALS['wgStylePath'],
+	'localBasePath'  => &$GLOBALS['wgStyleDirectory']
+);
+
+$wgResourceModules['skins.foreground.js'] = array(
+	'position'       => 'top',
 	'scripts'        => array(
 		'foreground/assets/scripts/vendor/custom.modernizr.js',
 		'foreground/assets/scripts/vendor/fastclick.js',
@@ -60,6 +76,5 @@ $wgResourceModules['skins.foreground'] = array(
 		'foreground/assets/scripts/foreground.js'
 	),
 	'remoteBasePath' => &$GLOBALS['wgStylePath'],
-	'localBasePath'  => &$GLOBALS['wgStyleDirectory'],
-	'position'       => 'bottom'
+	'localBasePath'  => &$GLOBALS['wgStyleDirectory']
 );

+ 11 - 0
i18n/fr.json

@@ -0,0 +1,11 @@
+{
+	"@metadata": {
+		"authors": [
+			"Marc Antoine Thevenet"
+		]
+	},
+	"skinname-foreground": "Foreground",
+	"foreground-desc": "Propose une skin visant à mettre votre contenu au premier plan",
+	"foreground-browsermsg": "Il est possible que l'affichage ne soit pas correct avec cette version d'Internet Explorer. Nous vous recommandons de le mettre à jour vers une version plus récente d'Internet Explorer ou de passer à un navigateur comme Firefox ou Chrome.",
+	"foreground-menutitle": "Menu"
+}

+ 63 - 0
skin.json

@@ -0,0 +1,63 @@
+{
+	"@Note": "Note: Don't forget when updating to update the foreground.php file with the same change.",
+	"name": "Foreground",
+	"version": "1.2.0",
+	"author": [
+		"Garrick Van Buren",
+		"Jamie Thingelstad",
+		"Tom Hutchison",
+		"..."
+	],
+	"url": "http://foreground.thingelstad.com",
+	"descriptionmsg": "foreground-desc",
+	"type": "skin",
+	"ValidSkinNames": {
+		"foreground": "Foreground"
+	},
+	"MessagesDirs": {
+		"SkinForeground": [
+			"i18n"
+		]
+	},
+	"AutoloadClasses": {
+		"SkinForeground": "Foreground.skin.php"
+	},
+	"ResourceModules": {
+		"skins.foreground.styles": {
+			"position": "top",
+			"styles": [
+				"assets/stylesheets/normalize.css",
+				"assets/stylesheets/font-awesome.css",
+				"assets/stylesheets/foundation.css",
+				"assets/stylesheets/foreground.css",
+				"assets/stylesheets/foreground-print.css",
+				"assets/stylesheets/jquery.autocomplete.css",
+				"assets/stylesheets/responsive-tables.css"
+			]
+		},
+		"skins.foreground.js": {
+			"position": "top",
+			"scripts": [
+				"assets/scripts/vendor/custom.modernizr.js",
+				"assets/scripts/vendor/fastclick.js",
+				"assets/scripts/vendor/responsive-tables.js",
+				"assets/scripts/foundation/foundation.js",
+				"assets/scripts/foundation/foundation.topbar.js",
+				"assets/scripts/foundation/foundation.dropdown.js",
+				"assets/scripts/foundation/foundation.section.js",
+				"assets/scripts/foundation/foundation.clearing.js",
+				"assets/scripts/foundation/foundation.cookie.js",
+				"assets/scripts/foundation/foundation.placeholder.js",
+				"assets/scripts/foundation/foundation.forms.js",
+				"assets/scripts/foundation/foundation.alerts.js",
+				"assets/scripts/foreground.js"
+			]
+		}
+	},
+	"ResourceFileModulePaths": {
+		"localBasePath": "",
+		"remoteSkinPath": "foreground"
+	},
+	"config": {},
+	"manifest_version": 1
+}