refinerycms-wymeditor 1.0.3 → 1.0.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 02d7fb0e3d3d55f5f2371b2e687b1da81be98dc5
4
- data.tar.gz: 5b7e3cb1d3c35b090a382736690ac11216da4682
3
+ metadata.gz: 25c185d8fb68c9ae7ada632e60d0e3a9b6296667
4
+ data.tar.gz: ab46582f627a3ed468403a8149dfa6fb06f0bed1
5
5
  SHA512:
6
- metadata.gz: 923ca257888e0b73bf92722f994c8a07f32f531a7472d3b1a8ad5324a5c913be9a869e84d14c2158d38ec8f04ce4a30d8f7ed51239a1bdac0f26475be5c39e74
7
- data.tar.gz: b638f2525440dfdda364efdb31ddc21a91d853649e38c464fa1f56dd186994f46cad1c7c1980ddff6cb73a537296f111283af630bb738b1c77b735101703e258
6
+ metadata.gz: 18bef3274b8efc47f67f7cc12ca716af9f4348435625d7c44ecaa800d7d37378e3e1ee07c5b955861df129ce4a53231b9f3afe6d564912bfcbb67b43143b5bde
7
+ data.tar.gz: d33af9cff27b00c6ff7724df2ca4db7ffc5be91845c874153948d11dd9967d6d5d744c2b376f341379103bf7a4cc598ec65ebb17e01a19c83a1d64d680c27a1e
data/.gitignore ADDED
@@ -0,0 +1,2 @@
1
+ spec/dummy
2
+ Gemfile.lock
data/.travis.yml ADDED
@@ -0,0 +1,27 @@
1
+ language: ruby
2
+ cache: bundler
3
+ bundler_args: --without development
4
+ before_script:
5
+ - "sh -e /etc/init.d/xvfb start"
6
+ - "bin/rake refinery:testing:dummy_app"
7
+ script:
8
+ - "DISPLAY=:99.0 bundle exec rspec spec"
9
+ notifications:
10
+ email: true
11
+ irc:
12
+ use_notice: true
13
+ skip_join: true
14
+ channels:
15
+ - "irc.freenode.org#refinerycms"
16
+ campfire:
17
+ on_success: always
18
+ on_failure: always
19
+ rooms:
20
+ - secure: "X5X39BTgXacSdc32F8mIjJKPqm5dZzmgZfJ14qYpJeMETTdA5JfByt2uCfU8\njJkkxT+XGWta0bSSlRIHQJO6pK26U94A95VYDX0jNuneKEnsoAsqJ6U0VY6v\nH5oxXMAZ2perP/FH9ZsPNR+ulyFfbMQCeGPJw5AXKZQqzf6qPOI="
21
+ webhooks:
22
+ - https://webhooks.gitter.im/e/b5d48907cdc89864b874
23
+ rvm:
24
+ - 2.2
25
+ - 2.1
26
+ - 2.0.0
27
+ sudo: false
data/Gemfile CHANGED
@@ -1 +1,14 @@
1
- source 'https://rubygems.org'
1
+ source "https://rubygems.org"
2
+
3
+ gemspec
4
+
5
+ git "http://github.com/refinery/refinerycms", branch: "master" do
6
+ gem "refinerycms"
7
+ gem "refinerycms-testing"
8
+ end
9
+
10
+ gem "refinerycms-i18n", git: "https://github.com/refinery/refinerycms-i18n",
11
+ branch: "master"
12
+
13
+ gem 'sqlite3'
14
+ gem 'pry'
data/Rakefile ADDED
@@ -0,0 +1,18 @@
1
+ #!/usr/bin/env rake
2
+ begin
3
+ require 'bundler/setup'
4
+ rescue LoadError
5
+ puts 'You must `gem install bundler` and `bundle install` to run rake tasks'
6
+ end
7
+
8
+ ENGINE_PATH = File.dirname(__FILE__)
9
+ APP_RAKEFILE = File.expand_path("../spec/dummy/Rakefile", __FILE__)
10
+
11
+ if File.exists?(APP_RAKEFILE)
12
+ load 'rails/tasks/engine.rake'
13
+ end
14
+
15
+ require "refinerycms-testing"
16
+ Refinery::Testing::Railtie.load_dummy_tasks(ENGINE_PATH)
17
+
18
+ task :default => :spec
@@ -214,20 +214,6 @@ WYMeditor.editor.prototype.loadIframe = function(iframe) {
214
214
  doc = doc.document;
215
215
  }
