comfortable_mexican_sofa 1.5.11 → 1.6.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (196) hide show
  1. data/.travis.yml +2 -2
  2. data/Gemfile +1 -1
  3. data/VERSION +1 -1
  4. data/app/assets/images/comfortable_mexican_sofa/checkerboard.gif +0 -0
  5. data/app/assets/images/comfortable_mexican_sofa/elrte/elrte-toolbar.png +0 -0
  6. data/app/assets/images/comfortable_mexican_sofa/elrte/google-maps.png +0 -0
  7. data/app/assets/images/comfortable_mexican_sofa/elrte/iframe.png +0 -0
  8. data/app/assets/images/comfortable_mexican_sofa/elrte/media-director.png +0 -0
  9. data/app/assets/images/comfortable_mexican_sofa/elrte/media-flash.png +0 -0
  10. data/app/assets/images/comfortable_mexican_sofa/elrte/media-quicktime.png +0 -0
  11. data/app/assets/images/comfortable_mexican_sofa/elrte/media-realaudio.png +0 -0
  12. data/app/assets/images/comfortable_mexican_sofa/elrte/media-rutube.png +0 -0
  13. data/app/assets/images/comfortable_mexican_sofa/elrte/media-vimeo.png +0 -0
  14. data/app/assets/images/comfortable_mexican_sofa/elrte/media-winmedia.png +0 -0
  15. data/app/assets/images/comfortable_mexican_sofa/elrte/media-youtube.png +0 -0
  16. data/app/assets/images/comfortable_mexican_sofa/elrte/outline-div.png +0 -0
  17. data/app/assets/images/comfortable_mexican_sofa/elrte/outline-p.png +0 -0
  18. data/app/assets/images/comfortable_mexican_sofa/elrte/pagebreak.gif +0 -0
  19. data/app/assets/images/comfortable_mexican_sofa/elrte/pixel.gif +0 -0
  20. data/app/assets/images/comfortable_mexican_sofa/elrte/smileys/evilgrin.png +0 -0
  21. data/app/assets/images/comfortable_mexican_sofa/elrte/smileys/grin.png +0 -0
  22. data/app/assets/images/comfortable_mexican_sofa/elrte/smileys/happy.png +0 -0
  23. data/app/assets/images/comfortable_mexican_sofa/elrte/smileys/smile.png +0 -0
  24. data/app/assets/images/comfortable_mexican_sofa/elrte/smileys/surprised.png +0 -0
  25. data/app/assets/images/comfortable_mexican_sofa/elrte/smileys/tongue.png +0 -0
  26. data/app/assets/images/comfortable_mexican_sofa/elrte/smileys/unhappy.png +0 -0
  27. data/app/assets/images/comfortable_mexican_sofa/elrte/smileys/waii.png +0 -0
  28. data/app/assets/images/comfortable_mexican_sofa/elrte/smileys/wink.png +0 -0
  29. data/app/assets/images/comfortable_mexican_sofa/x.png +0 -0
  30. data/app/assets/javascripts/comfortable_mexican_sofa/application.js +28 -3
  31. data/app/assets/javascripts/comfortable_mexican_sofa/codemirror/codemirror.js +1 -1
  32. data/app/assets/javascripts/comfortable_mexican_sofa/elrte/elrte.codemirror.js +35 -0
  33. data/app/assets/javascripts/comfortable_mexican_sofa/elrte/elrte.js +267 -0
  34. data/app/assets/javascripts/comfortable_mexican_sofa/elrte/elrte.sofa_image.js +61 -0
  35. data/app/assets/javascripts/comfortable_mexican_sofa/elrte/elrte.sofa_link.js +58 -0
  36. data/app/assets/javascripts/comfortable_mexican_sofa/jquery.js +4 -18
  37. data/app/assets/stylesheets/comfortable_mexican_sofa/application.css +3 -0
  38. data/app/assets/stylesheets/comfortable_mexican_sofa/codemirror.css +6 -0
  39. data/app/assets/stylesheets/comfortable_mexican_sofa/content.css +0 -65
  40. data/app/assets/stylesheets/comfortable_mexican_sofa/dialogs.css +45 -0
  41. data/app/assets/stylesheets/comfortable_mexican_sofa/elrte.css +173 -0
  42. data/app/assets/stylesheets/comfortable_mexican_sofa/files.css +82 -0
  43. data/app/assets/stylesheets/comfortable_mexican_sofa/form.css +2 -2
  44. data/app/assets/stylesheets/comfortable_mexican_sofa/structure.css +1 -1
  45. data/app/assets/stylesheets/comfortable_mexican_sofa/widgets.css +14 -56
  46. data/app/controllers/cms_admin/categories_controller.rb +2 -2
  47. data/app/controllers/cms_admin/dialogs_controller.rb +13 -0
  48. data/app/controllers/cms_admin/files_controller.rb +4 -1
  49. data/app/controllers/cms_admin/revisions_controller.rb +2 -2
  50. data/app/controllers/cms_content_controller.rb +1 -1
  51. data/app/models/cms/block.rb +2 -2
  52. data/app/models/cms/category.rb +3 -0
  53. data/app/models/cms/file.rb +9 -1
  54. data/app/models/cms/layout.rb +2 -2
  55. data/app/models/cms/page.rb +7 -5
  56. data/app/models/cms/site.rb +10 -5
  57. data/app/models/cms/snippet.rb +5 -3
  58. data/app/views/cms_admin/categories/_form.html.erb +1 -1
  59. data/app/views/cms_admin/categories/_index.html.erb +2 -2
  60. data/app/views/cms_admin/dialogs/image.html.erb +7 -0
  61. data/app/views/cms_admin/dialogs/link.html.erb +5 -0
  62. data/app/views/cms_admin/files/_file.html.erb +17 -9
  63. data/app/views/cms_admin/files/_index.html.erb +8 -18
  64. data/app/views/cms_admin/files/create.js.erb +1 -1
  65. data/app/views/cms_admin/layouts/_form.html.erb +1 -1
  66. data/app/views/cms_admin/layouts/_index_branch.html.erb +1 -1
  67. data/app/views/cms_admin/pages/_form_blocks.html.erb +1 -1
  68. data/app/views/cms_admin/revisions/show.html.erb +1 -1
  69. data/app/views/cms_admin/sites/_form.html.erb +2 -1
  70. data/app/views/cms_admin/snippets/_form.html.erb +1 -1
  71. data/app/views/cms_admin/snippets/index.html.erb +1 -1
  72. data/app/views/layouts/cms_admin/_head.html.erb +7 -6
  73. data/comfortable_mexican_sofa.gemspec +46 -47
  74. data/config/initializers/paperclip.rb +0 -25
  75. data/config/locales/en.yml +6 -0
  76. data/config/locales/es.yml +6 -0
  77. data/config/routes.rb +3 -2
  78. data/db/migrate/01_create_cms.rb +37 -35
  79. data/db/migrate/upgrades/07_upgrade_to_1_6_0.rb +25 -0
  80. data/lib/comfortable_mexican_sofa/error.rb +4 -4
  81. data/lib/comfortable_mexican_sofa/extensions/is_categorized.rb +3 -1
  82. data/lib/comfortable_mexican_sofa/extensions/is_mirrored.rb +8 -8
  83. data/lib/comfortable_mexican_sofa/fixtures.rb +19 -19
  84. data/lib/comfortable_mexican_sofa/form_builder.rb +4 -4
  85. data/lib/comfortable_mexican_sofa/render_methods.rb +8 -8
  86. data/lib/comfortable_mexican_sofa/tag.rb +14 -13
  87. data/lib/comfortable_mexican_sofa/tags/asset.rb +6 -6
  88. data/lib/comfortable_mexican_sofa/tags/collection.rb +3 -3
  89. data/lib/comfortable_mexican_sofa/tags/field_datetime.rb +3 -3
  90. data/lib/comfortable_mexican_sofa/tags/field_integer.rb +3 -3
  91. data/lib/comfortable_mexican_sofa/tags/field_string.rb +3 -3
  92. data/lib/comfortable_mexican_sofa/tags/field_text.rb +3 -3
  93. data/lib/comfortable_mexican_sofa/tags/file.rb +5 -5
  94. data/lib/comfortable_mexican_sofa/tags/helper.rb +4 -4
  95. data/lib/comfortable_mexican_sofa/tags/page_datetime.rb +3 -3
  96. data/lib/comfortable_mexican_sofa/tags/page_file.rb +8 -6
  97. data/lib/comfortable_mexican_sofa/tags/page_files.rb +6 -4
  98. data/lib/comfortable_mexican_sofa/tags/page_integer.rb +3 -3
  99. data/lib/comfortable_mexican_sofa/tags/page_rich_text.rb +3 -3
  100. data/lib/comfortable_mexican_sofa/tags/page_string.rb +3 -3
  101. data/lib/comfortable_mexican_sofa/tags/page_text.rb +3 -3
  102. data/lib/comfortable_mexican_sofa/tags/partial.rb +4 -4
  103. data/lib/comfortable_mexican_sofa/tags/snippet.rb +5 -4
  104. data/lib/comfortable_mexican_sofa/view_methods.rb +6 -6
  105. data/test/fixtures/cms/blocks.yml +2 -2
  106. data/test/fixtures/cms/categories.yml +1 -0
  107. data/test/fixtures/cms/layouts.yml +3 -3
  108. data/test/fixtures/cms/revisions.yml +4 -4
  109. data/test/fixtures/cms/sites.yml +1 -0
  110. data/test/fixtures/cms/snippets.yml +1 -1
  111. data/test/fixtures/files/data.zip +0 -0
  112. data/test/functional/cms_admin/dialogs_controller_test.rb +24 -0
  113. data/test/functional/cms_admin/files_controller_test.rb +1 -1
  114. data/test/functional/cms_admin/layouts_controller_test.rb +7 -7
  115. data/test/functional/cms_admin/pages_controller_test.rb +34 -35
  116. data/test/functional/cms_admin/revisions_controller_test.rb +2 -2
  117. data/test/functional/cms_admin/sites_controller_test.rb +3 -2
  118. data/test/functional/cms_admin/snippets_controller_test.rb +8 -8
  119. data/test/functional/cms_content_controller_test.rb +10 -11
  120. data/test/gemfiles/{Gemfile.rails-3.0.10 → Gemfile.rails-3.0} +1 -1
  121. data/test/gemfiles/{Gemfile.rails-3.1.1 → Gemfile.rails-3.1} +1 -1
  122. data/test/integration/fixtures_test.rb +4 -4
  123. data/test/integration/mirrors_test.rb +1 -1
  124. data/test/integration/render_cms_test.rb +10 -10
  125. data/test/integration/sites_test.rb +3 -3
  126. data/test/test_helper.rb +3 -0
  127. data/test/unit/fixtures_test.rb +11 -11
  128. data/test/unit/mirrors_test.rb +25 -25
  129. data/test/unit/models/block_test.rb +29 -29
  130. data/test/unit/models/categorization_test.rb +1 -1
  131. data/test/unit/models/category_test.rb +2 -2
  132. data/test/unit/models/file_test.rb +18 -0
  133. data/test/unit/models/layout_test.rb +21 -18
  134. data/test/unit/models/page_test.rb +3 -3
  135. data/test/unit/models/site_test.rb +26 -17
  136. data/test/unit/models/snippet_test.rb +6 -6
  137. data/test/unit/revisions_test.rb +13 -13
  138. data/test/unit/tag_test.rb +39 -45
  139. data/test/unit/tags/asset_test.rb +1 -1
  140. data/test/unit/tags/collection_test.rb +12 -10
  141. data/test/unit/tags/field_datetime_test.rb +3 -3
  142. data/test/unit/tags/field_integer_test.rb +3 -3
  143. data/test/unit/tags/field_string_test.rb +4 -4
  144. data/test/unit/tags/field_text_test.rb +3 -3
  145. data/test/unit/tags/file_test.rb +1 -1
  146. data/test/unit/tags/helper_test.rb +3 -3
  147. data/test/unit/tags/page_datetime_test.rb +3 -3
  148. data/test/unit/tags/page_file_test.rb +7 -4
  149. data/test/unit/tags/page_files_test.rb +7 -4
  150. data/test/unit/tags/page_integer_test.rb +3 -3
  151. data/test/unit/tags/page_rich_text_test.rb +3 -3
  152. data/test/unit/tags/page_string_test.rb +3 -3
  153. data/test/unit/tags/page_text_test.rb +4 -4
  154. data/test/unit/tags/partial_test.rb +4 -4
  155. data/test/unit/tags/snippet_test.rb +3 -3
  156. metadata +51 -52
  157. data/app/assets/images/comfortable_mexican_sofa/wym_icons.png +0 -0
  158. data/app/assets/javascripts/comfortable_mexican_sofa/wymeditor/iframe/default/lbl-blockquote.png +0 -0
  159. data/app/assets/javascripts/comfortable_mexican_sofa/wymeditor/iframe/default/lbl-h1.png +0 -0
  160. data/app/assets/javascripts/comfortable_mexican_sofa/wymeditor/iframe/default/lbl-h2.png +0 -0
  161. data/app/assets/javascripts/comfortable_mexican_sofa/wymeditor/iframe/default/lbl-h3.png +0 -0
  162. data/app/assets/javascripts/comfortable_mexican_sofa/wymeditor/iframe/default/lbl-h4.png +0 -0
  163. data/app/assets/javascripts/comfortable_mexican_sofa/wymeditor/iframe/default/lbl-h5.png +0 -0
  164. data/app/assets/javascripts/comfortable_mexican_sofa/wymeditor/iframe/default/lbl-h6.png +0 -0
  165. data/app/assets/javascripts/comfortable_mexican_sofa/wymeditor/iframe/default/lbl-p.png +0 -0
  166. data/app/assets/javascripts/comfortable_mexican_sofa/wymeditor/iframe/default/lbl-pre.png +0 -0
  167. data/app/assets/javascripts/comfortable_mexican_sofa/wymeditor/iframe/default/wymiframe.css +0 -52
  168. data/app/assets/javascripts/comfortable_mexican_sofa/wymeditor/iframe/default/wymiframe.html +0 -26
  169. data/app/assets/javascripts/comfortable_mexican_sofa/wymeditor/jquery.wymeditor.cms.js +0 -342
  170. data/app/assets/javascripts/comfortable_mexican_sofa/wymeditor/jquery.wymeditor.embed.js +0 -19
  171. data/app/assets/javascripts/comfortable_mexican_sofa/wymeditor/jquery.wymeditor.pack.js +0 -1
  172. data/app/assets/javascripts/comfortable_mexican_sofa/wymeditor/lang/bg.js +0 -45
  173. data/app/assets/javascripts/comfortable_mexican_sofa/wymeditor/lang/ca.js +0 -45
  174. data/app/assets/javascripts/comfortable_mexican_sofa/wymeditor/lang/cs.js +0 -45
  175. data/app/assets/javascripts/comfortable_mexican_sofa/wymeditor/lang/cy.js +0 -45
  176. data/app/assets/javascripts/comfortable_mexican_sofa/wymeditor/lang/de.js +0 -45
  177. data/app/assets/javascripts/comfortable_mexican_sofa/wymeditor/lang/en.js +0 -45
  178. data/app/assets/javascripts/comfortable_mexican_sofa/wymeditor/lang/es.js +0 -45
  179. data/app/assets/javascripts/comfortable_mexican_sofa/wymeditor/lang/fa.js +0 -46
  180. data/app/assets/javascripts/comfortable_mexican_sofa/wymeditor/lang/fi.js +0 -44
  181. data/app/assets/javascripts/comfortable_mexican_sofa/wymeditor/lang/fr.js +0 -45
  182. data/app/assets/javascripts/comfortable_mexican_sofa/wymeditor/lang/gl.js +0 -45
  183. data/app/assets/javascripts/comfortable_mexican_sofa/wymeditor/lang/he.js +0 -45
  184. data/app/assets/javascripts/comfortable_mexican_sofa/wymeditor/lang/hr.js +0 -45
  185. data/app/assets/javascripts/comfortable_mexican_sofa/wymeditor/lang/hu.js +0 -45
  186. data/app/assets/javascripts/comfortable_mexican_sofa/wymeditor/lang/it.js +0 -45
  187. data/app/assets/javascripts/comfortable_mexican_sofa/wymeditor/lang/nb.js +0 -45
  188. data/app/assets/javascripts/comfortable_mexican_sofa/wymeditor/lang/nl.js +0 -45
  189. data/app/assets/javascripts/comfortable_mexican_sofa/wymeditor/lang/nn.js +0 -45
  190. data/app/assets/javascripts/comfortable_mexican_sofa/wymeditor/lang/pl.js +0 -45
  191. data/app/assets/javascripts/comfortable_mexican_sofa/wymeditor/lang/pt-br.js +0 -45
  192. data/app/assets/javascripts/comfortable_mexican_sofa/wymeditor/lang/pt.js +0 -45
  193. data/app/assets/javascripts/comfortable_mexican_sofa/wymeditor/lang/ru.js +0 -45
  194. data/app/assets/javascripts/comfortable_mexican_sofa/wymeditor/lang/sv.js +0 -45
  195. data/app/assets/javascripts/comfortable_mexican_sofa/wymeditor/lang/tr.js +0 -45
  196. data/app/assets/javascripts/comfortable_mexican_sofa/wymeditor/lang/zh_cn.js +0 -47
