Skip to content
This repository has been archived by the owner on Apr 5, 2018. It is now read-only.

Commit

Permalink
clean the code (spohlenz/tinymce-rails#17)
Browse files Browse the repository at this point in the history
  • Loading branch information
did committed Jan 20, 2012
1 parent 93eed66 commit 9174ebe
Show file tree
Hide file tree
Showing 1,624 changed files with 113 additions and 19,083 deletions.
3 changes: 3 additions & 0 deletions Gemfile
@@ -0,0 +1,3 @@
source 'http://rubygems.org'

gemspec
51 changes: 51 additions & 0 deletions Gemfile.lock
@@ -0,0 +1,51 @@
PATH
remote: .
specs:
locomotive-aloha-rails (0.20.1)
actionpack (~> 3.1.3)

GEM
remote: http://rubygems.org/
specs:
actionpack (3.1.3)
activemodel (= 3.1.3)
activesupport (= 3.1.3)
builder (~> 3.0.0)
erubis (~> 2.7.0)
i18n (~> 0.6)
rack (~> 1.3.5)
rack-cache (~> 1.1)
rack-mount (~> 0.8.2)
rack-test (~> 0.6.1)
sprockets (~> 2.0.3)
activemodel (3.1.3)
activesupport (= 3.1.3)
builder (~> 3.0.0)
i18n (~> 0.6)
activesupport (3.1.3)
multi_json (~> 1.0)
builder (3.0.0)
erubis (2.7.0)
hike (1.2.1)
i18n (0.6.0)
multi_json (1.0.4)
rack (1.3.6)
rack-cache (1.1)
rack (>= 0.4)
rack-mount (0.8.3)
rack (>= 1.0.0)
rack-test (0.6.1)
rack (>= 1.0)
rake (0.9.2)
sprockets (2.0.3)
hike (~> 1.2)
rack (~> 1.0)
tilt (~> 1.1, != 1.3.0)
tilt (1.3.3)

PLATFORMS
ruby

DEPENDENCIES
locomotive-aloha-rails!
rake (= 0.9.2)
4 changes: 4 additions & 0 deletions README.md
Expand Up @@ -20,6 +20,10 @@ Add to your application.js:

//= require aloha

and in your erb / haml /..etc layout

= stylesheet_link_tag 'aloha/css/aloha.css'

and use AlohaEditor in your view:

<script type="text/javascript">
Expand Down
18 changes: 8 additions & 10 deletions Rakefile
Expand Up @@ -7,10 +7,8 @@ Gem::PackageTask.new(gemspec) do |pkg|
pkg.gem_spec = gemspec
end

unless defined? Aloha::VERSION
$:.unshift File.expand_path("../lib", __FILE__)
require "aloha/version"
end
$:.push File.expand_path('../lib', __FILE__)
require 'aloha/rails/version'

def step(name)
print "#{name} ..."
Expand All @@ -24,7 +22,7 @@ def download(url, filename)
`curl -L -# #{url} -o tmp/#{filename}`
end

desc "Update Aloha Editor to version specified in lib/tinymce/version.rb"
desc "Update Aloha Editor to version specified in lib/aloha/rails/version.rb"
task :update => [ :fetch, :extract, :process ]

task :fetch do
Expand All @@ -37,19 +35,19 @@ task :extract do
`unzip -u tmp/alohaeditor.zip -d tmp`

%w(build.txt package.json plugins/extra/browser/css/browsercombined.css.backup).each { |file| `rm tmp/aloha/#{file}` }
%w(demo test).each { |folder| `rm -rf tmp/aloha/#{folder}` }
%w(demo test plugins/extra/speak plugins/extra/flag-icons plugins/extra/googletranslate plugins/extra/wai-lang plugins/extra/zemanta).each { |folder| `rm -rf tmp/aloha/#{folder}` }

`rm -rf assets/vendor/aloha`
`mkdir -p assets/vendor/aloha`
`mv tmp/aloha assets/vendor/.`
`rm -rf vendor/assets/javascripts/aloha`
`mkdir -p vendor/assets/javascripts/aloha`
`mv tmp/aloha /vendor/assets/javascripts/.`
end
end

task :process do
step "Fixing file encoding" do
require 'iconv'
converter = Iconv.new('UTF-8', 'ISO-8859-1')
Dir["assets/vendor/aloha/**/*.js"].each do |file|
Dir["vendor/assets/javascripts/aloha/**/*.js"].each do |file|
contents = converter.iconv(File.read(file)).force_encoding('UTF-8')
File.open(file, 'w') { |f| f.write(contents) }
end
Expand Down
File renamed without changes.
1 change: 1 addition & 0 deletions app/assets/javascripts/aloha/preinit.js.erb
@@ -0,0 +1 @@
window.Aloha.settings.baseUrl = '<%= Rails.application.config.assets.prefix %>/aloha/lib/';
3 changes: 0 additions & 3 deletions assets/integration/aloha.css

This file was deleted.

1 change: 0 additions & 1 deletion assets/integration/aloha/preinit.js.erb

This file was deleted.

0 comments on commit 9174ebe

Please sign in to comment.