├── .gitignore ├── LICENSE ├── NotificationsModule.php ├── README.md ├── assets ├── jquery.timeago.js ├── locales │ ├── README.md │ ├── jquery.timeago.ar.js │ ├── jquery.timeago.bg.js │ ├── jquery.timeago.bs.js │ ├── jquery.timeago.ca.js │ ├── jquery.timeago.cs.js │ ├── jquery.timeago.cy.js │ ├── jquery.timeago.da.js │ ├── jquery.timeago.de.js │ ├── jquery.timeago.dv.js │ ├── jquery.timeago.el.js │ ├── jquery.timeago.en-short.js │ ├── jquery.timeago.en.js │ ├── jquery.timeago.es-short.js │ ├── jquery.timeago.es.js │ ├── jquery.timeago.et.js │ ├── jquery.timeago.fa.js │ ├── jquery.timeago.fi.js │ ├── jquery.timeago.fr-short.js │ ├── jquery.timeago.fr.js │ ├── jquery.timeago.gl.js │ ├── jquery.timeago.he.js │ ├── jquery.timeago.hr.js │ ├── jquery.timeago.hu.js │ ├── jquery.timeago.hy.js │ ├── jquery.timeago.id.js │ ├── jquery.timeago.is.js │ ├── jquery.timeago.it-short.js │ ├── jquery.timeago.it.js │ ├── jquery.timeago.ja.js │ ├── jquery.timeago.jv.js │ ├── jquery.timeago.ko.js │ ├── jquery.timeago.ky.js │ ├── jquery.timeago.lt.js │ ├── jquery.timeago.mk.js │ ├── jquery.timeago.nl.js │ ├── jquery.timeago.no.js │ ├── jquery.timeago.pl.js │ ├── jquery.timeago.pt-br-short.js │ ├── jquery.timeago.pt-br.js │ ├── jquery.timeago.pt.js │ ├── jquery.timeago.ro.js │ ├── jquery.timeago.rs.js │ ├── jquery.timeago.ru.js │ ├── jquery.timeago.rw.js │ ├── jquery.timeago.si.js │ ├── jquery.timeago.sk.js │ ├── jquery.timeago.sl.js │ ├── jquery.timeago.sv.js │ ├── jquery.timeago.th.js │ ├── jquery.timeago.tr.js │ ├── jquery.timeago.uk.js │ ├── jquery.timeago.uz.js │ ├── jquery.timeago.vi.js │ ├── jquery.timeago.zh-CN.js │ └── jquery.timeago.zh-TW.js ├── notifications.css ├── notifications.js ├── notifications.less └── themes │ ├── growl.css │ ├── growl.js │ ├── notie.css │ ├── notie.js │ ├── notifit.css │ ├── notifit.js │ ├── notify.js │ ├── noty.js │ ├── pnotify.css │ ├── pnotify.js │ ├── toastr.css │ └── toastr.js ├── commands └── NotificationsController.php ├── composer.json ├── controllers └── NotificationsController.php ├── docs ├── Concept.md ├── Configuration.md ├── Contributors.md ├── Installation.md ├── README.md ├── Todo.md ├── Usage.md ├── growl.png ├── list.png └── main.png ├── migrations ├── m151008_162401_create_notification_table.php ├── m160509_211405_add_flashed_to_notification.php └── m160921_171124_alter_notification_table.php ├── models └── Notification.php └── widgets ├── NotificationsAsset.php └── NotificationsWidget.php /.gitignore: -------------------------------------------------------------------------------- 1 | composer.phar 2 | vendor/ 3 | .idea 4 | 5 | # Commit your application's lock file http://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file 6 | # You may choose to ignore a library lock file http://getcomposer.org/doc/02-libraries.md#lock-file 7 | # composer.lock 8 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2017 Mehdi Achour 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 | 23 | -------------------------------------------------------------------------------- /NotificationsModule.php: -------------------------------------------------------------------------------- 1 | userId)) { 48 | $this->userId = call_user_func($this->userId); 49 | } 50 | parent::init(); 51 | 52 | if (Yii::$app instanceof \yii\console\Application) { 53 | $this->controllerNamespace = 'machour\yii2\notifications\commands'; 54 | } 55 | } 56 | 57 | /** 58 | * Creates a notification 59 | * 60 | * @param Notification $notification The notification class 61 | * @param string $key The notification key 62 | * @param integer $user_id The user id that will get the notification 63 | * @param string $key_id The key unique id 64 | * @param string $type The notification type 65 | * @return bool Returns TRUE on success, FALSE on failure 66 | * @throws Exception 67 | */ 68 | public static function notify($notification, $key, $user_id, $key_id = null, $type = Notification::TYPE_DEFAULT) 69 | { 70 | 71 | if (!in_array($key, $notification::$keys)) { 72 | throw new Exception("Not a registered notification key: $key"); 73 | } 74 | 75 | if (!in_array($type, Notification::$types)) { 76 | throw new Exception("Unknown notification type: $type"); 77 | } 78 | 79 | /** @var Notification $instance */ 80 | $instance = $notification::findOne(['user_id' => $user_id, 'key' => $key, 'key_id' => (string)$key_id]); 81 | if (!$instance || \Yii::$app->getModule('notifications')->allowDuplicate) { 82 | $instance = new $notification([ 83 | 'key' => $key, 84 | 'type' => $type, 85 | 'seen' => 0, 86 | 'flashed' => 0, 87 | 'user_id' => $user_id, 88 | 'key_id' => (string)$key_id, 89 | 'created_at' => new Expression('NOW()'), 90 | ]); 91 | return $instance->save(); 92 | } 93 | return true; 94 | } 95 | } 96 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | A complete notifications module for your Yii 2 powered application. 2 | 3 | [![Latest Stable Version](https://poser.pugx.org/machour/yii2-notifications/v/stable)](https://packagist.org/packages/machour/yii2-notifications) 4 | [![Total Downloads](https://poser.pugx.org/machour/yii2-notifications/downloads)](https://packagist.org/packages/machour/yii2-notifications) 5 | [![Latest Unstable Version](https://poser.pugx.org/machour/yii2-notifications/v/unstable)](https://packagist.org/packages/machour/yii2-notifications) 6 | [![License](https://poser.pugx.org/machour/yii2-notifications/license)](https://packagist.org/packages/machour/yii2-notifications) 7 | 8 | This module will install it's own table, and quickly allow you to: 9 | 10 | * Trigger notifications to your users 11 | * Toast these notifications on the screen using one of the supported UI libraries 12 | * Manage a HTML list of notifications 13 | 14 | ![Growl notification](docs/main.png) 15 | 16 | A documentation is available in the [docs](docs/README.md) folder of this repository. 17 | You can also check this [live demo](https://machour.idk.tn/yii2-kitchen-sink/site/yii2-notifications). 18 | -------------------------------------------------------------------------------- /assets/jquery.timeago.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Timeago is a jQuery plugin that makes it easy to support automatically 3 | * updating fuzzy timestamps (e.g. "4 minutes ago" or "about 1 day ago"). 4 | * 5 | * @name timeago 6 | * @version 1.4.3 7 | * @requires jQuery v1.2.3+ 8 | * @author Ryan McGeary 9 | * @license MIT License - http://www.opensource.org/licenses/mit-license.php 10 | * 11 | * For usage and examples, visit: 12 | * http://timeago.yarp.com/ 13 | * 14 | * Copyright (c) 2008-2015, Ryan McGeary (ryan -[at]- mcgeary [*dot*] org) 15 | */ 16 | 17 | (function (factory) { 18 | if (typeof define === 'function' && define.amd) { 19 | // AMD. Register as an anonymous module. 20 | define(['jquery'], factory); 21 | } else if (typeof module === 'object' && typeof module.exports === 'object') { 22 | factory(require('jquery')); 23 | } else { 24 | // Browser globals 25 | factory(jQuery); 26 | } 27 | }(function ($) { 28 | $.timeago = function(timestamp) { 29 | if (timestamp instanceof Date) { 30 | return inWords(timestamp); 31 | } else if (typeof timestamp === "string") { 32 | return inWords($.timeago.parse(timestamp)); 33 | } else if (typeof timestamp === "number") { 34 | return inWords(new Date(timestamp)); 35 | } else { 36 | return inWords($.timeago.datetime(timestamp)); 37 | } 38 | }; 39 | var $t = $.timeago; 40 | 41 | $.extend($.timeago, { 42 | settings: { 43 | refreshMillis: 60000, 44 | allowPast: true, 45 | allowFuture: false, 46 | localeTitle: false, 47 | cutoff: 0, 48 | strings: { 49 | prefixAgo: null, 50 | prefixFromNow: null, 51 | suffixAgo: "ago", 52 | suffixFromNow: "from now", 53 | inPast: 'any moment now', 54 | seconds: "less than a minute", 55 | minute: "about a minute", 56 | minutes: "%d minutes", 57 | hour: "about an hour", 58 | hours: "about %d hours", 59 | day: "a day", 60 | days: "%d days", 61 | month: "about a month", 62 | months: "%d months", 63 | year: "about a year", 64 | years: "%d years", 65 | wordSeparator: " ", 66 | numbers: [] 67 | } 68 | }, 69 | 70 | inWords: function(distanceMillis) { 71 | if(!this.settings.allowPast && ! this.settings.allowFuture) { 72 | throw 'timeago allowPast and allowFuture settings can not both be set to false.'; 73 | } 74 | 75 | var $l = this.settings.strings; 76 | var prefix = $l.prefixAgo; 77 | var suffix = $l.suffixAgo; 78 | if (this.settings.allowFuture) { 79 | if (distanceMillis < 0) { 80 | prefix = $l.prefixFromNow; 81 | suffix = $l.suffixFromNow; 82 | } 83 | } 84 | 85 | if(!this.settings.allowPast && distanceMillis >= 0) { 86 | return this.settings.strings.inPast; 87 | } 88 | 89 | var seconds = Math.abs(distanceMillis) / 1000; 90 | var minutes = seconds / 60; 91 | var hours = minutes / 60; 92 | var days = hours / 24; 93 | var years = days / 365; 94 | 95 | function substitute(stringOrFunction, number) { 96 | var string = $.isFunction(stringOrFunction) ? stringOrFunction(number, distanceMillis) : stringOrFunction; 97 | var value = ($l.numbers && $l.numbers[number]) || number; 98 | return string.replace(/%d/i, value); 99 | } 100 | 101 | var words = seconds < 45 && substitute($l.seconds, Math.round(seconds)) || 102 | seconds < 90 && substitute($l.minute, 1) || 103 | minutes < 45 && substitute($l.minutes, Math.round(minutes)) || 104 | minutes < 90 && substitute($l.hour, 1) || 105 | hours < 24 && substitute($l.hours, Math.round(hours)) || 106 | hours < 42 && substitute($l.day, 1) || 107 | days < 30 && substitute($l.days, Math.round(days)) || 108 | days < 45 && substitute($l.month, 1) || 109 | days < 365 && substitute($l.months, Math.round(days / 30)) || 110 | years < 1.5 && substitute($l.year, 1) || 111 | substitute($l.years, Math.round(years)); 112 | 113 | var separator = $l.wordSeparator || ""; 114 | if ($l.wordSeparator === undefined) { separator = " "; } 115 | return $.trim([prefix, words, suffix].join(separator)); 116 | }, 117 | 118 | parse: function(iso8601) { 119 | var s = $.trim(iso8601); 120 | s = s.replace(/\.\d+/,""); // remove milliseconds 121 | s = s.replace(/-/,"/").replace(/-/,"/"); 122 | s = s.replace(/T/," ").replace(/Z/," UTC"); 123 | s = s.replace(/([\+\-]\d\d)\:?(\d\d)/," $1$2"); // -04:00 -> -0400 124 | s = s.replace(/([\+\-]\d\d)$/," $100"); // +09 -> +0900 125 | return new Date(s); 126 | }, 127 | datetime: function(elem) { 128 | var iso8601 = $t.isTime(elem) ? $(elem).attr("datetime") : $(elem).attr("title"); 129 | return $t.parse(iso8601); 130 | }, 131 | isTime: function(elem) { 132 | // jQuery's `is()` doesn't play well with HTML5 in IE 133 | return $(elem).get(0).tagName.toLowerCase() === "time"; // $(elem).is("time"); 134 | } 135 | }); 136 | 137 | // functions that can be called via $(el).timeago('action') 138 | // init is default when no action is given 139 | // functions are called with context of a single element 140 | var functions = { 141 | init: function(){ 142 | var refresh_el = $.proxy(refresh, this); 143 | refresh_el(); 144 | var $s = $t.settings; 145 | if ($s.refreshMillis > 0) { 146 | this._timeagoInterval = setInterval(refresh_el, $s.refreshMillis); 147 | } 148 | }, 149 | update: function(time){ 150 | var parsedTime = $t.parse(time); 151 | $(this).data('timeago', { datetime: parsedTime }); 152 | if($t.settings.localeTitle) $(this).attr("title", parsedTime.toLocaleString()); 153 | refresh.apply(this); 154 | }, 155 | updateFromDOM: function(){ 156 | $(this).data('timeago', { datetime: $t.parse( $t.isTime(this) ? $(this).attr("datetime") : $(this).attr("title") ) }); 157 | refresh.apply(this); 158 | }, 159 | dispose: function () { 160 | if (this._timeagoInterval) { 161 | window.clearInterval(this._timeagoInterval); 162 | this._timeagoInterval = null; 163 | } 164 | } 165 | }; 166 | 167 | $.fn.timeago = function(action, options) { 168 | var fn = action ? functions[action] : functions.init; 169 | if(!fn){ 170 | throw new Error("Unknown function name '"+ action +"' for timeago"); 171 | } 172 | // each over objects here and call the requested function 173 | this.each(function(){ 174 | fn.call(this, options); 175 | }); 176 | return this; 177 | }; 178 | 179 | function refresh() { 180 | //check if it's still visible 181 | if(!$.contains(document.documentElement,this)){ 182 | //stop if it has been removed 183 | $(this).timeago("dispose"); 184 | return this; 185 | } 186 | 187 | var data = prepareData(this); 188 | var $s = $t.settings; 189 | 190 | if (!isNaN(data.datetime)) { 191 | if ( $s.cutoff == 0 || Math.abs(distance(data.datetime)) < $s.cutoff) { 192 | $(this).text(inWords(data.datetime)); 193 | } 194 | } 195 | return this; 196 | } 197 | 198 | function prepareData(element) { 199 | element = $(element); 200 | if (!element.data("timeago")) { 201 | element.data("timeago", { datetime: $t.datetime(element) }); 202 | var text = $.trim(element.text()); 203 | if ($t.settings.localeTitle) { 204 | element.attr("title", element.data('timeago').datetime.toLocaleString()); 205 | } else if (text.length > 0 && !($t.isTime(element) && element.attr("title"))) { 206 | element.attr("title", text); 207 | } 208 | } 209 | return element.data("timeago"); 210 | } 211 | 212 | function inWords(date) { 213 | return $t.inWords(distance(date)); 214 | } 215 | 216 | function distance(date) { 217 | return (new Date().getTime() - date.getTime()); 218 | } 219 | 220 | // fix for IE6 suckage 221 | document.createElement("abbr"); 222 | document.createElement("time"); 223 | })); 224 | -------------------------------------------------------------------------------- /assets/locales/README.md: -------------------------------------------------------------------------------- 1 | # Locale override examples for timeago 2 | 3 | You can represent time statements in most western languages where 4 | a prefix and/or suffix is used. 5 | 6 | The default case is to use suffix only (as in English), which you 7 | do by providing the `suffixAgo` and `suffixFromNow` settings in 8 | the strings hash (earlier versions of timeago used the deprecated 9 | `ago` and `fromNow` options). If present, they are used. 10 | 11 | 2 minutes [suffixAgo] 12 | 2 minutes [suffixFromNow] 13 | 14 | In case you want to use prefix only instead of 15 | suffix (e.g. Greek), you provide the `prefixAgo` and 16 | `prefixFromNow` options in the strings hash and leave `suffixAgo` 17 | and `suffixFromNow` empty or null. 18 | 19 | [prefixAgo] 2 minutes 20 | [prefixFromNow] 2 minutes 21 | 22 | For languages where you want to use a prefix only for future 23 | tense and prefix/suffix for past tense (for example swedish), you 24 | can combine the prefix and suffixes as needed. 25 | 26 | [prefixAgo] 2 minutes [suffixAgo] 27 | [prefixFromNow] 2 minutes 28 | -------------------------------------------------------------------------------- /assets/locales/jquery.timeago.ar.js: -------------------------------------------------------------------------------- 1 | (function() { 2 | function numpf(n, a) { 3 | return a[plural=n==0 ? 0 : n==1 ? 1 : n==2 ? 2 : n%100>=3 && n%100<=10 ? 3 : n%100>=11 ? 4 : 5]; 4 | } 5 | 6 | jQuery.timeago.settings.strings = { 7 | prefixAgo: "منذ", 8 | prefixFromNow: "بعد", 9 | suffixAgo: null, 10 | suffixFromNow: null, // null OR "من الآن" 11 | second: function(value) { return numpf(value, [ 12 | 'أقل من ثانية', 13 | 'ثانية واحدة', 14 | 'ثانيتين', 15 | '%d ثوانٍ', 16 | '%d ثانية', 17 | '%d ثانية']); }, 18 | seconds: function(value) { return numpf(value, [ 19 | 'أقل من ثانية', 20 | 'ثانية واحدة', 21 | 'ثانيتين', 22 | '%d ثوانٍ', 23 | '%d ثانية', 24 | '%d ثانية']); }, 25 | minute: function(value) { return numpf(value, [ 26 | 'أقل من دقيقة', 27 | 'دقيقة واحدة', 28 | 'دقيقتين', 29 | '%d دقائق', 30 | '%d دقيقة', 31 | 'دقيقة']); }, 32 | minutes: function(value) { return numpf(value, [ 33 | 'أقل من دقيقة', 34 | 'دقيقة واحدة', 35 | 'دقيقتين', 36 | '%d دقائق', 37 | '%d دقيقة', 38 | 'دقيقة']); }, 39 | hour: function(value) { return numpf(value, [ 40 | 'أقل من ساعة', 41 | 'ساعة واحدة', 42 | 'ساعتين', 43 | '%d ساعات', 44 | '%d ساعة', 45 | '%d ساعة']); }, 46 | hours: function(value) { return numpf(value, [ 47 | 'أقل من ساعة', 48 | 'ساعة واحدة', 49 | 'ساعتين', 50 | '%d ساعات', 51 | '%d ساعة', 52 | '%d ساعة']); }, 53 | day: function(value) { return numpf(value, [ 54 | 'أقل من يوم', 55 | 'يوم واحد', 56 | 'يومين', 57 | '%d أيام', 58 | '%d يومًا', 59 | '%d يوم']); }, 60 | days: function(value) { return numpf(value, [ 61 | 'أقل من يوم', 62 | 'يوم واحد', 63 | 'يومين', 64 | '%d أيام', 65 | '%d يومًا', 66 | '%d يوم']); }, 67 | month: function(value) { return numpf(value, [ 68 | 'أقل من شهر', 69 | 'شهر واحد', 70 | 'شهرين', 71 | '%d أشهر', 72 | '%d شهرًا', 73 | '%d شهر']); }, 74 | months: function(value) { return numpf(value, [ 75 | 'أقل من شهر', 76 | 'شهر واحد', 77 | 'شهرين', 78 | '%d أشهر', 79 | '%d شهرًا', 80 | '%d شهر']); }, 81 | year: function(value) { return numpf(value, [ 82 | 'أقل من عام', 83 | 'عام واحد', 84 | '%d عامين', 85 | '%d أعوام', 86 | '%d عامًا']); 87 | }, 88 | years: function(value) { return numpf(value, [ 89 | 'أقل من عام', 90 | 'عام واحد', 91 | 'عامين', 92 | '%d أعوام', 93 | '%d عامًا', 94 | '%d عام']);} 95 | }; 96 | })(); 97 | -------------------------------------------------------------------------------- /assets/locales/jquery.timeago.bg.js: -------------------------------------------------------------------------------- 1 | // Bulgarian 2 | jQuery.timeago.settings.strings = { 3 | prefixAgo: "преди", 4 | prefixFromNow: "след", 5 | suffixAgo: null, 6 | suffixFromNow: null, 7 | seconds: "по-малко от минута", 8 | minute: "една минута", 9 | minutes: "%d минути", 10 | hour: "един час", 11 | hours: "%d часа", 12 | day: "един ден", 13 | days: "%d дни", 14 | month: "един месец", 15 | months: "%d месеца", 16 | year: "една година", 17 | years: "%d години" 18 | }; -------------------------------------------------------------------------------- /assets/locales/jquery.timeago.bs.js: -------------------------------------------------------------------------------- 1 | // Bosnian 2 | (function() { 3 | var numpf; 4 | 5 | numpf = function(n, f, s, t) { 6 | var n10; 7 | n10 = n % 10; 8 | if (n10 === 1 && (n === 1 || n > 20)) { 9 | return f; 10 | } else if (n10 > 1 && n10 < 5 && (n > 20 || n < 10)) { 11 | return s; 12 | } else { 13 | return t; 14 | } 15 | }; 16 | 17 | jQuery.timeago.settings.strings = { 18 | prefixAgo: "prije", 19 | prefixFromNow: "za", 20 | suffixAgo: null, 21 | suffixFromNow: null, 22 | second: "sekund", 23 | seconds: function(value) { 24 | return numpf(value, "%d sekund", "%d sekunde", "%d sekundi"); 25 | }, 26 | minute: "oko minut", 27 | minutes: function(value) { 28 | return numpf(value, "%d minut", "%d minute", "%d minuta"); 29 | }, 30 | hour: "oko sat", 31 | hours: function(value) { 32 | return numpf(value, "%d sat", "%d sata", "%d sati"); 33 | }, 34 | day: "oko jednog dana", 35 | days: function(value) { 36 | return numpf(value, "%d dan", "%d dana", "%d dana"); 37 | }, 38 | month: "mjesec dana", 39 | months: function(value) { 40 | return numpf(value, "%d mjesec", "%d mjeseca", "%d mjeseci"); 41 | }, 42 | year: "prije godinu dana ", 43 | years: function(value) { 44 | return numpf(value, "%d godinu", "%d godine", "%d godina"); 45 | }, 46 | wordSeparator: " " 47 | }; 48 | 49 | }).call(this); -------------------------------------------------------------------------------- /assets/locales/jquery.timeago.ca.js: -------------------------------------------------------------------------------- 1 | // Catalan 2 | jQuery.timeago.settings.strings = { 3 | prefixAgo: "fa", 4 | prefixFromNow: "d'aqui a", 5 | suffixAgo: null, 6 | suffixFromNow: null, 7 | seconds: "menys d'1 minut", 8 | minute: "1 minut", 9 | minutes: "uns %d minuts", 10 | hour: "1 hora", 11 | hours: "unes %d hores", 12 | day: "1 dia", 13 | days: "%d dies", 14 | month: "aproximadament un mes", 15 | months: "%d mesos", 16 | year: "aproximadament un any", 17 | years: "%d anys" 18 | }; -------------------------------------------------------------------------------- /assets/locales/jquery.timeago.cs.js: -------------------------------------------------------------------------------- 1 | // Czech 2 | (function() { 3 | function f(n, d, a) { 4 | return a[d>=0 ? 0 : a.length==2 || n<5 ? 1 : 2]; 5 | } 6 | 7 | jQuery.timeago.settings.strings = { 8 | prefixAgo: 'před', 9 | prefixFromNow: 'za', 10 | suffixAgo: null, 11 | suffixFromNow: null, 12 | seconds: function(n, d) {return f(n, d, ['méně než minutou', 'méně než minutu']);}, 13 | minute: function(n, d) {return f(n, d, ['minutou', 'minutu']);}, 14 | minutes: function(n, d) {return f(n, d, ['%d minutami', '%d minuty', '%d minut']);}, 15 | hour: function(n, d) {return f(n, d, ['hodinou', 'hodinu']);}, 16 | hours: function(n, d) {return f(n, d, ['%d hodinami', '%d hodiny', '%d hodin']);}, 17 | day: function(n, d) {return f(n, d, ['%d dnem', '%d den']);}, 18 | days: function(n, d) {return f(n, d, ['%d dny', '%d dny', '%d dní']);}, 19 | month: function(n, d) {return f(n, d, ['%d měsícem', '%d měsíc']);}, 20 | months: function(n, d) {return f(n, d, ['%d měsíci', '%d měsíce', '%d měsíců']);}, 21 | year: function(n, d) {return f(n, d, ['%d rokem', '%d rok']);}, 22 | years: function(n, d) {return f(n, d, ['%d lety', '%d roky', '%d let']);} 23 | }; 24 | })(); 25 | -------------------------------------------------------------------------------- /assets/locales/jquery.timeago.cy.js: -------------------------------------------------------------------------------- 1 | // Welsh 2 | jQuery.timeago.settings.strings = { 3 | prefixAgo: null, 4 | prefixFromNow: null, 5 | suffixAgo: "yn ôl", 6 | suffixFromNow: "o hyn", 7 | seconds: "llai na munud", 8 | minute: "am funud", 9 | minutes: "%d munud", 10 | hour: "tua awr", 11 | hours: "am %d awr", 12 | day: "y dydd", 13 | days: "%d diwrnod", 14 | month: "tua mis", 15 | months: "%d mis", 16 | year: "am y flwyddyn", 17 | years: "%d blynedd", 18 | wordSeparator: " ", 19 | numbers: [] 20 | }; 21 | -------------------------------------------------------------------------------- /assets/locales/jquery.timeago.da.js: -------------------------------------------------------------------------------- 1 | // Danish 2 | jQuery.timeago.settings.strings = { 3 | prefixAgo: "for", 4 | prefixFromNow: "om", 5 | suffixAgo: "siden", 6 | suffixFromNow: "", 7 | seconds: "mindre end et minut", 8 | minute: "ca. et minut", 9 | minutes: "%d minutter", 10 | hour: "ca. en time", 11 | hours: "ca. %d timer", 12 | day: "en dag", 13 | days: "%d dage", 14 | month: "ca. en måned", 15 | months: "%d måneder", 16 | year: "ca. et år", 17 | years: "%d år" 18 | }; -------------------------------------------------------------------------------- /assets/locales/jquery.timeago.de.js: -------------------------------------------------------------------------------- 1 | // German 2 | jQuery.timeago.settings.strings = { 3 | prefixAgo: "vor", 4 | prefixFromNow: "in", 5 | suffixAgo: "", 6 | suffixFromNow: "", 7 | seconds: "wenigen Sekunden", 8 | minute: "etwa einer Minute", 9 | minutes: "%d Minuten", 10 | hour: "etwa einer Stunde", 11 | hours: "%d Stunden", 12 | day: "etwa einem Tag", 13 | days: "%d Tagen", 14 | month: "etwa einem Monat", 15 | months: "%d Monaten", 16 | year: "etwa einem Jahr", 17 | years: "%d Jahren" 18 | }; -------------------------------------------------------------------------------- /assets/locales/jquery.timeago.dv.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Dhivehi time in Thaana for timeago.js 3 | **/ 4 | jQuery.timeago.settings.strings = { 5 | prefixAgo: null, 6 | prefixFromNow: null, 7 | suffixAgo: "ކުރިން", 8 | suffixFromNow: "ފަހުން", 9 | seconds: "ސިކުންތުކޮޅެއް", 10 | minute: "މިނިޓެއްވަރު", 11 | minutes: "%d މިނިޓު", 12 | hour: "ގަޑިއެއްވަރު", 13 | hours: "ގާތްގަނޑަކަށް %d ގަޑިއިރު", 14 | day: "އެއް ދުވަސް", 15 | days: "މީގެ %d ދުވަސް", 16 | month: "މަހެއްވަރު", 17 | months: "މީގެ %d މަސް", 18 | year: "އަހަރެއްވަރު", 19 | years: "މީގެ %d އަހަރު", 20 | wordSeparator: " ", 21 | numbers: [] 22 | }; 23 | -------------------------------------------------------------------------------- /assets/locales/jquery.timeago.el.js: -------------------------------------------------------------------------------- 1 | // Greek 2 | jQuery.timeago.settings.strings = { 3 | prefixAgo: "πριν", 4 | prefixFromNow: "σε", 5 | suffixAgo: "", 6 | suffixFromNow: "", 7 | seconds: "λιγότερο από ένα λεπτό", 8 | minute: "περίπου ένα λεπτό", 9 | minutes: "%d λεπτά", 10 | hour: "περίπου μία ώρα", 11 | hours: "περίπου %d ώρες", 12 | day: "μία μέρα", 13 | days: "%d μέρες", 14 | month: "περίπου ένα μήνα", 15 | months: "%d μήνες", 16 | year: "περίπου ένα χρόνο", 17 | years: "%d χρόνια" 18 | }; -------------------------------------------------------------------------------- /assets/locales/jquery.timeago.en-short.js: -------------------------------------------------------------------------------- 1 | // English shortened 2 | jQuery.timeago.settings.strings = { 3 | prefixAgo: null, 4 | prefixFromNow: null, 5 | suffixAgo: "", 6 | suffixFromNow: "", 7 | seconds: "1m", 8 | minute: "1m", 9 | minutes: "%dm", 10 | hour: "1h", 11 | hours: "%dh", 12 | day: "1d", 13 | days: "%dd", 14 | month: "1mo", 15 | months: "%dmo", 16 | year: "1yr", 17 | years: "%dyr", 18 | wordSeparator: " ", 19 | numbers: [] 20 | }; 21 | -------------------------------------------------------------------------------- /assets/locales/jquery.timeago.en.js: -------------------------------------------------------------------------------- 1 | // English (Template) 2 | jQuery.timeago.settings.strings = { 3 | prefixAgo: null, 4 | prefixFromNow: null, 5 | suffixAgo: "ago", 6 | suffixFromNow: "from now", 7 | seconds: "less than a minute", 8 | minute: "about a minute", 9 | minutes: "%d minutes", 10 | hour: "about an hour", 11 | hours: "about %d hours", 12 | day: "a day", 13 | days: "%d days", 14 | month: "about a month", 15 | months: "%d months", 16 | year: "about a year", 17 | years: "%d years", 18 | wordSeparator: " ", 19 | numbers: [] 20 | }; 21 | -------------------------------------------------------------------------------- /assets/locales/jquery.timeago.es-short.js: -------------------------------------------------------------------------------- 1 | // Spanish shortened 2 | jQuery.timeago.settings.strings = { 3 | prefixAgo: null, 4 | prefixFromNow: null, 5 | suffixAgo: "", 6 | suffixFromNow: "", 7 | seconds: "1m", 8 | minute: "1m", 9 | minutes: "%dm", 10 | hour: "1h", 11 | hours: "%dh", 12 | day: "1d", 13 | days: "%dd", 14 | month: "1me", 15 | months: "%dme", 16 | year: "1a", 17 | years: "%da", 18 | wordSeparator: " ", 19 | numbers: [] 20 | }; 21 | -------------------------------------------------------------------------------- /assets/locales/jquery.timeago.es.js: -------------------------------------------------------------------------------- 1 | // Spanish 2 | jQuery.timeago.settings.strings = { 3 | prefixAgo: "hace", 4 | prefixFromNow: "dentro de", 5 | suffixAgo: "", 6 | suffixFromNow: "", 7 | seconds: "menos de un minuto", 8 | minute: "un minuto", 9 | minutes: "unos %d minutos", 10 | hour: "una hora", 11 | hours: "%d horas", 12 | day: "un día", 13 | days: "%d días", 14 | month: "un mes", 15 | months: "%d meses", 16 | year: "un año", 17 | years: "%d años" 18 | }; -------------------------------------------------------------------------------- /assets/locales/jquery.timeago.et.js: -------------------------------------------------------------------------------- 1 | // Estonian 2 | jQuery.timeago.settings.strings = { 3 | prefixAgo: null, 4 | prefixFromNow: null, 5 | suffixAgo: "tagasi", 6 | suffixFromNow: "pärast", 7 | seconds: function(n, d) { return d < 0 ? "vähem kui minuti aja" : "vähem kui minut aega"; }, 8 | minute: function(n, d) { return d < 0 ? "umbes minuti aja" : "umbes minut aega"; }, 9 | minutes: function(n, d) { return d < 0 ? "%d minuti" : "%d minutit"; }, 10 | hour: function(n, d) { return d < 0 ? "umbes tunni aja" : "umbes tund aega"; }, 11 | hours: function(n, d) { return d < 0 ? "%d tunni" : "%d tundi"; }, 12 | day: function(n, d) { return d < 0 ? "umbes päeva" : "umbes päev"; }, 13 | days: function(n, d) { return d < 0 ? "%d päeva" : "%d päeva"; }, 14 | month: function(n, d) { return d < 0 ? "umbes kuu aja" : "umbes kuu aega"; }, 15 | months: function(n, d) { return d < 0 ? "%d kuu" : "%d kuud"; }, 16 | year: function(n, d) { return d < 0 ? "umbes aasta aja" : "umbes aasta aega"; }, 17 | years: function(n, d) { return d < 0 ? "%d aasta" : "%d aastat"; } 18 | }; 19 | -------------------------------------------------------------------------------- /assets/locales/jquery.timeago.fa.js: -------------------------------------------------------------------------------- 1 |  2 | // Persian 3 | // Use DIR attribute for RTL text in Persian Language for ABBR tag . 4 | // By MB.seifollahi@gmail.com 5 | jQuery.timeago.settings.strings = { 6 | prefixAgo: null, 7 | prefixFromNow: null, 8 | suffixAgo: "پیش", 9 | suffixFromNow: "از حال", 10 | seconds: "کمتر از یک دقیقه", 11 | minute: "حدود یک دقیقه", 12 | minutes: "%d دقیقه", 13 | hour: "حدود یک ساعت", 14 | hours: "حدود %d ساعت", 15 | day: "یک روز", 16 | days: "%d روز", 17 | month: "حدود یک ماه", 18 | months: "%d ماه", 19 | year: "حدود یک سال", 20 | years: "%d سال", 21 | wordSeparator: " " 22 | }; -------------------------------------------------------------------------------- /assets/locales/jquery.timeago.fi.js: -------------------------------------------------------------------------------- 1 | // Finnish 2 | jQuery.timeago.settings.strings = { 3 | prefixAgo: null, 4 | prefixFromNow: null, 5 | suffixAgo: "sitten", 6 | suffixFromNow: "tulevaisuudessa", 7 | seconds: "alle minuutti", 8 | minute: "minuutti", 9 | minutes: "%d minuuttia", 10 | hour: "tunti", 11 | hours: "%d tuntia", 12 | day: "päivä", 13 | days: "%d päivää", 14 | month: "kuukausi", 15 | months: "%d kuukautta", 16 | year: "vuosi", 17 | years: "%d vuotta" 18 | }; 19 | 20 | // The above is not a great localization because one would usually 21 | // write "2 days ago" in Finnish as "2 päivää sitten", however 22 | // one would write "2 days into the future" as "2:n päivän päästä" 23 | // which cannot be achieved with localization support this simple. 24 | // This is because Finnish has word suffixes (attached directly 25 | // to the end of the word). The word "day" is "päivä" in Finnish. 26 | // As workaround, the above localizations will say 27 | // "2 päivää tulevaisuudessa" which is understandable but 28 | // not as fluent. -------------------------------------------------------------------------------- /assets/locales/jquery.timeago.fr-short.js: -------------------------------------------------------------------------------- 1 | // French shortened 2 | jQuery.timeago.settings.strings = { 3 | prefixAgo: "il y a", 4 | prefixFromNow: "d'ici", 5 | seconds: "moins d'une minute", 6 | minute: "une minute", 7 | minutes: "%d minutes", 8 | hour: "une heure", 9 | hours: "%d heures", 10 | day: "un jour", 11 | days: "%d jours", 12 | month: "un mois", 13 | months: "%d mois", 14 | year: "un an", 15 | years: "%d ans" 16 | }; -------------------------------------------------------------------------------- /assets/locales/jquery.timeago.fr.js: -------------------------------------------------------------------------------- 1 | // French 2 | jQuery.timeago.settings.strings = { 3 | // environ ~= about, it's optional 4 | prefixAgo: "il y a", 5 | prefixFromNow: "d'ici", 6 | seconds: "moins d'une minute", 7 | minute: "environ une minute", 8 | minutes: "environ %d minutes", 9 | hour: "environ une heure", 10 | hours: "environ %d heures", 11 | day: "environ un jour", 12 | days: "environ %d jours", 13 | month: "environ un mois", 14 | months: "environ %d mois", 15 | year: "un an", 16 | years: "%d ans" 17 | }; -------------------------------------------------------------------------------- /assets/locales/jquery.timeago.gl.js: -------------------------------------------------------------------------------- 1 | // Galician 2 | jQuery.timeago.settings.strings = { 3 | prefixAgo: "hai", 4 | prefixFromNow: "dentro de", 5 | suffixAgo: "", 6 | suffixFromNow: "", 7 | seconds: "menos dun minuto", 8 | minute: "un minuto", 9 | minutes: "uns %d minutos", 10 | hour: "unha hora", 11 | hours: "%d horas", 12 | day: "un día", 13 | days: "%d días", 14 | month: "un mes", 15 | months: "%d meses", 16 | year: "un ano", 17 | years: "%d anos" 18 | }; 19 | -------------------------------------------------------------------------------- /assets/locales/jquery.timeago.he.js: -------------------------------------------------------------------------------- 1 | // Hebrew 2 | jQuery.timeago.settings.strings = { 3 | prefixAgo: "לפני", 4 | prefixFromNow: "עוד", 5 | seconds: "פחות מדקה", 6 | minute: "דקה", 7 | minutes: "%d דקות", 8 | hour: "שעה", 9 | hours: function(number){return (number==2) ? "שעתיים" : "%d שעות";}, 10 | day: "יום", 11 | days: function(number){return (number==2) ? "יומיים" : "%d ימים";}, 12 | month: "חודש", 13 | months: function(number){return (number==2) ? "חודשיים" : "%d חודשים";}, 14 | year: "שנה", 15 | years: function(number){return (number==2) ? "שנתיים" : "%d שנים";} 16 | }; 17 | -------------------------------------------------------------------------------- /assets/locales/jquery.timeago.hr.js: -------------------------------------------------------------------------------- 1 | // Croatian 2 | (function () { 3 | var numpf; 4 | 5 | numpf = function (n, f, s, t) { 6 | var n10; 7 | n10 = n % 10; 8 | if (n10 === 1 && (n === 1 || n > 20)) { 9 | return f; 10 | } else if (n10 > 1 && n10 < 5 && (n > 20 || n < 10)) { 11 | return s; 12 | } else { 13 | return t; 14 | } 15 | }; 16 | 17 | jQuery.timeago.settings.strings = { 18 | prefixAgo: "prije", 19 | prefixFromNow: "za", 20 | suffixAgo: null, 21 | suffixFromNow: null, 22 | second: "sekundu", 23 | seconds: function (value) { 24 | return numpf(value, "%d sekundu", "%d sekunde", "%d sekundi"); 25 | }, 26 | minute: "oko minutu", 27 | minutes: function (value) { 28 | return numpf(value, "%d minutu", "%d minute", "%d minuta"); 29 | }, 30 | hour: "oko jedan sat", 31 | hours: function (value) { 32 | return numpf(value, "%d sat", "%d sata", "%d sati"); 33 | }, 34 | day: "jedan dan", 35 | days: function (value) { 36 | return numpf(value, "%d dan", "%d dana", "%d dana"); 37 | }, 38 | month: "mjesec dana", 39 | months: function (value) { 40 | return numpf(value, "%d mjesec", "%d mjeseca", "%d mjeseci"); 41 | }, 42 | year: "prije godinu dana", 43 | years: function (value) { 44 | return numpf(value, "%d godinu", "%d godine", "%d godina"); 45 | }, 46 | wordSeparator: " " 47 | }; 48 | 49 | }).call(this); -------------------------------------------------------------------------------- /assets/locales/jquery.timeago.hu.js: -------------------------------------------------------------------------------- 1 | // Hungarian 2 | jQuery.timeago.settings.strings = { 3 | prefixAgo: null, 4 | prefixFromNow: null, 5 | suffixAgo: null, 6 | suffixFromNow: null, 7 | seconds: "kevesebb mint egy perce", 8 | minute: "körülbelül egy perce", 9 | minutes: "%d perce", 10 | hour: "körülbelül egy órája", 11 | hours: "körülbelül %d órája", 12 | day: "körülbelül egy napja", 13 | days: "%d napja", 14 | month: "körülbelül egy hónapja", 15 | months: "%d hónapja", 16 | year: "körülbelül egy éve", 17 | years: "%d éve" 18 | }; -------------------------------------------------------------------------------- /assets/locales/jquery.timeago.hy.js: -------------------------------------------------------------------------------- 1 | // Armenian 2 | jQuery.timeago.settings.strings = { 3 | prefixAgo: null, 4 | prefixFromNow: null, 5 | suffixAgo: "առաջ", 6 | suffixFromNow: "հետո", 7 | seconds: "վայրկյաններ", 8 | minute: "մեկ րոպե", 9 | minutes: "%d րոպե", 10 | hour: "մեկ ժամ", 11 | hours: "%d ժամ", 12 | day: "մեկ օր", 13 | days: "%d օր", 14 | month: "մեկ ամիս", 15 | months: "%d ամիս", 16 | year: "մեկ տարի", 17 | years: "%d տարի" 18 | }; -------------------------------------------------------------------------------- /assets/locales/jquery.timeago.id.js: -------------------------------------------------------------------------------- 1 | // Indonesian 2 | jQuery.timeago.settings.strings = { 3 | prefixAgo: null, 4 | prefixFromNow: null, 5 | suffixAgo: "yang lalu", 6 | suffixFromNow: "dari sekarang", 7 | seconds: "kurang dari semenit", 8 | minute: "sekitar satu menit", 9 | minutes: "%d menit", 10 | hour: "sekitar sejam", 11 | hours: "sekitar %d jam", 12 | day: "sehari", 13 | days: "%d hari", 14 | month: "sekitar sebulan", 15 | months: "%d bulan", 16 | year: "sekitar setahun", 17 | years: "%d tahun" 18 | }; 19 | -------------------------------------------------------------------------------- /assets/locales/jquery.timeago.is.js: -------------------------------------------------------------------------------- 1 | jQuery.timeago.settings.strings = { 2 | prefixAgo: "fyrir", 3 | prefixFromNow: "eftir", 4 | suffixAgo: "síðan", 5 | suffixFromNow: null, 6 | seconds: "minna en mínútu", 7 | minute: "mínútu", 8 | minutes: "%d mínútum", 9 | hour: "klukkutíma", 10 | hours: "um %d klukkutímum", 11 | day: "degi", 12 | days: "%d dögum", 13 | month: "mánuði", 14 | months: "%d mánuðum", 15 | year: "ári", 16 | years: "%d árum", 17 | wordSeparator: " ", 18 | numbers: [] 19 | }; 20 | -------------------------------------------------------------------------------- /assets/locales/jquery.timeago.it-short.js: -------------------------------------------------------------------------------- 1 | // Italian shortened 2 | jQuery.timeago.settings.strings = { 3 | prefixAgo: null, 4 | prefixFromNow: null, 5 | suffixAgo: "", 6 | suffixFromNow: "", 7 | seconds: "1m", 8 | minute: "1m", 9 | minutes: "%dm", 10 | hour: "1h", 11 | hours: "%dh", 12 | day: "1g", 13 | days: "%dg", 14 | month: "1me", 15 | months: "%dme", 16 | year: "1a", 17 | years: "%da", 18 | wordSeparator: " ", 19 | numbers: [] 20 | }; 21 | -------------------------------------------------------------------------------- /assets/locales/jquery.timeago.it.js: -------------------------------------------------------------------------------- 1 | // Italian 2 | jQuery.timeago.settings.strings = { 3 | suffixAgo: "fa", 4 | suffixFromNow: "da ora", 5 | seconds: "meno di un minuto", 6 | minute: "circa un minuto", 7 | minutes: "%d minuti", 8 | hour: "circa un'ora", 9 | hours: "circa %d ore", 10 | day: "un giorno", 11 | days: "%d giorni", 12 | month: "circa un mese", 13 | months: "%d mesi", 14 | year: "circa un anno", 15 | years: "%d anni" 16 | }; -------------------------------------------------------------------------------- /assets/locales/jquery.timeago.ja.js: -------------------------------------------------------------------------------- 1 | // Japanese 2 | jQuery.timeago.settings.strings = { 3 | prefixAgo: "", 4 | prefixFromNow: "今から", 5 | suffixAgo: "前", 6 | suffixFromNow: "後", 7 | seconds: "1 分未満", 8 | minute: "約 1 分", 9 | minutes: "%d 分", 10 | hour: "約 1 時間", 11 | hours: "約 %d 時間", 12 | day: "約 1 日", 13 | days: "約 %d 日", 14 | month: "約 1 月", 15 | months: "約 %d 月", 16 | year: "約 1 年", 17 | years: "約 %d 年", 18 | wordSeparator: "" 19 | }; 20 | -------------------------------------------------------------------------------- /assets/locales/jquery.timeago.jv.js: -------------------------------------------------------------------------------- 1 | // Javanesse (Boso Jowo) 2 | jQuery.timeago.settings.strings = { 3 | prefixAgo: null, 4 | prefixFromNow: null, 5 | suffixAgo: "kepungkur", 6 | suffixFromNow: "seko saiki", 7 | seconds: "kurang seko sakmenit", 8 | minute: "kurang luwih sakmenit", 9 | minutes: "%d menit", 10 | hour: "kurang luwih sakjam", 11 | hours: "kurang luwih %d jam", 12 | day: "sedina", 13 | days: "%d dina", 14 | month: "kurang luwih sewulan", 15 | months: "%d wulan", 16 | year: "kurang luwih setahun", 17 | years: "%d tahun" 18 | }; 19 | -------------------------------------------------------------------------------- /assets/locales/jquery.timeago.ko.js: -------------------------------------------------------------------------------- 1 | // Korean 2 | jQuery.timeago.settings.strings = { 3 | prefixAgo: null, 4 | prefixFromNow: null, 5 | suffixAgo: "전", 6 | suffixFromNow: "후", 7 | seconds: "1분", 8 | minute: "약 1분", 9 | minutes: "%d분", 10 | hour: "약 1시간", 11 | hours: "약 %d시간", 12 | day: "하루", 13 | days: "%d일", 14 | month: "약 1개월", 15 | months: "%d개월", 16 | year: "약 1년", 17 | years: "%d년", 18 | wordSeparator: " ", 19 | numbers: [] 20 | }; 21 | -------------------------------------------------------------------------------- /assets/locales/jquery.timeago.ky.js: -------------------------------------------------------------------------------- 1 | // Russian 2 | (function() { 3 | function numpf(n, f, s, t) { 4 | // f - 1, 21, 31, ... 5 | // s - 2-4, 22-24, 32-34 ... 6 | // t - 5-20, 25-30, ... 7 | var n10 = n % 10; 8 | if ( (n10 == 1) && ( (n == 1) || (n > 20) ) ) { 9 | return f; 10 | } else if ( (n10 > 1) && (n10 < 5) && ( (n > 20) || (n < 10) ) ) { 11 | return s; 12 | } else { 13 | return t; 14 | } 15 | } 16 | 17 | jQuery.timeago.settings.strings = { 18 | prefixAgo: null, 19 | prefixFromNow: "через", 20 | suffixAgo: "мурун", 21 | suffixFromNow: null, 22 | seconds: "1 минуттан аз", 23 | minute: "минута", 24 | minutes: function(value) { return numpf(value, "%d минута", "%d минута", "%d минут"); }, 25 | hour: "саат", 26 | hours: function(value) { return numpf(value, "%d саат", "%d саат", "%d саат"); }, 27 | day: "күн", 28 | days: function(value) { return numpf(value, "%d күн", "%d күн", "%d күн"); }, 29 | month: "ай", 30 | months: function(value) { return numpf(value, "%d ай", "%d ай", "%d ай"); }, 31 | year: "жыл", 32 | years: function(value) { return numpf(value, "%d жыл", "%d жыл", "%d жыл"); } 33 | }; 34 | })(); -------------------------------------------------------------------------------- /assets/locales/jquery.timeago.lt.js: -------------------------------------------------------------------------------- 1 | //Lithuanian 2 | jQuery.timeago.settings.strings = { 3 | prefixAgo: "prieš", 4 | prefixFromNow: null, 5 | suffixAgo: null, 6 | suffixFromNow: "nuo dabar", 7 | seconds: "%d sek.", 8 | minute: "min.", 9 | minutes: "%d min.", 10 | hour: "val.", 11 | hours: "%d val.", 12 | day: "1 d.", 13 | days: "%d d.", 14 | month: "mėn.", 15 | months: "%d mėn.", 16 | year: "metus", 17 | years: "%d metus", 18 | wordSeparator: " ", 19 | numbers: [] 20 | }; 21 | -------------------------------------------------------------------------------- /assets/locales/jquery.timeago.mk.js: -------------------------------------------------------------------------------- 1 | // Macedonian 2 | (function() { 3 | jQuery.timeago.settings.strings={ 4 | prefixAgo: "пред", 5 | prefixFromNow: "за", 6 | suffixAgo: null, 7 | suffixFromNow: null, 8 | seconds: "%d секунди", 9 | minute: "%d минута", 10 | minutes: "%d минути", 11 | hour: "%d час", 12 | hours: "%d часа", 13 | day: "%d ден", 14 | days: "%d денови" , 15 | month: "%d месец", 16 | months: "%d месеци", 17 | year: "%d година", 18 | years: "%d години" 19 | }; 20 | })(); 21 | -------------------------------------------------------------------------------- /assets/locales/jquery.timeago.nl.js: -------------------------------------------------------------------------------- 1 | // Dutch 2 | jQuery.timeago.settings.strings = { 3 | prefixAgo: null, 4 | prefixFromNow: "over", 5 | suffixAgo: "geleden", 6 | suffixFromNow: null, 7 | seconds: "minder dan een minuut", 8 | minute: "ongeveer een minuut", 9 | minutes: "%d minuten", 10 | hour: "ongeveer een uur", 11 | hours: "ongeveer %d uur", 12 | day: "een dag", 13 | days: "%d dagen", 14 | month: "ongeveer een maand", 15 | months: "%d maanden", 16 | year: "ongeveer een jaar", 17 | years: "%d jaar", 18 | wordSeparator: " ", 19 | numbers: [] 20 | }; 21 | -------------------------------------------------------------------------------- /assets/locales/jquery.timeago.no.js: -------------------------------------------------------------------------------- 1 | // Norwegian 2 | jQuery.timeago.settings.strings = { 3 | prefixAgo: "for", 4 | prefixFromNow: "om", 5 | suffixAgo: "siden", 6 | suffixFromNow: "", 7 | seconds: "mindre enn et minutt", 8 | minute: "ca. et minutt", 9 | minutes: "%d minutter", 10 | hour: "ca. en time", 11 | hours: "ca. %d timer", 12 | day: "en dag", 13 | days: "%d dager", 14 | month: "ca. en måned", 15 | months: "%d måneder", 16 | year: "ca. et år", 17 | years: "%d år" 18 | }; -------------------------------------------------------------------------------- /assets/locales/jquery.timeago.pl.js: -------------------------------------------------------------------------------- 1 | // Polish 2 | (function() { 3 | function numpf(n, s, t) { 4 | // s - 2-4, 22-24, 32-34 ... 5 | // t - 5-21, 25-31, ... 6 | var n10 = n % 10; 7 | if ( (n10 > 1) && (n10 < 5) && ( (n > 20) || (n < 10) ) ) { 8 | return s; 9 | } else { 10 | return t; 11 | } 12 | } 13 | 14 | jQuery.timeago.settings.strings = { 15 | prefixAgo: null, 16 | prefixFromNow: "za", 17 | suffixAgo: "temu", 18 | suffixFromNow: null, 19 | seconds: "mniej niż minutę", 20 | minute: "minutę", 21 | minutes: function(value) { return numpf(value, "%d minuty", "%d minut"); }, 22 | hour: "godzinę", 23 | hours: function(value) { return numpf(value, "%d godziny", "%d godzin"); }, 24 | day: "dzień", 25 | days: "%d dni", 26 | month: "miesiąc", 27 | months: function(value) { return numpf(value, "%d miesiące", "%d miesięcy"); }, 28 | year: "rok", 29 | years: function(value) { return numpf(value, "%d lata", "%d lat"); } 30 | }; 31 | })(); -------------------------------------------------------------------------------- /assets/locales/jquery.timeago.pt-br-short.js: -------------------------------------------------------------------------------- 1 | // Portuguese Brasil shortened 2 | jQuery.timeago.settings.strings = { 3 | prefixAgo: null, 4 | prefixFromNow: null, 5 | suffixAgo: "", 6 | suffixFromNow: "", 7 | seconds: "1m", 8 | minute: "1m", 9 | minutes: "%dm", 10 | hour: "1h", 11 | hours: "%dh", 12 | day: "1d", 13 | days: "%dd", 14 | month: "1M", 15 | months: "%dM", 16 | year: "1a", 17 | years: "%da", 18 | wordSeparator: " ", 19 | numbers: [] 20 | }; 21 | -------------------------------------------------------------------------------- /assets/locales/jquery.timeago.pt-br.js: -------------------------------------------------------------------------------- 1 | // Brazilian Portuguese 2 | jQuery.timeago.settings.strings = { 3 | prefixAgo: "há", 4 | prefixFromNow: "em", 5 | suffixAgo: null, 6 | suffixFromNow: null, 7 | seconds: "alguns segundos", 8 | minute: "um minuto", 9 | minutes: "%d minutos", 10 | hour: "uma hora", 11 | hours: "%d horas", 12 | day: "um dia", 13 | days: "%d dias", 14 | month: "um mês", 15 | months: "%d meses", 16 | year: "um ano", 17 | years: "%d anos" 18 | }; 19 | -------------------------------------------------------------------------------- /assets/locales/jquery.timeago.pt.js: -------------------------------------------------------------------------------- 1 | // Portuguese 2 | jQuery.timeago.settings.strings = { 3 | suffixAgo: "atrás", 4 | suffixFromNow: "a partir de agora", 5 | seconds: "menos de um minuto", 6 | minute: "cerca de um minuto", 7 | minutes: "%d minutos", 8 | hour: "cerca de uma hora", 9 | hours: "cerca de %d horas", 10 | day: "um dia", 11 | days: "%d dias", 12 | month: "cerca de um mês", 13 | months: "%d meses", 14 | year: "cerca de um ano", 15 | years: "%d anos" 16 | }; -------------------------------------------------------------------------------- /assets/locales/jquery.timeago.ro.js: -------------------------------------------------------------------------------- 1 | // Romanian 2 | jQuery.timeago.settings.strings = { 3 | prefixAgo: "acum", 4 | prefixFromNow: "in timp de", 5 | suffixAgo: "", 6 | suffixFromNow: "", 7 | seconds: "mai putin de un minut", 8 | minute: "un minut", 9 | minutes: "%d minute", 10 | hour: "o ora", 11 | hours: "%d ore", 12 | day: "o zi", 13 | days: "%d zile", 14 | month: "o luna", 15 | months: "%d luni", 16 | year: "un an", 17 | years: "%d ani" 18 | }; 19 | -------------------------------------------------------------------------------- /assets/locales/jquery.timeago.rs.js: -------------------------------------------------------------------------------- 1 | // Serbian 2 | (function () { 3 | var numpf; 4 | 5 | numpf = function (n, f, s, t) { 6 | var n10; 7 | n10 = n % 10; 8 | if (n10 === 1 && (n === 1 || n > 20)) { 9 | return f; 10 | } else if (n10 > 1 && n10 < 5 && (n > 20 || n < 10)) { 11 | return s; 12 | } else { 13 | return t; 14 | } 15 | }; 16 | 17 | jQuery.timeago.settings.strings = { 18 | prefixAgo: "pre", 19 | prefixFromNow: "za", 20 | suffixAgo: null, 21 | suffixFromNow: null, 22 | second: "sekund", 23 | seconds: function (value) { 24 | return numpf(value, "%d sekund", "%d sekunde", "%d sekundi"); 25 | }, 26 | minute: "oko minut", 27 | minutes: function (value) { 28 | return numpf(value, "%d minut", "%d minuta", "%d minuta"); 29 | }, 30 | hour: "oko jedan sat", 31 | hours: function (value) { 32 | return numpf(value, "%d sat", "%d sata", "%d sati"); 33 | }, 34 | day: "jedan dan", 35 | days: function (value) { 36 | return numpf(value, "%d dan", "%d dana", "%d dana"); 37 | }, 38 | month: "mesec dana", 39 | months: function (value) { 40 | return numpf(value, "%d mesec", "%d meseca", "%d meseci"); 41 | }, 42 | year: "godinu dana", 43 | years: function (value) { 44 | return numpf(value, "%d godinu", "%d godine", "%d godina"); 45 | }, 46 | wordSeparator: " " 47 | }; 48 | 49 | }).call(this); 50 | -------------------------------------------------------------------------------- /assets/locales/jquery.timeago.ru.js: -------------------------------------------------------------------------------- 1 | // Russian 2 | (function() { 3 | function numpf(n, f, s, t) { 4 | // f - 1, 21, 31, ... 5 | // s - 2-4, 22-24, 32-34 ... 6 | // t - 5-20, 25-30, ... 7 | var n10 = n % 10; 8 | if ( (n10 == 1) && ( (n == 1) || (n > 20) ) ) { 9 | return f; 10 | } else if ( (n10 > 1) && (n10 < 5) && ( (n > 20) || (n < 10) ) ) { 11 | return s; 12 | } else { 13 | return t; 14 | } 15 | } 16 | 17 | jQuery.timeago.settings.strings = { 18 | prefixAgo: null, 19 | prefixFromNow: "через", 20 | suffixAgo: "назад", 21 | suffixFromNow: null, 22 | seconds: "меньше минуты", 23 | minute: "минуту", 24 | minutes: function(value) { return numpf(value, "%d минута", "%d минуты", "%d минут"); }, 25 | hour: "час", 26 | hours: function(value) { return numpf(value, "%d час", "%d часа", "%d часов"); }, 27 | day: "день", 28 | days: function(value) { return numpf(value, "%d день", "%d дня", "%d дней"); }, 29 | month: "месяц", 30 | months: function(value) { return numpf(value, "%d месяц", "%d месяца", "%d месяцев"); }, 31 | year: "год", 32 | years: function(value) { return numpf(value, "%d год", "%d года", "%d лет"); } 33 | }; 34 | })(); -------------------------------------------------------------------------------- /assets/locales/jquery.timeago.rw.js: -------------------------------------------------------------------------------- 1 | // Kinyarwanda 2 | jQuery.timeago.settings.strings = { 3 | prefixAgo: "hashize", 4 | prefixFromNow: "mu", 5 | suffixAgo: null, 6 | suffixFromNow: null, 7 | seconds: "amasegonda macye", 8 | minute: "umunota", 9 | minutes: "iminota %d", 10 | hour: "isaha", 11 | hours: "amasaha %d", 12 | day: "umunsi", 13 | days: "iminsi %d", 14 | month: "ukwezi", 15 | months: "amezi %d", 16 | year: "umwaka", 17 | years: "imyaka %d", 18 | wordSeparator: " ", 19 | numbers: [] 20 | }; 21 | -------------------------------------------------------------------------------- /assets/locales/jquery.timeago.si.js: -------------------------------------------------------------------------------- 1 | // Sinhalese (SI) 2 | jQuery.timeago.settings.strings = { 3 | prefixAgo: null, 4 | prefixFromNow: null, 5 | suffixAgo: "පෙර", 6 | suffixFromNow: "පසුව", 7 | seconds: "තත්පර කිහිපයකට", 8 | minute: "මිනිත්තුවකට පමණ", 9 | minutes: "මිනිත්තු %d කට", 10 | hour: "පැයක් පමණ ", 11 | hours: "පැය %d කට පමණ", 12 | day: "දවසක ට", 13 | days: "දවස් %d කට ", 14 | month: "මාසයක් පමණ", 15 | months: "මාස %d කට", 16 | year: "වසරක් පමණ", 17 | years: "වසරක් %d කට පමණ" 18 | }; -------------------------------------------------------------------------------- /assets/locales/jquery.timeago.sk.js: -------------------------------------------------------------------------------- 1 | // Slovak 2 | jQuery.timeago.settings.strings = { 3 | prefixAgo: "pred", 4 | prefixFromNow: null, 5 | suffixAgo: null, 6 | suffixFromNow: null, 7 | seconds: "menej než minútou", 8 | minute: "minútou", 9 | minutes: "%d minútami", 10 | hour: "hodinou", 11 | hours: "%d hodinami", 12 | day: "1 dňom", 13 | days: "%d dňami", 14 | month: "1 mesiacom", 15 | months: "%d mesiacmi", 16 | year: "1 rokom", 17 | years: "%d rokmi" 18 | }; 19 | -------------------------------------------------------------------------------- /assets/locales/jquery.timeago.sl.js: -------------------------------------------------------------------------------- 1 | // Slovenian with support for dual 2 | (function () { 3 | var numpf; 4 | numpf = function (n, a) { 5 | return a[n%100==1 ? 1 : n%100==2 ? 2 : n%100==3 || n%100==4 ? 3 : 0]; 6 | }; 7 | 8 | jQuery.timeago.settings.strings = { 9 | prefixAgo: null, 10 | prefixFromNow: "čez", 11 | suffixAgo: "nazaj", 12 | suffixFromNow: null, 13 | second: "sekundo", 14 | seconds: function (value) { 15 | return numpf(value, ["%d sekund", "%d sekundo", "%d sekundi", "%d sekunde"]); 16 | }, 17 | minute: "minuto", 18 | minutes: function (value) { 19 | return numpf(value, ["%d minut", "%d minuto", "%d minuti", "%d minute"]); 20 | }, 21 | hour: "eno uro", 22 | hours: function (value) { 23 | return numpf(value, ["%d ur", "%d uro", "%d uri", "%d ure"]); 24 | }, 25 | day: "en dan", 26 | days: function (value) { 27 | return numpf(value, ["%d dni", "%d dan", "%d dneva", "%d dni"]); 28 | }, 29 | month: "en mesec", 30 | months: function (value) { 31 | return numpf(value, ["%d mescov", "%d mesec", "%d mesca", "%d mesce"]); 32 | }, 33 | year: "eno leto", 34 | years: function (value) { 35 | return numpf(value, ["%d let", "%d leto", "%d leti", "%d leta"]); 36 | }, 37 | wordSeparator: " " 38 | }; 39 | 40 | }).call(this); 41 | -------------------------------------------------------------------------------- /assets/locales/jquery.timeago.sv.js: -------------------------------------------------------------------------------- 1 | // Swedish 2 | jQuery.timeago.settings.strings = { 3 | prefixAgo: "för", 4 | prefixFromNow: "om", 5 | suffixAgo: "sedan", 6 | suffixFromNow: "", 7 | seconds: "mindre än en minut", 8 | minute: "ungefär en minut", 9 | minutes: "%d minuter", 10 | hour: "ungefär en timme", 11 | hours: "ungefär %d timmar", 12 | day: "en dag", 13 | days: "%d dagar", 14 | month: "ungefär en månad", 15 | months: "%d månader", 16 | year: "ungefär ett år", 17 | years: "%d år" 18 | }; -------------------------------------------------------------------------------- /assets/locales/jquery.timeago.th.js: -------------------------------------------------------------------------------- 1 | // Thai 2 | jQuery.timeago.settings.strings = { 3 | prefixAgo: null, 4 | prefixFromNow: null, 5 | suffixAgo: "ที่แล้ว", 6 | suffixFromNow: "จากตอนนี้", 7 | seconds: "น้อยกว่าหนึ่งนาที", 8 | minute: "ประมาณหนึ่งนาที", 9 | minutes: "%d นาที", 10 | hour: "ประมาณหนึ่งชั่วโมง", 11 | hours: "ประมาณ %d ชั่วโมง", 12 | day: "หนึ่งวัน", 13 | days: "%d วัน", 14 | month: "ประมาณหนึ่งเดือน", 15 | months: "%d เดือน", 16 | year: "ประมาณหนึ่งปี", 17 | years: "%d ปี", 18 | wordSeparator: "", 19 | numbers: [] 20 | }; 21 | -------------------------------------------------------------------------------- /assets/locales/jquery.timeago.tr.js: -------------------------------------------------------------------------------- 1 | // Turkish 2 | jQuery.timeago.settings.strings = { 3 | suffixAgo: 'önce', 4 | suffixFromNow: null, 5 | seconds: '1 dakikadan', 6 | minute: '1 dakika', 7 | minutes: '%d dakika', 8 | hour: '1 saat', 9 | hours: '%d saat', 10 | day: '1 gün', 11 | days: '%d gün', 12 | month: '1 ay', 13 | months: '%d ay', 14 | year: '1 yıl', 15 | years: '%d yıl' 16 | }; 17 | -------------------------------------------------------------------------------- /assets/locales/jquery.timeago.uk.js: -------------------------------------------------------------------------------- 1 | // Ukrainian 2 | (function() { 3 | function numpf(n, f, s, t) { 4 | // f - 1, 21, 31, ... 5 | // s - 2-4, 22-24, 32-34 ... 6 | // t - 5-20, 25-30, ... 7 | var n10 = n % 10; 8 | if ( (n10 == 1) && ( (n == 1) || (n > 20) ) ) { 9 | return f; 10 | } else if ( (n10 > 1) && (n10 < 5) && ( (n > 20) || (n < 10) ) ) { 11 | return s; 12 | } else { 13 | return t; 14 | } 15 | } 16 | 17 | jQuery.timeago.settings.strings = { 18 | prefixAgo: null, 19 | prefixFromNow: "через", 20 | suffixAgo: "тому", 21 | suffixFromNow: null, 22 | seconds: "менше хвилини", 23 | minute: "хвилина", 24 | minutes: function(value) { return numpf(value, "%d хвилина", "%d хвилини", "%d хвилин"); }, 25 | hour: "година", 26 | hours: function(value) { return numpf(value, "%d година", "%d години", "%d годин"); }, 27 | day: "день", 28 | days: function(value) { return numpf(value, "%d день", "%d дні", "%d днів"); }, 29 | month: "місяць", 30 | months: function(value) { return numpf(value, "%d місяць", "%d місяці", "%d місяців"); }, 31 | year: "рік", 32 | years: function(value) { return numpf(value, "%d рік", "%d роки", "%d років"); } 33 | }; 34 | })(); -------------------------------------------------------------------------------- /assets/locales/jquery.timeago.uz.js: -------------------------------------------------------------------------------- 1 | //Uzbek 2 | jQuery.timeago.settings.strings = { 3 | prefixAgo: null, 4 | prefixFromNow: "keyin", 5 | suffixAgo: "avval", 6 | suffixFromNow: null, 7 | seconds: "bir necha soniya", 8 | minute: "1 daqiqa", 9 | minutes: function(value) { return "%d daqiqa"; }, 10 | hour: "1 soat", 11 | hours: function(value) { return "%d soat"; }, 12 | day: "1 kun", 13 | days: function(value) { return "%d kun"; }, 14 | month: "1 oy", 15 | months: function(value) { return "%d oy"; }, 16 | year: "1 yil", 17 | years: function(value) { return "%d yil"; }, 18 | wordSeparator: " " 19 | }; 20 | -------------------------------------------------------------------------------- /assets/locales/jquery.timeago.vi.js: -------------------------------------------------------------------------------- 1 | // Vietnamese 2 | jQuery.timeago.settings.strings = { 3 | prefixAgo: 'cách đây', 4 | prefixFromNow: null, 5 | suffixAgo: null, 6 | suffixFromNow: "trước", 7 | seconds: "chưa đến một phút", 8 | minute: "khoảng một phút", 9 | minutes: "%d phút", 10 | hour: "khoảng một tiếng", 11 | hours: "khoảng %d tiếng", 12 | day: "một ngày", 13 | days: "%d ngày", 14 | month: "khoảng một tháng", 15 | months: "%d tháng", 16 | year: "khoảng một năm", 17 | years: "%d năm", 18 | wordSeparator: " ", 19 | numbers: [] 20 | }; 21 | -------------------------------------------------------------------------------- /assets/locales/jquery.timeago.zh-CN.js: -------------------------------------------------------------------------------- 1 | // Simplified Chinese 2 | jQuery.timeago.settings.strings = { 3 | prefixAgo: null, 4 | prefixFromNow: "从现在开始", 5 | suffixAgo: "之前", 6 | suffixFromNow: null, 7 | seconds: "不到1分钟", 8 | minute: "大约1分钟", 9 | minutes: "%d分钟", 10 | hour: "大约1小时", 11 | hours: "大约%d小时", 12 | day: "1天", 13 | days: "%d天", 14 | month: "大约1个月", 15 | months: "%d月", 16 | year: "大约1年", 17 | years: "%d年", 18 | numbers: [], 19 | wordSeparator: "" 20 | }; 21 | -------------------------------------------------------------------------------- /assets/locales/jquery.timeago.zh-TW.js: -------------------------------------------------------------------------------- 1 | // Traditional Chinese, zh-tw 2 | jQuery.timeago.settings.strings = { 3 | prefixAgo: null, 4 | prefixFromNow: "從現在開始", 5 | suffixAgo: "之前", 6 | suffixFromNow: null, 7 | seconds: "不到1分鐘", 8 | minute: "大約1分鐘", 9 | minutes: "%d分鐘", 10 | hour: "大約1小時", 11 | hours: "%d小時", 12 | day: "大約1天", 13 | days: "%d天", 14 | month: "大約1個月", 15 | months: "%d個月", 16 | year: "大約1年", 17 | years: "%d年", 18 | numbers: [], 19 | wordSeparator: "" 20 | }; 21 | -------------------------------------------------------------------------------- /assets/notifications.css: -------------------------------------------------------------------------------- 1 | .notification { 2 | background: #fefefe; 3 | padding: 2px 5px; 4 | cursor: pointer; 5 | border-bottom: 1px solid #b5b5b5; 6 | } 7 | .notification.notification-danger { 8 | background: #b995a9; 9 | } 10 | .notification.notification-warning { 11 | background: #fcffcd; 12 | } 13 | .notification.notification-success { 14 | background: #00ca6d; 15 | } 16 | .notification .title { 17 | font-weight: bold; 18 | } 19 | .notification .description { 20 | display: none; 21 | } 22 | .notification .timeago { 23 | color: #555; 24 | font-style: italic; 25 | font-size: 12px; 26 | } 27 | .notification .actions .fa { 28 | color: #aaa; 29 | display: block; 30 | font-size: 10px; 31 | margin: 4px 0; 32 | } 33 | .notification .actions .fa:hover { 34 | color: #333; 35 | } 36 | -------------------------------------------------------------------------------- /assets/notifications.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Notifications 3 | * 4 | * @class 5 | * @param {Object} options Optional configuration options 6 | * @return {Notifications} Notifications main instance 7 | */ 8 | var Notifications = (function(options) { 9 | 10 | /** 11 | * The declared UI libraries 12 | * 13 | * Each property of this variable must be an object with the `show` callback 14 | * field defined, and an optional `types` translation map that will be used 15 | * to translate natives types into the used library notification type. 16 | * 17 | * @type Object 18 | */ 19 | this.themes = { 20 | /** 21 | * jQuery Growl 22 | * @see https://github.com/ksylvest/jquery-growl 23 | */ 24 | growl: { 25 | types: { 26 | success: 'notice' 27 | }, 28 | show: function (object) { 29 | $.growl($.extend({ 30 | duration: self.opts.delay, 31 | title: object.title, 32 | message: object.description, 33 | url: object.url, 34 | style: getType(object.type), 35 | }, self.opts.options)); 36 | } 37 | }, 38 | 39 | /** 40 | * Notie 41 | * @see https://jaredreich.com/projects/notie/ 42 | */ 43 | notie: { 44 | types: { 45 | 'default': 4, 46 | error: 3, 47 | warning: 2, 48 | success: 1 49 | }, 50 | show: function (object) { 51 | notie.alert(getType(object.type), object.description, self.opts.delay / 999); 52 | } 53 | }, 54 | 55 | /** 56 | * NotifIt! 57 | * @see http://naoxink.hol.es/notifIt/ 58 | */ 59 | notifit: { 60 | types: { 61 | 'default': 'info' 62 | }, 63 | show: function (object) { 64 | notif($.extend({ 65 | timeout: self.opts.delay, 66 | clickable: true, 67 | multiline: true, 68 | msg: "" + object.title + "

