http://www.mediawiki.org/wiki/Special:Code/MediaWiki/82776
Revision: 82776 Author: janpaul123 Date: 2011-02-25 01:16:57 +0000 (Fri, 25 Feb 2011) Log Message: ----------- Small fixes, i18n. Also fixes bug 27390. Modified Paths: -------------- trunk/extensions/InlineEditor/InlineEditor.i18n.php trunk/extensions/InlineEditor/jquery.inlineEditor.editors.basic.js trunk/extensions/InlineEditor/jquery.inlineEditor.js Modified: trunk/extensions/InlineEditor/InlineEditor.i18n.php =================================================================== --- trunk/extensions/InlineEditor/InlineEditor.i18n.php 2011-02-25 01:11:09 UTC (rev 82775) +++ trunk/extensions/InlineEditor/InlineEditor.i18n.php 2011-02-25 01:16:57 UTC (rev 82776) @@ -28,6 +28,8 @@ 'inline-editor-editmodes-undo' => 'Undo', 'inline-editor-editmodes-redo' => 'Redo', 'inline-editor-enable-preference' => 'Enable inline editing', + 'inline-editor-preview' => 'Preview', + 'inline-editor-cancel' => 'Cancel', ); /** Language descriptions @@ -62,4 +64,6 @@ unambiguous: it will be shown to the world. On the other hand, using the word "Publish" may have legal consequences in some countries, which should be looked into.', 'inline-editor-enable-preference' => '', + 'inline-editor-preview' => '', + 'inline-editor-cancel' => '', ); Modified: trunk/extensions/InlineEditor/jquery.inlineEditor.editors.basic.js =================================================================== --- trunk/extensions/InlineEditor/jquery.inlineEditor.editors.basic.js 2011-02-25 01:11:09 UTC (rev 82775) +++ trunk/extensions/InlineEditor/jquery.inlineEditor.editors.basic.js 2011-02-25 01:16:57 UTC (rev 82776) @@ -35,9 +35,12 @@ $input.text( wiki ); // build preview and cancel buttons and add click events - var $preview = $( '<input type="button" value="Preview" class="preview"/>' ); - var $cancel = $( '<input type="button" value="Cancel" class="cancel"/>' ); + var $preview = $( '<input type="button" class="preview"/>' ); + $preview.attr( 'value', mediaWiki.msg( 'inline-editor-preview' ) ); $preview.click( $.inlineEditor.editors.basic.clickPreview ); + + var $cancel = $( '<input type="button" class="cancel"/>' ); + $cancel.attr( 'value', mediaWiki.msg( 'inline-editor-cancel' ) ); $cancel.click( $.inlineEditor.editors.basic.clickCancel ); // build a div for the buttons @@ -156,7 +159,7 @@ * Reload the editor. */ reload: function() { - $.inlineEditor.editors.basic.bindEvents( $( '.inlineEditorElement .inlineEditorBasic' ) ); + $.inlineEditor.editors.basic.bindEvents( $( '.inlineEditorBasic' ) ); }, /** Modified: trunk/extensions/InlineEditor/jquery.inlineEditor.js =================================================================== --- trunk/extensions/InlineEditor/jquery.inlineEditor.js 2011-02-25 01:11:09 UTC (rev 82775) +++ trunk/extensions/InlineEditor/jquery.inlineEditor.js 2011-02-25 01:16:57 UTC (rev 82776) @@ -151,12 +151,9 @@ }, /** - * Publishes the document in its current state. + * Submit event, adds the json to the hidden field */ - publish: function( event ) { - event.stopPropagation(); - event.preventDefault(); - + submit: function( event ) { // get the wikitext from the state as it's currently on the screen var data = { 'object': $.inlineEditor.states[$.inlineEditor.currentState].object @@ -165,6 +162,12 @@ // set and send the form $( '#json' ).val( json ); + }, + + /** + * Publishes the document + */ + publish: function() { $( '#editForm' ).submit(); }, @@ -172,6 +175,7 @@ * Initializes the editor. */ init : function() { + $( '#editForm' ).submit( $.inlineEditor.submit ); $( '#publish' ).click( $.inlineEditor.publish ); //$( '#undo' ).click( $.inlineEditor.undo ); //$( '#redo' ).click( $.inlineEditor.redo ); _______________________________________________ MediaWiki-CVS mailing list MediaWiki-CVS@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs