Hi,
I am working on a phabricator task and I need to use OOjs UI/Windows/Message Dialogs ( https://www.mediawiki.org/wiki/OOjs_UI/Windows/Message_Dialogs) for a user warning.
But
TypeError: OO.ui.MessageDialog is not a constructor
error occurs when I use:
var messageDialog = new OO.ui.MessageDialog();TypeError: OO.ui.MessageDialog is not a constructor
What might be the problem?
Best Regards,
Shanika Ediriweera Undergraduate Dept. of Computer Science & Eng. University of Moratuwa
Hi,
I am working on a phabricator task and I need to use OOjs UI/Windows/Message Dialogs (https://www.mediawiki.org/ wiki/OOjs_UI/Windows/Message_Dialogs) for a user warning.
But
TypeError: OO.ui.MessageDialog is not a constructor
error occurs when I use:
var messageDialog = new OO.ui.MessageDialog();
What might be the problem?
Best Regards,
Shanika Ediriweera Undergraduate Dept. of Computer Science & Eng. University of Moratuwa
On 22 February 2017 at 08:02, Shanika Ediriweera shanika.13@cse.mrt.ac.lk wrote:
Hi,
I am working on a phabricator task and I need to use OOjs UI/Windows/Message Dialogs (https://www.mediawiki.org/ wiki/OOjs_UI/Windows/Message_Dialogs) for a user warning.
But
TypeError: OO.ui.MessageDialog is not a constructor
error occurs when I use:
var messageDialog = new OO.ui.MessageDialog();TypeError: OO.ui.MessageDialog is not a constructor
What might be the problem?
Best Regards,
Shanika Ediriweera Undergraduate Dept. of Computer Science & Eng. University of Moratuwa
Looks like you're not loading the OOjs UI code you're trying to use. Assuming that you're writing this as part of MediaWiki (or an extension), you need to add a dependency on the 'oojs-ui' ResourceLoader module.
Yes. I am working on a special page in the mediawiki core.
Could you please tell me where is the resource loader modue located?
Best Regards,
Shanika Ediriweera Undergraduate Dept. of Computer Science & Eng. University of Moratuwa
On 23 February 2017 at 02:15, Bartosz Dziewoński matma.rex@gmail.com wrote:
Looks like you're not loading the OOjs UI code you're trying to use. Assuming that you're writing this as part of MediaWiki (or an extension), you need to add a dependency on the 'oojs-ui' ResourceLoader module.
-- Bartosz Dziewoński
Wikitech-l mailing list Wikitech-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikitech-l
I found the resource loader file.
What should I add here?
// Windows and dialogs module. $modules['oojs-ui-windows'] = [ 'scripts' => 'resources/lib/oojs-ui/oojs-ui-windows.js', 'skinStyles' => $getSkinSpecific( 'windows' ), 'dependencies' => 'oojs-ui-core', 'messages' => [ 'ooui-dialog-message-accept', 'ooui-dialog-message-reject', 'ooui-dialog-process-continue', 'ooui-dialog-process-dismiss', 'ooui-dialog-process-error', 'ooui-dialog-process-retry', ], 'targets' => [ 'desktop', 'mobile' ], ];
Best Regards,
Shanika Ediriweera Undergraduate Dept. of Computer Science & Eng. University of Moratuwa
On 23 February 2017 at 05:40, Shanika Ediriweera shanika.13@cse.mrt.ac.lk wrote:
Yes. I am working on a special page in the mediawiki core.
Could you please tell me where is the resource loader modue located?
Best Regards,
Shanika Ediriweera Undergraduate Dept. of Computer Science & Eng. University of Moratuwa
On 23 February 2017 at 02:15, Bartosz Dziewoński matma.rex@gmail.com wrote:
Looks like you're not loading the OOjs UI code you're trying to use. Assuming that you're writing this as part of MediaWiki (or an extension), you need to add a dependency on the 'oojs-ui' ResourceLoader module.
-- Bartosz Dziewoński
Wikitech-l mailing list Wikitech-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikitech-l
Hi
I got it figured out.
I added 'oojs-ui-core', 'oojs-ui-windows' in Resources.php
'mediawiki.special.movePage' => [ 'scripts' => 'resources/src/mediawiki.special/mediawiki.special.movePage.js', 'dependencies' => [ 'jquery.byteLimit', 'mediawiki.widgets', 'oojs-ui-core', 'oojs-ui-windows' ], ],
Thanks for the help.
Best Regards,
Shanika Ediriweera Undergraduate Dept. of Computer Science & Eng. University of Moratuwa
On 23 February 2017 at 05:59, Shanika Ediriweera shanika.13@cse.mrt.ac.lk wrote:
I found the resource loader file.
What should I add here?
// Windows and dialogs module.
$modules['oojs-ui-windows'] = [ 'scripts' => 'resources/lib/oojs-ui/oojs-ui-windows.js', 'skinStyles' => $getSkinSpecific( 'windows' ), 'dependencies' => 'oojs-ui-core', 'messages' => [ 'ooui-dialog-message-accept', 'ooui-dialog-message-reject', 'ooui-dialog-process-continue', 'ooui-dialog-process-dismiss', 'ooui-dialog-process-error', 'ooui-dialog-process-retry', ], 'targets' => [ 'desktop', 'mobile' ], ];
Best Regards,
Shanika Ediriweera Undergraduate Dept. of Computer Science & Eng. University of Moratuwa
On 23 February 2017 at 05:40, Shanika Ediriweera <shanika.13@cse.mrt.ac.lk
wrote:
Yes. I am working on a special page in the mediawiki core.
Could you please tell me where is the resource loader modue located?
Best Regards,
Shanika Ediriweera Undergraduate Dept. of Computer Science & Eng. University of Moratuwa
On 23 February 2017 at 02:15, Bartosz Dziewoński matma.rex@gmail.com wrote:
Looks like you're not loading the OOjs UI code you're trying to use. Assuming that you're writing this as part of MediaWiki (or an extension), you need to add a dependency on the 'oojs-ui' ResourceLoader module.
-- Bartosz Dziewoński
Wikitech-l mailing list Wikitech-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikitech-l
wikitech-l@lists.wikimedia.org