bootstrap-wysihtml5-rails 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.
@@ -1,5 +1,5 @@
1
1
  module BootstrapWysihtml5Rails
2
2
  module Rails
3
- VERSION = "0.2.1"
3
+ VERSION = "0.2.2"
4
4
  end
5
5
  end
@@ -32,11 +32,34 @@
32
32
  "lists": true
33
33
  };
34
34
 
35
+ var parserRules = {
36
+ tags: {
37
+ b: {},
38
+ i: {},
39
+ br: {},
40
+ ol: {},
41
+ ul: {},
42
+ li: {},
43
+ h1: {},
44
+ h2: {},
45
+ a: {
46
+ set_attributes: {
47
+ target: "_blank",
48
+ rel: "nofollow"
49
+ },
50
+ check_attributes: {
51
+ href: "url" // important to avoid XSS
52
+ }
53
+ }
54
+ }
55
+ };
56
+
35
57
  var Wysihtml5 = function(el, options) {
36
58
  this.el = el;
37
59
  this.toolbar = this.createToolbar(el, options || defaultOptions);
38
60
  this.editor = new wysi.Editor(this.el.attr('id'), {
39
- toolbar: this.toolbar.attr('id')
61
+ toolbar: this.toolbar.attr('id'),
62
+ parserRules: parserRules
40
63
  });
41
64
 
42
65
  $('iframe.wysihtml5-sandbox').each(function(i, el){
@@ -56,7 +79,7 @@
56
79
  id : el.attr('id') + "-wysihtml5-toolbar",
57
80
  class : "wysihtml5-toolbar",
58
81
  style: "display:none"
59
- }).button();
82
+ });
60
83
 
61
84
  for(var key in defaultOptions) {
62
85
  var value;
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bootstrap-wysihtml5-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.2.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-03-25 00:00:00.000000000 Z
12
+ date: 2012-03-27 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: railties
@@ -94,7 +94,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
94
94
  version: '0'
95
95
  segments:
96
96
  - 0
97
- hash: -4611577056005445715
97
+ hash: 1657227061358575490
98
98
  required_rubygems_version: !ruby/object:Gem::Requirement
99
99
  none: false
100
100
  requirements:
@@ -103,7 +103,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
103
103
  version: '0'
104
104
  segments:
105
105
  - 0
106
- hash: -4611577056005445715
106
+ hash: 1657227061358575490
107
107
  requirements: []
108
108
  rubyforge_project:
109
109
  rubygems_version: 1.8.19