@@ -6,15 +6,15 @@ class PageStringTagTest < ActiveSupport::TestCase
6
6
  assert tag = ComfortableMexicanSofa::Tag::PageString.initialize_tag(
7
7
  cms_pages(:default), '{{ cms:page:content:string }}'
8
8
  )
9
- assert_equal 'content', tag.label
9
+ assert_equal 'content', tag.identifier
10
10
  assert tag = ComfortableMexicanSofa::Tag::PageString.initialize_tag(
11
11
  cms_pages(:default), '{{cms:page:content:string}}'
12
12
  )
13
- assert_equal 'content', tag.label
13
+ assert_equal 'content', tag.identifier
14
14
  assert tag = ComfortableMexicanSofa::Tag::PageString.initialize_tag(
15
15
  cms_pages(:default), '{{cms:page:dash-content:string}}'
16
16
  )
17
- assert_equal 'dash-content', tag.label
17
+ assert_equal 'dash-content', tag.identifier
18
18
  end
19
19
 
20
20
  def test_initialize_tag_failure
@@ -6,19 +6,19 @@ class PageTextTagTest < ActiveSupport::TestCase
6
6
  assert tag = ComfortableMexicanSofa::Tag::PageText.initialize_tag(
7
7
  cms_pages(:default), '{{ cms:page:content:text }}'
8
8
  )
