Extension talk:Gadgets

From MediaWiki.org
Jump to: navigation, search
Note:
Recently, old discussions from here have been archived to here, in favor of the new threading system.
Start a new discussion

Contents

Thread titleRepliesLast modified
Cannot use gadgets1111:37, 11 March 2012
New feature404:26, 23 February 2012
User Preferences don't offer Gadgets715:48, 8 February 2012

Cannot use gadgets

Hi, this is admin in Commerce Network Nightly Builds. I have a problem in setting gadgets. The problem is this: As I found that I the gadget extension is installed, then I went to Special: gadgets and edit "Uses:". After that, I ticked my check box in the preference page. There is no gadgets appeared, could someone please tell me how to fix it? -Shinghinyeung (talk) 12:17, 8 March 2012 (UTC)

Shinghinyeung (talk)12:46, 8 March 2012

You have to have the Javascript already prewritten and called in MediaWiki:Gadgets-definition.

Jasper Deng (talk)22:13, 8 March 2012

So what does this means?

I mean how to called in the page MediaWiki:Gadgets-definition.

Shinghinyeung (talk)09:20, 9 March 2012

Maybe one of the gadgets you enabled is broken? Have you tried enabling only one at a time?

Try disabling all gadgets, and creating a small gadget containing only something like

alert('It works!');

to see if you can make it to display a message.

Helder16:57, 9 March 2012

I have tried it does not work.

Shinghinyeung (talk)03:39, 11 March 2012
 

In actual fact, I have no idea of how to build a gadget even I read the Extension: Gadget#usage section, could someone tell me how to enable a gadget. This is what I think I have missed out. -Shinghinyeung (talk) 03:24, 11 March 2012 (UTC)

Shinghinyeung (talk)03:24, 11 March 2012

I think I have declared the gadget, so I will try what Helder told me, please ignore the upper one.

Shinghinyeung (talk)03:36, 11 March 2012

I have tried both Helder and Jasper's method and it still does not work. The gadgets are all come from the Mediwiki.org and I have no idea what to do at the moment.

Shinghinyeung (talk)03:52, 11 March 2012
 
 
 
 
 

New feature

Edited by 2 users.
Last edit: 19:21, 20 February 2012

Is it possible to add option that we can set some of the gadgets only for IP and not confirmed and when they will registered it will dis-activated.

Reza1615 (talk)17:17, 20 February 2012

For anons: make them standard JS and check for javascript globals in the DOM (above body).

Subfader (talk)00:01, 21 February 2012

close, but this won't create the desired effect exactly - what the OP asked for would allow for registered users to "opt-in", while your solution does not. however, this is the closest i can think of with a single script.

alternatively, you could play a little variation on the above: call the gadget directly from common.js under the condition "mw.user.anonymous()", and make the gadget non-default.

קיפודנחש (talk)07:08, 21 February 2012

He wants it active for anons and inactive for loggedin users = no gadget.

Subfader (talk)10:11, 21 February 2012
 
 

I'd recommend do making it as a gadget to allow optimized loading of it as well as internalization. Simply make it a normal gadget that doesn't have [default] but does have [ResourceLoader]. And from MediaWiki:Common.js (as קיפודנחש suggested), call mw.loader.load('gadget.YOUR_GADGET_ID') under a conditional:

mw.loader.using('medawiki.user', function() {
    if (mw.user.anonymous()) {
        mw.loader.load('gadget.YOUR_GADGET_ID');
    }
});
Krinkle (talk)04:26, 23 February 2012
 

User Preferences don't offer Gadgets

I installed a local wiki via MoWeS including MW 1.18.0 at 2011-11-28. Then I added several extensions incl. Gadgets. All requirements for Extension:Gadgets should be fulfilled: LocalSettings has require_once. MediaWiki:Gadgets-definition is defined:

*Pfeil-hoch|Pfeil-hoch.js

[[MediaWiki:Gadget-Pfeil-hoch.js]] and [[MediaWiki:Gadget-Pfeil-hoch]] are imported. But this gadget is not yet accepted:

What do I miss? Are gadgets preserved for the WMF version of MW? If so, which files must be fixed? Do I need a configuration setting? What else? Thanks for help! Juergen

Juetho16:24, 5 January 2012

Can you provide a link to your wiki for us to look at ? In the mean time, confirm via Special:Version that your extension is actually being recognized properly.

Krinkle02:17, 6 January 2012

Unfortunately, it's a local wiki like I wrote. Special:Version shows Gadgets in the section Others.

I could search by myself if I could read the current installation and configuration of de-Wikibooks. But I don't know how to check LocalSettings.php and all the files in the includes folder like SpecialPage, SpecialPageFactory, and so on if there are relevant differences between WB and my own configuration.

Juetho08:03, 6 January 2012
 

Just adding that line to your MediaWiki:Gadgets-definition should already make it appear on Special:Gadgets and Special:Preferences, regardless of any configuration or importing of the actual JavaScript/CSS resources.

If that isn't working there are likely other, bigger, issues.

Are any other gadgets working ? Anything in your error log ?

Krinkle20:10, 7 January 2012

In the meantime, I checked some options. (The MW configuration script tells that options aren't necessary, but they are very useful.) Nevertheless, nothing helps.

MediaWiki:Gadgets-definition contains the line above, and this line only. I reduced the definition site to a simple gadget for testing.

The error log tells this:

(20024)The given path is misformatted or contained invalid characters: Cannot map GET /wiki/index.php/MediaWiki:Gadgets HTTP/1.1 to file, referer: http://localhost/wiki/index.php/MediaWiki:Gadgets-definition

Moreover, I found differences in Special:Preferences:

  • Generally (like in my local wiki), there are 8 tabs: beginning with User profile and ending with Misc
  • WMF projects add: Pending changes, Gadgets
  • MediaWiki adds: Edit review, Gadgets, Threaded discussion, Contests

There must be a reason for the differences between WMF and MW. I suppose the same reason would lead to my problem's solution.

Juetho14:48, 26 January 2012

I don't understand anything anymore. After creating a new wiki including this gadget, there was no tab gadgets. After I switched on ShowExceptionDetails, the gadgets tab was shown. I wonder...

Juetho14:58, 26 January 2012

... and wonder on and on. It seems to work properly - also using other gadgets like wikEd.

The only exceptionDetail is "Zeitüberschreitung" (time overflow or so). But that's another problem because the local wiki works very slowly.

I would appreciate if you could give more hints. I want to write advices how to install a local wiki using MoWeS (see in my first post).

Juetho16:05, 26 January 2012
 
 
 

Maybe this is being caused by bugzilla:29794?

Try to open "MediaWiki:Gadgets-definition" for editing and paste the following line in your browser's address bar:

javascript:$('#wpTextbox1').val( $('#wpTextbox1').val().split(String.fromCharCode(8206)).join() ); void 0;

and then check if this makes any changes (like some of these).

Helder15:48, 8 February 2012
 
Personal tools
Namespaces

Variants
Actions
Navigation
Support
Download
Development
Communication
Print/export
Toolbox