Last modified: 2012-12-12 02:08:09 UTC
Legacy globals: wgArticlePath in jquery.wikiEditor.dialogs.config.js wgExtensionAssetsPath in jquery.wikiEditor.iframe.js and jquery.wikiEditor.js wgPageName in jquery.wikiEditor.previewDialog.js and jquery.wikiEditor.toc.js wgScriptPath in jquery.wikiEditor.dialogs.config.js (twice) and jquery.wikiEditor.previewDialog.js wgServer in jquery.wikiEditor.dialogs.config.js wgTitle in jquery.wikiEditor.previewDialog.js wgUrlProtocols in jquery.wikiEditor.dialogs.config.js wgUserLanguage in jquery.wikiEditor.js (twice) $j in: ext.wikiEditor.preview.js ext.wikiEditor.publish.js jquery.wikiEditor.dialogs.js jquery.wikiEditor.js jquery.wikiEditor.previewDialog.js jquery.wikiEditor.publish.js Accidently global variables Firebug lists some variables in global scope which probably come from WikiEditor and are meant to be local: $group cell filter group heading option page row section tool type For-in-loops: Some for-in-loops (e. g. for ( filter in tool.filters ) in jquery.wikiEditor.toolbar.js) seem to run not over an object but over an array. Use the for (;;) form instead.
Krinkle, could you clean these up?
Sure, I'll check it out early next week (or this weekend). /me notes the following searches: " wg*" (catches most of 'em, due to our whitespace conventions) http://toolserver.org/~krinkle/wikimedia-svn-search/do-live.php?path=%2Ftrunk%2Fextensions%2FWikiEditor&recursive=on&searchphrase=+wg "*(wg" (function calls) http://toolserver.org/~krinkle/wikimedia-svn-search/do-live.php?path=%2Ftrunk%2Fextensions%2FWikiEditor&recursive=on&searchphrase=%28wg "=wg*" (assignments) http://toolserver.org/~krinkle/wikimedia-svn-search/do-live.php?path=%2Ftrunk%2Fextensions%2FWikiEditor&recursive=on&searchphrase=%3Dwg "['wg*" (array item) http://toolserver.org/~krinkle/wikimedia-svn-search/do-live.php?path=%2Ftrunk%2Fextensions%2FWikiEditor&recursive=on&searchphrase=%5B%27wg ".wg*" (object notation) http://toolserver.org/~krinkle/wikimedia-svn-search/do-live.php?path=%2Ftrunk%2Fextensions%2FWikiEditor&recursive=on&searchphrase=.wg
A good start was done in r89616.
Created attachment 8702 [details] Patch for wg.* -> mw.config.get I've added a patch to use mw.config.get for all global variables. This also uses mw.util.wikiScript( 'api' ) for the path to api.php.
I just missed one global variable: In WikiEditor/modules/jquery.wikiEditor.toolbar.config.js line 939 change stylepath to mw.config.get( 'stylepath' )
Applied by mah in r90845. @Michael: What're we at ? Can we mark this bug fixed ?
There is still the problem with the for-in-loops: Set something like Array.prototype.random = 'stuff'; in startup.js to break everything that can be broken and try to get ext.wikiEditor.tests.toolbar to work again.
Created attachment 8732 [details] Proposed patch I broke everything with Array.prototype.random = 'stuff'; and fixed it again, patch added. Please note the following: * Adding something to the prototype for Array broke jquery.client as well, I opened bug 29676 with a patch for this. * Some changes in jquery.wikiEditor.toolbar.js are unrelated to this, I added quotes for the [rel=] stuff, since this broke one test. Some other changes were done to satisfy JSHint. * The changes in jquery.wikiEditor.preview.js are definitly unrelated to this, but I didn't want to create a separate patch for just adding a 2 (otherwise the diff is shown to the whole text, even when editing only a section) and for exchanging the + with a , (which just didn't work, asking for api.php[object Object] certainly gives a 404 error). * I didn't care about jquery.highlight.js, if a parameter isn't documented one can't know if it's an array or a plain object.
Split up the patch myself. Committed in. r91342 r91343 r91347 r91349
*** Bug 31102 has been marked as a duplicate of this bug. ***