added jquery growl instead of alert

This commit is contained in:
Kevin Froman 2017-03-30 20:17:52 -05:00
parent 503b395b43
commit 38c24a0501
No known key found for this signature in database
GPG Key ID: 36698DB39DA54065
3 changed files with 9 additions and 2 deletions

View File

@ -13,6 +13,7 @@
<script src="./jquery.min.js"></script> <script src="./jquery.min.js"></script>
<script src="./bootstrap.min.js"></script> <script src="./bootstrap.min.js"></script>
<script src="./clipboard.min.js"></script> <script src="./clipboard.min.js"></script>
<script src="./jquery.bootstrap-growl.min.js"></script>
<script src='./aes.min.js'></script> <script src='./aes.min.js'></script>
<link rel='stylesheet' href='./theme.min.css'> <link rel='stylesheet' href='./theme.min.css'>

1
jquery.bootstrap-growl.min.js vendored Normal file
View File

@ -0,0 +1 @@
(function(){var c;c=jQuery;c.bootstrapGrowl=function(f,a){var b,e,d;a=c.extend({},c.bootstrapGrowl.default_options,a);b=c("<div>");b.attr("class","bootstrap-growl alert");a.type&&b.addClass("alert-"+a.type);a.allow_dismiss&&(b.addClass("alert-dismissible"),b.append('<button class="close" data-dismiss="alert" type="button"><span aria-hidden="true">&#215;</span><span class="sr-only">Close</span></button>'));b.append(f);a.top_offset&&(a.offset={from:"top",amount:a.top_offset});d=a.offset.amount;c(".bootstrap-growl").each(function(){return d= Math.max(d,parseInt(c(this).css(a.offset.from))+c(this).outerHeight()+a.stackup_spacing)});e={position:"body"===a.ele?"fixed":"absolute",margin:0,"z-index":"9999",display:"none"};e[a.offset.from]=d+"px";b.css(e);"auto"!==a.width&&b.css("width",a.width+"px");c(a.ele).append(b);switch(a.align){case "center":b.css({left:"50%","margin-left":"-"+b.outerWidth()/2+"px"});break;case "left":b.css("left","20px");break;default:b.css("right","20px")}b.fadeIn();0<a.delay&&b.delay(a.delay).fadeOut(function(){return c(this).alert("close")}); return b};c.bootstrapGrowl.default_options={ele:"body",type:"info",offset:{from:"top",amount:20},align:"right",width:250,delay:4E3,allow_dismiss:!0,stackup_spacing:10}}).call(this);

View File

@ -12,6 +12,11 @@ var z_one = '';
var w_zero = ' '; var w_zero = ' ';
var w_one = '\t'; var w_one = '\t';
function showError(msg){
$.bootstrapGrowl(msg, {type: 'danger'})
}
function escapeRegExp(str) { function escapeRegExp(str) {
return str.replace(/([.*+?^=!:${}()|\[\]\/\\])/g, "\\$1"); return str.replace(/([.*+?^=!:${}()|\[\]\/\\])/g, "\\$1");
} }
@ -101,7 +106,7 @@ function verifyPass(mode)
{ {
if ($('#password').val() == '') if ($('#password').val() == '')
{ {
alert('You must provide a password.'); showError('You must provide a password.');
return false; return false;
} }
@ -109,7 +114,7 @@ function verifyPass(mode)
{ {
if ($('#password').val() != $('#confirmPass').val()) if ($('#password').val() != $('#confirmPass').val())
{ {
alert('Passwords must match.'); showError('Passwords must match.');
return false; return false;
} }
} }