├── LICENSE ├── apprise-1.5.full.js ├── apprise.css └── readme.md /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2019 Daniel Raftery 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /apprise-1.5.full.js: -------------------------------------------------------------------------------- 1 | // Apprise 1.5 by Daniel Raftery 2 | // http://thrivingkings.com/apprise 3 | // 4 | // Button text added by Adam Bezulski 5 | // 6 | // Cached jQuery variables, position center added by Josiah Ruddell 7 | 8 | function apprise(string, args, callback) { 9 | var default_args = 10 | { 11 | 'confirm': false, // Ok and Cancel buttons 12 | 'verify': false, // Yes and No buttons 13 | 'input': false, // Text input (can be true or string for default text) 14 | 'animate': false, // Groovy animation (can true or number, default is 400) 15 | 'textOk': 'Ok', // Ok button default text 16 | 'textCancel': 'Cancel', // Cancel button default text 17 | 'textYes': 'Yes', // Yes button default text 18 | 'textNo': 'No', // No button default text 19 | 'position': 'center'// position center (y-axis) any other option will default to 100 top 20 | } 21 | 22 | if (args) { 23 | for (var index in default_args) 24 | { if (typeof args[index] == "undefined") args[index] = default_args[index]; } 25 | } 26 | 27 | var aHeight = $(window).height(), 28 | aWidth = $(window).width(), 29 | apprise = $('
'), 30 | overlay = $(''), 31 | inner = $(''), 32 | buttons = $(''), 33 | posTop = 100; 34 | 35 | overlay.css({ height: aHeight, width: aWidth }) 36 | .appendTo('body') 37 | .fadeIn(100,function(){$(this).css('filter','alpha(opacity=70)');}); 38 | 39 | apprise.appendTo('body'); 40 | 41 | inner.append(string) 42 | .appendTo(apprise); 43 | 44 | 45 | 46 | if (args) { 47 | if (args['input']) { 48 | if (typeof (args['input']) == 'string') { 49 | inner.append(''); 50 | } 51 | if (typeof (args['input']) == 'object') { 52 | inner.append($('').append(args['input'])); 53 | } 54 | else { 55 | inner.append(''); 56 | } 57 | $('.aTextbox').focus(); 58 | } 59 | } 60 | 61 | inner.append(buttons); 62 | if (args) { 63 | if (args['confirm'] || args['input']) { 64 | buttons.append(''); 65 | buttons.append(''); 66 | } 67 | else if (args['verify']) { 68 | buttons.append(''); 69 | buttons.append(''); 70 | } 71 | else { buttons.append(''); } 72 | } 73 | else { buttons.append(''); } 74 | 75 | // position after adding buttons 76 | 77 | apprise.css("left", ($(window).width() - $('.appriseOuter').width()) / 2 + $(window).scrollLeft() + "px"); 78 | // get center 79 | if (args) { 80 | if (args['position'] && args['position'] === 'center') { 81 | posTop = (aHeight - apprise.height()) / 2; 82 | } 83 | 84 | if (args['animate']) { 85 | var aniSpeed = args['animate']; 86 | if (isNaN(aniSpeed)) { aniSpeed = 400; } 87 | apprise.css('top', '-200px').show().animate({ top: posTop }, aniSpeed); 88 | } 89 | else { apprise.css('top', posTop).fadeIn(200); } 90 | } 91 | else { apprise.css('top', posTop).fadeIn(200); } 92 | 93 | 94 | $(document).keydown(function (e) { 95 | if (overlay.is(':visible')) { 96 | if (e.keyCode == 13) 97 | { $('.aButtons > button[value="ok"]').click(); } 98 | if (e.keyCode == 27) 99 | { $('.aButtons > button[value="cancel"]').click(); } 100 | } 101 | }); 102 | 103 | var aText = $('.aTextbox').val(); 104 | if (!aText) { aText = false; } 105 | $('.aTextbox').keyup(function () 106 | { aText = $(this).val(); }); 107 | 108 | $('.aButtons > button').click(function () { 109 | overlay.remove(); 110 | apprise.remove(); 111 | if (callback) { 112 | $(this).text(""); 113 | var wButton = $(this).attr("value"); 114 | if (wButton == 'ok') { 115 | if (args) { 116 | if (args['input']) { callback(aText); } 117 | else { callback(true); } 118 | } 119 | else { 120 | callback(true); 121 | } 122 | } 123 | else if (wButton == 'cancel') { 124 | callback(false); 125 | } 126 | } 127 | }); 128 | } 129 | -------------------------------------------------------------------------------- /apprise.css: -------------------------------------------------------------------------------- 1 | .appriseOverlay 2 | { 3 | position:fixed; 4 | top:0; 5 | left:0; 6 | background-color: #000; 7 | zoom: 1; 8 | filter: alpha(opacity = 30); 9 | opacity: 0.3; 10 | } 11 | .appriseOuter 12 | { 13 | background:#eee; 14 | border:1px solid #fff; 15 | box-shadow:0px 3px 7px #333; 16 | -moz-box-shadow:0px 3px 7px #333; 17 | -webkit-box-shadow:0px 3px 7px #333; 18 | -moz-border-radius:4px; 19 | -webkit-border-radius:4px; 20 | border-radius:4px; 21 | -khtml-border-radius:4px; 22 | position:absolute; 23 | z-index:99999999; 24 | min-width:200px; 25 | min-height:50px; 26 | max-width:75%; 27 | position:fixed; 28 | display:none; 29 | } 30 | .appriseInner 31 | { 32 | padding:20px; 33 | color:#333; 34 | text-shadow:0px 1px 0px #fff; 35 | } 36 | .appriseInner button 37 | { 38 | border:1px solid #bbb; 39 | -moz-border-radius:3px; 40 | -webkit-border-radius:3px; 41 | border-radius:3px; 42 | -khtml-border-radius:3px; 43 | background: -moz-linear-gradient(100% 100% 90deg, #eee, #d5d5d5); 44 | background: -webkit-gradient(linear, 0% 0%, 0% 100%, from(#eee), to(#d5d5d5)); 45 | background: -webkit-linear-gradient(#eee, #d5d5d5); 46 | background: -o-linear-gradient(#eee, #d5d5d5); 47 | color:#232d3d; 48 | font-size:12px; 49 | font-weight:bold; 50 | padding:4px 10px; 51 | margin:0 3px; 52 | text-shadow:0px 1px 0px #fff; 53 | cursor:pointer; 54 | box-shadow:0px 1px 2px #ccc; 55 | -moz-box-shadow:0px 1px 2px #ccc; 56 | -webkit-box-shadow:0px 1px 2px #ccc; 57 | } 58 | .appriseInner button:hover 59 | { 60 | color:#d85054; 61 | } 62 | .aButtons, .aInput 63 | { 64 | margin:20px 10px 0px 10px; 65 | text-align:center; 66 | } 67 | .aTextbox 68 | { 69 | border:1px solid #aaa; 70 | -moz-border-radius:4px; 71 | -webkit-border-radius:4px; 72 | border-radius:4px; 73 | -khtml-border-radius:4px; 74 | box-shadow:0px 1px 0px #fff; 75 | -moz-box-shadow:0px 1px 0px #fff; 76 | -webkit-box-shadow:0px 1px 0px #fff; 77 | width:180px; 78 | font-size:12px; 79 | font-weight:bold; 80 | padding:5px 10px; 81 | } 82 | .no-rgba .appriseOverlay{ 83 | opacity: .30; 84 | filter: alpha(opacity = 30) !important; 85 | background: #000; 86 | zoom: 1; 87 | } 88 | .no-borderradius .appriseOuter{ 89 | border:1px solid #888; 90 | } 91 | .appriseOverlay { 92 | background-color:#222222; 93 | border:medium none; 94 | cursor:wait; 95 | height:100%; 96 | left:0; 97 | margin:0; 98 | padding:0; 99 | position:fixed; 100 | top:0; 101 | width:100%; 102 | z-index:1000; 103 | filter:alpha(opacity=70); 104 | opacity:0.70; 105 | } 106 | -------------------------------------------------------------------------------- /readme.md: -------------------------------------------------------------------------------- 1 | NO LONGER SUPPORTED. USE AT YOUR OWN RISK. 2 | === 3 | 4 | The attractive alert alternative for jQuery 5 | 6 | [http://thrivingkings.com/read/Apprise-The-attractive-alert-alternative-for-jQuery](http://thrivingkings.com/read/Apprise-The-attractive-alert-alternative-for-jQuery) 7 | --------------------------------------------------------------------------------