From e0a7e0fec760ba12c8067a37e10c96f1f05876e2 Mon Sep 17 00:00:00 2001
From: erdgeist
Date: Wed, 24 Jun 2026 04:13:16 +0200
Subject: Stage 1 complete: Rails 2.3.5 to Rails 3.2.22.5 upgrade
- Converted plugins to gems (Gemfile)
- Updated config structure (application.rb, boot.rb, environment.rb)
- Converted routes to Rails 3 DSL
- Converted named_scope to scope throughout models
- Converted find(:all, :conditions) to where() chains
- Fixed has_many :order to use ordering scope
- Updated session store and secret token configuration
- Fixed exception_notification middleware configuration
- Patched Ruby 2.4 / Rails 3.2 incompatibilities:
- Integer/Float duration arithmetic (ActiveSupport)
- Arel visit_Integer for PostgreSQL adapter
- create_database String/Integer coercion
- ActionController consider_all_requests_local
- Migrated taggings schema for acts-as-taggable-on
- Replaced dynamic_form gem with custom form_error_messages helper
- Fixed Rails 3 block helper syntax (form_for, form_tag, fields_for)
- Fixed admin layout yield
- Updated test suite for Rails 3 APIs
---
.../initializers/activesupport_duration_patch.rb | 53 ++++++++++++++++++++++
config/initializers/arel_patch.rb | 12 +++++
config/initializers/exception_notifier.rb | 6 +++
config/initializers/postgresql_adapter_patch.rb | 30 ++++++++++++
config/initializers/ruby2.rb | 16 +++++++
config/initializers/session_store.rb | 16 +------
6 files changed, 118 insertions(+), 15 deletions(-)
create mode 100644 config/initializers/activesupport_duration_patch.rb
create mode 100644 config/initializers/arel_patch.rb
create mode 100644 config/initializers/exception_notifier.rb
create mode 100644 config/initializers/postgresql_adapter_patch.rb
create mode 100644 config/initializers/ruby2.rb
(limited to 'config/initializers')
diff --git a/config/initializers/activesupport_duration_patch.rb b/config/initializers/activesupport_duration_patch.rb
new file mode 100644
index 0000000..c2b431d
--- /dev/null
+++ b/config/initializers/activesupport_duration_patch.rb
@@ -0,0 +1,53 @@
+class Integer
+ def days
+ ActiveSupport::Duration.new(self * 86400, [[:days, self]])
+ end
+ alias :day :days
+
+ def weeks
+ ActiveSupport::Duration.new(self * 7 * 86400, [[:days, self * 7]])
+ end
+ alias :week :weeks
+
+ def hours
+ ActiveSupport::Duration.new(self * 3600, [[:seconds, self * 3600]])
+ end
+ alias :hour :hours
+
+ def minutes
+ ActiveSupport::Duration.new(self * 60, [[:seconds, self * 60]])
+ end
+ alias :minute :minutes
+
+ def seconds
+ ActiveSupport::Duration.new(self, [[:seconds, self]])
+ end
+ alias :second :seconds
+
+ def months
+ ActiveSupport::Duration.new(self * 30 * 86400, [[:months, self]])
+ end
+ alias :month :months
+
+ def years
+ ActiveSupport::Duration.new((self * 365.25 * 86400).to_i, [[:years, self]])
+ end
+ alias :year :years
+end
+
+class Float
+ def days
+ ActiveSupport::Duration.new((self * 86400).to_i, [[:days, self]])
+ end
+ alias :day :days
+
+ def hours
+ ActiveSupport::Duration.new((self * 3600).to_i, [[:seconds, (self * 3600).to_i]])
+ end
+ alias :hour :hours
+
+ def minutes
+ ActiveSupport::Duration.new((self * 60).to_i, [[:seconds, (self * 60).to_i]])
+ end
+ alias :minute :minutes
+end
diff --git a/config/initializers/arel_patch.rb b/config/initializers/arel_patch.rb
new file mode 100644
index 0000000..753a72b
--- /dev/null
+++ b/config/initializers/arel_patch.rb
@@ -0,0 +1,12 @@
+require 'arel'
+module Arel
+ module Visitors
+ [ToSql, DepthFirst].each do |visitor|
+ visitor.class_eval do
+ def visit_Integer(o, collector = nil)
+ collector ? collector << o.to_s : o.to_s
+ end
+ end
+ end
+ end
+end
diff --git a/config/initializers/exception_notifier.rb b/config/initializers/exception_notifier.rb
new file mode 100644
index 0000000..bc7c385
--- /dev/null
+++ b/config/initializers/exception_notifier.rb
@@ -0,0 +1,6 @@
+Cccms::Application.config.middleware.use ExceptionNotification::Rack,
+ :email => {
+ :email_prefix => "[CCCMS] ",
+ :sender_address => %("CCCMS Error" ),
+ :exception_recipients => %w(erdgeist@ccc.de)
+ }
diff --git a/config/initializers/postgresql_adapter_patch.rb b/config/initializers/postgresql_adapter_patch.rb
new file mode 100644
index 0000000..57df6a2
--- /dev/null
+++ b/config/initializers/postgresql_adapter_patch.rb
@@ -0,0 +1,30 @@
+require 'active_record/connection_adapters/postgresql_adapter'
+
+module ActiveRecord
+ module ConnectionAdapters
+ class PostgreSQLAdapter
+ def create_database(name, options = {})
+ options = options.reverse_merge(:encoding => "utf8")
+
+ option_string = options.symbolize_keys.inject("") do |memo, (key, value)|
+ memo + case key
+ when :owner
+ " OWNER = \"#{value}\""
+ when :template
+ " TEMPLATE = \"#{value}\""
+ when :encoding
+ " ENCODING = '#{value}'"
+ when :tablespace
+ " TABLESPACE = \"#{value}\""
+ when :connection_limit
+ " CONNECTION LIMIT = #{value}"
+ else
+ ""
+ end
+ end
+
+ execute "CREATE DATABASE #{quote_table_name(name)}#{option_string}"
+ end
+ end
+ end
+end
diff --git a/config/initializers/ruby2.rb b/config/initializers/ruby2.rb
new file mode 100644
index 0000000..d2d62aa
--- /dev/null
+++ b/config/initializers/ruby2.rb
@@ -0,0 +1,16 @@
+if Rails::VERSION::MAJOR == 2 && RUBY_VERSION >= '2.0.0'
+ module ActiveRecord
+ module Associations
+ class AssociationProxy
+ def send(method, *args)
+ if proxy_respond_to?(method, true)
+ super
+ else
+ load_target
+ @target.send(method, *args)
+ end
+ end
+ end
+ end
+ end
+end
diff --git a/config/initializers/session_store.rb b/config/initializers/session_store.rb
index b3e1098..507dc3c 100644
--- a/config/initializers/session_store.rb
+++ b/config/initializers/session_store.rb
@@ -1,15 +1 @@
-# Be sure to restart your server when you modify this file.
-
-# Your secret key for verifying cookie session data integrity.
-# If you change this key, all old sessions 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.
-ActionController::Base.session = {
- :key => '_cccms_session',
- :secret => 'b50f62033369e6039f2ece511f83f10f70301024709e189ab28d42379a26b7bfd0739fb83d89b6b76dba350569e5b9d83ee4abedbd9da468deea963512e4102b'
-}
-
-# 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 "rake db:sessions:create")
-# ActionController::Base.session_store = :active_record_store
+Cccms::Application.config.session_store :cookie_store, :key => '_cccms_session'
--
cgit v1.3
From 7f26a8202556db3a584f1360950a671d2a60a1ea Mon Sep 17 00:00:00 2001
From: erdgeist
Date: Thu, 25 Jun 2026 17:49:34 +0200
Subject: Upgrade to Rails 5.2.8.1 on Ruby 2.5.8
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
- Bump rails 4.2.11.3 → 5.2.8.1, ruby 2.4.10 → 2.5.8
- Upgrade acts-as-taggable-on ~> 3.5 → ~> 6.0
- Upgrade exception_notification ~> 4.4 → ~> 4.5
- Upgrade globalize ~> 5.0 → ~> 5.2.0
- Upgrade pg ~> 0.17 → ~> 1.0
- Upgrade sass-rails ~> 4.0 → ~> 5.0
- Upgrade libxml-ruby to ~> 3.2 (5.x requires Ruby 3.2+)
- Pin awesome_nested_set ~> 3.4.0 (3.9 has lft/rgt update bug)
- Add rails-controller-testing gem
- Add assets initializer for jquery precompile
- Add acts_as_taggable missing indexes migration
- Set eager_load, serve_static_files, active_record settings
---
.bundle/config | 2 +
.ruby-gemset | 2 +-
.ruby-version | 2 +-
Gemfile | 17 +-
Gemfile.lock | 246 ++++++++++++---------
config/environments/test.rb | 3 +-
config/initializers/assets.rb | 1 +
...dexes_on_taggings.acts_as_taggable_on_engine.rb | 23 ++
8 files changed, 185 insertions(+), 111 deletions(-)
create mode 100644 .bundle/config
create mode 100644 config/initializers/assets.rb
create mode 100644 db/migrate/20260625031409_add_missing_indexes_on_taggings.acts_as_taggable_on_engine.rb
(limited to 'config/initializers')
diff --git a/.bundle/config b/.bundle/config
new file mode 100644
index 0000000..71be015
--- /dev/null
+++ b/.bundle/config
@@ -0,0 +1,2 @@
+---
+BUNDLE_BUNDLER_VERSION: "2.3.27"
diff --git a/.ruby-gemset b/.ruby-gemset
index c100f88..48fed33 100644
--- a/.ruby-gemset
+++ b/.ruby-gemset
@@ -1 +1 @@
-rails3-upgrade
+rails5-upgrade
diff --git a/.ruby-version b/.ruby-version
index 5304f06..56b1397 100644
--- a/.ruby-version
+++ b/.ruby-version
@@ -1 +1 @@
-ruby-2.4.10
+ruby-2.5.8
diff --git a/Gemfile b/Gemfile
index f00395b..b43b986 100644
--- a/Gemfile
+++ b/Gemfile
@@ -1,18 +1,18 @@
source 'https://rubygems.org'
-gem 'rails', '4.2.11.3'
+gem 'rails', '5.2.8.1'
-gem 'pg', '~> 0.17.0'
+gem 'pg', '~> 1.0'
-gem 'acts-as-taggable-on', '~> 3.5'
-gem 'awesome_nested_set', '~> 3.1'
+gem 'acts-as-taggable-on', '~> 6.0'
+gem 'awesome_nested_set', '~> 3.4.0'
gem 'acts_as_list'
-gem 'globalize', '~> 5.0'
+gem 'globalize', '~> 5.2.0'
gem 'routing-filter', '~> 0.6'
gem 'paperclip', '~> 3.5'
gem 'will_paginate', '~> 3.0'
-gem 'exception_notification'
-gem 'libxml-ruby', :require => 'xml'
+gem 'exception_notification', '~> 4.5'
+gem 'libxml-ruby', '~> 3.2', :require => 'xml'
gem 'nokogiri', '~> 1.10.10'
gem 'loofah', '~> 2.20.0'
@@ -22,13 +22,14 @@ gem 'jquery-rails'
gem 'unicorn', '~> 1.1'
group :assets do
- gem 'sass-rails', '~> 4.0'
+ gem 'sass-rails', '~> 5.0'
gem 'coffee-rails', '~> 4.0'
gem 'uglifier', '>= 1.0.3'
end
group :test do
gem 'test-unit', '~> 3.5'
+ gem 'rails-controller-testing'
end
gem 'chaos_calendar', :git => 'https://github.com/erdgeist/chaoscalendar.git',
diff --git a/Gemfile.lock b/Gemfile.lock
index 6350f67..74b71e7 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -1,6 +1,6 @@
GIT
remote: https://github.com/erdgeist/chaoscalendar.git
- revision: a1a84e0a1b05f2b64ea7fefb5fa159fccf43abce
+ revision: 0a46bdf537e691f06e8e486e035866682f77f511
branch: erdgeist-ruby1.9
specs:
chaos_calendar (0.1.3)
@@ -8,47 +8,55 @@ GIT
GEM
remote: https://rubygems.org/
specs:
- actionmailer (4.2.11.3)
- actionpack (= 4.2.11.3)
- actionview (= 4.2.11.3)
- activejob (= 4.2.11.3)
+ actioncable (5.2.8.1)
+ actionpack (= 5.2.8.1)
+ nio4r (~> 2.0)
+ websocket-driver (>= 0.6.1)
+ actionmailer (5.2.8.1)
+ actionpack (= 5.2.8.1)
+ actionview (= 5.2.8.1)
+ activejob (= 5.2.8.1)
mail (~> 2.5, >= 2.5.4)
- rails-dom-testing (~> 1.0, >= 1.0.5)
- actionpack (4.2.11.3)
- actionview (= 4.2.11.3)
- activesupport (= 4.2.11.3)
- rack (~> 1.6)
- rack-test (~> 0.6.2)
- rails-dom-testing (~> 1.0, >= 1.0.5)
+ rails-dom-testing (~> 2.0)
+ actionpack (5.2.8.1)
+ actionview (= 5.2.8.1)
+ activesupport (= 5.2.8.1)
+ rack (~> 2.0, >= 2.0.8)
+ rack-test (>= 0.6.3)
+ rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.0, >= 1.0.2)
- actionview (4.2.11.3)
- activesupport (= 4.2.11.3)
+ actionview (5.2.8.1)
+ activesupport (= 5.2.8.1)
builder (~> 3.1)
- erubis (~> 2.7.0)
- rails-dom-testing (~> 1.0, >= 1.0.5)
+ erubi (~> 1.4)
+ rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.0, >= 1.0.3)
- activejob (4.2.11.3)
- activesupport (= 4.2.11.3)
- globalid (>= 0.3.0)
- activemodel (4.2.11.3)
- activesupport (= 4.2.11.3)
- builder (~> 3.1)
- activerecord (4.2.11.3)
- activemodel (= 4.2.11.3)
- activesupport (= 4.2.11.3)
- arel (~> 6.0)
- activesupport (4.2.11.3)
- i18n (~> 0.7)
+ activejob (5.2.8.1)
+ activesupport (= 5.2.8.1)
+ globalid (>= 0.3.6)
+ activemodel (5.2.8.1)
+ activesupport (= 5.2.8.1)
+ activerecord (5.2.8.1)
+ activemodel (= 5.2.8.1)
+ activesupport (= 5.2.8.1)
+ arel (>= 9.0)
+ activestorage (5.2.8.1)
+ actionpack (= 5.2.8.1)
+ activerecord (= 5.2.8.1)
+ marcel (~> 1.0.0)
+ activesupport (5.2.8.1)
+ concurrent-ruby (~> 1.0, >= 1.0.2)
+ i18n (>= 0.7, < 2)
minitest (~> 5.1)
- thread_safe (~> 0.3, >= 0.3.4)
tzinfo (~> 1.1)
- acts-as-taggable-on (3.5.0)
- activerecord (>= 3.2, < 5)
+ acts-as-taggable-on (6.5.0)
+ activerecord (>= 5.0, < 6.1)
acts_as_list (1.1.0)
activerecord (>= 4.2)
- arel (6.0.4)
- awesome_nested_set (3.9.0)
- activerecord (>= 4.0.0, < 8.2)
+ arel (9.0.0)
+ awesome_nested_set (3.4.0)
+ activerecord (>= 4.0.0, < 7.0)
+ base64 (0.3.0)
builder (3.3.0)
climate_control (0.2.0)
cocaine (0.5.8)
@@ -62,31 +70,39 @@ GEM
coffee-script-source (1.12.2)
concurrent-ruby (1.3.7)
crass (1.0.6)
- erubis (2.7.0)
- exception_notification (4.4.3)
- actionmailer (>= 4.0, < 7)
- activesupport (>= 4.0, < 7)
- execjs (2.9.0)
- globalid (0.4.2)
- activesupport (>= 4.2.0)
- globalize (5.3.1)
- activemodel (>= 4.2, < 6.1)
- activerecord (>= 4.2, < 6.1)
+ digest (3.2.1)
+ erubi (1.13.1)
+ exception_notification (4.6.0)
+ actionmailer (>= 5.2, < 9)
+ activesupport (>= 5.2, < 9)
+ execjs (2.10.1)
+ ffi (1.17.4)
+ globalid (1.1.0)
+ activesupport (>= 5.0)
+ globalize (5.2.0)
+ activemodel (>= 4.2, < 5.3)
+ activerecord (>= 4.2, < 5.3)
request_store (~> 1.0)
- hike (1.2.3)
- i18n (0.9.5)
+ i18n (1.14.8)
concurrent-ruby (~> 1.0)
+ io-wait (0.3.1)
jquery-rails (4.6.1)
rails-dom-testing (>= 1, < 3)
railties (>= 4.2.0)
thor (>= 0.14, < 2.0)
- libxml-ruby (3.1.0)
- logger (1.5.3)
+ libxml-ruby (3.2.4)
+ logger (1.7.0)
loofah (2.20.0)
crass (~> 1.0.2)
nokogiri (>= 1.5.9)
- mail (2.7.1)
+ mail (2.9.0)
+ logger
mini_mime (>= 0.1.1)
+ net-imap
+ net-pop
+ net-smtp
+ marcel (1.0.4)
+ method_source (1.1.0)
mime-types (3.7.0)
logger
mime-types-data (~> 3.2025, >= 3.2025.0507)
@@ -94,7 +110,20 @@ GEM
mini_mime (1.1.2)
mini_portile2 (2.4.0)
minitest (5.15.0)
- multi_json (1.15.0)
+ net-imap (0.2.2)
+ digest
+ net-protocol
+ strscan
+ net-pop (0.1.2)
+ net-protocol
+ net-protocol (0.1.2)
+ io-wait
+ timeout
+ net-smtp (0.3.0)
+ digest
+ net-protocol
+ timeout
+ nio4r (2.7.3)
nokogiri (1.10.10)
mini_portile2 (~> 2.4.0)
paperclip (3.5.4)
@@ -102,94 +131,113 @@ GEM
activesupport (>= 3.0.0)
cocaine (~> 0.5.3)
mime-types
- pg (0.17.1)
+ pg (1.5.9)
power_assert (3.0.1)
- rack (1.6.13)
- rack-test (0.6.3)
- rack (>= 1.0)
- rails (4.2.11.3)
- actionmailer (= 4.2.11.3)
- actionpack (= 4.2.11.3)
- actionview (= 4.2.11.3)
- activejob (= 4.2.11.3)
- activemodel (= 4.2.11.3)
- activerecord (= 4.2.11.3)
- activesupport (= 4.2.11.3)
- bundler (>= 1.3.0, < 2.0)
- railties (= 4.2.11.3)
- sprockets-rails
- rails-deprecated_sanitizer (1.0.4)
- activesupport (>= 4.2.0.alpha)
- rails-dom-testing (1.0.9)
- activesupport (>= 4.2.0, < 5.0)
- nokogiri (~> 1.6)
- rails-deprecated_sanitizer (>= 1.0.1)
+ rack (2.2.23)
+ rack-test (2.2.0)
+ rack (>= 1.3)
+ rails (5.2.8.1)
+ actioncable (= 5.2.8.1)
+ actionmailer (= 5.2.8.1)
+ actionpack (= 5.2.8.1)
+ actionview (= 5.2.8.1)
+ activejob (= 5.2.8.1)
+ activemodel (= 5.2.8.1)
+ activerecord (= 5.2.8.1)
+ activestorage (= 5.2.8.1)
+ activesupport (= 5.2.8.1)
+ bundler (>= 1.3.0)
+ railties (= 5.2.8.1)
+ sprockets-rails (>= 2.0.0)
+ rails-controller-testing (1.0.5)
+ actionpack (>= 5.0.1.rc1)
+ actionview (>= 5.0.1.rc1)
+ activesupport (>= 5.0.1.rc1)
+ rails-dom-testing (2.3.0)
+ activesupport (>= 5.0.0)
+ minitest
+ nokogiri (>= 1.6)
rails-html-sanitizer (1.4.4)
loofah (~> 2.19, >= 2.19.1)
- railties (4.2.11.3)
- actionpack (= 4.2.11.3)
- activesupport (= 4.2.11.3)
+ railties (5.2.8.1)
+ actionpack (= 5.2.8.1)
+ activesupport (= 5.2.8.1)
+ method_source
rake (>= 0.8.7)
- thor (>= 0.18.1, < 2.0)
+ thor (>= 0.19.0, < 2.0)
rake (13.4.2)
+ rb-fsevent (0.11.2)
+ rb-inotify (0.11.1)
+ ffi (~> 1.0)
request_store (1.7.0)
rack (>= 1.4)
routing-filter (0.6.3)
actionpack (>= 4.2)
activesupport (>= 4.2)
- sass (3.2.19)
- sass-rails (4.0.5)
- railties (>= 4.0.0, < 5.0)
- sass (~> 3.2.2)
- sprockets (~> 2.8, < 3.0)
- sprockets-rails (~> 2.0)
- sprockets (2.12.5)
- hike (~> 1.2)
- multi_json (~> 1.0)
- rack (~> 1.0)
- tilt (~> 1.1, != 1.3.0)
- sprockets-rails (2.3.3)
- actionpack (>= 3.0)
- activesupport (>= 3.0)
+ sass (3.7.4)
+ sass-listen (~> 4.0.0)
+ sass-listen (4.0.0)
+ rb-fsevent (~> 0.9, >= 0.9.4)
+ rb-inotify (~> 0.9, >= 0.9.7)
+ sass-rails (5.1.0)
+ railties (>= 5.2.0)
+ sass (~> 3.1)
sprockets (>= 2.8, < 4.0)
+ sprockets-rails (>= 2.0, < 4.0)
+ tilt (>= 1.1, < 3)
+ sprockets (3.7.5)
+ base64
+ concurrent-ruby (~> 1.0)
+ rack (> 1, < 3)
+ sprockets-rails (3.4.2)
+ actionpack (>= 5.2)
+ activesupport (>= 5.2)
+ sprockets (>= 3.0.0)
+ strscan (3.1.8)
test-unit (3.7.8)
power_assert
thor (1.2.2)
thread_safe (0.3.6)
- tilt (1.4.1)
+ tilt (2.7.0)
+ timeout (0.4.0)
tzinfo (1.2.11)
thread_safe (~> 0.1)
uglifier (4.2.1)
execjs (>= 0.3.0, < 3)
unicorn (1.1.7)
rack
+ websocket-driver (0.8.2)
+ base64
+ websocket-extensions (>= 0.1.0)
+ websocket-extensions (0.1.5)
will_paginate (3.3.1)
PLATFORMS
ruby
DEPENDENCIES
- acts-as-taggable-on (~> 3.5)
+ acts-as-taggable-on (~> 6.0)
acts_as_list
- awesome_nested_set (~> 3.1)
+ awesome_nested_set (~> 3.4.0)
chaos_calendar!
coffee-rails (~> 4.0)
- exception_notification
- globalize (~> 5.0)
+ exception_notification (~> 4.5)
+ globalize (~> 5.2.0)
jquery-rails
- libxml-ruby
+ libxml-ruby (~> 3.2)
loofah (~> 2.20.0)
nokogiri (~> 1.10.10)
paperclip (~> 3.5)
- pg (~> 0.17.0)
- rails (= 4.2.11.3)
+ pg (~> 1.0)
+ rails (= 5.2.8.1)
+ rails-controller-testing
rails-html-sanitizer (~> 1.4.4)
routing-filter (~> 0.6)
- sass-rails (~> 4.0)
+ sass-rails (~> 5.0)
test-unit (~> 3.5)
uglifier (>= 1.0.3)
unicorn (~> 1.1)
will_paginate (~> 3.0)
BUNDLED WITH
- 1.17.3
+ 2.3.27
diff --git a/config/environments/test.rb b/config/environments/test.rb
index 3b2413e..858bebb 100644
--- a/config/environments/test.rb
+++ b/config/environments/test.rb
@@ -15,9 +15,8 @@ Cccms::Application.configure do
config.active_support.deprecation = :log
config.active_support.test_order = :sorted
- config.active_record.raise_in_transactional_callbacks = true
-
config.eager_load = false
config.serve_static_files = true
config.static_cache_control = "public, max-age=3600"
+ config.assets.compile = true
end
diff --git a/config/initializers/assets.rb b/config/initializers/assets.rb
new file mode 100644
index 0000000..938e89d
--- /dev/null
+++ b/config/initializers/assets.rb
@@ -0,0 +1 @@
+Rails.application.config.assets.precompile += %w( jquery.js jquery_ujs.js )
diff --git a/db/migrate/20260625031409_add_missing_indexes_on_taggings.acts_as_taggable_on_engine.rb b/db/migrate/20260625031409_add_missing_indexes_on_taggings.acts_as_taggable_on_engine.rb
new file mode 100644
index 0000000..7c39589
--- /dev/null
+++ b/db/migrate/20260625031409_add_missing_indexes_on_taggings.acts_as_taggable_on_engine.rb
@@ -0,0 +1,23 @@
+# This migration comes from acts_as_taggable_on_engine (originally 6)
+if ActiveRecord.gem_version >= Gem::Version.new('5.0')
+ class AddMissingIndexesOnTaggings < ActiveRecord::Migration[4.2]; end
+else
+ class AddMissingIndexesOnTaggings < ActiveRecord::Migration; end
+end
+AddMissingIndexesOnTaggings.class_eval do
+ def change
+ add_index ActsAsTaggableOn.taggings_table, :tag_id unless index_exists? ActsAsTaggableOn.taggings_table, :tag_id
+ add_index ActsAsTaggableOn.taggings_table, :taggable_id unless index_exists? ActsAsTaggableOn.taggings_table, :taggable_id
+ add_index ActsAsTaggableOn.taggings_table, :taggable_type unless index_exists? ActsAsTaggableOn.taggings_table, :taggable_type
+ add_index ActsAsTaggableOn.taggings_table, :tagger_id unless index_exists? ActsAsTaggableOn.taggings_table, :tagger_id
+ add_index ActsAsTaggableOn.taggings_table, :context unless index_exists? ActsAsTaggableOn.taggings_table, :context
+
+ unless index_exists? ActsAsTaggableOn.taggings_table, [:tagger_id, :tagger_type]
+ add_index ActsAsTaggableOn.taggings_table, [:tagger_id, :tagger_type]
+ end
+
+ unless index_exists? ActsAsTaggableOn.taggings_table, [:taggable_id, :taggable_type, :tagger_id, :context], name: 'taggings_idy'
+ add_index ActsAsTaggableOn.taggings_table, [:taggable_id, :taggable_type, :tagger_id, :context], name: 'taggings_idy'
+ end
+ end
+end
--
cgit v1.3
From c06723ee715512c2033c7786c48f15674585b56b Mon Sep 17 00:00:00 2001
From: erdgeist
Date: Fri, 26 Jun 2026 01:59:57 +0200
Subject: Stage 4: Rails 5.2 -> 6.1 on Ruby 2.7.2
- routing-filter 0.6.3 -> 0.7.0 (Rails 6.1 compatibility)
- RSS named routes rss_xml/rss_rdf added
- RouteWithParams workarounds: will_paginate_patch, content_path shim, safe_path helper
- Paperclip removed, replaced with FileAttachment concern (preserves URL scheme)
- Assets resource moved to /admin/assets (Sprockets middleware conflict)
- ApplicationRecord base class added, all models migrated
- Strong parameters added to Assets, Occurrences, Events, MenuItems controllers
- update_attributes -> update throughout
- render :nothing -> head :ok/:not_found throughout
- language_selector rewritten (removes :overwrite_params)
- Environment files updated for Rails 6.1 (eager_load, public_file_server, ActionMailer)
- Arel::Visitors::DepthFirst and Integer/Float duration patches removed from test_helper
- AssetsController tests added (10 tests covering upload, variants, destroy, auth)
- ImageMagick geometry: 460x250! for headline crop (not # which is invalid in IM6)
129 runs, 311 assertions, 5 failures (all pre-existing), 0 errors
---
.ruby-gemset | 2 +-
.ruby-version | 2 +-
Gemfile | 16 +-
Gemfile.lock | 230 +++++++++++++-------------
app/assets/config/manifest.js | 0
app/controllers/assets_controller.rb | 17 +-
app/controllers/content_controller.rb | 9 +-
app/controllers/events_controller.rb | 10 +-
app/controllers/menu_items_controller.rb | 15 +-
app/controllers/nodes_controller.rb | 6 +-
app/controllers/occurrences_controller.rb | 11 +-
app/controllers/pages_controller.rb | 2 +-
app/controllers/users_controller.rb | 2 +-
app/helpers/admin_helper.rb | 6 +-
app/helpers/link_helper.rb | 25 ++-
app/models/application_record.rb | 3 +
app/models/asset.rb | 17 +-
app/models/concerns/file_attachment.rb | 124 ++++++++++++++
app/models/event.rb | 2 +-
app/models/menu_item.rb | 2 +-
app/models/node.rb | 2 +-
app/models/occurrence.rb | 2 +-
app/models/page.rb | 2 +-
app/models/permission.rb | 2 +-
app/models/related_asset.rb | 2 +-
app/models/user.rb | 2 +-
app/views/content/_search.html.erb | 2 +-
app/views/content/_tags.html.erb | 2 +-
app/views/layouts/application.html.erb | 9 +-
app/views/layouts/application.html.erb.bak | 54 ------
config/environments/development.rb | 7 +-
config/environments/production.rb | 14 +-
config/environments/test.rb | 7 +-
config/initializers/arel_patch.rb | 12 --
config/initializers/will_paginate_patch.rb | 13 ++
config/routes.rb | 11 +-
lib/chaos_importer.rb | 4 +-
lib/update_importer.rb | 4 +-
test/controllers/assets_controller_test.rb | 170 +++++++++++++++++++
test/controllers/revisions_controller_test.rb | 2 +-
test/fixtures/files/test_document.pdf | Bin 0 -> 9246 bytes
test/fixtures/files/test_image.png | Bin 0 -> 49854 bytes
test/models/page_test.rb | 2 +-
test/models/user_test.rb | 4 +-
test/test_helper.rb | 67 --------
45 files changed, 557 insertions(+), 340 deletions(-)
create mode 100644 app/assets/config/manifest.js
create mode 100644 app/models/application_record.rb
create mode 100644 app/models/concerns/file_attachment.rb
delete mode 100644 app/views/layouts/application.html.erb.bak
delete mode 100644 config/initializers/arel_patch.rb
create mode 100644 config/initializers/will_paginate_patch.rb
create mode 100644 test/fixtures/files/test_document.pdf
create mode 100644 test/fixtures/files/test_image.png
(limited to 'config/initializers')
diff --git a/.ruby-gemset b/.ruby-gemset
index 48fed33..a363b74 100644
--- a/.ruby-gemset
+++ b/.ruby-gemset
@@ -1 +1 @@
-rails5-upgrade
+rails6-upgrade
diff --git a/.ruby-version b/.ruby-version
index 56b1397..2eb2fe9 100644
--- a/.ruby-version
+++ b/.ruby-version
@@ -1 +1 @@
-ruby-2.5.8
+ruby-2.7.2
diff --git a/Gemfile b/Gemfile
index b43b986..3184db4 100644
--- a/Gemfile
+++ b/Gemfile
@@ -1,28 +1,26 @@
source 'https://rubygems.org'
-gem 'rails', '5.2.8.1'
+gem 'rails', '6.1.7.10'
+gem 'concurrent-ruby', '1.3.4'
gem 'pg', '~> 1.0'
-gem 'acts-as-taggable-on', '~> 6.0'
+gem 'acts-as-taggable-on', '~> 7.0'
gem 'awesome_nested_set', '~> 3.4.0'
gem 'acts_as_list'
-gem 'globalize', '~> 5.2.0'
-gem 'routing-filter', '~> 0.6'
-gem 'paperclip', '~> 3.5'
+gem 'globalize', '~> 6.0'
+gem 'routing-filter', '~> 0.7.0'
gem 'will_paginate', '~> 3.0'
gem 'exception_notification', '~> 4.5'
gem 'libxml-ruby', '~> 3.2', :require => 'xml'
-gem 'nokogiri', '~> 1.10.10'
-gem 'loofah', '~> 2.20.0'
-gem 'rails-html-sanitizer', '~> 1.4.4'
+gem 'nokogiri', '~> 1.13'
gem 'jquery-rails'
gem 'unicorn', '~> 1.1'
group :assets do
- gem 'sass-rails', '~> 5.0'
+ gem 'sass-rails', '~> 6.0'
gem 'coffee-rails', '~> 4.0'
gem 'uglifier', '>= 1.0.3'
end
diff --git a/Gemfile.lock b/Gemfile.lock
index 74b71e7..d8294bd 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -8,59 +8,73 @@ GIT
GEM
remote: https://rubygems.org/
specs:
- actioncable (5.2.8.1)
- actionpack (= 5.2.8.1)
+ actioncable (6.1.7.10)
+ actionpack (= 6.1.7.10)
+ activesupport (= 6.1.7.10)
nio4r (~> 2.0)
websocket-driver (>= 0.6.1)
- actionmailer (5.2.8.1)
- actionpack (= 5.2.8.1)
- actionview (= 5.2.8.1)
- activejob (= 5.2.8.1)
+ actionmailbox (6.1.7.10)
+ actionpack (= 6.1.7.10)
+ activejob (= 6.1.7.10)
+ activerecord (= 6.1.7.10)
+ activestorage (= 6.1.7.10)
+ activesupport (= 6.1.7.10)
+ mail (>= 2.7.1)
+ actionmailer (6.1.7.10)
+ actionpack (= 6.1.7.10)
+ actionview (= 6.1.7.10)
+ activejob (= 6.1.7.10)
+ activesupport (= 6.1.7.10)
mail (~> 2.5, >= 2.5.4)
rails-dom-testing (~> 2.0)
- actionpack (5.2.8.1)
- actionview (= 5.2.8.1)
- activesupport (= 5.2.8.1)
- rack (~> 2.0, >= 2.0.8)
+ actionpack (6.1.7.10)
+ actionview (= 6.1.7.10)
+ activesupport (= 6.1.7.10)
+ rack (~> 2.0, >= 2.0.9)
rack-test (>= 0.6.3)
rails-dom-testing (~> 2.0)
- rails-html-sanitizer (~> 1.0, >= 1.0.2)
- actionview (5.2.8.1)
- activesupport (= 5.2.8.1)
+ rails-html-sanitizer (~> 1.0, >= 1.2.0)
+ actiontext (6.1.7.10)
+ actionpack (= 6.1.7.10)
+ activerecord (= 6.1.7.10)
+ activestorage (= 6.1.7.10)
+ activesupport (= 6.1.7.10)
+ nokogiri (>= 1.8.5)
+ actionview (6.1.7.10)
+ activesupport (= 6.1.7.10)
builder (~> 3.1)
erubi (~> 1.4)
rails-dom-testing (~> 2.0)
- rails-html-sanitizer (~> 1.0, >= 1.0.3)
- activejob (5.2.8.1)
- activesupport (= 5.2.8.1)
+ rails-html-sanitizer (~> 1.1, >= 1.2.0)
+ activejob (6.1.7.10)
+ activesupport (= 6.1.7.10)
globalid (>= 0.3.6)
- activemodel (5.2.8.1)
- activesupport (= 5.2.8.1)
- activerecord (5.2.8.1)
- activemodel (= 5.2.8.1)
- activesupport (= 5.2.8.1)
- arel (>= 9.0)
- activestorage (5.2.8.1)
- actionpack (= 5.2.8.1)
- activerecord (= 5.2.8.1)
- marcel (~> 1.0.0)
- activesupport (5.2.8.1)
+ activemodel (6.1.7.10)
+ activesupport (= 6.1.7.10)
+ activerecord (6.1.7.10)
+ activemodel (= 6.1.7.10)
+ activesupport (= 6.1.7.10)
+ activestorage (6.1.7.10)
+ actionpack (= 6.1.7.10)
+ activejob (= 6.1.7.10)
+ activerecord (= 6.1.7.10)
+ activesupport (= 6.1.7.10)
+ marcel (~> 1.0)
+ mini_mime (>= 1.1.0)
+ activesupport (6.1.7.10)
concurrent-ruby (~> 1.0, >= 1.0.2)
- i18n (>= 0.7, < 2)
- minitest (~> 5.1)
- tzinfo (~> 1.1)
- acts-as-taggable-on (6.5.0)
- activerecord (>= 5.0, < 6.1)
+ i18n (>= 1.6, < 2)
+ minitest (>= 5.1)
+ tzinfo (~> 2.0)
+ zeitwerk (~> 2.3)
+ acts-as-taggable-on (7.0.0)
+ activerecord (>= 5.0, < 6.2)
acts_as_list (1.1.0)
activerecord (>= 4.2)
- arel (9.0.0)
awesome_nested_set (3.4.0)
activerecord (>= 4.0.0, < 7.0)
base64 (0.3.0)
builder (3.3.0)
- climate_control (0.2.0)
- cocaine (0.5.8)
- climate_control (>= 0.0.3, < 1.0)
coffee-rails (4.2.2)
coffee-script (>= 2.2.0)
railties (>= 4.0.0)
@@ -68,8 +82,8 @@ GEM
coffee-script-source
execjs
coffee-script-source (1.12.2)
- concurrent-ruby (1.3.7)
- crass (1.0.6)
+ concurrent-ruby (1.3.4)
+ crass (1.0.7)
digest (3.2.1)
erubi (1.13.1)
exception_notification (4.6.0)
@@ -79,9 +93,9 @@ GEM
ffi (1.17.4)
globalid (1.1.0)
activesupport (>= 5.0)
- globalize (5.2.0)
- activemodel (>= 4.2, < 5.3)
- activerecord (>= 4.2, < 5.3)
+ globalize (6.3.0)
+ activemodel (>= 4.2, < 7.2)
+ activerecord (>= 4.2, < 7.2)
request_store (~> 1.0)
i18n (1.14.8)
concurrent-ruby (~> 1.0)
@@ -92,24 +106,20 @@ GEM
thor (>= 0.14, < 2.0)
libxml-ruby (3.2.4)
logger (1.7.0)
- loofah (2.20.0)
+ loofah (2.25.1)
crass (~> 1.0.2)
- nokogiri (>= 1.5.9)
+ nokogiri (>= 1.12.0)
mail (2.9.0)
logger
mini_mime (>= 0.1.1)
net-imap
net-pop
net-smtp
- marcel (1.0.4)
+ marcel (1.2.1)
method_source (1.1.0)
- mime-types (3.7.0)
- logger
- mime-types-data (~> 3.2025, >= 3.2025.0507)
- mime-types-data (3.2026.0414)
mini_mime (1.1.2)
- mini_portile2 (2.4.0)
- minitest (5.15.0)
+ mini_portile2 (2.8.9)
+ minitest (5.26.1)
net-imap (0.2.2)
digest
net-protocol
@@ -123,31 +133,30 @@ GEM
digest
net-protocol
timeout
- nio4r (2.7.3)
- nokogiri (1.10.10)
- mini_portile2 (~> 2.4.0)
- paperclip (3.5.4)
- activemodel (>= 3.0.0)
- activesupport (>= 3.0.0)
- cocaine (~> 0.5.3)
- mime-types
+ nio4r (2.7.5)
+ nokogiri (1.15.7)
+ mini_portile2 (~> 2.8.2)
+ racc (~> 1.4)
pg (1.5.9)
power_assert (3.0.1)
+ racc (1.8.1)
rack (2.2.23)
rack-test (2.2.0)
rack (>= 1.3)
- rails (5.2.8.1)
- actioncable (= 5.2.8.1)
- actionmailer (= 5.2.8.1)
- actionpack (= 5.2.8.1)
- actionview (= 5.2.8.1)
- activejob (= 5.2.8.1)
- activemodel (= 5.2.8.1)
- activerecord (= 5.2.8.1)
- activestorage (= 5.2.8.1)
- activesupport (= 5.2.8.1)
- bundler (>= 1.3.0)
- railties (= 5.2.8.1)
+ rails (6.1.7.10)
+ actioncable (= 6.1.7.10)
+ actionmailbox (= 6.1.7.10)
+ actionmailer (= 6.1.7.10)
+ actionpack (= 6.1.7.10)
+ actiontext (= 6.1.7.10)
+ actionview (= 6.1.7.10)
+ activejob (= 6.1.7.10)
+ activemodel (= 6.1.7.10)
+ activerecord (= 6.1.7.10)
+ activestorage (= 6.1.7.10)
+ activesupport (= 6.1.7.10)
+ bundler (>= 1.15.0)
+ railties (= 6.1.7.10)
sprockets-rails (>= 2.0.0)
rails-controller-testing (1.0.5)
actionpack (>= 5.0.1.rc1)
@@ -157,51 +166,47 @@ GEM
activesupport (>= 5.0.0)
minitest
nokogiri (>= 1.6)
- rails-html-sanitizer (1.4.4)
- loofah (~> 2.19, >= 2.19.1)
- railties (5.2.8.1)
- actionpack (= 5.2.8.1)
- activesupport (= 5.2.8.1)
+ rails-html-sanitizer (1.7.0)
+ loofah (~> 2.25)
+ nokogiri (>= 1.15.7, != 1.16.7, != 1.16.6, != 1.16.5, != 1.16.4, != 1.16.3, != 1.16.2, != 1.16.1, != 1.16.0.rc1, != 1.16.0)
+ railties (6.1.7.10)
+ actionpack (= 6.1.7.10)
+ activesupport (= 6.1.7.10)
method_source
- rake (>= 0.8.7)
- thor (>= 0.19.0, < 2.0)
+ rake (>= 12.2)
+ thor (~> 1.0)
rake (13.4.2)
- rb-fsevent (0.11.2)
- rb-inotify (0.11.1)
- ffi (~> 1.0)
request_store (1.7.0)
rack (>= 1.4)
- routing-filter (0.6.3)
- actionpack (>= 4.2)
- activesupport (>= 4.2)
- sass (3.7.4)
- sass-listen (~> 4.0.0)
- sass-listen (4.0.0)
- rb-fsevent (~> 0.9, >= 0.9.4)
- rb-inotify (~> 0.9, >= 0.9.7)
- sass-rails (5.1.0)
- railties (>= 5.2.0)
- sass (~> 3.1)
- sprockets (>= 2.8, < 4.0)
- sprockets-rails (>= 2.0, < 4.0)
- tilt (>= 1.1, < 3)
- sprockets (3.7.5)
- base64
+ routing-filter (0.7.0)
+ actionpack (>= 6.1)
+ activesupport (>= 6.1)
+ sass-rails (6.0.0)
+ sassc-rails (~> 2.1, >= 2.1.1)
+ sassc (2.4.0)
+ ffi (~> 1.9)
+ sassc-rails (2.1.2)
+ railties (>= 4.0.0)
+ sassc (>= 2.0)
+ sprockets (> 3.0)
+ sprockets-rails
+ tilt
+ sprockets (4.2.2)
concurrent-ruby (~> 1.0)
- rack (> 1, < 3)
- sprockets-rails (3.4.2)
- actionpack (>= 5.2)
- activesupport (>= 5.2)
+ logger
+ rack (>= 2.2.4, < 4)
+ sprockets-rails (3.5.2)
+ actionpack (>= 6.1)
+ activesupport (>= 6.1)
sprockets (>= 3.0.0)
strscan (3.1.8)
test-unit (3.7.8)
power_assert
thor (1.2.2)
- thread_safe (0.3.6)
tilt (2.7.0)
timeout (0.4.0)
- tzinfo (1.2.11)
- thread_safe (~> 0.1)
+ tzinfo (2.0.6)
+ concurrent-ruby (~> 1.0)
uglifier (4.2.1)
execjs (>= 0.3.0, < 3)
unicorn (1.1.7)
@@ -211,33 +216,32 @@ GEM
websocket-extensions (>= 0.1.0)
websocket-extensions (0.1.5)
will_paginate (3.3.1)
+ zeitwerk (2.6.18)
PLATFORMS
ruby
DEPENDENCIES
- acts-as-taggable-on (~> 6.0)
+ acts-as-taggable-on (~> 7.0)
acts_as_list
awesome_nested_set (~> 3.4.0)
chaos_calendar!
coffee-rails (~> 4.0)
+ concurrent-ruby (= 1.3.4)
exception_notification (~> 4.5)
- globalize (~> 5.2.0)
+ globalize (~> 6.0)
jquery-rails
libxml-ruby (~> 3.2)
- loofah (~> 2.20.0)
- nokogiri (~> 1.10.10)
- paperclip (~> 3.5)
+ nokogiri (~> 1.13)
pg (~> 1.0)
- rails (= 5.2.8.1)
+ rails (= 6.1.7.10)
rails-controller-testing
- rails-html-sanitizer (~> 1.4.4)
- routing-filter (~> 0.6)
- sass-rails (~> 5.0)
+ routing-filter (~> 0.7.0)
+ sass-rails (~> 6.0)
test-unit (~> 3.5)
uglifier (>= 1.0.3)
unicorn (~> 1.1)
will_paginate (~> 3.0)
BUNDLED WITH
- 2.3.27
+ 2.4.22
diff --git a/app/assets/config/manifest.js b/app/assets/config/manifest.js
new file mode 100644
index 0000000..e69de29
diff --git a/app/controllers/assets_controller.rb b/app/controllers/assets_controller.rb
index a11bbdd..d150e06 100644
--- a/app/controllers/assets_controller.rb
+++ b/app/controllers/assets_controller.rb
@@ -7,10 +7,9 @@ class AssetsController < ApplicationController
layout 'admin'
def index
- @assets = Asset.all.paginate(
- :page => params[:page],
- :per_page => 20,
- :order => 'id DESC'
+ @assets = Asset.order('id DESC').paginate(
+ :page => params[:page],
+ :per_page => 20
)
end
@@ -44,7 +43,7 @@ class AssetsController < ApplicationController
# POST /assets
# POST /assets.xml
def create
- @asset = Asset.new(params[:asset])
+ @asset = Asset.new(asset_params)
respond_to do |format|
if @asset.save
@@ -64,7 +63,7 @@ class AssetsController < ApplicationController
@asset = Asset.find(params[:id])
respond_to do |format|
- if @asset.update_attributes(params[:asset])
+ if @asset.update(asset_params)
flash[:notice] = 'Asset was successfully updated.'
format.html { redirect_to(@asset) }
format.xml { head :ok }
@@ -86,4 +85,10 @@ class AssetsController < ApplicationController
format.xml { head :ok }
end
end
+
+ private
+
+ def asset_params
+ params.require(:asset).permit(:name, :upload)
+ end
end
diff --git a/app/controllers/content_controller.rb b/app/controllers/content_controller.rb
index 876bccf..8d33105 100644
--- a/app/controllers/content_controller.rb
+++ b/app/controllers/content_controller.rb
@@ -15,13 +15,14 @@ class ContentController < ApplicationController
if @page and @page.public?
render(
- :file => @page.valid_template,
+ :template => @page.valid_template,
:layout => true
)
else
render(
- :file => Rails.root.join('public', '404.html'),
- :status => 404
+ :file => Rails.root.join('public', '404.html').to_s,
+ :status => 404,
+ :layout => false
)
end
@@ -32,7 +33,7 @@ class ContentController < ApplicationController
@images = @page.assets.images
render :file => "content/gallery"
else
- render :nothing => true, :status => 404
+ head :not_found
end
end
diff --git a/app/controllers/events_controller.rb b/app/controllers/events_controller.rb
index 6eba476..7695e9b 100644
--- a/app/controllers/events_controller.rb
+++ b/app/controllers/events_controller.rb
@@ -47,7 +47,7 @@ class EventsController < ApplicationController
# POST /events
# POST /events.xml
def create
- @event = Event.new(params[:event])
+ @event = Event.new(event_params)
respond_to do |format|
if @event.save
@@ -67,7 +67,7 @@ class EventsController < ApplicationController
@event = Event.find(params[:id])
respond_to do |format|
- if @event.update_attributes(params[:event])
+ if @event.update(event_params)
flash[:notice] = 'Event was successfully updated.'
format.html { redirect_to(edit_node_path(@event.node)) }
format.xml { head :ok }
@@ -89,4 +89,10 @@ class EventsController < ApplicationController
format.xml { head :ok }
end
end
+
+ private
+
+ def event_params
+ params.require(:event).permit(:start_time, :end_time, :rrule, :custom_rrule, :allday, :url, :latitude, :longitude, :node_id, :location)
+ end
end
diff --git a/app/controllers/menu_items_controller.rb b/app/controllers/menu_items_controller.rb
index 4018693..1b1eb59 100644
--- a/app/controllers/menu_items_controller.rb
+++ b/app/controllers/menu_items_controller.rb
@@ -14,11 +14,11 @@ class MenuItemsController < ApplicationController
end
def new
- @menu_item = MenuItem.new params[:menu_item]
+ @menu_item = MenuItem.new menu_item_params
end
def create
- if MenuItem.create( params[:menu_item] )
+ if MenuItem.create( menu_item_params )
redirect_to menu_items_path
else
render :new
@@ -32,7 +32,7 @@ class MenuItemsController < ApplicationController
def update
@menu_item = MenuItem.find( params[:id] )
- if @menu_item.update_attributes( params[:menu_item] )
+ if @menu_item.update( menu_item_params )
redirect_to menu_items_path
else
render :edit
@@ -48,10 +48,15 @@ class MenuItemsController < ApplicationController
def sort
params[:menu_items].each_with_index do |item_id, index|
menu_item = MenuItem.find(item_id)
- menu_item.update_attributes(:position => index + 1)
+ menu_item.update(:position => index + 1)
end
- render :nothing => true
+ head :ok
end
+ private
+
+ def menu_item_params
+ params.require(:menu_item).permit(:node_id, :path, :position, :type, :type_id)
+ end
end
diff --git a/app/controllers/nodes_controller.rb b/app/controllers/nodes_controller.rb
index 482d0ac..bd60b27 100644
--- a/app/controllers/nodes_controller.rb
+++ b/app/controllers/nodes_controller.rb
@@ -36,7 +36,7 @@ class NodesController < ApplicationController
@node.slug = params[:title].parameterize.to_s
if @node.save
- @node.draft.update_attributes(:title => params[:title])
+ @node.draft.update(:title => params[:title])
case params[:kind]
when "update"
@node.draft.tag_list.add("update")
@@ -70,10 +70,10 @@ class NodesController < ApplicationController
end
def update
- @node.update_attributes(node_params)
+ @node.update(node_params)
@draft = @node.find_or_create_draft current_user
@draft.tag_list = params[:tag_list]
- if @draft.update_attributes( page_params )
+ if @draft.update( page_params )
flash[:notice] = "Draft has been saved: #{Time.now}"
respond_to do |format|
format.html { redirect_to edit_node_path(@node) }
diff --git a/app/controllers/occurrences_controller.rb b/app/controllers/occurrences_controller.rb
index 61b42ff..0f30ce3 100644
--- a/app/controllers/occurrences_controller.rb
+++ b/app/controllers/occurrences_controller.rb
@@ -45,7 +45,7 @@ class OccurrencesController < ApplicationController
# POST /occurrences
# POST /occurrences.xml
def create
- @occurrence = Occurrence.new(params[:occurrence])
+ @occurrence = Occurrence.new(occurrence_params)
respond_to do |format|
if @occurrence.save
@@ -65,7 +65,7 @@ class OccurrencesController < ApplicationController
@occurrence = Occurrence.find(params[:id])
respond_to do |format|
- if @occurrence.update_attributes(params[:occurrence])
+ if @occurrence.update(occurrence_params)
flash[:notice] = 'Occurrence was successfully updated.'
format.html { redirect_to(@occurrence) }
format.xml { head :ok }
@@ -87,4 +87,11 @@ class OccurrencesController < ApplicationController
format.xml { head :ok }
end
end
+
+ private
+
+ def occurrence_params
+ params.require(:occurrence).permit(:start_time, :end_time, :node_id, :event_id)
+ end
+
end
diff --git a/app/controllers/pages_controller.rb b/app/controllers/pages_controller.rb
index f5609eb..a40bf10 100644
--- a/app/controllers/pages_controller.rb
+++ b/app/controllers/pages_controller.rb
@@ -22,6 +22,6 @@ class PagesController < ApplicationController
page = Page.find(params[:id])
page.update_assets(params[:images])
- render :nothing => true, :status => 200
+ head :ok
end
end
diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb
index 72e6058..98fd534 100644
--- a/app/controllers/users_controller.rb
+++ b/app/controllers/users_controller.rb
@@ -36,7 +36,7 @@ class UsersController < ApplicationController
permitted = user_params
permitted.delete(:admin) unless current_user.is_admin?
- if @user.update_attributes(permitted)
+ if @user.update(permitted)
flash[:notice] = "Updated user #{@user.login}"
redirect_to user_path(@user)
else
diff --git a/app/helpers/admin_helper.rb b/app/helpers/admin_helper.rb
index 389f6dc..e5c3d5c 100644
--- a/app/helpers/admin_helper.rb
+++ b/app/helpers/admin_helper.rb
@@ -1,11 +1,11 @@
module AdminHelper
-
+
def language_selector
case I18n.locale
when :de
- link_to raw('English'), url_for(:overwrite_params => {:locale => :en})
+ link_to raw('English'), url_for(params.permit!.to_h.merge('locale' => 'en'))
when :en
- link_to raw('Deutsch'), url_for(:overwrite_params => {:locale => :de})
+ link_to raw('Deutsch'), url_for(params.permit!.to_h.merge('locale' => 'de'))
end
end
end
diff --git a/app/helpers/link_helper.rb b/app/helpers/link_helper.rb
index 85d8fbe..39ec495 100644
--- a/app/helpers/link_helper.rb
+++ b/app/helpers/link_helper.rb
@@ -45,9 +45,28 @@ module LinkHelper
"Locked by #{@node.lock_owner.login}\n" +
"Last modified #{@page.updated_at.to_s(:db)}"
- link_to(
- 'Unlock', unlock_node_path(@node), :method => :put, :data => { :confirm => message }
+ link_to 'Unlock', safe_path(:unlock_node_path, @node), :method => :put, :data => { :confirm => message }
+ end
+
+ # Rails 6.1 workaround: content_path named helper returns RouteWithParams
+ # when called from within a catch-all glob route request context.
+ # Rails 6.1 workaround: named route helpers return RouteWithParams when called
+ # from within a catch-all glob route request context.
+ # Remove this method when upgrading to Rails 7.0+, where this is fixed.
+ def safe_path(name, *args)
+ Rails.application.routes.url_helpers.send(name, *args)
+ end
+
+ def content_path(page_path = nil, options = {})
+ if page_path.is_a?(Hash)
+ options = page_path
+ page_path = options.delete(:page_path)
+ end
+ options[:locale] ||= params[:locale] || I18n.locale
+ Rails.application.routes.url_helpers.content_path(
+ Array(page_path).join("/").sub(/^\//, ""),
+ options
)
end
-
+
end
diff --git a/app/models/application_record.rb b/app/models/application_record.rb
new file mode 100644
index 0000000..10a4cba
--- /dev/null
+++ b/app/models/application_record.rb
@@ -0,0 +1,3 @@
+class ApplicationRecord < ActiveRecord::Base
+ self.abstract_class = true
+end
diff --git a/app/models/asset.rb b/app/models/asset.rb
index f6526f2..aca0ee8 100644
--- a/app/models/asset.rb
+++ b/app/models/asset.rb
@@ -1,20 +1,11 @@
-class Asset < ActiveRecord::Base
+class Asset < ApplicationRecord
+
+ include FileAttachment
has_many :related_assets, :dependent => :destroy
has_many :pages, :through => :related_assets
- has_attached_file(
- :upload,
- :path => ":rails_root/public/system/:attachment/:id/:style/:filename",
- :url => "/system/:attachment/:id/:style/:filename",
- :styles => {
- :medium => "300x300",
- :thumb => "100x100",
- :headline => "460x250#"
- }
- )
-
- scope :images, -> { where(:upload_content_type => ["image/gif", "image/jpeg", "image/png"]) }
+ scope :images, -> { where(:upload_content_type => ["image/gif", "image/jpeg", "image/png", "image/webp"]) }
scope :documents, -> { where(:upload_content_type => ["application/pdf", "text/plain", "text/rtf"]) }
scope :audio, -> { where(:upload_content_type => ["audio/mpeg", "audio/x-m4a", "audio/wav", "audio/x-wav"]) }
diff --git a/app/models/concerns/file_attachment.rb b/app/models/concerns/file_attachment.rb
new file mode 100644
index 0000000..b3ff0f1
--- /dev/null
+++ b/app/models/concerns/file_attachment.rb
@@ -0,0 +1,124 @@
+# FileAttachment — minimal drop-in replacement for Paperclip's has_attached_file.
+#
+# Provides the same interface used throughout this codebase:
+# asset.upload.url -> "/system/uploads/:id/original/:filename"
+# asset.upload.url(:thumb) -> "/system/uploads/:id/thumb/:filename"
+# asset.upload.content_type -> string
+# asset.upload.size -> integer (bytes)
+#
+# Files are stored at:
+# Rails.root/public/system/uploads/:id/:style/:filename
+#
+# Image variants are generated via ImageMagick (convert) on upload.
+# Non-image files get only an original, no variants.
+#
+# To replace an asset: assign a new file to asset.upload= and save.
+# The filename is fixed on first upload and preserved on replacement,
+# keeping all public URLs stable.
+#
+# Future: if more sophisticated asset management is needed (versioning,
+# S3, on-demand resizing), replace this module and keep the interface.
+
+module FileAttachment
+ extend ActiveSupport::Concern
+
+ STYLES = {
+ medium: { geometry: "300x300>", format: nil },
+ thumb: { geometry: "100x100>", format: nil },
+ headline: { geometry: "460x250!", format: nil }
+ }.freeze
+
+ IMAGE_CONTENT_TYPES = %w[image/jpeg image/gif image/png image/webp].freeze
+
+ included do
+ attr_reader :upload
+
+ after_initialize :build_upload_proxy
+ after_save :process_upload
+ before_destroy :delete_upload_files
+ end
+
+ def upload=(uploaded_file)
+ return if uploaded_file.blank?
+ @pending_upload = uploaded_file
+ # Populate the database columns immediately so validations can use them
+ self.upload_file_name = sanitize_filename(uploaded_file.original_filename)
+ self.upload_content_type = uploaded_file.content_type.to_s.split(';').first.strip
+ self.upload_file_size = uploaded_file.size
+ self.upload_updated_at = Time.current
+ build_upload_proxy
+ end
+
+ private
+
+ def build_upload_proxy
+ @upload = UploadProxy.new(self)
+ end
+
+ def process_upload
+ return unless @pending_upload
+ uploaded_file = @pending_upload
+ @pending_upload = nil
+
+ original_path = file_path(:original)
+ FileUtils.mkdir_p(File.dirname(original_path))
+ FileUtils.cp(uploaded_file.tempfile.path, original_path)
+
+ if IMAGE_CONTENT_TYPES.include?(upload_content_type)
+ generate_variants(original_path)
+ end
+ end
+
+ def generate_variants(original_path)
+ STYLES.each do |style, options|
+ dest_path = file_path(style)
+ FileUtils.mkdir_p(File.dirname(dest_path))
+ system("convert", original_path, "-resize", options[:geometry], dest_path)
+ end
+ end
+
+ def delete_upload_files
+ dir = Rails.root.join("public", "system", "uploads", id.to_s)
+ FileUtils.rm_rf(dir) if Dir.exist?(dir)
+ end
+
+ def file_path(style)
+ Rails.root.join(
+ "public", "system", "uploads",
+ id.to_s, style.to_s, upload_file_name
+ ).to_s
+ end
+
+ def sanitize_filename(filename)
+ File.basename(filename).gsub(/[^\w\.\-]/, '_')
+ end
+
+ # Proxy object returned by asset.upload, providing the Paperclip-compatible
+ # interface used in views: .url, .url(:style), .content_type, .size
+ class UploadProxy
+ def initialize(record)
+ @record = record
+ end
+
+ def url(style = :original)
+ return "" if @record.upload_file_name.blank?
+ "/system/uploads/#{@record.id}/#{style}/#{@record.upload_file_name}"
+ end
+
+ def content_type
+ @record.upload_content_type.to_s
+ end
+
+ def size
+ @record.upload_file_size.to_i
+ end
+
+ def present?
+ @record.upload_file_name.present?
+ end
+
+ def blank?
+ !present?
+ end
+ end
+end
diff --git a/app/models/event.rb b/app/models/event.rb
index 23deed6..94a22e3 100644
--- a/app/models/event.rb
+++ b/app/models/event.rb
@@ -1,4 +1,4 @@
-class Event < ActiveRecord::Base
+class Event < ApplicationRecord
# Associations
diff --git a/app/models/menu_item.rb b/app/models/menu_item.rb
index eb82347..7769b7f 100644
--- a/app/models/menu_item.rb
+++ b/app/models/menu_item.rb
@@ -1,4 +1,4 @@
-class MenuItem < ActiveRecord::Base
+class MenuItem < ApplicationRecord
default_scope -> { where(:type => "MenuItem") }
diff --git a/app/models/node.rb b/app/models/node.rb
index d760f0a..f7a70d0 100644
--- a/app/models/node.rb
+++ b/app/models/node.rb
@@ -1,4 +1,4 @@
-class Node < ActiveRecord::Base
+class Node < ApplicationRecord
# Mixins and Plugins
acts_as_nested_set
diff --git a/app/models/occurrence.rb b/app/models/occurrence.rb
index 8457ffd..3baf447 100644
--- a/app/models/occurrence.rb
+++ b/app/models/occurrence.rb
@@ -1,7 +1,7 @@
# TODO Make a gem out of the c wrapper
require 'chaos_calendar'
-class Occurrence < ActiveRecord::Base
+class Occurrence < ApplicationRecord
# Associations
diff --git a/app/models/page.rb b/app/models/page.rb
index 93debf8..d1e7439 100644
--- a/app/models/page.rb
+++ b/app/models/page.rb
@@ -1,6 +1,6 @@
require 'xml'
-class Page < ActiveRecord::Base
+class Page < ApplicationRecord
PUBLIC_TEMPLATE_PATH = File.join(%w(custom page_templates public))
FULL_PUBLIC_TEMPLATE_PATH = Rails.root.join('app', 'views', PUBLIC_TEMPLATE_PATH)
diff --git a/app/models/permission.rb b/app/models/permission.rb
index f304538..1383a4b 100644
--- a/app/models/permission.rb
+++ b/app/models/permission.rb
@@ -1,4 +1,4 @@
-class Permission < ActiveRecord::Base
+class Permission < ApplicationRecord
# Validations
validates_presence_of :user_id, :node_id, :granted
validates_inclusion_of :granted, :in => [true, false]
diff --git a/app/models/related_asset.rb b/app/models/related_asset.rb
index 2b61c51..8f16460 100644
--- a/app/models/related_asset.rb
+++ b/app/models/related_asset.rb
@@ -1,4 +1,4 @@
-class RelatedAsset < ActiveRecord::Base
+class RelatedAsset < ApplicationRecord
belongs_to :page
belongs_to :asset
diff --git a/app/models/user.rb b/app/models/user.rb
index a2540b5..92ac33a 100644
--- a/app/models/user.rb
+++ b/app/models/user.rb
@@ -1,6 +1,6 @@
require 'digest/sha1'
-class User < ActiveRecord::Base
+class User < ApplicationRecord
# Mixins and Plugins
include Authentication
include Authentication::ByPassword
diff --git a/app/views/content/_search.html.erb b/app/views/content/_search.html.erb
index aa91424..f732fca 100644
--- a/app/views/content/_search.html.erb
+++ b/app/views/content/_search.html.erb
@@ -1,3 +1,3 @@
-<%= form_tag search_path, :method => 'get' do %>
+<%= form_tag safe_path(:search_path), :method => 'get' do %>
<%= text_field_tag :search_term, params[:search_term], :placeholder => 'suchen', :type => 'search' %>
<% end %>
diff --git a/app/views/content/_tags.html.erb b/app/views/content/_tags.html.erb
index 169ae84..387f51c 100644
--- a/app/views/content/_tags.html.erb
+++ b/app/views/content/_tags.html.erb
@@ -3,7 +3,7 @@
Tags
<% @page.tags.each do |tag| %>
- - <%= link_to tag.name, tag_path(:id => tag.name) %>
+ - <%= link_to tag.name, safe_path(:tag_path, tag.name) %>
<% end %>
diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb
index 2a46f09..84dcdc6 100644
--- a/app/views/layouts/application.html.erb
+++ b/app/views/layouts/application.html.erb
@@ -16,8 +16,8 @@
<%= stylesheet_link_tag "shadowbox" %>
<%= javascript_include_tag 'public' %>
- <%= auto_discovery_link_tag(:atom, {:locale => :de, :controller => "rss", :action => "updates", :format => :xml}) %>
- <%= auto_discovery_link_tag(:rss, {:locale => :de, :controller => "rss", :action => "updates", :format => :rdf}) %>
+ <%= auto_discovery_link_tag(:atom, '/rss/updates.xml', title: "ATOM") %>
+ <%= auto_discovery_link_tag(:rss, '/rss/updates.rdf', title: "RSS") %>
+
diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb
index c5cbf14..48e0a5b 100644
--- a/app/views/layouts/application.html.erb
+++ b/app/views/layouts/application.html.erb
@@ -10,11 +10,11 @@
<%= page_title %>
- <%= stylesheet_link_tag "ccc" %>
- <%= javascript_include_tag 'jquery-1.3.2.min' %>
- <%= javascript_include_tag 'shadowbox/shadowbox' %>
- <%= stylesheet_link_tag "shadowbox" %>
- <%= javascript_include_tag 'public' %>
+
+
+
+
+
<%= auto_discovery_link_tag(:atom, '/rss/updates.xml', title: "ATOM") %>
<%= auto_discovery_link_tag(:rss, '/rss/updates.rdf', title: "RSS") %>
@@ -31,7 +31,7 @@
diff --git a/app/views/revisions/diff.html.erb b/app/views/revisions/diff.html.erb
index efda85d..b8d061d 100644
--- a/app/views/revisions/diff.html.erb
+++ b/app/views/revisions/diff.html.erb
@@ -38,7 +38,7 @@
-<%= javascript_include_tag 'cacycle_diff' %>
+
-
-
-
-
-
-
-
-
-
diff --git a/public/javascripts/tiny_mce/plugins/advimage/css/advimage.css b/public/javascripts/tiny_mce/plugins/advimage/css/advimage.css
deleted file mode 100644
index 0a6251a..0000000
--- a/public/javascripts/tiny_mce/plugins/advimage/css/advimage.css
+++ /dev/null
@@ -1,13 +0,0 @@
-#src_list, #over_list, #out_list {width:280px;}
-.mceActionPanel {margin-top:7px;}
-.alignPreview {border:1px solid #000; width:140px; height:140px; overflow:hidden; padding:5px;}
-.checkbox {border:0;}
-.panel_wrapper div.current {height:305px;}
-#prev {margin:0; border:1px solid #000; width:428px; height:150px; overflow:auto;}
-#align, #classlist {width:150px;}
-#width, #height {vertical-align:middle; width:50px; text-align:center;}
-#vspace, #hspace, #border {vertical-align:middle; width:30px; text-align:center;}
-#class_list {width:180px;}
-input {width: 280px;}
-#constrain, #onmousemovecheck {width:auto;}
-#id, #dir, #lang, #usemap, #longdesc {width:200px;}
diff --git a/public/javascripts/tiny_mce/plugins/advimage/editor_plugin.js b/public/javascripts/tiny_mce/plugins/advimage/editor_plugin.js
deleted file mode 100644
index 4c7a9c3..0000000
--- a/public/javascripts/tiny_mce/plugins/advimage/editor_plugin.js
+++ /dev/null
@@ -1 +0,0 @@
-(function(){tinymce.create("tinymce.plugins.AdvancedImagePlugin",{init:function(a,b){a.addCommand("mceAdvImage",function(){if(a.dom.getAttrib(a.selection.getNode(),"class").indexOf("mceItem")!=-1){return}a.windowManager.open({file:b+"/image.htm",width:480+parseInt(a.getLang("advimage.delta_width",0)),height:385+parseInt(a.getLang("advimage.delta_height",0)),inline:1},{plugin_url:b})});a.addButton("image",{title:"advimage.image_desc",cmd:"mceAdvImage"})},getInfo:function(){return{longname:"Advanced image",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/advimage",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("advimage",tinymce.plugins.AdvancedImagePlugin)})();
\ No newline at end of file
diff --git a/public/javascripts/tiny_mce/plugins/advimage/editor_plugin_src.js b/public/javascripts/tiny_mce/plugins/advimage/editor_plugin_src.js
deleted file mode 100644
index f526842..0000000
--- a/public/javascripts/tiny_mce/plugins/advimage/editor_plugin_src.js
+++ /dev/null
@@ -1,47 +0,0 @@
-/**
- * $Id: editor_plugin_src.js 677 2008-03-07 13:52:41Z spocke $
- *
- * @author Moxiecode
- * @copyright Copyright 2004-2008, Moxiecode Systems AB, All rights reserved.
- */
-
-(function() {
- tinymce.create('tinymce.plugins.AdvancedImagePlugin', {
- init : function(ed, url) {
- // Register commands
- ed.addCommand('mceAdvImage', function() {
- // Internal image object like a flash placeholder
- if (ed.dom.getAttrib(ed.selection.getNode(), 'class').indexOf('mceItem') != -1)
- return;
-
- ed.windowManager.open({
- file : url + '/image.htm',
- width : 480 + parseInt(ed.getLang('advimage.delta_width', 0)),
- height : 385 + parseInt(ed.getLang('advimage.delta_height', 0)),
- inline : 1
- }, {
- plugin_url : url
- });
- });
-
- // Register buttons
- ed.addButton('image', {
- title : 'advimage.image_desc',
- cmd : 'mceAdvImage'
- });
- },
-
- getInfo : function() {
- return {
- longname : 'Advanced image',
- author : 'Moxiecode Systems AB',
- authorurl : 'http://tinymce.moxiecode.com',
- infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/advimage',
- version : tinymce.majorVersion + "." + tinymce.minorVersion
- };
- }
- });
-
- // Register plugin
- tinymce.PluginManager.add('advimage', tinymce.plugins.AdvancedImagePlugin);
-})();
\ No newline at end of file
diff --git a/public/javascripts/tiny_mce/plugins/advimage/image.htm b/public/javascripts/tiny_mce/plugins/advimage/image.htm
deleted file mode 100644
index 5d26150..0000000
--- a/public/javascripts/tiny_mce/plugins/advimage/image.htm
+++ /dev/null
@@ -1,237 +0,0 @@
-
-
-
-
{#advimage_dlg.dialog_title}
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/public/javascripts/tiny_mce/plugins/advimage/img/sample.gif b/public/javascripts/tiny_mce/plugins/advimage/img/sample.gif
deleted file mode 100644
index 53bf689..0000000
Binary files a/public/javascripts/tiny_mce/plugins/advimage/img/sample.gif and /dev/null differ
diff --git a/public/javascripts/tiny_mce/plugins/advimage/js/image.js b/public/javascripts/tiny_mce/plugins/advimage/js/image.js
deleted file mode 100644
index 3477226..0000000
--- a/public/javascripts/tiny_mce/plugins/advimage/js/image.js
+++ /dev/null
@@ -1,443 +0,0 @@
-var ImageDialog = {
- preInit : function() {
- var url;
-
- tinyMCEPopup.requireLangPack();
-
- if (url = tinyMCEPopup.getParam("external_image_list_url"))
- document.write('');
- },
-
- init : function(ed) {
- var f = document.forms[0], nl = f.elements, ed = tinyMCEPopup.editor, dom = ed.dom, n = ed.selection.getNode();
-
- tinyMCEPopup.resizeToInnerSize();
- this.fillClassList('class_list');
- this.fillFileList('src_list', 'tinyMCEImageList');
- this.fillFileList('over_list', 'tinyMCEImageList');
- this.fillFileList('out_list', 'tinyMCEImageList');
- TinyMCE_EditableSelects.init();
-
- if (n.nodeName == 'IMG') {
- nl.src.value = dom.getAttrib(n, 'src');
- nl.width.value = dom.getAttrib(n, 'width');
- nl.height.value = dom.getAttrib(n, 'height');
- nl.alt.value = dom.getAttrib(n, 'alt');
- nl.title.value = dom.getAttrib(n, 'title');
- nl.vspace.value = this.getAttrib(n, 'vspace');
- nl.hspace.value = this.getAttrib(n, 'hspace');
- nl.border.value = this.getAttrib(n, 'border');
- selectByValue(f, 'align', this.getAttrib(n, 'align'));
- selectByValue(f, 'class_list', dom.getAttrib(n, 'class'), true, true);
- nl.style.value = dom.getAttrib(n, 'style');
- nl.id.value = dom.getAttrib(n, 'id');
- nl.dir.value = dom.getAttrib(n, 'dir');
- nl.lang.value = dom.getAttrib(n, 'lang');
- nl.usemap.value = dom.getAttrib(n, 'usemap');
- nl.longdesc.value = dom.getAttrib(n, 'longdesc');
- nl.insert.value = ed.getLang('update');
-
- if (/^\s*this.src\s*=\s*\'([^\']+)\';?\s*$/.test(dom.getAttrib(n, 'onmouseover')))
- nl.onmouseoversrc.value = dom.getAttrib(n, 'onmouseover').replace(/^\s*this.src\s*=\s*\'([^\']+)\';?\s*$/, '$1');
-
- if (/^\s*this.src\s*=\s*\'([^\']+)\';?\s*$/.test(dom.getAttrib(n, 'onmouseout')))
- nl.onmouseoutsrc.value = dom.getAttrib(n, 'onmouseout').replace(/^\s*this.src\s*=\s*\'([^\']+)\';?\s*$/, '$1');
-
- if (ed.settings.inline_styles) {
- // Move attribs to styles
- if (dom.getAttrib(n, 'align'))
- this.updateStyle('align');
-
- if (dom.getAttrib(n, 'hspace'))
- this.updateStyle('hspace');
-
- if (dom.getAttrib(n, 'border'))
- this.updateStyle('border');
-
- if (dom.getAttrib(n, 'vspace'))
- this.updateStyle('vspace');
- }
- }
-
- // Setup browse button
- document.getElementById('srcbrowsercontainer').innerHTML = getBrowserHTML('srcbrowser','src','image','theme_advanced_image');
- if (isVisible('srcbrowser'))
- document.getElementById('src').style.width = '260px';
-
- // Setup browse button
- document.getElementById('onmouseoversrccontainer').innerHTML = getBrowserHTML('overbrowser','onmouseoversrc','image','theme_advanced_image');
- if (isVisible('overbrowser'))
- document.getElementById('onmouseoversrc').style.width = '260px';
-
- // Setup browse button
- document.getElementById('onmouseoutsrccontainer').innerHTML = getBrowserHTML('outbrowser','onmouseoutsrc','image','theme_advanced_image');
- if (isVisible('outbrowser'))
- document.getElementById('onmouseoutsrc').style.width = '260px';
-
- // If option enabled default contrain proportions to checked
- if (ed.getParam("advimage_constrain_proportions", true))
- f.constrain.checked = true;
-
- // Check swap image if valid data
- if (nl.onmouseoversrc.value || nl.onmouseoutsrc.value)
- this.setSwapImage(true);
- else
- this.setSwapImage(false);
-
- this.changeAppearance();
- this.showPreviewImage(nl.src.value, 1);
- },
-
- insert : function(file, title) {
- var ed = tinyMCEPopup.editor, t = this, f = document.forms[0];
-
- if (f.src.value === '') {
- if (ed.selection.getNode().nodeName == 'IMG') {
- ed.dom.remove(ed.selection.getNode());
- ed.execCommand('mceRepaint');
- }
-
- tinyMCEPopup.close();
- return;
- }
-
- if (tinyMCEPopup.getParam("accessibility_warnings", 1)) {
- if (!f.alt.value) {
- tinyMCEPopup.confirm(tinyMCEPopup.getLang('advimage_dlg.missing_alt'), function(s) {
- if (s)
- t.insertAndClose();
- });
-
- return;
- }
- }
-
- t.insertAndClose();
- },
-
- insertAndClose : function() {
- var ed = tinyMCEPopup.editor, f = document.forms[0], nl = f.elements, v, args = {}, el;
-
- tinyMCEPopup.restoreSelection();
-
- // Fixes crash in Safari
- if (tinymce.isWebKit)
- ed.getWin().focus();
-
- if (!ed.settings.inline_styles) {
- args = {
- vspace : nl.vspace.value,
- hspace : nl.hspace.value,
- border : nl.border.value,
- align : getSelectValue(f, 'align')
- };
- } else {
- // Remove deprecated values
- args = {
- vspace : '',
- hspace : '',
- border : '',
- align : ''
- };
- }
-
- tinymce.extend(args, {
- src : nl.src.value,
- width : nl.width.value,
- height : nl.height.value,
- alt : nl.alt.value,
- title : nl.title.value,
- 'class' : getSelectValue(f, 'class_list'),
- style : nl.style.value,
- id : nl.id.value,
- dir : nl.dir.value,
- lang : nl.lang.value,
- usemap : nl.usemap.value,
- longdesc : nl.longdesc.value
- });
-
- args.onmouseover = args.onmouseout = '';
-
- if (f.onmousemovecheck.checked) {
- if (nl.onmouseoversrc.value)
- args.onmouseover = "this.src='" + nl.onmouseoversrc.value + "';";
-
- if (nl.onmouseoutsrc.value)
- args.onmouseout = "this.src='" + nl.onmouseoutsrc.value + "';";
- }
-
- el = ed.selection.getNode();
-
- if (el && el.nodeName == 'IMG') {
- ed.dom.setAttribs(el, args);
- } else {
- ed.execCommand('mceInsertContent', false, '
![]()
', {skip_undo : 1});
- ed.dom.setAttribs('__mce_tmp', args);
- ed.dom.setAttrib('__mce_tmp', 'id', '');
- ed.undoManager.add();
- }
-
- tinyMCEPopup.close();
- },
-
- getAttrib : function(e, at) {
- var ed = tinyMCEPopup.editor, dom = ed.dom, v, v2;
-
- if (ed.settings.inline_styles) {
- switch (at) {
- case 'align':
- if (v = dom.getStyle(e, 'float'))
- return v;
-
- if (v = dom.getStyle(e, 'vertical-align'))
- return v;
-
- break;
-
- case 'hspace':
- v = dom.getStyle(e, 'margin-left')
- v2 = dom.getStyle(e, 'margin-right');
-
- if (v && v == v2)
- return parseInt(v.replace(/[^0-9]/g, ''));
-
- break;
-
- case 'vspace':
- v = dom.getStyle(e, 'margin-top')
- v2 = dom.getStyle(e, 'margin-bottom');
- if (v && v == v2)
- return parseInt(v.replace(/[^0-9]/g, ''));
-
- break;
-
- case 'border':
- v = 0;
-
- tinymce.each(['top', 'right', 'bottom', 'left'], function(sv) {
- sv = dom.getStyle(e, 'border-' + sv + '-width');
-
- // False or not the same as prev
- if (!sv || (sv != v && v !== 0)) {
- v = 0;
- return false;
- }
-
- if (sv)
- v = sv;
- });
-
- if (v)
- return parseInt(v.replace(/[^0-9]/g, ''));
-
- break;
- }
- }
-
- if (v = dom.getAttrib(e, at))
- return v;
-
- return '';
- },
-
- setSwapImage : function(st) {
- var f = document.forms[0];
-
- f.onmousemovecheck.checked = st;
- setBrowserDisabled('overbrowser', !st);
- setBrowserDisabled('outbrowser', !st);
-
- if (f.over_list)
- f.over_list.disabled = !st;
-
- if (f.out_list)
- f.out_list.disabled = !st;
-
- f.onmouseoversrc.disabled = !st;
- f.onmouseoutsrc.disabled = !st;
- },
-
- fillClassList : function(id) {
- var dom = tinyMCEPopup.dom, lst = dom.get(id), v, cl;
-
- if (v = tinyMCEPopup.getParam('theme_advanced_styles')) {
- cl = [];
-
- tinymce.each(v.split(';'), function(v) {
- var p = v.split('=');
-
- cl.push({'title' : p[0], 'class' : p[1]});
- });
- } else
- cl = tinyMCEPopup.editor.dom.getClasses();
-
- if (cl.length > 0) {
- lst.options.length = 0;
- lst.options[lst.options.length] = new Option(tinyMCEPopup.getLang('not_set'), '');
-
- tinymce.each(cl, function(o) {
- lst.options[lst.options.length] = new Option(o.title || o['class'], o['class']);
- });
- } else
- dom.remove(dom.getParent(id, 'tr'));
- },
-
- fillFileList : function(id, l) {
- var dom = tinyMCEPopup.dom, lst = dom.get(id), v, cl;
-
- l = window[l];
- lst.options.length = 0;
-
- if (l && l.length > 0) {
- lst.options[lst.options.length] = new Option('', '');
-
- tinymce.each(l, function(o) {
- lst.options[lst.options.length] = new Option(o[0], o[1]);
- });
- } else
- dom.remove(dom.getParent(id, 'tr'));
- },
-
- resetImageData : function() {
- var f = document.forms[0];
-
- f.elements.width.value = f.elements.height.value = '';
- },
-
- updateImageData : function(img, st) {
- var f = document.forms[0];
-
- if (!st) {
- f.elements.width.value = img.width;
- f.elements.height.value = img.height;
- }
-
- this.preloadImg = img;
- },
-
- changeAppearance : function() {
- var ed = tinyMCEPopup.editor, f = document.forms[0], img = document.getElementById('alignSampleImg');
-
- if (img) {
- if (ed.getParam('inline_styles')) {
- ed.dom.setAttrib(img, 'style', f.style.value);
- } else {
- img.align = f.align.value;
- img.border = f.border.value;
- img.hspace = f.hspace.value;
- img.vspace = f.vspace.value;
- }
- }
- },
-
- changeHeight : function() {
- var f = document.forms[0], tp, t = this;
-
- if (!f.constrain.checked || !t.preloadImg) {
- return;
- }
-
- if (f.width.value == "" || f.height.value == "")
- return;
-
- tp = (parseInt(f.width.value) / parseInt(t.preloadImg.width)) * t.preloadImg.height;
- f.height.value = tp.toFixed(0);
- },
-
- changeWidth : function() {
- var f = document.forms[0], tp, t = this;
-
- if (!f.constrain.checked || !t.preloadImg) {
- return;
- }
-
- if (f.width.value == "" || f.height.value == "")
- return;
-
- tp = (parseInt(f.height.value) / parseInt(t.preloadImg.height)) * t.preloadImg.width;
- f.width.value = tp.toFixed(0);
- },
-
- updateStyle : function(ty) {
- var dom = tinyMCEPopup.dom, st, v, f = document.forms[0], img = dom.create('img', {style : dom.get('style').value});
-
- if (tinyMCEPopup.editor.settings.inline_styles) {
- // Handle align
- if (ty == 'align') {
- dom.setStyle(img, 'float', '');
- dom.setStyle(img, 'vertical-align', '');
-
- v = getSelectValue(f, 'align');
- if (v) {
- if (v == 'left' || v == 'right')
- dom.setStyle(img, 'float', v);
- else
- img.style.verticalAlign = v;
- }
- }
-
- // Handle border
- if (ty == 'border') {
- dom.setStyle(img, 'border', '');
-
- v = f.border.value;
- if (v || v == '0') {
- if (v == '0')
- img.style.border = '0';
- else
- img.style.border = v + 'px solid black';
- }
- }
-
- // Handle hspace
- if (ty == 'hspace') {
- dom.setStyle(img, 'marginLeft', '');
- dom.setStyle(img, 'marginRight', '');
-
- v = f.hspace.value;
- if (v) {
- img.style.marginLeft = v + 'px';
- img.style.marginRight = v + 'px';
- }
- }
-
- // Handle vspace
- if (ty == 'vspace') {
- dom.setStyle(img, 'marginTop', '');
- dom.setStyle(img, 'marginBottom', '');
-
- v = f.vspace.value;
- if (v) {
- img.style.marginTop = v + 'px';
- img.style.marginBottom = v + 'px';
- }
- }
-
- // Merge
- dom.get('style').value = dom.serializeStyle(dom.parseStyle(img.style.cssText));
- }
- },
-
- changeMouseMove : function() {
- },
-
- showPreviewImage : function(u, st) {
- if (!u) {
- tinyMCEPopup.dom.setHTML('prev', '');
- return;
- }
-
- if (!st && tinyMCEPopup.getParam("advimage_update_dimensions_onchange", true))
- this.resetImageData();
-
- u = tinyMCEPopup.editor.documentBaseURI.toAbsolute(u);
-
- if (!st)
- tinyMCEPopup.dom.setHTML('prev', '

');
- else
- tinyMCEPopup.dom.setHTML('prev', '

');
- }
-};
-
-ImageDialog.preInit();
-tinyMCEPopup.onInit.add(ImageDialog.init, ImageDialog);
diff --git a/public/javascripts/tiny_mce/plugins/advimage/langs/en_dlg.js b/public/javascripts/tiny_mce/plugins/advimage/langs/en_dlg.js
deleted file mode 100644
index f493d19..0000000
--- a/public/javascripts/tiny_mce/plugins/advimage/langs/en_dlg.js
+++ /dev/null
@@ -1,43 +0,0 @@
-tinyMCE.addI18n('en.advimage_dlg',{
-tab_general:"General",
-tab_appearance:"Appearance",
-tab_advanced:"Advanced",
-general:"General",
-title:"Title",
-preview:"Preview",
-constrain_proportions:"Constrain proportions",
-langdir:"Language direction",
-langcode:"Language code",
-long_desc:"Long description link",
-style:"Style",
-classes:"Classes",
-ltr:"Left to right",
-rtl:"Right to left",
-id:"Id",
-map:"Image map",
-swap_image:"Swap image",
-alt_image:"Alternative image",
-mouseover:"for mouse over",
-mouseout:"for mouse out",
-misc:"Miscellaneous",
-example_img:"Appearance preview image",
-missing_alt:"Are you sure you want to continue without including an Image Description? Without it the image may not be accessible to some users with disabilities, or to those using a text browser, or browsing the Web with images turned off.",
-dialog_title:"Insert/edit image",
-src:"Image URL",
-alt:"Image description",
-list:"Image list",
-border:"Border",
-dimensions:"Dimensions",
-vspace:"Vertical space",
-hspace:"Horizontal space",
-align:"Alignment",
-align_baseline:"Baseline",
-align_top:"Top",
-align_middle:"Middle",
-align_bottom:"Bottom",
-align_texttop:"Text top",
-align_textbottom:"Text bottom",
-align_left:"Left",
-align_right:"Right",
-image_list:"Image list"
-});
\ No newline at end of file
diff --git a/public/javascripts/tiny_mce/plugins/advlink/css/advlink.css b/public/javascripts/tiny_mce/plugins/advlink/css/advlink.css
deleted file mode 100644
index 1436431..0000000
--- a/public/javascripts/tiny_mce/plugins/advlink/css/advlink.css
+++ /dev/null
@@ -1,8 +0,0 @@
-.mceLinkList, .mceAnchorList, #targetlist {width:280px;}
-.mceActionPanel {margin-top:7px;}
-.panel_wrapper div.current {height:320px;}
-#classlist, #title, #href {width:280px;}
-#popupurl, #popupname {width:200px;}
-#popupwidth, #popupheight, #popupleft, #popuptop {width:30px;vertical-align:middle;text-align:center;}
-#id, #style, #classes, #target, #dir, #hreflang, #lang, #charset, #type, #rel, #rev, #tabindex, #accesskey {width:200px;}
-#events_panel input {width:200px;}
diff --git a/public/javascripts/tiny_mce/plugins/advlink/editor_plugin.js b/public/javascripts/tiny_mce/plugins/advlink/editor_plugin.js
deleted file mode 100644
index 983fe5a..0000000
--- a/public/javascripts/tiny_mce/plugins/advlink/editor_plugin.js
+++ /dev/null
@@ -1 +0,0 @@
-(function(){tinymce.create("tinymce.plugins.AdvancedLinkPlugin",{init:function(a,b){this.editor=a;a.addCommand("mceAdvLink",function(){var c=a.selection;if(c.isCollapsed()&&!a.dom.getParent(c.getNode(),"A")){return}a.windowManager.open({file:b+"/link.htm",width:480+parseInt(a.getLang("advlink.delta_width",0)),height:400+parseInt(a.getLang("advlink.delta_height",0)),inline:1},{plugin_url:b})});a.addButton("link",{title:"advlink.link_desc",cmd:"mceAdvLink"});a.addShortcut("ctrl+k","advlink.advlink_desc","mceAdvLink");a.onNodeChange.add(function(d,c,f,e){c.setDisabled("link",e&&f.nodeName!="A");c.setActive("link",f.nodeName=="A"&&!f.name)})},getInfo:function(){return{longname:"Advanced link",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/advlink",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("advlink",tinymce.plugins.AdvancedLinkPlugin)})();
\ No newline at end of file
diff --git a/public/javascripts/tiny_mce/plugins/advlink/editor_plugin_src.js b/public/javascripts/tiny_mce/plugins/advlink/editor_plugin_src.js
deleted file mode 100644
index fc5325a..0000000
--- a/public/javascripts/tiny_mce/plugins/advlink/editor_plugin_src.js
+++ /dev/null
@@ -1,58 +0,0 @@
-/**
- * $Id: editor_plugin_src.js 539 2008-01-14 19:08:58Z spocke $
- *
- * @author Moxiecode
- * @copyright Copyright 2004-2008, Moxiecode Systems AB, All rights reserved.
- */
-
-(function() {
- tinymce.create('tinymce.plugins.AdvancedLinkPlugin', {
- init : function(ed, url) {
- this.editor = ed;
-
- // Register commands
- ed.addCommand('mceAdvLink', function() {
- var se = ed.selection;
-
- // No selection and not in link
- if (se.isCollapsed() && !ed.dom.getParent(se.getNode(), 'A'))
- return;
-
- ed.windowManager.open({
- file : url + '/link.htm',
- width : 480 + parseInt(ed.getLang('advlink.delta_width', 0)),
- height : 400 + parseInt(ed.getLang('advlink.delta_height', 0)),
- inline : 1
- }, {
- plugin_url : url
- });
- });
-
- // Register buttons
- ed.addButton('link', {
- title : 'advlink.link_desc',
- cmd : 'mceAdvLink'
- });
-
- ed.addShortcut('ctrl+k', 'advlink.advlink_desc', 'mceAdvLink');
-
- ed.onNodeChange.add(function(ed, cm, n, co) {
- cm.setDisabled('link', co && n.nodeName != 'A');
- cm.setActive('link', n.nodeName == 'A' && !n.name);
- });
- },
-
- getInfo : function() {
- return {
- longname : 'Advanced link',
- author : 'Moxiecode Systems AB',
- authorurl : 'http://tinymce.moxiecode.com',
- infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/advlink',
- version : tinymce.majorVersion + "." + tinymce.minorVersion
- };
- }
- });
-
- // Register plugin
- tinymce.PluginManager.add('advlink', tinymce.plugins.AdvancedLinkPlugin);
-})();
\ No newline at end of file
diff --git a/public/javascripts/tiny_mce/plugins/advlink/js/advlink.js b/public/javascripts/tiny_mce/plugins/advlink/js/advlink.js
deleted file mode 100644
index bb7922a..0000000
--- a/public/javascripts/tiny_mce/plugins/advlink/js/advlink.js
+++ /dev/null
@@ -1,528 +0,0 @@
-/* Functions for the advlink plugin popup */
-
-tinyMCEPopup.requireLangPack();
-
-var templates = {
- "window.open" : "window.open('${url}','${target}','${options}')"
-};
-
-function preinit() {
- var url;
-
- if (url = tinyMCEPopup.getParam("external_link_list_url"))
- document.write('');
-}
-
-function changeClass() {
- var f = document.forms[0];
-
- f.classes.value = getSelectValue(f, 'classlist');
-}
-
-function init() {
- tinyMCEPopup.resizeToInnerSize();
-
- var formObj = document.forms[0];
- var inst = tinyMCEPopup.editor;
- var elm = inst.selection.getNode();
- var action = "insert";
- var html;
-
- document.getElementById('hrefbrowsercontainer').innerHTML = getBrowserHTML('hrefbrowser','href','file','advlink');
- document.getElementById('popupurlbrowsercontainer').innerHTML = getBrowserHTML('popupurlbrowser','popupurl','file','advlink');
- document.getElementById('linklisthrefcontainer').innerHTML = getLinkListHTML('linklisthref','href');
- document.getElementById('anchorlistcontainer').innerHTML = getAnchorListHTML('anchorlist','href');
- document.getElementById('targetlistcontainer').innerHTML = getTargetListHTML('targetlist','target');
-
- // Link list
- html = getLinkListHTML('linklisthref','href');
- if (html == "")
- document.getElementById("linklisthrefrow").style.display = 'none';
- else
- document.getElementById("linklisthrefcontainer").innerHTML = html;
-
- // Resize some elements
- if (isVisible('hrefbrowser'))
- document.getElementById('href').style.width = '260px';
-
- if (isVisible('popupurlbrowser'))
- document.getElementById('popupurl').style.width = '180px';
-
- elm = inst.dom.getParent(elm, "A");
- if (elm != null && elm.nodeName == "A")
- action = "update";
-
- formObj.insert.value = tinyMCEPopup.getLang(action, 'Insert', true);
-
- setPopupControlsDisabled(true);
-
- if (action == "update") {
- var href = inst.dom.getAttrib(elm, 'href');
- var onclick = inst.dom.getAttrib(elm, 'onclick');
-
- // Setup form data
- setFormValue('href', href);
- setFormValue('title', inst.dom.getAttrib(elm, 'title'));
- setFormValue('id', inst.dom.getAttrib(elm, 'id'));
- setFormValue('style', inst.dom.getAttrib(elm, "style"));
- setFormValue('rel', inst.dom.getAttrib(elm, 'rel'));
- setFormValue('rev', inst.dom.getAttrib(elm, 'rev'));
- setFormValue('charset', inst.dom.getAttrib(elm, 'charset'));
- setFormValue('hreflang', inst.dom.getAttrib(elm, 'hreflang'));
- setFormValue('dir', inst.dom.getAttrib(elm, 'dir'));
- setFormValue('lang', inst.dom.getAttrib(elm, 'lang'));
- setFormValue('tabindex', inst.dom.getAttrib(elm, 'tabindex', typeof(elm.tabindex) != "undefined" ? elm.tabindex : ""));
- setFormValue('accesskey', inst.dom.getAttrib(elm, 'accesskey', typeof(elm.accesskey) != "undefined" ? elm.accesskey : ""));
- setFormValue('type', inst.dom.getAttrib(elm, 'type'));
- setFormValue('onfocus', inst.dom.getAttrib(elm, 'onfocus'));
- setFormValue('onblur', inst.dom.getAttrib(elm, 'onblur'));
- setFormValue('onclick', onclick);
- setFormValue('ondblclick', inst.dom.getAttrib(elm, 'ondblclick'));
- setFormValue('onmousedown', inst.dom.getAttrib(elm, 'onmousedown'));
- setFormValue('onmouseup', inst.dom.getAttrib(elm, 'onmouseup'));
- setFormValue('onmouseover', inst.dom.getAttrib(elm, 'onmouseover'));
- setFormValue('onmousemove', inst.dom.getAttrib(elm, 'onmousemove'));
- setFormValue('onmouseout', inst.dom.getAttrib(elm, 'onmouseout'));
- setFormValue('onkeypress', inst.dom.getAttrib(elm, 'onkeypress'));
- setFormValue('onkeydown', inst.dom.getAttrib(elm, 'onkeydown'));
- setFormValue('onkeyup', inst.dom.getAttrib(elm, 'onkeyup'));
- setFormValue('target', inst.dom.getAttrib(elm, 'target'));
- setFormValue('classes', inst.dom.getAttrib(elm, 'class'));
-
- // Parse onclick data
- if (onclick != null && onclick.indexOf('window.open') != -1)
- parseWindowOpen(onclick);
- else
- parseFunction(onclick);
-
- // Select by the values
- selectByValue(formObj, 'dir', inst.dom.getAttrib(elm, 'dir'));
- selectByValue(formObj, 'rel', inst.dom.getAttrib(elm, 'rel'));
- selectByValue(formObj, 'rev', inst.dom.getAttrib(elm, 'rev'));
- selectByValue(formObj, 'linklisthref', href);
-
- if (href.charAt(0) == '#')
- selectByValue(formObj, 'anchorlist', href);
-
- addClassesToList('classlist', 'advlink_styles');
-
- selectByValue(formObj, 'classlist', inst.dom.getAttrib(elm, 'class'), true);
- selectByValue(formObj, 'targetlist', inst.dom.getAttrib(elm, 'target'), true);
- } else
- addClassesToList('classlist', 'advlink_styles');
-}
-
-function checkPrefix(n) {
- if (n.value && Validator.isEmail(n) && !/^\s*mailto:/i.test(n.value) && confirm(tinyMCEPopup.getLang('advlink_dlg.is_email')))
- n.value = 'mailto:' + n.value;
-
- if (/^\s*www\./i.test(n.value) && confirm(tinyMCEPopup.getLang('advlink_dlg.is_external')))
- n.value = 'http://' + n.value;
-}
-
-function setFormValue(name, value) {
- document.forms[0].elements[name].value = value;
-}
-
-function parseWindowOpen(onclick) {
- var formObj = document.forms[0];
-
- // Preprocess center code
- if (onclick.indexOf('return false;') != -1) {
- formObj.popupreturn.checked = true;
- onclick = onclick.replace('return false;', '');
- } else
- formObj.popupreturn.checked = false;
-
- var onClickData = parseLink(onclick);
-
- if (onClickData != null) {
- formObj.ispopup.checked = true;
- setPopupControlsDisabled(false);
-
- var onClickWindowOptions = parseOptions(onClickData['options']);
- var url = onClickData['url'];
-
- formObj.popupname.value = onClickData['target'];
- formObj.popupurl.value = url;
- formObj.popupwidth.value = getOption(onClickWindowOptions, 'width');
- formObj.popupheight.value = getOption(onClickWindowOptions, 'height');
-
- formObj.popupleft.value = getOption(onClickWindowOptions, 'left');
- formObj.popuptop.value = getOption(onClickWindowOptions, 'top');
-
- if (formObj.popupleft.value.indexOf('screen') != -1)
- formObj.popupleft.value = "c";
-
- if (formObj.popuptop.value.indexOf('screen') != -1)
- formObj.popuptop.value = "c";
-
- formObj.popuplocation.checked = getOption(onClickWindowOptions, 'location') == "yes";
- formObj.popupscrollbars.checked = getOption(onClickWindowOptions, 'scrollbars') == "yes";
- formObj.popupmenubar.checked = getOption(onClickWindowOptions, 'menubar') == "yes";
- formObj.popupresizable.checked = getOption(onClickWindowOptions, 'resizable') == "yes";
- formObj.popuptoolbar.checked = getOption(onClickWindowOptions, 'toolbar') == "yes";
- formObj.popupstatus.checked = getOption(onClickWindowOptions, 'status') == "yes";
- formObj.popupdependent.checked = getOption(onClickWindowOptions, 'dependent') == "yes";
-
- buildOnClick();
- }
-}
-
-function parseFunction(onclick) {
- var formObj = document.forms[0];
- var onClickData = parseLink(onclick);
-
- // TODO: Add stuff here
-}
-
-function getOption(opts, name) {
- return typeof(opts[name]) == "undefined" ? "" : opts[name];
-}
-
-function setPopupControlsDisabled(state) {
- var formObj = document.forms[0];
-
- formObj.popupname.disabled = state;
- formObj.popupurl.disabled = state;
- formObj.popupwidth.disabled = state;
- formObj.popupheight.disabled = state;
- formObj.popupleft.disabled = state;
- formObj.popuptop.disabled = state;
- formObj.popuplocation.disabled = state;
- formObj.popupscrollbars.disabled = state;
- formObj.popupmenubar.disabled = state;
- formObj.popupresizable.disabled = state;
- formObj.popuptoolbar.disabled = state;
- formObj.popupstatus.disabled = state;
- formObj.popupreturn.disabled = state;
- formObj.popupdependent.disabled = state;
-
- setBrowserDisabled('popupurlbrowser', state);
-}
-
-function parseLink(link) {
- link = link.replace(new RegExp(''', 'g'), "'");
-
- var fnName = link.replace(new RegExp("\\s*([A-Za-z0-9\.]*)\\s*\\(.*", "gi"), "$1");
-
- // Is function name a template function
- var template = templates[fnName];
- if (template) {
- // Build regexp
- var variableNames = template.match(new RegExp("'?\\$\\{[A-Za-z0-9\.]*\\}'?", "gi"));
- var regExp = "\\s*[A-Za-z0-9\.]*\\s*\\(";
- var replaceStr = "";
- for (var i=0; i
";
- } else
- regExp += ".*";
- }
-
- regExp += "\\);?";
-
- // Build variable array
- var variables = [];
- variables["_function"] = fnName;
- var variableValues = link.replace(new RegExp(regExp, "gi"), replaceStr).split('');
- for (var i=0; i';
- html += '';
-
- for (i=0; i' + name + '';
- }
-
- html += '';
-
- return html;
-}
-
-function insertAction() {
- var inst = tinyMCEPopup.editor;
- var elm, elementArray, i;
-
- elm = inst.selection.getNode();
- checkPrefix(document.forms[0].href);
-
- elm = inst.dom.getParent(elm, "A");
-
- // Remove element if there is no href
- if (!document.forms[0].href.value) {
- tinyMCEPopup.execCommand("mceBeginUndoLevel");
- i = inst.selection.getBookmark();
- inst.dom.remove(elm, 1);
- inst.selection.moveToBookmark(i);
- tinyMCEPopup.execCommand("mceEndUndoLevel");
- tinyMCEPopup.close();
- return;
- }
-
- tinyMCEPopup.execCommand("mceBeginUndoLevel");
-
- // Create new anchor elements
- if (elm == null) {
- inst.getDoc().execCommand("unlink", false, null);
- tinyMCEPopup.execCommand("CreateLink", false, "#mce_temp_url#", {skip_undo : 1});
-
- elementArray = tinymce.grep(inst.dom.select("a"), function(n) {return inst.dom.getAttrib(n, 'href') == '#mce_temp_url#';});
- for (i=0; i';
-
- for (var i=0; i' + tinyMCELinkList[i][0] + '';
-
- html += '';
-
- return html;
-
- // tinyMCE.debug('-- image list start --', html, '-- image list end --');
-}
-
-function getTargetListHTML(elm_id, target_form_element) {
- var targets = tinyMCEPopup.getParam('theme_advanced_link_targets', '').split(';');
- var html = '';
-
- html += '';
-
- return html;
-}
-
-// While loading
-preinit();
-tinyMCEPopup.onInit.add(init);
diff --git a/public/javascripts/tiny_mce/plugins/advlink/langs/en_dlg.js b/public/javascripts/tiny_mce/plugins/advlink/langs/en_dlg.js
deleted file mode 100644
index c71ffbd..0000000
--- a/public/javascripts/tiny_mce/plugins/advlink/langs/en_dlg.js
+++ /dev/null
@@ -1,52 +0,0 @@
-tinyMCE.addI18n('en.advlink_dlg',{
-title:"Insert/edit link",
-url:"Link URL",
-target:"Target",
-titlefield:"Title",
-is_email:"The URL you entered seems to be an email address, do you want to add the required mailto: prefix?",
-is_external:"The URL you entered seems to external link, do you want to add the required http:// prefix?",
-list:"Link list",
-general_tab:"General",
-popup_tab:"Popup",
-events_tab:"Events",
-advanced_tab:"Advanced",
-general_props:"General properties",
-popup_props:"Popup properties",
-event_props:"Events",
-advanced_props:"Advanced properties",
-popup_opts:"Options",
-anchor_names:"Anchors",
-target_same:"Open in this window / frame",
-target_parent:"Open in parent window / frame",
-target_top:"Open in top frame (replaces all frames)",
-target_blank:"Open in new window",
-popup:"Javascript popup",
-popup_url:"Popup URL",
-popup_name:"Window name",
-popup_return:"Insert 'return false'",
-popup_scrollbars:"Show scrollbars",
-popup_statusbar:"Show status bar",
-popup_toolbar:"Show toolbars",
-popup_menubar:"Show menu bar",
-popup_location:"Show location bar",
-popup_resizable:"Make window resizable",
-popup_dependent:"Dependent (Mozilla/Firefox only)",
-popup_size:"Size",
-popup_position:"Position (X/Y)",
-id:"Id",
-style:"Style",
-classes:"Classes",
-target_name:"Target name",
-langdir:"Language direction",
-target_langcode:"Target language",
-langcode:"Language code",
-encoding:"Target character encoding",
-mime:"Target MIME type",
-rel:"Relationship page to target",
-rev:"Relationship target to page",
-tabindex:"Tabindex",
-accesskey:"Accesskey",
-ltr:"Left to right",
-rtl:"Right to left",
-link_list:"Link list"
-});
\ No newline at end of file
diff --git a/public/javascripts/tiny_mce/plugins/advlink/link.htm b/public/javascripts/tiny_mce/plugins/advlink/link.htm
deleted file mode 100644
index cc8b0b8..0000000
--- a/public/javascripts/tiny_mce/plugins/advlink/link.htm
+++ /dev/null
@@ -1,338 +0,0 @@
-
-
-
- {#advlink_dlg.title}
-
-
-
-
-
-
-
-
-
-
-
diff --git a/public/javascripts/tiny_mce/plugins/autoresize/editor_plugin.js b/public/javascripts/tiny_mce/plugins/autoresize/editor_plugin.js
deleted file mode 100644
index 220b84a..0000000
--- a/public/javascripts/tiny_mce/plugins/autoresize/editor_plugin.js
+++ /dev/null
@@ -1 +0,0 @@
-(function(){tinymce.create("tinymce.plugins.AutoResizePlugin",{init:function(a,c){var d=this;if(a.getParam("fullscreen_is_enabled")){return}function b(){var h=a.getDoc(),e=h.body,j=h.documentElement,g=tinymce.DOM,i=d.autoresize_min_height,f;f=tinymce.isIE?e.scrollHeight:j.offsetHeight;if(f>d.autoresize_min_height){i=f}g.setStyle(g.get(a.id+"_ifr"),"height",i+"px");if(d.throbbing){a.setProgressState(false);a.setProgressState(true)}}d.editor=a;d.autoresize_min_height=a.getElement().offsetHeight;a.onInit.add(function(f,e){f.setProgressState(true);d.throbbing=true;f.getBody().style.overflowY="hidden"});a.onChange.add(b);a.onSetContent.add(b);a.onPaste.add(b);a.onKeyUp.add(b);a.onPostRender.add(b);a.onLoadContent.add(function(f,e){b();setTimeout(function(){b();f.setProgressState(false);d.throbbing=false},1250)});a.addCommand("mceAutoResize",b)},getInfo:function(){return{longname:"Auto Resize",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/autoresize",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("autoresize",tinymce.plugins.AutoResizePlugin)})();
\ No newline at end of file
diff --git a/public/javascripts/tiny_mce/plugins/autoresize/editor_plugin_src.js b/public/javascripts/tiny_mce/plugins/autoresize/editor_plugin_src.js
deleted file mode 100644
index 8b2f374..0000000
--- a/public/javascripts/tiny_mce/plugins/autoresize/editor_plugin_src.js
+++ /dev/null
@@ -1,114 +0,0 @@
-/**
- * $Id: editor_plugin_src.js 539 2008-01-14 19:08:58Z spocke $
- *
- * @author Moxiecode
- * @copyright Copyright 2004-2008, Moxiecode Systems AB, All rights reserved.
- */
-
-(function() {
- /**
- * Auto Resize
- *
- * This plugin automatically resizes the content area to fit its content height.
- * It will retain a minimum height, which is the height of the content area when
- * it's initialized.
- */
- tinymce.create('tinymce.plugins.AutoResizePlugin', {
- /**
- * Initializes the plugin, this will be executed after the plugin has been created.
- * This call is done before the editor instance has finished it's initialization so use the onInit event
- * of the editor instance to intercept that event.
- *
- * @param {tinymce.Editor} ed Editor instance that the plugin is initialized in.
- * @param {string} url Absolute URL to where the plugin is located.
- */
- init : function(ed, url) {
- var t = this;
-
- if (ed.getParam('fullscreen_is_enabled'))
- return;
-
- /**
- * This method gets executed each time the editor needs to resize.
- */
- function resize() {
- var d = ed.getDoc(), b = d.body, de = d.documentElement, DOM = tinymce.DOM, resizeHeight = t.autoresize_min_height, myHeight;
-
- // Get height differently depending on the browser used
- myHeight = tinymce.isIE ? b.scrollHeight : de.offsetHeight;
-
- // Don't make it smaller than the minimum height
- if (myHeight > t.autoresize_min_height)
- resizeHeight = myHeight;
-
- // Resize content element
- DOM.setStyle(DOM.get(ed.id + '_ifr'), 'height', resizeHeight + 'px');
-
- // if we're throbbing, we'll re-throb to match the new size
- if (t.throbbing) {
- ed.setProgressState(false);
- ed.setProgressState(true);
- }
- };
-
- t.editor = ed;
-
- // Define minimum height
- t.autoresize_min_height = ed.getElement().offsetHeight;
-
- // Things to do when the editor is ready
- ed.onInit.add(function(ed, l) {
- // Show throbber until content area is resized properly
- ed.setProgressState(true);
- t.throbbing = true;
-
- // Hide scrollbars
- ed.getBody().style.overflowY = "hidden";
- });
-
- // Add appropriate listeners for resizing content area
- ed.onChange.add(resize);
- ed.onSetContent.add(resize);
- ed.onPaste.add(resize);
- ed.onKeyUp.add(resize);
- ed.onPostRender.add(resize);
-
- ed.onLoadContent.add(function(ed, l) {
- resize();
-
- // Because the content area resizes when its content CSS loads,
- // and we can't easily add a listener to its onload event,
- // we'll just trigger a resize after a short loading period
- setTimeout(function() {
- resize();
-
- // Disable throbber
- ed.setProgressState(false);
- t.throbbing = false;
- }, 1250);
- });
-
- // Register the command so that it can be invoked by using tinyMCE.activeEditor.execCommand('mceExample');
- ed.addCommand('mceAutoResize', resize);
- },
-
- /**
- * Returns information about the plugin as a name/value array.
- * The current keys are longname, author, authorurl, infourl and version.
- *
- * @return {Object} Name/value array containing information about the plugin.
- */
- getInfo : function() {
- return {
- longname : 'Auto Resize',
- author : 'Moxiecode Systems AB',
- authorurl : 'http://tinymce.moxiecode.com',
- infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/autoresize',
- version : tinymce.majorVersion + "." + tinymce.minorVersion
- };
- }
- });
-
- // Register plugin
- tinymce.PluginManager.add('autoresize', tinymce.plugins.AutoResizePlugin);
-})();
\ No newline at end of file
diff --git a/public/javascripts/tiny_mce/plugins/autosave/editor_plugin.js b/public/javascripts/tiny_mce/plugins/autosave/editor_plugin.js
deleted file mode 100644
index 091a063..0000000
--- a/public/javascripts/tiny_mce/plugins/autosave/editor_plugin.js
+++ /dev/null
@@ -1 +0,0 @@
-(function(){tinymce.create("tinymce.plugins.AutoSavePlugin",{init:function(a,b){var c=this;c.editor=a;window.onbeforeunload=tinymce.plugins.AutoSavePlugin._beforeUnloadHandler},getInfo:function(){return{longname:"Auto save",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/autosave",version:tinymce.majorVersion+"."+tinymce.minorVersion}},"static":{_beforeUnloadHandler:function(){var a;tinymce.each(tinyMCE.editors,function(b){if(b.getParam("fullscreen_is_enabled")){return}if(b.isDirty()){a=b.getLang("autosave.unload_msg");return false}});return a}}});tinymce.PluginManager.add("autosave",tinymce.plugins.AutoSavePlugin)})();
\ No newline at end of file
diff --git a/public/javascripts/tiny_mce/plugins/autosave/editor_plugin_src.js b/public/javascripts/tiny_mce/plugins/autosave/editor_plugin_src.js
deleted file mode 100644
index 3c4325a..0000000
--- a/public/javascripts/tiny_mce/plugins/autosave/editor_plugin_src.js
+++ /dev/null
@@ -1,51 +0,0 @@
-/**
- * $Id: editor_plugin_src.js 520 2008-01-07 16:30:32Z spocke $
- *
- * @author Moxiecode
- * @copyright Copyright 2004-2008, Moxiecode Systems AB, All rights reserved.
- */
-
-(function() {
- tinymce.create('tinymce.plugins.AutoSavePlugin', {
- init : function(ed, url) {
- var t = this;
-
- t.editor = ed;
-
- window.onbeforeunload = tinymce.plugins.AutoSavePlugin._beforeUnloadHandler;
- },
-
- getInfo : function() {
- return {
- longname : 'Auto save',
- author : 'Moxiecode Systems AB',
- authorurl : 'http://tinymce.moxiecode.com',
- infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/autosave',
- version : tinymce.majorVersion + "." + tinymce.minorVersion
- };
- },
-
- // Private plugin internal methods
-
- 'static' : {
- _beforeUnloadHandler : function() {
- var msg;
-
- tinymce.each(tinyMCE.editors, function(ed) {
- if (ed.getParam("fullscreen_is_enabled"))
- return;
-
- if (ed.isDirty()) {
- msg = ed.getLang("autosave.unload_msg");
- return false;
- }
- });
-
- return msg;
- }
- }
- });
-
- // Register plugin
- tinymce.PluginManager.add('autosave', tinymce.plugins.AutoSavePlugin);
-})();
\ No newline at end of file
diff --git a/public/javascripts/tiny_mce/plugins/bbcode/editor_plugin.js b/public/javascripts/tiny_mce/plugins/bbcode/editor_plugin.js
deleted file mode 100644
index 930fdff..0000000
--- a/public/javascripts/tiny_mce/plugins/bbcode/editor_plugin.js
+++ /dev/null
@@ -1 +0,0 @@
-(function(){tinymce.create("tinymce.plugins.BBCodePlugin",{init:function(a,b){var d=this,c=a.getParam("bbcode_dialect","punbb").toLowerCase();a.onBeforeSetContent.add(function(e,f){f.content=d["_"+c+"_bbcode2html"](f.content)});a.onPostProcess.add(function(e,f){if(f.set){f.content=d["_"+c+"_bbcode2html"](f.content)}if(f.get){f.content=d["_"+c+"_html2bbcode"](f.content)}})},getInfo:function(){return{longname:"BBCode Plugin",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/bbcode",version:tinymce.majorVersion+"."+tinymce.minorVersion}},_punbb_html2bbcode:function(a){a=tinymce.trim(a);function b(c,d){a=a.replace(c,d)}b(/(.*?)<\/a>/gi,"[url=$1]$2[/url]");b(/(.*?)<\/font>/gi,"[code][color=$1]$2[/color][/code]");b(/(.*?)<\/font>/gi,"[quote][color=$1]$2[/color][/quote]");b(/(.*?)<\/font>/gi,"[code][color=$1]$2[/color][/code]");b(/(.*?)<\/font>/gi,"[quote][color=$1]$2[/color][/quote]");b(/(.*?)<\/span>/gi,"[color=$1]$2[/color]");b(/(.*?)<\/font>/gi,"[color=$1]$2[/color]");b(/(.*?)<\/span>/gi,"[size=$1]$2[/size]");b(/(.*?)<\/font>/gi,"$1");b(//gi,"[img]$1[/img]");b(/(.*?)<\/span>/gi,"[code]$1[/code]");b(/(.*?)<\/span>/gi,"[quote]$1[/quote]");b(/(.*?)<\/strong>/gi,"[code][b]$1[/b][/code]");b(/(.*?)<\/strong>/gi,"[quote][b]$1[/b][/quote]");b(/(.*?)<\/em>/gi,"[code][i]$1[/i][/code]");b(/(.*?)<\/em>/gi,"[quote][i]$1[/i][/quote]");b(/(.*?)<\/u>/gi,"[code][u]$1[/u][/code]");b(/(.*?)<\/u>/gi,"[quote][u]$1[/u][/quote]");b(/<\/(strong|b)>/gi,"[/b]");b(/<(strong|b)>/gi,"[b]");b(/<\/(em|i)>/gi,"[/i]");b(/<(em|i)>/gi,"[i]");b(/<\/u>/gi,"[/u]");b(/(.*?)<\/span>/gi,"[u]$1[/u]");b(//gi,"[u]");b(/]*>/gi,"[quote]");b(/<\/blockquote>/gi,"[/quote]");b(/
/gi,"\n");b(/
/gi,"\n");b(/
/gi,"\n");b(//gi,"");b(/<\/p>/gi,"\n");b(/ /gi," ");b(/"/gi,'"');b(/</gi,"<");b(/>/gi,">");b(/&/gi,"&");return a},_punbb_bbcode2html:function(a){a=tinymce.trim(a);function b(c,d){a=a.replace(c,d)}b(/\n/gi,"
");b(/\[b\]/gi,"");b(/\[\/b\]/gi,"");b(/\[i\]/gi,"");b(/\[\/i\]/gi,"");b(/\[u\]/gi,"");b(/\[\/u\]/gi,"");b(/\[url=([^\]]+)\](.*?)\[\/url\]/gi,'$2');b(/\[url\](.*?)\[\/url\]/gi,'$1');b(/\[img\](.*?)\[\/img\]/gi,'
');b(/\[color=(.*?)\](.*?)\[\/color\]/gi,'$2');b(/\[code\](.*?)\[\/code\]/gi,'$1 ');b(/\[quote.*?\](.*?)\[\/quote\]/gi,'$1 ');return a}});tinymce.PluginManager.add("bbcode",tinymce.plugins.BBCodePlugin)})();
\ No newline at end of file
diff --git a/public/javascripts/tiny_mce/plugins/bbcode/editor_plugin_src.js b/public/javascripts/tiny_mce/plugins/bbcode/editor_plugin_src.js
deleted file mode 100644
index 1d7493e..0000000
--- a/public/javascripts/tiny_mce/plugins/bbcode/editor_plugin_src.js
+++ /dev/null
@@ -1,117 +0,0 @@
-/**
- * $Id: editor_plugin_src.js 201 2007-02-12 15:56:56Z spocke $
- *
- * @author Moxiecode
- * @copyright Copyright 2004-2008, Moxiecode Systems AB, All rights reserved.
- */
-
-(function() {
- tinymce.create('tinymce.plugins.BBCodePlugin', {
- init : function(ed, url) {
- var t = this, dialect = ed.getParam('bbcode_dialect', 'punbb').toLowerCase();
-
- ed.onBeforeSetContent.add(function(ed, o) {
- o.content = t['_' + dialect + '_bbcode2html'](o.content);
- });
-
- ed.onPostProcess.add(function(ed, o) {
- if (o.set)
- o.content = t['_' + dialect + '_bbcode2html'](o.content);
-
- if (o.get)
- o.content = t['_' + dialect + '_html2bbcode'](o.content);
- });
- },
-
- getInfo : function() {
- return {
- longname : 'BBCode Plugin',
- author : 'Moxiecode Systems AB',
- authorurl : 'http://tinymce.moxiecode.com',
- infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/bbcode',
- version : tinymce.majorVersion + "." + tinymce.minorVersion
- };
- },
-
- // Private methods
-
- // HTML -> BBCode in PunBB dialect
- _punbb_html2bbcode : function(s) {
- s = tinymce.trim(s);
-
- function rep(re, str) {
- s = s.replace(re, str);
- };
-
- // example: to [b]
- rep(/(.*?)<\/a>/gi,"[url=$1]$2[/url]");
- rep(/(.*?)<\/font>/gi,"[code][color=$1]$2[/color][/code]");
- rep(/(.*?)<\/font>/gi,"[quote][color=$1]$2[/color][/quote]");
- rep(/(.*?)<\/font>/gi,"[code][color=$1]$2[/color][/code]");
- rep(/(.*?)<\/font>/gi,"[quote][color=$1]$2[/color][/quote]");
- rep(/(.*?)<\/span>/gi,"[color=$1]$2[/color]");
- rep(/(.*?)<\/font>/gi,"[color=$1]$2[/color]");
- rep(/(.*?)<\/span>/gi,"[size=$1]$2[/size]");
- rep(/(.*?)<\/font>/gi,"$1");
- rep(//gi,"[img]$1[/img]");
- rep(/(.*?)<\/span>/gi,"[code]$1[/code]");
- rep(/(.*?)<\/span>/gi,"[quote]$1[/quote]");
- rep(/(.*?)<\/strong>/gi,"[code][b]$1[/b][/code]");
- rep(/(.*?)<\/strong>/gi,"[quote][b]$1[/b][/quote]");
- rep(/(.*?)<\/em>/gi,"[code][i]$1[/i][/code]");
- rep(/(.*?)<\/em>/gi,"[quote][i]$1[/i][/quote]");
- rep(/(.*?)<\/u>/gi,"[code][u]$1[/u][/code]");
- rep(/(.*?)<\/u>/gi,"[quote][u]$1[/u][/quote]");
- rep(/<\/(strong|b)>/gi,"[/b]");
- rep(/<(strong|b)>/gi,"[b]");
- rep(/<\/(em|i)>/gi,"[/i]");
- rep(/<(em|i)>/gi,"[i]");
- rep(/<\/u>/gi,"[/u]");
- rep(/(.*?)<\/span>/gi,"[u]$1[/u]");
- rep(//gi,"[u]");
- rep(/]*>/gi,"[quote]");
- rep(/<\/blockquote>/gi,"[/quote]");
- rep(/
/gi,"\n");
- rep(/
/gi,"\n");
- rep(/
/gi,"\n");
- rep(//gi,"");
- rep(/<\/p>/gi,"\n");
- rep(/ /gi," ");
- rep(/"/gi,"\"");
- rep(/</gi,"<");
- rep(/>/gi,">");
- rep(/&/gi,"&");
-
- return s;
- },
-
- // BBCode -> HTML from PunBB dialect
- _punbb_bbcode2html : function(s) {
- s = tinymce.trim(s);
-
- function rep(re, str) {
- s = s.replace(re, str);
- };
-
- // example: [b] to
- rep(/\n/gi,"
");
- rep(/\[b\]/gi,"");
- rep(/\[\/b\]/gi,"");
- rep(/\[i\]/gi,"");
- rep(/\[\/i\]/gi,"");
- rep(/\[u\]/gi,"");
- rep(/\[\/u\]/gi,"");
- rep(/\[url=([^\]]+)\](.*?)\[\/url\]/gi,"$2");
- rep(/\[url\](.*?)\[\/url\]/gi,"$1");
- rep(/\[img\](.*?)\[\/img\]/gi,"
");
- rep(/\[color=(.*?)\](.*?)\[\/color\]/gi,"$2");
- rep(/\[code\](.*?)\[\/code\]/gi,"$1 ");
- rep(/\[quote.*?\](.*?)\[\/quote\]/gi,"$1 ");
-
- return s;
- }
- });
-
- // Register plugin
- tinymce.PluginManager.add('bbcode', tinymce.plugins.BBCodePlugin);
-})();
\ No newline at end of file
diff --git a/public/javascripts/tiny_mce/plugins/contextmenu/editor_plugin.js b/public/javascripts/tiny_mce/plugins/contextmenu/editor_plugin.js
deleted file mode 100644
index 24ee2eb..0000000
--- a/public/javascripts/tiny_mce/plugins/contextmenu/editor_plugin.js
+++ /dev/null
@@ -1 +0,0 @@
-(function(){var a=tinymce.dom.Event,c=tinymce.each,b=tinymce.DOM;tinymce.create("tinymce.plugins.ContextMenu",{init:function(d){var f=this;f.editor=d;f.onContextMenu=new tinymce.util.Dispatcher(this);d.onContextMenu.add(function(g,h){if(!h.ctrlKey){f._getMenu(g).showMenu(h.clientX,h.clientY);a.add(g.getDoc(),"click",e);a.cancel(h)}});function e(){if(f._menu){f._menu.removeAll();f._menu.destroy();a.remove(d.getDoc(),"click",e)}}d.onMouseDown.add(e);d.onKeyDown.add(e)},getInfo:function(){return{longname:"Contextmenu",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/contextmenu",version:tinymce.majorVersion+"."+tinymce.minorVersion}},_getMenu:function(h){var l=this,f=l._menu,i=h.selection,e=i.isCollapsed(),d=i.getNode()||h.getBody(),g,k,j;if(f){f.removeAll();f.destroy()}k=b.getPos(h.getContentAreaContainer());j=b.getPos(h.getContainer());f=h.controlManager.createDropMenu("contextmenu",{offset_x:k.x+h.getParam("contextmenu_offset_x",0),offset_y:k.y+h.getParam("contextmenu_offset_y",0),constrain:1});l._menu=f;f.add({title:"advanced.cut_desc",icon:"cut",cmd:"Cut"}).setDisabled(e);f.add({title:"advanced.copy_desc",icon:"copy",cmd:"Copy"}).setDisabled(e);f.add({title:"advanced.paste_desc",icon:"paste",cmd:"Paste"});if((d.nodeName=="A"&&!h.dom.getAttrib(d,"name"))||!e){f.addSeparator();f.add({title:"advanced.link_desc",icon:"link",cmd:h.plugins.advlink?"mceAdvLink":"mceLink",ui:true});f.add({title:"advanced.unlink_desc",icon:"unlink",cmd:"UnLink"})}f.addSeparator();f.add({title:"advanced.image_desc",icon:"image",cmd:h.plugins.advimage?"mceAdvImage":"mceImage",ui:true});f.addSeparator();g=f.addMenu({title:"contextmenu.align"});g.add({title:"contextmenu.left",icon:"justifyleft",cmd:"JustifyLeft"});g.add({title:"contextmenu.center",icon:"justifycenter",cmd:"JustifyCenter"});g.add({title:"contextmenu.right",icon:"justifyright",cmd:"JustifyRight"});g.add({title:"contextmenu.full",icon:"justifyfull",cmd:"JustifyFull"});l.onContextMenu.dispatch(l,f,d,e);return f}});tinymce.PluginManager.add("contextmenu",tinymce.plugins.ContextMenu)})();
\ No newline at end of file
diff --git a/public/javascripts/tiny_mce/plugins/contextmenu/editor_plugin_src.js b/public/javascripts/tiny_mce/plugins/contextmenu/editor_plugin_src.js
deleted file mode 100644
index a2c1866..0000000
--- a/public/javascripts/tiny_mce/plugins/contextmenu/editor_plugin_src.js
+++ /dev/null
@@ -1,95 +0,0 @@
-/**
- * $Id: editor_plugin_src.js 848 2008-05-15 11:54:40Z spocke $
- *
- * @author Moxiecode
- * @copyright Copyright 2004-2008, Moxiecode Systems AB, All rights reserved.
- */
-
-(function() {
- var Event = tinymce.dom.Event, each = tinymce.each, DOM = tinymce.DOM;
-
- tinymce.create('tinymce.plugins.ContextMenu', {
- init : function(ed) {
- var t = this;
-
- t.editor = ed;
- t.onContextMenu = new tinymce.util.Dispatcher(this);
-
- ed.onContextMenu.add(function(ed, e) {
- if (!e.ctrlKey) {
- t._getMenu(ed).showMenu(e.clientX, e.clientY);
- Event.add(ed.getDoc(), 'click', hide);
- Event.cancel(e);
- }
- });
-
- function hide() {
- if (t._menu) {
- t._menu.removeAll();
- t._menu.destroy();
- Event.remove(ed.getDoc(), 'click', hide);
- }
- };
-
- ed.onMouseDown.add(hide);
- ed.onKeyDown.add(hide);
- },
-
- getInfo : function() {
- return {
- longname : 'Contextmenu',
- author : 'Moxiecode Systems AB',
- authorurl : 'http://tinymce.moxiecode.com',
- infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/contextmenu',
- version : tinymce.majorVersion + "." + tinymce.minorVersion
- };
- },
-
- _getMenu : function(ed) {
- var t = this, m = t._menu, se = ed.selection, col = se.isCollapsed(), el = se.getNode() || ed.getBody(), am, p1, p2;
-
- if (m) {
- m.removeAll();
- m.destroy();
- }
-
- p1 = DOM.getPos(ed.getContentAreaContainer());
- p2 = DOM.getPos(ed.getContainer());
-
- m = ed.controlManager.createDropMenu('contextmenu', {
- offset_x : p1.x + ed.getParam('contextmenu_offset_x', 0),
- offset_y : p1.y + ed.getParam('contextmenu_offset_y', 0),
- constrain : 1
- });
-
- t._menu = m;
-
- m.add({title : 'advanced.cut_desc', icon : 'cut', cmd : 'Cut'}).setDisabled(col);
- m.add({title : 'advanced.copy_desc', icon : 'copy', cmd : 'Copy'}).setDisabled(col);
- m.add({title : 'advanced.paste_desc', icon : 'paste', cmd : 'Paste'});
-
- if ((el.nodeName == 'A' && !ed.dom.getAttrib(el, 'name')) || !col) {
- m.addSeparator();
- m.add({title : 'advanced.link_desc', icon : 'link', cmd : ed.plugins.advlink ? 'mceAdvLink' : 'mceLink', ui : true});
- m.add({title : 'advanced.unlink_desc', icon : 'unlink', cmd : 'UnLink'});
- }
-
- m.addSeparator();
- m.add({title : 'advanced.image_desc', icon : 'image', cmd : ed.plugins.advimage ? 'mceAdvImage' : 'mceImage', ui : true});
-
- m.addSeparator();
- am = m.addMenu({title : 'contextmenu.align'});
- am.add({title : 'contextmenu.left', icon : 'justifyleft', cmd : 'JustifyLeft'});
- am.add({title : 'contextmenu.center', icon : 'justifycenter', cmd : 'JustifyCenter'});
- am.add({title : 'contextmenu.right', icon : 'justifyright', cmd : 'JustifyRight'});
- am.add({title : 'contextmenu.full', icon : 'justifyfull', cmd : 'JustifyFull'});
-
- t.onContextMenu.dispatch(t, m, el, col);
-
- return m;
- }
- });
-
- // Register plugin
- tinymce.PluginManager.add('contextmenu', tinymce.plugins.ContextMenu);
-})();
\ No newline at end of file
diff --git a/public/javascripts/tiny_mce/plugins/directionality/editor_plugin.js b/public/javascripts/tiny_mce/plugins/directionality/editor_plugin.js
deleted file mode 100644
index bce8e73..0000000
--- a/public/javascripts/tiny_mce/plugins/directionality/editor_plugin.js
+++ /dev/null
@@ -1 +0,0 @@
-(function(){tinymce.create("tinymce.plugins.Directionality",{init:function(a,b){var c=this;c.editor=a;a.addCommand("mceDirectionLTR",function(){var d=a.dom.getParent(a.selection.getNode(),a.dom.isBlock);if(d){if(a.dom.getAttrib(d,"dir")!="ltr"){a.dom.setAttrib(d,"dir","ltr")}else{a.dom.setAttrib(d,"dir","")}}a.nodeChanged()});a.addCommand("mceDirectionRTL",function(){var d=a.dom.getParent(a.selection.getNode(),a.dom.isBlock);if(d){if(a.dom.getAttrib(d,"dir")!="rtl"){a.dom.setAttrib(d,"dir","rtl")}else{a.dom.setAttrib(d,"dir","")}}a.nodeChanged()});a.addButton("ltr",{title:"directionality.ltr_desc",cmd:"mceDirectionLTR"});a.addButton("rtl",{title:"directionality.rtl_desc",cmd:"mceDirectionRTL"});a.onNodeChange.add(c._nodeChange,c)},getInfo:function(){return{longname:"Directionality",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/directionality",version:tinymce.majorVersion+"."+tinymce.minorVersion}},_nodeChange:function(b,a,e){var d=b.dom,c;e=d.getParent(e,d.isBlock);if(!e){a.setDisabled("ltr",1);a.setDisabled("rtl",1);return}c=d.getAttrib(e,"dir");a.setActive("ltr",c=="ltr");a.setDisabled("ltr",0);a.setActive("rtl",c=="rtl");a.setDisabled("rtl",0)}});tinymce.PluginManager.add("directionality",tinymce.plugins.Directionality)})();
\ No newline at end of file
diff --git a/public/javascripts/tiny_mce/plugins/directionality/editor_plugin_src.js b/public/javascripts/tiny_mce/plugins/directionality/editor_plugin_src.js
deleted file mode 100644
index 81818e3..0000000
--- a/public/javascripts/tiny_mce/plugins/directionality/editor_plugin_src.js
+++ /dev/null
@@ -1,79 +0,0 @@
-/**
- * $Id: editor_plugin_src.js 520 2008-01-07 16:30:32Z spocke $
- *
- * @author Moxiecode
- * @copyright Copyright 2004-2008, Moxiecode Systems AB, All rights reserved.
- */
-
-(function() {
- tinymce.create('tinymce.plugins.Directionality', {
- init : function(ed, url) {
- var t = this;
-
- t.editor = ed;
-
- ed.addCommand('mceDirectionLTR', function() {
- var e = ed.dom.getParent(ed.selection.getNode(), ed.dom.isBlock);
-
- if (e) {
- if (ed.dom.getAttrib(e, "dir") != "ltr")
- ed.dom.setAttrib(e, "dir", "ltr");
- else
- ed.dom.setAttrib(e, "dir", "");
- }
-
- ed.nodeChanged();
- });
-
- ed.addCommand('mceDirectionRTL', function() {
- var e = ed.dom.getParent(ed.selection.getNode(), ed.dom.isBlock);
-
- if (e) {
- if (ed.dom.getAttrib(e, "dir") != "rtl")
- ed.dom.setAttrib(e, "dir", "rtl");
- else
- ed.dom.setAttrib(e, "dir", "");
- }
-
- ed.nodeChanged();
- });
-
- ed.addButton('ltr', {title : 'directionality.ltr_desc', cmd : 'mceDirectionLTR'});
- ed.addButton('rtl', {title : 'directionality.rtl_desc', cmd : 'mceDirectionRTL'});
-
- ed.onNodeChange.add(t._nodeChange, t);
- },
-
- getInfo : function() {
- return {
- longname : 'Directionality',
- author : 'Moxiecode Systems AB',
- authorurl : 'http://tinymce.moxiecode.com',
- infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/directionality',
- version : tinymce.majorVersion + "." + tinymce.minorVersion
- };
- },
-
- // Private methods
-
- _nodeChange : function(ed, cm, n) {
- var dom = ed.dom, dir;
-
- n = dom.getParent(n, dom.isBlock);
- if (!n) {
- cm.setDisabled('ltr', 1);
- cm.setDisabled('rtl', 1);
- return;
- }
-
- dir = dom.getAttrib(n, 'dir');
- cm.setActive('ltr', dir == "ltr");
- cm.setDisabled('ltr', 0);
- cm.setActive('rtl', dir == "rtl");
- cm.setDisabled('rtl', 0);
- }
- });
-
- // Register plugin
- tinymce.PluginManager.add('directionality', tinymce.plugins.Directionality);
-})();
\ No newline at end of file
diff --git a/public/javascripts/tiny_mce/plugins/emotions/editor_plugin.js b/public/javascripts/tiny_mce/plugins/emotions/editor_plugin.js
deleted file mode 100644
index 4783bc3..0000000
--- a/public/javascripts/tiny_mce/plugins/emotions/editor_plugin.js
+++ /dev/null
@@ -1 +0,0 @@
-(function(){tinymce.create("tinymce.plugins.EmotionsPlugin",{init:function(a,b){a.addCommand("mceEmotion",function(){a.windowManager.open({file:b+"/emotions.htm",width:250+parseInt(a.getLang("emotions.delta_width",0)),height:160+parseInt(a.getLang("emotions.delta_height",0)),inline:1},{plugin_url:b})});a.addButton("emotions",{title:"emotions.emotions_desc",cmd:"mceEmotion"})},getInfo:function(){return{longname:"Emotions",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/emotions",version:tinymce.majorVersion+"."+tinymce.minorVersion}}});tinymce.PluginManager.add("emotions",tinymce.plugins.EmotionsPlugin)})();
\ No newline at end of file
diff --git a/public/javascripts/tiny_mce/plugins/emotions/editor_plugin_src.js b/public/javascripts/tiny_mce/plugins/emotions/editor_plugin_src.js
deleted file mode 100644
index df0d370..0000000
--- a/public/javascripts/tiny_mce/plugins/emotions/editor_plugin_src.js
+++ /dev/null
@@ -1,40 +0,0 @@
-/**
- * $Id: editor_plugin_src.js 520 2008-01-07 16:30:32Z spocke $
- *
- * @author Moxiecode
- * @copyright Copyright 2004-2008, Moxiecode Systems AB, All rights reserved.
- */
-
-(function() {
- tinymce.create('tinymce.plugins.EmotionsPlugin', {
- init : function(ed, url) {
- // Register commands
- ed.addCommand('mceEmotion', function() {
- ed.windowManager.open({
- file : url + '/emotions.htm',
- width : 250 + parseInt(ed.getLang('emotions.delta_width', 0)),
- height : 160 + parseInt(ed.getLang('emotions.delta_height', 0)),
- inline : 1
- }, {
- plugin_url : url
- });
- });
-
- // Register buttons
- ed.addButton('emotions', {title : 'emotions.emotions_desc', cmd : 'mceEmotion'});
- },
-
- getInfo : function() {
- return {
- longname : 'Emotions',
- author : 'Moxiecode Systems AB',
- authorurl : 'http://tinymce.moxiecode.com',
- infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/emotions',
- version : tinymce.majorVersion + "." + tinymce.minorVersion
- };
- }
- });
-
- // Register plugin
- tinymce.PluginManager.add('emotions', tinymce.plugins.EmotionsPlugin);
-})();
\ No newline at end of file
diff --git a/public/javascripts/tiny_mce/plugins/emotions/emotions.htm b/public/javascripts/tiny_mce/plugins/emotions/emotions.htm
deleted file mode 100644
index 55a1d72..0000000
--- a/public/javascripts/tiny_mce/plugins/emotions/emotions.htm
+++ /dev/null
@@ -1,40 +0,0 @@
-
-
-
- {#emotions_dlg.title}
-
-
-
-
-
-
-
diff --git a/public/javascripts/tiny_mce/plugins/emotions/img/smiley-cool.gif b/public/javascripts/tiny_mce/plugins/emotions/img/smiley-cool.gif
deleted file mode 100644
index ba90cc3..0000000
Binary files a/public/javascripts/tiny_mce/plugins/emotions/img/smiley-cool.gif and /dev/null differ
diff --git a/public/javascripts/tiny_mce/plugins/emotions/img/smiley-cry.gif b/public/javascripts/tiny_mce/plugins/emotions/img/smiley-cry.gif
deleted file mode 100644
index 74d897a..0000000
Binary files a/public/javascripts/tiny_mce/plugins/emotions/img/smiley-cry.gif and /dev/null differ
diff --git a/public/javascripts/tiny_mce/plugins/emotions/img/smiley-embarassed.gif b/public/javascripts/tiny_mce/plugins/emotions/img/smiley-embarassed.gif
deleted file mode 100644
index 963a96b..0000000
Binary files a/public/javascripts/tiny_mce/plugins/emotions/img/smiley-embarassed.gif and /dev/null differ
diff --git a/public/javascripts/tiny_mce/plugins/emotions/img/smiley-foot-in-mouth.gif b/public/javascripts/tiny_mce/plugins/emotions/img/smiley-foot-in-mouth.gif
deleted file mode 100644
index 16f68cc..0000000
Binary files a/public/javascripts/tiny_mce/plugins/emotions/img/smiley-foot-in-mouth.gif and /dev/null differ
diff --git a/public/javascripts/tiny_mce/plugins/emotions/img/smiley-frown.gif b/public/javascripts/tiny_mce/plugins/emotions/img/smiley-frown.gif
deleted file mode 100644
index 716f55e..0000000
Binary files a/public/javascripts/tiny_mce/plugins/emotions/img/smiley-frown.gif and /dev/null differ
diff --git a/public/javascripts/tiny_mce/plugins/emotions/img/smiley-innocent.gif b/public/javascripts/tiny_mce/plugins/emotions/img/smiley-innocent.gif
deleted file mode 100644
index 334d49e..0000000
Binary files a/public/javascripts/tiny_mce/plugins/emotions/img/smiley-innocent.gif and /dev/null differ
diff --git a/public/javascripts/tiny_mce/plugins/emotions/img/smiley-kiss.gif b/public/javascripts/tiny_mce/plugins/emotions/img/smiley-kiss.gif
deleted file mode 100644
index 4efd549..0000000
Binary files a/public/javascripts/tiny_mce/plugins/emotions/img/smiley-kiss.gif and /dev/null differ
diff --git a/public/javascripts/tiny_mce/plugins/emotions/img/smiley-laughing.gif b/public/javascripts/tiny_mce/plugins/emotions/img/smiley-laughing.gif
deleted file mode 100644
index 1606c11..0000000
Binary files a/public/javascripts/tiny_mce/plugins/emotions/img/smiley-laughing.gif and /dev/null differ
diff --git a/public/javascripts/tiny_mce/plugins/emotions/img/smiley-money-mouth.gif b/public/javascripts/tiny_mce/plugins/emotions/img/smiley-money-mouth.gif
deleted file mode 100644
index ca2451e..0000000
Binary files a/public/javascripts/tiny_mce/plugins/emotions/img/smiley-money-mouth.gif and /dev/null differ
diff --git a/public/javascripts/tiny_mce/plugins/emotions/img/smiley-sealed.gif b/public/javascripts/tiny_mce/plugins/emotions/img/smiley-sealed.gif
deleted file mode 100644
index b33d3cc..0000000
Binary files a/public/javascripts/tiny_mce/plugins/emotions/img/smiley-sealed.gif and /dev/null differ
diff --git a/public/javascripts/tiny_mce/plugins/emotions/img/smiley-smile.gif b/public/javascripts/tiny_mce/plugins/emotions/img/smiley-smile.gif
deleted file mode 100644
index e6a9e60..0000000
Binary files a/public/javascripts/tiny_mce/plugins/emotions/img/smiley-smile.gif and /dev/null differ
diff --git a/public/javascripts/tiny_mce/plugins/emotions/img/smiley-surprised.gif b/public/javascripts/tiny_mce/plugins/emotions/img/smiley-surprised.gif
deleted file mode 100644
index cb99cdd..0000000
Binary files a/public/javascripts/tiny_mce/plugins/emotions/img/smiley-surprised.gif and /dev/null differ
diff --git a/public/javascripts/tiny_mce/plugins/emotions/img/smiley-tongue-out.gif b/public/javascripts/tiny_mce/plugins/emotions/img/smiley-tongue-out.gif
deleted file mode 100644
index 2075dc1..0000000
Binary files a/public/javascripts/tiny_mce/plugins/emotions/img/smiley-tongue-out.gif and /dev/null differ
diff --git a/public/javascripts/tiny_mce/plugins/emotions/img/smiley-undecided.gif b/public/javascripts/tiny_mce/plugins/emotions/img/smiley-undecided.gif
deleted file mode 100644
index bef7e25..0000000
Binary files a/public/javascripts/tiny_mce/plugins/emotions/img/smiley-undecided.gif and /dev/null differ
diff --git a/public/javascripts/tiny_mce/plugins/emotions/img/smiley-wink.gif b/public/javascripts/tiny_mce/plugins/emotions/img/smiley-wink.gif
deleted file mode 100644
index 9faf1af..0000000
Binary files a/public/javascripts/tiny_mce/plugins/emotions/img/smiley-wink.gif and /dev/null differ
diff --git a/public/javascripts/tiny_mce/plugins/emotions/img/smiley-yell.gif b/public/javascripts/tiny_mce/plugins/emotions/img/smiley-yell.gif
deleted file mode 100644
index 648e6e8..0000000
Binary files a/public/javascripts/tiny_mce/plugins/emotions/img/smiley-yell.gif and /dev/null differ
diff --git a/public/javascripts/tiny_mce/plugins/emotions/js/emotions.js b/public/javascripts/tiny_mce/plugins/emotions/js/emotions.js
deleted file mode 100644
index c549367..0000000
--- a/public/javascripts/tiny_mce/plugins/emotions/js/emotions.js
+++ /dev/null
@@ -1,22 +0,0 @@
-tinyMCEPopup.requireLangPack();
-
-var EmotionsDialog = {
- init : function(ed) {
- tinyMCEPopup.resizeToInnerSize();
- },
-
- insert : function(file, title) {
- var ed = tinyMCEPopup.editor, dom = ed.dom;
-
- tinyMCEPopup.execCommand('mceInsertContent', false, dom.createHTML('img', {
- src : tinyMCEPopup.getWindowArg('plugin_url') + '/img/' + file,
- alt : ed.getLang(title),
- title : ed.getLang(title),
- border : 0
- }));
-
- tinyMCEPopup.close();
- }
-};
-
-tinyMCEPopup.onInit.add(EmotionsDialog.init, EmotionsDialog);
diff --git a/public/javascripts/tiny_mce/plugins/emotions/langs/en_dlg.js b/public/javascripts/tiny_mce/plugins/emotions/langs/en_dlg.js
deleted file mode 100644
index 3b57ad9..0000000
--- a/public/javascripts/tiny_mce/plugins/emotions/langs/en_dlg.js
+++ /dev/null
@@ -1,20 +0,0 @@
-tinyMCE.addI18n('en.emotions_dlg',{
-title:"Insert emotion",
-desc:"Emotions",
-cool:"Cool",
-cry:"Cry",
-embarassed:"Embarassed",
-foot_in_mouth:"Foot in mouth",
-frown:"Frown",
-innocent:"Innocent",
-kiss:"Kiss",
-laughing:"Laughing",
-money_mouth:"Money mouth",
-sealed:"Sealed",
-smile:"Smile",
-surprised:"Surprised",
-tongue_out:"Tongue out",
-undecided:"Undecided",
-wink:"Wink",
-yell:"Yell"
-});
\ No newline at end of file
diff --git a/public/javascripts/tiny_mce/plugins/example/dialog.htm b/public/javascripts/tiny_mce/plugins/example/dialog.htm
deleted file mode 100644
index b4c6284..0000000
--- a/public/javascripts/tiny_mce/plugins/example/dialog.htm
+++ /dev/null
@@ -1,27 +0,0 @@
-
-
-
- {#example_dlg.title}
-
-
-
-
-
-
-
-
-
diff --git a/public/javascripts/tiny_mce/plugins/example/editor_plugin.js b/public/javascripts/tiny_mce/plugins/example/editor_plugin.js
deleted file mode 100644
index ec1f81e..0000000
--- a/public/javascripts/tiny_mce/plugins/example/editor_plugin.js
+++ /dev/null
@@ -1 +0,0 @@
-(function(){tinymce.PluginManager.requireLangPack("example");tinymce.create("tinymce.plugins.ExamplePlugin",{init:function(a,b){a.addCommand("mceExample",function(){a.windowManager.open({file:b+"/dialog.htm",width:320+parseInt(a.getLang("example.delta_width",0)),height:120+parseInt(a.getLang("example.delta_height",0)),inline:1},{plugin_url:b,some_custom_arg:"custom arg"})});a.addButton("example",{title:"example.desc",cmd:"mceExample",image:b+"/img/example.gif"});a.onNodeChange.add(function(d,c,e){c.setActive("example",e.nodeName=="IMG")})},createControl:function(b,a){return null},getInfo:function(){return{longname:"Example plugin",author:"Some author",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/example",version:"1.0"}}});tinymce.PluginManager.add("example",tinymce.plugins.ExamplePlugin)})();
\ No newline at end of file
diff --git a/public/javascripts/tiny_mce/plugins/example/editor_plugin_src.js b/public/javascripts/tiny_mce/plugins/example/editor_plugin_src.js
deleted file mode 100644
index 5050550..0000000
--- a/public/javascripts/tiny_mce/plugins/example/editor_plugin_src.js
+++ /dev/null
@@ -1,81 +0,0 @@
-/**
- * $Id: editor_plugin_src.js 201 2007-02-12 15:56:56Z spocke $
- *
- * @author Moxiecode
- * @copyright Copyright 2004-2008, Moxiecode Systems AB, All rights reserved.
- */
-
-(function() {
- // Load plugin specific language pack
- tinymce.PluginManager.requireLangPack('example');
-
- tinymce.create('tinymce.plugins.ExamplePlugin', {
- /**
- * Initializes the plugin, this will be executed after the plugin has been created.
- * This call is done before the editor instance has finished it's initialization so use the onInit event
- * of the editor instance to intercept that event.
- *
- * @param {tinymce.Editor} ed Editor instance that the plugin is initialized in.
- * @param {string} url Absolute URL to where the plugin is located.
- */
- init : function(ed, url) {
- // Register the command so that it can be invoked by using tinyMCE.activeEditor.execCommand('mceExample');
- ed.addCommand('mceExample', function() {
- ed.windowManager.open({
- file : url + '/dialog.htm',
- width : 320 + parseInt(ed.getLang('example.delta_width', 0)),
- height : 120 + parseInt(ed.getLang('example.delta_height', 0)),
- inline : 1
- }, {
- plugin_url : url, // Plugin absolute URL
- some_custom_arg : 'custom arg' // Custom argument
- });
- });
-
- // Register example button
- ed.addButton('example', {
- title : 'example.desc',
- cmd : 'mceExample',
- image : url + '/img/example.gif'
- });
-
- // Add a node change handler, selects the button in the UI when a image is selected
- ed.onNodeChange.add(function(ed, cm, n) {
- cm.setActive('example', n.nodeName == 'IMG');
- });
- },
-
- /**
- * Creates control instances based in the incomming name. This method is normally not
- * needed since the addButton method of the tinymce.Editor class is a more easy way of adding buttons
- * but you sometimes need to create more complex controls like listboxes, split buttons etc then this
- * method can be used to create those.
- *
- * @param {String} n Name of the control to create.
- * @param {tinymce.ControlManager} cm Control manager to use inorder to create new control.
- * @return {tinymce.ui.Control} New control instance or null if no control was created.
- */
- createControl : function(n, cm) {
- return null;
- },
-
- /**
- * Returns information about the plugin as a name/value array.
- * The current keys are longname, author, authorurl, infourl and version.
- *
- * @return {Object} Name/value array containing information about the plugin.
- */
- getInfo : function() {
- return {
- longname : 'Example plugin',
- author : 'Some author',
- authorurl : 'http://tinymce.moxiecode.com',
- infourl : 'http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/example',
- version : "1.0"
- };
- }
- });
-
- // Register plugin
- tinymce.PluginManager.add('example', tinymce.plugins.ExamplePlugin);
-})();
\ No newline at end of file
diff --git a/public/javascripts/tiny_mce/plugins/example/img/example.gif b/public/javascripts/tiny_mce/plugins/example/img/example.gif
deleted file mode 100644
index 1ab5da4..0000000
Binary files a/public/javascripts/tiny_mce/plugins/example/img/example.gif and /dev/null differ
diff --git a/public/javascripts/tiny_mce/plugins/example/js/dialog.js b/public/javascripts/tiny_mce/plugins/example/js/dialog.js
deleted file mode 100644
index fa83411..0000000
--- a/public/javascripts/tiny_mce/plugins/example/js/dialog.js
+++ /dev/null
@@ -1,19 +0,0 @@
-tinyMCEPopup.requireLangPack();
-
-var ExampleDialog = {
- init : function() {
- var f = document.forms[0];
-
- // Get the selected contents as text and place it in the input
- f.someval.value = tinyMCEPopup.editor.selection.getContent({format : 'text'});
- f.somearg.value = tinyMCEPopup.getWindowArg('some_custom_arg');
- },
-
- insert : function() {
- // Insert the contents from the input into the document
- tinyMCEPopup.editor.execCommand('mceInsertContent', false, document.forms[0].someval.value);
- tinyMCEPopup.close();
- }
-};
-
-tinyMCEPopup.onInit.add(ExampleDialog.init, ExampleDialog);
diff --git a/public/javascripts/tiny_mce/plugins/example/langs/en.js b/public/javascripts/tiny_mce/plugins/example/langs/en.js
deleted file mode 100644
index e0784f8..0000000
--- a/public/javascripts/tiny_mce/plugins/example/langs/en.js
+++ /dev/null
@@ -1,3 +0,0 @@
-tinyMCE.addI18n('en.example',{
- desc : 'This is just a template button'
-});
diff --git a/public/javascripts/tiny_mce/plugins/example/langs/en_dlg.js b/public/javascripts/tiny_mce/plugins/example/langs/en_dlg.js
deleted file mode 100644
index ebcf948..0000000
--- a/public/javascripts/tiny_mce/plugins/example/langs/en_dlg.js
+++ /dev/null
@@ -1,3 +0,0 @@
-tinyMCE.addI18n('en.example_dlg',{
- title : 'This is just a example title'
-});
diff --git a/public/javascripts/tiny_mce/plugins/fullpage/css/fullpage.css b/public/javascripts/tiny_mce/plugins/fullpage/css/fullpage.css
deleted file mode 100644
index 7a3334f..0000000
--- a/public/javascripts/tiny_mce/plugins/fullpage/css/fullpage.css
+++ /dev/null
@@ -1,182 +0,0 @@
-/* Hide the advanced tab */
-#advanced_tab {
- display: none;
-}
-
-#metatitle, #metakeywords, #metadescription, #metaauthor, #metacopyright {
- width: 280px;
-}
-
-#doctype, #docencoding {
- width: 200px;
-}
-
-#langcode {
- width: 30px;
-}
-
-#bgimage {
- width: 220px;
-}
-
-#fontface {
- width: 240px;
-}
-
-#leftmargin, #rightmargin, #topmargin, #bottommargin {
- width: 50px;
-}
-
-.panel_wrapper div.current {
- height: 400px;
-}
-
-#stylesheet, #style {
- width: 240px;
-}
-
-/* Head list classes */
-
-.headlistwrapper {
- width: 100%;
-}
-
-.addbutton, .removebutton, .moveupbutton, .movedownbutton {
- border-top: 1px solid;
- border-left: 1px solid;
- border-bottom: 1px solid;
- border-right: 1px solid;
- border-color: #F0F0EE;
- cursor: default;
- display: block;
- width: 20px;
- height: 20px;
-}
-
-#doctypes {
- width: 200px;
-}
-
-.addbutton:hover, .removebutton:hover, .moveupbutton:hover, .movedownbutton:hover {
- border: 1px solid #0A246A;
- background-color: #B6BDD2;
-}
-
-.addbutton {
- background-image: url('../images/add.gif');
- float: left;
- margin-right: 3px;
-}
-
-.removebutton {
- background-image: url('../images/remove.gif');
- float: left;
-}
-
-.moveupbutton {
- background-image: url('../images/move_up.gif');
- float: left;
- margin-right: 3px;
-}
-
-.movedownbutton {
- background-image: url('../images/move_down.gif');
- float: left;
-}
-
-.selected {
- border: 1px solid #0A246A;
- background-color: #B6BDD2;
-}
-
-.toolbar {
- width: 100%;
-}
-
-#headlist {
- width: 100%;
- margin-top: 3px;
- font-size: 11px;
-}
-
-#info, #title_element, #meta_element, #script_element, #style_element, #base_element, #link_element, #comment_element, #unknown_element {
- display: none;
-}
-
-#addmenu {
- position: absolute;
- border: 1px solid gray;
- display: none;
- z-index: 100;
- background-color: white;
-}
-
-#addmenu a {
- display: block;
- width: 100%;
- line-height: 20px;
- text-decoration: none;
- background-color: white;
-}
-
-#addmenu a:hover {
- background-color: #B6BDD2;
- color: black;
-}
-
-#addmenu span {
- padding-left: 10px;
- padding-right: 10px;
-}
-
-#updateElementPanel {
- display: none;
-}
-
-#script_element .panel_wrapper div.current {
- height: 108px;
-}
-
-#style_element .panel_wrapper div.current {
- height: 108px;
-}
-
-#link_element .panel_wrapper div.current {
- height: 140px;
-}
-
-#element_script_value {
- width: 100%;
- height: 100px;
-}
-
-#element_comment_value {
- width: 100%;
- height: 120px;
-}
-
-#element_style_value {
- width: 100%;
- height: 100px;
-}
-
-#element_title, #element_script_src, #element_meta_name, #element_meta_content, #element_base_href, #element_link_href, #element_link_title {
- width: 250px;
-}
-
-.updateElementButton {
- margin-top: 3px;
-}
-
-/* MSIE specific styles */
-
-* html .addbutton, * html .removebutton, * html .moveupbutton, * html .movedownbutton {
- width: 22px;
- height: 22px;
-}
-
-textarea {
- height: 55px;
-}
-
-.panel_wrapper div.current {height:420px;}
\ No newline at end of file
diff --git a/public/javascripts/tiny_mce/plugins/fullpage/editor_plugin.js b/public/javascripts/tiny_mce/plugins/fullpage/editor_plugin.js
deleted file mode 100644
index 8e11bfc..0000000
--- a/public/javascripts/tiny_mce/plugins/fullpage/editor_plugin.js
+++ /dev/null
@@ -1 +0,0 @@
-(function(){tinymce.create("tinymce.plugins.FullPagePlugin",{init:function(a,b){var c=this;c.editor=a;a.addCommand("mceFullPageProperties",function(){a.windowManager.open({file:b+"/fullpage.htm",width:430+parseInt(a.getLang("fullpage.delta_width",0)),height:495+parseInt(a.getLang("fullpage.delta_height",0)),inline:1},{plugin_url:b,head_html:c.head})});a.addButton("fullpage",{title:"fullpage.desc",cmd:"mceFullPageProperties"});a.onBeforeSetContent.add(c._setContent,c);a.onSetContent.add(c._setBodyAttribs,c);a.onGetContent.add(c._getContent,c)},getInfo:function(){return{longname:"Fullpage",author:"Moxiecode Systems AB",authorurl:"http://tinymce.moxiecode.com",infourl:"http://wiki.moxiecode.com/index.php/TinyMCE:Plugins/fullpage",version:tinymce.majorVersion+"."+tinymce.minorVersion}},_setBodyAttribs:function(d,a){var l,c,e,g,b,h,j,f=this.head.match(/body(.*?)>/i);if(f&&f[1]){l=f[1].match(/\s*(\w+\s*=\s*".*?"|\w+\s*=\s*'.*?'|\w+\s*=\s*\w+|\w+)\s*/g);if(l){for(c=0,e=l.length;c",a);h.head=f.substring(0,a+1);j=f.indexOf("
\n";h.foot="\n