smart-spinner-cis 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
data/Gemfile ADDED
@@ -0,0 +1,3 @@
1
+ source "http://rubygems.org"
2
+
3
+ gemspec
@@ -0,0 +1,38 @@
1
+ smart-spiner-cis
2
+ =================
3
+
4
+ With the help of this gem you can easily have the spiner(ajax-loading-spiner) for your application on load(page load). :-)
5
+
6
+
7
+ INSTALLTION
8
+
9
+ First thing you need to do is the installation , you can follow the below mentioned steps to install the gem inside your rails application.
10
+ You need to add sudo if you are not using rvm(ruby version manager)
11
+
12
+ ```
13
+ gem install smart-spinner-cis
14
+ ```
15
+
16
+ Add this following line in your Gemfile and then run bundle install.
17
+ ```
18
+ gem 'smart-spinner-cis'
19
+ ```
20
+
21
+ Run the generator command:
22
+
23
+ ```
24
+ rails g smart_spinner_cis:install
25
+ ```
26
+
27
+ USAGE
28
+
29
+ Once you have installed this gem you can do the following :-
30
+
31
+
32
+ In application layout call spinner_tag,for example in application.html.haml
33
+
34
+ ```HTML
35
+ = spinner_tag
36
+ ```
37
+
38
+ And enjoy this!!
@@ -0,0 +1,2 @@
1
+ require 'bundler'
2
+ Bundler::GemHelper.install_tasks
@@ -0,0 +1,5 @@
1
+ $(window).load(function(){
2
+ setTimeout(function() {$("#div-load").hide();
3
+ $("#div-another-image").hide();
4
+ }, 1000);
5
+ });
@@ -0,0 +1,18 @@
1
+ #div-load{
2
+ width:100%;
3
+ z-index:1000;
4
+ height:100%;
5
+ background-color: rgb(119, 119, 119); opacity: 0.7;
6
+ position:fixed;
7
+
8
+ }
9
+ #div-another-image{
10
+ width:100%;
11
+ z-index:1001;
12
+ height:100%;
13
+ background-image:url('/assets/ajax-loader.gif');
14
+ opacity: 0.6;
15
+ background-position:center center;
16
+ background-repeat:no-repeat;
17
+ position:fixed;
18
+ }
@@ -0,0 +1,52 @@
1
+ require 'rails'
2
+
3
+ if ::Rails.version < "3.1"
4
+ module SmartSpinnerCis
5
+ module Generators
6
+ class InstallGenerator < ::Rails::Generators::Base
7
+
8
+ desc "This generator installs Jquery , CSS and Images"
9
+ source_root File.expand_path('../../../../../app/assets', __FILE__)
10
+
11
+ def copy_jquery_nested
12
+ copy_file "javascripts/smart-spinner-cis.js", "public/javascripts/smart-spinner-cis.js"
13
+ copy_file "stylesheets/smart-spinner-cis.css", "public/stylesheets/smart-spinner-cis.css"
14
+ end
15
+ end
16
+ end
17
+ end
18
+ else
19
+ module SmartSpinnerCis
20
+ module Generators
21
+ class InstallGenerator < ::Rails::Generators::Base
22
+ desc "This generator installs Jquery , CSS and Images"
23
+ source_root File.expand_path('../../../../../app/assets', __FILE__)
24
+ def add_assets
25
+ if detect_js_format.nil?
26
+ copy_file "javascripts/jquery.smart-spinner-cis.js", "app/assets/javascripts/smart-spinner-cis.js"
27
+ else
28
+ insert_into_file "app/assets/javascripts/application#{detect_js_format[0]}", "#{detect_js_format[1]} require smart-spinner-cis\n", :after => "jquery_ujs\n"
29
+ end
30
+ if detect_css_format.nil?
31
+ copy_file "stylesheets/jquery.smart-spinner-cis.css", "app/assets/stylesheets/smart-spinner-cis.css"
32
+ else
33
+ insert_into_file "app/assets/stylesheets/application#{detect_css_format[0]}", "#{detect_css_format[1]} require smart-spinner-cis\n", :after => "require_self\n"
34
+ end
35
+ #copy_file "images/notification_top_alert.png", "app/assets/images/notification_top_alert.png"
36
+ #copy_file "images/notification_top_error.png", "app/assets/images/notification_top_error.png"
37
+ #copy_file "images/notification_top_ok.png", "app/assets/images/notification_top_ok.png"
38
+
39
+ end
40
+
41
+ def detect_js_format
42
+ return ['.js.coffee', '#='] if File.exist?('app/assets/javascripts/application.js.coffee')
43
+ return ['.js', '//='] if File.exist?('app/assets/javascripts/application.js')
44
+ end
45
+ def detect_css_format
46
+ return ['.css.scss', '*='] if File.exist?('app/assets/stylesheets/application.css.scss')
47
+ return ['.css', '*='] if File.exist?('app/assets/stylesheets/application.css')
48
+ end
49
+ end
50
+ end
51
+ end
52
+ end
@@ -0,0 +1,12 @@
1
+ module SmartSpinnerCis
2
+ end
3
+
4
+
5
+ require "smart-spinner-cis/rails" if defined?(Rails)
6
+
7
+
8
+
9
+
10
+
11
+
12
+
@@ -0,0 +1,3 @@
1
+ require 'smart-spinner-cis/rails'
2
+ require 'smart-spinner-cis/rails/engine' if ::Rails.version >= '3.1'
3
+ require 'smart-spinner-cis/rails/railtie'
@@ -0,0 +1,6 @@
1
+ module SmartSpinnerCis
2
+ module Rails
3
+ class Engine < ::Rails::Engine
4
+ end
5
+ end
6
+ end
@@ -0,0 +1,8 @@
1
+ require 'smart-spinner-cis/view_helpers'
2
+ module SmartSpinnerCis
3
+ class Railtie < ::Rails::Railtie
4
+ initializer "smart-spinner-cis.view_helpers" do
5
+ ActionView::Base.send :include, ViewHelpers
6
+ end
7
+ end
8
+ end
@@ -0,0 +1,7 @@
1
+ module SmartSpinnerCis
2
+ module ViewHelpers
3
+ def spinner_tag
4
+ "<div id='div-load'></div><div id='div-another-image'></div>".html_safe
5
+ end
6
+ end
7
+ end
metadata ADDED
@@ -0,0 +1,81 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: smart-spinner-cis
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.4
5
+ prerelease:
6
+ platform: ruby
7
+ authors:
8
+ - Mohan Salvi
9
+ - CISROR Team
10
+ autorequire:
11
+ bindir: bin
12
+ cert_chain: []
13
+ date: 2013-11-01 00:00:00.000000000 Z
14
+ dependencies:
15
+ - !ruby/object:Gem::Dependency
16
+ name: jquery-rails
17
+ requirement: &11948300 !ruby/object:Gem::Requirement
18
+ none: false
19
+ requirements:
20
+ - - ! '>='
21
+ - !ruby/object:Gem::Version
22
+ version: '0'
23
+ type: :runtime
24
+ prerelease: false
25
+ version_requirements: *11948300
26
+ - !ruby/object:Gem::Dependency
27
+ name: railties
28
+ requirement: &11947580 !ruby/object:Gem::Requirement
29
+ none: false
30
+ requirements:
31
+ - - ! '>='
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: *11947580
37
+ description: smart-spinner-cis will provide spinner(ajax-loader) on page load
38
+ email:
39
+ executables: []
40
+ extensions: []
41
+ extra_rdoc_files: []
42
+ files:
43
+ - lib/smart-spinner-cis.rb
44
+ - lib/smart-spinner-cis/view_helpers.rb
45
+ - lib/smart-spinner-cis/rails.rb
46
+ - lib/smart-spinner-cis/rails/railtie.rb
47
+ - lib/smart-spinner-cis/rails/engine.rb
48
+ - lib/generators/smart_spinner_cis/install/install_generator.rb
49
+ - app/assets/stylesheets/smart-spinner-cis.css
50
+ - app/assets/images/demo_snap.png
51
+ - app/assets/images/ajax-loader.gif
52
+ - app/assets/javascripts/smart-spinner-cis.js
53
+ - Rakefile
54
+ - Gemfile
55
+ - README.md
56
+ homepage: https://github.com/cisin-ror/smart-spinner-cis
57
+ licenses:
58
+ - MIT
59
+ post_install_message:
60
+ rdoc_options: []
61
+ require_paths:
62
+ - lib
63
+ required_ruby_version: !ruby/object:Gem::Requirement
64
+ none: false
65
+ requirements:
66
+ - - ! '>='
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
69
+ required_rubygems_version: !ruby/object:Gem::Requirement
70
+ none: false
71
+ requirements:
72
+ - - ! '>='
73
+ - !ruby/object:Gem::Version
74
+ version: 1.3.6
75
+ requirements: []
76
+ rubyforge_project: jquery-rails
77
+ rubygems_version: 1.8.11
78
+ signing_key:
79
+ specification_version: 3
80
+ summary: smart-spinner-ciss will provide spinner(ajax-loader) on page load
81
+ test_files: []