216
216
  if (!$.browser.msie) {
217
- doc.open('text/html', 'replace');
218
- html = "<!DOCTYPE html>\
219
- <html>\
220
- <head>\
221
- <title>WYMeditor</title>\
222
- <meta charset='" + $('meta[charset]').attr('charset') + "' />\
223
- <meta http-equiv='X-UA-Compatible' content='IE=edge,chrome=1' />\
224
- </head>\
225
- <body class='wym_iframe'>\
226
- </body>\
227
- </html>";
228
- doc.write(html);
229
- doc.close();
230
-
231
217
  var doc_head = doc.head || $(doc).find('head').get(0);
232
218
  $("<link href='<%= Rails.application.config.assets.prefix + '/wymeditor/skins/refinery/wymiframe.css' %>' media='all' rel='stylesheet' />").appendTo(doc_head);
233
219
  $("<link href='<%= Rails.application.config.assets.prefix + '/refinery/formatting.css' %>' media='all' rel='stylesheet' />").appendTo(doc_head);
@@ -1,30 +1,30 @@
1
1
  WYMeditor.SKINS['refinery'] = {
2
2
 
3
- init: function(wym) {
4
- //render following sections as buttons
5
- $(wym._box).find(wym._options.toolsSelector)
6
- .addClass('wym_buttons');
3
+ init: function(wym) {
4
+ //render following sections as buttons
5
+ $(wym._box).find(wym._options.toolsSelector)
6
+ .addClass('wym_buttons');
7
7
 
8
- // auto add some margin to the main area sides if left area
9
- // or right area are not empty (if they contain sections)
10
- $(wym._box).find('div.wym_area_right ul')
11
- .parents('div.wym_area_right').show()
12
- .parents(wym._options.boxSelector)
13
- .find('div.wym_area_main')
14
- .css({'margin-right': '155px'});
8
+ // auto add some margin to the main area sides if left area
9
+ // or right area are not empty (if they contain sections)
10
+ $(wym._box).find('div.wym_area_right ul')
11
+ .parents('div.wym_area_right').show()
12
+ .parents(wym._options.boxSelector)
13
+ .find('div.wym_area_main')
14
+ .css({'margin-right': '155px'});
15
15
 
16
- $(wym._box).find('div.wym_area_left ul')
17
- .parents('div.wym_area_left').show()
18
- .parents(wym._options.boxSelector)
19
- .find('div.wym_area_main')
20
- .css({'margin-left': '155px'});
16
+ $(wym._box).find('div.wym_area_left ul')
17
+ .parents('div.wym_area_left').show()
18
+ .parents(wym._options.boxSelector)
19
+ .find('div.wym_area_main')
20
+ .css({'margin-left': '155px'});
21
21
 
22
- //make hover work under IE < 7
23
- $(wym._box).find('.wym_section').hover(function(){
24
- $(this).addClass('hover');
25
- },function(){
26
- $(this).removeClass('hover');
27
- });
22
+ //make hover work under IE < 7
23
+ $(wym._box).find('.wym_section').hover(function(){
24
+ $(this).addClass('hover');
25
+ },function(){
26
+ $(this).removeClass('hover');
27
+ });
28
28
 
29
29
  // show or hide CSS class options on hover
30
30
  $(wym._box).find('.wym_tools_class')
@@ -34,12 +34,8 @@ WYMeditor.SKINS['refinery'] = {
34
34
  this.toggleClassSelector();
35
35
  }, wym));
36
36
 
37
- // adjust sizing
38
- $(wym._box).css('width', $(wym._element).width() - 2)
39
- .find('.wym_iframe iframe').css('width', $(wym._box).width() - 2);
40
-
41
- $(".wym_skin_refinery").animate({
42
- opacity: 1
43
- }, 800);
44
- }
37
+ $(".wym_skin_refinery").animate({
38
+ opacity: 1
39
+ }, 800);
40
+ }
45
41
  };
data/bin/rails ADDED
@@ -0,0 +1,5 @@
1
+ #!/usr/bin/env ruby
2
+ # This command will automatically be run when you run "rails" with Rails 3 gems installed from the root of your application.
3
+
4
+ ENGINE_PATH = File.expand_path('../..', __FILE__)
5
+ load File.expand_path('../../spec/dummy/bin/rails', __FILE__)
data/bin/rake ADDED
@@ -0,0 +1,16 @@
1
+ #!/usr/bin/env ruby
2
+ #
3
+ # This file was generated by Bundler.
4
+ #
5
+ # The application 'rake' is installed as part of a gem, and
6
+ # this file is here to facilitate running it.
7
+ #
8
+
9
+ require 'pathname'
10
+ ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile",
11
+ Pathname.new(__FILE__).realpath)
12
+
13
+ require 'rubygems'
14
+ require 'bundler/setup'
15
+
16
+ load Gem.bin_path('rake', 'rake')
@@ -1,12 +1,12 @@
1
1
  module Refinery