9
- assert_equal 'content', tag.label
9
+ assert_equal 'content', tag.identifier
10
10
  assert tag = ComfortableMexicanSofa::Tag::PageText.initialize_tag(
11
11
  cms_pages(:default), '{{cms:page:content}}'
12
12
  )
13
- assert_equal 'content', tag.label
13
+ assert_equal 'content', tag.identifier
14
14
  assert tag = ComfortableMexicanSofa::Tag::PageText.initialize_tag(
15
15
  cms_pages(:default), '{{cms:page:content:text}}'
16
16
  )
17
- assert_equal 'content', tag.label
17
+ assert_equal 'content', tag.identifier
18
18
  assert tag = ComfortableMexicanSofa::Tag::PageText.initialize_tag(
19
19
  cms_pages(:default), '{{cms:page:dash-content}}'
20
20
  )
21
- assert_equal 'dash-content', tag.label
21
+ assert_equal 'dash-content', tag.identifier
22
22
  end
23
23
 
24
24
  def test_initialize_tag_failure
@@ -6,22 +6,22 @@ class PartialTagTest < ActiveSupport::TestCase
6
6
  assert tag = ComfortableMexicanSofa::Tag::Partial.initialize_tag(
7
7
  cms_pages(:default), '{{ cms:partial:partial_name }}'
8
8
  )
9
- assert_equal 'partial_name', tag.label
9
+ assert_equal 'partial_name', tag.identifier
10
10
  assert tag = ComfortableMexicanSofa::Tag::Partial.initialize_tag(
11
11
  cms_pages(:default), '{{cms:partial:path/to/partial}}'
12
12
  )
13
- assert_equal 'path/to/partial', tag.label
13
+ assert_equal 'path/to/partial', tag.identifier
14
14
  assert tag = ComfortableMexicanSofa::Tag::Partial.initialize_tag(
15
15
  cms_pages(:default), '{{cms:partial:path/to/dashed-partial}}'
16
16
  )
