r111699 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r111698‎ | r111699 | r111700 >
Date:23:02, 16 February 2012
Author:reedy
Status:ok
Tags:
Comment:
Modified paths:
  • /branches/wmf/1.19wmf1 (modified) (history)
  • /branches/wmf/1.19wmf1/includes (modified) (history)
  • /branches/wmf/1.19wmf1/includes/resourceloader/ResourceLoaderUserOptionsModule.php (modified) (history)
  • /branches/wmf/1.19wmf1/includes/resourceloader/ResourceLoaderUserTokensModule.php (modified) (history)
  • /branches/wmf/1.19wmf1/resources/mediawiki/mediawiki.js (modified) (history)
  • /branches/wmf/1.19wmf1/resources/mediawiki/mediawiki.user.js (modified) (history)

Diff [purge]

Index: branches/wmf/1.19wmf1/includes/resourceloader/ResourceLoaderUserOptionsModule.php
@@ -85,11 +85,4 @@
8686 public function getGroup() {
8787 return 'private';
8888 }
89 -
90 - /**
91 - * @return array
92 - */
93 - public function getDependencies() {
94 - return array( 'mediawiki.user' );
95 - }
9689 }
Index: branches/wmf/1.19wmf1/includes/resourceloader/ResourceLoaderUserTokensModule.php
@@ -60,11 +60,4 @@
6161 public function getGroup() {
6262 return 'private';
6363 }
64 -
65 - /**
66 - * @return array
67 - */
68 - public function getDependencies() {
69 - return array( 'mediawiki.user' );
70 - }
7164 }
Property changes on: branches/wmf/1.19wmf1/includes
___________________________________________________________________
Modified: svn:mergeinfo
7265 Merged /trunk/phase3/includes:r111695,111697
Index: branches/wmf/1.19wmf1/resources/mediawiki/mediawiki.user.js
@@ -7,7 +7,7 @@
88 /**
99 * User object
1010 */
11 - function User() {
 11+ function User( options, tokens ) {
1212
1313 /* Private Members */
1414
@@ -15,9 +15,9 @@
1616
1717 /* Public Members */
1818
19 - this.options = new mw.Map();
 19+ this.options = options || new mw.Map();
2020
21 - this.tokens = new mw.Map();
 21+ this.tokens = tokens || new mw.Map();
2222
2323 /* Public Methods */
2424
@@ -176,6 +176,8 @@
177177 };
178178 }
179179
180 - mw.user = new User();
 180+ // Extend the skeleton mw.user from mediawiki.js
 181+ // This is kind of ugly but we're stuck with this for b/c reasons
 182+ mw.user = new User( mw.user.options, mw.user.tokens );
181183
182184 })(jQuery);
\ No newline at end of file
Index: branches/wmf/1.19wmf1/resources/mediawiki/mediawiki.js
@@ -648,17 +648,21 @@
649649
650650 done = true;
651651
652 - // Handle memory leak in IE
653 - script.onload = script.onreadystatechange = null;
654 -
655652 callback();
656653
657 - if ( script.parentNode ) {
658 - script.parentNode.removeChild( script );
659 - }
660 -
661 - // Dereference the script
662 - script = undefined;
 654+ // Handle memory leak in IE. This seems to fail in
 655+ // IE7 sometimes (Permission Denied error when
 656+ // accessing script.parentNode) so wrap it in
 657+ // a try catch.
 658+ try {
 659+ script.onload = script.onreadystatechange = null;
 660+ if ( script.parentNode ) {
 661+ script.parentNode.removeChild( script );
 662+ }
 663+
 664+ // Dereference the script
 665+ script = undefined;
 666+ } catch ( e ) { }
663667 }
664668 };
665669 }
@@ -1419,7 +1423,13 @@
14201424 return s;
14211425 }
14221426 };
1423 - })()
 1427+ }() ),
 1428+
 1429+ // Skeleton user object. mediawiki.user.js extends this
 1430+ user: {
 1431+ options: new Map(),
 1432+ tokens: new Map()
 1433+ }
14241434 };
14251435
14261436 })( jQuery );
Property changes on: branches/wmf/1.19wmf1
___________________________________________________________________
Modified: svn:mergeinfo
14271437 Merged /trunk/phase3:r111695,111697

Follow-up revisions

RevisionCommit summaryAuthorDate
r111700Fix merge artefact in r111699catrope23:05, 16 February 2012

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r111695Since I'm sick of all the mw.user-induced problems, break the dependency betw...catrope22:51, 16 February 2012
r111697Move the IE memory leak prevention voodoo together to after the callback, and...catrope22:56, 16 February 2012

Status & tagging log