2
2
  module Wymeditor
3
- require 'refinery/wymeditor/engine'
4
- require 'refinery/wymeditor/configuration'
5
-
6
3
  class << self
7
4
  def root
8
5
  @root ||= Pathname.new(File.expand_path('../../../', __FILE__))
9
6
  end
10
7
  end
8
+
9
+ require 'refinery/wymeditor/engine'
10
+ require 'refinery/wymeditor/configuration'
11
11
  end
12
12
  end
@@ -17,6 +17,15 @@ module Refinery
17
17
  )
18
18
  end
19
19
 
20
+ before_inclusion do
21
+ Refinery::Plugin.register do |plugin|
22
+ plugin.pathname = root
23
+ plugin.name = "refinerycms_wymeditor"
24
+ plugin.hide_from_menu = true
25
+ plugin.menu_match = %r{refinery/wymeditor}
26
+ end
27
+ end
28
+
20
29
  config.after_initialize do
21
30
  Refinery.register_engine Refinery::Wymeditor
22
31
  end
data/readme.md CHANGED
@@ -1,4 +1,4 @@
1
- # WYMeditor (the visual editor)
1
+ # WYMeditor (the visual editor) [![Build Status](https://travis-ci.org/parndt/refinerycms-wymeditor.svg?branch=master)](https://travis-ci.org/parndt/refinerycms-wymeditor)
2
2
 
