refinerycms-core 2.0.10 → 2.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (181) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/javascripts/refinery/admin.js.erb +126 -234
  3. data/app/assets/javascripts/refinery/ajaxy_pagination.js.coffee +1 -1
  4. data/app/assets/javascripts/refinery/boot_wym.js.erb +4 -8
  5. data/app/assets/javascripts/refinery/core.js +1 -1
  6. data/app/assets/javascripts/refinery/interface.js.coffee.erb +3 -16
  7. data/app/assets/javascripts/refinery/modal_dialogs.js.erb +0 -3
  8. data/app/assets/javascripts/refinery/nestedsortables.js +312 -312
  9. data/app/assets/javascripts/refinery/refinery.js.erb +14 -15
  10. data/app/assets/javascripts/refinery/site_bar.js +3 -9
  11. data/app/assets/javascripts/refinery/sortable_list.js +145 -0
  12. data/app/assets/javascripts/refinery/sortable_menu.js.coffee +3 -4
  13. data/app/assets/javascripts/refinery/submit_continue.js.coffee.erb +1 -2
  14. data/app/assets/javascripts/refinery/tree.js +3 -3
  15. data/app/assets/javascripts/refinery/wymeditor.js +6 -6
  16. data/{public → app/assets/javascripts}/wymeditor/GPL-license.txt +0 -0
  17. data/{public → app/assets/javascripts}/wymeditor/MIT-license.txt +0 -0
  18. data/{public → app/assets/javascripts}/wymeditor/README +0 -0
  19. data/app/assets/javascripts/wymeditor/browsers/mozilla.js.erb +10 -11
  20. data/app/assets/javascripts/wymeditor/browsers/webkit.js.erb +17 -18
  21. data/app/assets/javascripts/wymeditor/classes.js.erb +3 -5
  22. data/app/assets/javascripts/wymeditor/functions.js.erb +5 -1
  23. data/app/assets/javascripts/wymeditor/prototypes.js.erb +0 -3
  24. data/app/assets/javascripts/wymeditor/setup.js.erb +5 -5
  25. data/app/assets/javascripts/wymeditor/skins/refinery/skin.js +1 -4
  26. data/app/assets/javascripts/wymeditor/validators.js.erb +3 -2
  27. data/app/assets/stylesheets/{formatting.css.scss → refinery/formatting.css.scss} +0 -0
  28. data/app/assets/stylesheets/refinery/layout.css.scss +41 -11
  29. data/app/assets/stylesheets/{theme.css.scss → refinery/theme.css.scss} +0 -0
  30. data/app/controllers/refinery/sitemap_controller.rb +1 -5
  31. data/app/helpers/refinery/admin_helper.rb +6 -0
  32. data/app/helpers/refinery/image_helper.rb +2 -1
  33. data/app/helpers/refinery/menu_helper.rb +0 -49
  34. data/app/helpers/refinery/meta_helper.rb +7 -3
  35. data/app/helpers/refinery/site_bar_helper.rb +3 -15
  36. data/app/models/refinery/core/base_model.rb +2 -0
  37. data/{lib → app/presenters}/refinery/base_presenter.rb +1 -2
  38. data/app/views/layouts/application.html.erb +8 -7
  39. data/app/views/refinery/_content_page.html.erb +1 -1
  40. data/app/views/refinery/_google_analytics.html.erb +12 -5
  41. data/app/views/refinery/_head.html.erb +11 -15
  42. data/app/views/refinery/_header.html.erb +1 -4
  43. data/app/views/refinery/_javascripts.html.erb +14 -8
  44. data/app/views/refinery/_site_bar.html.erb +4 -4
  45. data/app/views/refinery/admin/_form_advanced_options_menu.html.erb +12 -0
  46. data/app/views/refinery/admin/_javascripts.html.erb +13 -1
  47. data/app/views/refinery/admin/_locale_picker.html.erb +11 -0
  48. data/app/views/refinery/admin/_make_sortable.html.erb +8 -5
  49. data/app/views/refinery/admin/_search.html.erb +1 -7
  50. data/app/views/refinery/admin/_search_header.html.erb +1 -0
  51. data/app/views/refinery/admin/_wysiwyg.html.erb +16 -0
  52. data/config/initializers/will_paginate_monkeypatch.rb +1 -1
  53. data/config/locales/bg.yml +5 -1
  54. data/config/locales/cs.yml +5 -1
  55. data/config/locales/da.yml +5 -1
  56. data/config/locales/de.yml +7 -3
  57. data/config/locales/el.yml +5 -1
  58. data/config/locales/en.yml +7 -1
  59. data/config/locales/es.yml +5 -1
  60. data/config/locales/fi.yml +5 -1
  61. data/config/locales/fr.yml +5 -1
  62. data/config/locales/hu.yml +82 -0
  63. data/config/locales/it.yml +38 -34
  64. data/config/locales/ja.yml +5 -1
  65. data/config/locales/ko.yml +5 -1
  66. data/config/locales/lt.yml +5 -1
  67. data/config/locales/lv.yml +5 -1
  68. data/config/locales/nb.yml +5 -1
  69. data/config/locales/nl.yml +36 -29
  70. data/config/locales/pl.yml +8 -1
  71. data/config/locales/pt-BR.yml +7 -3
  72. data/config/locales/pt.yml +82 -0
  73. data/config/locales/rs.yml +5 -1
  74. data/config/locales/ru.yml +5 -1
  75. data/config/locales/sk.yml +10 -3
  76. data/config/locales/sl.yml +5 -1
  77. data/config/locales/sv.yml +5 -1
  78. data/config/locales/tr.yml +82 -0
  79. data/config/locales/uk.yml +77 -0
  80. data/config/locales/vi.yml +5 -1
  81. data/config/locales/zh-CN.yml +5 -1
  82. data/config/locales/zh-TW.yml +5 -1
  83. data/config/routes.rb +3 -3
  84. data/lib/generators/refinery/cms/cms_generator.rb +29 -0
  85. data/lib/generators/refinery/cms/templates/.gitignore +1 -0
  86. data/lib/generators/refinery/cms/templates/app/views/sitemap/index.xml.builder +13 -13
  87. data/lib/generators/refinery/core/templates/config/initializers/refinery/core.rb.erb +8 -12
  88. data/lib/generators/refinery/dummy/templates/rails/database.yml +3 -3
  89. data/lib/generators/refinery/engine/engine_generator.rb +8 -12
  90. data/lib/generators/refinery/engine/templates/Gemfile +5 -39
  91. data/lib/generators/refinery/engine/templates/app/controllers/refinery/namespace/admin/plural_name_controller.rb.erb +4 -4
  92. data/lib/generators/refinery/engine/templates/app/models/refinery/namespace/singular_name.rb.erb +2 -3
  93. data/lib/generators/refinery/engine/templates/app/views/refinery/namespace/admin/plural_name/_actions.html.erb +1 -1
  94. data/lib/generators/refinery/engine/templates/app/views/refinery/namespace/admin/plural_name/_form.html.erb +31 -33
  95. data/lib/generators/refinery/engine/templates/app/views/refinery/namespace/admin/plural_name/_records.html.erb +1 -3
  96. data/lib/generators/refinery/engine/templates/app/views/refinery/namespace/admin/plural_name/_singular_name.html.erb +2 -2
  97. data/lib/generators/refinery/engine/templates/app/views/refinery/namespace/admin/plural_name/index.html.erb +1 -1
  98. data/lib/generators/refinery/engine/templates/config/locales/cs.yml +28 -0
  99. data/lib/generators/refinery/engine/templates/config/locales/it.yml +28 -0
  100. data/lib/generators/refinery/engine/templates/config/locales/nl.yml +6 -6
  101. data/lib/generators/refinery/engine/templates/config/locales/tr.yml +28 -0
  102. data/lib/generators/refinery/engine/templates/config/routes.rb.erb +2 -2
  103. data/lib/generators/refinery/engine/templates/db/seeds.rb.erb +1 -1
  104. data/lib/generators/refinery/engine/templates/lib/generators/refinery/extension_plural_name_generator.rb.erb +1 -1
  105. data/lib/generators/refinery/engine/templates/lib/refinery/plural_name/engine.rb.erb +1 -1
  106. data/lib/generators/refinery/engine/templates/spec/{requests → features}/refinery/namespace/admin/plural_name_spec.rb.erb +1 -1
  107. data/lib/generators/refinery/engine/templates/spec/spec_helper.rb +25 -49
  108. data/lib/generators/refinery/form/form_generator.rb +1 -13
  109. data/lib/generators/refinery/form/templates/app/models/refinery/namespace/singular_name.rb.erb +0 -4
  110. data/lib/generators/refinery/form/templates/app/views/refinery/namespace/admin/plural_name/_records.html.erb +2 -2
  111. data/lib/generators/refinery/form/templates/app/views/refinery/namespace/admin/plural_name/spam.html.erb +7 -6
  112. data/lib/generators/refinery/form/templates/config/locales/nl.yml +29 -29
  113. data/lib/generators/refinery/form/templates/config/locales/tr.yml +78 -0
  114. data/lib/generators/refinery/form/templates/config/routes.rb.erb +1 -1
  115. data/lib/generators/refinery/form/templates/db/migrate/1_create_plural_name.rb.erb +2 -6
  116. data/lib/generators/refinery/form/templates/db/seeds.rb.erb +1 -1
  117. data/lib/generators/refinery/form/templates/lib/refinery/plural_name/engine.rb.erb +1 -1
  118. data/lib/generators/refinery/form/templates/refinerycms-plural_name.gemspec +2 -5
  119. data/lib/refinery.rb +191 -0
  120. data/lib/refinery/admin/base_controller.rb +27 -16
  121. data/lib/refinery/application_controller.rb +15 -47
  122. data/lib/refinery/cli.rb +48 -27
  123. data/lib/refinery/core.rb +7 -183
  124. data/lib/refinery/core/configuration.rb +17 -9
  125. data/lib/refinery/core/engine.rb +11 -47
  126. data/lib/refinery/crud.rb +81 -66
  127. data/lib/refinery/engine.rb +52 -55
  128. data/lib/refinery/ext/action_view/helpers/form_builder.rb +2 -0
  129. data/lib/refinery/extension_generation.rb +208 -110
  130. data/lib/refinery/menu.rb +16 -7
  131. data/lib/refinery/menu_item.rb +56 -54
  132. data/lib/refinery/plugin.rb +11 -3
  133. data/lib/refinery/plugins.rb +14 -1
  134. data/lib/refinery/version.rb +3 -3
  135. data/refinerycms-core.gemspec +11 -10
  136. data/spec/controllers/refinery/admin/dummy_controller_spec.rb +57 -0
  137. data/spec/controllers/refinery/admin/refinery_core_controller_spec.rb +3 -4
  138. data/spec/controllers/refinery/sitemap_controller_spec.rb +1 -14
  139. data/spec/{requests → features}/refinery/admin/custom_assets_spec.rb +1 -1
  140. data/spec/{requests → features}/refinery/admin/dialogs_spec.rb +1 -1
  141. data/spec/features/refinery/admin/xhr_paging_spec.rb +55 -0
  142. data/spec/features/refinery/application_layout_spec.rb +19 -0
  143. data/spec/features/refinery/core_spec.rb +14 -0
  144. data/spec/{requests → features}/refinery/site_bar_spec.rb +1 -1
  145. data/spec/helpers/refinery/meta_helper_spec.rb +25 -0
  146. data/spec/lib/generators/refinery/cms/cms_generator_spec.rb +61 -0
  147. data/spec/lib/generators/refinery/engine/engine_generator_multiple_resources_spec.rb +28 -1
  148. data/spec/lib/generators/refinery/engine/engine_generator_sanity_check_spec.rb +7 -7
  149. data/spec/lib/generators/refinery/engine/engine_generator_spec.rb +69 -8
  150. data/spec/lib/generators/refinery/engine/engine_generator_with_i18n_spec.rb +0 -2
  151. data/spec/lib/generators/refinery/form/form_generator_spec.rb +9 -1
  152. data/spec/lib/refinery/application_controller_spec.rb +48 -63
  153. data/spec/lib/refinery/cli_spec.rb +136 -0
  154. data/spec/lib/refinery/core/configuration_spec.rb +17 -0
  155. data/spec/lib/refinery/core_spec.rb +19 -13
  156. data/spec/lib/refinery/crud_spec.rb +0 -4
  157. data/spec/lib/refinery/menu_spec.rb +16 -26
  158. data/spec/support/refinery.rb +6 -1
  159. data/{app → vendor}/assets/javascripts/jquery/GPL-LICENSE.txt +0 -0
  160. data/{app → vendor}/assets/javascripts/jquery/MIT-LICENSE.txt +0 -0
  161. data/vendor/assets/javascripts/jquery/jquery.browser.js +49 -0
  162. data/{app → vendor}/assets/javascripts/jquery/jquery.html5-placeholder-shim.js +0 -0
  163. data/{app → vendor}/assets/javascripts/jquery/jquery.jcarousel.js +0 -0
  164. data/{app → vendor}/assets/javascripts/jquery/jquery.textTruncate.js +0 -0
  165. data/{app → vendor}/assets/javascripts/jquery/jquery.timers.js +0 -0
  166. data/{app → vendor}/assets/javascripts/modernizr-min.js +0 -0
  167. metadata +231 -78
  168. data/app/assets/images/refinery/resolve_digital_footer_logo.png +0 -0
  169. data/app/assets/javascripts/dd_belatedpng.js +0 -13
  170. data/app/assets/javascripts/jquery/jquery.corner.js +0 -345
  171. data/app/assets/stylesheets/application.css.scss +0 -55
  172. data/app/assets/stylesheets/home.css.scss +0 -3
  173. data/app/views/refinery/_ie6check.html.erb +0 -63
  174. data/app/views/refinery/_menu.html.erb +0 -20
  175. data/app/views/refinery/_menu_branch.html.erb +0 -19
  176. data/lib/generators/refinery/engine/templates/Guardfile +0 -27
  177. data/lib/generators/refinery/engine/templates/app/views/refinery/namespace/admin/plural_name/_locale_picker.html.erb +0 -11
  178. data/lib/refinery/catch_all_routes.rb +0 -3
  179. data/lib/tasks/yard.rake +0 -30
  180. data/spec/requests/refinery/admin/controller_restriction_spec.rb +0 -27
  181. data/spec/requests/refinery/search_spec.rb +0 -71
