Permalink
Browse files

Change to Christian Sterzl's fork

  • Loading branch information...
Nerian committed Jun 8, 2014
1 parent 997e506 commit c8851a4137738922c69ca53a0ccf94c1a61e1908
Showing with 455 additions and 10,997 deletions.
  1. +6 −13 README.md
  2. +13 −53 Rakefile
  3. +2 −1 lib/bootstrap-wysihtml5-rails/version.rb
  4. +1 −0 testapp/app/assets/javascripts/application.js
  5. +1 −0 testapp/app/assets/stylesheets/application.css.scss
  6. +8 −12 testapp/app/views/home/index.html.erb
  7. +0 −2 vendor/assets/javascripts/bootstrap-wysihtml5/b3.js
  8. +6 −0 vendor/assets/javascripts/bootstrap-wysihtml5/bootstrap3-wysihtml5.js
  9. +0 −522 vendor/assets/javascripts/bootstrap-wysihtml5/core-b3.js.erb
  10. +0 −513 vendor/assets/javascripts/bootstrap-wysihtml5/core.js.erb
  11. +1 −2 vendor/assets/javascripts/bootstrap-wysihtml5/index.js
  12. +3 −0 vendor/assets/javascripts/bootstrap-wysihtml5/locales/ar-AR.js
  13. +4 −1 vendor/assets/javascripts/bootstrap-wysihtml5/locales/bg-BG.js
  14. +6 −2 vendor/assets/javascripts/bootstrap-wysihtml5/locales/ca-CT.js
  15. +4 −1 vendor/assets/javascripts/bootstrap-wysihtml5/locales/cs-CZ.js
  16. +4 −1 vendor/assets/javascripts/bootstrap-wysihtml5/locales/da-DK.js
  17. +47 −44 vendor/assets/javascripts/bootstrap-wysihtml5/locales/de-DE.js
  18. +53 −0 vendor/assets/javascripts/bootstrap-wysihtml5/locales/en-US.js
  19. +48 −43 vendor/assets/javascripts/bootstrap-wysihtml5/locales/es-AR.js
  20. +50 −44 vendor/assets/javascripts/bootstrap-wysihtml5/locales/es-ES.js
  21. +49 −45 vendor/assets/javascripts/bootstrap-wysihtml5/locales/fr-FR.js
  22. +52 −0 vendor/assets/javascripts/bootstrap-wysihtml5/locales/hu-HU.js
  23. +53 −0 vendor/assets/javascripts/bootstrap-wysihtml5/locales/il-HE.js
  24. +9 −5 vendor/assets/javascripts/bootstrap-wysihtml5/locales/pl-PL.js
  25. +8 −3 vendor/assets/javascripts/bootstrap-wysihtml5/locales/pt-BR.js
  26. +6 −2 vendor/assets/javascripts/bootstrap-wysihtml5/locales/zh-CN.js
  27. +6 −2 vendor/assets/javascripts/bootstrap-wysihtml5/locales/zh-TW.js
  28. +0 −9,523 vendor/assets/javascripts/bootstrap-wysihtml5/wysihtml5.js
  29. +0 −3 vendor/assets/stylesheets/bootstrap-wysihtml5/b3.css
  30. +14 −0 vendor/assets/stylesheets/bootstrap-wysihtml5/{core.css → bootstrap3-wysihtml5.css}
  31. +0 −92 vendor/assets/stylesheets/bootstrap-wysihtml5/core-b3.css
  32. +1 −1 vendor/assets/stylesheets/bootstrap-wysihtml5/index.css
  33. +0 −67 vendor/assets/stylesheets/bootstrap-wysihtml5/wysiwyg-color.css
