diff options
| author | 2015-02-17 20:01:56 +0100 | |
|---|---|---|
| committer | 2015-02-17 20:01:56 +0100 | |
| commit | a09e12721fbab8f1f716495a04957f52595fc272 (patch) | |
| tree | cc5fe5be1c9e22e5c229171ec3bb62adca046c06 /pyload/webui/themes/Flat/lib/MooTools/MooDialog/MooDialog.Alert.js | |
| parent | Fix extractor plugin type (diff) | |
| download | pyload-a09e12721fbab8f1f716495a04957f52595fc272.tar.xz | |
Fix lib in .gitignore
Diffstat (limited to 'pyload/webui/themes/Flat/lib/MooTools/MooDialog/MooDialog.Alert.js')
| -rw-r--r-- | pyload/webui/themes/Flat/lib/MooTools/MooDialog/MooDialog.Alert.js | 45 | 
1 files changed, 45 insertions, 0 deletions
diff --git a/pyload/webui/themes/Flat/lib/MooTools/MooDialog/MooDialog.Alert.js b/pyload/webui/themes/Flat/lib/MooTools/MooDialog/MooDialog.Alert.js new file mode 100644 index 000000000..1e2d4180b --- /dev/null +++ b/pyload/webui/themes/Flat/lib/MooTools/MooDialog/MooDialog.Alert.js @@ -0,0 +1,45 @@ +/* +--- +name: MooDialog.Alert +description: Creates an Alert dialog +authors: Arian Stolwijk +license:  MIT-style license +requires: MooDialog +provides: MooDialog.Alert +... +*/ + + +MooDialog.Alert = new Class({ + +	Extends: MooDialog, + +	options: { +		okText: 'Ok', +		focus: true, +		textPClass: 'MooDialogAlert' +	}, + +	initialize: function(msg, options){ +		this.parent(options); + +		var okButton = new Element('button', { +			events: { +				click: this.close.bind(this) +			}, +			text: this.options.okText +		}); + +		this.setContent( +			new Element('p.' + this.options.textPClass, {text: msg}), +			new Element('div.buttons').adopt(okButton) +		); +		if (this.options.autoOpen) this.open(); + +		if (this.options.focus) this.addEvent('show', function(){ +			okButton.focus() +		}); + +	} +}); +  | 
