Last modified: 2012-03-19 09:09:06 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T37115, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 35115 - Narayam core resource should load before other Wiki level editable JavaScripts
Narayam core resource should load before other Wiki level editable JavaScripts
Status: RESOLVED INVALID
Product: MediaWiki extensions
Classification: Unclassified
Narayam (Other open bugs)
unspecified
All All
: Unprioritized enhancement (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks: 34693
  Show dependency treegraph
 
Reported: 2012-03-10 06:47 UTC by Junaid
Modified: 2012-03-19 09:09 UTC (History)
7 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Junaid 2012-03-10 06:47:51 UTC
Currently ext.narayam.core loads after wiki level javascripts. So local customization/hacks are not possible.

Confirmed that Mediawiki:Common.js is loading before ext.narayam.core.
Comment 1 Niklas Laxström 2012-03-10 07:34:57 UTC
That's not how resource loader works. You need to specify you want to have something loaded before you start altering it.
Comment 2 Krinkle 2012-03-10 08:11:56 UTC
mw.loader.using('ext.narayam.core', function () {

  /* customization here */

});

the above will work anywhere anytime, including in Mediawiki:Common.js
Comment 3 Junaid 2012-03-10 15:15:35 UTC
Thanks Krinkle, it helped
Comment 4 Krinkle 2012-03-10 16:28:30 UTC
(In reply to comment #3)
> Thanks Krinkle, it helped

You're welcome. I found this (small) section on the Narayam extension documentation page:

https://www.mediawiki.org/wiki/Extension:Narayam#User_level_customization

Perhaps you can improve it based on the customizations you have've created.
Comment 5 Siddhartha Ghai 2012-03-17 05:54:37 UTC
(In reply to comment #2)
> mw.loader.using('ext.narayam.core', function () {
> 
>   /* customization here */
> 
> });
> 
> the above will work anywhere anytime, including in Mediawiki:Common.js

I tried various ways to make this work at http://sa.wikipedia.org/wiki/%E0%A4%AF%E0%A5%8B%E0%A4%9C%E0%A4%95%E0%A4%83:Siddhartha_Ghai/vector.js but couldn't get it to work. The unshift method as described at the documentation works when using the console but doesn't work as part of the userscript. Gives the error described at http://www.mediawiki.org/wiki/Extension_talk:Narayam#Formalization_of_rules

Hope a way to do this can be found soon.
Comment 6 Santhosh Thottingal 2012-03-19 09:09:06 UTC

(In reply to comment #5)
> I tried various ways to make this work at
> http://sa.wikipedia.org/wiki/%E0%A4%AF%E0%A5%8B%E0%A4%9C%E0%A4%95%E0%A4%83:Siddhartha_Ghai/vector.js
> but couldn't get it to work. 

I made it working and here is the code http://pastebin.com/defjdVU9 See the differences from your code.

Also updated the documentation at http://www.mediawiki.org/wiki/Extension:Narayam#User_level_customization

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links