r87264 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r87263‎ | r87264 | r87265 >
Date:17:44, 2 May 2011
Author:preilly
Status:ok
Tags:
Comment:
Convert spaces to tabs
Modified paths:
  • /trunk/extensions/PatchOutputMobile/PatchOutputMobile.php (modified) (history)

Diff [purge]

Index: trunk/extensions/PatchOutputMobile/PatchOutputMobile.php
@@ -2,8 +2,8 @@
33
44 # Needs to be called within MediaWiki; not standalone
55 if ( !defined('MEDIAWIKI') ) {
6 - echo("This is an extension to the MediaWiki package and cannot be run standalone.\n" );
7 - die(-1);
 6+ echo("This is an extension to the MediaWiki package and cannot be run standalone.\n" );
 7+ die(-1);
88 }
99
1010 # Define the extension; allows us make sure the extension is used correctly
@@ -20,40 +20,40 @@
2121 $wgExtPatchOutputMobile = new ExtPatchOutputMobile();
2222
2323 $wgHooks['OutputPageBeforeHTML'][] = array(&$wgExtPatchOutputMobile,
24 - 'onOutputPageBeforeHTML');
 24+ 'onOutputPageBeforeHTML');
2525
2626 class ExtPatchOutputMobile {
2727 const VERSION = '0.2';
2828
2929 private $doc;
3030
31 - public $items_to_remove = array("#contentSub", #redirection notice
32 - "div.messagebox", #cleanup data
33 - "#siteNotice", #site notice
34 - "#siteSub", #"From Wikipedia..."
35 - "#jump-to-nav", #jump-to-nav
36 - "div.editsection", #edit blocks
37 - "div.infobox", # Infoboxes in the article
38 - "table.toc", #table of contents
39 - "#catlinks", #category links
40 - "div.stub", #stub warnings
41 - "table.metadata", #ugly metadata
42 - "form",
43 - "div.sister-project",
44 - "script",
45 - "div.magnify", #stupid magnify thing
46 - ".editsection",
47 - "span.t",
48 - 'sup[style*="help"]',
49 - ".portal",
50 - "#protected-icon",
51 - ".printfooter",
52 - ".boilerplate",
53 - "#id-articulo-destacado",
54 - "#coordinates",
55 - "#top",
56 - ".hiddenStructure",
57 - ".noprint",
 31+ public $items_to_remove = array("#contentSub", #redirection notice
 32+ "div.messagebox", #cleanup data
 33+ "#siteNotice", #site notice
 34+ "#siteSub", #"From Wikipedia..."
 35+ "#jump-to-nav", #jump-to-nav
 36+ "div.editsection", #edit blocks
 37+ "div.infobox", # Infoboxes in the article
 38+ "table.toc", #table of contents
 39+ "#catlinks", #category links
 40+ "div.stub", #stub warnings
 41+ "table.metadata", #ugly metadata
 42+ "form",
 43+ "div.sister-project",
 44+ "script",
 45+ "div.magnify", #stupid magnify thing
 46+ ".editsection",
 47+ "span.t",
 48+ 'sup[style*="help"]',
 49+ ".portal",
 50+ "#protected-icon",
 51+ ".printfooter",
 52+ ".boilerplate",
 53+ "#id-articulo-destacado",
 54+ "#coordinates",
 55+ "#top",
 56+ ".hiddenStructure",
 57+ ".noprint",
5858 ".medialist",
5959 ".mw-search-createlink");
6060
@@ -65,14 +65,14 @@
6666 private function _show_hide_callback($matches) {
6767 static $headings = 0;
6868 $show = "Show";
69 - $hide = "Hide";
70 - $back_to_top = "Jump Back A Section";
 69+ $hide = "Hide";
 70+ $back_to_top = "Jump Back A Section";
7171 ++$headings;
7272 // Back to top link
73 - $base = "<div class='section_anchors' id='anchor_" . intval($headings - 1) . "'><a href='#section_" . intval($headings - 1) . "' class='back_to_top'>&uarr; {$back_to_top}</a></div>";
74 - // generate the HTML we are going to inject
75 - $buttons = "<button class='section_heading show' section_id='{$headings}'>{$show}</button><button class='section_heading hide' section_id='{$headings}'>{$hide}</button>";
76 - $base .= "<h2 class='section_heading' id='section_{$headings}'{$matches[1]}{$buttons} <span>{$matches[2]}</span></h2><div class='content_block' id='content_{$headings}'>";
 73+ $base = "<div class='section_anchors' id='anchor_" . intval($headings - 1) . "'><a href='#section_" . intval($headings - 1) . "' class='back_to_top'>&uarr; {$back_to_top}</a></div>";
 74+ // generate the HTML we are going to inject
 75+ $buttons = "<button class='section_heading show' section_id='{$headings}'>{$show}</button><button class='section_heading hide' section_id='{$headings}'>{$hide}</button>";
 76+ $base .= "<h2 class='section_heading' id='section_{$headings}'{$matches[1]}{$buttons} <span>{$matches[2]}</span></h2><div class='content_block' id='content_{$headings}'>";
7777
7878 if ($headings > 1) {
7979 // Close it up here
@@ -98,7 +98,7 @@
9999
100100 public function parse($s) {
101101 // foreach(self::$mTable as $from => $to) {
102 - // $s =& str_replace( $from, $to, $s );
 102+ // $s =& str_replace( $from, $to, $s );
103103 // }
104104
105105 return $this->DOMParse($s);

Status & tagging log