diff options
| author | czaks <marcin@6irc.net> | 2014-10-18 22:43:35 +0200 |
|---|---|---|
| committer | czaks <marcin@6irc.net> | 2014-10-18 22:43:35 +0200 |
| commit | b55ebcd0ef002c86df714a3c857746832f010bc7 (patch) | |
| tree | 9f42ec64605b4d86279393c44a39eea5fe6ffed2 /templates | |
| parent | 638931b02d12d8215346e21b422d372e5a477506 (diff) | |
custom alert: now alert will be able to display custom HTML
Diffstat (limited to 'templates')
| -rw-r--r-- | templates/main.js | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/templates/main.js b/templates/main.js index ed25f7d9..ead852fe 100644 --- a/templates/main.js +++ b/templates/main.js @@ -69,6 +69,29 @@ var datelocale = , pm: _('pm') }; + +function alert(a) { + var handler, div; + var close = function() { + handler.fadeOut(400, function() { handler.remove(); }); + return false; + }; + + handler = $("<div id='alert_handler'></div>").hide().appendTo('body'); + + $("<div id='alert_background'></div>").click(close).appendTo(handler); + + div = $("<div id='alert_div'></div>").appendTo(handler); + $("<a id='alert_close' href='javascript:void(0)'><i class='fa fa-times'></i></div>") + .click(close).appendTo(div); + + $("<div id='alert_message'></div>").html(a).appendTo(div); + + $("<button class='button alert_button'>"+_("OK")+"</button>").click(close).appendTo(div); + + handler.fadeIn(400); +} + var saved = {}; |
