Coder Social home page Coder Social logo

jthingelstad / foreground Goto Github PK

View Code? Open in Web Editor NEW
137.0 14.0 60.0 3.1 MB

A MediaWiki skin that focuses on putting your content in the foreground.

Home Page: http://foreground.wikiproject.net/

License: Other

JavaScript 1.27% CSS 79.11% PHP 19.62%
mediawiki-skin

foreground's Introduction

MediaWiki Foreground Skin

MediaWiki skin that focuses on putting your content in the foreground. Supports responsive layouts and has classes predefined for Semantic MediaWiki. Built on the Zurb Foundation CSS framework.

CircleCI Scrutinizer Code Quality

Download

First, copy the Foreground source files into your MediaWiki skins directory (see skinning for general information on MediaWiki skins). You can either download the files and extract them from:

https://github.com/thingles/foreground/archive/develop.zip

You should extract that into a folder named foreground in your skins directory.

Alternatively, you can use git to clone the repository, which makes it very easy to update the code, using:

git clone https://github.com/thingles/foreground.git

After that, you can issue git pull to update the code at anytime.

Setup

Once the skin is in place add one the following lines to your LocalSettings.php file.

wfLoadSkin( 'foreground' );

This will activate Foreground in your installation. At this point you can select it as a user skin in your user preferences.

To activate Foreground for all users and anonymous visitors, you need to set the $wgDefaultSkin variable and set it to foreground.

$wgDefaultSkin = "foreground";

Configuration

Use following features in LocalSettings.php to change the behavior.

  • showActionsForAnon => true displays page actions for non-logged-in visitors.
  • NavWrapperType => 'divonly': only a div with id navwrapper will be created. '0' - no div will be created (old behavior), other values will be used as class.
  • showHelpUnderTools => true a Link to "Help" will be created under "Tools".
  • showRecentChangesUnderTools => true a Link to "recent changes" will be created under "Tools".
  • 'enableTabs' => true for tabs on page support.
  • wikiName => 'Alternate WikiName' sets top navbar name to a different output of the wiki's name. Useful if your $wgSitename is long but need to keep it for other purposes.
  • navbarIcon => true to display an icon in the top navbar. See below for more information.
  • IeEdgeCode => 1 will produce a meta tag with "X-UA-Compatible" content="IE=edge", 2 will sent a header, 0 nothing will be done
  • showFooterIcons => false suppresses the output of footer icons. Set to true or 1 to display them.
  • addThisPUBID => '' empty string will not fire the AddThis script, 'ra-##-#######' publisher ID will allow the run the AddThis script in async on content pages only.
  • useAddThisShare => '' default empty string, do not use AddThis share, your_addthis_specific_div_class_string will insert the share toolbox div directly under page title, but before the tagline with your custom div class.
  • useAddThisFollow => '' default empty string, do not use AddThis follow, your_addthis_specific_div_class_string will insert the follow toolbox div in the footer area before icon or text output with your custom div class.

These are the default values:

$wgForegroundFeatures = array(      
  'showActionsForAnon' => true,
  'NavWrapperType' => 'divonly',
  'showHelpUnderTools' => true,
  'showRecentChangesUnderTools' => true,
  'enableTabs' => false,
  'wikiName' => &$GLOBALS['wgSitename'],
  'navbarIcon' => false,
  'IeEdgeCode' => 1,
  'showFooterIcons' => false,
  'addThisPUBID' => '',
  'useAddThisShare' => '',
  'useAddThisFollow' => ''
);

Usage of NavWrapperType

With a setting like:

'NavWrapperType' => 'divonly'

and the created div called navwrapper anonymous visitors can change the setting of navbar (fixed or sticky) by User-Script (Firefox-extensions like greasemonkey or scriptish), users can take a gadget or their JavaScript, CSS ... :

$('#navwrapper').addClass('sticky');

Or you set class in LocalSettings.php with:

'NavWrapperType' => 'contain-to-grid fixed'

and visitors will be able to remove this class by their own JavaScript or gadget ...

Navbar Icon

With a setting like:

'navbarIcon' => true

A top navbar icon will be set using the current image set by $wgLogo in LocalSettings.php. See https://www.mediawiki.org/wiki/Manual:$wgLogo for more information about $wgLogo.

