muck-contents 0.2.20 → 0.2.21

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.2.20
1
+ 0.2.21
@@ -79,9 +79,9 @@ class Muck::ContentsController < ApplicationController
79
79
  format.html do
80
80
  after_create_redirect
81
81
  end
82
- # HACK there should be a way to force polymorphic_url to use an id instead of to_param
83
- update_path = polymorphic_url([@parent, @content]).gsub(@content.to_param, "#{@content.id}") # force the id. The slugs can cause problems during edit
84
- format.json { render :json => { :success => true, :content => @content, :parent_id => @parent ? @parent.id : nil, :update_path => update_path, :preview_path => @content.uri, :type => 'create' } }
82
+ format.json do
83
+ after_create_json
84
+ end
85
85
  end
86
86
  rescue ActiveRecord::RecordInvalid => ex
87
87
  if @content
@@ -155,6 +155,12 @@ class Muck::ContentsController < ApplicationController
155
155
  redirect_to @content.uri
156
156
  end
157
157
 
158
+ def after_create_json
159
+ # HACK there should be a way to force polymorphic_url to use an id instead of to_param
160
+ update_path = polymorphic_url([@parent, @content]).gsub(@content.to_param, "#{@content.id}") # force the id. The slugs can cause problems during edit
161
+ render :json => { :success => true, :content => @content, :parent_id => @parent ? @parent.id : nil, :update_path => update_path, :preview_path => @content.uri, :type => 'create' }
162
+ end
163
+
158
164
  def after_update_redirect
159
165
  redirect_to @content.uri
160
166
  end
@@ -9,8 +9,7 @@
9
9
  tiny_mce/tiny_mce_popup.js
10
10
  tiny_mce/utils/mctabs.js
11
11
  tiny_mce/utils/form_utils.js
