From 7ad983d6547bf254c1a441fb070e362207a2b9ff Mon Sep 17 00:00:00 2001 From: Nijiko Yonskai Date: Mon, 24 Dec 2012 15:07:23 -0800 Subject: [PATCH 01/21] Added component.json for bower installations --- component.json | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 component.json diff --git a/component.json b/component.json new file mode 100644 index 0000000..8c858f8 --- /dev/null +++ b/component.json @@ -0,0 +1,11 @@ +{ + "name": "bootstrap-notify", + "version": "1.0.0", + "main": "js/bootstrap-notify.js", + "dependencies": {}, + "description": "Bootstrap alert system made better.", + "repository": { + "type": "git", + "url": "git://github.com/nijikokun/bootstrap-notify.git" + } +} \ No newline at end of file From c8281393f7d38f7e20142d842f733dae04a4569f Mon Sep 17 00:00:00 2001 From: Nijiko Yonskai Date: Mon, 24 Dec 2012 15:20:14 -0800 Subject: [PATCH 02/21] Remove trailing slashes --- examples/index.html | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/examples/index.html b/examples/index.html index 4d8c362..e8aba60 100644 --- a/examples/index.html +++ b/examples/index.html @@ -11,20 +11,20 @@ - + - + - + @@ -231,7 +231,7 @@

Custom Styles Included:

// Basic Features, style isn't even required. $('.show-notification').click(function (e) { var message = messages[Math.floor(Math.random() * messages.length)]; - + $('.' + message[0]).notify({ message: { text: message[2] }, type: message[1], @@ -240,16 +240,16 @@