17
- assert_equal 'path/to/dashed-partial', tag.label
17
+ assert_equal 'path/to/dashed-partial', tag.identifier
18
18
  end
19
19
 
20
20
  def test_initialize_tag_with_parameters
21
21
  assert tag = ComfortableMexicanSofa::Tag::Partial.initialize_tag(
22
22
  cms_pages(:default), '{{cms:partial:path/to/partial:param1:param2}}'
23
23
  )
24
- assert tag.label = 'path/to/partial'
24
+ assert tag.identifier = 'path/to/partial'
25
25
  assert tag.params = 'param1:param2'
26
26
  end
27
27
 
@@ -6,15 +6,15 @@ class SnippetTagTest < ActiveSupport::TestCase
6
6
  assert tag = ComfortableMexicanSofa::Tag::Snippet.initialize_tag(
7
7
  cms_pages(:default), '{{ cms:snippet:label }}'
8
8
  )
9
- assert_equal 'label', tag.label
9
+ assert_equal 'label', tag.identifier
10
10
  assert tag = ComfortableMexicanSofa::Tag::Snippet.initialize_tag(
11
11
  cms_pages(:default), '{{cms:snippet:label}}'
12
12
  )
13
- assert_equal 'label', tag.label
13
+ assert_equal 'label', tag.identifier
14
14
  assert tag = ComfortableMexicanSofa::Tag::Snippet.initialize_tag(
15
15
  cms_pages(:default), '{{cms:snippet:dash-label}}'
16
16
  )
17
- assert_equal 'dash-label', tag.label
17
+ assert_equal 'dash-label', tag.identifier
18
18
  end
19
19
 
20
20
  def test_initialize_tag_failure
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: comfortable_mexican_sofa
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.5.11
4
+ version: 1.6.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -10,11 +10,11 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2011-11-17 00:00:00.000000000Z
13
+ date: 2011-12-15 00:00:00.000000000Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: rails
17
- requirement: &70264886592940 !ruby/object:Gem::Requirement
17
+ requirement: &70322361500400 !ruby/object:Gem::Requirement
18
18
  none: false
19
19
  requirements:
20
20
  - - ! '>='
@@ -22,10 +22,10 @@ dependencies:
22
22
  version: 3.0.0
23
23
  type: :runtime
24
24
  prerelease: false
25
- version_requirements: *70264886592940
25
+ version_requirements: *70322361500400
26
26
  - !ruby/object:Gem::Dependency
27
27
  name: active_link_to
28
- requirement: &70264886591540 !ruby/object:Gem::Requirement
28
+ requirement: &70322361499680 !ruby/object:Gem::Requirement
29
29
  none: false
30
30
  requirements:
31
31
  - - ~>
@@ -33,18 +33,18 @@ dependencies:
33
33
  version: 1.0.0
34
34
  type: :runtime
35
35
  prerelease: false
36
- version_requirements: *70264886591540
36
+ version_requirements: *70322361499680
37
37
  - !ruby/object:Gem::Dependency
38
38
  name: paperclip
39
- requirement: &70264886588600 !ruby/object:Gem::Requirement
39
+ requirement: &70322361498520 !ruby/object:Gem::Requirement
40
40
  none: false
41
41
  requirements:
42
- - - ~>
42
+ - - ! '>='
43
43
  - !ruby/object:Gem::Version
44
44
  version: 2.3.0
45
45
  type: :runtime
46
46
  prerelease: false
47
- version_requirements: *70264886588600
47
+ version_requirements: *70322361498520
48
48
  description: ''
49
49
  email: oleg@theworkinggroup.ca
50
50
  executables: []
@@ -61,6 +61,31 @@ files:
61
61
  - VERSION
62
62
  - app/assets/images/comfortable_mexican_sofa/arrow_bottom.gif
63
63
  - app/assets/images/comfortable_mexican_sofa/arrow_right.gif
64
+ - app/assets/images/comfortable_mexican_sofa/checkerboard.gif
65
+ - app/assets/images/comfortable_mexican_sofa/elrte/elrte-toolbar.png
66
+ - app/assets/images/comfortable_mexican_sofa/elrte/google-maps.png
67
+ - app/assets/images/comfortable_mexican_sofa/elrte/iframe.png
68
+ - app/assets/images/comfortable_mexican_sofa/elrte/media-director.png
69
+ - app/assets/images/comfortable_mexican_sofa/elrte/media-flash.png
70
+ - app/assets/images/comfortable_mexican_sofa/elrte/media-quicktime.png
71
+ - app/assets/images/comfortable_mexican_sofa/elrte/media-realaudio.png
72
+ - app/assets/images/comfortable_mexican_sofa/elrte/media-rutube.png
73
+ - app/assets/images/comfortable_mexican_sofa/elrte/media-vimeo.png
74
+ - app/assets/images/comfortable_mexican_sofa/elrte/media-winmedia.png
75
+ - app/assets/images/comfortable_mexican_sofa/elrte/media-youtube.png
76
+ - app/assets/images/comfortable_mexican_sofa/elrte/outline-div.png
77
+ - app/assets/images/comfortable_mexican_sofa/elrte/outline-p.png
78
+ - app/assets/images/comfortable_mexican_sofa/elrte/pagebreak.gif
79
+ - app/assets/images/comfortable_mexican_sofa/elrte/pixel.gif
80
+ - app/assets/images/comfortable_mexican_sofa/elrte/smileys/evilgrin.png
81
+ - app/assets/images/comfortable_mexican_sofa/elrte/smileys/grin.png
82
+ - app/assets/images/comfortable_mexican_sofa/elrte/smileys/happy.png
83
+ - app/assets/images/comfortable_mexican_sofa/elrte/smileys/smile.png
84
+ - app/assets/images/comfortable_mexican_sofa/elrte/smileys/surprised.png
85
+ - app/assets/images/comfortable_mexican_sofa/elrte/smileys/tongue.png
86
+ - app/assets/images/comfortable_mexican_sofa/elrte/smileys/unhappy.png
87
+ - app/assets/images/comfortable_mexican_sofa/elrte/smileys/waii.png
88
+ - app/assets/images/comfortable_mexican_sofa/elrte/smileys/wink.png
64
89
  - app/assets/images/comfortable_mexican_sofa/icon_layout.gif
65
90
  - app/assets/images/comfortable_mexican_sofa/icon_move.gif
66
91
  - app/assets/images/comfortable_mexican_sofa/icon_regular.gif
@@ -79,55 +104,23 @@ files:
79
104
  - app/assets/images/comfortable_mexican_sofa/jquery_ui/ui-icons_454545_256x240.png
80
105
  - app/assets/images/comfortable_mexican_sofa/jquery_ui/ui-icons_888888_256x240.png
81
106
  - app/assets/images/comfortable_mexican_sofa/jquery_ui/ui-icons_cd0a0a_256x240.png
82
- - app/assets/images/comfortable_mexican_sofa/wym_icons.png
107
+ - app/assets/images/comfortable_mexican_sofa/x.png
83
108
  - app/assets/javascripts/comfortable_mexican_sofa/application.js
