mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/CodeEditor
synced 2024-09-23 10:20:26 +00:00
Use OOUI for confirm dialog
Would be nice to do this for the goto line prompt, but such a OO.ui.prompt doesn't exist yet. Change-Id: I6b24e51b5b106ece80e265ff5417878f108619b7
This commit is contained in:
parent
1818ed4bea
commit
6042898fcf
|
@ -51,7 +51,8 @@
|
|||
"mediawiki.api.options",
|
||||
"user.options",
|
||||
"mediawiki.cookie",
|
||||
"jquery.textSelection"
|
||||
"jquery.textSelection",
|
||||
"oojs-ui-windows"
|
||||
],
|
||||
"messages": [
|
||||
"codeeditor-next-annotation",
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/* Ace syntax-highlighting code editor extension for wikiEditor */
|
||||
/* global ace, confirm, prompt */
|
||||
( function ( $, mw ) {
|
||||
/* global ace */
|
||||
( function ( $, mw, OO ) {
|
||||
$.wikiEditor.modules.codeEditor = {
|
||||
/**
|
||||
* Core Requirements
|
||||
|
@ -74,11 +74,19 @@
|
|||
paste: returnFalse,
|
||||
ready: returnFalse,
|
||||
codeEditorSubmit: function () {
|
||||
var form = this;
|
||||
context.evt.codeEditorSync();
|
||||
if ( hasErrorsOnSave ) {
|
||||
hasErrorsOnSave = false;
|
||||
return confirm( mw.msg( 'codeeditor-save-with-errors' ) );
|
||||
OO.ui.confirm( mw.msg( 'codeeditor-save-with-errors' ) ).done( function ( confirmed ) {
|
||||
if ( confirmed ) {
|
||||
// Programmatic submit doesn't retrigger this event listener
|
||||
form.submit();
|
||||
}
|
||||
} );
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
},
|
||||
codeEditorSave: function () {
|
||||
var i,
|
||||
|
@ -839,4 +847,4 @@
|
|||
}
|
||||
|
||||
};
|
||||
}( jQuery, mediaWiki ) );
|
||||
}( jQuery, mediaWiki, OO ) );
|
||||
|
|
Loading…
Reference in a new issue