browsercms 3.5.1 → 3.5.2
Sign up to get free protection for your applications and to get access to all the features.
- data/app/assets/javascripts/bcms/ckeditor.js +1 -51
- data/app/assets/javascripts/bcms/ckeditor_load.js.erb +48 -0
- data/app/assets/javascripts/{ckeditor/config.js → bcms/ckeditor_standard_config.js} +7 -5
- data/app/controllers/cms/resource_controller.rb +1 -1
- data/app/models/cms/redirect.rb +5 -1
- data/app/views/cms/redirects/edit.html.erb +1 -1
- data/doc/release_notes.md +6 -0
- data/lib/cms/engine.rb +8 -0
- data/lib/cms/version.rb +1 -1
- metadata +5 -4
@@ -3,55 +3,5 @@
|
|
3
3
|
// See /assets/ckeditor/config.js for default configuration.
|
4
4
|
//
|
5
5
|
//= require ckeditor-jquery
|
6
|
+
//= require bcms/ckeditor_load
|
6
7
|
|
7
|
-
jQuery(function($){
|
8
|
-
$('textarea.editor').each(function(e){
|
9
|
-
if(editorEnabled()) {
|
10
|
-
loadEditor(this.id)
|
11
|
-
}
|
12
|
-
});
|
13
|
-
});
|
14
|
-
|
15
|
-
function editorEnabled() {
|
16
|
-
return $.cookie('editorEnabled') ? $.cookie('editorEnabled') == "true" : true
|
17
|
-
}
|
18
|
-
|
19
|
-
function disableEditor(id) {
|
20
|
-
if(typeof(CKEDITOR) != "undefined" && CKEDITOR.instances[id] != null) {
|
21
|
-
$('#'+id).val(CKEDITOR.instances[id].getData()).show()
|
22
|
-
CKEDITOR.instances[id].destroy();
|
23
|
-
$.cookie('editorEnabled', false, { expires: 90, path: '/' })
|
24
|
-
}
|
25
|
-
}
|
26
|
-
|
27
|
-
function enableEditor(id) {
|
28
|
-
if(typeof(CKEDITOR) != "undefined" && CKEDITOR.instances[id] != null) {
|
29
|
-
CKEDITOR.instances[id].setData($('#'+id).val())
|
30
|
-
$('#'+id).hide()
|
31
|
-
$.cookie('editorEnabled', true, { expires: 90, path: '/' })
|
32
|
-
}
|
33
|
-
}
|
34
|
-
|
35
|
-
function toggleEditor(id, status) {
|
36
|
-
loadEditor(id)
|
37
|
-
if(status == 'Simple Text' || status.value == 'disabled'){
|
38
|
-
disableEditor(id)
|
39
|
-
} else {
|
40
|
-
enableEditor(id)
|
41
|
-
}
|
42
|
-
}
|
43
|
-
|
44
|
-
function loadEditor(id) {
|
45
|
-
if(typeof(CKEDITOR) != "undefined") {
|
46
|
-
if (CKEDITOR.instances[id] == null) {
|
47
|
-
CKEDITOR.replace(id, {
|
48
|
-
// Commented out as do not have image search available
|
49
|
-
// filebrowserImageBrowseUrl : '/ckfinder/ckfinder.html?Type=Image&Connector=/cms/sections/file_browser.xml'
|
50
|
-
});
|
51
|
-
}
|
52
|
-
$.cookie('editorEnabled', true, { expires: 90, path: '/' })
|
53
|
-
return true
|
54
|
-
} else {
|
55
|
-
return false
|
56
|
-
}
|
57
|
-
}
|
@@ -0,0 +1,48 @@
|
|
1
|
+
jQuery(function($){
|
2
|
+
$('textarea.editor').each(function(e){
|
3
|
+
if(editorEnabled()) {
|
4
|
+
loadEditor(this.id)
|
5
|
+
}
|
6
|
+
});
|
7
|
+
});
|
8
|
+
|
9
|
+
function editorEnabled() {
|
10
|
+
return $.cookie('editorEnabled') ? $.cookie('editorEnabled') == "true" : true
|
11
|
+
}
|
12
|
+
|
13
|
+
function disableEditor(id) {
|
14
|
+
if(typeof(CKEDITOR) != "undefined" && CKEDITOR.instances[id] != null) {
|
15
|
+
$('#'+id).val(CKEDITOR.instances[id].getData()).show()
|
16
|
+
CKEDITOR.instances[id].destroy();
|
17
|
+
$.cookie('editorEnabled', false, { expires: 90, path: '/' })
|
18
|
+
}
|
19
|
+
}
|
20
|
+
|
21
|
+
function enableEditor(id) {
|
22
|
+
if(typeof(CKEDITOR) != "undefined" && CKEDITOR.instances[id] != null) {
|
23
|
+
CKEDITOR.instances[id].setData($('#'+id).val())
|
24
|
+
$('#'+id).hide()
|
25
|
+
$.cookie('editorEnabled', true, { expires: 90, path: '/' })
|
26
|
+
}
|
27
|
+
}
|
28
|
+
|
29
|
+
function toggleEditor(id, status) {
|
30
|
+
loadEditor(id)
|
31
|
+
if(status == 'Simple Text' || status.value == 'disabled'){
|
32
|
+
disableEditor(id)
|
33
|
+
} else {
|
34
|
+
enableEditor(id)
|
35
|
+
}
|
36
|
+
}
|
37
|
+
|
38
|
+
function loadEditor(id) {
|
39
|
+
if(typeof(CKEDITOR) != "undefined") {
|
40
|
+
if (CKEDITOR.instances[id] == null) {
|
41
|
+
CKEDITOR.replace(id, { customConfig : '<%= asset_path(Rails.application.config.cms.ckeditor.configuration_file) %>' });
|
42
|
+
}
|
43
|
+
$.cookie('editorEnabled', true, { expires: 90, path: '/' })
|
44
|
+
return true
|
45
|
+
} else {
|
46
|
+
return false
|
47
|
+
}
|
48
|
+
}
|
@@ -1,4 +1,7 @@
|
|
1
|
-
//
|
1
|
+
// This is a custom configuration file that will be used by BrowserCMS to load instances of
|
2
|
+
// the CKEditor.
|
3
|
+
// As per http://docs.cksource.com/ckeditor_api/symbols/CKEDITOR.config.html#.customConfig using a custom config
|
4
|
+
// avoids the need to 'mask' the core default config.js file that CKEDITOR comes packaged with.
|
2
5
|
|
3
6
|
CKEDITOR.config.toolbar_CMS = [
|
4
7
|
['Source','-','Cut','Copy','Paste','PasteText','PasteFromWord','-','SpellChecker','Scayt','-','Undo','Redo','Find','Replace','RemoveFormat','-','NumberedList','BulletedList','Outdent','Indent','HorizontalRule'],
|
@@ -14,7 +17,6 @@ CKEDITOR.config.toolbar_CMSForms = [
|
|
14
17
|
['TextField','Select','Checkbox','Radio','Textarea','Button','ImageButton','HiddenField']
|
15
18
|
];
|
16
19
|
|
17
|
-
CKEDITOR.config.width = 598
|
18
|
-
CKEDITOR.config.height = 400
|
19
|
-
|
20
|
-
CKEDITOR.config.toolbar = 'CMS'
|
20
|
+
CKEDITOR.config.width = 598;
|
21
|
+
CKEDITOR.config.height = 400;
|
22
|
+
CKEDITOR.config.toolbar = 'CMS';
|
@@ -36,7 +36,7 @@ class ResourceController < Cms::BaseController
|
|
36
36
|
|
37
37
|
def update
|
38
38
|
@object = resource.find(params[:id])
|
39
|
-
if @object.update_attributes(params["
|
39
|
+
if @object.update_attributes(params["#{variable_name}"])
|
40
40
|
flash[:notice] = "#{resource_name.singularize.titleize} '#{object_name}' was updated"
|
41
41
|
redirect_to after_update_url
|
42
42
|
else
|
data/app/models/cms/redirect.rb
CHANGED
@@ -1,3 +1,3 @@
|
|
1
1
|
<% @page_title = @toolbar_title = "Edit Redirect" %>
|
2
|
-
<%= content_for :functions, link_to(span_tag("List All"),
|
2
|
+
<%= content_for :functions, link_to(span_tag("List All"), redirects_path, :class => "button") %>
|
3
3
|
<%= render :partial => 'form' %>
|
data/doc/release_notes.md
CHANGED
data/lib/cms/engine.rb
CHANGED
@@ -25,6 +25,9 @@ module Cms
|
|
25
25
|
# Allows additional menu items to be added to the 'Tools' menu on the Admin tab.
|
26
26
|
config.cms.tools_menu = ActiveSupport::OrderedOptions.new
|
27
27
|
|
28
|
+
# Define configuration for the CKEditor
|
29
|
+
config.cms.ckeditor = ActiveSupport::OrderedOptions.new
|
30
|
+
|
28
31
|
# Make sure we use our rails model template (rather then its default) when `rails g cms:content_block` is run.
|
29
32
|
config.app_generators do |g|
|
30
33
|
path = File::expand_path('../../templates', __FILE__)
|
@@ -60,6 +63,11 @@ module Cms
|
|
60
63
|
# config.cms.site_domain = "www.browsercms.org"
|
61
64
|
app.config.cms.site_domain = "localhost:3000"
|
62
65
|
|
66
|
+
# Determines which ckeditor file will be used to configure all instances.
|
67
|
+
# There should be at most ONE of these, so use manifest files which require the below one to augement it.
|
68
|
+
app.config.cms.ckeditor.configuration_file = 'bcms/ckeditor_standard_config.js'
|
69
|
+
|
70
|
+
# Define menu items to be added dynamically to the CMS Admin tab.
|
63
71
|
app.config.cms.tools_menu = []
|
64
72
|
end
|
65
73
|
|
data/lib/cms/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: browsercms
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.5.
|
4
|
+
version: 3.5.2
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-06-
|
12
|
+
date: 2012-06-07 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rails
|
@@ -363,7 +363,8 @@ files:
|
|
363
363
|
- app/assets/images/cms/usercontrols_bg.png
|
364
364
|
- app/assets/images/cms/usercontrols_bg_cap.png
|
365
365
|
- app/assets/javascripts/bcms/ckeditor.js
|
366
|
-
- app/assets/javascripts/
|
366
|
+
- app/assets/javascripts/bcms/ckeditor_load.js.erb
|
367
|
+
- app/assets/javascripts/bcms/ckeditor_standard_config.js
|
367
368
|
- app/assets/javascripts/cms/application.js
|
368
369
|
- app/assets/javascripts/cms/attachment_manager.js.erb
|
369
370
|
- app/assets/javascripts/cms/content_library.js
|
@@ -772,7 +773,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
772
773
|
version: '0'
|
773
774
|
segments:
|
774
775
|
- 0
|
775
|
-
hash: -
|
776
|
+
hash: -1523236011724183372
|
776
777
|
requirements: []
|
777
778
|
rubyforge_project:
|
778
779
|
rubygems_version: 1.8.24
|