refinerycms-wymeditor 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (129) hide show
  1. data/.gitignore +88 -0
  2. data/app/assets/images/wymeditor/skins/refinery/arrow_redo.png +0 -0
  3. data/app/assets/images/wymeditor/skins/refinery/arrow_undo.png +0 -0
  4. data/app/assets/images/wymeditor/skins/refinery/eye.png +0 -0
  5. data/app/assets/images/wymeditor/skins/refinery/html5/article.png +0 -0
  6. data/app/assets/images/wymeditor/skins/refinery/html5/aside.png +0 -0
  7. data/app/assets/images/wymeditor/skins/refinery/html5/blockquote.png +0 -0
  8. data/app/assets/images/wymeditor/skins/refinery/html5/command.png +0 -0
  9. data/app/assets/images/wymeditor/skins/refinery/html5/details.png +0 -0
  10. data/app/assets/images/wymeditor/skins/refinery/html5/figcaption.png +0 -0
  11. data/app/assets/images/wymeditor/skins/refinery/html5/figure.png +0 -0
  12. data/app/assets/images/wymeditor/skins/refinery/html5/footer.png +0 -0
  13. data/app/assets/images/wymeditor/skins/refinery/html5/h1.png +0 -0
  14. data/app/assets/images/wymeditor/skins/refinery/html5/h2.png +0 -0
  15. data/app/assets/images/wymeditor/skins/refinery/html5/h3.png +0 -0
  16. data/app/assets/images/wymeditor/skins/refinery/html5/h4.png +0 -0
  17. data/app/assets/images/wymeditor/skins/refinery/html5/h5.png +0 -0
  18. data/app/assets/images/wymeditor/skins/refinery/html5/h6.png +0 -0
  19. data/app/assets/images/wymeditor/skins/refinery/html5/header.png +0 -0
  20. data/app/assets/images/wymeditor/skins/refinery/html5/hgroup.png +0 -0
  21. data/app/assets/images/wymeditor/skins/refinery/html5/mark.png +0 -0
  22. data/app/assets/images/wymeditor/skins/refinery/html5/meter.png +0 -0
  23. data/app/assets/images/wymeditor/skins/refinery/html5/nav.png +0 -0
  24. data/app/assets/images/wymeditor/skins/refinery/html5/p.png +0 -0
  25. data/app/assets/images/wymeditor/skins/refinery/html5/pre.png +0 -0
  26. data/app/assets/images/wymeditor/skins/refinery/html5/progress.png +0 -0
  27. data/app/assets/images/wymeditor/skins/refinery/html5/readme.md +1 -0
  28. data/app/assets/images/wymeditor/skins/refinery/html5/rp.png +0 -0
  29. data/app/assets/images/wymeditor/skins/refinery/html5/rt.png +0 -0
  30. data/app/assets/images/wymeditor/skins/refinery/html5/ruby.png +0 -0
  31. data/app/assets/images/wymeditor/skins/refinery/html5/section.png +0 -0
  32. data/app/assets/images/wymeditor/skins/refinery/html5/summary.png +0 -0
  33. data/app/assets/images/wymeditor/skins/refinery/html5/time.png +0 -0
  34. data/app/assets/images/wymeditor/skins/refinery/iframe/lbl-blockquote.png +0 -0
  35. data/app/assets/images/wymeditor/skins/refinery/iframe/lbl-h1.png +0 -0
  36. data/app/assets/images/wymeditor/skins/refinery/iframe/lbl-h2.png +0 -0
  37. data/app/assets/images/wymeditor/skins/refinery/iframe/lbl-h3.png +0 -0
  38. data/app/assets/images/wymeditor/skins/refinery/iframe/lbl-h4.png +0 -0
  39. data/app/assets/images/wymeditor/skins/refinery/iframe/lbl-h5.png +0 -0
  40. data/app/assets/images/wymeditor/skins/refinery/iframe/lbl-h6.png +0 -0
  41. data/app/assets/images/wymeditor/skins/refinery/iframe/lbl-p.png +0 -0
  42. data/app/assets/images/wymeditor/skins/refinery/iframe/lbl-pre.png +0 -0
  43. data/app/assets/images/wymeditor/skins/refinery/link_add.png +0 -0
  44. data/app/assets/images/wymeditor/skins/refinery/link_break.png +0 -0
  45. data/app/assets/images/wymeditor/skins/refinery/page_code.png +0 -0
  46. data/app/assets/images/wymeditor/skins/refinery/page_paste.png +0 -0
  47. data/app/assets/images/wymeditor/skins/refinery/photo_add.png +0 -0
  48. data/app/assets/images/wymeditor/skins/refinery/right.png +0 -0
  49. data/app/assets/images/wymeditor/skins/refinery/style.png +0 -0
  50. data/app/assets/images/wymeditor/skins/refinery/table_add.png +0 -0
  51. data/app/assets/images/wymeditor/skins/refinery/text_align_center.png +0 -0
  52. data/app/assets/images/wymeditor/skins/refinery/text_align_justify.png +0 -0
  53. data/app/assets/images/wymeditor/skins/refinery/text_align_left.png +0 -0
  54. data/app/assets/images/wymeditor/skins/refinery/text_align_right.png +0 -0
  55. data/app/assets/images/wymeditor/skins/refinery/text_bold.png +0 -0
  56. data/app/assets/images/wymeditor/skins/refinery/text_heading_1.png +0 -0
  57. data/app/assets/images/wymeditor/skins/refinery/text_heading_2.png +0 -0
  58. data/app/assets/images/wymeditor/skins/refinery/text_heading_3.png +0 -0
  59. data/app/assets/images/wymeditor/skins/refinery/text_heading_4.png +0 -0
  60. data/app/assets/images/wymeditor/skins/refinery/text_heading_5.png +0 -0
  61. data/app/assets/images/wymeditor/skins/refinery/text_heading_6.png +0 -0
  62. data/app/assets/images/wymeditor/skins/refinery/text_indent.png +0 -0
  63. data/app/assets/images/wymeditor/skins/refinery/text_indent_remove.png +0 -0
  64. data/app/assets/images/wymeditor/skins/refinery/text_italic.png +0 -0
  65. data/app/assets/images/wymeditor/skins/refinery/text_list_bullets.png +0 -0
  66. data/app/assets/images/wymeditor/skins/refinery/text_list_numbers.png +0 -0
  67. data/app/assets/images/wymeditor/skins/refinery/text_paragraph.png +0 -0
  68. data/app/assets/images/wymeditor/skins/refinery/text_strikethrough.png +0 -0
  69. data/app/assets/images/wymeditor/skins/refinery/text_subscript.png +0 -0
  70. data/app/assets/images/wymeditor/skins/refinery/text_superscript.png +0 -0
  71. data/app/assets/images/wymeditor/skins/refinery/text_underline.png +0 -0
  72. data/app/assets/images/wymeditor/skins/wymeditor_icon.png +0 -0
  73. data/app/assets/javascripts/refinery/boot_wym.js.erb +289 -0
  74. data/app/assets/javascripts/refinery/wymeditor.js +37 -0
  75. data/app/assets/javascripts/wymeditor/browsers/ie.js.erb +224 -0
  76. data/app/assets/javascripts/wymeditor/browsers/mozilla.js.erb +293 -0
  77. data/app/assets/javascripts/wymeditor/browsers/opera.js.erb +123 -0
  78. data/app/assets/javascripts/wymeditor/browsers/webkit.js.erb +284 -0
  79. data/app/assets/javascripts/wymeditor/classes.js.erb +1577 -0
  80. data/app/assets/javascripts/wymeditor/functions.js.erb +218 -0
  81. data/app/assets/javascripts/wymeditor/lang/bg.js +57 -0
  82. data/app/assets/javascripts/wymeditor/lang/ca.js +45 -0
  83. data/app/assets/javascripts/wymeditor/lang/cs.js +58 -0
  84. data/app/assets/javascripts/wymeditor/lang/da.js +48 -0
  85. data/app/assets/javascripts/wymeditor/lang/de.js +45 -0
  86. data/app/assets/javascripts/wymeditor/lang/en.js +57 -0
  87. data/app/assets/javascripts/wymeditor/lang/es.js +58 -0
  88. data/app/assets/javascripts/wymeditor/lang/fa.js +46 -0
  89. data/app/assets/javascripts/wymeditor/lang/fi.js +57 -0
  90. data/app/assets/javascripts/wymeditor/lang/fr.js +57 -0
  91. data/app/assets/javascripts/wymeditor/lang/he.js +45 -0
  92. data/app/assets/javascripts/wymeditor/lang/hu.js +45 -0
  93. data/app/assets/javascripts/wymeditor/lang/it.js +48 -0
  94. data/app/assets/javascripts/wymeditor/lang/ja.js +47 -0
  95. data/app/assets/javascripts/wymeditor/lang/lv.js +47 -0
  96. data/app/assets/javascripts/wymeditor/lang/nb.js +48 -0
  97. data/app/assets/javascripts/wymeditor/lang/nl.js +47 -0
  98. data/app/assets/javascripts/wymeditor/lang/nn.js +45 -0
  99. data/app/assets/javascripts/wymeditor/lang/pl.js +45 -0
  100. data/app/assets/javascripts/wymeditor/lang/pt-BR.js +58 -0
  101. data/app/assets/javascripts/wymeditor/lang/pt.js +45 -0
  102. data/app/assets/javascripts/wymeditor/lang/rs.js +47 -0
  103. data/app/assets/javascripts/wymeditor/lang/ru.js +56 -0
  104. data/app/assets/javascripts/wymeditor/lang/sk.js +56 -0
  105. data/app/assets/javascripts/wymeditor/lang/sl.js +47 -0
  106. data/app/assets/javascripts/wymeditor/lang/sv.js +45 -0
  107. data/app/assets/javascripts/wymeditor/lang/tr.js +45 -0
  108. data/app/assets/javascripts/wymeditor/lang/vi.js +47 -0
  109. data/app/assets/javascripts/wymeditor/lang/zh_cn.js +47 -0
  110. data/app/assets/javascripts/wymeditor/prototypes.js.erb +1106 -0
  111. data/app/assets/javascripts/wymeditor/setup.js.erb +622 -0
  112. data/app/assets/javascripts/wymeditor/skins/refinery/skin.js +48 -0
  113. data/app/assets/javascripts/wymeditor/validators.js.erb +776 -0
  114. data/app/assets/stylesheets/theme.css.scss +36 -0
  115. data/app/assets/stylesheets/wymeditor/skins/refinery/skin.css.scss +530 -0
  116. data/app/assets/stylesheets/wymeditor/skins/refinery/wymiframe.css.scss +156 -0
  117. data/app/assets/stylesheets/wymeditor.css.scss +0 -0
  118. data/app/controllers/refinery/wymeditor_controller.rb +9 -0
  119. data/app/views/refinery/wymiframe.html.erb +14 -0
  120. data/config/initializers/refinery/wymeditor.rb.erb +4 -0
  121. data/lib/refinery/wymeditor/configuration.rb +10 -0
  122. data/lib/refinery/wymeditor/engine.rb +30 -0
  123. data/lib/refinery/wymeditor.rb +12 -0
  124. data/public/wymeditor/GPL-license.txt +278 -0
  125. data/public/wymeditor/MIT-license.txt +20 -0
  126. data/public/wymeditor/README +35 -0
  127. data/readme.md +96 -0
  128. data/refinerycms-wymeditor.gemspec +17 -0
  129. metadata +173 -0