@@ -2,19 +2,18 @@
2
2
  *= require jquery
3
3
  *= require jquery_ujs
4
4
  *= require jquery-ui
5
- *= require ../modernizr-min
6
- *= require ../jquery/jquery.corner
7
- *= require ../jquery/jquery.textTruncate
8
- *= require ../jquery/jquery.html5-placeholder-shim
9
- *= require ../jquery/jquery.timers
10
- *= require ../jquery/jquery.jcarousel
11
- *= require ../admin
12
- *= require ./core
13
- *= require ./site_bar
14
- *= require ./admin
15
- *= require ./submenu
16
- *= require ./interface
17
- *= require ./sortable_menu
18
- *= require ./submit_continue
19
- *= require ./ajaxy_pagination
5
+ *= require modernizr-min
6
+ *= require jquery/jquery.html5-placeholder-shim
7
+ *= require jquery/jquery.timers
8
+ *= require jquery/jquery.jcarousel
9
+ *= require jquery/jquery.browser
10
+ *= require admin
11
+ *= require refinery/core
12
+ *= require refinery/site_bar
13
+ *= require refinery/admin
14
+ *= require refinery/submenu
15
+ *= require refinery/interface
16
+ *= require refinery/sortable_menu
17
+ *= require refinery/submit_continue
18
+ *= require refinery/ajaxy_pagination
20
19
  */
