r95127 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r95126‎ | r95127 | r95128 >
Date:10:25, 21 August 2011
Author:maxsem
Status:ok
Tags:
Comment:
Follow-up r95112, r95124 and friends:
* Cleaned up per CR comments
* Introduced a define for extension's version, added it to credits
* Changed date format in generated file
Modified paths:
  • /trunk/extensions/wikihiero/SpecialHieroglyphs.php (modified) (history)
  • /trunk/extensions/wikihiero/generateTables.php (modified) (history)
  • /trunk/extensions/wikihiero/modules/ext.wikihiero.Special.js (modified) (history)
  • /trunk/extensions/wikihiero/wh_list.php (modified) (history)
  • /trunk/extensions/wikihiero/wikihiero.body.php (modified) (history)
  • /trunk/extensions/wikihiero/wikihiero.php (modified) (history)

Diff [purge]

Index: trunk/extensions/wikihiero/wh_list.php
@@ -1,7 +1,7 @@
22 <?php
33
4 -// File created by generateTables.php version 0.3.0alpha
5 -// 2011/08/20 at 09:31
 4+// File created by generateTables.php version 1.0alpha
 5+// 2011-08-21 at 12:00
66
77 $wh_prefabs = array(
88 "a&A1",
Index: trunk/extensions/wikihiero/wikihiero.php
@@ -1,29 +1,28 @@
22 <?php
33
4 -//////////////////////////////////////////////////////////////////////////
5 -//
6 -// WikiHiero - A PHP convert from text using "Manual for the encoding of
7 -// hieroglyphic texts for computer input" syntax to HTML entities (table and
8 -// images).
9 -//
10 -// Copyright (C) 2004 Guillaume Blanchard (Aoineko)
11 -//
12 -// This program is free software; you can redistribute it and/or
13 -// modify it under the terms of the GNU General Public License
14 -// as published by the Free Software Foundation; either version 2
15 -// of the License, or any later version.
16 -//
17 -// This program is distributed in the hope that it will be useful,
18 -// but WITHOUT ANY WARRANTY; without even the implied warranty of
19 -// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 -// GNU General Public License for more details.
21 -//
22 -// You should have received a copy of the GNU General Public License
23 -// along with this program; if not, write to the Free Software
24 -// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
25 -//
26 -//////////////////////////////////////////////////////////////////////////
 4+/**
 5+ * WikiHiero - adds Ancient Egyptian hieroglyphs support to MediaWiki
 6+ *
 7+ * Copyright (C) 2004 Guillaume Blanchard (Aoineko)
 8+ *
 9+ * This program is free software; you can redistribute it and/or modify
 10+ * it under the terms of the GNU General Public License as published by
 11+ * the Free Software Foundation; either version 2 of the License, or
 12+ * (at your option) any later version.
 13+ *
 14+ * This program is distributed in the hope that it will be useful,
 15+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
 16+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 17+ * GNU General Public License for more details.
 18+ *
 19+ * You should have received a copy of the GNU General Public License along
 20+ * with this program; if not, write to the Free Software Foundation, Inc.,
 21+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
 22+ * http://www.gnu.org/copyleft/gpl.html
 23+ */
2724
 25+define( 'WIKIHIERO_VERSION', '1.0alpha' );
 26+
2827 $wgHooks['ParserFirstCallInit'][] = 'wfRegisterWikiHiero';
2928 $wgHooks['BeforePageDisplay'][] = 'wfHieroBeforePageDisplay';
3029
@@ -31,6 +30,7 @@
3231 $wgExtensionCredits['parserhook'][] = array(
3332 'path' => __FILE__,
3433 'name' => 'WikiHiero',
 34+ 'version' => WIKIHIERO_VERSION,
3535 'author' => array( 'Guillaume Blanchard', 'Max Semenik' ),
3636 'url' => 'http://www.mediawiki.org/wiki/Extension:WikiHiero',
3737 'descriptionmsg' => 'wikihiero-desc',
Index: trunk/extensions/wikihiero/SpecialHieroglyphs.php
@@ -47,7 +47,7 @@
4848 Html::openElement( 'form',
4949 array(
5050 'method' => 'get',
51 - 'action' => SpecialPage::getTitleFor( 'Hieroglyphs' )->getLinkUrl(),
 51+ 'action' => $this->getTitle()->getLinkUrl(),
5252 )
5353 )
5454 . Html::element( 'textarea', array( 'id' => 'hiero-text', 'name' => 'text' ), $text )
Index: trunk/extensions/wikihiero/modules/ext.wikihiero.Special.js
@@ -23,7 +23,7 @@
2424 'text': '<hiero>' + text + '</hiero>',
2525 'disablepp': ''
2626 };
27 - $.getJSON( mw.config.get( 'wgServer' ) + mw.config.get( 'wgScriptPath' ) + '/api' + mw.config.get( 'wgScriptExtension' ),
 27+ $.getJSON( mw.config.get( 'wgScriptPath' ) + '/api' + mw.config.get( 'wgScriptExtension' ),
2828 data,
2929 function( data ) {
3030 var html = '<table class="wikitable">'
Index: trunk/extensions/wikihiero/generateTables.php
@@ -70,8 +70,8 @@
7171
7272 $file = fopen( 'wh_list.php', 'w+' );
7373 fwrite( $file, "<?php\n\n" );
74 - fwrite( $file, '// File created by generateTables.php version ' . WikiHiero::VERSION . "\n" );
75 - fwrite( $file, '// ' . date( 'Y/m/d \a\t H:i' ) . "\n\n" );
 74+ fwrite( $file, '// File created by generateTables.php version ' . WIKIHIERO_VERSION . "\n" );
 75+ fwrite( $file, '// ' . date( 'Y-m-d \a\t H:i' ) . "\n\n" );
7676 fwrite( $file, "$wh_prefabs\n\n$wh_files\n\n{$this->moreTables}\n" );
7777 fclose( $file );
7878 }
Index: trunk/extensions/wikihiero/wikihiero.body.php
@@ -61,7 +61,6 @@
6262 define( "WH_DEBUG_MODE", false );
6363
6464 class WikiHiero {
65 - const VERSION = '0.3.0alpha';
6665 const IMG_EXT = 'png';
6766
6867 private $scale = 100;

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r95068WikiHiero: moved all tables out of extension body, comment style fixesmaxsem07:31, 20 August 2011
r95112WikiHiero: created a special page to play with markup. Exactly what index.php...maxsem20:40, 20 August 2011
r95124fu r95112: Add version no., add Max as author for the rewrite...raymond08:56, 21 August 2011

Status & tagging log