Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

version 0.2.3

- bugfix: modules' extend didn't work as excepted when passed new functions
  • Loading branch information...
commit 40e4bad76c28edf18bac273ba3bd4fddcd9faa5d 1 parent 902d44a
@ewebdev authored
View
2  css/notifier-base.css
@@ -1,5 +1,5 @@
/*!
- * Backbone.Notifier v0.2.2 - Base Styles
+ * Backbone.Notifier v0.2.3 - Base Styles
* Copyright 2012, Eyal Weiss
*/
.notifier-screen {
View
2  css/notifier-theme-clean.css
@@ -1,5 +1,5 @@
/*!
- * Backbone.Notifier v0.2.2 - 'Clean' Theme
+ * Backbone.Notifier v0.2.3 - 'Clean' Theme
* Copyright 2012, Eyal Weiss
*/
.notifier-screen.notifier-theme-clean {
View
2  css/notifier-theme-plastic.css
@@ -1,5 +1,5 @@
/*!
- * Backbone.Notifier v0.2.2 - 'Plastic' Theme
+ * Backbone.Notifier v0.2.3 - 'Plastic' Theme
* Copyright 2012, Eyal Weiss
*/
.notifier-loader.notifier-theme-plastic {
View
49 example-js/example.js
@@ -327,13 +327,8 @@ $(function(){
ms: null,
modal: true,
theme: 'plastic',
- fadeInMs: 600,
- fadeOutMs: 1200,
'out': function(el, inner, options, duration, callback){
el.fadeOut(duration, callback);
- },
- 'in': function(el, inner, options, duration, callback){
- el.fadeIn(duration, callback);
}
});
this.loader.notify();
@@ -350,26 +345,32 @@ $(function(){
},
limit: 5,
template: function(data){
- var html = '';
+ var html = '',
+ prevVerList = '';
_.each(data.first(this.limit), function(item) {
- html += '<div class="row release-changes">';
- var date = new Date(item.attributes.commit.committer.date);
- html += '<div class="span3">' + date.toLocaleDateString() +' ' + date.toLocaleTimeString() + '</div>' +
- '<div class="span6">' +
- "<ul>";
- var s = item.attributes.commit.message.split('\n'),
- verList = '';
- _.each(s, function(l) {
- var change = l.replace(/^-\s?(.*)$/ig, '$1').trim();
- if (change.toLowerCase().substr(0, 7) === 'version') {
- verList = '<li class="ver">' + change + '</li>' + verList;
- } else if (change && change.length) {
- verList += '<li>' + change + '</li>';
- }
- });
- html += verList + '</ul>' +
- '</div>' +
- '</div>';
+ var commit = '';
+ commit += '<div class="row release-changes">';
+ var date = new Date(item.attributes.commit.committer.date);
+ commit += '<div class="span3">' + date.toLocaleDateString() +' ' + date.toLocaleTimeString() + '</div>' +
+ '<div class="span7"><ul>';
+ var s = item.attributes.commit.message.split('\n'),
+ verList = '';
+ _.each(s, function(l) {
+ var change = l.replace(/^-\s?(.*)$/ig, '$1').trim();
+ if (change.toLowerCase().substr(0, 2) === '//') {
+ return false;
+ }
+ if (change.toLowerCase().substr(0, 7) === 'version') {
+ verList = '<li class="ver">' + change + '</li>' + verList;
+ } else if (change && change.length) {
+ verList += '<li>' + change + '</li>';
+ }
+ });
+ commit += verList + '</ul>' +
+ '</div>' +
+ '</div>';
+ html += (verList && (prevVerList !== verList)) ? commit : '';
+ prevVerList = verList;
});
return html;
},
View
30 index.html
@@ -5,21 +5,21 @@
<title>Backbone.Notifier | Powerful UI Notifications Framework</title>
<!-- Used by example page -->
- <link rel="stylesheet" type="text/css" href="example-css/bootstrap.css?_0.2.2">
- <link rel="stylesheet" type="text/css" href="example-css/example.css?_0.2.2">
- <link rel="stylesheet" type="text/css" href="example-css/prettify.css?_0.2.2">
+ <link rel="stylesheet" type="text/css" href="example-css/bootstrap.css?_0.2.3">
+ <link rel="stylesheet" type="text/css" href="example-css/example.css?_0.2.3">
+ <link rel="stylesheet" type="text/css" href="example-css/prettify.css?_0.2.3">
<!-- Used /by example page -->
<!-- Backbone.Notifier LESS CSS -->
- <!--<link rel="stylesheet/less" type="text/css" href="less/notifier-base.less??_0.2.2">-->
- <!--<link rel="stylesheet/less" type="text/css" href="less/notifier-theme-clean.less??_0.2.2">-->
- <!--<link rel="stylesheet/less" type="text/css" href="less/notifier-theme-plastic.less??_0.2.2">-->
+ <!--<link rel="stylesheet/less" type="text/css" href="less/notifier-base.less??_0.2.3">-->
+ <!--<link rel="stylesheet/less" type="text/css" href="less/notifier-theme-clean.less??_0.2.3">-->
+ <!--<link rel="stylesheet/less" type="text/css" href="less/notifier-theme-plastic.less??_0.2.3">-->
<!--<script type="text/javascript" src="example-js/less-1.3.0.min.js"></script>-->
<!-- /Backbone.Notifier LESS CSS -->
- <link rel="stylesheet" type="text/css" href="css/notifier-base.css?_0.2.2">
- <link rel="stylesheet" type="text/css" href="css/notifier-theme-clean.css?_0.2.2">
- <link rel="stylesheet" type="text/css" href="css/notifier-theme-plastic.css?_0.2.2">
+ <link rel="stylesheet" type="text/css" href="css/notifier-base.css?_0.2.3">
+ <link rel="stylesheet" type="text/css" href="css/notifier-theme-clean.css?_0.2.3">
+ <link rel="stylesheet" type="text/css" href="css/notifier-theme-plastic.css?_0.2.3">
</head>
<body>
@@ -73,7 +73,7 @@
<section id="intro">
<div class="intro-ph">
<h1>Backbone.Notifier
- <small>version 0.2.2</small>
+ <small>version 0.2.3</small>
</h1>
<button id="btnTour" class="after-tour btn-primary btn btn-large">Quick Tour</button>
<button id="btnTheme" class="after-tour btn btn-large">Switch Theme</button>
@@ -813,17 +813,17 @@
<!-- /Dependencies -->
<!-- Backbone.Notifier -->
-<script type="text/javascript" src="js/Backbone.Notifier.js?_0.2.2"></script>
+<script type="text/javascript" src="js/Backbone.Notifier.js?_0.2.3"></script>
<!-- Optional modules -->
-<script type="text/javascript" src="js/modules/3d.js?_0.2.2"></script>
-<script type="text/javascript" src="js/modules/logger.js?_0.2.2"></script>
-<script type="text/javascript" src="js/modules/template.js?_0.2.2"></script>
+<script type="text/javascript" src="js/modules/3d.js?_0.2.3"></script>
+<script type="text/javascript" src="js/modules/logger.js?_0.2.3"></script>
+<script type="text/javascript" src="js/modules/template.js?_0.2.3"></script>
<!-- Optional modules -->
<!-- /Backbone.Notifier -->
<!-- Used by example page -->
<script type="text/javascript" src="example-js/prettify.js"></script>
-<script type="text/javascript" src="example-js/example.js?_0.2.2"></script>
+<script type="text/javascript" src="example-js/example.js?_0.2.3"></script>
<!-- /Used by example page -->
<!--Google Analytics-->
View
12 js/backbone.notifier.js
@@ -1,7 +1,7 @@
/*!
- * Backbone.Notifier.js v0.2.1
+ * Backbone.Notifier.js v0.2.3
* Copyright 2012, Eyal Weiss
- * backbone.notifier.js may be freely distributed under the MIT license.
+ * Backbone.Notifier.js may be freely distributed under the MIT license.
*/
(function($, Backbone, _) {
var emptyFn = function(){},
@@ -66,7 +66,7 @@
'<div class="' + settings.wrapperCls + '">',
'<div class="' + settings.innerCls + '">',
(settings.title ? '<div class="' + settings.baseCls + '-title">' + settings.title + '</div>' : ''),
- (settings.closeBtn ? '<button class="' + settings.baseCls + '-close" data-handler="destroy">x</button>' : '')
+ (settings.closeBtn ? '<button class="' + settings.baseCls + '-close" data-handler="destroy"><span>x</span></button>' : '')
];
if (settings.dialog) {
strBuilder.push(
@@ -350,12 +350,14 @@
if (m.extend) {
$.each(m.extend, function(k, v){
var orig = Notifier.prototype[k];
- if (_.isFunction(orig)) {
+ if (_.isFunction(v) || orig === undefined) {
Notifier.prototype[k] = function(){
return v.apply({scope: this, supr: orig, module: m}, arguments);
};
+ } else if (!_.isObject(v)) {
+ Notifier.prototype[k] = v;
} else {
- Notifier.prototype[k] = $.extend(true, {}, orig, v );
+ Notifier.prototype[k] = $.extend(true, {}, orig, v);
}
});
}
View
2  less/notifier-base.less
@@ -1,5 +1,5 @@
/*!
- * Backbone.Notifier v0.2.2 - Base Styles
+ * Backbone.Notifier v0.2.3 - Base Styles
* Copyright 2012, Eyal Weiss
*/
View
2  less/notifier-theme-clean.less
@@ -1,5 +1,5 @@
/*!
- * Backbone.Notifier v0.2.2 - 'Clean' Theme
+ * Backbone.Notifier v0.2.3 - 'Clean' Theme
* Copyright 2012, Eyal Weiss
*/
View
2  less/notifier-theme-plastic.less
@@ -1,5 +1,5 @@
/*!
- * Backbone.Notifier v0.2.2 - 'Plastic' Theme
+ * Backbone.Notifier v0.2.3 - 'Plastic' Theme
* Copyright 2012, Eyal Weiss
*/
View
2  less/notifier-variables.less
@@ -1,5 +1,5 @@
/*!
- * Backbone.Notifier v0.2.2 - Variables Config
+ * Backbone.Notifier v0.2.3 - Variables Config
* Copyright 2012, Eyal Weiss
*/
Please sign in to comment.
Something went wrong with that request. Please try again.