jquery_cheats 0.1.0 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- data/README.rdoc +40 -0
- data/Rakefile +1 -1
- data/jquery_cheats.gemspec +2 -2
- data/lib/jquery_cheats.rb +7 -7
- data/lib/railtie.rb +9 -0
- metadata +2 -1
data/README.rdoc
CHANGED
@@ -0,0 +1,40 @@
|
|
1
|
+
=Overview
|
2
|
+
JQuery Cheats is a Gem that is designed toa add simple helper methods to your application
|
3
|
+
making it easier to perform visual effects. Right now, it produces inline JavaScript
|
4
|
+
although we are highly considering having it read and write to an external file using a
|
5
|
+
generator or allowing the inline.
|
6
|
+
|
7
|
+
==Installation
|
8
|
+
|
9
|
+
In your Gemfile add
|
10
|
+
|
11
|
+
gem 'jquery_cheats'
|
12
|
+
|
13
|
+
If you would like the most recent "Edge" type rails then you can use the github version.
|
14
|
+
However, if you choose this version it may not work. For the github version use:
|
15
|
+
|
16
|
+
gem 'jquery_cheats',:git=>"git://github.com/plowdawg/jquery_cheats.git"
|
17
|
+
|
18
|
+
==USage VERSION >= 1.0.0
|
19
|
+
|
20
|
+
As of version 1.0.0 a railtie was introduced loading methods directly into ActionView.
|
21
|
+
This change makes it imposible to call it as it was previously called and use a more simpiler
|
22
|
+
syntax just because it is much shorter. Version 1.0.0 still only has one method but now
|
23
|
+
is called just by:
|
24
|
+
|
25
|
+
mouseoverimage("/path/to/image1.png","/path/to/image1-hover.png")
|
26
|
+
|
27
|
+
==Usage VERSION < 1.0.0
|
28
|
+
|
29
|
+
As of the current version there is only one available method, future versions will
|
30
|
+
expand this.
|
31
|
+
|
32
|
+
-To have a image that changes on mouseover use this code in your view:
|
33
|
+
|
34
|
+
JQueryCheats::HoverImage.mouseoverimage("/path/to/image1.jpg","/path/to/hover/image1.jpg")
|
35
|
+
|
36
|
+
===Future Speculation
|
37
|
+
|
38
|
+
In the future we plan on cutting the syntax down to possibly just:
|
39
|
+
|
40
|
+
mouseoverimage("image1.jpg","image2.jpg)
|
data/Rakefile
CHANGED
data/jquery_cheats.gemspec
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
Gem::Specification.new do |s|
|
4
4
|
s.name = %q{jquery_cheats}
|
5
|
-
s.version = "
|
5
|
+
s.version = "1.0.0"
|
6
6
|
|
7
7
|
s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
|
8
8
|
s.authors = [%q{Travis Pessettto}]
|
@@ -10,7 +10,7 @@ Gem::Specification.new do |s|
|
|
10
10
|
s.description = %q{JQuery Inline tricks}
|
11
11
|
s.email = %q{travis@pessetto.com}
|
12
12
|
s.extra_rdoc_files = [%q{README.rdoc}, %q{lib/jquery_cheats.rb}]
|
13
|
-
s.files = [%q{README.rdoc}, %q{Rakefile}, %q{lib/jquery_cheats.rb}, %q{Manifest}, %q{jquery_cheats.gemspec}]
|
13
|
+
s.files = [%q{README.rdoc}, %q{Rakefile}, %q{lib/jquery_cheats.rb}, %q{Manifest}, %q{jquery_cheats.gemspec},%{lib/railtie.rb}]
|
14
14
|
s.homepage = %q{http://pessetto.com}
|
15
15
|
s.rdoc_options = [%q{--line-numbers}, %q{--inline-source}, %q{--title}, %q{Jquery_cheats}, %q{--main}, %q{README.rdoc}]
|
16
16
|
s.require_paths = [%q{lib}]
|
data/lib/jquery_cheats.rb
CHANGED
@@ -1,21 +1,21 @@
|
|
1
1
|
module JQueryCheats
|
2
|
-
|
2
|
+
require 'railtie' if defined?(Rails)
|
3
|
+
module HoverImage
|
3
4
|
#class used to do a quick Hover image
|
4
|
-
attr_accessor :image_tag
|
5
5
|
|
6
|
-
class << self
|
6
|
+
#class << self
|
7
7
|
|
8
8
|
def mouseoverimage(initimage,hoverimage)
|
9
|
-
@
|
10
|
-
@
|
11
|
-
return @
|
9
|
+
@cheats_image_tag =""
|
10
|
+
@cheats_image_tag = "<img src=\"#{initimage}\" alt=\"image\" onmouseover=\"$(this).attr('src','#{hoverimage}')\" onmouseout=\"$(this).attr('src','#{initimage}')\">"
|
11
|
+
return @cheats_image_tag.html_safe
|
12
12
|
end
|
13
13
|
|
14
14
|
def initialize()
|
15
15
|
|
16
16
|
end
|
17
17
|
|
18
|
-
end#end self
|
18
|
+
#end#end self
|
19
19
|
|
20
20
|
end
|
21
21
|
end
|
data/lib/railtie.rb
ADDED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jquery_cheats
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 1.0.0
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -24,6 +24,7 @@ files:
|
|
24
24
|
- lib/jquery_cheats.rb
|
25
25
|
- Manifest
|
26
26
|
- jquery_cheats.gemspec
|
27
|
+
- lib/railtie.rb
|
27
28
|
homepage: http://pessetto.com
|
28
29
|
licenses: []
|
29
30
|
post_install_message:
|