Index: trunk/extensions/Storyboard/tags/Storysubmission/Storysubmission_body.php |
— | — | @@ -18,8 +18,6 @@ |
19 | 19 | |
20 | 20 | class TagStorysubmission { |
21 | 21 | |
22 | | - // http://www.mediawiki.org/wiki/Manual:Forms |
23 | | - // http://www.mediawiki.org/wiki/Manual:Hooks/UnknownAction |
24 | 22 | public static function render( $input, $args, $parser, $frame ) { |
25 | 23 | wfProfileIn( __METHOD__ ); |
26 | 24 | |
— | — | @@ -36,7 +34,14 @@ |
37 | 35 | wfProfileOut( __METHOD__ ); |
38 | 36 | } |
39 | 37 | |
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 ) { |
41 | 46 | global $wgOut, $wgUser, $wgJsMimeType, $wgSc, $egStoryboardScriptPath, $egStorysubmissionWidth, $egStoryboardMaxStoryLen, $egStoryboardMinStoryLen; |
42 | 47 | |
43 | 48 | $wgOut->addStyle( $egStoryboardScriptPath . '/tags/Storysubmission/storysubmission.css' ); |
— | — | @@ -48,7 +53,7 @@ |
49 | 54 | $maxLen = array_key_exists('maxlength', $args) && is_numeric($args['maxlength']) ? $args['maxlength'] : $egStoryboardMaxStoryLen; |
50 | 55 | $minLen = array_key_exists('minlength', $args) && is_numeric($args['minlength']) ? $args['minlength'] : $egStoryboardMinStoryLen; |
51 | 56 | |
52 | | - $submissionUrl = $parser->getTitle()->getLocalURL( 'action=purge' ); // TODO: fix parameters |
| 57 | + $submissionUrl = $parser->getTitle()->getLocalURL( 'action=purge' ); |
53 | 58 | |
54 | 59 | $formBody = "<table width='$width'>"; |
55 | 60 | |
— | — | @@ -87,7 +92,6 @@ |
88 | 93 | 'id' => 'story', |
89 | 94 | 'rows' => 7, |
90 | 95 | 'onkeyup' => "stbValidateStory( this, $minLen, $maxLen, 'storysubmission-charlimitinfo', 'storysubmission-button' )", |
91 | | - // TODO: make disabled when JS is enabled |
92 | 96 | ), |
93 | 97 | null |
94 | 98 | ) . |
— | — | @@ -131,7 +135,8 @@ |
132 | 136 | private static function doSubmissionAndGetResult() { |
133 | 137 | global $wgRequest, $wgUser; |
134 | 138 | |
135 | | - |
| 139 | + $dbw = wfGetDB( DB_MASTER ); |
| 140 | + $dbw->insert( 'storyboard' ); // TODO |
136 | 141 | } |
137 | 142 | |
138 | 143 | } |
\ No newline at end of file |
Index: trunk/extensions/Storyboard/tags/Storysubmission/storysubmission.js |
— | — | @@ -16,7 +16,7 @@ |
17 | 17 | var info = document.getElementById( infodiv ); |
18 | 18 | |
19 | 19 | if(textlength > upperLimit) { |
20 | | - info.innerHTML = ( upperLimit - textlength ) + ' characters to many!'; // TODO: i18n |
| 20 | + info.innerHTML = -( upperLimit - textlength ) + ' characters to many!'; // TODO: i18n |
21 | 21 | return false; |
22 | 22 | } else if (textlength < lowerLimit) { |
23 | 23 | info.innerHTML = '('+ ( lowerLimit - textlength ) + ' more characters needed)'; // TODO: i18n |