@@ -1,14 +1,8 @@
1
- (function($) {
1
+ $(function() {
2
2
  $logo = $('#site_bar_content #site_bar_refinery_cms_logo');
3
3
  $logo.css('left', ($('#site_bar_content').width() / 2) - ($logo.width() / 2));
4
4
 
5
5
  $switch_anchor = $('#editor_switch a').not('.ie7 #editor_switch a, .ie6 #editor_switch a');
6
- if ($.isFunction($switch_anchor.corner)) {
7
- $switch_anchor.corner('6px');
8
- }
9
6
 
10
- $('#editor_switch a').appendTo((span = $('<span></span>').prependTo('#editor_switch')));
11
- if ($.isFunction(span.corner)) {
12
- span.corner('6px');
13
- }
14
- })(jQuery);
7
+ $('#editor_switch a').appendTo($('<span></span>').prependTo('#editor_switch'));
8
+ });
@@ -0,0 +1,145 @@
1
+ var create_sortable_list = function(options){
2
+ ordered_list = {
3
+ initialised: false
4
+ , init: function(options) {
5
+ if(!this.initialised){
6
+ this.update_url = options.update_url;
7
+ this.sortable_list = options.sortable_list;
8
+ this.tree = options.tree;
9
+ this.replaceContentsAfterUpdate = options.replaceContentsAfterUpdate;
10
+
11
+ //setup dom
12
+ this.div_with_list_and_actions = this.sortable_list.parents().filter(function(index) {
13
+ return ($(this).children("#actions").length > 0);
14
+ });
15
+ this.actions = $("#actions",this.div_with_list_and_actions);
16
+ this.reorder_action = $('#reorder_action',this.actions);
17
+ this.reorder_action_done = $('#reorder_action_done',this.actions);
18
+
19
+
20
+ this.sortable_list.addClass("sortable_list");
21
+ this.reorder_action.click($.proxy(this.enable_reordering, {list: this}));
22
+ this.reorder_action_done.click($.proxy(this.disable_reordering, {list: this}));
23
+
24
+ if(this.tree == false){
25
+ this.sortable_list.find('li').addClass('no-nest');
26
+ }
27
+
28
+ this.sortable_list.nestedSortable({
29
+ listType: 'ul',
30
+ disableNesting: 'no-nest',
31
+ forcePlaceholderSize: true,
32
+ handle: this.tree ? 'div' : null,
33
+ items: 'li',
34
+ opacity: .6,
35
+ placeholder: 'placeholder',
36
+ tabSize: 25,
37
+ tolerance: 'pointer',
38
+ toleranceElement: this.tree ? '> div' : null,
39
+ disabled: true,
40
+ start: function () {
41
+ },
42
+ change: $.proxy(this.change, {list: this}),
43
+ stop: $.proxy(this.stop, {list: this})
44
+ });
45
+ if (this.tree) {
46
+ this.reset_branch_classes(this.sortable_list);
47
+ } else {
48
+ this.reset_on_off_classes(this.sortable_list);
49
+ }
50
+ this.initialised = true;
51
+ }
52
+ return this;
53
+ }
54
+ , stop: function() {
55
+ this.list.reset_classes();
56
+ }
57
+ , change: function() {
58
+ if (this.list.tree) {
59
+ this.list.reset_branch_classes(this.list.sortable_list)
60
+ }
61
+ }
62
+ , reset_classes: function(){
63
+ if (this.tree) {
64
+ this.reset_branch_classes(this.sortable_list);
65
+ this.reset_icon_classes(this.sortable_list);
66
+ } else {
67
+ this.reset_on_off_classes(this.sortable_list);
68
+ }
69
+ }
70
+ , reset_on_off_classes: function(ul) {
71
+ $("> li", ul).each(function(i, li) {
72
+ $(li).removeClass('on off on-hover').addClass(i % 2 === 0 ? 'on' : 'off');
73
+ });
74
+ }
75
+
76
+ , reset_branch_classes: function (ul) {
77
+ $("li.ui-sortable-helper", this).removeClass("record").removeClass("branch_start").removeClass("branch_end");
78
+ $("li", ul).removeClass("branch_start").removeClass("branch_end");
79
+
80
+ $("> li:first", ul).addClass("branch_start");
81
+ $("> li:last", ul).addClass("branch_end");
82
+
83
+ var nested_ul = $("ul", ul);
84
+ $("> li:last", nested_ul).addClass("branch_end");
85
+ }
86
+
87
+ , reset_icon_classes: function(ul) {
88
+ $('li', ul).each(function() {
89
+ var $li = $(this);
90
+ var $icon = $li.find('.icon:first');
91
+
92
+ if ($li.find('ul li').size() > 0) {
93
+ $icon.addClass('toggle expanded');
94
+ }
95
+ else if ($icon.hasClass('expanded')){
96
+ $icon.removeClass('toggle expanded');
97
+ }
98
+ });
99
+ }
100
+
101
+ , enable_reordering: function(e) {
102
+ if(e) { e.preventDefault(); }
103
+ this.list.sortable_list.addClass("reordering");
104
+ $('.actions', this.list.sortable_list).fadeTo(500, 0.3);
105
+ this.list.div_with_list_and_actions.parents().siblings('div').fadeTo(500,0.3);
106
+ $('*:not("#reorder_action_done, #reorder_action")',this.list.actions).not(this.list.reorder_action_done.parents('li, ul, div')).fadeTo(500, 0.55);
107
+ this.list.sortable_list.nestedSortable("enable");
108
+ this.list.reorder_action.hide();
109
+ this.list.reorder_action_done.show();
110
+ }
111
+ , disable_reordering: function(e){
112
+ if(e) { e.preventDefault(); }
113
+
114
+ if(this.list.reorder_action_done.hasClass('loading')){ return false; }
115
+
116
+ this.list.reorder_action_done.addClass('loading');
117
+ this.list.sortable_list.nestedSortable("disable");
118
+ this.list.sortable_list.removeClass("reordering");
119
+
120
+ if (this.list.update_url !== null) {
121
+ var serialized = this.list.sortable_list.serializelist();
122
+
123
+ $.post(this.list.update_url, serialized, $.proxy(this.list.restore_controls,{list: this.list}));
124
+ } else {
125
+ $.proxy(this.list.restore_controls,{list: this.list})();
126
+ }
127
+ }
128
+
129
+ , restore_controls: function(e) {
130
+ this.list.sortable_list.removeClass('reordering');
131
+ $('.actions',this.list.sortable_list).fadeTo(250, 1);
132
+ this.list.div_with_list_and_actions.parents().siblings('div').fadeTo(250,1);
133
+ $('*:not("#reorder_action_done, #reorder_action")',this.list.actions).not($('#reorder_action_done').parents('li, ul, div')).fadeTo(250, 1);
134
+ this.list.reorder_action_done.hide().removeClass('loading');
135
+ this.list.reorder_action.show();
136
+ if (this.list.replaceContentsAfterUpdate) {
137
+ this.list.sortable_list.children().remove();
138
+ this.list.sortable_list.append($(e).children());
139
+ this.list.reset_classes();
140
+ }
141
+ }
142
+ }
143
+ ordered_list.init(options);
144
+ return ordered_list;
145
+ };
@@ -2,11 +2,12 @@
2
2
  $menu = $("#menu")