data/.gitignore ADDED
@@ -0,0 +1,88 @@
1
+ # Rails
2
+ .bundle
3
+ db/*.sqlite3
4
+ db/*.sqlite3-journal
5
+ *.log
6
+ tmp
7
+ tmp/**/*
8
+ pkg
9
+ spec/dummy
10
+
11
+ # Documentation
12
+ doc/api
13
+ doc/app
14
+ .yardoc
15
+ .yardopts
16
+ coverage
17
+
18
+ # Public Uploads
19
+ public/system/*
20
+ public/themes/*
21
+
22
+ # Public Cache
23
+ public/javascripts/cache
24
+ public/stylesheets/cache
25
+
26
+ # Vendor Cache
27
+ vendor/cache
28
+
29
+ # Acts as Indexed
30
+ index/**/*
31
+
32
+ # Refinery Specific
33
+ *.tmproj
34
+ *.autobackupbyrefinery.*
35
+ refinerycms-*.gem
36
+ .autotest
37
+
38
+ # Mac
39
+ .DS_Store
40
+
41
+ # Windows
42
+ Thumbs.db
43
+
44
+ # NetBeans
45
+ nbproject
46
+
47
+ # Eclipse
48
+ .project
49
+
50
+ # Redcar
51
+ .redcar
52
+
53
+ # Rubinius
54
+ *.rbc
55
+ *.rbx
56
+
57
+ # Vim
58
+ *.swp
59
+ *.swo
60
+
61
+ # RubyMine
62
+ .idea
63
+
64
+ # E-texteditor
65
+ .eprj
66
+
67
+ # Backup
68
+ *~
69
+
70
+ # Capybara Bug
71
+ capybara-*html
72
+
73
+ # sass
74
+ .sass-cache
75
+ .sass-cache/*
76
+
77
+ #rvm
78
+ .rvmrc
79
+ .rvmrc.*
80
+
81
+ #rbenv
82
+ .rbenv-version
83
+
84
+ #Sprockets
85
+ public/assets
86
+
87
+ #Gemfile's lock file
88
+ Gemfile.lock
@@ -0,0 +1 @@
1
+ Labels are made using the [Visitor font](http://www.dafont.com/visitor.font), 9.5px, no anti-aliasing.
@@ -0,0 +1,289 @@
1
+ onOpenDialog = function(dialog) {
2
+ (dialog = $('.ui-dialog')).find('.ui-dialog-titlebar').corner('1px top');
3
+ if(!$.browser.msie){
4
+ dialog.corner('6px');
5
+ }
6
+ if (dialog.height() < $(window).height()) {
7
+ if(iframed()) {
8
+ $(parent.document.body).addClass('hide-overflow');
9
+ } else {
10
+ $(document.body).addClass('hide-overflow');
11
+ }
12
+ }
13
+ };
14
+
15
+ onCloseDialog = function(dialog) {
16
+ if(iframed()) {
17
+ $(parent.document.body).removeClass('hide-overflow');
18
+ } else {
19
+ $(document.body).removeClass('hide-overflow');
20
+ }
21
+ };
22
+
23
+ WYMeditor.onload_functions = [];
24
+ var wymeditor_inputs = [];
25
+ var wymeditors_loaded = 0;
26
+ // supply custom_wymeditor_boot_options if you want to override anything here.
27
+ if (typeof(custom_wymeditor_boot_options) == "undefined") { custom_wymeditor_boot_options = {}; }
28
+ var form_actions =
29
+ "<div id='dialog-form-actions' class='form-actions'>"
30
+ + "<div class='form-actions-left'>"
31
+ + "<input id='submit_button' class='wym_submit button' type='submit' value='{Insert}' class='button' />"
32
+ + "<a href='' class='wym_cancel close_dialog button'>{Cancel}</a>"
33
+ + "</div>"
34
+ + "</div>";
35
+ var wymeditor_boot_options = $.extend({
36
+ skin: 'refinery'
37
+ , basePath: "/"
38
+ , wymPath: "/assets/wymeditor/jquery.refinery.wymeditor.js"
39
+ , cssSkinPath: "/assets/wymeditor/skins/"
40
+ , jsSkinPath: "/assets/wymeditor/skins/"
41
+ , langPath: "/assets/wymeditor/lang/"
42
+ , iframeBasePath: '/'
43
+ , classesItems: [
44
+ {name: 'text-align', rules:[{name: 'left', title: '{Left}'}, {name: 'center', title: '{Center}'}, {name: 'right', title: '{Right}'}, {name: 'justify', title: '{Justify}'}], join: '-', title: '{Text_Align}'}
45
+ , {name: 'image-align', rules:[{name: 'left', title: '{Left}'}, {name: 'right', title: '{Right}'}], join: '-', title: '{Image_Align}'}
46
+ , {name: 'font-size', rules:[{name: 'small', title: '{Small}'}, {name: 'normal', title: '{Normal}'}, {name: 'large', title: '{Large}'}], join: '-', title: '{Font_Size}'}
47
+ ]
48
+
49
+ , containersItems: [
50
+ {'name': 'h1', 'title':'Heading_1', 'css':'wym_containers_h1'}
51
+ , {'name': 'h2', 'title':'Heading_2', 'css':'wym_containers_h2'}
52
+ , {'name': 'h3', 'title':'Heading_3', 'css':'wym_containers_h3'}
53
+ , {'name': 'p', 'title':'Paragraph', 'css':'wym_containers_p'}
54
+ ]
55
+ , toolsItems: [
56
+ {'name': 'Bold', 'title': 'Bold', 'css': 'wym_tools_strong'}
57
+ ,{'name': 'Italic', 'title': 'Emphasis', 'css': 'wym_tools_emphasis'}
58
+ ,{'name': 'InsertUnorderedList', 'title': 'Unordered_List', 'css': 'wym_tools_unordered_list'}
59
+ ,{'name': 'InsertOrderedList', 'title': 'Ordered_List', 'css': 'wym_tools_ordered_list'}
60
+ /*,{'name': 'Indent', 'title': 'Indent', 'css': 'wym_tools_indent'}
61
+ ,{'name': 'Outdent', 'title': 'Outdent', 'css': 'wym_tools_outdent'}
62
+ ,{'name': 'Undo', 'title': 'Undo', 'css': 'wym_tools_undo'}
63
+ ,{'name': 'Redo', 'title': 'Redo', 'css': 'wym_tools_redo'}*/
64
+ ,{'name': 'CreateLink', 'title': 'Link', 'css': 'wym_tools_link'}
65
+ ,{'name': 'Unlink', 'title': 'Unlink', 'css': 'wym_tools_unlink'}
66
+ ,{'name': 'InsertImage', 'title': 'Image', 'css': 'wym_tools_image'}
67
+ ,{'name': 'InsertTable', 'title': 'Table', 'css': 'wym_tools_table'}
68
+ //,{'name': 'Paste', 'title': 'Paste_From_Word', 'css': 'wym_tools_paste'}
69
+ ,{'name': 'ToggleHtml', 'title': 'HTML', 'css': 'wym_tools_html'}
70
+ ]
71
+
72
+ ,toolsHtml: "<ul class='wym_tools wym_section wym_buttons'>"
73
+ + WYMeditor.TOOLS_ITEMS
74
+ + "</ul>"
75
+
76
+ ,toolsItemHtml:
77
+ "<li class='" + WYMeditor.TOOL_CLASS + "'>"
78
+ + "<a href='#' name='" + WYMeditor.TOOL_NAME + "' title='" + WYMeditor.TOOL_TITLE + "' class='no-tooltip'>"
79
+ + WYMeditor.TOOL_TITLE
80
+ + "</a>"
81
+ + "</li>"
82
+
83
+ , classesHtml: "<ul class='wym_classes_container wym_section wym_buttons'>"
84
+ + "<li class='wym_tools_class'>"
85
+ + "<a href='#' name='" + WYMeditor.APPLY_CLASS + "' title='"+ WYMeditor.APPLY_CLASS +"' class='no-tooltip'>"
86
+ + WYMeditor.APPLY_CLASS
87
+ + "</a>"
88
+ + "<ul class='wym_classes wym_classes_hidden'>" + WYMeditor.CLASSES_ITEMS + "</ul>"
89
+ + "</li>"
90
+ + "</ul>"
91
+
92
+ , classesItemHtml: "<li><a href='#' name='"+ WYMeditor.CLASS_NAME + "'>"+ WYMeditor.CLASS_TITLE+ "</a></li>"
93
+ , classesItemHtmlMultiple: "<li class='wym_tools_class_multiple_rules'>"
94
+ + "<span>" + WYMeditor.CLASS_TITLE + "</span>"
95
+ + "<ul>{classesItemHtml}</ul>"
96
+ +"</li>"
97
+
98
+ , containersHtml: "<ul class='wym_containers wym_section'>" + WYMeditor.CONTAINERS_ITEMS + "</ul>"
99
+
100
+ , containersItemHtml:
101
+ "<li class='" + WYMeditor.CONTAINER_CLASS + "'>"
102
+ + "<a href='#' name='" + WYMeditor.CONTAINER_NAME + "' title='" + WYMeditor.CONTAINER_TITLE + "' class='no-tooltip'></a>"
103
+ + "</li>"
104
+
105
+ , boxHtml:
106
+ "<div class='wym_box'>"
107
+ + "<div class='wym_area_top clearfix'>"
108
+ + WYMeditor.CONTAINERS
109
+ + WYMeditor.TOOLS
110
+ + WYMeditor.CLASSES
111
+ + "</div>"
112
+ + "<div class='wym_area_main'>"
113
+ + WYMeditor.HTML
114
+ + WYMeditor.IFRAME
115
+ + WYMeditor.STATUS
116
+ + "</div>"
117
+ + "</div>"
118
+
119
+ , iframeHtml:
120
+ "<div class='wym_iframe wym_section'>"
121
+ + "<iframe id='WYMeditor_" + WYMeditor.INDEX + "'" + ($.browser.msie ? " src='" + WYMeditor.IFRAME_BASE_PATH + "wymiframe'" : "")
122
+ + " frameborder='0' marginheight='0' marginwidth='0' border='0'"
123
+ + " onload='this.contentWindow.parent.WYMeditor.INSTANCES[" + WYMeditor.INDEX + "].loadIframe(this);'></iframe>"
124
+ +"</div>"
125
+
126
+ , dialogImageHtml: ""
127
+
128
+ , dialogLinkHtml: ""
129
+
130
+ , dialogTableHtml:
131
+ "<div class='wym_dialog wym_dialog_table'>"
132
+ + "<form>"
133
+ + "<input type='hidden' id='wym_dialog_type' class='wym_dialog_type' value='"+ WYMeditor.DIALOG_TABLE + "' />"
134
+ + "<div class='field'>"
135
+ + "<label for='wym_caption'>{Caption}</label>"
136
+ + "<input type='text' id='wym_caption' class='wym_caption' value='' size='40' />"
137
+ + "</div>"
138
+ + "<div class='field'>"
139
+ + "<label for='wym_rows'>{Number_Of_Rows}</label>"
140
+ + "<input type='text' id='wym_rows' class='wym_rows' value='3' size='3' />"
141
+ + "</div>"
142
+ + "<div class='field'>"
143
+ + "<label for='wym_cols'>{Number_Of_Cols}</label>"
144
+ + "<input type='text' id='wym_cols' class='wym_cols' value='2' size='3' />"
145
+ + "</div>"
146
+ + form_actions
147
+ + "</form>"
148
+ + "</div>"
149
+
150
+ , dialogPasteHtml:
151
+ "<div class='wym_dialog wym_dialog_paste'>"
152
+ + "<form>"
153
+ + "<input type='hidden' id='wym_dialog_type' class='wym_dialog_type' value='" + WYMeditor.DIALOG_PASTE + "' />"
154
+ + "<div class='field'>"
155
+ + "<textarea class='wym_text' rows='10' cols='50'></textarea>"
156
+ + "</div>"
157
+ + form_actions
158
+ + "</form>"
159
+ + "</div>"
160
+
161
+ , dialogPath: "/refinery/dialogs/"
162
+ , dialogFeatures: {
163
+ width: 866
164
+ , height: 455
165
+ , modal: true
166
+ , draggable: true
167
+ , resizable: false
168
+ , autoOpen: true
169
+ , open: onOpenDialog
170
+ , close: onCloseDialog
171
+ }
172
+ , dialogInlineFeatures: {
173
+ width: 600
174
+ , height: 485
175
+ , modal: true
176
+ , draggable: true
177
+ , resizable: false
178
+ , autoOpen: true
179
+ , open: onOpenDialog
180
+ , close: onCloseDialog
181
+ }
182
+
183
+ , dialogId: 'editor_dialog'
184
+
185
+ , dialogHtml:
186
+ "<!DOCTYPE html>"
187
+ + "<html dir='" + WYMeditor.DIRECTION + "'>"
188
+ + "<head>"
189
+ + "<link rel='stylesheet' type='text/css' media='screen' href='" + WYMeditor.CSS_PATH + "' />"
190
+ + "<title>" + WYMeditor.DIALOG_TITLE + "</title>"
191
+ + "<script type='text/javascript' src='" + WYMeditor.JQUERY_PATH + "'></script>"
192
+ + "<script type='text/javascript' src='" + WYMeditor.WYM_PATH + "'></script>"
193
+ + "</head>"
194
+ + "<body>"
195
+ + "<div id='page'>" + WYMeditor.DIALOG_BODY + "</div>"
196
+ + "</body>"
197
+ + "</html>"
198
+ , postInit: function(wym)
199
+ {
200
+ // register loaded
201
+ wymeditors_loaded += 1;
202
+
203
+ // fire loaded if all editors loaded
204
+ if(WYMeditor.INSTANCES.length == wymeditors_loaded){
205
+ $('.wym_loading_overlay').remove();
206
+
207
+ // load any functions that have been registered to happen onload.
208
+ // these will have to be registered BEFORE postInit is fired (which is fairly quickly).
209
+ for(i=0; i < WYMeditor.onload_functions.length; i++) {
210
+ WYMeditor.onload_functions[i]();
211
+ }
212
+ }
213
+
214
+ $(wym._iframe).contents().find('body').addClass('wym_iframe_body');
215
+
216
+ $('.field.hide-overflow').removeClass('hide-overflow').css('height', 'auto');
217
+ }
218
+ , postInitDialog: function(wym) {
219
+ if($.browser.msie) {
220
+ ($the_ui_dialog = $('.ui-dialog')).css('height',
221
+ $the_ui_dialog.find('iframe').height()
222
+ + $the_ui_dialog.find('iframe').contents().find('.form-actions').height()
223
+ - 12
224
+ );
225
+ }
226
+ }
227
+ , lang: '<%= ::Refinery::i18n_enabled? ? ::Refinery::I18n.current_locale : 'en' %>'
228
+ }, custom_wymeditor_boot_options);
229
+
230
+ WYMeditor.editor.prototype.loadIframe = function(iframe) {
231
+ var wym = this;
232
+
233
+ // Internet explorer doesn't like this (which versions??)
234
+ var doc = (iframe.contentDocument || iframe.contentWindow);
235
+ if(doc.document) {
236
+ doc = doc.document;
237
+ }
238
+ if (!$.browser.msie) {
239
+ doc.open('text/html', 'replace');
240
+ html = "<!DOCTYPE html>\
241
+ <html>\
242
+ <head>\
243
+ <title>WYMeditor</title>\
244
+ <meta charset='" + $('meta[charset]').attr('charset') + "' />\
245
+ <meta http-equiv='X-UA-Compatible' content='IE=edge,chrome=1' />\
246
+ </head>\
247
+ <body class='wym_iframe'>\
248
+ </body>\
249
+ </html>";
250
+ doc.write(html);
251
+ doc.close();
252
+
253
+ var doc_head = doc.head || $(doc).find('head').get(0);
254
+ $.each(["wymeditor/skins/refinery/wymiframe", "formatting", "theme"], function(i, href) {
255
+ $("<link href='/assets/" + href + ".css?"+Math.random().toString().split('.')[1]+"' media='all' rel='stylesheet' />").appendTo(doc_head);
256
+ });
257
+ }
258
+ if ((id_of_editor = wym._element.parent().attr('id')) != null) {
259
+ $(doc.body).addClass(id_of_editor);
260
+ }
261
+
262
+ wym.initIframe(iframe);
263
+ };
264
+
265
+ WYMeditor.init = function() {
266
+ wymeditor_inputs = $('.wymeditor').filter(function(index) {
267
+ for (i=0; i < WYMeditor.INSTANCES.length; i++) {
268
+ if (WYMeditor.INSTANCES[i]._element.attr('id') == $(this).attr('id')) {
269
+ return false;
270
+ }
271
+ }
272
+
273
+ return true;
274
+ });
275
+
276
+ wymeditor_inputs.each(function(input) {
277
+ if ((containing_field = $(this).parents('.field')).length > 0 && containing_field.get(0).style.height.replace('auto', '') === '') {
278
+ containing_field.addClass('hide-overflow')
279
+ .css('height', $(this).outerHeight() - containing_field.offset().top + $(this).offset().top + 45);
280
+ }
281
+ $(this).hide();
282
+ });
283
+
284
+ wymeditor_inputs.wymeditor(wymeditor_boot_options);
285
+ };
286
+
287
+ $(function(){
288
+ WYMeditor.init();
289
+ });
@@ -0,0 +1,37 @@
1
+ /*
2
+ * WYMeditor : what you see is What You Mean web-based editor
3
+ * Copyright (c) 2005 - 2009 Jean-Francois Hovinne, http://www.wymeditor.org/
4
+ * Dual licensed under the MIT (MIT-license.txt)
5
+ * and GPL (GPL-license.txt) licenses.
6
+ *
7
+ * For further information visit:
8
+ * http://www.wymeditor.org/
9
+ *
10
+ * File: jquery.refinery.wymeditor.js
11
+ *
12
+ * Main JS file with core classes and functions.
13
+ * See the documentation for more info.
14
+ *
15
+ * About: authors
16
+ *
17
+ * Jean-Francois Hovinne (jf.hovinne a-t wymeditor dotorg)
18
+ * Volker Mische (vmx a-t gmx dotde)
19
+ * Scott Lewis (lewiscot a-t gmail dotcom)
20
+ * Bermi Ferrer (wymeditor a-t bermi dotorg)
21
+ * Daniel Reszka (d.reszka a-t wymeditor dotorg)
22
+ * Jonatan Lundin (jonatan.lundin a-t gmail dotcom)
23
+ */
24
+
25
+ /*
26
+ Namespace: WYMeditor
27
+ Global WYMeditor namespace.
28
+ */
29
+ /*
30
+ *= require ../wymeditor/setup
31
+ *= require ../wymeditor/functions
32
+ *= require ../wymeditor/prototypes
33
+ *= require ../wymeditor/classes
34
+ *= require ../wymeditor/validators
35
+ *= require_tree ../wymeditor/browsers
36
+ *= require ./boot_wym
37
+ */