diff --git a/.gitignore b/.gitignore index 7230c44..ae8fd2b 100644 --- a/.gitignore +++ b/.gitignore @@ -1,21 +1,11 @@ -log/*.log -tmp/* -tmp/**/* -doc/api -doc/app -db/*.sqlite3 -.sass-cache/ -public/stylesheets/*.css -.rspec/ -*.swp -*~ -.DS_Store -public/images/system -public/system -public/.htaccess -public/assets -*.bak -Thumbs.db -.bundle -bin/ +/.bundle +/log/*.log +/tmp config/vhost.conf +config/database.yml +public/assets +public/system +.sass-cache +tags +coverage +config/initializers/secret_token.rb diff --git a/.ruby-version b/.ruby-version new file mode 100644 index 0000000..cb50681 --- /dev/null +++ b/.ruby-version @@ -0,0 +1 @@ +2.0.0-p247 diff --git a/.travis.yml b/.travis.yml index 6ea2f60..2aaba94 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,12 +1,16 @@ -before_script: "RAILS_ENV=development bundle exec rake db:migrate db:test:prepare" -script: "bundle exec rake spec" +before_script: + - sudo apt-get install python-pip + - sudo pip install pygments + - sudo -u postgres createuser cms -dSR + - RAILS_ENV=development bundle exec rake db:create:all config:generate + - 'sh -e /etc/init.d/xvfb start' + - bundle exec rake db:migrate db:test:prepare +script: + - 'DISPLAY=:99.0 bundle exec rake spec' rvm: - - 1.8.7 - - 1.9.2 - - ree + - 2.0.0 + - 1.9.3 notifications: recipients: - enrique@cloverinteractive.com - - alejandro@cloverinteractive.com - adan@cloverinteractive.com - - alexperto@cloveritneractive.com diff --git a/Gemfile b/Gemfile index 6b62319..9438000 100644 --- a/Gemfile +++ b/Gemfile @@ -1,67 +1,54 @@ source 'http://rubygems.org' -gem 'rails', '3.2.8' +gem 'rails', '3.2.14' +gem 'pg' -gem 'will_paginate' +gem 'bootstrap-will_paginate' gem 'haml-rails' gem 'devise' -gem 'paperclip' -gem 'acts-as-taggable-on' +gem 'devise_invitable' gem 'tabs_on_rails' gem 'jquery-rails' gem 'simple_form' -gem 'single_test' gem 'capistrano' gem 'mime-types', :require => 'mime/types' gem 'symbolize' gem 'friendly_id', '~> 4.0.1' +gem 'redcarpet', '2.2.2' +gem 'pygments.rb', '0.4.2' +gem 'mail_form' group :development do + gem 'better_errors' + gem 'binding_of_caller' + gem 'debugger' gem 'quiet_assets' gem 'bullet' gem 'pry-rails' + gem 'rails_best_practices' end group :assets do gem 'sass-rails', '~> 3.2.3' gem 'coffee-rails', '~> 3.2.1' gem 'uglifier', '>= 1.0.3' + gem 'therubyracer', platforms: :ruby gem 'compass-rails' + gem 'bootstrap-sass' + gem 'bootstrap_pagedown' gem 'fancybox-rails' + gem 'turbo-sprockets-rails3' end group :development, :test do - gem "rspec-rails", "~> 2.6" + gem 'rspec-rails' + gem 'single_test' + gem 'launchy' end group :test do gem 'database_cleaner' gem 'factory_girl_rails' gem 'capybara-webkit' - gem 'mocha', :require => false -end - -platforms :ruby do - group :test, :development do - gem 'sqlite3' - end - - group :production do - gem 'mysql2' - end -end - -platforms :jruby do - gem 'activerecord-jdbc-adapter' - gem 'jruby-openssl' - gem 'trinidad' - gem 'ffi-ncurses' - - group :test, :development do - gem 'jdbc-sqlite3' - end - - group :production do - gem 'jdbc-mysql', :require => false - end + gem 'simplecov' end diff --git a/Gemfile.lock b/Gemfile.lock index 6534b1d..df6d422 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,39 +1,49 @@ GEM remote: http://rubygems.org/ specs: - actionmailer (3.2.8) - actionpack (= 3.2.8) - mail (~> 2.4.4) - actionpack (3.2.8) - activemodel (= 3.2.8) - activesupport (= 3.2.8) + actionmailer (3.2.14) + actionpack (= 3.2.14) + mail (~> 2.5.4) + actionpack (3.2.14) + activemodel (= 3.2.14) + activesupport (= 3.2.14) builder (~> 3.0.0) erubis (~> 2.7.0) journey (~> 1.0.4) - rack (~> 1.4.0) + rack (~> 1.4.5) rack-cache (~> 1.2) rack-test (~> 0.6.1) - sprockets (~> 2.1.3) - activemodel (3.2.8) - activesupport (= 3.2.8) + sprockets (~> 2.2.1) + activemodel (3.2.14) + activesupport (= 3.2.14) builder (~> 3.0.0) - activerecord (3.2.8) - activemodel (= 3.2.8) - activesupport (= 3.2.8) + activerecord (3.2.14) + activemodel (= 3.2.14) + activesupport (= 3.2.14) arel (~> 3.0.2) tzinfo (~> 0.3.29) - activeresource (3.2.8) - activemodel (= 3.2.8) - activesupport (= 3.2.8) - activesupport (3.2.8) - i18n (~> 0.6) + activeresource (3.2.14) + activemodel (= 3.2.14) + activesupport (= 3.2.14) + activesupport (3.2.14) + i18n (~> 0.6, >= 0.6.4) multi_json (~> 1.0) - acts-as-taggable-on (2.3.3) - rails (~> 3.0) addressable (2.3.2) arel (3.0.2) - bcrypt-ruby (3.0.1) - builder (3.0.3) + awesome_print (1.1.0) + bcrypt-ruby (3.1.1) + better_errors (0.3.2) + coderay (>= 1.0.0) + erubis (>= 2.7.0) + binding_of_caller (0.7.1) + debug_inspector (>= 0.0.1) + bootstrap-sass (2.3.2.2) + sass (~> 3.2) + bootstrap-will_paginate (0.0.9) + will_paginate + bootstrap_pagedown (1.1.0) + rails (>= 3.2) + builder (3.0.4) bullet (4.1.5) uniform_notifier (~> 1.0.0) capistrano (2.11.2) @@ -55,7 +65,8 @@ GEM childprocess (0.3.5) ffi (~> 1.0, >= 1.0.6) chunky_png (1.2.5) - cocaine (0.2.1) + code_analyzer (0.4.2) + sexp_processor coderay (1.0.7) coffee-rails (3.2.2) coffee-script (>= 2.2.0) @@ -63,7 +74,9 @@ GEM coffee-script (2.2.0) coffee-script-source execjs - coffee-script-source (1.2.0) + coffee-script-source (1.6.3) + colored (1.2) + columnize (0.3.6) compass (0.12.1) chunky_png (~> 1.2) fssm (>= 0.2.7) @@ -71,24 +84,35 @@ GEM compass-rails (1.0.1) compass (~> 0.12.0) database_cleaner (0.7.2) - devise (2.1.2) + debug_inspector (0.0.2) + debugger (1.6.1) + columnize (>= 0.3.1) + debugger-linecache (~> 1.2.0) + debugger-ruby_core_source (~> 1.2.3) + debugger-linecache (1.2.0) + debugger-ruby_core_source (1.2.3) + devise (3.0.0) bcrypt-ruby (~> 3.0) orm_adapter (~> 0.1) - railties (~> 3.1) - warden (~> 1.2.1) - diff-lcs (1.1.3) + railties (>= 3.2.6, < 5) + warden (~> 1.2.3) + devise_invitable (1.1.8) + actionmailer (~> 3.0) + devise (>= 2.1.2) + railties (~> 3.0) + diff-lcs (1.2.4) erubis (2.7.0) - execjs (1.3.0) + execjs (1.4.0) multi_json (~> 1.0) - factory_girl (2.6.4) - activesupport (>= 2.3.9) - factory_girl_rails (1.7.0) - factory_girl (~> 2.6.0) + factory_girl (4.2.0) + activesupport (>= 3.0.0) + factory_girl_rails (4.2.1) + factory_girl (~> 4.2.0) railties (>= 3.0.0) fancybox-rails (0.1.4) railties (>= 3.1.0) ffi (1.1.5) - friendly_id (4.0.8) + friendly_id (4.0.9) fssm (0.2.8.1) haml (3.1.7) haml-rails (0.3.5) @@ -97,26 +121,26 @@ GEM haml (~> 3.1) railties (>= 3.1, < 4.1) highline (1.6.11) - hike (1.2.1) - i18n (0.6.1) + hike (1.2.3) + i18n (0.6.5) journey (1.0.4) jquery-rails (2.0.2) railties (>= 3.2.0, < 5.0) thor (~> 0.14) - json (1.7.5) + json (1.8.0) + launchy (2.3.0) + addressable (~> 2.3) + libv8 (3.11.8.17) libwebsocket (0.1.5) addressable - mail (2.4.4) - i18n (>= 0.4.0) + mail (2.5.4) mime-types (~> 1.16) treetop (~> 1.4.8) - metaclass (0.0.1) + mail_form (1.4.1) + actionmailer (~> 3.0) method_source (0.8) - mime-types (1.19) - mocha (0.10.5) - metaclass (~> 0.0.1) - multi_json (1.3.6) - mysql2 (0.3.11) + mime-types (1.25) + multi_json (1.8.1) net-scp (1.0.4) net-ssh (>= 1.99.1) net-sftp (2.0.5) @@ -126,61 +150,72 @@ GEM net-ssh (>= 1.99.1) nokogiri (1.5.5) orm_adapter (0.4.0) - paperclip (2.7.0) - activerecord (>= 2.3.0) - activesupport (>= 2.3.2) - cocaine (>= 0.0.2) - mime-types + pg (0.14.1) polyglot (0.3.3) + posix-spawn (0.3.6) pry (0.9.10) coderay (~> 1.0.5) method_source (~> 0.8) slop (~> 3.3.1) pry-rails (0.1.6) pry + pygments.rb (0.4.2) + posix-spawn (~> 0.3.6) + yajl-ruby (~> 1.1.0) quiet_assets (1.0.1) railties (~> 3.1) - rack (1.4.1) + rack (1.4.5) rack-cache (1.2) rack (>= 0.4) - rack-ssl (1.3.2) + rack-ssl (1.3.3) rack - rack-test (0.6.1) + rack-test (0.6.2) rack (>= 1.0) - rails (3.2.8) - actionmailer (= 3.2.8) - actionpack (= 3.2.8) - activerecord (= 3.2.8) - activeresource (= 3.2.8) - activesupport (= 3.2.8) + rails (3.2.14) + actionmailer (= 3.2.14) + actionpack (= 3.2.14) + activerecord (= 3.2.14) + activeresource (= 3.2.14) + activesupport (= 3.2.14) bundler (~> 1.0) - railties (= 3.2.8) - railties (3.2.8) - actionpack (= 3.2.8) - activesupport (= 3.2.8) + railties (= 3.2.14) + rails_best_practices (1.14.3) + activesupport + awesome_print + code_analyzer (>= 0.4.2) + colored + erubis + i18n + require_all + ruby-progressbar + railties (3.2.14) + actionpack (= 3.2.14) + activesupport (= 3.2.14) rack-ssl (~> 1.3.2) rake (>= 0.8.7) rdoc (~> 3.4) thor (>= 0.14.6, < 2.0) - rake (0.9.2.2) - rdoc (3.12) + rake (10.1.0) + rdoc (3.12.2) json (~> 1.4) - rspec (2.9.0) - rspec-core (~> 2.9.0) - rspec-expectations (~> 2.9.0) - rspec-mocks (~> 2.9.0) - rspec-core (2.9.0) - rspec-expectations (2.9.0) - diff-lcs (~> 1.1.3) - rspec-mocks (2.9.0) - rspec-rails (2.9.0) + redcarpet (2.2.2) + ref (1.0.4) + require_all (1.3.1) + rspec-core (2.14.4) + rspec-expectations (2.14.0) + diff-lcs (>= 1.1.3, < 2.0) + rspec-mocks (2.14.2) + rspec-rails (2.14.0) actionpack (>= 3.0) activesupport (>= 3.0) railties (>= 3.0) - rspec (~> 2.9.0) + rspec-core (~> 2.14.0) + rspec-expectations (~> 2.14.0) + rspec-mocks (~> 2.14.0) + ruby-progressbar (1.2.0) rubyzip (0.9.9) - sass (3.1.15) - sass-rails (3.2.5) + sass (3.2.10) + sass-rails (3.2.6) railties (~> 3.2.0) sass (>= 3.1.10) tilt (~> 1.3) @@ -189,70 +224,86 @@ GEM libwebsocket (~> 0.1.3) multi_json (~> 1.0) rubyzip + sexp_processor (4.3.0) simple_form (2.0.2) actionpack (~> 3.0) activemodel (~> 3.0) + simplecov (0.7.1) + multi_json (~> 1.0) + simplecov-html (~> 0.7.1) + simplecov-html (0.7.1) single_test (0.4.4) slop (3.3.2) - sprockets (2.1.3) + sprockets (2.2.2) hike (~> 1.2) + multi_json (~> 1.0) rack (~> 1.0) tilt (~> 1.1, != 1.3.0) - sqlite3 (1.3.5) symbolize (4.2.0) tabs_on_rails (2.1.1) - thor (0.16.0) - tilt (1.3.3) - treetop (1.4.10) + therubyracer (0.11.4) + libv8 (~> 3.11.8.12) + ref + thor (0.18.1) + tilt (1.4.1) + treetop (1.4.15) polyglot polyglot (>= 0.3.1) - tzinfo (0.3.33) - uglifier (1.2.3) + turbo-sprockets-rails3 (0.3.10) + railties (> 3.2.8, < 4.0.0) + sprockets (>= 2.0.0) + tzinfo (0.3.37) + uglifier (2.1.2) execjs (>= 0.3.0) - multi_json (>= 1.0.2) + multi_json (~> 1.0, >= 1.0.2) uniform_notifier (1.0.2) - warden (1.2.1) + warden (1.2.3) rack (>= 1.0) - will_paginate (3.0.3) + will_paginate (3.0.4) xpath (0.1.4) nokogiri (~> 1.3) + yajl-ruby (1.1.0) PLATFORMS ruby DEPENDENCIES - activerecord-jdbc-adapter - acts-as-taggable-on + better_errors + binding_of_caller + bootstrap-sass + bootstrap-will_paginate + bootstrap_pagedown bullet capistrano capybara-webkit coffee-rails (~> 3.2.1) compass-rails database_cleaner + debugger devise + devise_invitable factory_girl_rails fancybox-rails - ffi-ncurses friendly_id (~> 4.0.1) haml-rails - jdbc-mysql - jdbc-sqlite3 jquery-rails - jruby-openssl + launchy + mail_form mime-types - mocha - mysql2 - paperclip + pg pry-rails + pygments.rb (= 0.4.2) quiet_assets - rails (= 3.2.8) - rspec-rails (~> 2.6) + rails (= 3.2.14) + rails_best_practices + redcarpet (= 2.2.2) + rspec-rails sass-rails (~> 3.2.3) simple_form + simplecov single_test - sqlite3 symbolize tabs_on_rails - trinidad + therubyracer + turbo-sprockets-rails3 uglifier (>= 1.0.3) - will_paginate diff --git a/README.md b/README.md index 5570ee7..31a1060 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ -# Clover CMS [![Build Status](http://travis-ci.org/cloverinteractive/clovercms.png)](http://travis-ci.org/cloverinteractive/clovercms) +# Clover CMS [![Build Status](https://travis-ci.org/cloverinteractive/cms.png?branch=master)](https://travis-ci.org/cloverinteractive/cms) -__A dead simple content management system for Rails 3.2.8__ +__A dead simple content management system for Rails 3.2.14__ CloveCMS provides the simpler barebones for creating a website, in v1.1 we embraced an even simpler approach by making it a single user app that means v1.1 does not support ACL nor multiple users, these features are present on v1.0, if you need ACL and multiple users checkout v1.0, @@ -29,18 +29,8 @@ To install and run in development: We currently test with: -* ruby 1.9.2 -* ruby 1.8.7 -* ree - -### JRuby - -We take JRuby into consideration, and our Gemfile works nice with its platforms, but since we can only version one instance, we don't build against it. However you can use `clovercms` with JRuby by doing the following: - -0. `rm -f Gemfile.lock` -1. `jruby -S bundle install` - -## Contribute +* ruby 2.0.0 +* ruby 1.9.3 Feel free to submit a pull request and don't forget to add your name to the list below. diff --git a/app/assets/images/jquery-ui/ui-bg_flat_0_aaaaaa_40x100.png b/app/assets/images/jquery-ui/ui-bg_flat_0_aaaaaa_40x100.png deleted file mode 100755 index 5b5dab2..0000000 Binary files a/app/assets/images/jquery-ui/ui-bg_flat_0_aaaaaa_40x100.png and /dev/null differ diff --git a/app/assets/images/jquery-ui/ui-bg_flat_75_ffffff_40x100.png b/app/assets/images/jquery-ui/ui-bg_flat_75_ffffff_40x100.png deleted file mode 100755 index ac8b229..0000000 Binary files a/app/assets/images/jquery-ui/ui-bg_flat_75_ffffff_40x100.png and /dev/null differ diff --git a/app/assets/images/jquery-ui/ui-bg_glass_55_fbf9ee_1x400.png b/app/assets/images/jquery-ui/ui-bg_glass_55_fbf9ee_1x400.png deleted file mode 100755 index ad3d634..0000000 Binary files a/app/assets/images/jquery-ui/ui-bg_glass_55_fbf9ee_1x400.png and /dev/null differ diff --git a/app/assets/images/jquery-ui/ui-bg_glass_65_ffffff_1x400.png b/app/assets/images/jquery-ui/ui-bg_glass_65_ffffff_1x400.png deleted file mode 100755 index 42ccba2..0000000 Binary files a/app/assets/images/jquery-ui/ui-bg_glass_65_ffffff_1x400.png and /dev/null differ diff --git a/app/assets/images/jquery-ui/ui-bg_glass_75_dadada_1x400.png b/app/assets/images/jquery-ui/ui-bg_glass_75_dadada_1x400.png deleted file mode 100755 index 5a46b47..0000000 Binary files a/app/assets/images/jquery-ui/ui-bg_glass_75_dadada_1x400.png and /dev/null differ diff --git a/app/assets/images/jquery-ui/ui-bg_glass_75_e6e6e6_1x400.png b/app/assets/images/jquery-ui/ui-bg_glass_75_e6e6e6_1x400.png deleted file mode 100755 index 86c2baa..0000000 Binary files a/app/assets/images/jquery-ui/ui-bg_glass_75_e6e6e6_1x400.png and /dev/null differ diff --git a/app/assets/images/jquery-ui/ui-bg_glass_95_fef1ec_1x400.png b/app/assets/images/jquery-ui/ui-bg_glass_95_fef1ec_1x400.png deleted file mode 100755 index 4443fdc..0000000 Binary files a/app/assets/images/jquery-ui/ui-bg_glass_95_fef1ec_1x400.png and /dev/null differ diff --git a/app/assets/images/jquery-ui/ui-bg_highlight-soft_75_cccccc_1x100.png b/app/assets/images/jquery-ui/ui-bg_highlight-soft_75_cccccc_1x100.png deleted file mode 100755 index 7c9fa6c..0000000 Binary files a/app/assets/images/jquery-ui/ui-bg_highlight-soft_75_cccccc_1x100.png and /dev/null differ diff --git a/app/assets/images/jquery-ui/ui-icons_222222_256x240.png b/app/assets/images/jquery-ui/ui-icons_222222_256x240.png deleted file mode 100755 index b273ff1..0000000 Binary files a/app/assets/images/jquery-ui/ui-icons_222222_256x240.png and /dev/null differ diff --git a/app/assets/images/jquery-ui/ui-icons_2e83ff_256x240.png b/app/assets/images/jquery-ui/ui-icons_2e83ff_256x240.png deleted file mode 100755 index 09d1cdc..0000000 Binary files a/app/assets/images/jquery-ui/ui-icons_2e83ff_256x240.png and /dev/null differ diff --git a/app/assets/images/jquery-ui/ui-icons_454545_256x240.png b/app/assets/images/jquery-ui/ui-icons_454545_256x240.png deleted file mode 100755 index 59bd45b..0000000 Binary files a/app/assets/images/jquery-ui/ui-icons_454545_256x240.png and /dev/null differ diff --git a/app/assets/images/jquery-ui/ui-icons_888888_256x240.png b/app/assets/images/jquery-ui/ui-icons_888888_256x240.png deleted file mode 100755 index 6d02426..0000000 Binary files a/app/assets/images/jquery-ui/ui-icons_888888_256x240.png and /dev/null differ diff --git a/app/assets/images/jquery-ui/ui-icons_cd0a0a_256x240.png b/app/assets/images/jquery-ui/ui-icons_cd0a0a_256x240.png deleted file mode 100755 index 2ab019b..0000000 Binary files a/app/assets/images/jquery-ui/ui-icons_cd0a0a_256x240.png and /dev/null differ diff --git a/app/assets/images/uploadify/cancel.png b/app/assets/images/uploadify/cancel.png deleted file mode 100755 index 35682b0..0000000 Binary files a/app/assets/images/uploadify/cancel.png and /dev/null differ diff --git a/app/assets/javascripts/application.js b/app/assets/javascripts/application.js index e3b3f96..2c5d33d 100644 --- a/app/assets/javascripts/application.js +++ b/app/assets/javascripts/application.js @@ -2,9 +2,9 @@ // //= require jquery //= require jquery_ujs -//= require jquery-ui //= require fancybox //= require jquery.easing //= require loopedslider -//= require wymeditor +//= require bootstrap +//= require bootstrap_pagedown //= require_tree . diff --git a/app/assets/javascripts/global.js b/app/assets/javascripts/global.js index eb4083f..72e49b5 100644 --- a/app/assets/javascripts/global.js +++ b/app/assets/javascripts/global.js @@ -1,177 +1,13 @@ $(function() { $.fn.loopedSlider.defaults.addPagination = true; $('#slider').loopedSlider({ autoStart: 5000, containerClick: false }); -}); - - -// Add images to editor -function add_images() -{ - $("#images_list img").each(function(){ - $(this).click(function(){ - image_operations({ element: this, title: 'Add image', text: 'Would you like to add this image to the page?' }) - }); - }); -} - -function remove_uploaded() -{ - $("p.fields").each(function() { - if ( $(this).children("input:first").val() != "" ) - $(this).remove(); - }); -} - -// Add documents to editor - -function add_documents() -{ -$("#documents a").each(function(){ - $(this).click(function(){ - document_operations({ element: this, title: 'Add document', text: 'Would you like to add this document to the page?' } ); - return false; - }); - }); -} - -// Keywords box functions - -function existing_keywords() -{ - $('#keywords option').each(function(){ - $(this).dblclick(function(){ - delete_confirmation_dialog({ - element: this, - title: 'Delete tag from tag list', - text: 'Are you sure you want to delete ' + this.value + ' from your tag list?', - onsuccess: 'keyword_list' - }); - }); - }); -} - -function add_keywords() -{ - $('#keyword_button').click(function(){ - $('#keyword_input').html(function() { - if (this.value != '') { - $.each(this.value.split(/\s?,\s?/), function(index, value) { - $('#keywords').append(''); - $("#keywords").children(":last").dblclick (function() { - delete_confirmation_dialog({ - element: this, - title: 'Delete tag from tag list', - text: 'Are you sure you want to delete ' + value + ' from your tag list?', - onsuccess: 'keyword_list' - }); - }); - }); - keyword_list(); - this.value = ''; - } - }); - }); -} - -function keyword_list() -{ - var keywords = ""; - $("#keywords option").each(function(){ - if ( keywords == "") - keywords = this.value; - else - keywords = keywords + ", " + this.value; - }); - $("#final_keywords_list").val(keywords); -} - -// Dialog box functions - -function delete_confirmation_dialog( params ) { - element = '

'; - element += params.text + '

'; - - $("#main").append(element); - - $(function() { - // a workaround for a flaw in the demo system (http://dev.jqueryui.com/ticket/4375), ignore! - $("#dialog").dialog("destroy"); - $("#dialog-confirm").dialog({ - resizable: false, - modal: true, - dialogClass: 'alert', - buttons: { - 'Delete': function() { - $(this).dialog('close'); - $(params.element).remove(); - eval(params.onsuccess + '()'); - $(this).remove(); - }, - Cancel: function() { - $(this).dialog('close'); - $(this).remove(); - } - } - }); - }); -} - -function image_operations( params ) { - element = '

'; - element += params.text + '

'; - $("#main").append(element); - - $(function() { - $("#dialog-pictures").dialog({ - resizable: false, - modal: true, - dialogClass: 'info', - buttons: { - 'Add picture to page': function() { - $(this).dialog('close'); - var img = document.createElement("img"); - var p = document.createElement(p) - p.innerHTML = ' '; - img.src = params.element.src.replace(/small/, 'medium' ); - $("body", $("iframe").contents()).append(img, p); - $("a[href=#tabs-1]").click(); - $(this).remove(); - }, - Cancel: function() { - $(this).dialog('close'); - $(this).remove(); - } - } - }); - }); -} - -// nested models -$(function() { - $('form a.add_child').click(function() { - var association = $(this).attr('data-association'); - var template = $('#' + association + '_fields_template').html(); - var regexp = new RegExp('new_' + association, 'g'); - var new_id = new Date().getTime(); - $(this).parent().before(template.replace(regexp, new_id)); - return false; - }); + if ( $("#wmd-input").length > 0 ) { + var converter = Markdown.getSanitizingConverter(); + var editor = new Markdown.Editor( converter ); - $('form a.remove_child').live('click', function() { - var hidden_field = $(this).prev('input[type=hidden]')[0]; - if(hidden_field) { - hidden_field.value = '1'; - } - $(this).parents('.fields').hide(); - return false; - }); + Markdown.Extra.init( converter ); + editor.run(); + } }); -// button methods -function submit_button() -{ - $('.submit').button( { icons: { primary: 'ui-icon-circle-check' } } ).click(function() { - $('.form').submit(); - }); -} diff --git a/app/assets/stylesheets/application.css b/app/assets/stylesheets/application.css index f0f22ee..0053bda 100644 --- a/app/assets/stylesheets/application.css +++ b/app/assets/stylesheets/application.css @@ -4,6 +4,5 @@ * the top of the compiled file, but it's generally better to create a new file per style scope. *= require_self *= require fancybox - *= require uploadify *= require main */ diff --git a/app/assets/stylesheets/dashboard.scss b/app/assets/stylesheets/dashboard.scss index 15eefd2..e65b04f 100644 --- a/app/assets/stylesheets/dashboard.scss +++ b/app/assets/stylesheets/dashboard.scss @@ -1,5 +1,7 @@ @import "compass/reset"; @import "compass/css3/border-radius"; +@import "bootstrap"; +@import "bootstrap_pagedown"; html { height: 100%; diff --git a/app/assets/stylesheets/jquery-ui.css b/app/assets/stylesheets/jquery-ui.css deleted file mode 100755 index 77d0ad2..0000000 --- a/app/assets/stylesheets/jquery-ui.css +++ /dev/null @@ -1,565 +0,0 @@ -/*! - * jQuery UI CSS Framework 1.8.19 - * - * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT or GPL Version 2 licenses. - * http://jquery.org/license - * - * http://docs.jquery.com/UI/Theming/API - */ - -/* Layout helpers -----------------------------------*/ -.ui-helper-hidden { display: none; } -.ui-helper-hidden-accessible { position: absolute !important; clip: rect(1px 1px 1px 1px); clip: rect(1px,1px,1px,1px); } -.ui-helper-reset { margin: 0; padding: 0; border: 0; outline: 0; line-height: 1.3; text-decoration: none; font-size: 100%; list-style: none; } -.ui-helper-clearfix:before, .ui-helper-clearfix:after { content: ""; display: table; } -.ui-helper-clearfix:after { clear: both; } -.ui-helper-clearfix { zoom: 1; } -.ui-helper-zfix { width: 100%; height: 100%; top: 0; left: 0; position: absolute; opacity: 0; filter:Alpha(Opacity=0); } - - -/* Interaction Cues -----------------------------------*/ -.ui-state-disabled { cursor: default !important; } - - -/* Icons -----------------------------------*/ - -/* states and images */ -.ui-icon { display: block; text-indent: -99999px; overflow: hidden; background-repeat: no-repeat; } - - -/* Misc visuals -----------------------------------*/ - -/* Overlays */ -.ui-widget-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; } - - -/*! - * jQuery UI CSS Framework 1.8.19 - * - * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT or GPL Version 2 licenses. - * http://jquery.org/license - * - * http://docs.jquery.com/UI/Theming/API - * - * To view and modify this theme, visit http://jqueryui.com/themeroller/?ffDefault=Verdana,Arial,sans-serif&fwDefault=normal&fsDefault=1.1em&cornerRadius=4px&bgColorHeader=cccccc&bgTextureHeader=03_highlight_soft.png&bgImgOpacityHeader=75&borderColorHeader=aaaaaa&fcHeader=222222&iconColorHeader=222222&bgColorContent=ffffff&bgTextureContent=01_flat.png&bgImgOpacityContent=75&borderColorContent=aaaaaa&fcContent=222222&iconColorContent=222222&bgColorDefault=e6e6e6&bgTextureDefault=02_glass.png&bgImgOpacityDefault=75&borderColorDefault=d3d3d3&fcDefault=555555&iconColorDefault=888888&bgColorHover=dadada&bgTextureHover=02_glass.png&bgImgOpacityHover=75&borderColorHover=999999&fcHover=212121&iconColorHover=454545&bgColorActive=ffffff&bgTextureActive=02_glass.png&bgImgOpacityActive=65&borderColorActive=aaaaaa&fcActive=212121&iconColorActive=454545&bgColorHighlight=fbf9ee&bgTextureHighlight=02_glass.png&bgImgOpacityHighlight=55&borderColorHighlight=fcefa1&fcHighlight=363636&iconColorHighlight=2e83ff&bgColorError=fef1ec&bgTextureError=02_glass.png&bgImgOpacityError=95&borderColorError=cd0a0a&fcError=cd0a0a&iconColorError=cd0a0a&bgColorOverlay=aaaaaa&bgTextureOverlay=01_flat.png&bgImgOpacityOverlay=0&opacityOverlay=30&bgColorShadow=aaaaaa&bgTextureShadow=01_flat.png&bgImgOpacityShadow=0&opacityShadow=30&thicknessShadow=8px&offsetTopShadow=-8px&offsetLeftShadow=-8px&cornerRadiusShadow=8px - */ - - -/* Component containers -----------------------------------*/ -.ui-widget { font-family: Verdana,Arial,sans-serif; font-size: 1.1em; } -.ui-widget .ui-widget { font-size: 1em; } -.ui-widget input, .ui-widget select, .ui-widget textarea, .ui-widget button { font-family: Verdana,Arial,sans-serif; font-size: 1em; } -.ui-widget-content { border: 1px solid #aaaaaa; background: #ffffff url(/assets/jquery-ui/ui-bg_flat_75_ffffff_40x100.png) 50% 50% repeat-x; color: #222222; } -.ui-widget-content a { color: #222222; } -.ui-widget-header { border: 1px solid #aaaaaa; background: #cccccc url(/assets/jquery-ui/ui-bg_highlight-soft_75_cccccc_1x100.png) 50% 50% repeat-x; color: #222222; font-weight: bold; } -.ui-widget-header a { color: #222222; } - -/* Interaction states -----------------------------------*/ -.ui-state-default, .ui-widget-content .ui-state-default, .ui-widget-header .ui-state-default { border: 1px solid #d3d3d3; background: #e6e6e6 url(/assets/jquery-ui/ui-bg_glass_75_e6e6e6_1x400.png) 50% 50% repeat-x; font-weight: normal; color: #555555; } -.ui-state-default a, .ui-state-default a:link, .ui-state-default a:visited { color: #555555; text-decoration: none; } -.ui-state-hover, .ui-widget-content .ui-state-hover, .ui-widget-header .ui-state-hover, .ui-state-focus, .ui-widget-content .ui-state-focus, .ui-widget-header .ui-state-focus { border: 1px solid #999999; background: #dadada url(/assets/jquery-ui/ui-bg_glass_75_dadada_1x400.png) 50% 50% repeat-x; font-weight: normal; color: #212121; } -.ui-state-hover a, .ui-state-hover a:hover { color: #212121; text-decoration: none; } -.ui-state-active, .ui-widget-content .ui-state-active, .ui-widget-header .ui-state-active { border: 1px solid #aaaaaa; background: #ffffff url(/assets/jquery-ui/ui-bg_glass_65_ffffff_1x400.png) 50% 50% repeat-x; font-weight: normal; color: #212121; } -.ui-state-active a, .ui-state-active a:link, .ui-state-active a:visited { color: #212121; text-decoration: none; } -.ui-widget :active { outline: none; } - -/* Interaction Cues -----------------------------------*/ -.ui-state-highlight, .ui-widget-content .ui-state-highlight, .ui-widget-header .ui-state-highlight {border: 1px solid #fcefa1; background: #fbf9ee url(/assets/jquery-ui/ui-bg_glass_55_fbf9ee_1x400.png) 50% 50% repeat-x; color: #363636; } -.ui-state-highlight a, .ui-widget-content .ui-state-highlight a,.ui-widget-header .ui-state-highlight a { color: #363636; } -.ui-state-error, .ui-widget-content .ui-state-error, .ui-widget-header .ui-state-error {border: 1px solid #cd0a0a; background: #fef1ec url(/assets/jquery-ui/ui-bg_glass_95_fef1ec_1x400.png) 50% 50% repeat-x; color: #cd0a0a; } -.ui-state-error a, .ui-widget-content .ui-state-error a, .ui-widget-header .ui-state-error a { color: #cd0a0a; } -.ui-state-error-text, .ui-widget-content .ui-state-error-text, .ui-widget-header .ui-state-error-text { color: #cd0a0a; } -.ui-priority-primary, .ui-widget-content .ui-priority-primary, .ui-widget-header .ui-priority-primary { font-weight: bold; } -.ui-priority-secondary, .ui-widget-content .ui-priority-secondary, .ui-widget-header .ui-priority-secondary { opacity: .7; filter:Alpha(Opacity=70); font-weight: normal; } -.ui-state-disabled, .ui-widget-content .ui-state-disabled, .ui-widget-header .ui-state-disabled { opacity: .35; filter:Alpha(Opacity=35); background-image: none; } - -/* Icons -----------------------------------*/ - -/* states and images */ -.ui-icon { width: 16px; height: 16px; background-image: url(/assets/jquery-ui/ui-icons_222222_256x240.png); } -.ui-widget-content .ui-icon {background-image: url(/assets/jquery-ui/ui-icons_222222_256x240.png); } -.ui-widget-header .ui-icon {background-image: url(/assets/jquery-ui/ui-icons_222222_256x240.png); } -.ui-state-default .ui-icon { background-image: url(/assets/jquery-ui/ui-icons_888888_256x240.png); } -.ui-state-hover .ui-icon, .ui-state-focus .ui-icon {background-image: url(/assets/jquery-ui/ui-icons_454545_256x240.png); } -.ui-state-active .ui-icon {background-image: url(/assets/jquery-ui/ui-icons_454545_256x240.png); } -.ui-state-highlight .ui-icon {background-image: url(/assets/jquery-ui/ui-icons_2e83ff_256x240.png); } -.ui-state-error .ui-icon, .ui-state-error-text .ui-icon {background-image: url(/assets/jquery-ui/ui-icons_cd0a0a_256x240.png); } - -/* positioning */ -.ui-icon-carat-1-n { background-position: 0 0; } -.ui-icon-carat-1-ne { background-position: -16px 0; } -.ui-icon-carat-1-e { background-position: -32px 0; } -.ui-icon-carat-1-se { background-position: -48px 0; } -.ui-icon-carat-1-s { background-position: -64px 0; } -.ui-icon-carat-1-sw { background-position: -80px 0; } -.ui-icon-carat-1-w { background-position: -96px 0; } -.ui-icon-carat-1-nw { background-position: -112px 0; } -.ui-icon-carat-2-n-s { background-position: -128px 0; } -.ui-icon-carat-2-e-w { background-position: -144px 0; } -.ui-icon-triangle-1-n { background-position: 0 -16px; } -.ui-icon-triangle-1-ne { background-position: -16px -16px; } -.ui-icon-triangle-1-e { background-position: -32px -16px; } -.ui-icon-triangle-1-se { background-position: -48px -16px; } -.ui-icon-triangle-1-s { background-position: -64px -16px; } -.ui-icon-triangle-1-sw { background-position: -80px -16px; } -.ui-icon-triangle-1-w { background-position: -96px -16px; } -.ui-icon-triangle-1-nw { background-position: -112px -16px; } -.ui-icon-triangle-2-n-s { background-position: -128px -16px; } -.ui-icon-triangle-2-e-w { background-position: -144px -16px; } -.ui-icon-arrow-1-n { background-position: 0 -32px; } -.ui-icon-arrow-1-ne { background-position: -16px -32px; } -.ui-icon-arrow-1-e { background-position: -32px -32px; } -.ui-icon-arrow-1-se { background-position: -48px -32px; } -.ui-icon-arrow-1-s { background-position: -64px -32px; } -.ui-icon-arrow-1-sw { background-position: -80px -32px; } -.ui-icon-arrow-1-w { background-position: -96px -32px; } -.ui-icon-arrow-1-nw { background-position: -112px -32px; } -.ui-icon-arrow-2-n-s { background-position: -128px -32px; } -.ui-icon-arrow-2-ne-sw { background-position: -144px -32px; } -.ui-icon-arrow-2-e-w { background-position: -160px -32px; } -.ui-icon-arrow-2-se-nw { background-position: -176px -32px; } -.ui-icon-arrowstop-1-n { background-position: -192px -32px; } -.ui-icon-arrowstop-1-e { background-position: -208px -32px; } -.ui-icon-arrowstop-1-s { background-position: -224px -32px; } -.ui-icon-arrowstop-1-w { background-position: -240px -32px; } -.ui-icon-arrowthick-1-n { background-position: 0 -48px; } -.ui-icon-arrowthick-1-ne { background-position: -16px -48px; } -.ui-icon-arrowthick-1-e { background-position: -32px -48px; } -.ui-icon-arrowthick-1-se { background-position: -48px -48px; } -.ui-icon-arrowthick-1-s { background-position: -64px -48px; } -.ui-icon-arrowthick-1-sw { background-position: -80px -48px; } -.ui-icon-arrowthick-1-w { background-position: -96px -48px; } -.ui-icon-arrowthick-1-nw { background-position: -112px -48px; } -.ui-icon-arrowthick-2-n-s { background-position: -128px -48px; } -.ui-icon-arrowthick-2-ne-sw { background-position: -144px -48px; } -.ui-icon-arrowthick-2-e-w { background-position: -160px -48px; } -.ui-icon-arrowthick-2-se-nw { background-position: -176px -48px; } -.ui-icon-arrowthickstop-1-n { background-position: -192px -48px; } -.ui-icon-arrowthickstop-1-e { background-position: -208px -48px; } -.ui-icon-arrowthickstop-1-s { background-position: -224px -48px; } -.ui-icon-arrowthickstop-1-w { background-position: -240px -48px; } -.ui-icon-arrowreturnthick-1-w { background-position: 0 -64px; } -.ui-icon-arrowreturnthick-1-n { background-position: -16px -64px; } -.ui-icon-arrowreturnthick-1-e { background-position: -32px -64px; } -.ui-icon-arrowreturnthick-1-s { background-position: -48px -64px; } -.ui-icon-arrowreturn-1-w { background-position: -64px -64px; } -.ui-icon-arrowreturn-1-n { background-position: -80px -64px; } -.ui-icon-arrowreturn-1-e { background-position: -96px -64px; } -.ui-icon-arrowreturn-1-s { background-position: -112px -64px; } -.ui-icon-arrowrefresh-1-w { background-position: -128px -64px; } -.ui-icon-arrowrefresh-1-n { background-position: -144px -64px; } -.ui-icon-arrowrefresh-1-e { background-position: -160px -64px; } -.ui-icon-arrowrefresh-1-s { background-position: -176px -64px; } -.ui-icon-arrow-4 { background-position: 0 -80px; } -.ui-icon-arrow-4-diag { background-position: -16px -80px; } -.ui-icon-extlink { background-position: -32px -80px; } -.ui-icon-newwin { background-position: -48px -80px; } -.ui-icon-refresh { background-position: -64px -80px; } -.ui-icon-shuffle { background-position: -80px -80px; } -.ui-icon-transfer-e-w { background-position: -96px -80px; } -.ui-icon-transferthick-e-w { background-position: -112px -80px; } -.ui-icon-folder-collapsed { background-position: 0 -96px; } -.ui-icon-folder-open { background-position: -16px -96px; } -.ui-icon-document { background-position: -32px -96px; } -.ui-icon-document-b { background-position: -48px -96px; } -.ui-icon-note { background-position: -64px -96px; } -.ui-icon-mail-closed { background-position: -80px -96px; } -.ui-icon-mail-open { background-position: -96px -96px; } -.ui-icon-suitcase { background-position: -112px -96px; } -.ui-icon-comment { background-position: -128px -96px; } -.ui-icon-person { background-position: -144px -96px; } -.ui-icon-print { background-position: -160px -96px; } -.ui-icon-trash { background-position: -176px -96px; } -.ui-icon-locked { background-position: -192px -96px; } -.ui-icon-unlocked { background-position: -208px -96px; } -.ui-icon-bookmark { background-position: -224px -96px; } -.ui-icon-tag { background-position: -240px -96px; } -.ui-icon-home { background-position: 0 -112px; } -.ui-icon-flag { background-position: -16px -112px; } -.ui-icon-calendar { background-position: -32px -112px; } -.ui-icon-cart { background-position: -48px -112px; } -.ui-icon-pencil { background-position: -64px -112px; } -.ui-icon-clock { background-position: -80px -112px; } -.ui-icon-disk { background-position: -96px -112px; } -.ui-icon-calculator { background-position: -112px -112px; } -.ui-icon-zoomin { background-position: -128px -112px; } -.ui-icon-zoomout { background-position: -144px -112px; } -.ui-icon-search { background-position: -160px -112px; } -.ui-icon-wrench { background-position: -176px -112px; } -.ui-icon-gear { background-position: -192px -112px; } -.ui-icon-heart { background-position: -208px -112px; } -.ui-icon-star { background-position: -224px -112px; } -.ui-icon-link { background-position: -240px -112px; } -.ui-icon-cancel { background-position: 0 -128px; } -.ui-icon-plus { background-position: -16px -128px; } -.ui-icon-plusthick { background-position: -32px -128px; } -.ui-icon-minus { background-position: -48px -128px; } -.ui-icon-minusthick { background-position: -64px -128px; } -.ui-icon-close { background-position: -80px -128px; } -.ui-icon-closethick { background-position: -96px -128px; } -.ui-icon-key { background-position: -112px -128px; } -.ui-icon-lightbulb { background-position: -128px -128px; } -.ui-icon-scissors { background-position: -144px -128px; } -.ui-icon-clipboard { background-position: -160px -128px; } -.ui-icon-copy { background-position: -176px -128px; } -.ui-icon-contact { background-position: -192px -128px; } -.ui-icon-image { background-position: -208px -128px; } -.ui-icon-video { background-position: -224px -128px; } -.ui-icon-script { background-position: -240px -128px; } -.ui-icon-alert { background-position: 0 -144px; } -.ui-icon-info { background-position: -16px -144px; } -.ui-icon-notice { background-position: -32px -144px; } -.ui-icon-help { background-position: -48px -144px; } -.ui-icon-check { background-position: -64px -144px; } -.ui-icon-bullet { background-position: -80px -144px; } -.ui-icon-radio-off { background-position: -96px -144px; } -.ui-icon-radio-on { background-position: -112px -144px; } -.ui-icon-pin-w { background-position: -128px -144px; } -.ui-icon-pin-s { background-position: -144px -144px; } -.ui-icon-play { background-position: 0 -160px; } -.ui-icon-pause { background-position: -16px -160px; } -.ui-icon-seek-next { background-position: -32px -160px; } -.ui-icon-seek-prev { background-position: -48px -160px; } -.ui-icon-seek-end { background-position: -64px -160px; } -.ui-icon-seek-start { background-position: -80px -160px; } -/* ui-icon-seek-first is deprecated, use ui-icon-seek-start instead */ -.ui-icon-seek-first { background-position: -80px -160px; } -.ui-icon-stop { background-position: -96px -160px; } -.ui-icon-eject { background-position: -112px -160px; } -.ui-icon-volume-off { background-position: -128px -160px; } -.ui-icon-volume-on { background-position: -144px -160px; } -.ui-icon-power { background-position: 0 -176px; } -.ui-icon-signal-diag { background-position: -16px -176px; } -.ui-icon-signal { background-position: -32px -176px; } -.ui-icon-battery-0 { background-position: -48px -176px; } -.ui-icon-battery-1 { background-position: -64px -176px; } -.ui-icon-battery-2 { background-position: -80px -176px; } -.ui-icon-battery-3 { background-position: -96px -176px; } -.ui-icon-circle-plus { background-position: 0 -192px; } -.ui-icon-circle-minus { background-position: -16px -192px; } -.ui-icon-circle-close { background-position: -32px -192px; } -.ui-icon-circle-triangle-e { background-position: -48px -192px; } -.ui-icon-circle-triangle-s { background-position: -64px -192px; } -.ui-icon-circle-triangle-w { background-position: -80px -192px; } -.ui-icon-circle-triangle-n { background-position: -96px -192px; } -.ui-icon-circle-arrow-e { background-position: -112px -192px; } -.ui-icon-circle-arrow-s { background-position: -128px -192px; } -.ui-icon-circle-arrow-w { background-position: -144px -192px; } -.ui-icon-circle-arrow-n { background-position: -160px -192px; } -.ui-icon-circle-zoomin { background-position: -176px -192px; } -.ui-icon-circle-zoomout { background-position: -192px -192px; } -.ui-icon-circle-check { background-position: -208px -192px; } -.ui-icon-circlesmall-plus { background-position: 0 -208px; } -.ui-icon-circlesmall-minus { background-position: -16px -208px; } -.ui-icon-circlesmall-close { background-position: -32px -208px; } -.ui-icon-squaresmall-plus { background-position: -48px -208px; } -.ui-icon-squaresmall-minus { background-position: -64px -208px; } -.ui-icon-squaresmall-close { background-position: -80px -208px; } -.ui-icon-grip-dotted-vertical { background-position: 0 -224px; } -.ui-icon-grip-dotted-horizontal { background-position: -16px -224px; } -.ui-icon-grip-solid-vertical { background-position: -32px -224px; } -.ui-icon-grip-solid-horizontal { background-position: -48px -224px; } -.ui-icon-gripsmall-diagonal-se { background-position: -64px -224px; } -.ui-icon-grip-diagonal-se { background-position: -80px -224px; } - - -/* Misc visuals -----------------------------------*/ - -/* Corner radius */ -.ui-corner-all, .ui-corner-top, .ui-corner-left, .ui-corner-tl { -moz-border-radius-topleft: 4px; -webkit-border-top-left-radius: 4px; -khtml-border-top-left-radius: 4px; border-top-left-radius: 4px; } -.ui-corner-all, .ui-corner-top, .ui-corner-right, .ui-corner-tr { -moz-border-radius-topright: 4px; -webkit-border-top-right-radius: 4px; -khtml-border-top-right-radius: 4px; border-top-right-radius: 4px; } -.ui-corner-all, .ui-corner-bottom, .ui-corner-left, .ui-corner-bl { -moz-border-radius-bottomleft: 4px; -webkit-border-bottom-left-radius: 4px; -khtml-border-bottom-left-radius: 4px; border-bottom-left-radius: 4px; } -.ui-corner-all, .ui-corner-bottom, .ui-corner-right, .ui-corner-br { -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 4px; -khtml-border-bottom-right-radius: 4px; border-bottom-right-radius: 4px; } - -/* Overlays */ -.ui-widget-overlay { background: #aaaaaa url(/assets/jquery-ui/ui-bg_flat_0_aaaaaa_40x100.png) 50% 50% repeat-x; opacity: .30;filter:Alpha(Opacity=30); } -.ui-widget-shadow { margin: -8px 0 0 -8px; padding: 8px; background: #aaaaaa url(/assets/jquery-ui/ui-bg_flat_0_aaaaaa_40x100.png) 50% 50% repeat-x; opacity: .30;filter:Alpha(Opacity=30); -moz-border-radius: 8px; -khtml-border-radius: 8px; -webkit-border-radius: 8px; border-radius: 8px; }/*! - * jQuery UI Resizable 1.8.19 - * - * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT or GPL Version 2 licenses. - * http://jquery.org/license - * - * http://docs.jquery.com/UI/Resizable#theming - */ -.ui-resizable { position: relative;} -.ui-resizable-handle { position: absolute;font-size: 0.1px;z-index: 99999; display: block; } -.ui-resizable-disabled .ui-resizable-handle, .ui-resizable-autohide .ui-resizable-handle { display: none; } -.ui-resizable-n { cursor: n-resize; height: 7px; width: 100%; top: -5px; left: 0; } -.ui-resizable-s { cursor: s-resize; height: 7px; width: 100%; bottom: -5px; left: 0; } -.ui-resizable-e { cursor: e-resize; width: 7px; right: -5px; top: 0; height: 100%; } -.ui-resizable-w { cursor: w-resize; width: 7px; left: -5px; top: 0; height: 100%; } -.ui-resizable-se { cursor: se-resize; width: 12px; height: 12px; right: 1px; bottom: 1px; } -.ui-resizable-sw { cursor: sw-resize; width: 9px; height: 9px; left: -5px; bottom: -5px; } -.ui-resizable-nw { cursor: nw-resize; width: 9px; height: 9px; left: -5px; top: -5px; } -.ui-resizable-ne { cursor: ne-resize; width: 9px; height: 9px; right: -5px; top: -5px;}/*! - * jQuery UI Selectable 1.8.19 - * - * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT or GPL Version 2 licenses. - * http://jquery.org/license - * - * http://docs.jquery.com/UI/Selectable#theming - */ -.ui-selectable-helper { position: absolute; z-index: 100; border:1px dotted black; } -/*! - * jQuery UI Accordion 1.8.19 - * - * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT or GPL Version 2 licenses. - * http://jquery.org/license - * - * http://docs.jquery.com/UI/Accordion#theming - */ -/* IE/Win - Fix animation bug - #4615 */ -.ui-accordion { width: 100%; } -.ui-accordion .ui-accordion-header { cursor: pointer; position: relative; margin-top: 1px; zoom: 1; } -.ui-accordion .ui-accordion-li-fix { display: inline; } -.ui-accordion .ui-accordion-header-active { border-bottom: 0 !important; } -.ui-accordion .ui-accordion-header a { display: block; font-size: 1em; padding: .5em .5em .5em .7em; } -.ui-accordion-icons .ui-accordion-header a { padding-left: 2.2em; } -.ui-accordion .ui-accordion-header .ui-icon { position: absolute; left: .5em; top: 50%; margin-top: -8px; } -.ui-accordion .ui-accordion-content { padding: 1em 2.2em; border-top: 0; margin-top: -2px; position: relative; top: 1px; margin-bottom: 2px; overflow: auto; display: none; zoom: 1; } -.ui-accordion .ui-accordion-content-active { display: block; } -/*! - * jQuery UI Autocomplete 1.8.19 - * - * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT or GPL Version 2 licenses. - * http://jquery.org/license - * - * http://docs.jquery.com/UI/Autocomplete#theming - */ -.ui-autocomplete { position: absolute; cursor: default; } - -/* workarounds */ -* html .ui-autocomplete { width:1px; } /* without this, the menu expands to 100% in IE6 */ - -/* - * jQuery UI Menu @VERSION - * - * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT or GPL Version 2 licenses. - * http://jquery.org/license - * - * http://docs.jquery.com/UI/Menu#theming - */ -.ui-menu { - list-style:none; - padding: 2px; - margin: 0; - display:block; - float: left; -} -.ui-menu .ui-menu { - margin-top: -3px; -} -.ui-menu .ui-menu-item { - margin:0; - padding: 0; - zoom: 1; - float: left; - clear: left; - width: 100%; -} -.ui-menu .ui-menu-item a { - text-decoration:none; - display:block; - padding:.2em .4em; - line-height:1.5; - zoom:1; -} -.ui-menu .ui-menu-item a.ui-state-hover, -.ui-menu .ui-menu-item a.ui-state-active { - font-weight: normal; - margin: -1px; -} -/*! - * jQuery UI Button 1.8.19 - * - * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT or GPL Version 2 licenses. - * http://jquery.org/license - * - * http://docs.jquery.com/UI/Button#theming - */ -.ui-button { display: inline-block; position: relative; padding: 0; margin-right: .1em; text-decoration: none !important; cursor: pointer; text-align: center; zoom: 1; overflow: visible; } /* the overflow property removes extra width in IE */ -.ui-button-icon-only { width: 2.2em; } /* to make room for the icon, a width needs to be set here */ -button.ui-button-icon-only { width: 2.4em; } /* button elements seem to need a little more width */ -.ui-button-icons-only { width: 3.4em; } -button.ui-button-icons-only { width: 3.7em; } - -/*button text element */ -.ui-button .ui-button-text { display: block; line-height: 1.4; } -.ui-button-text-only .ui-button-text { padding: .4em 1em; } -.ui-button-icon-only .ui-button-text, .ui-button-icons-only .ui-button-text { padding: .4em; text-indent: -9999999px; } -.ui-button-text-icon-primary .ui-button-text, .ui-button-text-icons .ui-button-text { padding: .4em 1em .4em 2.1em; } -.ui-button-text-icon-secondary .ui-button-text, .ui-button-text-icons .ui-button-text { padding: .4em 2.1em .4em 1em; } -.ui-button-text-icons .ui-button-text { padding-left: 2.1em; padding-right: 2.1em; } -/* no icon support for input elements, provide padding by default */ -input.ui-button { padding: .4em 1em; } - -/*button icon element(s) */ -.ui-button-icon-only .ui-icon, .ui-button-text-icon-primary .ui-icon, .ui-button-text-icon-secondary .ui-icon, .ui-button-text-icons .ui-icon, .ui-button-icons-only .ui-icon { position: absolute; top: 50%; margin-top: -8px; } -.ui-button-icon-only .ui-icon { left: 50%; margin-left: -8px; } -.ui-button-text-icon-primary .ui-button-icon-primary, .ui-button-text-icons .ui-button-icon-primary, .ui-button-icons-only .ui-button-icon-primary { left: .5em; } -.ui-button-text-icon-secondary .ui-button-icon-secondary, .ui-button-text-icons .ui-button-icon-secondary, .ui-button-icons-only .ui-button-icon-secondary { right: .5em; } -.ui-button-text-icons .ui-button-icon-secondary, .ui-button-icons-only .ui-button-icon-secondary { right: .5em; } - -/*button sets*/ -.ui-buttonset { margin-right: 7px; } -.ui-buttonset .ui-button { margin-left: 0; margin-right: -.3em; } - -/* workarounds */ -button.ui-button::-moz-focus-inner { border: 0; padding: 0; } /* reset extra padding in Firefox */ -/*! - * jQuery UI Dialog 1.8.19 - * - * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT or GPL Version 2 licenses. - * http://jquery.org/license - * - * http://docs.jquery.com/UI/Dialog#theming - */ -.ui-dialog { position: absolute; padding: .2em; width: 300px; overflow: hidden; } -.ui-dialog .ui-dialog-titlebar { padding: .4em 1em; position: relative; } -.ui-dialog .ui-dialog-title { float: left; margin: .1em 16px .1em 0; } -.ui-dialog .ui-dialog-titlebar-close { position: absolute; right: .3em; top: 50%; width: 19px; margin: -10px 0 0 0; padding: 1px; height: 18px; } -.ui-dialog .ui-dialog-titlebar-close span { display: block; margin: 1px; } -.ui-dialog .ui-dialog-titlebar-close:hover, .ui-dialog .ui-dialog-titlebar-close:focus { padding: 0; } -.ui-dialog .ui-dialog-content { position: relative; border: 0; padding: .5em 1em; background: none; overflow: auto; zoom: 1; } -.ui-dialog .ui-dialog-buttonpane { text-align: left; border-width: 1px 0 0 0; background-image: none; margin: .5em 0 0 0; padding: .3em 1em .5em .4em; } -.ui-dialog .ui-dialog-buttonpane .ui-dialog-buttonset { float: right; } -.ui-dialog .ui-dialog-buttonpane button { margin: .5em .4em .5em 0; cursor: pointer; } -.ui-dialog .ui-resizable-se { width: 14px; height: 14px; right: 3px; bottom: 3px; } -.ui-draggable .ui-dialog-titlebar { cursor: move; } -/*! - * jQuery UI Slider 1.8.19 - * - * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT or GPL Version 2 licenses. - * http://jquery.org/license - * - * http://docs.jquery.com/UI/Slider#theming - */ -.ui-slider { position: relative; text-align: left; } -.ui-slider .ui-slider-handle { position: absolute; z-index: 2; width: 1.2em; height: 1.2em; cursor: default; } -.ui-slider .ui-slider-range { position: absolute; z-index: 1; font-size: .7em; display: block; border: 0; background-position: 0 0; } - -.ui-slider-horizontal { height: .8em; } -.ui-slider-horizontal .ui-slider-handle { top: -.3em; margin-left: -.6em; } -.ui-slider-horizontal .ui-slider-range { top: 0; height: 100%; } -.ui-slider-horizontal .ui-slider-range-min { left: 0; } -.ui-slider-horizontal .ui-slider-range-max { right: 0; } - -.ui-slider-vertical { width: .8em; height: 100px; } -.ui-slider-vertical .ui-slider-handle { left: -.3em; margin-left: 0; margin-bottom: -.6em; } -.ui-slider-vertical .ui-slider-range { left: 0; width: 100%; } -.ui-slider-vertical .ui-slider-range-min { bottom: 0; } -.ui-slider-vertical .ui-slider-range-max { top: 0; }/*! - * jQuery UI Tabs 1.8.19 - * - * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT or GPL Version 2 licenses. - * http://jquery.org/license - * - * http://docs.jquery.com/UI/Tabs#theming - */ -.ui-tabs { position: relative; padding: .2em; zoom: 1; } /* position: relative prevents IE scroll bug (element with position: relative inside container with overflow: auto appear as "fixed") */ -.ui-tabs .ui-tabs-nav { margin: 0; padding: .2em .2em 0; } -.ui-tabs .ui-tabs-nav li { list-style: none; float: left; position: relative; top: 1px; margin: 0 .2em 1px 0; border-bottom: 0 !important; padding: 0; white-space: nowrap; } -.ui-tabs .ui-tabs-nav li a { float: left; padding: .5em 1em; text-decoration: none; } -.ui-tabs .ui-tabs-nav li.ui-tabs-selected { margin-bottom: 0; padding-bottom: 1px; } -.ui-tabs .ui-tabs-nav li.ui-tabs-selected a, .ui-tabs .ui-tabs-nav li.ui-state-disabled a, .ui-tabs .ui-tabs-nav li.ui-state-processing a { cursor: text; } -.ui-tabs .ui-tabs-nav li a, .ui-tabs.ui-tabs-collapsible .ui-tabs-nav li.ui-tabs-selected a { cursor: pointer; } /* first selector in group seems obsolete, but required to overcome bug in Opera applying cursor: text overall if defined elsewhere... */ -.ui-tabs .ui-tabs-panel { display: block; border-width: 0; padding: 1em 1.4em; background: none; } -.ui-tabs .ui-tabs-hide { display: none !important; } -/*! - * jQuery UI Datepicker 1.8.19 - * - * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT or GPL Version 2 licenses. - * http://jquery.org/license - * - * http://docs.jquery.com/UI/Datepicker#theming - */ -.ui-datepicker { width: 17em; padding: .2em .2em 0; display: none; } -.ui-datepicker .ui-datepicker-header { position:relative; padding:.2em 0; } -.ui-datepicker .ui-datepicker-prev, .ui-datepicker .ui-datepicker-next { position:absolute; top: 2px; width: 1.8em; height: 1.8em; } -.ui-datepicker .ui-datepicker-prev-hover, .ui-datepicker .ui-datepicker-next-hover { top: 1px; } -.ui-datepicker .ui-datepicker-prev { left:2px; } -.ui-datepicker .ui-datepicker-next { right:2px; } -.ui-datepicker .ui-datepicker-prev-hover { left:1px; } -.ui-datepicker .ui-datepicker-next-hover { right:1px; } -.ui-datepicker .ui-datepicker-prev span, .ui-datepicker .ui-datepicker-next span { display: block; position: absolute; left: 50%; margin-left: -8px; top: 50%; margin-top: -8px; } -.ui-datepicker .ui-datepicker-title { margin: 0 2.3em; line-height: 1.8em; text-align: center; } -.ui-datepicker .ui-datepicker-title select { font-size:1em; margin:1px 0; } -.ui-datepicker select.ui-datepicker-month-year {width: 100%;} -.ui-datepicker select.ui-datepicker-month, -.ui-datepicker select.ui-datepicker-year { width: 49%;} -.ui-datepicker table {width: 100%; font-size: .9em; border-collapse: collapse; margin:0 0 .4em; } -.ui-datepicker th { padding: .7em .3em; text-align: center; font-weight: bold; border: 0; } -.ui-datepicker td { border: 0; padding: 1px; } -.ui-datepicker td span, .ui-datepicker td a { display: block; padding: .2em; text-align: right; text-decoration: none; } -.ui-datepicker .ui-datepicker-buttonpane { background-image: none; margin: .7em 0 0 0; padding:0 .2em; border-left: 0; border-right: 0; border-bottom: 0; } -.ui-datepicker .ui-datepicker-buttonpane button { float: right; margin: .5em .2em .4em; cursor: pointer; padding: .2em .6em .3em .6em; width:auto; overflow:visible; } -.ui-datepicker .ui-datepicker-buttonpane button.ui-datepicker-current { float:left; } - -/* with multiple calendars */ -.ui-datepicker.ui-datepicker-multi { width:auto; } -.ui-datepicker-multi .ui-datepicker-group { float:left; } -.ui-datepicker-multi .ui-datepicker-group table { width:95%; margin:0 auto .4em; } -.ui-datepicker-multi-2 .ui-datepicker-group { width:50%; } -.ui-datepicker-multi-3 .ui-datepicker-group { width:33.3%; } -.ui-datepicker-multi-4 .ui-datepicker-group { width:25%; } -.ui-datepicker-multi .ui-datepicker-group-last .ui-datepicker-header { border-left-width:0; } -.ui-datepicker-multi .ui-datepicker-group-middle .ui-datepicker-header { border-left-width:0; } -.ui-datepicker-multi .ui-datepicker-buttonpane { clear:left; } -.ui-datepicker-row-break { clear:both; width:100%; font-size:0em; } - -/* RTL support */ -.ui-datepicker-rtl { direction: rtl; } -.ui-datepicker-rtl .ui-datepicker-prev { right: 2px; left: auto; } -.ui-datepicker-rtl .ui-datepicker-next { left: 2px; right: auto; } -.ui-datepicker-rtl .ui-datepicker-prev:hover { right: 1px; left: auto; } -.ui-datepicker-rtl .ui-datepicker-next:hover { left: 1px; right: auto; } -.ui-datepicker-rtl .ui-datepicker-buttonpane { clear:right; } -.ui-datepicker-rtl .ui-datepicker-buttonpane button { float: left; } -.ui-datepicker-rtl .ui-datepicker-buttonpane button.ui-datepicker-current { float:right; } -.ui-datepicker-rtl .ui-datepicker-group { float:right; } -.ui-datepicker-rtl .ui-datepicker-group-last .ui-datepicker-header { border-right-width:0; border-left-width:1px; } -.ui-datepicker-rtl .ui-datepicker-group-middle .ui-datepicker-header { border-right-width:0; border-left-width:1px; } - -/* IE6 IFRAME FIX (taken from datepicker 1.5.3 */ -.ui-datepicker-cover { - display: none; /*sorry for IE5*/ - display/**/: block; /*sorry for IE5*/ - position: absolute; /*must have*/ - z-index: -1; /*must have*/ - filter: mask(); /*must have*/ - top: -4px; /*must have*/ - left: -4px; /*must have*/ - width: 200px; /*must have*/ - height: 200px; /*must have*/ -}/*! - * jQuery UI Progressbar 1.8.19 - * - * Copyright 2012, AUTHORS.txt (http://jqueryui.com/about) - * Dual licensed under the MIT or GPL Version 2 licenses. - * http://jquery.org/license - * - * http://docs.jquery.com/UI/Progressbar#theming - */ -.ui-progressbar { height:2em; text-align: left; overflow: hidden; } -.ui-progressbar .ui-progressbar-value {margin: -1px; height:100%; } diff --git a/app/assets/stylesheets/uploadify.css b/app/assets/stylesheets/uploadify.css deleted file mode 100644 index 405f59c..0000000 --- a/app/assets/stylesheets/uploadify.css +++ /dev/null @@ -1,52 +0,0 @@ -/* -Uploadify v2.1.4 -Release Date: November 8, 2010 - -Copyright (c) 2010 Ronnie Garcia, Travis Nickels - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. -*/ -.uploadifyQueueItem { - background-color: #F5F5F5; - border: 2px solid #E5E5E5; - font: 11px Verdana, Geneva, sans-serif; - margin-top: 5px; - padding: 10px; - width: 350px; -} -.uploadifyError { - background-color: #FDE5DD !important; - border: 2px solid #FBCBBC !important; -} -.uploadifyQueueItem .cancel { - float: right; -} -.uploadifyQueue .completed { - background-color: #E5E5E5; -} -.uploadifyProgress { - background-color: #E5E5E5; - margin-top: 10px; - width: 100%; -} -.uploadifyProgressBar { - background-color: #0099FF; - height: 3px; - width: 1px; -} \ No newline at end of file diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 6d00948..23d4348 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -2,9 +2,9 @@ class ApplicationController < ActionController::Base before_filter :set_locale, :authenticate_user! layout :guess_layout - rescue_from ActiveRecord::RecordNotFound, :with => :page_not_found - rescue_from Clover::PageNotFoundError, :with => :page_not_found - rescue_from Clover::UnauthorizedAccessError, :with => :unauthorized_access + rescue_from ActiveRecord::RecordNotFound, with: :page_not_found + rescue_from Clover::PageNotFoundError, with: :page_not_found + rescue_from Clover::UnauthorizedAccessError, with: :unauthorized_access protect_from_forgery @@ -21,40 +21,32 @@ def set_locale end def devise_layout - if controller_name == 'registrations' - set_tab :edit_user - return 'dashboard' - end - - 'sessions' + return 'sessions' unless controller_name === 'registrations' + set_tab :edit_user + return 'dashboard' end def website_layout - return "themes/#{ site[:theme] }/theme" if site[:theme].present? - 'themes/default/theme' + return "themes/#{ site[:theme] || 'default' }/theme" end def dashboard_controller? - params[:controller] =~ /^dashboard\/[a-z_]+$/ + controller_path =~ /^dashboard\/[a-z_]+$/ end def guess_layout - if dashboard_controller? - 'dashboard' - elsif devise_controller? - devise_layout - else - website_layout - end + return devise_layout if devise_controller? + return 'dashboard' if dashboard_controller? + + website_layout end protected def unauthorized_access - flash[:info] = t 'messages.unauthorized_access' - redirect_to new_user_session_path + redirect_to new_user_session_path, flash: { info: t('messages.unauthorized_access') } end def page_not_found - render 'public/404.html', :formats => [ :html ], :status => :not_found, :layout => false + render 'public/404', formats: [ :html ], status: :not_found, layout: false end end diff --git a/app/controllers/contact_forms_controller.rb b/app/controllers/contact_forms_controller.rb index d7b79a1..69a6a13 100644 --- a/app/controllers/contact_forms_controller.rb +++ b/app/controllers/contact_forms_controller.rb @@ -2,12 +2,12 @@ class ContactFormsController < ApplicationController def create @contact_form = ContactForm.new params[:contact_form] - if @contact_form.valid? + if @contact_form.deliver flash[:success] = t 'messages.email_sent' - redirect_to root_path else flash[:error] = t 'messages.failed_miserably' - redirect_to request.env["HTTP_REFERER"] end + + redirect_to :back end end diff --git a/app/controllers/dashboard/assets_controller.rb b/app/controllers/dashboard/assets_controller.rb deleted file mode 100644 index 3b0c65e..0000000 --- a/app/controllers/dashboard/assets_controller.rb +++ /dev/null @@ -1,23 +0,0 @@ -class Dashboard::AssetsController < ApplicationController - before_filter :fix_content_type - - def create - @asset = Asset.new :attachable_type => params[:attachable_type], :attachable_id => params[:attachable_id] - @asset.asset = params[:Filedata] - - if @asset.save! - success = { :status => 'success', :thumbnail => @asset.asset.url(:small) }.to_json - render :json => success - else - render :json => { :status => 'error' }.to_json - end - end - - def destroy - end - - private - def fix_content_type - params[:Filedata].content_type = MIME::Types.type_for(params[:Filedata].original_filename).to_s - end -end diff --git a/app/controllers/dashboard/pages_controller.rb b/app/controllers/dashboard/pages_controller.rb index 8e788d6..fa83b63 100644 --- a/app/controllers/dashboard/pages_controller.rb +++ b/app/controllers/dashboard/pages_controller.rb @@ -1,52 +1,42 @@ class Dashboard::PagesController < ApplicationController - before_filter :set_page, :only => [ :edit, :update, :destroy ] + before_filter :find_page, only: [ :edit, :update, :destroy ] - set_tab :list_pages, :only => :index - set_tab :new_page, :only => :new + set_tab :list_pages, only: :index + set_tab :new_page, only: :new - # GET /pages def index - @pages = Page.page params[:page] + @pages = Page.includes( :section ).page params[:page] end - # GET /pages/new def new @page = Page.new end - # POST /pages def create - @page = Page.new params[:page].except('keywords') - @page.keyword_list = params[:page][:keywords] if params[:page][:keywords].present? + @page = Page.new params[:page] if @page.save - flash[:success] = t 'messages.created_successfully' - redirect_to dashboard_pages_path + redirect_to dashboard_pages_path, flash: { success: t('messages.created_successfully') } else render :new end end - # PUT /pages/1 def update - @page.keyword_list = params[:page][:keywords] if params[:page][:keywords].present? - - if @page.update_attributes params[:page].except('keywords') - flash[:success] = t 'messages.updated_successfully' - redirect_to dashboard_pages_path + if @page.update_attributes params[:page] + redirect_to edit_dashboard_page_path( @page ), flash: { success: t('messages.updated_successfully') } else render :edit end end - # DELETE /pages/1 def destroy @page.destroy redirect_to dashboard_pages_path end private - def set_page - @page ||= Page.find params[:id] + def find_page + @page = Page.find params[:id] end end diff --git a/app/controllers/dashboard/sections_controller.rb b/app/controllers/dashboard/sections_controller.rb index 3de13f9..506d4f9 100644 --- a/app/controllers/dashboard/sections_controller.rb +++ b/app/controllers/dashboard/sections_controller.rb @@ -1,12 +1,12 @@ class Dashboard::SectionsController < ApplicationController - before_filter :set_section, :only => [ :edit, :update, :destroy ] + before_filter :find_section, only: [ :edit, :update, :destroy ] - set_tab :list_sections, :only => :index - set_tab :new_section, :only => :new + set_tab :list_sections, only: :index + set_tab :new_section, only: :new # GET /sections def index - @sections = Section.page params[:page] + @sections = Section.includes( :main_section ).page params[:page] end # GET /sections/1 @@ -24,8 +24,7 @@ def create @section = Section.new params[:section] if @section.save - flash[:success] = t 'messages.created_successfully' - redirect_to dashboard_sections_path + redirect_to dashboard_sections_path, flash: { success: t('messages.created_successfully') } else render :new end @@ -34,8 +33,7 @@ def create # PUT /sections/1 def update if @section.update_attributes params[:section] - flash[:success] = t 'messages.updated_successfully' - redirect_to dashboard_sections_path + redirect_to dashboard_sections_path, flash: { success: t('messages.updated_successfully') } else render :edit end @@ -48,7 +46,7 @@ def destroy end private - def set_section - @section ||= Section.find params[:id] + def find_section + @section = Section.find params[:id] end end diff --git a/app/controllers/dashboard/settings_controller.rb b/app/controllers/dashboard/settings_controller.rb index 99ff9a3..9bc9020 100644 --- a/app/controllers/dashboard/settings_controller.rb +++ b/app/controllers/dashboard/settings_controller.rb @@ -1,8 +1,8 @@ class Dashboard::SettingsController < ApplicationController - before_filter :set_setting, :only => [ :edit, :update, :destroy ] + before_filter :find_setting, only: [ :edit, :update, :destroy ] - set_tab :list_settings, :only => :index - set_tab :new_setting, :only => :new + set_tab :list_settings, only: :index + set_tab :new_setting, only: :new def index @settings = Setting.page params[:page] @@ -12,52 +12,35 @@ def new @setting = Setting.new end - def edit - @themes = get_themes if @setting.name == 'theme' - end - def create @setting = Setting.new params[:setting] if @setting.save - flash[:success] = t 'messages.created_successfully' - redirect_to dashboard_settings_path + redirect_to dashboard_settings_path, flash: { success: t('messages.created_successfully') } else render :new end end def update - params[:setting] = params[:setting].except(:name) if !@setting.destroyable? - if @setting.update_attributes params[:setting] - flash[:success] = t 'messages.updated_successfully' - redirect_to dashboard_settings_path + redirect_to dashboard_settings_path, flash: { success: t('messages.updated_successfully') } else render :edit end end def destroy - if @setting.delete - flash[:success] = t 'messages.deleted_successfully' - redirect_to dashboard_settings_path + if @setting.destroyable? and @setting.destroy + redirect_to dashboard_settings_path, flash: { success: t('messages.deleted_successfully') } else - flash[:error] = t 'messages.failed_miserably' - redirect_to dashboard_settings_path + redirect_to dashboard_settings_path, flash: { error: t('messages.failed_miserably') } end end private - def get_themes - themes_path = File.join Rails.root, 'app', 'views', 'layouts', 'themes' - - Dir.new(themes_path).select do |dir| - dir =~ /^[a-z0-9_-]+$/i && File.directory?( File.join themes_path, dir ) - end - end - - def set_setting - @setting ||= Setting.find params[:id] + def find_setting + @setting = Setting.find params[:id] + @themes = $themes end end diff --git a/app/controllers/dashboard/users_controller.rb b/app/controllers/dashboard/users_controller.rb index 654ab03..4196a39 100644 --- a/app/controllers/dashboard/users_controller.rb +++ b/app/controllers/dashboard/users_controller.rb @@ -1,5 +1,5 @@ class Dashboard::UsersController < ApplicationController - set_tab :list_users, :only => :index + set_tab :list_users, only: :index def index @users = User.order('username').page params[:page] @@ -8,9 +8,7 @@ def index def destroy @user = User.find params[:id] - if @user.delete - flash[:success] = t('messages.deleted_successfully') - redirect_to :action => :index - end + @user.destroy + redirect_to dashboard_users_path end end diff --git a/app/controllers/pages_controller.rb b/app/controllers/pages_controller.rb index bb48ba9..7a4a722 100644 --- a/app/controllers/pages_controller.rb +++ b/app/controllers/pages_controller.rb @@ -1,33 +1,25 @@ class PagesController < ApplicationController - skip_before_filter :authenticate_user! + skip_before_filter :authenticate_user! # GET /:section/:page # GET /:section/:subsection/:page def show - @page = subsection.pages.published.find( params[:page] ) if subsection - @page ||= section.pages.published.find( params[:page] ) if section - - raise Clover::PageNotFoundError if @page.blank? - - if @page.has_contact? - @contact_form = render_to_string :partial => 'contact_forms/contact_form', :object => ContactForm.new - end + @section, @subsection, @page = *Section.with_children( params ) + raise_if_page_not_found! end #GET / def home @page = Page.published.home_page @section = @page.section + + raise_if_page_not_found! + render :show end private - def subsection - @subsection ||= Section.where( :slug => params[:subsection] ).first - end - - def section - @section = @subsection.try :main_section - @section ||= Section.find params[:section] + def raise_if_page_not_found! + raise Clover::PageNotFoundError unless @page.present? end end diff --git a/app/controllers/users/registrations_controller.rb b/app/controllers/users/registrations_controller.rb index 7953108..f19b492 100644 --- a/app/controllers/users/registrations_controller.rb +++ b/app/controllers/users/registrations_controller.rb @@ -1,10 +1,10 @@ module Users class RegistrationsController < Devise::RegistrationsController - before_filter :deactivate_action, :only => [ :create, :new ] + before_filter :deactivate_action, only: [ :create, :new ] private def deactivate_action - render 'public/404', :formats => :html, :status => :not_found, :layout => false + render 'public/404', formats: :html, status: :not_found, layout: false end end end diff --git a/app/exceptions/clover.rb b/app/exceptions/clover.rb index c9fb8d2..b45e9ee 100644 --- a/app/exceptions/clover.rb +++ b/app/exceptions/clover.rb @@ -1,3 +1,5 @@ +require 'active_record/errors' + module Clover class UnauthorizedAccessError < SecurityError; end class PageNotFoundError < ActiveRecord::RecordNotFound; end diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index cf5ea62..de6be79 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -1,40 +1,2 @@ module ApplicationHelper - def main_sections_collection section_name - Section.where("name != '#{section_name}'").map { |section| [ section.name, section.id ] } - end - - def all_sections_collection - Section.all.map { |section| [ section.name, section.id ] } - end - - def article_kinds - types = 'dashboard.articles.types' - [ %W(#{t("#{types}.post")} post), %W(#{t("#{types}.review")} review), %W(#{t("#{types}.news")} news) ] - end - - def meta(name, content) - %() - end - - def new_child_fields_template(form_builder, association, options={}) - options[:object] ||= form_builder.object.class.reflect_on_association(association).klass.new - options[:partial] ||= association.to_s.singularize - options[:form_builder_local] ||= :f - - content_for :resource_templates do - content_tag(:div, :id => "#{options[:partial]}_fields_template", :style => "display: none") do - form_builder.fields_for(association, options[:object], :child_index => "new_#{association}") do |f| - render :partial => options[:partial], :locals => { options[:form_builder_local] => f } - end - end - end - end - - def add_child_fields_link(name, association) - link_to name, "#", :class => 'add_child', :"data-association" => association - end - - def remove_child_fields_link(name, form_builder) - form_builder.hidden_field(:_destroy) + link_to(name, "#", :class => "remove_child") - end end diff --git a/app/helpers/markdown_helper.rb b/app/helpers/markdown_helper.rb new file mode 100644 index 0000000..c37fb93 --- /dev/null +++ b/app/helpers/markdown_helper.rb @@ -0,0 +1,6 @@ +module MarkdownHelper + def markdown text + renderer = PygmentsRenderer.new $render_options + Redcarpet::Markdown.new( renderer, $markdown_extensions ).render( text ).html_safe + end +end diff --git a/app/middleware/flash_session_cookie_middleware.rb b/app/middleware/flash_session_cookie_middleware.rb deleted file mode 100644 index 9716c30..0000000 --- a/app/middleware/flash_session_cookie_middleware.rb +++ /dev/null @@ -1,18 +0,0 @@ -require 'rack/utils' - -class FlashSessionCookieMiddleware - def initialize(app, session_key = '_session_id') - @app = app - @session_key = session_key - end - - def call(env) - if env['HTTP_USER_AGENT'] =~ /^(Adobe|Shockwave) Flash/ - req = Rack::Request.new(env) - env['HTTP_COOKIE'] = [ @session_key, req.params[@session_key] ].join('=').freeze unless req.params[@session_key].nil? - env['HTTP_ACCEPT'] = "#{req.params['_http_accept']}".freeze unless req.params['_http_accept'].nil? - end - - @app.call(env) - end -end diff --git a/app/models/asset.rb b/app/models/asset.rb deleted file mode 100644 index d8ccc0a..0000000 --- a/app/models/asset.rb +++ /dev/null @@ -1,14 +0,0 @@ -class Asset < ActiveRecord::Base - belongs_to :attachable, :polymorphic => true - - has_attached_file :asset, :styles => { - :squared => "120x80#", - :small => "120x80>", - :medium => "180x120>", - :big => "300x225>" - } - - validates_attachment_presence :asset - validates_attachment_content_type :asset, :content_type => [ 'image/jpeg', 'image/png', 'image/gif' ] - validates_attachment_size :asset, :less_than => 20.megabytes -end diff --git a/app/models/contact_form.rb b/app/models/contact_form.rb index de3ca5a..4b24065 100644 --- a/app/models/contact_form.rb +++ b/app/models/contact_form.rb @@ -1,17 +1,13 @@ -class ContactForm - include ActiveModel::Validations - - validates_presence_of :recipient, :subject, :body - validates_format_of :recipient, :with => /\b[a-z0-9._%-]+@[a-z0-9.-]+\.[a-z]{2,4}\b/i - validates_length_of :body, :minimum => 10 - - attr_accessor :recipient, :subject, :body - - def initialize(attributes = {}) - @recipient = attributes[:recipient] - @body = attributes[:body] - @subject = attributes[:subject] - - yield(self) if block_given? +class ContactForm < MailForm::Base + attribute :name, validate: true + attribute :email, validate: /\A([\w\.%\+\-]+)@([\w\-]+\.)+([\w]{2,})\z/i + attribute :subject + attribute :message + + def headers + { + subject: subject, + from: %("#{ name }" <#{ email }>) + } end end diff --git a/app/models/page.rb b/app/models/page.rb index d3fccec..1cdb6bc 100644 --- a/app/models/page.rb +++ b/app/models/page.rb @@ -1,32 +1,31 @@ class Page < ActiveRecord::Base extend FriendlyId - acts_as_taggable_on :keywords - - has_many :assets, :as => :attachable belongs_to :section before_save :check_home_page - validates :name, :content, :section, :presence => true - validates :name, :uniqueness => true + validates :name, :content, :section, presence: true + validates :name, uniqueness: true - friendly_id :name, :use => :slugged + friendly_id :name, use: :slugged attr_accessible :name, :content, :section, :home_page, :published, :section_id, :has_contact - scope :published, where(:published => true) + scope :published, -> { where published: true } + + delegate :name, to: :section, prefix: true def self.home_page - where( :home_page => true ).first + where( home_page: true ).first end private def check_home_page - if home_page? - Page.where("home_page = ?", true).each do |page| - page.update_attributes( :home_page => false ) if page != self - end + return unless home_page? + + Page.where( home_page: true ).find_each do |page| + page.update_attributes!( home_page: false ) unless page === self end end end diff --git a/app/models/section.rb b/app/models/section.rb index 02fa036..49881ef 100644 --- a/app/models/section.rb +++ b/app/models/section.rb @@ -1,13 +1,49 @@ class Section < ActiveRecord::Base extend FriendlyId - has_many :pages - has_many :subsections, :class_name => "Section", :foreign_key => :main_section_id - belongs_to :main_section, :class_name => "Section", :foreign_key => :main_section_id + has_many :pages, dependent: :destroy - validates :name, :presence => true, :uniqueness => true + has_many :subsections, class_name: "Section", foreign_key: :main_section_id, dependent: :destroy + belongs_to :main_section, class_name: "Section", foreign_key: :main_section_id - friendly_id :name, :use => :slugged + validates :name, presence: true, uniqueness: true + + friendly_id :name, use: :slugged attr_accessible :name, :main_section_id + + delegate :name, to: :main_section, prefix: true, allow_nil: true + + def section_collection + return scoped_collection unless new_record? + + Section.section_collection + end + + def self.section_collection + Section.select( 'name, id' ).all.map { |section| [ section.name, section.id ] } + end + + def self.with_children( params ) + section = includes( :pages ).find_by_slug params[:section] + subsection = fetch_subsection( section, params[:subsection] ) if section and params[:subsection] + page = fetch_page ( subsection || section ), params[:page] + + [ section, subsection, page ] + end + + def self.fetch_subsection( section, slug ) + section.subsections.find_by_slug slug + end + + def self.fetch_page( section, slug ) + return if section.nil? + section.pages.published.find_by_slug slug + end + + private + def scoped_collection + Section.select( 'name, id' ).where( "id != ?", id ).where( main_section_id: nil ). + map { |section| [ section.name, section.id ] } + end end diff --git a/app/models/setting.rb b/app/models/setting.rb index 4ab1973..370b91c 100644 --- a/app/models/setting.rb +++ b/app/models/setting.rb @@ -1,27 +1,19 @@ class Setting < ActiveRecord::Base - validates_presence_of :name, :value - validates_uniqueness_of :name + validates :name, :value, presence: true + validates :name, uniqueness: true - validates_format_of :name, :with => /^[a-z0-9_]+$/ - attr_accessible :name, :value, :description + validates_format_of :name, with: /\A[a-z0-9_]+\z/i attr_accessible :name, :value, :description, :destroyable - def delete - return super if destroyable? - false - end - - def delete! - return super if destroyable? - false + def name=(value) + self[:name] = value if destroyable? end def self.get_site_settings - site = {} - Setting.select('name, value').each do |setting| + Setting.select('name, value').inject( {} ) do |site, setting| site[setting.name.to_sym] = setting.value + site end - site end end diff --git a/app/models/user.rb b/app/models/user.rb index ed34d28..7fe01c0 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -1,14 +1,16 @@ class User < ActiveRecord::Base devise :database_authenticatable, :recoverable, :rememberable, :trackable, :validatable, :lockable, :registerable - validates_format_of :username, :with => /^([a-z0-9\-_.]{2,31})$/i + validates :username, presence: true, uniqueness: true + validates :username, format: { with: /\A[\w\.\-@]+\z/ } + validates :username, length: { minimum: 4, maximum: 10 } attr_accessor :login - attr_accessible :email, :password, :password_confirmation, :remember_me, :avatar, :username, :login + attr_accessible :email, :password, :password_confirmation, :remember_me, :username, :login protected def self.find_for_database_authentication(conditions) login = conditions.delete :login - where(conditions).where([ "username = :value OR email = :value", { :value => login } ]).first + where(conditions).where([ "username = :value OR email = :value", { value: login } ]).first end end diff --git a/app/views/contact_forms/_contact_form.html.haml b/app/views/contact_forms/_contact_form.html.haml index ebd71af..263108f 100644 --- a/app/views/contact_forms/_contact_form.html.haml +++ b/app/views/contact_forms/_contact_form.html.haml @@ -1,12 +1,8 @@ %fieldset - = form_for contact_form, :as => :contact_form, :url => contact_form_path do |contact| - = contact.label :recipient - = contact.text_field :recipient - - = contact.label :subject - = contact.text_field :subject - - = contact.label :body - = contact.text_area :body + = simple_form_for ContactForm.new, as: :contact_form, url: contact_form_path do |contact| + = contact.input :name + = contact.input :email + = contact.input :subject + = contact.input :message, as: :text = contact.submit :submit diff --git a/app/views/contact_forms/new.html.haml b/app/views/contact_forms/new.html.haml deleted file mode 100644 index 8d66559..0000000 --- a/app/views/contact_forms/new.html.haml +++ /dev/null @@ -1,12 +0,0 @@ -%fieldset - = form_for @contact_form, :validate => true do |contact| - = contact.label :recipient - = contact.text_field :recipient - - = contact.label :subject - = contact.text_field :subject - - = contact.label :body - = contact.text_area :body - - = contact.submit :submit diff --git a/app/views/dashboard/pages/_form.html.haml b/app/views/dashboard/pages/_form.html.haml new file mode 100644 index 0000000..88a5b1f --- /dev/null +++ b/app/views/dashboard/pages/_form.html.haml @@ -0,0 +1,18 @@ += simple_form_for [ :dashboard, page ] do |f| + #page_content + = f.input :name, placeholder: t('common.descriptions.url.item_name', item: Page.model_name.human.downcase ) + + = f.pagedown_editor :content + + = f.label :section do + = t 'activerecord.attributes.page.section' + %small= t 'dashboard.page.descriptions.section' + + = f.select :section_id, Section.section_collection + + .buttonset + = f.input :home_page, input_html: { class: :home_page } + = f.input :has_contact, input_html: { class: :contact_form } + = f.input :published, input_html: { class: :published } + + = f.submit t( 'common.forms.submit' ) diff --git a/app/views/dashboard/pages/_page.html.haml b/app/views/dashboard/pages/_page.html.haml index ab6bcbd..0400377 100644 --- a/app/views/dashboard/pages/_page.html.haml +++ b/app/views/dashboard/pages/_page.html.haml @@ -1,8 +1,8 @@ -%tr{ :class => cycle(:odd, :even) } +%tr{ class: cycle(:odd, :even) } %td= link_to page.name, edit_dashboard_page_path( page ) - %td= page.section.name - %td= l page.created_at, :format => :short - %td= l page.updated_at, :format => :short + %td= page.section_name + %td= l page.created_at, format: :short + %td= l page.updated_at, format: :short %td - = link_to t('links.edit'), edit_dashboard_page_path( page ), :class => 'icon edit' - = link_to t('links.destroy'), dashboard_page_path( page ), :confirm => t('common.messages.are_you_sure'), :method => :delete, :class => 'icon delete' \ No newline at end of file + = link_to t('links.edit'), edit_dashboard_page_path( page ), class: 'icon edit' + = link_to t('links.destroy'), dashboard_page_path( page ), class: 'icon delete', confirm: t('common.messages.are_you_sure'), data: { method: :delete } diff --git a/app/views/dashboard/pages/_page_editor.html.haml b/app/views/dashboard/pages/_page_editor.html.haml deleted file mode 100644 index 3719650..0000000 --- a/app/views/dashboard/pages/_page_editor.html.haml +++ /dev/null @@ -1,36 +0,0 @@ -= form_for [:dashboard, page_editor ], :validate => true do |f| - #page_content - = f.hidden_field :keywords, :id => :final_keywords_list - %label{ :for => :page_name } - = t 'common.fields.name' - %small= t 'common.descriptions.url.item_name', :item => t('activerecord.models.page').downcase - = f.text_field :name - = f.text_area :content, :class => 'wymeditor' - - %label{ :for => :page_section_id } - = t 'activerecord.attributes.page.section' - %small= t 'dashboard.page.descriptions.section' - = f.select :section_id, all_sections_collection - - .buttonset - = f.label :home_page - = f.check_box :home_page, :class => :home_page - = f.label :has_contact - = f.check_box :has_contact, :class => :contact_form - = f.label :published - = f.check_box :published, :class => :published - - %button.wymupdate= t 'common.forms.submit' - -:javascript - $(document).ready(function() { - $('#tabs').tabs(); - $('.wymupdate').button({ icons: { primary: "ui-icon-circle-check" } }); - $('.buttonset').buttonset(); - $('.home_page').button({ icons: { primary: "ui-icon-home" } }); - $('.contact_form').button({ icons: { primary: "ui-icon-mail-closed" } }); - $('.published').button({ icons: { primary: "ui-icon-check" } }); - $('#keyword_button').button({ icons: { primary: "ui-icon-circle-plus" } }); - add_keywords(); - existing_keywords(); - }); diff --git a/app/views/dashboard/pages/edit.haml b/app/views/dashboard/pages/edit.haml index 97e61d6..e7640b3 100644 --- a/app/views/dashboard/pages/edit.haml +++ b/app/views/dashboard/pages/edit.haml @@ -1,23 +1 @@ -#tabs - %ul - %li= link_to t('links.item_details', :item => t('activerecord.models.page')), '#tabs-1' - %li= link_to t('links.item_keywords', :item => t('activerecord.models.page')), '#tabs-2' - %li= link_to t('links.item_assets', :item => t('activerecord.models.page')), '#tabs-3' - #tabs-1 - = render :partial => 'page_editor', :object => @page - #tabs-2 - = render 'shared/keywords', :resource_keywords => @page.keywords.map(&:name) - .spacer - #tabs-3 - .splitcontentleft - #images_list - - @page.assets.each do |asset| - = image_tag asset.asset.url(:small) - %file#uploadify{ :name => 'asset' } - .splitcontentright - = render 'shared/uploadify', :object => @page - .spacer -:javascript - $(function() { - add_images(); - }) += render 'form', page: @page diff --git a/app/views/dashboard/pages/index.haml b/app/views/dashboard/pages/index.haml index dffe86c..9130674 100644 --- a/app/views/dashboard/pages/index.haml +++ b/app/views/dashboard/pages/index.haml @@ -1,16 +1,18 @@ -%h2= t 'common.headers.item_list', :item => t('activerecord.models.page').pluralize +%h2= t 'common.headers.item_list', item: Page.model_name.human( count: 0 ) + %p.info %span.bold= t('messages.information') + ':' = t 'dashboard.page.instructions.index' -%table.tabular{ :cellpadding => 0, :cellspacing => 0} +%table.tabular{ cellpadding: 0, cellspacing: 0 } %thead %tr %th= t 'common.fields.name' - %th= t 'activerecord.models.section' + %th= Section.model_name.human %th= t 'common.fields.created_at' %th= t 'common.fields.updated_at' %th= t 'common.messages.options' %tbody - = render :partial => 'page', :collection => @pages + = render @pages + = will_paginate @pages diff --git a/app/views/dashboard/pages/new.haml b/app/views/dashboard/pages/new.haml index a614893..e7640b3 100644 --- a/app/views/dashboard/pages/new.haml +++ b/app/views/dashboard/pages/new.haml @@ -1,9 +1 @@ -#tabs - %ul - %li= link_to t('links.item_details', :item => t('activerecord.models.page')), '#tabs-1' - %li= link_to t('links.item_keywords', :item => t('activerecord.models.page')), '#tabs-2' - #tabs-1 - = render :partial => 'page_editor', :object => @page - #tabs-2 - = render :partial => 'shared/keywords', :locals => { :resource_keywords => @page.keywords.map(&:name) } - .clear += render 'form', page: @page diff --git a/app/views/dashboard/sections/_form.html.haml b/app/views/dashboard/sections/_form.html.haml new file mode 100644 index 0000000..5c69c06 --- /dev/null +++ b/app/views/dashboard/sections/_form.html.haml @@ -0,0 +1,19 @@ += form_for [ :dashboard, section ] do |f| + .columns + .half + %label{ for: :section_name } + = Section.model_name.human + %small= t 'dashboard.sections.descriptions.name' + = f.text_field :name + + %label{ for: :main_section_id } + = t 'activerecord.attributes.section.main_section' + %small= t 'dashboard.sections.descriptions.main_section' + = f.select :main_section_id, section.section_collection, include_blank: true + + %button#submit= t 'common.forms.submit' + + .half + #tips_content.box + %h3= t 'common.headers.did_you_know' + %p= t 'dashboard.sections.index.tip' diff --git a/app/views/dashboard/sections/_page_section.html.haml b/app/views/dashboard/sections/_page_section.html.haml deleted file mode 100644 index 47bfd25..0000000 --- a/app/views/dashboard/sections/_page_section.html.haml +++ /dev/null @@ -1,25 +0,0 @@ -= form_for [ :dashboard, page_section ], :validate => true do |f| - .columns - .half - %label{ :for => :section_name } - = t 'activerecord.models.section' - %small= t 'dashboard.sections.descriptions.name' - = f.text_field :name - - %label{ :for => :main_section_id } - = t 'activerecord.attributes.section.main_section' - %small= t 'dashboard.sections.descriptions.main_section' - = f.select :main_section_id, main_sections_collection(page_section.name), :include_blank => true - - %button#submit= t 'common.forms.submit' - - .half - #tips_content.box - %h3= t 'common.headers.did_you_know' - %p= t 'dashboard.sections.index.tip' - -:javascript - $(document).ready(function() { - $('#submit').button({ icons: { primary: 'ui-icon-circle-check' } }); - $('#sections_menu_link').addClass('active'); - }); diff --git a/app/views/dashboard/sections/_section.html.haml b/app/views/dashboard/sections/_section.html.haml index 0ac5067..f193350 100644 --- a/app/views/dashboard/sections/_section.html.haml +++ b/app/views/dashboard/sections/_section.html.haml @@ -1,9 +1,9 @@ -%tr{ :class => cycle(:odd, :even) } +%tr{ class: cycle(:odd, :even) } %td= section.name - %td= section.main_section.name if section.main_section.present? - %td= l section.created_at, :format => :short - %td= l section.updated_at, :format => :short + %td= section.main_section_name + %td= l section.created_at, format: :short + %td= l section.updated_at, format: :short %td - = link_to t('links.edit'), edit_dashboard_section_path(section), :class => 'icon edit' - = link_to t('links.destroy'), dashboard_section_path(section), :confirm => t('common.messages.are_you_sure'), :method => :delete, :class => 'icon delete' + = link_to t('links.edit'), edit_dashboard_section_path( section.id ), class: 'icon edit' + = link_to t('links.destroy'), dashboard_section_path( section.id ), class: 'icon delete', confirm: t('common.messages.are_you_sure'), data: { method: :delete } diff --git a/app/views/dashboard/sections/edit.haml b/app/views/dashboard/sections/edit.haml index 767d9a9..4885ab2 100644 --- a/app/views/dashboard/sections/edit.haml +++ b/app/views/dashboard/sections/edit.haml @@ -1,2 +1,2 @@ -%h2= t 'links.edit_item', :item => t('activerecord.models.section') -= render :partial => 'page_section', :object => @section +%h2= t 'links.edit_item', item: Section.model_name.human += render 'form', section: @section diff --git a/app/views/dashboard/sections/index.haml b/app/views/dashboard/sections/index.haml index bc270d6..0df8abd 100644 --- a/app/views/dashboard/sections/index.haml +++ b/app/views/dashboard/sections/index.haml @@ -1,9 +1,9 @@ -%h2= t 'common.headers.item_list', :item => t('activerecord.models.section') +%h2= t 'common.headers.item_list', item: Section.model_name.human( count: 0 ) %p.info %span.bold= t('messages.information') + ':' = t '.information' -%table.tabular{ :cellpading => 0, :cellspacing => 0 } +%table.tabular{ cellpading: 0, cellspacing: 0 } %thead %tr %th= t 'activerecord.attributes.section.name' @@ -11,5 +11,7 @@ %th= t 'common.fields.created_at' %th= t 'common.fields.updated_at' %th= t 'common.messages.options' - %tbody= render :partial => 'section', :collection => @sections + %tbody + = render @sections + = will_paginate @sections diff --git a/app/views/dashboard/sections/new.haml b/app/views/dashboard/sections/new.haml index 415e0d5..45ad999 100644 --- a/app/views/dashboard/sections/new.haml +++ b/app/views/dashboard/sections/new.haml @@ -1,2 +1,2 @@ -%h2= t 'links.new_item', :item => t("activerecord.models.section") -= render :partial => 'page_section', :object => @section +%h2= t 'links.new_item', item: Section.model_name.human += render 'form', section: @section diff --git a/app/views/dashboard/settings/_setting_editor.html.haml b/app/views/dashboard/settings/_form.html.haml similarity index 70% rename from app/views/dashboard/settings/_setting_editor.html.haml rename to app/views/dashboard/settings/_form.html.haml index dc2661d..ea74a9f 100644 --- a/app/views/dashboard/settings/_setting_editor.html.haml +++ b/app/views/dashboard/settings/_form.html.haml @@ -1,4 +1,4 @@ -= form_for [ :dashboard, setting_editor ], :validate => true do |f| += form_for [ :dashboard, setting ] do |f| .columns .half = f.label :name @@ -19,8 +19,3 @@ #tips_content.box %h3= t 'common.headers.did_you_know' %p= t 'dashboard.settings.forms.tip' - -:javascript - $(function() { - $("#submit").button({ icons: { primary: 'ui-icon-circle-check' } }); - }); diff --git a/app/views/dashboard/settings/_setting.html.haml b/app/views/dashboard/settings/_setting.html.haml index 01b6687..873467a 100644 --- a/app/views/dashboard/settings/_setting.html.haml +++ b/app/views/dashboard/settings/_setting.html.haml @@ -1,8 +1,8 @@ -%tr{ :class => cycle(:odd, :even) } +%tr{ class: cycle(:odd, :even) } %td= setting.name %td= setting.description - %td= l setting.created_at, :format => :short - %td= l setting.updated_at, :format => :short + %td= l setting.created_at, format: :short + %td= l setting.updated_at, format: :short %td - = link_to t('links.edit'), edit_dashboard_setting_path(setting), :class => 'icon edit' - = link_to t('links.destroy'), dashboard_setting_path(setting), :confirm => t('common.messages.are_you_sure'), :method => :delete, :class => 'icon delete' if setting.destroyable? + = link_to t('links.edit'), edit_dashboard_setting_path(setting), class: 'icon edit' + = link_to t('links.destroy'), dashboard_setting_path(setting), confirm: t('common.messages.are_you_sure'), method: :delete, class: 'icon delete' if setting.destroyable? diff --git a/app/views/dashboard/settings/edit.html.haml b/app/views/dashboard/settings/edit.html.haml index 5511557..377625f 100644 --- a/app/views/dashboard/settings/edit.html.haml +++ b/app/views/dashboard/settings/edit.html.haml @@ -1,2 +1,2 @@ -%h2= t 'links.edit_item', :item => t('activerecord.models.setting') -= render :partial => 'setting_editor', :object => @setting, :locals => { :themes => @themes } +%h2= t 'links.edit_item', item: Setting.model_name.human += render 'form', setting: @setting, themes: @themes diff --git a/app/views/dashboard/settings/index.html.haml b/app/views/dashboard/settings/index.html.haml index 569c852..4779c9c 100644 --- a/app/views/dashboard/settings/index.html.haml +++ b/app/views/dashboard/settings/index.html.haml @@ -1,10 +1,10 @@ -%h2= t 'common.headers.item_list', :item => t('activerecord.models.setting') +%h2= t 'common.headers.item_list', item: Setting.model_name.human %p.info %span.bold= t('messages.information') + ':' = t '.instructions' -%table.tabular{ :cellpadding => 0, :cellspacing => 0 } +%table.tabular{ cellpadding: 0, cellspacing: 0 } %thead %tr %th= t 'common.fields.name' @@ -13,5 +13,6 @@ %th= t 'common.fields.updated_at' %th= t 'common.messages.options' %tbody - = render :partial => 'setting', :collection => @settings + = render @settings + = will_paginate @settings diff --git a/app/views/dashboard/settings/new.html.haml b/app/views/dashboard/settings/new.html.haml index 6c05d18..a5a1f62 100644 --- a/app/views/dashboard/settings/new.html.haml +++ b/app/views/dashboard/settings/new.html.haml @@ -1,2 +1,2 @@ -%h2= t 'links.new_item', :item => t('activerecord.models.setting') -= render :partial => 'setting_editor', :object => @setting, :locals => { :themes => @themes } +%h2= t 'links.new_item', item: Setting.model_name.human += render 'form', setting: @setting, themes: @themes diff --git a/app/views/dashboard/users/_user.html.haml b/app/views/dashboard/users/_user.html.haml index 68f32c8..3df0bd6 100644 --- a/app/views/dashboard/users/_user.html.haml +++ b/app/views/dashboard/users/_user.html.haml @@ -1,7 +1,7 @@ -%tr{ :class => cycle(:odd, :even) } +%tr{ class: cycle(:odd, :even) } %td= user.username %td= user.email - %td= l(user.confirmed_at, :format => :short) if user.confirmed_at - %td= l(user.last_sign_in_at, :format => :short) if user.last_sign_in_at + %td= l( user.confirmed_at, format: :short ) if user.confirmed_at + %td= l( user.last_sign_in_at, format: :short ) if user.last_sign_in_at %td - = link_to t('links.destroy'), dashboard_user_path(user), :method => :delete, :confirm => t('common.messages.are_you_sure'), :class => 'icon user_delete' + = link_to t('links.destroy'), dashboard_user_path(user), class: 'icon delete', confirm: t('common.messages.are_you_sure'), data: { method: :delete } diff --git a/app/views/dashboard/users/index.html.haml b/app/views/dashboard/users/index.html.haml index 12baf29..ea2ec3e 100644 --- a/app/views/dashboard/users/index.html.haml +++ b/app/views/dashboard/users/index.html.haml @@ -1,4 +1,4 @@ -%h2= t 'common.headers.item_list', :item => t('activerecord.models.user') +%h2= t 'common.headers.item_list', item: User.model_name.human %p.info %span.bold= t('messages.information') + ':' = t '.tip' @@ -12,5 +12,6 @@ %th= t 'activerecord.attributes.user.last_sign_in_at' %th= t 'common.messages.options' %tbody - = render :partial => 'user', :collection => @users + = render @users + = will_paginate @users diff --git a/app/views/devise/confirmations/new.html.haml b/app/views/devise/confirmations/new.html.haml index 87f8fef..fd7ca69 100644 --- a/app/views/devise/confirmations/new.html.haml +++ b/app/views/devise/confirmations/new.html.haml @@ -1,5 +1,5 @@ #login_form - = form_for resource, :as => resource_name, :url => confirmation_path(resource_name), :html => { :method => :post } do |f| + = form_for resource, as: resource_name, url: confirmation_path(resource_name), html: { method: :post } do |f| %fieldset = devise_error_messages! @@ -9,4 +9,4 @@ = f.submit t('devise.forms.resend_confirmation') .more_options - = render :partial => "devise/shared/links" + = render partial: "devise/shared/links" diff --git a/app/views/devise/mailer/confirmation_instructions.html.haml b/app/views/devise/mailer/confirmation_instructions.html.haml index 7840b9c..1b6bdb8 100644 --- a/app/views/devise/mailer/confirmation_instructions.html.haml +++ b/app/views/devise/mailer/confirmation_instructions.html.haml @@ -1,4 +1,4 @@ %p Welcome #{@resource.email}! %p You can confirm your account through the link below: -%p= link_to 'Confirm my account', confirmation_url(@resource, :confirmation_token => @resource.confirmation_token) +%p= link_to 'Confirm my account', confirmation_url(@resource, confirmation_token: @resource.confirmation_token) diff --git a/app/views/devise/mailer/reset_password_instructions.html.haml b/app/views/devise/mailer/reset_password_instructions.html.haml index 4fc4743..1b8157b 100644 --- a/app/views/devise/mailer/reset_password_instructions.html.haml +++ b/app/views/devise/mailer/reset_password_instructions.html.haml @@ -1,6 +1,6 @@ %p Hello #{@resource.email}! %p Someone has requested a link to change your password, and you can do this through the link below. -%p= link_to 'Change my password', edit_password_url(@resource, :reset_password_token => @resource.reset_password_token) +%p= link_to 'Change my password', edit_password_url(@resource, reset_password_token: @resource.reset_password_token) %p If you didn't request this, please ignore this email. %p Your password won't change until you access the link above and create a new one. diff --git a/app/views/devise/mailer/unlock_instructions.html.haml b/app/views/devise/mailer/unlock_instructions.html.haml index 34b0e9e..543e209 100644 --- a/app/views/devise/mailer/unlock_instructions.html.haml +++ b/app/views/devise/mailer/unlock_instructions.html.haml @@ -2,4 +2,4 @@ Hello #{@resource.email}! %p Your account has been locked due to an excessive amount of unsuccessful sign in attempts. %p Click the link below to unlock your account: -%p= link_to 'Unlock my account', unlock_url(@resource, :unlock_token => @resource.unlock_token) +%p= link_to 'Unlock my account', unlock_url(@resource, unlock_token: @resource.unlock_token) diff --git a/app/views/devise/passwords/edit.html.haml b/app/views/devise/passwords/edit.html.haml index 3b4e3e7..5cbdf8d 100644 --- a/app/views/devise/passwords/edit.html.haml +++ b/app/views/devise/passwords/edit.html.haml @@ -1,5 +1,5 @@ #login_form - = form_for resource, :as => resource_name, :url => password_path(resource_name), :html => { :method => :put } do |f| + = form_for resource, as: resource_name, url: password_path(resource_name), html: { method: :put } do |f| %fieldset = devise_error_messages! = f.hidden_field :reset_password_token @@ -13,4 +13,4 @@ = f.submit t('devise.forms.change_password') .more_options - = render :partial => "devise/shared/links" + = render partial: "devise/shared/links" diff --git a/app/views/devise/passwords/new.html.haml b/app/views/devise/passwords/new.html.haml index 4f2a9ae..2f2ea5e 100644 --- a/app/views/devise/passwords/new.html.haml +++ b/app/views/devise/passwords/new.html.haml @@ -1,5 +1,5 @@ #login_form - = form_for resource, :as => resource_name, :url => password_path(resource_name), :html => { :method => :post } do |f| + = form_for resource, as: resource_name, url: password_path(resource_name), html: { method: :post } do |f| %fieldset = devise_error_messages! @@ -8,4 +8,4 @@ = f.submit t('devise.forms.reset_password') .more_options - = render :partial => "devise/shared/links" + = render partial: "devise/shared/links" diff --git a/app/views/devise/registrations/edit.html.haml b/app/views/devise/registrations/edit.html.haml index cc28dce..72e3d71 100644 --- a/app/views/devise/registrations/edit.html.haml +++ b/app/views/devise/registrations/edit.html.haml @@ -1,5 +1,5 @@ -%h2= t 'links.edit_item', :item => t('activerecord.models.user') -= form_for resource, :as => resource_name, :url => registration_path(resource_name), :html => { :method => :put } do |f| +%h2= t 'links.edit_item', item: User.model_name.human += form_for resource, as: resource_name, url: registration_path(resource_name), html: { method: :put } do |f| .columns .half = devise_error_messages! @@ -26,6 +26,6 @@ %h3= t 'common.headers.cancel_account' %p = t('common.messages.unhappy') - = link_to t('common.headers.cancel_account'), registration_path(resource_name), :confirm => t('common.messages.are_you_sure'), :method => :delete + = link_to t('common.headers.cancel_account'), registration_path(resource_name), confirm: t('common.messages.are_you_sure'), method: :delete - content_for :sub_nav do - = render :partial => 'layouts/dashboard/nav/users' + = render partial: 'layouts/dashboard/nav/users' diff --git a/app/views/devise/registrations/new.html.haml b/app/views/devise/registrations/new.html.haml index e8194f7..9bf0c97 100644 --- a/app/views/devise/registrations/new.html.haml +++ b/app/views/devise/registrations/new.html.haml @@ -1,21 +1,21 @@ #login_form - = form_for resource, :as => resource_name, :url => registration_path(resource_name) do |f| + = form_for resource, as: resource_name, url: registration_path(resource_name) do |f| %fieldset = devise_error_messages! = f.label :email - = f.text_field :email, :class => :"input_text shadowed" + = f.text_field :email, class: :"input_text shadowed" = f.label :username - = f.text_field :username, :class => :"input_text shadowed" + = f.text_field :username, class: :"input_text shadowed" = f.label :password - = f.password_field :password, :class => :"input_password shadowed" + = f.password_field :password, class: :"input_password shadowed" = f.label :password_confirmation - = f.password_field :password_confirmation, :class => :"input_password shadowed" + = f.password_field :password_confirmation, class: :"input_password shadowed" = f.submit t('devise.forms.sign_up') .more_options - = render :partial => "devise/shared/links" + = render partial: "devise/shared/links" diff --git a/app/views/devise/sessions/new.html.haml b/app/views/devise/sessions/new.html.haml index bf24239..7589c11 100644 --- a/app/views/devise/sessions/new.html.haml +++ b/app/views/devise/sessions/new.html.haml @@ -1,5 +1,5 @@ #login_form - = form_for resource, :as => resource_name, :url => session_path(resource_name) do |f| + = form_for resource, as: resource_name, url: session_path(resource_name) do |f| %fieldset = f.label :login = f.text_field :login @@ -13,4 +13,4 @@ = f.submit t('devise.forms.sign_in') .more_options - = render :partial => "devise/shared/links" + = render partial: "devise/shared/links" diff --git a/app/views/devise/unlocks/new.html.haml b/app/views/devise/unlocks/new.html.haml index 22b1033..b00f754 100644 --- a/app/views/devise/unlocks/new.html.haml +++ b/app/views/devise/unlocks/new.html.haml @@ -1,5 +1,5 @@ #login_form - = form_for(resource, :as => resource_name, :url => unlock_path(resource_name), :html => { :method => :post }) do |f| + = form_for(resource, as: resource_name, url: unlock_path(resource_name), html: { method: :post }) do |f| %fieldset = devise_error_messages! @@ -8,4 +8,4 @@ = f.submit "Resend unlock instructions" .more_options - = render :partial => "devise/shared/links" + = render partial: "devise/shared/links" diff --git a/app/views/layouts/application.html.haml b/app/views/layouts/application.html.haml index 0192798..9b62715 100644 --- a/app/views/layouts/application.html.haml +++ b/app/views/layouts/application.html.haml @@ -14,7 +14,7 @@ #nav_wrap= yield :nav_wrap #content_wrap #content - = render :partial => 'layouts/application/flashes' + = render partial: 'layouts/application/flashes' - if content_for? :module .module %h2.title= yield :module_title diff --git a/app/views/layouts/application/_flashes.html.haml b/app/views/layouts/application/_flashes.html.haml index cb6a72f..a260f26 100644 --- a/app/views/layouts/application/_flashes.html.haml +++ b/app/views/layouts/application/_flashes.html.haml @@ -1,4 +1,4 @@ #flash - flash.each do |(status, message)| - css_class = (status == :alert) ? 'error' : status.to_s - = content_tag :div, flash[status], :class => css_class + = content_tag :div, flash[status], class: css_class diff --git a/app/views/layouts/dashboard.html.haml b/app/views/layouts/dashboard.html.haml index 445c6b9..f491cdd 100644 --- a/app/views/layouts/dashboard.html.haml +++ b/app/views/layouts/dashboard.html.haml @@ -1,13 +1,14 @@ - selected_tab = ( controller_name == 'registrations' ) ? 'users' : controller_name -= render 'layouts/dashboard/head', :selected_tab => selected_tab += render 'layouts/dashboard/head', selected_tab: selected_tab = render 'layouts/dashboard/navigation' = render 'layouts/dashboard/top' + !!! %html %head %title= content_for?(:title) ? yield(:title) : 'Dashboard' = javascript_include_tag :application - = stylesheet_link_tag 'dashboard' + = stylesheet_link_tag 'main', 'dashboard' = yield :head = csrf_meta_tag %body @@ -16,9 +17,9 @@ #nav_wrap= yield :nav_wrap #content_wrap #content - = render :partial => 'layouts/dashboard/flashes' + = render partial: 'layouts/dashboard/flashes' .module - %h2.title= content_for?(:module_title) ? yield(:module_title) : t( "activerecord.models.#{ selected_tab.singularize }" ) + %h2.title= content_for?(:module_title) ? yield(:module_title) : selected_tab.singularize.classify.constantize.model_name.human .module_body= yield #footer_wrap #footer= content_for?(:footer) ? yield(:footer) : 'CloverInteractive' diff --git a/app/views/layouts/dashboard/_flashes.html.haml b/app/views/layouts/dashboard/_flashes.html.haml index fc8c769..40e2617 100644 --- a/app/views/layouts/dashboard/_flashes.html.haml +++ b/app/views/layouts/dashboard/_flashes.html.haml @@ -4,4 +4,4 @@ - when 'alert' then 'error' - when 'notice' then 'success' - else status.to_s - = content_tag :div, flash[status], :class => css_class + = content_tag :div, flash[status], class: css_class diff --git a/app/views/layouts/dashboard/_navigation.html.haml b/app/views/layouts/dashboard/_navigation.html.haml index 3d0c2bd..cf01c05 100644 --- a/app/views/layouts/dashboard/_navigation.html.haml +++ b/app/views/layouts/dashboard/_navigation.html.haml @@ -1,19 +1,8 @@ -- content_for :head do - = stylesheet_link_tag 'jquery-ui' - = javascript_include_tag 'wymeditor/jquery.wymeditor.min', 'uploadify/uploadify.min', 'uploadify/swfobject' - :javascript - $(function() { - $("textarea.wymeditor").wymeditor({ - logoHtml: '', - skin: 'compact' - }); - }); - - content_for :nav_wrap do %ul#nav - %li#sections_menu_link= link_to t('activerecord.models.section'), dashboard_sections_path - %li#pages_menu_link= link_to t('activerecord.models.page'), dashboard_pages_path - %li#settings_menu_link= link_to t('activerecord.models.setting'), dashboard_settings_path - %li#users_menu_link= link_to t('activerecord.models.user'), dashboard_users_path + %li#sections_menu_link= link_to Section.model_name.human(count: 0), dashboard_sections_path + %li#pages_menu_link= link_to Page.model_name.human(count: 0), dashboard_pages_path + %li#settings_menu_link= link_to Setting.model_name.human(count: 0), dashboard_settings_path + %li#users_menu_link= link_to User.model_name.human(count: 0), dashboard_users_path = yield :nav = content_for?( :sub_nav ) ? yield( :sub_nav ) : render( "layouts/dashboard/nav/#{controller_name}" ) diff --git a/app/views/layouts/dashboard/_top.html.haml b/app/views/layouts/dashboard/_top.html.haml index 05c49dd..8f42cbc 100644 --- a/app/views/layouts/dashboard/_top.html.haml +++ b/app/views/layouts/dashboard/_top.html.haml @@ -1,5 +1,5 @@ = content_for :top do - = link_to '', root_path, :id => "logo" + = link_to '', root_path, id: "logo" #account_info - if defined?( current_user ) and defined?( edit_user_registration_path ) and defined?( destroy_user_registration_path ) = t 'common.messages.hi' diff --git a/app/views/layouts/dashboard/nav/_pages.html.haml b/app/views/layouts/dashboard/nav/_pages.html.haml index 333ee97..c7a3a19 100644 --- a/app/views/layouts/dashboard/nav/_pages.html.haml +++ b/app/views/layouts/dashboard/nav/_pages.html.haml @@ -1,3 +1,3 @@ -= tabs_tag :open_tabs => { :id => "sub_menu", :class => "sub_nav" } do |tab| - = tab.list_pages t('links.item_list', :item => t('activerecord.models.page')), dashboard_pages_path - = tab.new_page t('links.new_item', :item => t('activerecord.models.page')), new_dashboard_page_path += tabs_tag open_tabs: { id: "sub_menu", class: "sub_nav" } do |tab| + = tab.list_pages t('links.item_list', item: Page.model_name.human(count: 0)), dashboard_pages_path + = tab.new_page t('links.new_item', item: Page.model_name.human), new_dashboard_page_path diff --git a/app/views/layouts/dashboard/nav/_sections.html.haml b/app/views/layouts/dashboard/nav/_sections.html.haml index 9556f55..3133996 100644 --- a/app/views/layouts/dashboard/nav/_sections.html.haml +++ b/app/views/layouts/dashboard/nav/_sections.html.haml @@ -1,3 +1,3 @@ -= tabs_tag :open_tabs => { :id => "sub_menu", :class => "sub_nav" } do |tab| - = tab.list_sections t('links.item_list', :item => t('activerecord.models.section')), dashboard_sections_path - = tab.new_section t('links.new_item', :item => t('activerecord.models.section')), new_dashboard_section_path += tabs_tag open_tabs: { id: "sub_menu", class: "sub_nav" } do |tab| + = tab.list_sections t('links.item_list', item: Section.model_name.human( count: 0 )), dashboard_sections_path + = tab.new_section t('links.new_item', item: Section.model_name.human), new_dashboard_section_path diff --git a/app/views/layouts/dashboard/nav/_settings.html.haml b/app/views/layouts/dashboard/nav/_settings.html.haml index dfad712..a42c227 100644 --- a/app/views/layouts/dashboard/nav/_settings.html.haml +++ b/app/views/layouts/dashboard/nav/_settings.html.haml @@ -1,3 +1,3 @@ -= tabs_tag :open_tabs => { :id => "sub_menu", :class => "sub_nav" } do |tab| - = tab.list_settings t('links.item_list', :item => t('activerecord.models.setting')), dashboard_settings_path - = tab.new_setting t('links.new_item', :item => t('activerecord.models.setting')), new_dashboard_setting_path += tabs_tag open_tabs: { id: "sub_menu", class: "sub_nav" } do |tab| + = tab.list_settings t('links.item_list', item: Setting.model_name.human( count: 0 )), dashboard_settings_path + = tab.new_setting t('links.new_item', item: Setting.model_name.human), new_dashboard_setting_path diff --git a/app/views/layouts/dashboard/nav/_users.html.haml b/app/views/layouts/dashboard/nav/_users.html.haml index d9d8cf0..ec0c815 100644 --- a/app/views/layouts/dashboard/nav/_users.html.haml +++ b/app/views/layouts/dashboard/nav/_users.html.haml @@ -1,2 +1,3 @@ -= tabs_tag :open_tabs => { :id => "sub_menu", :class => "sub_nav" } do |tab| - = tab.list_users t('links.item_list', :item => t('activerecord.models.user')), dashboard_users_path += tabs_tag open_tabs: { id: "sub_menu", class: "sub_nav" } do |tab| + = tab.list_users t('links.item_list', item: User.model_name.human(count: 0)), dashboard_users_path + = tab.edit_user t('links.item_edit', item: User.model_name.human), edit_user_registration_path diff --git a/app/views/layouts/sessions.html.haml b/app/views/layouts/sessions.html.haml index fa7264e..aab7487 100644 --- a/app/views/layouts/sessions.html.haml +++ b/app/views/layouts/sessions.html.haml @@ -2,10 +2,10 @@ = t "devise.#{ controller_name }.#{ action_name }.title" - content_for :head do - = stylesheet_link_tag 'sessions' + = stylesheet_link_tag :sessions - content_for :top do - %a{:href =>"/"} + = link_to root_path do %h1#logo CloverInteractive -= render :file => 'layouts/application' += render file: 'layouts/application' diff --git a/app/views/layouts/themes/clover/_banner.html.haml b/app/views/layouts/themes/clover/_banner.html.haml index b3d531b..dfe759c 100644 --- a/app/views/layouts/themes/clover/_banner.html.haml +++ b/app/views/layouts/themes/clover/_banner.html.haml @@ -7,9 +7,9 @@ %h1 Impulsamos tu empresa a través de las ventajas que Internet te ofrece: reducir costos, potenciar tus productos y aumentar tu economía. %h3 Consigue aqui desde un consejo hasta una solución de telefonia #slider - #slider_left= link_to image_tag("themes/clover/scroll_left.gif", :alt => "Scroll left"), "#", :class => "previous" - = render :partial => 'layouts/themes/clover/slides' - #slider_right= link_to image_tag("themes/clover/scroll_right.gif", :alt => "Scroll right"), "#", :class => "next" + #slider_left= link_to image_tag("themes/clover/scroll_left.gif", alt: "Scroll left"), "#", class: "previous" + = render partial: 'layouts/themes/clover/slides' + #slider_right= link_to image_tag("themes/clover/scroll_right.gif", alt: "Scroll right"), "#", class: "next" - elsif page.present? %h1= section.name.titleize %h2= page.name.titleize diff --git a/app/views/layouts/themes/clover/_bottom.html.haml b/app/views/layouts/themes/clover/_bottom.html.haml index 697e8e9..1cc06d0 100644 --- a/app/views/layouts/themes/clover/_bottom.html.haml +++ b/app/views/layouts/themes/clover/_bottom.html.haml @@ -28,11 +28,11 @@ #newsletter_box.b360 %h2 Subscribete al newsletter - / - form_for EmailList.new, :url => "/email_lists/add_to_list", :html => { :id => "newsletter", :class => "forms_footer" } do |f| - / %label= f.text_field :email, :value => "Email", :class => "input_text" + / - form_for EmailList.new, url: "/email_lists/add_to_list", html: { id: "newsletter", class: "forms_footer" } do |f| + / %label= f.text_field :email, value: "Email", class: "input_text" / %label.right - / %a.button1{ :href => "javascript:void(null);" } - / %span{ :onclick => "$('#newsletter')[0].submit();" } Subscribir + / %a.button1{ href: "javascript:void(null);" } + / %span{ onclick: "$('#newsletter')[0].submit();" } Subscribir #footer2 diff --git a/app/views/layouts/themes/clover/_slides.html.haml b/app/views/layouts/themes/clover/_slides.html.haml index 3d32dc1..d0aeed0 100644 --- a/app/views/layouts/themes/clover/_slides.html.haml +++ b/app/views/layouts/themes/clover/_slides.html.haml @@ -3,19 +3,19 @@ .first_slide = image_tag "themes/clover/content/preview.jpg" .preview_intro - = link_to image_tag("themes/clover/view_project_btn.jpg"), "http://www.artificialonline.com", :target => "_blank", :class => "view_project" + = link_to image_tag("themes/clover/view_project_btn.jpg"), "http://www.artificialonline.com", target: "_blank", class: "view_project" %p Clover Interactive hospedaje web! %p Hospedaje y administración de sistemas .second_slide = image_tag "themes/clover/content/preview2.jpg" .preview_intro - = link_to image_tag("themes/clover/view_project_btn.jpg"), "http://www.aloboutique.com", :target => "_blank", :class => "view_project" + = link_to image_tag("themes/clover/view_project_btn.jpg"), "http://www.aloboutique.com", target: "_blank", class: "view_project" %p Clover Interactive desarrollo web! %p XHTML + CSS + Ruby, PHP + MySQL .third_slide = image_tag "themes/clover/content/preview3.jpg" .preview_intro - = link_to image_tag("themes/clover/view_project_btn.jpg"), "http://www.tjruby.org", :target => "_blank", :class => "view_project" + = link_to image_tag("themes/clover/view_project_btn.jpg"), "http://www.tjruby.org", target: "_blank", class: "view_project" %p Clover Interactive activo! %p Comprometidos con la comunidad. diff --git a/app/views/layouts/themes/clover/theme.html.haml b/app/views/layouts/themes/clover/theme.html.haml index c69ef44..fdfef1f 100644 --- a/app/views/layouts/themes/clover/theme.html.haml +++ b/app/views/layouts/themes/clover/theme.html.haml @@ -6,18 +6,18 @@ = stylesheet_link_tag :application, :clover = yield :head = csrf_meta_tag - %body{ :class => ( @page.present? && @page.home_page ? '' : 'section' ) } + %body{ class: ( @page.present? && @page.home_page ? '' : 'section' ) } #wrapper - = render :partial => 'layouts/themes/clover/top' - = render :partial => 'layouts/themes/clover/banner', :object => @page + = render partial: 'layouts/themes/clover/top' + = render partial: 'layouts/themes/clover/banner', object: @page #mid - if @page.present? && @page.home_page? #content= yield - = render :partial =>'layouts/themes/clover/sidebar', :object => @page, :locals => { :section => @section } + = render partial:'layouts/themes/clover/sidebar', object: @page, locals: { section: @section } - elsif @page.present? #imid - = render :partial => 'layouts/themes/clover/sidebar', :object => @page, :locals => { :section => @section } + = render partial: 'layouts/themes/clover/sidebar', object: @page, locals: { section: @section } #content= yield - = render :partial => 'layouts/themes/clover/bottom' + = render partial: 'layouts/themes/clover/bottom' diff --git a/app/views/layouts/themes/default/theme.html.haml b/app/views/layouts/themes/default/theme.html.haml index 839035e..0b1e1cc 100644 --- a/app/views/layouts/themes/default/theme.html.haml +++ b/app/views/layouts/themes/default/theme.html.haml @@ -1,4 +1,4 @@ -!!!5 +!!! %html %head %title= (content_for? :title) ? yield(:title) : 'CloverCMS - TJRuby theme' @@ -6,7 +6,7 @@ %body #wrapper #page_top - = render :partial => 'layouts/themes/default/top' + = render partial: 'layouts/themes/default/top' #main #content= yield #sidebar= yield :sidebar diff --git a/app/views/layouts/themes/simple_blog/_sidebar.html.haml b/app/views/layouts/themes/simple_blog/_sidebar.html.haml index 89a97ec..33da965 100644 --- a/app/views/layouts/themes/simple_blog/_sidebar.html.haml +++ b/app/views/layouts/themes/simple_blog/_sidebar.html.haml @@ -6,9 +6,9 @@ %ul - section.pages.published.each do |page| - if section.main_section - %li= link_to page.name.titleize, subsection_page_path(section.url_name, section.main_section.url_name, page.url_name) + %li= link_to page.name.titleize, subsection_page_path( section section.main_section, page ) - else - %li= link_to page.name.titleize, section_page_path(section.url_name, page.url_name) + %li= link_to page.name.titleize, section_page_path( section, page ) %h2 Follow us on %ul.icons diff --git a/app/views/layouts/themes/simple_blog/theme.html.haml b/app/views/layouts/themes/simple_blog/theme.html.haml index 04109d5..787e82b 100644 --- a/app/views/layouts/themes/simple_blog/theme.html.haml +++ b/app/views/layouts/themes/simple_blog/theme.html.haml @@ -1,17 +1,17 @@ -!!!5 +!!! %html %head - %meta{ :charset => 'utf-8' } - = yield :meta + %meta{ charset: 'utf-8' } %title= content_for?(:title) ? yield(:title) : 'Simple Blog' = stylesheet_link_tag 'application', 'simple_blog' + %body - = render :partial => 'layouts/themes/simple_blog/nav' + = render partial: 'layouts/themes/simple_blog/nav' #wrapper - = render :partial => 'layouts/application/flashes' + = render partial: 'layouts/application/flashes' #content_wrapper #content= yield - #sidebar= render :partial => 'layouts/themes/simple_blog/sidebar', :locals => { :section => @section } + #sidebar= render partial: 'layouts/themes/simple_blog/sidebar', locals: { section: @section } .clear - #footer= render :partial => 'layouts/themes/simple_blog/footer', :locals => { :section => @section } + #footer= render partial: 'layouts/themes/simple_blog/footer', locals: { section: @section } diff --git a/app/views/pages/show.haml b/app/views/pages/show.haml index ee8904f..5d63f08 100644 --- a/app/views/pages/show.haml +++ b/app/views/pages/show.haml @@ -1,11 +1,10 @@ %h1= @page.name.titleize -!= @page.content += markdown @page.content -!= @contact_form if @contact_form.present? += render 'contact_forms/contact_form' if @page.has_contact? = content_for :title do - = "#{site[:site_name]} - #{@page.name.titleize}" + = "#{site[:site_name]} - #{ @page.name.titleize }" + = content_for :footer do != "#{site[:footer]}" -= content_for :meta do - != meta "keywords", @page.keywords.join(',') if @page.keywords.present? diff --git a/app/views/shared/_keywords.html.haml b/app/views/shared/_keywords.html.haml deleted file mode 100644 index 63832ae..0000000 --- a/app/views/shared/_keywords.html.haml +++ /dev/null @@ -1,15 +0,0 @@ -.columns - .half - %label - = t 'common.fields.keywords' - %small= t 'common.descriptions.keywords' - %input#keyword_input{ :type => :text, :style => 'width: 250px; display: inline' } - %button#keyword_button= t 'common.forms.add' - %select{ :size => 5, :style => 'width: 350px; border: 1px solid gray;', :id => 'keywords' } - - resource_keywords.each do |keyword| - %option=keyword - .half - #tips_container.box - %h3= t 'common.headers.did_you_know' - %p= t 'common.tips.keywords.first' - %p= t 'common.tips.keywords.second' diff --git a/app/views/shared/_login_box.html.haml b/app/views/shared/_login_box.html.haml index a1a904e..ecfe482 100644 --- a/app/views/shared/_login_box.html.haml +++ b/app/views/shared/_login_box.html.haml @@ -1,12 +1,12 @@ %h1#logo= 'Clover Interactive' #login-form-container - = form_tag new_user_session_path, :id => 'login-form', :class => 'forms' do + = form_tag new_user_session_path, id: 'login-form', class: 'forms' do #form-body %fieldset = label_tag 'Email' - = text_field_tag 'user[email]', nil, :class => :input_text + = text_field_tag 'user[email]', nil, class: :input_text = label_tag 'Password' - = password_field_tag 'user[password]', nil, :class => :input_text + = password_field_tag 'user[password]', nil, class: :input_text %p - %input.input_button{ :type => :submit, :value => :login } + %input.input_button{ type: :submit, value: :login } %button.input_button Register \ No newline at end of file diff --git a/app/views/shared/_uploadify.html.haml b/app/views/shared/_uploadify.html.haml deleted file mode 100644 index f18c082..0000000 --- a/app/views/shared/_uploadify.html.haml +++ /dev/null @@ -1,34 +0,0 @@ -- session_key = Rails.application.config.session_options[:key] -:javascript - $(function () { - var uploadify_script_data = {}; - var csrf_token = $('meta[name=csrf-token]').attr('content'); - var csrf_param = $('meta[name=csrf-param]').attr('content'); - - uploadify_script_data[csrf_param] = encodeURI(encodeURIComponent(csrf_token)); - uploadify_script_data['#{session_key}'] = '#{cookies[session_key]}'; - uploadify_script_data.attachable_type = '#{object.class}' - uploadify_script_data.attachable_id = '#{object.id}' - - $('#uploadify').uploadify({ - script : '/dashboard/assets/', - scriptData : uploadify_script_data, - uploader : '/swf/uploadify/uploadify.swf', - cancelImg : '/assets/uploadify/cancel.png', - fileExt : '*.png;*.jpg;*.gif', - auto : true, - onComplete : function(a, b, c, response) { - response = $.parseJSON(response); - if (response.status == "success") { - var img = document.createElement('img'); - img.src = response.thumbnail; - $("#images_list").append(img); - $(img).click(function(){ - image_operations({ element: this, title: '#{t 'links.add_item', :item => t('common.fields.image')}', text: '#{t 'common.headers.add_image', :item => t('common.fields.image')}' }) - }); - } - }, - fileDesc : '#{t('common.forms.file_description')}', - sizeLimit : #{19.megabytes} - }); - }); diff --git a/bin/autospec b/bin/autospec new file mode 100755 index 0000000..64dcb9c --- /dev/null +++ b/bin/autospec @@ -0,0 +1,16 @@ +#!/usr/bin/env ruby +# +# This file was generated by Bundler. +# +# The application 'autospec' is installed as part of a gem, and +# this file is here to facilitate running it. +# + +require 'pathname' +ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile", + Pathname.new(__FILE__).realpath) + +require 'rubygems' +require 'bundler/setup' + +load Gem.bin_path('rspec-core', 'autospec') diff --git a/bin/cap b/bin/cap new file mode 100755 index 0000000..30352d4 --- /dev/null +++ b/bin/cap @@ -0,0 +1,16 @@ +#!/usr/bin/env ruby +# +# This file was generated by Bundler. +# +# The application 'cap' is installed as part of a gem, and +# this file is here to facilitate running it. +# + +require 'pathname' +ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile", + Pathname.new(__FILE__).realpath) + +require 'rubygems' +require 'bundler/setup' + +load Gem.bin_path('capistrano', 'cap') diff --git a/bin/capify b/bin/capify new file mode 100755 index 0000000..0f486e8 --- /dev/null +++ b/bin/capify @@ -0,0 +1,16 @@ +#!/usr/bin/env ruby +# +# This file was generated by Bundler. +# +# The application 'capify' is installed as part of a gem, and +# this file is here to facilitate running it. +# + +require 'pathname' +ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile", + Pathname.new(__FILE__).realpath) + +require 'rubygems' +require 'bundler/setup' + +load Gem.bin_path('capistrano', 'capify') diff --git a/bin/coderay b/bin/coderay new file mode 100755 index 0000000..5be1c00 --- /dev/null +++ b/bin/coderay @@ -0,0 +1,16 @@ +#!/usr/bin/env ruby +# +# This file was generated by Bundler. +# +# The application 'coderay' is installed as part of a gem, and +# this file is here to facilitate running it. +# + +require 'pathname' +ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile", + Pathname.new(__FILE__).realpath) + +require 'rubygems' +require 'bundler/setup' + +load Gem.bin_path('coderay', 'coderay') diff --git a/bin/compass b/bin/compass new file mode 100755 index 0000000..e1ac749 --- /dev/null +++ b/bin/compass @@ -0,0 +1,16 @@ +#!/usr/bin/env ruby +# +# This file was generated by Bundler. +# +# The application 'compass' is installed as part of a gem, and +# this file is here to facilitate running it. +# + +require 'pathname' +ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile", + Pathname.new(__FILE__).realpath) + +require 'rubygems' +require 'bundler/setup' + +load Gem.bin_path('compass', 'compass') diff --git a/bin/erubis b/bin/erubis new file mode 100755 index 0000000..2c7348b --- /dev/null +++ b/bin/erubis @@ -0,0 +1,16 @@ +#!/usr/bin/env ruby +# +# This file was generated by Bundler. +# +# The application 'erubis' is installed as part of a gem, and +# this file is here to facilitate running it. +# + +require 'pathname' +ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile", + Pathname.new(__FILE__).realpath) + +require 'rubygems' +require 'bundler/setup' + +load Gem.bin_path('erubis', 'erubis') diff --git a/bin/haml b/bin/haml new file mode 100755 index 0000000..3c6d074 --- /dev/null +++ b/bin/haml @@ -0,0 +1,16 @@ +#!/usr/bin/env ruby +# +# This file was generated by Bundler. +# +# The application 'haml' is installed as part of a gem, and +# this file is here to facilitate running it. +# + +require 'pathname' +ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile", + Pathname.new(__FILE__).realpath) + +require 'rubygems' +require 'bundler/setup' + +load Gem.bin_path('haml', 'haml') diff --git a/bin/html2haml b/bin/html2haml new file mode 100755 index 0000000..a52215a --- /dev/null +++ b/bin/html2haml @@ -0,0 +1,16 @@ +#!/usr/bin/env ruby +# +# This file was generated by Bundler. +# +# The application 'html2haml' is installed as part of a gem, and +# this file is here to facilitate running it. +# + +require 'pathname' +ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile", + Pathname.new(__FILE__).realpath) + +require 'rubygems' +require 'bundler/setup' + +load Gem.bin_path('haml', 'html2haml') diff --git a/bin/htmldiff b/bin/htmldiff new file mode 100755 index 0000000..c70e238 --- /dev/null +++ b/bin/htmldiff @@ -0,0 +1,16 @@ +#!/usr/bin/env ruby +# +# This file was generated by Bundler. +# +# The application 'htmldiff' is installed as part of a gem, and +# this file is here to facilitate running it. +# + +require 'pathname' +ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile", + Pathname.new(__FILE__).realpath) + +require 'rubygems' +require 'bundler/setup' + +load Gem.bin_path('diff-lcs', 'htmldiff') diff --git a/bin/launchy b/bin/launchy new file mode 100755 index 0000000..92b254a --- /dev/null +++ b/bin/launchy @@ -0,0 +1,16 @@ +#!/usr/bin/env ruby +# +# This file was generated by Bundler. +# +# The application 'launchy' is installed as part of a gem, and +# this file is here to facilitate running it. +# + +require 'pathname' +ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile", + Pathname.new(__FILE__).realpath) + +require 'rubygems' +require 'bundler/setup' + +load Gem.bin_path('launchy', 'launchy') diff --git a/bin/ldiff b/bin/ldiff new file mode 100755 index 0000000..8e3524a --- /dev/null +++ b/bin/ldiff @@ -0,0 +1,16 @@ +#!/usr/bin/env ruby +# +# This file was generated by Bundler. +# +# The application 'ldiff' is installed as part of a gem, and +# this file is here to facilitate running it. +# + +require 'pathname' +ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile", + Pathname.new(__FILE__).realpath) + +require 'rubygems' +require 'bundler/setup' + +load Gem.bin_path('diff-lcs', 'ldiff') diff --git a/bin/nokogiri b/bin/nokogiri new file mode 100755 index 0000000..d55f84b --- /dev/null +++ b/bin/nokogiri @@ -0,0 +1,16 @@ +#!/usr/bin/env ruby +# +# This file was generated by Bundler. +# +# The application 'nokogiri' is installed as part of a gem, and +# this file is here to facilitate running it. +# + +require 'pathname' +ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile", + Pathname.new(__FILE__).realpath) + +require 'rubygems' +require 'bundler/setup' + +load Gem.bin_path('nokogiri', 'nokogiri') diff --git a/bin/posix-spawn-benchmark b/bin/posix-spawn-benchmark new file mode 100755 index 0000000..9e73bb8 --- /dev/null +++ b/bin/posix-spawn-benchmark @@ -0,0 +1,16 @@ +#!/usr/bin/env ruby +# +# This file was generated by Bundler. +# +# The application 'posix-spawn-benchmark' is installed as part of a gem, and +# this file is here to facilitate running it. +# + +require 'pathname' +ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile", + Pathname.new(__FILE__).realpath) + +require 'rubygems' +require 'bundler/setup' + +load Gem.bin_path('posix-spawn', 'posix-spawn-benchmark') diff --git a/bin/pry b/bin/pry new file mode 100755 index 0000000..54678a3 --- /dev/null +++ b/bin/pry @@ -0,0 +1,16 @@ +#!/usr/bin/env ruby +# +# This file was generated by Bundler. +# +# The application 'pry' is installed as part of a gem, and +# this file is here to facilitate running it. +# + +require 'pathname' +ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile", + Pathname.new(__FILE__).realpath) + +require 'rubygems' +require 'bundler/setup' + +load Gem.bin_path('pry', 'pry') diff --git a/bin/rackup b/bin/rackup new file mode 100755 index 0000000..8cc9953 --- /dev/null +++ b/bin/rackup @@ -0,0 +1,16 @@ +#!/usr/bin/env ruby +# +# This file was generated by Bundler. +# +# The application 'rackup' is installed as part of a gem, and +# this file is here to facilitate running it. +# + +require 'pathname' +ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile", + Pathname.new(__FILE__).realpath) + +require 'rubygems' +require 'bundler/setup' + +load Gem.bin_path('rack', 'rackup') diff --git a/bin/rails b/bin/rails new file mode 100755 index 0000000..657440d --- /dev/null +++ b/bin/rails @@ -0,0 +1,16 @@ +#!/usr/bin/env ruby +# +# This file was generated by Bundler. +# +# The application 'rails' is installed as part of a gem, and +# this file is here to facilitate running it. +# + +require 'pathname' +ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile", + Pathname.new(__FILE__).realpath) + +require 'rubygems' +require 'bundler/setup' + +load Gem.bin_path('railties', 'rails') diff --git a/bin/rails_best_practices b/bin/rails_best_practices new file mode 100755 index 0000000..30c973c --- /dev/null +++ b/bin/rails_best_practices @@ -0,0 +1,16 @@ +#!/usr/bin/env ruby +# +# This file was generated by Bundler. +# +# The application 'rails_best_practices' is installed as part of a gem, and +# this file is here to facilitate running it. +# + +require 'pathname' +ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile", + Pathname.new(__FILE__).realpath) + +require 'rubygems' +require 'bundler/setup' + +load Gem.bin_path('rails_best_practices', 'rails_best_practices') diff --git a/bin/rake b/bin/rake new file mode 100755 index 0000000..26c7a2d --- /dev/null +++ b/bin/rake @@ -0,0 +1,16 @@ +#!/usr/bin/env ruby +# +# This file was generated by Bundler. +# +# The application 'rake' is installed as part of a gem, and +# this file is here to facilitate running it. +# + +require 'pathname' +ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile", + Pathname.new(__FILE__).realpath) + +require 'rubygems' +require 'bundler/setup' + +load Gem.bin_path('rake', 'rake') diff --git a/bin/rdebug b/bin/rdebug new file mode 100755 index 0000000..c0c33af --- /dev/null +++ b/bin/rdebug @@ -0,0 +1,16 @@ +#!/usr/bin/env ruby +# +# This file was generated by Bundler. +# +# The application 'rdebug' is installed as part of a gem, and +# this file is here to facilitate running it. +# + +require 'pathname' +ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile", + Pathname.new(__FILE__).realpath) + +require 'rubygems' +require 'bundler/setup' + +load Gem.bin_path('debugger', 'rdebug') diff --git a/bin/rdoc b/bin/rdoc new file mode 100755 index 0000000..f57260f --- /dev/null +++ b/bin/rdoc @@ -0,0 +1,16 @@ +#!/usr/bin/env ruby +# +# This file was generated by Bundler. +# +# The application 'rdoc' is installed as part of a gem, and +# this file is here to facilitate running it. +# + +require 'pathname' +ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile", + Pathname.new(__FILE__).realpath) + +require 'rubygems' +require 'bundler/setup' + +load Gem.bin_path('rdoc', 'rdoc') diff --git a/bin/redcarpet b/bin/redcarpet new file mode 100755 index 0000000..37d58a8 --- /dev/null +++ b/bin/redcarpet @@ -0,0 +1,16 @@ +#!/usr/bin/env ruby +# +# This file was generated by Bundler. +# +# The application 'redcarpet' is installed as part of a gem, and +# this file is here to facilitate running it. +# + +require 'pathname' +ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile", + Pathname.new(__FILE__).realpath) + +require 'rubygems' +require 'bundler/setup' + +load Gem.bin_path('redcarpet', 'redcarpet') diff --git a/bin/ri b/bin/ri new file mode 100755 index 0000000..90f2517 --- /dev/null +++ b/bin/ri @@ -0,0 +1,16 @@ +#!/usr/bin/env ruby +# +# This file was generated by Bundler. +# +# The application 'ri' is installed as part of a gem, and +# this file is here to facilitate running it. +# + +require 'pathname' +ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile", + Pathname.new(__FILE__).realpath) + +require 'rubygems' +require 'bundler/setup' + +load Gem.bin_path('rdoc', 'ri') diff --git a/bin/rspec b/bin/rspec new file mode 100755 index 0000000..0c86b5c --- /dev/null +++ b/bin/rspec @@ -0,0 +1,16 @@ +#!/usr/bin/env ruby +# +# This file was generated by Bundler. +# +# The application 'rspec' is installed as part of a gem, and +# this file is here to facilitate running it. +# + +require 'pathname' +ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile", + Pathname.new(__FILE__).realpath) + +require 'rubygems' +require 'bundler/setup' + +load Gem.bin_path('rspec-core', 'rspec') diff --git a/bin/sass b/bin/sass new file mode 100755 index 0000000..d65bb10 --- /dev/null +++ b/bin/sass @@ -0,0 +1,16 @@ +#!/usr/bin/env ruby +# +# This file was generated by Bundler. +# +# The application 'sass' is installed as part of a gem, and +# this file is here to facilitate running it. +# + +require 'pathname' +ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile", + Pathname.new(__FILE__).realpath) + +require 'rubygems' +require 'bundler/setup' + +load Gem.bin_path('sass', 'sass') diff --git a/bin/sass-convert b/bin/sass-convert new file mode 100755 index 0000000..ddde743 --- /dev/null +++ b/bin/sass-convert @@ -0,0 +1,16 @@ +#!/usr/bin/env ruby +# +# This file was generated by Bundler. +# +# The application 'sass-convert' is installed as part of a gem, and +# this file is here to facilitate running it. +# + +require 'pathname' +ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile", + Pathname.new(__FILE__).realpath) + +require 'rubygems' +require 'bundler/setup' + +load Gem.bin_path('sass', 'sass-convert') diff --git a/bin/scss b/bin/scss new file mode 100755 index 0000000..9f5e435 --- /dev/null +++ b/bin/scss @@ -0,0 +1,16 @@ +#!/usr/bin/env ruby +# +# This file was generated by Bundler. +# +# The application 'scss' is installed as part of a gem, and +# this file is here to facilitate running it. +# + +require 'pathname' +ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile", + Pathname.new(__FILE__).realpath) + +require 'rubygems' +require 'bundler/setup' + +load Gem.bin_path('sass', 'scss') diff --git a/bin/sprockets b/bin/sprockets new file mode 100755 index 0000000..09a1ad1 --- /dev/null +++ b/bin/sprockets @@ -0,0 +1,16 @@ +#!/usr/bin/env ruby +# +# This file was generated by Bundler. +# +# The application 'sprockets' is installed as part of a gem, and +# this file is here to facilitate running it. +# + +require 'pathname' +ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile", + Pathname.new(__FILE__).realpath) + +require 'rubygems' +require 'bundler/setup' + +load Gem.bin_path('sprockets', 'sprockets') diff --git a/bin/thor b/bin/thor new file mode 100755 index 0000000..8421e00 --- /dev/null +++ b/bin/thor @@ -0,0 +1,16 @@ +#!/usr/bin/env ruby +# +# This file was generated by Bundler. +# +# The application 'thor' is installed as part of a gem, and +# this file is here to facilitate running it. +# + +require 'pathname' +ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile", + Pathname.new(__FILE__).realpath) + +require 'rubygems' +require 'bundler/setup' + +load Gem.bin_path('thor', 'thor') diff --git a/bin/tilt b/bin/tilt new file mode 100755 index 0000000..09fe73e --- /dev/null +++ b/bin/tilt @@ -0,0 +1,16 @@ +#!/usr/bin/env ruby +# +# This file was generated by Bundler. +# +# The application 'tilt' is installed as part of a gem, and +# this file is here to facilitate running it. +# + +require 'pathname' +ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile", + Pathname.new(__FILE__).realpath) + +require 'rubygems' +require 'bundler/setup' + +load Gem.bin_path('tilt', 'tilt') diff --git a/bin/tt b/bin/tt new file mode 100755 index 0000000..6e3920b --- /dev/null +++ b/bin/tt @@ -0,0 +1,16 @@ +#!/usr/bin/env ruby +# +# This file was generated by Bundler. +# +# The application 'tt' is installed as part of a gem, and +# this file is here to facilitate running it. +# + +require 'pathname' +ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile", + Pathname.new(__FILE__).realpath) + +require 'rubygems' +require 'bundler/setup' + +load Gem.bin_path('treetop', 'tt') diff --git a/config/_database.yml.erb b/config/_database.yml.erb new file mode 100644 index 0000000..3725b2a --- /dev/null +++ b/config/_database.yml.erb @@ -0,0 +1,15 @@ +defaults: &defaults + adapter: postgresql + encoding: utf8 + pool: 5 + host: localhost + username: cms + min_messages: warning + +test: + <<: *defaults + database: cms_test + +<%= Rails.env %>: + <<: *defaults + database: cms_<%= Rails.env %> diff --git a/config/_secret_token.rb.erb b/config/_secret_token.rb.erb new file mode 100644 index 0000000..da0392d --- /dev/null +++ b/config/_secret_token.rb.erb @@ -0,0 +1 @@ +Clover::Application.config.secret_token = '<%= @secret_token %>' diff --git a/config/_vhost.conf.erb b/config/_vhost.conf.erb new file mode 100644 index 0000000..f6ebcaa --- /dev/null +++ b/config/_vhost.conf.erb @@ -0,0 +1,47 @@ +<% +if _bare_host = @host.match( /^(?:www)\.(.*)/ ) + _bare_host = _bare_host[1] +end + +def ip_from_hostname hostname + require 'socket' + Socket.gethostbyname( hostname )[3].unpack( 'C4' ).join '.' +end + +if _bare_host.present? +%> +server { + listen 80; + server_name <%= _bare_host %>; + rewrite ^(.*) http://<%= @host %>$1 permanent; +} + +<% end %> +server { + listen 80; + server_name <%= @host %>; + + root <%= @public %>; + passenger_enabled on; + + access_log <%= @log %>/nginx.access.log; + error_log <%= @log %>/nginx.error.log warn; + + sendfile on; + location ~ ^/assets/ { + gzip_static on; + gzip_disable "MSIE [1-60]\."; + expires max; + add_header Cache-Control public; + add_header ETag ""; + } + + error_page 401 403 404 /404.html; + error_page 500 502 503 504 /50x.html; + + location = /50x.html { + root html; + } +} + +# vim: set ft=nginx: diff --git a/config/application.rb b/config/application.rb index 4a634fb..a681569 100644 --- a/config/application.rb +++ b/config/application.rb @@ -10,7 +10,7 @@ if defined?(Bundler) # If you precompile assets before deploying to production, use this line - Bundler.require(*Rails.groups(:assets => %w(development test))) + Bundler.require(*Rails.groups(assets: %w(development test))) # If you want your assets lazily compiled in production, use this line # Bundler.require(:default, :assets, Rails.env) end @@ -23,7 +23,7 @@ class Application < Rails::Application # -- all .rb files in that directory are automatically loaded. # Custom directories with classes and modules you want to be autoloadable. - config.autoload_paths += %W(#{config.root}/app/middleware #{config.root}/extras) + config.autoload_paths += %W( #{config.root}/lib/extensions ) # Only load the plugins named here, in the order given (default is alphabetical). # :all can be used as a placeholder for all plugins not explicitly named. @@ -44,16 +44,31 @@ class Application < Rails::Application config.encoding = "utf-8" # Configure sensitive parameters which will be filtered from the log file. - config.filter_parameters += [:password] + config.filter_parameters += [:password, :password_confirmation] # Enable the asset pipeline config.assets.enabled = true - config.assets.precompile += %w( clover.css tjruby.css dashboard.css simple_blog.css sessions.css jquery-ui.css ) - config.assets.precompile += %w( wymeditor/jquery.wymeditor.min.js uploadify/uploadify.min.js uploadify/swfobject.js ) + config.assets.precompile += %w( clover.css tjruby.css dashboard.css simple_blog.css sessions.css ) # Version of your assets, change this if you want to expire all your assets config.assets.version = '1.0' + + $markdown_extensions = { + autolink: true, + no_intra_emphasis: true, + fenced_code_blocks: true, + space_after_headers: true, + superscript: true, + } + + $render_options = { + filter_html: true, + hard_wrap: true, + with_toc_data: true, + } + + $themes = Dir[ Rails.root.join('app', 'views', 'layouts', 'themes', '**' ) ].map { |dir| File.basename dir } end end diff --git a/config/capistrano_templates.rb b/config/capistrano_templates.rb deleted file mode 100644 index 9765ec9..0000000 --- a/config/capistrano_templates.rb +++ /dev/null @@ -1,74 +0,0 @@ -unless Capistrano::Configuration.respond_to?(:instance) - abort "This extension requires Capistrano 2" -end - -Capistrano::Configuration.instance.load do - namespace :deploy do - namespace :db do - - desc <<-DESC - Creates the database.yml configuration file in shared path. - - By default, this task uses a template unless a template \ - called database.yml.erb is found either is :template_dir \ - or /config/deploy folders. The default template matches \ - the template for config/database.yml file shipped with Rails. - - When this recipe is loaded, db:setup is automatically configured \ - to be invoked after deploy:setup. You can skip this task setting \ - the variable :skip_db_setup to true. This is especially useful \ - if you are using this recipe in combination with \ - capistrano-ext/multistaging to avoid multiple db:setup calls \ - when running deploy:setup for all stages one by one. - DESC - task :setup, :except => { :no_release => true } do - - default_template = <<-EOF - base: &base - adapter: sqlite3 - timeout: 5000 - development: - database: #{shared_path}/db/development.sqlite3 - <<: *base - test: - database: #{shared_path}/db/test.sqlite3 - <<: *base - production: - database: #{shared_path}/db/production.sqlite3 - <<: *base - EOF - - database = fetch(:template_dir, "config/deploy") + '/database.yml.erb' - htaccess = fetch(:template_dir, "config/deploy") + '/htaccess.erb' - - database_template = File.file?(database) ? File.read(database) : default_template - database_config = ERB.new(database_template) - - if File.file?(htaccess) - htaccess_template = File.read(htaccess) - apache_config = ERB.new(htaccess_template) - end - - run "mkdir -p #{shared_path}/db" - run "mkdir -p #{shared_path}/config" - run "mkdir -p #{shared_path}/vendor" - run "mkdir -p #{shared_path}/public" - - put database_config.result(binding), "#{shared_path}/config/database.yml" - put apache_config.result(binding), "#{shared_path}/public/.htaccess" if !apache_config.nil? - end - - desc <<-DESC - [internal] Updates the symlink for database.yml file to the just deployed release. - DESC - task :symlink, :except => { :no_release => true } do - run "ln -nfs #{shared_path}/config/database.yml #{release_path}/config/database.yml" - end - - end - - after "deploy:setup", "deploy:db:setup" unless fetch(:skip_db_setup, false) - after "deploy:finalize_update", "deploy:db:symlink" - end -end - diff --git a/config/cucumber.yml b/config/cucumber.yml deleted file mode 100644 index 19b288d..0000000 --- a/config/cucumber.yml +++ /dev/null @@ -1,8 +0,0 @@ -<% -rerun = File.file?('rerun.txt') ? IO.read('rerun.txt') : "" -rerun_opts = rerun.to_s.strip.empty? ? "--format #{ENV['CUCUMBER_FORMAT'] || 'progress'} features" : "--format #{ENV['CUCUMBER_FORMAT'] || 'pretty'} #{rerun}" -std_opts = "--format #{ENV['CUCUMBER_FORMAT'] || 'pretty'} --strict --tags ~@wip" -%> -default: <%= std_opts %> features -wip: --tags @wip:3 --wip features -rerun: <%= rerun_opts %> --format rerun --out rerun.txt --strict --tags ~@wip diff --git a/config/database.yml b/config/database.yml index 7551340..352ff7d 100644 --- a/config/database.yml +++ b/config/database.yml @@ -1,25 +1,15 @@ -# SQLite version 3.x -# gem install sqlite3-ruby (not necessary on OS X Leopard) -development: - adapter: sqlite3 - database: db/development.sqlite3 +defaults: &defaults + adapter: postgresql + encoding: utf8 pool: 5 - timeout: 5000 + host: localhost + username: cms + min_messages: warning -# Warning: The database defined as "test" will be erased and -# re-generated from your development database when you run "rake". -# Do not set this db to the same as development or production. -test: &test - adapter: sqlite3 - database: db/test.sqlite3 - pool: 5 - timeout: 5000 +test: + <<: *defaults + database: cms_test -production: - adapter: sqlite3 - database: db/production.sqlite3 - pool: 5 - timeout: 5000 - -cucumber: - <<: *test \ No newline at end of file +development: + <<: *defaults + database: cms_development diff --git a/config/deploy.rb b/config/deploy.rb index 153f0ad..2f75da7 100644 --- a/config/deploy.rb +++ b/config/deploy.rb @@ -14,7 +14,7 @@ role :web, "#{subdomain}.#{domain}" role :app, "#{subdomain}.#{domain}" -role :db, "#{subdomain}.#{domain}", :primary => true +role :db, "#{subdomain}.#{domain}", primary: true set :deploy_to, "/home/#{user}/rails_apps/#{subdomain}.#{domain}/#{application}" @@ -23,7 +23,7 @@ namespace :deploy do task :start do ; end task :stop do ; end - task :restart, :roles => :app, :except => { :no_release => true } do + task :restart, roles: :app, except: { no_release: true } do run "touch #{File.join(current_path,'tmp','restart.txt')}" end diff --git a/config/environments/development.rb b/config/environments/development.rb index 416785b..897419e 100644 --- a/config/environments/development.rb +++ b/config/environments/development.rb @@ -18,7 +18,7 @@ # Print deprecation notices to the Rails logger config.active_support.deprecation = :log - config.action_mailer.default_url_options = { :host => 'localhost:3000' } + config.action_mailer.default_url_options = { host: 'localhost:3000' } # Only use best-standards-support built into browsers config.action_dispatch.best_standards_support = :builtin diff --git a/config/environments/production.rb b/config/environments/production.rb index 12f6679..53ff2c2 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb @@ -40,5 +40,5 @@ # Send deprecation notices to registered listeners config.active_support.deprecation = :notify - config.action_mailer.default_url_options = { :host => 'localhost:3000' } + config.action_mailer.default_url_options = { host: 'localhost:3000' } end diff --git a/config/environments/test.rb b/config/environments/test.rb index 5b27ebc..633b523 100644 --- a/config/environments/test.rb +++ b/config/environments/test.rb @@ -36,7 +36,7 @@ # Print deprecation notices to the stderr config.active_support.deprecation = :stderr - config.action_mailer.default_url_options = { :host => 'localhost:3000' } + config.action_mailer.default_url_options = { host: 'localhost:3000' } # Allow pass debug_assets=true as a query parameter to load pages with unpackaged assets config.assets.allow_debugging = true diff --git a/config/initializers/devise.rb b/config/initializers/devise.rb index 6812fbc..d6bcc60 100644 --- a/config/initializers/devise.rb +++ b/config/initializers/devise.rb @@ -69,7 +69,7 @@ # :http_auth and :token_auth by adding those symbols to the array below. # Notice that if you are skipping storage for all authentication paths, you # may want to disable generating routes to Devise's sessions controller by - # passing :skip => :sessions to `devise_for` in your config/routes.rb + # passing skip: :sessions to `devise_for` in your config/routes.rb config.skip_session_storage = [:http_auth] # ==> Configuration for :database_authenticatable @@ -99,8 +99,8 @@ # The key to be used to check existing users when sending an invitation # and the regexp used to test it when validate_on_invite is not set. - # config.invite_key = {:email => /A[^@]+@[^@]+z/} - # config.invite_key = {:email => /A[^@]+@[^@]+z/, :username => nil} + # config.invite_key = {email: /A[^@]+@[^@]+z/} + # config.invite_key = {email: /A[^@]+@[^@]+z/, username: nil} # Flag that force a record to be valid before being actually invited # Default: false @@ -131,7 +131,7 @@ # config.extend_remember_period = false # Options to be passed to the created cookie. For instance, you can set - # :secure => true in order to force SSL only cookies. + # secure: true in order to force SSL only cookies. # config.rememberable_options = {} # ==> Configuration for :validatable @@ -227,7 +227,7 @@ # ==> OmniAuth # Add a new OmniAuth provider. Check the wiki for more information on setting # up on your models and hooks. - # config.omniauth :github, 'APP_ID', 'APP_SECRET', :scope => 'user,public_repo' + # config.omniauth :github, 'APP_ID', 'APP_SECRET', scope: 'user,public_repo' # ==> Warden configuration # If you want to use other strategies, that are not supported by Devise, or @@ -235,7 +235,7 @@ # # config.warden do |manager| # manager.intercept_401 = false - # manager.default_strategies(:scope => :user).unshift :some_external_strategy + # manager.default_strategies(scope: :user).unshift :some_external_strategy # end # ==> Mountable engine configurations diff --git a/config/initializers/secret_token.rb b/config/initializers/secret_token.rb deleted file mode 100644 index 2b560d3..0000000 --- a/config/initializers/secret_token.rb +++ /dev/null @@ -1,7 +0,0 @@ -# Be sure to restart your server when you modify this file. - -# Your secret key for verifying the integrity of signed cookies. -# If you change this key, all old signed cookies will become invalid! -# Make sure the secret is at least 30 characters and all random, -# no regular words or you'll be exposed to dictionary attacks. -Clover::Application.config.secret_token = 'eea93344927bd7860495a5c87132622ca87a41909fb0dddd3774b7f0d438386d1af9be3af199177c5987383fcbf31713c543bd659df8aeb54b7aa31aeed138b1' diff --git a/config/initializers/session_store.rb b/config/initializers/session_store.rb index 6dba04c..63abbb7 100644 --- a/config/initializers/session_store.rb +++ b/config/initializers/session_store.rb @@ -1,14 +1,8 @@ # Be sure to restart your server when you modify this file. -Clover::Application.config.session_store :cookie_store, :key => '_clover_session' +Clover::Application.config.session_store :cookie_store, key: '_clover_session' # Use the database for sessions instead of the cookie-based default, # which shouldn't be used to store highly confidential information # (create the session table with "rails generate session_migration") # Clover::Application.config.session_store :active_record_store - -Rails.application.config.middleware.insert_before( - ActionDispatch::Session::CookieStore, - FlashSessionCookieMiddleware, - Rails.application.config.session_options[:key] -) diff --git a/config/initializers/simple_form.rb b/config/initializers/simple_form.rb new file mode 100644 index 0000000..59c7d25 --- /dev/null +++ b/config/initializers/simple_form.rb @@ -0,0 +1,138 @@ +# Use this setup block to configure all options available in SimpleForm. +SimpleForm.setup do |config| + # Wrappers are used by the form builder to generate a + # complete input. You can remove any component from the + # wrapper, change the order or even add your own to the + # stack. The options given below are used to wrap the + # whole input. + config.wrappers :default, :class => :input, + :hint_class => :field_with_hint, :error_class => :field_with_errors do |b| + ## Extensions enabled by default + # Any of these extensions can be disabled for a + # given input by passing: `f.input EXTENSION_NAME => false`. + # You can make any of these extensions optional by + # renaming `b.use` to `b.optional`. + + # Determines whether to use HTML5 (:email, :url, ...) + # and required attributes + b.use :html5 + + # Calculates placeholders automatically from I18n + # You can also pass a string as f.input :placeholder => "Placeholder" + b.use :placeholder + + ## Optional extensions + # They are disabled unless you pass `f.input EXTENSION_NAME => :lookup` + # to the input. If so, they will retrieve the values from the model + # if any exists. If you want to enable the lookup for any of those + # extensions by default, you can change `b.optional` to `b.use`. + + # Calculates maxlength from length validations for string inputs + b.optional :maxlength + + # Calculates pattern from format validations for string inputs + b.optional :pattern + + # Calculates min and max from length validations for numeric inputs + b.optional :min_max + + # Calculates readonly automatically from readonly attributes + b.optional :readonly + + ## Inputs + b.use :label_input + b.use :hint, :wrap_with => { :tag => :span, :class => :hint } + b.use :error, :wrap_with => { :tag => :span, :class => :error } + end + + # The default wrapper to be used by the FormBuilder. + config.default_wrapper = :default + + # Define the way to render check boxes / radio buttons with labels. + # Defaults to :nested for bootstrap config. + # :inline => input + label + # :nested => label > input + config.boolean_style = :nested + + # Default class for buttons + config.button_class = 'btn' + + # Method used to tidy up errors. Specify any Rails Array method. + # :first lists the first message for each field. + # Use :to_sentence to list all errors for each field. + # config.error_method = :first + + # Default tag used for error notification helper. + config.error_notification_tag = :div + + # CSS class to add for error notification helper. + config.error_notification_class = 'alert alert-error' + + # ID to add for error notification helper. + # config.error_notification_id = nil + + # Series of attempts to detect a default label method for collection. + # config.collection_label_methods = [ :to_label, :name, :title, :to_s ] + + # Series of attempts to detect a default value method for collection. + # config.collection_value_methods = [ :id, :to_s ] + + # You can wrap a collection of radio/check boxes in a pre-defined tag, defaulting to none. + # config.collection_wrapper_tag = nil + + # You can define the class to use on all collection wrappers. Defaulting to none. + # config.collection_wrapper_class = nil + + # You can wrap each item in a collection of radio/check boxes with a tag, + # defaulting to :span. Please note that when using :boolean_style = :nested, + # SimpleForm will force this option to be a label. + # config.item_wrapper_tag = :span + + # You can define a class to use in all item wrappers. Defaulting to none. + # config.item_wrapper_class = nil + + # How the label text should be generated altogether with the required text. + # config.label_text = lambda { |label, required| "#{required} #{label}" } + + # You can define the class to use on all labels. Default is nil. + config.label_class = 'control-label' + + # You can define the class to use on all forms. Default is simple_form. + # config.form_class = :simple_form + + # You can define which elements should obtain additional classes + # config.generate_additional_classes_for = [:wrapper, :label, :input] + + # Whether attributes are required by default (or not). Default is true. + # config.required_by_default = true + + # Tell browsers whether to use default HTML5 validations (novalidate option). + # Default is enabled. + config.browser_validations = false + + # Collection of methods to detect if a file type was given. + # config.file_methods = [ :mounted_as, :file?, :public_filename ] + + # Custom mappings for input types. This should be a hash containing a regexp + # to match as key, and the input type that will be used when the field name + # matches the regexp as value. + # config.input_mappings = { /count/ => :integer } + + # Default priority for time_zone inputs. + # config.time_zone_priority = nil + + # Default priority for country inputs. + # config.country_priority = nil + + # Default size for text inputs. + # config.default_input_size = 50 + + # When false, do not use translations for labels. + # config.translate_labels = true + + # Automatically discover new inputs in Rails' autoload path. + # config.inputs_discovery = true + + # Cache SimpleForm inputs discovery + # config.cache_discovery = !Rails.env.development? +end diff --git a/config/initializers/wrap_parameters.rb b/config/initializers/wrap_parameters.rb index da4fb07..999df20 100644 --- a/config/initializers/wrap_parameters.rb +++ b/config/initializers/wrap_parameters.rb @@ -5,7 +5,7 @@ # Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array. ActiveSupport.on_load(:action_controller) do - wrap_parameters :format => [:json] + wrap_parameters format: [:json] end # Disable root element in JSON by default. diff --git a/config/locales/en.yml b/config/locales/en.yml index 96f6a58..4433436 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -77,6 +77,7 @@ en: item_details: '%{item} details' item_keywords: '%{item} keywords' item_assets: '%{item} Assets' + item_edit: '%{item} Edit' add_item: 'Add %{item}' logout: 'logout' diff --git a/config/locales/es.yml b/config/locales/es.yml index dccb078..95ad464 100644 --- a/config/locales/es.yml +++ b/config/locales/es.yml @@ -77,6 +77,7 @@ es: item_details: 'Detalles de %{item}' item_keywords: 'Palabras clave de %{item}' item_assets: 'Recursos de %{item}' + item_edit: 'Editar %{item}' add_item: 'Agregar %{item}' logout: 'salir' @@ -120,12 +121,18 @@ es: activerecord: models: - section: 'Sección' - page: 'Pagina' - article: 'Articulo' - user: 'Usuario' - role: 'Rol' - setting: 'Configuración' + section: + one: 'Sección' + other: 'Secciones' + page: + one: 'Página' + other: 'Páginas' + user: + one: 'Usuario' + other: 'Usuarios' + setting: + one: 'Configuración' + other: 'Configuraciones' attributes: section: name: 'Nombre' diff --git a/config/locales/simple_form.en.yml b/config/locales/simple_form.en.yml new file mode 100644 index 0000000..0df11fe --- /dev/null +++ b/config/locales/simple_form.en.yml @@ -0,0 +1,26 @@ +en: + simple_form: + "yes": 'Yes' + "no": 'No' + required: + text: 'required' + mark: '*' + # You can uncomment the line below if you need to overwrite the whole required html. + # When using html, text and mark won't be used. + # html: '*' + error_notification: + default_message: "Please review the problems below:" + # Labels and hints examples + # labels: + # defaults: + # password: 'Password' + # user: + # new: + # email: 'E-mail to sign in.' + # edit: + # email: 'E-mail.' + # hints: + # defaults: + # username: 'User name to sign in.' + # password: 'No special characters, please.' + diff --git a/config/routes.rb b/config/routes.rb index 20f16ae..9b48195 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -1,21 +1,21 @@ Clover::Application.routes.draw do - devise_for :users, :controllers => { :registrations => 'users/registrations' } + devise_for :users, controllers: { registrations: 'users/registrations' } - resource :contact_form, :only => [ :create ] + resource :contact_form, only: [ :create ] - match "/dashboard", :to => "dashboard/sections#index", :as => :dashboard, :via => :get - match "/dashboard/profile", :to => redirect("/users/edit"), :as => :user_root, :via => :get + match "/dashboard", to: "dashboard/sections#index", as: :dashboard, via: :get + match "/dashboard/profile", to: redirect("/users/edit"), as: :user_root, via: :get namespace :dashboard do - resources :users, :only => [ :index, :destroy ] - resources :assets, :only => [ :create, :destroy ] - resources :settings, :except => :show - resources :sections, :except => :show - resources :pages, :except => :show + resources :users, only: [ :index, :destroy ] + resources :assets, only: [ :create, :destroy ] + resources :settings, except: :show + resources :sections, except: :show + resources :pages, except: :show end - match ":section/:page", :to => "pages#show", :as => :section_page, :via => :get, :format => :html - match ":section/:subsection/:page", :to => "pages#show", :as => :subsection_page, :via => :get, :format => :html + match ":section/:page", to: "pages#show", as: :section_page, via: :get, format: :html + match ":section/:subsection/:page", to: "pages#show", as: :subsection_page, via: :get, format: :html - root :to => "pages#home", :via => :get + root to: "pages#home", via: :get end diff --git a/db/migrate/20100805055902_create_sections.rb b/db/migrate/20100805055902_create_sections.rb index c7d6f21..cfeb141 100644 --- a/db/migrate/20100805055902_create_sections.rb +++ b/db/migrate/20100805055902_create_sections.rb @@ -3,7 +3,7 @@ def self.up create_table :sections do |t| t.string :name t.integer :main_section_id - t.string :url_name, :unique => true + t.string :url_name, unique: true t.timestamps end diff --git a/db/migrate/20100806061522_create_pages.rb b/db/migrate/20100806061522_create_pages.rb index baf21f7..f63268d 100644 --- a/db/migrate/20100806061522_create_pages.rb +++ b/db/migrate/20100806061522_create_pages.rb @@ -5,9 +5,9 @@ def self.up t.string :url_name t.text :content t.integer :section_id - t.boolean :published, :default => false - t.boolean :home_page, :default => false - t.boolean :has_contact, :default => false + t.boolean :published, default: false + t.boolean :home_page, default: false + t.boolean :has_contact, default: false t.timestamps end diff --git a/db/migrate/20100814005921_devise_create_users.rb b/db/migrate/20100814005921_devise_create_users.rb index 5e5d3eb..8b0f52e 100644 --- a/db/migrate/20100814005921_devise_create_users.rb +++ b/db/migrate/20100814005921_devise_create_users.rb @@ -2,9 +2,9 @@ class DeviseCreateUsers < ActiveRecord::Migration def self.up create_table(:users) do |t| ## Database authenticatable - t.string :email, :null => false, :default => "" - t.string :username, :null => false, :default => '' - t.string :encrypted_password, :null => false, :default => "" + t.string :email, null: false, default: "" + t.string :username, null: false, default: '' + t.string :encrypted_password, null: false, default: "" ## Recoverable t.string :reset_password_token @@ -14,7 +14,7 @@ def self.up t.datetime :remember_created_at ## Trackable - t.integer :sign_in_count, :default => 0 + t.integer :sign_in_count, default: 0 t.datetime :current_sign_in_at t.datetime :last_sign_in_at t.string :current_sign_in_ip @@ -30,7 +30,7 @@ def self.up t.string :unconfirmed_email # Only if using reconfirmable ## Lockable - t.integer :failed_attempts, :default => 0 # Only if lock strategy is :failed_attempts + t.integer :failed_attempts, default: 0 # Only if lock strategy is :failed_attempts t.string :unlock_token # Only if unlock strategy is :email or :both t.datetime :locked_at @@ -43,11 +43,11 @@ def self.up t.timestamps end - add_index :users, :email, :unique => true - add_index :users, :username, :unique => true - add_index :users, :reset_password_token, :unique => true - add_index :users, :confirmation_token, :unique => true - add_index :users, :unlock_token, :unique => true + add_index :users, :email, unique: true + add_index :users, :username, unique: true + add_index :users, :reset_password_token, unique: true + add_index :users, :confirmation_token, unique: true + add_index :users, :unlock_token, unique: true end def self.down diff --git a/db/migrate/20101012145155_acts_as_taggable_on_migration.rb b/db/migrate/20101012145155_acts_as_taggable_on_migration.rb deleted file mode 100644 index e47c4a1..0000000 --- a/db/migrate/20101012145155_acts_as_taggable_on_migration.rb +++ /dev/null @@ -1,29 +0,0 @@ -class ActsAsTaggableOnMigration < ActiveRecord::Migration - def self.up - create_table :tags do |t| - t.string :name - end - - create_table :taggings do |t| - t.references :tag - - # You should make sure that the column created is - # long enough to store the required class names. - t.references :taggable, :polymorphic => true - t.references :tagger, :polymorphic => true - - t.string :context - - t.datetime :created_at - end - - add_index :taggings, :tag_id - add_index :taggings, [:taggable_id, :taggable_type, :context] - add_index :taggings, [:tagger_id, :tagger_type] - end - - def self.down - drop_table :taggings - drop_table :tags - end -end diff --git a/db/migrate/20101110064447_create_assets.rb b/db/migrate/20101110064447_create_assets.rb deleted file mode 100644 index f97d785..0000000 --- a/db/migrate/20101110064447_create_assets.rb +++ /dev/null @@ -1,22 +0,0 @@ -class CreateAssets < ActiveRecord::Migration - def self.up - create_table :assets do |t| - t.string :description - t.string :asset_file_name - t.string :asset_content_type - t.integer :asset_file_size - t.integer :attachable_id - t.string :attachable_type - end - - add_index :assets, :asset_content_type - add_index :assets, [ :attachable_id, :attachable_type ] - end - - def self.down - remove_index :assets, [ :attachable_id, :attachable_type ] - remove_index :assets, :asset_content_type - - drop_table :assets - end -end diff --git a/db/migrate/20110209072651_create_settings.rb b/db/migrate/20110209072651_create_settings.rb index 583b527..f41b6b8 100644 --- a/db/migrate/20110209072651_create_settings.rb +++ b/db/migrate/20110209072651_create_settings.rb @@ -1,10 +1,10 @@ class CreateSettings < ActiveRecord::Migration def self.up create_table :settings do |t| - t.string :name, :null => false - t.text :value, :null => false + t.string :name, null: false + t.text :value, null: false t.string :description - t.boolean :destroyable, :default => true + t.boolean :destroyable, default: true t.timestamps end diff --git a/db/migrate/20120918221141_add_slug_to_pages.rb b/db/migrate/20120918221141_add_slug_to_pages.rb index 18bc4f8..35d70f9 100644 --- a/db/migrate/20120918221141_add_slug_to_pages.rb +++ b/db/migrate/20120918221141_add_slug_to_pages.rb @@ -1,6 +1,6 @@ class AddSlugToPages < ActiveRecord::Migration def change add_column :pages, :slug, :string - add_index :pages, :slug, :unique => true + add_index :pages, :slug, unique: true end end diff --git a/db/migrate/20120918223422_add_slug_to_sections.rb b/db/migrate/20120918223422_add_slug_to_sections.rb index 46407c6..733fc07 100644 --- a/db/migrate/20120918223422_add_slug_to_sections.rb +++ b/db/migrate/20120918223422_add_slug_to_sections.rb @@ -1,6 +1,6 @@ class AddSlugToSections < ActiveRecord::Migration def change add_column :sections, :slug, :string - add_index :sections, :slug, :unique => true + add_index :sections, :slug, unique: true end end diff --git a/db/schema.rb b/db/schema.rb index db70c88..da3c21e 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -13,18 +13,6 @@ ActiveRecord::Schema.define(:version => 20120918223422) do - create_table "assets", :force => true do |t| - t.string "description" - t.string "asset_file_name" - t.string "asset_content_type" - t.integer "asset_file_size" - t.integer "attachable_id" - t.string "attachable_type" - end - - add_index "assets", ["asset_content_type"], :name => "index_assets_on_asset_content_type" - add_index "assets", ["attachable_id", "attachable_type"], :name => "index_assets_on_attachable_id_and_attachable_type" - create_table "pages", :force => true do |t| t.string "name" t.text "content" @@ -60,24 +48,6 @@ t.datetime "updated_at", :null => false end - create_table "taggings", :force => true do |t| - t.integer "tag_id" - t.integer "taggable_id" - t.string "taggable_type" - t.integer "tagger_id" - t.string "tagger_type" - t.string "context" - t.datetime "created_at" - end - - add_index "taggings", ["tag_id"], :name => "index_taggings_on_tag_id" - add_index "taggings", ["taggable_id", "taggable_type", "context"], :name => "index_taggings_on_taggable_id_and_taggable_type_and_context" - add_index "taggings", ["tagger_id", "tagger_type"], :name => "index_taggings_on_tagger_id_and_tagger_type" - - create_table "tags", :force => true do |t| - t.string "name" - end - create_table "users", :force => true do |t| t.string "email", :default => "", :null => false t.string "username", :default => "", :null => false diff --git a/db/seeds.rb b/db/seeds.rb index 060d2b2..e6d4317 100644 --- a/db/seeds.rb +++ b/db/seeds.rb @@ -1,30 +1,30 @@ # We crate our default section and page to avoid CMS errors -section = Section.create!( :name => 'main' ) -page = section.pages.build( :name => 'main page', :content => 'this is my main page', :home_page => true, :published => true ).save! +section = Section.create!( name: 'main' ) +page = section.pages.build( name: 'main page', content: 'this is my main page', home_page: true, published: true ).save! # We create and activate a default user -user = User.create! :username => 'admin', :password => 'administrator', :email => "admin@example.com" +user = User.create! username: 'admin', password: 'administrator', email: "admin@example.com" user.save! # We create the default non-destroyable site settings default_settings = [ { - :name => 'theme', - :value => 'default', - :description => 'This is the theme of your site.' + name: 'theme', + value: 'default', + description: 'This is the theme of your site.' }, { - :name => 'site_name', - :value => 'CloverInteractive', - :description => 'This is your site name.' + name: 'site_name', + value: 'CloverInteractive', + description: 'This is your site name.' }, { - :name => 'footer', - :value => 'This site is powered by CloverInteractive', - :description => "This is your site's footer." + name: 'footer', + value: 'This site is powered by CloverInteractive', + description: "This is your site's footer." } ] diff --git a/lib/extensions/pygments_renderer.rb b/lib/extensions/pygments_renderer.rb new file mode 100644 index 0000000..683432b --- /dev/null +++ b/lib/extensions/pygments_renderer.rb @@ -0,0 +1,9 @@ +class PygmentsRenderer < Redcarpet::Render::HTML + def block_code( code, language ) + sha = Digest::SHA1.hexdigest( code ) + + Rails.cache.fetch [ 'code', language, sha ].join( '-' ) do + Pygments.highlight( code, lexer: language, options: { encoding: 'utf-8' } ) + end + end +end diff --git a/lib/tasks/config.rake b/lib/tasks/config.rake new file mode 100644 index 0000000..8658fdf --- /dev/null +++ b/lib/tasks/config.rake @@ -0,0 +1,56 @@ +namespace :config do + desc "Generate application environment files" + task :generate => [ :vhost, :database, :secret_token ] + + desc "Generate nginx vhost" + task :vhost do + erb_parse :vhost + end + + + desc "Generate database.yml" + task :database do + erb_parse :database, extension: '.yml' + end + + desc "Generate secret_token.rb" + task :secret_token do + erb_parse :secret_token, extension: '.rb', output_dir: Rails.root.join( 'config', 'initializers' ).to_s + end + + def erb_parse name, opts={} + require 'erb' + require 'securerandom' + + ext = opts[:extension] || '.conf' + + host = { + 'development' => 'www.cms.dev', + 'production' => 'www.cloverinteractive.com', + 'staging' => 'staging.cloverinteractive.com' + }[ Rails.env ] + + config_dir = Rails.root.join( 'config' ).to_s + output_dir = opts[:output_dir] || config_dir + + erb_env = Proc.new do + @host = host + @root = Rails.root + + @subdomain = host.split( '.' ).first + @public = "#{ @root.join 'public' }" + @log = "#{ @root.join 'log' }" + @dev_on = Rails.env.production? ? 'off' : 'on' + + @secret_token = SecureRandom.hex 64 + + binding + end.call + + response = ERB.new File.read( File.join( config_dir, "_#{ name }#{ ext }.erb" ) ) + + File.open File.join( output_dir, "#{ name }#{ ext }" ), 'w' do |f| + f.print response.result( erb_env ) + end + end +end diff --git a/lib/templates/haml/scaffold/_form.html.haml b/lib/templates/haml/scaffold/_form.html.haml new file mode 100644 index 0000000..ac3aa7b --- /dev/null +++ b/lib/templates/haml/scaffold/_form.html.haml @@ -0,0 +1,10 @@ += simple_form_for(@<%= singular_table_name %>) do |f| + = f.error_notification + + .form-inputs + <%- attributes.each do |attribute| -%> + = f.<%= attribute.reference? ? :association : :input %> :<%= attribute.name %> + <%- end -%> + + .form-actions + = f.button :submit diff --git a/public/swf/uploadify/uploadify.swf b/public/swf/uploadify/uploadify.swf deleted file mode 100755 index 592badd..0000000 Binary files a/public/swf/uploadify/uploadify.swf and /dev/null differ diff --git a/spec/controllers/dashboard/pages_controller_spec.rb b/spec/controllers/dashboard/pages_controller_spec.rb index 4385819..84d8d92 100644 --- a/spec/controllers/dashboard/pages_controller_spec.rb +++ b/spec/controllers/dashboard/pages_controller_spec.rb @@ -1,16 +1,14 @@ require 'spec_helper' describe Dashboard::PagesController do - before :each do - @user = Factory.create :user - @section = Factory.create :section - @page = Factory.create :page, :section => @section - end + let( :user ) { create :user } + let( :section ) { create :section } + let( :page ) { create :page, section: section } + + before { page.should be_persisted } describe "when user is logged in" do - before :each do - login_as @user - end + before { sign_in user } describe "GET index" do before :each do @@ -18,7 +16,7 @@ end it "should assign @pages" do - assigns( :pages ).should == [ @page ] + assigns( :pages ).should include( page ) end it "should be successful" do @@ -50,7 +48,7 @@ describe "GET edit" do before :each do - get :edit, :id => @page + get :edit, id: page end it "should assign @page" do @@ -67,10 +65,9 @@ end describe "POST create" do - before :each do - @page_attr = Factory.attributes_for :page, :name => 'new page', :section_id => @section.id - post :create, :page => @page_attr - end + let( :page_attr ) { attributes_for :page, name: 'new page', section_id: section.id } + + before { post :create, page: page_attr } it "should redirect to index" do response.should redirect_to( dashboard_pages_path ) @@ -78,26 +75,26 @@ it "should create page" do assigns( :page ).should be_kind_of( Page ) - Page.count.should == 2 + Page.count.should eql( 2 ) end it "should render new if anything goes wrong" do - post :create, :page => @page_attr.merge( :name => @page.name ) + post :create, page: page_attr.merge( name: page.name ) response.should render_template( :new ) end end describe "PUT update" do before :each do - put :update, :id => @page, :page => { :name => 'batman' } + put :update, id: page, page: { name: 'batman' } end it "should redirect to index" do - response.should redirect_to( dashboard_pages_path ) + response.should redirect_to( edit_dashboard_page_path( page.reload ) ) end it "should update @page" do - assigns( :page ).should == @page.reload + assigns( :page ).should eql( page.reload ) end it "should assign @page" do @@ -107,11 +104,11 @@ describe "DELETE destroy" do before :each do - delete :destroy, :id => @page + delete :destroy, id: page end it "should destroy page" do - Page.count.should == 0 + Page.count.should eql( 0 ) end it "should redirect to index" do @@ -125,23 +122,23 @@ it "should redirect to login when using GET" do actions = %w/index new edit/ actions.each do |action| - get action, :id => @page + get action, id: page response.should redirect_to( new_user_session_path ) end end it "should redirect to login when using POST" do - post :create, :page => Factory.attributes_for( :page ) + post :create, page: attributes_for( :page ) response.should redirect_to( new_user_session_path ) end it "should redirect to login when using PUT" do - put :update, :id => @page, :page => { :name => '' } + put :update, id: page, page: { name: '' } response.should redirect_to( new_user_session_path ) end it "should redirect to login when using DELETE" do - delete :destroy, :id => @page + delete :destroy, id: page response.should redirect_to( new_user_session_path ) end end diff --git a/spec/controllers/dashboard/sections_controller_spec.rb b/spec/controllers/dashboard/sections_controller_spec.rb index 819d2f0..2d7a317 100644 --- a/spec/controllers/dashboard/sections_controller_spec.rb +++ b/spec/controllers/dashboard/sections_controller_spec.rb @@ -1,14 +1,13 @@ require 'spec_helper' describe Dashboard::SectionsController do - before :each do - @user = Factory.create :user - @section = Factory.create :section - end + let( :user ) { create :user } + let( :section ) { create :section } describe "when user is logged in" do before :each do - login_as @user + section.should be_persisted + sign_in user end describe "GET index" do @@ -21,7 +20,7 @@ end it "should assign @sections" do - assigns( :sections ).should == [ @section ] + assigns( :sections ).should include( section ) end it "should render index" do @@ -49,7 +48,7 @@ describe "GET edit" do before :each do - get :edit, :id => @section + get :edit, id: section end it "should be successfu" do @@ -67,11 +66,7 @@ describe "POST create" do before :each do - post :create, :section => Factory.attributes_for( :section ) - end - - it "should create new section" do - Section.count.should == 2 + expect { post :create, section: attributes_for( :section ) }.to change { Section.count }.by 1 end it "should assign @section" do @@ -83,41 +78,42 @@ end it "should render new should something go wrong" do - post :create, Factory.attributes_for( :section, :name => '' ) + post :create, attributes_for( :section, name: '' ) response.should render_template( :new ) end end describe "PUT update" do - before :each do - put :update, :id => @section, :section => { :name => 'batman' } - end + before { section.should be_persisted } - it "should assign @section" do - assigns( :section ).should be_kind_of( Section ) - end + context :update_successful do + before { put :update, id: section, section: { name: 'batman' } } - it "should update @section" do - assigns( :section ).should == @section - end + it "should assign @section" do + assigns( :section ).should be_kind_of( Section ) + end - it "should redirect to index" do - response.should redirect_to( dashboard_sections_path ) + it "should update @section" do + assigns( :section ).should eql( section ) + end + + it "should redirect to index" do + response.should redirect_to( dashboard_sections_path ) + end end - it "should render edit should something go wrong" do - put :update, :id => @section, :section => { :name => '' } - response.should render_template( :edit ) + + context :update_fails do + it "should render edit should something go wrong" do + put :update, id: section, section: { name: '' } + response.should render_template( :edit ) + end end end describe "DELETE destroy" do before :each do - delete :destroy, :id => @section - end - - it "should destroy section" do - Section.count.should == 0 + expect { delete :destroy, id: section }.to change { Section.count }.by -1 end it "should redirect to index" do @@ -131,23 +127,23 @@ it "should redirect to login when using GET" do actions = %w/index new edit/ actions.each do |action| - get action, :id => @section + get action, id: section response.should redirect_to( new_user_session_path ) end end it "should redirect to login when using POST" do - post :create, :setting => Factory.attributes_for( :section ) + post :create, setting: attributes_for( :section ) response.should redirect_to( new_user_session_path ) end it "should redirect to login when using PUT" do - put :update, :id => @section, :section => { :name => 'batman' } + put :update, id: section, section: { name: 'batman' } response.should redirect_to( new_user_session_path ) end it "should redirect to login when using DELETE" do - delete :destroy, :id => @section + delete :destroy, id: section response.should redirect_to( new_user_session_path ) end end diff --git a/spec/controllers/dashboard/settings_controller_spec.rb b/spec/controllers/dashboard/settings_controller_spec.rb index 62bf879..7094c7f 100644 --- a/spec/controllers/dashboard/settings_controller_spec.rb +++ b/spec/controllers/dashboard/settings_controller_spec.rb @@ -1,15 +1,11 @@ require 'spec_helper' describe Dashboard::SettingsController do - before :each do - @user = Factory.create :user - @setting = Factory.create :setting, :name => 'test_setting', :value => 'true' - end + let( :user ) { create :user } + let( :setting ) { create :setting, name: 'test_setting', value: 'true' } describe "when user is logged in" do - before :each do - login_as @user - end + before { sign_in user } describe "GET index" do before :each do @@ -21,7 +17,7 @@ end it "should assign @settings" do - assigns( :settings ).should == [ @setting ] + assigns( :settings ).should include( setting ) end it "should render index" do @@ -49,7 +45,7 @@ describe "GET edit" do before :each do - get :edit, :id => @setting + get :edit, id: setting end it "should be successful" do @@ -67,11 +63,7 @@ describe "POST create" do before :each do - post :create, :setting => Factory.attributes_for( :setting ) - end - - it "should create setting" do - Setting.count.should == 2 + expect { post :create, setting: attributes_for( :setting ) }.to change { Setting.count }.by 1 end it "should assign @setting" do @@ -83,18 +75,18 @@ end it "should render new should anything go wrong" do - post :create, :setting => Factory.attributes_for( :setting, :name => '' ) + post :create, setting: attributes_for( :setting, name: nil ) response.should render_template( :new ) end end describe "PUT update" do before :each do - put :update, :id => @setting, :setting => { :name => 'batman' } + put :update, id: setting, setting: { name: 'batman' } end it "should update setting" do - assigns( :setting ).should == @setting.reload + assigns( :setting ).should eql( setting.reload ) end it "should assign @setting" do @@ -106,18 +98,16 @@ end it "should render edit should anything go wrong" do - put :update, :id => @setting, :setting => { :name => '' } + put :update, id: setting, setting: { name: nil } response.should render_template( :edit ) end end describe "DELETE destroy" do - before :each do - delete :destroy, :id => @setting - end + before { delete :destroy, id: setting } it "should destroy setting" do - Setting.count.should == 0 + Setting.count.should eql( 0 ) end it "should redirect to index" do @@ -125,13 +115,10 @@ end it "should not destroy if setting is not destroyable" do - setting = Factory.create :setting setting.destroyable = false setting.save! - delete :destroy, :id => setting - Setting.count.should == 1 - Setting.first.should == setting + expect { delete :destroy, id: setting }.to_not change { Setting.count } end end end @@ -141,23 +128,23 @@ it "should redirect to login when using GET" do actions = %w/index new edit/ actions.each do |action| - get action, :id => @setting + get action, id: setting response.should redirect_to( new_user_session_path ) end end it "should redirect to login when using POST" do - post :create, :setting => Factory.attributes_for( :setting ) + post :create, setting: attributes_for( :setting ) response.should redirect_to( new_user_session_path ) end it "should redirect to login when using PUT" do - put :update, :id => @setting, :setting => { :name => 'batman' } + put :update, id: setting, setting: { name: 'batman' } response.should redirect_to( new_user_session_path ) end it "should redirect to login when using DELETE" do - delete :destroy, :id => @setting + delete :destroy, id: setting response.should redirect_to( new_user_session_path ) end end diff --git a/spec/controllers/dashboard/users_controller_spec.rb b/spec/controllers/dashboard/users_controller_spec.rb index 022448d..61fed5d 100644 --- a/spec/controllers/dashboard/users_controller_spec.rb +++ b/spec/controllers/dashboard/users_controller_spec.rb @@ -1,14 +1,10 @@ require 'spec_helper' describe Dashboard::UsersController do - before :each do - @user = Factory.create :user - end + let( :user ) { create :user } describe "when user is logged in" do - before :each do - login_as @user - end + before { sign_in user } describe "GET index" do before :each do @@ -20,7 +16,7 @@ end it "should assign @users" do - assigns( :users ).should == [ @user ] + assigns( :users ).should include( user ) end it "should render index" do @@ -30,11 +26,7 @@ describe "DELETE destroy" do before :each do - delete :destroy, :id => @user - end - - it "should delete user" do - User.count.should == 0 + expect { delete :destroy, id: user }.to change { User.count }.by -1 end it "should redirect to index" do @@ -51,7 +43,7 @@ end it "should redirect to login when using DELETE" do - delete :destroy, :id => @user + delete :destroy, id: user response.should redirect_to( new_user_session_path ) end end diff --git a/spec/controllers/pages_controller_spec.rb b/spec/controllers/pages_controller_spec.rb index e870843..56a02b8 100644 --- a/spec/controllers/pages_controller_spec.rb +++ b/spec/controllers/pages_controller_spec.rb @@ -1,22 +1,26 @@ require 'spec_helper' describe PagesController do - before :each do - @page = Factory.create :page, :home_page => true - get :show, :page => @page.slug, :section => @page.section.slug - end + let( :page ) { create :page, home_page: true } - it "response should be sucessful" do - response.should be_success - end + context 'render page' do + before( :each ) do + page.should be_persisted + get :show, page: page.slug, section: page.section.slug + end - it "should render show" do - response.should render_template( :show ) - end + it "response should be sucessful" do + response.should be_success + end + + it "should render show" do + response.should render_template( :show ) + end - it "should render show for homepage" do - get :home - response.should be_success - response.should render_template( :show ) + it "should render show for homepage" do + get :home + response.should be_success + response.should render_template( :show ) + end end end diff --git a/spec/factories.rb b/spec/factories.rb index 43e3050..50b57b5 100644 --- a/spec/factories.rb +++ b/spec/factories.rb @@ -9,7 +9,7 @@ factory :user do username 'user' - email { Factory.next :email } + email { generate :email } password 'password' password_confirmation 'password' end @@ -22,7 +22,7 @@ end factory :section do - name { Factory.next :name } + name { generate :name } end factory :setting do diff --git a/spec/models/page_spec.rb b/spec/models/page_spec.rb index 3b7930c..9a0964d 100644 --- a/spec/models/page_spec.rb +++ b/spec/models/page_spec.rb @@ -1,38 +1,29 @@ require 'spec_helper' describe Page do - before :each do - @page = Factory.create :page - end + let( :page ) { create :page } describe "name" do it "must be present" do - @page.name = nil - @page.should be_invalid + page.name = nil + page.should be_invalid end it "must be unique" do - page = Factory.build :page - page.should be_invalid + new_page = build :page, name: page.name + new_page.should be_invalid end end describe "slug" do it "must be autogenerated" do - @page.slug.should be_present + page.save! + page.slug.should be_present end end it "should belong to one section" do - page = Page.new :name => 'test_name', :content => 'Test content' + page = build :page, name: 'test_name', content: 'Test content', section: nil page.should be_invalid - - @page.section.should be_present - end - - it "should accept keywords" do - @page.keyword_list = 'this, are, some, keywords' - @page.should be_valid - @page.save.should == true end end diff --git a/spec/models/section_spec.rb b/spec/models/section_spec.rb index 82fa3de..8889668 100644 --- a/spec/models/section_spec.rb +++ b/spec/models/section_spec.rb @@ -1,26 +1,117 @@ require 'spec_helper' describe Section do - before :each do - @section = Factory :section, :name => "test" - end + let( :section ) { create :section, name: 'test' } + let( :subsection ) { create :section, main_section: section } + describe "name" do it "should be present" do - new_section = Section.new + new_section = build :section, name: nil new_section.should be_invalid end it "should be unique" do - section = Factory.build :section, :name => "test" - section.should be_invalid + section.should be_persisted - section.name = 'new_name' - section.should be_valid + new_section = build :section, name: section.name + new_section.should be_invalid end end it "should have an slug after created" do - @section.slug.should be_present + section.slug.should be_present + end + + describe :section_collection do + before { section.should be_persisted } + + context :new_record do + it 'should show fetch all sections' do + new_section = build :section + new_section.section_collection.should include( [ section.name, section.id ] ) + new_section.section_collection.should eql( Section.section_collection ) + end + end + + context :exting_record do + it 'should not fetch self' do + section.section_collection.should_not include( [ section.name, section.id ] ) + section.section_collection.should eql( [] ) + end + end + end + + describe :with_children do + context :section_page do + let( :section_page ) { create :page, section: section } + + before( :each ) do + section.should be_persisted + section_page.should be_persisted + end + + it 'should fetch section and page' do + new_section, new_subsection, page = *Section.with_children( section: section.slug, page: section_page.slug ) + + new_section.should be_present + new_section.should be_kind_of( Section ) + + new_subsection.should be_blank + + page.should be_present + page.should be_kind_of( Page ) + end + + it 'should only fetch section if page name is wrong' do + new_section, new_subsection, page = *Section.with_children( section: section.slug, page: "#{ section_page.slug }-wrong" ) + + new_section.should be_present + new_subsection.should be_blank + page.should be_blank + end + + it 'should not fetch anything if section name is wrong' do + new_section, new_subsection, page = *Section.with_children( section: "#{ section.slug }-wrong", page: section_page.slug ) + + new_section.should be_blank + new_subsection.should be_blank + page.should be_blank + end + end + + context :subsection_page do + let( :section_page ) { create :page, section: subsection } + + before( :each ) do + section.should be_persisted + subsection.should be_persisted + section_page.should be_persisted + end + + it 'it should fetch section, subsection and page' do + new_section, new_subsection, page = *Section.with_children( section: section.slug, subsection: subsection.slug, page: section_page.slug ) + + new_section.should be_present + new_subsection.should be_present + page.should be_present + end + + it 'should not fetch anything if section name is wrong' do + new_section, new_subsection, page = *Section.with_children( section: "#{ section.slug }-wrong", subsection: subsection.slug, page: section_page.slug ) + + new_section.should be_blank + new_subsection.should be_blank + page.should be_blank + end + + it 'should not fetch page if subsection name is wrong' do + new_section, new_subsection, page = *Section.with_children( section: section.slug, subsection: "#{ subsection.slug }-wrong", page: section_page.slug ) + + new_section.should be_present + new_subsection.should be_blank + page.should be_blank + end + end end end diff --git a/spec/models/setting_spec.rb b/spec/models/setting_spec.rb index e275d8b..3ad87ce 100644 --- a/spec/models/setting_spec.rb +++ b/spec/models/setting_spec.rb @@ -1,35 +1,31 @@ require 'spec_helper' describe Setting do - before :each do - @theme = Factory.create :setting, :name => 'theme', :value => 'clover', :destroyable => false - end + let( :theme ) { create :setting, name: 'theme', value: 'clover', destroyable: false } describe "name" do it "must be present" do - setting = Factory.build :setting, :name => '' + setting = build :setting, name: nil setting.should be_invalid end it "must be unique" do - setting = Factory.build :setting, :name => 'theme' + theme.should be_persisted + + setting = build :setting, name: 'theme' setting.should be_invalid end it "shold be properly formatted" do - setting = Factory.build :setting, :name => 'badly formatted name ' + setting = build :setting, name: 'badly formatted name ' setting.should be_invalid end end describe "value" do it "must be present" do - setting = Factory.build :setting, :value => '' + setting = build :setting, value: '' setting.should be_invalid end end - - it "should not delete non destroyable settings" do - @theme.delete.should be_false - end end diff --git a/spec/models/user_spec.rb b/spec/models/user_spec.rb index 8454e71..b79ab09 100644 --- a/spec/models/user_spec.rb +++ b/spec/models/user_spec.rb @@ -1,33 +1,34 @@ require 'spec_helper' describe User do - before :each do - @user = Factory.create :user - end + let( :user ) { create :user } describe "email" do it "must be unique" do - user = Factory.build :user, :email => @user.email - user.should be_invalid + user.should be_persisted + + new_user = build :user, email: user.email + new_user.should be_invalid end it "must have proper format" do - user = Factory.build :user + new_user = build :user + %w/invalid_email in@va@lid invalit@..@/.each do |invalid_email| - user.email = invalid_email - user.should be_invalid + new_user.email = invalid_email + new_user.should be_invalid end end end describe "username" do it "must be present" do - user = Factory.build :user, :username => '' + user = build :user, username: nil user.should be_invalid end it "must be properly formatted" do - user = Factory.build :user, :username => '' + user = build :user, username: nil %w/&*)@user tes!@@k ASc&#))/.each do |invalid_username| user.username = invalid_username diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 0d1b441..81760ce 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -1,14 +1,39 @@ # This file is copied to spec/ when you run 'rails generate rspec:install' -ENV["RAILS_ENV"] ||= 'test' +ENV["RAILS_ENV"] = 'test' + +require 'simplecov' +SimpleCov.start 'rails' + require File.expand_path("../../config/environment", __FILE__) require 'rspec/rails' -require 'mocha' +require 'rspec/autorun' +require 'capybara/rspec' + +Capybara.javascript_driver = :webkit # Requires supporting ruby files with custom matchers and macros, etc, # in spec/support/ and its subdirectories. Dir[Rails.root.join("spec/support/**/*.rb")].each {|f| require f} RSpec.configure do |config| - config.mock_with :mocha config.use_transactional_fixtures = true + + config.before( :suite ) do + DatabaseCleaner.strategy = :truncation + DatabaseCleaner.clean_with :truncation + end + + config.before( :each ) do + DatabaseCleaner.start + end + + config.after( :each ) do + DatabaseCleaner.clean + end + + config.infer_base_class_for_anonymous_controllers = false + config.order = "random" + + config.include FactoryGirl::Syntax::Methods + config.include Devise::TestHelpers, type: :controller end diff --git a/spec/support/controller_spec_helper.rb b/spec/support/controller_spec_helper.rb deleted file mode 100644 index dbaf678..0000000 --- a/spec/support/controller_spec_helper.rb +++ /dev/null @@ -1,10 +0,0 @@ -module ControllerSpecHelpers - def login_as( user ) - @controller.class.any_instance.stubs( :current_user ).returns user - @controller.class.any_instance.stubs( :authenticate_user! ).returns true - end -end - -RSpec.configure do |config| - config.include ControllerSpecHelpers, :type => :controller -end diff --git a/spec/support/devise.rb b/spec/support/devise.rb deleted file mode 100644 index 3552bea..0000000 --- a/spec/support/devise.rb +++ /dev/null @@ -1,3 +0,0 @@ -RSpec.configure do |config| - config.include Devise::TestHelpers, :type => :controller -end diff --git a/vendor/assets/javascripts/uploadify/swfobject.js b/vendor/assets/javascripts/uploadify/swfobject.js deleted file mode 100755 index 8eafe9d..0000000 --- a/vendor/assets/javascripts/uploadify/swfobject.js +++ /dev/null @@ -1,4 +0,0 @@ -/* SWFObject v2.2 - is released under the MIT License -*/ -var swfobject=function(){var D="undefined",r="object",S="Shockwave Flash",W="ShockwaveFlash.ShockwaveFlash",q="application/x-shockwave-flash",R="SWFObjectExprInst",x="onreadystatechange",O=window,j=document,t=navigator,T=false,U=[h],o=[],N=[],I=[],l,Q,E,B,J=false,a=false,n,G,m=true,M=function(){var aa=typeof j.getElementById!=D&&typeof j.getElementsByTagName!=D&&typeof j.createElement!=D,ah=t.userAgent.toLowerCase(),Y=t.platform.toLowerCase(),ae=Y?/win/.test(Y):/win/.test(ah),ac=Y?/mac/.test(Y):/mac/.test(ah),af=/webkit/.test(ah)?parseFloat(ah.replace(/^.*webkit\/(\d+(\.\d+)?).*$/,"$1")):false,X=!+"\v1",ag=[0,0,0],ab=null;if(typeof t.plugins!=D&&typeof t.plugins[S]==r){ab=t.plugins[S].description;if(ab&&!(typeof t.mimeTypes!=D&&t.mimeTypes[q]&&!t.mimeTypes[q].enabledPlugin)){T=true;X=false;ab=ab.replace(/^.*\s+(\S+\s+\S+$)/,"$1");ag[0]=parseInt(ab.replace(/^(.*)\..*$/,"$1"),10);ag[1]=parseInt(ab.replace(/^.*\.(.*)\s.*$/,"$1"),10);ag[2]=/[a-zA-Z]/.test(ab)?parseInt(ab.replace(/^.*[a-zA-Z]+(.*)$/,"$1"),10):0}}else{if(typeof O.ActiveXObject!=D){try{var ad=new ActiveXObject(W);if(ad){ab=ad.GetVariable("$version");if(ab){X=true;ab=ab.split(" ")[1].split(",");ag=[parseInt(ab[0],10),parseInt(ab[1],10),parseInt(ab[2],10)]}}}catch(Z){}}}return{w3:aa,pv:ag,wk:af,ie:X,win:ae,mac:ac}}(),k=function(){if(!M.w3){return}if((typeof j.readyState!=D&&j.readyState=="complete")||(typeof j.readyState==D&&(j.getElementsByTagName("body")[0]||j.body))){f()}if(!J){if(typeof j.addEventListener!=D){j.addEventListener("DOMContentLoaded",f,false)}if(M.ie&&M.win){j.attachEvent(x,function(){if(j.readyState=="complete"){j.detachEvent(x,arguments.callee);f()}});if(O==top){(function(){if(J){return}try{j.documentElement.doScroll("left")}catch(X){setTimeout(arguments.callee,0);return}f()})()}}if(M.wk){(function(){if(J){return}if(!/loaded|complete/.test(j.readyState)){setTimeout(arguments.callee,0);return}f()})()}s(f)}}();function f(){if(J){return}try{var Z=j.getElementsByTagName("body")[0].appendChild(C("span"));Z.parentNode.removeChild(Z)}catch(aa){return}J=true;var X=U.length;for(var Y=0;Y0){for(var af=0;af0){var ae=c(Y);if(ae){if(F(o[af].swfVersion)&&!(M.wk&&M.wk<312)){w(Y,true);if(ab){aa.success=true;aa.ref=z(Y);ab(aa)}}else{if(o[af].expressInstall&&A()){var ai={};ai.data=o[af].expressInstall;ai.width=ae.getAttribute("width")||"0";ai.height=ae.getAttribute("height")||"0";if(ae.getAttribute("class")){ai.styleclass=ae.getAttribute("class")}if(ae.getAttribute("align")){ai.align=ae.getAttribute("align")}var ah={};var X=ae.getElementsByTagName("param");var ac=X.length;for(var ad=0;ad'}}aa.outerHTML='"+af+"";N[N.length]=ai.id;X=c(ai.id)}else{var Z=C(r);Z.setAttribute("type",q);for(var ac in ai){if(ai[ac]!=Object.prototype[ac]){if(ac.toLowerCase()=="styleclass"){Z.setAttribute("class",ai[ac])}else{if(ac.toLowerCase()!="classid"){Z.setAttribute(ac,ai[ac])}}}}for(var ab in ag){if(ag[ab]!=Object.prototype[ab]&&ab.toLowerCase()!="movie"){e(Z,ab,ag[ab])}}aa.parentNode.replaceChild(Z,aa);X=Z}}return X}function e(Z,X,Y){var aa=C("param");aa.setAttribute("name",X);aa.setAttribute("value",Y);Z.appendChild(aa)}function y(Y){var X=c(Y);if(X&&X.nodeName=="OBJECT"){if(M.ie&&M.win){X.style.display="none";(function(){if(X.readyState==4){b(Y)}else{setTimeout(arguments.callee,10)}})()}else{X.parentNode.removeChild(X)}}}function b(Z){var Y=c(Z);if(Y){for(var X in Y){if(typeof Y[X]=="function"){Y[X]=null}}Y.parentNode.removeChild(Y)}}function c(Z){var X=null;try{X=j.getElementById(Z)}catch(Y){}return X}function C(X){return j.createElement(X)}function i(Z,X,Y){Z.attachEvent(X,Y);I[I.length]=[Z,X,Y]}function F(Z){var Y=M.pv,X=Z.split(".");X[0]=parseInt(X[0],10);X[1]=parseInt(X[1],10)||0;X[2]=parseInt(X[2],10)||0;return(Y[0]>X[0]||(Y[0]==X[0]&&Y[1]>X[1])||(Y[0]==X[0]&&Y[1]==X[1]&&Y[2]>=X[2]))?true:false}function v(ac,Y,ad,ab){if(M.ie&&M.mac){return}var aa=j.getElementsByTagName("head")[0];if(!aa){return}var X=(ad&&typeof ad=="string")?ad:"screen";if(ab){n=null;G=null}if(!n||G!=X){var Z=C("style");Z.setAttribute("type","text/css");Z.setAttribute("media",X);n=aa.appendChild(Z);if(M.ie&&M.win&&typeof j.styleSheets!=D&&j.styleSheets.length>0){n=j.styleSheets[j.styleSheets.length-1]}G=X}if(M.ie&&M.win){if(n&&typeof n.addRule==r){n.addRule(ac,Y)}}else{if(n&&typeof j.createTextNode!=D){n.appendChild(j.createTextNode(ac+" {"+Y+"}"))}}}function w(Z,X){if(!m){return}var Y=X?"visible":"hidden";if(J&&c(Z)){c(Z).style.visibility=Y}else{v("#"+Z,"visibility:"+Y)}}function L(Y){var Z=/[\\\"<>\.;]/;var X=Z.exec(Y)!=null;return X&&typeof encodeURIComponent!=D?encodeURIComponent(Y):Y}var d=function(){if(M.ie&&M.win){window.attachEvent("onunload",function(){var ac=I.length;for(var ab=0;ab');swfobject.embedSWF(f.uploader,f.id+"Uploader",f.width,f.height,"9.0.24",f.expressInstall,g,{quality:"high",wmode:f.wmode,allowScriptAccess:f.scriptAccess},{},function(i){if(typeof(f.onSWFReady)=="function"&&i.success){f.onSWFReady()}});if(f.queueID==false){a("#"+a(this).attr("id")+"Uploader").after('
')}else{a("#"+f.queueID).addClass("uploadifyQueue")}}if(typeof(f.onOpen)=="function"){a(this).bind("uploadifyOpen",f.onOpen)}a(this).bind("uploadifySelect",{action:f.onSelect,queueID:f.queueID},function(k,i,j){if(k.data.action(k,i,j)!==false){var l=Math.round(j.size/1024*100)*0.01;var m="KB";if(l>1000){l=Math.round(l*0.001*100)*0.01;m="MB"}var n=l.toString().split(".");if(n.length>1){l=n[0]+"."+n[1].substr(0,2)}else{l=n[0]}if(j.name.length>20){fileName=j.name.substr(0,20)+"..."}else{fileName=j.name}queue="#"+a(this).attr("id")+"Queue";if(k.data.queueID){queue="#"+k.data.queueID}a(queue).append('
'+fileName+" ("+l+m+')
')}});a(this).bind("uploadifySelectOnce",{action:f.onSelectOnce},function(i,j){i.data.action(i,j);if(f.auto){if(f.checkScript){a(this).uploadifyUpload(null,false)}else{a(this).uploadifyUpload(null,true)}}});a(this).bind("uploadifyQueueFull",{action:f.onQueueFull},function(i,j){if(i.data.action(i,j)!==false){alert("The queue is full. The max size is "+j+".")}});a(this).bind("uploadifyCheckExist",{action:f.onCheck},function(n,m,l,k,p){var j=new Object();j=l;j.folder=(k.substr(0,1)=="/")?k:e+k;if(p){for(var i in l){var o=i}}a.post(m,j,function(s){for(var q in s){if(n.data.action(n,s,q)!==false){var r=confirm("Do you want to replace the file "+s[q]+"?");if(!r){document.getElementById(a(n.target).attr("id")+"Uploader").cancelFileUpload(q,true,true)}}}if(p){document.getElementById(a(n.target).attr("id")+"Uploader").startFileUpload(o,true)}else{document.getElementById(a(n.target).attr("id")+"Uploader").startFileUpload(null,true)}},"json")});a(this).bind("uploadifyCancel",{action:f.onCancel},function(n,j,m,o,i,l){if(n.data.action(n,j,m,o,l)!==false){if(i){var k=(l==true)?0:250;a("#"+a(this).attr("id")+j).fadeOut(k,function(){a(this).remove()})}}});a(this).bind("uploadifyClearQueue",{action:f.onClearQueue},function(k,j){var i=(f.queueID)?f.queueID:a(this).attr("id")+"Queue";if(j){a("#"+i).find(".uploadifyQueueItem").remove()}if(k.data.action(k,j)!==false){a("#"+i).find(".uploadifyQueueItem").each(function(){var l=a(".uploadifyQueueItem").index(this);a(this).delay(l*100).fadeOut(250,function(){a(this).remove()})})}});var c=[];a(this).bind("uploadifyError",{action:f.onError},function(m,i,l,k){if(m.data.action(m,i,l,k)!==false){var j=new Array(i,l,k);c.push(j);a("#"+a(this).attr("id")+i).find(".percentage").text(" - "+k.type+" Error");a("#"+a(this).attr("id")+i).find(".uploadifyProgress").hide();a("#"+a(this).attr("id")+i).addClass("uploadifyError")}});if(typeof(f.onUpload)=="function"){a(this).bind("uploadifyUpload",f.onUpload)}a(this).bind("uploadifyProgress",{action:f.onProgress,toDisplay:f.displayData},function(k,i,j,l){if(k.data.action(k,i,j,l)!==false){a("#"+a(this).attr("id")+i+"ProgressBar").animate({width:l.percentage+"%"},250,function(){if(l.percentage==100){a(this).closest(".uploadifyProgress").fadeOut(250,function(){a(this).remove()})}});if(k.data.toDisplay=="percentage"){displayData=" - "+l.percentage+"%"}if(k.data.toDisplay=="speed"){displayData=" - "+l.speed+"KB/s"}if(k.data.toDisplay==null){displayData=" "}a("#"+a(this).attr("id")+i).find(".percentage").text(displayData)}});a(this).bind("uploadifyComplete",{action:f.onComplete},function(l,i,k,j,m){if(l.data.action(l,i,k,unescape(j),m)!==false){a("#"+a(this).attr("id")+i).find(".percentage").text(" - Completed");if(f.removeCompleted){a("#"+a(l.target).attr("id")+i).fadeOut(250,function(){a(this).remove()})}a("#"+a(l.target).attr("id")+i).addClass("completed")}});if(typeof(f.onAllComplete)=="function"){a(this).bind("uploadifyAllComplete",{action:f.onAllComplete},function(i,j){if(i.data.action(i,j)!==false){c=[]}})}})},uploadifySettings:function(f,j,c){var g=false;a(this).each(function(){if(f=="scriptData"&&j!=null){if(c){var i=j}else{var i=a.extend(a(this).data("settings").scriptData,j)}var l="";for(var k in i){l+="&"+k+"="+i[k]}j=escape(l.substr(1))}g=document.getElementById(a(this).attr("id")+"Uploader").updateSettings(f,j)});if(j==null){if(f=="scriptData"){var b=unescape(g).split("&");var e=new Object();for(var d=0;d - - - -WYMeditor iframe - - - - - diff --git a/vendor/assets/javascripts/wymeditor/jquery.wymeditor.min.js b/vendor/assets/javascripts/wymeditor/jquery.wymeditor.min.js deleted file mode 100644 index 1748335..0000000 --- a/vendor/assets/javascripts/wymeditor/jquery.wymeditor.min.js +++ /dev/null @@ -1,33 +0,0 @@ -/*jslint evil: true, indent: 4 *//** - WYMeditor - ========= - - version 1.0.0a2 - - WYMeditor : what you see is What You Mean web-based editor - - Main JS file with core classes and functions. - - Copyright - --------- - - Copyright (c) 2005 - 2010 Jean-Francois Hovinne, http://www.wymeditor.org/ - Dual licensed under the MIT (MIT-license.txt) - and GPL (GPL-license.txt) licenses. - - Website - ------- - - For further information visit: - http://www.wymeditor.org/ - - - Authors - ------- - - See AUTHORS file -*/// Global WYMeditor namespace. -typeof WYMeditor=="undefined"&&(WYMeditor={}),function(){if(!window.console||!window.console.firebug){var a=["log","debug","info","warn","error","assert","dir","dirxml","group","groupEnd","time","timeEnd","count","trace","profile","profileEnd"],b=function(){},c;WYMeditor.console={};for(c=0;c"+"
"+WYMeditor.TOOLS+"
"+"
"+"
"+WYMeditor.CONTAINERS+WYMeditor.CLASSES+"
"+"
"+WYMeditor.HTML+WYMeditor.IFRAME+WYMeditor.STATUS+"
"+"
"+WYMeditor.LOGO+"
"+"",logoHtml:String()+'WYMeditor',iframeHtml:String()+'
'+'"+"
",editorStyles:[],toolsHtml:String()+'
'+"

{Tools}

"+"
    "+WYMeditor.TOOLS_ITEMS+"
"+"
",toolsItemHtml:String()+'
  • '+''+WYMeditor.TOOL_TITLE+""+"
  • ",toolsItems:[{name:"Bold",title:"Strong",css:"wym_tools_strong"},{name:"Italic",title:"Emphasis",css:"wym_tools_emphasis"},{name:"Superscript",title:"Superscript",css:"wym_tools_superscript"},{name:"Subscript",title:"Subscript",css:"wym_tools_subscript"},{name:"InsertOrderedList",title:"Ordered_List",css:"wym_tools_ordered_list"},{name:"InsertUnorderedList",title:"Unordered_List",css:"wym_tools_unordered_list"},{name:"Indent",title:"Indent",css:"wym_tools_indent"},{name:"Outdent",title:"Outdent",css:"wym_tools_outdent"},{name:"Undo",title:"Undo",css:"wym_tools_undo"},{name:"Redo",title:"Redo",css:"wym_tools_redo"},{name:"CreateLink",title:"Link",css:"wym_tools_link"},{name:"Unlink",title:"Unlink",css:"wym_tools_unlink"},{name:"InsertImage",title:"Image",css:"wym_tools_image"},{name:"InsertTable",title:"Table",css:"wym_tools_table"},{name:"Paste",title:"Paste_From_Word",css:"wym_tools_paste"},{name:"ToggleHtml",title:"HTML",css:"wym_tools_html"},{name:"Preview",title:"Preview",css:"wym_tools_preview"}],containersHtml:String()+'
    '+"

    {Containers}

    "+"
      "+WYMeditor.CONTAINERS_ITEMS+"
    "+"
    ",containersItemHtml:String()+'
  • '+''+WYMeditor.CONTAINER_TITLE+""+"
  • ",containersItems:[{name:"P",title:"Paragraph",css:"wym_containers_p"},{name:"H1",title:"Heading_1",css:"wym_containers_h1"},{name:"H2",title:"Heading_2",css:"wym_containers_h2"},{name:"H3",title:"Heading_3",css:"wym_containers_h3"},{name:"H4",title:"Heading_4",css:"wym_containers_h4"},{name:"H5",title:"Heading_5",css:"wym_containers_h5"},{name:"H6",title:"Heading_6",css:"wym_containers_h6"},{name:"PRE",title:"Preformatted",css:"wym_containers_pre"},{name:"BLOCKQUOTE",title:"Blockquote",css:"wym_containers_blockquote"},{name:"TH",title:"Table_Header",css:"wym_containers_th"}],classesHtml:String()+'
    '+"

    {Classes}

    "+"
      "+WYMeditor.CLASSES_ITEMS+"
    "+"
    ",classesItemHtml:String()+'
  • '+''+WYMeditor.CLASS_TITLE+""+"
  • ",classesItems:[],statusHtml:String()+'
    '+"

    {Status}

    "+"
    ",htmlHtml:String()+'
    '+"

    {Source_Code}

    "+''+"
    ",boxSelector:".wym_box",toolsSelector:".wym_tools",toolsListSelector:" ul",containersSelector:".wym_containers",classesSelector:".wym_classes",htmlSelector:".wym_html",iframeSelector:".wym_iframe iframe",iframeBodySelector:".wym_iframe",statusSelector:".wym_status",toolSelector:".wym_tools a",containerSelector:".wym_containers a",classSelector:".wym_classes a",htmlValSelector:".wym_html_val",hrefSelector:".wym_href",srcSelector:".wym_src",titleSelector:".wym_title",relSelector:".wym_rel",altSelector:".wym_alt",textSelector:".wym_text",rowsSelector:".wym_rows",colsSelector:".wym_cols",captionSelector:".wym_caption",summarySelector:".wym_summary",submitSelector:"form",cancelSelector:".wym_cancel",previewSelector:"",dialogTypeSelector:".wym_dialog_type",dialogLinkSelector:".wym_dialog_link",dialogImageSelector:".wym_dialog_image",dialogTableSelector:".wym_dialog_table",dialogPasteSelector:".wym_dialog_paste",dialogPreviewSelector:".wym_dialog_preview",updateSelector:".wymupdate",updateEvent:"click",dialogFeatures:"menubar=no,titlebar=no,toolbar=no,resizable=no,width=560,height=300,top=0,left=0",dialogFeaturesPreview:"menubar=no,titlebar=no,toolbar=no,resizable=no,scrollbars=yes,width=560,height=300,top=0,left=0",dialogHtml:String()+''+''+""+''+""+WYMeditor.DIALOG_TITLE+""+''+''+""+WYMeditor.DIALOG_BODY+"",dialogLinkHtml:String()+''+"
    "+"
    "+''+"{Link}"+'
    '+""+''+"
    "+'
    '+""+''+"
    "+'
    '+""+''+"
    "+'
    '+''+''+"
    "+"
    "+"
    "+"",dialogImageHtml:String()+''+"
    "+"
    "+''+"{Image}"+'
    '+""+''+"
    "+'
    '+""+''+"
    "+'
    '+""+''+"
    "+'
    '+''+''+"
    "+"
    "+"
    "+"",dialogTableHtml:String()+''+"
    "+"
    "+''+"{Table}"+'
    '+""+''+"
    "+'
    '+""+''+"
    "+'
    '+""+''+"
    "+'
    '+""+''+"
    "+'
    '+''+''+"
    "+"
    "+"
    "+"",dialogPasteHtml:String()+''+"
    "+''+"
    "+"{Paste_From_Word}"+'
    '+''+"
    "+'
    '+''+''+"
    "+"
    "+"
    "+"",dialogPreviewHtml:String()+'',dialogStyles:[],stringDelimiterLeft:"{",stringDelimiterRight:"}",preInit:null,preBind:null,postInit:null,preInitDialog:null,postInitDialog:null},a),this.each(function(){var b=new WYMeditor.editor(jQuery(this),a)})},jQuery.extend({wymeditors:function(a){return WYMeditor.INSTANCES[a]}}),WYMeditor.computeWymPath=function(){var a=jQuery(jQuery.grep(jQuery("script"),function(a){return a.src?a.src.match(/jquery\.wymeditor(\.pack|\.min|\.packed)?\.js(\?.*)?$/)||a.src.match(/\/core\.js(\?.*)?$/):null}));return a.length>0?a.attr("src"):(WYMeditor.console.warn("Error determining wymPath. No base WYMeditor file located."),WYMeditor.console.warn("Assuming wymPath to be the current URL"),WYMeditor.console.warn("Please pass a correct wymPath option"),"")},WYMeditor.computeBasePath=function(a){var b=a.lastIndexOf("/");return a.substr(0,b+1)},WYMeditor.computeJqueryPath=function(){return jQuery(jQuery.grep(jQuery("script"),function(a){return a.src&&a.src.match(/jquery(-(.*)){0,1}(\.pack|\.min|\.packed)?\.js(\?.*)?$/)})).attr("src")},WYMeditor.INIT_DIALOG=function(index){var wym=window.opener.WYMeditor.INSTANCES[index],doc=window.document,selected=wym.selected(),dialogType=jQuery(wym._options.dialogTypeSelector).val(),sStamp=wym.uniqueStamp(),styles,aCss,tableOnClick;dialogType===WYMeditor.DIALOG_LINK&&(selected&&selected.tagName&&selected.tagName.toLowerCase!==WYMeditor.A&&(selected=jQuery(selected).parentsOrSelf(WYMeditor.A)),!selected&&wym._selected_image&&(selected=jQuery(wym._selected_image).parentsOrSelf(WYMeditor.A))),jQuery.isFunction(wym._options.preInitDialog)&&wym._options.preInitDialog(wym,window),styles=doc.styleSheets[0],aCss=eval(wym._options.dialogStyles),wym.addCssRules(doc,aCss),selected&&(jQuery(wym._options.hrefSelector).val(jQuery(selected).attr(WYMeditor.HREF)),jQuery(wym._options.srcSelector).val(jQuery(selected).attr(WYMeditor.SRC)),jQuery(wym._options.titleSelector).val(jQuery(selected).attr(WYMeditor.TITLE)),jQuery(wym._options.relSelector).val(jQuery(selected).attr(WYMeditor.REL)),jQuery(wym._options.altSelector).val(jQuery(selected).attr(WYMeditor.ALT))),wym._selected_image&&(jQuery(wym._options.dialogImageSelector+" "+wym._options.srcSelector).val(jQuery(wym._selected_image).attr(WYMeditor.SRC)),jQuery(wym._options.dialogImageSelector+" "+wym._options.titleSelector).val(jQuery(wym._selected_image).attr(WYMeditor.TITLE)),jQuery(wym._options.dialogImageSelector+" "+wym._options.altSelector).val(jQuery(wym._selected_image).attr(WYMeditor.ALT))),jQuery(wym._options.dialogLinkSelector+" "+wym._options.submitSelector).submit(function(){var a=jQuery(wym._options.hrefSelector).val(),b;a.length>0&&(selected[0]&&selected[0].tagName.toLowerCase()===WYMeditor.A?b=selected:(wym._exec(WYMeditor.CREATE_LINK,sStamp),b=jQuery("a[href="+sStamp+"]",wym._doc.body)),b.attr(WYMeditor.HREF,a),b.attr(WYMeditor.TITLE,jQuery(wym._options.titleSelector).val()),b.attr(WYMeditor.REL,jQuery(wym._options.relSelector).val())),window.close()}),jQuery(wym._options.dialogImageSelector+" "+wym._options.submitSelector).submit(function(){var a=jQuery(wym._options.srcSelector).val(),b;a.length>0&&(wym._exec(WYMeditor.INSERT_IMAGE,sStamp),b=jQuery("img[src$="+sStamp+"]",wym._doc.body),b.attr(WYMeditor.SRC,a),b.attr(WYMeditor.TITLE,jQuery(wym._options.titleSelector).val()),b.attr(WYMeditor.ALT,jQuery(wym._options.altSelector).val())),window.close()}),tableOnClick=WYMeditor.MAKE_TABLE_ONCLICK(wym),jQuery(wym._options.dialogTableSelector+" "+wym._options.submitSelector).submit(tableOnClick),jQuery(wym._options.dialogPasteSelector+" "+wym._options.submitSelector).submit(function(){var a=jQuery(wym._options.textSelector).val();wym.paste(a),window.close()}),jQuery(wym._options.dialogPreviewSelector+" "+wym._options.previewSelector).html(wym.xhtml()),jQuery(wym._options.cancelSelector).mousedown(function(){window.close()}),jQuery.isFunction(wym._options.postInitDialog)&&wym._options.postInitDialog(wym,window)},WYMeditor.MAKE_TABLE_ONCLICK=function(a){var b=function(){var b=jQuery(a._options.rowsSelector).val(),c=jQuery(a._options.colsSelector).val(),d=jQuery(a._options.captionSelector).val(),e=jQuery(a._options.summarySelector).val(),f=a.insertTable(b,c,d,e);window.close()};return b},jQuery.fn.isPhantomNode=function(){return this[0].nodeType===3?!/[^\t\n\r ]/.test(this[0].data):!1},WYMeditor.isPhantomNode=function(a){return a.nodeType===3?!/[^\t\n\r ]/.test(a.data):!1},WYMeditor.isPhantomString=function(a){return!/[^\t\n\r ]/.test(a)},jQuery.fn.parentsOrSelf=function(a){var b=this;return b[0].nodeType===3&&(b=b.parents().slice(0,1)),b.filter(a).size()===1?b:b.parents(a).slice(0,1)},WYMeditor.Helper={replaceAll:function(a,b,c){var d=new RegExp(b,"g");return a.replace(d,c)},insertAt:function(a,b,c){return a.substr(0,c)+b+a.substring(c)},trim:function(a){return a.replace(/^(\s*)|(\s*)$/gm,"")},contains:function(a,b){var c;for(c=0;c["+a.childNodes.length+"]":a.nodeName:"[No node]"}function j(a){this._next=this.root=a}function k(a,b){this.node=a,this.offset=b}function l(a){this.code=this[a],this.codeName=a,this.message="DOMException: "+this.codeName}var m=a.util;m.areHostMethods(document,["createDocumentFragment","createElement","createTextNode"])||b.fail("document missing a Node creation method"),m.isHostMethod(document,"getElementsByTagName")||b.fail("document missing getElementsByTagName method");var n=document.createElement("div");m.areHostMethods(n,["insertBefore","appendChild","cloneNode"])||b.fail("Incomplete Element implementation"),n=document.createTextNode("test"),m.areHostMethods(n,["splitText","deleteData","insertData","appendData","cloneNode"])||b.fail("Incomplete Text Node implementation");var o=function(a,b){for(var c=a.length;c--;)if(a[c]===b)return!0;return!1};j.prototype={_current:null,hasNext:function(){return!!this._next},next:function(){var a=this._current=this._next,b;if(this._current)if(b=a.firstChild)this._next=b;else{for(b=null;a!==this.root&&!(b=a.nextSibling);)a=a.parentNode;this._next=b}return this._current},detach:function(){this._current=this._next=this.root=null}},k.prototype={equals:function(a){return this.node===a.node&this.offset==a.offset},inspect:function(){return"[DomPosition("+i(this.node)+":"+this.offset+")]"}},l.prototype={INDEX_SIZE_ERR:1,HIERARCHY_REQUEST_ERR:3,WRONG_DOCUMENT_ERR:4,NO_MODIFICATION_ALLOWED_ERR:7,NOT_FOUND_ERR:8,NOT_SUPPORTED_ERR:9,INVALID_STATE_ERR:11},l.prototype.toString=function(){return this.message},a.dom={arrayContains:o,getNodeIndex:c,getCommonAncestor:d,isAncestorOf:function(a,b,c){for(b=c?b:b.parentNode;b;){if(b===a)return!0;b=b.parentNode}return!1},getClosestAncestorIn:e,isCharacterDataNode:f,insertAfter:g,splitDataNode:function(a,b){var c;return a.nodeType==3?c=a.splitText(b):(c=a.cloneNode(),c.deleteData(0,b),a.deleteData(0,a.length-b),g(c,a)),c},getDocument:h,getWindow:function(a){a=h(a);if(typeof a.defaultView!="undefined")return a.defaultView;if(typeof a.parentWindow!="undefined")return a.parentWindow;throw Error("Cannot get a window object for node")},getIframeWindow:function(a){if(typeof a.contentWindow!="undefined")return a.contentWindow;if(typeof a.contentDocument!="undefined")return a.contentDocument.defaultView;throw Error("getIframeWindow: No Window object found for iframe element")},getIframeDocument:function(a){if(typeof a.contentDocument!="undefined")return a.contentDocument;if(typeof a.contentWindow!="undefined")return a.contentWindow.document;throw Error("getIframeWindow: No Document object found for iframe element")},getBody:function(a){return m.isHostObject(a,"body")?a.body:a.getElementsByTagName("body")[0]},comparePoints:function(a,b,f,g){var h;if(a==f)return b===g?0:b=b.childNodes.length?b.appendChild(a):b.insertBefore(a,b.childNodes[c]),d}function i(a){for(var b,d,e=c(a.range).createDocumentFragment();d=a.next();){b=a.isPartiallySelectedSubtree(),d=d.cloneNode(!b),b&&(b=a.getSubtreeIterator(),d.appendChild(i(b)),b.detach(!0));if(d.nodeType==10)throw new J("HIERARCHY_REQUEST_ERR");e.appendChild(d)}return e}function j(a,b,c){var d,e;for(c=c||{stop:!1};d=a.next();)if(a.isPartiallySelectedSubtree()){if(b(d)===!1){c.stop=!0;return}d=a.getSubtreeIterator(),j(d,b,c),d.detach(!0);if(c.stop)return}else for(d=H.createIterator(d);e=d.next();)if(b(e)===!1){c.stop=!0;return}}function k(a){for(var b;a.next();)a.isPartiallySelectedSubtree()?(b=a.getSubtreeIterator(),k(b),b.detach(!0)):a.remove()}function l(a){for(var b,d=c(a.range).createDocumentFragment(),e;b=a.next();){a.isPartiallySelectedSubtree()?(b=b.cloneNode(!1),e=a.getSubtreeIterator(),b.appendChild(l(e)),e.detach(!0)):a.remove();if(b.nodeType==10)throw new J("HIERARCHY_REQUEST_ERR");d.appendChild(b)}return d}function m(a,b,c){var d=!!b&&!!b.length,e,f=!!c;d&&(e=RegExp("^("+b.join("|")+")$"));var g=[];return j(new o(a,!1),function(a){(!d||e.test(a.nodeType))&&(!f||c(a))&&g.push(a)}),g}function n(a){return"["+(typeof a.getName=="undefined"?"Range":a.getName())+"("+H.inspectNode(a.startContainer)+":"+a.startOffset+", "+H.inspectNode(a.endContainer)+":"+a.endOffset+")]"}function o(a,b){this.range=a,this.clonePartiallySelectedTextNodes=b;if(!a.collapsed){this.sc=a.startContainer,this.so=a.startOffset,this.ec=a.endContainer,this.eo=a.endOffset;var c=a.commonAncestorContainer;this.sc===this.ec&&H.isCharacterDataNode(this.sc)?(this.isSingleCharacterDataNode=!0,this._first=this._last=this._next=this.sc):(this._first=this._next=this.sc===c&&!H.isCharacterDataNode(this.sc)?this.sc.childNodes[this.so]:H.getClosestAncestorIn(this.sc,c,!0),this._last=this.ec===c&&!H.isCharacterDataNode(this.ec)?this.ec.childNodes[this.eo-1]:H.getClosestAncestorIn(this.ec,c,!0))}}function p(a){this.code=this[a],this.codeName=a,this.message="RangeException: "+this.codeName}function q(a,b,c){this.nodes=m(a,b,c),this._next=this.nodes[0],this._position=0}function r(a){return function(b,c){for(var d,e=c?b:b.parentNode;e;){d=e.nodeType;if(H.arrayContains(a,d))return e;e=e.parentNode}return null}}function s(a){for(var b;b=a.parentNode;)a=b;return a}function t(a,b){if(Q(a,b))throw new p("INVALID_NODE_TYPE_ERR")}function u(a){if(!a.startContainer)throw new J("INVALID_STATE_ERR")}function v(a,b){if(!H.arrayContains(b,a.nodeType))throw new p("INVALID_NODE_TYPE_ERR")}function w(a,b){if(b<0||b>(H.isCharacterDataNode(a)?a.length:a.childNodes.length))throw new J("INDEX_SIZE_ERR")}function x(a,b){if(O(a,!0)!==O(b,!0))throw new J("WRONG_DOCUMENT_ERR")}function y(a){if(P(a,!0))throw new J("NO_MODIFICATION_ALLOWED_ERR")}function z(a,b){if(!a)throw new J(b)}function A(a){if(!O(a.startContainer,!0)||!O(a.endContainer,!0)||!(a.startOffset<=(H.isCharacterDataNode(a.startContainer)?a.startContainer.length:a.startContainer.childNodes.length))||!(a.endOffset<=(H.isCharacterDataNode(a.endContainer)?a.endContainer.length:a.endContainer.childNodes.length)))throw Error("Range error: Range is no longer valid after DOM mutation ("+a.inspect()+")")}function B(a){a.START_TO_START=S,a.START_TO_END=T,a.END_TO_END=U,a.END_TO_START=V,a.NODE_BEFORE=W,a.NODE_AFTER=X,a.NODE_BEFORE_AND_AFTER=Y,a.NODE_INSIDE=Z}function C(a){B(a),B(a.prototype)}function D(a,d,r){function B(a,b){return function(c){u(this),v(c,K),v(s(c),L),c=(a?e:f)(c),(b?D:E)(this,c.node,c.offset)}}function D(a,b,c){var e=a.endContainer,f=a.endOffset;if(b!==a.startContainer||c!==this.startOffset){if(s(b)!=s(e)||H.comparePoints(b,c,e,f)==1)e=b,f=c;d(a,b,c,e,f)}}function E(a,b,c){var e=a.startContainer,f=a.startOffset;if(b!==a.endContainer||c!==this.endOffset){if(s(b)!=s(e)||H.comparePoints(b,c,e,f)==-1)e=b,f=c;d(a,e,f,b,c)}}function F(a,b,c){(b!==a.startContainer||c!==this.startOffset||b!==a.endContainer||c!==this.endOffset)&&d(a,b,c,b,c)}function I(a){return function(){u(this),A(this);var b=this.startContainer,c=this.startOffset,e=this.commonAncestorContainer,g=new o(this,!0);return b!==e&&(b=H.getClosestAncestorIn(b,e,!0),c=f(b),b=c.node,c=c.offset),j(g,y),g.reset(),e=a(g),g.detach(),d(this,b,c,b,c),e}}a.prototype={attachListener:function(a,b){this._listeners[a].push(b)},setStart:function(a,b){u(this),t(a,!0),w(a,b),D(this,a,b)},setEnd:function(a,b){u(this),t(a,!0),w(a,b),E(this,a,b)},setStartBefore:B(!0,!0),setStartAfter:B(!1,!0),setEndBefore:B(!0,!1),setEndAfter:B(!1,!1),collapse:function(a){u(this),A(this),a?d(this,this.startContainer,this.startOffset,this.startContainer,this.startOffset):d(this,this.endContainer,this.endOffset,this.endContainer,this.endOffset)},selectNodeContents:function(a){u(this),t(a,!0),d(this,a,0,a,g(a))},selectNode:function(a){u(this),t(a,!1),v(a,K);var b=e(a);a=f(a),d(this,b.node,b.offset,a.node,a.offset)},compareBoundaryPoints:function(a,b){u(this),A(this),x(this.startContainer,b.startContainer);var c=a==V||a==S?"start":"end",d=a==T||a==S?"start":"end";return H.comparePoints(this[c+"Container"],this[c+"Offset"],b[d+"Container"],b[d+"Offset"])},insertNode:function(a){u(this),A(this),v(a,M),y(this.startContainer);if(H.isAncestorOf(a,this.startContainer,!0))throw new J("HIERARCHY_REQUEST_ERR");this.setStartBefore(h(a,this.startContainer,this.startOffset))},cloneContents:function(){u(this),A(this);var a,b;return this.collapsed?c(this).createDocumentFragment():this.startContainer===this.endContainer&&H.isCharacterDataNode(this.startContainer)?(a=this.startContainer.cloneNode(!0),a.data=a.data.slice(this.startOffset,this.endOffset),b=c(this).createDocumentFragment(),b.appendChild(a),b):(b=new o(this,!0),a=i(b),b.detach(),a)},extractContents:I(l),deleteContents:I(k),canSurroundContents:function(){u(this),A(this),y(this.startContainer),y(this.endContainer);var a=new o(this,!0),c=a._first&&b(a._first,this)||a._last&&b(a._last,this);return a.detach(),!c},surroundContents:function(a){v(a,N);if(!this.canSurroundContents())throw new p("BAD_BOUNDARYPOINTS_ERR");var b=this.extractContents();if(a.hasChildNodes())for(;a.lastChild;)a.removeChild(a.lastChild);h(a,this.startContainer,this.startOffset),a.appendChild(b),this.selectNode(a)},cloneRange:function(){u(this),A(this);for(var a=new G(c(this)),b=R.length,d;b--;)d=R[b],a[d]=this[d];return a},detach:function(){r(this)},toString:function(){u(this),A(this);var a=this.startContainer;if(a===this.endContainer&&H.isCharacterDataNode(a))return a.nodeType==3||a.nodeType==4?a.data.slice(this.startOffset,this.endOffset):"";var b=[];return a=new o(this,!0),j(a,function(a){(a.nodeType==3||a.nodeType==4)&& -b.push(a.data)}),a.detach(),b.join("")},compareNode:function(a){u(this),A(this);var b=a.parentNode,c=H.getNodeIndex(a);if(!b)throw new J("NOT_FOUND_ERR");return a=this.comparePoint(b,c),b=this.comparePoint(b,c+1),a<0?b>0?Y:W:b>0?X:Z},comparePoint:function(a,b){return u(this),A(this),z(a,"HIERARCHY_REQUEST_ERR"),x(a,this.startContainer),H.comparePoints(a,b,this.startContainer,this.startOffset)<0?-1:H.comparePoints(a,b,this.endContainer,this.endOffset)>0?1:0},createContextualFragment:function(a){u(this);var b=c(this),d=b.createElement("div");d.innerHTML=a;for(a=b.createDocumentFragment();b=d.firstChild;)a.appendChild(b);return a},intersectsNode:function(a,b){u(this),A(this),z(a,"NOT_FOUND_ERR");if(H.getDocument(a)!==c(this))return!1;var d=a.parentNode,e=H.getNodeIndex(a);z(d,"NOT_FOUND_ERR");var f=H.comparePoints(d,e,this.endContainer,this.endOffset);return d=H.comparePoints(d,e+1,this.startContainer,this.startOffset),b?f<=0&&d>=0:f<0&&d>0},isPointInRange:function(a,b){return u(this),A(this),z(a,"HIERARCHY_REQUEST_ERR"),x(a,this.startContainer),H.comparePoints(a,b,this.startContainer,this.startOffset)>=0&&H.comparePoints(a,b,this.endContainer,this.endOffset)<=0},intersectsRange:function(a){u(this),A(this);if(c(a)!=c(this))throw new J("WRONG_DOCUMENT_ERR");return H.comparePoints(this.startContainer,this.startOffset,a.endContainer,a.endOffset)<0&&H.comparePoints(this.endContainer,this.endOffset,a.startContainer,a.startOffset)>0},intersection:function(a){if(this.intersectsRange(a)){var b=H.comparePoints(this.startContainer,this.startOffset,a.startContainer,a.startOffset),c=H.comparePoints(this.endContainer,this.endOffset,a.endContainer,a.endOffset),d=this.cloneRange();return b==-1&&d.setStart(a.startContainer,a.startOffset),c==1&&d.setEnd(a.endContainer,a.endOffset),d}return null},containsNode:function(a,b){return b?this.intersectsNode(a,!1):this.compareNode(a)==Z},containsNodeContents:function(a){return this.comparePoint(a,0)>=0&&this.comparePoint(a,g(a))<=0},splitBoundaries:function(){A(this);var a=this.startContainer,b=this.startOffset,c=this.endContainer,e=this.endOffset,f=a===c;H.isCharacterDataNode(c)&&e>0&&e0&&b=H.getNodeIndex(a)&&e++,b=0),d(this,a,b,c,e)},normalizeBoundaries:function(){A(this);var a=this.startContainer,b=this.startOffset,c=this.endContainer,e=this.endOffset,f=function(a){var b=a.nextSibling;b&&b.nodeType==a.nodeType&&(c=a,e=a.length,a.appendData(b.data),b.parentNode.removeChild(b))},g=function(d){var f=d.previousSibling;if(f&&f.nodeType==d.nodeType){a=d;var g=d.length;b=f.length,d.insertData(0,f.data),f.parentNode.removeChild(f),a==c?(e+=b,c=a):c==d.parentNode&&(f=H.getNodeIndex(d),e==f?(c=d,e=g):e>f&&e--)}},h=!0;H.isCharacterDataNode(c)?c.length==e&&f(c):(e>0&&(h=c.childNodes[e-1])&&H.isCharacterDataNode(h)&&f(h),h=!this.collapsed),h?H.isCharacterDataNode(a)?b==0&&g(a):b0&&b.previousSibling);j=b.nextSibling;if(i==-1&&j&&e.isCharacterDataNode(j)){g.setEndPoint(c?"EndToStart":"EndToEnd",a);if(/[\r\n]/.test(j.data)){h=g.duplicate(),c=h.text.replace(/\r\n/g,"\r").length;for(c=h.moveStart("character",c);h.compareEndPoints("StartToEnd",h)==-1;)c++,h.moveStart("character",1)}else c=g.text.length;h=new f(j,c)}else j=(d||!c)&&b.previousSibling,h=(c=(d||c)&&b.nextSibling)&&e.isCharacterDataNode(c)?new f(c,0):j&&e.isCharacterDataNode(j)?new f(j,j.length):new f(h,e.getNodeIndex(b));return b.parentNode.removeChild(b),h}function c(a,b){var c,d,f=a.offset,g=e.getDocument(a.node),h=g.body.createTextRange(),i=e.isCharacterDataNode(a.node);return i?(c=a.node,d=c.parentNode):(c=a.node.childNodes,c=f12"),b.close();var c=p.getIframeWindow(a).getSelection(),d=b.documentElement.lastChild.firstChild;b=b.createRange(),b.setStart(d,1),b.collapse(!0),c.addRange(b),F=c.rangeCount==1,c.removeAllRanges();var e=b.cloneRange();b.setStart(d,0),e.setEnd(d,2),c.addRange(b),c.addRange(e),E=c.rangeCount==2,b.detach(),e.detach(),A.removeChild(a)}(),a.features.selectionSupportsMultipleRanges=E,a.features.collapsedNonEditableSelectionsSupported=F;var G=!1,H;A&&q.isHostMethod(A,"createControlRange")&&(H=A.createControlRange(),q.areHostProperties(H,["item","add"])&&(G=!0)),a.features.implementsControlRange=G,w=B?function(a){return a.anchorNode===a.focusNode&&a.anchorOffset===a.focusOffset}:function(a){return a.rangeCount?a.getRangeAt(a.rangeCount-1).collapsed:!1};var I;q.isHostMethod(x,"getRangeAt")?I=function(a,b){try{return a.getRangeAt(b)}catch(c){return null}}:B&&(I=function(b){var c=p.getDocument(b.anchorNode);return c=a.createRange(c),c.setStart(b.anchorNode,b.anchorOffset),c.setEnd(b.focusNode,b.focusOffset),c.collapsed!==this.isCollapsed&&(c.setStart(b.focusNode,b.focusOffset),c.setEnd(b.anchorNode,b.anchorOffset)),c}),a.getSelection=function(a){a=a||window;var b=a._rangySelection,c=v(a),e=y?d(a):null;return b?(b.nativeSelection=c,b.docSelection=e,b.refresh(a)):(b=new l(c,e,a),a._rangySelection=b),b},a.getIframeSelection=function(b){return a.getSelection(p.getIframeWindow(b))},H=l.prototype;if(B&&q.areHostMethods(x,["removeAllRanges","addRange"])){H.removeAllRanges=function(){this.nativeSelection.removeAllRanges(),f(this)};var J=function(b,c){var d=r.getRangeDocument(c);d=a.createRange(d),d.collapseToPoint(c.endContainer,c.endOffset),b.nativeSelection.addRange(g(d)),b.nativeSelection.extend(c.startContainer,c.startOffset),b.refresh()};H.addRange=D?function(b,c){if(G&&y&&this.docSelection.type=="Control")k(this,b);else if(c&&C)J(this,b);else{var d;E?d=this.rangeCount:(this.removeAllRanges(),d=0),this.nativeSelection.addRange(g(b)),this.rangeCount=this.nativeSelection.rangeCount,this.rangeCount==d+1?(a.config.checkSelectionRanges&&(d=I(this.nativeSelection,this.rangeCount-1))&&!r.rangesEqual(d,b)&&(b=new s(d)),this._ranges[this.rangeCount-1]=b,e(this,b,M(this.nativeSelection)),this.isCollapsed=w(this)):this.refresh()}}:function(a,b){b&&C?J(this,a):(this.nativeSelection.addRange(g(a)),this.refresh())},H.setRanges=function(a){if(G&&a.length>1)m(this,a);else{this.removeAllRanges();for(var b=0,c=a.length;b1?m(this,a):b&&this.addRange(a[0])};else return b.fail("No means of selecting a Range or TextRange was found"),!1;H.getRangeAt=function(a){if(a<0||a>=this.rangeCount)throw new t("INDEX_SIZE_ERR");return this._ranges[a]};var K;if(q.isHostMethod(x,"getRangeAt")&&typeof x.rangeCount=="number")K=function(b){if(G&&y&&b.docSelection.type=="Control")j(b);else{b._ranges.length=b.rangeCount=b.nativeSelection.rangeCount;if(b.rangeCount){for(var c=0,d=b.rangeCount;c0&&(h=f.item(0));for(i=0;i',e,f,g;c.length>0&&(e=$(c[0]),f=$(c[c.length-1]),e.is(a)&&e.before(d),f.is(a)&&f.after(d)),g=this._getBlockSepSelector(),b.find(g).before(d)},WYMeditor.editor.prototype._getBlockSepSelector=function(){if(typeof this._blockSpacersSel!="undefined")return this._blockSpacersSel;var a=[];return $.each(WYMeditor.BLOCKING_ELEMENTS,function(b,c){$.each(WYMeditor.BLOCKING_ELEMENTS,function(b,d){a.push(c+" + "+d)})}),$.each(WYMeditor.BLOCKING_ELEMENTS,function(b,c){$.each(WYMeditor.NON_BLOCKING_ELEMENTS,function(b,d){a.push(c+" + "+d),a.push(d+" + "+c)})}),this._blockSpacersSel=a.join(", "),this._blockSpacersSel},WYMeditor.editor.prototype.fixDoubleBr=function(){var a=$(this._doc).find("body.wym_iframe"),b;a.children("br + br").filter(":not(pre br)").remove(),a.find("p + br").next("p").prev("br").remove(),b=a.find("p + br").slice(-1),b.length>0&&b.next().length===0&&b.remove()},WYMeditor.editor.prototype.dialog=function(a,b,c){var d=b||this._wym._options.dialogFeatures,e=window.open("","dialog",d),f,g=WYMeditor.Helper,h,i;if(e){f="";switch(a){case WYMeditor.DIALOG_LINK:f=this._options.dialogLinkHtml;break;case WYMeditor.DIALOG_IMAGE:f=this._options.dialogImageHtml;break;case WYMeditor.DIALOG_TABLE:f=this._options.dialogTableHtml;break;case WYMeditor.DIALOG_PASTE:f=this._options.dialogPasteHtml;break;case WYMeditor.PREVIEW:f=this._options.dialogPreviewHtml;break;default:f=c}h=this._options.dialogHtml,h=g.replaceAll(h,WYMeditor.BASE_PATH,this._options.basePath),h=g.replaceAll(h,WYMeditor.DIRECTION,this._options.direction),h=g.replaceAll(h,WYMeditor.CSS_PATH,this._options.skinPath+WYMeditor.SKINS_DEFAULT_CSS),h=g.replaceAll(h,WYMeditor.WYM_PATH,this._options.wymPath),h=g.replaceAll(h,WYMeditor.JQUERY_PATH,this._options.jQueryPath),h=g.replaceAll(h,WYMeditor.DIALOG_TITLE,this.encloseString(a)),h=g.replaceAll(h,WYMeditor.DIALOG_BODY,f),h=g.replaceAll(h,WYMeditor.INDEX,this._index),h=this.replaceStrings(h),i=e.document,i.write(h),i.close()}},WYMeditor.editor.prototype.toggleHtml=function(){jQuery(this._box).find(this._options.htmlSelector).toggle()},WYMeditor.editor.prototype.uniqueStamp=function(){var a=new Date;return"wym-"+a.getTime()},WYMeditor.editor.prototype.paste=function(a){var b=this.selected(),c="",d,e,f,g;d=a.split(new RegExp(WYMeditor.NEWLINE+"{2,}","g"));for(f=0,g=d.length;f"+d[f].split(WYMeditor.NEWLINE).join("
    ")+"

    ";b&&b.tagName.toLowerCase()!==WYMeditor.BODY?(d=jQuery(c,this._doc).insertAfter(b),e=d[d.length-1]):(d=jQuery(c,this._doc).appendTo(this._doc.body),e=d[d.length-1]),jQuery(b).text()===""&&jQuery(b).remove(),jQuery("body > br",this._doc).remove(),this.setFocusToNode(e)},WYMeditor.editor.prototype.insert=function(a){var b=this._iframe.contentWindow.getSelection(),c,d;b.focusNode!==null?(c=b.getRangeAt(0),d=c.createContextualFragment(a),c.deleteContents(),c.insertNode(d)):this.paste(a)},WYMeditor.editor.prototype.wrap=function(a,b){this.insert(a+this._iframe.contentWindow.getSelection().toString()+b)},WYMeditor.editor.prototype.unwrap=function(){this.insert(this._iframe.contentWindow.getSelection().toString())},WYMeditor.editor.prototype.setFocusToNode=function(a,b){var c=this._doc.createRange(),d=this._iframe.contentWindow.getSelection();b=b?0:1,c.selectNodeContents(a),d.addRange(c),d.collapse(a,b),this._iframe.contentWindow.focus()},WYMeditor.editor.prototype.addCssRules=function(a,b){var c=a.styleSheets[0],d,e;if(c)for(d=0;d1||c.tagName.toLowerCase()===WYMeditor.OL||c.tagName.toLowerCase()===WYMeditor.UL||c.tagName.toLowerCase()===WYMeditor.LI)return!0}return!1},WYMeditor.editor.prototype._canOutdent=function(a,b){if(a&&a===b&&a.tagName.toLowerCase()===WYMeditor.LI){var c=a.parentNode.parentNode;if(a.parentNode.childNodes.length>1||c.tagName.toLowerCase()===WYMeditor.OL||c.tagName.toLowerCase()===WYMeditor.UL||c.tagName.toLowerCase()===WYMeditor.LI)if($(c).parent().is("ol,ul,li"))return!0}return!1},WYMeditor.editor.prototype.indent=function(){var a=this.selected(),b=rangy.getIframeSelection(this._iframe),c=b.getRangeAt(0).startContainer,d=b.getRangeAt(0).startOffset,e=b.anchorNode,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y;a=this.findUp(a,WYMeditor.BLOCKS),e=this.findUp(e,WYMeditor.BLOCKS);if(!this._canIndent(a,e))return;i=$(a),j=i.parent()[0].tagName.toLowerCase(),k=i.contents().not("ol,ul"),i.prev().length===0&&i.parent().not("ul,ol,li")?(l='
  • <'+j+">"+"
  • ",i.before(l),f=i.prev().find(j),i.children().unwrap(),f.append(i)):i.prev().contents().last().is(j)?(m=i.prev(),n=m.contents().last(),o=i.children(),o.unwrap(),n.append(i),o.detach(),m.append(o),o.first().is(j)&&(p=o.first().children(),p.unwrap(),p.detach(),n.append(p))):i.children("ol,ul").length===0?(g=i.prev().filter("li"),i.children().unwrap(),q="<"+j+">",g.append(q),g.children(j).last().append(i)):(r=i.contents().unwrap(),r.wrapAll('
  • '),r.filter("ol,ul").first().prepend(i)),i.prepend(k),s=i.parent().parent("li.spacer_li"),s.length===1&&(t=s.prev().filter("li").contents().last(),t.is(j)?(h=i.parent().contents(),s.detach(),t.append(h)):s.next("li").contents().first().is(j)?(u=s.next("li").children().first(),h=i.parent().contents(),s.detach(),u.prepend(h)):s.prev().is("li")&&(g=s.prev(),s.detach(),g.append(s.contents()))),i.next().is(".spacer_li")&&(v=i.next(".spacer_li"),w=v.contents(),w.detach(),i.append(w),v.remove()),x=this._iframe.contentWindow,b=rangy.getSelection(x),y=rangy.createRange(this._doc),y.setStart(c,d),y.setEnd(c,d),y.collapse(!1),b.setSingleRange(y)},WYMeditor.editor.prototype.outdent=function(){var a=this.selected(),b=rangy.getIframeSelection(this._iframe),c=b.getRangeAt(0).startContainer,d=b.getRangeAt(0).startOffset,e=b.anchorNode,f,g,h,i,j,k,l,m,n;a=this.findUp(a,WYMeditor.BLOCKS),e=this.findUp(e,WYMeditor.BLOCKS);if(!this._canOutdent(a,e))return;f=$(a),g=f.parent().parent("li"),h=f.parent()[0].tagName.toLowerCase(),i=f.nextAll("li"),f.detach(),g.after(f),j=f.children("ol,ul"),j.length>0&&j.each(function(a,b){var c=$(b),d;c.detach(),d="<"+h+">"+'
  • '+"",f.append(d),f.children(h).last().children("li").append(c)}),i.length>0&&(k=i,k.detach(),f.append("<"+h+">"),f.find(h).last().append(i),l=f.children(h+" + "+h),l.length>0&&l.each(function(a,b){var c=$(b),d=c.contents(),e=c.prev();d.detach(),c.remove(),e.append(d)})),g.find("ul:empty,ol:empty").remove(),g.is(".spacer_li")&&g.is(":empty")&&g.remove(),m=this._iframe.contentWindow,b=rangy.getSelection(m),n=rangy.createRange(this._doc),n.setStart(c,d),n.setEnd(c,d),n.collapse(!1),b.setSingleRange(n)},WYMeditor.editor.prototype.insertTable=function(a,b,c,d){if(a<=0||b<=0)return;var e=this._doc.createElement(WYMeditor.TABLE),f=null,g=null,h,i,j,k;h=e.createCaption(),h.innerHTML=c;for(i=0;i",WYMeditor.WymClassExplorer.prototype.initIframe=function(iframe){this._iframe=iframe,this._doc=iframe.contentWindow.document;var styles=this._doc.styleSheets[0],aCss=eval(this._options.editorStyles);this.addCssRules(this._doc,aCss),this._doc.title=this._wym._index,jQuery("html",this._doc).attr("dir",this._options.direction),jQuery(this._doc.body).html(this._wym._html);var wym=this;this._doc.body.onfocus=function(){wym._doc.designMode="on",wym._doc=iframe.contentWindow.document},this._doc.onbeforedeactivate=function(){wym.saveCaret()},$(this._doc).bind("keyup",wym.keyup);var ieVersion=parseInt($.browser.version,10);ieVersion>=8&&ieVersion<9&&$(this._doc).bind("keydown",function(){wym.fixBluescreenOfDeath()}),this._doc.onkeyup=function(){wym.saveCaret()},this._doc.onclick=function(){wym.saveCaret()},this._doc.body.onbeforepaste=function(){wym._iframe.contentWindow.event.returnValue=!1},this._doc.body.onpaste=function(){wym._iframe.contentWindow.event.returnValue=!1,wym.paste(window.clipboardData.getData("Text"))},this._initialized&&(jQuery.isFunction(this._options.preBind)&&this._options.preBind(this),this._wym.bindEvents(),jQuery.isFunction(this._options.postInit)&&this._options.postInit(this),this.listen()),this._initialized=!0,this._doc.designMode="on";try{this._doc=iframe.contentWindow.document}catch(e){}},function(a){WYMeditor.WymClassExplorer.prototype.loadSkin=function(){jQuery(this._box).find(this._options.containerSelector).attr("unselectable","on"),a.call(this)}}(WYMeditor.editor.prototype.loadSkin),WYMeditor.WymClassExplorer.prototype.fixBluescreenOfDeath=function(){var a=$(this._doc).find("p").eq(0).position();typeof a!="undefined"&&a.left<0&&($(this._box).append('
    '),$(this._box).find("#wym-bluescreen-bug-fix").remove())},WYMeditor.WymClassExplorer.prototype._exec=function(a,b){b?this._doc.execCommand(a,!1,b):this._doc.execCommand(a)},WYMeditor.WymClassExplorer.prototype.selected=function(){var a=this._iframe.contentWindow.document.caretPos;if(a&&a.parentElement)return a.parentElement()},WYMeditor.WymClassExplorer.prototype.saveCaret=function(){this._doc.caretPos=this._doc.selection.createRange()},WYMeditor.WymClassExplorer.prototype.addCssRule=function(a,b){var c=b.name.split(","),d;for(d=0;d0){var e=$(c[0]),f=$(c[c.length-1]);e.is(a)&&e.before(d),$.browser.version>="7.0"&&f.is(a)&&f.after(d)}var g=this._getBlockSepSelector();b.find(g).before(d)},WYMeditor.WymClassMozilla=function(a){this._wym=a,this._class="class"},WYMeditor.WymClassMozilla.CELL_PLACEHOLDER='
    ',WYMeditor.WymClassMozilla.NEEDS_CELL_FIX=$.browser.version>="1.9.1"&&$.browser.version<"2.0",WYMeditor.WymClassMozilla.prototype.initIframe=function(iframe){var wym=this;this._iframe=iframe,this._doc=iframe.contentDocument;var styles=this._doc.styleSheets[0],aCss=eval(this._options.editorStyles);this.addCssRules(this._doc,aCss),this._doc.title=this._wym._index,jQuery("html",this._doc).attr("dir",this._options.direction),this.html(this._wym._html),this.enableDesignMode(),jQuery.isFunction(this._options.preBind)&&this._options.preBind(this),this._wym.bindEvents(),jQuery(this._doc).bind("keydown",this.keydown),jQuery(this._doc).bind("keyup",this.keyup),jQuery(this._doc).bind("click",this.click),jQuery(this._doc).bind("focus",function(){wym.enableDesignMode.call(wym)}),jQuery.isFunction(this._options.postInit)&&this._options.postInit(this),this.listen()},WYMeditor.WymClassMozilla.prototype.html=function(a){if(typeof a!="string")return jQuery(this._doc.body).html();try{this._doc.designMode="off"}catch(b){}return a=a.replace(/]*)>/gi,""),a=a.replace(/<\/em>/gi,""),a=a.replace(/]*)>/gi,""),a=a.replace(/<\/strong>/gi,""),jQuery(this._doc.body).html(a),this._wym.fixBodyHtml(),this.enableDesignMode(),!1},WYMeditor.WymClassMozilla.prototype._exec=function(a,b){if(!this.selected())return!1;b?this._doc.execCommand(a,"",b):this._doc.execCommand(a,"",null);var c=this.selected();return c.tagName.toLowerCase()===WYMeditor.BODY&&this._exec(WYMeditor.FORMAT_BLOCK,WYMeditor.P),!0},WYMeditor.WymClassMozilla.prototype.addCssRule=function(a,b){a.insertRule(b.name+" {"+b.css+"}",a.cssRules.length)},WYMeditor.WymClassMozilla.prototype.keydown=function(a){var b=WYMeditor.INSTANCES[this.title];if(a.ctrlKey){if(a.keyCode===66)return b._exec(WYMeditor.BOLD),!1;if(a.keyCode===73)return b._exec(WYMeditor.ITALIC),!1}return!0},WYMeditor.WymClassMozilla.prototype.keyup=function(a){var b=WYMeditor.INSTANCES[this.title];b._selected_image=null;var c=null;if(a.keyCode!==WYMeditor.KEY.BACKSPACE&&a.keyCode!==WYMeditor.KEY.CTRL&&a.keyCode!==WYMeditor.KEY.DELETE&&a.keyCode!==WYMeditor.KEY.COMMAND&&a.keyCode!==WYMeditor.KEY.UP&&a.keyCode!==WYMeditor.KEY.DOWN&&a.keyCode!==WYMeditor.KEY.LEFT&&a.keyCode!==WYMeditor.KEY.RIGHT&&a.keyCode!==WYMeditor.KEY.ENTER&&!a.metaKey&&!a.ctrlKey){c=b.selected();var d=c.tagName.toLowerCase();if(d==="strong"||d==="b"||d==="em"||d==="i"||d==="sub"||d==="sup"||d==="a")d=c.parentNode.tagName.toLowerCase();d===WYMeditor.BODY&&(b._exec(WYMeditor.FORMAT_BLOCK,WYMeditor.P),b.fixBodyHtml())}(a.keyCode===WYMeditor.KEY.UP||a.keyCode===WYMeditor.KEY.DOWN||a.keyCode===WYMeditor.KEY.LEFT||a.keyCode===WYMeditor.KEY.RIGHT||a.keyCode===WYMeditor.KEY.BACKSPACE||a.keyCode===WYMeditor.KEY.ENTER)&&b.fixBodyHtml()},WYMeditor.WymClassMozilla.prototype.click=function(a){var b=WYMeditor.INSTANCES[this.title],c=b.selected();WYMeditor.WymClassMozilla.NEEDS_CELL_FIX===!0&&c&&c.tagName.toLowerCase()===WYMeditor.TR&&jQuery(WYMeditor.TD,b._doc.body).append(WYMeditor.WymClassMozilla.CELL_PLACEHOLDER);if(c&&c.tagName.toLowerCase()===WYMeditor.BODY){var d=b._iframe.contentWindow.getSelection();d.isCollapsed===!0&&b._exec(WYMeditor.FORMAT_BLOCK,WYMeditor.P)}},WYMeditor.WymClassMozilla.prototype.enableDesignMode=function(){if(this._doc.designMode==="off")try{this._doc.designMode="on",this._doc.execCommand("styleWithCSS","",!1),this._doc.execCommand("enableObjectResizing",!1,!1)}catch(a){}},WYMeditor.WymClassMozilla.prototype.openBlockTag=function(a,b){b=this.validator.getValidTagAttributes(a,b);if(a==="span"&&b.style){var c=this.getTagForStyle(b.style);c&&(a=c,this._tag_stack.pop(),this._tag_stack.push(a),b.style="")}this.output+=this.helper.tag(a,b,!0)},WYMeditor.WymClassMozilla.prototype.getTagForStyle=function(a){return/bold/.test(a)?"strong":/italic/.test(a)?"em":/sub/.test(a)?"sub":/super/.test(a)?"sup":!1},WYMeditor.WymClassMozilla.prototype.afterInsertTable=function(a){WYMeditor.WymClassMozilla.NEEDS_CELL_FIX===!0&&$(a).find("td").each(function(a,b){$(b).append(WYMeditor.WymClassMozilla.CELL_PLACEHOLDER)})},WYMeditor.WymClassOpera=function(a){this._wym=a,this._class="class"},WYMeditor.WymClassOpera.prototype.initIframe=function(iframe){this._iframe=iframe,this._doc=iframe.contentWindow.document;var styles=this._doc.styleSheets[0],aCss=eval(this._options.editorStyles);this.addCssRules(this._doc,aCss),this._doc.title=this._wym._index,jQuery("html",this._doc).attr("dir",this._options.direction),this._doc.designMode="on",this.html(this._wym._html),jQuery.isFunction(this._options.preBind)&&this._options.preBind(this),this._wym.bindEvents(),jQuery(this._doc).bind("keydown",this.keydown),jQuery(this._doc).bind("keyup",this.keyup),jQuery.isFunction(this._options.postInit)&&this._options.postInit(this),this.listen()},WYMeditor.WymClassOpera.prototype._exec=function(a,b){b?this._doc.execCommand(a,!1,b):this._doc.execCommand(a)},WYMeditor.WymClassOpera.prototype.selected=function(){var a=this._iframe.contentWindow.getSelection(),b=a.focusNode;return b?b.nodeName=="#text"?b.parentNode:b:null},WYMeditor.WymClassOpera.prototype.addCssRule=function(a,b){a.insertRule(b.name+" {"+b.css+"}",a.cssRules.length)},WYMeditor.WymClassOpera.prototype.keydown=function(a){var b=WYMeditor.INSTANCES[this.title],c=b._iframe.contentWindow.getSelection();startNode=c.getRangeAt(0).startContainer,!jQuery(startNode).parentsOrSelf(WYMeditor.MAIN_CONTAINERS.join(","))[0]&&!jQuery(startNode).parentsOrSelf("li")&&a.keyCode!=WYMeditor.KEY.ENTER&&a.keyCode!=WYMeditor.KEY.LEFT&&a.keyCode!=WYMeditor.KEY.UP&&a.keyCode!=WYMeditor.KEY.RIGHT&&a.keyCode!=WYMeditor.KEY.DOWN&&a.keyCode!=WYMeditor.KEY.BACKSPACE&&a.keyCode!=WYMeditor.KEY.DELETE&&b._exec(WYMeditor.FORMAT_BLOCK,WYMeditor.P)},WYMeditor.WymClassOpera.prototype.keyup=function(a){var b=WYMeditor.INSTANCES[this.title];b._selected_image=null},WYMeditor.WymClassSafari=function(a){this._wym=a,this._class="class"},WYMeditor.WymClassSafari.prototype.initIframe=function(iframe){this._iframe=iframe,this._doc=iframe.contentDocument;var styles=this._doc.styleSheets[0],aCss=eval(this._options.editorStyles);this.addCssRules(this._doc,aCss),this._doc.title=this._wym._index,jQuery("html",this._doc).attr("dir",this._options.direction),this._doc.designMode="on",this.html(this._wym._html),jQuery.isFunction(this._options.preBind)&&this._options.preBind(this),this._wym.bindEvents(),jQuery(this._doc).bind("keydown",this.keydown),jQuery(this._doc).bind("keyup",this.keyup),jQuery.isFunction(this._options.postInit)&&this._options.postInit(this),this.listen()},WYMeditor.WymClassSafari.prototype._exec=function(a,b){if(!this.selected())return!1;var c=this.selected();switch(a){case WYMeditor.INSERT_ORDEREDLIST:case WYMeditor.INSERT_UNORDEREDLIST:this._doc.execCommand(a,"",null);var d=this.findUp(c,WYMeditor.MAIN_CONTAINERS);d&&jQuery(d).replaceWith(jQuery(d).html());break;default:b?this._doc.execCommand(a,"",b):this._doc.execCommand(a,"",null)}return d=this.selected(),d&&d.tagName.toLowerCase()==WYMeditor.BODY&&this._exec(WYMeditor.FORMAT_BLOCK,WYMeditor.P),!0},WYMeditor.WymClassSafari.prototype.addCssRule=function(a,b){a.insertRule(b.name+" {"+b.css+"}",a.cssRules.length)},WYMeditor.WymClassSafari.prototype.keydown=function(a){var b=WYMeditor.INSTANCES[this.title];a.ctrlKey?(a.keyCode==WYMeditor.KEY.B&&(b._exec(WYMeditor.BOLD),a.preventDefault()),a.keyCode==WYMeditor.KEY.I&&(b._exec(WYMeditor.ITALIC),a.preventDefault())):a.shiftKey&&a.keyCode==WYMeditor.KEY.ENTER&&(b._exec("InsertLineBreak"),a.preventDefault())},WYMeditor.WymClassSafari.prototype.keyup=function(a){var b=WYMeditor.INSTANCES[this.title];b._selected_image=null;var c=null;$.browser.version<534.1&&a.keyCode==WYMeditor.KEY.ENTER&&a.shiftKey&&b._exec("InsertLineBreak");if(a.keyCode!=WYMeditor.KEY.BACKSPACE&&a.keyCode!=WYMeditor.KEY.CTRL&&a.keyCode!=WYMeditor.KEY.DELETE&&a.keyCode!=WYMeditor.KEY.COMMAND&&a.keyCode!=WYMeditor.KEY.UP&&a.keyCode!=WYMeditor.KEY.DOWN&&a.keyCode!=WYMeditor.KEY.LEFT&&a.keyCode!=WYMeditor.KEY.RIGHT&&a.keyCode!=WYMeditor.KEY.ENTER&&!a.metaKey&&!a.ctrlKey){c=b.selected();var d=c.tagName.toLowerCase();if(d=="strong"||d=="b"||d=="em"||d=="i"||d=="sub"||d=="sup"||d=="a"||d=="span")d=c.parentNode.tagName.toLowerCase();if(d==WYMeditor.BODY||d==WYMeditor.DIV)b._exec(WYMeditor.FORMAT_BLOCK,WYMeditor.P),b.fixBodyHtml()}(a.keyCode==WYMeditor.KEY.UP||a.keyCode==WYMeditor.KEY.DOWN||a.keyCode==WYMeditor.KEY.LEFT||a.keyCode==WYMeditor.KEY.RIGHT||a.keyCode==WYMeditor.KEY.BACKSPACE||a.keyCode==WYMeditor.KEY.ENTER)&&b.fixBodyHtml()},WYMeditor.WymClassSafari.prototype.openBlockTag=function(a,b){b=this.validator.getValidTagAttributes(a,b);if(a=="span"&&b.style){var c=this.getTagForStyle(b.style);c&&(a=c,this._tag_stack.pop(),this._tag_stack.push(a),b.style="",typeof b["class"]=="string"&&(b["class"]=b["class"].replace(/apple-style-span/gi,"")))}this.output+=this.helper.tag(a,b,!0)},WYMeditor.WymClassSafari.prototype.getTagForStyle=function(a){return/bold/.test(a)?"strong":/italic/.test(a)?"em":/sub/.test(a)?"sub":/super/.test(a)?"sup":!1},WYMeditor.XmlHelper=function(){return this._entitiesDiv=document.createElement("div"),this},WYMeditor.XmlHelper.prototype.tag=function(a,b,c){return b=b||!1,c=c||!1,"<"+a+(b?this.tagOptions(b):"")+(c?">":" />")},WYMeditor.XmlHelper.prototype.contentTag=function(a,b,c){return c=c||!1,"<"+a+(c?this.tagOptions(c):"")+">"+b+""},WYMeditor.XmlHelper.prototype.cdataSection=function(a){return""},WYMeditor.XmlHelper.prototype.escapeOnce=function(a){return this._fixDoubleEscape(this.escapeEntities(a))},WYMeditor.XmlHelper.prototype._fixDoubleEscape=function(a){return a.replace(/&([a-z]+|(#\d+));/ig,"&$1;")},WYMeditor.XmlHelper.prototype.tagOptions=function(a){var b=this;b._formated_options="";for(var c in a){var d="",e=a[c];typeof e!="function"&&e.length>0&&(parseInt(c,10)==c&&typeof e=="object"&&(c=e.shift(),e=e.pop()),c!==""&&e!==""&&(b._formated_options+=" "+c+'="'+b.escapeOnce(e)+'"'))}return b._formated_options},WYMeditor.XmlHelper.prototype.escapeEntities=function(a,b){this._entitiesDiv.innerHTML=a,this._entitiesDiv.textContent=a;var c=this._entitiesDiv.innerHTML;return typeof b=="undefined"&&(b!==!1&&(c=c.replace('"',""")),b===!0&&(c=c.replace('"',"'"))),c},WYMeditor.XmlHelper.prototype.parseAttributes=function(a){var b=[],c=a.split(/((=\s*")(")("))|((=\s*\')(\')(\'))|((=\s*[^>\s]*))/g);if(c.toString()!=a)for(var d in c){var e=c[d];if(typeof e!="function"&&e.length!==0){var f=new RegExp("(\\w+)\\s*"+e),g=a.match(f);if(g){var h=e.replace(/^[\s=]+/,""),i=h.charAt(0);i=i=='"'?'"':i=="'"?"'":"",i!==""&&(h=i=='"'?h.replace(/^"|"+$/g,""):h.replace(/^'|'+$/g,"")),a=a.replace(g[0],""),b.push([g[1],h])}}}return b},WYMeditor.XhtmlValidator={_attributes:{core:{except:["base","head","html","meta","param","script","style","title"],attributes:["class","id","style","title","accesskey","tabindex","/^data-.*/"]},language:{except:["base","br","hr","iframe","param","script"],attributes:{dir:["ltr","rtl"],0:"lang",1:"xml:lang"}},keyboard:{attributes:{accesskey:/^(\w){1}$/,tabindex:/^(\d)+$/}}},_events:{window:{only:["body"],attributes:["onload","onunload"]},form:{only:["form","input","textarea","select","a","label","button"],attributes:["onchange","onsubmit","onreset","onselect","onblur","onfocus"]},keyboard:{except:["base","bdo","br","frame","frameset","head","html","iframe","meta","param","script","style","title"],attributes:["onkeydown","onkeypress","onkeyup"]},mouse:{except:["base","bdo","br","head","html","meta","param","script","style","title"],attributes:["onclick","ondblclick","onmousedown","onmousemove","onmouseover","onmouseout","onmouseup"]}},_tags:{a:{attributes:{0:"charset",1:"coords",2:"href",3:"hreflang",4:"name",5:"rel",6:"rev",shape:/^(rect|rectangle|circ|circle|poly|polygon)$/,7:"type"}},0:"abbr",1:"acronym",2:"address",area:{attributes:{0:"alt",1:"coords",2:"href",nohref:/^(true|false)$/,shape:/^(rect|rectangle|circ|circle|poly|polygon)$/},required:["alt"]},3:"b",base:{attributes:["href"],required:["href"]},bdo:{attributes:{dir:/^(ltr|rtl)$/},required:["dir"]},4:"big",blockquote:{attributes:["cite"]},5:"body",6:"br",button:{attributes:{disabled:/^(disabled)$/,type:/^(button|reset|submit)$/,0:"value"},inside:"form"},7:"caption",8:"cite",9:"code",col:{attributes:{align:/^(right|left|center|justify)$/,0:"char",1:"charoff",span:/^(\d)+$/,valign:/^(top|middle|bottom|baseline)$/,2:"width"},inside:"colgroup"},colgroup:{attributes:{align:/^(right|left|center|justify)$/,0:"char",1:"charoff",span:/^(\d)+$/,valign:/^(top|middle|bottom|baseline)$/,2:"width"}},10:"dd",del:{attributes:{0:"cite",datetime:/^([0-9]){8}/}},11:"div",12:"dfn",13:"dl",14:"dt",15:"em",fieldset:{inside:"form"},form:{attributes:{0:"action",1:"accept",2:"accept-charset",3:"enctype",method:/^(get|post)$/},required:["action"]},head:{attributes:["profile"]},16:"h1",17:"h2",18:"h3",19:"h4",20:"h5",21:"h6",22:"hr",html:{attributes:["xmlns"]},23:"i",img:{attributes:["alt","src","height","ismap","longdesc","usemap","width"],required:["alt","src"]},input:{attributes:{0:"accept",1:"alt",checked:/^(checked)$/,disabled:/^(disabled)$/,maxlength:/^(\d)+$/,2:"name",readonly:/^(readonly)$/,size:/^(\d)+$/,3:"src",type:/^(button|checkbox|file|hidden|image|password|radio|reset|submit|text)$/,4:"value"},inside:"form"},ins:{attributes:{0:"cite",datetime:/^([0-9]){8}/}},24:"kbd",label:{attributes:["for"],inside:"form"},25:"legend",26:"li",link:{attributes:{0:"charset",1:"href",2:"hreflang",media:/^(all|braille|print|projection|screen|speech|,|;| )+$/i,rel:/^(alternate|appendix|bookmark|chapter|contents|copyright|glossary|help|home|index|next|prev|section|start|stylesheet|subsection| |shortcut|icon)+$/i,rev:/^(alternate|appendix|bookmark|chapter|contents|copyright|glossary|help|home|index|next|prev|section|start|stylesheet|subsection| |shortcut|icon)+$/i,3:"type"},inside:"head"},map:{attributes:["id","name"],required:["id"]},meta:{attributes:{0:"content","http-equiv":/^(content\-type|expires|refresh|set\-cookie)$/i,1:"name",2:"scheme"},required:["content"]},27:"noscript",object:{attributes:["archive","classid","codebase","codetype","data","declare","height","name","standby","type","usemap","width"]},28:"ol",optgroup:{attributes:{0:"label",disabled:/^(disabled)$/},required:["label"]},option:{attributes:{0:"label",disabled:/^(disabled)$/,selected:/^(selected)$/,1:"value"},inside:"select"},29:"p",param:{attributes:{0:"type",valuetype:/^(data|ref|object)$/,1:"valuetype",2:"value"},required:["name"]},30:"pre",q:{attributes:["cite"]},31:"samp",script:{attributes:{type:/^(text\/ecmascript|text\/javascript|text\/jscript|text\/vbscript|text\/vbs|text\/xml)$/,0:"charset",defer:/^(defer)$/,1:"src"},required:["type"]},select:{attributes:{disabled:/^(disabled)$/,multiple:/^(multiple)$/,0:"name",1:"size"},inside:"form"},32:"small",33:"span",34:"strong",style:{attributes:{0:"type",media:/^(screen|tty|tv|projection|handheld|print|braille|aural|all)$/},required:["type"]},35:"sub",36:"sup",table:{attributes:{0:"border",1:"cellpadding",2:"cellspacing",frame:/^(void|above|below|hsides|lhs|rhs|vsides|box|border)$/,rules:/^(none|groups|rows|cols|all)$/,3:"summary",4:"width"}},tbody:{attributes:{align:/^(right|left|center|justify)$/,0:"char",1:"charoff",valign:/^(top|middle|bottom|baseline)$/}},td:{attributes:{0:"abbr",align:/^(left|right|center|justify|char)$/,1:"axis",2:"char",3:"charoff",colspan:/^(\d)+$/,4:"headers",rowspan:/^(\d)+$/,scope:/^(col|colgroup|row|rowgroup)$/,valign:/^(top|middle|bottom|baseline)$/}},textarea:{attributes:["cols","rows","disabled","name","readonly"],required:["cols","rows"],inside:"form"},tfoot:{attributes:{align:/^(right|left|center|justify)$/,0:"char",1:"charoff",valign:/^(top|middle|bottom)$/,2:"baseline"}},th:{attributes:{0:"abbr",align:/^(left|right|center|justify|char)$/,1:"axis",2:"char",3:"charoff",colspan:/^(\d)+$/,4:"headers",rowspan:/^(\d)+$/,scope:/^(col|colgroup|row|rowgroup)$/,valign:/^(top|middle|bottom|baseline)$/}},thead:{attributes:{align:/^(right|left|center|justify)$/,0:"char",1:"charoff",valign:/^(top|middle|bottom|baseline)$/}},37:"title",tr:{attributes:{align:/^(right|left|center|justify|char)$/,0:"char",1:"charoff",valign:/^(top|middle|bottom|baseline)$/}},38:"tt",39:"ul",40:"var"},skiped_attributes:[],skiped_attribute_values:[],getValidTagAttributes:function(a,b){var c={},d=this.getPossibleTagAttributes(a);for(var e in b){var f=b[e];e=e.toLowerCase();var g=WYMeditor.Helper;!g.contains(this.skiped_attributes,e)&&!g.contains(this.skiped_attribute_values,f)&&(typeof f!="function"&&g.contains(d,e)?this.doesAttributeNeedsValidation(a,e)?this.validateAttribute(a,e,f)&&(c[e]=f):c[e]=f:jQuery.each(d,function(){this.match(/\/(.*)\//)&&(regex=new RegExp(this.match(/\/(.*)\//)[1]),regex.test(e)&&(c[e]=f))}))}return c},getUniqueAttributesAndEventsForTag:function(a){var b=[];if(this._tags[a]&&this._tags[a].attributes)for(var c in this._tags[a].attributes)b.push(parseInt(c,10)==c?this._tags[a].attributes[c]:c);return b},getDefaultAttributesAndEventsForTags:function(){var a=[];for(var b in this._events)a.push(this._events[b]);for(b in this._attributes)a.push(this._attributes[b]);return a},isValidTag:function(a){if(this._tags[a])return!0;for(var b in this._tags)if(this._tags[b]==a)return!0;return!1},getDefaultAttributesAndEventsForTag:function(a){var b=[];if(this.isValidTag(a)){var c=this.getDefaultAttributesAndEventsForTags();for(var d in c){var e=c[d];if(typeof e=="object"){var f=WYMeditor.Helper;if(e.except&&f.contains(e.except,a)||e.only&&!f.contains(e.only,a))continue;var g=e.attributes?e.attributes:e.events;for(var h in g)b.push(typeof g[h]!="string"?h:g[h])}}}return b},doesAttributeNeedsValidation:function(a,b){return this._tags[a]&&(this._tags[a].attributes&&this._tags[a].attributes[b]||this._tags[a].required&&WYMeditor.Helper.contains(this._tags[a].required,b))},validateAttribute:function(a,b,c){return this._tags[a]&&this._tags[a].attributes&&this._tags[a].attributes[b]&&c.length>0&&!c.match(this._tags[a].attributes[b])||this._tags[a]&&this._tags[a].required&&WYMeditor.Helper.contains(this._tags[a].required,b)&&c.length===0?!1:typeof this._tags[a]!="undefined"},getPossibleTagAttributes:function(a){return this._possible_tag_attributes||(this._possible_tag_attributes={}),this._possible_tag_attributes[a]||(this._possible_tag_attributes[a]=this.getUniqueAttributesAndEventsForTag(a).concat(this.getDefaultAttributesAndEventsForTag -(a))),this._possible_tag_attributes[a]}},WYMeditor.ParallelRegex=function(a){return this._case=a,this._patterns=[],this._labels=[],this._regex=null,this},WYMeditor.ParallelRegex.prototype.addPattern=function(a,b){b=b||!0;var c=this._patterns.length;this._patterns[c]=a,this._labels[c]=b,this._regex=null},WYMeditor.ParallelRegex.prototype.match=function(a){if(this._patterns.length===0)return[!1,""];var b=a.match(this._getCompoundedRegex());if(!b)return[!1,""];var c=b[0];for(var d=1;d","Comment")},WYMeditor.XhtmlLexer.prototype.addScriptTokens=function(a){this.addEntryPattern("","Script")},WYMeditor.XhtmlLexer.prototype.addCssTokens=function(a){this.addEntryPattern("","Css")},WYMeditor.XhtmlLexer.prototype.addTagTokens=function(a){this.addSpecialPattern("<\\s*[a-z0-9:-]+\\s*>",a,"OpeningTag"),this.addEntryPattern("<[a-z0-9:-]+[\\/ \\>]+",a,"OpeningTag"),this.addInTagDeclarationTokens("OpeningTag"),this.addSpecialPattern("",a,"ClosingTag")},WYMeditor.XhtmlLexer.prototype.addInTagDeclarationTokens=function(a){this.addSpecialPattern("\\s+",a,"Ignore"),this.addAttributeTokens(a),this.addExitPattern("/>",a),this.addExitPattern(">",a)},WYMeditor.XhtmlLexer.prototype.addAttributeTokens=function(a){this.addSpecialPattern("\\s*[a-z-_0-9]*:?[a-z-_0-9]+\\s*(?==)\\s*",a,"TagAttributes"),this.addEntryPattern('=\\s*"',a,"DoubleQuotedAttribute"),this.addPattern('\\\\"',"DoubleQuotedAttribute"),this.addExitPattern('"',"DoubleQuotedAttribute"),this.addEntryPattern("=\\s*'",a,"SingleQuotedAttribute"),this.addPattern("\\\\'","SingleQuotedAttribute"),this.addExitPattern("'","SingleQuotedAttribute"),this.addSpecialPattern("=\\s*[^>\\s]*",a,"UnquotedAttribute")},WYMeditor.XhtmlParser=function(a,b){return b=b||"Text",this._Lexer=new WYMeditor.XhtmlLexer(this),this._Listener=a,this._mode=b,this._matches=[],this._last_match="",this._current_match="",this},WYMeditor.XhtmlParser.prototype.parse=function(a){return this._Lexer.parse(this.beforeParsing(a)),this.afterParsing(this._Listener.getResult())},WYMeditor.XhtmlParser.prototype.beforeParsing=function(a){return(a.match(/class="MsoNormal"/)||a.match(/ns = "urn:schemas-microsoft-com/))&&this._Listener.avoidStylingTagsAndAttributes(),this._Listener.beforeParsing(a)},WYMeditor.XhtmlParser.prototype.afterParsing=function(a){return this._Listener._avoiding_tags_implicitly&&this._Listener.allowStylingTagsAndAttributes(),this._Listener.afterParsing(a)},WYMeditor.XhtmlParser.prototype.Ignore=function(a,b){return!0},WYMeditor.XhtmlParser.prototype.Text=function(a){return this._Listener.addContent(a),!0},WYMeditor.XhtmlParser.prototype.Comment=function(a,b){return this._addNonTagBlock(a,b,"addComment")},WYMeditor.XhtmlParser.prototype.Script=function(a,b){return this._addNonTagBlock(a,b,"addScript")},WYMeditor.XhtmlParser.prototype.Css=function(a,b){return this._addNonTagBlock(a,b,"addCss")},WYMeditor.XhtmlParser.prototype._addNonTagBlock=function(a,b,c){switch(b){case WYMeditor.LEXER_ENTER:this._non_tag=a;break;case WYMeditor.LEXER_UNMATCHED:this._non_tag+=a;break;case WYMeditor.LEXER_EXIT:switch(c){case"addComment":this._Listener.addComment(this._non_tag+a);break;case"addScript":this._Listener.addScript(this._non_tag+a);break;case"addCss":this._Listener.addCss(this._non_tag+a);break;default:}break;default:}return!0},WYMeditor.XhtmlParser.prototype.OpeningTag=function(a,b){switch(b){case WYMeditor.LEXER_ENTER:this._tag=this.normalizeTag(a),this._tag_attributes={};break;case WYMeditor.LEXER_SPECIAL:this._callOpenTagListener(this.normalizeTag(a));break;case WYMeditor.LEXER_EXIT:this._callOpenTagListener(this._tag,this._tag_attributes);break;default:}return!0},WYMeditor.XhtmlParser.prototype.ClosingTag=function(a,b){return this._callCloseTagListener(this.normalizeTag(a)),!0},WYMeditor.XhtmlParser.prototype._callOpenTagListener=function(a,b){b=b||{},this.autoCloseUnclosedBeforeNewOpening(a),this._Listener.isBlockTag(a)?(this._Listener._tag_stack.push(a),this._Listener.fixNestingBeforeOpeningBlockTag(a,b),this._Listener.openBlockTag(a,b),this._increaseOpenTagCounter(a)):this._Listener.isInlineTag(a)?this._Listener.inlineTag(a,b):(this._Listener.openUnknownTag(a,b),this._increaseOpenTagCounter(a)),this._Listener.last_tag=a,this._Listener.last_tag_opened=!0,this._Listener.last_tag_attributes=b},WYMeditor.XhtmlParser.prototype._callCloseTagListener=function(a){if(this._decreaseOpenTagCounter(a)){this.autoCloseUnclosedBeforeTagClosing(a);if(this._Listener.isBlockTag(a)){var b=this._Listener._tag_stack.pop();if(b===!1)return;b!=a&&(a=b),this._Listener.closeBlockTag(a)}else this._Listener.closeUnknownTag(a)}else this._Listener.closeUnopenedTag(a);this._Listener.last_tag=a,this._Listener.last_tag_opened=!1},WYMeditor.XhtmlParser.prototype._increaseOpenTagCounter=function(a){this._Listener._open_tags[a]=this._Listener._open_tags[a]||0,this._Listener._open_tags[a]++},WYMeditor.XhtmlParser.prototype._decreaseOpenTagCounter=function(a){return this._Listener._open_tags[a]?(this._Listener._open_tags[a]--,this._Listener._open_tags[a]===0&&(this._Listener._open_tags[a]=undefined),!0):!1},WYMeditor.XhtmlParser.prototype.autoCloseUnclosedBeforeNewOpening=function(a){this._autoCloseUnclosed(a,!1)},WYMeditor.XhtmlParser.prototype.autoCloseUnclosedBeforeTagClosing=function(a){this._autoCloseUnclosed(a,!0)},WYMeditor.XhtmlParser.prototype._autoCloseUnclosed=function(a,b){b=b||!1;if(this._Listener._open_tags)for(var c in this._Listener._open_tags){var d=this._Listener._open_tags[c];d>0&&this._Listener.shouldCloseTagAutomatically(c,a,b)&&this._callCloseTagListener(c,!0)}},WYMeditor.XhtmlParser.prototype.getTagReplacements=function(){return this._Listener.getTagReplacements()},WYMeditor.XhtmlParser.prototype.normalizeTag=function(a){a=a.replace(/^([\s<\/>]*)|([\s<\/>]*)$/gm,"").toLowerCase();var b=this._Listener.getTagReplacements();return b[a]?b[a]:a},WYMeditor.XhtmlParser.prototype.TagAttributes=function(a,b){return WYMeditor.LEXER_SPECIAL==b&&(this._current_attribute=a),!0},WYMeditor.XhtmlParser.prototype.DoubleQuotedAttribute=function(a,b){return WYMeditor.LEXER_UNMATCHED==b&&(this._tag_attributes[this._current_attribute]=a),!0},WYMeditor.XhtmlParser.prototype.SingleQuotedAttribute=function(a,b){return WYMeditor.LEXER_UNMATCHED==b&&(this._tag_attributes[this._current_attribute]=a),!0},WYMeditor.XhtmlParser.prototype.UnquotedAttribute=function(a,b){return this._tag_attributes[this._current_attribute]=a.replace(/^=/,""),!0},WYMeditor.XhtmlSaxListener=function(){return this.output="",this.helper=new WYMeditor.XmlHelper,this._open_tags={},this.validator=WYMeditor.XhtmlValidator,this._tag_stack=[],this.avoided_tags=[],this.entities={" ":" ","¡":"¡","¢":"¢","£":"£","¤":"¤","¥":"¥","¦":"¦","§":"§","¨":"¨","©":"©","ª":"ª","«":"«","¬":"¬","­":"­","®":"®","¯":"¯","°":"°","±":"±","²":"²","³":"³","´":"´","µ":"µ","¶":"¶","·":"·","¸":"¸","¹":"¹","º":"º","»":"»","¼":"¼","½":"½","¾":"¾","¿":"¿","À":"À","Á":"Á","Â":"Â","Ã":"Ã","Ä":"Ä","Å":"Å","Æ":"Æ","Ç":"Ç","È":"È","É":"É","Ê":"Ê","Ë":"Ë","Ì":"Ì","Í":"Í","Î":"Î","Ï":"Ï","Ð":"Ð","Ñ":"Ñ","Ò":"Ò","Ó":"Ó","Ô":"Ô","Õ":"Õ","Ö":"Ö","×":"×","Ø":"Ø","Ù":"Ù","Ú":"Ú","Û":"Û","Ü":"Ü","Ý":"Ý","Þ":"Þ","ß":"ß","à":"à","á":"á","â":"â","ã":"ã","ä":"ä","å":"å","æ":"æ","ç":"ç","è":"è","é":"é","ê":"ê","ë":"ë","ì":"ì","í":"í","î":"î","ï":"ï","ð":"ð","ñ":"ñ","ò":"ò","ó":"ó","ô":"ô","õ":"õ","ö":"ö","÷":"÷","ø":"ø","ù":"ù","ú":"ú","û":"û","ü":"ü","ý":"ý","þ":"þ","ÿ":"ÿ","Œ":"Œ","œ":"œ","Š":"Š","š":"š","Ÿ":"Ÿ","ƒ":"ƒ","ˆ":"ˆ","˜":"˜","Α":"Α","Β":"Β","Γ":"Γ","Δ":"Δ","Ε":"Ε","Ζ":"Ζ","Η":"Η","Θ":"Θ","Ι":"Ι","Κ":"Κ","Λ":"Λ","Μ":"Μ","Ν":"Ν","Ξ":"Ξ","Ο":"Ο","Π":"Π","Ρ":"Ρ","Σ":"Σ","Τ":"Τ","Υ":"Υ","Φ":"Φ","Χ":"Χ","Ψ":"Ψ","Ω":"Ω","α":"α","β":"β","γ":"γ","δ":"δ","ε":"ε","ζ":"ζ","η":"η","θ":"θ","ι":"ι","κ":"κ","λ":"λ","μ":"μ","ν":"ν","ξ":"ξ","ο":"ο","π":"π","ρ":"ρ","ς":"ς","σ":"σ","τ":"τ","υ":"υ","φ":"φ","χ":"χ","ψ":"ψ","ω":"ω","ϑ":"ϑ","ϒ":"ϒ","ϖ":"ϖ"," ":" "," ":" "," ":" ","‌":"‌","‍":"‍","‎":"‎","‏":"‏","–":"–","—":"—","‘":"‘","’":"’","‚":"‚","“":"“","”":"”","„":"„","†":"†","‡":"‡","•":"•","…":"…","‰":"‰","′":"′","″":"″","‹":"‹","›":"›","‾":"‾","⁄":"⁄","€":"€","ℑ":"ℑ","℘":"℘","ℜ":"ℜ","™":"™","ℵ":"ℵ","←":"←","↑":"↑","→":"→","↓":"↓","↔":"↔","↵":"↵","⇐":"⇐","⇑":"⇑","⇒":"⇒","⇓":"⇓","⇔":"⇔","∀":"∀","∂":"∂","∃":"∃","∅":"∅","∇":"∇","∈":"∈","∉":"∉","∋":"∋","∏":"∏","∑":"∑","−":"−","∗":"∗","√":"√","∝":"∝","∞":"∞","∠":"∠","∧":"∧","∨":"∨","∩":"∩","∪":"∪","∫":"∫","∴":"∴","∼":"∼","≅":"≅","≈":"≈","≠":"≠","≡":"≡","≤":"≤","≥":"≥","⊂":"⊂","⊃":"⊃","⊄":"⊄","⊆":"⊆","⊇":"⊇","⊕":"⊕","⊗":"⊗","⊥":"⊥","⋅":"⋅","⌈":"⌈","⌉":"⌉","⌊":"⌊","⌋":"⌋","⟨":"〈","⟩":"〉","◊":"◊","♠":"♠","♣":"♣","♥":"♥","♦":"♦"},this.block_tags=["a","abbr","acronym","address","area","b","base","bdo","big","blockquote","body","button","caption","cite","code","col","colgroup","dd","del","div","dfn","dl","dt","em","fieldset","form","head","h1","h2","h3","h4","h5","h6","html","i","ins","kbd","label","legend","li","map","noscript","object","ol","optgroup","option","p","param","pre","q","samp","script","select","small","span","strong","style","sub","sup","table","tbody","td","textarea","tfoot","th","thead","title","tr","tt","ul","var","extends"],this.inline_tags=["br","hr","img","input"],this},WYMeditor.XhtmlSaxListener.prototype.shouldCloseTagAutomatically=function(a,b,c){c=c||!1;if(a=="td"){if(c&&b=="tr"||!c&&b=="td")return!0}else if(a=="option")if(c&&b=="select"||!c&&b=="option")return!0;return!1},WYMeditor.XhtmlSaxListener.prototype.beforeParsing=function(a){return this.output="",a},WYMeditor.XhtmlSaxListener.prototype.afterParsing=function(a){return a=this.replaceNamedEntities(a),a=this.joinRepeatedEntities(a),a=this.removeEmptyTags(a),a=this.removeBrInPre(a),a},WYMeditor.XhtmlSaxListener.prototype.replaceNamedEntities=function(a){for(var b in this.entities)a=a.replace(new RegExp(b,"g"),this.entities[b]);return a},WYMeditor.XhtmlSaxListener.prototype.joinRepeatedEntities=function(a){var b="em|strong|sub|sup|acronym|pre|del|address";return a.replace(new RegExp("<\\1>",""),"").replace(new RegExp("(s*<("+b+")>s*){2}(.*)(s*s*){2}",""),"<$2>$3<$2>")},WYMeditor.XhtmlSaxListener.prototype.removeEmptyTags=function(a){return a.replace(new RegExp("<("+this.block_tags.join("|").replace(/\|td/,"").replace(/\|th/,"")+")>(
    | | |\\s)*","g"),"")},WYMeditor.XhtmlSaxListener.prototype.removeBrInPre=function(a){var b=a.match(new RegExp("]*>(.*?)","gmi"));if(b)for(var c=0;c","g"),String.fromCharCode(13,10)));return a},WYMeditor.XhtmlSaxListener.prototype.getResult=function(){return this.output},WYMeditor.XhtmlSaxListener.prototype.getTagReplacements=function(){return{b:"strong",i:"em"}},WYMeditor.XhtmlSaxListener.prototype.addContent=function(a){this.last_tag&&this.last_tag=="li"&&(a=a.replace(/\n/,""),a=a.replace(/\r/,"")),this.output+=a},WYMeditor.XhtmlSaxListener.prototype.addComment=function(a){this.remove_comments&&(this.output+=a)},WYMeditor.XhtmlSaxListener.prototype.addScript=function(a){this.remove_scripts||(this.output+=a)},WYMeditor.XhtmlSaxListener.prototype.addCss=function(a){this.remove_embeded_styles||(this.output+=a)},WYMeditor.XhtmlSaxListener.prototype.openBlockTag=function(a,b){this.output+=this.helper.tag(a,this.validator.getValidTagAttributes(a,b),!0)},WYMeditor.XhtmlSaxListener.prototype.inlineTag=function(a,b){this.output+=this.helper.tag(a,this.validator.getValidTagAttributes(a,b))},WYMeditor.XhtmlSaxListener.prototype.openUnknownTag=function(a,b){},WYMeditor.XhtmlSaxListener.prototype.closeBlockTag=function(a){this.output=this.output.replace(/
    $/,"")+this._getClosingTagContent("before",a)+""+this._getClosingTagContent("after",a)},WYMeditor.XhtmlSaxListener.prototype.closeUnknownTag=function(a){},WYMeditor.XhtmlSaxListener.prototype.closeUnopenedTag=function(a){this.output+=""},WYMeditor.XhtmlSaxListener.prototype.avoidStylingTagsAndAttributes=function(){this.avoided_tags=["div","span"],this.validator.skiped_attributes=["style"],this.validator.skiped_attribute_values=["MsoNormal","main1"],this._avoiding_tags_implicitly=!0},WYMeditor.XhtmlSaxListener.prototype.allowStylingTagsAndAttributes=function(){this.avoided_tags=[],this.validator.skiped_attributes=[],this.validator.skiped_attribute_values=[],this._avoiding_tags_implicitly=!1},WYMeditor.XhtmlSaxListener.prototype.isBlockTag=function(a){return!WYMeditor.Helper.contains(this.avoided_tags,a)&&WYMeditor.Helper.contains(this.block_tags,a)},WYMeditor.XhtmlSaxListener.prototype.isInlineTag=function(a){return!WYMeditor.Helper.contains(this.avoided_tags,a)&&WYMeditor.Helper.contains(this.inline_tags,a)},WYMeditor.XhtmlSaxListener.prototype.insertContentAfterClosingTag=function(a,b){this._insertContentWhenClosingTag("after",a,b)},WYMeditor.XhtmlSaxListener.prototype.insertContentBeforeClosingTag=function(a,b){this._insertContentWhenClosingTag("before",a,b)},WYMeditor.XhtmlSaxListener.prototype.fixNestingBeforeOpeningBlockTag=function(a,b){if((a=="ul"||a=="ol")&&this.last_tag&&!this.last_tag_opened&&this.last_tag=="li")this.output=this.output.replace(/<\/li>\s*$/,""),this.insertContentAfterClosingTag(a,"");else if(a!="ul"&&a!="ol"||!this.last_tag||!this.last_tag_opened||this.last_tag!="ul"&&this.last_tag!="ol"){if(a=="li"&&!this.last_tag_opened&&this._tag_stack.length>=2){var c=this._tag_stack[this._tag_stack.length-2];c=="li"&&(this._open_tags.li--,this._open_tags.li===0&&(this._open_tags.li=undefined),this._tag_stack.pop(this._tag_stack.length-2),this.output+="")}}else this.output+=this.helper.tag("li",{},!0),this.insertContentAfterClosingTag(a,"")},WYMeditor.XhtmlSaxListener.prototype._insertContentWhenClosingTag=function(a,b,c){this["_insert_"+a+"_closing"]||(this["_insert_"+a+"_closing"]=[]),this["_insert_"+a+"_closing"][b]||(this["_insert_"+a+"_closing"][b]=[]),this["_insert_"+a+"_closing"][b].push(c)},WYMeditor.XhtmlSaxListener.prototype._getClosingTagContent=function(a,b){return this["_insert_"+a+"_closing"]&&this["_insert_"+a+"_closing"][b]&&this["_insert_"+a+"_closing"][b].length>0?this["_insert_"+a+"_closing"][b].pop():""},WYMeditor.WymCssLexer=function(a,b){return b=typeof b=="undefined"?!0:b,jQuery.extend(this,new WYMeditor.Lexer(a,b?"Ignore":"WymCss")),this.mapHandler("WymCss","Ignore"),b===!0&&(this.addEntryPattern("/\\*[<\\s]*WYMeditor[>\\s]*\\*/","Ignore","WymCss"),this.addExitPattern("/\\*[\\s]*\\*/","WymCss")),this.addSpecialPattern("[\\sa-z1-6]*\\.[a-z-_0-9]+","WymCss","WymCssStyleDeclaration"),this.addEntryPattern("/\\*","WymCss","WymCssComment"),this.addExitPattern("\\*/","WymCssComment"),this.addEntryPattern("{","WymCss","WymCssStyle"),this.addExitPattern("}","WymCssStyle"),this.addEntryPattern("/\\*","WymCssStyle","WymCssFeedbackStyle"),this.addExitPattern("\\*/","WymCssFeedbackStyle"),this},WYMeditor.WymCssParser=function(){return this._in_style=!1,this._has_title=!1,this.only_wym_blocks=!0,this.css_settings={classesItems:[],editorStyles:[],dialogStyles:[]},this},WYMeditor.WymCssParser.prototype.parse=function(a,b){b=typeof b=="undefined"?this.only_wym_blocks:b,this._Lexer=new WYMeditor.WymCssLexer(this,b),this._Lexer.parse(a)},WYMeditor.WymCssParser.prototype.Ignore=function(a,b){return!0},WYMeditor.WymCssParser.prototype.WymCssComment=function(a,b){return a.match(/end[a-z0-9\s]*wym[a-z0-9\s]*/mi)?!1:(b==WYMeditor.LEXER_UNMATCHED&&(this._in_style?this._current_item[this._current_element]&&(this._current_item[this._current_element].expressions?this._current_item[this._current_element].expressions.push(a):this._current_item[this._current_element].expressions=[a]):(this._has_title=!0,this._current_item={title:WYMeditor.Helper.trim(a)}),this._in_style=!0),!0)},WYMeditor.WymCssParser.prototype.WymCssStyle=function(a,b){return b==WYMeditor.LEXER_UNMATCHED?(a=WYMeditor.Helper.trim(a),a!==""&&(this._current_item[this._current_element].style=a)):b==WYMeditor.LEXER_EXIT&&(this._in_style=!1,this._has_title=!1,this.addStyleSetting(this._current_item)),!0},WYMeditor.WymCssParser.prototype.WymCssFeedbackStyle=function(a,b){return b==WYMeditor.LEXER_UNMATCHED&&(this._current_item[this._current_element].feedback_style=a.replace(/^([\s\/\*]*)|([\s\/\*]*)$/gm,"")),!0},WYMeditor.WymCssParser.prototype.WymCssStyleDeclaration=function(a){a=a.replace(/^([\s\.]*)|([\s\.*]*)$/gm,"");var b="";if(a.indexOf(".")>0){var c=a.split(".");this._current_element=c[1],b=c[0]}else this._current_element=a;return this._has_title||(this._current_item={title:(b?b.toUpperCase()+": ":"")+this._current_element},this._has_title=!0),this._current_item[this._current_element]||(this._current_item[this._current_element]={name:this._current_element}),b&&(this._current_item[this._current_element].tags?this._current_item[this._current_element].tags.push(b):this._current_item[this._current_element].tags=[b]),!0},WYMeditor.WymCssParser.prototype.addStyleSetting=function(a){for(var b in a){var c=a[b];typeof c=="object"&&b!="title"&&(this.css_settings.classesItems.push({name:WYMeditor.Helper.trim(c.name),title:a.title,expr:WYMeditor.Helper.trim((c.expressions||c.tags).join(", "))}),c.feedback_style&&this.css_settings.editorStyles.push({name:"."+WYMeditor.Helper.trim(c.name),css:c.feedback_style}),c.style&&this.css_settings.dialogStyles.push({name:"."+WYMeditor.Helper.trim(c.name),css:c.style}))}}; \ No newline at end of file diff --git a/vendor/assets/javascripts/wymeditor/lang/bg.js b/vendor/assets/javascripts/wymeditor/lang/bg.js deleted file mode 100644 index 35a8e2b..0000000 --- a/vendor/assets/javascripts/wymeditor/lang/bg.js +++ /dev/null @@ -1,45 +0,0 @@ -WYMeditor.STRINGS.bg = { - Strong: 'Получер', - Emphasis: 'Курсив', - Superscript: 'Горен индекс', - Subscript: 'Долен индекс', - Ordered_List: 'Подреден списък', - Unordered_List: 'Неподреден списък', - Indent: 'Блок навътре', - Outdent: 'Блок навън', - Undo: 'Стъпка назад', - Redo: 'Стъпка напред', - Link: 'Създай хипервръзка', - Unlink: 'Премахни хипервръзката', - Image: 'Изображение', - Table: 'Таблица', - HTML: 'HTML', - Paragraph: 'Абзац', - Heading_1: 'Заглавие 1', - Heading_2: 'Заглавие 2', - Heading_3: 'Заглавие 3', - Heading_4: 'Заглавие 4', - Heading_5: 'Заглавие 5', - Heading_6: 'Заглавие 6', - Preformatted: 'Преформатиран', - Blockquote: 'Цитат', - Table_Header: 'Заглавие на таблицата', - URL: 'URL', - Title: 'Заглавие', - Alternative_Text: 'Алтернативен текст', - Caption: 'Етикет', - Summary: 'Общо', - Number_Of_Rows: 'Брой редове', - Number_Of_Cols: 'Брой колони', - Submit: 'Изпрати', - Cancel: 'Отмени', - Choose: 'Затвори', - Preview: 'Предварителен преглед', - Paste_From_Word: 'Вмъкни от MS WORD', - Tools: 'Инструменти', - Containers: 'Контейнери', - Classes: 'Класове', - Status: 'Статус', - Source_Code: 'Източник, код' -}; - diff --git a/vendor/assets/javascripts/wymeditor/lang/ca.js b/vendor/assets/javascripts/wymeditor/lang/ca.js deleted file mode 100644 index 595b8ce..0000000 --- a/vendor/assets/javascripts/wymeditor/lang/ca.js +++ /dev/null @@ -1,45 +0,0 @@ -WYMeditor.STRINGS.ca = { - Strong: 'Ressaltar', - Emphasis: 'Emfatitzar', - Superscript: 'Superindex', - Subscript: 'Subindex', - Ordered_List: 'Llistat ordenat', - Unordered_List: 'Llistat sense ordenar', - Indent: 'Indentat', - Outdent: 'Sense indentar', - Undo: 'Desfer', - Redo: 'Refer', - Link: 'Enllaçar', - Unlink: 'Eliminar enllaç', - Image: 'Imatge', - Table: 'Taula', - HTML: 'HTML', - Paragraph: 'Paràgraf', - Heading_1: 'Capçalera 1', - Heading_2: 'Capçalera 2', - Heading_3: 'Capçalera 3', - Heading_4: 'Capçalera 4', - Heading_5: 'Capçalera 5', - Heading_6: 'Capçalera 6', - Preformatted: 'Pre-formatejat', - Blockquote: 'Cita', - Table_Header: 'Capçalera de la taula', - URL: 'URL', - Title: 'Títol', - Alternative_Text: 'Text alternatiu', - Caption: 'Llegenda', - Summary: 'Summary', - Number_Of_Rows: 'Nombre de files', - Number_Of_Cols: 'Nombre de columnes', - Submit: 'Enviar', - Cancel: 'Cancel·lar', - Choose: 'Triar', - Preview: 'Vista prèvia', - Paste_From_Word: 'Pegar des de Word', - Tools: 'Eines', - Containers: 'Contenidors', - Classes: 'Classes', - Status: 'Estat', - Source_Code: 'Codi font' -}; - diff --git a/vendor/assets/javascripts/wymeditor/lang/cs.js b/vendor/assets/javascripts/wymeditor/lang/cs.js deleted file mode 100644 index fdbbcc4..0000000 --- a/vendor/assets/javascripts/wymeditor/lang/cs.js +++ /dev/null @@ -1,45 +0,0 @@ -WYMeditor.STRINGS.cs = { - Strong: 'Tučné', - Emphasis: 'Kurzíva', - Superscript: 'Horní index', - Subscript: 'Dolní index', - Ordered_List: 'Číslovaný seznam', - Unordered_List: 'Nečíslovaný seznam', - Indent: 'Zvětšit odsazení', - Outdent: 'Zmenšit odsazení', - Undo: 'Zpět', - Redo: 'Znovu', - Link: 'Vytvořit odkaz', - Unlink: 'Zrušit odkaz', - Image: 'Obrázek', - Table: 'Tabulka', - HTML: 'HTML', - Paragraph: 'Odstavec', - Heading_1: 'Nadpis 1. úrovně', - Heading_2: 'Nadpis 2. úrovně', - Heading_3: 'Nadpis 3. úrovně', - Heading_4: 'Nadpis 4. úrovně', - Heading_5: 'Nadpis 5. úrovně', - Heading_6: 'Nadpis 6. úrovně', - Preformatted: 'Předformátovaný text', - Blockquote: 'Citace', - Table_Header: 'Hlavičková buňka tabulky', - URL: 'Adresa', - Title: 'Text po najetí myší', - Alternative_Text: 'Text pro případ nezobrazení obrázku', - Caption: 'Titulek tabulky', - Summary: 'Shrnutí obsahu', - Number_Of_Rows: 'Počet řádek', - Number_Of_Cols: 'Počet sloupců', - Submit: 'Vytvořit', - Cancel: 'Zrušit', - Choose: 'Vybrat', - Preview: 'Náhled', - Paste_From_Word: 'Vložit z Wordu', - Tools: 'Nástroje', - Containers: 'Typy obsahu', - Classes: 'Třídy', - Status: 'Stav', - Source_Code: 'Zdrojový kód' -}; - diff --git a/vendor/assets/javascripts/wymeditor/lang/cy.js b/vendor/assets/javascripts/wymeditor/lang/cy.js deleted file mode 100644 index e812677..0000000 --- a/vendor/assets/javascripts/wymeditor/lang/cy.js +++ /dev/null @@ -1,45 +0,0 @@ -WYMeditor.STRINGS.cy = { - Strong: 'Bras', - Emphasis: 'Italig', - Superscript: 'Uwchsgript', - Subscript: 'Is-sgript', - Ordered_List: 'Rhestr mewn Trefn', - Unordered_List: 'Pwyntiau Bwled', - Indent: 'Mewnoli', - Outdent: 'Alloli', - Undo: 'Dadwneud', - Redo: 'Ailwneud', - Link: 'Cysylltu', - Unlink: 'Datgysylltu', - Image: 'Delwedd', - Table: 'Tabl', - HTML: 'HTML', - Paragraph: 'Paragraff', - Heading_1: 'Pennawd 1', - Heading_2: 'Pennawd 2', - Heading_3: 'Pennawd 3', - Heading_4: 'Pennawd 4', - Heading_5: 'Pennawd 5', - Heading_6: 'Pennawd 6', - Preformatted: 'Rhagfformat', - Blockquote: 'Bloc Dyfyniad', - Table_Header: 'Pennyn Tabl', - URL: 'URL', - Title: 'Teitl', - Alternative_Text: 'Testun Amgen', - Caption: 'Pennawd', - Summary: 'Crynodeb', - Number_Of_Rows: 'Nifer y rhesi', - Number_Of_Cols: 'Nifer y colofnau', - Submit: 'Anfon', - Cancel: 'Diddymu', - Choose: 'Dewis', - Preview: 'Rhagolwg', - Paste_From_Word: 'Gludo o Word', - Tools: 'Offer', - Containers: 'Cynhwysyddion', - Classes: 'Dosbarthiadau', - Status: 'Statws', - Source_Code: 'Cod ffynhonnell' -}; - diff --git a/vendor/assets/javascripts/wymeditor/lang/de.js b/vendor/assets/javascripts/wymeditor/lang/de.js deleted file mode 100644 index d106829..0000000 --- a/vendor/assets/javascripts/wymeditor/lang/de.js +++ /dev/null @@ -1,45 +0,0 @@ -WYMeditor.STRINGS.de = { - Strong: 'Fett', - Emphasis: 'Kursiv', - Superscript: 'Text hochstellen', - Subscript: 'Text tiefstellen', - Ordered_List: 'Geordnete Liste einfügen', - Unordered_List: 'Ungeordnete Liste einfügen', - Indent: 'Einzug erhöhen', - Outdent: 'Einzug vermindern', - Undo: 'Befehle rückgängig machen', - Redo: 'Befehle wiederherstellen', - Link: 'Hyperlink einfügen', - Unlink: 'Hyperlink entfernen', - Image: 'Bild einfügen', - Table: 'Tabelle einfügen', - HTML: 'HTML anzeigen/verstecken', - Paragraph: 'Absatz', - Heading_1: 'Überschrift 1', - Heading_2: 'Überschrift 2', - Heading_3: 'Überschrift 3', - Heading_4: 'Überschrift 4', - Heading_5: 'Überschrift 5', - Heading_6: 'Überschrift 6', - Preformatted: 'Vorformatiert', - Blockquote: 'Zitat', - Table_Header: 'Tabellenüberschrift', - URL: 'URL', - Title: 'Titel', - Alternative_Text: 'Alternativer Text', - Caption: 'Tabellenüberschrift', - Summary: 'Summary', - Number_Of_Rows: 'Anzahl Zeilen', - Number_Of_Cols: 'Anzahl Spalten', - Submit: 'Absenden', - Cancel: 'Abbrechen', - Choose: 'Auswählen', - Preview: 'Vorschau', - Paste_From_Word: 'Aus Word einfügen', - Tools: 'Werkzeuge', - Containers: 'Inhaltstyp', - Classes: 'Klassen', - Status: 'Status', - Source_Code: 'Quellcode' -}; - diff --git a/vendor/assets/javascripts/wymeditor/lang/en.js b/vendor/assets/javascripts/wymeditor/lang/en.js deleted file mode 100644 index df7ac51..0000000 --- a/vendor/assets/javascripts/wymeditor/lang/en.js +++ /dev/null @@ -1,45 +0,0 @@ -WYMeditor.STRINGS.en = { - Strong: 'Strong', - Emphasis: 'Emphasis', - Superscript: 'Superscript', - Subscript: 'Subscript', - Ordered_List: 'Ordered List', - Unordered_List: 'Unordered List', - Indent: 'Indent', - Outdent: 'Outdent', - Undo: 'Undo', - Redo: 'Redo', - Link: 'Link', - Unlink: 'Unlink', - Image: 'Image', - Table: 'Table', - HTML: 'HTML', - Paragraph: 'Paragraph', - Heading_1: 'Heading 1', - Heading_2: 'Heading 2', - Heading_3: 'Heading 3', - Heading_4: 'Heading 4', - Heading_5: 'Heading 5', - Heading_6: 'Heading 6', - Preformatted: 'Preformatted', - Blockquote: 'Blockquote', - Table_Header: 'Table Header', - URL: 'URL', - Title: 'Title', - Relationship: 'Relationship', - Alternative_Text: 'Alternative text', - Caption: 'Caption', - Summary: 'Summary', - Number_Of_Rows: 'Number of rows', - Number_Of_Cols: 'Number of cols', - Submit: 'Submit', - Cancel: 'Cancel', - Choose: 'Choose', - Preview: 'Preview', - Paste_From_Word: 'Paste from Word', - Tools: 'Tools', - Containers: 'Containers', - Classes: 'Classes', - Status: 'Status', - Source_Code: 'Source code' -}; \ No newline at end of file diff --git a/vendor/assets/javascripts/wymeditor/lang/es.js b/vendor/assets/javascripts/wymeditor/lang/es.js deleted file mode 100644 index 4a89b00..0000000 --- a/vendor/assets/javascripts/wymeditor/lang/es.js +++ /dev/null @@ -1,45 +0,0 @@ -WYMeditor.STRINGS.es = { - Strong: 'Resaltar', - Emphasis: 'Enfatizar', - Superscript: 'Superindice', - Subscript: 'Subindice', - Ordered_List: 'Lista ordenada', - Unordered_List: 'Lista sin ordenar', - Indent: 'Indentado', - Outdent: 'Sin indentar', - Undo: 'Deshacer', - Redo: 'Rehacer', - Link: 'Enlazar', - Unlink: 'Eliminar enlace', - Image: 'Imagen', - Table: 'Tabla', - HTML: 'HTML', - Paragraph: 'Párrafo', - Heading_1: 'Cabecera 1', - Heading_2: 'Cabecera 2', - Heading_3: 'Cabecera 3', - Heading_4: 'Cabecera 4', - Heading_5: 'Cabecera 5', - Heading_6: 'Cabecera 6', - Preformatted: 'Preformateado', - Blockquote: 'Cita', - Table_Header: 'Cabecera de la tabla', - URL: 'URL', - Title: 'Título', - Alternative_Text: 'Texto alternativo', - Caption: 'Leyenda', - Summary: 'Summary', - Number_Of_Rows: 'Número de filas', - Number_Of_Cols: 'Número de columnas', - Submit: 'Enviar', - Cancel: 'Cancelar', - Choose: 'Seleccionar', - Preview: 'Vista previa', - Paste_From_Word: 'Pegar desde Word', - Tools: 'Herramientas', - Containers: 'Contenedores', - Classes: 'Clases', - Status: 'Estado', - Source_Code: 'Código fuente' -}; - diff --git a/vendor/assets/javascripts/wymeditor/lang/fa.js b/vendor/assets/javascripts/wymeditor/lang/fa.js deleted file mode 100644 index c948f24..0000000 --- a/vendor/assets/javascripts/wymeditor/lang/fa.js +++ /dev/null @@ -1,46 +0,0 @@ -//Translation To Persian: Ghassem Tofighi (http://ght.ir) -WYMeditor.STRINGS.fa = { - Strong: 'پررنگ',//Strong - Emphasis: 'ایتالیک',//Emphasis - Superscript: 'بالانويس‌ ',//Superscript - Subscript: 'زيرنويس‌',//Subscript - Ordered_List: 'لیست مرتب',//Ordered List - Unordered_List: 'لیست نامرتب',//Unordered List - Indent: 'افزودن دندانه',//Indent - Outdent: 'کاهش دندانه',//Outdent - Undo: 'واگردانی',//Undo - Redo: 'تکرار',//Redo - Link: 'ساختن پیوند',//Link - Unlink: 'برداشتن پیوند',//Unlink - Image: 'تصویر',//Image - Table: 'جدول',//Table - HTML: 'HTML',//HTML - Paragraph: 'پاراگراف',//Paragraph - Heading_1: 'سرتیتر ۱',//Heading 1 - Heading_2: 'سرتیتر ۲',//Heading 2 - Heading_3: 'سرتیتر ۳',//Heading 3 - Heading_4: 'سرتیتر ۴',//Heading 4 - Heading_5: 'سرتیتر ۵',//Heading 5 - Heading_6: 'سرتیتر ۶',//Heading 6 - Preformatted: 'قالب آماده',//Preformatted - Blockquote: 'نقل قول',//Blockquote - Table_Header: 'سرجدول',//Table Header - URL: 'آدرس اینترنتی',//URL - Title: 'عنوان',//Title - Alternative_Text: 'متن جایگزین',//Alternative text - Caption: 'عنوان',//Caption - Summary: 'Summary', - Number_Of_Rows: 'تعداد سطرها',//Number of rows - Number_Of_Cols: 'تعداد ستون‌ها',//Number of cols - Submit: 'فرستادن',//Submit - Cancel: 'لغو',//Cancel - Choose: 'انتخاب',//Choose - Preview: 'پیش‌نمایش',//Preview - Paste_From_Word: 'انتقال از ورد',//Paste from Word - Tools: 'ابزار',//Tools - Containers: '‌قالب‌ها',//Containers - Classes: 'کلاس‌ها',//Classes - Status: 'وضعیت',//Status - Source_Code: 'کد مبدأ'//Source code -}; - diff --git a/vendor/assets/javascripts/wymeditor/lang/fi.js b/vendor/assets/javascripts/wymeditor/lang/fi.js deleted file mode 100644 index 529fcec..0000000 --- a/vendor/assets/javascripts/wymeditor/lang/fi.js +++ /dev/null @@ -1,44 +0,0 @@ -WYMeditor.STRINGS.fi = { - Strong: 'Lihavoitu', - Emphasis: 'Korostus', - Superscript: 'Yläindeksi', - Subscript: 'Alaindeksi', - Ordered_List: 'Numeroitu lista', - Unordered_List: 'Luettelomerkit', - Indent: 'Suurenna sisennystä', - Outdent: 'Pienennä sisennystä', - Undo: 'Kumoa', - Redo: 'Toista', - Link: 'Linkitä', - Unlink: 'Poista linkitys', - Image: 'Kuva', - Table: 'Taulukko', - HTML: 'HTML', - Paragraph: 'Kappale', - Heading_1: 'Otsikko 1', - Heading_2: 'Otsikko 2', - Heading_3: 'Otsikko 3', - Heading_4: 'Otsikko 4', - Heading_5: 'Otsikko 5', - Heading_6: 'Otsikko 6', - Preformatted: 'Esimuotoilu', - Blockquote: 'Sitaatti', - Table_Header: 'Taulukon otsikko', - URL: 'URL', - Title: 'Otsikko', - Alternative_Text: 'Vaihtoehtoinen teksti', - Caption: 'Kuvateksti', - Summary: 'Yhteenveto', - Number_Of_Rows: 'Rivien määrä', - Number_Of_Cols: 'Palstojen määrä', - Submit: 'Lähetä', - Cancel: 'Peruuta', - Choose: 'Valitse', - Preview: 'Esikatsele', - Paste_From_Word: 'Tuo Wordista', - Tools: 'Työkalut', - Containers: 'Muotoilut', - Classes: 'Luokat', - Status: 'Tila', - Source_Code: 'Lähdekoodi' -}; diff --git a/vendor/assets/javascripts/wymeditor/lang/fr.js b/vendor/assets/javascripts/wymeditor/lang/fr.js deleted file mode 100644 index 1b2ab75..0000000 --- a/vendor/assets/javascripts/wymeditor/lang/fr.js +++ /dev/null @@ -1,45 +0,0 @@ -WYMeditor.STRINGS.fr = { - Strong: 'Mise en évidence', - Emphasis: 'Emphase', - Superscript: 'Exposant', - Subscript: 'Indice', - Ordered_List: 'Liste Ordonnée', - Unordered_List: 'Liste Non-Ordonnée', - Indent: 'Imbriqué', - Outdent: 'Non-imbriqué', - Undo: 'Annuler', - Redo: 'Rétablir', - Link: 'Lien', - Unlink: 'Supprimer le Lien', - Image: 'Image', - Table: 'Tableau', - HTML: 'HTML', - Paragraph: 'Paragraphe', - Heading_1: 'Titre 1', - Heading_2: 'Titre 2', - Heading_3: 'Titre 3', - Heading_4: 'Titre 4', - Heading_5: 'Titre 5', - Heading_6: 'Titre 6', - Preformatted: 'Pré-formatté', - Blockquote: 'Citation', - Table_Header: 'Cellule de titre', - URL: 'URL', - Title: 'Titre', - Alternative_Text: 'Texte alternatif', - Caption: 'Légende', - Summary: 'Résumé', - Number_Of_Rows: 'Nombre de lignes', - Number_Of_Cols: 'Nombre de colonnes', - Submit: 'Envoyer', - Cancel: 'Annuler', - Choose: 'Choisir', - Preview: 'Prévisualisation', - Paste_From_Word: 'Copier depuis Word', - Tools: 'Outils', - Containers: 'Type de texte', - Classes: 'Type de contenu', - Status: 'Infos', - Source_Code: 'Code source' -}; - diff --git a/vendor/assets/javascripts/wymeditor/lang/gl.js b/vendor/assets/javascripts/wymeditor/lang/gl.js deleted file mode 100644 index 58a0af4..0000000 --- a/vendor/assets/javascripts/wymeditor/lang/gl.js +++ /dev/null @@ -1,45 +0,0 @@ -WYMeditor.STRINGS.gl = { - Strong: 'Moita énfase', - Emphasis: 'Énfase', - Superscript: 'Superíndice', - Subscript: 'Subíndice', - Ordered_List: 'Lista ordenada', - Unordered_List: 'Lista sen ordenar', - Indent: 'Aniñar', - Outdent: 'Desaniñar', - Undo: 'Desfacer', - Redo: 'Refacer', - Link: 'Ligazón', - Unlink: 'Desligar', - Image: 'Imaxe', - Table: 'Táboa', - HTML: 'HTML', - Paragraph: 'Parágrafo', - Heading_1: 'Título 1', - Heading_2: 'Título 2', - Heading_3: 'Título 3', - Heading_4: 'Título 4', - Heading_5: 'Título 5', - Heading_6: 'Título 6', - Preformatted: 'Preformatado', - Blockquote: 'Cita en parágrafo', - Table_Header: 'Cabeceira da táboa', - URL: 'URL', - Title: 'Título', - Alternative_Text: 'Texto alternativo', - Caption: 'Título', - Summary: 'Resumo', - Number_Of_Rows: 'Número de filas', - Number_Of_Cols: 'Número de columnas', - Submit: 'Enviar', - Cancel: 'Cancelar', - Choose: 'Escoller', - Preview: 'Previsualizar', - Paste_From_Word: 'Colar dende Word', - Tools: 'Ferramentas', - Containers: 'Contenedores', - Classes: 'Clases', - Status: 'Estado', - Source_Code: 'Código fonte' -}; - diff --git a/vendor/assets/javascripts/wymeditor/lang/he.js b/vendor/assets/javascripts/wymeditor/lang/he.js deleted file mode 100644 index 3d57c33..0000000 --- a/vendor/assets/javascripts/wymeditor/lang/he.js +++ /dev/null @@ -1,45 +0,0 @@ -WYMeditor.STRINGS.he = { - Strong: 'חזק', - Emphasis: 'מובלט', - Superscript: 'כתב עילי', - Subscript: 'כתב תחתי', - Ordered_List: 'רשימה ממוספרת', - Unordered_List: 'רשימה לא ממוספרת', - Indent: 'הזחה פנימה', - Outdent: 'הזחה החוצה', - Undo: 'בטל פעולה', - Redo: 'בצע מחדש פעולה', - Link: 'קישור', - Unlink: 'בטל קישור', - Image: 'תמונה', - Table: 'טבלה', - HTML: 'קוד HTML', - Paragraph: 'פסקה', - Heading_1: 'כותרת 1 ; תג <h1>', - Heading_2: 'כותרת 2 ; תג <h2>', - Heading_3: 'כותרת 3 ; תג <h3>', - Heading_4: 'כותרת 4 ; תג <h4>', - Heading_5: 'כותרת 5 ; תג <h5>', - Heading_6: 'כותרת 6 ; תג <h6>', - Preformatted: 'משמר רווחים', - Blockquote: 'ציטוט', - Table_Header: 'כותרת טבלה', - URL: 'קישור (URL)', - Title: 'כותרת', - Alternative_Text: 'טקסט חלופי', - Caption: 'כותרת', - Summary: 'סיכום', - Number_Of_Rows: 'מספר שורות', - Number_Of_Cols: 'מספר טורים', - Submit: 'שלח', - Cancel: 'בטל', - Choose: 'בחר', - Preview: 'תצוגה מקדימה', - Paste_From_Word: 'העתק מ-Word', - Tools: 'כלים', - Containers: 'מיכלים', - Classes: 'מחלקות', - Status: 'מצב', - Source_Code: 'קוד מקור' -}; - diff --git a/vendor/assets/javascripts/wymeditor/lang/hr.js b/vendor/assets/javascripts/wymeditor/lang/hr.js deleted file mode 100644 index 22d6bda..0000000 --- a/vendor/assets/javascripts/wymeditor/lang/hr.js +++ /dev/null @@ -1,45 +0,0 @@ -WYMeditor.STRINGS.hr = { - Strong: 'Podebljano', - Emphasis: 'Naglašeno', - Superscript: 'Iznad', - Subscript: 'Ispod', - Ordered_List: 'Pobrojana lista', - Unordered_List: 'Nepobrojana lista', - Indent: 'Uvuci', - Outdent: 'Izvuci', - Undo: 'Poništi promjenu', - Redo: 'Ponovno promjeni', - Link: 'Hiperveza', - Unlink: 'Ukloni hipervezu', - Image: 'Slika', - Table: 'Tablica', - HTML: 'HTML', - Paragraph: 'Paragraf', - Heading_1: 'Naslov 1', - Heading_2: 'Naslov 2', - Heading_3: 'Naslov 3', - Heading_4: 'Naslov 4', - Heading_5: 'Naslov 5', - Heading_6: 'Naslov 6', - Preformatted: 'Unaprijed formatirano', - Blockquote: 'Citat', - Table_Header: 'Zaglavlje tablice', - URL: 'URL', - Title: 'Naslov', - Alternative_Text: 'Alternativni tekst', - Caption: 'Zaglavlje', - Summary: 'Sažetak', - Number_Of_Rows: 'Broj redova', - Number_Of_Cols: 'Broj kolona', - Submit: 'Snimi', - Cancel: 'Odustani', - Choose: 'Izaberi', - Preview: 'Pregled', - Paste_From_Word: 'Zalijepi iz Word-a', - Tools: 'Alati', - Containers: 'Kontejneri', - Classes: 'Klase', - Status: 'Status', - Source_Code: 'Izvorni kod' -}; - diff --git a/vendor/assets/javascripts/wymeditor/lang/hu.js b/vendor/assets/javascripts/wymeditor/lang/hu.js deleted file mode 100644 index fcc3a4e..0000000 --- a/vendor/assets/javascripts/wymeditor/lang/hu.js +++ /dev/null @@ -1,45 +0,0 @@ -WYMeditor.STRINGS.hu = { - Strong: 'Félkövér', - Emphasis: 'Kiemelt', - Superscript: 'Felső index', - Subscript: 'Alsó index', - Ordered_List: 'Rendezett lista', - Unordered_List: 'Rendezetlen lista', - Indent: 'Bekezdés', - Outdent: 'Bekezdés törlése', - Undo: 'Visszavon', - Redo: 'Visszaállít', - Link: 'Link', - Unlink: 'Link törlése', - Image: 'Kép', - Table: 'Tábla', - HTML: 'HTML', - Paragraph: 'Bekezdés', - Heading_1: 'Címsor 1', - Heading_2: 'Címsor 2', - Heading_3: 'Címsor 3', - Heading_4: 'Címsor 4', - Heading_5: 'Címsor 5', - Heading_6: 'Címsor 6', - Preformatted: 'Előformázott', - Blockquote: 'Idézet', - Table_Header: 'Tábla Fejléc', - URL: 'Webcím', - Title: 'Megnevezés', - Alternative_Text: 'Alternatív szöveg', - Caption: 'Fejléc', - Summary: 'Summary', - Number_Of_Rows: 'Sorok száma', - Number_Of_Cols: 'Oszlopok száma', - Submit: 'Elküld', - Cancel: 'Mégsem', - Choose: 'Választ', - Preview: 'Előnézet', - Paste_From_Word: 'Másolás Word-ból', - Tools: 'Eszközök', - Containers: 'Tartalmak', - Classes: 'Osztályok', - Status: 'Állapot', - Source_Code: 'Forráskód' -}; - diff --git a/vendor/assets/javascripts/wymeditor/lang/it.js b/vendor/assets/javascripts/wymeditor/lang/it.js deleted file mode 100644 index d296e0b..0000000 --- a/vendor/assets/javascripts/wymeditor/lang/it.js +++ /dev/null @@ -1,45 +0,0 @@ -WYMeditor.STRINGS.it = { - Strong: 'Grassetto', - Emphasis: 'Corsetto', - Superscript: 'Apice', - Subscript: 'Pedice', - Ordered_List: 'Lista Ordinata', - Unordered_List: 'Lista Puntata', - Indent: 'Indenta', - Outdent: 'Caccia', - Undo: 'Indietro', - Redo: 'Avanti', - Link: 'Inserisci Link', - Unlink: 'Togli Link', - Image: 'Inserisci Immagine', - Table: 'Inserisci Tabella', - HTML: 'HTML', - Paragraph: 'Paragrafo', - Heading_1: 'Heading 1', - Heading_2: 'Heading 2', - Heading_3: 'Heading 3', - Heading_4: 'Heading 4', - Heading_5: 'Heading 5', - Heading_6: 'Heading 6', - Preformatted: 'Preformattato', - Blockquote: 'Blockquote', - Table_Header: 'Header Tabella', - URL: 'Indirizzo', - Title: 'Titolo', - Alternative_Text: 'Testo Alternativo', - Caption: 'Caption', - Summary: 'Summary', - Number_Of_Rows: 'Numero di Righe', - Number_Of_Cols: 'Numero di Colonne', - Submit: 'Invia', - Cancel: 'Cancella', - Choose: 'Scegli', - Preview: 'Anteprima', - Paste_From_Word: 'Incolla', - Tools: 'Tools', - Containers: 'Contenitori', - Classes: 'Classi', - Status: 'Stato', - Source_Code: 'Codice Sorgente' -}; - diff --git a/vendor/assets/javascripts/wymeditor/lang/ja.js b/vendor/assets/javascripts/wymeditor/lang/ja.js deleted file mode 100644 index b00ef84..0000000 --- a/vendor/assets/javascripts/wymeditor/lang/ja.js +++ /dev/null @@ -1,44 +0,0 @@ -WYMeditor.STRINGS.ja = { - Strong: '強調', - Emphasis: '強調', - Superscript: '上付き', - Subscript: '下付き', - Ordered_List: '番号付きリスト', - Unordered_List: '番号無リスト', - Indent: 'インデントを増やす', - Outdent: 'インデントを減らす', - Undo: '元に戻す', - Redo: 'やり直す', - Link: 'リンク', - Unlink: 'リンク取消', - Image: '画像', - Table: 'テーブル', - HTML: 'HTML', - Paragraph: '段落', - Heading_1: '見出し 1', - Heading_2: '見出し 2', - Heading_3: '見出し 3', - Heading_4: '見出し 4', - Heading_5: '見出し 5', - Heading_6: '見出し 6', - Preformatted: '整形済みテキスト', - Blockquote: '引用文', - Table_Header: '表見出し', - URL: 'URL', - Title: 'タイトル', - Alternative_Text: '代替テキスト', - Caption: 'キャプション', - Summary: 'サマリー', - Number_Of_Rows: '行数', - Number_Of_Cols: '列数', - Submit: '送信', - Cancel: 'キャンセル', - Choose: '選択', - Preview: 'プレビュー', - Paste_From_Word: '貼り付け', - Tools: 'ツール', - Containers: 'コンテナ', - Classes: 'クラス', - Status: 'ステータス', - Source_Code: 'ソースコード' -}; diff --git a/vendor/assets/javascripts/wymeditor/lang/lt.js b/vendor/assets/javascripts/wymeditor/lang/lt.js deleted file mode 100644 index b442655..0000000 --- a/vendor/assets/javascripts/wymeditor/lang/lt.js +++ /dev/null @@ -1,45 +0,0 @@ -WYMeditor.STRINGS.lt = { - Strong: 'Pusjuodis', - Emphasis: 'Kursyvas', - Superscript: 'Viršutinis indeksas', - Subscript: 'Apatinis indeksas', - Ordered_List: 'Numeruotas sąrašas', - Unordered_List: 'Suženklintas sąrašas', - Indent: 'Padidinti įtrauką', - Outdent: 'Sumažinti įtrauką', - Undo: 'Atšaukti', - Redo: 'Atstatyti', - Link: 'Nuoroda', - Unlink: 'Panaikinti nuorodą', - Image: 'Vaizdas', - Table: 'Lentelė', - HTML: 'HTML', - Paragraph: 'Paragrafas', - Heading_1: 'Antraštinis 1', - Heading_2: 'Antraštinis 2', - Heading_3: 'Antraštinis 3', - Heading_4: 'Antraštinis 4', - Heading_5: 'Antraštinis 5', - Heading_6: 'Antraštinis 6', - Preformatted: 'Formuotas', - Blockquote: 'Citata', - Table_Header: 'Lentelės antraštė', - URL: 'URL', - Title: 'Antraštinis tekstas', - Relationship: 'Sąryšis', - Alternative_Text: 'Alternatyvus tekstas', - Caption: 'Antraštė', - Summary: 'Santrauka', - Number_Of_Rows: 'Eilučių skaičius', - Number_Of_Cols: 'Stulpelių skaičius', - Submit: 'Išsaugoti', - Cancel: 'Nutraukti', - Choose: 'Rinktis', - Preview: 'Peržiūra', - Paste_From_Word: 'Įkelti iš MS Word', - Tools: 'Įrankiai', - Containers: 'Stiliai', - Classes: 'Klasės', - Status: 'Statusas', - Source_Code: 'Išeities tekstas' -}; \ No newline at end of file diff --git a/vendor/assets/javascripts/wymeditor/lang/nb.js b/vendor/assets/javascripts/wymeditor/lang/nb.js deleted file mode 100644 index 2ed2d95..0000000 --- a/vendor/assets/javascripts/wymeditor/lang/nb.js +++ /dev/null @@ -1,45 +0,0 @@ -WYMeditor.STRINGS.nb = { - Strong: 'Fet', - Emphasis: 'Uthevet', - Superscript: 'Opphøyet', - Subscript: 'Nedsenket', - Ordered_List: 'Nummerert liste', - Unordered_List: 'Punktliste', - Indent: 'Rykk inn', - Outdent: 'Rykk ut', - Undo: 'Angre', - Redo: 'Gjenta', - Link: 'Lenke', - Unlink: 'Ta bort lenken', - Image: 'Bilde', - Table: 'Tabell', - HTML: 'HTML', - Paragraph: 'Avsnitt', - Heading_1: 'Overskrift 1', - Heading_2: 'Overskrift 2', - Heading_3: 'Overskrift 3', - Heading_4: 'Overskrift 4', - Heading_5: 'Overskrift 5', - Heading_6: 'Overskrift 6', - Preformatted: 'Preformatert', - Blockquote: 'Sitat', - Table_Header: 'Tabelloverskrift', - URL: 'URL', - Title: 'Tittel', - Alternative_Text: 'Alternativ tekst', - Caption: 'Overskrift', - Summary: 'Sammendrag', - Number_Of_Rows: 'Antall rader', - Number_Of_Cols: 'Antall kolonner', - Submit: 'Ok', - Cancel: 'Avbryt', - Choose: 'Velg', - Preview: 'Forhåndsvis', - Paste_From_Word: 'Lim inn fra Word', - Tools: 'Verktøy', - Containers: 'Formatering', - Classes: 'Klasser', - Status: 'Status', - Source_Code: 'Kildekode' -}; - diff --git a/vendor/assets/javascripts/wymeditor/lang/nl.js b/vendor/assets/javascripts/wymeditor/lang/nl.js deleted file mode 100644 index a7572f1..0000000 --- a/vendor/assets/javascripts/wymeditor/lang/nl.js +++ /dev/null @@ -1,45 +0,0 @@ -WYMeditor.STRINGS.nl = { - Strong: 'Sterk benadrukken', - Emphasis: 'Benadrukken', - Superscript: 'Bovenschrift', - Subscript: 'Onderschrift', - Ordered_List: 'Geordende lijst', - Unordered_List: 'Ongeordende lijst', - Indent: 'Inspringen', - Outdent: 'Terugspringen', - Undo: 'Ongedaan maken', - Redo: 'Opnieuw uitvoeren', - Link: 'Linken', - Unlink: 'Ontlinken', - Image: 'Afbeelding', - Table: 'Tabel', - HTML: 'HTML', - Paragraph: 'Paragraaf', - Heading_1: 'Kop 1', - Heading_2: 'Kop 2', - Heading_3: 'Kop 3', - Heading_4: 'Kop 4', - Heading_5: 'Kop 5', - Heading_6: 'Kop 6', - Preformatted: 'Voorgeformatteerd', - Blockquote: 'Citaat', - Table_Header: 'Tabel-kop', - URL: 'URL', - Title: 'Titel', - Relationship: 'Relatie', - Alternative_Text: 'Alternatieve tekst', - Caption: 'Bijschrift', - Summary: 'Summary', - Number_Of_Rows: 'Aantal rijen', - Number_Of_Cols: 'Aantal kolommen', - Submit: 'Versturen', - Cancel: 'Annuleren', - Choose: 'Kiezen', - Preview: 'Voorbeeld bekijken', - Paste_From_Word: 'Plakken uit Word', - Tools: 'Hulpmiddelen', - Containers: 'Teksttypes', - Classes: 'Klassen', - Status: 'Status', - Source_Code: 'Broncode' -}; \ No newline at end of file diff --git a/vendor/assets/javascripts/wymeditor/lang/nn.js b/vendor/assets/javascripts/wymeditor/lang/nn.js deleted file mode 100644 index c7ea20c..0000000 --- a/vendor/assets/javascripts/wymeditor/lang/nn.js +++ /dev/null @@ -1,45 +0,0 @@ -WYMeditor.STRINGS.nn = { - Strong: 'Feit', - Emphasis: 'Utheva', - Superscript: 'Opphøgd', - Subscript: 'Nedsenka', - Ordered_List: 'Nummerert liste', - Unordered_List: 'Punktliste', - Indent: 'Rykk inn', - Outdent: 'Rykk ut', - Undo: 'Angre', - Redo: 'Gjentaka', - Link: 'Lenkje', - Unlink: 'Ta bort lenkja', - Image: 'Bilete', - Table: 'Tabell', - HTML: 'HTML', - Paragraph: 'Avsnitt', - Heading_1: 'Overskrift 1', - Heading_2: 'Overskrift 2', - Heading_3: 'Overskrift 3', - Heading_4: 'Overskrift 4', - Heading_5: 'Overskrift 5', - Heading_6: 'Overskrift 6', - Preformatted: 'Preformatert', - Blockquote: 'Sitat', - Table_Header: 'Tabelloverskrift', - URL: 'URL', - Title: 'Tittel', - Alternative_Text: 'Alternativ tekst', - Caption: 'Overskrift', - Summary: 'Samandrag', - Number_Of_Rows: 'Tal på rader', - Number_Of_Cols: 'Tal på kolonnar', - Submit: 'Ok', - Cancel: 'Avbryt', - Choose: 'Vel', - Preview: 'Førehandsvis', - Paste_From_Word: 'Lim inn frå Word', - Tools: 'Verkty', - Containers: 'Formatering', - Classes: 'Klassar', - Status: 'Status', - Source_Code: 'Kjeldekode' -}; - diff --git a/vendor/assets/javascripts/wymeditor/lang/pl.js b/vendor/assets/javascripts/wymeditor/lang/pl.js deleted file mode 100644 index cf01891..0000000 --- a/vendor/assets/javascripts/wymeditor/lang/pl.js +++ /dev/null @@ -1,45 +0,0 @@ -WYMeditor.STRINGS.pl = { - Strong: 'Nacisk', - Emphasis: 'Emfaza', - Superscript: 'Indeks górny', - Subscript: 'Indeks dolny', - Ordered_List: 'Lista numerowana', - Unordered_List: 'Lista wypunktowana', - Indent: 'Zwiększ wcięcie', - Outdent: 'Zmniejsz wcięcie', - Undo: 'Cofnij', - Redo: 'Ponów', - Link: 'Wstaw link', - Unlink: 'Usuń link', - Image: 'Obraz', - Table: 'Tabela', - HTML: 'Źródło HTML', - Paragraph: 'Akapit', - Heading_1: 'Nagłówek 1', - Heading_2: 'Nagłówek 2', - Heading_3: 'Nagłówek 3', - Heading_4: 'Nagłówek 4', - Heading_5: 'Nagłówek 5', - Heading_6: 'Nagłówek 6', - Preformatted: 'Preformatowany', - Blockquote: 'Cytat blokowy', - Table_Header: 'Nagłówek tabeli', - URL: 'URL', - Title: 'Tytuł', - Alternative_Text: 'Tekst alternatywny', - Caption: 'Tytuł tabeli', - Summary: 'Summary', - Number_Of_Rows: 'Liczba wierszy', - Number_Of_Cols: 'Liczba kolumn', - Submit: 'Wyślij', - Cancel: 'Anuluj', - Choose: 'Wybierz', - Preview: 'Podgląd', - Paste_From_Word: 'Wklej z Worda', - Tools: 'Narzędzia', - Containers: 'Format', - Classes: 'Styl', - Status: 'Status', - Source_Code: 'Kod źródłowy' -}; - diff --git a/vendor/assets/javascripts/wymeditor/lang/pt-br.js b/vendor/assets/javascripts/wymeditor/lang/pt-br.js deleted file mode 100644 index 2ec18fe..0000000 --- a/vendor/assets/javascripts/wymeditor/lang/pt-br.js +++ /dev/null @@ -1,45 +0,0 @@ -WYMeditor.STRINGS['pt-br'] = { - Strong: 'Resaltar', - Emphasis: 'Enfatizar', - Superscript: 'Sobre escrito', - Subscript: 'Sub escrito ', - Ordered_List: 'Lista ordenada', - Unordered_List: 'Lista desordenada', - Indent: 'Indentado', - Outdent: 'Desidentar', - Undo: 'Desfazer', - Redo: 'Refazer', - Link: 'Link', - Unlink: 'Remover Link', - Image: 'Imagem', - Table: 'Tabela', - HTML: 'HTML', - Paragraph: 'Parágrafo', - Heading_1: 'Título 1', - Heading_2: 'Título 2', - Heading_3: 'Título 3', - Heading_4: 'Título 4', - Heading_5: 'Título 5', - Heading_6: 'Título 6', - Preformatted: 'Preformatado', - Blockquote: 'Citação', - Table_Header: 'Título de tabela', - URL: 'URL', - Title: 'Título', - Alternative_Text: 'Texto alternativo', - Caption: 'Legenda', - Summary: 'Summary', - Number_Of_Rows: 'Número de linhas', - Number_Of_Cols: 'Número de colunas', - Submit: 'Enviar', - Cancel: 'Cancelar', - Choose: 'Selecionar', - Preview: 'Previsualizar', - Paste_From_Word: 'Copiar do Word', - Tools: 'Ferramentas', - Containers: 'Conteneiners', - Classes: 'Classes', - Status: 'Estado', - Source_Code: 'Código fonte' -}; - diff --git a/vendor/assets/javascripts/wymeditor/lang/pt.js b/vendor/assets/javascripts/wymeditor/lang/pt.js deleted file mode 100644 index 7ea1d7c..0000000 --- a/vendor/assets/javascripts/wymeditor/lang/pt.js +++ /dev/null @@ -1,45 +0,0 @@ -WYMeditor.STRINGS.pt = { - Strong: 'Negrito', - Emphasis: 'Itálico', - Superscript: 'Sobrescrito', - Subscript: 'Subsescrito', - Ordered_List: 'Lista Numerada', - Unordered_List: 'Lista Marcada', - Indent: 'Aumentar Indentaçã', - Outdent: 'Diminuir Indentaçã', - Undo: 'Desfazer', - Redo: 'Restaurar', - Link: 'Link', - Unlink: 'Tirar link', - Image: 'Imagem', - Table: 'Tabela', - HTML: 'HTML', - Paragraph: 'Parágrafo', - Heading_1: 'Título 1', - Heading_2: 'Título 2', - Heading_3: 'Título 3', - Heading_4: 'Título 4', - Heading_5: 'Título 5', - Heading_6: 'Título 6', - Preformatted: 'Pré-formatado', - Blockquote: 'Citação', - Table_Header: 'Cabeçalho Tabela', - URL: 'URL', - Title: 'Título', - Alternative_Text: 'Texto Alterativo', - Caption: 'Título Tabela', - Summary: 'Summary', - Number_Of_Rows: 'Número de Linhas', - Number_Of_Cols: 'Número de Colunas', - Submit: 'Enviar', - Cancel: 'Cancelar', - Choose: 'Escolha', - Preview: 'Prever', - Paste_From_Word: 'Colar do Word', - Tools: 'Ferramentas', - Containers: 'Containers', - Classes: 'Classes', - Status: 'Status', - Source_Code: 'Código Fonte' -}; - diff --git a/vendor/assets/javascripts/wymeditor/lang/ru.js b/vendor/assets/javascripts/wymeditor/lang/ru.js deleted file mode 100644 index 368a90c..0000000 --- a/vendor/assets/javascripts/wymeditor/lang/ru.js +++ /dev/null @@ -1,45 +0,0 @@ -WYMeditor.STRINGS.ru = { - Strong: 'Жирный', - Emphasis: 'Наклонный', - Superscript: 'Надстрочный', - Subscript: 'Подстрочный', - Ordered_List: 'Нумерованый список', - Unordered_List: 'Ненумерованый список', - Indent: 'Увеличить отступ', - Outdent: 'Уменьшить отступ', - Undo: 'Отменить', - Redo: 'Повторить', - Link: 'Ссылка', - Unlink: 'Удалить ссылку', - Image: 'Изображение', - Table: 'Таблица', - HTML: 'Править HTML', - Paragraph: 'Параграф', - Heading_1: 'Заголовок 1', - Heading_2: 'Заголовок 2', - Heading_3: 'Заголовок 3', - Heading_4: 'Заголовок 4', - Heading_5: 'Заголовок 5', - Heading_6: 'Заголовок 6', - Preformatted: 'Preformatted', - Blockquote: 'Цитата', - Table_Header: 'Заголовок таблицы', - URL: 'URL', - Title: 'Заголовок', - Alternative_Text: 'Альтернативный текст', - Caption: 'Надпись', - Summary: 'Summary', - Number_Of_Rows: 'Кол-во строк', - Number_Of_Cols: 'Кол-во столбцов', - Submit: 'Отправить', - Cancel: 'Отмена', - Choose: 'Выбор', - Preview: 'Просмотр', - Paste_From_Word: 'Вставить из Word', - Tools: 'Инструменты', - Containers: 'Контейнеры', - Classes: 'Классы', - Status: 'Статус', - Source_Code: 'Исходный код' -}; - diff --git a/vendor/assets/javascripts/wymeditor/lang/sv.js b/vendor/assets/javascripts/wymeditor/lang/sv.js deleted file mode 100644 index 34081bc..0000000 --- a/vendor/assets/javascripts/wymeditor/lang/sv.js +++ /dev/null @@ -1,46 +0,0 @@ -WYMeditor.STRINGS.sv = { - Strong: 'Viktigt', - Emphasis: 'Betoning', - Superscript: 'Upphöjt', - Subscript: 'Nedsänkt', - Ordered_List: 'Nummerlista', - Unordered_List: 'Punktlista', - Indent: 'Indrag', - Outdent: 'Utdrag', - Undo: 'Ångra', - Redo: 'Gör om', - Link: 'Länk', - Unlink: 'Ta bort länk', - Image: 'Bild', - Table: 'Tabell', - HTML: 'HTML', - Paragraph: 'Paragraf', - Heading_1: 'Rubrik 1', - Heading_2: 'Rubrik 2', - Heading_3: 'Rubrik 3', - Heading_4: 'Rubrik 4', - Heading_5: 'Rubrik 5', - Heading_6: 'Rubrik 6', - Preformatted: 'Förformaterad', - Blockquote: 'Blockcitat', - Table_Header: 'Tabellrubrik', - URL: 'URL', - Title: 'Titel', - Relationship: 'Relation', - Alternative_Text: 'Alternativ text', - Caption: 'Överskrift', - Summary: 'Summary', - Number_Of_Rows: 'Antal rader', - Number_Of_Cols: 'Antal kolumner', - Submit: 'Skicka', - Cancel: 'Avbryt', - Choose: 'Välj', - Preview: 'Förhandsgranska', - Paste_From_Word: 'Klistra in från Word', - Tools: 'Verktyg', - Containers: 'Formatering', - Classes: 'Klasser', - Status: 'Status', - Source_Code: 'Källkod' -}; - diff --git a/vendor/assets/javascripts/wymeditor/lang/tr.js b/vendor/assets/javascripts/wymeditor/lang/tr.js deleted file mode 100644 index f5e1aeb..0000000 --- a/vendor/assets/javascripts/wymeditor/lang/tr.js +++ /dev/null @@ -1,45 +0,0 @@ -WYMeditor.STRINGS.tr = { - Strong: 'Kalın', - Emphasis: 'Vurgu', - Superscript: 'Superscript', - Subscript: 'Subscript', - Ordered_List: 'Sıralı List', - Unordered_List: 'Sırasız List', - Indent: 'İçerlek', - Outdent: 'Çıkıntılı', - Undo: 'Geri Al', - Redo: 'Yinele', - Link: 'Bağlantı', - Unlink: 'Bağlantıyı Kaldır', - Image: 'İmaj', - Table: 'Tablo', - HTML: 'HTML', - Paragraph: 'Parağraf', - Heading_1: 'Başlık 1', - Heading_2: 'Başlık 2', - Heading_3: 'Başlık 3', - Heading_4: 'Başlık 4', - Heading_5: 'Başlık 5', - Heading_6: 'Başlık 6', - Preformatted: 'Önceden Formatlı', - Blockquote: 'Alıntı', - Table_Header: 'Tablo Başlığı', - URL: 'URL', - Title: 'Başlık', - Alternative_Text: 'Alternatif Metin', - Caption: 'Etiket', - Summary: 'Summary', - Number_Of_Rows: 'Satır sayısı', - Number_Of_Cols: 'Sütun sayısı', - Submit: 'Gönder', - Cancel: 'İptal', - Choose: 'Seç', - Preview: 'Önizleme', - Paste_From_Word: 'Wordden yapıştır', - Tools: 'Araçlar', - Containers: 'Kapsayıcılar', - Classes: 'Sınıflar', - Status: 'Durum', - Source_Code: 'Kaynak Kodu' -}; - diff --git a/vendor/assets/javascripts/wymeditor/lang/zh_cn.js b/vendor/assets/javascripts/wymeditor/lang/zh_cn.js deleted file mode 100644 index 3e35678..0000000 --- a/vendor/assets/javascripts/wymeditor/lang/zh_cn.js +++ /dev/null @@ -1,47 +0,0 @@ -WYMeditor.STRINGS.zh_cn = { - Strong: '加粗', - Emphasis: '斜体', - Superscript: '上标', - Subscript: '下标', - Ordered_List: '有序列表', - Unordered_List: '无序列表', - Indent: '增加缩进', - Outdent: '减少缩进', - Undo: '撤消', - Redo: '重做', - Link: '链接', - Unlink: '取消链接', - Image: '图片', - Table: '表格', - HTML: 'HTML源代码', - Paragraph: '段落', - Heading_1: '标题 1', - Heading_2: '标题 2', - Heading_3: '标题 3', - Heading_4: '标题 4', - Heading_5: '标题 5', - Heading_6: '标题 6', - Preformatted: '原始文本', - Blockquote: '引语', - Table_Header: '表头', - URL: '地址', - Title: '提示文字', - Alternative_Text: '失效文字', - Caption: '标题', - Summary: 'Summary', - Number_Of_Rows: '行数', - Number_Of_Cols: '列数', - Submit: '提交', - Cancel: '放弃', - Choose: '选择', - Preview: '预览', - Paste_From_Word: '从Word粘贴纯文本', - Tools: '工具', - Containers: '容器', - Classes: '预定义样式', - Status: '状态', - Source_Code: '源代码', - Attachment: '附件', - NewParagraph: '新段落' -}; - diff --git a/vendor/assets/javascripts/wymeditor/plugins/embed/jquery.wymeditor.embed.js b/vendor/assets/javascripts/wymeditor/plugins/embed/jquery.wymeditor.embed.js deleted file mode 100644 index 79daa16..0000000 --- a/vendor/assets/javascripts/wymeditor/plugins/embed/jquery.wymeditor.embed.js +++ /dev/null @@ -1,82 +0,0 @@ -/** - * WYMeditor : what you see is What You Mean web-based editor - * Copyright (c) 2005 - 2009 Jean-Francois Hovinne, http://www.wymeditor.org/ - * Dual licensed under the MIT (MIT-license.txt) - * and GPL (GPL-license.txt) licenses. - * - * For further information visit: - * http://www.wymeditor.org/ - * - * File Name: - * jquery.wymeditor.embed.js - * Experimental embed plugin - * - * File Authors: - * Jonatan Lundin (jonatan.lundin a-t gmail dotcom) - * Roger Hu (roger.hu a-t gmail dotcom) - * Scott Nixon (citadelgrad a-t gmail dotcom) - */ - -(function () { - function removeItem(item, arr) { - for (var i = arr.length; i--;) { - if (arr[i] === item) { - arr.splice(i, 1); - } - } - return arr; - } - if (WYMeditor && WYMeditor.XhtmlValidator._tags.param.attributes) { - - WYMeditor.XhtmlValidator._tags.embed = { - "attributes":[ - "allowscriptaccess", - "allowfullscreen", - "height", - "src", - "type", - "width" - ] - }; - - WYMeditor.XhtmlValidator._tags.param.attributes = { - '0':'name', - '1':'type', - 'valuetype':/^(data|ref|object)$/, - '2':'valuetype', - '3':'value' - }; - - WYMeditor.XhtmlValidator._tags.iframe = { - "attributes":[ - "allowfullscreen", - "width", - "height", - "src", - "title", - "frameborder" - ] - }; - - // Override the XhtmlSaxListener to allow param, embed and iframe. - // - // We have to do an explicit override - // of the function instead of just changing the startup parameters - // because those are only used on creation, and changing them after - // the fact won't affect the existing XhtmlSaxListener - var XhtmlSaxListener = WYMeditor.XhtmlSaxListener; - WYMeditor.XhtmlSaxListener = function () { - var listener = XhtmlSaxListener.call(this); - // param, embed and iframe should be inline tags so that they can - // be nested inside other elements - removeItem('param', listener.block_tags); - listener.inline_tags.push('param'); - listener.inline_tags.push('embed'); - listener.inline_tags.push('iframe'); - - return listener; - }; - - WYMeditor.XhtmlSaxListener.prototype = XhtmlSaxListener.prototype; - } -})(); diff --git a/vendor/assets/javascripts/wymeditor/plugins/fullscreen/icon_fullscreen.gif b/vendor/assets/javascripts/wymeditor/plugins/fullscreen/icon_fullscreen.gif deleted file mode 100644 index d2a8b0a..0000000 Binary files a/vendor/assets/javascripts/wymeditor/plugins/fullscreen/icon_fullscreen.gif and /dev/null differ diff --git a/vendor/assets/javascripts/wymeditor/plugins/fullscreen/jquery.wymeditor.fullscreen.js b/vendor/assets/javascripts/wymeditor/plugins/fullscreen/jquery.wymeditor.fullscreen.js deleted file mode 100644 index 3f805e5..0000000 --- a/vendor/assets/javascripts/wymeditor/plugins/fullscreen/jquery.wymeditor.fullscreen.js +++ /dev/null @@ -1,124 +0,0 @@ -/* - * WYMeditor : what you see is What You Mean web-based editor - * Copyright (c) 2005 - 2009 Jean-Francois Hovinne, http://www.wymeditor.org/ - * Dual licensed under the MIT (MIT-license.txt) - * and GPL (GPL-license.txt) licenses. - * - * For further information visit: - * http://www.wymeditor.org/ - * - * File Name: - * jquery.wymeditor.fullscreen.js - * Fullscreen plugin for WYMeditor - * - * File Authors: - * Luis Santos (luis.santos a-t openquest dotpt) - * Jonatan Lundin (jonatan.lundin a-t gmail dotcom) - * Gerd Riesselmann (gerd a-t gyro-php dot org) : Fixed issue with new skin layout - */ - -//Extend WYMeditor -WYMeditor.editor.prototype.fullscreen = function() { - var wym = this, - $box = jQuery(this._box), - $iframe = jQuery(this._iframe), - $overlay = null, - $window = jQuery(window), - - editorMargin = 15; // Margin from window (without padding) - - - //construct the button's html - var html = '' + - "
  • " + - "" + - "Fullscreen" + - "" + - "
  • "; - //add the button to the tools box - $box.find(wym._options.toolsSelector + wym._options.toolsListSelector) - .append(html); - - function resize () { - // Calculate margins - var uiHeight = $box.outerHeight(true) - $iframe.outerHeight(true); - var editorPadding = $box.outerWidth() - $box.width(); - - // Calculate heights - var screenHeight = $window.height(); - var iframeHeight = (screenHeight - uiHeight - (editorMargin * 2)) + 'px'; - - // Calculate witdths - var screenWidth = $window.width(); - var boxWidth = (screenWidth - editorPadding - (editorMargin * 2)) + 'px'; - - $box.css('width', boxWidth); - $iframe.css('height', iframeHeight); - $overlay.css({ - 'height': screenHeight + 'px', - 'width': screenWidth + 'px' - }); - } - - //handle click event - $box.find('li.wym_tools_fullscreen a').click(function() { - if ($box.css('position') != 'fixed') { - // Store previous inline styles - $box.data('wym-inline-css', $box.attr('style')); - $iframe.data('wym-inline-css', $iframe.attr('style')); - - // Create overlay - $overlay = jQuery('
    ') - .appendTo('body').css({ - 'position': 'fixed', - 'background-color': 'rgb(0, 0, 0)', - 'opacity': '0.75', - 'z-index': '98', - 'top': '0px', - 'left': '0px' - }); - - // Possition the editor - $box.css({ - 'position': 'fixed', - 'z-index': '99', - 'top': editorMargin + 'px', - 'left': editorMargin + 'px' - }); - - // Bind event listeners - $window.bind('resize', resize); - $box.find('li.wym_tools_html a').bind('click', resize); - - // Force resize - resize(); - } else { - // Unbind event listeners - $window.unbind('resize', resize); - $box.find('li.wym_tools_html a').unbind('click', resize); - - // Remove inline styles - $box.css({ - 'position': 'static', - 'z-index': '', - 'width': '', - 'top': '', - 'left': '' - }); - $iframe.css('height', ''); - - // Remove overlay - $overlay.remove(); - $overlay = null; - - // Retore previous inline styles - $box.attr('style', $box.data('wym-inline-css')); - $iframe.attr('style', $iframe.data('wym-inline-css')); - } - - return false; - }); -}; diff --git a/vendor/assets/javascripts/wymeditor/plugins/hovertools/jquery.wymeditor.hovertools.js b/vendor/assets/javascripts/wymeditor/plugins/hovertools/jquery.wymeditor.hovertools.js deleted file mode 100644 index 1a9521d..0000000 --- a/vendor/assets/javascripts/wymeditor/plugins/hovertools/jquery.wymeditor.hovertools.js +++ /dev/null @@ -1,49 +0,0 @@ -/*jslint evil: true */ -/** - WYMeditor.hovertools - ==================== - - A hovertools plugin. -*/ - -WYMeditor.editor.prototype.hovertools = function() { - var wym = this; - - wym.status(' '); - - // Bind events on buttons - jQuery(this._box).find(this._options.toolSelector).hover( - function() { - wym.status(jQuery(this).html()); - }, - function() { - wym.status(' '); - } - ); - - // Classes: add/remove a style attr to matching elems - // while mouseover/mouseout - jQuery(this._box).find(this._options.classSelector).hover( - function() { - var aClasses = eval(wym._options.classesItems); - var sName = jQuery(this).attr(WYMeditor.NAME); - var oClass = WYMeditor.Helper.findByName(aClasses, sName); - - if (oClass){ - jqexpr = oClass.expr; - // Don't use jQuery.find() on the iframe body - // because of MSIE + jQuery + expando issue (#JQ1143) - if (!jQuery.browser.msie) { - jQuery(wym._doc).find(jqexpr).css('background-color','#cfc'); - } - } - }, - function() { - // Don't use jQuery.find() on the iframe body - // because of MSIE + jQuery + expando issue (#JQ1143) - if (!jQuery.browser.msie) { - jQuery(wym._doc).find('*').removeAttr('style'); - } - } - ); -}; diff --git a/vendor/assets/javascripts/wymeditor/plugins/list/jquery.wymeditor.list.js b/vendor/assets/javascripts/wymeditor/plugins/list/jquery.wymeditor.list.js deleted file mode 100644 index 1d75858..0000000 --- a/vendor/assets/javascripts/wymeditor/plugins/list/jquery.wymeditor.list.js +++ /dev/null @@ -1,60 +0,0 @@ -/** - * Copyright (c) 2011 PolicyStat LLC. - * MIT licensed (MIT-license.txt) - * - * This plugin adds the ability to use tab and shift+tab to indent/outdent - * lists, mimicking a user's expected behavior when inside an editor. - * - * @author Wes Winham (winhamwr@gmail.com) - */ - -function ListPlugin(options, wym) { - this._options = jQuery.extend({}, options); - this._wym = wym; - - this.init(); -} - -ListPlugin.prototype.init = function() { - this._wym.listPlugin = this; - - this.bindEvents(); -}; - -ListPlugin.prototype.bindEvents = function() { - var listPlugin = this; - var wym = this._wym; - - // Bind a key listener so we can handle tabs - // With jQuery 1.3, live() can be used to simplify handler logic - $(wym._doc).bind('keydown', listPlugin.handleKeyDown); -}; - -/** - * Handle any tab presses when inside list items and indent/outdent. - */ -ListPlugin.prototype.handleKeyDown = function(evt) { - //'this' is the editor._doc - var wym = WYMeditor.INSTANCES[this.title]; - var listPlugin = wym.listPlugin; - - var container = wym.selected(); - var name = container.tagName.toLowerCase(); - // We only care about tabs when we're inside a list - if (name != "li") { - return null; - } - - // Handle tab presses - if (evt.keyCode == WYMeditor.KEY.TAB) { - if (evt.shiftKey) { - wym.exec(WYMeditor.OUTDENT); - return false; // Short-circuit normal tab behavior - } else { - wym.exec(WYMeditor.INDENT); - return false; - } - } - - return null; -}; diff --git a/vendor/assets/javascripts/wymeditor/plugins/rdfa/jquery.wymeditor.rdfa.js b/vendor/assets/javascripts/wymeditor/plugins/rdfa/jquery.wymeditor.rdfa.js deleted file mode 100644 index ecbacca..0000000 --- a/vendor/assets/javascripts/wymeditor/plugins/rdfa/jquery.wymeditor.rdfa.js +++ /dev/null @@ -1,182 +0,0 @@ -/* - * WYMeditor : what you see is What You Mean web-based editor - * Copyright (c) 2005 - 2011 Jean-Francois Hovinne, http://www.wymeditor.org/ - * Dual licensed under the MIT (MIT-license.txt) - * and GPL (GPL-license.txt) licenses. - * - * For further information visit: - * http://www.wymeditor.org/ - * - * File Name: - * jquery.wymeditor.rdfa.js - * RDFa plugin for WYMeditor - * - * File Authors: - * Jean-Francois Hovinne (@jfhovinne) - */ - -//Extend WYMeditor -WYMeditor.editor.prototype.rdfa = function(options) { - var rdfa = new WYMeditor.RDFa(options, this); - return(rdfa); -}; - -//RDFa constructor -WYMeditor.RDFa = function(options, wym) { - options = jQuery.extend({ - setStdNameSpaces: true, - extendXHTMLParser: true, - buttons: {} - }, options); - - this._options = options; - this._wym = wym; - this.init(); -}; - -//RDFa plugin init -WYMeditor.RDFa.prototype.init = function() { - if (this._options.setStdNameSpaces) { - this.setStdNameSpaces(); - } - if (this._options.extendXHTMLParser) { - this.extendXHTMLParser(); - } - this.setButtons(); -}; - -//Adding the namespaces to the document -WYMeditor.RDFa.prototype.setStdNameSpaces = function() { - this.addNameSpace('xmlns', 'http://www.w3.org/1999/xhtml'); - this.addNameSpace('version', 'XHTML+RDFa 1.0'); -}; - -WYMeditor.RDFa.prototype.addNameSpace = function(attr, value) { - jQuery('html', this._wym._doc) - .attr(attr, value); -}; - -WYMeditor.RDFa.prototype.extendXHTMLParser = function() { - this.extendAttributes(); - this.setStdVocabularies(); - this.extendLinkAttributes(); -}; - -WYMeditor.RDFa.prototype.extendAttributes = function() { - //Add the RDFa attributes - WYMeditor.XhtmlValidator._attributes.core.attributes.push( - 'rel', - 'rev', - 'content', - 'href', - 'src', - 'about', - 'property', - 'resource', - 'datatype', - 'typeof'); -}; - -WYMeditor.RDFa.prototype.setStdVocabularies = function() { - var _this = this; - //Add the 'standard' vocabularies - vocabularies = [ - 'xmlns:biblio', - 'xmlns:cc', - 'xmlns:dbp', - 'xmlns:dbr', - 'xmlns:dc', - 'xmlns:ex', - 'xmlns:foaf', - 'xmlns:rdf', - 'xmlns:rdfs', - 'xmlns:taxo', - 'xmlns:xhv', - 'xmlns:xsd' - ]; - jQuery.each(vocabularies, function(index, vocabulary) { - _this.addVocabulary(vocabulary); - }); -}; - -WYMeditor.RDFa.prototype.addVocabulary = function(vocabulary) { - WYMeditor.XhtmlValidator._attributes.core.attributes.push(vocabulary); -}; - -WYMeditor.RDFa.prototype.extendLinkAttributes = function() { - //Overwrite the attributes 'rel' and 'rev' - WYMeditor.XhtmlValidator._tags.a = { - "attributes": { - "0":"charset", - "1":"coords", - "2":"href", - "3":"hreflang", - "4":"name", - "5":"rel", - "6":"rev", - "shape":/^(rect|rectangle|circ|circle|poly|polygon)$/, - "7":"type" - } - }; -}; - -WYMeditor.RDFa.prototype.setButtons = function() { - var _this = this; - var list = jQuery(this._wym._box).find('div.wym_classes ul'); - jQuery.each(this._options.buttons, function(index, button) { - list - .append('
  • ') - .children(':last') - .append('
    ') - .children(':last') - .attr('href', '#') - .text(button.title) - .bind('click', - {instance: _this._wym, - button: button, - ns: button.ns, - attr: button.attr, - value: button.value}, - _this.clickButtonHandler); - }); -}; - -WYMeditor.RDFa.prototype.clickButtonHandler = function(evt) { - var wym = evt.data.instance, - selected = wym.selected(); - - //the attribute already exists, remove it - if (typeof(jQuery(selected).attr(evt.data.attr)) !== 'undefined' && - jQuery(selected).attr(evt.data.attr) != '') { - WYMeditor.console.log( - 'attribute already exists, remove it:', - evt.data.attr, - jQuery(selected).attr(evt.data.attr)); - jQuery(selected) - .removeAttr(evt.data.attr) - .removeClass(evt.data.ns) - .removeClass(evt.data.attr) - .removeClass(evt.data.value); - - //else, add it - } else { - WYMeditor.console.log('attribute does not exist, add it:', evt.data.attr, evt.data.value); - if (evt.data.value) { //value available - jQuery(selected) - .attr(evt.data.attr, evt.data.ns + ':' + evt.data.value) - .addClass(evt.data.ns) - .addClass(evt.data.attr) - .addClass(evt.data.value); - } else { //value not available - evt.data.value = prompt('Value', ''); - if (evt.data.value !== null) { - jQuery(selected) - .attr(evt.data.attr, evt.data.value) - .addClass(evt.data.ns) - .addClass(evt.data.attr) - .addClass(evt.data.value); - } - } - } - return false; -}; diff --git a/vendor/assets/javascripts/wymeditor/plugins/resizable/jquery.wymeditor.resizable.js b/vendor/assets/javascripts/wymeditor/plugins/resizable/jquery.wymeditor.resizable.js deleted file mode 100644 index cb6032d..0000000 --- a/vendor/assets/javascripts/wymeditor/plugins/resizable/jquery.wymeditor.resizable.js +++ /dev/null @@ -1,77 +0,0 @@ -/* - * WYMeditor : what you see is What You Mean web-based editor - * Copyright (c) 2005 - 2009 Jean-Francois Hovinne, http://www.wymeditor.org/ - * Dual licensed under the MIT (MIT-license.txt) - * and GPL (GPL-license.txt) licenses. - * - * For further information visit: - * http://www.wymeditor.org/ - * - * File Name: - * jquery.wymeditor.resizable.js - * resize plugin for WYMeditor - * - * File Authors: - * Peter Eschler (peschler _at_ gmail.com) - * Jean-Francois Hovinne - http://www.hovinne.com/ - * - * Version: - * 0.4 - * - * Changelog: - * - * 0.4 - * - Removed UI and UI.resizable scripts loading - see #167 (jfh). - * - * 0.3 - * - Added 'iframeOriginalSize' and removed 'ui.instance' calls (jfh). - * - * 0.2 - * - Added full support for all jQueryUI resizable plugin options. - * - Refactored and documented code. - * 0.1 - * - Initial release. - */ - -/** - * The resizable plugin makes the wymeditor box vertically resizable. - * It it based on the ui.resizable.js plugin of the jQuery UI library. - * - * The WYMeditor resizable plugin supports all parameters of the jQueryUI - * resizable plugin. The parameters are passed like this: - * - * wym.resizable({ handles: "s,e", - * maxHeight: 600 }); - * - * DEPENDENCIES: jQuery UI, jQuery UI resizable - * - * @param options options for the plugin - */ -WYMeditor.editor.prototype.resizable = function(options) { - - var wym = this; - var $iframe = jQuery(wym._box).find('iframe'); - var $iframe_div = jQuery(wym._box).find('.wym_iframe'); - var iframeOriginalSize = {}; - - // Define some default options - var default_options = { - resize: function() { - $iframe_div.height($iframe.height()); - }, - alsoResize: $iframe, - handles: "s,e,se", - minHeight: 250 - }; - - // Merge given options with default options. Given options override - // default ones. - var final_options = jQuery.extend(default_options, options); - - if (jQuery.isFunction(jQuery.fn.resizable)) { - jQuery(wym._box).resizable(final_options); - } else { - WYMeditor.console.error('Oops, jQuery UI.resizable unavailable.'); - } - -}; diff --git a/vendor/assets/javascripts/wymeditor/plugins/resizable/readme.txt b/vendor/assets/javascripts/wymeditor/plugins/resizable/readme.txt deleted file mode 100644 index 2a0444e..0000000 --- a/vendor/assets/javascripts/wymeditor/plugins/resizable/readme.txt +++ /dev/null @@ -1,124 +0,0 @@ - - -resizable plugin for WYMeditor -############################## - -The ``resizable`` plugin for WYMeditor_ enables vertical resizing of the -editor area. The plugin is based on the jQuery UI library. - -Requirements -============ -The following packages are required for using the WYMeditor ``resizable`` -plugin: - -* jQuery (tested with jQuery ``jquery-1.2.4a.js`` from ``jquery.ui`` package) -* WYMeditor SVN trunk (Revision: 482) -* jQuery-UI (tested with ``jquery.ui-1.5b2``) - -It should be possible to use this plugin with ``WYMeditor-0.4`` but I have not -tried. - -Download -======== -You can download the WYMeditor ``resizable`` plugin here: - -* wymeditor-resizable-plugin-0.2.tgz_ -* wymeditor-resizable-plugin-0.1.tgz_ - -See the Changelog_ for more infos about the releases. - -.. _wymeditor-resizable-plugin-0.2.tgz: http://pyjax.net/download/wymeditor-resizable-plugin-0.2.tgz -.. _wymeditor-resizable-plugin-0.1.tgz: http://pyjax.net/download/wymeditor-resizable-plugin-0.1.tgz - -Installation -============ -Just extract the downloaded archive into your WYMeditor's ``plugin`` -directory. - -Usage -===== -For general instructions on WYMeditor plugins please refer to the `WYMeditor -plugin page`_. - -To use the ``resizable`` plugin simply include the plugin's JavaScript file in -your code. You **do not** need to include the jQuery UI files - this is done -automatically by the plugin (see `Internals`_):: - - - -Make sure to adjust the ``src`` attribute to your needs, then initialize the -plugin in WYMeditor's ``postInit`` function:: - - wymeditor({postInit: function(wym) { - wym.hovertools(); // other plugins... - wym.resizable({handles: "s,e", - maxHeight: 600}); - } - }) - -The ``resizable`` plugin takes exactly one parameter, which is an object literal -containing the options of the plugin. The WYMeditor ``resizable`` plugin -supports all options of the jQuery UI ``resizable`` plugin. These are the -default values used by the plugin:: - - handles: "s,e,se", - minHeight: 250, - maxHeight: 600 - -See the `jQuery UI resizable plugin docs`_ for a list of all options. - -That's it! You are now able to resize the WYMeditor vertically, horizontally or -both, depending on your options. - -.. _jQuery UI resizable plugin docs: http://docs.jquery.com/UI/Resizables - -Internals -========= -The plugin takes care of loading the necessary jQuery UI files (``base`` and -``resizable``) from the same path the jQuery library was loaded. Here's how -it's done:: - - // Get the jQuery path from the editor, stripping away the jQuery file. - // see http://www.oreilly.com/catalog/regex/chapter/ch04.html - // The match result array contains the path and the filename. - var jQueryPath = wym.computeJqueryPath().match(/^(.*)\/(.*)$/)[1]; - - // Make an array of the external JavaScript files required by the plugin. - var jQueryPlugins = [jQueryPath + '/ui.base.js', - jQueryPath + '/ui.resizable.js']; - - // First get the jQuery UI base file - $.getScript(jQueryPlugins[0]); - - // Get the jQuery UI resizeable plugin and then init the wymeditor resizable - // plugin. It is import to do the initialisation after loading the - // necessary jQuery UI files has finished, otherwise the "resizable" method - // would not be available. - $.getScript(jQueryPlugins[1], function() { - jQuery(wym._box).resizable(final_options); - }); - -An alternative approach would be to use an AJAX queue when getting the script -files to ensure that all jQuery files are loaded before the initialisation code -of the plugin is executed. There is an `jQuery AJAX queue plugin`_ which does -that. - -.. _jQuery AJAX queue plugin: http://plugins.jquery.com/project/ajaxqueue - -Changelog -========= - -0.2 ---- -- Added full support for all jQuery UI resizable plugin options. -- Refactored and documented code. -- Now contains a packed version (775 bytes). - -0.1 ---- -- Initial release. - -.. _WYMeditor: http://www.wymeditor.org/ -.. _WYMeditor plugin page: http://trac.wymeditor.org/trac/wiki/0.4/Plugins diff --git a/vendor/assets/javascripts/wymeditor/plugins/table/jquery.wymeditor.table.js b/vendor/assets/javascripts/wymeditor/plugins/table/jquery.wymeditor.table.js deleted file mode 100644 index aacc528..0000000 --- a/vendor/assets/javascripts/wymeditor/plugins/table/jquery.wymeditor.table.js +++ /dev/null @@ -1,676 +0,0 @@ -/** - * Copyright (c) 2011 PolicyStat LLC. - * MIT licensed (MIT-license.txt) - * - * @author Wes Winham (winhamwr@gmail.com) - */ - -// Fugue icons by Yusuke Kamiyamane http://p.yusukekamiyamane.com/ -// and licensed under Creative Commons Attribution - -/** - * A Table editing plugin that gives the user ability to add and remove - * rows and columns as well as merge rows and columns. - * - * @param options A configuration object. - * @param wym The WYMeditor instance to which the TableEditor should attach. - * @class - */ -function TableEditor(options, wym) { - options = jQuery.extend({ - sMergeRowButtonHtml: '' + - '
  • ' + - '' + - 'Merge Table Row' + - '' + - '
  • ', - - sMergeRowButtonSelector: "li.wym_tools_merge_row a", - - sAddRowButtonHtml: '' + - "
  • " + - "" + - "Add Table Row" + - "" + - "
  • ", - sAddRowButtonSelector: "li.wym_tools_add_row a", - - sRemoveRowButtonHtml: '' + - "
  • " + - "" + - "Remove Table Row" + - "" + - "
  • ", - sRemoveRowButtonSelector: "li.wym_tools_remove_row a", - - sAddColumnButtonHtml: '' + - "
  • " + - "" + - "Add Table Column" + - "" + - "
  • ", - sAddColumnButtonSelector: "li.wym_tools_add_column a", - - sRemoveColumnButtonHtml: '' + - "
  • " + - "" + - "Remove Table Column" + - "" + - "
  • ", - sRemoveColumnButtonSelector: "li.wym_tools_remove_column a", - - enableCellTabbing: true - - }, options); - - this._options = options; - this._wym = wym; - - this.init(); -} - -/** - * Construct and return a table objects using the given options object. - * - * @param options The configuration object. - */ -WYMeditor.editor.prototype.table = function(options) { - var tableEditor = new TableEditor(options, this); - this.tableEditor = tableEditor; - - return tableEditor; -}; - -/** - * Initialize the TableEditor object by adding appropriate toolbar buttons and - * binding any required event listeners. - */ -TableEditor.prototype.init = function() { - var wym = this._wym; - var tableEditor = this; - - // Add the tool panel buttons - var tools = $(wym._box).find( - wym._options.toolsSelector + wym._options.toolsListSelector); - - tools.append(tableEditor._options.sMergeRowButtonHtml); - tools.append(tableEditor._options.sAddRowButtonHtml); - tools.append(tableEditor._options.sRemoveRowButtonHtml); - tools.append(tableEditor._options.sAddColumnButtonHtml); - tools.append(tableEditor._options.sRemoveColumnButtonHtml); - - tableEditor.bindEvents(); - rangy.init(); -}; - -/** - * Bind all required event listeners, including button listeners and support for - * tabbing through table cells if enableCellTabbing is true. - */ -TableEditor.prototype.bindEvents = function() { - var wym = this._wym; - var tableEditor = this; - - // Handle tool button click - $(wym._box).find(tableEditor._options.sMergeRowButtonSelector).click(function() { - var sel = rangy.getIframeSelection(wym._iframe); - tableEditor.mergeRow(sel); - return false; - }); - $(wym._box).find(tableEditor._options.sAddRowButtonSelector).click(function() { - return tableEditor.addRow(wym.selected()); - }); - $(wym._box).find(tableEditor._options.sRemoveRowButtonSelector).click(function() { - return tableEditor.removeRow(wym.selected()); - }); - $(wym._box).find(tableEditor._options.sAddColumnButtonSelector).click(function() { - return tableEditor.addColumn(wym.selected()); - }); - $(wym._box).find(tableEditor._options.sRemoveColumnButtonSelector).click(function() { - return tableEditor.removeColumn(wym.selected()); - }); - - // Handle tab clicks - if(tableEditor._options.enableCellTabbing) { - $(wym._doc).bind('keydown', tableEditor.keyDown); - } -}; - -/** - * Get the number of columns in a given tr element, accounting for colspan and - * rowspan. This function assumes that the table structure is valid, and will - * return incorrect results for uneven tables. - * - * @param tr The node whose number of columns we need to count. - * - * @returns {Number} The number of columns in the given tr, accounting for - * colspan and rowspan. - */ -TableEditor.prototype.getNumColumns = function(tr) { - var wym = this._wym; - var numColumns = 0; - - var table = wym.findUp(tr, 'table'); - var firstTr = $(table).find('tr:eq(0)'); - - // Count the tds and ths in the FIRST ROW of this table, accounting for - // colspan. We count the first td because it won't have any rowspan's before - // it to complicate things - $(firstTr).children('td,th').each(function(index, elmnt) { - numColumns += TableEditor.GET_COLSPAN_PROP(elmnt); - }); - - return numColumns; -}; - -/** - TableEditor.GET_COLSPAN_PROP - ============================ - - Get the integer value of the inferred colspan property on the given cell in - a cross-browser compatible way that's also compatible across jquery versions. - - jquery 1.6 changed the way .attr works, which affected certain browsers - differently with regard to colspan and rowspan for cells that didn't explcility - have that attribue set. -*/ -TableEditor.GET_COLSPAN_PROP = function(cell) { - var colspan = $(cell).attr('colspan'); - if (typeof(colspan) === 'undefined') { - colspan = 1; - } - return parseInt(colspan, 10); -}; - -/** - TableEditor.GET_ROWSPAN_PROP - ============================ - - Get the integer value of the inferred rowspan property on the given cell in - a cross-browser compatible way that's also compatible across jquery versions. - - See GET_COLSPAN_PROP for details -*/ -TableEditor.GET_ROWSPAN_PROP = function(cell) { - var rowspan = $(cell).attr('rowspan'); - if (typeof(rowspan) === 'undefined') { - rowspan = 1; - } - return parseInt(rowspan, 10); -}; -/** - * Get the X grid index of the given td or th table cell (0-indexed). This takes - * in to account all colspans and rowspans. - * - * @param cell The td or th node whose X index we're returning. - */ -TableEditor.prototype.getCellXIndex = function(cell) { - var tableEditor = this; - var parentTr = $(cell).parent('tr')[0]; - - var baseRowColumns = this.getNumColumns(parentTr); - - // Figure out how many explicit cells are missing which is how many rowspans - // we're affected by - var rowColCount = 0; - $(parentTr).children('td,th').each(function(index, elmnt) { - rowColCount += TableEditor.GET_COLSPAN_PROP(elmnt); - }); - - var missingCells = baseRowColumns - rowColCount; - var rowspanIndexes = []; - var checkTr = parentTr; - var rowOffset = 1; - - // If this cell is affected by a rowspan from farther up the table, - // we need to take in to account any possible colspan attributes on that - // cell. Store the real X index of the cells to the left of our cell to use - // in the colspan calculation. - while (missingCells > 0) { - checkTr = $(checkTr).prev('tr'); - rowOffset += 1; - var trChildren = $(checkTr).children('td,th'); - for (var i = 0; i < trChildren.length; i++) { - var elmnt = trChildren[i]; - if (TableEditor.GET_ROWSPAN_PROP(elmnt) >= rowOffset) { - // Actually affects our source row - missingCells -= 1; - var colspan = TableEditor.GET_COLSPAN_PROP(elmnt); - rowspanIndexes[tableEditor.getCellXIndex(elmnt)] = colspan; - } - } - } - - var indexCounter = 0; - var cellIndex = null; - // Taking in to account the real X indexes of all of the columns to the left - // of this cell, determine the real X index. - $(parentTr).children('td,th').each(function(index, elmnt) { - if (cellIndex !== null) { - // We've already iterated to the cell we're checking - return; - } - // Account for an inferred colspan created by a rowspan from above - while (typeof(rowspanIndexes[indexCounter]) != 'undefined') { - indexCounter += parseInt(rowspanIndexes[indexCounter], 10); - } - if (elmnt == cell) { - // We're at our cell, no need to keep moving to the right. - // Signal this by setting the cellIndex - cellIndex = indexCounter; - return; - } - // Account for an explicit colspan on this cell - indexCounter += TableEditor.GET_COLSPAN_PROP(elmnt); - }); - - if (cellIndex === null) { - // Somehow, we never found the cell when iterating over its row. - throw "Cell index not found"; - } - return cellIndex; -}; - -/** - * Get the number of columns represented by the given array of contiguous cell - * (td/th) nodes. - * Accounts for colspan and rowspan attributes. - * - * @param cells An array of td/th nodes whose total column span we're checking. - * - * @return {Number} The number of columns represented by the "cells" - */ -TableEditor.prototype.getTotalColumns = function(cells) { - var tableEditor = this; - - var rootTr = this.getCommonParentTr(cells); - if (rootTr === null) { - // Non-contiguous columns - throw "getTotalColumns only allowed for contiguous cells"; - } - - var baseRowColumns = this.getNumColumns(rootTr); - - // Count the number of simple columns, not accounting for rowspans - var colspanCount = 0; - $(cells).each(function(index, elmnt) { - colspanCount += TableEditor.GET_COLSPAN_PROP(elmnt); - }); - - // Determine if we're affected by rowspans. If the number of simple columns - // in the row equals the number of columns in the first row, we don't have - // any rowspans - var rowColCount = 0; - $(rootTr).children('td,th').each(function(index, elmnt) { - rowColCount += TableEditor.GET_COLSPAN_PROP(elmnt); - }); - - if (rowColCount == baseRowColumns) { - // Easy case. No rowspans to deal with - return colspanCount; - } else { - if (cells.length == 1) { - // Easy. Just the colspan - return TableEditor.GET_COLSPAN_PROP(cells[0]); - } else { - var lastCell = $(cells).eq(cells.length - 1)[0]; - var firstCell = $(cells).eq(0)[0]; - // On jQuery 1.4 upgrade, $(cells).eq(-1) - return 1 + tableEditor.getCellXIndex(lastCell) - - tableEditor.getCellXIndex(firstCell); - } - } -}; - -/** - * Merge the table cells in the given selection using a colspan. - * - * @param sel A rangy selection object across which to row merge. - * - * @return {Boolean} true if changes are made, false otherwise - */ -TableEditor.prototype.mergeRow = function(sel) { - var wym = this._wym; - var tableEditor = this; - - // Get all of the affected nodes in the range - var nodes = []; - var range = null; - for (var i = 0; i < sel.rangeCount; i++) { - range = sel.getRangeAt(i); - nodes = nodes.concat(range.getNodes(false)); - } - - // Just use the td and th nodes - var cells = $(nodes).filter('td,th'); - if (cells.length === 0) { - return false; - } - - // If the selection is across multiple tables, don't merge - var rootTr = tableEditor.getCommonParentTr(cells); - if (rootTr === null) { - return false; - } - - var mergeCell = cells[0]; - // If any of the cells have a rowspan, create the inferred cells - $(cells).each(function(i, elmnt) { - var $elmnt = $(elmnt); - var rowspanProp = TableEditor.GET_ROWSPAN_PROP(elmnt); - if (rowspanProp <= 1) { - // We don't care about cells without a rowspan - return; - } - - // This cell has an actual rowspan, we need to account for it - // Figure out the x index for this cell in the table grid - var prevCells = $elmnt.prevAll('td,th'); - var index = tableEditor.getCellXIndex(elmnt); - - // Create the previously-inferred cell in the appropriate index - // with one less rowspan - var newRowspan = rowspanProp - 1; - var newTd; - if (newRowspan == 1) { - newTd = '' + $elmnt.html() + ''; - } else { - newTd = '' + - '' + - $elmnt.html() + - ''; - } - if (index === 0) { - $elmnt.parent('tr') - .next('tr') - .prepend(newTd); - } else { - // TODO: account for colspan/rowspan with insertion - // Account for colspan/rowspan by walking from right to left looking - // for the cell closest to the desired index to APPEND to - var insertionIndex = index - 1; - var insertionCells = $elmnt.parent('tr').next('tr') - .find('td,th'); - var cellInserted = false; - for (i = insertionCells.length - 1; i >= 0; i--) { - var xIndex = tableEditor.getCellXIndex(insertionCells[i]); - if (xIndex <= insertionIndex) { - $(insertionCells[i]).append(newTd); - cellInserted = true; - break; - } - } - if (! cellInserted) { - // Bail out now before we clear HTML and break things - throw "Cell rowspan invalid"; - } - } - - // Clear the cell's html, since we just moved it down - $elmnt.html(''); - }); - - // Remove any rowspan from the mergecell now that we've shifted rowspans - // down - // ie fails when we try to remove a rowspan for some reason - try { - $(mergeCell).removeAttr('rowspan'); - } catch(err) { - $(mergeCell).attr('rowspan', 1); - } - - // Build the content of the new combined cell from all of the included cells - var newContent = ''; - $(cells).each(function(index, elmnt) { - newContent += $(elmnt).html(); - }); - - // Add a colspan to the farthest-left cell - var combinedColspan = this.getTotalColumns(cells); - if ($.browser.msie) { - // jQuery.attr doesn't work for colspan in ie - mergeCell.colSpan = combinedColspan; - } else { - $(mergeCell).attr('colspan', combinedColspan); - } - - // Delete the rest of the cells - $(cells).each(function(index, elmnt) { - if (index !== 0) { - $(elmnt).remove(); - } - }); - - // Change the content in our newly-merged cell - $(mergeCell).html(newContent); - - tableEditor.selectElement(mergeCell); - - return true; -}; - -/** - * Add a row to the given elmnt (representing a or a child of a ). - * - * @param The node which will have a row appended after its parent row. - */ -TableEditor.prototype.addRow = function(elmnt) { - var wym = this._wym; - var tr = wym.findUp(elmnt, 'tr'); - if (tr === null) { - return false; - } - - var numColumns = this.getNumColumns(tr); - - var td_html = ''; - for (i=0; i'+td_html+''); - - return false; -}; - -/** - * Remove the given table if it doesn't have any rows/columns. - * - * @param table The table to delete if it is empty. - */ -TableEditor.prototype.removeEmptyTable = function(table) { - var cells = $(table).find('td,th'); - if (cells.length === 0) { - $(table).remove(); - } -}; - -/** - * Remove the row for the given element (representing a or a child - * of a ). - * - * @param elmnt The node whose parent tr will be removed. - */ -TableEditor.prototype.removeRow = function(elmnt) { - var wym = this._wym; - var tr = wym.findUp(elmnt, 'tr'); - if (tr === null) { - return false; - } - var table = wym.findUp(elmnt, 'table'); - $(tr).remove(); - this.removeEmptyTable(table); - - return false; -}; - -/** - * Add a column to the given elmnt (representing a or a child of a ). - * - * @param elmnt The node which will have a column appended afterward. - */ -TableEditor.prototype.addColumn = function(elmnt) { - var wym = this._wym; - var td = wym.findUp(elmnt, ['td', 'th']); - if (td === null) { - return false; - } - var prevTds = $(td).prevAll(); - var tdIndex = prevTds.length; - - var newTd = ' '; - var newTh = ' '; - var tr = wym.findUp(td, 'tr'); - $(tr).siblings('tr').andSelf().each(function(index, element) { - var insertionElement = newTd; - if ($(element).find('th').length > 0) { - // The row has a TH, so insert a th - insertionElement = newTh; - } - - $(element).find('td,th').eq(tdIndex).after(insertionElement); - }); - - return false; -}; - -/** - * Remove the column to the right of the given elmnt (representing a or a - * child of a ). - */ -TableEditor.prototype.removeColumn = function(elmnt) { - var wym = this._wym; - var td = wym.findUp(elmnt, ['td', 'th']); - if (td === null) { - return false; - } - var table = wym.findUp(elmnt, 'table'); - var prevTds = $(td).prevAll(); - var tdIndex = prevTds.length; - - var tr = wym.findUp(td, 'tr'); - $(tr).siblings('tr').each(function(index, element) { - $(element).find('td,th').eq(tdIndex).remove(); - }); - $(td).remove(); - this.removeEmptyTable(table); - - return false; -}; - -/** - * keyDown event handler used for consistent tab key cell movement. - */ -TableEditor.prototype.keyDown = function(evt) { - //'this' is the doc - var wym = WYMeditor.INSTANCES[this.title]; - var tableEditor = wym.tableEditor; - - if (evt.keyCode == WYMeditor.KEY.TAB) { - return tableEditor.selectNextCell(wym.selected()); - } - - return null; -}; - -/** - * Move the focus to the next cell. - */ -TableEditor.prototype.selectNextCell = function(elmnt) { - var wym = this._wym; - var tableEditor = this; - - var cell = wym.findUp(elmnt, ['td', 'th']); - if (cell === null) { - return null; - } - - // Try moving to the next cell to the right - var nextCells = $(cell).next('td,th'); - if (nextCells.length > 0) { - tableEditor.selectElement(nextCells[0]); - return false; - } - - // There was no cell to the right, use the first cell in the next row - var tr = wym.findUp(cell, 'tr'); - var nextRows = $(tr).next('tr'); - if (nextRows.length !== 0) { - nextCells = $(nextRows).children('td,th'); - if (nextCells.length > 0) { - tableEditor.selectElement(nextCells[0]); - return false; - } - } - - // There is no next row. Do a normal tab - return null; -}; - -/** - * Select the given element using rangy selectors. - */ -TableEditor.prototype.selectElement = function(elmnt) { - var sel = rangy.getIframeSelection(this._wym._iframe); - - var range = rangy.createRange(this._wym._doc); - range.setStart(elmnt, 0); - range.setEnd(elmnt, 0); - range.collapse(false); - - try { - sel.setSingleRange(range); - } catch(err) { - // ie8 can raise an "unkown runtime error" trying to empty the range - } - // IE selection hack - if ($.browser.msie) { - this._wym.saveCaret(); - } -}; - -/** - * Get the common parent tr for the given table cell nodes. If the closest parent - * tr for each cell isn't the same, returns null. - */ -TableEditor.prototype.getCommonParentTr = function(cells) { - cells = $(cells).filter('td,th'); - if (cells.length === 0) { - return null; - } - var firstCell = cells[0]; - - var parentTrList = $(firstCell).parent('tr'); - if (parentTrList.length === 0) { - return null; - } - var rootTr = parentTrList[0]; - - // Ensure that all of the cells have the same parent tr - $(cells).each(function(index, elmnt) { - var parentTrList = $(elmnt).parent('tr'); - if (parentTrList.length === 0 || parentTrList[0] != rootTr) { - return null; - } - }); - - return rootTr; -}; diff --git a/vendor/assets/javascripts/wymeditor/plugins/table/table_delete_column.png b/vendor/assets/javascripts/wymeditor/plugins/table/table_delete_column.png deleted file mode 100644 index 9022d68..0000000 Binary files a/vendor/assets/javascripts/wymeditor/plugins/table/table_delete_column.png and /dev/null differ diff --git a/vendor/assets/javascripts/wymeditor/plugins/table/table_delete_row.png b/vendor/assets/javascripts/wymeditor/plugins/table/table_delete_row.png deleted file mode 100644 index f9d956f..0000000 Binary files a/vendor/assets/javascripts/wymeditor/plugins/table/table_delete_row.png and /dev/null differ diff --git a/vendor/assets/javascripts/wymeditor/plugins/table/table_insert_column.png b/vendor/assets/javascripts/wymeditor/plugins/table/table_insert_column.png deleted file mode 100644 index 49226ec..0000000 Binary files a/vendor/assets/javascripts/wymeditor/plugins/table/table_insert_column.png and /dev/null differ diff --git a/vendor/assets/javascripts/wymeditor/plugins/table/table_insert_row.png b/vendor/assets/javascripts/wymeditor/plugins/table/table_insert_row.png deleted file mode 100644 index da435c3..0000000 Binary files a/vendor/assets/javascripts/wymeditor/plugins/table/table_insert_row.png and /dev/null differ diff --git a/vendor/assets/javascripts/wymeditor/plugins/table/table_join_row.png b/vendor/assets/javascripts/wymeditor/plugins/table/table_join_row.png deleted file mode 100644 index 70e5983..0000000 Binary files a/vendor/assets/javascripts/wymeditor/plugins/table/table_join_row.png and /dev/null differ diff --git a/vendor/assets/javascripts/wymeditor/plugins/tidy/README b/vendor/assets/javascripts/wymeditor/plugins/tidy/README deleted file mode 100644 index acc7ffd..0000000 --- a/vendor/assets/javascripts/wymeditor/plugins/tidy/README +++ /dev/null @@ -1,19 +0,0 @@ -WYMeditor : what you see is What You Mean web-based editor -Copyright (c) 2005 - 2009 Jean-Francois Hovinne, http://www.wymeditor.org/ -Dual licensed under the MIT (MIT-license.txt) -and GPL (GPL-license.txt) licenses. - -For further information visit: - http://www.wymeditor.org/ - -File Name: - README - HTML Tidy plugin for WYMeditor - -File Authors: - Jean-François Hovinne (jf.hovinne a-t wymeditor dotorg) - -Credits: - 'HTML Tidy' by Dave Ragget - http://tidy.sourceforge.net/ - Icon 'wand' by Mark James - http://famfamfam.com/ - -WYMeditor documentation is available online at http://www.wymeditor.org/ diff --git a/vendor/assets/javascripts/wymeditor/plugins/tidy/jquery.wymeditor.tidy.js b/vendor/assets/javascripts/wymeditor/plugins/tidy/jquery.wymeditor.tidy.js deleted file mode 100644 index 65c3eaf..0000000 --- a/vendor/assets/javascripts/wymeditor/plugins/tidy/jquery.wymeditor.tidy.js +++ /dev/null @@ -1,78 +0,0 @@ -/* - * WYMeditor : what you see is What You Mean web-based editor - * Copyright (c) 2005 - 2009 Jean-Francois Hovinne, http://www.wymeditor.org/ - * Dual licensed under the MIT (MIT-license.txt) - * and GPL (GPL-license.txt) licenses. - * - * For further information visit: - * http://www.wymeditor.org/ - * - * File Name: - * jquery.wymeditor.tidy.js - * HTML Tidy plugin for WYMeditor - * - * File Authors: - * Jean-Francois Hovinne (jf.hovinne a-t wymeditor dotorg) - */ - -//WymTidy constructor -function WymTidy(options, wym) { - var wand_url = wym._options.basePath + "plugins/tidy/wand.png"; - options = jQuery.extend({ - sUrl: wym._options.basePath + "plugins/tidy/tidy.php", - sButtonHtml: "" + - "
  • " + - "" + - "Clean up HTML" + - "" + - "
  • ", - - sButtonSelector: "li.wym_tools_tidy a" - - }, options); - - this._options = options; - this._wym = wym; -} - -//Extend WYMeditor -WYMeditor.editor.prototype.tidy = function(options) { - var tidy = new WymTidy(options, this); - return tidy; -}; - - -//WymTidy initialization -WymTidy.prototype.init = function() { - var tidy = this; - - jQuery(this._wym._box).find( - this._wym._options.toolsSelector + this._wym._options.toolsListSelector) - .append(this._options.sButtonHtml); - - //handle click event - jQuery(this._wym._box).find(this._options.sButtonSelector).click(function() { - tidy.cleanup(); - return(false); - }); -}; - -//WymTidy cleanup -WymTidy.prototype.cleanup = function() { - var wym = this._wym; - var html = "" + wym.xhtml() + ""; - - jQuery.post(this._options.sUrl, { html: html}, function(data) { - if (data.length > 0 && data != '0') { - if (data.indexOf(" tags, onclick, onblur, onload, onmouseover... attributes - if you *really* need this functionality. Or, even better, you could allow only the tags and - attributes that you explicitly allow (future versions of WYMeditor might provide this - functionality by default - please contribute). - - Be warned that providing authentication is NOT enough to guard you agains the attack. When - someone is authenticated in your page and visits www.badsite.com, the IFRAME has the proper - authentication so nothing has changed. - -*/ - -if (get_magic_quotes_gpc()) $html = stripslashes($_REQUEST['html']); -else $html = $_REQUEST['html']; - -if(strlen($html) > 0) { - - // Specify configuration - $config = array( - 'bare' => true, - 'clean' => true, - 'doctype' => 'strict', - 'drop-empty-paras' => true, - 'drop-font-tags' => true, - 'drop-proprietary-attributes' => true, - 'enclose-block-text' => true, - 'indent' => false, - 'join-classes' => true, - 'join-styles' => true, - 'logical-emphasis' => true, - 'output-xhtml' => true, - 'show-body-only' => true, - 'wrap' => 0); - - // Tidy - $tidy = new tidy; - $tidy->parseString($html, $config, 'utf8'); - $tidy->cleanRepair(); - - // Output - echo $tidy; -} else { - -echo ('0'); -} -?> diff --git a/vendor/assets/javascripts/wymeditor/plugins/tidy/wand.png b/vendor/assets/javascripts/wymeditor/plugins/tidy/wand.png deleted file mode 100644 index bb55eea..0000000 Binary files a/vendor/assets/javascripts/wymeditor/plugins/tidy/wand.png and /dev/null differ diff --git a/vendor/assets/javascripts/wymeditor/skins/compact/icons.png b/vendor/assets/javascripts/wymeditor/skins/compact/icons.png deleted file mode 100644 index c6eb463..0000000 Binary files a/vendor/assets/javascripts/wymeditor/skins/compact/icons.png and /dev/null differ diff --git a/vendor/assets/javascripts/wymeditor/skins/compact/skin.css b/vendor/assets/javascripts/wymeditor/skins/compact/skin.css deleted file mode 100644 index 4a6a0c6..0000000 --- a/vendor/assets/javascripts/wymeditor/skins/compact/skin.css +++ /dev/null @@ -1,134 +0,0 @@ -/* - * WYMeditor : what you see is What You Mean web-based editor - * Copyright (c) 2005 - 2009 Jean-Francois Hovinne, http://www.wymeditor.org/ - * Dual licensed under the MIT (MIT-license.txt) - * and GPL (GPL-license.txt) licenses. - * - * For further information visit: - * http://www.wymeditor.org/ - * - * File Name: - * screen.css - * main stylesheet for the WYMeditor skin - * See the documentation for more info. - * - * File Authors: - * Daniel Reszka (d.reszka a-t wymeditor dotorg) - * Jean-Francois Hovinne (jf.hovinne a-t wymeditor dotorg) -*/ - -/*TRYING TO RESET STYLES THAT MAY INTERFERE WITH WYMEDITOR*/ - .wym_skin_compact p, .wym_skin_compact h2, .wym_skin_compact h3, - .wym_skin_compact ul, .wym_skin_compact li { background: transparent url(); margin: 0; padding: 0; border-width:0; list-style: none; } - - -/*HIDDEN BY DEFAULT*/ - .wym_skin_compact .wym_area_left { display: none; } - .wym_skin_compact .wym_area_right { display: none; } - - -/*TYPO*/ - .wym_skin_compact { font-size: 10px; font-family: Verdana, Arial, sans-serif; } - .wym_skin_compact h2 { font-size: 110%; /* = 11px */} - .wym_skin_compact h3 { font-size: 100%; /* = 10px */} - .wym_skin_compact li { font-size: 100%; /* = 10px */} - - -/*WYM_BOX*/ - .wym_skin_compact { border: 1px solid gray; padding: 5px} - - /*auto-clear the wym_box*/ - .wym_skin_compact:after { content: "."; display: block; height: 0; clear: both; visibility: hidden; } - * html .wym_skin_compact { height: 1%;} - - -/*WYM_HTML*/ - .wym_skin_compact .wym_html { width: 98%;} - .wym_skin_compact .wym_html textarea { font-size: 120%; width: 100%; height: 200px; border: 1px solid gray; background: white; } - - -/*WYM_IFRAME*/ - .wym_skin_compact .wym_iframe { width: 98%;} - .wym_skin_compact .wym_iframe iframe { width: 100%; height: 200px; border: 1px solid gray; background: white } - - -/*AREAS*/ - .wym_skin_compact .wym_area_left { width: 100px; float: left;} - .wym_skin_compact .wym_area_right { width: 150px; float: right;} - .wym_skin_compact .wym_area_bottom { height: 1%; clear: both;} - * html .wym_skin_compact .wym_area_main { height: 1%;} - * html .wym_skin_compact .wym_area_top { height: 1%;} - *+html .wym_skin_compact .wym_area_top { height: 1%;} - -/*SECTIONS SYSTEM*/ - - /*common defaults for all sections*/ - .wym_skin_compact .wym_section { margin-bottom: 5px; } - .wym_skin_compact .wym_section h2, - .wym_skin_compact .wym_section h3 { padding: 1px 3px; margin: 0; } - .wym_skin_compact .wym_section a { padding: 0 3px; display: block; text-decoration: none; color: black; } - .wym_skin_compact .wym_section a:hover { background-color: yellow; } - /*hide section titles by default*/ - .wym_skin_compact .wym_section h2 { display: none; } - /*disable any margin-collapse*/ - .wym_skin_compact .wym_section { padding-top: 1px; padding-bottom: 1px; } - /*auto-clear sections*/ - .wym_skin_compact .wym_section ul:after { content: "."; display: block; height: 0; clear: both; visibility: hidden; } - * html .wym_skin_compact .wym_section ul { height: 1%;} - - /*option: add this class to a section to make it render as a panel*/ - .wym_skin_compact .wym_panel { } - .wym_skin_compact .wym_panel h2 { display: block; } - - /*option: add this class to a section to make it render as a dropdown menu*/ - .wym_skin_compact .wym_dropdown h2 { display: block; } - .wym_skin_compact .wym_dropdown ul { display: none; position: absolute; background: white; } - .wym_skin_compact .wym_dropdown:hover ul, - .wym_skin_compact .wym_dropdown.hover ul { display: block; } - - /*option: add this class to a section to make its elements render buttons (icons are only available for the wym_tools section for now)*/ - .wym_skin_compact .wym_buttons li { float:left;} - .wym_skin_compact .wym_buttons a { width: 20px; height: 20px; overflow: hidden; padding: 2px } - /*image replacements*/ - .wym_skin_compact .wym_buttons li a { background: url(icons.png) no-repeat; text-indent: -9999px;} - .wym_skin_compact .wym_buttons li.wym_tools_strong a { background-position: 0 -382px;} - .wym_skin_compact .wym_buttons li.wym_tools_emphasis a { background-position: 0 -22px;} - .wym_skin_compact .wym_buttons li.wym_tools_superscript a { background-position: 0 -430px;} - .wym_skin_compact .wym_buttons li.wym_tools_subscript a { background-position: 0 -454px;} - .wym_skin_compact .wym_buttons li.wym_tools_ordered_list a { background-position: 0 -48px;} - .wym_skin_compact .wym_buttons li.wym_tools_unordered_list a{ background-position: 0 -72px;} - .wym_skin_compact .wym_buttons li.wym_tools_indent a { background-position: 0 -574px;} - .wym_skin_compact .wym_buttons li.wym_tools_outdent a { background-position: 0 -598px;} - .wym_skin_compact .wym_buttons li.wym_tools_undo a { background-position: 0 -502px;} - .wym_skin_compact .wym_buttons li.wym_tools_redo a { background-position: 0 -526px;} - .wym_skin_compact .wym_buttons li.wym_tools_link a { background-position: 0 -96px;} - .wym_skin_compact .wym_buttons li.wym_tools_unlink a { background-position: 0 -168px;} - .wym_skin_compact .wym_buttons li.wym_tools_image a { background-position: 0 -121px;} - .wym_skin_compact .wym_buttons li.wym_tools_table a { background-position: 0 -144px;} - .wym_skin_compact .wym_buttons li.wym_tools_paste a { background-position: 0 -552px;} - .wym_skin_compact .wym_buttons li.wym_tools_html a { background-position: 0 -193px;} - .wym_skin_compact .wym_buttons li.wym_tools_preview a { background-position: 0 -408px;} - -/*DECORATION*/ - .wym_skin_compact .wym_section h2 { background: #f0f0f0; border: solid gray; border-width: 0 0 1px;} - .wym_skin_compact .wym_section h2 span { color: gray;} - .wym_skin_compact .wym_panel { padding: 0; border: solid gray; border-width: 1px; background: white;} - .wym_skin_compact .wym_panel ul { margin: 2px 0 5px; } - .wym_skin_compact .wym_dropdown { padding: 0; border: solid gray; border-width: 1px 1px 0 1px; } - .wym_skin_compact .wym_dropdown ul { border: solid gray; border-width: 0 1px 1px 1px; margin-left: -1px; padding: 5px 10px 5px 3px;} - -/*DIALOGS*/ - .wym_dialog div.row { margin-bottom: 5px;} - .wym_dialog div.row input { margin-right: 5px;} - .wym_dialog div.row label { float: left; width: 150px; display: block; text-align: right; margin-right: 10px; } - .wym_dialog div.row-indent { padding-left: 160px; } - /*autoclearing*/ - .wym_dialog div.row:after { content: "."; display: block; height: 0; clear: both; visibility: hidden; } - .wym_dialog div.row { display: inline-block; } - /* Hides from IE-mac \*/ - * html .wym_dialog div.row { height: 1%; } - .wym_dialog div.row { display: block; } - /* End hide from IE-mac */ - -/*WYMEDITOR_LINK*/ - a.wym_wymeditor_link { text-indent: -9999px; float: right; display: block; width: 50px; height: 15px; background: url(../wymeditor_icon.png); overflow: hidden; text-decoration: none; } diff --git a/vendor/assets/javascripts/wymeditor/skins/compact/skin.js b/vendor/assets/javascripts/wymeditor/skins/compact/skin.js deleted file mode 100644 index 2fa961b..0000000 --- a/vendor/assets/javascripts/wymeditor/skins/compact/skin.js +++ /dev/null @@ -1,37 +0,0 @@ -WYMeditor.SKINS.compact = { - - init: function(wym) { - - //move the containers panel to the top area - jQuery(wym._options.containersSelector + ', ' + - wym._options.classesSelector, wym._box) - .appendTo( jQuery("div.wym_area_top", wym._box) ) - .addClass("wym_dropdown") - .css({"margin-right": "10px", "width": "120px", "float": "left"}); - - //render following sections as buttons - jQuery(wym._options.toolsSelector, wym._box) - .addClass("wym_buttons") - .css({"margin-right": "10px", "float": "left"}); - - //make hover work under IE < 7 - jQuery(".wym_section", wym._box).hover(function(){ - jQuery(this).addClass("hover"); - },function(){ - jQuery(this).removeClass("hover"); - }); - - var postInit = wym._options.postInit; - wym._options.postInit = function(wym) { - - if (postInit) { - postInit.call(wym, wym); - } - var rule = { - name: 'body', - css: 'background-color: #f0f0f0;' - }; - wym.addCssRule( wym._doc.styleSheets[0], rule); - }; - } -}; diff --git a/vendor/assets/javascripts/wymeditor/skins/default/icons.png b/vendor/assets/javascripts/wymeditor/skins/default/icons.png deleted file mode 100644 index c6eb463..0000000 Binary files a/vendor/assets/javascripts/wymeditor/skins/default/icons.png and /dev/null differ diff --git a/vendor/assets/javascripts/wymeditor/skins/default/skin.css b/vendor/assets/javascripts/wymeditor/skins/default/skin.css deleted file mode 100644 index bbffd6e..0000000 --- a/vendor/assets/javascripts/wymeditor/skins/default/skin.css +++ /dev/null @@ -1,133 +0,0 @@ -/* - * WYMeditor : what you see is What You Mean web-based editor - * Copyright (c) 2005 - 2009 Jean-Francois Hovinne, http://www.wymeditor.org/ - * Dual licensed under the MIT (MIT-license.txt) - * and GPL (GPL-license.txt) licenses. - * - * For further information visit: - * http://www.wymeditor.org/ - * - * File Name: - * skin.css - * main stylesheet for the default WYMeditor skin - * See the documentation for more info. - * - * File Authors: - * Daniel Reszka (d.reszka a-t wymeditor dotorg) -*/ - -/*TRYING TO RESET STYLES THAT MAY INTERFERE WITH WYMEDITOR*/ - .wym_skin_default p, .wym_skin_default h2, .wym_skin_default h3, - .wym_skin_default ul, .wym_skin_default li { background: transparent url(); margin: 0; padding: 0; border-width:0; list-style: none; } - - -/*HIDDEN BY DEFAULT*/ - .wym_skin_default .wym_area_left { display: none; } - .wym_skin_default .wym_area_right { display: block; } - - -/*TYPO*/ - .wym_skin_default { font-size: 62.5%; font-family: Verdana, Arial, sans-serif; } - .wym_skin_default h2 { font-size: 110%; /* = 11px */} - .wym_skin_default h3 { font-size: 100%; /* = 10px */} - .wym_skin_default li { font-size: 100%; /* = 10px */} - - -/*WYM_BOX*/ - .wym_skin_default { border: 1px solid gray; background: #f2f2f2; padding: 5px} - - /*auto-clear the wym_box*/ - .wym_skin_default:after { content: "."; display: block; height: 0; clear: both; visibility: hidden; } - * html .wym_skin_default { height: 1%;} - - -/*WYM_HTML*/ - .wym_skin_default .wym_html { width: 98%;} - .wym_skin_default .wym_html textarea { width: 100%; height: 200px; border: 1px solid gray; background: white; } - - -/*WYM_IFRAME*/ - .wym_skin_default .wym_iframe { width: 98%;} - .wym_skin_default .wym_iframe iframe { width: 100%; height: 200px; border: 1px solid gray; background: white } - - -/*AREAS*/ - .wym_skin_default .wym_area_left { width: 150px; float: left;} - .wym_skin_default .wym_area_right { width: 150px; float: right;} - .wym_skin_default .wym_area_bottom { height: 1%; clear: both;} - * html .wym_skin_default .wym_area_main { height: 1%;} - * html .wym_skin_default .wym_area_top { height: 1%;} - *+html .wym_skin_default .wym_area_top { height: 1%;} - -/*SECTIONS SYSTEM*/ - - /*common defaults for all sections*/ - .wym_skin_default .wym_section { margin-bottom: 5px; } - .wym_skin_default .wym_section h2, - .wym_skin_default .wym_section h3 { padding: 1px 3px; margin: 0; } - .wym_skin_default .wym_section a { padding: 0 3px; display: block; text-decoration: none; color: black; } - .wym_skin_default .wym_section a:hover { background-color: yellow; } - /*hide section titles by default*/ - .wym_skin_default .wym_section h2 { display: none; } - /*disable any margin-collapse*/ - .wym_skin_default .wym_section { padding-top: 1px; padding-bottom: 1px; } - /*auto-clear sections*/ - .wym_skin_default .wym_section ul:after { content: "."; display: block; height: 0; clear: both; visibility: hidden; } - * html .wym_skin_default .wym_section ul { height: 1%;} - - /*option: add this class to a section to make it render as a panel*/ - .wym_skin_default .wym_panel { } - .wym_skin_default .wym_panel h2 { display: block; } - - /*option: add this class to a section to make it render as a dropdown menu*/ - .wym_skin_default .wym_dropdown h2 { display: block; } - .wym_skin_default .wym_dropdown ul { display: none; position: absolute; background: white; } - .wym_skin_default .wym_dropdown:hover ul, - .wym_skin_default .wym_dropdown.hover ul { display: block; } - - /*option: add this class to a section to make its elements render buttons (icons are only available for the wym_tools section for now)*/ - .wym_skin_default .wym_buttons li { float:left;} - .wym_skin_default .wym_buttons a { width: 20px; height: 20px; overflow: hidden; padding: 2px } - /*image replacements*/ - .wym_skin_default .wym_buttons li a { background: url(icons.png) no-repeat; text-indent: -9999px;} - .wym_skin_default .wym_buttons li.wym_tools_strong a { background-position: 0 -382px;} - .wym_skin_default .wym_buttons li.wym_tools_emphasis a { background-position: 0 -22px;} - .wym_skin_default .wym_buttons li.wym_tools_superscript a { background-position: 0 -430px;} - .wym_skin_default .wym_buttons li.wym_tools_subscript a { background-position: 0 -454px;} - .wym_skin_default .wym_buttons li.wym_tools_ordered_list a { background-position: 0 -48px;} - .wym_skin_default .wym_buttons li.wym_tools_unordered_list a{ background-position: 0 -72px;} - .wym_skin_default .wym_buttons li.wym_tools_indent a { background-position: 0 -574px;} - .wym_skin_default .wym_buttons li.wym_tools_outdent a { background-position: 0 -598px;} - .wym_skin_default .wym_buttons li.wym_tools_undo a { background-position: 0 -502px;} - .wym_skin_default .wym_buttons li.wym_tools_redo a { background-position: 0 -526px;} - .wym_skin_default .wym_buttons li.wym_tools_link a { background-position: 0 -96px;} - .wym_skin_default .wym_buttons li.wym_tools_unlink a { background-position: 0 -168px;} - .wym_skin_default .wym_buttons li.wym_tools_image a { background-position: 0 -121px;} - .wym_skin_default .wym_buttons li.wym_tools_table a { background-position: 0 -144px;} - .wym_skin_default .wym_buttons li.wym_tools_paste a { background-position: 0 -552px;} - .wym_skin_default .wym_buttons li.wym_tools_html a { background-position: 0 -193px;} - .wym_skin_default .wym_buttons li.wym_tools_preview a { background-position: 0 -408px;} - -/*DECORATION*/ - .wym_skin_default .wym_section h2 { background: #ddd; border: solid gray; border-width: 0 0 1px;} - .wym_skin_default .wym_section h2 span { color: gray;} - .wym_skin_default .wym_panel { padding: 0; border: solid gray; border-width: 1px; background: white;} - .wym_skin_default .wym_panel ul { margin: 2px 0 5px; } - .wym_skin_default .wym_dropdown { padding: 0; border: solid gray; border-width: 1px 1px 0 1px; } - .wym_skin_default .wym_dropdown ul { border: solid gray; border-width: 0 1px 1px 1px; margin-left: -1px; padding: 5px 10px 5px 3px;} - -/*DIALOGS*/ - .wym_dialog div.row { margin-bottom: 5px;} - .wym_dialog div.row input { margin-right: 5px;} - .wym_dialog div.row label { float: left; width: 120px; display: block; text-align: right; margin-right: 10px; } - .wym_dialog div.row-indent { padding-left: 160px; } - /*autoclearing*/ - .wym_dialog div.row:after { content: "."; display: block; height: 0; clear: both; visibility: hidden; } - .wym_dialog div.row { display: inline-block; } - /* Hides from IE-mac \*/ - * html .wym_dialog div.row { height: 1%; } - .wym_dialog div.row { display: block; } - /* End hide from IE-mac */ - -/*WYMEDITOR_LINK*/ - a.wym_wymeditor_link { text-indent: -9999px; float: right; display: block; width: 50px; height: 15px; background: url(../wymeditor_icon.png); overflow: hidden; text-decoration: none; } diff --git a/vendor/assets/javascripts/wymeditor/skins/default/skin.js b/vendor/assets/javascripts/wymeditor/skins/default/skin.js deleted file mode 100644 index 5f6d97e..0000000 --- a/vendor/assets/javascripts/wymeditor/skins/default/skin.js +++ /dev/null @@ -1,40 +0,0 @@ -WYMeditor.SKINS['default'] = { - - init: function(wym) { - - //render following sections as panels - jQuery(wym._box).find(wym._options.classesSelector) - .addClass("wym_panel"); - - //render following sections as buttons - jQuery(wym._box).find(wym._options.toolsSelector) - .addClass("wym_buttons"); - - //render following sections as dropdown menus - jQuery(wym._box).find(wym._options.containersSelector) - .addClass("wym_dropdown") - .find(WYMeditor.H2) - .append(" >"); - - // auto add some margin to the main area sides if left area - // or right area are not empty (if they contain sections) - jQuery(wym._box).find("div.wym_area_right ul") - .parents("div.wym_area_right").show() - .parents(wym._options.boxSelector) - .find("div.wym_area_main") - .css({"margin-right": "155px"}); - - jQuery(wym._box).find("div.wym_area_left ul") - .parents("div.wym_area_left").show() - .parents(wym._options.boxSelector) - .find("div.wym_area_main") - .css({"margin-left": "155px"}); - - //make hover work under IE < 7 - jQuery(wym._box).find(".wym_section").hover(function(){ - jQuery(this).addClass("hover"); - },function(){ - jQuery(this).removeClass("hover"); - }); - } -}; diff --git a/vendor/assets/javascripts/wymeditor/skins/minimal/images/bg.header.gif b/vendor/assets/javascripts/wymeditor/skins/minimal/images/bg.header.gif deleted file mode 100644 index b2d2907..0000000 Binary files a/vendor/assets/javascripts/wymeditor/skins/minimal/images/bg.header.gif and /dev/null differ diff --git a/vendor/assets/javascripts/wymeditor/skins/minimal/images/bg.selector.silver.gif b/vendor/assets/javascripts/wymeditor/skins/minimal/images/bg.selector.silver.gif deleted file mode 100644 index e65976b..0000000 Binary files a/vendor/assets/javascripts/wymeditor/skins/minimal/images/bg.selector.silver.gif and /dev/null differ diff --git a/vendor/assets/javascripts/wymeditor/skins/minimal/images/bg.wymeditor.png b/vendor/assets/javascripts/wymeditor/skins/minimal/images/bg.wymeditor.png deleted file mode 100644 index 1e84813..0000000 Binary files a/vendor/assets/javascripts/wymeditor/skins/minimal/images/bg.wymeditor.png and /dev/null differ diff --git a/vendor/assets/javascripts/wymeditor/skins/minimal/images/icons.silver.gif b/vendor/assets/javascripts/wymeditor/skins/minimal/images/icons.silver.gif deleted file mode 100644 index 8c6a4fb..0000000 Binary files a/vendor/assets/javascripts/wymeditor/skins/minimal/images/icons.silver.gif and /dev/null differ diff --git a/vendor/assets/javascripts/wymeditor/skins/minimal/skin.css b/vendor/assets/javascripts/wymeditor/skins/minimal/skin.css deleted file mode 100644 index cea8d84..0000000 --- a/vendor/assets/javascripts/wymeditor/skins/minimal/skin.css +++ /dev/null @@ -1,131 +0,0 @@ -/* - * WYMeditor : what you see is What You Mean web-based editor - * Copyright (c) 2005 - 2009 Jean-Francois Hovinne, http://www.wymeditor.org/ - * Dual licensed under the MIT (MIT-license.txt) - * and GPL (GPL-license.txt) licenses. - * - * For further information visit: - * http://www.wymeditor.org/ - * - * File Name: - * skin.css - * main stylesheet for the minimal WYMeditor skin - * See the documentation for more info. - * - * File Authors: - * Jean-Francois Hovinne - * Scott Lewis (see Silver skin) -*/ - -/* Set iframe */ -.wym_skin_minimal div.wym_iframe iframe { - width: 90%; - height: 200px; -} - -/* Hide h2 by default */ -.wym_skin_minimal h2 { - display: none; -} - -/* Show specific h2 */ -.wym_skin_minimal div.wym_tools h2, -.wym_skin_minimal div.wym_containers h2, -.wym_skin_minimal div.wym_classes h2 { - display: block; -} - -.wym_skin_minimal div.wym_section ul { - margin: 0; -} - -.wym_skin_minimal div.wym_section ul li { - float: left; - list-style-type: none; - margin-right: 5px; -} - -.wym_skin_minimal div.wym_area_top, -.wym_skin_minimal div.wym_area_right, -.wym_skin_minimal div.wym_containers, -.wym_skin_minimal div.wym_classes { - float: left; -} - -.wym_skin_minimal div.wym_area_main { - clear: both; -} - -.wym_skin_minimal div.wym_html { - width: 90%; -} - -.wym_skin_minimal textarea.wym_html_val { - width: 100%; - height: 100px; -} - -/* DROPDOWNS (see Silver skin) */ -.wym_skin_minimal div.wym_dropdown { - cursor: pointer; - margin: 0px 4px 10px 0px; - padding: 0px; - z-index: 1001; - display: block; -} - -.wym_skin_minimal div.wym_dropdown ul { - display: none; - width: 124px; - padding: 0px; - margin: 0px; - list-style-type: none; - list-style-image: none; - z-index: 1002; - position: absolute; - border-top: 1px solid #AAA; -} - -.wym_skin_minimal div.wym_dropdown ul li { - width: 146px; - height: 20px; - padding: 0px; - margin: 0px; - border: 1px solid #777; - border-top: none; - background: #EEE; - list-style-image: none; -} - -.wym_skin_minimal div.wym_dropdown h2 { - width: 138px; - height: 16px; - color: #000; - background-image: url(images/bg.selector.silver.gif); - background-position: 0px -18px; - background-repeat: no-repeat; - border: none; - font-family: "Trebuchet MS", Verdana, Arial, Helvetica, Sanserif; - font-size: 12px; - font-weight: bold; - padding: 2px 0px 0px 10px; - margin: 0px; -} - -.wym_skin_minimal div.wym_dropdown a { - text-decoration: none; - font-family: "Trebuchet MS", Verdana, Arial, Helvetica, Sanserif; - font-size: 12px; - padding: 5px 0px 0px 10px; - display: block; - width: 136px; - height: 15px; - color: #000; - text-align: left; - margin-left: 0px; -} - -.wym_skin_minimal div.wym_dropdown a:hover { - background: #BBB; - border-bottom: none; -} diff --git a/vendor/assets/javascripts/wymeditor/skins/minimal/skin.js b/vendor/assets/javascripts/wymeditor/skins/minimal/skin.js deleted file mode 100644 index d2536ce..0000000 --- a/vendor/assets/javascripts/wymeditor/skins/minimal/skin.js +++ /dev/null @@ -1,30 +0,0 @@ -jQuery.fn.selectify = function() { - return this.each(function() { - jQuery(this).hover( - function() { - jQuery("h2", this).css("background-position", "0px -18px"); - jQuery("ul", this).fadeIn("fast"); - }, - function() { - jQuery("h2", this).css("background-position", ""); - jQuery("ul", this).fadeOut("fast"); - } - ); - }); -}; - -WYMeditor.SKINS.minimal = { - //placeholder for the skin JS, if needed - - //init the skin - //wym is the WYMeditor.editor instance - init: function(wym) { - - //render following sections as dropdown menus - jQuery(wym._box).find(wym._options.toolsSelector + ', ' + wym._options.containersSelector + ', ' + wym._options.classesSelector) - .addClass("wym_dropdown") - .selectify(); - - - } -}; diff --git a/vendor/assets/javascripts/wymeditor/skins/silver/COPYING b/vendor/assets/javascripts/wymeditor/skins/silver/COPYING deleted file mode 100755 index 94a9ed0..0000000 --- a/vendor/assets/javascripts/wymeditor/skins/silver/COPYING +++ /dev/null @@ -1,674 +0,0 @@ - GNU GENERAL PUBLIC LICENSE - Version 3, 29 June 2007 - - Copyright (C) 2007 Free Software Foundation, Inc. - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - - Preamble - - The GNU General Public License is a free, copyleft license for -software and other kinds of works. - - The licenses for most software and other practical works are designed -to take away your freedom to share and change the works. By contrast, -the GNU General Public License is intended to guarantee your freedom to -share and change all versions of a program--to make sure it remains free -software for all its users. We, the Free Software Foundation, use the -GNU General Public License for most of our software; it applies also to -any other work released this way by its authors. You can apply it to -your programs, too. - - When we speak of free software, we are referring to freedom, not -price. Our General Public Licenses are designed to make sure that you -have the freedom to distribute copies of free software (and charge for -them if you wish), that you receive source code or can get it if you -want it, that you can change the software or use pieces of it in new -free programs, and that you know you can do these things. - - To protect your rights, we need to prevent others from denying you -these rights or asking you to surrender the rights. Therefore, you have -certain responsibilities if you distribute copies of the software, or if -you modify it: responsibilities to respect the freedom of others. - - For example, if you distribute copies of such a program, whether -gratis or for a fee, you must pass on to the recipients the same -freedoms that you received. You must make sure that they, too, receive -or can get the source code. And you must show them these terms so they -know their rights. - - Developers that use the GNU GPL protect your rights with two steps: -(1) assert copyright on the software, and (2) offer you this License -giving you legal permission to copy, distribute and/or modify it. - - For the developers' and authors' protection, the GPL clearly explains -that there is no warranty for this free software. For both users' and -authors' sake, the GPL requires that modified versions be marked as -changed, so that their problems will not be attributed erroneously to -authors of previous versions. - - Some devices are designed to deny users access to install or run -modified versions of the software inside them, although the manufacturer -can do so. This is fundamentally incompatible with the aim of -protecting users' freedom to change the software. The systematic -pattern of such abuse occurs in the area of products for individuals to -use, which is precisely where it is most unacceptable. Therefore, we -have designed this version of the GPL to prohibit the practice for those -products. If such problems arise substantially in other domains, we -stand ready to extend this provision to those domains in future versions -of the GPL, as needed to protect the freedom of users. - - Finally, every program is threatened constantly by software patents. -States should not allow patents to restrict development and use of -software on general-purpose computers, but in those that do, we wish to -avoid the special danger that patents applied to a free program could -make it effectively proprietary. To prevent this, the GPL assures that -patents cannot be used to render the program non-free. - - The precise terms and conditions for copying, distribution and -modification follow. - - TERMS AND CONDITIONS - - 0. Definitions. - - "This License" refers to version 3 of the GNU General Public License. - - "Copyright" also means copyright-like laws that apply to other kinds of -works, such as semiconductor masks. - - "The Program" refers to any copyrightable work licensed under this -License. Each licensee is addressed as "you". "Licensees" and -"recipients" may be individuals or organizations. - - To "modify" a work means to copy from or adapt all or part of the work -in a fashion requiring copyright permission, other than the making of an -exact copy. The resulting work is called a "modified version" of the -earlier work or a work "based on" the earlier work. - - A "covered work" means either the unmodified Program or a work based -on the Program. - - To "propagate" a work means to do anything with it that, without -permission, would make you directly or secondarily liable for -infringement under applicable copyright law, except executing it on a -computer or modifying a private copy. Propagation includes copying, -distribution (with or without modification), making available to the -public, and in some countries other activities as well. - - To "convey" a work means any kind of propagation that enables other -parties to make or receive copies. Mere interaction with a user through -a computer network, with no transfer of a copy, is not conveying. - - An interactive user interface displays "Appropriate Legal Notices" -to the extent that it includes a convenient and prominently visible -feature that (1) displays an appropriate copyright notice, and (2) -tells the user that there is no warranty for the work (except to the -extent that warranties are provided), that licensees may convey the -work under this License, and how to view a copy of this License. If -the interface presents a list of user commands or options, such as a -menu, a prominent item in the list meets this criterion. - - 1. Source Code. - - The "source code" for a work means the preferred form of the work -for making modifications to it. "Object code" means any non-source -form of a work. - - A "Standard Interface" means an interface that either is an official -standard defined by a recognized standards body, or, in the case of -interfaces specified for a particular programming language, one that -is widely used among developers working in that language. - - The "System Libraries" of an executable work include anything, other -than the work as a whole, that (a) is included in the normal form of -packaging a Major Component, but which is not part of that Major -Component, and (b) serves only to enable use of the work with that -Major Component, or to implement a Standard Interface for which an -implementation is available to the public in source code form. A -"Major Component", in this context, means a major essential component -(kernel, window system, and so on) of the specific operating system -(if any) on which the executable work runs, or a compiler used to -produce the work, or an object code interpreter used to run it. - - The "Corresponding Source" for a work in object code form means all -the source code needed to generate, install, and (for an executable -work) run the object code and to modify the work, including scripts to -control those activities. However, it does not include the work's -System Libraries, or general-purpose tools or generally available free -programs which are used unmodified in performing those activities but -which are not part of the work. For example, Corresponding Source -includes interface definition files associated with source files for -the work, and the source code for shared libraries and dynamically -linked subprograms that the work is specifically designed to require, -such as by intimate data communication or control flow between those -subprograms and other parts of the work. - - The Corresponding Source need not include anything that users -can regenerate automatically from other parts of the Corresponding -Source. - - The Corresponding Source for a work in source code form is that -same work. - - 2. Basic Permissions. - - All rights granted under this License are granted for the term of -copyright on the Program, and are irrevocable provided the stated -conditions are met. This License explicitly affirms your unlimited -permission to run the unmodified Program. The output from running a -covered work is covered by this License only if the output, given its -content, constitutes a covered work. This License acknowledges your -rights of fair use or other equivalent, as provided by copyright law. - - You may make, run and propagate covered works that you do not -convey, without conditions so long as your license otherwise remains -in force. You may convey covered works to others for the sole purpose -of having them make modifications exclusively for you, or provide you -with facilities for running those works, provided that you comply with -the terms of this License in conveying all material for which you do -not control copyright. Those thus making or running the covered works -for you must do so exclusively on your behalf, under your direction -and control, on terms that prohibit them from making any copies of -your copyrighted material outside their relationship with you. - - Conveying under any other circumstances is permitted solely under -the conditions stated below. Sublicensing is not allowed; section 10 -makes it unnecessary. - - 3. Protecting Users' Legal Rights From Anti-Circumvention Law. - - No covered work shall be deemed part of an effective technological -measure under any applicable law fulfilling obligations under article -11 of the WIPO copyright treaty adopted on 20 December 1996, or -similar laws prohibiting or restricting circumvention of such -measures. - - When you convey a covered work, you waive any legal power to forbid -circumvention of technological measures to the extent such circumvention -is effected by exercising rights under this License with respect to -the covered work, and you disclaim any intention to limit operation or -modification of the work as a means of enforcing, against the work's -users, your or third parties' legal rights to forbid circumvention of -technological measures. - - 4. Conveying Verbatim Copies. - - You may convey verbatim copies of the Program's source code as you -receive it, in any medium, provided that you conspicuously and -appropriately publish on each copy an appropriate copyright notice; -keep intact all notices stating that this License and any -non-permissive terms added in accord with section 7 apply to the code; -keep intact all notices of the absence of any warranty; and give all -recipients a copy of this License along with the Program. - - You may charge any price or no price for each copy that you convey, -and you may offer support or warranty protection for a fee. - - 5. Conveying Modified Source Versions. - - You may convey a work based on the Program, or the modifications to -produce it from the Program, in the form of source code under the -terms of section 4, provided that you also meet all of these conditions: - - a) The work must carry prominent notices stating that you modified - it, and giving a relevant date. - - b) The work must carry prominent notices stating that it is - released under this License and any conditions added under section - 7. This requirement modifies the requirement in section 4 to - "keep intact all notices". - - c) You must license the entire work, as a whole, under this - License to anyone who comes into possession of a copy. This - License will therefore apply, along with any applicable section 7 - additional terms, to the whole of the work, and all its parts, - regardless of how they are packaged. This License gives no - permission to license the work in any other way, but it does not - invalidate such permission if you have separately received it. - - d) If the work has interactive user interfaces, each must display - Appropriate Legal Notices; however, if the Program has interactive - interfaces that do not display Appropriate Legal Notices, your - work need not make them do so. - - A compilation of a covered work with other separate and independent -works, which are not by their nature extensions of the covered work, -and which are not combined with it such as to form a larger program, -in or on a volume of a storage or distribution medium, is called an -"aggregate" if the compilation and its resulting copyright are not -used to limit the access or legal rights of the compilation's users -beyond what the individual works permit. Inclusion of a covered work -in an aggregate does not cause this License to apply to the other -parts of the aggregate. - - 6. Conveying Non-Source Forms. - - You may convey a covered work in object code form under the terms -of sections 4 and 5, provided that you also convey the -machine-readable Corresponding Source under the terms of this License, -in one of these ways: - - a) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by the - Corresponding Source fixed on a durable physical medium - customarily used for software interchange. - - b) Convey the object code in, or embodied in, a physical product - (including a physical distribution medium), accompanied by a - written offer, valid for at least three years and valid for as - long as you offer spare parts or customer support for that product - model, to give anyone who possesses the object code either (1) a - copy of the Corresponding Source for all the software in the - product that is covered by this License, on a durable physical - medium customarily used for software interchange, for a price no - more than your reasonable cost of physically performing this - conveying of source, or (2) access to copy the - Corresponding Source from a network server at no charge. - - c) Convey individual copies of the object code with a copy of the - written offer to provide the Corresponding Source. This - alternative is allowed only occasionally and noncommercially, and - only if you received the object code with such an offer, in accord - with subsection 6b. - - d) Convey the object code by offering access from a designated - place (gratis or for a charge), and offer equivalent access to the - Corresponding Source in the same way through the same place at no - further charge. You need not require recipients to copy the - Corresponding Source along with the object code. If the place to - copy the object code is a network server, the Corresponding Source - may be on a different server (operated by you or a third party) - that supports equivalent copying facilities, provided you maintain - clear directions next to the object code saying where to find the - Corresponding Source. Regardless of what server hosts the - Corresponding Source, you remain obligated to ensure that it is - available for as long as needed to satisfy these requirements. - - e) Convey the object code using peer-to-peer transmission, provided - you inform other peers where the object code and Corresponding - Source of the work are being offered to the general public at no - charge under subsection 6d. - - A separable portion of the object code, whose source code is excluded -from the Corresponding Source as a System Library, need not be -included in conveying the object code work. - - A "User Product" is either (1) a "consumer product", which means any -tangible personal property which is normally used for personal, family, -or household purposes, or (2) anything designed or sold for incorporation -into a dwelling. In determining whether a product is a consumer product, -doubtful cases shall be resolved in favor of coverage. For a particular -product received by a particular user, "normally used" refers to a -typical or common use of that class of product, regardless of the status -of the particular user or of the way in which the particular user -actually uses, or expects or is expected to use, the product. A product -is a consumer product regardless of whether the product has substantial -commercial, industrial or non-consumer uses, unless such uses represent -the only significant mode of use of the product. - - "Installation Information" for a User Product means any methods, -procedures, authorization keys, or other information required to install -and execute modified versions of a covered work in that User Product from -a modified version of its Corresponding Source. The information must -suffice to ensure that the continued functioning of the modified object -code is in no case prevented or interfered with solely because -modification has been made. - - If you convey an object code work under this section in, or with, or -specifically for use in, a User Product, and the conveying occurs as -part of a transaction in which the right of possession and use of the -User Product is transferred to the recipient in perpetuity or for a -fixed term (regardless of how the transaction is characterized), the -Corresponding Source conveyed under this section must be accompanied -by the Installation Information. But this requirement does not apply -if neither you nor any third party retains the ability to install -modified object code on the User Product (for example, the work has -been installed in ROM). - - The requirement to provide Installation Information does not include a -requirement to continue to provide support service, warranty, or updates -for a work that has been modified or installed by the recipient, or for -the User Product in which it has been modified or installed. Access to a -network may be denied when the modification itself materially and -adversely affects the operation of the network or violates the rules and -protocols for communication across the network. - - Corresponding Source conveyed, and Installation Information provided, -in accord with this section must be in a format that is publicly -documented (and with an implementation available to the public in -source code form), and must require no special password or key for -unpacking, reading or copying. - - 7. Additional Terms. - - "Additional permissions" are terms that supplement the terms of this -License by making exceptions from one or more of its conditions. -Additional permissions that are applicable to the entire Program shall -be treated as though they were included in this License, to the extent -that they are valid under applicable law. If additional permissions -apply only to part of the Program, that part may be used separately -under those permissions, but the entire Program remains governed by -this License without regard to the additional permissions. - - When you convey a copy of a covered work, you may at your option -remove any additional permissions from that copy, or from any part of -it. (Additional permissions may be written to require their own -removal in certain cases when you modify the work.) You may place -additional permissions on material, added by you to a covered work, -for which you have or can give appropriate copyright permission. - - Notwithstanding any other provision of this License, for material you -add to a covered work, you may (if authorized by the copyright holders of -that material) supplement the terms of this License with terms: - - a) Disclaiming warranty or limiting liability differently from the - terms of sections 15 and 16 of this License; or - - b) Requiring preservation of specified reasonable legal notices or - author attributions in that material or in the Appropriate Legal - Notices displayed by works containing it; or - - c) Prohibiting misrepresentation of the origin of that material, or - requiring that modified versions of such material be marked in - reasonable ways as different from the original version; or - - d) Limiting the use for publicity purposes of names of licensors or - authors of the material; or - - e) Declining to grant rights under trademark law for use of some - trade names, trademarks, or service marks; or - - f) Requiring indemnification of licensors and authors of that - material by anyone who conveys the material (or modified versions of - it) with contractual assumptions of liability to the recipient, for - any liability that these contractual assumptions directly impose on - those licensors and authors. - - All other non-permissive additional terms are considered "further -restrictions" within the meaning of section 10. If the Program as you -received it, or any part of it, contains a notice stating that it is -governed by this License along with a term that is a further -restriction, you may remove that term. If a license document contains -a further restriction but permits relicensing or conveying under this -License, you may add to a covered work material governed by the terms -of that license document, provided that the further restriction does -not survive such relicensing or conveying. - - If you add terms to a covered work in accord with this section, you -must place, in the relevant source files, a statement of the -additional terms that apply to those files, or a notice indicating -where to find the applicable terms. - - Additional terms, permissive or non-permissive, may be stated in the -form of a separately written license, or stated as exceptions; -the above requirements apply either way. - - 8. Termination. - - You may not propagate or modify a covered work except as expressly -provided under this License. Any attempt otherwise to propagate or -modify it is void, and will automatically terminate your rights under -this License (including any patent licenses granted under the third -paragraph of section 11). - - However, if you cease all violation of this License, then your -license from a particular copyright holder is reinstated (a) -provisionally, unless and until the copyright holder explicitly and -finally terminates your license, and (b) permanently, if the copyright -holder fails to notify you of the violation by some reasonable means -prior to 60 days after the cessation. - - Moreover, your license from a particular copyright holder is -reinstated permanently if the copyright holder notifies you of the -violation by some reasonable means, this is the first time you have -received notice of violation of this License (for any work) from that -copyright holder, and you cure the violation prior to 30 days after -your receipt of the notice. - - Termination of your rights under this section does not terminate the -licenses of parties who have received copies or rights from you under -this License. If your rights have been terminated and not permanently -reinstated, you do not qualify to receive new licenses for the same -material under section 10. - - 9. Acceptance Not Required for Having Copies. - - You are not required to accept this License in order to receive or -run a copy of the Program. Ancillary propagation of a covered work -occurring solely as a consequence of using peer-to-peer transmission -to receive a copy likewise does not require acceptance. However, -nothing other than this License grants you permission to propagate or -modify any covered work. These actions infringe copyright if you do -not accept this License. Therefore, by modifying or propagating a -covered work, you indicate your acceptance of this License to do so. - - 10. Automatic Licensing of Downstream Recipients. - - Each time you convey a covered work, the recipient automatically -receives a license from the original licensors, to run, modify and -propagate that work, subject to this License. You are not responsible -for enforcing compliance by third parties with this License. - - An "entity transaction" is a transaction transferring control of an -organization, or substantially all assets of one, or subdividing an -organization, or merging organizations. If propagation of a covered -work results from an entity transaction, each party to that -transaction who receives a copy of the work also receives whatever -licenses to the work the party's predecessor in interest had or could -give under the previous paragraph, plus a right to possession of the -Corresponding Source of the work from the predecessor in interest, if -the predecessor has it or can get it with reasonable efforts. - - You may not impose any further restrictions on the exercise of the -rights granted or affirmed under this License. For example, you may -not impose a license fee, royalty, or other charge for exercise of -rights granted under this License, and you may not initiate litigation -(including a cross-claim or counterclaim in a lawsuit) alleging that -any patent claim is infringed by making, using, selling, offering for -sale, or importing the Program or any portion of it. - - 11. Patents. - - A "contributor" is a copyright holder who authorizes use under this -License of the Program or a work on which the Program is based. The -work thus licensed is called the contributor's "contributor version". - - A contributor's "essential patent claims" are all patent claims -owned or controlled by the contributor, whether already acquired or -hereafter acquired, that would be infringed by some manner, permitted -by this License, of making, using, or selling its contributor version, -but do not include claims that would be infringed only as a -consequence of further modification of the contributor version. For -purposes of this definition, "control" includes the right to grant -patent sublicenses in a manner consistent with the requirements of -this License. - - Each contributor grants you a non-exclusive, worldwide, royalty-free -patent license under the contributor's essential patent claims, to -make, use, sell, offer for sale, import and otherwise run, modify and -propagate the contents of its contributor version. - - In the following three paragraphs, a "patent license" is any express -agreement or commitment, however denominated, not to enforce a patent -(such as an express permission to practice a patent or covenant not to -sue for patent infringement). To "grant" such a patent license to a -party means to make such an agreement or commitment not to enforce a -patent against the party. - - If you convey a covered work, knowingly relying on a patent license, -and the Corresponding Source of the work is not available for anyone -to copy, free of charge and under the terms of this License, through a -publicly available network server or other readily accessible means, -then you must either (1) cause the Corresponding Source to be so -available, or (2) arrange to deprive yourself of the benefit of the -patent license for this particular work, or (3) arrange, in a manner -consistent with the requirements of this License, to extend the patent -license to downstream recipients. "Knowingly relying" means you have -actual knowledge that, but for the patent license, your conveying the -covered work in a country, or your recipient's use of the covered work -in a country, would infringe one or more identifiable patents in that -country that you have reason to believe are valid. - - If, pursuant to or in connection with a single transaction or -arrangement, you convey, or propagate by procuring conveyance of, a -covered work, and grant a patent license to some of the parties -receiving the covered work authorizing them to use, propagate, modify -or convey a specific copy of the covered work, then the patent license -you grant is automatically extended to all recipients of the covered -work and works based on it. - - A patent license is "discriminatory" if it does not include within -the scope of its coverage, prohibits the exercise of, or is -conditioned on the non-exercise of one or more of the rights that are -specifically granted under this License. You may not convey a covered -work if you are a party to an arrangement with a third party that is -in the business of distributing software, under which you make payment -to the third party based on the extent of your activity of conveying -the work, and under which the third party grants, to any of the -parties who would receive the covered work from you, a discriminatory -patent license (a) in connection with copies of the covered work -conveyed by you (or copies made from those copies), or (b) primarily -for and in connection with specific products or compilations that -contain the covered work, unless you entered into that arrangement, -or that patent license was granted, prior to 28 March 2007. - - Nothing in this License shall be construed as excluding or limiting -any implied license or other defenses to infringement that may -otherwise be available to you under applicable patent law. - - 12. No Surrender of Others' Freedom. - - If conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot convey a -covered work so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you may -not convey it at all. For example, if you agree to terms that obligate you -to collect a royalty for further conveying from those to whom you convey -the Program, the only way you could satisfy both those terms and this -License would be to refrain entirely from conveying the Program. - - 13. Use with the GNU Affero General Public License. - - Notwithstanding any other provision of this License, you have -permission to link or combine any covered work with a work licensed -under version 3 of the GNU Affero General Public License into a single -combined work, and to convey the resulting work. The terms of this -License will continue to apply to the part which is the covered work, -but the special requirements of the GNU Affero General Public License, -section 13, concerning interaction through a network will apply to the -combination as such. - - 14. Revised Versions of this License. - - The Free Software Foundation may publish revised and/or new versions of -the GNU General Public License from time to time. Such new versions will -be similar in spirit to the present version, but may differ in detail to -address new problems or concerns. - - Each version is given a distinguishing version number. If the -Program specifies that a certain numbered version of the GNU General -Public License "or any later version" applies to it, you have the -option of following the terms and conditions either of that numbered -version or of any later version published by the Free Software -Foundation. If the Program does not specify a version number of the -GNU General Public License, you may choose any version ever published -by the Free Software Foundation. - - If the Program specifies that a proxy can decide which future -versions of the GNU General Public License can be used, that proxy's -public statement of acceptance of a version permanently authorizes you -to choose that version for the Program. - - Later license versions may give you additional or different -permissions. However, no additional obligations are imposed on any -author or copyright holder as a result of your choosing to follow a -later version. - - 15. Disclaimer of Warranty. - - THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY -APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT -HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY -OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM -IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF -ALL NECESSARY SERVICING, REPAIR OR CORRECTION. - - 16. Limitation of Liability. - - IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS -THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY -GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE -USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF -DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD -PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), -EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF -SUCH DAMAGES. - - 17. Interpretation of Sections 15 and 16. - - If the disclaimer of warranty and limitation of liability provided -above cannot be given local legal effect according to their terms, -reviewing courts shall apply local law that most closely approximates -an absolute waiver of all civil liability in connection with the -Program, unless a warranty or assumption of liability accompanies a -copy of the Program in return for a fee. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Programs - - If you develop a new program, and you want it to be of the greatest -possible use to the public, the best way to achieve this is to make it -free software which everyone can redistribute and change under these terms. - - To do so, attach the following notices to the program. It is safest -to attach them to the start of each source file to most effectively -state the exclusion of warranty; and each file should have at least -the "copyright" line and a pointer to where the full notice is found. - - - Copyright (C) - - This program is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program. If not, see . - -Also add information on how to contact you by electronic and paper mail. - - If the program does terminal interaction, make it output a short -notice like this when it starts in an interactive mode: - - Copyright (C) - This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. - This is free software, and you are welcome to redistribute it - under certain conditions; type `show c' for details. - -The hypothetical commands `show w' and `show c' should show the appropriate -parts of the General Public License. Of course, your program's commands -might be different; for a GUI interface, you would use an "about box". - - You should also get your employer (if you work as a programmer) or school, -if any, to sign a "copyright disclaimer" for the program, if necessary. -For more information on this, and how to apply and follow the GNU GPL, see -. - - The GNU General Public License does not permit incorporating your program -into proprietary programs. If your program is a subroutine library, you -may consider it more useful to permit linking proprietary applications with -the library. If this is what you want to do, use the GNU Lesser General -Public License instead of this License. But first, please read -. diff --git a/vendor/assets/javascripts/wymeditor/skins/silver/README b/vendor/assets/javascripts/wymeditor/skins/silver/README deleted file mode 100755 index 130dc46..0000000 --- a/vendor/assets/javascripts/wymeditor/skins/silver/README +++ /dev/null @@ -1,27 +0,0 @@ -/** -* @version Alpha 0.1 2008-05-10 23:28:43 $ -* @package Silver skin for WYMeditor -* @copyright Copyright (C) 2008 Scott Edwin Lewis. All rights reserved. -* @license GNU/GPL, see COPYING -* Silver skin for WYMeditor is free software and is licensed under the -* GNU General Public License. See COPYING for copyright notices and details. -*/ - -Adds custom buttons and color palette to the WYMeditor XHTML Editor. - -INSTALLATION: - -1. Copy the entire /silver/ directory to /wymeditor/skins/ -2. Initialize the WYMeditor 'skin' option as below: - - - -That's it. You're done. diff --git a/vendor/assets/javascripts/wymeditor/skins/silver/images/bg.header.gif b/vendor/assets/javascripts/wymeditor/skins/silver/images/bg.header.gif deleted file mode 100644 index b2d2907..0000000 Binary files a/vendor/assets/javascripts/wymeditor/skins/silver/images/bg.header.gif and /dev/null differ diff --git a/vendor/assets/javascripts/wymeditor/skins/silver/images/bg.selector.silver.gif b/vendor/assets/javascripts/wymeditor/skins/silver/images/bg.selector.silver.gif deleted file mode 100644 index e65976b..0000000 Binary files a/vendor/assets/javascripts/wymeditor/skins/silver/images/bg.selector.silver.gif and /dev/null differ diff --git a/vendor/assets/javascripts/wymeditor/skins/silver/images/bg.wymeditor.png b/vendor/assets/javascripts/wymeditor/skins/silver/images/bg.wymeditor.png deleted file mode 100644 index 1e84813..0000000 Binary files a/vendor/assets/javascripts/wymeditor/skins/silver/images/bg.wymeditor.png and /dev/null differ diff --git a/vendor/assets/javascripts/wymeditor/skins/silver/images/icons.silver.gif b/vendor/assets/javascripts/wymeditor/skins/silver/images/icons.silver.gif deleted file mode 100644 index 8c6a4fb..0000000 Binary files a/vendor/assets/javascripts/wymeditor/skins/silver/images/icons.silver.gif and /dev/null differ diff --git a/vendor/assets/javascripts/wymeditor/skins/silver/skin.css b/vendor/assets/javascripts/wymeditor/skins/silver/skin.css deleted file mode 100644 index 8284d81..0000000 --- a/vendor/assets/javascripts/wymeditor/skins/silver/skin.css +++ /dev/null @@ -1,297 +0,0 @@ -/* - * WYMeditor : what you see is What You Mean web-based editor - * Copyright (c) 2005 - 2009 Jean-Francois Hovinne, http://www.wymeditor.org/ - * Dual licensed under the MIT (MIT-license.txt) - * and GPL (GPL-license.txt) licenses. - * - * For further information visit: - * http://www.wymeditor.org/ - * - * File Name: - * screen.css - * main stylesheet for the default WYMeditor skin - * See the documentation for more info. - * - * File Authors: - * Daniel Reszka (d.reszka a-t wymeditor dotorg) - * Scott Edwin Lewis -*/ - -/*TRYING TO RESET STYLES THAT MAY INTERFERE WITH WYMEDITOR*/ - .wym_skin_silver p, .wym_skin_silver h2, .wym_skin_silver h3, - .wym_skin_silver ul, .wym_skin_silver li { background: transparent url(); margin: 0; padding: 0; border-width:0; list-style: none; } - - -/*HIDDEN BY DEFAULT*/ - .wym_skin_silver .wym_area_left { display: none; } - .wym_skin_silver .wym_area_right { display: block; } - - -/*TYPO*/ - .wym_skin_silver { font-size: 62.5%; font-family: Verdana, Arial, sans-serif; } - .wym_skin_silver h2 { font-size: 110%; /* = 11px */} - .wym_skin_silver h3 { font-size: 100%; /* = 10px */} - .wym_skin_silver li { font-size: 100%; /* = 10px */} - - -/*WYM_BOX*/ - .wym_skin_silver { border: 1px solid gray; background: #f2f2f2; padding: 0px; margin: 0px;} - - /*auto-clear the wym_box*/ - .wym_skin_silver:after { content: "."; display: block; height: 0; clear: both; visibility: hidden; } - * html .wym_skin_silver { height: 1%;} - - -/*WYM_HTML*/ - .wym_skin_silver .wym_html { width: 98%;} - .wym_skin_silver .wym_html textarea { width: 100%; height: 200px; border: 1px solid gray; background: white; } - - -/*WYM_IFRAME*/ - .wym_skin_silver .wym_iframe { width: 98%;} - .wym_skin_silver .wym_iframe iframe { width: 100%; height: 200px; border: 1px solid gray; background: white } - - -/*AREAS*/ - .wym_skin_silver .wym_area_left { width: 150px; float: left;} - .wym_skin_silver .wym_area_right { width: 150px; float: right;} - .wym_skin_silver .wym_area_bottom { height: 1%; clear: both;} - * html .wym_skin_silver .wym_area_main { height: 1%;} - * html .wym_skin_silver .wym_area_top { height: 1%;} - *+html .wym_skin_silver .wym_area_top { height: 1%;} - -/*SECTIONS SYSTEM*/ - - /*common defaults for all sections*/ - .wym_skin_silver .wym_section { margin-bottom: 5px; } - .wym_skin_silver .wym_section h2, - .wym_skin_silver .wym_section h3 { padding: 1px 3px; margin: 0; cursor: pointer; } - .wym_skin_silver .wym_section a { padding: 5px 0px 0px 10px; display: block; text-decoration: none; color: black; } - .wym_skin_silver .wym_section a:hover { /*background-color: #DDD;*/} - /*hide section titles by default*/ - .wym_skin_silver .wym_section h2 { display: none; } - /*disable any margin-collapse*/ - .wym_skin_silver .wym_section { padding-top: 1px; padding-bottom: 1px; } - /*auto-clear sections*/ - .wym_skin_silver .wym_section ul:after { content: "."; display: block; height: 0; clear: both; visibility: hidden; padding: 0px; } - * html .wym_skin_silver .wym_section ul { height: 1%;} - .wym_skin_silver .wym_section li {} - - /*option: add this class to a section to make it render as a panel*/ - .wym_skin_silver .wym_panel { } - .wym_skin_silver .wym_panel h2 { display: block; font-size: 11px; } - - /*option: add this class to a section to make it render as a dropdown menu*/ - .wym_skin_silver .wym_dropdown h2 { display: block; font-size: 11px;} - .wym_skin_silver .wym_dropdown ul { position: absolute; background: white; padding: 0px;} - .wym_skin_silver .wym_dropdown:hover ul, - .wym_skin_silver .wym_dropdown.hover ul { cursor: pointer;} - .wym_skin_silver .wym_dropdown ul li a {/*border-bottom: 1px solid #AAA;*/} - - /*option: add this class to a section to make its elements render buttons (icons are only available for the wym_tools section for now)*/ - .wym_skin_silver .wym_buttons li { float:left;} - .wym_skin_silver .wym_buttons a { width: 20px; height: 20px; overflow: hidden; padding: 2px; text-decoration: none !important; border: 1px solid #666; } - .wym_skin_silver .wym_buttons a:hover { text-decoration: none !important; border: 1px solid #000;} - /*image replacements*/ - .wym_skin_silver .wym_buttons li a { background: url(images/icons.silver.gif) no-repeat; text-indent: -9999px;} - .wym_skin_silver .wym_buttons li.wym_tools_strong a { background-position: 0 -384px;} - .wym_skin_silver .wym_buttons li.wym_tools_emphasis a { background-position: 0 -24px;} - .wym_skin_silver .wym_buttons li.wym_tools_superscript a { background-position: 0 -432px;} - .wym_skin_silver .wym_buttons li.wym_tools_subscript a { background-position: 0 -456px;} - .wym_skin_silver .wym_buttons li.wym_tools_ordered_list a { background-position: 0 -48px;} - .wym_skin_silver .wym_buttons li.wym_tools_unordered_list a{ background-position: 0 -72px;} - .wym_skin_silver .wym_buttons li.wym_tools_indent a { background-position: 0 -600px;} - .wym_skin_silver .wym_buttons li.wym_tools_outdent a { background-position: 0 -624px;} - .wym_skin_silver .wym_buttons li.wym_tools_undo a { background-position: 0 -504px;} - .wym_skin_silver .wym_buttons li.wym_tools_redo a { background-position: 0 -528px;} - .wym_skin_silver .wym_buttons li.wym_tools_link a { background-position: 0 -96px;} - .wym_skin_silver .wym_buttons li.wym_tools_unlink a { background-position: 0 -168px;} - .wym_skin_silver .wym_buttons li.wym_tools_image a { background-position: 0 -120px;} - .wym_skin_silver .wym_buttons li.wym_tools_table a { background-position: 0 -144px;} - .wym_skin_silver .wym_buttons li.wym_tools_paste a { background-position: 0 -552px;} - .wym_skin_silver .wym_buttons li.wym_tools_html a { background-position: 0 -192px;} - .wym_skin_silver .wym_buttons li.wym_tools_preview a { background-position: 0 -408px;} - .wym_skin_silver .wym_buttons li.wym_tools_gadget a { background-position: 0 -576px;} - - .wym_skin_silver .wym_buttons li.wym_tools_strong a:hover { background-position: -24px -384px;} - .wym_skin_silver .wym_buttons li.wym_tools_emphasis a:hover { background-position: -24px -24px;} - .wym_skin_silver .wym_buttons li.wym_tools_superscript a:hover { background-position: -24px -432px;} - .wym_skin_silver .wym_buttons li.wym_tools_subscript a:hover { background-position: -24px -456px;} - .wym_skin_silver .wym_buttons li.wym_tools_ordered_list a:hover { background-position: -24px -48px;} - .wym_skin_silver .wym_buttons li.wym_tools_unordered_list a:hover{ background-position: -24px -72px;} - .wym_skin_silver .wym_buttons li.wym_tools_indent a:hover { background-position: -24px -600px;} - .wym_skin_silver .wym_buttons li.wym_tools_outdent a:hover { background-position: -24px -624px;} - .wym_skin_silver .wym_buttons li.wym_tools_undo a:hover { background-position: -24px -504px;} - .wym_skin_silver .wym_buttons li.wym_tools_redo a:hover { background-position: -24px -528px;} - .wym_skin_silver .wym_buttons li.wym_tools_link a:hover { background-position: -24px -96px;} - .wym_skin_silver .wym_buttons li.wym_tools_unlink a:hover { background-position: -24px -168px;} - .wym_skin_silver .wym_buttons li.wym_tools_image a:hover { background-position: -24px -120px;} - .wym_skin_silver .wym_buttons li.wym_tools_table a:hover { background-position: -24px -144px;} - .wym_skin_silver .wym_buttons li.wym_tools_paste a:hover { background-position: -24px -552px;} - .wym_skin_silver .wym_buttons li.wym_tools_html a:hover { background-position: -24px -192px;} - .wym_skin_silver .wym_buttons li.wym_tools_preview a:hover { background-position: -24px -408px;} - .wym_skin_silver .wym_buttons li.wym_tools_gadget a:hover { background-position: -24px -576px;} - -/*DECORATION*/ - .wym_skin_silver .wym_section h2 { background: #ddd; border: none;} - .wym_skin_silver .wym_section h2 span { color: gray;} - .wym_skin_silver .wym_panel { padding: 0; border: solid gray; border-width: 0px;} - .wym_skin_silver .wym_panel ul { margin: 2px 0 5px; } - .wym_skin_silver .wym_dropdown { padding: 0; border: none; } - .wym_skin_silver .wym_dropdown ul { border: none; margin-left: -1px; padding: 0px;} - -/*DIALOGS*/ - .wym_dialog div.row { margin-bottom: 5px;} - .wym_dialog div.row input { margin-right: 5px;} - .wym_dialog div.row label { float: left; width: 150px; display: block; text-align: right; margin-right: 10px; } - .wym_dialog div.row-indent { padding-left: 160px; } - /*autoclearing*/ - .wym_dialog div.row:after { content: "."; display: block; height: 0; clear: both; visibility: hidden; } - .wym_dialog div.row { display: inline-block; } - /* Hides from IE-mac \*/ - * html .wym_dialog div.row { height: 1%; } - .wym_dialog div.row { display: block; } - /* End hide from IE-mac */ - -/*WYMEDITOR_LINK*/ - a.wym_wymeditor_link - { - text-indent: -9999px; - float: right; - display: block; - width: 50px; - height: 15px; - background: url(../wymeditor_icon.png); - background-position: 1px 1px; - background-repeat: no-repeat; - overflow: hidden; - text-decoration: none; - padding: 1px !important; - border: 1px solid #333 !important; - background-color: #FFF !important; - } - -.wym_box -{ - padding: 0px !important; - margin: 0px; -} -.wym_inner -{ - border-left: 1px solid #FFF; - border-top: 1px solid #FFF; - border-right: 1px solid #FFF; - border-bottom: 1px solid #FFF; - padding: 5px; - background-color: #B8C1C4; - height: auto; -} - -.clear {clear: both;} - -div.wym_dropdown -{ - cursor: pointer; - width: 138px !important; - margin: 0px 4px 10px 0px !important; - padding: 0px; - z-index: 1001; - display: block; - border: 1px solid red; -} - -div.wym_dropdown ul -{ - display: none; - width: 124px; - padding: 0px !important; - margin: 0px !important; - list-style-type: none; - list-style-image: none; - z-index: 1002; - position: absolute; - border-top: 1px solid #AAA; -} - -div.wym_dropdown ul li -{ - width: 146px; - height: 20px; - padding: 0px !important; - margin: 0px; - border: 1px solid #777; - border-top: none; - background: #DDD; - list-style-image: none; -} - -div.wym_dropdown h2 -{ - width: 138px; - height: 16px; - color: #000 !important; - background-image: url(images/bg.selector.silver.gif) !important; - background-position: 0px -18px; - background-repeat: no-repeat; - border: none; - font-family: "Trebuchet MS", Verdana, Arial, Helvetica, Sanserif; - font-size: 12px !important; - font-weight: bold !important; - padding: 2px 0px 0px 10px !important; - margin: 0px !important; -} - -.wym_skin_silver .wym_panel h2 -{ - width: 138px; - height: 16px; - color: #000 !important; - background-image: url(images/bg.header.gif) !important; - background-position: 0px 0px; - background-repeat: no-repeat; - border: none; - font-family: "Trebuchet MS", Verdana, Arial, Helvetica, Sanserif; - font-size: 12px !important; - font-weight: bold !important; - padding: 2px 0px 0px 10px !important; - margin: 0px !important; -} - -.wym_skin_silver .wym_panel ul -{ - margin-top: 0px !important; -} - -.wym_skin_silver .wym_panel ul li -{ - width: 146px; - height: 20px; - padding: 0px !important; - margin: 0px; - border: 1px solid #777; - border-top: none; - background: #DDD; - list-style-image: none; -} - -.wym_skin_silver .wym_panel a, -div.wym_dropdown a -{ - text-decoration: none; - font-family: "Trebuchet MS", Verdana, Arial, Helvetica, Sanserif; - font-size: 12px; - padding: 5px 0px 0px 10px !important; - display: block; - width: 136px; - height: 15px; - color: #000; - text-align: left !important; - margin-left: 0px !important; -} - -div.wym_dropdown a:hover, -.wym_skin_silver .wym_panel a:hover -{ - background: #BBB; - border-bottom: none !important; -} diff --git a/vendor/assets/javascripts/wymeditor/skins/silver/skin.js b/vendor/assets/javascripts/wymeditor/skins/silver/skin.js deleted file mode 100644 index 7d94094..0000000 --- a/vendor/assets/javascripts/wymeditor/skins/silver/skin.js +++ /dev/null @@ -1,61 +0,0 @@ -/* This file is part of the Silver skin for WYMeditor by Scott Edwin Lewis */ - -jQuery.fn.selectify = function() { - return this.each(function() { - jQuery(this).hover( - function() { - jQuery("h2", this).css("background-position", "0px -18px"); - jQuery("ul", this).fadeIn("fast"); - }, - function() { - jQuery("h2", this).css("background-position", ""); - jQuery("ul", this).fadeOut("fast"); - } - ); - }); -}; - -WYMeditor.SKINS.silver = { - - init: function(wym) { - - //add some elements to improve the rendering - jQuery(wym._box) - .append('
    ') - .wrapInner('
    '); - - //render following sections as panels - jQuery(wym._box).find(wym._options.classesSelector) - .addClass("wym_panel"); - - //render following sections as buttons - jQuery(wym._box).find(wym._options.toolsSelector) - .addClass("wym_buttons"); - - //render following sections as dropdown menus - jQuery(wym._box).find(wym._options.containersSelector) - .addClass("wym_dropdown") - .selectify(); - - // auto add some margin to the main area sides if left area - // or right area are not empty (if they contain sections) - jQuery(wym._box).find("div.wym_area_right ul") - .parents("div.wym_area_right").show() - .parents(wym._options.boxSelector) - .find("div.wym_area_main") - .css({"margin-right": "155px"}); - - jQuery(wym._box).find("div.wym_area_left ul") - .parents("div.wym_area_left").show() - .parents(wym._options.boxSelector) - .find("div.wym_area_main") - .css({"margin-left": "155px"}); - - //make hover work under IE < 7 - jQuery(wym._box).find(".wym_section").hover(function(){ - jQuery(this).addClass("hover"); - },function(){ - jQuery(this).removeClass("hover"); - }); - } -}; diff --git a/vendor/assets/javascripts/wymeditor/skins/twopanels/icons.png b/vendor/assets/javascripts/wymeditor/skins/twopanels/icons.png deleted file mode 100644 index c6eb463..0000000 Binary files a/vendor/assets/javascripts/wymeditor/skins/twopanels/icons.png and /dev/null differ diff --git a/vendor/assets/javascripts/wymeditor/skins/twopanels/skin.css b/vendor/assets/javascripts/wymeditor/skins/twopanels/skin.css deleted file mode 100644 index 7e6b8fd..0000000 --- a/vendor/assets/javascripts/wymeditor/skins/twopanels/skin.css +++ /dev/null @@ -1,134 +0,0 @@ -/* - * WYMeditor : what you see is What You Mean web-based editor - * Copyright (c) 2005 - 2009 Jean-Francois Hovinne, http://www.wymeditor.org/ - * Dual licensed under the MIT (MIT-license.txt) - * and GPL (GPL-license.txt) licenses. - * - * For further information visit: - * http://www.wymeditor.org/ - * - * File Name: - * screen.css - * main stylesheet for the WYMeditor skin - * See the documentation for more info. - * - * File Authors: - * Daniel Reszka (d.reszka a-t wymeditor dotorg) - * Jean-Francois Hovinne -*/ - -/*TRYING TO RESET STYLES THAT MAY INTERFERE WITH WYMEDITOR*/ - .wym_skin_twopanels p, .wym_skin_twopanels h2, .wym_skin_twopanels h3, - .wym_skin_twopanels ul, .wym_skin_twopanels li { background: transparent url(); margin: 0; padding: 0; border-width:0; list-style: none; } - - -/*HIDDEN BY DEFAULT*/ - .wym_skin_twopanels .wym_area_left { display: block; } - .wym_skin_twopanels .wym_area_right { display: block; } - - -/*TYPO*/ - .wym_skin_twopanels { font-size: 62.5%; font-family: Verdana, Arial, sans-serif; } - .wym_skin_twopanels h2 { font-size: 110%; /* = 11px */} - .wym_skin_twopanels h3 { font-size: 100%; /* = 10px */} - .wym_skin_twopanels li { font-size: 100%; /* = 10px */} - - -/*WYM_BOX*/ - .wym_skin_twopanels { border: 1px solid gray; background: #f2f2f2; padding: 5px} - - /*auto-clear the wym_box*/ - .wym_skin_twopanels:after { content: "."; display: block; height: 0; clear: both; visibility: hidden; } - * html .wym_skin_twopanels { height: 1%;} - - -/*WYM_HTML*/ - .wym_skin_twopanels .wym_html { width: 98%;} - .wym_skin_twopanels .wym_html textarea { width: 100%; height: 200px; border: 1px solid gray; background: white; } - - -/*WYM_IFRAME*/ - .wym_skin_twopanels .wym_iframe { width: 98%;} - .wym_skin_twopanels .wym_iframe iframe { width: 100%; height: 200px; border: 1px solid gray; background: white } - - -/*AREAS*/ - .wym_skin_twopanels .wym_area_left { width: 100px; float: left;} - .wym_skin_twopanels .wym_area_right { width: 150px; float: right;} - .wym_skin_twopanels .wym_area_bottom { height: 1%; clear: both;} - * html .wym_skin_twopanels .wym_area_main { height: 1%;} - * html .wym_skin_twopanels .wym_area_top { height: 1%;} - *+html .wym_skin_twopanels .wym_area_top { height: 1%;} - -/*SECTIONS SYSTEM*/ - - /*common defaults for all sections*/ - .wym_skin_twopanels .wym_section { margin-bottom: 5px; } - .wym_skin_twopanels .wym_section h2, - .wym_skin_twopanels .wym_section h3 { padding: 1px 3px; margin: 0; } - .wym_skin_twopanels .wym_section a { padding: 0 3px; display: block; text-decoration: none; color: black; } - .wym_skin_twopanels .wym_section a:hover { background-color: yellow; } - /*hide section titles by default*/ - .wym_skin_twopanels .wym_section h2 { display: none; } - /*disable any margin-collapse*/ - .wym_skin_twopanels .wym_section { padding-top: 1px; padding-bottom: 1px; } - /*auto-clear sections*/ - .wym_skin_twopanels .wym_section ul:after { content: "."; display: block; height: 0; clear: both; visibility: hidden; } - * html .wym_skin_twopanels .wym_section ul { height: 1%;} - - /*option: add this class to a section to make it render as a panel*/ - .wym_skin_twopanels .wym_panel { } - .wym_skin_twopanels .wym_panel h2 { display: block; } - - /*option: add this class to a section to make it render as a dropdown menu*/ - .wym_skin_twopanels .wym_dropdown h2 { display: block; } - .wym_skin_twopanels .wym_dropdown ul { display: none; position: absolute; background: white; } - .wym_skin_twopanels .wym_dropdown:hover ul, - .wym_skin_twopanels .wym_dropdown.hover ul { display: block; } - - /*option: add this class to a section to make its elements render buttons (icons are only available for the wym_tools section for now)*/ - .wym_skin_twopanels .wym_buttons li { float:left;} - .wym_skin_twopanels .wym_buttons a { width: 20px; height: 20px; overflow: hidden; padding: 2px } - /*image replacements*/ - .wym_skin_twopanels .wym_buttons li a { background: url(icons.png) no-repeat; text-indent: -9999px;} - .wym_skin_twopanels .wym_buttons li.wym_tools_strong a { background-position: 0 -382px;} - .wym_skin_twopanels .wym_buttons li.wym_tools_emphasis a { background-position: 0 -22px;} - .wym_skin_twopanels .wym_buttons li.wym_tools_superscript a { background-position: 0 -430px;} - .wym_skin_twopanels .wym_buttons li.wym_tools_subscript a { background-position: 0 -454px;} - .wym_skin_twopanels .wym_buttons li.wym_tools_ordered_list a { background-position: 0 -48px;} - .wym_skin_twopanels .wym_buttons li.wym_tools_unordered_list a{ background-position: 0 -72px;} - .wym_skin_twopanels .wym_buttons li.wym_tools_indent a { background-position: 0 -574px;} - .wym_skin_twopanels .wym_buttons li.wym_tools_outdent a { background-position: 0 -598px;} - .wym_skin_twopanels .wym_buttons li.wym_tools_undo a { background-position: 0 -502px;} - .wym_skin_twopanels .wym_buttons li.wym_tools_redo a { background-position: 0 -526px;} - .wym_skin_twopanels .wym_buttons li.wym_tools_link a { background-position: 0 -96px;} - .wym_skin_twopanels .wym_buttons li.wym_tools_unlink a { background-position: 0 -168px;} - .wym_skin_twopanels .wym_buttons li.wym_tools_image a { background-position: 0 -121px;} - .wym_skin_twopanels .wym_buttons li.wym_tools_table a { background-position: 0 -144px;} - .wym_skin_twopanels .wym_buttons li.wym_tools_paste a { background-position: 0 -552px;} - .wym_skin_twopanels .wym_buttons li.wym_tools_html a { background-position: 0 -193px;} - .wym_skin_twopanels .wym_buttons li.wym_tools_preview a { background-position: 0 -408px;} - -/*DECORATION*/ - .wym_skin_twopanels .wym_section h2 { background: #ddd; border: solid gray; border-width: 0 0 1px;} - .wym_skin_twopanels .wym_section h2 span { color: gray;} - .wym_skin_twopanels .wym_panel { padding: 0; border: solid gray; border-width: 1px; background: white;} - .wym_skin_twopanels .wym_panel ul { margin: 2px 0 5px; } - .wym_skin_twopanels .wym_dropdown { padding: 0; border: solid gray; border-width: 1px 1px 0 1px; } - .wym_skin_twopanels .wym_dropdown ul { border: solid gray; border-width: 0 1px 1px 1px; margin-left: -1px; padding: 5px 10px 5px 3px;} - -/*DIALOGS*/ - .wym_dialog div.row { margin-bottom: 5px;} - .wym_dialog div.row input { margin-right: 5px;} - .wym_dialog div.row label { float: left; width: 150px; display: block; text-align: right; margin-right: 10px; } - .wym_dialog div.row-indent { padding-left: 160px; } - /*autoclearing*/ - .wym_dialog div.row:after { content: "."; display: block; height: 0; clear: both; visibility: hidden; } - .wym_dialog div.row { display: inline-block; } - /* Hides from IE-mac \*/ - * html .wym_dialog div.row { height: 1%; } - .wym_dialog div.row { display: block; } - /* End hide from IE-mac */ - -/*WYMEDITOR_LINK*/ - a.wym_wymeditor_link { text-indent: -9999px; float: right; display: block; width: 50px; height: 15px; background: url(../wymeditor_icon.png); overflow: hidden; text-decoration: none; } diff --git a/vendor/assets/javascripts/wymeditor/skins/twopanels/skin.js b/vendor/assets/javascripts/wymeditor/skins/twopanels/skin.js deleted file mode 100644 index 79ccdf9..0000000 --- a/vendor/assets/javascripts/wymeditor/skins/twopanels/skin.js +++ /dev/null @@ -1,39 +0,0 @@ -WYMeditor.SKINS.twopanels = { - - init: function(wym) { - - //move the containers panel to the left area - jQuery(wym._box).find(wym._options.containersSelector) - .appendTo("div.wym_area_left"); - - //render following sections as panels - jQuery(wym._box).find(wym._options.classesSelector + ', ' + - wym._options.containersSelector) - .addClass("wym_panel"); - - //render following sections as buttons - jQuery(wym._box).find(wym._options.toolsSelector) - .addClass("wym_buttons"); - - // auto add some margin to the main area sides if left area - // or right area are not empty (if they contain sections) - jQuery(wym._box).find("div.wym_area_right ul") - .parents("div.wym_area_right").show() - .parents(wym._options.boxSelector) - .find("div.wym_area_main") - .css({"margin-right": "155px"}); - - jQuery(wym._box).find("div.wym_area_left ul") - .parents("div.wym_area_left").show() - .parents(wym._options.boxSelector) - .find("div.wym_area_main") - .css({"margin-left": "115px"}); - - //make hover work under IE < 7 - jQuery(wym._box).find(".wym_section").hover(function(){ - jQuery(this).addClass("hover"); - },function(){ - jQuery(this).removeClass("hover"); - }); - } -}; diff --git a/vendor/assets/javascripts/wymeditor/skins/wymeditor_icon.png b/vendor/assets/javascripts/wymeditor/skins/wymeditor_icon.png deleted file mode 100644 index d4fc155..0000000 Binary files a/vendor/assets/javascripts/wymeditor/skins/wymeditor_icon.png and /dev/null differ