The icon will be resized to fit into a maximum width of 64px x 36px wide or a 16:9 ratio.

Show Help under Tools

This will add the help link under tools. To control what the help link will link to use the message page, MediaWiki:Helppage to set the link target. The link target can be a local page, Help:Contents, or an external URL, https://www.mediawiki.org/wiki/Help:Contents.

AddThis Buttons

With a setting like:

'addThisFollowPUBID' => 'yourAddThis-PubID'

Important, this feature uses the free or paid version of the https://addthis.com horizontal Follow Buttons only. Choose which social media FollowUs buttons(Twitter, Facebook, YouTube, etc.) and at the bottom of the screen locate the script. Within the script you will see something similar ...#pubid=ra-5378f4902d02197">. Everything after the = sign and up to the "> is your Publisher ID. To turn on social follow icons, insert your publisher id:

'addThisFollowPUBID' => 'ra-5378f4902d02197'

Notes on other skins

As you build a wiki out with Foreground you will likely use the responsive grid from Foundation. This is key to making a responsive wiki, and is one of the largest migration requirements when you want to move a wiki that ppreviously used Vector (and likely a lot of tables for layout) to Foreground. Once you do this, the ability of a user to select whatever skin will be removed. If you take full advantage of Foreground in your templates the lack of the Foundation grid will make viewing the wiki using Vector or MonoBook very difficult.

Because of this, it is suggested that you set the $wgSkipSkins variable to make sure that everyone sees the site as you intended it. This removes other skins from being user selectable options.

# Foreground is specific, so lets disable other skins
$wgSkipSkins = array( 'cologneblue', 'modern', 'monobook', 'vector' );

You may also want to allow users to set a User CSS if they want to tweak things inside of Foreground. This is entirely optional.

# Allow User CSS, mostly for skin testing
$wgAllowUserCss = true;

Using Foreground

There is a mailing list to discuss Foreground. Please join to connect with others and explore questions about using Foreground on your wiki. You can see a list of wikis with Foreground installed at WikiApiary.

foreground's People

Contributors

alnaimi avatar ardiman avatar bramsvs avatar fw25 avatar garrickvanburen avatar haydenbbickerton avatar hexmode avatar hutchy68 avatar jthingelstad avatar kghbln avatar paladox avatar rififia avatar robo-fish avatar samwilson avatar translatewiki avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

foreground's Issues

alignment of page actions

I'm guessing that since these are all "characters" this may be hard, but it would be nice if the words were aligned left to each other on the page actions menu.

screenshot

Feature? Don't scroll top bar

I think it would be interesting to have a configuration settings in LocalSettings.php that would tell Foreground to not scroll the top bar, leaving it in a fixed position. That may be impossible to do given how MediaWiki renders the page, but it could be a pretty nice feature.

Dropdowns colliding

I'm not sure what the right behavior is here. When the actions drop down is down, the top-bar drodown is below and cannot be used.

bug

As long as actions is persistent with a click, I would suggest the top bar should get higher z-order precedence and should be on top.

Drop down menu does not work if it overlaps the page title

In case the expanded menu overlaps the page title it is not possible to select a menu item. In fact it disappears as soon as you move the mouse down to the desired item. Try this with the menu item "navigation" which in almost all cases overlaps the page title, however this applies to all items. This happens only in the main namespace as far as I see.

Watch notification popup covers action menu

When you watch/unwatch a page there is a slick popup div but it covers the action menu. Can we move this popup to another location. Bottom right of the window would be my preference.

Capitalise file and skin name

For general consistency with MediaWiki behaviour I suggest to capitalise the file names and the skin name, e.g. foreground.php -> Foreground.php

Unclosed <div> ?

I'm trying to debug something in a template so I took the full HTML output from Foreground and pasted it in Sublime Text. Sublime was kind enough to point out that on line 78 there is an unclosed div.

            <ul class="right">
              <li class="has-form">
                <form action="/w/index.php" id="searchform" class="mw-search">
                    <div class="row collapse">
                    <div class="small-8 columns">
                            <input type="search" name="search" title="Search WikiApiary [f]" accesskey="f" placeholder="Search..." id="searchInput" />                          </div>
                         <div class="small-4 columns">

the "row collapse" one. May or may not be an issue, but deserves investigating.

