Skip to content

Commit

Permalink
Follow up on bootstrap.notify, docs and minor issues
Browse files Browse the repository at this point in the history
  • Loading branch information
bertpareyn committed Jan 19, 2014
1 parent 483b7d5 commit c1146d7
Show file tree
Hide file tree
Showing 7 changed files with 39 additions and 32 deletions.
2 changes: 1 addition & 1 deletion admin/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ <h4>${option.name|encodeForHTML}</h4>
{elseif element.type === "internationalizableText"}
<div class="admin-internationalizable-text-container">
<div class="form-group">
<label for="${configPath|encodeForHTMLAttribute}" class="control-label col-xs-12 col-sm-3 col-md-3">Choose terms and conditions language to change</label>
<label for="${configPath|encodeForHTMLAttribute}" class="control-label col-xs-12 col-sm-3 col-md-3">Choose language to change</label>
<div class="col-xs-12 col-sm-9 col-md-9">
<select class="admin-internationalizabletext-language-picker form-control" id="${configPath|encodeForHTMLAttribute}">
<option value="default">Default</option>
Expand Down
3 changes: 2 additions & 1 deletion docs/css/doc.css
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,8 @@ td form {
padding: 8px 14px;
word-break: break-word;
}
.bs-docs-sidenav > li > a > div {
.bs-docs-sidenav > li > a > span {
display: block;
margin-right: 22px;
}
.bs-docs-sidenav .icon-chevron-right {
Expand Down
2 changes: 1 addition & 1 deletion docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ <h5>${title}</h5>
<ul class="nav nav-list bs-docs-sidenav">
{for module in modules}
<li data-id="${module}" data-type="${type}">
<a href="/docs/${type}/${module}"><i class="icon-chevron-right pull-right"></i> <div>${module}</div></a>
<a href="/docs/${type}/${module}"><i class="icon-chevron-right pull-right"></i> <span>${module}</span></a>
</li>
{/for}
</ul>
Expand Down
4 changes: 4 additions & 0 deletions node_modules/oae-core/activity/css/activity.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion shared/oae/api/oae.api.util.js
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@ define(['exports', 'require', 'jquery', 'underscore', 'oae.api.config', 'jquery.
* a close button for closing the notification. Notifications can be used as a confirmation message, error message, etc.
*
* This function is mostly just a wrapper around jQuery.bootstrap.notify.js and supports all of the options documented
* at http://nijikokun.github.com/bootstrap-notify/.
* at https://github.com/goodybag/bootstrap-notify.
*
* @param {String} [title] The notification title
* @param {String} message The notification message that will be shown underneath the title. The message should be sanitized by the caller to allow for HTML inside of the notification
Expand Down
56 changes: 29 additions & 27 deletions shared/vendor/js/bootstrap-plugins/bootstrap.notify.oae-edited.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
/**
* bootstrap-notify.js v1.0.0
* bootstrap-notify.js v1.0

This comment has been minimized.

Copy link
@nicolaasmatthijs

nicolaasmatthijs Feb 2, 2014

As long as we are editing this plugin, it would be good to add a link to our PR (goodybag/bootstrap-notify#29). It also looks like there is a comment on that PR, so it would be good to follow up on that.

* --
* Copyright 2012 Nijiko Yonskai <[email protected]>
* Copyright 2012 Goodybag, Inc.
* --
* Licensed under the Apache License, Version 2.0 (the "License");
Expand All @@ -17,61 +16,65 @@
* limitations under the License.
*/

define(['jquery'], function (jQuery) {
(function ($) {
var Notification = function (element, options) {
// Element collection
this.$element = $(element);
this.$note = $('<div class="alert alert-dismissable"></div>');
this.options = $.extend(true, {}, $.fn.notify.defaults, options);
this._link = null;
this.$element = $(element);
this.$note = $('<div class="alert"></div>');
if (this.options.closable) {
this.$note = $('<div class="alert alert-dismissable"></div>');
}

// Setup from options
if (this.options.transition)
if (this.options.transition === 'fade')
if(this.options.transition)
if(this.options.transition == 'fade')
this.$note.addClass('in').addClass(this.options.transition);
else this.$note.addClass(this.options.transition);
else this.$note.addClass('fade').addClass('in');

if (this.options.type)
if(this.options.type)
this.$note.addClass('alert-' + this.options.type);
else this.$note.addClass('alert-success');

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)
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.html)
this.$note.html(this.options.message.html);
else if (this.options.message.text)
else if(this.options.message.text)
this.$note.text(this.options.message.text);
else
this.$note.html(this.options.message);

if (this.options.closable)
this._link = $('<button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times</button>'),
$(this._link).on('click', $.proxy(Notification.onClose, this)),
this.$note.prepend(this._link);
if(this.options.closable)
var link = $('<a class="close pull-right" href="#">&times;</a>');
$(link).on('click', $.proxy(onClose, this));
this.$note.prepend(link);

return this;
};

Notification.onClose = function () {
var onClose = function() {

This comment has been minimized.

Copy link
@nicolaasmatthijs

nicolaasmatthijs Feb 2, 2014

Are these all changes that we made, as the PR to bootstrap.notify doesn't include all of these.

This comment has been minimized.

Copy link
@bertpareyn

bertpareyn Feb 3, 2014

Author Owner

I upgraded the plugin to the latest version.

this.options.onClose();
$(this.$note).remove();
this.options.onClosed();
return false;
};

Notification.prototype.show = function () {
if (this.options.fadeOut.enabled)
this.$note.delay(this.options.fadeOut.delay || 3000).fadeOut('slow', $.proxy(Notification.onClose, this));
if(this.options.fadeOut.enabled)
this.$note.delay(this.options.fadeOut.delay || 3000).fadeOut('slow', $.proxy(onClose, this));

this.$element.append(this.$note);
this.$note.alert();
};

Notification.prototype.hide = function () {
if (this.options.fadeOut.enabled)
this.$note.delay(this.options.fadeOut.delay || 3000).fadeOut('slow', $.proxy(Notification.onClose, this));
else Notification.onClose.call(this);
if(this.options.fadeOut.enabled)
this.$note.delay(this.options.fadeOut.delay || 3000).fadeOut('slow', $.proxy(onClose, this));
else onClose.call(this);
};

$.fn.notify = function (options) {
Expand All @@ -89,6 +92,5 @@ define(['jquery'], function (jQuery) {
message: null,
onClose: function () {},
onClosed: function () {}
};
}
})(window.jQuery);
});

0 comments on commit c1146d7

Please sign in to comment.