Skip to content
This repository has been archived by the owner on Apr 12, 2019. It is now read-only.

Commit

Permalink
Version bump, revert PHP files back to their previous states, remove …
Browse files Browse the repository at this point in the history
…unecessary headers from CSS and JS.
  • Loading branch information
Alexia committed Apr 29, 2015
1 parent efb3e6d commit d533633
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 54 deletions.
35 changes: 19 additions & 16 deletions Tabber.hooks.php
Original file line number Diff line number Diff line change
@@ -1,52 +1,54 @@
<?php
/**
* Tabber Hooks
* Tabber
* Tabber Hooks Class
*
* @author Eric Fortin, Alexia E. Smith, Kris Blair
* @author Eric Fortin, Alexia E. Smith
* @license GPL
* @package Tabber
* @link https://www.mediawiki.org/wiki/Extension:Tabber
*/
*
**/

class TabberHooks {
/**
* Sets up this extension's parser functions
* Sets up this extension's parser functions.
*
* @access public
* @param object Parser object passed as a reference
* @return boolean True
* @param object Parser object passed as a reference.
* @return boolean true
*/
static public function onParserFirstCallInit(Parser &$parser) {
$parser->setHook('tabber', 'TabberHooks::renderTabber');
$parser->setHook("tabber", "TabberHooks::renderTabber");

return true;
}

/**
* Renders the necessary HTML for a <tabber> tag
* Renders the necessary HTML for a <tabber> tag.
*
* @access public
* @param string The input URL between the beginning and ending tags
* @param array Array of attribute arguments on that beginning tag
* @param string The input URL between the beginning and ending tags.
* @param array Array of attribute arguments on that beginning tag.
* @param object Mediawiki Parser Object
* @param object Mediawiki PPFrame Object
* @return string HTML
*/
static public function renderTabber($input, array $args, Parser $parser, PPFrame $frame) {
$parser->getOutput()->addModules('ext.Tabber');

$arr = explode('|-|', $input);
$arr = explode("|-|", $input);
foreach ($arr as $tab) {
$htmlTabs .= self::buildTab($tab, $parser);
}

$HTML = "<div class='tabber'>{$htmlTabs}</div>";
$HTML = '<div class="tabber">'.$htmlTabs."</div>";

return $HTML;
}

/**
* Build individual tab
* Build individual tab.
*
* @access private
* @param string Tab information
Expand All @@ -63,9 +65,10 @@ static private function buildTab($tab = '', Parser $parser) {
$tabName = array_shift($args);
$tabBody = $parser->recursiveTagParse(implode('=', $args));

$tab = "<div class='tabbertab' title='" . htmlspecialchars($tabName) . "'>
<p>{$tabBody}</p>
</div>";
$tab = '
<div class="tabbertab" title="'.htmlspecialchars($tabName).'">
<p>'.$tabBody.'</p>
</div>';

return $tab;
}
Expand Down
35 changes: 19 additions & 16 deletions Tabber.php
Original file line number Diff line number Diff line change
@@ -1,39 +1,42 @@
<?php
/**
* Tabber
* Tabber Main File
*
* @author Eric Fortin, Alexia E. Smith, Kris Blair
* @author Eric Fortin, Alexia E. Smith
* @license GPL
* @package Tabber
* @link https://www.mediawiki.org/wiki/Extension:Tabber
*/
*
**/

/*****************************************/
/* Credits */
/*****************************************/
/******************************************/
/* Credits */
/******************************************/
$credits = [
'path' => __FILE__,
'name' => 'Tabber',
'author' => ['Eric Fortin', 'Alexia E. Smith', 'Curse Inc. Wiki Platform Team', 'Kris Blair'],
'author' => ['Eric Fortin', 'Alexia E. Smith', 'Curse Inc. Wiki Platform Team'],
'url' => 'https://www.mediawiki.org/wiki/Extension:Tabber',
'descriptionmsg' => 'tabber-desc',
'version' => '2.1'
'version' => '2.2'
];
$wgExtensionCredits['parserhook'][] = $credits;

/*****************************************/
/* Language Strings, Page Aliases, Hooks */
/*****************************************/
$extDir = __DIR__ . '/';

$wgMessagesDirs['Tabber'] = "{$extDir}/i18n";
$wgExtensionMessagesFiles['Tabber'] = "{$extDir}/Tabber.i18n.php";
/******************************************/
/* Language Strings, Page Aliases, Hooks */
/******************************************/
$extDir = __DIR__.'/';

$wgMessagesDirs['Tabber'] = "{$extDir}/i18n";
$wgExtensionMessagesFiles['Tabber'] = "{$extDir}/Tabber.i18n.php";

$wgAutoloadClasses['TabberHooks'] = "{$extDir}/Tabber.hooks.php";
$wgAutoloadClasses['TabberHooks'] = "{$extDir}/Tabber.hooks.php";

$wgHooks['ParserFirstCallInit'][] = 'TabberHooks::onParserFirstCallInit';
$wgHooks['ParserFirstCallInit'][] = 'TabberHooks::onParserFirstCallInit';

$wgResourceModules['ext.Tabber'] = [
$wgResourceModules['ext.Tabber'] = [
'localBasePath' => __DIR__,
'remoteExtPath' => 'Tabber',
'styles' => ['css/tabber.css'],
Expand Down
12 changes: 0 additions & 12 deletions css/tabber.css
Original file line number Diff line number Diff line change
@@ -1,15 +1,3 @@
/*
* Tabber CSS
* Copied from http://www.barelyfitz.com/projects/tabber/example.css used under MIT license
*
* @author Eric Fortin, Alexia E. Smith, Kris Blair
* @license GPL
* @package Tabber
* @link https://www.mediawiki.org/wiki/Extension:Tabber
*
* @see http://www.barelyfitz.com/projects/tabber/
*/

ul.tabbernav {
margin: 0;
padding: 3px 0;
Expand Down
11 changes: 1 addition & 10 deletions js/tabber.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,4 @@
/**
* Tabber JS
*
* @author Alexia E. Smith, Kris Blair
* @license GPL
* @package Tabber
* @link https://www.mediawiki.org/wiki/Extension:Tabber
*/

(function($) {
(function($) {
$.fn.tabber = function() {
return this.each(function() {
// create tabs
Expand Down

0 comments on commit d533633

Please sign in to comment.