diff options
author | Timotej Lazar <timotej.lazar@fri.uni-lj.si> | 2016-03-31 16:56:19 +0200 |
---|---|---|
committer | Timotej Lazar <timotej.lazar@fri.uni-lj.si> | 2016-03-31 16:56:19 +0200 |
commit | a5a5a276ab60d000fe259858585dc5b71eb372d2 (patch) | |
tree | cb06882c7ea8f9ba3f4b436687d5cc5a777261e4 /js/codeq/core.js | |
parent | 63f4ef494b32f08ee6709c6040374bb9ed9c5da8 (diff) |
Replace window.alert with custom message box
Diffstat (limited to 'js/codeq/core.js')
-rw-r--r-- | js/codeq/core.js | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/js/codeq/core.js b/js/codeq/core.js index b1d4a5c..fd58781 100644 --- a/js/codeq/core.js +++ b/js/codeq/core.js @@ -243,6 +243,16 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. */ }; }; + // replace window.alert with custom message box (only used for app errors) + var jqMessage = $('div#message'); + jqMessage.find('.close').click(function () { + jqMessage.slideUp('fast'); + }); + window.alert = function (message, type) { + jqMessage.find('.text').text(message); + jqMessage.removeClass().addClass(type || 'error').slideDown('fast'); + }; + window.codeq = { 'jsonize': jsonize, |