From a09e12721fbab8f1f716495a04957f52595fc272 Mon Sep 17 00:00:00 2001 From: Walter Purcaro Date: Tue, 17 Feb 2015 20:01:56 +0100 Subject: Fix lib in .gitignore --- .../Dark/lib/MooTools/MooDialog/MooDialog.Alert.js | 45 ++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 pyload/webui/themes/Dark/lib/MooTools/MooDialog/MooDialog.Alert.js (limited to 'pyload/webui/themes/Dark/lib/MooTools/MooDialog/MooDialog.Alert.js') diff --git a/pyload/webui/themes/Dark/lib/MooTools/MooDialog/MooDialog.Alert.js b/pyload/webui/themes/Dark/lib/MooTools/MooDialog/MooDialog.Alert.js new file mode 100644 index 000000000..1e2d4180b --- /dev/null +++ b/pyload/webui/themes/Dark/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() + }); + + } +}); + -- cgit v1.2.3