84
109
  - app/assets/javascripts/comfortable_mexican_sofa/codemirror/codemirror.js
110
+ - app/assets/javascripts/comfortable_mexican_sofa/elrte/elrte.codemirror.js
111
+ - app/assets/javascripts/comfortable_mexican_sofa/elrte/elrte.js
112
+ - app/assets/javascripts/comfortable_mexican_sofa/elrte/elrte.sofa_image.js
113
+ - app/assets/javascripts/comfortable_mexican_sofa/elrte/elrte.sofa_link.js
85
114
  - app/assets/javascripts/comfortable_mexican_sofa/jquery.js
86
115
  - app/assets/javascripts/comfortable_mexican_sofa/jquery_ui.js
87
116
  - app/assets/javascripts/comfortable_mexican_sofa/jquery_ui_timepicker.js
88
117
  - app/assets/javascripts/comfortable_mexican_sofa/rails.js
89
- - app/assets/javascripts/comfortable_mexican_sofa/wymeditor/iframe/default/lbl-blockquote.png
90
- - app/assets/javascripts/comfortable_mexican_sofa/wymeditor/iframe/default/lbl-h1.png
91
- - app/assets/javascripts/comfortable_mexican_sofa/wymeditor/iframe/default/lbl-h2.png
92
- - app/assets/javascripts/comfortable_mexican_sofa/wymeditor/iframe/default/lbl-h3.png
93
- - app/assets/javascripts/comfortable_mexican_sofa/wymeditor/iframe/default/lbl-h4.png
94
- - app/assets/javascripts/comfortable_mexican_sofa/wymeditor/iframe/default/lbl-h5.png
95
- - app/assets/javascripts/comfortable_mexican_sofa/wymeditor/iframe/default/lbl-h6.png
96
- - app/assets/javascripts/comfortable_mexican_sofa/wymeditor/iframe/default/lbl-p.png
97
- - app/assets/javascripts/comfortable_mexican_sofa/wymeditor/iframe/default/lbl-pre.png
98
- - app/assets/javascripts/comfortable_mexican_sofa/wymeditor/iframe/default/wymiframe.css
99
- - app/assets/javascripts/comfortable_mexican_sofa/wymeditor/iframe/default/wymiframe.html
100
- - app/assets/javascripts/comfortable_mexican_sofa/wymeditor/jquery.wymeditor.cms.js
101
- - app/assets/javascripts/comfortable_mexican_sofa/wymeditor/jquery.wymeditor.embed.js
102
- - app/assets/javascripts/comfortable_mexican_sofa/wymeditor/jquery.wymeditor.pack.js
103
- - app/assets/javascripts/comfortable_mexican_sofa/wymeditor/lang/bg.js
104
- - app/assets/javascripts/comfortable_mexican_sofa/wymeditor/lang/ca.js
105
- - app/assets/javascripts/comfortable_mexican_sofa/wymeditor/lang/cs.js
106
- - app/assets/javascripts/comfortable_mexican_sofa/wymeditor/lang/cy.js
107
- - app/assets/javascripts/comfortable_mexican_sofa/wymeditor/lang/de.js
108
- - app/assets/javascripts/comfortable_mexican_sofa/wymeditor/lang/en.js
109
- - app/assets/javascripts/comfortable_mexican_sofa/wymeditor/lang/es.js
110
- - app/assets/javascripts/comfortable_mexican_sofa/wymeditor/lang/fa.js
111
- - app/assets/javascripts/comfortable_mexican_sofa/wymeditor/lang/fi.js
112
- - app/assets/javascripts/comfortable_mexican_sofa/wymeditor/lang/fr.js
113
- - app/assets/javascripts/comfortable_mexican_sofa/wymeditor/lang/gl.js
114
- - app/assets/javascripts/comfortable_mexican_sofa/wymeditor/lang/he.js
115
- - app/assets/javascripts/comfortable_mexican_sofa/wymeditor/lang/hr.js
116
- - app/assets/javascripts/comfortable_mexican_sofa/wymeditor/lang/hu.js
117
- - app/assets/javascripts/comfortable_mexican_sofa/wymeditor/lang/it.js
118
- - app/assets/javascripts/comfortable_mexican_sofa/wymeditor/lang/nb.js
119
- - app/assets/javascripts/comfortable_mexican_sofa/wymeditor/lang/nl.js
120
- - app/assets/javascripts/comfortable_mexican_sofa/wymeditor/lang/nn.js
121
- - app/assets/javascripts/comfortable_mexican_sofa/wymeditor/lang/pl.js
122
- - app/assets/javascripts/comfortable_mexican_sofa/wymeditor/lang/pt-br.js
123
- - app/assets/javascripts/comfortable_mexican_sofa/wymeditor/lang/pt.js
124
- - app/assets/javascripts/comfortable_mexican_sofa/wymeditor/lang/ru.js
125
- - app/assets/javascripts/comfortable_mexican_sofa/wymeditor/lang/sv.js
126
- - app/assets/javascripts/comfortable_mexican_sofa/wymeditor/lang/tr.js
127
- - app/assets/javascripts/comfortable_mexican_sofa/wymeditor/lang/zh_cn.js
128
118
  - app/assets/stylesheets/comfortable_mexican_sofa/application.css
129
119
  - app/assets/stylesheets/comfortable_mexican_sofa/codemirror.css
130
120
  - app/assets/stylesheets/comfortable_mexican_sofa/content.css
121
+ - app/assets/stylesheets/comfortable_mexican_sofa/dialogs.css
122
+ - app/assets/stylesheets/comfortable_mexican_sofa/elrte.css
123
+ - app/assets/stylesheets/comfortable_mexican_sofa/files.css
131
124
  - app/assets/stylesheets/comfortable_mexican_sofa/form.css
132
125
  - app/assets/stylesheets/comfortable_mexican_sofa/jquery_ui.css
133
126
  - app/assets/stylesheets/comfortable_mexican_sofa/reset.css
@@ -137,6 +130,7 @@ files:
137
130
  - app/controllers/application_controller.rb
138
131
  - app/controllers/cms_admin/base_controller.rb
139
132
  - app/controllers/cms_admin/categories_controller.rb
133
+ - app/controllers/cms_admin/dialogs_controller.rb
140
134
  - app/controllers/cms_admin/files_controller.rb
141
135
  - app/controllers/cms_admin/layouts_controller.rb
142
136
  - app/controllers/cms_admin/pages_controller.rb
@@ -162,6 +156,8 @@ files:
162
156
  - app/views/cms_admin/categories/destroy.js.erb
163
157
  - app/views/cms_admin/categories/edit.js.erb
164
158
  - app/views/cms_admin/categories/update.js.erb
159
+ - app/views/cms_admin/dialogs/image.html.erb
160
+ - app/views/cms_admin/dialogs/link.html.erb
165
161
  - app/views/cms_admin/files/_file.html.erb
166
162
  - app/views/cms_admin/files/_form.html.erb
