wysia 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +8 -0
- data/lib/wysia/version.rb +1 -1
- data/lib/wysia/wysia_form_helper.rb +1 -1
- data/vendor/assets/javascripts/wysia.js +3 -2
- data/vendor/assets/javascripts/wysiwyg/simple.js +32 -0
- data/vendor/assets/javascripts/wysiwyg/wysihtml5-0.3.0.js +380 -380
- data/vendor/assets/stylesheets/wysiwyg/stylesheet.css.scss +8 -11
- metadata +5 -4
data/README.md
CHANGED
@@ -12,9 +12,17 @@ This Gem uses
|
|
12
12
|
## Installation
|
13
13
|
|
14
14
|
In your `Gemfile`, add the following dependencies:
|
15
|
+
|
16
|
+
From rubygems
|
17
|
+
```ruby
|
18
|
+
gem 'wysia'
|
19
|
+
```
|
20
|
+
|
21
|
+
Or use the last version
|
15
22
|
```ruby
|
16
23
|
gem 'wysia', :git => 'https://github.com/jhny/wysia.git'
|
17
24
|
```
|
25
|
+
|
18
26
|
Run:
|
19
27
|
```unix
|
20
28
|
$ bundle install
|
data/lib/wysia/version.rb
CHANGED
@@ -50,7 +50,7 @@ HTML
|
|
50
50
|
var editor = new wysihtml5.Editor("#{text_area_id}", { // id of textarea element
|
51
51
|
toolbar:"#{text_area_id}_wysihtml5-toolbar", // id of toolbar element
|
52
52
|
stylesheets:"/assets/wysiwyg/stylesheet.css", // stylesheet to be used
|
53
|
-
parserRules:wysihtml5ParserRules // defined in parser rules set
|
53
|
+
parserRules: wysihtml5ParserRules // defined in parser rules set
|
54
54
|
});
|
55
55
|
javascript
|
56
56
|
|
@@ -1,2 +1,3 @@
|
|
1
|
-
//= require wysiwyg/
|
2
|
-
//= require wysiwyg/
|
1
|
+
//= require wysiwyg/advanced.js
|
2
|
+
//= require wysiwyg/simple.js
|
3
|
+
//= require wysiwyg/wysihtml5-0.3.0.js
|
@@ -0,0 +1,32 @@
|
|
1
|
+
/**
|
2
|
+
* Very simple basic rule set
|
3
|
+
*
|
4
|
+
* Allows
|
5
|
+
* <i>, <em>, <b>, <strong>, <p>, <div>, <a href="http://foo"></a>, <br>, <span>, <ol>, <ul>, <li>
|
6
|
+
*
|
7
|
+
* For a proper documentation of the format check advanced.js
|
8
|
+
*/
|
9
|
+
var wysihtml5ParserRules = {
|
10
|
+
tags: {
|
11
|
+
strong: {},
|
12
|
+
b: {},
|
13
|
+
i: {},
|
14
|
+
em: {},
|
15
|
+
br: {},
|
16
|
+
p: {},
|
17
|
+
div: {},
|
18
|
+
span: {},
|
19
|
+
ul: {},
|
20
|
+
ol: {},
|
21
|
+
li: {},
|
22
|
+
a: {
|
23
|
+
set_attributes: {
|
24
|
+
target: "_blank",
|
25
|
+
rel: "nofollow"
|
26
|
+
},
|
27
|
+
check_attributes: {
|
28
|
+
href: "url" // important to avoid XSS
|
29
|
+
}
|
30
|
+
}
|
31
|
+
}
|
32
|
+
};
|