From 41f8eec259c2b35710cac33703f5332af2ae868c Mon Sep 17 00:00:00 2001 From: Felix Niklas Date: Tue, 29 Sep 2015 17:12:59 +0200 Subject: [PATCH] change notify style --- .../app/controllers/widget/notify.coffee | 29 +- .../javascripts/app/lib/base/jquery.noty.js | 1203 ++++++++++++++--- app/assets/stylesheets/application.css | 3 - app/assets/stylesheets/jquery.noty.css | 105 -- app/assets/stylesheets/medium.css | 44 - app/assets/stylesheets/noty_theme_twitter.css | 129 -- app/assets/stylesheets/zammad.scss | 87 ++ 7 files changed, 1112 insertions(+), 488 deletions(-) delete mode 100644 app/assets/stylesheets/jquery.noty.css delete mode 100644 app/assets/stylesheets/medium.css delete mode 100644 app/assets/stylesheets/noty_theme_twitter.css diff --git a/app/assets/javascripts/app/controllers/widget/notify.coffee b/app/assets/javascripts/app/controllers/widget/notify.coffee index 3942bb6d4..cecaeb8b4 100644 --- a/app/assets/javascripts/app/controllers/widget/notify.coffee +++ b/app/assets/javascripts/app/controllers/widget/notify.coffee @@ -36,27 +36,14 @@ class App.Notify extends App.ControllerWidgetPermanent $.noty.closeAll() if data.link data.msg = '' + data.msg + '' - $('#notify').noty( - { - dismissQueue: true - text: data.msg - layout: 'top' - type: data.type - theme: 'noty_theme_twitter' - animateOpen: { - height: 'toggle' - opacity: 0.85, - }, - animateClose: { - opacity: 0.25 - }, - speed: 450 - timeout: data.timeout || 3800 - closeButton: false - closeOnSelfClick: true - closeOnSelfOver: false - } - ) + $('#notify').noty + text: data.msg + type: data.type + animation: + open: 'animated fadeInDown' + close: 'animated fadeOutDown' + timeout: data.timeout || 3800 + closeWith: ['click'] destroy: (e) -> e.preventDefault() diff --git a/app/assets/javascripts/app/lib/base/jquery.noty.js b/app/assets/javascripts/app/lib/base/jquery.noty.js index 05b7b4ba0..0c00f422e 100644 --- a/app/assets/javascripts/app/lib/base/jquery.noty.js +++ b/app/assets/javascripts/app/lib/base/jquery.noty.js @@ -1,220 +1,1051 @@ -/** -* jQuery Noty Plugin v1.1.1 -* Authors: Nedim Arabacı (http://ned.im), Muhittin Özer (http://muhittinozer.com) -* -* Examples and Documentation - http://needim.github.com/noty/ -* -* Licensed under the MIT licenses: -* http://www.opensource.org/licenses/mit-license.php -* -**/ -(function($) { - $.noty = function(options, customContainer) { +!function(root, factory) { + if (typeof define === 'function' && define.amd) { + define(['jquery'], factory); + } else if (typeof exports === 'object') { + module.exports = factory(require('jquery')); + } else { + factory(root.jQuery); + } +}(this, function($) { - var base = this; - var $noty = null; - var isCustom = false; +/*! + @package noty - jQuery Notification Plugin + @version version: 2.3.7 + @contributors https://github.com/needim/noty/graphs/contributors - base.init = function(options) { - base.options = $.extend({}, $.noty.defaultOptions, options); - base.options.type = base.options.cssPrefix+base.options.type; - base.options.id = base.options.type+'_'+new Date().getTime(); - base.options.layout = base.options.cssPrefix+'layout_'+base.options.layout; + @documentation Examples and Documentation - http://needim.github.com/noty/ - if (base.options.custom.container) customContainer = base.options.custom.container; - isCustom = ($.type(customContainer) === 'object') ? true : false; + @license Licensed under the MIT licenses: http://www.opensource.org/licenses/mit-license.php + */ - return base.addQueue(); - }; + if(typeof Object.create !== 'function') { + Object.create = function(o) { + function F() { + } - // Push notification to queue - base.addQueue = function() { - var isGrowl = ($.inArray(base.options.layout, $.noty.growls) == -1) ? false : true; - if (!isGrowl) (base.options.force) ? $.noty.queue.unshift({options: base.options}) : $.noty.queue.push({options: base.options}); - return base.render(isGrowl); - }; + F.prototype = o; + return new F(); + }; + } - // Render the noty - base.render = function(isGrowl) { + var NotyObject = { - // Layout spesific container settings - var container = (isCustom) ? customContainer.addClass(base.options.theme+' '+base.options.layout+' noty_custom_container') : $('body'); - if (isGrowl) { - if ($('ul.noty_cont.' + base.options.layout).length == 0) - container.prepend($('