167
163
  - app/views/cms_admin/files/_index.html.erb
@@ -235,6 +231,7 @@ files:
235
231
  - db/migrate/upgrades/04_upgrade_to_1_3_0.rb
236
232
  - db/migrate/upgrades/05_upgrade_to_1_4_0.rb
237
233
  - db/migrate/upgrades/06_upgrade_to_1_5_0.rb
234
+ - db/migrate/upgrades/07_upgrade_to_1_6_0.rb
238
235
  - db/seeds.rb
239
236
  - doc/preview.png
240
237
  - doc/sofa.png
@@ -287,6 +284,7 @@ files:
287
284
  - test/fixtures/cms/revisions.yml
288
285
  - test/fixtures/cms/sites.yml
289
286
  - test/fixtures/cms/snippets.yml
287
+ - test/fixtures/files/data.zip
290
288
  - test/fixtures/files/document.pdf
291
289
  - test/fixtures/files/image.gif
292
290
  - test/fixtures/files/image.jpg
@@ -296,6 +294,7 @@ files:
296
294
  - test/fixtures/views/render_test/render_layout.html.erb
297
295
  - test/functional/cms_admin/base_controller_test.rb
298
296
  - test/functional/cms_admin/categories_controller_test.rb
297
+ - test/functional/cms_admin/dialogs_controller_test.rb
299
298
  - test/functional/cms_admin/files_controller_test.rb
300
299
  - test/functional/cms_admin/layouts_controller_test.rb
301
300
  - test/functional/cms_admin/pages_controller_test.rb
@@ -303,8 +302,8 @@ files:
303
302
  - test/functional/cms_admin/sites_controller_test.rb
304
303
  - test/functional/cms_admin/snippets_controller_test.rb
305
304
  - test/functional/cms_content_controller_test.rb
306
- - test/gemfiles/Gemfile.rails-3.0.10
307
- - test/gemfiles/Gemfile.rails-3.1.1
305
+ - test/gemfiles/Gemfile.rails-3.0
306
+ - test/gemfiles/Gemfile.rails-3.1
308
307
  - test/integration/authentication_test.rb
309
308
  - test/integration/fixtures_test.rb
310
309
  - test/integration/mirrors_test.rb
@@ -359,7 +358,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
359
358
  version: '0'
360
359
  segments:
361
360
  - 0
362
- hash: 3416423876498059333
361
+ hash: -3203141432806971480
363
362
  required_rubygems_version: !ruby/object:Gem::Requirement
364
363
  none: false
365
364
  requirements:
