r63379 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r63378‎ | r63379 | r63380 >
Date:01:16, 8 March 2010
Author:jeroendedauw
Status:ok
Tags:
Comment:
Added docs & minor js fix
Modified paths:
  • /trunk/extensions/Storyboard/tags/Storysubmission/Storysubmission_body.php (modified) (history)
  • /trunk/extensions/Storyboard/tags/Storysubmission/storysubmission.js (modified) (history)

Diff [purge]

Index: trunk/extensions/Storyboard/tags/Storysubmission/Storysubmission_body.php
@@ -18,8 +18,6 @@
1919
2020 class TagStorysubmission {
2121
22 - // http://www.mediawiki.org/wiki/Manual:Forms
23 - // http://www.mediawiki.org/wiki/Manual:Hooks/UnknownAction
2422 public static function render( $input, $args, $parser, $frame ) {
2523 wfProfileIn( __METHOD__ );
2624
@@ -36,7 +34,14 @@
3735 wfProfileOut( __METHOD__ );
3836 }
3937
40 - private static function getFrom( $parser, $args ) {
 38+ /**
 39+ * Returns the HTML for a storysubmission form.
 40+ *
 41+ * @param $parser
 42+ * @param array $args
 43+ * @return HTML
 44+ */
 45+ private static function getFrom( $parser, array $args ) {
4146 global $wgOut, $wgUser, $wgJsMimeType, $wgSc, $egStoryboardScriptPath, $egStorysubmissionWidth, $egStoryboardMaxStoryLen, $egStoryboardMinStoryLen;
4247
4348 $wgOut->addStyle( $egStoryboardScriptPath . '/tags/Storysubmission/storysubmission.css' );
@@ -48,7 +53,7 @@
4954 $maxLen = array_key_exists('maxlength', $args) && is_numeric($args['maxlength']) ? $args['maxlength'] : $egStoryboardMaxStoryLen;
5055 $minLen = array_key_exists('minlength', $args) && is_numeric($args['minlength']) ? $args['minlength'] : $egStoryboardMinStoryLen;
5156
52 - $submissionUrl = $parser->getTitle()->getLocalURL( 'action=purge' ); // TODO: fix parameters
 57+ $submissionUrl = $parser->getTitle()->getLocalURL( 'action=purge' );
5358
5459 $formBody = "<table width='$width'>";
5560
@@ -87,7 +92,6 @@
8893 'id' => 'story',
8994 'rows' => 7,
9095 'onkeyup' => "stbValidateStory( this, $minLen, $maxLen, 'storysubmission-charlimitinfo', 'storysubmission-button' )",
91 - // TODO: make disabled when JS is enabled
9296 ),
9397 null
9498 ) .
@@ -131,7 +135,8 @@
132136 private static function doSubmissionAndGetResult() {
133137 global $wgRequest, $wgUser;
134138
135 -
 139+ $dbw = wfGetDB( DB_MASTER );
 140+ $dbw->insert( 'storyboard' ); // TODO
136141 }
137142
138143 }
\ No newline at end of file
Index: trunk/extensions/Storyboard/tags/Storysubmission/storysubmission.js
@@ -16,7 +16,7 @@
1717 var info = document.getElementById( infodiv );
1818
1919 if(textlength > upperLimit) {
20 - info.innerHTML = ( upperLimit - textlength ) + ' characters to many!'; // TODO: i18n
 20+ info.innerHTML = -( upperLimit - textlength ) + ' characters to many!'; // TODO: i18n
2121 return false;
2222 } else if (textlength < lowerLimit) {
2323 info.innerHTML = '('+ ( lowerLimit - textlength ) + ' more characters needed)'; // TODO: i18n

Status & tagging log