Permalink
Browse files

clean the code (spohlenz/tinymce-rails#17)

  • Loading branch information...
1 parent 93eed66 commit 9174ebe9ccc2d44b35673ca32eae6d581e326d12 did committed Jan 20, 2012
Showing 1,624 changed files with 113 additions and 19,083 deletions.
View
@@ -0,0 +1,3 @@
+source 'http://rubygems.org'
+
+gemspec
View
@@ -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)
View
@@ -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">
View
@@ -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} ..."
@@ -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
@@ -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
File renamed without changes.
@@ -0,0 +1 @@
+window.Aloha.settings.baseUrl = '<%= Rails.application.config.assets.prefix %>/aloha/lib/';
@@ -1,3 +0,0 @@
-/*
- *= require aloha/css/aloha.css
-*/
@@ -1 +0,0 @@
-Aloha.settings.baseUrl = '<%= Rails.application.config.assets.prefix %>/aloha/lib/';
Oops, something went wrong.

0 comments on commit 9174ebe

Please sign in to comment.