wysia 0.0.3 → 0.0.4

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/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
@@ -1,3 +1,3 @@
1
1
  module Wysia
2
- VERSION = "0.0.3"
2
+ VERSION = "0.0.4"
3
3
  end
@@ -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/wysihtml5-0.3.0.js
2
- //= require wysiwyg/advanced.js
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
+ };