diff options
author | Adam Spiers <git@adamspiers.org> | 2016-06-11 22:20:04 +0100 |
---|---|---|
committer | Adam Spiers <git@adamspiers.org> | 2018-05-15 13:42:16 +0100 |
commit | 2c9d23b0291157eb1096384ff76e0122747b9bdf (patch) | |
tree | 524c7b479b65a478c998c28475d52e636b919200 /git_deps/html/js/git-deps-noty.coffee | |
parent | 9a741f07167dcb6cc81a8f87036d1ea75c4270d3 (diff) | |
download | git-deps-2c9d23b0291157eb1096384ff76e0122747b9bdf.tar.gz |
convert into a proper Python module
Sem-Ver: api-break
Diffstat (limited to 'git_deps/html/js/git-deps-noty.coffee')
-rw-r--r-- | git_deps/html/js/git-deps-noty.coffee | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/git_deps/html/js/git-deps-noty.coffee b/git_deps/html/js/git-deps-noty.coffee new file mode 100644 index 0000000..cec2b08 --- /dev/null +++ b/git_deps/html/js/git-deps-noty.coffee @@ -0,0 +1,32 @@ +noty = require "noty" + +# Different noty types: +# alert, success, error, warning, information, confirmation +noty_error = (text) -> notyfication "error", text +noty_warn = (text) -> notyfication "warning", text +noty_success = (text) -> notyfication "success", text +noty_info = (text) -> notyfication "information", text +noty_debug = (text) -> notyfication "information", text + +# "notyfication" - haha, did you see what I did there? +notyfication = (type, text) -> + noty( + text: text + type: type + layout: "topRight" + theme: "relax" + maxVisible: 15 + timeout: 30000 # ms + animation: + open: "animated bounceInUp" # Animate.css class names + close: "animated bounceOutUp" # Animate.css class names + easing: "swing" # unavailable - no need + speed: 500 # unavailable - no need + ) + +module.exports = + error: noty_error + warn: noty_warn + success: noty_success + info: noty_info + debug: noty_debug |