r61965 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r61964‎ | r61965 | r61966 >
Date:00:42, 4 February 2010
Author:nimishg
Status:deferred
Tags:
Comment:
removed console.log; now keeps dialog consistent with what's on screen
Modified paths:
  • /trunk/extensions/UsabilityInitiative/js/plugins/jquery.wikiEditor.templateEditor.js (modified) (history)

Diff [purge]

Index: trunk/extensions/UsabilityInitiative/js/plugins/jquery.wikiEditor.templateEditor.js
@@ -183,8 +183,10 @@
184184
185185
186186 function createDialog( $templateDiv ){
187 - var templateModel = $templateDiv.data('model');
188 - console.log(templateModel.getText());
 187+ var $wikitext = $templateDiv.children('.wikiEditor-template-text');
 188+ //TODO: check if template model has been changed
 189+ var templateModel = new $.wikiEditor.modules.templateEditor.fn.model( $wikitext.text() );
 190+ $templateDiv.data('model', templateModel);
189191 var $dialog = $("<div></div>");
190192 var $title = $("<div>" + templateModel.getName() + "</div>").addClass('wikiEditor-template-dialog-title');
191193 var $table = $("<table></table>")
@@ -213,6 +215,9 @@
214216 $('.wikiEditor-template-dialog-value input').each( function(){
215217 templateModel.setValue( $(this).data('name'), $(this).val() );
216218 });
 219+ //keep text consistent
 220+ $wikitext.text( templateModel.getText() );
 221+
217222 $dialog.dialog('close');
218223
219224 }).text("OK").appendTo($dialog);

Status & tagging log