wysihat-engine 0.1.11 → 0.1.12

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.11
1
+ 0.1.12
@@ -1,2 +1,13 @@
1
1
  module WysihatFilesHelper
2
+ def include_link(file)
3
+ function = file.file_content_type.starts_with?('image') ?
4
+ ".insertImage(this.href);" :
5
+ ".insertHTML('<a href=\"' + this.href + '\">#{file.file_file_name}</a>');"
6
+
7
+ link_to_function(
8
+ file.file_file_name,
9
+ "$$('iframe##{params[:editor]}')[0]#{function}facebox.close();",
10
+ :href => file.file.url
11
+ )
12
+ end
2
13
  end
@@ -1,4 +1,4 @@
1
1
  <li id="wysihat_file_<%= wysihat_file.id %>">
2
- <%= link_to_function(wysihat_file.file_file_name, "$$('iframe##{params[:editor]}')[0].insertImage(this.href); facebox.close();", :href => wysihat_file.file.url) %>
3
- <%= link_to_remote t('wysihat_files.destroy.name'), :url => wysihat_file, :method => :delete, :confirm => t('wysihat_files.destroy.sure') %>
2
+ <%= include_link(wysihat_file) %>
3
+ <%= link_to_remote t('wysihat_files.destroy.name'), :url => wysihat_file, :method => :delete, :confirm => t('wysihat_files.destroy.sure') %>
4
4
  </li>
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{wysihat-engine}
8
- s.version = "0.1.11"
8
+ s.version = "0.1.12"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Jeff Kreeftmeijer"]
12
- s.date = %q{2010-02-02}
12
+ s.date = %q{2010-02-26}
13
13
  s.description = %q{A Rails engine to help integrate the 37signals WysiHat rich text editor to your application.}
14
14
  s.email = %q{jeff@80beans.com}
15
15
  s.extra_rdoc_files = [
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: wysihat-engine
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.11
4
+ version: 0.1.12
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jeff Kreeftmeijer
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2010-02-02 00:00:00 +01:00
12
+ date: 2010-02-26 00:00:00 +01:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency