bootstrap_pagedown 1.0.0
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.
- checksums.yaml +7 -0
- data/MIT-LICENSE +20 -0
- data/README.md +66 -0
- data/Rakefile +28 -0
- data/lib/bootstrap_pagedown/engine.rb +4 -0
- data/lib/bootstrap_pagedown/form_builder.rb +10 -0
- data/lib/bootstrap_pagedown/version.rb +3 -0
- data/lib/bootstrap_pagedown.rb +8 -0
- data/lib/tasks/bootstrap_pagedown_tasks.rake +4 -0
- metadata +65 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: a8e726b82d2230d670103f7d59fca96cac469042
|
4
|
+
data.tar.gz: d20812e763123444215fbbe955a173aa9bbeeed0
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 1fef37f2aed37d821aa7cf7c8edbdb6ef2953e5569b4dbb4298b223bd26fd6a1acab86530c7bbccf1188cedb22d0ec2265a0a61d030c735843ee378347e47c93
|
7
|
+
data.tar.gz: 1706e4a3a79a30801c834b03bfccc9a1463f6f541411685440ed7ce2281c615a9739418153e638e8ad08d1fa5b6421de24f91231bf9562e678c245000e05a071
|
data/MIT-LICENSE
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
Copyright 2013 YOURNAME
|
2
|
+
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
4
|
+
a copy of this software and associated documentation files (the
|
5
|
+
"Software"), to deal in the Software without restriction, including
|
6
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
7
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
8
|
+
permit persons to whom the Software is furnished to do so, subject to
|
9
|
+
the following conditions:
|
10
|
+
|
11
|
+
The above copyright notice and this permission notice shall be
|
12
|
+
included in all copies or substantial portions of the Software.
|
13
|
+
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
15
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
16
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
17
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
18
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
19
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
20
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,66 @@
|
|
1
|
+
# Bootstrap Pagedown
|
2
|
+
[](http://travis-ci.org/cloverinteractive/bootstrap_pagedown)
|
3
|
+
|
4
|
+
It's a rails version of Bootstrap Pagedown with it's own form builder.
|
5
|
+
|
6
|
+
## Setup
|
7
|
+
|
8
|
+
Add it to your Gemfile then run `bundle` to install it.
|
9
|
+
|
10
|
+
```ruby
|
11
|
+
gem "bootstrap_pagedown"
|
12
|
+
```
|
13
|
+
|
14
|
+
Then add it to your Asset Pipeline manifest files:
|
15
|
+
|
16
|
+
```javascript
|
17
|
+
// application.js
|
18
|
+
//= require bootstrap_pagedown
|
19
|
+
```
|
20
|
+
|
21
|
+
```css
|
22
|
+
/*
|
23
|
+
* application.css
|
24
|
+
*= require bootstrap_pagedown
|
25
|
+
*/
|
26
|
+
```
|
27
|
+
|
28
|
+
## Requirements
|
29
|
+
|
30
|
+
This plugin requires bootstrap to work as intended.
|
31
|
+
|
32
|
+
## Form builder
|
33
|
+
|
34
|
+
To use with rails form simply do the following:
|
35
|
+
|
36
|
+
```erb
|
37
|
+
<%= form_for @page do |f| %>
|
38
|
+
<%= f.pagedown_editor :body
|
39
|
+
<% end %>
|
40
|
+
```
|
41
|
+
|
42
|
+
This will generate the necessary HTML to render the Markdown editor for the `body` property of our `Page` model.
|
43
|
+
|
44
|
+
You may also add attributes to the generated text area as needed by simply adding them after the method name:
|
45
|
+
|
46
|
+
```erb
|
47
|
+
<%= f.pagedown_editor :body, 'data-name' => 'editor'
|
48
|
+
```
|
49
|
+
|
50
|
+
The previous example would add `data-name="editor"` to the editor textarea element.
|
51
|
+
|
52
|
+
### Note
|
53
|
+
|
54
|
+
You should only use one editor per page since `Pagedown`'s Javascript relies on the HTML id attribute for most of it's behavior.
|
55
|
+
|
56
|
+
## Running the test suite
|
57
|
+
|
58
|
+
Simply clone this project (or pull) and then run `rake`
|
59
|
+
|
60
|
+
## Running the dummy app
|
61
|
+
|
62
|
+
Go into the `spec/dummy` directory and run `rails s` then in your web browser visit `http://localhost:3000`, you should see a blank page with the editor.
|
63
|
+
|
64
|
+
## License
|
65
|
+
|
66
|
+
This project uses the MIT license, please read the `MIT-LICENSE` file included with this project
|
data/Rakefile
ADDED
@@ -0,0 +1,28 @@
|
|
1
|
+
begin
|
2
|
+
require 'bundler/setup'
|
3
|
+
rescue LoadError
|
4
|
+
puts 'You must `gem install bundler` and `bundle install` to run rake tasks'
|
5
|
+
end
|
6
|
+
|
7
|
+
require 'rdoc/task'
|
8
|
+
|
9
|
+
begin
|
10
|
+
require 'rspec/core/rake_task'
|
11
|
+
desc "Run RSpec"
|
12
|
+
RSpec::Core::RakeTask.new do |t|
|
13
|
+
t.verbose = false
|
14
|
+
end
|
15
|
+
rescue LoadError
|
16
|
+
puts "Please run bundle install"
|
17
|
+
end
|
18
|
+
|
19
|
+
RDoc::Task.new(:rdoc) do |rdoc|
|
20
|
+
rdoc.rdoc_dir = 'rdoc'
|
21
|
+
rdoc.title = 'BootstrapPagedown'
|
22
|
+
rdoc.options << '--line-numbers'
|
23
|
+
rdoc.rdoc_files.include('lib/**/*.rb')
|
24
|
+
end
|
25
|
+
|
26
|
+
task default: :spec
|
27
|
+
|
28
|
+
Bundler::GemHelper.install_tasks
|
@@ -0,0 +1,10 @@
|
|
1
|
+
module BootstrapPagedown
|
2
|
+
module FormBuilder
|
3
|
+
def pagedown_editor( method, options={})
|
4
|
+
@template.content_tag( :div, class: 'wmd-panel' ) do
|
5
|
+
@template.content_tag( :div, nil, id: 'wmd-button-bar' ) +
|
6
|
+
@template.text_area( @object_name, method, objectify_options( options ).merge( id: 'wmd-input', class: 'wmd-input' ) )
|
7
|
+
end
|
8
|
+
end
|
9
|
+
end
|
10
|
+
end
|
metadata
ADDED
@@ -0,0 +1,65 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: bootstrap_pagedown
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 1.0.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Enrique Vidal
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2013-09-15 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: rails
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - '>='
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '3.2'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - '>='
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '3.2'
|
27
|
+
description: It's Bootstrap Pagedown for the Rails asset pipeline.
|
28
|
+
email:
|
29
|
+
- enrique@cloverinteractive.com
|
30
|
+
executables: []
|
31
|
+
extensions: []
|
32
|
+
extra_rdoc_files: []
|
33
|
+
files:
|
34
|
+
- lib/bootstrap_pagedown/engine.rb
|
35
|
+
- lib/bootstrap_pagedown/form_builder.rb
|
36
|
+
- lib/bootstrap_pagedown/version.rb
|
37
|
+
- lib/bootstrap_pagedown.rb
|
38
|
+
- lib/tasks/bootstrap_pagedown_tasks.rake
|
39
|
+
- MIT-LICENSE
|
40
|
+
- Rakefile
|
41
|
+
- README.md
|
42
|
+
homepage: https://github.com/cloverinteractive/bootstrap_pagedown
|
43
|
+
licenses: []
|
44
|
+
metadata: {}
|
45
|
+
post_install_message:
|
46
|
+
rdoc_options: []
|
47
|
+
require_paths:
|
48
|
+
- lib
|
49
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
50
|
+
requirements:
|
51
|
+
- - '>='
|
52
|
+
- !ruby/object:Gem::Version
|
53
|
+
version: 1.9.3
|
54
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
55
|
+
requirements:
|
56
|
+
- - '>='
|
57
|
+
- !ruby/object:Gem::Version
|
58
|
+
version: '0'
|
59
|
+
requirements: []
|
60
|
+
rubyforge_project:
|
61
|
+
rubygems_version: 2.0.2
|
62
|
+
signing_key:
|
63
|
+
specification_version: 4
|
64
|
+
summary: Bootstrap Pagedown for Rails.
|
65
|
+
test_files: []
|