Re: [Wikitech-l] Changing the action button labels of a OO.ui.confirm dialog
Thanks very much for the suggestions. On Fri, Dec 13, 2019 at 5:05 PM Bartosz Dziewoński wrote: > You can actually customize the labels in OO.ui.confirm() too: > > OO.ui.confirm( '...', { > actions: [ > { action: 'accept', label: 'Yes!', flags: > 'primary' }, > { action: 'reject', label: 'No…', flags: 'safe' } > ] > } ).done( function ( confirmed ) { > ... > } ); > > Make sure to keep the `action: 'accept'` and `action: 'reject'` (the > dialog uses this to make the two buttons do things), the other pieces > can be changed. > > -- > Bartosz Dziewoński > > ___ > Wikitech-l mailing list > Wikitech-l@lists.wikimedia.org > https://lists.wikimedia.org/mailman/listinfo/wikitech-l ___ Wikitech-l mailing list Wikitech-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikitech-l
Re: [Wikitech-l] Changing the action button labels of a OO.ui.confirm dialog
You can actually customize the labels in OO.ui.confirm() too: OO.ui.confirm( '...', { actions: [ { action: 'accept', label: 'Yes!', flags: 'primary' }, { action: 'reject', label: 'No…', flags: 'safe' } ] } ).done( function ( confirmed ) { ... } ); Make sure to keep the `action: 'accept'` and `action: 'reject'` (the dialog uses this to make the two buttons do things), the other pieces can be changed. -- Bartosz Dziewoński ___ Wikitech-l mailing list Wikitech-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikitech-l
Re: [Wikitech-l] Changing the action button labels of a OO.ui.confirm dialog
Note: With the `confirm()` method, a MessageDialog object is being created in the background. Altering that dialog at run time is almost impossible. So, the best way is go with constructing your own Message Dialog with the action labels you want as I shared above or other ways. For more information from the JS side, see: https://stackoverflow.com/questions/823790/javascript-confirm-popup-yes-no-button-instead-of-ok-and-cancel and other Google Search related results. *--* *Derick* On Thu, Dec 12, 2019 at 10:41 AM Derick Alangi wrote: > Hi, > > Yes, it's possible to personalize the action labels via the `*actions`* > option when constructing your message dialog. Wrote up something on this > etherpad: https://etherpad.wikimedia.org/p/wrDQW6gSAqwWYwfL2tJb. Hope > it's useful. > > *--* > *Derick* > > > On Thu, Dec 12, 2019 at 9:40 AM Egbe Eugene wrote: > >> Hi All, >> >> while going through OO.ui.confirm dialog documentation I got curious about >> how to change the labels of the action buttons 'Ok' and 'Cancel' to show >> different texts. >> >> -- >> Eugene >> ___ >> Wikitech-l mailing list >> Wikitech-l@lists.wikimedia.org >> https://lists.wikimedia.org/mailman/listinfo/wikitech-l > > ___ Wikitech-l mailing list Wikitech-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikitech-l
Re: [Wikitech-l] Changing the action button labels of a OO.ui.confirm dialog
Hi, Yes, it's possible to personalize the action labels via the `*actions`* option when constructing your message dialog. Wrote up something on this etherpad: https://etherpad.wikimedia.org/p/wrDQW6gSAqwWYwfL2tJb. Hope it's useful. *--* *Derick* On Thu, Dec 12, 2019 at 9:40 AM Egbe Eugene wrote: > Hi All, > > while going through OO.ui.confirm dialog documentation I got curious about > how to change the labels of the action buttons 'Ok' and 'Cancel' to show > different texts. > > -- > Eugene > ___ > Wikitech-l mailing list > Wikitech-l@lists.wikimedia.org > https://lists.wikimedia.org/mailman/listinfo/wikitech-l ___ Wikitech-l mailing list Wikitech-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikitech-l
[Wikitech-l] Changing the action button labels of a OO.ui.confirm dialog
Hi All, while going through OO.ui.confirm dialog documentation I got curious about how to change the labels of the action buttons 'Ok' and 'Cancel' to show different texts. -- Eugene ___ Wikitech-l mailing list Wikitech-l@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/wikitech-l