MarkTraceur has uploaded a new change for review.
https://gerrit.wikimedia.org/r/86805
Change subject: jquery audit of mw.ErrorDialog.js
......................................................................
jquery audit of mw.ErrorDialog.js
Moved some JS-added styles to the CSS file.
Bug: 53245
Change-Id: I625459241f3ff814bb7d0565dc720d20f70fed6e
---
M resources/mw.ErrorDialog.js
M resources/uploadWizard.css
2 files changed, 35 insertions(+), 26 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/UploadWizard
refs/changes/05/86805/1
diff --git a/resources/mw.ErrorDialog.js b/resources/mw.ErrorDialog.js
index d19a86f..9ab9e80 100644
--- a/resources/mw.ErrorDialog.js
+++ b/resources/mw.ErrorDialog.js
@@ -1,40 +1,41 @@
( function( mw, $ ) {
-
/**
* Thingy for collecting user feedback on a wiki page
* @param {mw.Api} api properly configured to talk to this wiki
* @param {mw.Title} the title of the page where you collect feedback
*/
mw.ErrorDialog = function( errorMessage ) {
+ var $innerDiv, $mainDiv,
+ dialog = this;
+
this.errorMessage = errorMessage;
- this.setup();
+
+ // Set up buttons for dialog box. We have to do it the hard way
since the json keys are localized
+ this.buttons = {};
+ this.buttons[ mw.message( 'mwe-upwiz-errordialog-ok'
).escaped() ] = function () { dialog.ok(); };
+
+ $innerDiv = $( '<div>' )
+ .addClass( 'mwe-upwiz-errordialog-innerdiv' )
+ .html( errorMessage );
+
+ $mainDiv = $( '<div>' )
+ .addClass( 'mwe-upwiz-errordialog' )
+ .addClass( 'mwe-upwiz-errordialog-mode' )
+ .html( this.$innerDiv );
+
+ this.$dialog = $( '<div>' )
+ .addClass( 'mwe-upwiz-errordialog-contain' )
+ .html( this.$mainDiv )
+ .dialog( {
+ width: 600,
+ autoOpen: false,
+ title: mw.message(
'mwe-upwiz-errordialog-title' ).escaped(),
+ modal: true,
+ buttons: this.buttons
+ } );
};
mw.ErrorDialog.prototype = {
- setup: function() {
- var dialog = this;
-
- // Set up buttons for dialog box. We have to do it the
hard way since the json keys are localized
- this.buttons = {};
- this.buttons[ mw.message( 'mwe-upwiz-errordialog-ok'
).escaped() ] = function () { dialog.ok(); };
-
- this.$dialog =
- $( '<div style="position:relative;"></div>'
).append(
- $( '<div
class="mwe-upwiz-errordialog-mode mwe-upwiz-errordialog"></div>' ).append(
- $( '<div
style="margin-top:1em;"></div>' ).append(
- this.errorMessage,
- $( '<br/>' )
- )
- )
- ).dialog({
- width: 600,
- autoOpen: false,
- title: mw.message(
'mwe-upwiz-errordialog-title' ).escaped(),
- modal: true,
- buttons: this.buttons
- });
- },
-
ok: function() {
this.$dialog.dialog( 'close' );
},
diff --git a/resources/uploadWizard.css b/resources/uploadWizard.css
index fe3cb0c..8f5b629 100644
--- a/resources/uploadWizard.css
+++ b/resources/uploadWizard.css
@@ -805,3 +805,11 @@
color:gray;
padding-left:0.5em;
}
+
+.mwe-upwiz-errordialog-contain {
+ position: relative;
+}
+
+.mwe-upwiz-errordialog-innerdiv {
+ margin-top: 1em;
+}
--
To view, visit https://gerrit.wikimedia.org/r/86805
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I625459241f3ff814bb7d0565dc720d20f70fed6e
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/UploadWizard
Gerrit-Branch: master
Gerrit-Owner: MarkTraceur <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits