brightcontent-pages 2.0.30 → 2.0.31

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 ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 60a6dd6e95abe9ba95a5fe2ee21a9929c2c20854
4
+ data.tar.gz: 4dc302f9c2b496a7767d1144de60094d89830205
5
+ SHA512:
6
+ metadata.gz: 087e2ca4383266d73bf13d932d2e3664c016b82f61d669654fdfbd64f2f28bd0b24944a85d046a2158c3da2ba95685032319b6e279d53b9ea164a89becfa88b2
7
+ data.tar.gz: b39602268eb9c05550d21c9b3569ab5659d39ea8938f8e872a3b203c2ab2a58aa5e7ecb2289db8377418680a317cc0b32a120cadcddf7da1ca89e2ca945bec9a
data/.gitignore CHANGED
@@ -8,3 +8,4 @@ spec/dummy/log/*.log
8
8
  spec/dummy/tmp/
9
9
  spec/dummy/.sass-cache
10
10
  vendor/bundle
11
+ /bin
data/Gemfile.lock CHANGED
@@ -1,30 +1,30 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- brightcontent-pages (2.0.30)
4
+ brightcontent-pages (2.0.31)
5
5
  awesome_nested_set
6
- brightcontent-attachments (= 2.0.30)
7
- brightcontent-core (= 2.0.30)
6
+ brightcontent-attachments (= 2.0.31)
7
+ brightcontent-core (= 2.0.31)
8
8
  the_sortable_tree (~> 2.3.0)
9
9
 
10
10
  PATH
11
11
  remote: ../attachments
12
12
  specs:
13
- brightcontent-attachments (2.0.30)
14
- brightcontent-core (= 2.0.30)
13
+ brightcontent-attachments (2.0.31)
14
+ brightcontent-core (= 2.0.31)
15
15
  jquery-fileupload-rails
16
16
  paperclip
17
17
 
18
18
  PATH
19
19
  remote: ../core
20
20
  specs:
21
- brightcontent-core (2.0.30)
22
- bcrypt-ruby
21
+ brightcontent-core (2.0.31)
22
+ bcrypt-ruby (= 3.0.0)
23
23
  bootstrap-wysihtml5-rails
24
24
  has_scope
25
25
  inherited_resources
26
26
  jquery-rails
27
- rails (~> 3.2.9)
27
+ rails (~> 3.2.13)
28
28
  simple_form
29
29
  strong_parameters
30
30
  will_paginate
@@ -59,61 +59,57 @@ GEM
59
59
  activesupport (3.2.13)
60
60
  i18n (= 0.6.1)
61
61
  multi_json (~> 1.0)
62
- addressable (2.3.3)
62
+ addressable (2.3.5)
63
63
  arel (3.0.2)
64
64
  awesome_nested_set (2.1.6)
65
65
  activerecord (>= 3.0.0)
66
- bcrypt-ruby (3.0.1)
67
- bootstrap-wysihtml5-rails (0.3.1.19)
66
+ bcrypt-ruby (3.0.0)
67
+ bootstrap-wysihtml5-rails (0.3.1.20)
68
68
  railties (>= 3.0)
69
69
  builder (3.0.4)
70
- capybara (2.0.2)
70
+ capybara (2.1.0)
71
71
  mime-types (>= 1.16)
72
72
  nokogiri (>= 1.3.3)
73
73
  rack (>= 1.0.0)
74
74
  rack-test (>= 0.5.4)
75
- selenium-webdriver (~> 2.0)
76
- xpath (~> 1.0.0)
77
- childprocess (0.3.9)
78
- ffi (~> 1.0, >= 1.0.11)
75
+ xpath (~> 2.0)
79
76
  climate_control (0.0.3)
80
77
  activesupport (>= 3.0)
81
78
  cocaine (0.5.1)
82
79
  climate_control (>= 0.0.3, < 1.0)
83
- diff-lcs (1.2.1)
80
+ diff-lcs (1.2.4)
84
81
  erubis (2.7.0)
85
82
  factory_girl (4.2.0)
86
83
  activesupport (>= 3.0.0)
87
84
  factory_girl_rails (4.2.1)
88
85
  factory_girl (~> 4.2.0)
89
86
  railties (>= 3.0.0)
90
- ffi (1.5.0)
91
87
  has_scope (0.5.1)
92
- hike (1.2.1)
88
+ hike (1.2.3)
93
89
  i18n (0.6.1)
94
- inherited_resources (1.3.1)
90
+ inherited_resources (1.4.0)
95
91
  has_scope (~> 0.5.0)
96
- responders (~> 0.6)
92
+ responders (~> 0.9)
97
93
  journey (1.0.4)
98
94
  jquery-fileupload-rails (0.4.1)
99
95
  actionpack (>= 3.1)
100
96
  railties (>= 3.1)
101
- jquery-rails (2.2.1)
97
+ jquery-rails (3.0.4)
102
98
  railties (>= 3.0, < 5.0)
103
99
  thor (>= 0.14, < 2.0)
104
- json (1.7.7)
105
- launchy (2.2.0)
100
+ json (1.8.0)
101
+ launchy (2.3.0)
106
102
  addressable (~> 2.3)
107
- mail (2.5.3)
108
- i18n (>= 0.4.0)
103
+ mail (2.5.4)
109
104
  mime-types (~> 1.16)
110
105
  treetop (~> 1.4.8)
111
- mime-types (1.21)
112
- multi_json (1.7.2)
113
- nokogiri (1.5.9)
114
- paperclip (3.4.1)
106
+ mime-types (1.23)
107
+ mini_portile (0.5.1)
108
+ multi_json (1.7.7)
109
+ nokogiri (1.6.0)
110
+ mini_portile (~> 0.5.0)
111
+ paperclip (3.5.0)
115
112
  activemodel (>= 3.0.0)
116
- activerecord (>= 3.0.0)
117
113
  activesupport (>= 3.0.0)
118
114
  cocaine (~> 0.5.0)
119
115
  mime-types
@@ -140,28 +136,22 @@ GEM
140
136
  rake (>= 0.8.7)
141
137
  rdoc (~> 3.4)
142
138
  thor (>= 0.14.6, < 2.0)
143
- rake (10.0.3)
139
+ rake (10.1.0)
144
140
  rdoc (3.12.2)
145
141
  json (~> 1.4)
146
142
  responders (0.9.3)
147
143
  railties (~> 3.1)
148
- rspec-core (2.13.1)
149
- rspec-expectations (2.13.0)
144
+ rspec-core (2.14.3)
145
+ rspec-expectations (2.14.0)
150
146
  diff-lcs (>= 1.1.3, < 2.0)
151
- rspec-mocks (2.13.0)
152
- rspec-rails (2.13.0)
147
+ rspec-mocks (2.14.1)
148
+ rspec-rails (2.14.0)
153
149
  actionpack (>= 3.0)
154
150
  activesupport (>= 3.0)
155
151
  railties (>= 3.0)
156
- rspec-core (~> 2.13.0)
157
- rspec-expectations (~> 2.13.0)
158
- rspec-mocks (~> 2.13.0)
159
- rubyzip (0.9.9)
160
- selenium-webdriver (2.31.0)
161
- childprocess (>= 0.2.5)
162
- multi_json (~> 1.0)
163
- rubyzip
164
- websocket (~> 1.0.4)
152
+ rspec-core (~> 2.14.0)
153
+ rspec-expectations (~> 2.14.0)
154
+ rspec-mocks (~> 2.14.0)
165
155
  simple_form (2.1.0)
166
156
  actionpack (~> 3.0)
167
157
  activemodel (~> 3.0)
@@ -171,21 +161,20 @@ GEM
171
161
  rack (~> 1.0)
172
162
  tilt (~> 1.1, != 1.3.0)
173
163
  sqlite3 (1.3.7)
174
- strong_parameters (0.2.0)
164
+ strong_parameters (0.2.1)
175
165
  actionpack (~> 3.0)
176
166
  activemodel (~> 3.0)
177
167
  railties (~> 3.0)
178
- the_sortable_tree (2.3.0)
168
+ the_sortable_tree (2.3.3)
179
169
  rails (>= 3.1)
180
- thor (0.17.0)
181
- tilt (1.3.6)
182
- treetop (1.4.12)
170
+ thor (0.18.1)
171
+ tilt (1.4.1)
172
+ treetop (1.4.14)
183
173
  polyglot
184
174
  polyglot (>= 0.3.1)
185
175
  tzinfo (0.3.37)
186
- websocket (1.0.7)
187
176
  will_paginate (3.0.4)
188
- xpath (1.0.0)
177
+ xpath (2.0.0)
189
178
  nokogiri (~> 1.3)
190
179
 
191
180
  PLATFORMS
@@ -2,4 +2,5 @@
2
2
  //= require jquery_ujs
3
3
  //= require jquery.ui.nestedSortable
4
4
  //= require sortable_tree/initializer
5
+ //= require wysithtml5-parser-rules
5
6
 
@@ -0,0 +1,553 @@
1
+ /**
2
+ * Full HTML5 compatibility rule set
3
+ * These rules define which tags and CSS classes are supported and which tags should be specially treated.
4
+ *
5
+ * Examples based on this rule set:
6
+ *
7
+ * <a href="http://foobar.com">foo</a>
8
+ * ... becomes ...
9
+ * <a href="http://foobar.com" target="_blank" rel="nofollow">foo</a>
10
+ *
11
+ * <img align="left" src="http://foobar.com/image.png">
12
+ * ... becomes ...
13
+ * <img class="wysiwyg-float-left" src="http://foobar.com/image.png" alt="">
14
+ *
15
+ * <div>foo<script>alert(document.cookie)</script></div>
16
+ * ... becomes ...
17
+ * <div>foo</div>
18
+ *
19
+ * <marquee>foo</marquee>
20
+ * ... becomes ...
21
+ * <span>foo</span>
22
+ *
23
+ * foo <br clear="both"> bar
24
+ * ... becomes ...
25
+ * foo <br class="wysiwyg-clear-both"> bar
26
+ *
27
+ * <div>hello <iframe src="http://google.com"></iframe></div>
28
+ * ... becomes ...
29
+ * <div>hello </div>
30
+ *
31
+ * <center>hello</center>
32
+ * ... becomes ...
33
+ * <div class="wysiwyg-text-align-center">hello</div>
34
+ */
35
+ var wysihtml5ParserRules = {
36
+ /**
37
+ * CSS Class white-list
38
+ * Following CSS classes won't be removed when parsed by the wysihtml5 HTML parser
39
+ */
40
+ "classes": {
41
+ "wysiwyg-clear-both": 1,
42
+ "wysiwyg-clear-left": 1,
43
+ "wysiwyg-clear-right": 1,
44
+ "wysiwyg-color-aqua": 1,
45
+ "wysiwyg-color-black": 1,
46
+ "wysiwyg-color-blue": 1,
47
+ "wysiwyg-color-fuchsia": 1,
48
+ "wysiwyg-color-gray": 1,
49
+ "wysiwyg-color-green": 1,
50
+ "wysiwyg-color-lime": 1,
51
+ "wysiwyg-color-maroon": 1,
52
+ "wysiwyg-color-navy": 1,
53
+ "wysiwyg-color-olive": 1,
54
+ "wysiwyg-color-purple": 1,
55
+ "wysiwyg-color-red": 1,
56
+ "wysiwyg-color-silver": 1,
57
+ "wysiwyg-color-teal": 1,
58
+ "wysiwyg-color-white": 1,
59
+ "wysiwyg-color-yellow": 1,
60
+ "wysiwyg-float-left": 1,
61
+ "wysiwyg-float-right": 1,
62
+ "wysiwyg-font-size-large": 1,
63
+ "wysiwyg-font-size-larger": 1,
64
+ "wysiwyg-font-size-medium": 1,
65
+ "wysiwyg-font-size-small": 1,
66
+ "wysiwyg-font-size-smaller": 1,
67
+ "wysiwyg-font-size-x-large": 1,
68
+ "wysiwyg-font-size-x-small": 1,
69
+ "wysiwyg-font-size-xx-large": 1,
70
+ "wysiwyg-font-size-xx-small": 1,
71
+ "wysiwyg-text-align-center": 1,
72
+ "wysiwyg-text-align-justify": 1,
73
+ "wysiwyg-text-align-left": 1,
74
+ "wysiwyg-text-align-right": 1
75
+ },
76
+ /**
77
+ * Tag list
78
+ *
79
+ * The following options are available:
80
+ *
81
+ * - add_class: converts and deletes the given HTML4 attribute (align, clear, ...) via the given method to a css class
82
+ * The following methods are implemented in wysihtml5.dom.parse:
83
+ * - align_text: converts align attribute values (right/left/center/justify) to their corresponding css class "wysiwyg-text-align-*")
84
+ * <p align="center">foo</p> ... becomes ... <p> class="wysiwyg-text-align-center">foo</p>
85
+ * - clear_br: converts clear attribute values left/right/all/both to their corresponding css class "wysiwyg-clear-*"
86
+ * <br clear="all"> ... becomes ... <br class="wysiwyg-clear-both">
87
+ * - align_img: converts align attribute values (right/left) on <img> to their corresponding css class "wysiwyg-float-*"
88
+ *
89
+ * - remove: removes the element and its content
90
+ *
91
+ * - rename_tag: renames the element to the given tag
92
+ *
93
+ * - set_class: adds the given class to the element (note: make sure that the class is in the "classes" white list above)
94
+ *
95
+ * - set_attributes: sets/overrides the given attributes
96
+ *
97
+ * - check_attributes: checks the given HTML attribute via the given method
98
+ * - url: allows only valid urls (starting with http:// or https://)
99
+ * - src: allows something like "/foobar.jpg", "http://google.com", ...
100
+ * - href: allows something like "mailto:bert@foo.com", "http://google.com", "/foobar.jpg"
101
+ * - alt: strips unwanted characters. if the attribute is not set, then it gets set (to ensure valid and compatible HTML)
102
+ * - numbers: ensures that the attribute only contains numeric characters
103
+ */
104
+ "tags": {
105
+ "tr": {
106
+ "add_class": {
107
+ "align": "align_text"
108
+ }
109
+ },
110
+ "strike": {
111
+ "remove": 1
112
+ },
113
+ "form": {
114
+ "rename_tag": "div"
115
+ },
116
+ "rt": {
117
+ "rename_tag": "span"
118
+ },
119
+ "code": {},
120
+ "acronym": {
121
+ "rename_tag": "span"
122
+ },
123
+ "br": {
124
+ "add_class": {
125
+ "clear": "clear_br"
126
+ }
127
+ },
128
+ "details": {
129
+ "rename_tag": "div"
130
+ },
131
+ "h4": {
132
+ "add_class": {
133
+ "align": "align_text"
134
+ }
135
+ },
136
+ "em": {},
137
+ "title": {
138
+ "remove": 1
139
+ },
140
+ "multicol": {
141
+ "rename_tag": "div"
142
+ },
143
+ "figure": {
144
+ "rename_tag": "div"
145
+ },
146
+ "xmp": {
147
+ "rename_tag": "span"
148
+ },
149
+ "small": {
150
+ "rename_tag": "span",
151
+ "set_class": "wysiwyg-font-size-smaller"
152
+ },
153
+ "area": {
154
+ "remove": 1
155
+ },
156
+ "time": {
157
+ "rename_tag": "span"
158
+ },
159
+ "dir": {
160
+ "rename_tag": "ul"
161
+ },
162
+ "bdi": {
163
+ "rename_tag": "span"
164
+ },
165
+ "command": {
166
+ "remove": 1
167
+ },
168
+ "ul": {},
169
+ "progress": {
170
+ "rename_tag": "span"
171
+ },
172
+ "dfn": {
173
+ "rename_tag": "span"
174
+ },
175
+ "iframe": {
176
+ "remove": 1
177
+ },
178
+ "figcaption": {
179
+ "rename_tag": "div"
180
+ },
181
+ "a": {
182
+ "check_attributes": {
183
+ "href": "url" // if you compiled master manually then change this from 'url' to 'href'
184
+ },
185
+ "set_attributes": {
186
+ "rel": "nofollow",
187
+ "target": "_blank"
188
+ }
189
+ },
190
+ "img": {
191
+ "check_attributes": {
192
+ "width": "numbers",
193
+ "alt": "alt",
194
+ "src": "url", // if you compiled master manually then change this from 'url' to 'src'
195
+ "height": "numbers"
196
+ },
197
+ "add_class": {
198
+ "align": "align_img"
199
+ }
200
+ },
201
+ "rb": {
202
+ "rename_tag": "span"
203
+ },
204
+ "footer": {
205
+ "rename_tag": "div"
206
+ },
207
+ "noframes": {
208
+ "remove": 1
209
+ },
210
+ "abbr": {
211
+ "rename_tag": "span"
212
+ },
213
+ "u": {},
214
+ "bgsound": {
215
+ "remove": 1
216
+ },
217
+ "sup": {
218
+ "rename_tag": "span"
219
+ },
220
+ "address": {
221
+ "rename_tag": "div"
222
+ },
223
+ "basefont": {
224
+ "remove": 1
225
+ },
226
+ "nav": {
227
+ "rename_tag": "div"
228
+ },
229
+ "h1": {
230
+ "add_class": {
231
+ "align": "align_text"
232
+ }
233
+ },
234
+ "head": {
235
+ "remove": 1
236
+ },
237
+ "tbody": {
238
+ "add_class": {
239
+ "align": "align_text"
240
+ }
241
+ },
242
+ "dd": {
243
+ "rename_tag": "div"
244
+ },
245
+ "s": {
246
+ "rename_tag": "span"
247
+ },
248
+ "li": {},
249
+ "td": {
250
+ "check_attributes": {
251
+ "rowspan": "numbers",
252
+ "colspan": "numbers"
253
+ },
254
+ "add_class": {
255
+ "align": "align_text"
256
+ }
257
+ },
258
+ "object": {
259
+ "remove": 1
260
+ },
261
+ "div": {
262
+ "add_class": {
263
+ "align": "align_text"
264
+ }
265
+ },
266
+ "option": {
267
+ "rename_tag": "span"
268
+ },
269
+ "select": {
270
+ "rename_tag": "span"
271
+ },
272
+ "i": {},
273
+ "track": {
274
+ "remove": 1
275
+ },
276
+ "wbr": {
277
+ "remove": 1
278
+ },
279
+ "fieldset": {
280
+ "rename_tag": "div"
281
+ },
282
+ "big": {
283
+ "rename_tag": "span",
284
+ "set_class": "wysiwyg-font-size-larger"
285
+ },
286
+ "button": {
287
+ "rename_tag": "span"
288
+ },
289
+ "noscript": {
290
+ "remove": 1
291
+ },
292
+ "svg": {
293
+ "remove": 1
294
+ },
295
+ "input": {
296
+ "remove": 1
297
+ },
298
+ "table": {},
299
+ "keygen": {
300
+ "remove": 1
301
+ },
302
+ "h5": {
303
+ "add_class": {
304
+ "align": "align_text"
305
+ }
306
+ },
307
+ "meta": {
308
+ "remove": 1
309
+ },
310
+ "map": {
311
+ "rename_tag": "div"
312
+ },
313
+ "isindex": {
314
+ "remove": 1
315
+ },
316
+ "mark": {
317
+ "rename_tag": "span"
318
+ },
319
+ "caption": {
320
+ "add_class": {
321
+ "align": "align_text"
322
+ }
323
+ },
324
+ "tfoot": {
325
+ "add_class": {
326
+ "align": "align_text"
327
+ }
328
+ },
329
+ "base": {
330
+ "remove": 1
331
+ },
332
+ "video": {
333
+ "remove": 1
334
+ },
335
+ "strong": {},
336
+ "canvas": {
337
+ "remove": 1
338
+ },
339
+ "output": {
340
+ "rename_tag": "span"
341
+ },
342
+ "marquee": {
343
+ "rename_tag": "span"
344
+ },
345
+ "b": {},
346
+ "q": {
347
+ "check_attributes": {
348
+ "cite": "url"
349
+ }
350
+ },
351
+ "applet": {
352
+ "remove": 1
353
+ },
354
+ "span": {},
355
+ "rp": {
356
+ "rename_tag": "span"
357
+ },
358
+ "spacer": {
359
+ "remove": 1
360
+ },
361
+ "source": {
362
+ "remove": 1
363
+ },
364
+ "aside": {
365
+ "rename_tag": "div"
366
+ },
367
+ "frame": {
368
+ "remove": 1
369
+ },
370
+ "section": {
371
+ "rename_tag": "div"
372
+ },
373
+ "body": {
374
+ "rename_tag": "div"
375
+ },
376
+ "ol": {},
377
+ "nobr": {
378
+ "rename_tag": "span"
379
+ },
380
+ "html": {
381
+ "rename_tag": "div"
382
+ },
383
+ "summary": {
384
+ "rename_tag": "span"
385
+ },
386
+ "var": {
387
+ "rename_tag": "span"
388
+ },
389
+ "del": {
390
+ "remove": 1
391
+ },
392
+ "blockquote": {
393
+ "check_attributes": {
394
+ "cite": "url"
395
+ }
396
+ },
397
+ "style": {
398
+ "remove": 1
399
+ },
400
+ "device": {
401
+ "remove": 1
402
+ },
403
+ "meter": {
404
+ "rename_tag": "span"
405
+ },
406
+ "h3": {
407
+ "add_class": {
408
+ "align": "align_text"
409
+ }
410
+ },
411
+ "textarea": {
412
+ "rename_tag": "span"
413
+ },
414
+ "embed": {
415
+ "remove": 1
416
+ },
417
+ "hgroup": {
418
+ "rename_tag": "div"
419
+ },
420
+ "font": {
421
+ "rename_tag": "span",
422
+ "add_class": {
423
+ "size": "size_font"
424
+ }
425
+ },
426
+ "tt": {
427
+ "rename_tag": "span"
428
+ },
429
+ "noembed": {
430
+ "remove": 1
431
+ },
432
+ "thead": {
433
+ "add_class": {
434
+ "align": "align_text"
435
+ }
436
+ },
437
+ "blink": {
438
+ "rename_tag": "span"
439
+ },
440
+ "plaintext": {
441
+ "rename_tag": "span"
442
+ },
443
+ "xml": {
444
+ "remove": 1
445
+ },
446
+ "h6": {
447
+ "add_class": {
448
+ "align": "align_text"
449
+ }
450
+ },
451
+ "param": {
452
+ "remove": 1
453
+ },
454
+ "th": {
455
+ "check_attributes": {
456
+ "rowspan": "numbers",
457
+ "colspan": "numbers"
458
+ },
459
+ "add_class": {
460
+ "align": "align_text"
461
+ }
462
+ },
463
+ "legend": {
464
+ "rename_tag": "span"
465
+ },
466
+ "hr": {},
467
+ "label": {
468
+ "rename_tag": "span"
469
+ },
470
+ "dl": {
471
+ "rename_tag": "div"
472
+ },
473
+ "kbd": {
474
+ "rename_tag": "span"
475
+ },
476
+ "listing": {
477
+ "rename_tag": "div"
478
+ },
479
+ "dt": {
480
+ "rename_tag": "span"
481
+ },
482
+ "nextid": {
483
+ "remove": 1
484
+ },
485
+ "pre": {},
486
+ "center": {
487
+ "rename_tag": "div",
488
+ "set_class": "wysiwyg-text-align-center"
489
+ },
490
+ "audio": {
491
+ "remove": 1
492
+ },
493
+ "datalist": {
494
+ "rename_tag": "span"
495
+ },
496
+ "samp": {
497
+ "rename_tag": "span"
498
+ },
499
+ "col": {
500
+ "remove": 1
501
+ },
502
+ "article": {
503
+ "rename_tag": "div"
504
+ },
505
+ "cite": {},
506
+ "link": {
507
+ "remove": 1
508
+ },
509
+ "script": {
510
+ "remove": 1
511
+ },
512
+ "bdo": {
513
+ "rename_tag": "span"
514
+ },
515
+ "menu": {
516
+ "rename_tag": "ul"
517
+ },
518
+ "colgroup": {
519
+ "remove": 1
520
+ },
521
+ "ruby": {
522
+ "rename_tag": "span"
523
+ },
524
+ "h2": {
525
+ "add_class": {
526
+ "align": "align_text"
527
+ }
528
+ },
529
+ "ins": {
530
+ "rename_tag": "span"
531
+ },
532
+ "p": {
533
+ "add_class": {
534
+ "align": "align_text"
535
+ }
536
+ },
537
+ "sub": {
538
+ "rename_tag": "span"
539
+ },
540
+ "comment": {
541
+ "remove": 1
542
+ },
543
+ "frameset": {
544
+ "remove": 1
545
+ },
546
+ "optgroup": {
547
+ "rename_tag": "span"
548
+ },
549
+ "header": {
550
+ "rename_tag": "div"
551
+ }
552
+ }
553
+ };
@@ -18,7 +18,7 @@
18
18
  list-style: none outside none;