3
3
  return if $menu.length == 0
4
4
  $menu.sortable(
5
+ items: "> *:not(#menu_reorder, #menu_reorder_done)"
5
6
  axis: "x"
6
7
  cursor: "crosshair"
7
8
  connectWith: ".nested"
8
9
  update: ->
9
- $.post "/refinery/update_menu_positions", $menu.sortable("serialize",
10
+ $.post "/refinery/update_menu_positions", $menu.sortable("serialize",
10
11
  key: "menu[]"
11
12
  expression: /plugin_([\w]*)$/
12
13
  )
@@ -14,8 +15,6 @@
14
15
  $menu.sortable "disable"
15
16
  $menu.find("#menu_reorder").click (e) ->
16
17
  trigger_reordering e, true
17
-
18
+
18
19
  $menu.find("#menu_reorder_done").click (e) ->
19
20
  trigger_reordering e, false
20
-
21
- $menu.find("> a").corner "top 5px"
@@ -6,8 +6,7 @@
6
6
 
7
7
  if (continue_editing_button = $("#continue_editing")).length > 0 and continue_editing_button.attr("rel") != "no-prompt"
8
8
  $("#editor_switch a").click (e) ->
9
- if $("form[data-changes-made]").length > 0
10
- e.preventDefault() unless confirm("<%= ::I18n.t('confirm_changes', :scope => 'refinery.js.admin') %>")
9
+ e.preventDefault() unless confirm("<%= ::I18n.t("js.admin.confirm_changes") %>") if $("form[data-changes-made]").length > 0
11
10
 
12
11
  $("input[id=page_custom_slug]").change ->
13
12
  $("#submit_continue_button").remove()
@@ -1,6 +1,6 @@
1
1
  $(function() {
2
- $('.tree .toggle').live('click', function(e) {
3
- e.preventDefault();
2
+ $('.tree').on('click', '.toggle', function(e) {
3
+ e.preventDefault();
4
4
  var $li = $(this).parents('li:first');
5
5
  var $icon = $li.find('.icon.toggle');
6
6
  var $nested = $li.find('.nested');
@@ -10,7 +10,7 @@ $(function() {
10
10
  $nested.slideUp();
11
11
  }
12
12
  else {
13
- var contentUrl = $nested.attr('data-ajax-content');
13
+ var contentUrl = $nested.data('ajax-content');
14
14
  $li.addClass('loading');
15
15
 
16
16
  $nested.load(contentUrl, function() {
@@ -27,11 +27,11 @@
27
27
  Global WYMeditor namespace.
28
28
  */
29
29
  /*
30
- *= require ../wymeditor/setup
31
- *= require ../wymeditor/functions
32
- *= require ../wymeditor/prototypes
33
- *= require ../wymeditor/classes
34
- *= require ../wymeditor/validators
30
+ *= require wymeditor/setup
31
+ *= require wymeditor/functions
32
+ *= require wymeditor/prototypes
33
+ *= require wymeditor/classes
34
+ *= require wymeditor/validators
35
35
  *= require_tree ../wymeditor/browsers
36
- *= require ./boot_wym
36
+ *= require refinery/boot_wym
37
37
  */
File without changes
@@ -267,22 +267,21 @@ WYMeditor.WymClassMozilla.prototype.openBlockTag = function(tag, attributes)
267
267
  {
268
268
  var attributes = this.validator.getValidTagAttributes(tag, attributes);
269
269
 
270
- // Handle Mozilla styled spans
271
- if(tag == 'span' && attributes.style) {
272
- var new_tag = this.getTagForStyle(attributes.style);
273
- if(new_tag){
274
- this._tag_stack.pop();
275
- var tag = new_tag;
276
- this._tag_stack.push(new_tag);
277
- attributes.style = '';
278
- } else {
279
- return;
270
+ // Handle Mozilla styled spans
271
+ if (tag === 'span' && attributes.style) {
272
+ var new_tag = this.getTagForStyle(attributes.style);
273
+ if (new_tag) {
274
+ tag = new_tag;
275
+ this._tag_stack.pop();
276
+ this._tag_stack.push(tag);
277
+ attributes.style = '';
278
+ }
280
279
  }
281
- }
282
280
 
283
281
  this.output += this.helper.tag(tag, attributes, true);
284
282
  };
285
283
 
284
+
286
285
  WYMeditor.WymClassMozilla.prototype.getTagForStyle = function(style) {
287
286
 
288
287
  if(/bold/.test(style)) return 'strong';
@@ -251,27 +251,26 @@ WYMeditor.WymClassSafari.prototype.keyup = function(e) {
251
251
 
252
252
  WYMeditor.WymClassSafari.prototype.openBlockTag = function(tag, attributes)
253
253
  {
254
- var attributes = this.validator.getValidTagAttributes(tag, attributes);
255
-
256
- // Handle Safari styled spans
257
- if(tag == 'span' && attributes.style) {
258
- if(new_tag = this.getTagForStyle(attributes.style)) {
259
- this._tag_stack.pop();
260
- var tag = new_tag;
261
- this._tag_stack.push(new_tag);
262
- attributes.style = '';
263
-
264
- //should fix #125 - also removed the xhtml() override
265
- if(typeof attributes['class'] == 'string') {
266
- attributes['class'] = attributes['class'].replace(/apple-style-span/gi, '');
267
- }
254
+ var attributes = this.validator.getValidTagAttributes(tag, attributes);
255
+
256
+ // Handle Safari styled spans
257
+ if(tag == 'span' && attributes.style) {
258
+ new_tag = this.getTagForStyle(attributes.style);
259
+ if(new_tag) {
260
+ this._tag_stack.pop();
261
+ var tag = new_tag;
262
+ this._tag_stack.push(new_tag);
263
+ attributes.style = '';
264
+
265
+ //should fix #125 - also removed the xhtml() override
266
+ if(typeof attributes['class'] == 'string') {
267
+ attributes['class'] = attributes['class'].replace(/apple-style-span/gi, '');
268
+ }
268
269
 
269
- } else {
270
- return;
270
+ }
271
271
  }
272
- }
273
272
 
274
- this.output += this.helper.tag(tag, attributes, true);
273
+ this.output += this.helper.tag(tag, attributes, true);
275
274
  };
276
275
 
277
276
  WYMeditor.WymClassSafari.prototype.getTagForStyle = function(style) {
@@ -636,9 +636,7 @@ WYMeditor.Lexer.prototype._invokeParser = function(content, is_match)
636
636
  }
637
637
  var current = this._mode.getCurrent();
638
638
  var handler = this._mode_handlers[current];
639
- var result;
640
- eval('result = this._parser.' + handler + '(content, is_match);');
641
- return result;
639
+ return this._parser[handler](content, is_match);
642
640
  };
643
641
 
644
642
  /**
@@ -1122,8 +1120,8 @@ WYMeditor.XhtmlSaxListener = function()
1122
1120
  "thead", "title", "tr", "tt", "ul", "var", "extends", "meter",
1123
1121
  "section", "article", "aside", "details", "header", "footer",
1124
1122
  "nav", "dialog", "figure", "figcaption", "address", "hgroup",
1125
- "mark", "time", "canvas", "audio", "video", "source", "output",
1126
- "progress", "ruby", "rt", "rp", "summary", "command"<%= ", #{Refinery::Core.wymeditor_whitelist_tags.keys.map{|k| %Q{"#{k}"}}.join(', ')}" if Refinery::Core.wymeditor_whitelist_tags.any? %>];
1123
+ "mark", "time", "canvas", "audio", "video", "output",
1124
+ "progress", "ruby", "rt", "rp", "summary", "command"];
1127
1125
 
1128
1126
 
1129
1127
  // Defines self-closing tags.
@@ -88,7 +88,11 @@ WYMeditor.INIT_DIALOG = function(wym, selected, isIframe) {
88
88
  if(wym._selected_image) {
89
89
  imgDialog = $(wym._options.dialogImageSelector);
90
90
  img = $(wym._selected_image);
91
- size = ((img.attr(WYMeditor.REL) || doc.find('#existing_image_size_area li.selected a').attr('rel')) || "");
91
+ size = (
92
+ (img.attr(WYMeditor.REL)
93
+ || doc.find('#existing_image_size_area li.selected a').attr(WYMeditor.REL)
94
+ || doc.find('#existing_image_size_area li.selected a').attr('rel')) || ""
95
+ );
92
96
  src = img.attr(WYMeditor.SRC);
93
97
  if (size.length > 0) {
94
98
  src = src.replace('_' + size + '.', '.');
@@ -796,9 +796,6 @@ WYMeditor.editor.prototype.dialog_ajax_callback = function(selected) {
796
796
  // now fix the height;
797
797
  $("#" + wym._options.dialogId + ".editor_dialog").css('height', 'auto');
798
798
 
799
- // add corners to the buttons.
800
- $('#' + wym._options.dialogId + " .button").corner('6px');
801
-
802
799
  // look for iframes
803
800
  (iframes = $("#" + this._options.dialogId).find('iframe')).load(function() {
804
801
  WYMeditor.INIT_DIALOG(wym, _selected, true);
@@ -102,7 +102,7 @@ $.extend(WYMeditor, {
102
102
  SKINS_DEFAULT_PATH : "<%= asset_path 'wymeditor/skins/' %>",
103
103
  SKINS_DEFAULT_CSS : "skin.css",
104
104
  SKINS_DEFAULT_JS : "skin.js",
105
- LANG_DEFAULT_PATH : "lang/",
105
+ LANG_DEFAULT_PATH : "<%= asset_path 'wymeditor/lang/' %>",
106
106
  IFRAME_BASE_PATH : "{Wym_Iframe_Base_Path}",
107
107
  IFRAME_DEFAULT : "iframe/default/",
108
108
  JQUERY_PATH : "{Wym_Jquery_Path}",
@@ -154,7 +154,7 @@ $.extend(WYMeditor, {
154
154
  TITLE : "title",
155
155
  TARGET : "target",
156
156
  ALT : "alt",
157
- REL : 'rel',
157
+ REL : 'data-rel',
158
158
  DIALOG_LINK : "Link",
159
159
  DIALOG_IMAGE : "Image",
160
160
  DIALOG_TABLE : "Table",
@@ -186,8 +186,8 @@ $.extend(WYMeditor, {
186
186
  "li", "tbody", "td", "tfoot", "th", "thead", "tr", "meter",
187
187
  "section", "article", "aside", "details", "header", "footer",
188
188
  "nav", "dialog", "figure", "figcaption", "address", "hgroup",
189
- "mark", "time", "canvas", "audio", "video", "source", "output",
190
- "progress", "ruby", "rt", "rp", "summary", "command"<%= ", #{Refinery::Core.wymeditor_whitelist_tags.keys.map{|k| %Q{"#{k}"}}.join(', ')}" if Refinery::Core.wymeditor_whitelist_tags.any? %>),
189
+ "mark", "time", "canvas", "audio", "video", "output",
190
+ "progress", "ruby", "rt", "rp", "summary", "command"),
191
191
 
192
192
  KEY : {
193
193
  BACKSPACE: 8,
@@ -323,7 +323,7 @@ $.fn.wymeditor = function(options) {
323
323
  initSkin: true,
324
324
  loadSkin: true,
325
325
 
326
- lang: "en",
326
+ lang: refinery.current_admin_locale,
327
327
 
328
328
  direction: "ltr",
329
329
 
@@ -25,7 +25,7 @@ WYMeditor.SKINS['refinery'] = {
25
25
  },function(){
26
26
  $(this).removeClass('hover');
27
27
  });
28
-
28
+
29
29
  // show or hide CSS class options on hover
30
30
  $(wym._box).find('.wym_tools_class')
31
31
  .hover($.proxy(function(){
@@ -38,9 +38,6 @@ WYMeditor.SKINS['refinery'] = {
38
38
  $(wym._box).css('width', $(wym._element).width() - 2)
39
39
  .find('.wym_iframe iframe').css('width', $(wym._box).width() - 2);
40
40
 
41
- $('.button').corner('6px');
42
- $(".wym_area_top li>a").corner("2px");
43
-
44
41
  $(".wym_skin_refinery").animate({
45
42
  opacity: 1
46
43
  }, 800);