" + object.description, 69 | type: getType(object.type) 70 | }, self.opts.options)); 71 | $("#ui_notifIt").click(function(e) { 72 | document.location = object.url; 73 | }); 74 | } 75 | }, 76 | 77 | /** 78 | * Notify.js 79 | * @see https://notifyjs.com/ 80 | */ 81 | notify: { 82 | types: { 83 | warning: 'warn', 84 | 'default': 'info' 85 | }, 86 | show: function (object) { 87 | $.notify(object.title, getType(object.type), $.extend({ 88 | autoHideDelay: self.opts.delay, 89 | }, self.opts.options)); 90 | } 91 | }, 92 | 93 | /** 94 | * Noty 95 | * @see http://ned.im/noty/ 96 | */ 97 | noty: { 98 | types: { 99 | 'default': 'information' 100 | }, 101 | show: function (object) { 102 | noty($.extend({ 103 | text: object.title, 104 | type: getType(object.type), 105 | dismissQueue: false, 106 | timeout: self.opts.delay, 107 | layout: 'topRight', 108 | theme: 'defaultTheme', 109 | callback: { 110 | onCloseClick: function () { 111 | document.location = object.url; 112 | } 113 | } 114 | }, self.opts.options)); 115 | } 116 | }, 117 | 118 | /** 119 | * PNotify 120 | * @see http://sciactive.com/pnotify/ 121 | */ 122 | pnotify: { 123 | types: { 124 | warning: 'notice', 125 | 'default': 'info' 126 | }, 127 | show: function (object) { 128 | new PNotify($.extend({ 129 | title: object.title, 130 | text: '' + object.description + '', 131 | type: getType(object.type), 132 | delay: self.opts.delay 133 | }, self.opts.options)); 134 | } 135 | }, 136 | 137 | /** 138 | * Toastr 139 | * @see https://codeseven.github.io/toastr/ 140 | */ 141 | toastr: { 142 | types: { 143 | 'default': 'info' 144 | }, 145 | show: function (object) { 146 | toastr[getType(object.type)](object.description, object.title, $.extend({ 147 | timeOut: self.opts.delay, 148 | onclick: function() { 149 | document.location = object.url; 150 | } 151 | }, self.opts.options)); 152 | } 153 | } 154 | }; 155 | 156 | 157 | var self = this; 158 | 159 | /** 160 | * Options 161 | * @type {Object} 162 | */ 163 | this.opts = $.extend({ 164 | seenUrl: '', // Overwritten by widget 165 | seenAllUrl: '', // Overwritten by widget 166 | deleteUrl: '', // Overwritten by widget 167 | deleteAllUrl: '', // Overwritten by widget 168 | flashUrl: '', 169 | pollInterval: 5000, 170 | pollSeen: false, 171 | xhrTimeout: 2000, 172 | delay: 5000, 173 | theme: null, 174 | counters: [], 175 | markAllSeenSelector: null, 176 | deleteAllSelector: null, 177 | listSelector: null, 178 | listItemTemplate: 179 | '
' + 180 | '
' + 181 | '
{title}
' + 182 | '
{description}
' + 183 | '
{timeago}
' + 184 | '
' + 185 | '
' + 186 | '
{seen}{delete}
' + 187 | '
' + 188 | '
', 189 | listItemBeforeRender: function (elem) { 190 | return elem; 191 | } 192 | }, options); 193 | 194 | /** 195 | * Already displayed notifications cache 196 | * @type {Array} 197 | */ 198 | this.displayed = []; 199 | 200 | /** 201 | * Renders a notification row 202 | * 203 | * @param object The notification instance 204 | * @returns {jQuery|HTMLElement|*} 205 | */ 206 | this.renderRow = function (object) { 207 | var keywords = ['id', 'title', 'description', 'url', 'type']; 208 | var ret, html = self.opts.listItemTemplate; 209 | 210 | html = '
' + 213 | html + 214 | '
'; 215 | 216 | for (var i = 0; i < keywords.length; i++) { 217 | html = html.replace(new RegExp('{' + keywords[i] + '}', 'g'), object[keywords[i]]); 218 | } 219 | 220 | html = html.replace(/\{seen}/g, ''); 221 | html = html.replace(/\{delete}/g, ''); 222 | html = html.replace(/\{timeago}/g, ''); 223 | ret = $(html); 224 | ret.find('.notification-seen').click(function() { 225 | self.markSeen($(this).parents('.notification').data('id')); 226 | $(this).parents('.notification').hide(); 227 | 228 | // Update all counters 229 | for (var i = 0; i < self.opts.counters.length; i++) { 230 | if ($(self.opts.counters[i]).text() != parseInt($(self.opts.counters[i]).html())-1) { 231 | $(self.opts.counters[i]).text(parseInt($(self.opts.counters[i]).html())-1); 232 | } 233 | } 234 | 235 | return false; 236 | }); 237 | ret.find('.notification-timeago').text($.timeago(object['date'])); 238 | ret.find('.notification-delete').click(function() { 239 | self.delete($(this).parents('.notification').data('id')); 240 | return false; 241 | }); 242 | return ret; 243 | }; 244 | 245 | /** 246 | * Marks a notification as seen 247 | * @param {int} id The notification id 248 | */ 249 | this.markSeen = function (id) { 250 | $.get(this.opts.seenUrl, {id: id}, function () { 251 | 252 | }); 253 | }; 254 | 255 | /** 256 | * Deletes a notification 257 | * @param {int} id The notification id 258 | */ 259 | this.delete = function (id) { 260 | $.get(this.opts.deleteUrl, {id: id}, function () { 261 | $('.notification[data-id=' + id + ']').remove(); 262 | }); 263 | }; 264 | 265 | this.flash = function (id) { 266 | $.get(this.opts.flashUrl, {id: id}); 267 | }; 268 | 269 | /** 270 | * Translates a native type to a theme type 271 | * 272 | * @param type 273 | * @returns The translated theme type 274 | */ 275 | function getType(type) { 276 | 277 | var types = this.themes[this.opts.theme].types; 278 | var translation; 279 | 280 | if (typeof types !== "undefined") { 281 | translation = types[type]; 282 | if (typeof translation !== "undefined") { 283 | return translation; 284 | } 285 | } 286 | return type; 287 | } 288 | 289 | /** 290 | * Polls the server 291 | */ 292 | this.poll = function() { 293 | $.ajax({ 294 | url: this.opts.url, 295 | type: "GET", 296 | data: { 297 | seen: this.opts.pollSeen ? 1 : 0 298 | }, 299 | success: function(data) { 300 | var engine = self.themes[self.opts.theme]; 301 | var elem, difference, notifId; 302 | var returned = []; 303 | 304 | $.each(data, function (index, object) { 305 | returned.push(object.id); 306 | }); 307 | 308 | //find difference between displayed and returned notifications 309 | difference = $.grep(self.displayed, function(x) {return $.inArray(x, returned) < 0}); 310 | 311 | //remove old notifications 312 | if (difference.length > 0) { 313 | //iterate over displayed notification 314 | $(self.opts.listSelector + ' > div').each(function (index) { 315 | notifId = $(this).data('id'); 316 | if (difference.indexOf(notifId) !== -1) { 317 | $(this).remove(); 318 | position = self.displayed.indexOf(notifId); 319 | self.displayed.splice(position, 1); 320 | } 321 | }); 322 | } 323 | 324 | $.each(data, function (index, object) { 325 | if (self.displayed.indexOf(object.id) !== -1) { 326 | return; 327 | } 328 | 329 | self.displayed.push(object.id); 330 | 331 | if (self.opts.theme !== null && object.flashed === 0) { 332 | if (typeof engine !== "undefined") { 333 | engine.show(object); 334 | self.flash(object.id); 335 | } else { 336 | console.warn("Unknown engine: " + self.opts.theme); 337 | } 338 | } 339 | 340 | if (self.opts.listSelector !== null) { 341 | elem = self.renderRow(object); 342 | elem = self.opts.listItemBeforeRender(elem); 343 | elem.click(function() { 344 | document.location = $(this).data('route'); 345 | }).appendTo(self.opts.listSelector); 346 | } 347 | }); 348 | 349 | // Update all counters 350 | for (var i = 0; i < self.opts.counters.length; i++) { 351 | if ($(self.opts.counters[i]).text() != data.length) { 352 | $(self.opts.counters[i]).text(data.length); 353 | } 354 | } 355 | 356 | }, 357 | dataType: "json", 358 | complete: setTimeout(function() { 359 | self.poll(opts) 360 | }, opts.pollInterval), 361 | timeout: opts.xhrTimeout 362 | }); 363 | }; 364 | 365 | /** 366 | * Register click event on selector 367 | */ 368 | this.registerClickEvents = function () { 369 | if (self.opts.markAllSeenSelector !== null) { 370 | $(self.opts.markAllSeenSelector).click(function() { 371 | self.markAllSeen(); 372 | }); 373 | } 374 | if (self.opts.deleteAllSelector !== null) { 375 | $(self.opts.deleteAllSelector).click(function() { 376 | self.deleteAll(); 377 | }); 378 | } 379 | }; 380 | 381 | /** 382 | * Return array of all notification IDs displayed in listSelector 383 | * 384 | * @returns {Array} 385 | */ 386 | this.getNotificationIds = function() { 387 | var notificationIdList = []; 388 | $(self.opts.listSelector + ' > div').each(function(index) { 389 | notificationIdList.push($(this).data('id')); 390 | }); 391 | 392 | return notificationIdList; 393 | }; 394 | 395 | /** 396 | * Marks all notification as seen 397 | */ 398 | this.markAllSeen = function () { 399 | var ids = this.getNotificationIds(); 400 | $.post(this.opts.seenAllUrl, {ids: ids}, function () { 401 | //hide all 402 | var idsLength = ids.length; 403 | for (var i = 0; i < idsLength; i++) { 404 | $('.notification[data-id=' + ids[i] + ']').hide(); 405 | } 406 | }); 407 | }; 408 | 409 | /** 410 | * Delete all notifications 411 | */ 412 | this.deleteAll = function () { 413 | var ids = this.getNotificationIds(); 414 | $.post(this.opts.deleteAllUrl, {ids: ids}, function () { 415 | //remove all 416 | var idsLength = ids.length; 417 | for (var i = 0; i < idsLength; i++) { 418 | $('.notification[data-id=' + ids[i] + ']').remove(); 419 | } 420 | }); 421 | }; 422 | 423 | // register click events on jQuery elements 424 | this.registerClickEvents(); 425 | 426 | // Fire the initial poll 427 | this.poll(); 428 | 429 | }); 430 | -------------------------------------------------------------------------------- /assets/notifications.less: -------------------------------------------------------------------------------- 1 | .notification { 2 | background: #fefefe; 3 | padding: 2px 5px; 4 | cursor: pointer; 5 | border-bottom: 1px solid #b5b5b5; 6 | 7 | &.notification-danger { 8 | background: #b995a9; 9 | } 10 | &.notification-warning { 11 | background: #fcffcd; 12 | } 13 | &.notification-success { 14 | background: #00ca6d; 15 | } 16 | 17 | .title { 18 | font-weight: bold; 19 | } 20 | 21 | .description { 22 | display: none; 23 | } 24 | 25 | .timeago { 26 | color: #555; 27 | font-style: italic; 28 | font-size: 12px; 29 | } 30 | 31 | .actions { 32 | .fa { 33 | color: #aaa; 34 | display: block; 35 | font-size: 10px; 36 | margin: 4px 0; 37 | &:hover { 38 | color: #333; 39 | } 40 | } 41 | } 42 | 43 | } -------------------------------------------------------------------------------- /assets/themes/growl.css: -------------------------------------------------------------------------------- 1 | /* jQuery Growl 2 | * Copyright 2015 Kevin Sylvestre 3 | * 1.3.1 4 | */ 5 | #growls { 6 | z-index: 50000; 7 | position: fixed; } 8 | #growls.default { 9 | top: 10px; 10 | right: 10px; } 11 | #growls.tl { 12 | top: 10px; 13 | left: 10px; } 14 | #growls.tr { 15 | top: 10px; 16 | right: 10px; } 17 | #growls.bl { 18 | bottom: 10px; 19 | left: 10px; } 20 | #growls.br { 21 | bottom: 10px; 22 | right: 10px; } 23 | #growls.tc { 24 | top: 10px; 25 | right: 10px; 26 | left: 10px; } 27 | #growls.bc { 28 | bottom: 10px; 29 | right: 10px; 30 | left: 10px; } 31 | #growls.tc .growl, #growls.bc .growl { 32 | margin-left: auto; 33 | margin-right: auto; } 34 | 35 | .growl { 36 | opacity: 0.8; 37 | filter: alpha(opacity=80); 38 | position: relative; 39 | border-radius: 4px; 40 | -webkit-transition: all 0.4s ease-in-out; 41 | -moz-transition: all 0.4s ease-in-out; 42 | transition: all 0.4s ease-in-out; } 43 | .growl.growl-incoming { 44 | opacity: 0; 45 | filter: alpha(opacity=0); } 46 | .growl.growl-outgoing { 47 | opacity: 0; 48 | filter: alpha(opacity=0); } 49 | .growl.growl-small { 50 | width: 200px; 51 | padding: 5px; 52 | margin: 5px; } 53 | .growl.growl-medium { 54 | width: 250px; 55 | padding: 10px; 56 | margin: 10px; } 57 | .growl.growl-large { 58 | width: 300px; 59 | padding: 15px; 60 | margin: 15px; } 61 | .growl.growl-default { 62 | color: #FFF; 63 | background: #7f8c8d; } 64 | .growl.growl-error { 65 | color: #FFF; 66 | background: #C0392B; } 67 | .growl.growl-notice { 68 | color: #FFF; 69 | background: #2ECC71; } 70 | .growl.growl-warning { 71 | color: #FFF; 72 | background: #F39C12; } 73 | .growl .growl-close { 74 | cursor: pointer; 75 | float: right; 76 | font-size: 14px; 77 | line-height: 18px; 78 | font-weight: normal; 79 | font-family: helvetica, verdana, sans-serif; } 80 | .growl .growl-title { 81 | font-size: 18px; 82 | line-height: 24px; } 83 | .growl .growl-message { 84 | font-size: 14px; 85 | line-height: 18px; } 86 | -------------------------------------------------------------------------------- /assets/themes/growl.js: -------------------------------------------------------------------------------- 1 | // Generated by CoffeeScript 1.9.3 2 | 3 | /* 4 | jQuery Growl 5 | Copyright 2015 Kevin Sylvestre 6 | 1.3.1 7 | */ 8 | 9 | (function() { 10 | "use strict"; 11 | var $, Animation, Growl, 12 | bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; }; 13 | 14 | $ = jQuery; 15 | 16 | Animation = (function() { 17 | function Animation() {} 18 | 19 | Animation.transitions = { 20 | "webkitTransition": "webkitTransitionEnd", 21 | "mozTransition": "mozTransitionEnd", 22 | "oTransition": "oTransitionEnd", 23 | "transition": "transitionend" 24 | }; 25 | 26 | Animation.transition = function($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 | return Animation; 39 | 40 | })(); 41 | 42 | Growl = (function() { 43 | Growl.settings = { 44 | namespace: 'growl', 45 | duration: 3200, 46 | close: "×", 47 | location: "default", 48 | style: "default", 49 | size: "medium" 50 | }; 51 | 52 | Growl.growl = function(settings) { 53 | if (settings == null) { 54 | settings = {}; 55 | } 56 | this.initialize(); 57 | return new Growl(settings); 58 | }; 59 | 60 | Growl.initialize = function() { 61 | return $("body:not(:has(#growls))").append('
'); 62 | }; 63 | 64 | function Growl(settings) { 65 | if (settings == null) { 66 | settings = {}; 67 | } 68 | this.container = bind(this.container, this); 69 | this.content = bind(this.content, this); 70 | this.html = bind(this.html, this); 71 | this.$growl = bind(this.$growl, this); 72 | this.$growls = bind(this.$growls, this); 73 | this.animate = bind(this.animate, this); 74 | this.remove = bind(this.remove, this); 75 | this.dismiss = bind(this.dismiss, this); 76 | this.present = bind(this.present, this); 77 | this.cycle = bind(this.cycle, this); 78 | this.close = bind(this.close, this); 79 | this.click = bind(this.click, this); 80 | this.unbind = bind(this.unbind, this); 81 | this.bind = bind(this.bind, this); 82 | this.render = bind(this.render, this); 83 | this.settings = $.extend({}, Growl.settings, settings); 84 | this.$growls().attr('class', this.settings.location); 85 | this.render(); 86 | } 87 | 88 | Growl.prototype.render = function() { 89 | var $growl; 90 | $growl = this.$growl(); 91 | this.$growls().append($growl); 92 | if (this.settings.fixed) { 93 | this.present(); 94 | } else { 95 | this.cycle(); 96 | } 97 | }; 98 | 99 | Growl.prototype.bind = function($growl) { 100 | if ($growl == null) { 101 | $growl = this.$growl(); 102 | } 103 | $growl.on("click", this.click); 104 | return $growl.on("contextmenu", this.close).find("." + this.settings.namespace + "-close").on("click", this.close); 105 | }; 106 | 107 | Growl.prototype.unbind = function($growl) { 108 | if ($growl == null) { 109 | $growl = this.$growl(); 110 | } 111 | $growl.off("click", this.click); 112 | return $growl.off("contextmenu", this.close).find("." + this.settings.namespace + "-close").off("click", this.close); 113 | }; 114 | 115 | Growl.prototype.click = function(event) { 116 | if (this.settings.url != null) { 117 | event.preventDefault(); 118 | event.stopPropagation(); 119 | return window.open(this.settings.url); 120 | } 121 | }; 122 | 123 | Growl.prototype.close = function(event) { 124 | var $growl; 125 | event.preventDefault(); 126 | event.stopPropagation(); 127 | $growl = this.$growl(); 128 | return $growl.stop().queue(this.dismiss).queue(this.remove); 129 | }; 130 | 131 | Growl.prototype.cycle = function() { 132 | var $growl; 133 | $growl = this.$growl(); 134 | return $growl.queue(this.present).delay(this.settings.duration).queue(this.dismiss).queue(this.remove); 135 | }; 136 | 137 | Growl.prototype.present = function(callback) { 138 | var $growl; 139 | $growl = this.$growl(); 140 | this.bind($growl); 141 | return this.animate($growl, this.settings.namespace + "-incoming", 'out', callback); 142 | }; 143 | 144 | Growl.prototype.dismiss = function(callback) { 145 | var $growl; 146 | $growl = this.$growl(); 147 | this.unbind($growl); 148 | return this.animate($growl, this.settings.namespace + "-outgoing", 'in', callback); 149 | }; 150 | 151 | Growl.prototype.remove = function(callback) { 152 | this.$growl().remove(); 153 | return callback(); 154 | }; 155 | 156 | Growl.prototype.animate = function($element, name, direction, callback) { 157 | var transition; 158 | if (direction == null) { 159 | direction = 'in'; 160 | } 161 | transition = Animation.transition($element); 162 | $element[direction === 'in' ? 'removeClass' : 'addClass'](name); 163 | $element.offset().position; 164 | $element[direction === 'in' ? 'addClass' : 'removeClass'](name); 165 | if (callback == null) { 166 | return; 167 | } 168 | if (transition != null) { 169 | $element.one(transition, callback); 170 | } else { 171 | callback(); 172 | } 173 | }; 174 | 175 | Growl.prototype.$growls = function() { 176 | return this.$_growls != null ? this.$_growls : this.$_growls = $('#growls'); 177 | }; 178 | 179 | Growl.prototype.$growl = function() { 180 | return this.$_growl != null ? this.$_growl : this.$_growl = $(this.html()); 181 | }; 182 | 183 | Growl.prototype.html = function() { 184 | return this.container(this.content()); 185 | }; 186 | 187 | Growl.prototype.content = function() { 188 | return "
" + this.settings.close + "
\n
" + this.settings.title + "
\n
" + this.settings.message + "
"; 189 | }; 190 | 191 | Growl.prototype.container = function(content) { 192 | return "
\n " + content + "\n
"; 193 | }; 194 | 195 | return Growl; 196 | 197 | })(); 198 | 199 | this.Growl = Growl; 200 | 201 | $.growl = function(options) { 202 | if (options == null) { 203 | options = {}; 204 | } 205 | return Growl.growl(options); 206 | }; 207 | 208 | $.growl.error = function(options) { 209 | var settings; 210 | if (options == null) { 211 | options = {}; 212 | } 213 | settings = { 214 | title: "Error!", 215 | style: "error" 216 | }; 217 | return $.growl($.extend(settings, options)); 218 | }; 219 | 220 | $.growl.notice = function(options) { 221 | var settings; 222 | if (options == null) { 223 | options = {}; 224 | } 225 | settings = { 226 | title: "Notice!", 227 | style: "notice" 228 | }; 229 | return $.growl($.extend(settings, options)); 230 | }; 231 | 232 | $.growl.warning = function(options) { 233 | var settings; 234 | if (options == null) { 235 | options = {}; 236 | } 237 | settings = { 238 | title: "Warning!", 239 | style: "warning" 240 | }; 241 | return $.growl($.extend(settings, options)); 242 | }; 243 | 244 | }).call(this); 245 | -------------------------------------------------------------------------------- /assets/themes/notie.css: -------------------------------------------------------------------------------- 1 | .notie-transition { 2 | -moz-transition: all 0.3s ease; 3 | -webkit-transition: all 0.3s ease; 4 | transition: all 0.3s ease; } 5 | 6 | .notie-background-success { 7 | background-color: #57BF57; } 8 | 9 | .notie-background-warning { 10 | background-color: #D6A14D; } 11 | 12 | .notie-background-error { 13 | background-color: #E1715B; } 14 | 15 | .notie-background-info { 16 | background-color: #4D82D6; } 17 | 18 | #notie-alert-outer, #notie-confirm-outer, #notie-input-outer, #notie-select-outer { 19 | position: fixed; 20 | top: 0; 21 | left: 0; 22 | z-index: 999999999; 23 | height: auto; 24 | width: 100%; 25 | display: none; 26 | text-align: center; 27 | cursor: pointer; 28 | font-size: 24px; 29 | -o-box-shadow: 0px 0px 10px 0px rgba(0, 0, 0, 0.5); 30 | -ms-box-shadow: 0px 0px 10px 0px rgba(0, 0, 0, 0.5); 31 | -moz-box-shadow: 0px 0px 10px 0px rgba(0, 0, 0, 0.5); 32 | -webkit-box-shadow: 0px 0px 10px 0px rgba(0, 0, 0, 0.5); 33 | box-shadow: 0px 0px 10px 0px rgba(0, 0, 0, 0.5); } 34 | @media (max-width: 600px) { 35 | #notie-alert-outer, #notie-confirm-outer, #notie-input-outer, #notie-select-outer { 36 | font-size: 18px; } } 37 | 38 | #notie-alert-inner { 39 | padding: 20px; 40 | display: table-cell; } 41 | 42 | #notie-alert-content { 43 | max-width: 900px; 44 | margin: 0 auto; } 45 | 46 | #notie-alert-text { 47 | color: #FFFFFF; } 48 | 49 | #notie-confirm-outer { 50 | cursor: default; } 51 | 52 | #notie-confirm-inner, #notie-input-inner, #notie-select-inner { 53 | box-sizing: border-box; 54 | width: 100%; 55 | padding: 20px; 56 | display: block; 57 | cursor: default; 58 | background-color: #4D82D6; } 59 | 60 | #notie-confirm-text { 61 | color: #FFFFFF; } 62 | 63 | #notie-confirm-text-yes { 64 | color: #FFFFFF; } 65 | 66 | #notie-confirm-text-no { 67 | color: #FFFFFF; } 68 | 69 | #notie-confirm-yes, #notie-confirm-no, #notie-input-no, #notie-input-yes { 70 | float: left; 71 | height: 50px; 72 | line-height: 50px; 73 | width: 50%; 74 | cursor: pointer; 75 | background-color: #57BF57; } 76 | 77 | #notie-confirm-no, #notie-input-no { 78 | float: right; 79 | background-color: #E1715B; } 80 | 81 | #notie-confirm-background, #notie-input-background, #notie-select-background { 82 | position: fixed; 83 | top: 0; 84 | left: 0; 85 | z-index: 999999980; 86 | height: 100%; 87 | width: 100%; 88 | display: none; 89 | background-color: #FFFFFF; 90 | opacity: 0; } 91 | 92 | /* INPUT */ 93 | #notie-input-outer { 94 | cursor: default; } 95 | 96 | #notie-input-field { 97 | display: block; 98 | box-sizing: border-box; 99 | height: 55px; 100 | width: 100%; 101 | text-align: center; 102 | outline: 0; 103 | border: 0; 104 | background-color: #FFFFFF; 105 | font-family: inherit; 106 | font-size: 24px; } 107 | @media (max-width: 600px) { 108 | #notie-input-field { 109 | font-size: 18px; } } 110 | 111 | #notie-input-text { 112 | color: #FFFFFF; } 113 | 114 | #notie-input-text-yes { 115 | color: #FFFFFF; } 116 | 117 | #notie-input-text-no { 118 | color: #FFFFFF; } 119 | 120 | #notie-select-outer { 121 | top: auto; 122 | bottom: 0; 123 | cursor: default; } 124 | 125 | #notie-select-text { 126 | color: #FFFFFF; } 127 | 128 | #notie-select-choices, .notie-select-choice { 129 | background-color: #57BF57; } 130 | 131 | .notie-select-choice { 132 | height: 50px; 133 | line-height: 50px; 134 | color: #FFFFFF; 135 | cursor: pointer; } 136 | 137 | #notie-select-cancel { 138 | height: 60px; 139 | line-height: 60px; 140 | color: #FFFFFF; 141 | cursor: pointer; 142 | background-color: #A0A0A0; } 143 | -------------------------------------------------------------------------------- /assets/themes/notie.js: -------------------------------------------------------------------------------- 1 | var notie=function(){function e(e){for(var t in e)h[t]=e[t]}function t(e,t,i){h.colorText.length>0&&(C.style.color=h.colorText),f(),H++,setTimeout(function(){H--},h.animationDelay+10),1===H&&(D?(clearTimeout(x),clearTimeout(E),n(function(){o(e,t,i)})):o(e,t,i))}function o(e,t,o){D=!0;var i=0;if("undefined"==typeof o||0===o)var i=864e5;else i=o>0&&1>o?1e3:1e3*o;switch(y(k,"notie-background-success"),y(k,"notie-background-warning"),y(k,"notie-background-error"),y(k,"notie-background-info"),e){case 1:h.colorSuccess.length>0?k.style.backgroundColor=h.colorSuccess:p(k,"notie-background-success");break;case 2:h.colorWarning.length>0?k.style.backgroundColor=h.colorWarning:p(k,"notie-background-warning");break;case 3:h.colorError.length>0?k.style.backgroundColor=h.colorError:p(k,"notie-background-error");break;case 4:h.colorInfo.length>0?k.style.backgroundColor=h.colorInfo:p(k,"notie-background-info")}C.innerHTML=t,k.style.top="-10000px",k.style.display="table",k.style.top="-"+k.offsetHeight-5+"px",x=setTimeout(function(){p(k,"notie-transition"),k.style.top=0,E=setTimeout(function(){n(function(){})},i)},20)}function n(e){k.style.top="-"+k.offsetHeight-5+"px",setTimeout(function(){y(k,"notie-transition"),k.style.top="-10000px",D=!1,e&&e()},h.animationDelay+10)}function i(e,t,o,i,l){h.colorInfo.length>0&&(L.style.backgroundColor=h.colorInfo),h.colorSuccess.length>0&&(M.style.backgroundColor=h.colorSuccess),h.colorError.length>0&&(S.style.backgroundColor=h.colorError),h.colorText.length>0&&(I.style.color=h.colorText,A.style.color=h.colorText,N.style.color=h.colorText),f(),D?(clearTimeout(x),clearTimeout(E),n(function(){c(e,t,o,i,l)})):c(e,t,o,i,l)}function c(e,t,o,n,i){function c(){I.innerHTML=e,A.innerHTML=t,N.innerHTML=o,w.style.top="-10000px",w.style.display="table",w.style.top="-"+w.offsetHeight-5+"px",W.style.display="block",setTimeout(function(){p(w,"notie-transition"),w.style.top=0,W.style.opacity="0.75",setTimeout(function(){V=!0},h.animationDelay+10)},20)}g(),M.onclick=function(){l(),n&&setTimeout(function(){n()},h.animationDelay+10)},S.onclick=function(){l(),i&&setTimeout(function(){i()},h.animationDelay+10)},V?(l(),setTimeout(function(){c()},h.animationDelay+10)):c()}function l(){w.style.top="-"+w.offsetHeight-5+"px",W.style.opacity="0",setTimeout(function(){y(w,"notie-transition"),w.style.top="-10000px",W.style.display="none",b(),V=!1},h.animationDelay+10)}function r(e,t,o,i,c,l){h.colorInfo.length>0&&(z.style.backgroundColor=h.colorInfo),h.colorSuccess.length>0&&(R.style.backgroundColor=h.colorSuccess),h.colorError.length>0&&($.style.backgroundColor=h.colorError),h.colorText.length>0&&(q.style.color=h.colorText,F.style.color=h.colorText,G.style.color=h.colorText),f(),"undefined"!=typeof e.type&&e.type?O.setAttribute("type",e.type):O.setAttribute("type","text"),"undefined"!=typeof e.placeholder&&e.placeholder&&O.setAttribute("placeholder",e.placeholder),"undefined"!=typeof e.prefilledValue&&e.prefilledValue?O.value=e.prefilledValue:O.value="",D?(clearTimeout(x),clearTimeout(E),n(function(){a(t,o,i,c,l)})):a(t,o,i,c,l)}function a(e,t,o,n,i){function c(){q.innerHTML=e,F.innerHTML=t,G.innerHTML=o,j.style.top="-10000px",j.style.display="table",j.style.top="-"+j.offsetHeight-5+"px",B.style.display="block",setTimeout(function(){p(j,"notie-transition"),j.style.top=0,B.style.opacity="0.75",setTimeout(function(){J=!0,O.focus()},h.animationDelay+10)},20)}g(),R.onclick=function(){d(),n&&setTimeout(function(){n(O.value)},h.animationDelay+10)},$.onclick=function(){d(),i&&setTimeout(function(){i(O.value)},h.animationDelay+10)},J?(d(),setTimeout(function(){c()},h.animationDelay+10)):c()}function d(){j.style.top="-"+j.offsetHeight-5+"px",B.style.opacity="0",setTimeout(function(){y(j,"notie-transition"),B.style.display="none",j.style.top="-10000px",b(),J=!1},h.animationDelay+10)}function u(e,t){h.colorInfo.length>0&&(P.style.backgroundColor=h.colorInfo),h.colorNeutral.length>0&&(Y.style.backgroundColor=h.colorNeutral),h.colorText.length>0&&(Q.style.color=h.colorText,Y.style.color=h.colorText);for(var o=[],i=0;i0&&(l.style.color=h.colorText),t[c].type)switch(t[c].type){case 1:h.colorSuccess.length>0?l.style.backgroundColor=h.colorSuccess:p(l,"notie-background-success");break;case 2:h.colorWarning.length>0?l.style.backgroundColor=h.colorWarning:p(l,"notie-background-warning");break;case 3:h.colorError.length>0?l.style.backgroundColor=h.colorError:p(l,"notie-background-error");break;case 4:h.colorInfo.length>0?l.style.backgroundColor=h.colorInfo:p(l,"notie-background-info")}else t[c].color&&(l.style.backgroundColor=t[c].color);c>0&&l.style.backgroundColor===i.style.backgroundColor&&(i.style.borderBottom="1px solid rgba(255, 255, 255, 0.2)"),l.onclick=function(e){return function(){m(),setTimeout(function(){o[e]()},h.animationDelay+10)}}(c),i=l}ee?(m(),setTimeout(function(){n(e)},h.animationDelay+10)):n(e)}function m(){K.style.bottom="-"+K.offsetHeight-5+"px",U.style.opacity="0",setTimeout(function(){y(K,"notie-transition"),K.style.bottom="-10000px",U.style.display="none",b(),ee=!1},h.animationDelay+10)}function p(e,t){e.classList?e.classList.add(t):e.className+=" "+t}function y(e,t){e.classList?e.classList.remove(t):e.className=e.className.replace(new RegExp("(^|\\b)"+t.split(" ").join("|")+"(\\b|$)","gi")," ")}function f(){document.activeElement.blur()}function g(){Z=document.body.style.height,_=document.body.style.overflow,document.body.style.height="100%",document.body.style.overflow="hidden"}function b(){document.body.style.height=Z,document.body.style.overflow=_}var h={colorSuccess:"",colorWarning:"",colorError:"",colorInfo:"",colorNeutral:"",colorText:"",animationDelay:300,backgroundClickDismiss:!0},k=document.createElement("div");k.id="notie-alert-outer",k.onclick=function(){clearTimeout(x),clearTimeout(E),n()},document.body.appendChild(k);var v=document.createElement("div");v.id="notie-alert-inner",k.appendChild(v);var T=document.createElement("div");T.id="notie-alert-content",v.appendChild(T);var C=document.createElement("span");C.id="notie-alert-text",T.appendChild(C);var x,E,D=!1,H=0,w=document.createElement("div");w.id="notie-confirm-outer";var L=document.createElement("div");L.id="notie-confirm-inner",w.appendChild(L);var I=document.createElement("span");I.id="notie-confirm-text",L.appendChild(I);var M=document.createElement("div");M.id="notie-confirm-yes",w.appendChild(M);var S=document.createElement("div");S.id="notie-confirm-no",w.appendChild(S);var A=document.createElement("span");A.id="notie-confirm-text-yes",M.appendChild(A);var N=document.createElement("span");N.id="notie-confirm-text-no",S.appendChild(N);var W=document.createElement("div");W.id="notie-confirm-background",p(W,"notie-transition"),W.onclick=function(){h.backgroundClickDismiss&&l()},document.body.appendChild(w),document.body.appendChild(W);var V=!1,j=document.createElement("div");j.id="notie-input-outer";var B=document.createElement("div");B.id="notie-input-background",p(B,"notie-transition");var z=document.createElement("div");z.id="notie-input-inner",j.appendChild(z);var O=document.createElement("input");O.id="notie-input-field",O.setAttribute("autocomplete","off"),O.setAttribute("autocorrect","off"),O.setAttribute("autocapitalize","off"),O.setAttribute("spellcheck","false"),j.appendChild(O);var R=document.createElement("div");R.id="notie-input-yes",j.appendChild(R);var $=document.createElement("div");$.id="notie-input-no",j.appendChild($);var q=document.createElement("span");q.id="notie-input-text",z.appendChild(q);var F=document.createElement("span");F.id="notie-input-text-yes",R.appendChild(F);var G=document.createElement("span");G.id="notie-input-text-no",$.appendChild(G),document.body.appendChild(j),document.body.appendChild(B),B.onclick=function(){h.backgroundClickDismiss&&d()};var J=!1,K=document.createElement("div");K.id="notie-select-outer";var P=document.createElement("div");P.id="notie-select-inner",K.appendChild(P);var Q=document.createElement("span");Q.id="notie-select-text",P.appendChild(Q);var U=document.createElement("div");U.id="notie-select-background",p(U,"notie-transition");var X=document.createElement("div");X.id="notie-select-choices",K.appendChild(X);var Y=document.createElement("div");Y.id="notie-select-cancel",Y.innerHTML="Cancel",K.appendChild(Y),document.body.appendChild(K),document.body.appendChild(U),U.onclick=function(){h.backgroundClickDismiss&&m()},Y.onclick=function(){m()};var Z,_,ee=!1;return window.addEventListener("keydown",function(e){var t=13==e.which||13==e.keyCode,o=27==e.which||27==e.keyCode;D?(t||o)&&(clearTimeout(x),clearTimeout(E),n()):V?t?M.click():o&&l():J?t?R.click():o&&d():ee&&o&&m()}),{setOptions:e,alert:t,confirm:i,input:r,select:u}}();"object"==typeof module&&module.exports&&(module.exports=notie); 2 | -------------------------------------------------------------------------------- /assets/themes/notifit.css: -------------------------------------------------------------------------------- 1 | #ui_notifIt{ 2 | position: fixed; 3 | top: 10px; 4 | right: 10px; 5 | cursor: pointer; 6 | overflow: hidden; 7 | -webkit-box-shadow: 0px 3px 5px rgba(0, 0, 0, 0.3); 8 | -moz-box-shadow: 0px 3px 5px rgba(0, 0, 0, 0.3); 9 | -o-box-shadow: 0px 3px 5px rgba(0, 0, 0, 0.3); 10 | box-shadow: 0px 3px 5px rgba(0, 0, 0, 0.3); 11 | -wekbit-border-radius: 5px; 12 | -moz-border-radius: 5px; 13 | -o-border-radius: 5px; 14 | border-radius: 5px; 15 | z-index: 2000; 16 | } 17 | #ui_notifIt:hover{ 18 | opacity: 1 !important; 19 | } 20 | #ui_notifIt p{ 21 | text-align: center; 22 | font-family: sans-serif; 23 | font-size: 14px; 24 | padding: 0; 25 | margin: 0; 26 | } 27 | 28 | /* Color setup */ 29 | /* You are free to change all of this */ 30 | #ui_notifIt.success{ 31 | background-color: yellowgreen; 32 | color: white; 33 | } 34 | #ui_notifIt.error{ 35 | background-color: orangered; 36 | color: white; 37 | } 38 | #ui_notifIt.warning{ 39 | background-color: orange; 40 | color: white; 41 | } 42 | #ui_notifIt.info{ 43 | background-color: deepskyblue; 44 | color: white; 45 | } 46 | #ui_notifIt.default{ 47 | background-color: #EEE; 48 | color: #444; 49 | } -------------------------------------------------------------------------------- /assets/themes/notifit.js: -------------------------------------------------------------------------------- 1 | !function(a,b){if("function"==typeof define&&define.amd)define(b);else{var c=b(a.b);a.notif=c.notif,a.notifit_dismiss=c.notifit_dismiss}}(this,function(){function a(a){var c=function(){return e("",{id:"notifIt_close",html:"×"})},d=function(){var a=e("
",{id:"ui_notifIt"}),b=e("