3
3
  Refinery is backed by [WYMeditor](http://www.wymeditor.org/)
4
4
 
@@ -2,7 +2,7 @@
2
2
  Gem::Specification.new do |s|
3
3
  s.platform = Gem::Platform::RUBY
4
4
  s.name = %q{refinerycms-wymeditor}
5
- s.version = '1.0.3'
5
+ s.version = '1.0.4'
6
6
  s.summary = %q{WYMeditor support for Refinery CMS}
7
7
  s.description = %q{This extension adds WYMeditor support to Refinery CMS for visual editing.}
8
8
  s.email = %q{info@refinerycms.com}
@@ -15,5 +15,6 @@ Gem::Specification.new do |s|
15
15
  s.test_files = `git ls-files -- spec/*`.split("\n")
16
16
  s.executables = `git ls-files -- bin/*`.split("\n").map { |f| File.basename(f) }
17
17
 
18
- s.add_dependency 'refinerycms-core', '~> 3.0', '>= 3.0.0'
18
+ s.add_dependency 'refinerycms-core', '~> 3.0', '>= 3.0.0'
19
+ s.add_development_dependency 'selenium-webdriver', '~> 2.43'
19
20
  end
@@ -1,12 +1,12 @@
1
1
  require 'spec_helper'
2
2
 
3
3
  module Refinery
4
- describe FastController do
4
+ describe FastController, :type => :controller do
5
5
  it "should render the wymiframe template" do
6
6
  get :wymiframe
7
7
 
8
- response.should be_success
9
- response.should render_template(:wymiframe)
8
+ expect(response).to be_success
9
+ expect(response).to render_template(:wymiframe)
10
10
  end
11
11
  end
12
12
  end
@@ -0,0 +1,58 @@
1
+ require 'spec_helper'
2
+
3
+ describe 'wymeditor', :type => :feature do
4
+ refinery_login_with :refinery_user
5
+ # see https://github.com/refinery/refinerycms/pull/1583
6
+ context "when switching locales" do
7
+ before do
8
+ allow(Refinery::I18n).to receive(:frontend_locales).and_return [:en, :ru]
9
+
10
+ # Create a page in both locales
11
+ about_page = Globalize.with_locale(:en) do
12
+ Refinery::Page.create :title => 'About'
13
+ end
14
+
15
+ Globalize.with_locale(:ru) do
16
+ about_page.title = 'About Ru'
17
+ about_page.save
18
+ end
19
+ end
20
+
21
+ let(:about_page) do
22
+ page = Refinery::Page.last
23
+ # we need page parts so that there's a visual editor
24
+ Refinery::Pages.default_parts.each_with_index do |default_page_part, index|
25
+ page.parts.create(:title => default_page_part, :body => nil, :position => index)
26
+ end
27
+ page
28
+ end
29
+
30
+ specify "dialog has correct links", :js do
31
+ visit refinery.edit_admin_page_path(about_page)
32
+
33
+ find("#page_part_body .wym_tools_link a").click
34
+
35
+ expect(page).to have_selector("iframe#dialog_frame")
36
+
37
+ page.within_frame("dialog_frame") do
38
+ expect(page).to have_content("About")
39
+ expect(page).to have_css("a[href$='/about']")
40
+
41
+ click_link "cancel_button"
42
+ end
43
+
44
+ within "#switch_locale_picker" do
45
+ click_link "ru"
46
+ end
47
+
48
+ find("#page_part_body .wym_tools_link a").click
49
+
50
+ expect(page).to have_selector("iframe#dialog_frame")
51
+
52
+ page.within_frame("dialog_frame") do
53
+ expect(page).to have_content("About Ru")
54
+ expect(page).to have_css("a[href$='/ru/about-ru']")
55
+ end
56
+ end
57
+ end
58
+ end
data/spec/spec_helper.rb CHANGED
@@ -13,7 +13,6 @@ Rails.backtrace_cleaner.remove_silencers!
13
13
 
14
14
  RSpec.configure do |config|
15
15
  config.mock_with :rspec
16
- config.treat_symbols_as_metadata_keys_with_true_values = true
17
16
  config.filter_run :focus => true
18
17
  config.run_all_when_everything_filtered = true
19
18
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: refinerycms-wymeditor
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.3
4
+ version: 1.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Philip Arndt
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-11-04 00:00:00.000000000 Z
11
+ date: 2015-01-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: refinerycms-core
@@ -30,14 +30,32 @@ dependencies:
30
30
  - - ">="
31
31
  - !ruby/object:Gem::Version
32
32
  version: 3.0.0
33
+ - !ruby/object:Gem::Dependency
34
+ name: selenium-webdriver
35
+ requirement: !ruby/object:Gem::Requirement
36
+ requirements:
37
+ - - "~>"
38
+ - !ruby/object:Gem::Version
39
+ version: '2.43'
40
+ type: :development
41
+ prerelease: false
42
+ version_requirements: !ruby/object:Gem::Requirement
43
+ requirements:
44
+ - - "~>"
45
+ - !ruby/object:Gem::Version
46
+ version: '2.43'
33
47
  description: This extension adds WYMeditor support to Refinery CMS for visual editing.
34
48
  email: info@refinerycms.com
35
- executables: []
49
+ executables:
50
+ - rails
51
+ - rake
36
52
  extensions: []
37
53
  extra_rdoc_files: []
38
54
  files:
55
+ - ".gitignore"
56
+ - ".travis.yml"
39
57
  - Gemfile
40
- - Gemfile.lock
58
+ - Rakefile
41
59
  - app/assets/images/wymeditor/skins/refinery/arrow_redo.png
42
60
  - app/assets/images/wymeditor/skins/refinery/arrow_undo.png
43
61
  - app/assets/images/wymeditor/skins/refinery/eye.png
@@ -164,6 +182,8 @@ files:
164
182
  - app/decorators/models/refinery/page/friendly_id_options_decorator.rb
165
183
  - app/views/refinery/admin/dialogs/show.html.erb
166
184
  - app/views/refinery/wymiframe.html.erb
185
+ - bin/rails
186
+ - bin/rake
167
187
  - config/initializers/refinery/wymeditor.rb.erb
168
188
  - config/routes.rb
169
189
  - lib/generators/refinery/wymeditor/templates/config/initializers/refinery/wymeditor.rb.erb
@@ -178,6 +198,7 @@ files:
178
198
  - readme.md
179
199
  - refinerycms-wymeditor.gemspec
180
200
  - spec/controllers/refinery/fast_controller_spec.rb
201
+ - spec/features/refinery/admin/wymeditor_feature_spec.rb
181
202
  - spec/spec_helper.rb
182
203
  homepage: http://refinerycms.com
183
204
  licenses:
@@ -199,10 +220,12 @@ required_rubygems_version: !ruby/object:Gem::Requirement
199
220
  version: '0'
200
221
  requirements: []
201
222
  rubyforge_project:
202
- rubygems_version: 2.2.2
223
+ rubygems_version: 2.4.5
203
224
  signing_key:
204
225
  specification_version: 4
205
226
  summary: WYMeditor support for Refinery CMS
206
227
  test_files:
207
228
  - spec/controllers/refinery/fast_controller_spec.rb
229
+ - spec/features/refinery/admin/wymeditor_feature_spec.rb
208
230
  - spec/spec_helper.rb
231
+ has_rdoc:
data/Gemfile.lock DELETED
@@ -1,8 +0,0 @@
1
- GEM
2
- remote: https://rubygems.org/
3
- specs:
4
-
5
- PLATFORMS
6
- ruby
7
-
8
- DEPENDENCIES