/* Optional: Overwrites javascript's built-in alert function */ function webci_alert(title, msg){ if( typeof msg == 'undefined' ) { msg = title; title = ''; } $.jAlert({ 'title': title, 'content': msg }); } /* Optional: Overwrites javascript's built-in confirm function (DANGER: operates differently - returns true every time and doesn't stop execution!) - You must provide a callback */ function webci_confirm(title, confirmQuestion, confirmBtnText, denyBtnText, confirmCallback, denyCallback) { $.jAlert({'type': 'confirm', 'title': title, 'confirmQuestion': confirmQuestion, 'confirmBtnText': confirmBtnText, 'denyBtnText': denyBtnText, 'onConfirm': confirmCallback, 'onDeny': denyCallback, 'animationTimeout': 0, 'showAnimation': false, 'hideAnimation': false }); } /* Optional Alert shortcuts based on color */ function webci_show_alert(title, msg, theme) { if(theme == '') { theme = 'default'; } $.jAlert({ 'title': title, 'content': msg, 'theme': theme, 'animationTimeout' : 0, 'showAnimation': false, 'hideAnimation': false }); } function webci_successAlert(title, msg) { if( typeof msg == 'undefined' ) { msg = title; title = 'Success'; } showAlert(title, msg, 'green'); } function webci_errorAlert(title, msg) { if( typeof msg == 'undefined' ) { msg = title; title = 'Error'; } showAlert(title, msg, 'red'); } function webci_infoAlert(title, msg) { if( typeof msg == 'undefined' ) { msg = title; title = 'Info'; } showAlert(title, msg, 'blue'); } function webci_warningAlert(title, msg) { if( typeof msg == 'undefined' ) { msg = title; title = 'Warning'; } showAlert(title, msg, 'yellow'); } function webci_blackAlert(title, msg) { if( typeof msg == 'undefined' ) { msg = title; title = 'Warning'; } showAlert(title, msg, 'black'); } function webci_imageAlert(img, imgWidth) { if( typeof imgWidth == 'auto' ) { iframeHeight = false; } $.jAlert({ 'image': img, 'imageWidth': imgWidth }); } function webci_videoAlert(video) { $.jAlert({ 'video': video }); } function webci_iframeAlert(iframe, iframeHeight) { if( typeof iframeHeight == 'undefined' ) { iframeHeight = false; } $.jAlert({ 'iframe': iframe, 'iframeHeight': iframeHeight }); } function webci_ajaxAlert(url, onOpen) { if( typeof onOpen == 'undefined' ) { onOpen = function(alert){ //on open call back. Fires just after the alert has finished rendering return false; }; } $.jAlert({ 'ajax': url, 'onOpen': onOpen }); }