r82776 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r82775‎ | r82776 | r82777 >
Date:01:16, 25 February 2011
Author:janpaul123
Status:deferred (Comments)
Tags:
Comment:
Small fixes, i18n. Also fixes bug 27390.
Modified paths:
  • /trunk/extensions/InlineEditor/InlineEditor.i18n.php (modified) (history)
  • /trunk/extensions/InlineEditor/jquery.inlineEditor.editors.basic.js (modified) (history)
  • /trunk/extensions/InlineEditor/jquery.inlineEditor.js (modified) (history)

Diff [purge]

Index: trunk/extensions/InlineEditor/InlineEditor.i18n.php
@@ -28,6 +28,8 @@
2929 'inline-editor-editmodes-undo' => 'Undo',
3030 'inline-editor-editmodes-redo' => 'Redo',
3131 'inline-editor-enable-preference' => 'Enable inline editing',
 32+ 'inline-editor-preview' => 'Preview',
 33+ 'inline-editor-cancel' => 'Cancel',
3234 );
3335
3436 /** Language descriptions
@@ -62,4 +64,6 @@
6365 unambiguous: it will be shown to the world. On the other hand, using the word "Publish" may have legal
6466 consequences in some countries, which should be looked into.',
6567 'inline-editor-enable-preference' => '',
 68+ 'inline-editor-preview' => '',
 69+ 'inline-editor-cancel' => '',
6670 );
Index: trunk/extensions/InlineEditor/jquery.inlineEditor.editors.basic.js
@@ -35,9 +35,12 @@
3636 $input.text( wiki );
3737
3838 // build preview and cancel buttons and add click events
39 - var $preview = $( '<input type="button" value="Preview" class="preview"/>' );
40 - var $cancel = $( '<input type="button" value="Cancel" class="cancel"/>' );
 39+ var $preview = $( '<input type="button" class="preview"/>' );
 40+ $preview.attr( 'value', mediaWiki.msg( 'inline-editor-preview' ) );
4141 $preview.click( $.inlineEditor.editors.basic.clickPreview );
 42+
 43+ var $cancel = $( '<input type="button" class="cancel"/>' );
 44+ $cancel.attr( 'value', mediaWiki.msg( 'inline-editor-cancel' ) );
4245 $cancel.click( $.inlineEditor.editors.basic.clickCancel );
4346
4447 // build a div for the buttons
@@ -156,7 +159,7 @@
157160 * Reload the editor.
158161 */
159162 reload: function() {
160 - $.inlineEditor.editors.basic.bindEvents( $( '.inlineEditorElement .inlineEditorBasic' ) );
 163+ $.inlineEditor.editors.basic.bindEvents( $( '.inlineEditorBasic' ) );
161164 },
162165
163166 /**
Index: trunk/extensions/InlineEditor/jquery.inlineEditor.js
@@ -151,12 +151,9 @@
152152 },
153153
154154 /**
155 - * Publishes the document in its current state.
 155+ * Submit event, adds the json to the hidden field
156156 */
157 - publish: function( event ) {
158 - event.stopPropagation();
159 - event.preventDefault();
160 -
 157+ submit: function( event ) {
161158 // get the wikitext from the state as it's currently on the screen
162159 var data = {
163160 'object': $.inlineEditor.states[$.inlineEditor.currentState].object
@@ -165,6 +162,12 @@
166163
167164 // set and send the form
168165 $( '#json' ).val( json );
 166+ },
 167+
 168+ /**
 169+ * Publishes the document
 170+ */
 171+ publish: function() {
169172 $( '#editForm' ).submit();
170173 },
171174
@@ -172,6 +175,7 @@
173176 * Initializes the editor.
174177 */
175178 init : function() {
 179+ $( '#editForm' ).submit( $.inlineEditor.submit );
176180 $( '#publish' ).click( $.inlineEditor.publish );
177181 //$( '#undo' ).click( $.inlineEditor.undo );
178182 //$( '#redo' ).click( $.inlineEditor.redo );

Follow-up revisions

RevisionCommit summaryAuthorDate
r82789Per r82776: Add extension to Translatewiki....raymond11:28, 25 February 2011

Comments

#Comment by Raymond (talk | contribs)   08:50, 25 February 2011

Could you give me a ping pls when this extension is ready to be added to Translatewiki for localization?

#Comment by JanPaul123 (talk | contribs)   11:06, 25 February 2011

Absolutely! :)

Status & tagging log