",{html:h.msg});return a.append(b),a};window.notifit_timeout=null;var e=jQuery,f=(window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth)/2,g=["left","center","right","bottom"],h={type:"default",width:400,height:60,position:"right",autohide:1,msg:"This is my default message",opacity:1,multiline:0,fade:0,bgcolor:"",color:"",timeout:5e3,zindex:null,offset:0,callback:null,clickable:!1,animation:"slide"};if(e.extend(h,a),h.animations={},h.animations.slide={center:{css_start:{top:parseInt(0-(h.height+10)),left:f-parseInt(h.width/2)},"in":{top:parseInt(10+h.offset)},out:{start:{top:parseInt(h.height-h.height/2)},end:{top:parseInt(0-2*h.height)}}},bottom:{css_start:{top:"auto",bottom:parseInt(0-(h.height+10)),left:f-parseInt(h.width/2)},"in":{bottom:parseInt(10+h.offset)},out:{start:{bottom:parseInt(h.height-h.height/2)},end:{bottom:parseInt(0-2*h.height)}}},right:{css_start:{right:parseInt(0-(h.width+10)),right:parseInt(0-2*h.width)},"in":{right:parseInt(10+h.offset)},out:{start:{right:parseFloat(h.width-.9*h.width)},end:{right:parseInt(0-2*h.width)}}},left:{css_start:{left:parseInt(0-(h.width+10))},"in":{left:parseInt(10+h.offset)},out:{start:{left:parseFloat(h.width-.9*h.width)},end:{left:parseInt(0-2*h.width)}}}},h.animations.zoom={center:{css_start:{top:10,left:f-parseInt(h.width/2),zoom:.01},"in":{zoom:1},out:{start:{zoom:1.3},end:{zoom:.01}}},bottom:{css_start:{top:"auto",bottom:10,left:f-parseInt(h.width/2),zoom:.01},"in":{zoom:1},out:{start:{zoom:1.3},end:{zoom:.01}}},right:{css_start:{right:10,zoom:.01},"in":{right:parseInt(10+h.offset),zoom:1},out:{start:{zoom:1.3},end:{zoom:.01}}},left:{css_start:{left:10,zoom:.01},"in":{zoom:1},out:{start:{zoom:1.3},end:{zoom:.01}}}},h.available_animations=Object.keys(h.animations),!h.available_animations.length)throw new Error("No animations");if(!g.length)throw new Error("No available positions");-1===g.indexOf(h.position)&&(h.position=g[0]),-1===h.available_animations.indexOf(h.animation)&&(h.animation=h.available_animations[0]),"function"!=typeof h.callback&&(h.callback=null),h.width>0?h.width=h.width:"all"===h.width?h.width=screen.width-60:h.width=400,h.height<100&&h.height>0&&(height=h.height);var i=d();h.clickable&&i.append(c());var j=function(){e("#ui_notifIt").remove(),clearInterval(window.notifit_timeout)};return j(),e("body").append(i),h.zindex&&e("#ui_notifIt").css("z-index",h.zindex),h.multiline?e("#ui_notifIt").css("padding",15):(e("#ui_notifIt").css("height",height),e("#ui_notifIt p").css("line-height",height+"px")),e("#ui_notifIt").css({width:h.width,opacity:h.opacity,"background-color":h.bgcolor,color:h.color}),e("#ui_notifIt").addClass(h.type),h.animations[h.animation][h.position].css_start?e("#ui_notifIt").css(h.animations[h.animation][h.position].css_start):e("#ui_notifIt").css(h.animations[h.available_animations[0]][h.position].css_start),e("#ui_notifIt").animate(h.animations[h.animation][h.position]["in"]),h.clickable||e("#ui_notifIt").click(function(a){a.stopPropagation(),b(h)}),e("body").on("click","#ui_notifIt #notifIt_close",function(){b(h)}),h.autohide&&(isNaN(h.timeout)||(window.notifit_timeout=setTimeout(function(){b(h)},h.timeout))),{destroy:j}}function b(a){if(clearTimeout(window.notifit_timeout),"fade"!=a.animation){if(a.animations&&a.animations[a.animation]&&a.animations[a.animation][a.position]&&a.animations[a.animation][a.position].out&&a.animations[a.animation][a.position].out.start&&a.animations[a.animation][a.position].out.end)animation1=a.animations[a.animation][a.position].out.start,animation2=a.animations[a.animation][a.position].out.end;else{if(!(a.animations[a.available_animations[0]]&&a.animations[a.available_animations[0]][a.position]&&a.animations[a.available_animations[0]][a.position].out&&a.animations[a.available_animations[0]][a.position].out.start&&a.animations[a.available_animations[0]][a.position].out.end))throw new Error("Invalid animation");animation1=a.animations[a.available_animations[0]][a.position].out.start,animation2=a.animations[a.available_animations[0]][a.position].out.end}$("#ui_notifIt").animate(animation1,100,function(){$("#ui_notifIt").animate(animation2,100,function(){$("#ui_notifIt").remove(),a.callback&&a.callback()})})}else $("#ui_notifIt").fadeOut("slow",function(){$("#ui_notifIt").remove(),a.callback&&a.callback()})}return{notif:a,notifit_dismiss:b}}); -------------------------------------------------------------------------------- /assets/themes/notify.js: -------------------------------------------------------------------------------- 1 | /* Notify.js - http://notifyjs.com/ Copyright (c) 2015 MIT */ 2 | (function(window, document, $, undefined) { 3 | "use strict"; 4 | //IE8 indexOf polyfill 5 | var indexOf = [].indexOf || function(item) { 6 | for (var i = 0, l = this.length; i < l; i++) { 7 | if (i in this && this[i] === item) { 8 | return i; 9 | } 10 | } 11 | return -1; 12 | }; 13 | 14 | var pluginName = "notify"; 15 | var pluginClassName = pluginName + "js"; 16 | var blankFieldName = pluginName + "!blank"; 17 | 18 | var positions = { 19 | t: "top", 20 | m: "middle", 21 | b: "bottom", 22 | l: "left", 23 | c: "center", 24 | r: "right" 25 | }; 26 | var hAligns = ["l", "c", "r"]; 27 | var vAligns = ["t", "m", "b"]; 28 | var mainPositions = ["t", "b", "l", "r"]; 29 | var opposites = { 30 | t: "b", 31 | m: null, 32 | b: "t", 33 | l: "r", 34 | c: null, 35 | r: "l" 36 | }; 37 | 38 | var parsePosition = function(str) { 39 | var pos; 40 | pos = []; 41 | $.each(str.split(/\W+/), function(i, word) { 42 | var w; 43 | w = word.toLowerCase().charAt(0); 44 | if (positions[w]) { 45 | return pos.push(w); 46 | } 47 | }); 48 | return pos; 49 | }; 50 | 51 | var styles = {}; 52 | 53 | var coreStyle = { 54 | name: "core", 55 | html: "

\n
\n
\n
", 56 | css: "." + pluginClassName + "-corner {\n position: fixed;\n margin: 5px;\n z-index: 1050;\n}\n\n." + pluginClassName + "-corner ." + pluginClassName + "-wrapper,\n." + pluginClassName + "-corner ." + pluginClassName + "-container {\n position: relative;\n display: block;\n height: inherit;\n width: inherit;\n margin: 3px;\n}\n\n." + pluginClassName + "-wrapper {\n z-index: 1;\n position: absolute;\n display: inline-block;\n height: 0;\n width: 0;\n}\n\n." + pluginClassName + "-container {\n display: none;\n z-index: 1;\n position: absolute;\n}\n\n." + pluginClassName + "-hidable {\n cursor: pointer;\n}\n\n[data-notify-text],[data-notify-html] {\n position: relative;\n}\n\n." + pluginClassName + "-arrow {\n position: absolute;\n z-index: 2;\n width: 0;\n height: 0;\n}" 57 | }; 58 | 59 | var stylePrefixes = { 60 | "border-radius": ["-webkit-", "-moz-"] 61 | }; 62 | 63 | var getStyle = function(name) { 64 | return styles[name]; 65 | }; 66 | 67 | var addStyle = function(name, def) { 68 | var cssText, elem, fields, ref; 69 | if (!name) { 70 | throw "Missing Style name"; 71 | } 72 | if (!def) { 73 | throw "Missing Style definition"; 74 | } 75 | if (!def.html) { 76 | throw "Missing Style HTML"; 77 | } 78 | if ((ref = styles[name]) != null ? ref.cssElem : void 0) { 79 | if (window.console) { 80 | console.warn(pluginName + ": overwriting style '" + name + "'"); 81 | } 82 | styles[name].cssElem.remove(); 83 | } 84 | def.name = name; 85 | styles[name] = def; 86 | cssText = ""; 87 | if (def.classes) { 88 | $.each(def.classes, function(className, props) { 89 | cssText += "." + pluginClassName + "-" + def.name + "-" + className + " {\n"; 90 | $.each(props, function(name, val) { 91 | if (stylePrefixes[name]) { 92 | $.each(stylePrefixes[name], function(i, prefix) { 93 | return cssText += " " + prefix + name + ": " + val + ";\n"; 94 | }); 95 | } 96 | return cssText += " " + name + ": " + val + ";\n"; 97 | }); 98 | return cssText += "}\n"; 99 | }); 100 | } 101 | if (def.css) { 102 | cssText += "/* styles for " + def.name + " */\n" + def.css; 103 | } 104 | if (cssText) { 105 | def.cssElem = insertCSS(cssText); 106 | def.cssElem.attr("id", "notify-" + def.name); 107 | } 108 | fields = {}; 109 | elem = $(def.html); 110 | findFields("html", elem, fields); 111 | findFields("text", elem, fields); 112 | return def.fields = fields; 113 | }; 114 | 115 | var insertCSS = function(cssText) { 116 | var e, elem, error; 117 | elem = createElem("style"); 118 | elem.attr("type", 'text/css'); 119 | $("head").append(elem); 120 | try { 121 | elem.html(cssText); 122 | } catch (error) { 123 | e = error; 124 | elem[0].styleSheet.cssText = cssText; 125 | } 126 | return elem; 127 | }; 128 | 129 | var findFields = function(type, elem, fields) { 130 | var attr; 131 | if (type !== "html") { 132 | type = "text"; 133 | } 134 | attr = "data-notify-" + type; 135 | return find(elem, "[" + attr + "]").each(function() { 136 | var name; 137 | name = $(this).attr(attr); 138 | if (!name) { 139 | name = blankFieldName; 140 | } 141 | return fields[name] = type; 142 | }); 143 | }; 144 | 145 | var find = function(elem, selector) { 146 | if (elem.is(selector)) { 147 | return elem; 148 | } else { 149 | return elem.find(selector); 150 | } 151 | }; 152 | 153 | var pluginOptions = { 154 | clickToHide: true, 155 | autoHide: true, 156 | autoHideDelay: 5000, 157 | arrowShow: true, 158 | arrowSize: 5, 159 | breakNewLines: true, 160 | elementPosition: "bottom", 161 | globalPosition: "top right", 162 | style: "bootstrap", 163 | className: "error", 164 | showAnimation: "slideDown", 165 | showDuration: 400, 166 | hideAnimation: "slideUp", 167 | hideDuration: 200, 168 | gap: 5 169 | }; 170 | 171 | var inherit = function(a, b) { 172 | var F; 173 | F = function() {}; 174 | F.prototype = a; 175 | return $.extend(true, new F(), b); 176 | }; 177 | 178 | var defaults = function(opts) { 179 | return $.extend(pluginOptions, opts); 180 | }; 181 | 182 | var createElem = function(tag) { 183 | return $("<" + tag + ">"); 184 | }; 185 | 186 | var globalAnchors = {}; 187 | 188 | var getAnchorElement = function(element) { 189 | var radios; 190 | if (element.is('[type=radio]')) { 191 | radios = element.parents('form:first').find('[type=radio]').filter(function(i, e) { 192 | return $(e).attr("name") === element.attr("name"); 193 | }); 194 | element = radios.first(); 195 | } 196 | return element; 197 | }; 198 | 199 | var incr = function(obj, pos, val) { 200 | var opp, temp; 201 | if (typeof val === "string") { 202 | val = parseInt(val, 10); 203 | } else if (typeof val !== "number") { 204 | return; 205 | } 206 | if (isNaN(val)) { 207 | return; 208 | } 209 | opp = positions[opposites[pos.charAt(0)]]; 210 | temp = pos; 211 | if (obj[opp] !== undefined) { 212 | pos = positions[opp.charAt(0)]; 213 | val = -val; 214 | } 215 | if (obj[pos] === undefined) { 216 | obj[pos] = val; 217 | } else { 218 | obj[pos] += val; 219 | } 220 | return null; 221 | }; 222 | 223 | var realign = function(alignment, inner, outer) { 224 | if (alignment === "l" || alignment === "t") { 225 | return 0; 226 | } else if (alignment === "c" || alignment === "m") { 227 | return outer / 2 - inner / 2; 228 | } else if (alignment === "r" || alignment === "b") { 229 | return outer - inner; 230 | } 231 | throw "Invalid alignment"; 232 | }; 233 | 234 | var encode = function(text) { 235 | encode.e = encode.e || createElem("div"); 236 | return encode.e.text(text).html(); 237 | }; 238 | 239 | function Notification(elem, data, options) { 240 | if (typeof options === "string") { 241 | options = { 242 | className: options 243 | }; 244 | } 245 | this.options = inherit(pluginOptions, $.isPlainObject(options) ? options : {}); 246 | this.loadHTML(); 247 | this.wrapper = $(coreStyle.html); 248 | if (this.options.clickToHide) { 249 | this.wrapper.addClass(pluginClassName + "-hidable"); 250 | } 251 | this.wrapper.data(pluginClassName, this); 252 | this.arrow = this.wrapper.find("." + pluginClassName + "-arrow"); 253 | this.container = this.wrapper.find("." + pluginClassName + "-container"); 254 | this.container.append(this.userContainer); 255 | if (elem && elem.length) { 256 | this.elementType = elem.attr("type"); 257 | this.originalElement = elem; 258 | this.elem = getAnchorElement(elem); 259 | this.elem.data(pluginClassName, this); 260 | this.elem.before(this.wrapper); 261 | } 262 | this.container.hide(); 263 | this.run(data); 264 | } 265 | 266 | Notification.prototype.loadHTML = function() { 267 | var style; 268 | style = this.getStyle(); 269 | this.userContainer = $(style.html); 270 | this.userFields = style.fields; 271 | }; 272 | 273 | Notification.prototype.show = function(show, userCallback) { 274 | var args, callback, elems, fn, hidden; 275 | callback = (function(_this) { 276 | return function() { 277 | if (!show && !_this.elem) { 278 | _this.destroy(); 279 | } 280 | if (userCallback) { 281 | return userCallback(); 282 | } 283 | }; 284 | })(this); 285 | hidden = this.container.parent().parents(':hidden').length > 0; 286 | elems = this.container.add(this.arrow); 287 | args = []; 288 | if (hidden && show) { 289 | fn = "show"; 290 | } else if (hidden && !show) { 291 | fn = "hide"; 292 | } else if (!hidden && show) { 293 | fn = this.options.showAnimation; 294 | args.push(this.options.showDuration); 295 | } else if (!hidden && !show) { 296 | fn = this.options.hideAnimation; 297 | args.push(this.options.hideDuration); 298 | } else { 299 | return callback(); 300 | } 301 | args.push(callback); 302 | return elems[fn].apply(elems, args); 303 | }; 304 | 305 | Notification.prototype.setGlobalPosition = function() { 306 | var align, anchor, css, key, main, pAlign, pMain, ref; 307 | ref = this.getPosition(), pMain = ref[0], pAlign = ref[1]; 308 | main = positions[pMain]; 309 | align = positions[pAlign]; 310 | key = pMain + "|" + pAlign; 311 | anchor = globalAnchors[key]; 312 | if (!anchor) { 313 | anchor = globalAnchors[key] = createElem("div"); 314 | css = {}; 315 | css[main] = 0; 316 | if (align === "middle") { 317 | css.top = '45%'; 318 | } else if (align === "center") { 319 | css.left = '45%'; 320 | } else { 321 | css[align] = 0; 322 | } 323 | anchor.css(css).addClass(pluginClassName + "-corner"); 324 | $("body").append(anchor); 325 | } 326 | return anchor.prepend(this.wrapper); 327 | }; 328 | 329 | Notification.prototype.setElementPosition = function() { 330 | var arrowColor, arrowCss, arrowSize, color, contH, contW, css, elemH, elemIH, elemIW, elemPos, elemW, gap, j, k, len, len1, mainFull, margin, opp, oppFull, pAlign, pArrow, pMain, pos, posFull, position, ref, wrapPos; 331 | position = this.getPosition(); 332 | pMain = position[0], pAlign = position[1], pArrow = position[2]; 333 | elemPos = this.elem.position(); 334 | elemH = this.elem.outerHeight(); 335 | elemW = this.elem.outerWidth(); 336 | elemIH = this.elem.innerHeight(); 337 | elemIW = this.elem.innerWidth(); 338 | wrapPos = this.wrapper.position(); 339 | contH = this.container.height(); 340 | contW = this.container.width(); 341 | mainFull = positions[pMain]; 342 | opp = opposites[pMain]; 343 | oppFull = positions[opp]; 344 | css = {}; 345 | css[oppFull] = pMain === "b" ? elemH : pMain === "r" ? elemW : 0; 346 | incr(css, "top", elemPos.top - wrapPos.top); 347 | incr(css, "left", elemPos.left - wrapPos.left); 348 | ref = ["top", "left"]; 349 | for (j = 0, len = ref.length; j < len; j++) { 350 | pos = ref[j]; 351 | margin = parseInt(this.elem.css("margin-" + pos), 10); 352 | if (margin) { 353 | incr(css, pos, margin); 354 | } 355 | } 356 | gap = Math.max(0, this.options.gap - (this.options.arrowShow ? arrowSize : 0)); 357 | incr(css, oppFull, gap); 358 | if (!this.options.arrowShow) { 359 | this.arrow.hide(); 360 | } else { 361 | arrowSize = this.options.arrowSize; 362 | arrowCss = $.extend({}, css); 363 | arrowColor = this.userContainer.css("border-color") || this.userContainer.css("background-color") || "white"; 364 | for (k = 0, len1 = mainPositions.length; k < len1; k++) { 365 | pos = mainPositions[k]; 366 | posFull = positions[pos]; 367 | if (pos === opp) { 368 | continue; 369 | } 370 | color = posFull === mainFull ? arrowColor : "transparent"; 371 | arrowCss["border-" + posFull] = arrowSize + "px solid " + color; 372 | } 373 | incr(css, positions[opp], arrowSize); 374 | if (indexOf.call(mainPositions, pAlign) >= 0) { 375 | incr(arrowCss, positions[pAlign], arrowSize * 2); 376 | } 377 | } 378 | if (indexOf.call(vAligns, pMain) >= 0) { 379 | incr(css, "left", realign(pAlign, contW, elemW)); 380 | if (arrowCss) { 381 | incr(arrowCss, "left", realign(pAlign, arrowSize, elemIW)); 382 | } 383 | } else if (indexOf.call(hAligns, pMain) >= 0) { 384 | incr(css, "top", realign(pAlign, contH, elemH)); 385 | if (arrowCss) { 386 | incr(arrowCss, "top", realign(pAlign, arrowSize, elemIH)); 387 | } 388 | } 389 | if (this.container.is(":visible")) { 390 | css.display = "block"; 391 | } 392 | this.container.removeAttr("style").css(css); 393 | if (arrowCss) { 394 | return this.arrow.removeAttr("style").css(arrowCss); 395 | } 396 | }; 397 | 398 | Notification.prototype.getPosition = function() { 399 | var pos, ref, ref1, ref2, ref3, ref4, ref5, text; 400 | text = this.options.position || (this.elem ? this.options.elementPosition : this.options.globalPosition); 401 | pos = parsePosition(text); 402 | if (pos.length === 0) { 403 | pos[0] = "b"; 404 | } 405 | if (ref = pos[0], indexOf.call(mainPositions, ref) < 0) { 406 | throw "Must be one of [" + mainPositions + "]"; 407 | } 408 | if (pos.length === 1 || ((ref1 = pos[0], indexOf.call(vAligns, ref1) >= 0) && (ref2 = pos[1], indexOf.call(hAligns, ref2) < 0)) || ((ref3 = pos[0], indexOf.call(hAligns, ref3) >= 0) && (ref4 = pos[1], indexOf.call(vAligns, ref4) < 0))) { 409 | pos[1] = (ref5 = pos[0], indexOf.call(hAligns, ref5) >= 0) ? "m" : "l"; 410 | } 411 | if (pos.length === 2) { 412 | pos[2] = pos[1]; 413 | } 414 | return pos; 415 | }; 416 | 417 | Notification.prototype.getStyle = function(name) { 418 | var style; 419 | if (!name) { 420 | name = this.options.style; 421 | } 422 | if (!name) { 423 | name = "default"; 424 | } 425 | style = styles[name]; 426 | if (!style) { 427 | throw "Missing style: " + name; 428 | } 429 | return style; 430 | }; 431 | 432 | Notification.prototype.updateClasses = function() { 433 | var classes, style; 434 | classes = ["base"]; 435 | if ($.isArray(this.options.className)) { 436 | classes = classes.concat(this.options.className); 437 | } else if (this.options.className) { 438 | classes.push(this.options.className); 439 | } 440 | style = this.getStyle(); 441 | classes = $.map(classes, function(n) { 442 | return pluginClassName + "-" + style.name + "-" + n; 443 | }).join(" "); 444 | return this.userContainer.attr("class", classes); 445 | }; 446 | 447 | Notification.prototype.run = function(data, options) { 448 | var d, datas, name, type, value; 449 | if ($.isPlainObject(options)) { 450 | $.extend(this.options, options); 451 | } else if ($.type(options) === "string") { 452 | this.options.className = options; 453 | } 454 | if (this.container && !data) { 455 | this.show(false); 456 | return; 457 | } else if (!this.container && !data) { 458 | return; 459 | } 460 | datas = {}; 461 | if ($.isPlainObject(data)) { 462 | datas = data; 463 | } else { 464 | datas[blankFieldName] = data; 465 | } 466 | for (name in datas) { 467 | d = datas[name]; 468 | type = this.userFields[name]; 469 | if (!type) { 470 | continue; 471 | } 472 | if (type === "text") { 473 | d = encode(d); 474 | if (this.options.breakNewLines) { 475 | d = d.replace(/\n/g, '
'); 476 | } 477 | } 478 | value = name === blankFieldName ? '' : '=' + name; 479 | find(this.userContainer, "[data-notify-" + type + value + "]").html(d); 480 | } 481 | this.updateClasses(); 482 | if (this.elem) { 483 | this.setElementPosition(); 484 | } else { 485 | this.setGlobalPosition(); 486 | } 487 | this.show(true); 488 | if (this.options.autoHide) { 489 | clearTimeout(this.autohideTimer); 490 | this.autohideTimer = setTimeout(this.show.bind(this, false), this.options.autoHideDelay); 491 | } 492 | }; 493 | 494 | Notification.prototype.destroy = function() { 495 | return this.wrapper.remove(); 496 | }; 497 | 498 | $[pluginName] = function(elem, data, options) { 499 | if ((elem && elem.nodeName) || elem.jquery) { 500 | $(elem)[pluginName](data, options); 501 | } else { 502 | options = data; 503 | data = elem; 504 | new Notification(null, data, options); 505 | } 506 | return elem; 507 | }; 508 | 509 | $.fn[pluginName] = function(data, options) { 510 | $(this).each(function() { 511 | var inst; 512 | inst = getAnchorElement($(this)).data(pluginClassName); 513 | if (inst) { 514 | return inst.run(data, options); 515 | } else { 516 | return new Notification($(this), data, options); 517 | } 518 | }); 519 | return this; 520 | }; 521 | 522 | $.extend($[pluginName], { 523 | defaults: defaults, 524 | addStyle: addStyle, 525 | pluginOptions: pluginOptions, 526 | getStyle: getStyle, 527 | insertCSS: insertCSS 528 | }); 529 | 530 | //always include the default bootstrap style 531 | addStyle("bootstrap", { 532 | html: "
\n\n
", 533 | classes: { 534 | base: { 535 | "font-weight": "bold", 536 | "padding": "8px 15px 8px 14px", 537 | "text-shadow": "0 1px 0 rgba(255, 255, 255, 0.5)", 538 | "background-color": "#fcf8e3", 539 | "border": "1px solid #fbeed5", 540 | "border-radius": "4px", 541 | "white-space": "nowrap", 542 | "padding-left": "25px", 543 | "background-repeat": "no-repeat", 544 | "background-position": "3px 7px" 545 | }, 546 | error: { 547 | "color": "#B94A48", 548 | "background-color": "#F2DEDE", 549 | "border-color": "#EED3D7", 550 | "background-image": "url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAtRJREFUeNqkVc1u00AQHq+dOD+0poIQfkIjalW0SEGqRMuRnHos3DjwAH0ArlyQeANOOSMeAA5VjyBxKBQhgSpVUKKQNGloFdw4cWw2jtfMOna6JOUArDTazXi/b3dm55socPqQhFka++aHBsI8GsopRJERNFlY88FCEk9Yiwf8RhgRyaHFQpPHCDmZG5oX2ui2yilkcTT1AcDsbYC1NMAyOi7zTX2Agx7A9luAl88BauiiQ/cJaZQfIpAlngDcvZZMrl8vFPK5+XktrWlx3/ehZ5r9+t6e+WVnp1pxnNIjgBe4/6dAysQc8dsmHwPcW9C0h3fW1hans1ltwJhy0GxK7XZbUlMp5Ww2eyan6+ft/f2FAqXGK4CvQk5HueFz7D6GOZtIrK+srupdx1GRBBqNBtzc2AiMr7nPplRdKhb1q6q6zjFhrklEFOUutoQ50xcX86ZlqaZpQrfbBdu2R6/G19zX6XSgh6RX5ubyHCM8nqSID6ICrGiZjGYYxojEsiw4PDwMSL5VKsC8Yf4VRYFzMzMaxwjlJSlCyAQ9l0CW44PBADzXhe7xMdi9HtTrdYjFYkDQL0cn4Xdq2/EAE+InCnvADTf2eah4Sx9vExQjkqXT6aAERICMewd/UAp/IeYANM2joxt+q5VI+ieq2i0Wg3l6DNzHwTERPgo1ko7XBXj3vdlsT2F+UuhIhYkp7u7CarkcrFOCtR3H5JiwbAIeImjT/YQKKBtGjRFCU5IUgFRe7fF4cCNVIPMYo3VKqxwjyNAXNepuopyqnld602qVsfRpEkkz+GFL1wPj6ySXBpJtWVa5xlhpcyhBNwpZHmtX8AGgfIExo0ZpzkWVTBGiXCSEaHh62/PoR0p/vHaczxXGnj4bSo+G78lELU80h1uogBwWLf5YlsPmgDEd4M236xjm+8nm4IuE/9u+/PH2JXZfbwz4zw1WbO+SQPpXfwG/BBgAhCNZiSb/pOQAAAAASUVORK5CYII=)" 551 | }, 552 | success: { 553 | "color": "#468847", 554 | "background-color": "#DFF0D8", 555 | "border-color": "#D6E9C6", 556 | "background-image": "url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAutJREFUeNq0lctPE0Ecx38zu/RFS1EryqtgJFA08YCiMZIAQQ4eRG8eDGdPJiYeTIwHTfwPiAcvXIwXLwoXPaDxkWgQ6islKlJLSQWLUraPLTv7Gme32zoF9KSTfLO7v53vZ3d/M7/fIth+IO6INt2jjoA7bjHCJoAlzCRw59YwHYjBnfMPqAKWQYKjGkfCJqAF0xwZjipQtA3MxeSG87VhOOYegVrUCy7UZM9S6TLIdAamySTclZdYhFhRHloGYg7mgZv1Zzztvgud7V1tbQ2twYA34LJmF4p5dXF1KTufnE+SxeJtuCZNsLDCQU0+RyKTF27Unw101l8e6hns3u0PBalORVVVkcaEKBJDgV3+cGM4tKKmI+ohlIGnygKX00rSBfszz/n2uXv81wd6+rt1orsZCHRdr1Imk2F2Kob3hutSxW8thsd8AXNaln9D7CTfA6O+0UgkMuwVvEFFUbbAcrkcTA8+AtOk8E6KiQiDmMFSDqZItAzEVQviRkdDdaFgPp8HSZKAEAL5Qh7Sq2lIJBJwv2scUqkUnKoZgNhcDKhKg5aH+1IkcouCAdFGAQsuWZYhOjwFHQ96oagWgRoUov1T9kRBEODAwxM2QtEUl+Wp+Ln9VRo6BcMw4ErHRYjH4/B26AlQoQQTRdHWwcd9AH57+UAXddvDD37DmrBBV34WfqiXPl61g+vr6xA9zsGeM9gOdsNXkgpEtTwVvwOklXLKm6+/p5ezwk4B+j6droBs2CsGa/gNs6RIxazl4Tc25mpTgw/apPR1LYlNRFAzgsOxkyXYLIM1V8NMwyAkJSctD1eGVKiq5wWjSPdjmeTkiKvVW4f2YPHWl3GAVq6ymcyCTgovM3FzyRiDe2TaKcEKsLpJvNHjZgPNqEtyi6mZIm4SRFyLMUsONSSdkPeFtY1n0mczoY3BHTLhwPRy9/lzcziCw9ACI+yql0VLzcGAZbYSM5CCSZg1/9oc/nn7+i8N9p/8An4JMADxhH+xHfuiKwAAAABJRU5ErkJggg==)" 557 | }, 558 | info: { 559 | "color": "#3A87AD", 560 | "background-color": "#D9EDF7", 561 | "border-color": "#BCE8F1", 562 | "background-image": "url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH3QYFAhkSsdes/QAAA8dJREFUOMvVlGtMW2UYx//POaWHXg6lLaW0ypAtw1UCgbniNOLcVOLmAjHZolOYlxmTGXVZdAnRfXQm+7SoU4mXaOaiZsEpC9FkiQs6Z6bdCnNYruM6KNBw6YWewzl9z+sHImEWv+vz7XmT95f/+3/+7wP814v+efDOV3/SoX3lHAA+6ODeUFfMfjOWMADgdk+eEKz0pF7aQdMAcOKLLjrcVMVX3xdWN29/GhYP7SvnP0cWfS8caSkfHZsPE9Fgnt02JNutQ0QYHB2dDz9/pKX8QjjuO9xUxd/66HdxTeCHZ3rojQObGQBcuNjfplkD3b19Y/6MrimSaKgSMmpGU5WevmE/swa6Oy73tQHA0Rdr2Mmv/6A1n9w9suQ7097Z9lM4FlTgTDrzZTu4StXVfpiI48rVcUDM5cmEksrFnHxfpTtU/3BFQzCQF/2bYVoNbH7zmItbSoMj40JSzmMyX5qDvriA7QdrIIpA+3cdsMpu0nXI8cV0MtKXCPZev+gCEM1S2NHPvWfP/hL+7FSr3+0p5RBEyhEN5JCKYr8XnASMT0xBNyzQGQeI8fjsGD39RMPk7se2bd5ZtTyoFYXftF6y37gx7NeUtJJOTFlAHDZLDuILU3j3+H5oOrD3yWbIztugaAzgnBKJuBLpGfQrS8wO4FZgV+c1IxaLgWVU0tMLEETCos4xMzEIv9cJXQcyagIwigDGwJgOAtHAwAhisQUjy0ORGERiELgG4iakkzo4MYAxcM5hAMi1WWG1yYCJIcMUaBkVRLdGeSU2995TLWzcUAzONJ7J6FBVBYIggMzmFbvdBV44Corg8vjhzC+EJEl8U1kJtgYrhCzgc/vvTwXKSib1paRFVRVORDAJAsw5FuTaJEhWM2SHB3mOAlhkNxwuLzeJsGwqWzf5TFNdKgtY5qHp6ZFf67Y/sAVadCaVY5YACDDb3Oi4NIjLnWMw2QthCBIsVhsUTU9tvXsjeq9+X1d75/KEs4LNOfcdf/+HthMnvwxOD0wmHaXr7ZItn2wuH2SnBzbZAbPJwpPx+VQuzcm7dgRCB57a1uBzUDRL4bfnI0RE0eaXd9W89mpjqHZnUI5Hh2l2dkZZUhOqpi2qSmpOmZ64Tuu9qlz/SEXo6MEHa3wOip46F1n7633eekV8ds8Wxjn37Wl63VVa+ej5oeEZ/82ZBETJjpJ1Rbij2D3Z/1trXUvLsblCK0XfOx0SX2kMsn9dX+d+7Kf6h8o4AIykuffjT8L20LU+w4AZd5VvEPY+XpWqLV327HR7DzXuDnD8r+ovkBehJ8i+y8YAAAAASUVORK5CYII=)" 563 | }, 564 | warn: { 565 | "color": "#C09853", 566 | "background-color": "#FCF8E3", 567 | "border-color": "#FBEED5", 568 | "background-image": "url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAMAAAC6V+0/AAABJlBMVEXr6eb/2oD/wi7/xjr/0mP/ykf/tQD/vBj/3o7/uQ//vyL/twebhgD/4pzX1K3z8e349vK6tHCilCWbiQymn0jGworr6dXQza3HxcKkn1vWvV/5uRfk4dXZ1bD18+/52YebiAmyr5S9mhCzrWq5t6ufjRH54aLs0oS+qD751XqPhAybhwXsujG3sm+Zk0PTwG6Shg+PhhObhwOPgQL4zV2nlyrf27uLfgCPhRHu7OmLgAafkyiWkD3l49ibiAfTs0C+lgCniwD4sgDJxqOilzDWowWFfAH08uebig6qpFHBvH/aw26FfQTQzsvy8OyEfz20r3jAvaKbhgG9q0nc2LbZxXanoUu/u5WSggCtp1anpJKdmFz/zlX/1nGJiYmuq5Dx7+sAAADoPUZSAAAAAXRSTlMAQObYZgAAAAFiS0dEAIgFHUgAAAAJcEhZcwAACxMAAAsTAQCanBgAAAAHdElNRQfdBgUBGhh4aah5AAAAlklEQVQY02NgoBIIE8EUcwn1FkIXM1Tj5dDUQhPU502Mi7XXQxGz5uVIjGOJUUUW81HnYEyMi2HVcUOICQZzMMYmxrEyMylJwgUt5BljWRLjmJm4pI1hYp5SQLGYxDgmLnZOVxuooClIDKgXKMbN5ggV1ACLJcaBxNgcoiGCBiZwdWxOETBDrTyEFey0jYJ4eHjMGWgEAIpRFRCUt08qAAAAAElFTkSuQmCC)" 569 | } 570 | } 571 | }); 572 | 573 | $(function() { 574 | insertCSS(coreStyle.css).attr("id", "core-notify"); 575 | $(document).on("click", "." + pluginClassName + "-hidable", function(e) { 576 | return $(this).trigger("notify-hide"); 577 | }); 578 | return $(document).on("notify-hide", "." + pluginClassName + "-wrapper", function(e) { 579 | var elem = $(this).data(pluginClassName); 580 | if(elem) { 581 | elem.show(false); 582 | } 583 | }); 584 | }); 585 | 586 | }).call(this, window, document, jQuery); -------------------------------------------------------------------------------- /assets/themes/noty.js: -------------------------------------------------------------------------------- 1 | !function(a,b){"function"==typeof define&&define.amd?define(["jquery"],b):"object"==typeof exports?module.exports=b(require("jquery")):b(a.jQuery)}(this,function(a){"function"!=typeof Object.create&&(Object.create=function(a){function b(){}return b.prototype=a,new b});var b={init:function(b){return this.options=a.extend({},a.noty.defaults,b),this.options.layout=this.options.custom?a.noty.layouts.inline:a.noty.layouts[this.options.layout],a.noty.themes[this.options.theme]?this.options.theme=a.noty.themes[this.options.theme]:b.themeClassName=this.options.theme,delete b.layout,delete b.theme,this.options=a.extend({},this.options,this.options.layout.options),this.options.id="noty_"+(new Date).getTime()*Math.floor(1e6*Math.random()),this.options=a.extend({},this.options,b),this._build(),this},_build:function(){var b=a('
').attr("id",this.options.id);if(b.append(this.options.template).find(".noty_text").html(this.options.text),this.$bar=null!==this.options.layout.parent.object?a(this.options.layout.parent.object).css(this.options.layout.parent.css).append(b):b,this.options.themeClassName&&this.$bar.addClass(this.options.themeClassName).addClass("noty_container_type_"+this.options.type),this.options.buttons){this.options.closeWith=[],this.options.timeout=!1;var c=a("
").addClass("noty_buttons");null!==this.options.layout.parent.object?this.$bar.find(".noty_bar").append(c):this.$bar.append(c);var d=this;a.each(this.options.buttons,function(b,c){var e=a("