@@ -1,52 +0,0 @@
1
- /* Reset */
2
- html{color:#000;background:#FFF;}body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,code,form,fieldset,legend,input,button,textarea,p,blockquote,th,td{margin:0;padding:0;}table{border-collapse:collapse;border-spacing:0;}fieldset,img{border:0;}address,caption,cite,code,dfn,em,strong,th,var,optgroup{font-style:inherit;font-weight:inherit;}del,ins{text-decoration:none;}li{list-style:none;}caption,th{text-align:left;}h1,h2,h3,h4,h5,h6{font-size:100%;font-weight:normal;}q:before,q:after{content:'';}abbr,acronym{border:0;font-variant:normal;}sup{vertical-align:baseline;}sub{vertical-align:baseline;}legend{color:#000;}input,button,textarea,select,optgroup,option{font-family:inherit;font-size:inherit;font-style:inherit;font-weight:inherit;}input,button,textarea,select{*font-size:100%;}
3
-
4
- body {
5
- padding: 5px;
6
- background: #fff;
7
- font: 14px Arial, sans-serif;
8
- }
9
-
10
- p, h1, h2, h3, h4, h5, h6, ul, ol, table, blockquote, pre {
11
- outline: 1px dotted #e1e1e1;
12
- background: #fff no-repeat 2px 2px;
13
- padding: 5px;
14
- margin-bottom: 10px;
15
- }
16
-
17
- h1 { font: bold 24px Times, serif }
18
- h2 { font: bold 20px Times, serif }
19
- h3 { font: bold 16px Times, serif }
20
-
21
- p { letter-spacing: 0.5px }
22
-
23
- ul, ol { margin-left: 25px }
24
- ul li { list-style: disc }
25
- ol li { list-style: decimal }
26
-
27
- table {
28
- width: 100%;
29
- }
30
- th, td {
31
- height: 20px;
32
- width: 20px;
33
- border: 1px dotted #ccc;
34
- }
35
-
36
- p { background-image: url(lbl-p.png); }
37
- h1 { background-image: url(lbl-h1.png); }
38
- h2 { background-image: url(lbl-h2.png); }
39
- h3 { background-image: url(lbl-h3.png); }
40
- h4 { background-image: url(lbl-h4.png); }
41
- h5 { background-image: url(lbl-h5.png); }
42
- h6 { background-image: url(lbl-h6.png); }
43
- blockquote { background-image: url(lbl-blockquote.png); }
44
- pre { background-image: url(lbl-pre.png); }
45
-
46
- /* Custom Classes */
47
- *.align_left { float: left }
48
- *.align_center { display: block; margin: auto }
49
- *.align_right { float: right }
50
- p.align_left { float: none; text-align: left }
51
- p.align_center { float: none; text-align: center }
52
- p.align_right { float: none; text-align: right }
@@ -1,26 +0,0 @@
1
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
2
- <!--
3
- * WYMeditor : what you see is What You Mean web-based editor
4
- * Copyright (c) 2005 - 2009 Jean-Francois Hovinne, http://www.wymeditor.org/
5
- * Dual licensed under the MIT (MIT-license.txt)
6
- * and GPL (GPL-license.txt) licenses.
7
- *
8
- * For further information visit:
9
- * http://www.wymeditor.org/
10
- *
11
- * File Name:
12
- * wymiframe.html
13
- * Iframe used by designMode.
14
- * See the documentation for more info.
15
- *
16
- * File Authors:
17
- * Jean-Francois Hovinne (jf.hovinne a-t wymeditor dotorg)
18
- -->
19
- <html>
20
- <head>
21
- <title>WYMeditor iframe</title>
22
- <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
23
- <link rel="stylesheet" type="text/css" media="screen" href="wymiframe.css" />
24
- </head>
25
- <body class="wym_iframe"></body>
26
- </html>
@@ -1,342 +0,0 @@
1
- //= require comfortable_mexican_sofa/wymeditor/jquery.wymeditor.embed.js
2
-
3
- // -- Options overrides -----------------------------------------------------
4
- var cms_wym_options = {
5
-
6
- initSkin: false,
7
- lang: $('meta[name="cms-locale"]').attr('content'),
8
-
9
- basePath: $('meta[name="cms-js-assets-base-path"]').attr('content') + '/wymeditor/',
10
- wymPath: 'disabled',
11
- jQueryPath: 'disabled',
12
-
13
- updateSelector: 'form',
14
- updateEvent: 'submit',
15
-
16
- containersItems: [
17
- { 'name': 'H1', 'title': 'Heading_1', 'css': 'wym_containers_h1' },
18
- { 'name': 'H2', 'title': 'Heading_2', 'css': 'wym_containers_h2' },
19
- { 'name': 'H3', 'title': 'Heading_3', 'css': 'wym_containers_h3' },
20
- { 'name': 'P', 'title': 'Paragraph', 'css': 'wym_containers_p' },
21
- { 'name': 'PRE', 'title': 'Preformatted', 'css': 'wym_containers_pre' }
22
- ],
23
-
24
- toolsItems: [
25
- { 'name': 'Bold', 'title': 'Strong', 'css': 'wym_tools_strong' },
26
- { 'name': 'Italic', 'title': 'Emphasis', 'css': 'wym_tools_emphasis' },
27
- { 'name': 'InsertOrderedList', 'title': 'Ordered_List', 'css': 'wym_tools_ordered_list' },
28
- { 'name': 'InsertUnorderedList', 'title': 'Unordered_List', 'css': 'wym_tools_unordered_list' },
29
- { 'name': 'InsertTable', 'title': 'Table', 'css': 'wym_tools_table' },
30
- { 'name': 'CreateLink', 'title': 'Link', 'css': 'wym_tools_link' },
31
- { 'name': 'Unlink', 'title': 'Unlink', 'css': 'wym_tools_unlink' },
32
- { 'name': 'InsertImage', 'title': 'Image', 'css': 'wym_tools_image' },
33
- { 'name': 'Paste', 'title': 'Paste_From_Word', 'css': 'wym_tools_paste' },
34
- { 'name': 'ToggleHtml', 'title': 'HTML', 'css': 'wym_tools_html' }
35
- ],
36
-
37
- classesItems: [
38
- { 'name': 'align_left', 'title': 'Align_Left', 'expr': '*' },
39
- { 'name': 'align_center', 'title': 'Align_Center', 'expr': '*' },
40
- { 'name': 'align_right', 'title': 'Align_Left', 'expr': '*' }
41
- ],
42
-
43
- dialog: jQuery(jQuery('#cms_dialog').get(0) || jQuery('<div id="cms_dialog"></div>')),
44
-
45
- boxHtml: '<div class="wym_box">'
46
- + '<div class="wym_toolbar">'
47
- + WYMeditor.CONTAINERS
48
- + WYMeditor.CLASSES
49
- + WYMeditor.TOOLS
50
- + '</div>'
51
- + '<div class="wym_area_main">'
52
- + WYMeditor.HTML
53
- + WYMeditor.IFRAME
54
- + '</div>'
55
- + '</div>',
56
-
57
- containersHtml: '<ul class="wym_containers wym_toolbar_section">'
58
- + WYMeditor.CONTAINERS_ITEMS
59
- + '</ul>',
60
-
61
- toolsHtml: '<ul class="wym_tools wym_toolbar_section">'
62
- + WYMeditor.TOOLS_ITEMS
63
- + '</ul>',
64
-
65
- classesHtml: '<ul class="wym_classes wym_toolbar_section">'
66
- + WYMeditor.CLASSES_ITEMS
67
- + '</ul>',
68
-
69
- htmlHtml: '<div class="wym_html">'
70
- + '<textarea class="wym_html_val"></textarea>'
71
- + '</div>',
72
-
73
- dialogLinkHtml: '<form id="wym_dialog_form">'
74
- + '<div class="form_element">'
75
- + '<div class="label">'
76
- + '<label>{URL}</label>'
77
- + '</div>'
78
- + '<div class="value">'
79
- + '<input type="text" name="href"/>'
80
- + '</div>'
81
- + '</div>'
82
- + '<div class="form_element">'
83
- + '<div class="label">'
84
- + '<label>{Title}</label>'
85
- + '</div>'
86
- + '<div class="value">'
87
- + '<input type="text" name="title"/>'
88
- + '</div>'
89
- + '</div>'
90
- + '<div class="form_element submit_element">'
91
- + '<div class="value">'
92
- + '<input name="commit" type="submit" value="{Submit}" />'
93
- + '</div>'
94
- + '</div>'
95
- + '</form>',
96
-
97
- dialogImageHtml: '<form id="wym_dialog_form">'
98
- + '<div class="form_element">'
99
- + '<div class="label">'
100
- + '<label>{URL}</label>'
101
- + '</div>'
102
- + '<div class="value">'
103
- + '<input type="text" name="src"/>'
104
- + '</div>'
105
- + '</div>'
106
- + '<div class="form_element">'
107
- + '<div class="label">'
108
- + '<label>{Alternative_Text}</label>'
109
- + '</div>'
110
- + '<div class="value">'
111
- + '<input type="text" name="alt"/>'
112
- + '</div>'
113
- + '</div>'
114
- + '<div class="form_element">'
115
- + '<div class="label">'
116
- + '<label>{Title}</label>'
117
- + '</div>'
118
- + '<div class="value">'
119
- + '<input type="text" name="title"/>'
120
- + '</div>'
121
- + '</div>'
122
- + '<div class="form_element submit_element">'
123
- + '<div class="value">'
124
- + '<input name="commit" type="submit" value="{Submit}" />'
125
- + '</div>'
126
- + '</div>'
127
- + '</form>',
128
-
129
- dialogTableHtml: '<form id="wym_dialog_form">'
130
- + '<div class="form_element">'
131
- + '<div class="label">'
132
- + '<label>{Caption}</label>'
133
- + '</div>'
134
- + '<div class="value">'
135
- + '<input type="text" name="caption"></textarea>'
136
- + '</div>'
137
- + '</div>'
138
- + '<div class="form_element">'
139
- + '<div class="label">'
140
- + '<label>{Summary}</label>'
141
- + '</div>'
142
- + '<div class="value">'
143
- + '<input type="text" name="summary"></textarea>'
144
- + '</div>'
145
- + '</div>'
146
- + '<div class="form_element">'
147
- + '<div class="label">'
148
- + '<label>{Number_Of_Rows}</label>'
149
- + '</div>'
150
- + '<div class="value">'
151
- + '<input type="text" name="rows"></textarea>'
152
- + '</div>'
153
- + '</div>'
154
- + '<div class="form_element">'
155
- + '<div class="label">'
156
- + '<label>{Number_Of_Cols}</label>'
157
- + '</div>'
158
- + '<div class="value">'
159
- + '<input type="text" name="cols"></textarea>'
160
- + '</div>'
161
- + '</div>'
162
- + '<div class="form_element submit_element">'
163
- + '<div class="value">'
164
- + '<input name="commit" type="submit" value="{Submit}" />'
165
- + '</div>'
166
- + '</div>'
167
- + '</form>',
168
-
169
- dialogPasteHtml: '<form id="wym_dialog_form">'
170
- + '<div class="form_element">'
171
- + '<div class="label">'
172
- + '<label>{Paste_From_Word}</label>'
173
- + '</div>'
174
- + '<div class="value">'
175
- + '<textarea name="paste"></textarea>'
176
- + '</div>'
177
- + '</div>'
178
- + '<div class="form_element submit_element">'
179
- + '<div class="value">'
180
- + '<input name="commit" type="submit" value="{Submit}" />'
181
- + '</div>'
182
- + '</div>'
183
- + '</form>'
184
- };
185
-
186
- // -- New dialog pop-up -----------------------------------------------------
187
- WYMeditor.editor.prototype.dialog = function( dialogType, dialogFeatures, bodyHtml ) {
188
-
189
- var body = '';
190
- switch(dialogType) {
191
- case WYMeditor.DIALOG_LINK:
192
- body = this._options.dialogLinkHtml;
193
- break;
194
- case WYMeditor.DIALOG_IMAGE:
195
- body = this._options.dialogImageHtml;
196
- break;
197
- case WYMeditor.DIALOG_TABLE:
198
- body = this._options.dialogTableHtml;
199
- break;
200
- case WYMeditor.DIALOG_PASTE:
201
- body = this._options.dialogPasteHtml;
202
- break;
203
- default:
204
- body = bodyHtmls;
205
- }
206
-
207
- this._options.dialog.html(this.replaceStrings(body));
208
- this._options.dialog.dialog({
209
- title: this.replaceStrings(this.encloseString(dialogType)),
210
- modal: true,
211
- width: 800,
212
- resizable: false
213
- });
214
-
215
- WYMeditor.INIT_DIALOG(this, dialogType);
216
- };
217
-
218
- // -- Dialog processing -----------------------------------------------------
219
- WYMeditor.INIT_DIALOG = function(wym, type) {
220
- var form = jQuery('form#wym_dialog_form');
221
- var selected = wym.selected();
222
-
223
- if(selected) {
224
- form.find('input[name="href"]').val(jQuery(selected).attr(WYMeditor.HREF));
225
- form.find('input[name="src"]').val(jQuery(selected).attr(WYMeditor.SRC));
226
- form.find('input[name="title"]').val(jQuery(selected).attr(WYMeditor.TITLE));
227
- form.find('input[name="alt"]').val(jQuery(selected).attr(WYMeditor.ALT));
228
- }
229
- if(wym._selected_image) {
230
- form.find('input[name="src"]').val(jQuery(wym._selected_image).attr(WYMeditor.SRC));
231
- form.find('input[name="alt"]').val(jQuery(wym._selected_image).attr(WYMeditor.ALT));
232
- form.find('input[name="title"]').val(jQuery(wym._selected_image).attr(WYMeditor.TITLE));
233
- }
234
-
235
- form.submit(function(){
236
- var data = { };
237
- var form_data = $(this).serializeArray();
238
- jQuery.each(form_data, function(){
239
- if (data[this.name] !== undefined) {
240
- if (!data[this.name].push) {
241
- data[this.name] = [data[this.name]];
242
- }
243
- data[this.name].push(this.value || '');
244
- } else {
245
- data[this.name] = this.value || '';
246
- }
247
- });
248
-
249
- switch(type){
250
- case WYMeditor.DIALOG_LINK:
251
- WYMeditor.PROCESS_DIALOG_LINK(wym, data);
252
- break;
253
- case WYMeditor.DIALOG_IMAGE:
254
- WYMeditor.PROCESS_DIALOG_IMAGE(wym, data);
255
- break;
256
- case WYMeditor.DIALOG_TABLE:
257
- WYMeditor.PROCESS_DIALOG_TABLE(wym, data);
258
- break;
259
- case WYMeditor.DIALOG_PASTE:
260
- WYMeditor.PROCESS_DIALOG_PASTE(wym, data);
261
- break;
262
- }
263
-
264
- wym._options.dialog.dialog('close');
265
- return false;
266
- })
267
- }
268
-
269
- WYMeditor.PROCESS_DIALOG_LINK = function(wym, data) {
270
- var sStamp = wym.uniqueStamp();
271
- var selected = wym.selected();
272
-
273
- //ensure that we select the link to populate the fields
274
- if(selected && selected.tagName && selected.tagName.toLowerCase != WYMeditor.A) {
275
- selected = jQuery(selected).parentsOrSelf(WYMeditor.A);
276
- }
277
- //fix MSIE selection if link image has been clicked
278
- if(!selected && wym._selected_image){
279
- selected = jQuery(wym._selected_image).parentsOrSelf(WYMeditor.A);
280
- }
281
-
282
- var sUrl = data['href'];
283
- if(sUrl.length > 0) {
284
- var link;
285
- if (selected[0] && selected[0].tagName.toLowerCase() == WYMeditor.A) {
286
- link = selected;
287
- } else {
288
- wym._exec(WYMeditor.CREATE_LINK, sStamp);
289
- link = jQuery("a[href=" + sStamp + "]", wym._doc.body);
290
- }
291
- link.attr(WYMeditor.HREF, sUrl).attr(WYMeditor.TITLE, data['title']);
292
- }
293
- }
294
-
295
- WYMeditor.PROCESS_DIALOG_IMAGE = function(wym, data) {
296
- var sStamp = wym.uniqueStamp();
297
-
298
- var sUrl = data['src'];
299
- if(sUrl.length > 0) {
300
- wym._exec(WYMeditor.INSERT_IMAGE, sStamp);
301
-
302
- jQuery("img[src$=" + sStamp + "]", wym._doc.body)
303
- .attr(WYMeditor.SRC, sUrl)
304
- .attr(WYMeditor.TITLE, data['title'])
305
- .attr(WYMeditor.ALT, data['alt']);
306
- }
307
- }
308
-
309
- WYMeditor.PROCESS_DIALOG_TABLE = function(wym, data) {
310
- var iRows = data['rows'];
311
- var iCols = data['cols'];
312
- if(iRows > 0 && iCols > 0) {
313
- var table = wym._doc.createElement(WYMeditor.TABLE);
314
- var newRow = null;
315
- var newCol = null;
316
- var sCaption = data['caption'];
317
- var newCaption = table.createCaption();
318
- newCaption.innerHTML = sCaption;
319
- for(x=0; x<iRows; x++) {
320
- newRow = table.insertRow(x);
321
- for(y=0; y<iCols; y++) {newRow.insertCell(y);}
322
- }
323
- jQuery(table).attr('summary', data['summary']);
324
- var node = jQuery(wym.findUp(wym.container(), WYMeditor.MAIN_CONTAINERS)).get(0);
325
- if(!node || !node.parentNode){
326
- jQuery(wym._doc.body).append(table);
327
- } else {
328
- jQuery(node).after(table);
329
- }
330
- }
331
- }
332
-
333
- WYMeditor.PROCESS_DIALOG_PASTE = function(wym, data) {
334
- wym.paste(data['paste']);
335
- }
336
-
337
- WYMeditor.editor.prototype.xhtml = function() {
338
- var html = this.parser.parse(this.html());
339
- var reg = /(>)(<)(\/*)/g;
340
- html = html.replace(reg, '$1\r\n$2$3');
341
- return html;
342
- };