r107951 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r107950‎ | r107951 | r107952 >
Date:22:24, 3 January 2012
Author:mah
Status:ok (Comments)
Tags:
Comment:
Bug 29236 - Extension:Collection should copy the book title automatically to the stored "book page" input field
Author: John N

I took time to adapt John's patch to jQuery awesomeness and learned
something about our js infrastructure in the process.
Modified paths:
  • /trunk/extensions/Collection/js/collection.js (modified) (history)

Diff [purge]

Index: trunk/extensions/Collection/js/collection.js
@@ -220,8 +220,10 @@
221221 toggle_order_info(false);
222222 update_buttons();
223223 make_sortable();
 224+ $('#personalCollTitle').val($('#titleInput').val());
224225 $('#personalCollTitle').keyup(update_buttons);
225226 $('#personalCollTitle').change(update_buttons);
 227+ $('#communityCollTitle').val($('#titleInput').val());
226228 $('#communityCollTitle').keyup(update_buttons);
227229 $('#communityCollTitle').change(update_buttons);
228230 $('#personalCollType').change(update_buttons);

Sign-offs

UserFlagDate
Nikerabbitinspected15:02, 11 January 2012

Comments

#Comment by Krinkle (talk | contribs)   23:56, 23 January 2012

<input id="personalCollTitle" (..)/> and <input id="titleInput" (..)/> are both outputted by PHP. Since this is running only once on document ready, it'd make sense to change Collection.templates.php instead to output the initial value in both of them, instead of syncing them from JS after the page is loaded.

Status & tagging log