源码
/*!
tMsgbox
sample:
1. tmsgbox.alert({message:"my message", type:"warning", title:"my title"});
2. tmsgbox.confirm({message:"my message", type:"error"}).on(function (e) {
if (!e) {
return;
} else {
// ....
}
});
3. tmsgbox.dialog({title:"my title",url:"<%=request.getContextPath()%>/frontend/test"});
*/
(function ($) {
window.tmsgbox = function () {
var msghtml = '<div class="modal fade bs-example-modal-sm" id="[Id]" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">' +
' <div class="modal-dialog modal-sm" role="document">' +
' <div class="modal-content tmsgbox-content">' +
' <div class="modal-header tmsgbox-h">' +
' <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>' +
' <h4 class="modal-title tmsgbox-title" id="myModalLabel">[Title]</h4>' +
' </div>' +
' <div class="modal-body row tmsgbox-body">' +
' <div class="col-xs-3"><span class="glyphicon [Type] tmsgbox-icon"></span></div>' +
' <div class="col-xs-9 "><span>[Message]</span></div>' +
' </div>' +
' <div class="modal-footer tmsgbox-footer">' +
' <button type="button" class="btn btn-primary ok" data-dismiss="modal">[BtnOk]</button>' +
' <button type="button" class="btn btn-default cancel" data-dismiss="modal">[BtnCancel]</button>' +
' </div>' +
' </div>' +
'