19
19
  }
20
20
 
21
- a{
21
+ .link{
22
22
  font-weight:normal;
23
23
  text-decoration:none;
24
24
  margin-left:30px;
@@ -47,13 +47,13 @@
47
47
  background: #fff;
48
48
  border: 1px solid #ddd;
49
49
  margin-bottom: -1px;
50
- a { font-weight: bold; }
50
+ .link { font-weight: bold; }
51
51
  &:hover{ background: #ffc; }
52
52
  }
53
53
 
54
54
  .nested_set .item {
55
55
  background: #f7f7f7;
56
- a { font-weight: normal; color: #333; }
56
+ .link { font-weight: normal; color: #333; }
57
57
  &:hover{ background: #ffc; }
58
58
  }
59
59
 
@@ -71,4 +71,15 @@
71
71
  color: #8a1f11;
72
72
  }
73
73
 
74
+ .controls {
75
+ display: none;
76
+ position: absolute;
77
+ right: 13px;
78
+ top: 11px;
79
+ }
80
+
81
+ .item:hover .controls {
82
+ display: block;
83
+ }
84
+
74
85
  }
@@ -21,6 +21,7 @@ module RenderSortableTreeHelper
21
21
  <div class='item #{"page-hidden" if node.hidden? }'>
22
22
  <i class='handle'></i>
23
23
  #{show_link}
24
+ #{controls}
24
25
  </div>
25
26
  #{children}
26
27
  </li>
@@ -33,7 +34,21 @@ module RenderSortableTreeHelper
33
34
  url = h.url_for(ns + [node])
34
35
  title_field = options[:title]
35
36
 
36
- h.link_to(node.send(title_field), url)
37
+ h.link_to(node.send(title_field), url, class: 'link')
38
+ end
39
+
40
+ def controls
41
+ node = options[:node]
42
+
43
+ edit_path = h.url_for(:controller => options[:klass].pluralize, :action => :edit, :id => node)
44
+ show_path = h.url_for(:controller => options[:klass].pluralize, :action => :show, :id => node)
45
+
46
+ "
47
+ <div class='controls'>
48
+ #{ h.link_to 'Edit', edit_path, :class => 'btn btn-mini btn-primary btn-edit' }
49
+ #{ h.link_to 'Delete', show_path, :class => 'btn btn-mini btn-delete', :method => :delete, :data => { :confirm => 'Are you sure?' } }
50
+ </div>
51
+ "
37
52
  end
38
53
 
39
54
  def children
@@ -4,6 +4,7 @@ module Brightcontent
4
4
 
5
5
  included do
6
6
  acts_as_nested_set
7
+ has_attached_files Brightcontent.page_attachment_styles
7
8
  include Brightcontent::Attachable
8
9
  include TheSortableTree::Scopes
9
10
  validates_presence_of :name
@@ -25,10 +26,6 @@ module Brightcontent
25
26
  "/" + slug
26
27
  end
27
28
 
28
- def attachment_styles
29
- Brightcontent.page_attachment_styles
30
- end
31
-
32
29
  def root_parent_children
33
30
  root? ? children : ancestors.first.children
34
31
  end
@@ -1,9 +1,9 @@
1
1
  <div id="overview">
2
-
3
- <%= link_to "Create new #{resource_instance_name.to_s.humanize}", polymorphic_url(resource_class, action: :new), class: "btn btn-primary btn-right" %>
2
+
3
+ <%= link_to "Create new #{resource_instance_name.to_s.humanize}", polymorphic_url([parent, resource_class], action: :new), class: "btn btn-primary btn-right" %>
4
4
  <h1><%= resource_collection_name.to_s.humanize %></h1>
5
5
  <%= render "index_top" %>
6
-
6
+
7
7
  <%= content_tag("ol", class:"sortable_tree", :"data-rebuild_url" => rebuild_pages_url, :"data-max_levels" => 5 ) do -%>
8
8
  <%= sortable_tree @pages, title:"name" -%>
9
9
  <% end -%>
@@ -9,13 +9,13 @@ feature "Pages index" do
9
9
 
10
10
  scenario "click on edit page" do
11
11
  click_link "Pages"
12
- page.find(:css, '.controls .edit').click
13
- page.should have_content "Edit page"
12
+ page.find(:css, '.controls .btn-edit').click
13
+ page.should have_content "Edit Page"
14
14
  end
15
15
 
16
16
  scenario "click on delete page" do
17
17
  click_link "Pages"
18
- page.find(:css, '.controls .delete').click
18
+ page.find(:css, '.controls .btn-delete').click
19
19
  page.should_not have_content "Test page"
20
20
  page.should have_content "successfully"
21
21
  end
metadata CHANGED
@@ -1,68 +1,60 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: brightcontent-pages
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.30
5
- prerelease:
4
+ version: 2.0.31
6
5
  platform: ruby
7
6
  authors:
8
7
  - Developers at Brightin
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2013-03-27 00:00:00.000000000 Z
11
+ date: 2013-07-20 00:00:00.000000000 Z
13
12
  dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
14
  name: brightcontent-core
16
15
  requirement: !ruby/object:Gem::Requirement
17
- none: false
18
16
  requirements:
19
17
  - - '='
20
18
  - !ruby/object:Gem::Version
21
- version: 2.0.30
19
+ version: 2.0.31
22
20
  type: :runtime
23
21
  prerelease: false
24
22
  version_requirements: !ruby/object:Gem::Requirement
25
- none: false
26
23
  requirements:
27
24
  - - '='
28
25
  - !ruby/object:Gem::Version
29
- version: 2.0.30
26
+ version: 2.0.31
30
27
  - !ruby/object:Gem::Dependency
31
28
  name: brightcontent-attachments
32
29
  requirement: !ruby/object:Gem::Requirement
33
- none: false
34
30
  requirements:
35
31
  - - '='
36
32
  - !ruby/object:Gem::Version
37
- version: 2.0.30
33
+ version: 2.0.31
38
34
  type: :runtime
39
35
  prerelease: false
40
36
  version_requirements: !ruby/object:Gem::Requirement
41
- none: false
42
37
  requirements:
43
38
  - - '='
44
39
  - !ruby/object:Gem::Version
45
- version: 2.0.30
40
+ version: 2.0.31
46
41
  - !ruby/object:Gem::Dependency
47
42
  name: awesome_nested_set
48
43
  requirement: !ruby/object:Gem::Requirement
49
- none: false
50
44
  requirements:
51
- - - ! '>='
45
+ - - '>='
52
46
  - !ruby/object:Gem::Version
53
47
  version: '0'
54
48
  type: :runtime
55
49
  prerelease: false
56
50
  version_requirements: !ruby/object:Gem::Requirement
57
- none: false
58
51
  requirements:
59
- - - ! '>='
52
+ - - '>='
60
53
  - !ruby/object:Gem::Version
61
54
  version: '0'
62
55
  - !ruby/object:Gem::Dependency
63
56
  name: the_sortable_tree
64
57
  requirement: !ruby/object:Gem::Requirement
65
- none: false
66
58
  requirements:
67
59
  - - ~>
68
60
  - !ruby/object:Gem::Version
@@ -70,7 +62,6 @@ dependencies:
70
62
  type: :runtime
71
63
  prerelease: false
72
64
  version_requirements: !ruby/object:Gem::Requirement
73
- none: false
74
65
  requirements:
75
66
  - - ~>
76
67
  - !ruby/object:Gem::Version
@@ -78,81 +69,71 @@ dependencies:
78
69
  - !ruby/object:Gem::Dependency
79
70
  name: sqlite3
80
71
  requirement: !ruby/object:Gem::Requirement
81
- none: false
82
72
  requirements:
83
- - - ! '>='
73
+ - - '>='
84
74
  - !ruby/object:Gem::Version
85
75
  version: '0'
86
76
  type: :development
87
77
  prerelease: false
88
78
  version_requirements: !ruby/object:Gem::Requirement
89
- none: false
90
79
  requirements:
91
- - - ! '>='
80
+ - - '>='
92
81
  - !ruby/object:Gem::Version
93
82
  version: '0'
94
83
  - !ruby/object:Gem::Dependency
95
84
  name: rspec-rails
96
85
  requirement: !ruby/object:Gem::Requirement
97
- none: false
98
86
  requirements:
99
- - - ! '>='
87
+ - - '>='
100
88
  - !ruby/object:Gem::Version
101
89
  version: '0'
102
90
  type: :development
103
91
  prerelease: false
104
92
  version_requirements: !ruby/object:Gem::Requirement
105
- none: false
106
93
  requirements:
107
- - - ! '>='
94
+ - - '>='
108
95
  - !ruby/object:Gem::Version
109
96
  version: '0'
110
97
  - !ruby/object:Gem::Dependency
111
98
  name: capybara
112
99
  requirement: !ruby/object:Gem::Requirement
113
- none: false
114
100
  requirements:
115
- - - ! '>='
101
+ - - '>='
116
102
  - !ruby/object:Gem::Version
117
103
  version: '0'
118
104
  type: :development
119
105
  prerelease: false
120
106
  version_requirements: !ruby/object:Gem::Requirement
121
- none: false
122
107
  requirements:
123
- - - ! '>='
108
+ - - '>='
124
109
  - !ruby/object:Gem::Version
125
110
  version: '0'
126
111
  - !ruby/object:Gem::Dependency
127
112
  name: launchy
128
113
  requirement: !ruby/object:Gem::Requirement
129
- none: false
130
114
  requirements:
131
- - - ! '>='
115
+ - - '>='
132
116
  - !ruby/object:Gem::Version
133
117
  version: '0'
134
118
  type: :development
135
119
  prerelease: false
136
120
  version_requirements: !ruby/object:Gem::Requirement
137
- none: false
138
121
  requirements:
139
- - - ! '>='
122
+ - - '>='
140
123
  - !ruby/object:Gem::Version
141
124
  version: '0'
142
125
  - !ruby/object:Gem::Dependency
143
126
  name: factory_girl_rails
144
127
  requirement: !ruby/object:Gem::Requirement
145
- none: false
146
128
  requirements:
147
- - - ! '>='
129
+ - - '>='
148
130
  - !ruby/object:Gem::Version
149
131
  version: '0'
150
132
  type: :development
151
133
  prerelease: false
152
134
  version_requirements: !ruby/object:Gem::Requirement
153
- none: false
154
135
  requirements:
155
- - - ! '>='
136
+ - - '>='
156
137
  - !ruby/object:Gem::Version
157
138
  version: '0'
158
139
  description: Separate pages resource for brightcontent
@@ -168,6 +149,7 @@ files:
168
149
  - app/assets/images/brightcontent/.gitkeep
169
150
  - app/assets/images/brightcontent/move.png
170
151
  - app/assets/javascripts/pages.js
152
+ - app/assets/javascripts/wysithtml5-parser-rules.js
171
153
  - app/assets/stylesheets/pages.css.scss
172
154
  - app/controllers/brightcontent/page_base_controller.rb
173
155
  - app/controllers/brightcontent/pages_controller.rb
@@ -240,33 +222,26 @@ files:
240
222
  - spec/support/acceptance_helper.rb
241
223
  homepage: http://brightin.nl
242
224
  licenses: []
225
+ metadata: {}
243
226
  post_install_message:
244
227
  rdoc_options: []
245
228
  require_paths:
246
229
  - lib
247
230
  required_ruby_version: !ruby/object:Gem::Requirement
248
- none: false
249
231
  requirements:
250
- - - ! '>='
232
+ - - '>='
251
233
  - !ruby/object:Gem::Version
252
234
  version: '0'
253
- segments:
254
- - 0
255
- hash: -2996376452483059878
256
235
  required_rubygems_version: !ruby/object:Gem::Requirement
257
- none: false
258
236
  requirements:
259
- - - ! '>='
237
+ - - '>='
260
238
  - !ruby/object:Gem::Version
261
239
  version: '0'
262
- segments:
263
- - 0
264
- hash: -2996376452483059878
265
240
  requirements: []
266
241
  rubyforge_project:
267
- rubygems_version: 1.8.24
242
+ rubygems_version: 2.0.2
268
243
  signing_key:
269
- specification_version: 3
244
+ specification_version: 4
270
245
  summary: Pages resource for brightcontent
271
246
  test_files:
272
247
  - spec/dummy/README.rdoc