浏览代码

adding in-context Page Actions menu using Foundations dropdown button

Garrick van Buren 12 年之前
父节点
当前提交
891a08d994
共有 4 个文件被更改,包括 14 次插入8 次删除
  1. 4 1
      assets/scripts/foreground.js
  2. 2 0
      assets/stylesheets/foreground.css
  3. 1 0
      foreground.php
  4. 7 7
      foreground.skin.php

+ 4 - 1
assets/scripts/foreground.js

@@ -1,5 +1,8 @@
 jQuery(document).ready(function() {
 jQuery(document).ready(function() {
-  jQuery(document).foundation();
+  jQuery(document).foundation(function (response) {
+    console.log(response.errors);
+  });
+
   // Split the namespace title into a title and a label
   // Split the namespace title into a title and a label
   var $title = jQuery("h2.title:contains(':')").not(":contains('\"')").not(":contains('as of')").text().split(":");
   var $title = jQuery("h2.title:contains(':')").not(":contains('\"')").not(":contains('as of')").text().split(":");
   jQuery("h2.title:contains(':')").not(":contains('\"')").not(":contains('as of')").html('<small class="label">' + $title[0] + '</small><span>' + $title[1] + '</span>');
   jQuery("h2.title:contains(':')").not(":contains('\"')").not(":contains('as of')").html('<small class="label">' + $title[0] + '</small><span>' + $title[1] + '</span>');

+ 2 - 0
assets/stylesheets/foreground.css

@@ -11,6 +11,8 @@ a.label:focus {
   color: white;
   color: white;
 }
 }
 
 
+a.button.dropdown { float:right;}
+
 td.mw-submit a,
 td.mw-submit a,
 .htmlform-tip,
 .htmlform-tip,
 #mw-upload-permitted p {
 #mw-upload-permitted p {

+ 1 - 0
foreground.php

@@ -41,6 +41,7 @@ $wgResourceModules['skins.foreground'] = array(
         'Foreground/assets/scripts/vendor/custom.modernizr.js',
         'Foreground/assets/scripts/vendor/custom.modernizr.js',
         'Foreground/assets/scripts/foundation/foundation.js',
         'Foreground/assets/scripts/foundation/foundation.js',
         'Foreground/assets/scripts/foundation/foundation.topbar.js',
         'Foreground/assets/scripts/foundation/foundation.topbar.js',
+        'Foreground/assets/scripts/foundation/foundation.dropdown.js',
         'Foreground/assets/scripts/foundation/foundation.section.js',
         'Foreground/assets/scripts/foundation/foundation.section.js',
         'Foreground/assets/scripts/foundation/foundation.clearing.js',
         'Foreground/assets/scripts/foundation/foundation.clearing.js',
         'Foreground/assets/scripts/foundation/foundation.cookie.js',
         'Foreground/assets/scripts/foundation/foundation.cookie.js',

+ 7 - 7
foreground.skin.php

@@ -100,6 +100,13 @@ class ForegroundTemplate extends BaseTemplate {
 
 
 		<div class="row">
 		<div class="row">
 				<div class="large-12 columns">
 				<div class="large-12 columns">
+					<?php if ($wgUser->isLoggedIn()): ?>
+						<a href="#" data-dropdown="drop1" class="button dropdown small secondary radius">This Page</a>
+						<ul id="drop1" class="views large-12 columns f-dropdown">
+							<?php foreach( $this->data['content_actions'] as $key => $item ) { echo $this->makeListItem($key, $item); } ?>
+							<?php wfRunHooks( SkinTemplateToolboxEnd, array( &$this, true ) );  ?>
+						</ul>
+					<?php endif; ?>
 					<h2 class="title"><?php $this->html('title') ?></h2>
 					<h2 class="title"><?php $this->html('title') ?></h2>
 					<h5 class="subtitle"><?php $this->html('subtitle') ?></h5>
 					<h5 class="subtitle"><?php $this->html('subtitle') ?></h5>
 					<?php $this->html('bodytext') ?>
 					<?php $this->html('bodytext') ?>
@@ -110,13 +117,6 @@ class ForegroundTemplate extends BaseTemplate {
 
 
 		<footer class="row">
 		<footer class="row">
 
 
-		<?php if ($wgUser->isLoggedIn()): ?>
-		<ul class="views large-12 columns">
-			<?php foreach( $this->data['content_actions'] as $key => $item ) { echo $this->makeListItem($key, $item); } ?>
-			<?php wfRunHooks( SkinTemplateToolboxEnd, array( &$this, true ) );  ?>
-		</ul>
-		<?php endif; ?>
-
 		<ul class="large-12 columns">
 		<ul class="large-12 columns">
 		<?php foreach ( $this->getFooterLinks( "flat" ) as $key ) { ?>
 		<?php foreach ( $this->getFooterLinks( "flat" ) as $key ) { ?>
 		        <li><?php $this->html( $key ) ?></li>
 		        <li><?php $this->html( $key ) ?></li>