1'use strict'; 2 3var animationDuration; 4 5$(window).load(function(){ 6 7 8 9 10 //Welcome Message (not for login page) 11 function notify(message, type){ 12 $.notify({ 13 message: message 14 },{ 15 type: type, 16 allow_dismiss: false, 17 label: 'Cancel', 18 className: 'btn-xs btn-default', 19 placement: { 20 from: 'bottom', 21 align: 'left' 22 }, 23 delay: 2500, 24 animate: { 25 enter: 'animated fadeInUp', 26 exit: 'animated fadeOutDown' 27 }, 28 offset: { 29 x: 30, 30 y: 30 31 } 32 }); 33 } 34 35 if (!$('.login, .four-zero')[0]) { 36 //notify('Welcome back Nadine', '-dark'); 37 } 38}); 39 40$(document).ready(function() { 41 /*-------------------------------------- 42 Animation 43 ---------------------------------------*/ 44 $('body').on('click', '.animation-demo .btn', function(){ 45 var animation = $(this).text(); 46 var cardImg = $(this).closest('.card').find('img'); 47 if (animation === "hinge") { 48 animationDuration = 2100; 49 } 50 else { 51 animationDuration = 1200; 52 } 53 54 cardImg.removeAttr('class'); 55 cardImg.addClass('animated '+animation); 56 57 setTimeout(function(){ 58 cardImg.removeClass(animation); 59 }, animationDuration); 60 }); 61 62 63 /*-------------------------------------- 64 Bootstrap Notify Notifications 65 ---------------------------------------*/ 66 function notify(from, align, icon, type, animIn, animOut){ 67 $.notify({ 68 icon: icon, 69 title: ' Bootstrap Notify', 70 message: 'Turning standard Bootstrap alerts into awesome notifications', 71 url: '' 72 },{ 73 element: 'body', 74 type: type, 75 allow_dismiss: true, 76 placement: { 77 from: from, 78 align: align 79 }, 80 offset: { 81 x: 30, 82 y: 30 83 }, 84 spacing: 10, 85 z_index: 1031, 86 delay: 2500, 87 timer: 1000, 88 url_target: '_blank', 89 mouse_over: false, 90 animate: { 91 enter: animIn, 92 exit: animOut 93 }, 94 template: '<div data-notify="container" class="alert alert-dismissible alert-{0}" role="alert">' + 95 '<button type="button" class="close" data-dismiss="alert"><span aria-hidden="true">×</span></button>' + 96 '<span data-notify="icon"></span> ' + 97 '<span data-notify="title">{1}</span> ' + 98 '<span data-notify="message">{2}</span>' + 99 '<div class="progress" data-notify="progressbar">' + 100 '<div class="progress-bar progress-bar-{0}" role="progressbar" aria-valuenow="0" aria-valuemin="0" aria-valuemax="100" style="width: 0%;"></div>' + 101 '</div>' + 102 '<a href="{3}" target="{4}" data-notify="url"></a>' + 103 '</div>' 104 }); 105 } 106 107 $('.notifications > div > .btn').click(function(e){ 108 e.preventDefault(); 109 var nFrom = $(this).attr('data-from'); 110 var nAlign = $(this).attr('data-align'); 111 var nIcons = $(this).attr('data-icon'); 112 var nType = $(this).attr('data-type'); 113 var nAnimIn = $(this).attr('data-animation-in'); 114 var nAnimOut = $(this).attr('data-animation-out'); 115 116 notify(nFrom, nAlign, nIcons, nType, nAnimIn, nAnimOut); 117 }); 118 119 120 /*-------------------------------------- 121 Sweet Alert Dialogs 122 ---------------------------------------*/ 123 124 //Basic 125 $('#sa-basic').click(function(){ 126 swal("Here's a message!"); 127 }); 128 129 //A title with a text under 130 $('#sa-title').click(function(){ 131 swal( 132 "Here's a message!", 133 "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed lorem erat, tincidunt vitae ipsum et, pellentesque maximus enim. Mauris eleifend ex semper, lobortis purus sed, pharetra felis" 134 ) 135 }); 136 137 //Success Message 138 $('#sa-success').click(function(){ 139 swal( 140 "Good job!", 141 "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed lorem erat, tincidunt vitae ipsum et, pellentesque maximus enim. Mauris eleifend ex semper, lobortis purus sed, pharetra felis", 142 "success" 143 ) 144 }); 145 146 //Warning Message 147 $('#sa-warning').click(function(){ 148 swal( 149 "Not a good sign...", 150 "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed lorem erat, tincidunt vitae ipsum et, pellentesque maximus enim. Mauris eleifend ex semper, lobortis purus sed, pharetra felis", 151 "warning" 152 ) 153 }); 154 155 //Question Message 156 $('#sa-question').click(function(){ 157 swal( 158 "Hmm.. what did you say?", 159 "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed lorem erat, tincidunt vitae ipsum et, pellentesque maximus enim. Mauris eleifend ex semper, lobortis purus sed, pharetra felis", 160 "question" 161 ) 162 }); 163 164 //Warning Message with function 165 $('#sa-function').click(function(){ 166 swal({ 167 title: "Are you sure?",
168 text: "You will not be able to recover this imaginary file!", 169 type: "warning", 170 showCancelButton: true, 171 confirmButtonColor: "#DD6B55", 172 confirmButtonText: "Yes, delete it!" 173 }).then(function(){ 174 swal( 175 "Deleted!", 176 "Your imaginary file has been deleted.", 177 "success" 178 ); 179 }); 180 }); 181 182 //Custom Image 183 $('#sa-image').click(function(){ 184 swal({ 185 title: "Sweet!", 186 text: "Here's a custom image.", 187 imageUrl: "demo/img/thumbs-up.png" 188 }); 189 }); 190 191 //Auto Close Timer 192 $('#sa-close').click(function(){ 193 swal({ 194 title: "Auto close alert!", 195 text: "I will close in 2 seconds.", 196 timer: 2000, 197 showConfirmButton: false 198 }); 199 }); 200 201 202 /*--------------------------------------------------------- 203 NoUiSlider 204 ----------------------------------------------------------*/ 205 //Basic 206 if($('#slider-basic')[0]) { 207 var sliderBasic = document.getElementById('slider-basic'); 208 noUiSlider.create(sliderBasic, { 209 start: 100, 210 connect: true, 211 range: { 212 'min': 0, 213 'max': 1000 214 } 215 }); 216 } 217 218 //Range Slider 219 if($('#slider-range')[0]) { 220 var sliderRange = document.getElementById('slider-range'); 221 noUiSlider.create(sliderRange, { 222 start: [20, 80], 223 connect: true, 224 range: { 225 'min': 0, 226 'max': 100 227 } 228 }); 229 } 230 231 //Output Values 232 if($('#slider-complete')[0]) { 233 var sliderComplete = document.getElementById('slider-complete'); 234 var sliderCompleteValues = [ 235 document.getElementById('slider-complete-upper'), 236 document.getElementById('slider-complete-lower') 237 ] 238 239 noUiSlider.create (sliderComplete, { 240 start: [12000, 70000], 241 connect: true, 242 range: { 243 'min': 12000, 244 'max': 70000 245 } 246 }); 247 248 sliderComplete.noUiSlider.on('update', function( values, handle ) { 249 sliderCompleteValues[handle].innerHTML = values[handle]; 250 }); 251 } 252 253}); 254
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.