// Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors // MIT License. See license.txt wn.provide("wn.messages") wn.messages.waiting = function(parent, msg, bar_percent) { if(!bar_percent) bar_percent = '100'; return $(repl('
%(msg)s
\" + message + "
\\ \ \
"); $(d.wrapper).find(".btn-yes").click(function() { d.hide(); ifyes && ifyes(); }); $(d.wrapper).find(".btn-no").click(function() { d.hide(); ifno && ifno(); }); } var msg_dialog=null; function msgprint(msg, title) { if(!msg) return; if(msg instanceof Array) { $.each(msg, function(i,v) { if(v) { msgprint(v); } }) return; } if(typeof(msg)!='string') msg = JSON.stringify(msg); // small message if(msg.substr(0,8)=='__small:') { show_alert(msg.substr(8)); return; } if(!msg_dialog) { msg_dialog = new wn.ui.Dialog({ title:"Message", onhide: function() { if(msg_dialog.custom_onhide) { msg_dialog.custom_onhide(); } msg_dialog.msg_area.empty(); } }); msg_dialog.msg_area = $('|