jquery_cheats 1.2.0 → 2.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/Manifest +6 -2
- data/README.md +52 -0
- data/Rakefile +2 -2
- data/app/assets/javascripts/jqueryCheats.js +10 -0
- data/jquery_cheats.gemspec +14 -14
- data/lib/engine.rb +7 -0
- data/lib/jquery_cheats.rb +2 -0
- metadata +13 -11
- data/README.rdoc +0 -38
data/Manifest
CHANGED
data/README.md
ADDED
@@ -0,0 +1,52 @@
|
|
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','~>2.0.0'
|
9
|
+
```
|
10
|
+
|
11
|
+
Then add the following to app/assets/application.js
|
12
|
+
|
13
|
+
```js
|
14
|
+
//= require jqueryCheats
|
15
|
+
```
|
16
|
+
|
17
|
+
##Functions
|
18
|
+
|
19
|
+
Mouse over image, Image1 changes to Image2 when moused over:
|
20
|
+
|
21
|
+
```erb
|
22
|
+
<%= mouseoverimage("/path/to/image1.jpg","/path/to/image2.jpg") %>
|
23
|
+
```
|
24
|
+
|
25
|
+
Submit Image, allows you to use an image instead of a button for a form:
|
26
|
+
|
27
|
+
```erb
|
28
|
+
<%= submitimage("/path/to/image.png") %>
|
29
|
+
```
|
30
|
+
|
31
|
+
This can also be used with an alternate text parameter
|
32
|
+
|
33
|
+
```erb
|
34
|
+
<%= submitimage("/path/to/image.png","Image Alt Text") %>
|
35
|
+
```
|
36
|
+
|
37
|
+
Simple Mouse Over Link, Provide one image and a link and it will provide a mouse over image
|
38
|
+
to that link. The function will look for imagename-hover so make sure your image file is named
|
39
|
+
right
|
40
|
+
|
41
|
+
```erb
|
42
|
+
<%= simplemolink("/path/to/imgage.png",link_path) %>
|
43
|
+
```
|
44
|
+
This will try to find /path/to/image-hover.png as the image to use when moused over.
|
45
|
+
|
46
|
+
##Ajax Requests for Field Items
|
47
|
+
|
48
|
+
The new assetpipline JavaScript makes it possible to submit form elements via data-remote calls when changed. Only the following are supported.
|
49
|
+
|
50
|
+
#Select Box
|
51
|
+
|
52
|
+
To use ajax with jquery_cheats add data-onchange="true" and data-url="/path/to"
|
data/Rakefile
CHANGED
@@ -2,9 +2,9 @@ require 'rubygems'
|
|
2
2
|
require 'rake'
|
3
3
|
require 'echoe'
|
4
4
|
|
5
|
-
Echoe.new('jquery_cheats', '
|
5
|
+
Echoe.new('jquery_cheats', '2.0.0') do |p|
|
6
6
|
p.description = "JQuery Inline tricks"
|
7
|
-
p.url = "
|
7
|
+
p.url = "https://github.com/plowdawg/jquery_cheats"
|
8
8
|
p.author = "Travis Pessettto"
|
9
9
|
p.email = "travis@pessetto.com"
|
10
10
|
p.ignore_pattern = ["tmp/*", "script/*"]
|
@@ -0,0 +1,10 @@
|
|
1
|
+
$(document).ready(function(){
|
2
|
+
//make select boxes ajax-compatible by adding two params data-onchange=true and data-url="/path/to"
|
3
|
+
$('select[data-onchange]').live("change",function(){
|
4
|
+
$.ajax({type: "post",
|
5
|
+
url: $(this).attr("data-url"),
|
6
|
+
data: $(this).serialize(),
|
7
|
+
success: function(data){eval(data);},
|
8
|
+
dataType: "script"});
|
9
|
+
});
|
10
|
+
});
|
data/jquery_cheats.gemspec
CHANGED
@@ -1,22 +1,22 @@
|
|
1
1
|
# -*- encoding: utf-8 -*-
|
2
2
|
|
3
3
|
Gem::Specification.new do |s|
|
4
|
-
s.name =
|
5
|
-
s.version = "
|
4
|
+
s.name = "jquery_cheats"
|
5
|
+
s.version = "2.0.1"
|
6
6
|
|
7
7
|
s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
|
8
|
-
s.authors = [
|
9
|
-
s.date =
|
10
|
-
s.description =
|
11
|
-
s.email =
|
12
|
-
s.extra_rdoc_files = [
|
13
|
-
s.files = [
|
14
|
-
s.homepage =
|
15
|
-
s.rdoc_options = [
|
16
|
-
s.require_paths = [
|
17
|
-
s.rubyforge_project =
|
18
|
-
s.rubygems_version =
|
19
|
-
s.summary =
|
8
|
+
s.authors = ["Travis Pessettto"]
|
9
|
+
s.date = "2012-06-07"
|
10
|
+
s.description = "JQuery Asset Pipeline tricks"
|
11
|
+
s.email = "travis@pessetto.com"
|
12
|
+
s.extra_rdoc_files = ["README.md", "lib/jquery_cheats.rb"]
|
13
|
+
s.files = Dir["{lib,app}/**/*"]+["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
20
|
|
21
21
|
if s.respond_to? :specification_version then
|
22
22
|
s.specification_version = 3
|
data/lib/engine.rb
ADDED
data/lib/jquery_cheats.rb
CHANGED
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: 2.0.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,23 +9,25 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2012-06-07 00:00:00.000000000 Z
|
13
13
|
dependencies: []
|
14
|
-
description: JQuery
|
14
|
+
description: JQuery Asset Pipeline tricks
|
15
15
|
email: travis@pessetto.com
|
16
16
|
executables: []
|
17
17
|
extensions: []
|
18
18
|
extra_rdoc_files:
|
19
|
-
- README.
|
19
|
+
- README.md
|
20
20
|
- lib/jquery_cheats.rb
|
21
21
|
files:
|
22
|
-
-
|
23
|
-
- Rakefile
|
22
|
+
- lib/engine.rb
|
24
23
|
- lib/jquery_cheats.rb
|
24
|
+
- lib/railtie.rb
|
25
|
+
- app/assets/javascripts/jqueryCheats.js
|
26
|
+
- README.md
|
27
|
+
- Rakefile
|
25
28
|
- Manifest
|
26
29
|
- jquery_cheats.gemspec
|
27
|
-
|
28
|
-
homepage: http://pessetto.com
|
30
|
+
homepage: https://github.com/plowdawg/jquery_cheats
|
29
31
|
licenses: []
|
30
32
|
post_install_message:
|
31
33
|
rdoc_options:
|
@@ -34,7 +36,7 @@ rdoc_options:
|
|
34
36
|
- --title
|
35
37
|
- Jquery_cheats
|
36
38
|
- --main
|
37
|
-
- README.
|
39
|
+
- README.md
|
38
40
|
require_paths:
|
39
41
|
- lib
|
40
42
|
required_ruby_version: !ruby/object:Gem::Requirement
|
@@ -51,8 +53,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
51
53
|
version: '1.2'
|
52
54
|
requirements: []
|
53
55
|
rubyforge_project: jquery_cheats
|
54
|
-
rubygems_version: 1.8.
|
56
|
+
rubygems_version: 1.8.24
|
55
57
|
signing_key:
|
56
58
|
specification_version: 3
|
57
|
-
summary: JQuery
|
59
|
+
summary: JQuery Asset Pipeline tricks
|
58
60
|
test_files: []
|
data/README.rdoc
DELETED
@@ -1,38 +0,0 @@
|
|
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.1.0
|
19
|
-
|
20
|
-
As of version 1.0.0 a railtie was introduced loading methods directly into ActionView
|
21
|
-
you can call the two methods now by:
|
22
|
-
|
23
|
-
mouseoverimage("/path/to/image1.png","/path/to/image1-hover.png")
|
24
|
-
|
25
|
-
submitimage("/path/to/image","Alternate Text")
|
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
|
-
Future move from .rdoc to .md
|