Custom Styles Included:

} }).show(); }); - + /* Custom Styles */ var custom = [ 'bangTidy', 'blackgloss' ]; - + for(var i = 0; i < custom.length; i++) { var type = custom[i]; - + (function(type) { $('.show-' + type).click(function (e) { var message = messages[Math.floor(Math.random() * messages.length)]; From 5a486e9921bd7fcc96e0ba45a6d0a27b03a0e201 Mon Sep 17 00:00:00 2001 From: Nijiko Yonskai Date: Mon, 24 Dec 2012 15:21:24 -0800 Subject: [PATCH 03/21] Add support for data-attributes --- js/bootstrap-notify.js | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/js/bootstrap-notify.js b/js/bootstrap-notify.js index 394335c..3c91d98 100644 --- a/js/bootstrap-notify.js +++ b/js/bootstrap-notify.js @@ -1,7 +1,8 @@ /** - * bootstrap-notify.js v1.0 + * bootstrap-notify.js v1.0.0 * -- - * Copyright 2012 Goodybag, Inc. + * Copyright 2012 Nijiko Yonskai + * Copyright 2012 Goodybag, Inc. * -- * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -21,7 +22,7 @@ // Element collection this.$element = $(element); this.$note = $('
'); - this.options = $.extend(true, {}, $.fn.notify.defaults, options); + this.options = $.extend(true, $.fn.notify.defaults, options, this.$element.data()); // Setup from options if(this.options.transition) @@ -34,19 +35,17 @@ this.$note.addClass('alert-' + this.options.type); else this.$note.addClass('alert-success'); - if(!this.options.message && this.$element.data("message") !== '') // dom text - this.$note.html(this.$element.data("message")); - else - if(typeof this.options.message === 'object') + if(this.options.message) + if(typeof this.options.message === 'string') + this.$note.html(this.options.message); + else if(typeof this.options.message === 'object') if(this.options.message.html) this.$note.html(this.options.message.html); else if(this.options.message.text) this.$note.text(this.options.message.text); - else - this.$note.html(this.options.message); if(this.options.closable) - var link = $('×'); + var link = $('×'); $(link).on('click', $.proxy(onClose, this)); this.$note.prepend(link); From 26310495ff34fef26b4cf8e47b5e9e52b2c5ef42 Mon Sep 17 00:00:00 2001 From: Nijiko Yonskai Date: Mon, 24 Dec 2012 15:21:44 -0800 Subject: [PATCH 04/21] Add base less file --- css/bootstrap-notify.less | 45 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 css/bootstrap-notify.less diff --git a/css/bootstrap-notify.less b/css/bootstrap-notify.less new file mode 100644 index 0000000..fd6c989 --- /dev/null +++ b/css/bootstrap-notify.less @@ -0,0 +1,45 @@ +/** + * Bootstrap-notify.less + * + * @author Vitaly @Laboratory + * @copyright 2012 Vitaly + */ + +@right: 10px; +@left: @right; +@top: 25px; +@bottom: @top; + +.notifications { + position: fixed; +} + +/* Positioning */ +.notifications.top-right { + right: @right; + top: @top; +} + +.notifications.top-left { + left: @left; + top: @top; +} + +.notifications.bottom-left { + left: @left; + bottom: @bottom; +} + +.notifications.bottom-right { + right: @right; + bottom: @bottom; +} + +/* Notification Element */ +.notifications { + > div { + position: relative; + z-index: 9999; + margin: 5px 0px; + } +} \ No newline at end of file From 425298973154e0f7fe977ff8476ec24892ab4fbb Mon Sep 17 00:00:00 2001 From: Nijiko Yonskai Date: Mon, 24 Dec 2012 15:22:29 -0800 Subject: [PATCH 05/21] Update readme, as per Apache Licensing for copyright --- README.md | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 53041a2..c148da7 100644 --- a/README.md +++ b/README.md @@ -3,9 +3,7 @@ bootstrap-notify Bootstrap alert system made better. -### Contributors +### Copyright -* Nijiko Yonskai - - -Copyright 2012 Goodybag, Inc. \ No newline at end of file + Copyright 2012 Nijiko Yonskai @nijikokun + Copyright 2012 Goodybag, Inc. \ No newline at end of file From 3e87049407a3d8d6ac9816fac18ac88a7be8d3df Mon Sep 17 00:00:00 2001 From: Nijiko Yonskai Date: Mon, 24 Dec 2012 15:32:09 -0800 Subject: [PATCH 06/21] Clean up css files, move notification animations to their own file --- css/styles/alert-bangtidy.less | 45 ++++++++++++++++++ css/styles/alert-blackgloss.css | 32 ------------- css/styles/alert-notification-animations.css | 48 ++++++++++++++++++++ 3 files changed, 93 insertions(+), 32 deletions(-) create mode 100644 css/styles/alert-bangtidy.less create mode 100644 css/styles/alert-notification-animations.css diff --git a/css/styles/alert-bangtidy.less b/css/styles/alert-bangtidy.less new file mode 100644 index 0000000..06ae6bf --- /dev/null +++ b/css/styles/alert-bangtidy.less @@ -0,0 +1,45 @@ +/** + * bangTidy2 Style - Ported from Growl Style + * Ported and Cleaned By Nijikokun @nijikokun + * Less By Vitaly @Laboratory + * Original Author Daryl Ginn + * Based On http://dribbble.com/shots/527056-Growl-Theme-2 + * + * To use, for style use: bangTidy + * + */ + +@glossLight: rgba(0, 0, 0, 0.80); +@glossDark: rgba(0, 0, 0, 0.88); +@box_shadow: inset 0 1px 0 rgba(255, 255, 255, 0.07), inset 0 0 0 1px rgba(255, 255, 255, 0.1); +@text_shadow: 0 -1px 0 rgba(0, 0, 0, 0.2); +@border_radius: 4px; + +.alert-bangTidy { + box-sizing: border-box; + font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; + background: @glossLight; + background: -moz-linear-gradient(top, @glossLight 0%, @glossDark 100%); + background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, @glossLight), color-stop(100%, @glossDark)); + background: -webkit-linear-gradient(top, @glossLight 0%, @glossDark 100%); + background: -o-linear-gradient(top, @glossLight 0%, @glossDark 100%); + background: -ms-linear-gradient(top, @glossLight 0%, @glossDark 100%); + background: linear-gradient(top, @glossLight 0%, @glossDark 100%); + filter: progid:DXImageTransform.Microsoft.gradient(startColorstr = '@{glossLight}', endColorstr = '@{glossDark}', GradientType = 0); + border: 1px solid #000; + -webkit-box-shadow: @box_shadow; + -moz-box-shadow: @box_shadow; + -o-box-shadow: @box_shadow; + box-shadow: @box_shadow; + -webkit-border-radius: @border_radius; + -moz-border-radius: @border_radius; + -o-border-radius: @border_radius; + border-radius: @border_radius; + overflow: hidden; + color: white; + -webkit-text-shadow: @text_shadow; + -moz-text-shadow: @text_shadow; + -o-text-shadow: @text_shadow; + text-shadow: @text_shadow; + -webkit-font-smoothing: antialiased; +} \ No newline at end of file diff --git a/css/styles/alert-blackgloss.css b/css/styles/alert-blackgloss.css index 89c3d8b..4ec0078 100644 --- a/css/styles/alert-blackgloss.css +++ b/css/styles/alert-blackgloss.css @@ -11,33 +11,6 @@ * The gloss is only supported in webkit based browsers. * Chrome and Safari. */ -@-webkit-keyframes notification { - 0% { -webkit-transform: rotateY(-90deg); opacity: 0; } - 70% { -webkit-transform: rotateY(20deg); opacity: .8; } - 90% { -webkit-transform: rotateY(-10deg); opacity: 1; } - 100% { -webkit-transform: rotateY(-0deg); opacity: 1; } -} - -@-moz-keyframes notification { - 0% { -webkit-transform: rotateY(-90deg); opacity: 0; } - 70% { -webkit-transform: rotateY(20deg); opacity: .8; } - 90% { -webkit-transform: rotateY(-10deg); opacity: 1; } - 100% { -webkit-transform: rotateY(-0deg); opacity: 1; } -} - -@-o-keyframes notification { - 0% { -webkit-transform: rotateY(-90deg); opacity: 0; } - 70% { -webkit-transform: rotateY(20deg); opacity: .8; } - 90% { -webkit-transform: rotateY(-10deg); opacity: 1; } - 100% { -webkit-transform: rotateY(-0deg); opacity: 1; } -} - -keyframes notification { - 0% { -webkit-transform: rotateY(-90deg); opacity: 0; } - 70% { -webkit-transform: rotateY(20deg); opacity: .8; } - 90% { -webkit-transform: rotateY(-10deg); opacity: 1; } - 100% { -webkit-transform: rotateY(-0deg); opacity: 1; } -} /* Webkit Only */ .alert-blackgloss:before { @@ -57,11 +30,6 @@ keyframes notification { } .alert-blackgloss { - -webkit-animation: notification .75s linear; - -moz-animation: notification .75s linear; - -ms-animation: notification .75s linear; - -o-animation: notification .75s linear; - animation: notification .75s linear; background: rgba(0,0,0,1); -webkit-box-shadow: 0 2px 5px rgba(0,0,0,.5), inset 0 1px 0 rgba(255,255,255,.2), inset 0 0 0 1px rgba(255,255,255,.1); -moz-box-shadow: 0 2px 5px rgba(0,0,0,.5), inset 0 1px 0 rgba(255,255,255,.2), inset 0 0 0 1px rgba(255,255,255,.1); diff --git a/css/styles/alert-notification-animations.css b/css/styles/alert-notification-animations.css new file mode 100644 index 0000000..2a16d66 --- /dev/null +++ b/css/styles/alert-notification-animations.css @@ -0,0 +1,48 @@ +/* ## Notification Keyframe Animations + * + * ## Usage + * + * ```css + * -webkit-animation: notification .75s linear; + * -moz-animation: notification .75s linear; + * -ms-animation: notification .75s linear; + * -o-animation: notification .75s linear; + * animation: notification .75s linear; + * ``` + */ + +@-webkit-keyframes notification { + 0% { -webkit-transform: rotateY(-90deg); opacity: 0; } + 70% { -webkit-transform: rotateY(20deg); opacity: .8; } + 90% { -webkit-transform: rotateY(-10deg); opacity: 1; } + 100% { -webkit-transform: rotateY(-0deg); opacity: 1; } +} + +@-moz-keyframes notification { + 0% { -webkit-transform: rotateY(-90deg); opacity: 0; } + 70% { -webkit-transform: rotateY(20deg); opacity: .8; } + 90% { -webkit-transform: rotateY(-10deg); opacity: 1; } + 100% { -webkit-transform: rotateY(-0deg); opacity: 1; } +} + +@-o-keyframes notification { + 0% { -webkit-transform: rotateY(-90deg); opacity: 0; } + 70% { -webkit-transform: rotateY(20deg); opacity: .8; } + 90% { -webkit-transform: rotateY(-10deg); opacity: 1; } + 100% { -webkit-transform: rotateY(-0deg); opacity: 1; } +} + +keyframes notification { + 0% { -webkit-transform: rotateY(-90deg); opacity: 0; } + 70% { -webkit-transform: rotateY(20deg); opacity: .8; } + 90% { -webkit-transform: rotateY(-10deg); opacity: 1; } + 100% { -webkit-transform: rotateY(-0deg); opacity: 1; } +} + +.notifications > div { + -webkit-animation: notification .75s linear; + -moz-animation: notification .75s linear; + -ms-animation: notification .75s linear; + -o-animation: notification .75s linear; + animation: notification .75s linear; +} \ No newline at end of file From 755a337c937df596bad613f6b4b772ea1e30cdca Mon Sep 17 00:00:00 2001 From: Nijiko Yonskai Date: Mon, 24 Dec 2012 15:35:11 -0800 Subject: [PATCH 07/21] Fix transform clauses with correct vendor prefixes, add ms --- css/styles/alert-notification-animations.css | 31 ++++++++++++-------- 1 file changed, 19 insertions(+), 12 deletions(-) diff --git a/css/styles/alert-notification-animations.css b/css/styles/alert-notification-animations.css index 2a16d66..e5ed32f 100644 --- a/css/styles/alert-notification-animations.css +++ b/css/styles/alert-notification-animations.css @@ -19,24 +19,31 @@ } @-moz-keyframes notification { - 0% { -webkit-transform: rotateY(-90deg); opacity: 0; } - 70% { -webkit-transform: rotateY(20deg); opacity: .8; } - 90% { -webkit-transform: rotateY(-10deg); opacity: 1; } - 100% { -webkit-transform: rotateY(-0deg); opacity: 1; } + 0% { -moz-transform: rotateY(-90deg); opacity: 0; } + 70% { -moz-transform: rotateY(20deg); opacity: .8; } + 90% { -moz-transform: rotateY(-10deg); opacity: 1; } + 100% { -moz-transform: rotateY(-0deg); opacity: 1; } +} + +@-ms-keyframes notification { + 0% { -ms-transform: rotateY(-90deg); opacity: 0; } + 70% { -ms-transform: rotateY(20deg); opacity: .8; } + 90% { -ms-transform: rotateY(-10deg); opacity: 1; } + 100% { -ms-transform: rotateY(-0deg); opacity: 1; } } @-o-keyframes notification { - 0% { -webkit-transform: rotateY(-90deg); opacity: 0; } - 70% { -webkit-transform: rotateY(20deg); opacity: .8; } - 90% { -webkit-transform: rotateY(-10deg); opacity: 1; } - 100% { -webkit-transform: rotateY(-0deg); opacity: 1; } + 0% { -o-transform: rotateY(-90deg); opacity: 0; } + 70% { -o-transform: rotateY(20deg); opacity: .8; } + 90% { -o-transform: rotateY(-10deg); opacity: 1; } + 100% { -o-transform: rotateY(-0deg); opacity: 1; } } keyframes notification { - 0% { -webkit-transform: rotateY(-90deg); opacity: 0; } - 70% { -webkit-transform: rotateY(20deg); opacity: .8; } - 90% { -webkit-transform: rotateY(-10deg); opacity: 1; } - 100% { -webkit-transform: rotateY(-0deg); opacity: 1; } + 0% { transform: rotateY(-90deg); opacity: 0; } + 70% { transform: rotateY(20deg); opacity: .8; } + 90% { transform: rotateY(-10deg); opacity: 1; } + 100% { transform: rotateY(-0deg); opacity: 1; } } .notifications > div { From 700264fdf1e1c4a4806cf1e2d69d739954e791d7 Mon Sep 17 00:00:00 2001 From: Nijiko Yonskai Date: Mon, 24 Dec 2012 15:35:50 -0800 Subject: [PATCH 08/21] Add notification animations file --- examples/index.html | 1 + 1 file changed, 1 insertion(+) diff --git a/examples/index.html b/examples/index.html index e8aba60..d8f3fd7 100644 --- a/examples/index.html +++ b/examples/index.html @@ -18,6 +18,7 @@ +