refinerycms-wymeditor 1.0.3 → 1.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.gitignore +2 -0
- data/.travis.yml +27 -0
- data/Gemfile +14 -1
- data/Rakefile +18 -0
- data/app/assets/javascripts/refinery/boot_wym.js.erb +0 -14
- data/app/assets/javascripts/wymeditor/skins/refinery/skin.js +26 -30
- data/bin/rails +5 -0
- data/bin/rake +16 -0
- data/lib/refinery/wymeditor.rb +3 -3
- data/lib/refinery/wymeditor/engine.rb +9 -0
- data/readme.md +1 -1
- data/refinerycms-wymeditor.gemspec +3 -2
- data/spec/controllers/refinery/fast_controller_spec.rb +3 -3
- data/spec/features/refinery/admin/wymeditor_feature_spec.rb +58 -0
- data/spec/spec_helper.rb +0 -1
- metadata +28 -5
- data/Gemfile.lock +0 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 25c185d8fb68c9ae7ada632e60d0e3a9b6296667
|
4
|
+
data.tar.gz: ab46582f627a3ed468403a8149dfa6fb06f0bed1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 18bef3274b8efc47f67f7cc12ca716af9f4348435625d7c44ecaa800d7d37378e3e1ee07c5b955861df129ce4a53231b9f3afe6d564912bfcbb67b43143b5bde
|
7
|
+
data.tar.gz: d33af9cff27b00c6ff7724df2ca4db7ffc5be91845c874153948d11dd9967d6d5d744c2b376f341379103bf7a4cc598ec65ebb17e01a19c83a1d64d680c27a1e
|
data/.gitignore
ADDED
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
|
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
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
3
|
+
init: function(wym) {
|
4
|
+
//render following sections as buttons
|
5
|
+
$(wym._box).find(wym._options.toolsSelector)
|
6
|
+
.addClass('wym_buttons');
|
7
7
|
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
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
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
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
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
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
|
-
|
38
|
-
|
39
|
-
|
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
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')
|
data/lib/refinery/wymeditor.rb
CHANGED
@@ -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) [](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.
|
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
|
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.
|
9
|
-
response.
|
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
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.
|
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:
|
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
|
-
-
|
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.
|
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:
|