r66482 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r66481‎ | r66482 | r66483 >
Date:17:45, 15 May 2010
Author:devunt
Status:reverted (Comments)
Tags:
Comment:
essage=Commit New Files
Modified paths:
  • /trunk/extensions/WebIRC/WebIRC.alias.php (added) (history)
  • /trunk/extensions/WebIRC/WebIRC.i18n.php (added) (history)
  • /trunk/extensions/WebIRC/WebIRC.php (added) (history)
  • /trunk/extensions/WebIRC/WebIRC_body.php (added) (history)

Diff [purge]

Index: trunk/extensions/WebIRC/WebIRC.i18n.php
@@ -0,0 +1,32 @@
 2+<?php
 3+/**
 4+ * WebIRC
 5+ *
 6+ * make a web irc client in to a special page
 7+ *
 8+ * @link http://www.mediawiki.org/wiki/Extension:WebIRC
 9+ *
 10+ * @author Devunt <devunt@devunt.kr>
 11+ * @authorlink http://www.mediawiki.org/wiki/User:Devunt
 12+ * @copyright Copyright © 2010 Devunt (Bae June Hyeon).
 13+ * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License 2.0 or later
 14+ */
 15+$messages = array();
 16+
 17+/** English
 18+ */
 19+$messages['en'] = array(
 20+ 'webirc' => 'Web IRC',
 21+ 'webirc-desc' => 'Add [[Special:WebIRC|Special page]] to do [[IRC]] on the web',
 22+ 'right-webirc' => 'Use web IRC',
 23+);
 24+
 25+/** Korean (한국어)
 26+ * @author Devunt
 27+ * @author Kwj2772
 28+ */
 29+$messages['ko'] = array(
 30+ 'webirc' => '웹 IRC',
 31+ 'webirc-desc' => '웹에서 [[IRC]]를 할 수 있는 [[Special:WebIRC|특수문서]]를 추가합니다.',
 32+ 'right-webirc' => '웹 IRC를 사용하기',
 33+);
Property changes on: trunk/extensions/WebIRC/WebIRC.i18n.php
___________________________________________________________________
Name: svn:eol-style
134 + native
Index: trunk/extensions/WebIRC/WebIRC.php
@@ -0,0 +1,36 @@
 2+<?php
 3+/**
 4+ * WebIRC
 5+ *
 6+ * make a web irc client in to a special page
 7+ *
 8+ * @link http://www.mediawiki.org/wiki/Extension:WebIRC
 9+ *
 10+ * @author Devunt <devunt@devunt.kr>
 11+ * @authorlink http://www.mediawiki.org/wiki/User:Devunt
 12+ * @copyright Copyright © 2010 Devunt (Bae June Hyeon).
 13+ * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License 2.0 or later
 14+ */
 15+
 16+// If this is run directly from the web die as this is not a valid entry point.
 17+if ( !defined( 'MEDIAWIKI' ) ) die('define error!');
 18+
 19+// Extension credits.
 20+$wgExtensionCredits[ 'specialpage' ][] = array(
 21+ 'name' => 'WebIRC',
 22+ 'author' => 'Devunt (Bae June Hyeon)',
 23+ 'url' => 'http://www.mediawiki.org/wiki/Extension:WebIRC',
 24+ 'description' => 'webirc-desc',
 25+ 'descriptionmsg' => 'webirc-desc',
 26+ 'version' => '0.7.1',
 27+);
 28+
 29+$dir = dirname( __FILE__ ) . '/';
 30+
 31+$wgSpecialPages['WebIRC'] = 'WebIRC';
 32+$wgSpecialPageGroups['WebIRC'] = 'wiki';
 33+$wgAutoloadClasses['WebIRC'] = $dir.'WebIRC_body.php';
 34+$wgExtensionMessagesFiles['WebIRC'] = $dir.'WebIRC.i18n.php';
 35+$wgExtensionAliasesFiles['WebIRC'] = $dir.'WebIRC.alias.php';
 36+
 37+$wgAvailableRights[] = 'webirc';
