diff --git a/.gitignore b/.gitignore
index a86654f6..52178214 100644
--- a/.gitignore
+++ b/.gitignore
@@ -15,5 +15,6 @@ pkg
rails_3_gems
doc/performance.txt
doc/production.sh
+doc/DONE
*.gem
tmp/*
diff --git a/app/controllers/admin/asset_collections_controller.rb b/app/controllers/admin/asset_collections_controller.rb
index b2d6c35c..77cdf6f0 100644
--- a/app/controllers/admin/asset_collections_controller.rb
+++ b/app/controllers/admin/asset_collections_controller.rb
@@ -60,7 +60,7 @@ module Admin
protected
def set_collections
- @collections = current_site.asset_collections
+ @collections = current_site.asset_collections.order_by([[:name, :asc]])
end
end
end
diff --git a/app/controllers/admin/custom_fields_controller.rb b/app/controllers/admin/custom_fields_controller.rb
index 3119d299..cef73522 100644
--- a/app/controllers/admin/custom_fields_controller.rb
+++ b/app/controllers/admin/custom_fields_controller.rb
@@ -3,15 +3,15 @@ module Admin
layout false
- before_filter :set_content_type
+ before_filter :set_parent_and_fields
def edit
- @field = @content_type.content_custom_fields.find(params[:id])
+ @field = @fields.find(params[:id])
render :action => "edit_#{@field.kind.downcase}"
end
def update
- @field = @content_type.content_custom_fields.find(params[:id])
+ @field = @fields.find(params[:id])
@field.updated_at = Time.now # forces mongoid to save the object
params[:custom_field][:category_items_attributes].delete('-1')
@@ -25,8 +25,14 @@ module Admin
protected
- def set_content_type
- @content_type = current_site.content_types.where(:slug => params[:slug]).first
+ def set_parent_and_fields
+ if params[:parent] == 'asset_collection'
+ @parent = current_site.asset_collections.where(:slug => params[:slug]).first
+ @fields = @parent.asset_custom_fields
+ else
+ @parent = current_site.content_types.where(:slug => params[:slug]).first
+ @fields = @parent.content_custom_fields
+ end
end
end
diff --git a/app/controllers/admin/layouts_controller.rb b/app/controllers/admin/layouts_controller.rb
index 3de8b9f0..00c38b28 100644
--- a/app/controllers/admin/layouts_controller.rb
+++ b/app/controllers/admin/layouts_controller.rb
@@ -4,7 +4,7 @@ module Admin
sections 'settings'
def index
- @layouts = current_site.layouts
+ @layouts = current_site.layouts.order_by([[:name, :asc]])
end
def new
diff --git a/app/controllers/admin/snippets_controller.rb b/app/controllers/admin/snippets_controller.rb
index e5eab712..7a440932 100644
--- a/app/controllers/admin/snippets_controller.rb
+++ b/app/controllers/admin/snippets_controller.rb
@@ -4,7 +4,7 @@ module Admin
sections 'settings'
def index
- @snippets = current_site.snippets
+ @snippets = current_site.snippets.order_by([[:name, :asc]])
end
def new
diff --git a/app/helpers/admin/custom_fields_helper.rb b/app/helpers/admin/custom_fields_helper.rb
index c9f09c23..ca6b57d2 100644
--- a/app/helpers/admin/custom_fields_helper.rb
+++ b/app/helpers/admin/custom_fields_helper.rb
@@ -1,8 +1,7 @@
module Admin::CustomFieldsHelper
def options_for_field_kind(selected = nil)
- # %w{String Text Boolean Email File Date}
- options = %w{String Text Category}.map do |kind|
+ options = %w{String Text Category Boolean}.map do |kind|
[t("admin.custom_fields.kind.#{kind.downcase}"), kind]
end
end
@@ -28,4 +27,10 @@ module Admin::CustomFieldsHelper
collection.map { |field| [field.label, field._name] }
end
+ def options_for_text_formatting
+ options = %w{none html}.map do |option|
+ [t("admin.custom_fields.text_formatting.#{option}"), option]
+ end
+ end
+
end
\ No newline at end of file
diff --git a/app/views/admin/asset_collections/edit.html.haml b/app/views/admin/asset_collections/edit.html.haml
index 4b79d1f2..db8e9c97 100644
--- a/app/views/admin/asset_collections/edit.html.haml
+++ b/app/views/admin/asset_collections/edit.html.haml
@@ -26,7 +26,7 @@
= f.input :name
= f.input :slug, :required => false
- = render 'admin/custom_fields/index', :f => f, :collection_name => 'assets'
+ = render 'admin/custom_fields/index', :form => f, :collection_name => 'assets'
= render 'admin/shared/form_actions', :delete_button => link_to(content_tag(:span, t('.destroy')), admin_asset_collection_url(@collection), :confirm => t('admin.messages.confirm'), :method => :delete, :class => 'button small remove'), :button_label => :update
diff --git a/app/views/admin/assets/_form.html.haml b/app/views/admin/assets/_form.html.haml
index d50673f2..a03ba0eb 100644
--- a/app/views/admin/assets/_form.html.haml
+++ b/app/views/admin/assets/_form.html.haml
@@ -1,14 +1,13 @@
+- content_for :head do
+ = javascript_include_tag 'admin/plugins/tiny_mce/tinymce', 'admin/plugins/json2', 'admin/plugins/fancybox', 'admin/custom_fields/category', 'admin/assets'
+ = stylesheet_link_tag 'admin/plugins/fancybox', 'admin/box'
+
= f.inputs :name => :information do
= f.input :name
= f.input :source
- unless @asset.custom_fields.empty?
- = f.inputs :name => :other_fields do
- - @asset.custom_fields.each do |field|
- - if field.string?
- = f.input field._alias.to_sym, :label => field.label
- - elsif field.text?
- = f.input field._alias.to_sym, :label => field.label, :as => :text
+ = render 'admin/custom_fields/custom_form', :form => f, :title => :other_fields, :parent => @collection
- if @asset.image? && @asset.valid?
= f.foldable_inputs :name => "#{t('formtastic.titles.preview')} #{image_dimensions_and_size(@asset)}", :class => 'preview' do
diff --git a/app/views/admin/contents/_form.html.haml b/app/views/admin/contents/_form.html.haml
index 2d5e9c54..5b9d483d 100644
--- a/app/views/admin/contents/_form.html.haml
+++ b/app/views/admin/contents/_form.html.haml
@@ -1,20 +1,5 @@
- content_for :head do
- = javascript_include_tag 'admin/plugins/json2', 'admin/plugins/fancybox', 'admin/custom_fields/category', 'admin/contents'
+ = javascript_include_tag 'admin/plugins/tiny_mce/tinymce', 'admin/plugins/json2', 'admin/plugins/fancybox', 'admin/custom_fields/category', 'admin/contents'
= stylesheet_link_tag 'admin/plugins/fancybox', 'admin/box'
-- highlighted_field_name = @content.content_type.highlighted_field_name
-
-= f.inputs :name => :other_fields do
- - @content.custom_fields.each do |field|
- - required = highlighted_field_name == field._name
-
- - if field.string?
- = f.input field._alias.to_sym, :label => field.label, :hint => field.hint, :required => required
- - elsif field.text?
- = f.input field._alias.to_sym, :label => field.label, :hint => field.hint, :as => :text, :required => required
- - elsif field.category?
- = f.custom_input field._alias.to_sym, :label => field.label, :hint => field.hint, :css => 'toggle' do
- = f.select field._name.to_sym, field.ordered_category_items.collect { |item| [item.name, item.id] }
- %button.button.light.edit-categories-link{ :type => 'button', :'data-url' => edit_admin_custom_field_path(@content_type.slug, field) }
- %span= t('.edit_categories')
-
+= render 'admin/custom_fields/custom_form', :form => f, :title => :attributes, :parent => @content_type
\ No newline at end of file
diff --git a/app/views/admin/custom_fields/_custom_form.html.haml b/app/views/admin/custom_fields/_custom_form.html.haml
new file mode 100644
index 00000000..862edea1
--- /dev/null
+++ b/app/views/admin/custom_fields/_custom_form.html.haml
@@ -0,0 +1,18 @@
+- highlighted_field_name = parent.highlighted_field_name rescue ''
+
+= form.inputs :name => title || :attributes do
+ - form.object.custom_fields.each do |field|
+ - required = highlighted_field_name == field._name
+
+ - if field.string?
+ = form.input field._alias.to_sym, :label => field.label, :hint => field.hint, :required => required
+ - elsif field.text?
+ = form.input field._alias.to_sym, :label => field.label, :hint => field.hint, :as => :text, :required => required, :input_html => { :class => field.text_formatting }
+ - elsif field.category?
+ = form.custom_input field._alias.to_sym, :label => field.label, :hint => field.hint, :css => 'toggle' do
+ = form.select field._name.to_sym, field.ordered_category_items.collect { |item| [item.name, item.id] }
+ %button.button.light.edit-categories-link{ :type => 'button', :'data-url' => edit_admin_custom_field_path(parent.model_name.underscore, parent.slug, field) }
+ %span= t('.edit_categories')
+ - elsif field.boolean?
+ = form.custom_input field._alias.to_sym, :label => field.label, :hint => field.hint, :css => 'toggle' do
+ = form.check_box field._alias.to_sym
\ No newline at end of file
diff --git a/app/views/admin/custom_fields/_edit_field.html.haml b/app/views/admin/custom_fields/_edit_field.html.haml
index 7437dacc..53923953 100644
--- a/app/views/admin/custom_fields/_edit_field.html.haml
+++ b/app/views/admin/custom_fields/_edit_field.html.haml
@@ -4,6 +4,7 @@
= form_tag '#', :class => 'formtastic' do
= fields_for CustomFields::Field.new, :builder => Formtastic::SemanticFormHelper.builder do |g|
- = g.inputs :name => :information do
+ = g.inputs :name => :attributes do
= g.input :_alias
- = g.input :hint
\ No newline at end of file
+ = g.input :hint
+ = g.input :text_formatting, :as => 'select', :collection => options_for_text_formatting, :include_blank => false
\ No newline at end of file
diff --git a/app/views/admin/custom_fields/_index.html.haml b/app/views/admin/custom_fields/_index.html.haml
index 8d0ea4da..72bda90c 100644
--- a/app/views/admin/custom_fields/_index.html.haml
+++ b/app/views/admin/custom_fields/_index.html.haml
@@ -1,11 +1,11 @@
- collection_name = "#{collection_name.singularize}_custom_fields"
-- custom_fields = f.object.send(collection_name.to_sym)
-- ordered_custom_fields = f.object.send(:"ordered_#{collection_name}")
+- custom_fields = form.object.send(collection_name.to_sym)
+- ordered_custom_fields = form.object.send(:"ordered_#{collection_name}")
-= f.foldable_inputs :name => :custom_fields, :class => 'editable-list fields' do
+= form.foldable_inputs :name => :custom_fields, :class => 'editable-list fields' do
- ordered_custom_fields.each do |field|
- = f.fields_for collection_name.to_sym, field, :child_index => field._index do |g|
- %li{ :class => "item added #{'new' if f.object.new_record?} #{'error' unless field.errors.empty?}"}
+ = form.fields_for collection_name.to_sym, field, :child_index => field._index do |g|
+ %li{ :class => "item added #{'new' if form.object.new_record?} #{'error' unless field.errors.empty?}"}
%span.handle
= image_tag 'admin/form/icons/drag.png'
@@ -14,6 +14,8 @@
= g.hidden_field :_alias, :class => 'alias'
= g.hidden_field :hint, :class => 'hint'
+
+ = g.hidden_field :text_formatting, :class => 'text-formatting'
= g.text_field :label, :class => 'label'
@@ -29,7 +31,7 @@
= link_to image_tag('admin/form/pen.png'), '#edit-custom-field', :class => 'edit first'
= link_to image_tag('admin/form/icons/trash.png'), '#', :class => 'remove', :confirm => t('admin.messages.confirm')
- = f.fields_for collection_name.to_sym, custom_fields.build(:label => 'field name', :_alias => ''), :child_index => '-1' do |g|
+ = form.fields_for collection_name.to_sym, custom_fields.build(:label => 'field name', :_alias => ''), :child_index => '-1' do |g|
%li{ :class => 'item template' }
%span.handle
= image_tag 'admin/form/icons/drag.png'
@@ -39,6 +41,8 @@
= g.hidden_field :_alias, :class => 'alias'
= g.hidden_field :hint, :class => 'hint'
+
+ = g.hidden_field :text_formatting, :class => 'text-formatting'
= g.text_field :label, :class => 'string label void'
diff --git a/app/views/admin/custom_fields/edit_category.html.haml b/app/views/admin/custom_fields/edit_category.html.haml
index 5cd07d29..713cece6 100644
--- a/app/views/admin/custom_fields/edit_category.html.haml
+++ b/app/views/admin/custom_fields/edit_category.html.haml
@@ -4,7 +4,7 @@
%p= t('.help')
- = semantic_form_for @field, :as => :custom_field, :url => admin_custom_field_url(@content_type.slug, @field) do |f|
+ = semantic_form_for @field, :as => :custom_field, :url => admin_custom_field_url(@parent.model_name.underscore, @parent.slug, @field) do |f|
= f.foldable_inputs :name => t('.collection_label'), :class => 'editable-list off' do
- @field.ordered_category_items.each do |item|
= f.fields_for :category_items, item, :child_index => item._index do |g|
diff --git a/config/locales/admin_ui_en.yml b/config/locales/admin_ui_en.yml
index 200c921e..4b4e699d 100644
--- a/config/locales/admin_ui_en.yml
+++ b/config/locales/admin_ui_en.yml
@@ -39,12 +39,18 @@ en:
string: Simple Input
text: Text
category: Select
+ boolean: Checkbox
+ text_formatting:
+ none: None
+ html: HTML
edit_field:
title: Edit field
edit_category:
title: Edit options
help: Manage the list of options for your select box.
collection_label: List of options
+ custom_form:
+ edit_categories: Edit options
sessions:
new:
@@ -282,8 +288,6 @@ en:
title: '{{type}} — new item'
edit:
title: '{{type}} — editing item'
- form:
- edit_categories: Edit options
messages:
successful_create: "Content was successfully created."
successful_update: "Content was successfully updated."
@@ -294,7 +298,7 @@ en:
formtastic:
titles:
information: General information
- meta: Meta
+ meta: SEO Metadata
code: Code
credentials: Credentials
language: Language
@@ -308,6 +312,7 @@ en:
custom_fields: Custom fields
other_fields: Other information
presentation: Presentation
+ attributes: Attributes
labels:
theme_asset:
new:
@@ -332,4 +337,8 @@ en:
slug: "You do not need to add the extension file (.css or .js)"
edit:
source: "You can replace it by a file of the same extension"
+ custom_fields:
+ field:
+ _alias: "Property available in liquid templates"
+ hint: "Text displayed in the model form just below the field"
diff --git a/config/routes.rb b/config/routes.rb
index ddc146a3..9f1c4b1a 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -36,17 +36,17 @@ Rails.application.routes.draw do |map|
resources :asset_collections
- resources :assets, :path => "asset_collections/:collection_id/assets"
+ resources :assets, :path => 'asset_collections/:collection_id/assets'
resources :content_types
- resources :contents, :path => "content_types/:slug/contents" do
+ resources :contents, :path => 'content_types/:slug/contents' do
put :sort, :on => :collection
end
- resources :api_contents, :path => "api/:slug/contents", :controller => 'api_contents', :only => [:create]
+ resources :api_contents, :path => 'api/:slug/contents', :controller => 'api_contents', :only => [:create]
- resources :custom_fields, :path => "content_types/:slug/fields"
+ resources :custom_fields, :path => 'custom/:parent/:slug/fields'
end
# magic urls
diff --git a/doc/TODO b/doc/TODO
index 52bd3742..e7aeab1f 100644
--- a/doc/TODO
+++ b/doc/TODO
@@ -1,9 +1,8 @@
BOARD:
-- access page children in liquid
-- new custom field types
- - boolean
-
+- refactoring admin crud (pages + layouts + snippets)
+- refactor slugify method (use parameterize + create a module)
+
BACKLOG:
- localize application in French
@@ -19,12 +18,8 @@ BACKLOG:
- date
- belongs_to => association
-- refactoring admin crud (pages + layouts + snippets)
-- refactor slugify method (use parameterize + create a module)
- cucumber features for admin pages
-- tiny mce or similar for custom field text type.
-
- sitemap
BUGS:
@@ -36,112 +31,13 @@ NICE TO HAVE:
- super_finder
- better icons for mime type
- traffic statistics
-- Heroku / S3 / Worker (not so sure finally)
+- Worker => Heroku / S3 (not so sure finally)
DONE:
-x admin layout
-x logout button
-x slugify page
-x validation page slug
-x update position when assigning a new parent
-x remove all descendants
-x slug from title
-! update "path" when changing slug (new page too) ?
-x mettre a jour le chemin dans _form si slug et/ou parent change
-x slug for 404 and Index pages can not be modified
-x store node closed or open in cookies
-x snippets section
-x menu items have to be translated
-x layout needs at least content_for_layout
-x parts js/css:
- x codemirror
- x change bg (separator)
- x when a tab is selected, if we change layout, we should move to the first visible one
-x page parts
-x layout part should be always in first
-x pages section (CRUD)
-x my account section (part of settings)
-x add new accounts
-x edit site settings
-x slug unique within a folder
-x layouts section
-x create new site
-x share session accross domains (only subdomains)
-x destroy site
-x remove all pages, snippets, ...etc when destroying a website
-x destroy account
-x can not delete the only one admin account for a site
-x create 404 + index pages once a site is created
-x can not delete index + 404 pages
-x validates_uniqueness_of :slug, :scope => :id
-x domain scoping when authenticating
-x theme assets
- x create / update
- x slug
- x filename from slug
- x can not replace a javascript by a stylesheet
-x asset collections
- x create / update
- x sort assets
- x removing assets
- x assets
- x destroy
-x custom fields:
- x renaming fields
- x extract a plugin from custom fields
- x ui
- x field position
- x rename asset_field
- x nested attributes
- x keep tracks of all custom fields (adding / editing assets) + order them
- x duplicate fields
-x content types / models (CRUD)
- x require a custom field at least
- x pre-select the first custom field as the highlighted one
-x contents (CRUD)
- x sort contents
-x contents sub menu => BUG
-x liquid rendering engine
-x contents pagination
-x how to disable a page part in layout ? (BUG)
-x non published page (redirect to 404 ?)
-x refactoring page.rb => create module pagetree
-! assets uploader: remove old files if new one (BUG non )
-x CodeMirror: switch js -> css -> js .... (http://marijn.haverbeke.nl/codemirror/manual.html)
-x theme assets picker (???)
- x lightbox (http://fancybox.net/api)
- x select it
- x flash upload (http://www.plupload.com/example_custom.php)
-x refactor theme assets / assets uploaders
-x refactoring: CustomFields::CustomField => CustomFields::Field
-x optimization custom_fields: use dynamic class for a collection instead of modifying the metaclass each time we build an item
-x new custom field type: category
- x model
- x ui
- x liquid
-x [BUG] when assigning new layout, disabled parts show up :-( (js problem)
-x make an engine:
- x move initializers to lib/...
- x helpers do not work
-x missing translation in english
-x api security option in content types
-x password resets (url is not handled correctly)
-x mongoid hack for nested attributes
-x convert 2 plugins into gems (mongo_session_store / actionmailer_with_request)
-x comment console.log
-x upload files in S3
-x [BUG] asset vignette: name + icon not vertically aligned
-x truncate nom dans le menu de contents
-x site subdomain regexp [a-z][A-Z][0-9]
-! migrate content_instance to its own collection => http://www.mongodb.org/display/DOCS/Advanced+Queries#AdvancedQueries-%24sliceoperator
-x [BUG] "field name" for alias / hint for custom fields
-x [BUG] can not remove custom fields at creation if object is invalid
-x internal logger
-x deploy on Heroku
- x observers to add / remove domains (http://groups.google.com/group/heroku/browse_thread/thread/148d6ea68e4574fb/4d8f1c8545d52bda?lnk=gst&q=heroku+gem+api#4d8f1c8545d52bda)
-x varnish caching (only with Heroku ?)
-x page not included in liquid templates
-x redirect to referer url when updating site
-x [BUG] items non sorted in a category
-x contents grouped by "category" in the admin
-x hint for custom fields (super easy to do !)
\ No newline at end of file
+
+x tiny mce or similar for custom field text type.
+x refactor custom field types
+x new custom field types
+ x boolean
+x enable/disable text formatting
+x custom fields for asset collections
\ No newline at end of file
diff --git a/public/javascripts/admin/application.js b/public/javascripts/admin/application.js
index ff8a0549..77248398 100644
--- a/public/javascripts/admin/application.js
+++ b/public/javascripts/admin/application.js
@@ -43,6 +43,17 @@ var addCodeMirrorEditor = function(type, el, parser) {
CodeMirrorEditors.push({ 'el': el, 'editor': editor });
}
+/* ___ tinyMCE ___ */
+
+var TinyMceDefaultSettings = {
+ script_url : '/javascripts/admin/plugins/tiny_mce/tiny_mce.js',
+ theme : 'advanced',
+ skin : 'locomotive',
+ theme_advanced_buttons1 : 'code,|,bold,italic,|,strikethrough,justifyleft,justifycenter,justifyright,justifyfull,|,bullist,numlist,|,outdent,indent,blockquote,|,link,unlink',
+ theme_advanced_buttons2 : 'formatselect,fontselect,fontsizeselect,|,undo,redo',
+ theme_advanced_buttons3 : ''
+};
+
/* ___ global ___ */
$(document).ready(function() {
diff --git a/public/javascripts/admin/asset_collections.js b/public/javascripts/admin/asset_collections.js
index 4c364691..f05dd37e 100644
--- a/public/javascripts/admin/asset_collections.js
+++ b/public/javascripts/admin/asset_collections.js
@@ -47,4 +47,5 @@ $(document).ready(function() {
e.preventDefault();
e.stopPropagation();
});
+
});
\ No newline at end of file
diff --git a/public/javascripts/admin/assets.js b/public/javascripts/admin/assets.js
new file mode 100644
index 00000000..4b454bf0
--- /dev/null
+++ b/public/javascripts/admin/assets.js
@@ -0,0 +1,5 @@
+$(document).ready(function() {
+
+ $('textarea.html').tinymce(TinyMceDefaultSettings);
+
+});
\ No newline at end of file
diff --git a/public/javascripts/admin/contents.js b/public/javascripts/admin/contents.js
index b768ec61..44806444 100644
--- a/public/javascripts/admin/contents.js
+++ b/public/javascripts/admin/contents.js
@@ -1,5 +1,4 @@
$(document).ready(function() {
-
var updateContentsOrder = function() {
var lists = $('ul#contents-list.sortable');
var ids = jQuery.map(lists, function(list) {
@@ -15,15 +14,6 @@ $(document).ready(function() {
items: 'li.content',
stop: function(event, ui) { updateContentsOrder(); }
});
-
- $('button.edit-categories-link').click(function() {
- var link = $(this);
- $.fancybox({
- titleShow: false,
- href: link.attr('data-url'),
- padding: 0,
- onComplete: function() { SetupCustomFieldCategoryEditor(link.prev()); },
- onCleanup: function() { }
- })
- });
+
+ $('textarea.html').tinymce(TinyMceDefaultSettings);
});
\ No newline at end of file
diff --git a/public/javascripts/admin/custom_fields.js b/public/javascripts/admin/custom_fields.js
index 415cdaf6..a70d9d1c 100644
--- a/public/javascripts/admin/custom_fields.js
+++ b/public/javascripts/admin/custom_fields.js
@@ -123,18 +123,32 @@ $(document).ready(function() {
e.stopPropagation();
});
- var alias = link.parent().prevAll('.alias').val().trim();
+ var parent = link.parent();
+
+ if (parent.prevAll('select').val() == 'Text') {
+ var formatting = parent.prevAll('.text-formatting').val();
+ $('#fancybox-wrap #custom_fields_field_text_formatting').val(formatting);
+ $('#fancybox-wrap #custom_fields_field_text_formatting_input').show();
+ } else {
+ $('#fancybox-wrap #custom_fields_field_text_formatting_input').hide();
+ }
+
+ var alias = parent.prevAll('.alias').val().trim();
if (alias == '') alias = makeSlug(link.parent().prevAll('.label').val());
$('#fancybox-wrap #custom_fields_field__alias').val(alias);
- var hint = link.parent().prevAll('.hint').val();
+ var hint = parent.prevAll('.hint').val();
$('#fancybox-wrap #custom_fields_field_hint').val(hint);
},
onCleanup: function() {
+ var parent = link.parent();
+
var alias = $('#fancybox-wrap #custom_fields_field__alias').val().trim();
- if (alias != '') link.parent().prevAll('.alias').val(alias);
+ if (alias != '') parent.prevAll('.alias').val(alias);
var hint = $('#fancybox-wrap #custom_fields_field_hint').val().trim();
- if (hint != '') link.parent().prevAll('.hint').val(hint);
+ if (hint != '') parent.prevAll('.hint').val(hint);
+ var formatting = $('#fancybox-wrap #custom_fields_field_text_formatting').val();
+ parent.prevAll('.text-formatting').val(formatting);
}
})
});
diff --git a/public/javascripts/admin/custom_fields/category.js b/public/javascripts/admin/custom_fields/category.js
index e122d2f4..298a5bb8 100644
--- a/public/javascripts/admin/custom_fields/category.js
+++ b/public/javascripts/admin/custom_fields/category.js
@@ -1,4 +1,17 @@
// edit category collection
+$(document).ready(function() {
+ $('button.edit-categories-link').click(function() {
+ var link = $(this);
+ $.fancybox({
+ titleShow: false,
+ href: link.attr('data-url'),
+ padding: 0,
+ onComplete: function() { SetupCustomFieldCategoryEditor(link.prev()); },
+ onCleanup: function() { }
+ })
+ });
+});
+
var SetupCustomFieldCategoryEditor = function(target) {
var refreshPosition = function() {
diff --git a/public/javascripts/admin/plugins/tiny_mce/langs/en.js b/public/javascripts/admin/plugins/tiny_mce/langs/en.js
new file mode 100644
index 00000000..ea4a1b0e
--- /dev/null
+++ b/public/javascripts/admin/plugins/tiny_mce/langs/en.js
@@ -0,0 +1,170 @@
+tinyMCE.addI18n({en:{
+common:{
+edit_confirm:"Do you want to use the WYSIWYG mode for this textarea?",
+apply:"Apply",
+insert:"Insert",
+update:"Update",
+cancel:"Cancel",
+close:"Close",
+browse:"Browse",
+class_name:"Class",
+not_set:"-- Not set --",
+clipboard_msg:"Copy/Cut/Paste is not available in Mozilla and Firefox.\nDo you want more information about this issue?",
+clipboard_no_support:"Currently not supported by your browser, use keyboard shortcuts instead.",
+popup_blocked:"Sorry, but we have noticed that your popup-blocker has disabled a window that provides application functionality. You will need to disable popup blocking on this site in order to fully utilize this tool.",
+invalid_data:"Error: Invalid values entered, these are marked in red.",
+more_colors:"More colors"
+},
+contextmenu:{
+align:"Alignment",
+left:"Left",
+center:"Center",
+right:"Right",
+full:"Full"
+},
+insertdatetime:{
+date_fmt:"%Y-%m-%d",
+time_fmt:"%H:%M:%S",
+insertdate_desc:"Insert date",
+inserttime_desc:"Insert time",
+months_long:"January,February,March,April,May,June,July,August,September,October,November,December",
+months_short:"Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec",
+day_long:"Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday,Sunday",
+day_short:"Sun,Mon,Tue,Wed,Thu,Fri,Sat,Sun"
+},
+print:{
+print_desc:"Print"
+},
+preview:{
+preview_desc:"Preview"
+},
+directionality:{
+ltr_desc:"Direction left to right",
+rtl_desc:"Direction right to left"
+},
+layer:{
+insertlayer_desc:"Insert new layer",
+forward_desc:"Move forward",
+backward_desc:"Move backward",
+absolute_desc:"Toggle absolute positioning",
+content:"New layer..."
+},
+save:{
+save_desc:"Save",
+cancel_desc:"Cancel all changes"
+},
+nonbreaking:{
+nonbreaking_desc:"Insert non-breaking space character"
+},
+iespell:{
+iespell_desc:"Run spell checking",
+download:"ieSpell not detected. Do you want to install it now?"
+},
+advhr:{
+advhr_desc:"Horizontal rule"
+},
+emotions:{
+emotions_desc:"Emotions"
+},
+searchreplace:{
+search_desc:"Find",
+replace_desc:"Find/Replace"
+},
+advimage:{
+image_desc:"Insert/edit image"
+},
+advlink:{
+link_desc:"Insert/edit link"
+},
+xhtmlxtras:{
+cite_desc:"Citation",
+abbr_desc:"Abbreviation",
+acronym_desc:"Acronym",
+del_desc:"Deletion",
+ins_desc:"Insertion",
+attribs_desc:"Insert/Edit Attributes"
+},
+style:{
+desc:"Edit CSS Style"
+},
+paste:{
+paste_text_desc:"Paste as Plain Text",
+paste_word_desc:"Paste from Word",
+selectall_desc:"Select All",
+plaintext_mode_sticky:"Paste is now in plain text mode. Click again to toggle back to regular paste mode. After you paste something you will be returned to regular paste mode.",
+plaintext_mode:"Paste is now in plain text mode. Click again to toggle back to regular paste mode."
+},
+paste_dlg:{
+text_title:"Use CTRL+V on your keyboard to paste the text into the window.",
+text_linebreaks:"Keep linebreaks",
+word_title:"Use CTRL+V on your keyboard to paste the text into the window."
+},
+table:{
+desc:"Inserts a new table",
+row_before_desc:"Insert row before",
+row_after_desc:"Insert row after",
+delete_row_desc:"Delete row",
+col_before_desc:"Insert column before",
+col_after_desc:"Insert column after",
+delete_col_desc:"Remove column",
+split_cells_desc:"Split merged table cells",
+merge_cells_desc:"Merge table cells",
+row_desc:"Table row properties",
+cell_desc:"Table cell properties",
+props_desc:"Table properties",
+paste_row_before_desc:"Paste table row before",
+paste_row_after_desc:"Paste table row after",
+cut_row_desc:"Cut table row",
+copy_row_desc:"Copy table row",
+del:"Delete table",
+row:"Row",
+col:"Column",
+cell:"Cell"
+},
+autosave:{
+unload_msg:"The changes you made will be lost if you navigate away from this page.",
+restore_content:"Restore auto-saved content.",
+warning_message:"If you restore the saved content, you will lose all the content that is currently in the editor.\n\nAre you sure you want to restore the saved content?."
+},
+fullscreen:{
+desc:"Toggle fullscreen mode"
+},
+media:{
+desc:"Insert / edit embedded media",
+edit:"Edit embedded media"
+},
+fullpage:{
+desc:"Document properties"
+},
+template:{
+desc:"Insert predefined template content"
+},
+visualchars:{
+desc:"Visual control characters on/off."
+},
+spellchecker:{
+desc:"Toggle spellchecker",
+menu:"Spellchecker settings",
+ignore_word:"Ignore word",
+ignore_words:"Ignore all",
+langs:"Languages",
+wait:"Please wait...",
+sug:"Suggestions",
+no_sug:"No suggestions",
+no_mpell:"No misspellings found."
+},
+pagebreak:{
+desc:"Insert page break."
+},
+advlist:{
+types:"Types",
+def:"Default",
+lower_alpha:"Lower alpha",
+lower_greek:"Lower greek",
+lower_roman:"Lower roman",
+upper_alpha:"Upper alpha",
+upper_roman:"Upper roman",
+circle:"Circle",
+disc:"Disc",
+square:"Square"
+}}});
\ No newline at end of file
diff --git a/public/javascripts/admin/plugins/tiny_mce/license.txt b/public/javascripts/admin/plugins/tiny_mce/license.txt
new file mode 100644
index 00000000..60d6d4c8
--- /dev/null
+++ b/public/javascripts/admin/plugins/tiny_mce/license.txt
@@ -0,0 +1,504 @@
+ GNU LESSER GENERAL PUBLIC LICENSE
+ Version 2.1, February 1999
+
+ Copyright (C) 1991, 1999 Free Software Foundation, Inc.
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+[This is the first released version of the Lesser GPL. It also counts
+ as the successor of the GNU Library Public License, version 2, hence
+ the version number 2.1.]
+
+ Preamble
+
+ The licenses for most software are designed to take away your
+freedom to share and change it. By contrast, the GNU General Public
+Licenses are intended to guarantee your freedom to share and change
+free software--to make sure the software is free for all its users.
+
+ This license, the Lesser General Public License, applies to some
+specially designated software packages--typically libraries--of the
+Free Software Foundation and other authors who decide to use it. You
+can use it too, but we suggest you first think carefully about whether
+this license or the ordinary General Public License is the better
+strategy to use in any particular case, based on the explanations below.
+
+ When we speak of free software, we are referring to freedom of use,
+not price. Our General Public Licenses are designed to make sure that
+you have the freedom to distribute copies of free software (and charge
+for this service if you wish); that you receive source code or can get
+it if you want it; that you can change the software and use pieces of
+it in new free programs; and that you are informed that you can do
+these things.
+
+ To protect your rights, we need to make restrictions that forbid
+distributors to deny you these rights or to ask you to surrender these
+rights. These restrictions translate to certain responsibilities for
+you if you distribute copies of the library or if you modify it.
+
+ For example, if you distribute copies of the library, whether gratis
+or for a fee, you must give the recipients all the rights that we gave
+you. You must make sure that they, too, receive or can get the source
+code. If you link other code with the library, you must provide
+complete object files to the recipients, so that they can relink them
+with the library after making changes to the library and recompiling
+it. And you must show them these terms so they know their rights.
+
+ We protect your rights with a two-step method: (1) we copyright the
+library, and (2) we offer you this license, which gives you legal
+permission to copy, distribute and/or modify the library.
+
+ To protect each distributor, we want to make it very clear that
+there is no warranty for the free library. Also, if the library is
+modified by someone else and passed on, the recipients should know
+that what they have is not the original version, so that the original
+author's reputation will not be affected by problems that might be
+introduced by others.
+
+ Finally, software patents pose a constant threat to the existence of
+any free program. We wish to make sure that a company cannot
+effectively restrict the users of a free program by obtaining a
+restrictive license from a patent holder. Therefore, we insist that
+any patent license obtained for a version of the library must be
+consistent with the full freedom of use specified in this license.
+
+ Most GNU software, including some libraries, is covered by the
+ordinary GNU General Public License. This license, the GNU Lesser
+General Public License, applies to certain designated libraries, and
+is quite different from the ordinary General Public License. We use
+this license for certain libraries in order to permit linking those
+libraries into non-free programs.
+
+ When a program is linked with a library, whether statically or using
+a shared library, the combination of the two is legally speaking a
+combined work, a derivative of the original library. The ordinary
+General Public License therefore permits such linking only if the
+entire combination fits its criteria of freedom. The Lesser General
+Public License permits more lax criteria for linking other code with
+the library.
+
+ We call this license the "Lesser" General Public License because it
+does Less to protect the user's freedom than the ordinary General
+Public License. It also provides other free software developers Less
+of an advantage over competing non-free programs. These disadvantages
+are the reason we use the ordinary General Public License for many
+libraries. However, the Lesser license provides advantages in certain
+special circumstances.
+
+ For example, on rare occasions, there may be a special need to
+encourage the widest possible use of a certain library, so that it becomes
+a de-facto standard. To achieve this, non-free programs must be
+allowed to use the library. A more frequent case is that a free
+library does the same job as widely used non-free libraries. In this
+case, there is little to gain by limiting the free library to free
+software only, so we use the Lesser General Public License.
+
+ In other cases, permission to use a particular library in non-free
+programs enables a greater number of people to use a large body of
+free software. For example, permission to use the GNU C Library in
+non-free programs enables many more people to use the whole GNU
+operating system, as well as its variant, the GNU/Linux operating
+system.
+
+ Although the Lesser General Public License is Less protective of the
+users' freedom, it does ensure that the user of a program that is
+linked with the Library has the freedom and the wherewithal to run
+that program using a modified version of the Library.
+
+ The precise terms and conditions for copying, distribution and
+modification follow. Pay close attention to the difference between a
+"work based on the library" and a "work that uses the library". The
+former contains code derived from the library, whereas the latter must
+be combined with the library in order to run.
+
+ GNU LESSER GENERAL PUBLIC LICENSE
+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+ 0. This License Agreement applies to any software library or other
+program which contains a notice placed by the copyright holder or
+other authorized party saying it may be distributed under the terms of
+this Lesser General Public License (also called "this License").
+Each licensee is addressed as "you".
+
+ A "library" means a collection of software functions and/or data
+prepared so as to be conveniently linked with application programs
+(which use some of those functions and data) to form executables.
+
+ The "Library", below, refers to any such software library or work
+which has been distributed under these terms. A "work based on the
+Library" means either the Library or any derivative work under
+copyright law: that is to say, a work containing the Library or a
+portion of it, either verbatim or with modifications and/or translated
+straightforwardly into another language. (Hereinafter, translation is
+included without limitation in the term "modification".)
+
+ "Source code" for a work means the preferred form of the work for
+making modifications to it. For a library, complete source code means
+all the source code for all modules it contains, plus any associated
+interface definition files, plus the scripts used to control compilation
+and installation of the library.
+
+ Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope. The act of
+running a program using the Library is not restricted, and output from
+such a program is covered only if its contents constitute a work based
+on the Library (independent of the use of the Library in a tool for
+writing it). Whether that is true depends on what the Library does
+and what the program that uses the Library does.
+
+ 1. You may copy and distribute verbatim copies of the Library's
+complete source code as you receive it, in any medium, provided that
+you conspicuously and appropriately publish on each copy an
+appropriate copyright notice and disclaimer of warranty; keep intact
+all the notices that refer to this License and to the absence of any
+warranty; and distribute a copy of this License along with the
+Library.
+
+ You may charge a fee for the physical act of transferring a copy,
+and you may at your option offer warranty protection in exchange for a
+fee.
+
+ 2. You may modify your copy or copies of the Library or any portion
+of it, thus forming a work based on the Library, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+ a) The modified work must itself be a software library.
+
+ b) You must cause the files modified to carry prominent notices
+ stating that you changed the files and the date of any change.
+
+ c) You must cause the whole of the work to be licensed at no
+ charge to all third parties under the terms of this License.
+
+ d) If a facility in the modified Library refers to a function or a
+ table of data to be supplied by an application program that uses
+ the facility, other than as an argument passed when the facility
+ is invoked, then you must make a good faith effort to ensure that,
+ in the event an application does not supply such function or
+ table, the facility still operates, and performs whatever part of
+ its purpose remains meaningful.
+
+ (For example, a function in a library to compute square roots has
+ a purpose that is entirely well-defined independent of the
+ application. Therefore, Subsection 2d requires that any
+ application-supplied function or table used by this function must
+ be optional: if the application does not supply it, the square
+ root function must still compute square roots.)
+
+These requirements apply to the modified work as a whole. If
+identifiable sections of that work are not derived from the Library,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works. But when you
+distribute the same sections as part of a whole which is a work based
+on the Library, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote
+it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Library.
+
+In addition, mere aggregation of another work not based on the Library
+with the Library (or with a work based on the Library) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+ 3. You may opt to apply the terms of the ordinary GNU General Public
+License instead of this License to a given copy of the Library. To do
+this, you must alter all the notices that refer to this License, so
+that they refer to the ordinary GNU General Public License, version 2,
+instead of to this License. (If a newer version than version 2 of the
+ordinary GNU General Public License has appeared, then you can specify
+that version instead if you wish.) Do not make any other change in
+these notices.
+
+ Once this change is made in a given copy, it is irreversible for
+that copy, so the ordinary GNU General Public License applies to all
+subsequent copies and derivative works made from that copy.
+
+ This option is useful when you wish to copy part of the code of
+the Library into a program that is not a library.
+
+ 4. You may copy and distribute the Library (or a portion or
+derivative of it, under Section 2) in object code or executable form
+under the terms of Sections 1 and 2 above provided that you accompany
+it with the complete corresponding machine-readable source code, which
+must be distributed under the terms of Sections 1 and 2 above on a
+medium customarily used for software interchange.
+
+ If distribution of object code is made by offering access to copy
+from a designated place, then offering equivalent access to copy the
+source code from the same place satisfies the requirement to
+distribute the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+ 5. A program that contains no derivative of any portion of the
+Library, but is designed to work with the Library by being compiled or
+linked with it, is called a "work that uses the Library". Such a
+work, in isolation, is not a derivative work of the Library, and
+therefore falls outside the scope of this License.
+
+ However, linking a "work that uses the Library" with the Library
+creates an executable that is a derivative of the Library (because it
+contains portions of the Library), rather than a "work that uses the
+library". The executable is therefore covered by this License.
+Section 6 states terms for distribution of such executables.
+
+ When a "work that uses the Library" uses material from a header file
+that is part of the Library, the object code for the work may be a
+derivative work of the Library even though the source code is not.
+Whether this is true is especially significant if the work can be
+linked without the Library, or if the work is itself a library. The
+threshold for this to be true is not precisely defined by law.
+
+ If such an object file uses only numerical parameters, data
+structure layouts and accessors, and small macros and small inline
+functions (ten lines or less in length), then the use of the object
+file is unrestricted, regardless of whether it is legally a derivative
+work. (Executables containing this object code plus portions of the
+Library will still fall under Section 6.)
+
+ Otherwise, if the work is a derivative of the Library, you may
+distribute the object code for the work under the terms of Section 6.
+Any executables containing that work also fall under Section 6,
+whether or not they are linked directly with the Library itself.
+
+ 6. As an exception to the Sections above, you may also combine or
+link a "work that uses the Library" with the Library to produce a
+work containing portions of the Library, and distribute that work
+under terms of your choice, provided that the terms permit
+modification of the work for the customer's own use and reverse
+engineering for debugging such modifications.
+
+ You must give prominent notice with each copy of the work that the
+Library is used in it and that the Library and its use are covered by
+this License. You must supply a copy of this License. If the work
+during execution displays copyright notices, you must include the
+copyright notice for the Library among them, as well as a reference
+directing the user to the copy of this License. Also, you must do one
+of these things:
+
+ a) Accompany the work with the complete corresponding
+ machine-readable source code for the Library including whatever
+ changes were used in the work (which must be distributed under
+ Sections 1 and 2 above); and, if the work is an executable linked
+ with the Library, with the complete machine-readable "work that
+ uses the Library", as object code and/or source code, so that the
+ user can modify the Library and then relink to produce a modified
+ executable containing the modified Library. (It is understood
+ that the user who changes the contents of definitions files in the
+ Library will not necessarily be able to recompile the application
+ to use the modified definitions.)
+
+ b) Use a suitable shared library mechanism for linking with the
+ Library. A suitable mechanism is one that (1) uses at run time a
+ copy of the library already present on the user's computer system,
+ rather than copying library functions into the executable, and (2)
+ will operate properly with a modified version of the library, if
+ the user installs one, as long as the modified version is
+ interface-compatible with the version that the work was made with.
+
+ c) Accompany the work with a written offer, valid for at
+ least three years, to give the same user the materials
+ specified in Subsection 6a, above, for a charge no more
+ than the cost of performing this distribution.
+
+ d) If distribution of the work is made by offering access to copy
+ from a designated place, offer equivalent access to copy the above
+ specified materials from the same place.
+
+ e) Verify that the user has already received a copy of these
+ materials or that you have already sent this user a copy.
+
+ For an executable, the required form of the "work that uses the
+Library" must include any data and utility programs needed for
+reproducing the executable from it. However, as a special exception,
+the materials to be distributed need not include anything that is
+normally distributed (in either source or binary form) with the major
+components (compiler, kernel, and so on) of the operating system on
+which the executable runs, unless that component itself accompanies
+the executable.
+
+ It may happen that this requirement contradicts the license
+restrictions of other proprietary libraries that do not normally
+accompany the operating system. Such a contradiction means you cannot
+use both them and the Library together in an executable that you
+distribute.
+
+ 7. You may place library facilities that are a work based on the
+Library side-by-side in a single library together with other library
+facilities not covered by this License, and distribute such a combined
+library, provided that the separate distribution of the work based on
+the Library and of the other library facilities is otherwise
+permitted, and provided that you do these two things:
+
+ a) Accompany the combined library with a copy of the same work
+ based on the Library, uncombined with any other library
+ facilities. This must be distributed under the terms of the
+ Sections above.
+
+ b) Give prominent notice with the combined library of the fact
+ that part of it is a work based on the Library, and explaining
+ where to find the accompanying uncombined form of the same work.
+
+ 8. You may not copy, modify, sublicense, link with, or distribute
+the Library except as expressly provided under this License. Any
+attempt otherwise to copy, modify, sublicense, link with, or
+distribute the Library is void, and will automatically terminate your
+rights under this License. However, parties who have received copies,
+or rights, from you under this License will not have their licenses
+terminated so long as such parties remain in full compliance.
+
+ 9. You are not required to accept this License, since you have not
+signed it. However, nothing else grants you permission to modify or
+distribute the Library or its derivative works. These actions are
+prohibited by law if you do not accept this License. Therefore, by
+modifying or distributing the Library (or any work based on the
+Library), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Library or works based on it.
+
+ 10. Each time you redistribute the Library (or any work based on the
+Library), the recipient automatically receives a license from the
+original licensor to copy, distribute, link with or modify the Library
+subject to these terms and conditions. You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties with
+this License.
+
+ 11. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License. If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Library at all. For example, if a patent
+license would not permit royalty-free redistribution of the Library by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Library.
+
+If any portion of this section is held invalid or unenforceable under any
+particular circumstance, the balance of the section is intended to apply,
+and the section as a whole is intended to apply in other circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system which is
+implemented by public license practices. Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+ 12. If the distribution and/or use of the Library is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Library under this License may add
+an explicit geographical distribution limitation excluding those countries,
+so that distribution is permitted only in or among countries not thus
+excluded. In such case, this License incorporates the limitation as if
+written in the body of this License.
+
+ 13. The Free Software Foundation may publish revised and/or new
+versions of the Lesser General Public License from time to time.
+Such new versions will be similar in spirit to the present version,
+but may differ in detail to address new problems or concerns.
+
+Each version is given a distinguishing version number. If the Library
+specifies a version number of this License which applies to it and
+"any later version", you have the option of following the terms and
+conditions either of that version or of any later version published by
+the Free Software Foundation. If the Library does not specify a
+license version number, you may choose any version ever published by
+the Free Software Foundation.
+
+ 14. If you wish to incorporate parts of the Library into other free
+programs whose distribution conditions are incompatible with these,
+write to the author to ask for permission. For software which is
+copyrighted by the Free Software Foundation, write to the Free
+Software Foundation; we sometimes make exceptions for this. Our
+decision will be guided by the two goals of preserving the free status
+of all derivatives of our free software and of promoting the sharing
+and reuse of software generally.
+
+ NO WARRANTY
+
+ 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
+WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
+EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
+OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
+KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
+LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
+THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
+
+ 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
+WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
+AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
+FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
+CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
+LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
+RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
+FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
+SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
+DAMAGES.
+
+ END OF TERMS AND CONDITIONS
+
+ How to Apply These Terms to Your New Libraries
+
+ If you develop a new library, and you want it to be of the greatest
+possible use to the public, we recommend making it free software that
+everyone can redistribute and change. You can do so by permitting
+redistribution under these terms (or, alternatively, under the terms of the
+ordinary General Public License).
+
+ To apply these terms, attach the following notices to the library. It is
+safest to attach them to the start of each source file to most effectively
+convey the exclusion of warranty; and each file should have at least the
+"copyright" line and a pointer to where the full notice is found.
+
+ /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," /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,"
';
+
+ ed.execCommand("mceInsertContent", false, h);
+ tinyMCEPopup.close();
+ }
+};
+
+tinyMCEPopup.requireLangPack();
+tinyMCEPopup.onInit.add(AdvHRDialog.init, AdvHRDialog);
diff --git a/public/javascripts/admin/plugins/tiny_mce/plugins/advhr/langs/en_dlg.js b/public/javascripts/admin/plugins/tiny_mce/plugins/advhr/langs/en_dlg.js
new file mode 100644
index 00000000..873bfd8d
--- /dev/null
+++ b/public/javascripts/admin/plugins/tiny_mce/plugins/advhr/langs/en_dlg.js
@@ -0,0 +1,5 @@
+tinyMCE.addI18n('en.advhr_dlg',{
+width:"Width",
+size:"Height",
+noshade:"No shadow"
+});
\ No newline at end of file
diff --git a/public/javascripts/admin/plugins/tiny_mce/plugins/advhr/rule.htm b/public/javascripts/admin/plugins/tiny_mce/plugins/advhr/rule.htm
new file mode 100644
index 00000000..fc37b2ae
--- /dev/null
+++ b/public/javascripts/admin/plugins/tiny_mce/plugins/advhr/rule.htm
@@ -0,0 +1,57 @@
+
+
+
+
]*>/gi,"").length>0){i.windowManager.confirm(c+".warning_message",function(m){if(m){h.restoreDraft()}})}else{h.restoreDraft()}}});i.onNodeChange.add(function(){var m=i.controlManager;if(m.get(g)){m.setDisabled(g,!h.hasDraft())}});i.onInit.add(function(){if(i.controlManager.get(g)){h.setupStorage(i);setInterval(function(){h.storeDraft();i.nodeChanged()},l.autosave_interval)}});h.onStoreDraft=new a(h);h.onRestoreDraft=new a(h);h.onRemoveDraft=new a(h);if(!d){window.onbeforeunload=e.plugins.AutoSave._beforeUnloadHandler;d=b}},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:e.majorVersion+"."+e.minorVersion}},getExpDate:function(){return new Date(new Date().getTime()+this.editor.settings.autosave_retention).toUTCString()},setupStorage:function(i){var h=this,k=c+"_test",j="OK";h.key=c+i.id;e.each([function(){if(localStorage){localStorage.setItem(k,j);if(localStorage.getItem(k)===j){localStorage.removeItem(k);return localStorage}}},function(){if(sessionStorage){sessionStorage.setItem(k,j);if(sessionStorage.getItem(k)===j){sessionStorage.removeItem(k);return sessionStorage}}},function(){if(e.isIE){i.getElement().style.behavior="url('#default#userData')";return{autoExpires:b,setItem:function(l,n){var m=i.getElement();m.setAttribute(l,n);m.expires=h.getExpDate();m.save("TinyMCE")},getItem:function(l){var m=i.getElement();m.load("TinyMCE");return m.getAttribute(l)},removeItem:function(l){i.getElement().removeAttribute(l)}}}},],function(l){try{h.storage=l();if(h.storage){return false}}catch(m){}})},storeDraft:function(){var i=this,l=i.storage,j=i.editor,h,k;if(l){if(!l.getItem(i.key)&&!j.isDirty()){return}k=j.getContent();if(k.length>j.settings.autosave_minlength){h=i.getExpDate();if(!i.storage.autoExpires){i.storage.setItem(i.key+"_expires",h)}i.storage.setItem(i.key,k);i.onStoreDraft.dispatch(i,{expires:h,content:k})}}},restoreDraft:function(){var h=this,i=h.storage;if(i){content=i.getItem(h.key);if(content){h.editor.setContent(content);h.onRestoreDraft.dispatch(h,{content:content})}}},hasDraft:function(){var h=this,k=h.storage,i,j;if(k){j=!!k.getItem(h.key);if(j){if(!h.storage.autoExpires){i=new Date(k.getItem(h.key+"_expires"));if(new Date().getTime()
]*>/gi, "").length > 0) {
+ // Show confirm dialog if the editor isn't empty
+ ed.windowManager.confirm(
+ PLUGIN_NAME + ".warning_message",
+ function(ok) {
+ if (ok)
+ self.restoreDraft();
+ }
+ );
+ } else
+ self.restoreDraft();
+ }
+ });
+
+ // Enable/disable restoredraft button depending on if there is a draft stored or not
+ ed.onNodeChange.add(function() {
+ var controlManager = ed.controlManager;
+
+ if (controlManager.get(RESTORE_DRAFT))
+ controlManager.setDisabled(RESTORE_DRAFT, !self.hasDraft());
+ });
+
+ ed.onInit.add(function() {
+ // Check if the user added the restore button, then setup auto storage logic
+ if (ed.controlManager.get(RESTORE_DRAFT)) {
+ // Setup storage engine
+ self.setupStorage(ed);
+
+ // Auto save contents each interval time
+ setInterval(function() {
+ self.storeDraft();
+ ed.nodeChanged();
+ }, settings.autosave_interval);
+ }
+ });
+
+ /**
+ * This event gets fired when a draft is stored to local storage.
+ *
+ * @event onStoreDraft
+ * @param {tinymce.plugins.AutoSave} sender Plugin instance sending the event.
+ * @param {Object} draft Draft object containing the HTML contents of the editor.
+ */
+ self.onStoreDraft = new Dispatcher(self);
+
+ /**
+ * This event gets fired when a draft is restored from local storage.
+ *
+ * @event onStoreDraft
+ * @param {tinymce.plugins.AutoSave} sender Plugin instance sending the event.
+ * @param {Object} draft Draft object containing the HTML contents of the editor.
+ */
+ self.onRestoreDraft = new Dispatcher(self);
+
+ /**
+ * This event gets fired when a draft removed/expired.
+ *
+ * @event onRemoveDraft
+ * @param {tinymce.plugins.AutoSave} sender Plugin instance sending the event.
+ * @param {Object} draft Draft object containing the HTML contents of the editor.
+ */
+ self.onRemoveDraft = new Dispatcher(self);
+
+ // Add ask before unload dialog only add one unload handler
+ if (!unloadHandlerAdded) {
+ window.onbeforeunload = tinymce.plugins.AutoSave._beforeUnloadHandler;
+ unloadHandlerAdded = TRUE;
+ }
+ },
+
+ /**
+ * Returns information about the plugin as a name/value array.
+ * The current keys are longname, author, authorurl, infourl and version.
+ *
+ * @method getInfo
+ * @return {Object} Name/value array containing information about the plugin.
+ */
+ 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
+ };
+ },
+
+ /**
+ * Returns an expiration date UTC string.
+ *
+ * @method getExpDate
+ * @return {String} Expiration date UTC string.
+ */
+ getExpDate : function() {
+ return new Date(
+ new Date().getTime() + this.editor.settings.autosave_retention
+ ).toUTCString();
+ },
+
+ /**
+ * This method will setup the storage engine. If the browser has support for it.
+ *
+ * @method setupStorage
+ */
+ setupStorage : function(ed) {
+ var self = this, testKey = PLUGIN_NAME + '_test', testVal = "OK";
+
+ self.key = PLUGIN_NAME + ed.id;
+
+ // Loop though each storage engine type until we find one that works
+ tinymce.each([
+ function() {
+ // Try HTML5 Local Storage
+ if (localStorage) {
+ localStorage.setItem(testKey, testVal);
+
+ if (localStorage.getItem(testKey) === testVal) {
+ localStorage.removeItem(testKey);
+
+ return localStorage;
+ }
+ }
+ },
+
+ function() {
+ // Try HTML5 Session Storage
+ if (sessionStorage) {
+ sessionStorage.setItem(testKey, testVal);
+
+ if (sessionStorage.getItem(testKey) === testVal) {
+ sessionStorage.removeItem(testKey);
+
+ return sessionStorage;
+ }
+ }
+ },
+
+ function() {
+ // Try IE userData
+ if (tinymce.isIE) {
+ ed.getElement().style.behavior = "url('#default#userData')";
+
+ // Fake localStorage on old IE
+ return {
+ autoExpires : TRUE,
+
+ setItem : function(key, value) {
+ var userDataElement = ed.getElement();
+
+ userDataElement.setAttribute(key, value);
+ userDataElement.expires = self.getExpDate();
+ userDataElement.save("TinyMCE");
+ },
+
+ getItem : function(key) {
+ var userDataElement = ed.getElement();
+
+ userDataElement.load("TinyMCE");
+
+ return userDataElement.getAttribute(key);
+ },
+
+ removeItem : function(key) {
+ ed.getElement().removeAttribute(key);
+ }
+ };
+ }
+ },
+ ], function(setup) {
+ // Try executing each function to find a suitable storage engine
+ try {
+ self.storage = setup();
+
+ if (self.storage)
+ return false;
+ } catch (e) {
+ // Ignore
+ }
+ });
+ },
+
+ /**
+ * This method will store the current contents in the the storage engine.
+ *
+ * @method storeDraft
+ */
+ storeDraft : function() {
+ var self = this, storage = self.storage, editor = self.editor, expires, content;
+
+ // Is the contents dirty
+ if (storage) {
+ // If there is no existing key and the contents hasn't been changed since
+ // it's original value then there is no point in saving a draft
+ if (!storage.getItem(self.key) && !editor.isDirty())
+ return;
+
+ // Store contents if the contents if longer than the minlength of characters
+ content = editor.getContent();
+ if (content.length > editor.settings.autosave_minlength) {
+ expires = self.getExpDate();
+
+ // Store expiration date if needed IE userData has auto expire built in
+ if (!self.storage.autoExpires)
+ self.storage.setItem(self.key + "_expires", expires);
+
+ self.storage.setItem(self.key, content);
+ self.onStoreDraft.dispatch(self, {
+ expires : expires,
+ content : content
+ });
+ }
+ }
+ },
+
+ /**
+ * This method will restore the contents from the storage engine back to the editor.
+ *
+ * @method restoreDraft
+ */
+ restoreDraft : function() {
+ var self = this, storage = self.storage;
+
+ if (storage) {
+ content = storage.getItem(self.key);
+
+ if (content) {
+ self.editor.setContent(content);
+ self.onRestoreDraft.dispatch(self, {
+ content : content
+ });
+ }
+ }
+ },
+
+ /**
+ * This method will return true/false if there is a local storage draft available.
+ *
+ * @method hasDraft
+ * @return {boolean} true/false state if there is a local draft.
+ */
+ hasDraft : function() {
+ var self = this, storage = self.storage, expDate, exists;
+
+ if (storage) {
+ // Does the item exist at all
+ exists = !!storage.getItem(self.key);
+ if (exists) {
+ // Storage needs autoexpire
+ if (!self.storage.autoExpires) {
+ expDate = new Date(storage.getItem(self.key + "_expires"));
+
+ // Contents hasn't expired
+ if (new Date().getTime() < expDate.getTime())
+ return TRUE;
+
+ // Remove it if it has
+ self.removeDraft();
+ } else
+ return TRUE;
+ }
+ }
+
+ return false;
+ },
+
+ /**
+ * Removes the currently stored draft.
+ *
+ * @method removeDraft
+ */
+ removeDraft : function() {
+ var self = this, storage = self.storage, key = self.key, content;
+
+ if (storage) {
+ // Get current contents and remove the existing draft
+ content = storage.getItem(key);
+ storage.removeItem(key);
+ storage.removeItem(key + "_expires");
+
+ // Dispatch remove event if we had any contents
+ if (content) {
+ self.onRemoveDraft.dispatch(self, {
+ content : content
+ });
+ }
+ }
+ },
+
+ "static" : {
+ // Internal unload handler will be called before the page is unloaded
+ _beforeUnloadHandler : function(e) {
+ var msg;
+
+ tinymce.each(tinyMCE.editors, function(ed) {
+ // Store a draft for each editor instance
+ if (ed.plugins.autosave)
+ ed.plugins.autosave.storeDraft();
+
+ // Never ask in fullscreen mode
+ if (ed.getParam("fullscreen_is_enabled"))
+ return;
+
+ // Setup a return message if the editor is dirty
+ if (!msg && ed.isDirty() && ed.getParam("autosave_ask_before_unload"))
+ msg = ed.getLang("autosave.unload_msg");
+ });
+
+ return msg;
+ }
+ }
+ });
+
+ tinymce.PluginManager.add('autosave', tinymce.plugins.AutoSave);
+})(tinymce);
diff --git a/public/javascripts/admin/plugins/tiny_mce/plugins/autosave/langs/en.js b/public/javascripts/admin/plugins/tiny_mce/plugins/autosave/langs/en.js
new file mode 100644
index 00000000..fce6bd3e
--- /dev/null
+++ b/public/javascripts/admin/plugins/tiny_mce/plugins/autosave/langs/en.js
@@ -0,0 +1,4 @@
+tinyMCE.addI18n('en.autosave',{
+restore_content: "Restore auto-saved content",
+warning_message: "If you restore the saved content, you will lose all the content that is currently in the editor.\n\nAre you sure you want to restore the saved content?"
+});
\ No newline at end of file
diff --git a/public/javascripts/admin/plugins/tiny_mce/plugins/bbcode/editor_plugin.js b/public/javascripts/admin/plugins/tiny_mce/plugins/bbcode/editor_plugin.js
new file mode 100644
index 00000000..930fdff0
--- /dev/null
+++ b/public/javascripts/admin/plugins/tiny_mce/plugins/bbcode/editor_plugin.js
@@ -0,0 +1 @@
+(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(/]*>/gi,"[quote]");b(/<\/blockquote>/gi,"[/quote]");b(/
/gi,"\n");b(/
/gi,"\n");b(/
/gi,"\n");b(/
");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/admin/plugins/tiny_mce/plugins/bbcode/editor_plugin_src.js b/public/javascripts/admin/plugins/tiny_mce/plugins/bbcode/editor_plugin_src.js
new file mode 100644
index 00000000..5586637f
--- /dev/null
+++ b/public/javascripts/admin/plugins/tiny_mce/plugins/bbcode/editor_plugin_src.js
@@ -0,0 +1,120 @@
+/**
+ * editor_plugin_src.js
+ *
+ * Copyright 2009, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://tinymce.moxiecode.com/license
+ * Contributing: http://tinymce.moxiecode.com/contributing
+ */
+
+(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(/]*>/gi,"[quote]");
+ rep(/<\/blockquote>/gi,"[/quote]");
+ rep(/
/gi,"\n");
+ rep(/
/gi,"\n");
+ rep(/
/gi,"\n");
+ rep(/
");
+ 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/admin/plugins/tiny_mce/plugins/contextmenu/editor_plugin.js b/public/javascripts/admin/plugins/tiny_mce/plugins/contextmenu/editor_plugin.js
new file mode 100644
index 00000000..9749e516
--- /dev/null
+++ b/public/javascripts/admin/plugins/tiny_mce/plugins/contextmenu/editor_plugin.js
@@ -0,0 +1 @@
+(function(){var a=tinymce.dom.Event,c=tinymce.each,b=tinymce.DOM;tinymce.create("tinymce.plugins.ContextMenu",{init:function(d){var f=this,g;f.editor=d;f.onContextMenu=new tinymce.util.Dispatcher(this);d.onContextMenu.add(function(h,i){if(!i.ctrlKey){if(g){h.selection.setRng(g)}f._getMenu(h).showMenu(i.clientX,i.clientY);a.add(h.getDoc(),"click",function(j){e(h,j)});a.cancel(i)}});d.onRemove.add(function(){if(f._menu){f._menu.removeAll()}});function e(h,i){g=null;if(i&&i.button==2){g=h.selection.getRng();return}if(f._menu){f._menu.removeAll();f._menu.destroy();a.remove(h.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/admin/plugins/tiny_mce/plugins/contextmenu/editor_plugin_src.js b/public/javascripts/admin/plugins/tiny_mce/plugins/contextmenu/editor_plugin_src.js
new file mode 100644
index 00000000..13813a64
--- /dev/null
+++ b/public/javascripts/admin/plugins/tiny_mce/plugins/contextmenu/editor_plugin_src.js
@@ -0,0 +1,147 @@
+/**
+ * editor_plugin_src.js
+ *
+ * Copyright 2009, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://tinymce.moxiecode.com/license
+ * Contributing: http://tinymce.moxiecode.com/contributing
+ */
+
+(function() {
+ var Event = tinymce.dom.Event, each = tinymce.each, DOM = tinymce.DOM;
+
+ /**
+ * This plugin a context menu to TinyMCE editor instances.
+ *
+ * @class tinymce.plugins.ContextMenu
+ */
+ tinymce.create('tinymce.plugins.ContextMenu', {
+ /**
+ * 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.
+ *
+ * @method init
+ * @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) {
+ var t = this, lastRng;
+
+ t.editor = ed;
+
+ /**
+ * This event gets fired when the context menu is shown.
+ *
+ * @event onContextMenu
+ * @param {tinymce.plugins.ContextMenu} sender Plugin instance sending the event.
+ * @param {tinymce.ui.DropMenu} menu Drop down menu to fill with more items if needed.
+ */
+ t.onContextMenu = new tinymce.util.Dispatcher(this);
+
+ ed.onContextMenu.add(function(ed, e) {
+ if (!e.ctrlKey) {
+ // Restore the last selection since it was removed
+ if (lastRng)
+ ed.selection.setRng(lastRng);
+
+ t._getMenu(ed).showMenu(e.clientX, e.clientY);
+ Event.add(ed.getDoc(), 'click', function(e) {
+ hide(ed, e);
+ });
+ Event.cancel(e);
+ }
+ });
+
+ ed.onRemove.add(function() {
+ if (t._menu)
+ t._menu.removeAll();
+ });
+
+ function hide(ed, e) {
+ lastRng = null;
+
+ // Since the contextmenu event moves
+ // the selection we need to store it away
+ if (e && e.button == 2) {
+ lastRng = ed.selection.getRng();
+ return;
+ }
+
+ if (t._menu) {
+ t._menu.removeAll();
+ t._menu.destroy();
+ Event.remove(ed.getDoc(), 'click', hide);
+ }
+ };
+
+ ed.onMouseDown.add(hide);
+ ed.onKeyDown.add(hide);
+ },
+
+ /**
+ * Returns information about the plugin as a name/value array.
+ * The current keys are longname, author, authorurl, infourl and version.
+ *
+ * @method getInfo
+ * @return {Object} Name/value array containing information about the plugin.
+ */
+ 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/admin/plugins/tiny_mce/plugins/directionality/editor_plugin.js b/public/javascripts/admin/plugins/tiny_mce/plugins/directionality/editor_plugin.js
new file mode 100644
index 00000000..bce8e739
--- /dev/null
+++ b/public/javascripts/admin/plugins/tiny_mce/plugins/directionality/editor_plugin.js
@@ -0,0 +1 @@
+(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/admin/plugins/tiny_mce/plugins/directionality/editor_plugin_src.js b/public/javascripts/admin/plugins/tiny_mce/plugins/directionality/editor_plugin_src.js
new file mode 100644
index 00000000..4444959b
--- /dev/null
+++ b/public/javascripts/admin/plugins/tiny_mce/plugins/directionality/editor_plugin_src.js
@@ -0,0 +1,82 @@
+/**
+ * editor_plugin_src.js
+ *
+ * Copyright 2009, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://tinymce.moxiecode.com/license
+ * Contributing: http://tinymce.moxiecode.com/contributing
+ */
+
+(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/admin/plugins/tiny_mce/plugins/emotions/editor_plugin.js b/public/javascripts/admin/plugins/tiny_mce/plugins/emotions/editor_plugin.js
new file mode 100644
index 00000000..dbdd8ffb
--- /dev/null
+++ b/public/javascripts/admin/plugins/tiny_mce/plugins/emotions/editor_plugin.js
@@ -0,0 +1 @@
+(function(a){a.create("tinymce.plugins.EmotionsPlugin",{init:function(b,c){b.addCommand("mceEmotion",function(){b.windowManager.open({file:c+"/emotions.htm",width:250+parseInt(b.getLang("emotions.delta_width",0)),height:160+parseInt(b.getLang("emotions.delta_height",0)),inline:1},{plugin_url:c})});b.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:a.majorVersion+"."+a.minorVersion}}});a.PluginManager.add("emotions",a.plugins.EmotionsPlugin)})(tinymce);
\ No newline at end of file
diff --git a/public/javascripts/admin/plugins/tiny_mce/plugins/emotions/editor_plugin_src.js b/public/javascripts/admin/plugins/tiny_mce/plugins/emotions/editor_plugin_src.js
new file mode 100644
index 00000000..71d54169
--- /dev/null
+++ b/public/javascripts/admin/plugins/tiny_mce/plugins/emotions/editor_plugin_src.js
@@ -0,0 +1,43 @@
+/**
+ * editor_plugin_src.js
+ *
+ * Copyright 2009, Moxiecode Systems AB
+ * Released under LGPL License.
+ *
+ * License: http://tinymce.moxiecode.com/license
+ * Contributing: http://tinymce.moxiecode.com/contributing
+ */
+
+(function(tinymce) {
+ 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);
+})(tinymce);
\ No newline at end of file
diff --git a/public/javascripts/admin/plugins/tiny_mce/plugins/emotions/emotions.htm b/public/javascripts/admin/plugins/tiny_mce/plugins/emotions/emotions.htm
new file mode 100644
index 00000000..55a1d72f
--- /dev/null
+++ b/public/javascripts/admin/plugins/tiny_mce/plugins/emotions/emotions.htm
@@ -0,0 +1,40 @@
+
+
+
+
\n'}h.head+=d.getParam("fullpage_default_doctype",'');h.head+="\n\n
\n
\n";if(g=d.getParam("fullpage_default_encoding")){h.head+='\n'}if(g=d.getParam("fullpage_default_font_family")){i+="font-family: "+g+";"}if(g=d.getParam("fullpage_default_font_size")){i+="font-size: "+g+";"}if(g=d.getParam("fullpage_default_text_color")){i+="color: "+g+";"}h.head+="\n
\n