question overview: Where/How could I add new javascript files into wiki? I would like to add dynamic functions as a part of the header which will be static on all pages.
details: I have gone in and changed the content under skins/. "Sidebar" now exist as a horizontal navigation bar. What I would like to do is to include a set of javascript funcions and call it from Monobook.php (I have just edited the default Monobook.php file) when outputing the items.
I have tried it on a separte test php file where it echos: "<script type='text/javascript' src='menu.js'>" It works fine on this test run. When added to Monobook.php, it stops working.
I have also tried to delete all content form Monobook.php to nothing but just the javascript include and hard-code definition of the sidebar items & its dropdown menu (pretty much the same as the test run php file from above) but the javascript capability is still lost. I have checked paths of these files and am sure that it works outside of wiki...
Any inputs would be greatly appreciated!
Thank you
On 10/24/06, Liz Kim lizkim270@gmail.com wrote:
question overview: Where/How could I add new javascript files into wiki? I would like to add dynamic functions as a part of the header which will be static on all pages.
details: I have gone in and changed the content under skins/. "Sidebar" now exist as a horizontal navigation bar. What I would like to do is to include a set of javascript funcions and call it from Monobook.php (I have just edited the default Monobook.php file) when outputing the items.
I have tried it on a separte test php file where it echos: "<script type='text/javascript' src='menu.js'>" It works fine on this test run. When added to Monobook.php, it stops working.
I have also tried to delete all content form Monobook.php to nothing but just the javascript include and hard-code definition of the sidebar items & its dropdown menu (pretty much the same as the test run php file from above) but the javascript capability is still lost. I have checked paths of these files and am sure that it works outside of wiki...
Any inputs would be greatly appreciated!
Thank you _______________________________________________ Wikitech-l mailing list Wikitech-l@wikimedia.org http://mail.wikipedia.org/mailman/listinfo/wikitech-l
Just modify the page MediaWiki:Monobook.js in-wiki.
I am bit confused.. I have enabled wgAllowUserJs Still does not work.. any example of simple js working with this? Thank you..
On 10/24/06, Simetrical Simetrical+wikitech@gmail.com wrote:
On 10/24/06, Liz Kim lizkim270@gmail.com wrote:
question overview: Where/How could I add new javascript files into wiki? I would like to add dynamic functions as a part of the header which will
be
static on all pages.
details: I have gone in and changed the content under skins/. "Sidebar" now exist as a horizontal navigation bar. What I would like to do is to include a set of javascript funcions and
call
it from Monobook.php (I have just edited the default Monobook.php file) when outputing the
items.
I have tried it on a separte test php file where it echos: "<script type='text/javascript' src='menu.js'>" It works fine on this test run. When added to Monobook.php, it stops working.
I have also tried to delete all content form Monobook.php to nothing but just the javascript include and hard-code definition of the sidebar
items &
its dropdown menu (pretty much the same as the test run php file from above) but the javascript capability is still lost. I have checked paths of these files and am sure that it works
outside
of wiki...
Any inputs would be greatly appreciated!
Thank you _______________________________________________ Wikitech-l mailing list Wikitech-l@wikimedia.org http://mail.wikipedia.org/mailman/listinfo/wikitech-l
Just modify the page MediaWiki:Monobook.js in-wiki. _______________________________________________ Wikitech-l mailing list Wikitech-l@wikimedia.org http://mail.wikipedia.org/mailman/listinfo/wikitech-l
On 10/24/06, Liz Kim lizkim270@gmail.com wrote:
I am bit confused.. I have enabled wgAllowUserJs Still does not work.. any example of simple js working with this? Thank you..
See http://en.wikipedia.org/wiki/MediaWiki:Monobook.js for an example of use. $wgUseSiteJs needs to be true, but it appears to be enabled by default, so that should work. I believe this feature was added in 1.5; if you aren't at least at that version, it would probably be a good idea to upgrade.
On 10/25/06, Simetrical Simetrical+wikitech@gmail.com wrote:
On 10/24/06, Liz Kim lizkim270@gmail.com wrote:
question overview: Where/How could I add new javascript files into wiki? I would like to add dynamic functions as a part of the header which will be static on all pages.
details: I have gone in and changed the content under skins/. "Sidebar" now exist as a horizontal navigation bar. What I would like to do is to include a set of javascript funcions and call it from Monobook.php (I have just edited the default Monobook.php file) when outputing the items.
I have tried it on a separte test php file where it echos: "<script type='text/javascript' src='menu.js'>" It works fine on this test run. When added to Monobook.php, it stops working.
I have also tried to delete all content form Monobook.php to nothing but just the javascript include and hard-code definition of the sidebar items & its dropdown menu (pretty much the same as the test run php file from above) but the javascript capability is still lost. I have checked paths of these files and am sure that it works outside of wiki...
Any inputs would be greatly appreciated!
Thank you _______________________________________________ Wikitech-l mailing list Wikitech-l@wikimedia.org http://mail.wikipedia.org/mailman/listinfo/wikitech-l
Just modify the page MediaWiki:Monobook.js in-wiki.
Keep in mind that there is one Monobook.js per interface language. So if you have users using any language besides the default one they will not have access to your JS unless you put the same functions in every version of Monobook.js that is being used.
The other pages are accessed in this way (Spanish and German examples given):
MediaWiki:Monobook.js/es MediaWiki:Monobook.js/de
Andrew Dunbar (hippietrail)
Wikitech-l mailing list Wikitech-l@wikimedia.org http://mail.wikipedia.org/mailman/listinfo/wikitech-l
On 10/25/06, Andrew Dunbar hippytrail@gmail.com wrote:
Keep in mind that there is one Monobook.js per interface language. So if you have users using any language besides the default one they will not have access to your JS unless you put the same functions in every version of Monobook.js that is being used.
I'm fairly sure this is no longer true: Monobook.js is called via wfMsgForContent, and so uses the content language and not the user-selected language.
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
Simetrical wrote:
On 10/25/06, Andrew Dunbar hippytrail@gmail.com wrote:
Keep in mind that there is one Monobook.js per interface language. So if you have users using any language besides the default one they will not have access to your JS unless you put the same functions in every version of Monobook.js that is being used.
I'm fairly sure this is no longer true: Monobook.js is called via wfMsgForContent, and so uses the content language and not the user-selected language.
Checking in enwiki with "uselang=fr", I indeed get the regular MediaWiki:Monobook.js, although "MediaWiki:Monobook.js/fr" is not exist.
wikitech-l@lists.wikimedia.org