jquery_cheats 5.1.3 → 5.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/.gitignore ADDED
@@ -0,0 +1,2 @@
1
+ *.*redcar*
2
+ *.gem
data/README.md CHANGED
@@ -1,28 +1,39 @@
1
1
  #JQuery Cheats
2
- JQuery Cheats is Gem that makes it easy to do simple little JavaScript tricks via the JQuery
3
- library.
4
- ##Installation
5
- It is as easy as adding this to your Gemfile
6
-
7
- ```ruby
8
- gem 'jquery_cheats','~>5.0.0'
9
- ```
10
-
11
- Then add the following to app/assets/application.js
12
-
13
- ```js
14
- //= require jqueryCheats
15
- ```
16
-
17
- If you would like charting functionality make sure the following code is in app/assets/application.js
18
-
19
- ```js
20
- //= require jqplot/jquery.jqplot.js
21
- ```
22
-
23
- Depending on the chart, you will have to include the plugin too, which are loaded in the jqplot/plugins directory
24
-
25
2
 
3
+ JQUery cheats is a simple gem that is suppose to make a few things easier within the Rails framework.
4
+ It is designed to be used with Rails >= 3.0.0 and later will support the asset pipeline requiring Rails >= 3.1.0
5
+
6
+ ##The Asset Pipeline
7
+
8
+ Because we want to make installing the asset pipeline easier we've provided the following instructions:
9
+
10
+ 1. This gem has a generator to include the needed files run ```rails g jquery_cheats:asset_pipeline```
11
+ 2. Make sure that your Gemfile has the following lines of code in it:
12
+
13
+ ```ruby
14
+ group :assets do
15
+ gem 'sass-rails', " ~> 3.1.0"
16
+ gem 'coffee-rails', " ~> 3.1.0"
17
+ gem 'uglifier'
18
+ end
19
+ gem 'jquery-rails'
20
+ ```
21
+ 3. Replace the following:
22
+
23
+ ```ruby
24
+ Bundler.require(:default, Rails.env) if defined?(Bundler)
25
+ ```
26
+ with:
27
+ ```ruby
28
+ if defined?(Bundler)
29
+ # If you precompile assets before deploying to production, use this line
30
+ Bundler.require *Rails.groups(:assets => %w(development test))
31
+ # If you want your assets lazily compiled in production, use this line
32
+ # Bundler.require(:default, :assets, Rails.env)
33
+ end
34
+ ```
35
+ 4.See the rest on [RailsCasts](http://railscasts.com/episodes/282-upgrading-to-rails-3-1?view=asciicast)
36
+
26
37
  ##Functions
27
38
 
28
39
  Mouse over image, Image1 changes to Image2 when moused over:
@@ -75,5 +86,4 @@ JQuery Cheats works in conjunction with [plotSimple](http://github.com/plowdawg/
75
86
 
76
87
  ##Change Log
77
88
 
78
- * Version 5.0 removes DOMSubtreeModified due to browser issues. Work around call barChart(id,xmlurl) in your JavaScript
79
- * Version 5.1 adds the ability to save charts as images (buggy)
89
+ * Version 5.0 removes DOMSubtreeModified due to browser issues. Work around call barChart(id,xmlurl) in your JavaScript
@@ -0,0 +1,13 @@
1
+ /*
2
+ * This is a manifest file that'll be compiled into application.css, which will include all the files
3
+ * listed below.
4
+ *
5
+ * Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets,
6
+ * or vendor/assets/stylesheets of plugins, if any, can be referenced here using a relative path.
7
+ *
8
+ * You're free to add application-wide styles to this file and they'll appear at the top of the
9
+ * compiled file, but it's generally better to create a new file per style scope.
10
+ *
11
+ *= require_self
12
+ *= require_tree .
13
+ */
@@ -0,0 +1,15 @@
1
+ // This is a manifest file that'll be compiled into application.js, which will include all the files
2
+ // listed below.
3
+ //
4
+ // Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
5
+ // or vendor/assets/javascripts of plugins, if any, can be referenced here using a relative path.
6
+ //
7
+ // It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
8
+ // the compiled file.
9
+ //
10
+ // WARNING: THE FIRST BLANK LINE MARKS THE END OF WHAT'S TO BE PROCESSED, ANY BLANK LINE SHOULD
11
+ // GO AFTER THE REQUIRES BELOW.
12
+ //
13
+ //= require jquery
14
+ //= require jquery_ujs
15
+ //= require_tree .
@@ -1,5 +1,16 @@
1
1
  $(document).ready(function() {
2
- //the following are for AJAX requests of form objects
2
+ /*$('html').keypress(function(e){
3
+ if(e.which == 13 && !$(\"textarea\").is(\":focus\")){
4
+ $('form').submit();
5
+ return false;
6
+ }
7
+ });*/
8
+ $(\"a[data-back]\").live(\"click\",
9
+ function(){
10
+ var ref = document.referrer;
11
+ document.location=ref;
12
+ });
13
+ //the following are for AJAX requests of form objects
3
14
  $("select[data-onchange]").live("change", function() {
4
15
  $.ajax({
5
16
  type : "post",
@@ -1,29 +1,27 @@
1
- # -*- encoding: utf-8 -*-
2
-
3
- Gem::Specification.new do |s|
4
- s.name = "jquery_cheats"
5
- s.version = "5.1.3"
6
-
7
- s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
8
- s.authors = ["Travis Pessettto"]
9
- s.date = Date.today
10
- s.description = "JQuery, JQPlot graphing, and other useful items for jquery."
11
- s.email = "travis@pessetto.com"
12
- s.extra_rdoc_files = ["README.md", "lib/jquery_cheats.rb"]
13
- s.files = Dir["{lib,app,vendor}/**/*"]+["README.md", "Rakefile", "Manifest", "jquery_cheats.gemspec"]
14
- s.homepage = "https://github.com/plowdawg/jquery_cheats"
15
- s.rdoc_options = ["--line-numbers", "--inline-source", "--title", "Jquery_cheats", "--main", "README.md"]
16
- s.require_paths = ["lib"]
17
- s.rubyforge_project = "jquery_cheats"
18
- s.rubygems_version = "1.8.23"
19
- s.summary = "JQuery Asset Pipeline tricks"
20
-
21
- if s.respond_to? :specification_version then
22
- s.specification_version = 3
23
-
24
- if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
25
- else
26
- end
27
- else
28
- end
29
- end
1
+ Gem::Specification.new do |s|
2
+ s.name = %q{jquery_cheats}
3
+ s.version = "5.2.1"
4
+
5
+ s.required_ruby_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
6
+ s.authors = %q{Travis Pessetto}
7
+ s.date = Date.today
8
+ s.description = %q{Useful items for JQUERY and an Asset Pipeline genrator}
9
+ s.email = %q{travis@pessetto.com}
10
+ s.extra_rdoc_files = [%q{README.md}]
11
+ s.files = `git ls-files`.split("\n")
12
+ s.homepage = %q{http://www.github.com/plowdawg/jquery_cheats}
13
+ s.rdoc_options = [%q{--line-numbers}, %q{--inline-source}, %q{--title}, %q{plot_simple}, %q{--main}, %q{readme.rdoc}]
14
+ s.require_paths = [%q{lib}]
15
+ s.rubyforge_project = %q{jquery_cheats}
16
+ s.rubygems_version = %q{1.8.6}
17
+ s.summary = %q{Useful to create assetpipeline files and other tricks with jquery}
18
+
19
+ if s.respond_to? :specification_version then
20
+ s.specification_version = 3
21
+
22
+ if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
23
+ else
24
+ end
25
+ else
26
+ end
27
+ end
@@ -0,0 +1,18 @@
1
+ require "rails/generators"
2
+ module JqueryCheats
3
+ class AssetPipelineGenerator < Rails::Generators::Base
4
+ desc "A simple way to get the asset pipeline in your application"
5
+ def generate_assetPipeline
6
+ source_root = File.expand_path("../../../../app/assets/assetpipeline/",__FILE__)
7
+ # need to make a directory to hold them
8
+ if(!File.exists?('app/assets/javascripts'))
9
+ FileUtils.mkdir_p 'app/assets/javascripts'
10
+ end
11
+ if(!File.exists?('app/assets/stylesheets'))
12
+ FileUtils.mkdir_p 'app/assets/stylesheets'
13
+ end
14
+ FileUtils.cp source_root+"/assetpipeline.js",'app/assets/javascripts/application.js'
15
+ FileUtils.cp source_root+"/assetpipeline.css",'app/assets/stylesheets/application.css'
16
+ end
17
+ end
18
+ end
@@ -1,6 +1,5 @@
1
1
  require 'jquery_cheats'
2
2
  module JQueryCheats
3
3
  class Engine < Rails::Engine
4
- # isolate_namespace JQueryCheats
5
4
  end
6
5
  end
data/lib/jquery_cheats.rb CHANGED
@@ -1,62 +1,59 @@
1
- module JQueryCheats
2
- require 'jquery_cheats/railtie' if defined?(Rails)
3
- require 'jquery_cheats/engine' if defined?(Rails)
4
- module HoverImage
5
- #class used to do a quick Hover image
6
-
7
- #class << self
8
-
9
- def mouseoverimage(initimage,hoverimage)
10
- cheats_image_tag =""
11
- cheats_image_tag = "<img src=\"#{initimage}\" alt=\"image\" onmouseover=\"$(this).attr('src','#{hoverimage}')\" onmouseout=\"$(this).attr('src','#{initimage}')\">"
12
- return cheats_image_tag.html_safe
13
- end
14
-
15
- def submitimage(imagepath,alt="Image Tag")
16
- button_tag = "<a href=\"#\" onclick=\"$('form').submit(); return false;\">
17
- <img src=\"#{imagepath}\" alt=\"#{alt}\"></a>".html_safe
18
- button_tag += "<script type=\"text/javascript\">
19
- $(document).ready(function(){
20
- $('html').keypress(function(e){
21
- if(e.which == 13){
22
- $('form').submit();
23
- return false;
24
- }
25
- });
26
- });</script>".html_safe
27
- return button_tag
28
- end
29
-
30
- def simplemolink(imagepath,link)
31
- hover_arry = imagepath.split('.')
32
- extension = hover_arry.pop
33
- newpath = hover_arry.join
34
- newlink = "<a href=\"#{link}\">#{self.mouseoverimage(imagepath,newpath+"-hover."+extension)}</a>".html_safe
35
- return newlink
36
- end
37
-
38
- def barchart(name,xmlurl)
39
- #create a new barchar div tag, class of jqplot is used to simplify jquery binding
40
- html = "<div id=\"#{name}\" class=\"barchart\" data-xmlurl=\"#{xmlurl}\"></div>".html_safe
41
- #we will have to relly on XML to get the rest of the data...
42
- end
43
-
44
- def piechart(name,xmlurl)
45
- #create a new barchar div tag, class of jqplot is used to simplify jquery binding
46
- html = "<div id=\"#{name}\" class=\"piechart\" data-xmlurl=\"#{xmlurl}\"></div>".html_safe
47
- #we will have to relly on XML to get the rest of the data...
48
- end
49
-
50
- def stackedcolumn(name,xmlurl)
51
- html = "<div id=\"#{name}\" class=\"stackedcolumn\" data-xmlurl=\"#{xmlurl}\"></div>".html_safe
52
- end
53
-
54
- def initialize
55
-
56
- end
57
-
58
- #end#end self
59
-
60
- end
61
-
1
+ module JQueryCheats
2
+ require 'jquery_cheats/railtie'
3
+ require 'jquery_cheats/engine' if defined?(Rails)
4
+ require 'generators/jquery_cheats/asset_pipeline_generator'
5
+ module HoverImage
6
+ #class used to do a quick Hover image
7
+
8
+ #class << self
9
+
10
+ def mouseoverimage(initimage,hoverimage)
11
+ cheats_image_tag =""
12
+ cheats_image_tag = "<img src=\"#{initimage}\" alt=\"image\" onmouseover=\"$(this).attr('src','#{hoverimage}')\" onmouseout=\"$(this).attr('src','#{initimage}')\">"
13
+ return cheats_image_tag.html_safe
14
+ end
15
+
16
+ def submitimage(imagepath,alt="Image Tag")
17
+ button_tag = "<a href=\"#\" onclick=\"$('form').submit(); return false;\">
18
+ <img src=\"#{imagepath}\" alt=\"#{alt}\"></a>".html_safe
19
+ button_tag += "<script type=\"text/javascript\">
20
+ $(document).ready(function(){
21
+ $('html').keypress(function(e){
22
+ if(e.which == 13){
23
+ $('form').submit();
24
+ return false;
25
+ }
26
+ });
27
+ });</script>".html_safe
28
+ return button_tag
29
+ end
30
+
31
+ def simplemolink(imagepath,link)
32
+ hover_arry = imagepath.split('.')
33
+ extension = hover_arry.pop
34
+ newpath = hover_arry.join
35
+ newlink = "<a href=\"#{link}\">#{self.mouseoverimage(imagepath,newpath+"-hover."+extension)}</a>".html_safe
36
+ return newlink
37
+ end
38
+
39
+ def barchart(name,xmlurl)
40
+ #create a new barchar div tag, class of jqplot is used to simplify jquery binding
41
+ html = "<div id=\"#{name}\" class=\"barchart\" data-xmlurl=\"#{xmlurl}\"></div>".html_safe
42
+ #we will have to relly on XML to get the rest of the data...
43
+ end
44
+
45
+ def piechart(name,xmlurl)
46
+ #create a new barchar div tag, class of jqplot is used to simplify jquery binding
47
+ html = "<div id=\"#{name}\" class=\"piechart\" data-xmlurl=\"#{xmlurl}\"></div>".html_safe
48
+ #we will have to relly on XML to get the rest of the data...
49
+ end
50
+
51
+ def initialize
52
+
53
+ end
54
+
55
+ #end#end self
56
+
57
+ end
58
+
62
59
  end
metadata CHANGED
@@ -1,36 +1,40 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jquery_cheats
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.1.3
4
+ version: 5.2.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
8
- - Travis Pessettto
8
+ - Travis Pessetto
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-11-29 00:00:00.000000000 Z
12
+ date: 2013-05-02 00:00:00.000000000 Z
13
13
  dependencies: []
14
- description: JQuery, JQPlot graphing, and other useful items for jquery.
14
+ description: Useful items for JQUERY and an Asset Pipeline genrator
15
15
  email: travis@pessetto.com
16
16
  executables: []
17
17
  extensions: []
18
18
  extra_rdoc_files:
19
19
  - README.md
20
- - lib/jquery_cheats.rb
21
20
  files:
22
- - lib/jquery_cheats/engine.rb
23
- - lib/jquery_cheats/jquery_cheats.rb
24
- - lib/jquery_cheats/railtie.rb
25
- - lib/jquery_cheats.rb
21
+ - .gitignore
22
+ - README.md
23
+ - app/assets/assetpipeline/assetpipeline.css
24
+ - app/assets/assetpipeline/assetpipeline.js
26
25
  - app/assets/javascripts/jquery_cheats/jquery_cheats.js
27
26
  - app/assets/javascripts/jquery_cheats/replacementContextMenu.js
27
+ - jquery_cheats.gemspec
28
+ - lib/generators/jquery_cheats/asset_pipeline_generator.rb
29
+ - lib/jquery_cheats.rb
30
+ - lib/jquery_cheats/engine.rb
31
+ - lib/jquery_cheats/railtie.rb
28
32
  - vendor/assets/javascripts/jqplot/excanvas.js
29
33
  - vendor/assets/javascripts/jqplot/jquery.jqplot.js
30
- - vendor/assets/javascripts/jqplot/plugins/jqplot.barRenderer.js
31
- - vendor/assets/javascripts/jqplot/plugins/jqplot.barRenderer.min.js
32
34
  - vendor/assets/javascripts/jqplot/plugins/jqplot.BezierCurveRenderer.js
33
35
  - vendor/assets/javascripts/jqplot/plugins/jqplot.BezierCurveRenderer.min.js
36
+ - vendor/assets/javascripts/jqplot/plugins/jqplot.barRenderer.js
37
+ - vendor/assets/javascripts/jqplot/plugins/jqplot.barRenderer.min.js
34
38
  - vendor/assets/javascripts/jqplot/plugins/jqplot.blockRenderer.js
35
39
  - vendor/assets/javascripts/jqplot/plugins/jqplot.blockRenderer.min.js
36
40
  - vendor/assets/javascripts/jqplot/plugins/jqplot.bubbleRenderer.js
@@ -88,10 +92,10 @@ files:
88
92
  - vendor/assets/javascripts/jquery_cheats/jqplot/excanvas.js
89
93
  - vendor/assets/javascripts/jquery_cheats/jqplot/index.js
90
94
  - vendor/assets/javascripts/jquery_cheats/jqplot/jquery.jqplot.js
91
- - vendor/assets/javascripts/jquery_cheats/jqplot/plugins/jqplot.barRenderer.js
92
- - vendor/assets/javascripts/jquery_cheats/jqplot/plugins/jqplot.barRenderer.min.js
93
95
  - vendor/assets/javascripts/jquery_cheats/jqplot/plugins/jqplot.BezierCurveRenderer.js
94
96
  - vendor/assets/javascripts/jquery_cheats/jqplot/plugins/jqplot.BezierCurveRenderer.min.js
97
+ - vendor/assets/javascripts/jquery_cheats/jqplot/plugins/jqplot.barRenderer.js
98
+ - vendor/assets/javascripts/jquery_cheats/jqplot/plugins/jqplot.barRenderer.min.js
95
99
  - vendor/assets/javascripts/jquery_cheats/jqplot/plugins/jqplot.blockRenderer.js
96
100
  - vendor/assets/javascripts/jquery_cheats/jqplot/plugins/jqplot.blockRenderer.min.js
97
101
  - vendor/assets/javascripts/jquery_cheats/jqplot/plugins/jqplot.bubbleRenderer.js
@@ -149,20 +153,16 @@ files:
149
153
  - vendor/assets/javascripts/jquery_cheats/spinjs/spin.min.js
150
154
  - vendor/assets/stylesheets/jquery.jqplot.css
151
155
  - vendor/assets/stylesheets/jquery_cheats/jquery.jqplot.css
152
- - README.md
153
- - Rakefile
154
- - Manifest
155
- - jquery_cheats.gemspec
156
- homepage: https://github.com/plowdawg/jquery_cheats
156
+ homepage: http://www.github.com/plowdawg/jquery_cheats
157
157
  licenses: []
158
158
  post_install_message:
159
159
  rdoc_options:
160
160
  - --line-numbers
161
161
  - --inline-source
162
162
  - --title
163
- - Jquery_cheats
163
+ - plot_simple
164
164
  - --main
165
- - README.md
165
+ - readme.rdoc
166
166
  require_paths:
167
167
  - lib
168
168
  required_ruby_version: !ruby/object:Gem::Requirement
@@ -170,17 +170,17 @@ required_ruby_version: !ruby/object:Gem::Requirement
170
170
  requirements:
171
171
  - - ! '>='
172
172
  - !ruby/object:Gem::Version
173
- version: '0'
173
+ version: '1.2'
174
174
  required_rubygems_version: !ruby/object:Gem::Requirement
175
175
  none: false
176
176
  requirements:
177
177
  - - ! '>='
178
178
  - !ruby/object:Gem::Version
179
- version: '1.2'
179
+ version: '0'
180
180
  requirements: []
181
181
  rubyforge_project: jquery_cheats
182
- rubygems_version: 1.8.23
182
+ rubygems_version: 1.8.24
183
183
  signing_key:
184
184
  specification_version: 3
185
- summary: JQuery Asset Pipeline tricks
185
+ summary: Useful to create assetpipeline files and other tricks with jquery
186
186
  test_files: []
data/Manifest DELETED
@@ -1,8 +0,0 @@
1
- Manifest
2
- README.md
3
- Rakefile
4
- app/assets/javascripts/jqueryCheats.js
5
- jquery_cheats.gemspec
6
- lib/engine.rb
7
- lib/jquery_cheats.rb
8
- lib/railtie.rb
data/Rakefile DELETED
@@ -1,14 +0,0 @@
1
- require 'rubygems'
2
- require 'rake'
3
- require 'echoe'
4
-
5
- Echoe.new('jquery_cheats', '2.0.0') do |p|
6
- p.description = "JQuery Inline tricks"
7
- p.url = "https://github.com/plowdawg/jquery_cheats"
8
- p.author = "Travis Pessettto"
9
- p.email = "travis@pessetto.com"
10
- p.ignore_pattern = ["tmp/*", "script/*"]
11
- p.development_dependencies = []
12
- end
13
-
14
- Dir["#{File.dirname(__FILE__)}/tasks/*.rake"].sort.each { |ext| load ext }
@@ -1,58 +0,0 @@
1
- module JQueryCheats
2
- require 'railtie' if defined?(Rails)
3
- require 'engine' if defined?(Rails)
4
- module HoverImage
5
- #class used to do a quick Hover image
6
-
7
- #class << self
8
-
9
- def mouseoverimage(initimage,hoverimage)
10
- cheats_image_tag =""
11
- cheats_image_tag = "<img src=\"#{initimage}\" alt=\"image\" onmouseover=\"$(this).attr('src','#{hoverimage}')\" onmouseout=\"$(this).attr('src','#{initimage}')\">"
12
- return cheats_image_tag.html_safe
13
- end
14
-
15
- def submitimage(imagepath,alt="Image Tag")
16
- button_tag = "<a href=\"#\" onclick=\"$('form').submit(); return false;\">
17
- <img src=\"#{imagepath}\" alt=\"#{alt}\"></a>".html_safe
18
- button_tag += "<script type=\"text/javascript\">
19
- $(document).ready(function(){
20
- $('html').keypress(function(e){
21
- if(e.which == 13){
22
- $('form').submit();
23
- return false;
24
- }
25
- });
26
- });</script>".html_safe
27
- return button_tag
28
- end
29
-
30
- def simplemolink(imagepath,link)
31
- hover_arry = imagepath.split('.')
32
- extension = hover_arry.pop
33
- newpath = hover_arry.join
34
- newlink = "<a href=\"#{link}\">#{self.mouseoverimage(imagepath,newpath+"-hover."+extension)}</a>".html_safe
35
- return newlink
36
- end
37
-
38
- def barchart(name,xmlurl)
39
- #create a new barchar div tag, class of jqplot is used to simplify jquery binding
40
- html = "<div id=\"#{name}\" class=\"barchart\" data-xmlurl=\"#{xmlurl}\"></div>".html_safe
41
- #we will have to relly on XML to get the rest of the data...
42
- end
43
-
44
- def piechart(name,xmlurl)
45
- #create a new barchar div tag, class of jqplot is used to simplify jquery binding
46
- html = "<div id=\"#{name}\" class=\"piechart\" data-xmlurl=\"#{xmlurl}\"></div>".html_safe
47
- #we will have to relly on XML to get the rest of the data...
48
- end
49
-
50
- def initialize
51
-
52
- end
53
-
54
- #end#end self
55
-
56
- end
57
-
58
- end