1var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); 2 3function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } 4 5// Generated by CoffeeScript 2.1.0 6(function () { 7 /* 8 jQuery Growl 9 Copyright 2015 Kevin Sylvestre 10 1.3.5 11 */ 12 "use strict"; 13 14 var $, Animation, Growl; 15 16 $ = jQuery; 17 18 Animation = function () { 19 var Animation = function () { 20 function Animation() { 21 _classCallCheck(this, Animation); 22 } 23 24 _createClass(Animation, null, [{ 25 key: "transition", 26 value: function transition($el) { 27 var el, ref, result, type; 28 el = $el[0]; 29 ref = this.transitions; 30 for (type in ref) { 31 result = ref[type]; 32 if (el.style[type] != null) { 33 return result; 34 } 35 } 36 } 37 }]); 38 39 return Animation; 40 }(); 41 42 ; 43 44 Animation.transitions = { 45 "webkitTransition": "webkitTransitionEnd", 46 "mozTransition": "mozTransitionEnd", 47 "oTransition": "oTransitionEnd", 48 "transition": "transitionend" 49 }; 50 51 return Animation; 52 }(); 53 54 Growl = function () { 55 var Growl = function () { 56 _createClass(Growl, null, [{ 57 key: "growl", 58 value: function growl() { 59 var settings = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; 60 61 return new Growl(settings); 62 } 63 }]); 64 65 function Growl() { 66 var settings = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; 67 68 _classCallCheck(this, Growl); 69 70 this.render = this.render.bind(this); 71 this.bind = this.bind.bind(this); 72 this.unbind = this.unbind.bind(this); 73 this.mouseEnter = this.mouseEnter.bind(this); 74 this.mouseLeave = this.mouseLeave.bind(this); 75 this.click = this.click.bind(this); 76 this.close = this.close.bind(this); 77 this.cycle = this.cycle.bind(this); 78 this.waitAndDismiss = this.waitAndDismiss.bind(this); 79 this.present = this.present.bind(this); 80 this.dismiss = this.dismiss.bind(this); 81 this.remove = this.remove.bind(this); 82 this.animate = this.animate.bind(this); 83 this.$growls = this.$growls.bind(this); 84 this.$growl = this.$growl.bind(this); 85 this.html = this.html.bind(this); 86 this.content = this.content.bind(this); 87 this.container = this.container.bind(this); 88 this.settings = $.extend({}, Growl.settings, settings); 89 this.initialize(this.settings.location); 90 this.render(); 91 } 92 93 _createClass(Growl, [{ 94 key: "initialize", 95 value: function initialize(location) { 96 var id; 97 id = 'growls-' + location; 98 return $('body:not(:has(#' + id + '))').append('<div id="' + id + '" />'); 99 } 100 }, { 101 key: "render", 102 value: function render() { 103 var $growl; 104 $growl = this.$growl(); 105 this.$growls(this.settings.location).append($growl); 106 if (this.settings.fixed) { 107 this.present(); 108 } else { 109 this.cycle(); 110 } 111 } 112 }, { 113 key: "bind", 114 value: function bind() { 115 var $growl = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.$growl(); 116 117 $growl.on("click", this.click); 118 if (this.settings.delayOnHover) { 119 $growl.on("mouseenter", this.mouseEnter); 120 $growl.on("mouseleave", this.mouseLeave); 121 } 122 return $growl.on("contextmenu", this.close).find("." + this.settings.namespace + "-close").on("click", this.close); 123 } 124 }, { 125 key: "unbind", 126 value: function unbind() { 127 var $growl = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : this.$growl(); 128 129 $growl.off("click", this.click); 130 if (this.settings.delayOnHover) { 131 $growl.off("mouseenter", this.mouseEnter); 132 $growl.off("mouseleave", this.mouseLeave); 133 } 134 return $growl.off("contextmenu", this.close).find("." + this.settings.namespace + "-close").off("click", this.close); 135 } 136 }, { 137 key: "mouseEnter", 138 value: function mouseEnter(event) { 139 var $growl; 140 $growl = this.$growl(); 141 return $growl.stop(true, true); 142 } 143 }, { 144 key: "mouseLeave", 145 value: function mouseLeave(event) { 146 return this.waitAndDismiss(); 147 } 148 }, { 149 key: "click", 150 value: function click(event) { 151 if (this.settings.url != null) { 152 event.preventDefault(); 153 event.stopPropagation(); 154 return window.open(this.settings.url); 155 } 156 } 157 }, { 158 key: "close", 159 value: function close(event) { 160 var $growl; 161 var closedByCookie = this.settings.closeCookie; 162 event.preventDefault(); 163 event.stopPropagation(); 164 $growl = this.$growl(); 165 if(closedByCookie) { 166 document.cookie = "isclosed=yes; max-age=86400; path=/"; 167 } 168 sessionStorage.setItem('isread', 'yes'); 169 return $growl.stop().queue(this.dismiss).queue(this.remove); 170 } 171 }, { 172 key: "cycle", 173 value: function cycle() { 174 var $growl; 175 $growl = this.$growl(); 176 return $growl.queue(this.present).queue(this.waitAndDismiss()); 177 } 178 }, { 179 key: "waitAndDismiss", 180 value: function waitAndDismiss() { 181 var $growl; 182 $growl = this.$growl(); 183 return $growl.delay(this.settings.duration).queue(this.dismiss).queue(this.remove); 184 } 185 }, { 186 key: "present", 187 value: function present(callback) { 188 var $growl; 189 $growl = this.$growl(); 190 this.bind($growl); 191 return this.animate($growl, this.settings.namespace + "-incoming", 'out',
191callback); 192 } 193 }, { 194 key: "dismiss", 195 value: function dismiss(callback) { 196 var $growl; 197 $growl = this.$growl(); 198 this.unbind($growl); 199 return this.animate($growl, this.settings.namespace + "-outgoing", 'in', callback); 200 } 201 }, { 202 key: "remove", 203 value: function remove(callback) { 204 this.$growl().remove(); 205 return typeof callback === "function" ? callback() : void 0; 206 } 207 }, { 208 key: "animate", 209 value: function animate($element, name) { 210 var direction = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'in'; 211 var callback = arguments[3]; 212 213 var transition; 214 transition = Animation.transition($element); 215 $element[direction === 'in' ? 'removeClass' : 'addClass'](name); 216 $element.offset().position; 217 $element[direction === 'in' ? 'addClass' : 'removeClass'](name); 218 if (callback == null) { 219 return; 220 } 221 if (transition != null) { 222 $element.one(transition, callback); 223 } else { 224 callback(); 225 } 226 } 227 }, { 228 key: "$growls", 229 value: function $growls(location) { 230 var base; 231 if (this.$_growls == null) { 232 this.$_growls = []; 233 } 234 return (base = this.$_growls)[location] != null ? base[location] : base[location] = $('#growls-' + location); 235 } 236 }, { 237 key: "$growl", 238 value: function $growl() { 239 return this.$_growl != null ? this.$_growl : this.$_growl = $(this.html()); 240 } 241 }, { 242 key: "html", 243 value: function html() { 244 return this.container(this.content()); 245 } 246 }, { 247 key: "content", 248 value: function content() { 249 return "<div class='" + this.settings.namespace + "-close'>" + this.settings.close + "</div>\n<div class='" + this.settings.namespace + "-title'>" + this.settings.title + "</div>\n<div class='" + this.settings.namespace + "-message'>" + this.settings.message + "</div>"; 250 } 251 }, { 252 key: "container", 253 value: function container(content) { 254 return "<div class='" + this.settings.namespace + " " + this.settings.namespace + "-" + this.settings.style + " " + this.settings.namespace + "-" + this.settings.size + "'>\n " + content + "\n</div>"; 255 } 256 }]); 257 258 return Growl; 259 }(); 260 261 ; 262 263 Growl.settings = { 264 namespace: 'growl', 265 duration: 3200, 266 close: "×", 267 location: "default", 268 style: "default", 269 size: "medium", 270 delayOnHover: true, 271 closeCookie: false 272 }; 273 274 return Growl; 275 }(); 276 277 this.Growl = Growl; 278 279 $.growl = function () { 280 var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; 281 282 return Growl.growl(options); 283 }; 284 285 $.growl.error = function () { 286 var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; 287 288 var settings; 289 settings = { 290 title: "Error!", 291 style: "error" 292 }; 293 return $.growl($.extend(settings, options)); 294 }; 295 296 $.growl.notice = function () { 297 var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; 298 299 var settings; 300 settings = { 301 title: "Notice!", 302 style: "notice" 303 }; 304 return $.growl($.extend(settings, options)); 305 }; 306 307 $.growl.warning = function () { 308 var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; 309 310 var settings; 311 settings = { 312 title: "Warning!", 313 style: "warning" 314 }; 315 return $.growl($.extend(settings, options)); 316 }; 317}).call(this);
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.