SrBuj 0.2.1 → 0.2.2
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/LICENSE.txt +22 -0
- data/README.md +98 -0
- data/lib/SrBuj/version.rb +1 -3
- data/lib/{Srbuj.rb → SrBuj.rb} +0 -0
- metadata +43 -7
data/LICENSE.txt
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
Copyright (c) 2013 gagoar
|
2
|
+
|
3
|
+
MIT License
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
6
|
+
a copy of this software and associated documentation files (the
|
7
|
+
"Software"), to deal in the Software without restriction, including
|
8
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
9
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
10
|
+
permit persons to whom the Software is furnished to do so, subject to
|
11
|
+
the following conditions:
|
12
|
+
|
13
|
+
The above copyright notice and this permission notice shall be
|
14
|
+
included in all copies or substantial portions of the Software.
|
15
|
+
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
17
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
18
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
19
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
20
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
21
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
22
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,98 @@
|
|
1
|
+
SrBuj
|
2
|
+
=
|
3
|
+
|
4
|
+
Better Unobtrusive JavaScript Request (for Rails and jquery_ujs, twitter/bootstrap modal.js)
|
5
|
+
|
6
|
+
- Do you need render a partial in your web with out reload?, and make a modal out of it?(depends on twitter/Bootstrap modal.js)
|
7
|
+
- Do you need remove an element from a list?
|
8
|
+
- Do you need replace an element after update?
|
9
|
+
|
10
|
+
|
11
|
+
This unobtrusive scripting support file is developed for the Ruby on Rails framework, but is not strictly tied to any specific backend. You can drop this into any application to:
|
12
|
+
|
13
|
+
- get modals out of the box, via js
|
14
|
+
- make non-GET requests from hyperlinks
|
15
|
+
- make forms or hyperlinks submit data asynchronously with Ajax and handle the response in a dry way;
|
16
|
+
|
17
|
+
These features are achieved by adding certain ["data" attributes][data] to your HTML markup. In Rails, they are added by the framework's template helpers.
|
18
|
+
|
19
|
+
Requirements
|
20
|
+
------------
|
21
|
+
|
22
|
+
- [jQuery 1.7.x or higher][jquery];
|
23
|
+
- [twitter/bootstrap modal.js plugin]
|
24
|
+
- HTML5 doctype (optional).
|
25
|
+
|
26
|
+
If you don't use HTML5, adding "data" attributes to your HTML4 or XHTML pages might make them fail [W3C markup validation][validator]. However, this shouldn't create any issues for web browsers or other user agents.
|
27
|
+
|
28
|
+
Installation
|
29
|
+
------------
|
30
|
+
|
31
|
+
For automated installation in Rails, use the "jquery-rails" gem. Place this in your Gemfile:
|
32
|
+
|
33
|
+
````ruby
|
34
|
+
gem 'SrBuj'
|
35
|
+
````
|
36
|
+
|
37
|
+
And run:
|
38
|
+
|
39
|
+
$ bundle install
|
40
|
+
|
41
|
+
This next step depends on your version of Rails.
|
42
|
+
|
43
|
+
a. For Rails 3.1, add these lines to the top of your app/assets/javascripts/application.js file:
|
44
|
+
|
45
|
+
```javascript
|
46
|
+
//= require jquery
|
47
|
+
//= require jquery_ujs
|
48
|
+
//= require SrBuj
|
49
|
+
```
|
50
|
+
|
51
|
+
Use
|
52
|
+
---
|
53
|
+
data[target] = id Element in to render the response before success
|
54
|
+
data[modal] = true|false if you wish that repsonse execute in modal (default false)
|
55
|
+
data[error] = id Element In a form data[error] is the holder in witch de form re renders to show the errors
|
56
|
+
data[replace] = true|false if you wish replace de data[target] element with the response content on success (default false)
|
57
|
+
data[remote] && data[target] = combined the success response execute a remove() over the target element
|
58
|
+
|
59
|
+
|
60
|
+
Example
|
61
|
+
---
|
62
|
+
|
63
|
+
in your view (example with a link)
|
64
|
+
|
65
|
+
````haml
|
66
|
+
= link_to 'add Element' elements_path, remote: true, data: {target: 'partial-id', modal: true}
|
67
|
+
|
68
|
+
|
69
|
+
#partial-id
|
70
|
+
|
71
|
+
````
|
72
|
+
|
73
|
+
in your controller
|
74
|
+
|
75
|
+
```` ruby
|
76
|
+
def new
|
77
|
+
@element= Element.new
|
78
|
+
render partial: 'new', content_type: 'text/html'
|
79
|
+
end
|
80
|
+
````
|
81
|
+
|
82
|
+
that's it.
|
83
|
+
|
84
|
+
Contributing
|
85
|
+
------------
|
86
|
+
|
87
|
+
1. Fork it
|
88
|
+
2. Create your feature branch (`git checkout -b my-new-feature`)
|
89
|
+
3. Commit your changes (`git commit -am 'Add some feature'`)
|
90
|
+
4. Push to the branch (`git push origin my-new-feature`)
|
91
|
+
5. Create new Pull Request
|
92
|
+
|
93
|
+
Copyright
|
94
|
+
---------
|
95
|
+
|
96
|
+
Copyright (c) 2013 gagoar. See LICENSE.txt for
|
97
|
+
further details.
|
98
|
+
|
data/lib/SrBuj/version.rb
CHANGED
data/lib/{Srbuj.rb → SrBuj.rb}
RENAMED
File without changes
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: SrBuj
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.2
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -10,8 +10,41 @@ autorequire:
|
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
12
|
date: 2013-03-03 00:00:00.000000000 Z
|
13
|
-
dependencies:
|
14
|
-
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
15
|
+
name: bundler
|
16
|
+
requirement: &70118254588320 !ruby/object:Gem::Requirement
|
17
|
+
none: false
|
18
|
+
requirements:
|
19
|
+
- - ~>
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: '1.3'
|
22
|
+
type: :development
|
23
|
+
prerelease: false
|
24
|
+
version_requirements: *70118254588320
|
25
|
+
- !ruby/object:Gem::Dependency
|
26
|
+
name: railties
|
27
|
+
requirement: &70118254586620 !ruby/object:Gem::Requirement
|
28
|
+
none: false
|
29
|
+
requirements:
|
30
|
+
- - ~>
|
31
|
+
- !ruby/object:Gem::Version
|
32
|
+
version: '3.1'
|
33
|
+
type: :runtime
|
34
|
+
prerelease: false
|
35
|
+
version_requirements: *70118254586620
|
36
|
+
- !ruby/object:Gem::Dependency
|
37
|
+
name: rake
|
38
|
+
requirement: &70118254585760 !ruby/object:Gem::Requirement
|
39
|
+
none: false
|
40
|
+
requirements:
|
41
|
+
- - ! '>='
|
42
|
+
- !ruby/object:Gem::Version
|
43
|
+
version: '0'
|
44
|
+
type: :development
|
45
|
+
prerelease: false
|
46
|
+
version_requirements: *70118254585760
|
47
|
+
description: Better Unobtrusive JavaScript Request in asset pipeline
|
15
48
|
email:
|
16
49
|
- xeroice@gmail.com
|
17
50
|
executables: []
|
@@ -19,10 +52,13 @@ extensions: []
|
|
19
52
|
extra_rdoc_files: []
|
20
53
|
files:
|
21
54
|
- lib/SrBuj/version.rb
|
22
|
-
- lib/
|
55
|
+
- lib/SrBuj.rb
|
23
56
|
- vendor/assets/javascripts/SrBuj.js
|
24
|
-
|
25
|
-
|
57
|
+
- LICENSE.txt
|
58
|
+
- README.md
|
59
|
+
homepage: http://gagoar.github.com/SrBuj/
|
60
|
+
licenses:
|
61
|
+
- MIT
|
26
62
|
post_install_message:
|
27
63
|
rdoc_options: []
|
28
64
|
require_paths:
|
@@ -44,6 +80,6 @@ rubyforge_project:
|
|
44
80
|
rubygems_version: 1.8.11
|
45
81
|
signing_key:
|
46
82
|
specification_version: 3
|
47
|
-
summary:
|
83
|
+
summary: http://github.com/gagoar/SrBuj/
|
48
84
|
test_files: []
|
49
85
|
has_rdoc:
|