Property changes on: trunk/extensions/WebIRC/WebIRC.php
___________________________________________________________________
Name: svn:eol-style
138 + native
Index: trunk/extensions/WebIRC/WebIRC.alias.php
@@ -0,0 +1,23 @@
 2+<?php
 3+/**
 4+ * WebIRC
 5+ *
 6+ * make a web irc client in to a special page
 7+ *
 8+ * @link http://www.mediawiki.org/wiki/Extension:WebIRC
 9+ *
 10+ * @author Devunt <devunt@devunt.kr>
 11+ * @authorlink http://www.mediawiki.org/wiki/User:Devunt
 12+ * @copyright Copyright © 2010 Devunt (Bae June Hyeon).
 13+ * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License 2.0 or later
 14+ */
 15+$aliases = array();
 16+
 17+/** English */
 18+$aliases['en'] = array(
 19+ 'WebIRC' => array( 'WebIRC', 'IRC' ),
 20+);
 21+
 22+$messages['ko'] = array(
 23+ 'WebIRC' => array( 'WebIRC', 'IRC' ),
 24+);
Property changes on: trunk/extensions/WebIRC/WebIRC.alias.php
___________________________________________________________________
Name: svn:eol-style
125 + native
Index: trunk/extensions/WebIRC/WebIRC_body.php
@@ -0,0 +1,58 @@
 2+<?php
 3+/**
 4+ * WebIRC
 5+ *
 6+ * make a web irc client in to a special page
 7+ *
 8+ * @link http://www.mediawiki.org/wiki/Extension:WebIRC
 9+ *
 10+ * @author Devunt <devunt@devunt.kr>
 11+ * @authorlink http://www.mediawiki.org/wiki/User:Devunt
 12+ * @copyright Copyright © 2010 Devunt (Bae June Hyeon).
 13+ * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License 2.0 or later
 14+ */
 15+class WebIRC extends SpecialPage {
 16+
 17+ function __construct() {
 18+ SpecialPage::SpecialPage( 'WebIRC', 'webirc' );
 19+ }
 20+
 21+ function execute( $par ) {
 22+ global $wgOut, $wgUser, $wgIRCServer, $wgIRCChannel, $wgIRCSettings;
 23+ wfLoadExtensionMessages( 'WebIRC' );
 24+ $this->setHeaders();
 25+
 26+ if( !$this->userCanExecute( $wgUser ) ){
 27+ $this->displayRestrictionError();
 28+ return;
 29+ }
 30+
 31+ $wgIRCServer = urlencode( strstr($wgIRCServer, "irc://") ? substr($wgIRCServer, 6) : $wgIRCServer );
 32+ $wgIRCChannel = urlencode( strstr($wgIRCChannel, "#") ? $wgIRCChannel : "#".$wgIRCChannel );
 33+ $wgIRCSettings = urlencode( $wgIRCSettings );
 34+
 35+ $username = strtolower($wgUser->mName);
 36+ $webirc_url = "";
 37+ $serverport = explode(':', $wgIRCServer);
 38+ if (strstr($serverport[0], "freenode.org"))
 39+ $webirc_url =
 40+ "http://webchat.freenode.net/?".
 41+ "channels=$wgIRCChannel&".
 42+ "nick=$username";
 43+ else
 44+ $webirc_url =
 45+ "http://widget.mibbit.com/?".
 46+ "server=$wgIRCServer&".
 47+ "channel=$wgIRCChannel&".
 48+ "settings=$wgIRCSettings&".
 49+ "showmotd=0&".
 50+ "nick=$username";
 51+ $wgOut->addHTML( Xml::openElement( 'iframe', array(
 52+ 'width' => '100%',
 53+ 'height' => '500px',
 54+ 'scrolling' => 'no',
 55+ 'style' => 'border:solid black 1px',
 56+ 'src' => $webirc_url,
 57+ ) ) . Xml::closeElement( 'iframe' ) );
 58+ }
 59+}
Property changes on: trunk/extensions/WebIRC/WebIRC_body.php
___________________________________________________________________
Name: svn:eol-style
160 + native

Follow-up revisions

RevisionCommit summaryAuthorDate
r68118Drop WebIRC extension. Per fixmes on r66482, this is duplicating functionalit...demon12:49, 16 June 2010

Comments

#Comment by *devunt (talk | contribs)   18:00, 15 May 2010

new extension

#Comment by Siebrand (talk | contribs)   18:22, 15 May 2010

Is it me or is the basically a copy of the functionality implemented by Extension:WebChat? If so, can we please maintain one extension for one functionality instead of 2?

#Comment by *devunt (talk | contribs)   18:28, 15 May 2010

I consult Extension:WebChat's body script, but not copy.

#Comment by Siebrand (talk | contribs)   18:36, 15 May 2010

That's not my point. I was asking what made it necessary to create a second interface to Freenode's web chat as a MediaWiki extension, instead of improving the current one.

#Comment by 😂 (talk | contribs)   18:17, 8 June 2010

Unless the committer weighs in on this again, I'd like to drop the duplicate extension from SVN.

Status & tagging log