View
@@ -9,14 +9,15 @@ It includes base CSS and HTML for typography, forms, buttons, tables, grids, nav
http://twitter.github.com/bootstrap/
-Bootstrap Wysihtml5 is a plugin for Bootstrap designed by James Hollingworth. It provides a stylish wysiwyg editor for Bootstrap.
+Bootstrap Wysihtml5 is a plugin for Bootstrap designed by James Hollingworth. It provides a stylish wysiwyg editor for Bootstrap. We use Christian Sterzl's fork.
-https://github.com/jhollingworth/bootstrap-wysihtml5
+https://github.com/Waxolunist/bootstrap3-wysihtml5-bower
bootstrap-wysihtml5-rails project integrates it with Rails 3 assets pipeline.
https://github.com/Nerian/bootstrap-wysihtml5-rails
+__Latest version with Bootstrap 2 support was `0.3.1.24`. New releases only package Bootstrap 3 support.__
## Rails > 3.1
Include bootstrap-wysihtml5-rails in Gemfile;
@@ -28,31 +29,25 @@ gem 'bootstrap-wysihtml5-rails'
or you can install from latest build;
``` ruby
-gem 'bootstrap-wysihtml5-rails', :require => 'bootstrap-wysihtml5-rails',
- :git => 'git://github.com/Nerian/bootstrap-wysihtml5-rails.git'
+gem 'bootstrap-wysihtml5-rails', :git => 'git://github.com/Nerian/bootstrap-wysihtml5-rails.git'
```
and run bundle install.
-This gem doesn't include Bootstrap. You can get Bootstrap here: https://github.com/anjlab/bootstrap-rails
+This gem doesn't include Bootstrap. You can get Bootstrap here: https://github.com/twbs/bootstrap-sass
## Configuration
-Bootstrap-wysihtml5 depends on jquery and bootstrap.
+Bootstrap-wysihtml5 depends on bootstrap and jQuery.
app/assets/stylesheets/application.css
``` css
*= require bootstrap-wysihtml5
-// or
-*= require bootstrap-wysihtml5/b3
```
app/assets/javascripts/application.js
```javascript
//= require bootstrap-wysihtml5
-// or
-//= require bootstrap-wysihtml5/b3
-
You may include all locales like this:
@@ -85,8 +80,6 @@ Just call wysihtml5() with any selector.
```
-A live example: http://jsfiddle.net/5UUrg/
-
## If using Turbolinks
```
View
@@ -1,71 +1,31 @@
#!/usr/bin/env rake
require File.expand_path('../lib/bootstrap-wysihtml5-rails/version', __FILE__)
-ORIGIN_LIB_PATH = "bootstrap-wysihtml5/lib"
-ORIGIN_SRC_PATH = "bootstrap-wysihtml5/src"
-DEST_JAVASCRIPT_PATH = "vendor/assets/javascripts/bootstrap-wysihtml5"
-DEST_CSS_PATH = "vendor/assets/stylesheets/bootstrap-wysihtml5"
-
-def b2
- system("cd bootstrap-wysihtml5 && git checkout master")
-
- system("cp #{ORIGIN_SRC_PATH}/bootstrap-wysihtml5.css #{DEST_CSS_PATH}/core.css")
-
- core_file = File.read("#{ORIGIN_SRC_PATH}/bootstrap-wysihtml5.js")
- original_string = /stylesheets: \[".\/lib\/css\/wysiwyg-color.css"\]/
- objective_string = "stylesheets: [\"<%= stylesheet_path('bootstrap-wysihtml5/wysiwyg-color.css') %>\"]"
-
- replaced = core_file.gsub(original_string, objective_string)
-
- File.open("#{DEST_JAVASCRIPT_PATH}/core.js.erb", "w") { |file| file.puts replaced }
+def copy_locales
+ Dir['bootstrap-wysihtml5/dist/locales/*'].each do |file|
+ `cp #{file} vendor/assets/javascripts/bootstrap-wysihtml5/locales/#{File.basename(file).gsub('bootstrap-wysihtml5.', '')}`
+ end
end
-def b3
- system("cd bootstrap-wysihtml5 && git checkout tb3")
-
- system("cp #{ORIGIN_SRC_PATH}/bootstrap-wysihtml5.css #{DEST_CSS_PATH}/core-b3.css")
-
- core_file = File.read("#{ORIGIN_SRC_PATH}/bootstrap-wysihtml5.js")
- original_string = /stylesheets: \[".\/lib\/css\/wysiwyg-color.css"\]/
- objective_string = "stylesheets: [\"<%= stylesheet_path('bootstrap-wysihtml5/wysiwyg-color.css') %>\"]"
-
- replaced = core_file.gsub(original_string, objective_string)
-
- File.open("#{DEST_JAVASCRIPT_PATH}/core-b3.js.erb", "w") { |file| file.puts replaced }
+def copy_javascript
+ `cp bootstrap-wysihtml5/dist/bootstrap3-wysihtml5.all.min.js vendor/assets/javascripts/bootstrap-wysihtml5/bootstrap3-wysihtml5.js`
end
-
+def copy_css
+ `cp bootstrap-wysihtml5/dist/bootstrap3-wysihtml5.css vendor/assets/stylesheets/bootstrap-wysihtml5/bootstrap3-wysihtml5.css`
+end
desc "Update assets"
task 'update' do
if Dir.exist?('bootstrap-wysihtml5')
system("cd bootstrap-wysihtml5 && git pull && cd ..")
else
- system("git clone git://github.com/jhollingworth/bootstrap-wysihtml5.git bootstrap-wysihtml5")
- # system("cd bootstrap-wysihtml5 && git remote add b3 git@github.com:artillery/bootstrap-wysihtml5.git")
- # system("cd bootstrap-wysihtml5 && git fetch b3")
- # system("cd bootstrap-wysihtml5 && git checkout -b tb3 b3/master")
- end
-
- Dir.foreach("bootstrap-wysihtml5/src/locales") do |file|
- unless file == '.' || file == '..'
- abbreviated_file_name = file.gsub('bootstrap-wysihtml5.', '')
- system("cp #{ORIGIN_SRC_PATH}/locales/#{file} #{DEST_JAVASCRIPT_PATH}/locales/#{abbreviated_file_name}")
- end
+ system("git clone git://github.com/Waxolunist/bootstrap3-wysihtml5-bower.git bootstrap-wysihtml5")
end
- system("cp #{ORIGIN_LIB_PATH}/js/wysihtml5-0.3.0.js #{DEST_JAVASCRIPT_PATH}/wysihtml5.js")
- system("cp #{ORIGIN_LIB_PATH}/css/wysiwyg-color.css #{DEST_CSS_PATH}/wysiwyg-color.css")
-
- b2
- # b3
-
- # ["#{DEST_JAVASCRIPT_PATH}/core.js.erb", "#{DEST_JAVASCRIPT_PATH}/core-b3.js.erb"].each do |file|
- ["#{DEST_JAVASCRIPT_PATH}/core.js.erb"].each do |file|
- initial = File.read(file)
- initial = "//= depend_on_asset \"bootstrap-wysihtml5/wysiwyg-color.css\"\n\n" + initial
- File.write(file, initial)
- end
+ copy_locales
+ copy_javascript
+ copy_css
system("git status")
end
@@ -1,5 +1,6 @@
module BootstrapWysihtml5Rails
module Rails
- VERSION = "0.3.1.24"
+ # Change to follow bootstrap3-wysihtml5-bower version as soon as they we can.
+ VERSION = "0.3.2.99"
end
end
@@ -13,6 +13,7 @@
//= require jquery
//= require jquery_ujs
//= require bootstrap-wysihtml5
+//= require bootstrap-wysihtml5/locales
//= require bootstrap
//= require_tree .
//= require_self
@@ -14,3 +14,4 @@
*/
@import "bootstrap";
+@import "bootstrap/theme"
@@ -1,18 +1,14 @@
<h1>Home#index</h1>
<p>Find me in app/views/home/index.html.erb</p>
-<textarea id="some-textarea" style="width: 810px; height: 200px;" placeholder="Enter text ...">
- <b>This is some previous text</b>
-</textarea>
+<div id="some_div">
+ Hello
+</div>
+
+<textarea class="textarea" placeholder="Enter text ..." style='width: 100%;height: 300px'></textarea>
<script type="text/javascript">
- $('#some-textarea').wysihtml5({
- "font-styles": true, //Font styling, e.g. h1, h2, etc. Default true
- "emphasis": true, //Italics, bold, etc. Default true
- "lists": true, //(Un)ordered lists, e.g. Bullets, Numbers. Default true
- "html": true, //Button which allows you to edit the generated HTML. Default false
- "link": true, //Button to insert a link. Default true
- "image": true, //Button to insert an image. Default true,
- "color": true //Button to change color of font
- });
+ $('.textarea').wysihtml5({locale: 'es-ES'});
+
+ $('#some_div').wysihtml5();
</script>
@@ -1,2 +0,0 @@
-//= require ./wysihtml5
-//= require ./core-b3

Large diffs are not rendered by default.

Oops, something went wrong.
Oops, something went wrong.

0 comments on commit c8851a4

Please sign in to comment.