Permalink
Browse files

cleaning the code

  • Loading branch information...
1 parent b41e20d commit e6d00ec7213b490ba369383e23a63d26ee896df3 @ustrajunior committed Jul 3, 2012
Showing with 0 additions and 210 deletions.
  1. +0 −51 README.rdoc
  2. +0 −8 lib/jquery_notify_bar/railtie.rb
  3. +0 −109 public/javascripts/jquery.notifyBar.js
  4. +0 −42 public/stylesheets/jquery.notifyBar.css
View
@@ -1,51 +0,0 @@
-=JqueryNotifyBar
-
-This is a simple ruby gem to include jquery.nofityBar from {Dmitri Smirnov}[http://github.com/dknight/jQuery-Notify-bar] to your rails app.
-
-jquery.notifyBar is a twitter like notification bar.
-
-With this gem, all your flash messages will be showed in the nofity bar. Visit the {demo page}[http://www.dmitri.me/misc/notify/] on Dmitri's website
-
-== Installation
-
-In your gem file add:
-
- gem 'jquery_notify_bar'
-
-You need copy this files to your stylesheets and javascripts folder
-
- https://github.com/ustrajunior/jquery_notify_bar/blob/master/public/javascripts/jquery.notifyBar.js
- https://github.com/ustrajunior/jquery_notify_bar/blob/master/public/stylesheets/jquery.notifyBar.css
-
-== Usage
-
-=== Rails 3.0
-
- <%= include_jquery_notify_bar %>
-
-=== Rails 3.1
- In rails 3.1 you don't need include the helper.
-
-This helper is to include the js function to generate the notification.
-
- <% flash.each do |key, msg| %>
- <%= jquery_notify_bar(key, msg) %>
- <% end %>
-
-==Parameters
-
-You can pass options too:
-
- :cls => :success
- :animation_speed => 'normal'
- :delay => 2000
-
- or all at the same time
-
- <% flash.each do |key, msg| %>
- <%= jquery_notify_bar(key, msg, :cls => :success, :animation_speed => 'normal', :delay => 2000) %>
- <% end %>
-
-This gem was inspired in the notify_bar[https://github.com/emrekutlu/notify_bar] {by İ. Emre Kutlu}[https://github.com/emrekutlu]
-
-Copyright (c) 2011 {Jose Carlos Ustra Junior}[http://ustrajunior.com], released under the MIT license
@@ -1,8 +0,0 @@
-require 'jquery_notify_bar/view_helpers'
-module JqueryNotifyBar
- class Railtie < Rails::Railtie
- initializer "jquery_notify_bar.view_helpers" do
- ActionView::Base.send :include, ViewHelpers
- end
- end
-end
@@ -1,109 +0,0 @@
-/*
-* Notify Bar - jQuery plugin
-*
-* Copyright (c) 2009-2010 Dmitri Smirnov
-*
-* Licensed under the MIT license:
-* http://www.opensource.org/licenses/mit-license.php
-*
-* Version: 1.2.2
-*
-* Project home:
-* http://www.dmitri.me/blog/notify-bar
-*/
-
-/**
-* param Object
-*/
-jQuery.notifyBar = function(settings) {
-
- (function($) {
-
- var bar = notifyBarNS = {};
- notifyBarNS.shown = false;
-
- if( !settings) {
- settings = {};
- }
- // HTML inside bar
- notifyBarNS.html = settings.html || "Your message here";
-
- //How long bar will be delayed, doesn't count animation time.
- notifyBarNS.delay = settings.delay || 2000;
-
- //How long notifyBarNS bar will be slided up and down
- notifyBarNS.animationSpeed = settings.animationSpeed || 200;
-
- //Use own jquery object usually DIV, or use default
- notifyBarNS.jqObject = settings.jqObject;
-
- //Set up own class
- notifyBarNS.cls = settings.cls || "";
-
- //close button
- notifyBarNS.close = settings.close || false;
-
- if( notifyBarNS.jqObject) {
- bar = notifyBarNS.jqObject;
- notifyBarNS.html = bar.html();
- } else {
- bar = jQuery("<div></div>")
- .addClass("jquery-notify-bar")
- .addClass(notifyBarNS.cls)
- .attr("id", "__notifyBar");
- }
-
- bar.html(notifyBarNS.html).hide();
- var id = bar.attr("id");
- switch (notifyBarNS.animationSpeed) {
- case "slow":
- asTime = 600;
- break;
- case "normal":
- asTime = 400;
- break;
- case "fast":
- asTime = 200;
- break;
- default:
- asTime = notifyBarNS.animationSpeed;
- }
- if( bar != 'object'); {
- jQuery("body").prepend(bar);
- }
-
- // Style close button in CSS file
- if( notifyBarNS.close) {
- bar.append(jQuery("<a href='#' class='notify-bar-close'>Close [X]</a>"));
- jQuery(".notify-bar-close").click(function() {
- if( bar.attr("id") == "__notifyBar") {
- jQuery("#" + id).slideUp(asTime, function() { jQuery("#" + id).remove() });
- } else {
- jQuery("#" + id).slideUp(asTime);
- }
- return false;
- });
- }
-
- // Check if we've got any visible bars and if we have, slide them up before showing the new one
- if($('.jquery-notify-bar:visible').length > 0) {
- $('.jquery-notify-bar:visible').stop().slideUp(asTime, function() {
- bar.stop().slideDown(asTime);
- });
- } else {
- bar.slideDown(asTime);
- }
-
- // Allow the user to click on the bar to close it
- bar.click(function() {
- $(this).slideUp(asTime);
- })
-
- // If taken from DOM dot not remove just hide
- if( bar.attr("id") == "__notifyBar") {
- setTimeout("jQuery('#" + id + "').stop().slideUp(" + asTime +", function() {jQuery('#" + id + "').remove()});", notifyBarNS.delay + asTime);
- } else {
- setTimeout("jQuery('#" + id + "').stop().slideUp(" + asTime +", function() {jQuery('#" + id + "')});", notifyBarNS.delay + asTime);
- }
-
-})(jQuery) };
@@ -1,42 +0,0 @@
-/*
-* Notify Bar - jQuery plugin
-*
-* Copyright (c) 2009-2010 Dmitri Smirnov
-*
-* Licensed under the MIT license:
-* http://www.opensource.org/licenses/mit-license.php
-*
-* Version: 1.2
-*
-* Project home:
-* http://www.dmitri.me/blog/notify-bar
-*/
-
-.jquery-notify-bar {
- width:100%;
- position:fixed;
- top:0;
- left:0;
- z-index:32768;
- background-color:#efefef;
- font-size:18px;
- color:#000;
- text-align:center;
- font-family: Arial, Verdana, sans-serif;
- padding:20px 0px;
- border-bottom:1px solid #bbb;
- cursor: pointer;
-}
-.jquery-notify-bar.error {
- color:#f00;
- background-color:#fdd;
-}
-.jquery-notify-bar.success {
- color:#060;
- background-color:#BBFFB6;
-}
-.notify-bar-close {
- position:absolute;
- left:95%;
- font-size:11px;
-}

0 comments on commit e6d00ec

Please sign in to comment.