scribble_cms 0.82 → 0.88

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.
@@ -1,12 +1,38 @@
1
1
  // Place all the behaviors and hooks related to the matching controller here.
2
2
  // All this logic will automatically be available in application.js.
3
- $(document).ready(function() {
4
- tinyMCE.init({
3
+
4
+ window.initScribblerTinyMce = function(){
5
+ tinymce.remove("textarea")
6
+ $('textarea').not('.plain').not(".mini-editor").tinymce({
5
7
  mode: 'textareas',
6
8
  theme: 'modern',
7
9
  plugins: "autolink code colorpicker hr image link lists paste table textcolor",
8
10
  menubar: '',
9
- toolbar: "undo redo | styleselect | bold italic | link unlink image | alignleft aligncenter alignright | bullist numlist table | textcolor | code",
10
- valid_elements : '*[*]'
11
- });
11
+ toolbar: "undo redo | styleselect | bold italic | link unlink image | alignleft aligncenter alignright | bullist numlist table | textcolor fontsizeselect | code",
12
+ valid_elements : '*[*]',
13
+ elementpath: false,
14
+ statusbar: true,
15
+ fontsize_formats: "8px 10px 12px 14px 16px 18px 24pt 36px 48px",
16
+ convert_urls: false
17
+ });
18
+
19
+ $('textarea.mini-editor').tinymce({
20
+ mode: 'textareas',
21
+ theme: 'modern',
22
+ plugins: "autolink link lists paste textcolor",
23
+ menubar: '',
24
+ toolbar: "bold italic | link unlink | bullist numlist | code",
25
+ valid_elements : '*[*]',
26
+ elementpath: false,
27
+ statusbar: true,
28
+ fontsize_formats: "8px 10px 12px 14px 16px 18px 24pt 36px 48px"
29
+ });
30
+ }
31
+
32
+ $(document).ready(function() {
33
+ window.initScribblerTinyMce()
34
+ });
35
+
36
+ $(document).ajaxComplete(function() {
37
+ window.initScribblerTinyMce()
12
38
  });
@@ -1 +1 @@
1
- body{background-color:#FFFFFF;color:#000000;font-family:Verdana,Arial,Helvetica,sans-serif;font-size:14px;scrollbar-3dlight-color:#F0F0EE;scrollbar-arrow-color:#676662;scrollbar-base-color:#F0F0EE;scrollbar-darkshadow-color:#DDDDDD;scrollbar-face-color:#E0E0DD;scrollbar-highlight-color:#F0F0EE;scrollbar-shadow-color:#F0F0EE;scrollbar-track-color:#F5F5F5}td,th{font-family:Verdana,Arial,Helvetica,sans-serif;font-size:14px}.mce-content-body .mce-reset{margin:0;padding:0;border:0;outline:0;vertical-align:top;background:transparent;text-decoration:none;color:black;font-family:Arial;font-size:11px;text-shadow:none;float:none;position:static;width:auto;height:auto;white-space:nowrap;cursor:inherit;line-height:normal;font-weight:normal;text-align:left;-webkit-tap-highlight-color:transparent;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;box-sizing:content-box;direction:ltr;max-width:none}.mce-object{border:1px dotted #3A3A3A;background:#D5D5D5 url(img/object.gif) no-repeat center}.mce-preview-object{display:inline-block;position:relative;margin:0 2px 0 2px;line-height:0;border:1px solid gray}.mce-preview-object[data-mce-selected="2"] .mce-shim{display:none}.mce-preview-object .mce-shim{position:absolute;top:0;left:0;width:100%;height:100%;background:url(data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)}figure.align-left{float:left}figure.align-right{float:right}figure.image.align-center{display:table;margin-left:auto;margin-right:auto}figure.image{display:inline-block;border:1px solid gray;margin:0 2px 0 1px;background:#f5f2f0}figure.image img{margin:8px 8px 0 8px}figure.image figcaption{margin:6px 8px 6px 8px;text-align:center}.mce-toc{border:1px solid gray}.mce-toc h2{margin:4px}.mce-toc li{list-style-type:none}.mce-pagebreak{cursor:default;display:block;border:0;width:100%;height:5px;border:1px dashed #666;margin-top:15px;page-break-before:always}@media print{.mce-pagebreak{border:0}}.mce-item-anchor{cursor:default;display:inline-block;-webkit-user-select:all;-webkit-user-modify:read-only;-moz-user-select:all;-moz-user-modify:read-only;user-select:all;user-modify:read-only;width:9px !important;height:9px !important;border:1px dotted #3A3A3A;background:#D5D5D5 url(img/anchor.gif) no-repeat center}.mce-nbsp,.mce-shy{background:#AAA}.mce-shy::after{content:'-'}hr{cursor:default}.mce-match-marker{background:#AAA;color:#fff}.mce-match-marker-selected{background:#3399ff;color:#fff}.mce-spellchecker-word{border-bottom:2px solid #F00;cursor:default}.mce-spellchecker-grammar{border-bottom:2px solid #008000;cursor:default}.mce-item-table,.mce-item-table td,.mce-item-table th,.mce-item-table caption{border:1px dashed #BBB}td[data-mce-selected],th[data-mce-selected]{background-color:#3399ff !important}.mce-edit-focus{outline:1px dotted #333}.mce-content-body *[contentEditable=false] *[contentEditable=true]:focus{outline:2px solid #2d8ac7}.mce-content-body *[contentEditable=false] *[contentEditable=true]:hover{outline:2px solid #7ACAFF}.mce-content-body *[contentEditable=false][data-mce-selected]{outline:2px solid #2d8ac7}.mce-resize-bar-dragging{background-color:blue;opacity:.25;filter:alpha(opacity=25);zoom:1}
1
+ body{background-color:#FFFFFF;color:#000000;font-size:14px;scrollbar-3dlight-color:#F0F0EE;scrollbar-arrow-color:#676662;scrollbar-base-color:#F0F0EE;scrollbar-darkshadow-color:#DDDDDD;scrollbar-face-color:#E0E0DD;scrollbar-highlight-color:#F0F0EE;scrollbar-shadow-color:#F0F0EE;scrollbar-track-color:#F5F5F5}td,th{font-size:14px}.mce-content-body .mce-reset{margin:0;padding:0;border:0;outline:0;vertical-align:top;background:transparent;text-decoration:none;color:black;font-family:Arial;font-size:11px;text-shadow:none;float:none;position:static;width:auto;height:auto;white-space:nowrap;cursor:inherit;line-height:normal;font-weight:normal;text-align:left;-webkit-tap-highlight-color:transparent;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;box-sizing:content-box;direction:ltr;max-width:none}.mce-object{border:1px dotted #3A3A3A;background:#D5D5D5 url(img/object.gif) no-repeat center}.mce-preview-object{display:inline-block;position:relative;margin:0 2px 0 2px;line-height:0;border:1px solid gray}.mce-preview-object[data-mce-selected="2"] .mce-shim{display:none}.mce-preview-object .mce-shim{position:absolute;top:0;left:0;width:100%;height:100%;background:url(data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)}figure.align-left{float:left}figure.align-right{float:right}figure.image.align-center{display:table;margin-left:auto;margin-right:auto}figure.image{display:inline-block;border:1px solid gray;margin:0 2px 0 1px;background:#f5f2f0}figure.image img{margin:8px 8px 0 8px}figure.image figcaption{margin:6px 8px 6px 8px;text-align:center}.mce-toc{border:1px solid gray}.mce-toc h2{margin:4px}.mce-toc li{list-style-type:none}.mce-pagebreak{cursor:default;display:block;border:0;width:100%;height:5px;border:1px dashed #666;margin-top:15px;page-break-before:always}@media print{.mce-pagebreak{border:0}}.mce-item-anchor{cursor:default;display:inline-block;-webkit-user-select:all;-webkit-user-modify:read-only;-moz-user-select:all;-moz-user-modify:read-only;user-select:all;user-modify:read-only;width:9px !important;height:9px !important;border:1px dotted #3A3A3A;background:#D5D5D5 url(img/anchor.gif) no-repeat center}.mce-nbsp,.mce-shy{background:#AAA}.mce-shy::after{content:'-'}hr{cursor:default}.mce-match-marker{background:#AAA;color:#fff}.mce-match-marker-selected{background:#3399ff;color:#fff}.mce-spellchecker-word{border-bottom:2px solid #F00;cursor:default}.mce-spellchecker-grammar{border-bottom:2px solid #008000;cursor:default}.mce-item-table,.mce-item-table td,.mce-item-table th,.mce-item-table caption{border:1px dashed #BBB}td[data-mce-selected],th[data-mce-selected]{background-color:#3399ff !important}.mce-edit-focus{outline:1px dotted #333}.mce-content-body *[contentEditable=false] *[contentEditable=true]:focus{outline:2px solid #2d8ac7}.mce-content-body *[contentEditable=false] *[contentEditable=true]:hover{outline:2px solid #7ACAFF}.mce-content-body *[contentEditable=false][data-mce-selected]{outline:2px solid #2d8ac7}.mce-resize-bar-dragging{background-color:blue;opacity:.25;filter:alpha(opacity=25);zoom:1}
@@ -1,13 +1,17 @@
1
1
  module ScribblerAdminHelper
2
-
2
+
3
3
  # Form
4
4
  def scribbler_form_element(element,form)
5
- render :partial => "/scribbler_content/forms/#{element.element_type}", :locals => {:element => element, :f => form}
6
- end
7
-
8
-
5
+ render :partial => "/scribbler_content/forms/#{element.element_type}", :locals => {:element => element, :f => form}
6
+ end
7
+
8
+
9
9
  def scribbler_layout(&block)
10
10
  render :partial => "/scribbler_admin/scribbler_layout", :locals => {:content => capture(&block)}
11
- end
12
-
11
+ end
12
+
13
+ def scribbler_assets
14
+ render 'scribbler_admin/scribbler_assets'
15
+ end
16
+
13
17
  end
@@ -20,6 +20,10 @@ module ScribblerContentHelper
20
20
  if block_given?
21
21
  options[:default] = capture(&block).html_safe.strip.force_encoding("UTF-8")
22
22
  end
23
+
24
+ if options[:i18n]
25
+ group = "#{group}-#{I18n.locale}"
26
+ end
23
27
 
24
28
  scribbler_group(container.to_s, group.to_s) do |g|
25
29
  v = g.send(type.to_s, name.to_s, options)
@@ -3,7 +3,6 @@ class ScribblerContainer < ActiveRecord::Base
3
3
  #= Configuration
4
4
  #== Associations
5
5
  has_many :groups, :class_name => "::ScribblerGroup", :foreign_key => "container_id"
6
- belongs_to :element, :class_name => "Alchemy::Element", :foreign_key => "element_id"
7
6
  #== Plugins and modules
8
7
  #=== PlugIns
9
8
  # => Stuff in Here
@@ -143,7 +143,7 @@ class ScribblerGroup < ActiveRecord::Base
143
143
 
144
144
  def process_data!(data)
145
145
  data.each do |key, content|
146
- content.symbolize_keys!
146
+ content.to_hash.symbolize_keys!
147
147
  e_id = content.delete(:id)
148
148
  e_type = content.delete(:type)
149
149
  e_rel = content.delete(:release)
@@ -0,0 +1,7 @@
1
+ <% ScribbleCms.js_files.each do |js| %>
2
+ <%= javascript_include_tag(js) %>
3
+ <% end %>
4
+
5
+ <% ScribbleCms.css_files.each do |css| %>
6
+ <%= stylesheet_link_tag(css, :media => 'all') %>
7
+ <% end %>
@@ -1,3 +1,5 @@
1
+ <%= scribbler_assets %>
2
+
1
3
  <div id="scribbler-admin-area" class="cf">
2
4
  <% if @containers.empty? %>
3
5
  <span class="metainfo">Es liegen keine Inhalte vor, die bearbeitet werden können</span>
@@ -6,5 +8,5 @@
6
8
  <%= render :partial => "/scribbler_admin/scribbler_sidebar" unless request.xhr? %>
7
9
  </div>
8
10
  <div id="scribbler-edit-area"><%= content %></div>
9
- <% end %>
11
+ <% end %>
10
12
  </div>
@@ -56,11 +56,6 @@
56
56
 
57
57
  <% end %>
58
58
 
59
- <script type="text/javascript">
60
- f = "Alchemy.Tinymce.init(<%= element_ids %>)"
61
- window.setTimeout(f, 250)
62
- </script>
63
-
64
59
 
65
60
 
66
61
 
@@ -1,6 +1,8 @@
1
1
  module Scribbler
2
2
  class Engine < Rails::Engine
3
3
 
4
+
5
+
4
6
  engine_name 'scribbler'
5
7
 
6
8
  initializer "dragonfly.scribbler" do
@@ -14,20 +16,19 @@ module Scribbler
14
16
  end
15
17
  end
16
18
 
17
- if defined?(ActiveAdmin)
18
- initializer 'activeadmin.tinymce', :group => :all do |app|
19
- js = ['ext/tinymce.min.js', 'scribbler.js']
20
- css = ['ext/tinymce.skin.css', 'ext/tinymce.content.min.css']
21
19
 
22
- app.config.assets.precompile += js
23
- app.config.assets.precompile += css
20
+ initializer 'activeadmin.tinymce', :group => :all do |app|
21
+
22
+ app.config.assets.precompile += ScribbleCms.js_files
23
+ app.config.assets.precompile += ScribbleCms.css_files
24
24
 
25
+ if defined?(ActiveAdmin)
25
26
  ActiveAdmin.application.tap do |config|
26
- js.each do |j|
27
+ ScribbleCms.js_files.each do |j|
27
28
  config.register_javascript j
28
29
  end
29
30
 
30
- css.each do |s|
31
+ ScribbleCms.css_files.each do |s|
31
32
  config.register_stylesheet s
32
33
  end
33
34
  end
data/lib/scribble_cms.rb CHANGED
@@ -10,6 +10,15 @@ module ScribbleCms
10
10
 
11
11
  self.tiny_mce_css = "default_tinymce"
12
12
  self.tiny_mce_js = "Alchemy.Tinymce.initAll();"
13
+
14
+ def self.js_files
15
+ ['ext/tinymce.min.js', 'ext/jquery.tinymce.min.js', 'scribbler.js']
16
+ end
17
+
18
+ def self.css_files
19
+ ['ext/tinymce.skin.css', 'ext/tinymce.content.min.css']
20
+ end
21
+
13
22
  end
14
23
 
15
24
  ActionController::Base.send(:include, ScribbleCms::ScribblerControllerPlugin)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: scribble_cms
3
3
  version: !ruby/object:Gem::Version
4
- version: '0.82'
4
+ version: '0.88'
5
5
  platform: ruby
6
6
  authors:
7
7
  - Florian Eck
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-05-08 00:00:00.000000000 Z
11
+ date: 2017-10-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: friendly_extensions
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: 0.2.4
19
+ version: 0.2.6
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: 0.2.4
26
+ version: 0.2.6
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: dragonfly
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -42,16 +42,16 @@ dependencies:
42
42
  name: smart_search
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - "~>"
45
+ - - ">="
46
46
  - !ruby/object:Gem::Version
47
- version: 0.0.79
47
+ version: '0'
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - "~>"
52
+ - - ">="
53
53
  - !ruby/object:Gem::Version
54
- version: 0.0.79
54
+ version: '0'
55
55
  description: Easy-to-use tool for placing user-editable content in your pages
56
56
  email:
57
57
  - florian.eck@el-digital.de
@@ -70,6 +70,7 @@ files:
70
70
  - app/assets/fonts/tinymce.ttf
71
71
  - app/assets/fonts/tinymce.woff
72
72
  - app/assets/javascripts/ext/jquery.Jcrop.min.js
73
+ - app/assets/javascripts/ext/jquery.tinymce.min.js
73
74
  - app/assets/javascripts/ext/tinymce.min.js
74
75
  - app/assets/javascripts/scribbler.js
75
76
  - app/assets/stylesheets/ext/jquery.Jcrop.css
@@ -87,6 +88,7 @@ files:
87
88
  - app/models/scribbler_text.rb
88
89
  - app/models/scribbler_var.rb
89
90
  - app/views/admin/_scribbler_group_form.html.erb
91
+ - app/views/scribbler_admin/_scribbler_assets.html.erb
90
92
  - app/views/scribbler_admin/_scribbler_layout.html.erb
91
93
  - app/views/scribbler_admin/_scribbler_sidebar.html.erb
92
94
  - app/views/scribbler_admin/container_edit.html.erb
@@ -128,8 +130,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
128
130
  version: '0'
129
131
  requirements: []
130
132
  rubyforge_project:
131
- rubygems_version: 2.6.8
133
+ rubygems_version: 2.6.12
132
134
  signing_key:
133
135
  specification_version: 4
134
- summary: Easy-to-use tool for placing user-editable content in your pages
136
+ summary: Eay-to-use tool for placing user-editable content in your pages
135
137
  test_files: []