{I" class:ETI"ProcessedAsset; FI"logical_path; TI"'hatchy/libraries/pnotify.custom.js; FI" pathname; TI"p/home/bauser/Documents/dev/ruby/opensource/hatchy/app/assets/javascripts/hatchy/libraries/pnotify.custom.js; FI"content_type; TI"application/javascript; TI" mtime; Tl+R_”VI"length; TiãI"digest; TI"%72c4d8427d128d2fc701e6c9dcc91b2e; FI"source; TI"ã/* PNotify 2.1.0 sciactive.com/pnotify/ (C) 2015 Hunter Perrin license GPL/LGPL/MPL */ /* * ====== PNotify ====== * * http://sciactive.com/pnotify/ * * Copyright 2009-2015 Hunter Perrin * * Triple licensed under the GPL, LGPL, and MPL. * http://gnu.org/licenses/gpl.html * http://gnu.org/licenses/lgpl.html * http://mozilla.org/MPL/MPL-1.1.html */ (function (factory) { if (typeof exports === 'object' && typeof module !== 'undefined') { // CommonJS module.exports = factory(require('jquery')); } else if (typeof define === 'function' && define.amd) { // AMD. Register as a module. define('pnotify', ['jquery'], factory); } else { // Browser globals factory(jQuery); } }(function($){ var default_stack = { dir1: "down", dir2: "left", push: "bottom", spacing1: 25, spacing2: 25, context: $("body") }; var posTimer, // Position all timer. body, jwindow = $(window); // Set global variables. var do_when_ready = function(){ body = $("body"); PNotify.prototype.options.stack.context = body; jwindow = $(window); // Reposition the notices when the window resizes. jwindow.bind('resize', function(){ if (posTimer) { clearTimeout(posTimer); } posTimer = setTimeout(function(){ PNotify.positionAll(true); }, 10); }); }; PNotify = function(options){ this.parseOptions(options); this.init(); }; $.extend(PNotify.prototype, { // The current version of PNotify. version: "2.1.0", // === Options === // Options defaults. options: { // The notice's title. title: false, // Whether to escape the content of the title. (Not allow HTML.) title_escape: false, // The notice's text. text: false, // Whether to escape the content of the text. (Not allow HTML.) text_escape: false, // What styling classes to use. (Can be either "brighttheme", "jqueryui", "bootstrap2", "bootstrap3", or "fontawesome".) styling: "brighttheme", // Additional classes to be added to the notice. (For custom styling.) addclass: "", // Class to be added to the notice for corner styling. cornerclass: "", // Display the notice when it is created. auto_display: true, // Width of the notice. width: "300px", // Minimum height of the notice. It will expand to fit content. min_height: "16px", // Type of the notice. "notice", "info", "success", or "error". type: "notice", // Set icon to true to use the default icon for the selected // style/type, false for no icon, or a string for your own icon class. icon: true, // Opacity of the notice. opacity: 1, // The animation to use when displaying and hiding the notice. "none", // "show", "fade", and "slide" are built in to jQuery. Others require jQuery // UI. Use an object with effect_in and effect_out to use different effects. animation: "fade", // Speed at which the notice animates in and out. "slow", "def" or "normal", // "fast" or number of milliseconds. animate_speed: "slow", // Specify a specific duration of position animation position_animate_speed: 500, // Display a drop shadow. shadow: true, // After a delay, remove the notice. hide: true, // Delay in milliseconds before the notice is removed. delay: 8000, // Reset the hide timer if the mouse moves over the notice. mouse_reset: true, // Remove the notice's elements from the DOM after it is removed. remove: true, // Change new lines to br tags. insert_brs: true, // Whether to remove notices from the global array. destroy: true, // The stack on which the notices will be placed. Also controls the // direction the notices stack. stack: default_stack }, // === Modules === // This object holds all the PNotify modules. They are used to provide // additional functionality. modules: {}, // This runs an event on all the modules. runModules: function(event, arg){ var curArg; for (var module in this.modules) { curArg = ((typeof arg === "object" && module in arg) ? arg[module] : arg); if (typeof this.modules[module][event] === 'function') { this.modules[module][event](this, typeof this.options[module] === 'object' ? this.options[module] : {}, curArg); } } }, // === Class Variables === state: "initializing", // The state can be "initializing", "opening", "open", "closing", and "closed". timer: null, // Auto close timer. styles: null, elem: null, container: null, title_container: null, text_container: null, animating: false, // Stores what is currently being animated (in or out). timerHide: false, // Stores whether the notice was hidden by a timer. // === Events === init: function(){ var that = this; // First and foremost, we don't want our module objects all referencing the prototype. this.modules = {}; $.extend(true, this.modules, PNotify.prototype.modules); // Get our styling object. if (typeof this.options.styling === "object") { this.styles = this.options.styling; } else { this.styles = PNotify.styling[this.options.styling]; } // Create our widget. // Stop animation, reset the removal timer when the user mouses over. this.elem = $("
", { "class": "ui-pnotify "+this.options.addclass, "css": {"display": "none"}, "aria-live": "assertive", "mouseenter": function(e){ if (that.options.mouse_reset && that.animating === "out") { if (!that.timerHide) { return; } that.cancelRemove(); } // Stop the close timer. if (that.options.hide && that.options.mouse_reset) { that.cancelRemove(); } }, "mouseleave": function(e){ // Start the close timer. if (that.options.hide && that.options.mouse_reset && that.animating !== "out") { that.queueRemove(); } PNotify.positionAll(); } }); // Create a container for the notice contents. this.container = $("", { "class": this.styles.container+" ui-pnotify-container "+(this.options.type === "error" ? this.styles.error : (this.options.type === "info" ? this.styles.info : (this.options.type === "success" ? this.styles.success : this.styles.notice))), "role": "alert" }).appendTo(this.elem); if (this.options.cornerclass !== "") { this.container.removeClass("ui-corner-all").addClass(this.options.cornerclass); } // Create a drop shadow. if (this.options.shadow) { this.container.addClass("ui-pnotify-shadow"); } // Add the appropriate icon. if (this.options.icon !== false) { $("", {"class": "ui-pnotify-icon"}) .append($("", {"class": this.options.icon === true ? (this.options.type === "error" ? this.styles.error_icon : (this.options.type === "info" ? this.styles.info_icon : (this.options.type === "success" ? this.styles.success_icon : this.styles.notice_icon))) : this.options.icon})) .prependTo(this.container); } // Add a title. this.title_container = $("", { "class": "ui-pnotify-title" }) .appendTo(this.container); if (this.options.title === false) { this.title_container.hide(); } else if (this.options.title_escape) { this.title_container.text(this.options.title); } else { this.title_container.html(this.options.title); } // Add text. this.text_container = $("", { "class": "ui-pnotify-text" }) .appendTo(this.container); if (this.options.text === false) { this.text_container.hide(); } else if (this.options.text_escape) { this.text_container.text(this.options.text); } else { this.text_container.html(this.options.insert_brs ? String(this.options.text).replace(/\n/g, "