Add topic in actions on talk pages

When on a talk page the drop down has a + in it

screenshot

I don't know why it's a plus, but that "action" is actually the "Add topic" action. In vector, it shows as another tab:

screenshot

Hopefully we can turn that into "Add topic" in Foreground as well.

Moving the seach field to the far right

The more I think about it the more I believe that the search field should be at the far right of the top bar.

The personal menue and the tools menue should be left of it and aligned right as opposed to wiki specific menus.

Currently both menus (personal and tools) expand over the action menu below. This does not look nice and causes confusion if this one is expanded too.

JS error in console

Seeing this error when loading page:

load.php:57TypeError: 'undefined' is not a function (evaluating 'jQuery('h2:not(:contains("""))').jQuery('h2:contains(":")')')

Indicator for status of associated Talk page

Right now there is no way to tell if there is an active talk page associated with any given page in Foreground.

I think it would be interesting to use the Talk "balloons" that are in the drop down and show them to the left of the page actions drop down. Dim if there is no talk page, full if there is.

One could argue that some wikis may like it this way. Perhaps this could be a configurable option.

Support 1-click Patrol

In MediaWiki 1.21 the patrol function got this really cool AJAX 1-click feature. It makes patrolling a lot faster. For some reason Foreground either isn't supporting it, or is not doing something that is needed that Vector is doing to make this work.

IE8 incompatibilities

Turns out, Foundation 4 wasn't built to support IE8 (definitely explains the dramatic layout differences in IE8.)

http://foundation.zurb.com/docs/support.html

ZURB (the makers of Foundation) justify that decision by saying that as of Oct 2012, IE8 held 24% of browser marketshare

http://zurb.com/article/1204/getting-foundation-and-ie8-to-play-nice

The workaround they recommend in the above article is to load the previous version of the Foundation framework (both CSS & Javascript) using IE conditional comments.

I found a gist purporting to add IE8 CSS support
https://gist.github.com/zurbchris/5068210

I've added it and many of the other suggestions from the comment thread into Foreground. It seems to help - but there's still significantly more to do.

All of this is to say - that the top-bar menu should now be functioning in IE8. It likely doesn't look pretty - but the links should now be visible upon clicking.

Make drop down menue for page actions expandable on hover

I think the drop menu for page actions should expand right on hover rather than having to click on it once to expand it. The current behaviour is also inconsistent to the main menu bar. I think the difference between page selection (main menu bar) and action triggering (action menu) is not big enough to justify a difference.

Input fields and dropdown boxes vary in size

If you have a look at forms you will see that the size of direct input fields and drop down fields vary in size. The following code helped solving the issue.

input[type="file"], input[type="checkbox"], input[type="radio"], select {
padding: 5px;
}

(typical) CSS to hide page titles doesn't work

There is a well used trick to selectively hide page titles on some wiki pages using CSS, like this:

/* hide some things */
body.page-Main_Page h1.firstHeading,
body.page-Main_Page #siteSub,
body.page-Extension_Main_Page h1.firstHeading,
body.page-Extension_Main_Page #siteSub,
body.page-Skin_Main_Page h1.firstHeading,
body.page-Skin_Main_Page #siteSub,
body.page-Farm_Main_Pageh1.firstHeading,
body.page-Farm_Main_Page #siteSub {
display:none;
}

http://wikiapiary.com/wiki/MediaWiki:Common.css

Right now in foreground these don't hide anything.

Add class for non-existent categories

If a category is assigned to a page but doens't exist the HTML looks like

<a href="/w/index.php?title=Category:Club_shows&action=edit&redlink=1" class="new label" title="Category:Club shows (page does not exist)">Club shows</a>

the "new" class indicates that the category doesn't exist. can we style this differently from categories that do exist?

Semantic Forms class large-3 for fields doesn't work

According to Foundation docs form elements should be able to have a class="large-3" and honor that for their width. I tried doing this with Forms

{{{field|Name|class=large-3}}}

and the output is there but it has no effect.

Page action icons

OMG love the new icons in the page actions. Note the non-default ones also.

screenshot

#autoedit buttons on a page don't work

If you try to use an {{#autoedit:}} button on a page there is no action from clicking on the button. Just sits there. I'm guessing this is the same issue that is keeping #12 from working.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.