whowish_word 0.5.5 → 0.6.0

Sign up to get free protection for your applications and to get access to all the features.
data/Gemfile CHANGED
@@ -1,3 +1,4 @@
1
1
  source 'http://rubygems.org'
2
2
 
3
+ gem 'rubyzip'
3
4
  gem 'rspec'
data/README.md CHANGED
@@ -179,6 +179,7 @@ Authors
179
179
  -------------------
180
180
 
181
181
  Tanin Na Nakorn
182
+
182
183
  Tanun Niyomjit (Designer)
183
184
 
184
185
 
@@ -59,6 +59,10 @@ if defined?(ActionView) and defined?(ActionView::Base)
59
59
  end
60
60
  end
61
61
 
62
+ def th(uid, *variables)
63
+ return t(uid, *variables).html_safe
64
+ end
65
+
62
66
  def ta(uid, *variables)
63
67
  if @whowish_word_config.edit_mode == true
64
68
  s = PREFIX + \
@@ -8,6 +8,7 @@ module WhowishWord
8
8
  match "whowish_word/change_word", :to=>"whowish_word#change_word"
9
9
  match "whowish_word_css", :to=>"whowish_word#css"
10
10
  match "whowish_word_js", :to=>"whowish_word#js"
11
+ match "whowish_word/download", :to=>"whowish_word#download"
11
12
  end
12
13
 
13
14
  end
@@ -1,3 +1,5 @@
1
+ # encoding: utf-8
2
+
1
3
  class WhowishWordController < ApplicationController
2
4
  def css
3
5
  text = ""
@@ -93,4 +95,21 @@ class WhowishWordController < ApplicationController
93
95
  :ok => true
94
96
  }
95
97
  end
98
+
99
+ def download
100
+ t = Tempfile.new("whowish_word.zip")
101
+
102
+ Zip::ZipOutputStream.open(t.path) do |zos|
103
+ Dir["#{WhowishWord.config_file_dir}/**/*"].each do |file|
104
+ next if File.directory?(file)
105
+
106
+ zos.put_next_entry("#{file.sub(WhowishWord.config_file_dir + "/", "")}")
107
+ zos.print IO.read(file)
108
+ end
109
+ end
110
+
111
+ send_file t.path, :filename => "whowish_word.zip", :content_type => "application/zip"
112
+
113
+ t.close
114
+ end
96
115
  end
@@ -61,6 +61,7 @@
61
61
  padding-bottom:4px;
62
62
  margin-top:5px;
63
63
  margin-bottom:5px;
64
+ white-space: nowrap;
64
65
  }
65
66
 
66
67
  .whowishWordDialog > span {
@@ -79,15 +80,14 @@
79
80
  }
80
81
 
81
82
  .whowishWordDialog {
82
-
83
83
  position:absolute;
84
84
  left:100px;
85
85
  top:100px;
86
86
 
87
87
  display:none;
88
88
  z-index:1000001;
89
-
90
-
89
+
90
+ width: 600px;
91
91
 
92
92
  font-family: 'Bitstream Vera Sans Mono','Courier',monospace;
93
93
  background-color:#DDDDDD;
data/rails/Gemfile CHANGED
@@ -2,6 +2,7 @@ source 'http://rubygems.org'
2
2
 
3
3
  gem 'rails', '3.2.3'
4
4
 
5
+ gem 'rubyzip'
5
6
  gem 'rspec-rails'
6
7
  gem 'watir-webdriver-rails'
7
8
 
data/rails/Gemfile.lock CHANGED
@@ -127,5 +127,6 @@ DEPENDENCIES
127
127
  mongoid
128
128
  rails (= 3.2.3)
129
129
  rspec-rails
130
+ rubyzip
130
131
  sqlite3
131
132
  watir-webdriver-rails
@@ -35,6 +35,12 @@
35
35
  </span>
36
36
  <span>
37
37
 
38
+ </span>
39
+ <span>
40
+ <b>HTML: </b> <%=th :html_text%>
41
+ </span>
42
+ <span>
43
+ <b>Image: </b> <img src="<%=ta :image_src%>">
38
44
  </span>
39
45
  <span>
40
46
  <b>Text: </b> <%=t :text, :name => "Tanin"%>
data/whowish_word.gemspec CHANGED
@@ -3,13 +3,13 @@ $:.push File.expand_path("../lib", __FILE__)
3
3
 
4
4
  Gem::Specification.new do |s|
5
5
  s.name = "whowish_word"
6
- s.version = "0.5.5"
6
+ s.version = "0.6.0"
7
7
  s.platform = Gem::Platform::RUBY
8
8
  s.authors = ["Tanin Na Nakorn"]
9
9
  s.email = ["tanin47@yahoo.com"]
10
10
  s.homepage = "http://github.com/tanin47/whowish_word"
11
- s.summary = %q{WhowishWord}
12
- s.description = %q{Inline internationlization for Rails 3.2.*}
11
+ s.summary = %q{whowish_word}
12
+ s.description = %q{WYSIWYG for i18n for Rails 3.2.*}
13
13
 
14
14
  s.rubyforge_project = "whowish_word"
15
15
 
@@ -18,4 +18,5 @@ Gem::Specification.new do |s|
18
18
  s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
19
19
  s.require_paths = ["lib"]
20
20
 
21
+ s.add_dependency('rubyzip')
21
22
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: whowish_word
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.5
4
+ version: 0.6.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,9 +9,25 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-07-14 00:00:00.000000000 Z
13
- dependencies: []
14
- description: Inline internationlization for Rails 3.2.*
12
+ date: 2012-07-24 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: rubyzip
16
+ requirement: !ruby/object:Gem::Requirement
17
+ none: false
18
+ requirements:
19
+ - - ! '>='
20
+ - !ruby/object:Gem::Version
21
+ version: '0'
22
+ type: :runtime
23
+ prerelease: false
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ! '>='
28
+ - !ruby/object:Gem::Version
29
+ version: '0'
30
+ description: WYSIWYG for i18n for Rails 3.2.*
15
31
  email:
16
32
  - tanin47@yahoo.com
17
33
  executables: []
@@ -165,5 +181,5 @@ rubyforge_project: whowish_word
165
181
  rubygems_version: 1.8.21
166
182
  signing_key:
167
183
  specification_version: 3
168
- summary: WhowishWord
184
+ summary: whowish_word
169
185
  test_files: []