12
- tiny_mce/utils/validate.js
13
- application.js }, :cache => 'tinymce_js_cached' %>
12
+ tiny_mce/utils/validate.js }, :cache => 'tinymce_js_cached' %>
14
13
  <%= javascript_tag %[const AUTH_TOKEN = #{form_authenticity_token.inspect};] if protect_against_forgery? %>
15
14
  <%= stylesheet_link_tag %W{ tinymce jquery/jquery.autocomplete } %>
16
15
  <%= yield :head -%>
@@ -23,7 +23,7 @@ GlobalConfig.advanced_mce_options = {
23
23
  bold italic underline strikethrough separator
24
24
  justifyleft justifycenter justifyright indent outdent separator
25
25
  bullist numlist separator
26
- link unlink image file media anchor separator
26
+ mucklink muckimage muckfile media anchor separator
27
27
  template visualaid separator
28
28
  fullscreen code},
29
29
  :theme_advanced_buttons2 => %w{styleprops styleselect separator
@@ -33,7 +33,7 @@ GlobalConfig.advanced_mce_options = {
33
33
  sub sup charmap },
34
34
  :theme_advanced_buttons3 => %w{}, #bramus_cssextras_classes bramus_cssextras_ids
35
35
  #:theme_advanced_buttons3 => %w{cleanup code insertdate inserttime removeformat insertlayer},
36
- :plugins => %w{ paste media preview inlinepopups safari save searchreplace table style template fullscreen print autosave muckimage mucklink},
36
+ :plugins => %w{ paste media preview inlinepopups safari save searchreplace table style template fullscreen print autosave muckimage mucklink muckfile},
37
37
  # codehighlighting
38
38
  # spellchecker,pagebreak,layer,advhr,advimage,advlink,emotions,iespell,inlinepopups,insertdatetime,preview,media,searchreplace,print,
39
39
  # contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{muck-contents}
8
- s.version = "0.2.20"
8
+ s.version = "0.2.21"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Justin Ball", "Joel Duffin"]
12
- s.date = %q{2010-04-08}
12
+ s.date = %q{2010-05-05}
13
13
  s.email = %q{justin@tatemae.com}
14
14
  s.extra_rdoc_files = [
15
15
  "README.rdoc"
@@ -99,6 +99,9 @@ Gem::Specification.new do |s|
99
99
  "locales/zh-TW.yml",
100
100
  "locales/zh.yml",
101
101
  "muck-contents.gemspec",
102
+ "public/images/tinymce/doc.jpg",
103
+ "public/images/tinymce/image.jpg",
104
+ "public/images/tinymce/link.jpg",
102
105
  "public/images/tinymce/sample.gif",
103
106
  "public/images/tinymce/upload.gif",
104
107
  "public/javascripts/tiny_mce/langs/ar.js",
Binary file
Binary file
Binary file
@@ -4,10 +4,10 @@
4
4
  * @copyright Copyright © 2009, Tatemae.
5
5
  */
6
6
  (function() {
7
- tinymce.create('tinymce.plugins.AdvancedFileTooPlugin', {
7
+ tinymce.create('tinymce.plugins.MuckFilePlugin', {
8
8
  init : function(ed, url) {
9
9
  // Register commands
10
- ed.addCommand('mceAdvFileToo', function() {
10
+ ed.addCommand('mceMuckFile', function() {
11
11
  var e = ed.selection.getNode();
12
12
  // Internal file object like a flash placeholder
13
13
  if (ed.dom.getAttrib(e, 'class').indexOf('mceItem') != -1)
@@ -22,10 +22,10 @@
22
22
  });
23
23
  });
24
24
  // Register button
25
- ed.addButton('file', {
25
+ ed.addButton('muckfile', {
26
26
  title : 'Upload Files',
27
- cmd : 'mceAdvFileToo',
28
- image : '/images/tinymce/upload.gif'
27
+ cmd : 'mceMuckFile',
28
+ image : '/images/tinymce/doc.jpg'
29
29
  });
30
30
  },
31
31
  getInfo : function() {
@@ -38,5 +38,5 @@
38
38
  }
39
39
  });
40
40
  // Register plugin
41
- tinymce.PluginManager.add('muckfile', tinymce.plugins.AdvancedFileTooPlugin);
41
+ tinymce.PluginManager.add('muckfile', tinymce.plugins.MuckFilePlugin);
42
42
  })();
@@ -4,10 +4,10 @@
4
4
  * @copyright Copyright © 2009, Tatemae.
5
5
  */
6
6
  (function() {
7
- tinymce.create('tinymce.plugins.AdvancedFileTooPlugin', {
7
+ tinymce.create('tinymce.plugins.MuckFilePlugin', {
8
8
  init : function(ed, url) {
9
9
  // Register commands
10
- ed.addCommand('mceAdvFileToo', function() {
10
+ ed.addCommand('mceMuckFile', function() {
11
11
  var e = ed.selection.getNode();
12
12
  // Internal file object like a flash placeholder
13
13
  if (ed.dom.getAttrib(e, 'class').indexOf('mceItem') != -1)
@@ -22,10 +22,10 @@
22
22
  });
23
23
  });
24
24
  // Register button
25
- ed.addButton('file', {
25
+ ed.addButton('muckfile', {
26
26
  title : 'Upload Files',
27
- cmd : 'mceAdvFileToo',
28
- image : '/images/tinymce/upload.gif'
27
+ cmd : 'mceMuckFile',
28
+ image : '/images/tinymce/doc.jpg'
29
29
  });
30
30
  },
31
31
  getInfo : function() {
@@ -38,5 +38,5 @@
38
38
  }
39
39
  });
40
40
  // Register plugin
41
- tinymce.PluginManager.add('muckfile', tinymce.plugins.AdvancedFileTooPlugin);
41
+ tinymce.PluginManager.add('muckfile', tinymce.plugins.MuckFilePlugin);
42
42
  })();
@@ -4,10 +4,10 @@
4
4
  * @copyright Copyright © 2009, Tatemae.
5
5
  */
6
6
  (function() {
7
- tinymce.create('tinymce.plugins.AdvancedImageTooPlugin', {
7
+ tinymce.create('tinymce.plugins.MuckImagePlugin', {
8
8
  init : function(ed, url) {
9
9
  // Register commands
10
- ed.addCommand('mceAdvImageToo', function() {
10
+ ed.addCommand('mceMuckImage', function() {
11
11
  var e = ed.selection.getNode();
12
12
  // Internal image object like a flash placeholder
13
13
  if (ed.dom.getAttrib(e, 'class').indexOf('mceItem') != -1)
@@ -22,9 +22,10 @@
22
22
  });
23
23
  });
24
24
  // Register buttons
25
- ed.addButton('image', {
25
+ ed.addButton('muckimage', {
26
26
  title : 'Upload Images',
27
- cmd : 'mceAdvImageToo'
27
+ cmd : 'mceMuckImage',
28
+ image : '/images/tinymce/image.jpg'
28
29
  });
29
30
  },
30
31
  getInfo : function() {
@@ -37,5 +38,5 @@
37
38
  }
38
39
  });
39
40
  // Register plugin
40
- tinymce.PluginManager.add('muckimage', tinymce.plugins.AdvancedImageTooPlugin);
41
+ tinymce.PluginManager.add('muckimage', tinymce.plugins.MuckImagePlugin);
41
42
  })();
@@ -4,10 +4,10 @@
4
4
  * @copyright Copyright © 2009, Tatemae.
5
5
  */
6
6
  (function() {
7
- tinymce.create('tinymce.plugins.AdvancedImageTooPlugin', {
7
+ tinymce.create('tinymce.plugins.MuckImagePlugin', {
8
8
  init : function(ed, url) {
9
9
  // Register commands
10
- ed.addCommand('mceAdvImageToo', function() {
10
+ ed.addCommand('mceMuckImage', function() {
11
11
  var e = ed.selection.getNode();
12
12
  // Internal image object like a flash placeholder
13
13
  if (ed.dom.getAttrib(e, 'class').indexOf('mceItem') != -1)
@@ -22,9 +22,10 @@
22
22
  });
23
23
  });
24
24
  // Register buttons
25
- ed.addButton('image', {
25
+ ed.addButton('muckimage', {
26
26
  title : 'Upload Images',
27
- cmd : 'mceAdvImageToo'
27
+ cmd : 'mceMuckImage',
28
+ image : '/images/tinymce/image.jpg'
28
29
  });
29
30
  },
30
31
  getInfo : function() {
@@ -37,5 +38,5 @@
37
38
  }
38
39
  });
39
40
  // Register plugin
40
- tinymce.PluginManager.add('muckimage', tinymce.plugins.AdvancedImageTooPlugin);
41
+ tinymce.PluginManager.add('muckimage', tinymce.plugins.MuckImagePlugin);
41
42
  })();
@@ -4,11 +4,11 @@
4
4
  * @copyright Copyright © 2009, Tatemae, All rights reserved.
5
5
  */
6
6
  (function() {
7
- tinymce.create('tinymce.plugins.AdvancedLinkTooPlugin', {
7
+ tinymce.create('tinymce.plugins.MuckLink', {
8
8
  init : function(ed, url) {
9
9
  this.editor = ed;
10
10
  // Register commands
11
- ed.addCommand('mceAdvLinkToo', function() {
11
+ ed.addCommand('mceMuckLink', function() {
12
12
  var se = ed.selection;
13
13
  // No selection and not in link
14
14
  if (se.isCollapsed() && !ed.dom.getParent(se.getNode(), 'A'))
@@ -23,11 +23,12 @@
23
23
  });
24
24
  });
25
25
  // Register buttons
26
- ed.addButton('link', {
27
- title : 'mucklink.link_desc',
28
- cmd : 'mceAdvLinkToo'
26
+ ed.addButton('mucklink', {
27
+ title : 'Create Link',
28
+ cmd : 'mceMuckLink',
29
+ image : '/images/tinymce/link.jpg'
29
30
  });
30
- ed.addShortcut('ctrl+k', 'mucklink.advlink_desc', 'mceAdvLinkToo');
31
+ ed.addShortcut('ctrl+k', 'Create Link', 'mceMuckLink');
31
32
  ed.onNodeChange.add(function(ed, cm, n, co) {
32
33
  cm.setDisabled('link', co && n.nodeName != 'A');
33
34
  cm.setActive('link', n.nodeName == 'A' && !n.name);
@@ -43,5 +44,5 @@
43
44
  }
44
45
  });
45
46
  // Register plugin
46
- tinymce.PluginManager.add('mucklink', tinymce.plugins.AdvancedLinkTooPlugin);
47
+ tinymce.PluginManager.add('mucklink', tinymce.plugins.MuckLink);
47
48
  })();
@@ -4,11 +4,11 @@
4
4
  * @copyright Copyright � 2009, Tatemae, All rights reserved.
5
5
  */
6
6
  (function() {
7
- tinymce.create('tinymce.plugins.AdvancedLinkTooPlugin', {
7
+ tinymce.create('tinymce.plugins.MuckLink', {
8
8
  init : function(ed, url) {
9
9
  this.editor = ed;
10
10
  // Register commands
11
- ed.addCommand('mceAdvLinkToo', function() {
11
+ ed.addCommand('mceMuckLink', function() {
12
12
  var se = ed.selection;
13
13
  // No selection and not in link
14
14
  if (se.isCollapsed() && !ed.dom.getParent(se.getNode(), 'A'))
@@ -23,11 +23,12 @@
23
23
  });
24
24
  });
25
25
  // Register buttons
26
- ed.addButton('link', {
27
- title : 'mucklink.link_desc',
28
- cmd : 'mceAdvLinkToo'
26
+ ed.addButton('mucklink', {
27
+ title : 'Create Link',
28
+ cmd : 'mceMuckLink',
29
+ image : '/images/tinymce/link.jpg'
29
30
  });
30
- ed.addShortcut('ctrl+k', 'mucklink.advlink_desc', 'mceAdvLinkToo');
31
+ ed.addShortcut('ctrl+k', 'Create Link', 'mceMuckLink');
31
32
  ed.onNodeChange.add(function(ed, cm, n, co) {
32
33
  cm.setDisabled('link', co && n.nodeName != 'A');
33
34
  cm.setActive('link', n.nodeName == 'A' && !n.name);
@@ -43,5 +44,5 @@
43
44
  }
44
45
  });
45
46
  // Register plugin
46
- tinymce.PluginManager.add('mucklink', tinymce.plugins.AdvancedLinkTooPlugin);
47
+ tinymce.PluginManager.add('mucklink', tinymce.plugins.MuckLink);
47
48
  })();
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 2
8
- - 20
9
- version: 0.2.20
8
+ - 21
9
+ version: 0.2.21
10
10
  platform: ruby
11
11
  authors:
12
12
  - Justin Ball
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2010-04-08 00:00:00 -06:00
18
+ date: 2010-05-05 00:00:00 -06:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
@@ -231,6 +231,9 @@ files:
231
231
  - locales/zh-TW.yml
232
232
  - locales/zh.yml
233
233
  - muck-contents.gemspec
234
+ - public/images/tinymce/doc.jpg
235
+ - public/images/tinymce/image.jpg
236
+ - public/images/tinymce/link.jpg
234
237
  - public/images/tinymce/sample.gif
235
238
  - public/images/tinymce/upload.gif
236
239
  - public/javascripts/tiny_mce/langs/ar.js