Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added linking feature #40

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions README.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ A small growl-like notification plugin for jQuery

## Change Log

### Changes in 1.7.4.1 (January 30, 2012)

* Forked for changes. Added 'href' param to allow for linkable notifications. .gritter-item element changed to achor tag with display block. .gritter-top and .gritter-bottom elements removed from js and css. Rounded corners and transparency no achieved via css3. Not tested in ie7-8, will test soon.
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This needs to be tested in IE7/8 before being considered.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fair enough. This is my first ever pull request. Give me some time to meet that requirement.

On Mar 16, 2013, at 4:42 PM, Jordan Boesch [email protected] wrote:

In README.markdown:

@@ -5,6 +5,10 @@ A small growl-like notification plugin for jQuery

Change Log

+### Changes in 1.7.4.1 (January 30, 2012)
+
+* Forked for changes. Added 'href' param to allow for linkable notifications. .gritter-item element changed to achor tag with display block. .gritter-top and .gritter-bottom elements removed from js and css. Rounded corners and transparency no achieved via css3. Not tested in ie7-8, will test soon.
This needs to be tested in IE7/8 before being considered.


Reply to this email directly or view it on GitHub.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No prob! I appreciate the pull request :)

Jordan Boesch
www.boedesign.com

On Saturday, 16 March, 2013 at 4:48 PM, Isaac Shapira wrote:

In README.markdown:

@@ -5,6 +5,10 @@ A small growl-like notification plugin for jQuery > > ## Change Log > > +### Changes in 1.7.4.1 (January 30, 2012) > + > +* Forked for changes. Added 'href' param to allow for linkable notifications. .gritter-item element changed to achor tag with display block. .gritter-top and .gritter-bottom elements removed from js and css. Rounded corners and transparency no achieved via css3. Not tested in ie7-8, will test soon.
Fair enough. This is my first ever pull request. Give me some time to meet that requirement.
… (#)
On Mar 16, 2013, at 4:42 PM, Jordan Boesch <[email protected] (mailto:[email protected])> wrote: In README.markdown: > @@ -5,6 +5,10 @@ A small growl-like notification plugin for jQuery > > ## Change Log > > +### Changes in 1.7.4.1 (January 30, 2012) > + > +* Forked for changes. Added 'href' param to allow for linkable notifications. .gritter-item element changed to achor tag with display block. .gritter-top and .gritter-bottom elements removed from js and css. Rounded corners and transparency no achieved via css3. Not tested in ie7-8, will test soon. This needs to be tested in IE7/8 before being considered. — Reply to this email directly or view it on GitHub.


Reply to this email directly or view it on GitHub (https://github.com/jboesch/Gritter/pull/40/files#r3404148).


### Changes in 1.7.4 (February 24, 2012)

* Fixing bug where click event was being bound multiple times on hover. The result was the beforeClose callback being called multiple times. Thanks for commit aossowski!
Expand Down
22 changes: 5 additions & 17 deletions css/jquery.gritter.css
Original file line number Diff line number Diff line change
Expand Up @@ -27,28 +27,18 @@
margin:0 0 10px 0;
background:url('../images/ie-spacer.gif'); /* ie7/8 fix */
}
.gritter-top {
background:url(../images/gritter.png) no-repeat left -30px;
height:10px;
}
.hover .gritter-top {
background-position:right -30px;
}
.gritter-bottom {
background:url(../images/gritter.png) no-repeat left bottom;
height:8px;
margin:0;
}
.hover .gritter-bottom {
background-position: bottom right;
}
.gritter-item {
display:block;
background:url(../images/gritter.png) no-repeat left -40px;
background: rgba(0,0,0,0.4);
color:#eee;
padding:2px 11px 8px 11px;
font-size: 11px;
font-family:verdana;
-webkit-border-radius:5px;
-moz-border-radius:5px;
-o-border-radius:5px;
border-radius:5px;
}
.hover .gritter-item {
background-position:right -40px;
Expand Down Expand Up @@ -90,8 +80,6 @@
}
/* for the light (white) version of the gritter notice */
.gritter-light .gritter-item,
.gritter-light .gritter-bottom,
.gritter-light .gritter-top,
.gritter-light .gritter-close {
background-image: url(../images/gritter-light.png);
color: #222;
Expand Down
Binary file removed images/trees.jpg
Binary file not shown.
14 changes: 8 additions & 6 deletions js/jquery.gritter.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* Dual licensed under the MIT and GPL licenses.
*
* Date: February 24, 2012
* Version: 1.7.4
* Version: 1.7.4.1
*/

(function($){
Expand Down Expand Up @@ -80,7 +80,7 @@
_is_setup: 0,
_tpl_close: '<div class="gritter-close"></div>',
_tpl_title: '<span class="gritter-title">[[title]]</span>',
_tpl_item: '<div id="gritter-item-[[number]]" class="gritter-item-wrapper [[item_class]]" style="display:none"><div class="gritter-top"></div><div class="gritter-item">[[close]][[image]]<div class="[[class_name]]">[[title]]<p>[[text]]</p></div><div style="clear:both"></div></div><div class="gritter-bottom"></div></div>',
_tpl_item: '<a href="[[href]]" id="gritter-item-[[number]]" class="gritter-item-wrapper [[item_class]]" style="display:none"><div class="gritter-item">[[close]][[image]]<div class="[[class_name]]">[[title]]<p>[[text]]</p></div><div style="clear:both"></div></div></a>',
_tpl_wrap: '<div id="gritter-notice-wrapper"></div>',

/**
Expand Down Expand Up @@ -111,7 +111,8 @@
sticky = params.sticky || false,
item_class = params.class_name || $.gritter.options.class_name,
position = $.gritter.options.position,
time_alive = params.time || '';
time_alive = params.time || '',
href = params.href || '#';
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So if someone scrolls half way down the page, then clicks on the gritter message and href == '#', it'll jump to the top, right? If so, that needs to be stopped from happening.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you are correct sir. I will modify.

On Mar 16, 2013, at 4:40 PM, Jordan Boesch [email protected] wrote:

In js/jquery.gritter.js:

@@ -111,7 +111,8 @@
sticky = params.sticky || false,
item_class = params.class_name || $.gritter.options.class_name,
position = $.gritter.options.position,

  •           time_alive = params.time || '';
    
  •           time_alive = params.time || '',
    
  •           href = params.href || '#';
    
    So if someone scrolls half way down the page, then clicks on the gritter message and href == '#', it'll jump to the top, right? If so, that needs to be stopped from happening.


Reply to this email directly or view it on GitHub.


this._verifyWrapper();

Expand Down Expand Up @@ -143,8 +144,8 @@
}

tmp = this._str_replace(
['[[title]]', '[[text]]', '[[close]]', '[[image]]', '[[number]]', '[[class_name]]', '[[item_class]]'],
[title, text, this._tpl_close, image_str, this._item_count, class_name, item_class], tmp
['[[title]]', '[[text]]', '[[close]]', '[[image]]', '[[number]]', '[[class_name]]', '[[item_class]]','[[href]]'],
[title, text, this._tpl_close, image_str, this._item_count, class_name, item_class, href], tmp
);

// If it's false, don't show another gritter message
Expand Down Expand Up @@ -180,7 +181,8 @@
});

// Clicking (X) makes the perdy thing close
$(item).find('.gritter-close').click(function(){
$(item).find('.gritter-close').click(function(e){
e.preventDefault();
Gritter.removeSpecific(number, {}, null, true);
});

Expand Down
2 changes: 1 addition & 1 deletion js/jquery.gritter.min.js

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