Removed gettext and simplified_localization-plugin. L18n is now the appropriate module.
Upgraded to rails 2.2.2 and replaced complex foodsoft.rb-loader with simple initializers/load_app_config.rb. Multiple foodcoops option is temporarly deactivated.
This commit is contained in:
parent
5b9a7e05df
commit
9f8d0d28ac
121 changed files with 1197 additions and 15237 deletions
|
@ -1,12 +1,7 @@
|
||||||
require 'user'
|
|
||||||
|
|
||||||
class ApplicationController < ActionController::Base
|
class ApplicationController < ActionController::Base
|
||||||
# Gettext For i18n
|
|
||||||
# locale is chosen through browser http request
|
#before_filter :select_foodcoop
|
||||||
init_gettext "foodsoft"
|
before_filter :authenticate, :store_controller
|
||||||
|
|
||||||
before_filter :select_foodcoop, :authenticate, :store_controller
|
|
||||||
# before_filter :ensureUTF8
|
|
||||||
after_filter :send_email_messages, :remove_controller
|
after_filter :send_email_messages, :remove_controller
|
||||||
|
|
||||||
# sends a mail, when an error occurs
|
# sends a mail, when an error occurs
|
||||||
|
@ -56,12 +51,12 @@ class ApplicationController < ActionController::Base
|
||||||
private
|
private
|
||||||
|
|
||||||
# selects the foodcoop depending on the subdomain
|
# selects the foodcoop depending on the subdomain
|
||||||
def select_foodcoop
|
# def select_foodcoop
|
||||||
# get subdomain and set FoodSoft-class-variable (for later config-requests)
|
# # get subdomain and set FoodSoft-class-variable (for later config-requests)
|
||||||
FoodSoft.subdomain = request.subdomains.first
|
# FoodSoft.subdomain = request.subdomains.first
|
||||||
# set database-connection
|
# # set database-connection
|
||||||
ActiveRecord::Base.establish_connection(FoodSoft.get_database)
|
# ActiveRecord::Base.establish_connection(FoodSoft.get_database)
|
||||||
end
|
# end
|
||||||
|
|
||||||
# Ensures the HTTP content-type encoding is set to "UTF-8" for "text/html" contents.
|
# Ensures the HTTP content-type encoding is set to "UTF-8" for "text/html" contents.
|
||||||
def ensureUTF8
|
def ensureUTF8
|
||||||
|
|
|
@ -163,7 +163,7 @@ class FinanceController < ApplicationController
|
||||||
def createArticleResult
|
def createArticleResult
|
||||||
render :update do |page|
|
render :update do |page|
|
||||||
@article = OrderArticleResult.new(params[:order_article_result])
|
@article = OrderArticleResult.new(params[:order_article_result])
|
||||||
@article.fc_markup = FoodSoft::getPriceMarkup
|
@article.fc_markup = APP_CONFIG[:price_markup]
|
||||||
@article.make_gross if @article.tax && @article.deposit && @article.net_price
|
@article.make_gross if @article.tax && @article.deposit && @article.net_price
|
||||||
if @article.valid?
|
if @article.valid?
|
||||||
@article.save
|
@article.save
|
||||||
|
|
|
@ -118,7 +118,7 @@ class MessagesController < ApplicationController
|
||||||
@message = Message.new(
|
@message = Message.new(
|
||||||
:recipient => message.sender,
|
:recipient => message.sender,
|
||||||
:subject => "Re: #{message.subject}",
|
:subject => "Re: #{message.subject}",
|
||||||
:body => "#{message.sender.nick} schrieb am #{FoodSoft::format_date(message.created_on)} um #{FoodSoft::format_time(message.created_on)}:\n"
|
:body => "#{message.sender.nick} schrieb am #{I18n.l(message.created_on.to_date)} um #{I18n.l(message.created_on, :format => :time)}:\n"
|
||||||
)
|
)
|
||||||
if (message.body)
|
if (message.body)
|
||||||
message.body.each_line{|l| @message.body += "> #{l}"}
|
message.body.each_line{|l| @message.body += "> #{l}"}
|
||||||
|
|
|
@ -133,13 +133,13 @@ class OrdersController < ApplicationController
|
||||||
def text_fax_template
|
def text_fax_template
|
||||||
order = Order.find(params[:id])
|
order = Order.find(params[:id])
|
||||||
supplier = order.supplier
|
supplier = order.supplier
|
||||||
contact = FoodSoft.getFoodcoopContact
|
contact = APP_CONFIG[:contact].symbolize_keys
|
||||||
text = _("Order for") + " #{FoodSoft.getFoodcoopName}"
|
text = _("Order for") + " #{APP_CONFIG[:name]}"
|
||||||
text += "\n" + _("Customer number") + ": #{supplier.customer_number}" unless supplier.customer_number.blank?
|
text += "\n" + _("Customer number") + ": #{supplier.customer_number}" unless supplier.customer_number.blank?
|
||||||
text += "\n" + _("Delivery date") + ": "
|
text += "\n" + _("Delivery date") + ": "
|
||||||
text += "\n\n#{supplier.name}\n#{supplier.address}\nFAX: #{supplier.fax}\n\n"
|
text += "\n\n#{supplier.name}\n#{supplier.address}\nFAX: #{supplier.fax}\n\n"
|
||||||
text += "****** " + _("Shipping address") + "\n\n"
|
text += "****** " + _("Shipping address") + "\n\n"
|
||||||
text += "#{FoodSoft.getFoodcoopName}\n#{contact[:street]}\n#{contact[:zip_code]} #{contact[:city]}\n\n"
|
text += "#{APP_CONFIG[:name]}\n#{contact[:street]}\n#{contact[:zip_code]} #{contact[:city]}\n\n"
|
||||||
text += "****** " + _("Articles") + "\n\n"
|
text += "****** " + _("Articles") + "\n\n"
|
||||||
text += _("Number") + " " + _("Quantity") + " " + _("Name") + "\n"
|
text += _("Number") + " " + _("Quantity") + " " + _("Name") + "\n"
|
||||||
# now display all ordered articles
|
# now display all ordered articles
|
||||||
|
|
|
@ -2,11 +2,15 @@
|
||||||
module ApplicationHelper
|
module ApplicationHelper
|
||||||
|
|
||||||
def format_time(time = Time.now)
|
def format_time(time = Time.now)
|
||||||
FoodSoft::format_date_time(time) unless time.nil?
|
I18n.l time, :format => "%d.%m.%Y %H:%M"
|
||||||
end
|
end
|
||||||
|
|
||||||
def format_date(time = Time.now)
|
def format_date(time = Time.now)
|
||||||
FoodSoft::format_date(time) unless time.nil?
|
I18n.l time.to_date
|
||||||
|
end
|
||||||
|
|
||||||
|
def format_datetime(time = Time.now)
|
||||||
|
I18n.l time
|
||||||
end
|
end
|
||||||
|
|
||||||
# Creates ajax-controlled-links for pagination
|
# Creates ajax-controlled-links for pagination
|
||||||
|
|
|
@ -31,22 +31,22 @@ class Article < ActiveRecord::Base
|
||||||
|
|
||||||
# Custom attribute setter that accepts decimal numbers using localized decimal separator.
|
# Custom attribute setter that accepts decimal numbers using localized decimal separator.
|
||||||
def net_price=(net_price)
|
def net_price=(net_price)
|
||||||
self[:net_price] = FoodSoft::delocalizeDecimalString(net_price)
|
self[:net_price] = String.delocalized_decimal(net_price)
|
||||||
end
|
end
|
||||||
|
|
||||||
# Custom attribute setter that accepts decimal numbers using localized decimal separator.
|
# Custom attribute setter that accepts decimal numbers using localized decimal separator.
|
||||||
def tax=(tax)
|
def tax=(tax)
|
||||||
self[:tax] = FoodSoft::delocalizeDecimalString(tax)
|
self[:tax] = String.delocalized_decimal(tax)
|
||||||
end
|
end
|
||||||
|
|
||||||
# Custom attribute setter that accepts decimal numbers using localized decimal separator.
|
# Custom attribute setter that accepts decimal numbers using localized decimal separator.
|
||||||
def deposit=(deposit)
|
def deposit=(deposit)
|
||||||
self[:deposit] = FoodSoft::delocalizeDecimalString(deposit)
|
self[:deposit] = String.delocalized_decimal(deposit)
|
||||||
end
|
end
|
||||||
|
|
||||||
# calculate the fc price and sets the attribute
|
# calculate the fc price and sets the attribute
|
||||||
def calc_gross_price
|
def calc_gross_price
|
||||||
self.gross_price = ((net_price + deposit) * (tax / 100 + 1)) * (FoodSoft::getPriceMarkup / 100 + 1)
|
self.gross_price = ((net_price + deposit) * (tax / 100 + 1)) * (APP_CONFIG[:price_markup] / 100 + 1)
|
||||||
end
|
end
|
||||||
|
|
||||||
# Returns true if article has been updated at least 2 days ago
|
# Returns true if article has been updated at least 2 days ago
|
||||||
|
@ -150,7 +150,7 @@ class Article < ActiveRecord::Base
|
||||||
end
|
end
|
||||||
|
|
||||||
# convert units in foodcoop-size
|
# convert units in foodcoop-size
|
||||||
# uses FoodSoft.get_units_factors to calc the price/unit_quantity
|
# uses unit factors in app_config.yml to calc the price/unit_quantity
|
||||||
# returns new price and unit_quantity in array, when calc is possible => [price, unit_quanity]
|
# returns new price and unit_quantity in array, when calc is possible => [price, unit_quanity]
|
||||||
# returns false if units aren't foodsoft-compatible
|
# returns false if units aren't foodsoft-compatible
|
||||||
# returns nil if units are eqal
|
# returns nil if units are eqal
|
||||||
|
@ -166,7 +166,8 @@ class Article < ActiveRecord::Base
|
||||||
false
|
false
|
||||||
end
|
end
|
||||||
else # get factors for fc and supplier
|
else # get factors for fc and supplier
|
||||||
fc_unit_factor, supplier_unit_factor = FoodSoft.get_units_factors[self.unit], FoodSoft.get_units_factors[self.shared_article.unit]
|
fc_unit_factor = APP_CONFIG[:units][self.unit]
|
||||||
|
supplier_unit_factor = APP_CONFIG[:units][self.shared_article.unit]
|
||||||
if fc_unit_factor and supplier_unit_factor
|
if fc_unit_factor and supplier_unit_factor
|
||||||
convertion_factor = fc_unit_factor / supplier_unit_factor
|
convertion_factor = fc_unit_factor / supplier_unit_factor
|
||||||
new_price = BigDecimal((convertion_factor * shared_article.price).to_s).round(2)
|
new_price = BigDecimal((convertion_factor * shared_article.price).to_s).round(2)
|
||||||
|
|
|
@ -1,6 +1,4 @@
|
||||||
class Assignment < ActiveRecord::Base
|
class Assignment < ActiveRecord::Base
|
||||||
# gettext-option
|
|
||||||
untranslate_all
|
|
||||||
|
|
||||||
belongs_to :user
|
belongs_to :user
|
||||||
belongs_to :task
|
belongs_to :task
|
||||||
|
|
|
@ -15,7 +15,7 @@ class FinancialTransaction < ActiveRecord::Base
|
||||||
|
|
||||||
# Custom attribute setter that accepts decimal numbers using localized decimal separator.
|
# Custom attribute setter that accepts decimal numbers using localized decimal separator.
|
||||||
def amount=(amount)
|
def amount=(amount)
|
||||||
self[:amount] = FoodSoft::delocalizeDecimalString(amount)
|
self[:amount] = String.delocalized_decimal(amount)
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
|
@ -10,8 +10,6 @@
|
||||||
# * updated_by (User): the user who last updated this order
|
# * updated_by (User): the user who last updated this order
|
||||||
#
|
#
|
||||||
class GroupOrder < ActiveRecord::Base
|
class GroupOrder < ActiveRecord::Base
|
||||||
# gettext-option
|
|
||||||
untranslate_all
|
|
||||||
|
|
||||||
belongs_to :order
|
belongs_to :order
|
||||||
belongs_to :order_group
|
belongs_to :order_group
|
||||||
|
|
|
@ -9,8 +9,6 @@
|
||||||
# * updated_on (timestamp): updated automatically by ActiveRecord
|
# * updated_on (timestamp): updated automatically by ActiveRecord
|
||||||
#
|
#
|
||||||
class GroupOrderArticle < ActiveRecord::Base
|
class GroupOrderArticle < ActiveRecord::Base
|
||||||
# gettext-option
|
|
||||||
untranslate_all
|
|
||||||
|
|
||||||
belongs_to :group_order
|
belongs_to :group_order
|
||||||
belongs_to :order_article
|
belongs_to :order_article
|
||||||
|
|
|
@ -8,8 +8,6 @@
|
||||||
# * created_on (timestamp)
|
# * created_on (timestamp)
|
||||||
|
|
||||||
class GroupOrderArticleQuantity < ActiveRecord::Base
|
class GroupOrderArticleQuantity < ActiveRecord::Base
|
||||||
# gettext-option
|
|
||||||
untranslate_all
|
|
||||||
|
|
||||||
belongs_to :group_order_article
|
belongs_to :group_order_article
|
||||||
|
|
||||||
|
|
|
@ -21,7 +21,7 @@ class GroupOrderArticleResult < ActiveRecord::Base
|
||||||
|
|
||||||
# Custom attribute setter that accepts decimal numbers using localized decimal separator.
|
# Custom attribute setter that accepts decimal numbers using localized decimal separator.
|
||||||
def quantity=(quantity)
|
def quantity=(quantity)
|
||||||
self[:quantity] = FoodSoft::delocalizeDecimalString(quantity)
|
self[:quantity] = String.delocalized_decimal(quantity)
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
|
@ -6,8 +6,6 @@
|
||||||
# * group_order_article_results: collection of associated GroupOrderArticleResults
|
# * group_order_article_results: collection of associated GroupOrderArticleResults
|
||||||
#
|
#
|
||||||
class GroupOrderResult < ActiveRecord::Base
|
class GroupOrderResult < ActiveRecord::Base
|
||||||
# gettext-option
|
|
||||||
untranslate_all
|
|
||||||
|
|
||||||
belongs_to :order
|
belongs_to :order
|
||||||
has_many :group_order_article_results, :dependent => :destroy
|
has_many :group_order_article_results, :dependent => :destroy
|
||||||
|
|
|
@ -5,37 +5,37 @@ class Mailer < ActionMailer::Base
|
||||||
# Assumes user.setResetPasswordToken has been successfully called already.
|
# Assumes user.setResetPasswordToken has been successfully called already.
|
||||||
def password(user)
|
def password(user)
|
||||||
request = ApplicationController.current.request
|
request = ApplicationController.current.request
|
||||||
subject "[#{FoodSoft::getFoodcoopName}] Neues Passwort für/ New password for " + user.nick
|
subject "[#{APP_CONFIG[:name]}] Neues Passwort für/ New password for " + user.nick
|
||||||
recipients user.email
|
recipients user.email
|
||||||
from "FoodSoft <#{FoodSoft::getEmailSender}>"
|
from "FoodSoft <#{APP_CONFIG[:email_sender]}>"
|
||||||
body :user => user,
|
body :user => user,
|
||||||
:link => url_for(:host => FoodSoft::getHost || request.host, :controller => "login", :action => "password", :id => user.id, :token => user.reset_password_token),
|
:link => url_for(:host => request.host, :controller => "login", :action => "password", :id => user.id, :token => user.reset_password_token),
|
||||||
:foodsoftUrl => url_for(:host => FoodSoft::getHost || request.host, :controller => "index")
|
:foodsoftUrl => url_for(:host => request.host, :controller => "index")
|
||||||
end
|
end
|
||||||
|
|
||||||
# Sends an email copy of the given internal foodsoft message.
|
# Sends an email copy of the given internal foodsoft message.
|
||||||
def message(message)
|
def message(message)
|
||||||
request = ApplicationController.current.request
|
request = ApplicationController.current.request
|
||||||
subject "[#{FoodSoft::getFoodcoopName}] " + message.subject
|
subject "[#{APP_CONFIG[:name]}] " + message.subject
|
||||||
recipients message.recipient.email
|
recipients message.recipient.email
|
||||||
from (message.system_message? ? "FoodSoft <#{FoodSoft::getEmailSender}>" : "#{message.sender.nick} <#{message.sender.email}>")
|
from (message.system_message? ? "FoodSoft <#{APP_CONFIG[:email_sender]}>" : "#{message.sender.nick} <#{message.sender.email}>")
|
||||||
body :body => message.body, :sender => (message.system_message? ? 'Foodsoft' : message.sender.nick),
|
body :body => message.body, :sender => (message.system_message? ? 'Foodsoft' : message.sender.nick),
|
||||||
:recipients => message.recipients,
|
:recipients => message.recipients,
|
||||||
:reply => url_for(:host => FoodSoft::getHost || request.host, :controller => "messages", :action => "reply", :id => message),
|
:reply => url_for(:host => request.host, :controller => "messages", :action => "reply", :id => message),
|
||||||
:profile => url_for(:host => FoodSoft::getHost || request.host, :controller => "index", :action => "myProfile", :id => message.recipient),
|
:profile => url_for(:host => request.host, :controller => "index", :action => "myProfile", :id => message.recipient),
|
||||||
:link => url_for(:host => FoodSoft::getHost || request.host, :controller => "messages", :action => "show", :id => message),
|
:link => url_for(:host => request.host, :controller => "messages", :action => "show", :id => message),
|
||||||
:foodsoftUrl => url_for(:host => FoodSoft::getHost || request.host, :controller => "index")
|
:foodsoftUrl => url_for(:host => request.host, :controller => "index")
|
||||||
end
|
end
|
||||||
|
|
||||||
# Sends an invite email.
|
# Sends an invite email.
|
||||||
def invite(invite)
|
def invite(invite)
|
||||||
request = ApplicationController.current.request
|
request = ApplicationController.current.request
|
||||||
subject "Einladung in die Foodcoop #{FoodSoft::getFoodcoopName} - Invitation to the Foodcoop"
|
subject "Einladung in die Foodcoop #{APP_CONFIG[:name]} - Invitation to the Foodcoop"
|
||||||
recipients invite.email
|
recipients invite.email
|
||||||
from "FoodSoft <#{FoodSoft::getEmailSender}>"
|
from "FoodSoft <#{APP_CONFIG[:email_sender]}>"
|
||||||
body :invite => invite,
|
body :invite => invite,
|
||||||
:link => url_for(:host => FoodSoft::getHost || request.host, :controller => "login", :action => "invite", :id => invite.token),
|
:link => url_for(:host => request.host, :controller => "login", :action => "invite", :id => invite.token),
|
||||||
:foodsoftUrl => url_for(:host => FoodSoft::getHost || request.host, :controller => "index")
|
:foodsoftUrl => url_for(:host => request.host, :controller => "index")
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,8 +1,5 @@
|
||||||
class Membership < ActiveRecord::Base
|
class Membership < ActiveRecord::Base
|
||||||
|
|
||||||
# gettext-option
|
|
||||||
untranslate_all
|
|
||||||
|
|
||||||
belongs_to :user
|
belongs_to :user
|
||||||
belongs_to :group
|
belongs_to :group
|
||||||
|
|
||||||
|
|
|
@ -14,8 +14,6 @@ class Message < ActiveRecord::Base
|
||||||
|
|
||||||
attr_accessible :recipient_id, :recipient, :subject, :body, :recipients
|
attr_accessible :recipient_id, :recipient, :subject, :body, :recipients
|
||||||
|
|
||||||
# needed for method 'from_template'
|
|
||||||
include GetText::Rails
|
|
||||||
|
|
||||||
# Values for the email_state attribute: :none, :pending, :sent, :failed
|
# Values for the email_state attribute: :none, :pending, :sent, :failed
|
||||||
EMAIL_STATE = {
|
EMAIL_STATE = {
|
||||||
|
|
|
@ -26,17 +26,17 @@ class Order < ActiveRecord::Base
|
||||||
|
|
||||||
# Custom attribute setter that accepts decimal numbers using localized decimal separator.
|
# Custom attribute setter that accepts decimal numbers using localized decimal separator.
|
||||||
def invoice_amount=(amount)
|
def invoice_amount=(amount)
|
||||||
self[:invoice_amount] = FoodSoft::delocalizeDecimalString(amount)
|
self[:invoice_amount] = String.delocalized_decimal(amount)
|
||||||
end
|
end
|
||||||
|
|
||||||
# Custom attribute setter that accepts decimal numbers using localized decimal separator.
|
# Custom attribute setter that accepts decimal numbers using localized decimal separator.
|
||||||
def deposit=(deposit)
|
def deposit=(deposit)
|
||||||
self[:deposit] = FoodSoft::delocalizeDecimalString(deposit)
|
self[:deposit] = String.delocalized_decimal(deposit)
|
||||||
end
|
end
|
||||||
|
|
||||||
# Custom attribute setter that accepts decimal numbers using localized decimal separator.
|
# Custom attribute setter that accepts decimal numbers using localized decimal separator.
|
||||||
def deposit_credit=(deposit)
|
def deposit_credit=(deposit)
|
||||||
self[:deposit_credit] = FoodSoft::delocalizeDecimalString(deposit)
|
self[:deposit_credit] = String.delocalized_decimal(deposit)
|
||||||
end
|
end
|
||||||
|
|
||||||
# Create or destroy OrderArticle associations on create/update
|
# Create or destroy OrderArticle associations on create/update
|
||||||
|
@ -169,7 +169,7 @@ class Order < ActiveRecord::Base
|
||||||
:gross_price => oa.article.gross_price,
|
:gross_price => oa.article.gross_price,
|
||||||
:tax => oa.article.tax,
|
:tax => oa.article.tax,
|
||||||
:deposit => oa.article.deposit,
|
:deposit => oa.article.deposit,
|
||||||
:fc_markup => FoodSoft::getPriceMarkup,
|
:fc_markup => APP_CONFIG[:price_markup],
|
||||||
:order_number => oa.article.order_number,
|
:order_number => oa.article.order_number,
|
||||||
:unit_quantity => oa.article.unit_quantity,
|
:unit_quantity => oa.article.unit_quantity,
|
||||||
:units_to_order => oa.units_to_order)
|
:units_to_order => oa.units_to_order)
|
||||||
|
|
|
@ -8,10 +8,7 @@
|
||||||
# * units_to_order (int): number of packaging units to be ordered according to the order quantity/tolerance
|
# * units_to_order (int): number of packaging units to be ordered according to the order quantity/tolerance
|
||||||
#
|
#
|
||||||
class OrderArticle < ActiveRecord::Base
|
class OrderArticle < ActiveRecord::Base
|
||||||
|
|
||||||
# gettext-option
|
|
||||||
untranslate_all
|
|
||||||
|
|
||||||
belongs_to :order
|
belongs_to :order
|
||||||
belongs_to :article
|
belongs_to :article
|
||||||
has_many :group_order_articles, :dependent => :destroy
|
has_many :group_order_articles, :dependent => :destroy
|
||||||
|
|
|
@ -28,22 +28,22 @@ class OrderArticleResult < ActiveRecord::Base
|
||||||
|
|
||||||
# Custom attribute setter that accepts decimal numbers using localized decimal separator.
|
# Custom attribute setter that accepts decimal numbers using localized decimal separator.
|
||||||
def net_price=(net_price)
|
def net_price=(net_price)
|
||||||
self[:net_price] = FoodSoft::delocalizeDecimalString(net_price)
|
self[:net_price] = String.delocalized_decimal(net_price)
|
||||||
end
|
end
|
||||||
|
|
||||||
# Custom attribute setter that accepts decimal numbers using localized decimal separator.
|
# Custom attribute setter that accepts decimal numbers using localized decimal separator.
|
||||||
def tax=(tax)
|
def tax=(tax)
|
||||||
self[:tax] = FoodSoft::delocalizeDecimalString(tax)
|
self[:tax] = String.delocalized_decimal(tax)
|
||||||
end
|
end
|
||||||
|
|
||||||
# Custom attribute setter that accepts decimal numbers using localized decimal separator.
|
# Custom attribute setter that accepts decimal numbers using localized decimal separator.
|
||||||
def deposit=(deposit)
|
def deposit=(deposit)
|
||||||
self[:deposit] = FoodSoft::delocalizeDecimalString(deposit)
|
self[:deposit] = String.delocalized_decimal(deposit)
|
||||||
end
|
end
|
||||||
|
|
||||||
# Custom attribute setter that accepts decimal numbers using localized decimal separator.
|
# Custom attribute setter that accepts decimal numbers using localized decimal separator.
|
||||||
def units_to_order=(units_to_order)
|
def units_to_order=(units_to_order)
|
||||||
self[:units_to_order] = FoodSoft::delocalizeDecimalString(units_to_order)
|
self[:units_to_order] = String.delocalized_decimal(units_to_order)
|
||||||
end
|
end
|
||||||
|
|
||||||
# counts from every GroupOrderArticleResult for this ArticleResult
|
# counts from every GroupOrderArticleResult for this ArticleResult
|
||||||
|
|
|
@ -1,10 +1,7 @@
|
||||||
class SharedArticle < ActiveRecord::Base
|
class SharedArticle < ActiveRecord::Base
|
||||||
|
|
||||||
# gettext-option
|
|
||||||
untranslate_all
|
|
||||||
|
|
||||||
# connect to database from sharedLists-Application
|
# connect to database from sharedLists-Application
|
||||||
SharedArticle.establish_connection(FoodSoft::get_shared_lists_config)
|
SharedArticle.establish_connection(APP_CONFIG[:shared_lists])
|
||||||
# set correct table_name in external DB
|
# set correct table_name in external DB
|
||||||
set_table_name :articles
|
set_table_name :articles
|
||||||
|
|
||||||
|
|
|
@ -1,9 +1,7 @@
|
||||||
class SharedSupplier < ActiveRecord::Base
|
class SharedSupplier < ActiveRecord::Base
|
||||||
# used for gettext
|
|
||||||
untranslate_all
|
|
||||||
|
|
||||||
# connect to database from sharedLists-Application
|
# connect to database from sharedLists-Application
|
||||||
SharedSupplier.establish_connection(FoodSoft::get_shared_lists_config)
|
SharedSupplier.establish_connection(APP_CONFIG[:shared_lists])
|
||||||
# set correct table_name in external DB
|
# set correct table_name in external DB
|
||||||
set_table_name :suppliers
|
set_table_name :suppliers
|
||||||
|
|
||||||
|
|
|
@ -12,6 +12,7 @@ require 'digest/sha1'
|
||||||
class User < ActiveRecord::Base
|
class User < ActiveRecord::Base
|
||||||
has_many :memberships, :dependent => :destroy
|
has_many :memberships, :dependent => :destroy
|
||||||
has_many :groups, :through => :memberships
|
has_many :groups, :through => :memberships
|
||||||
|
has_many :order_groups, :through => :memberships, :source => :group
|
||||||
has_many :assignments, :dependent => :destroy
|
has_many :assignments, :dependent => :destroy
|
||||||
has_many :tasks, :through => :assignments
|
has_many :tasks, :through => :assignments
|
||||||
|
|
||||||
|
@ -119,8 +120,9 @@ class User < ActiveRecord::Base
|
||||||
end
|
end
|
||||||
|
|
||||||
# Returns the user's OrderGroup or nil if none found.
|
# Returns the user's OrderGroup or nil if none found.
|
||||||
def find_ordergroup
|
def find_ordergroup
|
||||||
groups.find(:first, :conditions => "type = 'OrderGroup'")
|
order_groups.first
|
||||||
|
#groups.find(:first, :conditions => "type = 'OrderGroup'")
|
||||||
end
|
end
|
||||||
|
|
||||||
# Find all tasks, for which the current user should be responsible
|
# Find all tasks, for which the current user should be responsible
|
||||||
|
|
|
@ -30,7 +30,7 @@
|
||||||
%td=h user.last_name
|
%td=h user.last_name
|
||||||
%td=h user.email
|
%td=h user.email
|
||||||
%td=h roles.join(', ')
|
%td=h roles.join(', ')
|
||||||
%td=h FoodSoft::format_date_time(user.last_login)
|
%td=h format_date_time(user.last_login)
|
||||||
%td
|
%td
|
||||||
= link_to(image_tag('b_edit.png', :size => "16x16", :border => "0", :alt => 'Benutzer_in bearbeiten', :title => 'Benutzer_in bearbeiten'), :action => 'editUser', :id => user)
|
= link_to(image_tag('b_edit.png', :size => "16x16", :border => "0", :alt => 'Benutzer_in bearbeiten', :title => 'Benutzer_in bearbeiten'), :action => 'editUser', :id => user)
|
||||||
= link_to(image_tag('b_drop.png', :size => "16x16", :border => "0", :alt => 'Benutzer_in löschen', :title => 'Benutzer_in löschen'), |
|
= link_to(image_tag('b_drop.png', :size => "16x16", :border => "0", :alt => 'Benutzer_in löschen', :title => 'Benutzer_in löschen'), |
|
||||||
|
|
|
@ -56,5 +56,5 @@
|
||||||
%td{:colspan => "4"}
|
%td{:colspan => "4"}
|
||||||
%b
|
%b
|
||||||
%abbr{:title => "= Gruppenbeträge - Rechnung ohne Pfand"} Differenz mit Aufschlag
|
%abbr{:title => "= Gruppenbeträge - Rechnung ohne Pfand"} Differenz mit Aufschlag
|
||||||
= "(#{number_to_percentage(FoodSoft.getPriceMarkup)}):"
|
= "(#{number_to_percentage(APP_CONFIG[:price_markup])}):"
|
||||||
%span#fcProfit= number_to_currency(@order.fcProfit)
|
%span#fcProfit= number_to_currency(@order.fcProfit)
|
||||||
|
|
|
@ -17,7 +17,7 @@
|
||||||
#logo
|
#logo
|
||||||
%a{:href => "/"}
|
%a{:href => "/"}
|
||||||
<span>food</span>soft
|
<span>food</span>soft
|
||||||
%span{:style => "color:white; font-size:45%; letter-spacing: -1px;"}= FoodSoft::getFoodcoopName
|
%span{:style => "color:white; font-size:45%; letter-spacing: -1px;"}= APP_CONFIG[:name]
|
||||||
#nav= render :partial => 'shared/nav'
|
#nav= render :partial => 'shared/nav'
|
||||||
|
|
||||||
#main
|
#main
|
||||||
|
|
|
@ -12,4 +12,4 @@
|
||||||
= yield
|
= yield
|
||||||
#meta
|
#meta
|
||||||
Foodcoop
|
Foodcoop
|
||||||
= link_to_if FoodSoft::getFoodcoopUrl, FoodSoft::getFoodcoopName, FoodSoft::getFoodcoopUrl
|
= link_to_if APP_CONFIG[:base_url], APP_CONFIG[:name], APP_CONFIG[:base_url]
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
Hallo <%= user.nick %>!
|
Hallo <%= user.nick %>!
|
||||||
|
|
||||||
Der Kontostand deiner Bestellgruppe <%= group.name %> ist durch eine Buchung am <%= transaction.created_on.strftime('%d.%m.%Y um %H:%M') %> ins Minus gerutscht: <%= FoodSoft::format_currency(group.account_balance) %>
|
Der Kontostand deiner Bestellgruppe <%= group.name %> ist durch eine Buchung am <%= transaction.created_on.strftime('%d.%m.%Y um %H:%M') %> ins Minus gerutscht: <%= group.account_balance %>
|
||||||
|
|
||||||
Es wurden <%= FoodSoft::format_currency(transaction.amount) %> für "<%= transaction.note %>" abgebucht, die Buchung wurde von <%= transaction.user.nick %> erstellt.
|
Es wurden <%= transaction.amount %> für "<%= transaction.note %>" abgebucht, die Buchung wurde von <%= transaction.user.nick %> erstellt.
|
||||||
|
|
||||||
Bitte zahlt so bald wie möglich wieder Geld ein, um das Gruppenkonto auszugleichen.
|
Bitte zahlt so bald wie möglich wieder Geld ein, um das Gruppenkonto auszugleichen.
|
||||||
|
|
||||||
Viele Grüße von <%= FoodSoft::getFoodcoopName %>
|
Viele Grüße von <%= APP_CONFIG[:name] %>
|
|
@ -5,10 +5,10 @@ Die Bestellung "<%= order.name %>" wurde am <%= order.ends.strftime('%d.%m.%Y um
|
||||||
Für deine Bestellgruppe <%= group.name %> wurden die folgenden Artikel bestellt:
|
Für deine Bestellgruppe <%= group.name %> wurden die folgenden Artikel bestellt:
|
||||||
<% for result in results
|
<% for result in results
|
||||||
article = result.order_article_result -%>
|
article = result.order_article_result -%>
|
||||||
<%= article.name %>: <%= result.quantity %> x <%= article.unit %> = <%= FoodSoft::format_currency(result.quantity * article.gross_price) %>
|
<%= article.name %>: <%= result.quantity %> x <%= article.unit %> = <%= result.quantity * article.gross_price %>
|
||||||
<% end -%>
|
<% end -%>
|
||||||
Gesamtpreis: <%= FoodSoft::format_currency(total) %>
|
Gesamtpreis: <%= total %>
|
||||||
|
|
||||||
Bestellung online einsehen: <%= ApplicationController.current.url_for(:controller => 'ordering', :action => 'my_order_result', :id => order.id) %>
|
Bestellung online einsehen: <%= ApplicationController.current.url_for(:controller => 'ordering', :action => 'my_order_result', :id => order.id) %>
|
||||||
|
|
||||||
Viele Grüße von <%= FoodSoft::getFoodcoopName %>
|
Viele Grüße von <%= APP_CONFIG[:name] %>
|
|
@ -125,7 +125,7 @@
|
||||||
<%= button_to_function('-', "decreaseTolerance(#{i})") %>
|
<%= button_to_function('-', "decreaseTolerance(#{i})") %>
|
||||||
<% end -%>
|
<% end -%>
|
||||||
</td>
|
</td>
|
||||||
<td id="td_price_<%= i %>" style="text-align:right; padding-right:10px; width:4em"><span id="price_<%= i %>_display"><%= number_to_currency(article_total, :unit => "") %></span> <%= FoodSoft::getCurrencyUnit %></td>
|
<td id="td_price_<%= i %>" style="text-align:right; padding-right:10px; width:4em"><span id="price_<%= i %>_display"><%= number_to_currency(article_total, :unit => "") %></span> <%= l18n.number.currency.format.unit %></td>
|
||||||
</tr>
|
</tr>
|
||||||
<% unless order_article.article.note.empty? -%>
|
<% unless order_article.article.note.empty? -%>
|
||||||
<tr id="note_<%= i %>" class="note" style="display:none">
|
<tr id="note_<%= i %>" class="note" style="display:none">
|
||||||
|
@ -139,7 +139,7 @@
|
||||||
<tfoot>
|
<tfoot>
|
||||||
<tr>
|
<tr>
|
||||||
<td colspan="6"></td>
|
<td colspan="6"></td>
|
||||||
<td colspan="3" class="currency"><%=_ "Total amount" %>: <span id="total_price"><%= total %></span> <%= FoodSoft::getCurrencyUnit %></td>
|
<td colspan="3" class="currency"><%=_ "Total amount" %>: <span id="total_price"><%= total %></span> <%= l18n.number.currency.format.unit %></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td colspan="6"></td>
|
<td colspan="6"></td>
|
||||||
|
@ -147,7 +147,7 @@
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td colspan="6"></td>
|
<td colspan="6"></td>
|
||||||
<td colspan="3" class="currency"><%=_ "New account balance"%>: <strong><span id="new_balance"><%= @order_group.account_balance - total %></span> <%= FoodSoft::getCurrencyUnit %></strong></td>
|
<td colspan="3" class="currency"><%=_ "New account balance"%>: <strong><span id="new_balance"><%= @order_group.account_balance - total %></span> <%= l18n.number.currency.format.unit %></strong></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td style="text-align:left;"><%= link_to_top %></td>
|
<td style="text-align:left;"><%= link_to_top %></td>
|
||||||
|
@ -171,7 +171,7 @@
|
||||||
setGroupBalance(<%= @availableFunds %>);
|
setGroupBalance(<%= @availableFunds %>);
|
||||||
|
|
||||||
// localization
|
// localization
|
||||||
setDecimalSeparator("<%= FoodSoft::getDecimalSeparator %>");
|
setDecimalSeparator("<%= l18n.number.currency.format.separator %>");
|
||||||
|
|
||||||
// initialize javascript
|
// initialize javascript
|
||||||
updateBalance();
|
updateBalance();
|
||||||
|
|
|
@ -20,7 +20,7 @@
|
||||||
@ends = @order.ends.strftime('%d.%m.%Y').to_s
|
@ends = @order.ends.strftime('%d.%m.%Y').to_s
|
||||||
@title = replace_UTF8(@order.name.to_s) + " | beendet am " + @ends
|
@title = replace_UTF8(@order.name.to_s) + " | beendet am " + @ends
|
||||||
|
|
||||||
pdf.SetAuthor(FoodSoft.getFoodcoopName)
|
pdf.SetAuthor(APP_CONFIG[:name])
|
||||||
pdf.SetTitle(replace_UTF8("Artikelsortierung für #{@order.name}, #{format_date(@order.ends)}"))
|
pdf.SetTitle(replace_UTF8("Artikelsortierung für #{@order.name}, #{format_date(@order.ends)}"))
|
||||||
pdf.AliasNbPages()
|
pdf.AliasNbPages()
|
||||||
pdf.AddPage()
|
pdf.AddPage()
|
||||||
|
|
|
@ -11,7 +11,7 @@
|
||||||
|
|
||||||
@order_articles = @order.order_article_results
|
@order_articles = @order.order_article_results
|
||||||
|
|
||||||
pdf.SetAuthor(replace_UTF8(FoodSoft.getFoodcoopName))
|
pdf.SetAuthor(replace_UTF8(APP_CONFIG[:name]))
|
||||||
pdf.SetTitle(replace_UTF8("BestellFAX für #{@order.supplier.name}"))
|
pdf.SetTitle(replace_UTF8("BestellFAX für #{@order.supplier.name}"))
|
||||||
pdf.AliasNbPages()
|
pdf.AliasNbPages()
|
||||||
pdf.AddPage()
|
pdf.AddPage()
|
||||||
|
@ -19,15 +19,15 @@
|
||||||
#the main informations
|
#the main informations
|
||||||
pdf.SetY(15)
|
pdf.SetY(15)
|
||||||
pdf.SetFont('Arial','',10)
|
pdf.SetFont('Arial','',10)
|
||||||
pdf.Cell(0,5,replace_UTF8(FoodSoft.getFoodcoopName),0,0,'R')
|
pdf.Cell(0,5,replace_UTF8(APP_CONFIG[:name]),0,0,'R')
|
||||||
pdf.Ln()
|
pdf.Ln()
|
||||||
pdf.Cell(0,5,replace_UTF8(FoodSoft.getFoodcoopContact[:street]),0,0,'R')
|
pdf.Cell(0,5,replace_UTF8(APP_CONFIG[:contact].symbolize_keys[:street]),0,0,'R')
|
||||||
pdf.Ln()
|
pdf.Ln()
|
||||||
pdf.Cell(0,5,FoodSoft.getFoodcoopContact[:zip_code] + " " + replace_UTF8(FoodSoft.getFoodcoopContact[:city]),0,0,'R')
|
pdf.Cell(0,5,APP_CONFIG[:contact].symbolize_keys[:zip_code] + " " + replace_UTF8(APP_CONFIG[:contact].symbolize_keys[:city]),0,0,'R')
|
||||||
pdf.Ln()
|
pdf.Ln()
|
||||||
pdf.Cell(0,5,replace_UTF8(FoodSoft.getFoodcoopName[:phone]),0,0,'R')
|
pdf.Cell(0,5,replace_UTF8(APP_CONFIG[:name][:phone]),0,0,'R')
|
||||||
pdf.Ln()
|
pdf.Ln()
|
||||||
pdf.Cell(0,5,replace_UTF8(FoodSoft.getFoodcoopName[:email]),0,0,'R')
|
pdf.Cell(0,5,replace_UTF8(APP_CONFIG[:name][:email]),0,0,'R')
|
||||||
pdf.Ln()
|
pdf.Ln()
|
||||||
pdf.Cell(0,5,Date.today.strftime('%d.%m.%Y').to_s,0,0,'R')
|
pdf.Cell(0,5,Date.today.strftime('%d.%m.%Y').to_s,0,0,'R')
|
||||||
pdf.Ln()
|
pdf.Ln()
|
||||||
|
|
|
@ -19,7 +19,7 @@
|
||||||
@ends = @order.ends.strftime('%d.%m.%Y').to_s
|
@ends = @order.ends.strftime('%d.%m.%Y').to_s
|
||||||
@title = replace_UTF8(@order.name.to_s) + " | beendet am " + @ends
|
@title = replace_UTF8(@order.name.to_s) + " | beendet am " + @ends
|
||||||
|
|
||||||
pdf.SetAuthor(FoodSoft.getFoodcoopName)
|
pdf.SetAuthor(APP_CONFIG[:name])
|
||||||
pdf.SetTitle(replace_UTF8("GruppenSortierung für #{@order.name}, #{format_date(@order.ends)}"))
|
pdf.SetTitle(replace_UTF8("GruppenSortierung für #{@order.name}, #{format_date(@order.ends)}"))
|
||||||
pdf.SetFillColor(235)
|
pdf.SetFillColor(235)
|
||||||
pdf.AliasNbPages()
|
pdf.AliasNbPages()
|
||||||
|
|
|
@ -18,7 +18,7 @@
|
||||||
MAX_ARTICLES_PER_PAGE = 15 #how many articles shoud written on a page
|
MAX_ARTICLES_PER_PAGE = 15 #how many articles shoud written on a page
|
||||||
|
|
||||||
pdf=PDF.new
|
pdf=PDF.new
|
||||||
pdf.SetAuthor(FoodSoft.getFoodcoopName)
|
pdf.SetAuthor(APP_CONFIG[:name])
|
||||||
@starts = @order.starts.strftime('%d.%m.%Y').to_s
|
@starts = @order.starts.strftime('%d.%m.%Y').to_s
|
||||||
@ends = @order.ends.strftime('%d.%m.%Y').to_s
|
@ends = @order.ends.strftime('%d.%m.%Y').to_s
|
||||||
@title = replace_UTF8(@order.name.to_s) + " | beendet am " + @ends
|
@title = replace_UTF8(@order.name.to_s) + " | beendet am " + @ends
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
%li
|
%li
|
||||||
= image_tag 'b_user.png' , :size => '7x10', :border => 0, :alt => _("User")
|
= image_tag 'b_user.png' , :size => '7x10', :border => 0, :alt => _("User")
|
||||||
= link_to h(@current_user.nick), { :controller => 'index', :action => 'myProfile' }, { :title => _("User Settings") }
|
= link_to h(@current_user.nick), { :controller => 'index', :action => 'myProfile' }, { :title => _("User Settings") }
|
||||||
- if FoodSoft::getFoodcoopUrl
|
- if APP_CONFIG[:base_url]
|
||||||
%li= link_to FoodSoft::getFoodcoopName, FoodSoft::getFoodcoopUrl, { :title => _("Go to your FoodCoop-Hompage") }
|
%li= link_to APP_CONFIG[:name], APP_CONFIG[:base_url], { :title => _("Go to your FoodCoop-Hompage") }
|
||||||
%li= link_to _("Help"), 'http://dev.foodcoops.net/wiki/FoodsoftDoku'
|
%li= link_to _("Help"), 'http://dev.foodcoops.net/wiki/FoodsoftDoku'
|
||||||
%li= link_to _("Logout"), :controller => '/login', :action => 'logout'
|
%li= link_to _("Logout"), :controller => '/login', :action => 'logout'
|
|
@ -1,4 +1,4 @@
|
||||||
--
|
--
|
||||||
FoodSoft: <%= @foodsoftUrl %>
|
FoodSoft: <%= @foodsoftUrl %>
|
||||||
Foodcoop-Homepage: <%= FoodSoft::getFoodcoopUrl %>
|
Foodcoop-Homepage: <%= APP_CONFIG[:base_url] %>
|
||||||
Hilfe/Help: <%= FoodSoft::getHelp %>
|
Hilfe/Help: <%= APP_CONFIG[:help_url] %>
|
58
config/app_config.yml.SAMPLE
Normal file
58
config/app_config.yml.SAMPLE
Normal file
|
@ -0,0 +1,58 @@
|
||||||
|
# Foodsoft configuration
|
||||||
|
|
||||||
|
development: &defaults
|
||||||
|
# name of this foodcoop
|
||||||
|
name: FC Test
|
||||||
|
# foodcoop contact information (used for FAX messages)
|
||||||
|
contact:
|
||||||
|
street: Grüne Straße 103
|
||||||
|
zip_code: "10997"
|
||||||
|
city: Berlin
|
||||||
|
country: Deutschland
|
||||||
|
email: foodsoft@myfoodcoop.org
|
||||||
|
phone: "030 323 23249"
|
||||||
|
# base URL for this installation
|
||||||
|
base_url: http://www.fctest.de
|
||||||
|
# foodsoft documentation URL
|
||||||
|
help_url: http://foodsoft.fcschinke09.de/trac/wiki/FoodsoftDoku
|
||||||
|
# price markup in percent
|
||||||
|
price_markup: 2.0
|
||||||
|
# email address to be used as sender
|
||||||
|
email_sender: foodsoft@myfoodcoop.org
|
||||||
|
|
||||||
|
# Config for the exception_notification plugin
|
||||||
|
notification:
|
||||||
|
error_recipients:
|
||||||
|
- benni@dresdener27.de
|
||||||
|
sender_address: FoodSoft Error <foodsoft@foodcoops.net>
|
||||||
|
email_prefix: "[FoodSoft]"
|
||||||
|
# Access to sharedLists, the external article-database
|
||||||
|
shared_lists:
|
||||||
|
adapter: mysql
|
||||||
|
host: localhost
|
||||||
|
database: sharedlists_development
|
||||||
|
username: root
|
||||||
|
password:
|
||||||
|
encoding: utf8
|
||||||
|
socket: /opt/lampp/var/mysql/mysql.sock
|
||||||
|
# auto-units-conversion
|
||||||
|
# this is used for automatic article-synchronization to handle different units
|
||||||
|
# e.g. when foodcoop-unit should be 500g and supplier-unit is 1kg
|
||||||
|
units:
|
||||||
|
KG: 1
|
||||||
|
1kg: 1
|
||||||
|
500g: 0.5
|
||||||
|
400g: 0.4
|
||||||
|
300g: 0.3
|
||||||
|
250g: 0.25
|
||||||
|
200g: 0.2
|
||||||
|
150g: 0.15
|
||||||
|
125g: 0.125
|
||||||
|
100g: 0.1
|
||||||
|
50g: 0.05
|
||||||
|
|
||||||
|
test:
|
||||||
|
<<: *defaults
|
||||||
|
|
||||||
|
production:
|
||||||
|
<<: *defaults
|
|
@ -67,7 +67,7 @@ module Rails
|
||||||
|
|
||||||
class << self
|
class << self
|
||||||
def rubygems_version
|
def rubygems_version
|
||||||
Gem::RubyGemsVersion if defined? Gem::RubyGemsVersion
|
Gem::RubyGemsVersion rescue nil
|
||||||
end
|
end
|
||||||
|
|
||||||
def gem_version
|
def gem_version
|
||||||
|
@ -82,14 +82,14 @@ module Rails
|
||||||
|
|
||||||
def load_rubygems
|
def load_rubygems
|
||||||
require 'rubygems'
|
require 'rubygems'
|
||||||
|
min_version = '1.3.1'
|
||||||
unless rubygems_version >= '0.9.4'
|
unless rubygems_version >= min_version
|
||||||
$stderr.puts %(Rails requires RubyGems >= 0.9.4 (you have #{rubygems_version}). Please `gem update --system` and try again.)
|
$stderr.puts %Q(Rails requires RubyGems >= #{min_version} (you have #{rubygems_version}). Please `gem update --system` and try again.)
|
||||||
exit 1
|
exit 1
|
||||||
end
|
end
|
||||||
|
|
||||||
rescue LoadError
|
rescue LoadError
|
||||||
$stderr.puts %(Rails requires RubyGems >= 0.9.4. Please install RubyGems and try again: http://rubygems.rubyforge.org)
|
$stderr.puts %Q(Rails requires RubyGems >= #{min_version}. Please install RubyGems and try again: http://rubygems.rubyforge.org)
|
||||||
exit 1
|
exit 1
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -5,25 +5,22 @@
|
||||||
# ENV['RAILS_ENV'] ||= 'production'
|
# ENV['RAILS_ENV'] ||= 'production'
|
||||||
|
|
||||||
# Specifies gem version of Rails to use when vendor/rails is not present
|
# Specifies gem version of Rails to use when vendor/rails is not present
|
||||||
RAILS_GEM_VERSION = '2.1.0' unless defined? RAILS_GEM_VERSION
|
RAILS_GEM_VERSION = '2.2.2' unless defined? RAILS_GEM_VERSION
|
||||||
|
|
||||||
# Bootstrap the Rails environment, frameworks, and default configuration
|
# Bootstrap the Rails environment, frameworks, and default configuration
|
||||||
require File.join(File.dirname(__FILE__), 'boot')
|
require File.join(File.dirname(__FILE__), 'boot')
|
||||||
|
|
||||||
# Need gettext for i18n
|
|
||||||
require 'gettext/rails'
|
|
||||||
|
|
||||||
# Loads the "FoodSoft" module and configuration:
|
|
||||||
require 'foodsoft'
|
|
||||||
|
|
||||||
Rails::Initializer.run do |config|
|
Rails::Initializer.run do |config|
|
||||||
# Settings in config/environments/* take precedence over those specified here
|
# Settings in config/environments/* take precedence over those specified here.
|
||||||
|
# Application configuration should go into files in config/initializers
|
||||||
|
# -- all .rb files in that directory are automatically loaded.
|
||||||
|
# See Rails::Configuration for more options.
|
||||||
|
|
||||||
# Skip frameworks you're not going to use (only works if using vendor/rails)
|
# Skip frameworks you're not going to use (only works if using vendor/rails)
|
||||||
# config.frameworks -= [ :action_web_service, :action_mailer ]
|
# config.frameworks -= [ :action_web_service, :action_mailer ]
|
||||||
|
|
||||||
# Only load the plugins named here, by default all plugins in vendor/plugins are loaded
|
# Only load the plugins named here, by default all plugins in vendor/plugins are loaded
|
||||||
# config.plugins = %W( exception_notification ssl_requirement )
|
# config.plugins = [ :exception_notification, :ssl_requirement, :all ]
|
||||||
|
|
||||||
# Add additional load paths for your own custom dirs
|
# Add additional load paths for your own custom dirs
|
||||||
# config.load_paths += %W( #{RAILS_ROOT}/extras )
|
# config.load_paths += %W( #{RAILS_ROOT}/extras )
|
||||||
|
@ -48,7 +45,7 @@ Rails::Initializer.run do |config|
|
||||||
# config.active_record.observers = :cacher, :garbage_collector
|
# config.active_record.observers = :cacher, :garbage_collector
|
||||||
|
|
||||||
# Make Active Record use UTC-base instead of local time
|
# Make Active Record use UTC-base instead of local time
|
||||||
# config.active_record.default_timezone = :utc
|
config.time_zone = 'UTC'
|
||||||
|
|
||||||
# Your secret key for verifying cookie session data integrity.
|
# Your secret key for verifying cookie session data integrity.
|
||||||
# If you change this key, all old sessions will become invalid!
|
# If you change this key, all old sessions will become invalid!
|
||||||
|
@ -56,42 +53,31 @@ Rails::Initializer.run do |config|
|
||||||
# no regular words or you'll be exposed to dictionary attacks.
|
# no regular words or you'll be exposed to dictionary attacks.
|
||||||
config.action_controller.session = {
|
config.action_controller.session = {
|
||||||
:session_key => '_foodsoft_session',
|
:session_key => '_foodsoft_session',
|
||||||
:secret => FoodSoft.get_session_secret
|
:secret => "dhjfuez47892nsl39fh83ham3jsdfjkh4879sdh"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Specify gems that this application depends on.
|
||||||
|
# They can then be installed with "rake gems:install" on new installations.
|
||||||
|
# You have to specify the :lib option for libraries, where the Gem name (sqlite3-ruby) differs from the file itself (sqlite3)
|
||||||
|
# config.gem "bj"
|
||||||
|
# config.gem "hpricot", :version => '0.6', :source => "http://code.whytheluckystiff.net"
|
||||||
|
# config.gem "sqlite3-ruby", :lib => "sqlite3"
|
||||||
|
# config.gem "aws-s3", :lib => "aws/s3"
|
||||||
|
#
|
||||||
|
# library for parsing/writing files from/to csv-file
|
||||||
|
config.gem "fastercsv"
|
||||||
|
|
||||||
|
# The internationalization framework can be changed to have another default locale (standard is :en) or more load paths.
|
||||||
|
# All files from config/locales/*.rb,yml are added automatically.
|
||||||
|
# config.i18n.load_path << Dir[File.join(RAILS_ROOT, 'my', 'locales', '*.{rb,yml}')]
|
||||||
|
config.i18n.default_locale = :de
|
||||||
|
|
||||||
# See Rails::Configuration for more options
|
# See Rails::Configuration for more options
|
||||||
end
|
end
|
||||||
|
|
||||||
# Add new inflection rules using the following format
|
|
||||||
# (all these examples are active by default):
|
|
||||||
# Inflector.inflections do |inflect|
|
|
||||||
# inflect.plural /^(ox)$/i, '\1en'
|
|
||||||
# inflect.singular /^(ox)en/i, '\1'
|
|
||||||
# inflect.irregular 'person', 'people'
|
|
||||||
# inflect.uncountable %w( fish sheep )decimal
|
|
||||||
# end
|
|
||||||
|
|
||||||
# Add new mime types for use in respond_to blocks:
|
|
||||||
# Mime::Type.register "text/richtext", :rtf
|
|
||||||
# Mime::Type.register "application/x-mobile", :mobile
|
|
||||||
|
|
||||||
# Include your application configuration below
|
|
||||||
|
|
||||||
# library for parsing/writing files from/to csv-file
|
|
||||||
# doc: http://fastercsv.rubyforge.org/
|
|
||||||
require 'faster_csv'
|
|
||||||
|
|
||||||
# Attention: Don't forget to set the locale through LocalizationSimplified plugin!
|
|
||||||
|
|
||||||
# Defines custom logging format.
|
# Defines custom logging format.
|
||||||
class Logger
|
#class Logger
|
||||||
def format_message(severity, timestamp, progname, msg)
|
# def format_message(severity, timestamp, progname, msg)
|
||||||
format("%s %-5.5s %s\n", timestamp.strftime('%H:%M:%S'), severity, msg)
|
# format("%s %-5.5s %s\n", timestamp.strftime('%H:%M:%S'), severity, msg)
|
||||||
end
|
# end
|
||||||
end
|
#end
|
||||||
|
|
||||||
# Configuration of the exception_notification plugin
|
|
||||||
# Mailadresses are set in config/foodsoft.yaml
|
|
||||||
ExceptionNotifier.exception_recipients = FoodSoft.get_notification_config[:error_recipients]
|
|
||||||
ExceptionNotifier.sender_address = FoodSoft.get_notification_config[:sender_address]
|
|
||||||
ExceptionNotifier.email_prefix = FoodSoft.get_notification_config[:email_prefix]
|
|
|
@ -4,6 +4,9 @@
|
||||||
# Code is not reloaded between requests
|
# Code is not reloaded between requests
|
||||||
config.cache_classes = true
|
config.cache_classes = true
|
||||||
|
|
||||||
|
# Enable threaded mode
|
||||||
|
# config.threadsafe!
|
||||||
|
|
||||||
# Use a different logger for distributed setups
|
# Use a different logger for distributed setups
|
||||||
# config.logger = SyslogLogger.new
|
# config.logger = SyslogLogger.new
|
||||||
config.log_level = :warn
|
config.log_level = :warn
|
||||||
|
@ -12,6 +15,9 @@ config.log_level = :warn
|
||||||
config.action_controller.consider_all_requests_local = false
|
config.action_controller.consider_all_requests_local = false
|
||||||
config.action_controller.perform_caching = true
|
config.action_controller.perform_caching = true
|
||||||
|
|
||||||
|
# Use a different cache store in production
|
||||||
|
# config.cache_store = :mem_cache_store
|
||||||
|
|
||||||
# Enable serving of images, stylesheets, and javascripts from an asset server
|
# Enable serving of images, stylesheets, and javascripts from an asset server
|
||||||
# config.action_controller.asset_host = "http://assets.example.com"
|
# config.action_controller.asset_host = "http://assets.example.com"
|
||||||
|
|
||||||
|
|
|
@ -27,8 +27,7 @@ test1:
|
||||||
email_sender: foodsoft@myfoodcoop.org
|
email_sender: foodsoft@myfoodcoop.org
|
||||||
|
|
||||||
# localized date/time formats
|
# localized date/time formats
|
||||||
date_format: %d.%m.%Y
|
|
||||||
time_format: %H:%M
|
|
||||||
|
|
||||||
|
|
||||||
#test2:
|
#test2:
|
||||||
|
@ -44,5 +43,3 @@ test1:
|
||||||
# help_url: http://foodsoft.fcschinke09.de/trac/wiki/FoodsoftDoku
|
# help_url: http://foodsoft.fcschinke09.de/trac/wiki/FoodsoftDoku
|
||||||
# price_markup: 1.0
|
# price_markup: 1.0
|
||||||
# email_sender: foodsoft@fctest2.org
|
# email_sender: foodsoft@fctest2.org
|
||||||
# date_format: %d.%m.%Y
|
|
||||||
# time_format: %H:%M
|
|
||||||
|
|
|
@ -1,38 +0,0 @@
|
||||||
# Foodsoft configuration
|
|
||||||
|
|
||||||
# Config for the exception_notification plugin
|
|
||||||
notification:
|
|
||||||
error_recipients:
|
|
||||||
- foo@bar.tld
|
|
||||||
sender_address: FoodSoft Error <foodsoft@foodcoops.net>
|
|
||||||
email_prefix: "[FoodSoft]"
|
|
||||||
|
|
||||||
# Access to sharedLists, the external article-database
|
|
||||||
shared_lists:
|
|
||||||
adapter: mysql
|
|
||||||
host: localhost
|
|
||||||
database: sharedLists_development
|
|
||||||
username: root
|
|
||||||
password:
|
|
||||||
encoding: utf8
|
|
||||||
socket: /opt/lampp/var/mysql/mysql.sock
|
|
||||||
|
|
||||||
# secret to generate an integrity hash for cookie session data
|
|
||||||
# the string should have at least 30 characters
|
|
||||||
session_secret: dhjfuez47892nsl39fh83ham3jsdfjkh4879sdh
|
|
||||||
|
|
||||||
# auto-units-conversion
|
|
||||||
# this is used for automatic article-synchronization to handle different units
|
|
||||||
# e.g. when foodcoop-unit should be 500g and supplier-unit is 1kg
|
|
||||||
units:
|
|
||||||
KG: 1
|
|
||||||
1kg: 1
|
|
||||||
500g: 0.5
|
|
||||||
400g: 0.4
|
|
||||||
300g: 0.3
|
|
||||||
250g: 0.25
|
|
||||||
200g: 0.2
|
|
||||||
150g: 0.15
|
|
||||||
125g: 0.125
|
|
||||||
100g: 0.1
|
|
||||||
50g: 0.05
|
|
12
config/initializers/extensions.rb
Normal file
12
config/initializers/extensions.rb
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
# extend the BigDecimal class
|
||||||
|
class String
|
||||||
|
|
||||||
|
# remove comma from decimal inputs
|
||||||
|
def self.delocalized_decimal(string)
|
||||||
|
if !string.blank? and string.is_a?(String)
|
||||||
|
BigDecimal.new(string.sub(',', '.'))
|
||||||
|
else
|
||||||
|
string
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
10
config/initializers/gettext_helper.rb
Normal file
10
config/initializers/gettext_helper.rb
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
# Remove this file, when every gettext-method <_("text to translate..")>
|
||||||
|
# is replaced by rails l18n method: l18n.name.name...
|
||||||
|
|
||||||
|
module ActionView
|
||||||
|
class Base
|
||||||
|
def _(text)
|
||||||
|
text
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
10
config/initializers/inflections.rb
Normal file
10
config/initializers/inflections.rb
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
# Be sure to restart your server when you modify this file.
|
||||||
|
|
||||||
|
# Add new inflection rules using the following format
|
||||||
|
# (all these examples are active by default):
|
||||||
|
# ActiveSupport::Inflector.inflections do |inflect|
|
||||||
|
# inflect.plural /^(ox)$/i, '\1en'
|
||||||
|
# inflect.singular /^(ox)en/i, '\1'
|
||||||
|
# inflect.irregular 'person', 'people'
|
||||||
|
# inflect.uncountable %w( fish sheep )
|
||||||
|
# end
|
9
config/initializers/load_app_config.rb
Normal file
9
config/initializers/load_app_config.rb
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
raw_config = File.read(RAILS_ROOT + "/config/app_config.yml")
|
||||||
|
APP_CONFIG = YAML.load(raw_config)[RAILS_ENV].symbolize_keys
|
||||||
|
|
||||||
|
|
||||||
|
# Configuration of the exception_notification plugin
|
||||||
|
# Mailadresses are set in config/foodsoft.yaml
|
||||||
|
ExceptionNotifier.exception_recipients = APP_CONFIG[:error_recipients]
|
||||||
|
ExceptionNotifier.sender_address = APP_CONFIG[:sender_address]
|
||||||
|
ExceptionNotifier.email_prefix = APP_CONFIG[:email_prefix]
|
5
config/initializers/mime_types.rb
Normal file
5
config/initializers/mime_types.rb
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
# Be sure to restart your server when you modify this file.
|
||||||
|
|
||||||
|
# Add new mime types for use in respond_to blocks:
|
||||||
|
# Mime::Type.register "text/richtext", :rtf
|
||||||
|
# Mime::Type.register_alias "text/html", :iphone
|
17
config/initializers/new_rails_defaults.rb
Normal file
17
config/initializers/new_rails_defaults.rb
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
# These settings change the behavior of Rails 2 apps and will be defaults
|
||||||
|
# for Rails 3. You can remove this initializer when Rails 3 is released.
|
||||||
|
|
||||||
|
if defined?(ActiveRecord)
|
||||||
|
# Include Active Record class name as root for JSON serialized output.
|
||||||
|
ActiveRecord::Base.include_root_in_json = true
|
||||||
|
|
||||||
|
# Store the full class name (including module namespace) in STI type column.
|
||||||
|
ActiveRecord::Base.store_full_sti_class = true
|
||||||
|
end
|
||||||
|
|
||||||
|
# Use ISO 8601 format for JSON serialized times and dates.
|
||||||
|
ActiveSupport.use_standard_json_time_format = true
|
||||||
|
|
||||||
|
# Don't escape HTML entities in JSON, leave that for the #json_escape helper.
|
||||||
|
# if you're including raw json in an HTML page.
|
||||||
|
ActiveSupport.escape_html_entities_in_json = false
|
125
config/locales/de.yml
Normal file
125
config/locales/de.yml
Normal file
|
@ -0,0 +1,125 @@
|
||||||
|
# German translations for Ruby on Rails
|
||||||
|
# by Clemens Kofler (clemens@railway.at)
|
||||||
|
|
||||||
|
de:
|
||||||
|
date:
|
||||||
|
formats:
|
||||||
|
default: "%d.%m.%Y"
|
||||||
|
short: "%e. %b"
|
||||||
|
long: "%e. %B %Y"
|
||||||
|
only_day: "%e"
|
||||||
|
|
||||||
|
day_names: [Sonntag, Montag, Dienstag, Mittwoch, Donnerstag, Freitag, Samstag]
|
||||||
|
abbr_day_names: [So, Mo, Di, Mi, Do, Fr, Sa]
|
||||||
|
month_names: [~, Januar, Februar, März, April, Mai, Juni, Juli, August, September, Oktober, November, Dezember]
|
||||||
|
abbr_month_names: [~, Jan, Feb, Mär, Apr, Mai, Jun, Jul, Aug, Sep, Okt, Nov, Dez]
|
||||||
|
order: [ :day, :month, :year ]
|
||||||
|
|
||||||
|
time:
|
||||||
|
formats:
|
||||||
|
default: "%A, %e. %B %Y, %H:%M Uhr"
|
||||||
|
short: "%e. %B, %H:%M Uhr"
|
||||||
|
long: "%A, %e. %B %Y, %H:%M Uhr"
|
||||||
|
time: "%H:%M"
|
||||||
|
|
||||||
|
am: "vormittags"
|
||||||
|
pm: "nachmittags"
|
||||||
|
|
||||||
|
datetime:
|
||||||
|
distance_in_words:
|
||||||
|
half_a_minute: 'eine halbe Minute'
|
||||||
|
less_than_x_seconds:
|
||||||
|
zero: 'weniger als 1 Sekunde'
|
||||||
|
one: 'weniger als 1 Sekunde'
|
||||||
|
other: 'weniger als {{count}} Sekunden'
|
||||||
|
x_seconds:
|
||||||
|
one: '1 Sekunde'
|
||||||
|
other: '{{count}} Sekunden'
|
||||||
|
less_than_x_minutes:
|
||||||
|
zero: 'weniger als 1 Minute'
|
||||||
|
one: 'weniger als eine Minute'
|
||||||
|
other: 'weniger als {{count}} Minuten'
|
||||||
|
x_minutes:
|
||||||
|
one: '1 Minute'
|
||||||
|
other: '{{count}} Minuten'
|
||||||
|
about_x_hours:
|
||||||
|
one: 'etwa 1 Stunde'
|
||||||
|
other: 'etwa {{count}} Stunden'
|
||||||
|
x_days:
|
||||||
|
one: '1 Tag'
|
||||||
|
other: '{{count}} Tage'
|
||||||
|
about_x_months:
|
||||||
|
one: 'etwa 1 Monat'
|
||||||
|
other: 'etwa {{count}} Monate'
|
||||||
|
x_months:
|
||||||
|
one: '1 Monat'
|
||||||
|
other: '{{count}} Monate'
|
||||||
|
about_x_years:
|
||||||
|
one: 'etwa 1 Jahr'
|
||||||
|
other: 'etwa {{count}} Jahre'
|
||||||
|
over_x_years:
|
||||||
|
one: 'mehr als 1 Jahr'
|
||||||
|
other: 'mehr als {{count}} Jahre'
|
||||||
|
|
||||||
|
number:
|
||||||
|
format:
|
||||||
|
precision: 2
|
||||||
|
separator: ','
|
||||||
|
delimiter: '.'
|
||||||
|
currency:
|
||||||
|
format:
|
||||||
|
unit: '€'
|
||||||
|
format: '%n %u'
|
||||||
|
separator:
|
||||||
|
delimiter:
|
||||||
|
precision:
|
||||||
|
percentage:
|
||||||
|
format:
|
||||||
|
delimiter: ""
|
||||||
|
precision:
|
||||||
|
format:
|
||||||
|
delimiter: ""
|
||||||
|
human:
|
||||||
|
format:
|
||||||
|
delimiter: ""
|
||||||
|
precision: 1
|
||||||
|
|
||||||
|
support:
|
||||||
|
array:
|
||||||
|
sentence_connector: "und"
|
||||||
|
skip_last_comma: true
|
||||||
|
|
||||||
|
activerecord:
|
||||||
|
errors:
|
||||||
|
template:
|
||||||
|
header:
|
||||||
|
one: "Konnte dieses {{model}} Objekt nicht speichern: 1 Fehler."
|
||||||
|
other: "Konnte dieses {{model}} Objekt nicht speichern: {{count}} Fehler."
|
||||||
|
body: "Bitte überprüfen Sie die folgenden Felder:"
|
||||||
|
|
||||||
|
messages:
|
||||||
|
inclusion: "ist kein gültiger Wert"
|
||||||
|
exclusion: "ist nicht verfügbar"
|
||||||
|
invalid: "ist nicht gültig"
|
||||||
|
confirmation: "stimmt nicht mit der Bestätigung überein"
|
||||||
|
accepted: "muss akzeptiert werden"
|
||||||
|
empty: "muss ausgefüllt werden"
|
||||||
|
blank: "muss ausgefüllt werden"
|
||||||
|
too_long: "ist zu lang (nicht mehr als {{count}} Zeichen)"
|
||||||
|
too_short: "ist zu kurz (nicht weniger als {{count}} Zeichen)"
|
||||||
|
wrong_length: "hat die falsche Länge (muss genau {{count}} Zeichen haben)"
|
||||||
|
taken: "ist bereits vergeben"
|
||||||
|
not_a_number: "ist keine Zahl"
|
||||||
|
greater_than: "muss größer als {{count}} sein"
|
||||||
|
greater_than_or_equal_to: "muss größer oder gleich {{count}} sein"
|
||||||
|
equal_to: "muss genau {{count}} sein"
|
||||||
|
less_than: "muss kleiner als {{count}} sein"
|
||||||
|
less_than_or_equal_to: "muss kleiner oder gleich {{count}} sein"
|
||||||
|
odd: "muss ungerade sein"
|
||||||
|
even: "muss gerade sein"
|
||||||
|
models:
|
||||||
|
article: Artikel
|
||||||
|
attributes:
|
||||||
|
article:
|
||||||
|
net_price: Nettopreis
|
||||||
|
gross_price: Bruttopreis
|
5
config/locales/en.yml
Normal file
5
config/locales/en.yml
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
# Sample localization file for English. Add more files in this directory for other locales.
|
||||||
|
# See http://github.com/svenfuchs/rails-i18n/tree/master/rails%2Flocale for starting points.
|
||||||
|
|
||||||
|
en:
|
||||||
|
hello: "Hello world"
|
|
@ -1,23 +1,46 @@
|
||||||
ActionController::Routing::Routes.draw do |map|
|
ActionController::Routing::Routes.draw do |map|
|
||||||
|
|
||||||
map.my_profile 'my_profile', :controller => 'index', :action => 'myProfile'
|
map.my_profile 'my_profile', :controller => 'index', :action => 'myProfile'
|
||||||
|
|
||||||
# The priority is based upon order of creation: first created -> highest priority.
|
# The priority is based upon order of creation: first created -> highest priority.
|
||||||
|
|
||||||
# Sample of regular route:
|
# Sample of regular route:
|
||||||
# map.connect 'products/:id', :controller => 'catalog', :action => 'view'
|
# map.connect 'products/:id', :controller => 'catalog', :action => 'view'
|
||||||
# Keep in mind you can assign values other than :controller and :action
|
# Keep in mind you can assign values other than :controller and :action
|
||||||
|
|
||||||
# Sample of named route:
|
# Sample of named route:
|
||||||
# map.purchase 'products/:id/purchase', :controller => 'catalog', :action => 'purchase'
|
# map.purchase 'products/:id/purchase', :controller => 'catalog', :action => 'purchase'
|
||||||
# This route can be invoked with purchase_url(:id => product.id)
|
# This route can be invoked with purchase_url(:id => product.id)
|
||||||
|
|
||||||
# You can have the root of your site routed by hooking up ''
|
# Sample resource route (maps HTTP verbs to controller actions automatically):
|
||||||
# -- just remember to delete public/index.html.
|
# map.resources :products
|
||||||
#map.connect '', :controller => 'login'
|
|
||||||
|
|
||||||
# Allow downloading Web Service WSDL as a file with an extension
|
# Sample resource route with options:
|
||||||
# instead of a file named 'wsdl'
|
# map.resources :products, :member => { :short => :get, :toggle => :post }, :collection => { :sold => :get }
|
||||||
map.connect ':controller/service.wsdl', :action => 'wsdl'
|
|
||||||
|
# Sample resource route with sub-resources:
|
||||||
|
# map.resources :products, :has_many => [ :comments, :sales ], :has_one => :seller
|
||||||
|
|
||||||
|
# Sample resource route with more complex sub-resources
|
||||||
|
# map.resources :products do |products|
|
||||||
|
# products.resources :comments
|
||||||
|
# products.resources :sales, :collection => { :recent => :get }
|
||||||
|
# end
|
||||||
|
|
||||||
|
# Sample resource route within a namespace:
|
||||||
|
# map.namespace :admin do |admin|
|
||||||
|
# # Directs /admin/products/* to Admin::ProductsController (app/controllers/admin/products_controller.rb)
|
||||||
|
# admin.resources :products
|
||||||
|
# end
|
||||||
|
|
||||||
|
# You can have the root of your site routed with map.root -- just remember to delete public/index.html.
|
||||||
|
# map.root :controller => "welcome"
|
||||||
|
|
||||||
|
# See how all your routes lay out with "rake routes"
|
||||||
|
|
||||||
|
# Install the default routes as the lowest priority.
|
||||||
|
# Note: These default routes make all actions in every controller accessible via GET requests. You should
|
||||||
|
# consider removing the them or commenting them out if you're using named routes and resources.
|
||||||
|
|
||||||
# Install the default route as the lowest priority.
|
# Install the default route as the lowest priority.
|
||||||
map.connect ':controller/:action/:id', :controller => 'index'
|
map.connect ':controller/:action/:id', :controller => 'index'
|
||||||
|
|
183
lib/foodsoft.rb
183
lib/foodsoft.rb
|
@ -1,183 +0,0 @@
|
||||||
require 'yaml'
|
|
||||||
|
|
||||||
# General FoodSoft module for application configuration and global methods.
|
|
||||||
#
|
|
||||||
# This library needs to be loaded in environment.rb through <code>require 'foodsoft'</code>.
|
|
||||||
#
|
|
||||||
module FoodSoft
|
|
||||||
private
|
|
||||||
@@foodcoops = Hash.new
|
|
||||||
@@database = Hash.new
|
|
||||||
@@foodsoft = Hash.new
|
|
||||||
@@subdomain = String.new
|
|
||||||
|
|
||||||
public
|
|
||||||
|
|
||||||
# Loads the configuration file config/foodsoft.yml, ..foodcoops.yml and ..database.yml
|
|
||||||
def self.load_configuration
|
|
||||||
# load foodcoops-config
|
|
||||||
@@foodcoops = YAML::load(File.open("#{RAILS_ROOT}/config/foodcoops.yml"))
|
|
||||||
|
|
||||||
# load database-config
|
|
||||||
@@database = YAML::load(File.open("#{RAILS_ROOT}/config/database.yml"))
|
|
||||||
|
|
||||||
# load foodsoft-config
|
|
||||||
@@foodsoft = YAML::load(File.open("#{RAILS_ROOT}/config/foodsoft.yml")).symbolize_keys
|
|
||||||
|
|
||||||
# validates the parsed data
|
|
||||||
self.validate
|
|
||||||
rescue => e
|
|
||||||
# raise "Failed to load configuration files: #{e.message}"
|
|
||||||
end
|
|
||||||
|
|
||||||
|
|
||||||
def self.subdomain=(subdomain)
|
|
||||||
@@subdomain = subdomain
|
|
||||||
end
|
|
||||||
|
|
||||||
def self.subdomain
|
|
||||||
return @@subdomain
|
|
||||||
end
|
|
||||||
|
|
||||||
def self.format_time(time = Time.now)
|
|
||||||
raise "FoodSoft::time_format has not been set!" unless @@foodcoops[subdomain]["time_format"]
|
|
||||||
time.strftime(@@foodcoops[subdomain]["time_format"]) unless time.nil?
|
|
||||||
end
|
|
||||||
|
|
||||||
def self.format_date(date = Time.now)
|
|
||||||
raise "FoodSoft: date_format has not been set!" unless @@foodcoops[subdomain]["date_format"]
|
|
||||||
date.strftime(@@foodcoops[subdomain]["date_format"]) unless date.nil?
|
|
||||||
end
|
|
||||||
|
|
||||||
def self.format_date_time(time = Time.now)
|
|
||||||
"#{format_date(time)} #{format_time(time)}" unless time.nil?
|
|
||||||
end
|
|
||||||
|
|
||||||
def self.format_currency(decimal)
|
|
||||||
"#{self.getCurrencyUnit} %01.2f" % decimal
|
|
||||||
end
|
|
||||||
|
|
||||||
# Returns the set host, otherwise returns nil
|
|
||||||
def self.getHost
|
|
||||||
return @@foodcoops[subdomain]["host"]
|
|
||||||
end
|
|
||||||
|
|
||||||
def self.getFoodcoopName
|
|
||||||
raise 'foodcoopName has not been set!' unless @@foodcoops[subdomain]["name"]
|
|
||||||
return @@foodcoops[subdomain]["name"]
|
|
||||||
end
|
|
||||||
|
|
||||||
def self.getFoodcoopContact
|
|
||||||
raise "contact has not been set!" unless @@foodcoops[subdomain]["contact"]
|
|
||||||
return @@foodcoops[subdomain]["contact"].symbolize_keys
|
|
||||||
end
|
|
||||||
|
|
||||||
def self.getFoodcoopUrl
|
|
||||||
return @@foodcoops[subdomain]["base_url"]
|
|
||||||
end
|
|
||||||
|
|
||||||
def self.getHelp
|
|
||||||
raise 'foodsoftHelp has not been set!' unless @@foodcoops[subdomain]["help_url"]
|
|
||||||
return @@foodcoops[subdomain]["help_url"]
|
|
||||||
end
|
|
||||||
|
|
||||||
# Returns the email sender used for system emails.
|
|
||||||
def self.getEmailSender
|
|
||||||
raise 'FoodSoft::emailSender has not been set!' unless @@foodcoops[subdomain]["email_sender"]
|
|
||||||
return @@foodcoops[subdomain]["email_sender"]
|
|
||||||
end
|
|
||||||
|
|
||||||
# Returns the price markup.
|
|
||||||
def self.getPriceMarkup
|
|
||||||
raise "FoodSoft::priceMarkup has not been set!" unless @@foodcoops[subdomain]["price_markup"]
|
|
||||||
return @@foodcoops[subdomain]["price_markup"]
|
|
||||||
end
|
|
||||||
|
|
||||||
# Returns the local decimal separator.
|
|
||||||
def self.getDecimalSeparator
|
|
||||||
if (separator = LocalizationSimplified::NumberHelper::CurrencyOptions[:separator])
|
|
||||||
return separator
|
|
||||||
else
|
|
||||||
logger.warn('No locale configured through plugin LocalizationSimplified')
|
|
||||||
return '.'
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
# Returns the local currency unit.
|
|
||||||
def self.getCurrencyUnit
|
|
||||||
if (unit = LocalizationSimplified::NumberHelper::CurrencyOptions[:unit])
|
|
||||||
return unit
|
|
||||||
else
|
|
||||||
logger.warn('No locale configured through plugin LocalizationSimplified')
|
|
||||||
return '$'
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
# Returns the delocalized version of the string, i.e. with the decimal separator local character properly replaced.
|
|
||||||
# For example, for the locale "de-DE", the comma character "," will be replaced with the standard separator ".".
|
|
||||||
def self.delocalizeDecimalString(string)
|
|
||||||
if (string && string.is_a?(String) && !string.empty?)
|
|
||||||
separator = getDecimalSeparator
|
|
||||||
if (separator != '.' && string.index(separator))
|
|
||||||
string = string.sub(separator, '.')
|
|
||||||
end
|
|
||||||
end
|
|
||||||
return string
|
|
||||||
end
|
|
||||||
|
|
||||||
# Return the specific database
|
|
||||||
def self.get_database
|
|
||||||
raise 'databse for foodcoop has not been set' unless @@database[subdomain]
|
|
||||||
return @@database[subdomain]
|
|
||||||
end
|
|
||||||
|
|
||||||
# Foodsoft-Config begins
|
|
||||||
|
|
||||||
# Returns an array with mail-adresses for the exception_notification plugin
|
|
||||||
def self.get_notification_config
|
|
||||||
raise 'FoodSoft::errorRecipients has not been set!' unless @@foodsoft[:notification]
|
|
||||||
return @@foodsoft[:notification].symbolize_keys
|
|
||||||
end
|
|
||||||
|
|
||||||
# returns shared_lists database connection
|
|
||||||
def self.get_shared_lists_config
|
|
||||||
raise "sharedLists database config has not been set" unless @@foodsoft[:shared_lists]
|
|
||||||
return @@foodsoft[:shared_lists]
|
|
||||||
end
|
|
||||||
|
|
||||||
# returns a string for an integrity hash for cookie session data
|
|
||||||
def self.get_session_secret
|
|
||||||
raise "session secret string has not been set" unless @@foodsoft[:session_secret]
|
|
||||||
return @@foodsoft[:session_secret]
|
|
||||||
end
|
|
||||||
|
|
||||||
# returns units-hash for automatic units-conversion
|
|
||||||
# this hash looks like {"KG" => 1, "500g" => 0.5, ...}
|
|
||||||
def self.get_units_factors
|
|
||||||
raise "units has not been set" unless @@foodsoft[:units]
|
|
||||||
@@foodsoft[:units]
|
|
||||||
end
|
|
||||||
|
|
||||||
# validates the yaml-parsed-config-file
|
|
||||||
def self.validate
|
|
||||||
raise "Price markup is not a proper float. please use at least one decimal place" unless @@foodcoops.each {|fc| fc["price_markup"].is_a?(Float)}
|
|
||||||
raise "Error recipients aren't set correctly. use hyphen for each recipient" unless @@foodsoft[:error_recipients].is_a?(Array)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
# Automatically load configuration file:
|
|
||||||
FoodSoft::load_configuration
|
|
||||||
|
|
||||||
# Makes "number_to_percentage" locale aware.
|
|
||||||
module ActionView
|
|
||||||
module Helpers
|
|
||||||
module NumberHelper
|
|
||||||
alias_method :foodsoft_old_number_to_percentage, :number_to_percentage
|
|
||||||
|
|
||||||
# Returns the number in the localized percentage format.
|
|
||||||
def number_to_percentage(number, options = {})
|
|
||||||
foodsoft_old_number_to_percentage(number, :precision => 1, :separator => FoodSoft::getDecimalSeparator)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
Binary file not shown.
1978
po/de/foodsoft.po
1978
po/de/foodsoft.po
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
1911
po/foodsoft.pot
1911
po/foodsoft.pot
File diff suppressed because it is too large
Load diff
144
public/javascripts/controls.js
vendored
144
public/javascripts/controls.js
vendored
|
@ -1,22 +1,22 @@
|
||||||
// Copyright (c) 2005-2008 Thomas Fuchs (http://script.aculo.us, http://mir.aculo.us)
|
// Copyright (c) 2005-2008 Thomas Fuchs (http://script.aculo.us, http://mir.aculo.us)
|
||||||
// (c) 2005-2007 Ivan Krstic (http://blogs.law.harvard.edu/ivan)
|
// (c) 2005-2008 Ivan Krstic (http://blogs.law.harvard.edu/ivan)
|
||||||
// (c) 2005-2007 Jon Tirsen (http://www.tirsen.com)
|
// (c) 2005-2008 Jon Tirsen (http://www.tirsen.com)
|
||||||
// Contributors:
|
// Contributors:
|
||||||
// Richard Livsey
|
// Richard Livsey
|
||||||
// Rahul Bhargava
|
// Rahul Bhargava
|
||||||
// Rob Wills
|
// Rob Wills
|
||||||
//
|
//
|
||||||
// script.aculo.us is freely distributable under the terms of an MIT-style license.
|
// script.aculo.us is freely distributable under the terms of an MIT-style license.
|
||||||
// For details, see the script.aculo.us web site: http://script.aculo.us/
|
// For details, see the script.aculo.us web site: http://script.aculo.us/
|
||||||
|
|
||||||
// Autocompleter.Base handles all the autocompletion functionality
|
// Autocompleter.Base handles all the autocompletion functionality
|
||||||
// that's independent of the data source for autocompletion. This
|
// that's independent of the data source for autocompletion. This
|
||||||
// includes drawing the autocompletion menu, observing keyboard
|
// includes drawing the autocompletion menu, observing keyboard
|
||||||
// and mouse events, and similar.
|
// and mouse events, and similar.
|
||||||
//
|
//
|
||||||
// Specific autocompleters need to provide, at the very least,
|
// Specific autocompleters need to provide, at the very least,
|
||||||
// a getUpdatedChoices function that will be invoked every time
|
// a getUpdatedChoices function that will be invoked every time
|
||||||
// the text inside the monitored textbox changes. This method
|
// the text inside the monitored textbox changes. This method
|
||||||
// should get the text for which to provide autocompletion by
|
// should get the text for which to provide autocompletion by
|
||||||
// invoking this.getToken(), NOT by directly accessing
|
// invoking this.getToken(), NOT by directly accessing
|
||||||
// this.element.value. This is to allow incremental tokenized
|
// this.element.value. This is to allow incremental tokenized
|
||||||
|
@ -30,23 +30,23 @@
|
||||||
// will incrementally autocomplete with a comma as the token.
|
// will incrementally autocomplete with a comma as the token.
|
||||||
// Additionally, ',' in the above example can be replaced with
|
// Additionally, ',' in the above example can be replaced with
|
||||||
// a token array, e.g. { tokens: [',', '\n'] } which
|
// a token array, e.g. { tokens: [',', '\n'] } which
|
||||||
// enables autocompletion on multiple tokens. This is most
|
// enables autocompletion on multiple tokens. This is most
|
||||||
// useful when one of the tokens is \n (a newline), as it
|
// useful when one of the tokens is \n (a newline), as it
|
||||||
// allows smart autocompletion after linebreaks.
|
// allows smart autocompletion after linebreaks.
|
||||||
|
|
||||||
if(typeof Effect == 'undefined')
|
if(typeof Effect == 'undefined')
|
||||||
throw("controls.js requires including script.aculo.us' effects.js library");
|
throw("controls.js requires including script.aculo.us' effects.js library");
|
||||||
|
|
||||||
var Autocompleter = { }
|
var Autocompleter = { };
|
||||||
Autocompleter.Base = Class.create({
|
Autocompleter.Base = Class.create({
|
||||||
baseInitialize: function(element, update, options) {
|
baseInitialize: function(element, update, options) {
|
||||||
element = $(element)
|
element = $(element);
|
||||||
this.element = element;
|
this.element = element;
|
||||||
this.update = $(update);
|
this.update = $(update);
|
||||||
this.hasFocus = false;
|
this.hasFocus = false;
|
||||||
this.changed = false;
|
this.changed = false;
|
||||||
this.active = false;
|
this.active = false;
|
||||||
this.index = 0;
|
this.index = 0;
|
||||||
this.entryCount = 0;
|
this.entryCount = 0;
|
||||||
this.oldElementValue = this.element.value;
|
this.oldElementValue = this.element.value;
|
||||||
|
|
||||||
|
@ -59,28 +59,28 @@ Autocompleter.Base = Class.create({
|
||||||
this.options.tokens = this.options.tokens || [];
|
this.options.tokens = this.options.tokens || [];
|
||||||
this.options.frequency = this.options.frequency || 0.4;
|
this.options.frequency = this.options.frequency || 0.4;
|
||||||
this.options.minChars = this.options.minChars || 1;
|
this.options.minChars = this.options.minChars || 1;
|
||||||
this.options.onShow = this.options.onShow ||
|
this.options.onShow = this.options.onShow ||
|
||||||
function(element, update){
|
function(element, update){
|
||||||
if(!update.style.position || update.style.position=='absolute') {
|
if(!update.style.position || update.style.position=='absolute') {
|
||||||
update.style.position = 'absolute';
|
update.style.position = 'absolute';
|
||||||
Position.clone(element, update, {
|
Position.clone(element, update, {
|
||||||
setHeight: false,
|
setHeight: false,
|
||||||
offsetTop: element.offsetHeight
|
offsetTop: element.offsetHeight
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
Effect.Appear(update,{duration:0.15});
|
Effect.Appear(update,{duration:0.15});
|
||||||
};
|
};
|
||||||
this.options.onHide = this.options.onHide ||
|
this.options.onHide = this.options.onHide ||
|
||||||
function(element, update){ new Effect.Fade(update,{duration:0.15}) };
|
function(element, update){ new Effect.Fade(update,{duration:0.15}) };
|
||||||
|
|
||||||
if(typeof(this.options.tokens) == 'string')
|
if(typeof(this.options.tokens) == 'string')
|
||||||
this.options.tokens = new Array(this.options.tokens);
|
this.options.tokens = new Array(this.options.tokens);
|
||||||
// Force carriage returns as token delimiters anyway
|
// Force carriage returns as token delimiters anyway
|
||||||
if (!this.options.tokens.include('\n'))
|
if (!this.options.tokens.include('\n'))
|
||||||
this.options.tokens.push('\n');
|
this.options.tokens.push('\n');
|
||||||
|
|
||||||
this.observer = null;
|
this.observer = null;
|
||||||
|
|
||||||
this.element.setAttribute('autocomplete','off');
|
this.element.setAttribute('autocomplete','off');
|
||||||
|
|
||||||
Element.hide(this.update);
|
Element.hide(this.update);
|
||||||
|
@ -91,10 +91,10 @@ Autocompleter.Base = Class.create({
|
||||||
|
|
||||||
show: function() {
|
show: function() {
|
||||||
if(Element.getStyle(this.update, 'display')=='none') this.options.onShow(this.element, this.update);
|
if(Element.getStyle(this.update, 'display')=='none') this.options.onShow(this.element, this.update);
|
||||||
if(!this.iefix &&
|
if(!this.iefix &&
|
||||||
(Prototype.Browser.IE) &&
|
(Prototype.Browser.IE) &&
|
||||||
(Element.getStyle(this.update, 'position')=='absolute')) {
|
(Element.getStyle(this.update, 'position')=='absolute')) {
|
||||||
new Insertion.After(this.update,
|
new Insertion.After(this.update,
|
||||||
'<iframe id="' + this.update.id + '_iefix" '+
|
'<iframe id="' + this.update.id + '_iefix" '+
|
||||||
'style="display:none;position:absolute;filter:progid:DXImageTransform.Microsoft.Alpha(opacity=0);" ' +
|
'style="display:none;position:absolute;filter:progid:DXImageTransform.Microsoft.Alpha(opacity=0);" ' +
|
||||||
'src="javascript:false;" frameborder="0" scrolling="no"></iframe>');
|
'src="javascript:false;" frameborder="0" scrolling="no"></iframe>');
|
||||||
|
@ -102,7 +102,7 @@ Autocompleter.Base = Class.create({
|
||||||
}
|
}
|
||||||
if(this.iefix) setTimeout(this.fixIEOverlapping.bind(this), 50);
|
if(this.iefix) setTimeout(this.fixIEOverlapping.bind(this), 50);
|
||||||
},
|
},
|
||||||
|
|
||||||
fixIEOverlapping: function() {
|
fixIEOverlapping: function() {
|
||||||
Position.clone(this.update, this.iefix, {setTop:(!this.update.style.height)});
|
Position.clone(this.update, this.iefix, {setTop:(!this.update.style.height)});
|
||||||
this.iefix.style.zIndex = 1;
|
this.iefix.style.zIndex = 1;
|
||||||
|
@ -150,15 +150,15 @@ Autocompleter.Base = Class.create({
|
||||||
Event.stop(event);
|
Event.stop(event);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
if(event.keyCode==Event.KEY_TAB || event.keyCode==Event.KEY_RETURN ||
|
if(event.keyCode==Event.KEY_TAB || event.keyCode==Event.KEY_RETURN ||
|
||||||
(Prototype.Browser.WebKit > 0 && event.keyCode == 0)) return;
|
(Prototype.Browser.WebKit > 0 && event.keyCode == 0)) return;
|
||||||
|
|
||||||
this.changed = true;
|
this.changed = true;
|
||||||
this.hasFocus = true;
|
this.hasFocus = true;
|
||||||
|
|
||||||
if(this.observer) clearTimeout(this.observer);
|
if(this.observer) clearTimeout(this.observer);
|
||||||
this.observer =
|
this.observer =
|
||||||
setTimeout(this.onObserverEvent.bind(this), this.options.frequency*1000);
|
setTimeout(this.onObserverEvent.bind(this), this.options.frequency*1000);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -170,35 +170,35 @@ Autocompleter.Base = Class.create({
|
||||||
|
|
||||||
onHover: function(event) {
|
onHover: function(event) {
|
||||||
var element = Event.findElement(event, 'LI');
|
var element = Event.findElement(event, 'LI');
|
||||||
if(this.index != element.autocompleteIndex)
|
if(this.index != element.autocompleteIndex)
|
||||||
{
|
{
|
||||||
this.index = element.autocompleteIndex;
|
this.index = element.autocompleteIndex;
|
||||||
this.render();
|
this.render();
|
||||||
}
|
}
|
||||||
Event.stop(event);
|
Event.stop(event);
|
||||||
},
|
},
|
||||||
|
|
||||||
onClick: function(event) {
|
onClick: function(event) {
|
||||||
var element = Event.findElement(event, 'LI');
|
var element = Event.findElement(event, 'LI');
|
||||||
this.index = element.autocompleteIndex;
|
this.index = element.autocompleteIndex;
|
||||||
this.selectEntry();
|
this.selectEntry();
|
||||||
this.hide();
|
this.hide();
|
||||||
},
|
},
|
||||||
|
|
||||||
onBlur: function(event) {
|
onBlur: function(event) {
|
||||||
// needed to make click events working
|
// needed to make click events working
|
||||||
setTimeout(this.hide.bind(this), 250);
|
setTimeout(this.hide.bind(this), 250);
|
||||||
this.hasFocus = false;
|
this.hasFocus = false;
|
||||||
this.active = false;
|
this.active = false;
|
||||||
},
|
},
|
||||||
|
|
||||||
render: function() {
|
render: function() {
|
||||||
if(this.entryCount > 0) {
|
if(this.entryCount > 0) {
|
||||||
for (var i = 0; i < this.entryCount; i++)
|
for (var i = 0; i < this.entryCount; i++)
|
||||||
this.index==i ?
|
this.index==i ?
|
||||||
Element.addClassName(this.getEntry(i),"selected") :
|
Element.addClassName(this.getEntry(i),"selected") :
|
||||||
Element.removeClassName(this.getEntry(i),"selected");
|
Element.removeClassName(this.getEntry(i),"selected");
|
||||||
if(this.hasFocus) {
|
if(this.hasFocus) {
|
||||||
this.show();
|
this.show();
|
||||||
this.active = true;
|
this.active = true;
|
||||||
}
|
}
|
||||||
|
@ -207,27 +207,27 @@ Autocompleter.Base = Class.create({
|
||||||
this.hide();
|
this.hide();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
markPrevious: function() {
|
markPrevious: function() {
|
||||||
if(this.index > 0) this.index--
|
if(this.index > 0) this.index--;
|
||||||
else this.index = this.entryCount-1;
|
else this.index = this.entryCount-1;
|
||||||
this.getEntry(this.index).scrollIntoView(true);
|
this.getEntry(this.index).scrollIntoView(true);
|
||||||
},
|
},
|
||||||
|
|
||||||
markNext: function() {
|
markNext: function() {
|
||||||
if(this.index < this.entryCount-1) this.index++
|
if(this.index < this.entryCount-1) this.index++;
|
||||||
else this.index = 0;
|
else this.index = 0;
|
||||||
this.getEntry(this.index).scrollIntoView(false);
|
this.getEntry(this.index).scrollIntoView(false);
|
||||||
},
|
},
|
||||||
|
|
||||||
getEntry: function(index) {
|
getEntry: function(index) {
|
||||||
return this.update.firstChild.childNodes[index];
|
return this.update.firstChild.childNodes[index];
|
||||||
},
|
},
|
||||||
|
|
||||||
getCurrentEntry: function() {
|
getCurrentEntry: function() {
|
||||||
return this.getEntry(this.index);
|
return this.getEntry(this.index);
|
||||||
},
|
},
|
||||||
|
|
||||||
selectEntry: function() {
|
selectEntry: function() {
|
||||||
this.active = false;
|
this.active = false;
|
||||||
this.updateElement(this.getCurrentEntry());
|
this.updateElement(this.getCurrentEntry());
|
||||||
|
@ -244,7 +244,7 @@ Autocompleter.Base = Class.create({
|
||||||
if(nodes.length>0) value = Element.collectTextNodes(nodes[0], this.options.select);
|
if(nodes.length>0) value = Element.collectTextNodes(nodes[0], this.options.select);
|
||||||
} else
|
} else
|
||||||
value = Element.collectTextNodesIgnoreClass(selectedElement, 'informal');
|
value = Element.collectTextNodesIgnoreClass(selectedElement, 'informal');
|
||||||
|
|
||||||
var bounds = this.getTokenBounds();
|
var bounds = this.getTokenBounds();
|
||||||
if (bounds[0] != -1) {
|
if (bounds[0] != -1) {
|
||||||
var newValue = this.element.value.substr(0, bounds[0]);
|
var newValue = this.element.value.substr(0, bounds[0]);
|
||||||
|
@ -257,7 +257,7 @@ Autocompleter.Base = Class.create({
|
||||||
}
|
}
|
||||||
this.oldElementValue = this.element.value;
|
this.oldElementValue = this.element.value;
|
||||||
this.element.focus();
|
this.element.focus();
|
||||||
|
|
||||||
if (this.options.afterUpdateElement)
|
if (this.options.afterUpdateElement)
|
||||||
this.options.afterUpdateElement(this.element, selectedElement);
|
this.options.afterUpdateElement(this.element, selectedElement);
|
||||||
},
|
},
|
||||||
|
@ -269,20 +269,20 @@ Autocompleter.Base = Class.create({
|
||||||
Element.cleanWhitespace(this.update.down());
|
Element.cleanWhitespace(this.update.down());
|
||||||
|
|
||||||
if(this.update.firstChild && this.update.down().childNodes) {
|
if(this.update.firstChild && this.update.down().childNodes) {
|
||||||
this.entryCount =
|
this.entryCount =
|
||||||
this.update.down().childNodes.length;
|
this.update.down().childNodes.length;
|
||||||
for (var i = 0; i < this.entryCount; i++) {
|
for (var i = 0; i < this.entryCount; i++) {
|
||||||
var entry = this.getEntry(i);
|
var entry = this.getEntry(i);
|
||||||
entry.autocompleteIndex = i;
|
entry.autocompleteIndex = i;
|
||||||
this.addObservers(entry);
|
this.addObservers(entry);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
this.entryCount = 0;
|
this.entryCount = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
this.stopIndicator();
|
this.stopIndicator();
|
||||||
this.index = 0;
|
this.index = 0;
|
||||||
|
|
||||||
if(this.entryCount==1 && this.options.autoSelect) {
|
if(this.entryCount==1 && this.options.autoSelect) {
|
||||||
this.selectEntry();
|
this.selectEntry();
|
||||||
this.hide();
|
this.hide();
|
||||||
|
@ -298,7 +298,7 @@ Autocompleter.Base = Class.create({
|
||||||
},
|
},
|
||||||
|
|
||||||
onObserverEvent: function() {
|
onObserverEvent: function() {
|
||||||
this.changed = false;
|
this.changed = false;
|
||||||
this.tokenBounds = null;
|
this.tokenBounds = null;
|
||||||
if(this.getToken().length>=this.options.minChars) {
|
if(this.getToken().length>=this.options.minChars) {
|
||||||
this.getUpdatedChoices();
|
this.getUpdatedChoices();
|
||||||
|
@ -351,16 +351,16 @@ Ajax.Autocompleter = Class.create(Autocompleter.Base, {
|
||||||
|
|
||||||
getUpdatedChoices: function() {
|
getUpdatedChoices: function() {
|
||||||
this.startIndicator();
|
this.startIndicator();
|
||||||
|
|
||||||
var entry = encodeURIComponent(this.options.paramName) + '=' +
|
var entry = encodeURIComponent(this.options.paramName) + '=' +
|
||||||
encodeURIComponent(this.getToken());
|
encodeURIComponent(this.getToken());
|
||||||
|
|
||||||
this.options.parameters = this.options.callback ?
|
this.options.parameters = this.options.callback ?
|
||||||
this.options.callback(this.element, entry) : entry;
|
this.options.callback(this.element, entry) : entry;
|
||||||
|
|
||||||
if(this.options.defaultParams)
|
if(this.options.defaultParams)
|
||||||
this.options.parameters += '&' + this.options.defaultParams;
|
this.options.parameters += '&' + this.options.defaultParams;
|
||||||
|
|
||||||
new Ajax.Request(this.url, this.options);
|
new Ajax.Request(this.url, this.options);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -382,7 +382,7 @@ Ajax.Autocompleter = Class.create(Autocompleter.Base, {
|
||||||
// - choices - How many autocompletion choices to offer
|
// - choices - How many autocompletion choices to offer
|
||||||
//
|
//
|
||||||
// - partialSearch - If false, the autocompleter will match entered
|
// - partialSearch - If false, the autocompleter will match entered
|
||||||
// text only at the beginning of strings in the
|
// text only at the beginning of strings in the
|
||||||
// autocomplete array. Defaults to true, which will
|
// autocomplete array. Defaults to true, which will
|
||||||
// match text at the beginning of any *word* in the
|
// match text at the beginning of any *word* in the
|
||||||
// strings in the autocomplete array. If you want to
|
// strings in the autocomplete array. If you want to
|
||||||
|
@ -399,7 +399,7 @@ Ajax.Autocompleter = Class.create(Autocompleter.Base, {
|
||||||
// - ignoreCase - Whether to ignore case when autocompleting.
|
// - ignoreCase - Whether to ignore case when autocompleting.
|
||||||
// Defaults to true.
|
// Defaults to true.
|
||||||
//
|
//
|
||||||
// It's possible to pass in a custom function as the 'selector'
|
// It's possible to pass in a custom function as the 'selector'
|
||||||
// option, if you prefer to write your own autocompletion logic.
|
// option, if you prefer to write your own autocompletion logic.
|
||||||
// In that case, the other options above will not apply unless
|
// In that case, the other options above will not apply unless
|
||||||
// you support them.
|
// you support them.
|
||||||
|
@ -427,20 +427,20 @@ Autocompleter.Local = Class.create(Autocompleter.Base, {
|
||||||
var entry = instance.getToken();
|
var entry = instance.getToken();
|
||||||
var count = 0;
|
var count = 0;
|
||||||
|
|
||||||
for (var i = 0; i < instance.options.array.length &&
|
for (var i = 0; i < instance.options.array.length &&
|
||||||
ret.length < instance.options.choices ; i++) {
|
ret.length < instance.options.choices ; i++) {
|
||||||
|
|
||||||
var elem = instance.options.array[i];
|
var elem = instance.options.array[i];
|
||||||
var foundPos = instance.options.ignoreCase ?
|
var foundPos = instance.options.ignoreCase ?
|
||||||
elem.toLowerCase().indexOf(entry.toLowerCase()) :
|
elem.toLowerCase().indexOf(entry.toLowerCase()) :
|
||||||
elem.indexOf(entry);
|
elem.indexOf(entry);
|
||||||
|
|
||||||
while (foundPos != -1) {
|
while (foundPos != -1) {
|
||||||
if (foundPos == 0 && elem.length != entry.length) {
|
if (foundPos == 0 && elem.length != entry.length) {
|
||||||
ret.push("<li><strong>" + elem.substr(0, entry.length) + "</strong>" +
|
ret.push("<li><strong>" + elem.substr(0, entry.length) + "</strong>" +
|
||||||
elem.substr(entry.length) + "</li>");
|
elem.substr(entry.length) + "</li>");
|
||||||
break;
|
break;
|
||||||
} else if (entry.length >= instance.options.partialChars &&
|
} else if (entry.length >= instance.options.partialChars &&
|
||||||
instance.options.partialSearch && foundPos != -1) {
|
instance.options.partialSearch && foundPos != -1) {
|
||||||
if (instance.options.fullSearch || /\s/.test(elem.substr(foundPos-1,1))) {
|
if (instance.options.fullSearch || /\s/.test(elem.substr(foundPos-1,1))) {
|
||||||
partial.push("<li>" + elem.substr(0, foundPos) + "<strong>" +
|
partial.push("<li>" + elem.substr(0, foundPos) + "<strong>" +
|
||||||
|
@ -450,14 +450,14 @@ Autocompleter.Local = Class.create(Autocompleter.Base, {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
foundPos = instance.options.ignoreCase ?
|
foundPos = instance.options.ignoreCase ?
|
||||||
elem.toLowerCase().indexOf(entry.toLowerCase(), foundPos + 1) :
|
elem.toLowerCase().indexOf(entry.toLowerCase(), foundPos + 1) :
|
||||||
elem.indexOf(entry, foundPos + 1);
|
elem.indexOf(entry, foundPos + 1);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (partial.length)
|
if (partial.length)
|
||||||
ret = ret.concat(partial.slice(0, instance.options.choices - ret.length))
|
ret = ret.concat(partial.slice(0, instance.options.choices - ret.length));
|
||||||
return "<ul>" + ret.join('') + "</ul>";
|
return "<ul>" + ret.join('') + "</ul>";
|
||||||
}
|
}
|
||||||
}, options || { });
|
}, options || { });
|
||||||
|
@ -474,7 +474,7 @@ Field.scrollFreeActivate = function(field) {
|
||||||
setTimeout(function() {
|
setTimeout(function() {
|
||||||
Field.activate(field);
|
Field.activate(field);
|
||||||
}, 1);
|
}, 1);
|
||||||
}
|
};
|
||||||
|
|
||||||
Ajax.InPlaceEditor = Class.create({
|
Ajax.InPlaceEditor = Class.create({
|
||||||
initialize: function(element, url, options) {
|
initialize: function(element, url, options) {
|
||||||
|
@ -604,7 +604,7 @@ Ajax.InPlaceEditor = Class.create({
|
||||||
this.triggerCallback('onEnterHover');
|
this.triggerCallback('onEnterHover');
|
||||||
},
|
},
|
||||||
getText: function() {
|
getText: function() {
|
||||||
return this.element.innerHTML;
|
return this.element.innerHTML.unescapeHTML();
|
||||||
},
|
},
|
||||||
handleAJAXFailure: function(transport) {
|
handleAJAXFailure: function(transport) {
|
||||||
this.triggerCallback('onFailure', transport);
|
this.triggerCallback('onFailure', transport);
|
||||||
|
@ -780,7 +780,7 @@ Ajax.InPlaceCollectionEditor = Class.create(Ajax.InPlaceEditor, {
|
||||||
onSuccess: function(transport) {
|
onSuccess: function(transport) {
|
||||||
var js = transport.responseText.strip();
|
var js = transport.responseText.strip();
|
||||||
if (!/^\[.*\]$/.test(js)) // TODO: improve sanity check
|
if (!/^\[.*\]$/.test(js)) // TODO: improve sanity check
|
||||||
throw 'Server returned an invalid collection representation.';
|
throw('Server returned an invalid collection representation.');
|
||||||
this._collection = eval(js);
|
this._collection = eval(js);
|
||||||
this.checkForExternalText();
|
this.checkForExternalText();
|
||||||
}.bind(this),
|
}.bind(this),
|
||||||
|
@ -937,7 +937,7 @@ Ajax.InPlaceCollectionEditor.DefaultOptions = {
|
||||||
loadingCollectionText: 'Loading options...'
|
loadingCollectionText: 'Loading options...'
|
||||||
};
|
};
|
||||||
|
|
||||||
// Delayed observer, like Form.Element.Observer,
|
// Delayed observer, like Form.Element.Observer,
|
||||||
// but waits for delay after last key input
|
// but waits for delay after last key input
|
||||||
// Ideal for live-search fields
|
// Ideal for live-search fields
|
||||||
|
|
||||||
|
@ -947,7 +947,7 @@ Form.Element.DelayedObserver = Class.create({
|
||||||
this.element = $(element);
|
this.element = $(element);
|
||||||
this.callback = callback;
|
this.callback = callback;
|
||||||
this.timer = null;
|
this.timer = null;
|
||||||
this.lastValue = $F(this.element);
|
this.lastValue = $F(this.element);
|
||||||
Event.observe(this.element,'keyup',this.delayedListener.bindAsEventListener(this));
|
Event.observe(this.element,'keyup',this.delayedListener.bindAsEventListener(this));
|
||||||
},
|
},
|
||||||
delayedListener: function(event) {
|
delayedListener: function(event) {
|
||||||
|
@ -960,4 +960,4 @@ Form.Element.DelayedObserver = Class.create({
|
||||||
this.timer = null;
|
this.timer = null;
|
||||||
this.callback(this.element, $F(this.element));
|
this.callback(this.element, $F(this.element));
|
||||||
}
|
}
|
||||||
});
|
});
|
329
public/javascripts/dragdrop.js
vendored
329
public/javascripts/dragdrop.js
vendored
|
@ -1,6 +1,6 @@
|
||||||
// Copyright (c) 2005-2008 Thomas Fuchs (http://script.aculo.us, http://mir.aculo.us)
|
// Copyright (c) 2005-2008 Thomas Fuchs (http://script.aculo.us, http://mir.aculo.us)
|
||||||
// (c) 2005-2007 Sammi Williams (http://www.oriontransfer.co.nz, sammi@oriontransfer.co.nz)
|
// (c) 2005-2008 Sammi Williams (http://www.oriontransfer.co.nz, sammi@oriontransfer.co.nz)
|
||||||
//
|
//
|
||||||
// script.aculo.us is freely distributable under the terms of an MIT-style license.
|
// script.aculo.us is freely distributable under the terms of an MIT-style license.
|
||||||
// For details, see the script.aculo.us web site: http://script.aculo.us/
|
// For details, see the script.aculo.us web site: http://script.aculo.us/
|
||||||
|
|
||||||
|
@ -32,7 +32,7 @@ var Droppables = {
|
||||||
options._containers.push($(containment));
|
options._containers.push($(containment));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(options.accept) options.accept = [options.accept].flatten();
|
if(options.accept) options.accept = [options.accept].flatten();
|
||||||
|
|
||||||
Element.makePositioned(element); // fix IE
|
Element.makePositioned(element); // fix IE
|
||||||
|
@ -40,34 +40,34 @@ var Droppables = {
|
||||||
|
|
||||||
this.drops.push(options);
|
this.drops.push(options);
|
||||||
},
|
},
|
||||||
|
|
||||||
findDeepestChild: function(drops) {
|
findDeepestChild: function(drops) {
|
||||||
deepest = drops[0];
|
deepest = drops[0];
|
||||||
|
|
||||||
for (i = 1; i < drops.length; ++i)
|
for (i = 1; i < drops.length; ++i)
|
||||||
if (Element.isParent(drops[i].element, deepest.element))
|
if (Element.isParent(drops[i].element, deepest.element))
|
||||||
deepest = drops[i];
|
deepest = drops[i];
|
||||||
|
|
||||||
return deepest;
|
return deepest;
|
||||||
},
|
},
|
||||||
|
|
||||||
isContained: function(element, drop) {
|
isContained: function(element, drop) {
|
||||||
var containmentNode;
|
var containmentNode;
|
||||||
if(drop.tree) {
|
if(drop.tree) {
|
||||||
containmentNode = element.treeNode;
|
containmentNode = element.treeNode;
|
||||||
} else {
|
} else {
|
||||||
containmentNode = element.parentNode;
|
containmentNode = element.parentNode;
|
||||||
}
|
}
|
||||||
return drop._containers.detect(function(c) { return containmentNode == c });
|
return drop._containers.detect(function(c) { return containmentNode == c });
|
||||||
},
|
},
|
||||||
|
|
||||||
isAffected: function(point, element, drop) {
|
isAffected: function(point, element, drop) {
|
||||||
return (
|
return (
|
||||||
(drop.element!=element) &&
|
(drop.element!=element) &&
|
||||||
((!drop._containers) ||
|
((!drop._containers) ||
|
||||||
this.isContained(element, drop)) &&
|
this.isContained(element, drop)) &&
|
||||||
((!drop.accept) ||
|
((!drop.accept) ||
|
||||||
(Element.classNames(element).detect(
|
(Element.classNames(element).detect(
|
||||||
function(v) { return drop.accept.include(v) } ) )) &&
|
function(v) { return drop.accept.include(v) } ) )) &&
|
||||||
Position.within(drop.element, point[0], point[1]) );
|
Position.within(drop.element, point[0], point[1]) );
|
||||||
},
|
},
|
||||||
|
@ -87,12 +87,12 @@ var Droppables = {
|
||||||
show: function(point, element) {
|
show: function(point, element) {
|
||||||
if(!this.drops.length) return;
|
if(!this.drops.length) return;
|
||||||
var drop, affected = [];
|
var drop, affected = [];
|
||||||
|
|
||||||
this.drops.each( function(drop) {
|
this.drops.each( function(drop) {
|
||||||
if(Droppables.isAffected(point, element, drop))
|
if(Droppables.isAffected(point, element, drop))
|
||||||
affected.push(drop);
|
affected.push(drop);
|
||||||
});
|
});
|
||||||
|
|
||||||
if(affected.length>0)
|
if(affected.length>0)
|
||||||
drop = Droppables.findDeepestChild(affected);
|
drop = Droppables.findDeepestChild(affected);
|
||||||
|
|
||||||
|
@ -101,7 +101,7 @@ var Droppables = {
|
||||||
Position.within(drop.element, point[0], point[1]);
|
Position.within(drop.element, point[0], point[1]);
|
||||||
if(drop.onHover)
|
if(drop.onHover)
|
||||||
drop.onHover(element, drop.element, Position.overlap(drop.overlap, drop.element));
|
drop.onHover(element, drop.element, Position.overlap(drop.overlap, drop.element));
|
||||||
|
|
||||||
if (drop != this.last_active) Droppables.activate(drop);
|
if (drop != this.last_active) Droppables.activate(drop);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
@ -112,8 +112,8 @@ var Droppables = {
|
||||||
|
|
||||||
if (this.isAffected([Event.pointerX(event), Event.pointerY(event)], element, this.last_active))
|
if (this.isAffected([Event.pointerX(event), Event.pointerY(event)], element, this.last_active))
|
||||||
if (this.last_active.onDrop) {
|
if (this.last_active.onDrop) {
|
||||||
this.last_active.onDrop(element, this.last_active.element, event);
|
this.last_active.onDrop(element, this.last_active.element, event);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -121,25 +121,25 @@ var Droppables = {
|
||||||
if(this.last_active)
|
if(this.last_active)
|
||||||
this.deactivate(this.last_active);
|
this.deactivate(this.last_active);
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
|
||||||
var Draggables = {
|
var Draggables = {
|
||||||
drags: [],
|
drags: [],
|
||||||
observers: [],
|
observers: [],
|
||||||
|
|
||||||
register: function(draggable) {
|
register: function(draggable) {
|
||||||
if(this.drags.length == 0) {
|
if(this.drags.length == 0) {
|
||||||
this.eventMouseUp = this.endDrag.bindAsEventListener(this);
|
this.eventMouseUp = this.endDrag.bindAsEventListener(this);
|
||||||
this.eventMouseMove = this.updateDrag.bindAsEventListener(this);
|
this.eventMouseMove = this.updateDrag.bindAsEventListener(this);
|
||||||
this.eventKeypress = this.keyPress.bindAsEventListener(this);
|
this.eventKeypress = this.keyPress.bindAsEventListener(this);
|
||||||
|
|
||||||
Event.observe(document, "mouseup", this.eventMouseUp);
|
Event.observe(document, "mouseup", this.eventMouseUp);
|
||||||
Event.observe(document, "mousemove", this.eventMouseMove);
|
Event.observe(document, "mousemove", this.eventMouseMove);
|
||||||
Event.observe(document, "keypress", this.eventKeypress);
|
Event.observe(document, "keypress", this.eventKeypress);
|
||||||
}
|
}
|
||||||
this.drags.push(draggable);
|
this.drags.push(draggable);
|
||||||
},
|
},
|
||||||
|
|
||||||
unregister: function(draggable) {
|
unregister: function(draggable) {
|
||||||
this.drags = this.drags.reject(function(d) { return d==draggable });
|
this.drags = this.drags.reject(function(d) { return d==draggable });
|
||||||
if(this.drags.length == 0) {
|
if(this.drags.length == 0) {
|
||||||
|
@ -148,24 +148,24 @@ var Draggables = {
|
||||||
Event.stopObserving(document, "keypress", this.eventKeypress);
|
Event.stopObserving(document, "keypress", this.eventKeypress);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
activate: function(draggable) {
|
activate: function(draggable) {
|
||||||
if(draggable.options.delay) {
|
if(draggable.options.delay) {
|
||||||
this._timeout = setTimeout(function() {
|
this._timeout = setTimeout(function() {
|
||||||
Draggables._timeout = null;
|
Draggables._timeout = null;
|
||||||
window.focus();
|
window.focus();
|
||||||
Draggables.activeDraggable = draggable;
|
Draggables.activeDraggable = draggable;
|
||||||
}.bind(this), draggable.options.delay);
|
}.bind(this), draggable.options.delay);
|
||||||
} else {
|
} else {
|
||||||
window.focus(); // allows keypress events if window isn't currently focused, fails for Safari
|
window.focus(); // allows keypress events if window isn't currently focused, fails for Safari
|
||||||
this.activeDraggable = draggable;
|
this.activeDraggable = draggable;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
deactivate: function() {
|
deactivate: function() {
|
||||||
this.activeDraggable = null;
|
this.activeDraggable = null;
|
||||||
},
|
},
|
||||||
|
|
||||||
updateDrag: function(event) {
|
updateDrag: function(event) {
|
||||||
if(!this.activeDraggable) return;
|
if(!this.activeDraggable) return;
|
||||||
var pointer = [Event.pointerX(event), Event.pointerY(event)];
|
var pointer = [Event.pointerX(event), Event.pointerY(event)];
|
||||||
|
@ -173,36 +173,36 @@ var Draggables = {
|
||||||
// the same coordinates, prevent needless redrawing (moz bug?)
|
// the same coordinates, prevent needless redrawing (moz bug?)
|
||||||
if(this._lastPointer && (this._lastPointer.inspect() == pointer.inspect())) return;
|
if(this._lastPointer && (this._lastPointer.inspect() == pointer.inspect())) return;
|
||||||
this._lastPointer = pointer;
|
this._lastPointer = pointer;
|
||||||
|
|
||||||
this.activeDraggable.updateDrag(event, pointer);
|
this.activeDraggable.updateDrag(event, pointer);
|
||||||
},
|
},
|
||||||
|
|
||||||
endDrag: function(event) {
|
endDrag: function(event) {
|
||||||
if(this._timeout) {
|
if(this._timeout) {
|
||||||
clearTimeout(this._timeout);
|
clearTimeout(this._timeout);
|
||||||
this._timeout = null;
|
this._timeout = null;
|
||||||
}
|
}
|
||||||
if(!this.activeDraggable) return;
|
if(!this.activeDraggable) return;
|
||||||
this._lastPointer = null;
|
this._lastPointer = null;
|
||||||
this.activeDraggable.endDrag(event);
|
this.activeDraggable.endDrag(event);
|
||||||
this.activeDraggable = null;
|
this.activeDraggable = null;
|
||||||
},
|
},
|
||||||
|
|
||||||
keyPress: function(event) {
|
keyPress: function(event) {
|
||||||
if(this.activeDraggable)
|
if(this.activeDraggable)
|
||||||
this.activeDraggable.keyPress(event);
|
this.activeDraggable.keyPress(event);
|
||||||
},
|
},
|
||||||
|
|
||||||
addObserver: function(observer) {
|
addObserver: function(observer) {
|
||||||
this.observers.push(observer);
|
this.observers.push(observer);
|
||||||
this._cacheObserverCallbacks();
|
this._cacheObserverCallbacks();
|
||||||
},
|
},
|
||||||
|
|
||||||
removeObserver: function(element) { // element instead of observer fixes mem leaks
|
removeObserver: function(element) { // element instead of observer fixes mem leaks
|
||||||
this.observers = this.observers.reject( function(o) { return o.element==element });
|
this.observers = this.observers.reject( function(o) { return o.element==element });
|
||||||
this._cacheObserverCallbacks();
|
this._cacheObserverCallbacks();
|
||||||
},
|
},
|
||||||
|
|
||||||
notify: function(eventName, draggable, event) { // 'onStart', 'onEnd', 'onDrag'
|
notify: function(eventName, draggable, event) { // 'onStart', 'onEnd', 'onDrag'
|
||||||
if(this[eventName+'Count'] > 0)
|
if(this[eventName+'Count'] > 0)
|
||||||
this.observers.each( function(o) {
|
this.observers.each( function(o) {
|
||||||
|
@ -210,7 +210,7 @@ var Draggables = {
|
||||||
});
|
});
|
||||||
if(draggable.options[eventName]) draggable.options[eventName](draggable, event);
|
if(draggable.options[eventName]) draggable.options[eventName](draggable, event);
|
||||||
},
|
},
|
||||||
|
|
||||||
_cacheObserverCallbacks: function() {
|
_cacheObserverCallbacks: function() {
|
||||||
['onStart','onEnd','onDrag'].each( function(eventName) {
|
['onStart','onEnd','onDrag'].each( function(eventName) {
|
||||||
Draggables[eventName+'Count'] = Draggables.observers.select(
|
Draggables[eventName+'Count'] = Draggables.observers.select(
|
||||||
|
@ -218,7 +218,7 @@ var Draggables = {
|
||||||
).length;
|
).length;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
|
||||||
/*--------------------------------------------------------------------------*/
|
/*--------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
@ -234,12 +234,12 @@ var Draggable = Class.create({
|
||||||
},
|
},
|
||||||
endeffect: function(element) {
|
endeffect: function(element) {
|
||||||
var toOpacity = Object.isNumber(element._opacity) ? element._opacity : 1.0;
|
var toOpacity = Object.isNumber(element._opacity) ? element._opacity : 1.0;
|
||||||
new Effect.Opacity(element, {duration:0.2, from:0.7, to:toOpacity,
|
new Effect.Opacity(element, {duration:0.2, from:0.7, to:toOpacity,
|
||||||
queue: {scope:'_draggable', position:'end'},
|
queue: {scope:'_draggable', position:'end'},
|
||||||
afterFinish: function(){
|
afterFinish: function(){
|
||||||
Draggable._dragging[element] = false
|
Draggable._dragging[element] = false
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
zindex: 1000,
|
zindex: 1000,
|
||||||
revert: false,
|
revert: false,
|
||||||
|
@ -250,57 +250,57 @@ var Draggable = Class.create({
|
||||||
snap: false, // false, or xy or [x,y] or function(x,y){ return [x,y] }
|
snap: false, // false, or xy or [x,y] or function(x,y){ return [x,y] }
|
||||||
delay: 0
|
delay: 0
|
||||||
};
|
};
|
||||||
|
|
||||||
if(!arguments[1] || Object.isUndefined(arguments[1].endeffect))
|
if(!arguments[1] || Object.isUndefined(arguments[1].endeffect))
|
||||||
Object.extend(defaults, {
|
Object.extend(defaults, {
|
||||||
starteffect: function(element) {
|
starteffect: function(element) {
|
||||||
element._opacity = Element.getOpacity(element);
|
element._opacity = Element.getOpacity(element);
|
||||||
Draggable._dragging[element] = true;
|
Draggable._dragging[element] = true;
|
||||||
new Effect.Opacity(element, {duration:0.2, from:element._opacity, to:0.7});
|
new Effect.Opacity(element, {duration:0.2, from:element._opacity, to:0.7});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
var options = Object.extend(defaults, arguments[1] || { });
|
var options = Object.extend(defaults, arguments[1] || { });
|
||||||
|
|
||||||
this.element = $(element);
|
this.element = $(element);
|
||||||
|
|
||||||
if(options.handle && Object.isString(options.handle))
|
if(options.handle && Object.isString(options.handle))
|
||||||
this.handle = this.element.down('.'+options.handle, 0);
|
this.handle = this.element.down('.'+options.handle, 0);
|
||||||
|
|
||||||
if(!this.handle) this.handle = $(options.handle);
|
if(!this.handle) this.handle = $(options.handle);
|
||||||
if(!this.handle) this.handle = this.element;
|
if(!this.handle) this.handle = this.element;
|
||||||
|
|
||||||
if(options.scroll && !options.scroll.scrollTo && !options.scroll.outerHTML) {
|
if(options.scroll && !options.scroll.scrollTo && !options.scroll.outerHTML) {
|
||||||
options.scroll = $(options.scroll);
|
options.scroll = $(options.scroll);
|
||||||
this._isScrollChild = Element.childOf(this.element, options.scroll);
|
this._isScrollChild = Element.childOf(this.element, options.scroll);
|
||||||
}
|
}
|
||||||
|
|
||||||
Element.makePositioned(this.element); // fix IE
|
Element.makePositioned(this.element); // fix IE
|
||||||
|
|
||||||
this.options = options;
|
this.options = options;
|
||||||
this.dragging = false;
|
this.dragging = false;
|
||||||
|
|
||||||
this.eventMouseDown = this.initDrag.bindAsEventListener(this);
|
this.eventMouseDown = this.initDrag.bindAsEventListener(this);
|
||||||
Event.observe(this.handle, "mousedown", this.eventMouseDown);
|
Event.observe(this.handle, "mousedown", this.eventMouseDown);
|
||||||
|
|
||||||
Draggables.register(this);
|
Draggables.register(this);
|
||||||
},
|
},
|
||||||
|
|
||||||
destroy: function() {
|
destroy: function() {
|
||||||
Event.stopObserving(this.handle, "mousedown", this.eventMouseDown);
|
Event.stopObserving(this.handle, "mousedown", this.eventMouseDown);
|
||||||
Draggables.unregister(this);
|
Draggables.unregister(this);
|
||||||
},
|
},
|
||||||
|
|
||||||
currentDelta: function() {
|
currentDelta: function() {
|
||||||
return([
|
return([
|
||||||
parseInt(Element.getStyle(this.element,'left') || '0'),
|
parseInt(Element.getStyle(this.element,'left') || '0'),
|
||||||
parseInt(Element.getStyle(this.element,'top') || '0')]);
|
parseInt(Element.getStyle(this.element,'top') || '0')]);
|
||||||
},
|
},
|
||||||
|
|
||||||
initDrag: function(event) {
|
initDrag: function(event) {
|
||||||
if(!Object.isUndefined(Draggable._dragging[this.element]) &&
|
if(!Object.isUndefined(Draggable._dragging[this.element]) &&
|
||||||
Draggable._dragging[this.element]) return;
|
Draggable._dragging[this.element]) return;
|
||||||
if(Event.isLeftClick(event)) {
|
if(Event.isLeftClick(event)) {
|
||||||
// abort on form elements, fixes a Firefox issue
|
// abort on form elements, fixes a Firefox issue
|
||||||
var src = Event.element(event);
|
var src = Event.element(event);
|
||||||
if((tag_name = src.tagName.toUpperCase()) && (
|
if((tag_name = src.tagName.toUpperCase()) && (
|
||||||
|
@ -309,34 +309,34 @@ var Draggable = Class.create({
|
||||||
tag_name=='OPTION' ||
|
tag_name=='OPTION' ||
|
||||||
tag_name=='BUTTON' ||
|
tag_name=='BUTTON' ||
|
||||||
tag_name=='TEXTAREA')) return;
|
tag_name=='TEXTAREA')) return;
|
||||||
|
|
||||||
var pointer = [Event.pointerX(event), Event.pointerY(event)];
|
var pointer = [Event.pointerX(event), Event.pointerY(event)];
|
||||||
var pos = Position.cumulativeOffset(this.element);
|
var pos = Position.cumulativeOffset(this.element);
|
||||||
this.offset = [0,1].map( function(i) { return (pointer[i] - pos[i]) });
|
this.offset = [0,1].map( function(i) { return (pointer[i] - pos[i]) });
|
||||||
|
|
||||||
Draggables.activate(this);
|
Draggables.activate(this);
|
||||||
Event.stop(event);
|
Event.stop(event);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
startDrag: function(event) {
|
startDrag: function(event) {
|
||||||
this.dragging = true;
|
this.dragging = true;
|
||||||
if(!this.delta)
|
if(!this.delta)
|
||||||
this.delta = this.currentDelta();
|
this.delta = this.currentDelta();
|
||||||
|
|
||||||
if(this.options.zindex) {
|
if(this.options.zindex) {
|
||||||
this.originalZ = parseInt(Element.getStyle(this.element,'z-index') || 0);
|
this.originalZ = parseInt(Element.getStyle(this.element,'z-index') || 0);
|
||||||
this.element.style.zIndex = this.options.zindex;
|
this.element.style.zIndex = this.options.zindex;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(this.options.ghosting) {
|
if(this.options.ghosting) {
|
||||||
this._clone = this.element.cloneNode(true);
|
this._clone = this.element.cloneNode(true);
|
||||||
this.element._originallyAbsolute = (this.element.getStyle('position') == 'absolute');
|
this._originallyAbsolute = (this.element.getStyle('position') == 'absolute');
|
||||||
if (!this.element._originallyAbsolute)
|
if (!this._originallyAbsolute)
|
||||||
Position.absolutize(this.element);
|
Position.absolutize(this.element);
|
||||||
this.element.parentNode.insertBefore(this._clone, this.element);
|
this.element.parentNode.insertBefore(this._clone, this.element);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(this.options.scroll) {
|
if(this.options.scroll) {
|
||||||
if (this.options.scroll == window) {
|
if (this.options.scroll == window) {
|
||||||
var where = this._getWindowScroll(this.options.scroll);
|
var where = this._getWindowScroll(this.options.scroll);
|
||||||
|
@ -347,28 +347,28 @@ var Draggable = Class.create({
|
||||||
this.originalScrollTop = this.options.scroll.scrollTop;
|
this.originalScrollTop = this.options.scroll.scrollTop;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Draggables.notify('onStart', this, event);
|
Draggables.notify('onStart', this, event);
|
||||||
|
|
||||||
if(this.options.starteffect) this.options.starteffect(this.element);
|
if(this.options.starteffect) this.options.starteffect(this.element);
|
||||||
},
|
},
|
||||||
|
|
||||||
updateDrag: function(event, pointer) {
|
updateDrag: function(event, pointer) {
|
||||||
if(!this.dragging) this.startDrag(event);
|
if(!this.dragging) this.startDrag(event);
|
||||||
|
|
||||||
if(!this.options.quiet){
|
if(!this.options.quiet){
|
||||||
Position.prepare();
|
Position.prepare();
|
||||||
Droppables.show(pointer, this.element);
|
Droppables.show(pointer, this.element);
|
||||||
}
|
}
|
||||||
|
|
||||||
Draggables.notify('onDrag', this, event);
|
Draggables.notify('onDrag', this, event);
|
||||||
|
|
||||||
this.draw(pointer);
|
this.draw(pointer);
|
||||||
if(this.options.change) this.options.change(this);
|
if(this.options.change) this.options.change(this);
|
||||||
|
|
||||||
if(this.options.scroll) {
|
if(this.options.scroll) {
|
||||||
this.stopScrolling();
|
this.stopScrolling();
|
||||||
|
|
||||||
var p;
|
var p;
|
||||||
if (this.options.scroll == window) {
|
if (this.options.scroll == window) {
|
||||||
with(this._getWindowScroll(this.options.scroll)) { p = [ left, top, left+width, top+height ]; }
|
with(this._getWindowScroll(this.options.scroll)) { p = [ left, top, left+width, top+height ]; }
|
||||||
|
@ -386,16 +386,16 @@ var Draggable = Class.create({
|
||||||
if(pointer[1] > (p[3]-this.options.scrollSensitivity)) speed[1] = pointer[1]-(p[3]-this.options.scrollSensitivity);
|
if(pointer[1] > (p[3]-this.options.scrollSensitivity)) speed[1] = pointer[1]-(p[3]-this.options.scrollSensitivity);
|
||||||
this.startScrolling(speed);
|
this.startScrolling(speed);
|
||||||
}
|
}
|
||||||
|
|
||||||
// fix AppleWebKit rendering
|
// fix AppleWebKit rendering
|
||||||
if(Prototype.Browser.WebKit) window.scrollBy(0,0);
|
if(Prototype.Browser.WebKit) window.scrollBy(0,0);
|
||||||
|
|
||||||
Event.stop(event);
|
Event.stop(event);
|
||||||
},
|
},
|
||||||
|
|
||||||
finishDrag: function(event, success) {
|
finishDrag: function(event, success) {
|
||||||
this.dragging = false;
|
this.dragging = false;
|
||||||
|
|
||||||
if(this.options.quiet){
|
if(this.options.quiet){
|
||||||
Position.prepare();
|
Position.prepare();
|
||||||
var pointer = [Event.pointerX(event), Event.pointerY(event)];
|
var pointer = [Event.pointerX(event), Event.pointerY(event)];
|
||||||
|
@ -403,24 +403,24 @@ var Draggable = Class.create({
|
||||||
}
|
}
|
||||||
|
|
||||||
if(this.options.ghosting) {
|
if(this.options.ghosting) {
|
||||||
if (!this.element._originallyAbsolute)
|
if (!this._originallyAbsolute)
|
||||||
Position.relativize(this.element);
|
Position.relativize(this.element);
|
||||||
delete this.element._originallyAbsolute;
|
delete this._originallyAbsolute;
|
||||||
Element.remove(this._clone);
|
Element.remove(this._clone);
|
||||||
this._clone = null;
|
this._clone = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
var dropped = false;
|
var dropped = false;
|
||||||
if(success) {
|
if(success) {
|
||||||
dropped = Droppables.fire(event, this.element);
|
dropped = Droppables.fire(event, this.element);
|
||||||
if (!dropped) dropped = false;
|
if (!dropped) dropped = false;
|
||||||
}
|
}
|
||||||
if(dropped && this.options.onDropped) this.options.onDropped(this.element);
|
if(dropped && this.options.onDropped) this.options.onDropped(this.element);
|
||||||
Draggables.notify('onEnd', this, event);
|
Draggables.notify('onEnd', this, event);
|
||||||
|
|
||||||
var revert = this.options.revert;
|
var revert = this.options.revert;
|
||||||
if(revert && Object.isFunction(revert)) revert = revert(this.element);
|
if(revert && Object.isFunction(revert)) revert = revert(this.element);
|
||||||
|
|
||||||
var d = this.currentDelta();
|
var d = this.currentDelta();
|
||||||
if(revert && this.options.reverteffect) {
|
if(revert && this.options.reverteffect) {
|
||||||
if (dropped == 0 || revert != 'failure')
|
if (dropped == 0 || revert != 'failure')
|
||||||
|
@ -433,67 +433,67 @@ var Draggable = Class.create({
|
||||||
if(this.options.zindex)
|
if(this.options.zindex)
|
||||||
this.element.style.zIndex = this.originalZ;
|
this.element.style.zIndex = this.originalZ;
|
||||||
|
|
||||||
if(this.options.endeffect)
|
if(this.options.endeffect)
|
||||||
this.options.endeffect(this.element);
|
this.options.endeffect(this.element);
|
||||||
|
|
||||||
Draggables.deactivate(this);
|
Draggables.deactivate(this);
|
||||||
Droppables.reset();
|
Droppables.reset();
|
||||||
},
|
},
|
||||||
|
|
||||||
keyPress: function(event) {
|
keyPress: function(event) {
|
||||||
if(event.keyCode!=Event.KEY_ESC) return;
|
if(event.keyCode!=Event.KEY_ESC) return;
|
||||||
this.finishDrag(event, false);
|
this.finishDrag(event, false);
|
||||||
Event.stop(event);
|
Event.stop(event);
|
||||||
},
|
},
|
||||||
|
|
||||||
endDrag: function(event) {
|
endDrag: function(event) {
|
||||||
if(!this.dragging) return;
|
if(!this.dragging) return;
|
||||||
this.stopScrolling();
|
this.stopScrolling();
|
||||||
this.finishDrag(event, true);
|
this.finishDrag(event, true);
|
||||||
Event.stop(event);
|
Event.stop(event);
|
||||||
},
|
},
|
||||||
|
|
||||||
draw: function(point) {
|
draw: function(point) {
|
||||||
var pos = Position.cumulativeOffset(this.element);
|
var pos = Position.cumulativeOffset(this.element);
|
||||||
if(this.options.ghosting) {
|
if(this.options.ghosting) {
|
||||||
var r = Position.realOffset(this.element);
|
var r = Position.realOffset(this.element);
|
||||||
pos[0] += r[0] - Position.deltaX; pos[1] += r[1] - Position.deltaY;
|
pos[0] += r[0] - Position.deltaX; pos[1] += r[1] - Position.deltaY;
|
||||||
}
|
}
|
||||||
|
|
||||||
var d = this.currentDelta();
|
var d = this.currentDelta();
|
||||||
pos[0] -= d[0]; pos[1] -= d[1];
|
pos[0] -= d[0]; pos[1] -= d[1];
|
||||||
|
|
||||||
if(this.options.scroll && (this.options.scroll != window && this._isScrollChild)) {
|
if(this.options.scroll && (this.options.scroll != window && this._isScrollChild)) {
|
||||||
pos[0] -= this.options.scroll.scrollLeft-this.originalScrollLeft;
|
pos[0] -= this.options.scroll.scrollLeft-this.originalScrollLeft;
|
||||||
pos[1] -= this.options.scroll.scrollTop-this.originalScrollTop;
|
pos[1] -= this.options.scroll.scrollTop-this.originalScrollTop;
|
||||||
}
|
}
|
||||||
|
|
||||||
var p = [0,1].map(function(i){
|
var p = [0,1].map(function(i){
|
||||||
return (point[i]-pos[i]-this.offset[i])
|
return (point[i]-pos[i]-this.offset[i])
|
||||||
}.bind(this));
|
}.bind(this));
|
||||||
|
|
||||||
if(this.options.snap) {
|
if(this.options.snap) {
|
||||||
if(Object.isFunction(this.options.snap)) {
|
if(Object.isFunction(this.options.snap)) {
|
||||||
p = this.options.snap(p[0],p[1],this);
|
p = this.options.snap(p[0],p[1],this);
|
||||||
} else {
|
} else {
|
||||||
if(Object.isArray(this.options.snap)) {
|
if(Object.isArray(this.options.snap)) {
|
||||||
p = p.map( function(v, i) {
|
p = p.map( function(v, i) {
|
||||||
return (v/this.options.snap[i]).round()*this.options.snap[i] }.bind(this))
|
return (v/this.options.snap[i]).round()*this.options.snap[i] }.bind(this));
|
||||||
} else {
|
} else {
|
||||||
p = p.map( function(v) {
|
p = p.map( function(v) {
|
||||||
return (v/this.options.snap).round()*this.options.snap }.bind(this))
|
return (v/this.options.snap).round()*this.options.snap }.bind(this));
|
||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
|
|
||||||
var style = this.element.style;
|
var style = this.element.style;
|
||||||
if((!this.options.constraint) || (this.options.constraint=='horizontal'))
|
if((!this.options.constraint) || (this.options.constraint=='horizontal'))
|
||||||
style.left = p[0] + "px";
|
style.left = p[0] + "px";
|
||||||
if((!this.options.constraint) || (this.options.constraint=='vertical'))
|
if((!this.options.constraint) || (this.options.constraint=='vertical'))
|
||||||
style.top = p[1] + "px";
|
style.top = p[1] + "px";
|
||||||
|
|
||||||
if(style.visibility=="hidden") style.visibility = ""; // fix gecko rendering
|
if(style.visibility=="hidden") style.visibility = ""; // fix gecko rendering
|
||||||
},
|
},
|
||||||
|
|
||||||
stopScrolling: function() {
|
stopScrolling: function() {
|
||||||
if(this.scrollInterval) {
|
if(this.scrollInterval) {
|
||||||
clearInterval(this.scrollInterval);
|
clearInterval(this.scrollInterval);
|
||||||
|
@ -501,14 +501,14 @@ var Draggable = Class.create({
|
||||||
Draggables._lastScrollPointer = null;
|
Draggables._lastScrollPointer = null;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
startScrolling: function(speed) {
|
startScrolling: function(speed) {
|
||||||
if(!(speed[0] || speed[1])) return;
|
if(!(speed[0] || speed[1])) return;
|
||||||
this.scrollSpeed = [speed[0]*this.options.scrollSpeed,speed[1]*this.options.scrollSpeed];
|
this.scrollSpeed = [speed[0]*this.options.scrollSpeed,speed[1]*this.options.scrollSpeed];
|
||||||
this.lastScrolled = new Date();
|
this.lastScrolled = new Date();
|
||||||
this.scrollInterval = setInterval(this.scroll.bind(this), 10);
|
this.scrollInterval = setInterval(this.scroll.bind(this), 10);
|
||||||
},
|
},
|
||||||
|
|
||||||
scroll: function() {
|
scroll: function() {
|
||||||
var current = new Date();
|
var current = new Date();
|
||||||
var delta = current - this.lastScrolled;
|
var delta = current - this.lastScrolled;
|
||||||
|
@ -524,7 +524,7 @@ var Draggable = Class.create({
|
||||||
this.options.scroll.scrollLeft += this.scrollSpeed[0] * delta / 1000;
|
this.options.scroll.scrollLeft += this.scrollSpeed[0] * delta / 1000;
|
||||||
this.options.scroll.scrollTop += this.scrollSpeed[1] * delta / 1000;
|
this.options.scroll.scrollTop += this.scrollSpeed[1] * delta / 1000;
|
||||||
}
|
}
|
||||||
|
|
||||||
Position.prepare();
|
Position.prepare();
|
||||||
Droppables.show(Draggables._lastPointer, this.element);
|
Droppables.show(Draggables._lastPointer, this.element);
|
||||||
Draggables.notify('onDrag', this);
|
Draggables.notify('onDrag', this);
|
||||||
|
@ -538,10 +538,10 @@ var Draggable = Class.create({
|
||||||
Draggables._lastScrollPointer[1] = 0;
|
Draggables._lastScrollPointer[1] = 0;
|
||||||
this.draw(Draggables._lastScrollPointer);
|
this.draw(Draggables._lastScrollPointer);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(this.options.change) this.options.change(this);
|
if(this.options.change) this.options.change(this);
|
||||||
},
|
},
|
||||||
|
|
||||||
_getWindowScroll: function(w) {
|
_getWindowScroll: function(w) {
|
||||||
var T, L, W, H;
|
var T, L, W, H;
|
||||||
with (w.document) {
|
with (w.document) {
|
||||||
|
@ -560,7 +560,7 @@ var Draggable = Class.create({
|
||||||
H = documentElement.clientHeight;
|
H = documentElement.clientHeight;
|
||||||
} else {
|
} else {
|
||||||
W = body.offsetWidth;
|
W = body.offsetWidth;
|
||||||
H = body.offsetHeight
|
H = body.offsetHeight;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return { top: T, left: L, width: W, height: H };
|
return { top: T, left: L, width: W, height: H };
|
||||||
|
@ -577,11 +577,11 @@ var SortableObserver = Class.create({
|
||||||
this.observer = observer;
|
this.observer = observer;
|
||||||
this.lastValue = Sortable.serialize(this.element);
|
this.lastValue = Sortable.serialize(this.element);
|
||||||
},
|
},
|
||||||
|
|
||||||
onStart: function() {
|
onStart: function() {
|
||||||
this.lastValue = Sortable.serialize(this.element);
|
this.lastValue = Sortable.serialize(this.element);
|
||||||
},
|
},
|
||||||
|
|
||||||
onEnd: function() {
|
onEnd: function() {
|
||||||
Sortable.unmark();
|
Sortable.unmark();
|
||||||
if(this.lastValue != Sortable.serialize(this.element))
|
if(this.lastValue != Sortable.serialize(this.element))
|
||||||
|
@ -591,11 +591,11 @@ var SortableObserver = Class.create({
|
||||||
|
|
||||||
var Sortable = {
|
var Sortable = {
|
||||||
SERIALIZE_RULE: /^[^_\-](?:[A-Za-z0-9\-\_]*)[_](.*)$/,
|
SERIALIZE_RULE: /^[^_\-](?:[A-Za-z0-9\-\_]*)[_](.*)$/,
|
||||||
|
|
||||||
sortables: { },
|
sortables: { },
|
||||||
|
|
||||||
_findRootElement: function(element) {
|
_findRootElement: function(element) {
|
||||||
while (element.tagName.toUpperCase() != "BODY") {
|
while (element.tagName.toUpperCase() != "BODY") {
|
||||||
if(element.id && Sortable.sortables[element.id]) return element;
|
if(element.id && Sortable.sortables[element.id]) return element;
|
||||||
element = element.parentNode;
|
element = element.parentNode;
|
||||||
}
|
}
|
||||||
|
@ -606,22 +606,23 @@ var Sortable = {
|
||||||
if(!element) return;
|
if(!element) return;
|
||||||
return Sortable.sortables[element.id];
|
return Sortable.sortables[element.id];
|
||||||
},
|
},
|
||||||
|
|
||||||
destroy: function(element){
|
destroy: function(element){
|
||||||
var s = Sortable.options(element);
|
element = $(element);
|
||||||
|
var s = Sortable.sortables[element.id];
|
||||||
|
|
||||||
if(s) {
|
if(s) {
|
||||||
Draggables.removeObserver(s.element);
|
Draggables.removeObserver(s.element);
|
||||||
s.droppables.each(function(d){ Droppables.remove(d) });
|
s.droppables.each(function(d){ Droppables.remove(d) });
|
||||||
s.draggables.invoke('destroy');
|
s.draggables.invoke('destroy');
|
||||||
|
|
||||||
delete Sortable.sortables[s.element.id];
|
delete Sortable.sortables[s.element.id];
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
create: function(element) {
|
create: function(element) {
|
||||||
element = $(element);
|
element = $(element);
|
||||||
var options = Object.extend({
|
var options = Object.extend({
|
||||||
element: element,
|
element: element,
|
||||||
tag: 'li', // assumes li children, override with tag: 'tagname'
|
tag: 'li', // assumes li children, override with tag: 'tagname'
|
||||||
dropOnEmpty: false,
|
dropOnEmpty: false,
|
||||||
|
@ -635,17 +636,17 @@ var Sortable = {
|
||||||
delay: 0,
|
delay: 0,
|
||||||
hoverclass: null,
|
hoverclass: null,
|
||||||
ghosting: false,
|
ghosting: false,
|
||||||
quiet: false,
|
quiet: false,
|
||||||
scroll: false,
|
scroll: false,
|
||||||
scrollSensitivity: 20,
|
scrollSensitivity: 20,
|
||||||
scrollSpeed: 15,
|
scrollSpeed: 15,
|
||||||
format: this.SERIALIZE_RULE,
|
format: this.SERIALIZE_RULE,
|
||||||
|
|
||||||
// these take arrays of elements or ids and can be
|
// these take arrays of elements or ids and can be
|
||||||
// used for better initialization performance
|
// used for better initialization performance
|
||||||
elements: false,
|
elements: false,
|
||||||
handles: false,
|
handles: false,
|
||||||
|
|
||||||
onChange: Prototype.emptyFunction,
|
onChange: Prototype.emptyFunction,
|
||||||
onUpdate: Prototype.emptyFunction
|
onUpdate: Prototype.emptyFunction
|
||||||
}, arguments[1] || { });
|
}, arguments[1] || { });
|
||||||
|
@ -682,24 +683,24 @@ var Sortable = {
|
||||||
if(options.zindex)
|
if(options.zindex)
|
||||||
options_for_draggable.zindex = options.zindex;
|
options_for_draggable.zindex = options.zindex;
|
||||||
|
|
||||||
// build options for the droppables
|
// build options for the droppables
|
||||||
var options_for_droppable = {
|
var options_for_droppable = {
|
||||||
overlap: options.overlap,
|
overlap: options.overlap,
|
||||||
containment: options.containment,
|
containment: options.containment,
|
||||||
tree: options.tree,
|
tree: options.tree,
|
||||||
hoverclass: options.hoverclass,
|
hoverclass: options.hoverclass,
|
||||||
onHover: Sortable.onHover
|
onHover: Sortable.onHover
|
||||||
}
|
};
|
||||||
|
|
||||||
var options_for_tree = {
|
var options_for_tree = {
|
||||||
onHover: Sortable.onEmptyHover,
|
onHover: Sortable.onEmptyHover,
|
||||||
overlap: options.overlap,
|
overlap: options.overlap,
|
||||||
containment: options.containment,
|
containment: options.containment,
|
||||||
hoverclass: options.hoverclass
|
hoverclass: options.hoverclass
|
||||||
}
|
};
|
||||||
|
|
||||||
// fix for gecko engine
|
// fix for gecko engine
|
||||||
Element.cleanWhitespace(element);
|
Element.cleanWhitespace(element);
|
||||||
|
|
||||||
options.draggables = [];
|
options.draggables = [];
|
||||||
options.droppables = [];
|
options.droppables = [];
|
||||||
|
@ -712,14 +713,14 @@ var Sortable = {
|
||||||
|
|
||||||
(options.elements || this.findElements(element, options) || []).each( function(e,i) {
|
(options.elements || this.findElements(element, options) || []).each( function(e,i) {
|
||||||
var handle = options.handles ? $(options.handles[i]) :
|
var handle = options.handles ? $(options.handles[i]) :
|
||||||
(options.handle ? $(e).select('.' + options.handle)[0] : e);
|
(options.handle ? $(e).select('.' + options.handle)[0] : e);
|
||||||
options.draggables.push(
|
options.draggables.push(
|
||||||
new Draggable(e, Object.extend(options_for_draggable, { handle: handle })));
|
new Draggable(e, Object.extend(options_for_draggable, { handle: handle })));
|
||||||
Droppables.add(e, options_for_droppable);
|
Droppables.add(e, options_for_droppable);
|
||||||
if(options.tree) e.treeNode = element;
|
if(options.tree) e.treeNode = element;
|
||||||
options.droppables.push(e);
|
options.droppables.push(e);
|
||||||
});
|
});
|
||||||
|
|
||||||
if(options.tree) {
|
if(options.tree) {
|
||||||
(Sortable.findTreeElements(element, options) || []).each( function(e) {
|
(Sortable.findTreeElements(element, options) || []).each( function(e) {
|
||||||
Droppables.add(e, options_for_tree);
|
Droppables.add(e, options_for_tree);
|
||||||
|
@ -741,7 +742,7 @@ var Sortable = {
|
||||||
return Element.findChildren(
|
return Element.findChildren(
|
||||||
element, options.only, options.tree ? true : false, options.tag);
|
element, options.only, options.tree ? true : false, options.tag);
|
||||||
},
|
},
|
||||||
|
|
||||||
findTreeElements: function(element, options) {
|
findTreeElements: function(element, options) {
|
||||||
return Element.findChildren(
|
return Element.findChildren(
|
||||||
element, options.only, options.tree ? true : false, options.treeTag);
|
element, options.only, options.tree ? true : false, options.treeTag);
|
||||||
|
@ -758,7 +759,7 @@ var Sortable = {
|
||||||
var oldParentNode = element.parentNode;
|
var oldParentNode = element.parentNode;
|
||||||
element.style.visibility = "hidden"; // fix gecko rendering
|
element.style.visibility = "hidden"; // fix gecko rendering
|
||||||
dropon.parentNode.insertBefore(element, dropon);
|
dropon.parentNode.insertBefore(element, dropon);
|
||||||
if(dropon.parentNode!=oldParentNode)
|
if(dropon.parentNode!=oldParentNode)
|
||||||
Sortable.options(oldParentNode).onChange(element);
|
Sortable.options(oldParentNode).onChange(element);
|
||||||
Sortable.options(dropon.parentNode).onChange(element);
|
Sortable.options(dropon.parentNode).onChange(element);
|
||||||
}
|
}
|
||||||
|
@ -769,26 +770,26 @@ var Sortable = {
|
||||||
var oldParentNode = element.parentNode;
|
var oldParentNode = element.parentNode;
|
||||||
element.style.visibility = "hidden"; // fix gecko rendering
|
element.style.visibility = "hidden"; // fix gecko rendering
|
||||||
dropon.parentNode.insertBefore(element, nextElement);
|
dropon.parentNode.insertBefore(element, nextElement);
|
||||||
if(dropon.parentNode!=oldParentNode)
|
if(dropon.parentNode!=oldParentNode)
|
||||||
Sortable.options(oldParentNode).onChange(element);
|
Sortable.options(oldParentNode).onChange(element);
|
||||||
Sortable.options(dropon.parentNode).onChange(element);
|
Sortable.options(dropon.parentNode).onChange(element);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
onEmptyHover: function(element, dropon, overlap) {
|
onEmptyHover: function(element, dropon, overlap) {
|
||||||
var oldParentNode = element.parentNode;
|
var oldParentNode = element.parentNode;
|
||||||
var droponOptions = Sortable.options(dropon);
|
var droponOptions = Sortable.options(dropon);
|
||||||
|
|
||||||
if(!Element.isParent(dropon, element)) {
|
if(!Element.isParent(dropon, element)) {
|
||||||
var index;
|
var index;
|
||||||
|
|
||||||
var children = Sortable.findElements(dropon, {tag: droponOptions.tag, only: droponOptions.only});
|
var children = Sortable.findElements(dropon, {tag: droponOptions.tag, only: droponOptions.only});
|
||||||
var child = null;
|
var child = null;
|
||||||
|
|
||||||
if(children) {
|
if(children) {
|
||||||
var offset = Element.offsetSize(dropon, droponOptions.overlap) * (1.0 - overlap);
|
var offset = Element.offsetSize(dropon, droponOptions.overlap) * (1.0 - overlap);
|
||||||
|
|
||||||
for (index = 0; index < children.length; index += 1) {
|
for (index = 0; index < children.length; index += 1) {
|
||||||
if (offset - Element.offsetSize (children[index], droponOptions.overlap) >= 0) {
|
if (offset - Element.offsetSize (children[index], droponOptions.overlap) >= 0) {
|
||||||
offset -= Element.offsetSize (children[index], droponOptions.overlap);
|
offset -= Element.offsetSize (children[index], droponOptions.overlap);
|
||||||
|
@ -801,9 +802,9 @@ var Sortable = {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
dropon.insertBefore(element, child);
|
dropon.insertBefore(element, child);
|
||||||
|
|
||||||
Sortable.options(oldParentNode).onChange(element);
|
Sortable.options(oldParentNode).onChange(element);
|
||||||
droponOptions.onChange(element);
|
droponOptions.onChange(element);
|
||||||
}
|
}
|
||||||
|
@ -816,34 +817,34 @@ var Sortable = {
|
||||||
mark: function(dropon, position) {
|
mark: function(dropon, position) {
|
||||||
// mark on ghosting only
|
// mark on ghosting only
|
||||||
var sortable = Sortable.options(dropon.parentNode);
|
var sortable = Sortable.options(dropon.parentNode);
|
||||||
if(sortable && !sortable.ghosting) return;
|
if(sortable && !sortable.ghosting) return;
|
||||||
|
|
||||||
if(!Sortable._marker) {
|
if(!Sortable._marker) {
|
||||||
Sortable._marker =
|
Sortable._marker =
|
||||||
($('dropmarker') || Element.extend(document.createElement('DIV'))).
|
($('dropmarker') || Element.extend(document.createElement('DIV'))).
|
||||||
hide().addClassName('dropmarker').setStyle({position:'absolute'});
|
hide().addClassName('dropmarker').setStyle({position:'absolute'});
|
||||||
document.getElementsByTagName("body").item(0).appendChild(Sortable._marker);
|
document.getElementsByTagName("body").item(0).appendChild(Sortable._marker);
|
||||||
}
|
}
|
||||||
var offsets = Position.cumulativeOffset(dropon);
|
var offsets = Position.cumulativeOffset(dropon);
|
||||||
Sortable._marker.setStyle({left: offsets[0]+'px', top: offsets[1] + 'px'});
|
Sortable._marker.setStyle({left: offsets[0]+'px', top: offsets[1] + 'px'});
|
||||||
|
|
||||||
if(position=='after')
|
if(position=='after')
|
||||||
if(sortable.overlap == 'horizontal')
|
if(sortable.overlap == 'horizontal')
|
||||||
Sortable._marker.setStyle({left: (offsets[0]+dropon.clientWidth) + 'px'});
|
Sortable._marker.setStyle({left: (offsets[0]+dropon.clientWidth) + 'px'});
|
||||||
else
|
else
|
||||||
Sortable._marker.setStyle({top: (offsets[1]+dropon.clientHeight) + 'px'});
|
Sortable._marker.setStyle({top: (offsets[1]+dropon.clientHeight) + 'px'});
|
||||||
|
|
||||||
Sortable._marker.show();
|
Sortable._marker.show();
|
||||||
},
|
},
|
||||||
|
|
||||||
_tree: function(element, options, parent) {
|
_tree: function(element, options, parent) {
|
||||||
var children = Sortable.findElements(element, options) || [];
|
var children = Sortable.findElements(element, options) || [];
|
||||||
|
|
||||||
for (var i = 0; i < children.length; ++i) {
|
for (var i = 0; i < children.length; ++i) {
|
||||||
var match = children[i].id.match(options.format);
|
var match = children[i].id.match(options.format);
|
||||||
|
|
||||||
if (!match) continue;
|
if (!match) continue;
|
||||||
|
|
||||||
var child = {
|
var child = {
|
||||||
id: encodeURIComponent(match ? match[1] : null),
|
id: encodeURIComponent(match ? match[1] : null),
|
||||||
element: element,
|
element: element,
|
||||||
|
@ -851,16 +852,16 @@ var Sortable = {
|
||||||
children: [],
|
children: [],
|
||||||
position: parent.children.length,
|
position: parent.children.length,
|
||||||
container: $(children[i]).down(options.treeTag)
|
container: $(children[i]).down(options.treeTag)
|
||||||
}
|
};
|
||||||
|
|
||||||
/* Get the element containing the children and recurse over it */
|
/* Get the element containing the children and recurse over it */
|
||||||
if (child.container)
|
if (child.container)
|
||||||
this._tree(child.container, options, child)
|
this._tree(child.container, options, child);
|
||||||
|
|
||||||
parent.children.push (child);
|
parent.children.push (child);
|
||||||
}
|
}
|
||||||
|
|
||||||
return parent;
|
return parent;
|
||||||
},
|
},
|
||||||
|
|
||||||
tree: function(element) {
|
tree: function(element) {
|
||||||
|
@ -873,15 +874,15 @@ var Sortable = {
|
||||||
name: element.id,
|
name: element.id,
|
||||||
format: sortableOptions.format
|
format: sortableOptions.format
|
||||||
}, arguments[1] || { });
|
}, arguments[1] || { });
|
||||||
|
|
||||||
var root = {
|
var root = {
|
||||||
id: null,
|
id: null,
|
||||||
parent: null,
|
parent: null,
|
||||||
children: [],
|
children: [],
|
||||||
container: element,
|
container: element,
|
||||||
position: 0
|
position: 0
|
||||||
}
|
};
|
||||||
|
|
||||||
return Sortable._tree(element, options, root);
|
return Sortable._tree(element, options, root);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -897,7 +898,7 @@ var Sortable = {
|
||||||
sequence: function(element) {
|
sequence: function(element) {
|
||||||
element = $(element);
|
element = $(element);
|
||||||
var options = Object.extend(this.options(element), arguments[1] || { });
|
var options = Object.extend(this.options(element), arguments[1] || { });
|
||||||
|
|
||||||
return $(this.findElements(element, options) || []).map( function(item) {
|
return $(this.findElements(element, options) || []).map( function(item) {
|
||||||
return item.id.match(options.format) ? item.id.match(options.format)[1] : '';
|
return item.id.match(options.format) ? item.id.match(options.format)[1] : '';
|
||||||
});
|
});
|
||||||
|
@ -906,14 +907,14 @@ var Sortable = {
|
||||||
setSequence: function(element, new_sequence) {
|
setSequence: function(element, new_sequence) {
|
||||||
element = $(element);
|
element = $(element);
|
||||||
var options = Object.extend(this.options(element), arguments[2] || { });
|
var options = Object.extend(this.options(element), arguments[2] || { });
|
||||||
|
|
||||||
var nodeMap = { };
|
var nodeMap = { };
|
||||||
this.findElements(element, options).each( function(n) {
|
this.findElements(element, options).each( function(n) {
|
||||||
if (n.id.match(options.format))
|
if (n.id.match(options.format))
|
||||||
nodeMap[n.id.match(options.format)[1]] = [n, n.parentNode];
|
nodeMap[n.id.match(options.format)[1]] = [n, n.parentNode];
|
||||||
n.parentNode.removeChild(n);
|
n.parentNode.removeChild(n);
|
||||||
});
|
});
|
||||||
|
|
||||||
new_sequence.each(function(ident) {
|
new_sequence.each(function(ident) {
|
||||||
var n = nodeMap[ident];
|
var n = nodeMap[ident];
|
||||||
if (n) {
|
if (n) {
|
||||||
|
@ -922,16 +923,16 @@ var Sortable = {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
serialize: function(element) {
|
serialize: function(element) {
|
||||||
element = $(element);
|
element = $(element);
|
||||||
var options = Object.extend(Sortable.options(element), arguments[1] || { });
|
var options = Object.extend(Sortable.options(element), arguments[1] || { });
|
||||||
var name = encodeURIComponent(
|
var name = encodeURIComponent(
|
||||||
(arguments[1] && arguments[1].name) ? arguments[1].name : element.id);
|
(arguments[1] && arguments[1].name) ? arguments[1].name : element.id);
|
||||||
|
|
||||||
if (options.tree) {
|
if (options.tree) {
|
||||||
return Sortable.tree(element, arguments[1]).children.map( function (item) {
|
return Sortable.tree(element, arguments[1]).children.map( function (item) {
|
||||||
return [name + Sortable._constructIndex(item) + "[id]=" +
|
return [name + Sortable._constructIndex(item) + "[id]=" +
|
||||||
encodeURIComponent(item.id)].concat(item.children.map(arguments.callee));
|
encodeURIComponent(item.id)].concat(item.children.map(arguments.callee));
|
||||||
}).flatten().join('&');
|
}).flatten().join('&');
|
||||||
} else {
|
} else {
|
||||||
|
@ -940,16 +941,16 @@ var Sortable = {
|
||||||
}).join('&');
|
}).join('&');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
|
|
||||||
// Returns true if child is contained within element
|
// Returns true if child is contained within element
|
||||||
Element.isParent = function(child, element) {
|
Element.isParent = function(child, element) {
|
||||||
if (!child.parentNode || child == element) return false;
|
if (!child.parentNode || child == element) return false;
|
||||||
if (child.parentNode == element) return true;
|
if (child.parentNode == element) return true;
|
||||||
return Element.isParent(child.parentNode, element);
|
return Element.isParent(child.parentNode, element);
|
||||||
}
|
};
|
||||||
|
|
||||||
Element.findChildren = function(element, only, recursive, tagName) {
|
Element.findChildren = function(element, only, recursive, tagName) {
|
||||||
if(!element.hasChildNodes()) return null;
|
if(!element.hasChildNodes()) return null;
|
||||||
tagName = tagName.toUpperCase();
|
tagName = tagName.toUpperCase();
|
||||||
if(only) only = [only].flatten();
|
if(only) only = [only].flatten();
|
||||||
|
@ -965,8 +966,8 @@ Element.findChildren = function(element, only, recursive, tagName) {
|
||||||
});
|
});
|
||||||
|
|
||||||
return (elements.length>0 ? elements.flatten() : []);
|
return (elements.length>0 ? elements.flatten() : []);
|
||||||
}
|
};
|
||||||
|
|
||||||
Element.offsetSize = function (element, type) {
|
Element.offsetSize = function (element, type) {
|
||||||
return element['offset' + ((type=='vertical' || type=='height') ? 'Height' : 'Width')];
|
return element['offset' + ((type=='vertical' || type=='height') ? 'Height' : 'Width')];
|
||||||
}
|
};
|
338
public/javascripts/effects.js
vendored
338
public/javascripts/effects.js
vendored
|
@ -3,46 +3,46 @@
|
||||||
// Justin Palmer (http://encytemedia.com/)
|
// Justin Palmer (http://encytemedia.com/)
|
||||||
// Mark Pilgrim (http://diveintomark.org/)
|
// Mark Pilgrim (http://diveintomark.org/)
|
||||||
// Martin Bialasinki
|
// Martin Bialasinki
|
||||||
//
|
//
|
||||||
// script.aculo.us is freely distributable under the terms of an MIT-style license.
|
// script.aculo.us is freely distributable under the terms of an MIT-style license.
|
||||||
// For details, see the script.aculo.us web site: http://script.aculo.us/
|
// For details, see the script.aculo.us web site: http://script.aculo.us/
|
||||||
|
|
||||||
// converts rgb() and #xxx to #xxxxxx format,
|
// converts rgb() and #xxx to #xxxxxx format,
|
||||||
// returns self (or first argument) if not convertable
|
// returns self (or first argument) if not convertable
|
||||||
String.prototype.parseColor = function() {
|
String.prototype.parseColor = function() {
|
||||||
var color = '#';
|
var color = '#';
|
||||||
if (this.slice(0,4) == 'rgb(') {
|
if (this.slice(0,4) == 'rgb(') {
|
||||||
var cols = this.slice(4,this.length-1).split(',');
|
var cols = this.slice(4,this.length-1).split(',');
|
||||||
var i=0; do { color += parseInt(cols[i]).toColorPart() } while (++i<3);
|
var i=0; do { color += parseInt(cols[i]).toColorPart() } while (++i<3);
|
||||||
} else {
|
} else {
|
||||||
if (this.slice(0,1) == '#') {
|
if (this.slice(0,1) == '#') {
|
||||||
if (this.length==4) for(var i=1;i<4;i++) color += (this.charAt(i) + this.charAt(i)).toLowerCase();
|
if (this.length==4) for(var i=1;i<4;i++) color += (this.charAt(i) + this.charAt(i)).toLowerCase();
|
||||||
if (this.length==7) color = this.toLowerCase();
|
if (this.length==7) color = this.toLowerCase();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return (color.length==7 ? color : (arguments[0] || this));
|
return (color.length==7 ? color : (arguments[0] || this));
|
||||||
};
|
};
|
||||||
|
|
||||||
/*--------------------------------------------------------------------------*/
|
/*--------------------------------------------------------------------------*/
|
||||||
|
|
||||||
Element.collectTextNodes = function(element) {
|
Element.collectTextNodes = function(element) {
|
||||||
return $A($(element).childNodes).collect( function(node) {
|
return $A($(element).childNodes).collect( function(node) {
|
||||||
return (node.nodeType==3 ? node.nodeValue :
|
return (node.nodeType==3 ? node.nodeValue :
|
||||||
(node.hasChildNodes() ? Element.collectTextNodes(node) : ''));
|
(node.hasChildNodes() ? Element.collectTextNodes(node) : ''));
|
||||||
}).flatten().join('');
|
}).flatten().join('');
|
||||||
};
|
};
|
||||||
|
|
||||||
Element.collectTextNodesIgnoreClass = function(element, className) {
|
Element.collectTextNodesIgnoreClass = function(element, className) {
|
||||||
return $A($(element).childNodes).collect( function(node) {
|
return $A($(element).childNodes).collect( function(node) {
|
||||||
return (node.nodeType==3 ? node.nodeValue :
|
return (node.nodeType==3 ? node.nodeValue :
|
||||||
((node.hasChildNodes() && !Element.hasClassName(node,className)) ?
|
((node.hasChildNodes() && !Element.hasClassName(node,className)) ?
|
||||||
Element.collectTextNodesIgnoreClass(node, className) : ''));
|
Element.collectTextNodesIgnoreClass(node, className) : ''));
|
||||||
}).flatten().join('');
|
}).flatten().join('');
|
||||||
};
|
};
|
||||||
|
|
||||||
Element.setContentZoom = function(element, percent) {
|
Element.setContentZoom = function(element, percent) {
|
||||||
element = $(element);
|
element = $(element);
|
||||||
element.setStyle({fontSize: (percent/100) + 'em'});
|
element.setStyle({fontSize: (percent/100) + 'em'});
|
||||||
if (Prototype.Browser.WebKit) window.scrollBy(0,0);
|
if (Prototype.Browser.WebKit) window.scrollBy(0,0);
|
||||||
return element;
|
return element;
|
||||||
};
|
};
|
||||||
|
@ -70,28 +70,23 @@ var Effect = {
|
||||||
Transitions: {
|
Transitions: {
|
||||||
linear: Prototype.K,
|
linear: Prototype.K,
|
||||||
sinoidal: function(pos) {
|
sinoidal: function(pos) {
|
||||||
return (-Math.cos(pos*Math.PI)/2) + 0.5;
|
return (-Math.cos(pos*Math.PI)/2) + .5;
|
||||||
},
|
},
|
||||||
reverse: function(pos) {
|
reverse: function(pos) {
|
||||||
return 1-pos;
|
return 1-pos;
|
||||||
},
|
},
|
||||||
flicker: function(pos) {
|
flicker: function(pos) {
|
||||||
var pos = ((-Math.cos(pos*Math.PI)/4) + 0.75) + Math.random()/4;
|
var pos = ((-Math.cos(pos*Math.PI)/4) + .75) + Math.random()/4;
|
||||||
return pos > 1 ? 1 : pos;
|
return pos > 1 ? 1 : pos;
|
||||||
},
|
},
|
||||||
wobble: function(pos) {
|
wobble: function(pos) {
|
||||||
return (-Math.cos(pos*Math.PI*(9*pos))/2) + 0.5;
|
return (-Math.cos(pos*Math.PI*(9*pos))/2) + .5;
|
||||||
},
|
},
|
||||||
pulse: function(pos, pulses) {
|
pulse: function(pos, pulses) {
|
||||||
pulses = pulses || 5;
|
return (-Math.cos((pos*((pulses||5)-.5)*2)*Math.PI)/2) + .5;
|
||||||
return (
|
|
||||||
((pos % (1/pulses)) * pulses).round() == 0 ?
|
|
||||||
((pos * pulses * 2) - (pos * pulses * 2).floor()) :
|
|
||||||
1 - ((pos * pulses * 2) - (pos * pulses * 2).floor())
|
|
||||||
);
|
|
||||||
},
|
},
|
||||||
spring: function(pos) {
|
spring: function(pos) {
|
||||||
return 1 - (Math.cos(pos * 4.5 * Math.PI) * Math.exp(-pos * 6));
|
return 1 - (Math.cos(pos * 4.5 * Math.PI) * Math.exp(-pos * 6));
|
||||||
},
|
},
|
||||||
none: function(pos) {
|
none: function(pos) {
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -112,14 +107,14 @@ var Effect = {
|
||||||
tagifyText: function(element) {
|
tagifyText: function(element) {
|
||||||
var tagifyStyle = 'position:relative';
|
var tagifyStyle = 'position:relative';
|
||||||
if (Prototype.Browser.IE) tagifyStyle += ';zoom:1';
|
if (Prototype.Browser.IE) tagifyStyle += ';zoom:1';
|
||||||
|
|
||||||
element = $(element);
|
element = $(element);
|
||||||
$A(element.childNodes).each( function(child) {
|
$A(element.childNodes).each( function(child) {
|
||||||
if (child.nodeType==3) {
|
if (child.nodeType==3) {
|
||||||
child.nodeValue.toArray().each( function(character) {
|
child.nodeValue.toArray().each( function(character) {
|
||||||
element.insertBefore(
|
element.insertBefore(
|
||||||
new Element('span', {style: tagifyStyle}).update(
|
new Element('span', {style: tagifyStyle}).update(
|
||||||
character == ' ' ? String.fromCharCode(160) : character),
|
character == ' ' ? String.fromCharCode(160) : character),
|
||||||
child);
|
child);
|
||||||
});
|
});
|
||||||
Element.remove(child);
|
Element.remove(child);
|
||||||
|
@ -128,13 +123,13 @@ var Effect = {
|
||||||
},
|
},
|
||||||
multiple: function(element, effect) {
|
multiple: function(element, effect) {
|
||||||
var elements;
|
var elements;
|
||||||
if (((typeof element == 'object') ||
|
if (((typeof element == 'object') ||
|
||||||
Object.isFunction(element)) &&
|
Object.isFunction(element)) &&
|
||||||
(element.length))
|
(element.length))
|
||||||
elements = element;
|
elements = element;
|
||||||
else
|
else
|
||||||
elements = $(element).childNodes;
|
elements = $(element).childNodes;
|
||||||
|
|
||||||
var options = Object.extend({
|
var options = Object.extend({
|
||||||
speed: 0.1,
|
speed: 0.1,
|
||||||
delay: 0.0
|
delay: 0.0
|
||||||
|
@ -156,7 +151,7 @@ var Effect = {
|
||||||
var options = Object.extend({
|
var options = Object.extend({
|
||||||
queue: { position:'end', scope:(element.id || 'global'), limit: 1 }
|
queue: { position:'end', scope:(element.id || 'global'), limit: 1 }
|
||||||
}, arguments[2] || { });
|
}, arguments[2] || { });
|
||||||
Effect[element.visible() ?
|
Effect[element.visible() ?
|
||||||
Effect.PAIRS[effect][1] : Effect.PAIRS[effect][0]](element, options);
|
Effect.PAIRS[effect][1] : Effect.PAIRS[effect][0]](element, options);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -168,20 +163,20 @@ Effect.DefaultOptions.transition = Effect.Transitions.sinoidal;
|
||||||
Effect.ScopedQueue = Class.create(Enumerable, {
|
Effect.ScopedQueue = Class.create(Enumerable, {
|
||||||
initialize: function() {
|
initialize: function() {
|
||||||
this.effects = [];
|
this.effects = [];
|
||||||
this.interval = null;
|
this.interval = null;
|
||||||
},
|
},
|
||||||
_each: function(iterator) {
|
_each: function(iterator) {
|
||||||
this.effects._each(iterator);
|
this.effects._each(iterator);
|
||||||
},
|
},
|
||||||
add: function(effect) {
|
add: function(effect) {
|
||||||
var timestamp = new Date().getTime();
|
var timestamp = new Date().getTime();
|
||||||
|
|
||||||
var position = Object.isString(effect.options.queue) ?
|
var position = Object.isString(effect.options.queue) ?
|
||||||
effect.options.queue : effect.options.queue.position;
|
effect.options.queue : effect.options.queue.position;
|
||||||
|
|
||||||
switch(position) {
|
switch(position) {
|
||||||
case 'front':
|
case 'front':
|
||||||
// move unstarted effects after this effect
|
// move unstarted effects after this effect
|
||||||
this.effects.findAll(function(e){ return e.state=='idle' }).each( function(e) {
|
this.effects.findAll(function(e){ return e.state=='idle' }).each( function(e) {
|
||||||
e.startOn += effect.finishOn;
|
e.startOn += effect.finishOn;
|
||||||
e.finishOn += effect.finishOn;
|
e.finishOn += effect.finishOn;
|
||||||
|
@ -195,13 +190,13 @@ Effect.ScopedQueue = Class.create(Enumerable, {
|
||||||
timestamp = this.effects.pluck('finishOn').max() || timestamp;
|
timestamp = this.effects.pluck('finishOn').max() || timestamp;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
effect.startOn += timestamp;
|
effect.startOn += timestamp;
|
||||||
effect.finishOn += timestamp;
|
effect.finishOn += timestamp;
|
||||||
|
|
||||||
if (!effect.options.queue.limit || (this.effects.length < effect.options.queue.limit))
|
if (!effect.options.queue.limit || (this.effects.length < effect.options.queue.limit))
|
||||||
this.effects.push(effect);
|
this.effects.push(effect);
|
||||||
|
|
||||||
if (!this.interval)
|
if (!this.interval)
|
||||||
this.interval = setInterval(this.loop.bind(this), 15);
|
this.interval = setInterval(this.loop.bind(this), 15);
|
||||||
},
|
},
|
||||||
|
@ -214,7 +209,7 @@ Effect.ScopedQueue = Class.create(Enumerable, {
|
||||||
},
|
},
|
||||||
loop: function() {
|
loop: function() {
|
||||||
var timePos = new Date().getTime();
|
var timePos = new Date().getTime();
|
||||||
for(var i=0, len=this.effects.length;i<len;i++)
|
for(var i=0, len=this.effects.length;i<len;i++)
|
||||||
this.effects[i] && this.effects[i].loop(timePos);
|
this.effects[i] && this.effects[i].loop(timePos);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -223,7 +218,7 @@ Effect.Queues = {
|
||||||
instances: $H(),
|
instances: $H(),
|
||||||
get: function(queueName) {
|
get: function(queueName) {
|
||||||
if (!Object.isString(queueName)) return queueName;
|
if (!Object.isString(queueName)) return queueName;
|
||||||
|
|
||||||
return this.instances.get(queueName) ||
|
return this.instances.get(queueName) ||
|
||||||
this.instances.set(queueName, new Effect.ScopedQueue());
|
this.instances.set(queueName, new Effect.ScopedQueue());
|
||||||
}
|
}
|
||||||
|
@ -248,23 +243,35 @@ Effect.Base = Class.create({
|
||||||
this.fromToDelta = this.options.to-this.options.from;
|
this.fromToDelta = this.options.to-this.options.from;
|
||||||
this.totalTime = this.finishOn-this.startOn;
|
this.totalTime = this.finishOn-this.startOn;
|
||||||
this.totalFrames = this.options.fps*this.options.duration;
|
this.totalFrames = this.options.fps*this.options.duration;
|
||||||
|
|
||||||
eval('this.render = function(pos){ '+
|
this.render = (function() {
|
||||||
'if (this.state=="idle"){this.state="running";'+
|
function dispatch(effect, eventName) {
|
||||||
codeForEvent(this.options,'beforeSetup')+
|
if (effect.options[eventName + 'Internal'])
|
||||||
(this.setup ? 'this.setup();':'')+
|
effect.options[eventName + 'Internal'](effect);
|
||||||
codeForEvent(this.options,'afterSetup')+
|
if (effect.options[eventName])
|
||||||
'};if (this.state=="running"){'+
|
effect.options[eventName](effect);
|
||||||
'pos=this.options.transition(pos)*'+this.fromToDelta+'+'+this.options.from+';'+
|
}
|
||||||
'this.position=pos;'+
|
|
||||||
codeForEvent(this.options,'beforeUpdate')+
|
return function(pos) {
|
||||||
(this.update ? 'this.update(pos);':'')+
|
if (this.state === "idle") {
|
||||||
codeForEvent(this.options,'afterUpdate')+
|
this.state = "running";
|
||||||
'}}');
|
dispatch(this, 'beforeSetup');
|
||||||
|
if (this.setup) this.setup();
|
||||||
|
dispatch(this, 'afterSetup');
|
||||||
|
}
|
||||||
|
if (this.state === "running") {
|
||||||
|
pos = (this.options.transition(pos) * this.fromToDelta) + this.options.from;
|
||||||
|
this.position = pos;
|
||||||
|
dispatch(this, 'beforeUpdate');
|
||||||
|
if (this.update) this.update(pos);
|
||||||
|
dispatch(this, 'afterUpdate');
|
||||||
|
}
|
||||||
|
};
|
||||||
|
})();
|
||||||
|
|
||||||
this.event('beforeStart');
|
this.event('beforeStart');
|
||||||
if (!this.options.sync)
|
if (!this.options.sync)
|
||||||
Effect.Queues.get(Object.isString(this.options.queue) ?
|
Effect.Queues.get(Object.isString(this.options.queue) ?
|
||||||
'global' : this.options.queue.scope).add(this);
|
'global' : this.options.queue.scope).add(this);
|
||||||
},
|
},
|
||||||
loop: function(timePos) {
|
loop: function(timePos) {
|
||||||
|
@ -273,9 +280,9 @@ Effect.Base = Class.create({
|
||||||
this.render(1.0);
|
this.render(1.0);
|
||||||
this.cancel();
|
this.cancel();
|
||||||
this.event('beforeFinish');
|
this.event('beforeFinish');
|
||||||
if (this.finish) this.finish();
|
if (this.finish) this.finish();
|
||||||
this.event('afterFinish');
|
this.event('afterFinish');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
var pos = (timePos - this.startOn) / this.totalTime,
|
var pos = (timePos - this.startOn) / this.totalTime,
|
||||||
frame = (pos * this.totalFrames).round();
|
frame = (pos * this.totalFrames).round();
|
||||||
|
@ -287,7 +294,7 @@ Effect.Base = Class.create({
|
||||||
},
|
},
|
||||||
cancel: function() {
|
cancel: function() {
|
||||||
if (!this.options.sync)
|
if (!this.options.sync)
|
||||||
Effect.Queues.get(Object.isString(this.options.queue) ?
|
Effect.Queues.get(Object.isString(this.options.queue) ?
|
||||||
'global' : this.options.queue.scope).remove(this);
|
'global' : this.options.queue.scope).remove(this);
|
||||||
this.state = 'finished';
|
this.state = 'finished';
|
||||||
},
|
},
|
||||||
|
@ -325,10 +332,10 @@ Effect.Parallel = Class.create(Effect.Base, {
|
||||||
Effect.Tween = Class.create(Effect.Base, {
|
Effect.Tween = Class.create(Effect.Base, {
|
||||||
initialize: function(object, from, to) {
|
initialize: function(object, from, to) {
|
||||||
object = Object.isString(object) ? $(object) : object;
|
object = Object.isString(object) ? $(object) : object;
|
||||||
var args = $A(arguments), method = args.last(),
|
var args = $A(arguments), method = args.last(),
|
||||||
options = args.length == 5 ? args[3] : null;
|
options = args.length == 5 ? args[3] : null;
|
||||||
this.method = Object.isFunction(method) ? method.bind(object) :
|
this.method = Object.isFunction(method) ? method.bind(object) :
|
||||||
Object.isFunction(object[method]) ? object[method].bind(object) :
|
Object.isFunction(object[method]) ? object[method].bind(object) :
|
||||||
function(value) { object[method] = value };
|
function(value) { object[method] = value };
|
||||||
this.start(Object.extend({ from: from, to: to }, options || { }));
|
this.start(Object.extend({ from: from, to: to }, options || { }));
|
||||||
},
|
},
|
||||||
|
@ -392,7 +399,7 @@ Effect.Move = Class.create(Effect.Base, {
|
||||||
|
|
||||||
// for backwards compatibility
|
// for backwards compatibility
|
||||||
Effect.MoveBy = function(element, toTop, toLeft) {
|
Effect.MoveBy = function(element, toTop, toLeft) {
|
||||||
return new Effect.Move(element,
|
return new Effect.Move(element,
|
||||||
Object.extend({ x: toLeft, y: toTop }, arguments[3] || { }));
|
Object.extend({ x: toLeft, y: toTop }, arguments[3] || { }));
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -414,15 +421,15 @@ Effect.Scale = Class.create(Effect.Base, {
|
||||||
setup: function() {
|
setup: function() {
|
||||||
this.restoreAfterFinish = this.options.restoreAfterFinish || false;
|
this.restoreAfterFinish = this.options.restoreAfterFinish || false;
|
||||||
this.elementPositioning = this.element.getStyle('position');
|
this.elementPositioning = this.element.getStyle('position');
|
||||||
|
|
||||||
this.originalStyle = { };
|
this.originalStyle = { };
|
||||||
['top','left','width','height','fontSize'].each( function(k) {
|
['top','left','width','height','fontSize'].each( function(k) {
|
||||||
this.originalStyle[k] = this.element.style[k];
|
this.originalStyle[k] = this.element.style[k];
|
||||||
}.bind(this));
|
}.bind(this));
|
||||||
|
|
||||||
this.originalTop = this.element.offsetTop;
|
this.originalTop = this.element.offsetTop;
|
||||||
this.originalLeft = this.element.offsetLeft;
|
this.originalLeft = this.element.offsetLeft;
|
||||||
|
|
||||||
var fontSize = this.element.getStyle('font-size') || '100%';
|
var fontSize = this.element.getStyle('font-size') || '100%';
|
||||||
['em','px','%','pt'].each( function(fontSizeType) {
|
['em','px','%','pt'].each( function(fontSizeType) {
|
||||||
if (fontSize.indexOf(fontSizeType)>0) {
|
if (fontSize.indexOf(fontSizeType)>0) {
|
||||||
|
@ -430,9 +437,9 @@ Effect.Scale = Class.create(Effect.Base, {
|
||||||
this.fontSizeType = fontSizeType;
|
this.fontSizeType = fontSizeType;
|
||||||
}
|
}
|
||||||
}.bind(this));
|
}.bind(this));
|
||||||
|
|
||||||
this.factor = (this.options.scaleTo - this.options.scaleFrom)/100;
|
this.factor = (this.options.scaleTo - this.options.scaleFrom)/100;
|
||||||
|
|
||||||
this.dims = null;
|
this.dims = null;
|
||||||
if (this.options.scaleMode=='box')
|
if (this.options.scaleMode=='box')
|
||||||
this.dims = [this.element.offsetHeight, this.element.offsetWidth];
|
this.dims = [this.element.offsetHeight, this.element.offsetWidth];
|
||||||
|
@ -507,17 +514,16 @@ Effect.Highlight = Class.create(Effect.Base, {
|
||||||
|
|
||||||
Effect.ScrollTo = function(element) {
|
Effect.ScrollTo = function(element) {
|
||||||
var options = arguments[1] || { },
|
var options = arguments[1] || { },
|
||||||
scrollOffsets = document.viewport.getScrollOffsets(),
|
scrollOffsets = document.viewport.getScrollOffsets(),
|
||||||
elementOffsets = $(element).cumulativeOffset(),
|
elementOffsets = $(element).cumulativeOffset();
|
||||||
max = (window.height || document.body.scrollHeight) - document.viewport.getHeight();
|
|
||||||
|
|
||||||
if (options.offset) elementOffsets[1] += options.offset;
|
if (options.offset) elementOffsets[1] += options.offset;
|
||||||
|
|
||||||
return new Effect.Tween(null,
|
return new Effect.Tween(null,
|
||||||
scrollOffsets.top,
|
scrollOffsets.top,
|
||||||
elementOffsets[1] > max ? max : elementOffsets[1],
|
elementOffsets[1],
|
||||||
options,
|
options,
|
||||||
function(p){ scrollTo(scrollOffsets.left, p.round()) }
|
function(p){ scrollTo(scrollOffsets.left, p.round()); }
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -529,9 +535,9 @@ Effect.Fade = function(element) {
|
||||||
var options = Object.extend({
|
var options = Object.extend({
|
||||||
from: element.getOpacity() || 1.0,
|
from: element.getOpacity() || 1.0,
|
||||||
to: 0.0,
|
to: 0.0,
|
||||||
afterFinishInternal: function(effect) {
|
afterFinishInternal: function(effect) {
|
||||||
if (effect.options.to!=0) return;
|
if (effect.options.to!=0) return;
|
||||||
effect.element.hide().setStyle({opacity: oldOpacity});
|
effect.element.hide().setStyle({opacity: oldOpacity});
|
||||||
}
|
}
|
||||||
}, arguments[1] || { });
|
}, arguments[1] || { });
|
||||||
return new Effect.Opacity(element,options);
|
return new Effect.Opacity(element,options);
|
||||||
|
@ -547,15 +553,15 @@ Effect.Appear = function(element) {
|
||||||
effect.element.forceRerendering();
|
effect.element.forceRerendering();
|
||||||
},
|
},
|
||||||
beforeSetup: function(effect) {
|
beforeSetup: function(effect) {
|
||||||
effect.element.setOpacity(effect.options.from).show();
|
effect.element.setOpacity(effect.options.from).show();
|
||||||
}}, arguments[1] || { });
|
}}, arguments[1] || { });
|
||||||
return new Effect.Opacity(element,options);
|
return new Effect.Opacity(element,options);
|
||||||
};
|
};
|
||||||
|
|
||||||
Effect.Puff = function(element) {
|
Effect.Puff = function(element) {
|
||||||
element = $(element);
|
element = $(element);
|
||||||
var oldStyle = {
|
var oldStyle = {
|
||||||
opacity: element.getInlineOpacity(),
|
opacity: element.getInlineOpacity(),
|
||||||
position: element.getStyle('position'),
|
position: element.getStyle('position'),
|
||||||
top: element.style.top,
|
top: element.style.top,
|
||||||
left: element.style.left,
|
left: element.style.left,
|
||||||
|
@ -563,12 +569,12 @@ Effect.Puff = function(element) {
|
||||||
height: element.style.height
|
height: element.style.height
|
||||||
};
|
};
|
||||||
return new Effect.Parallel(
|
return new Effect.Parallel(
|
||||||
[ new Effect.Scale(element, 200,
|
[ new Effect.Scale(element, 200,
|
||||||
{ sync: true, scaleFromCenter: true, scaleContent: true, restoreAfterFinish: true }),
|
{ sync: true, scaleFromCenter: true, scaleContent: true, restoreAfterFinish: true }),
|
||||||
new Effect.Opacity(element, { sync: true, to: 0.0 } ) ],
|
new Effect.Opacity(element, { sync: true, to: 0.0 } ) ],
|
||||||
Object.extend({ duration: 1.0,
|
Object.extend({ duration: 1.0,
|
||||||
beforeSetupInternal: function(effect) {
|
beforeSetupInternal: function(effect) {
|
||||||
Position.absolutize(effect.effects[0].element)
|
Position.absolutize(effect.effects[0].element);
|
||||||
},
|
},
|
||||||
afterFinishInternal: function(effect) {
|
afterFinishInternal: function(effect) {
|
||||||
effect.effects[0].element.hide().setStyle(oldStyle); }
|
effect.effects[0].element.hide().setStyle(oldStyle); }
|
||||||
|
@ -580,12 +586,12 @@ Effect.BlindUp = function(element) {
|
||||||
element = $(element);
|
element = $(element);
|
||||||
element.makeClipping();
|
element.makeClipping();
|
||||||
return new Effect.Scale(element, 0,
|
return new Effect.Scale(element, 0,
|
||||||
Object.extend({ scaleContent: false,
|
Object.extend({ scaleContent: false,
|
||||||
scaleX: false,
|
scaleX: false,
|
||||||
restoreAfterFinish: true,
|
restoreAfterFinish: true,
|
||||||
afterFinishInternal: function(effect) {
|
afterFinishInternal: function(effect) {
|
||||||
effect.element.hide().undoClipping();
|
effect.element.hide().undoClipping();
|
||||||
}
|
}
|
||||||
}, arguments[1] || { })
|
}, arguments[1] || { })
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
@ -593,15 +599,15 @@ Effect.BlindUp = function(element) {
|
||||||
Effect.BlindDown = function(element) {
|
Effect.BlindDown = function(element) {
|
||||||
element = $(element);
|
element = $(element);
|
||||||
var elementDimensions = element.getDimensions();
|
var elementDimensions = element.getDimensions();
|
||||||
return new Effect.Scale(element, 100, Object.extend({
|
return new Effect.Scale(element, 100, Object.extend({
|
||||||
scaleContent: false,
|
scaleContent: false,
|
||||||
scaleX: false,
|
scaleX: false,
|
||||||
scaleFrom: 0,
|
scaleFrom: 0,
|
||||||
scaleMode: {originalHeight: elementDimensions.height, originalWidth: elementDimensions.width},
|
scaleMode: {originalHeight: elementDimensions.height, originalWidth: elementDimensions.width},
|
||||||
restoreAfterFinish: true,
|
restoreAfterFinish: true,
|
||||||
afterSetup: function(effect) {
|
afterSetup: function(effect) {
|
||||||
effect.element.makeClipping().setStyle({height: '0px'}).show();
|
effect.element.makeClipping().setStyle({height: '0px'}).show();
|
||||||
},
|
},
|
||||||
afterFinishInternal: function(effect) {
|
afterFinishInternal: function(effect) {
|
||||||
effect.element.undoClipping();
|
effect.element.undoClipping();
|
||||||
}
|
}
|
||||||
|
@ -616,16 +622,16 @@ Effect.SwitchOff = function(element) {
|
||||||
from: 0,
|
from: 0,
|
||||||
transition: Effect.Transitions.flicker,
|
transition: Effect.Transitions.flicker,
|
||||||
afterFinishInternal: function(effect) {
|
afterFinishInternal: function(effect) {
|
||||||
new Effect.Scale(effect.element, 1, {
|
new Effect.Scale(effect.element, 1, {
|
||||||
duration: 0.3, scaleFromCenter: true,
|
duration: 0.3, scaleFromCenter: true,
|
||||||
scaleX: false, scaleContent: false, restoreAfterFinish: true,
|
scaleX: false, scaleContent: false, restoreAfterFinish: true,
|
||||||
beforeSetup: function(effect) {
|
beforeSetup: function(effect) {
|
||||||
effect.element.makePositioned().makeClipping();
|
effect.element.makePositioned().makeClipping();
|
||||||
},
|
},
|
||||||
afterFinishInternal: function(effect) {
|
afterFinishInternal: function(effect) {
|
||||||
effect.element.hide().undoClipping().undoPositioned().setStyle({opacity: oldOpacity});
|
effect.element.hide().undoClipping().undoPositioned().setStyle({opacity: oldOpacity});
|
||||||
}
|
}
|
||||||
})
|
});
|
||||||
}
|
}
|
||||||
}, arguments[1] || { }));
|
}, arguments[1] || { }));
|
||||||
};
|
};
|
||||||
|
@ -637,16 +643,16 @@ Effect.DropOut = function(element) {
|
||||||
left: element.getStyle('left'),
|
left: element.getStyle('left'),
|
||||||
opacity: element.getInlineOpacity() };
|
opacity: element.getInlineOpacity() };
|
||||||
return new Effect.Parallel(
|
return new Effect.Parallel(
|
||||||
[ new Effect.Move(element, {x: 0, y: 100, sync: true }),
|
[ new Effect.Move(element, {x: 0, y: 100, sync: true }),
|
||||||
new Effect.Opacity(element, { sync: true, to: 0.0 }) ],
|
new Effect.Opacity(element, { sync: true, to: 0.0 }) ],
|
||||||
Object.extend(
|
Object.extend(
|
||||||
{ duration: 0.5,
|
{ duration: 0.5,
|
||||||
beforeSetup: function(effect) {
|
beforeSetup: function(effect) {
|
||||||
effect.effects[0].element.makePositioned();
|
effect.effects[0].element.makePositioned();
|
||||||
},
|
},
|
||||||
afterFinishInternal: function(effect) {
|
afterFinishInternal: function(effect) {
|
||||||
effect.effects[0].element.hide().undoPositioned().setStyle(oldStyle);
|
effect.effects[0].element.hide().undoPositioned().setStyle(oldStyle);
|
||||||
}
|
}
|
||||||
}, arguments[1] || { }));
|
}, arguments[1] || { }));
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -674,7 +680,7 @@ Effect.Shake = function(element) {
|
||||||
new Effect.Move(effect.element,
|
new Effect.Move(effect.element,
|
||||||
{ x: -distance, y: 0, duration: split, afterFinishInternal: function(effect) {
|
{ x: -distance, y: 0, duration: split, afterFinishInternal: function(effect) {
|
||||||
effect.element.undoPositioned().setStyle(oldStyle);
|
effect.element.undoPositioned().setStyle(oldStyle);
|
||||||
}}) }}) }}) }}) }}) }});
|
}}); }}); }}); }}); }}); }});
|
||||||
};
|
};
|
||||||
|
|
||||||
Effect.SlideDown = function(element) {
|
Effect.SlideDown = function(element) {
|
||||||
|
@ -682,9 +688,9 @@ Effect.SlideDown = function(element) {
|
||||||
// SlideDown need to have the content of the element wrapped in a container element with fixed height!
|
// SlideDown need to have the content of the element wrapped in a container element with fixed height!
|
||||||
var oldInnerBottom = element.down().getStyle('bottom');
|
var oldInnerBottom = element.down().getStyle('bottom');
|
||||||
var elementDimensions = element.getDimensions();
|
var elementDimensions = element.getDimensions();
|
||||||
return new Effect.Scale(element, 100, Object.extend({
|
return new Effect.Scale(element, 100, Object.extend({
|
||||||
scaleContent: false,
|
scaleContent: false,
|
||||||
scaleX: false,
|
scaleX: false,
|
||||||
scaleFrom: window.opera ? 0 : 1,
|
scaleFrom: window.opera ? 0 : 1,
|
||||||
scaleMode: {originalHeight: elementDimensions.height, originalWidth: elementDimensions.width},
|
scaleMode: {originalHeight: elementDimensions.height, originalWidth: elementDimensions.width},
|
||||||
restoreAfterFinish: true,
|
restoreAfterFinish: true,
|
||||||
|
@ -692,11 +698,11 @@ Effect.SlideDown = function(element) {
|
||||||
effect.element.makePositioned();
|
effect.element.makePositioned();
|
||||||
effect.element.down().makePositioned();
|
effect.element.down().makePositioned();
|
||||||
if (window.opera) effect.element.setStyle({top: ''});
|
if (window.opera) effect.element.setStyle({top: ''});
|
||||||
effect.element.makeClipping().setStyle({height: '0px'}).show();
|
effect.element.makeClipping().setStyle({height: '0px'}).show();
|
||||||
},
|
},
|
||||||
afterUpdateInternal: function(effect) {
|
afterUpdateInternal: function(effect) {
|
||||||
effect.element.down().setStyle({bottom:
|
effect.element.down().setStyle({bottom:
|
||||||
(effect.dims[0] - effect.element.clientHeight) + 'px' });
|
(effect.dims[0] - effect.element.clientHeight) + 'px' });
|
||||||
},
|
},
|
||||||
afterFinishInternal: function(effect) {
|
afterFinishInternal: function(effect) {
|
||||||
effect.element.undoClipping().undoPositioned();
|
effect.element.undoClipping().undoPositioned();
|
||||||
|
@ -710,8 +716,8 @@ Effect.SlideUp = function(element) {
|
||||||
var oldInnerBottom = element.down().getStyle('bottom');
|
var oldInnerBottom = element.down().getStyle('bottom');
|
||||||
var elementDimensions = element.getDimensions();
|
var elementDimensions = element.getDimensions();
|
||||||
return new Effect.Scale(element, window.opera ? 0 : 1,
|
return new Effect.Scale(element, window.opera ? 0 : 1,
|
||||||
Object.extend({ scaleContent: false,
|
Object.extend({ scaleContent: false,
|
||||||
scaleX: false,
|
scaleX: false,
|
||||||
scaleMode: 'box',
|
scaleMode: 'box',
|
||||||
scaleFrom: 100,
|
scaleFrom: 100,
|
||||||
scaleMode: {originalHeight: elementDimensions.height, originalWidth: elementDimensions.width},
|
scaleMode: {originalHeight: elementDimensions.height, originalWidth: elementDimensions.width},
|
||||||
|
@ -721,7 +727,7 @@ Effect.SlideUp = function(element) {
|
||||||
effect.element.down().makePositioned();
|
effect.element.down().makePositioned();
|
||||||
if (window.opera) effect.element.setStyle({top: ''});
|
if (window.opera) effect.element.setStyle({top: ''});
|
||||||
effect.element.makeClipping().show();
|
effect.element.makeClipping().show();
|
||||||
},
|
},
|
||||||
afterUpdateInternal: function(effect) {
|
afterUpdateInternal: function(effect) {
|
||||||
effect.element.down().setStyle({bottom:
|
effect.element.down().setStyle({bottom:
|
||||||
(effect.dims[0] - effect.element.clientHeight) + 'px' });
|
(effect.dims[0] - effect.element.clientHeight) + 'px' });
|
||||||
|
@ -734,15 +740,15 @@ Effect.SlideUp = function(element) {
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
// Bug in opera makes the TD containing this element expand for a instance after finish
|
// Bug in opera makes the TD containing this element expand for a instance after finish
|
||||||
Effect.Squish = function(element) {
|
Effect.Squish = function(element) {
|
||||||
return new Effect.Scale(element, window.opera ? 1 : 0, {
|
return new Effect.Scale(element, window.opera ? 1 : 0, {
|
||||||
restoreAfterFinish: true,
|
restoreAfterFinish: true,
|
||||||
beforeSetup: function(effect) {
|
beforeSetup: function(effect) {
|
||||||
effect.element.makeClipping();
|
effect.element.makeClipping();
|
||||||
},
|
},
|
||||||
afterFinishInternal: function(effect) {
|
afterFinishInternal: function(effect) {
|
||||||
effect.element.hide().undoClipping();
|
effect.element.hide().undoClipping();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
@ -762,13 +768,13 @@ Effect.Grow = function(element) {
|
||||||
width: element.style.width,
|
width: element.style.width,
|
||||||
opacity: element.getInlineOpacity() };
|
opacity: element.getInlineOpacity() };
|
||||||
|
|
||||||
var dims = element.getDimensions();
|
var dims = element.getDimensions();
|
||||||
var initialMoveX, initialMoveY;
|
var initialMoveX, initialMoveY;
|
||||||
var moveX, moveY;
|
var moveX, moveY;
|
||||||
|
|
||||||
switch (options.direction) {
|
switch (options.direction) {
|
||||||
case 'top-left':
|
case 'top-left':
|
||||||
initialMoveX = initialMoveY = moveX = moveY = 0;
|
initialMoveX = initialMoveY = moveX = moveY = 0;
|
||||||
break;
|
break;
|
||||||
case 'top-right':
|
case 'top-right':
|
||||||
initialMoveX = dims.width;
|
initialMoveX = dims.width;
|
||||||
|
@ -793,11 +799,11 @@ Effect.Grow = function(element) {
|
||||||
moveY = -dims.height / 2;
|
moveY = -dims.height / 2;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
return new Effect.Move(element, {
|
return new Effect.Move(element, {
|
||||||
x: initialMoveX,
|
x: initialMoveX,
|
||||||
y: initialMoveY,
|
y: initialMoveY,
|
||||||
duration: 0.01,
|
duration: 0.01,
|
||||||
beforeSetup: function(effect) {
|
beforeSetup: function(effect) {
|
||||||
effect.element.hide().makeClipping().makePositioned();
|
effect.element.hide().makeClipping().makePositioned();
|
||||||
},
|
},
|
||||||
|
@ -806,17 +812,17 @@ Effect.Grow = function(element) {
|
||||||
[ new Effect.Opacity(effect.element, { sync: true, to: 1.0, from: 0.0, transition: options.opacityTransition }),
|
[ new Effect.Opacity(effect.element, { sync: true, to: 1.0, from: 0.0, transition: options.opacityTransition }),
|
||||||
new Effect.Move(effect.element, { x: moveX, y: moveY, sync: true, transition: options.moveTransition }),
|
new Effect.Move(effect.element, { x: moveX, y: moveY, sync: true, transition: options.moveTransition }),
|
||||||
new Effect.Scale(effect.element, 100, {
|
new Effect.Scale(effect.element, 100, {
|
||||||
scaleMode: { originalHeight: dims.height, originalWidth: dims.width },
|
scaleMode: { originalHeight: dims.height, originalWidth: dims.width },
|
||||||
sync: true, scaleFrom: window.opera ? 1 : 0, transition: options.scaleTransition, restoreAfterFinish: true})
|
sync: true, scaleFrom: window.opera ? 1 : 0, transition: options.scaleTransition, restoreAfterFinish: true})
|
||||||
], Object.extend({
|
], Object.extend({
|
||||||
beforeSetup: function(effect) {
|
beforeSetup: function(effect) {
|
||||||
effect.effects[0].element.setStyle({height: '0px'}).show();
|
effect.effects[0].element.setStyle({height: '0px'}).show();
|
||||||
},
|
},
|
||||||
afterFinishInternal: function(effect) {
|
afterFinishInternal: function(effect) {
|
||||||
effect.effects[0].element.undoClipping().undoPositioned().setStyle(oldStyle);
|
effect.effects[0].element.undoClipping().undoPositioned().setStyle(oldStyle);
|
||||||
}
|
}
|
||||||
}, options)
|
}, options)
|
||||||
)
|
);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
@ -838,7 +844,7 @@ Effect.Shrink = function(element) {
|
||||||
|
|
||||||
var dims = element.getDimensions();
|
var dims = element.getDimensions();
|
||||||
var moveX, moveY;
|
var moveX, moveY;
|
||||||
|
|
||||||
switch (options.direction) {
|
switch (options.direction) {
|
||||||
case 'top-left':
|
case 'top-left':
|
||||||
moveX = moveY = 0;
|
moveX = moveY = 0;
|
||||||
|
@ -855,19 +861,19 @@ Effect.Shrink = function(element) {
|
||||||
moveX = dims.width;
|
moveX = dims.width;
|
||||||
moveY = dims.height;
|
moveY = dims.height;
|
||||||
break;
|
break;
|
||||||
case 'center':
|
case 'center':
|
||||||
moveX = dims.width / 2;
|
moveX = dims.width / 2;
|
||||||
moveY = dims.height / 2;
|
moveY = dims.height / 2;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
return new Effect.Parallel(
|
return new Effect.Parallel(
|
||||||
[ new Effect.Opacity(element, { sync: true, to: 0.0, from: 1.0, transition: options.opacityTransition }),
|
[ new Effect.Opacity(element, { sync: true, to: 0.0, from: 1.0, transition: options.opacityTransition }),
|
||||||
new Effect.Scale(element, window.opera ? 1 : 0, { sync: true, transition: options.scaleTransition, restoreAfterFinish: true}),
|
new Effect.Scale(element, window.opera ? 1 : 0, { sync: true, transition: options.scaleTransition, restoreAfterFinish: true}),
|
||||||
new Effect.Move(element, { x: moveX, y: moveY, sync: true, transition: options.moveTransition })
|
new Effect.Move(element, { x: moveX, y: moveY, sync: true, transition: options.moveTransition })
|
||||||
], Object.extend({
|
], Object.extend({
|
||||||
beforeStartInternal: function(effect) {
|
beforeStartInternal: function(effect) {
|
||||||
effect.effects[0].element.makePositioned().makeClipping();
|
effect.effects[0].element.makePositioned().makeClipping();
|
||||||
},
|
},
|
||||||
afterFinishInternal: function(effect) {
|
afterFinishInternal: function(effect) {
|
||||||
effect.effects[0].element.hide().undoClipping().undoPositioned().setStyle(oldStyle); }
|
effect.effects[0].element.hide().undoClipping().undoPositioned().setStyle(oldStyle); }
|
||||||
|
@ -877,12 +883,14 @@ Effect.Shrink = function(element) {
|
||||||
|
|
||||||
Effect.Pulsate = function(element) {
|
Effect.Pulsate = function(element) {
|
||||||
element = $(element);
|
element = $(element);
|
||||||
var options = arguments[1] || { };
|
var options = arguments[1] || { },
|
||||||
var oldOpacity = element.getInlineOpacity();
|
oldOpacity = element.getInlineOpacity(),
|
||||||
var transition = options.transition || Effect.Transitions.sinoidal;
|
transition = options.transition || Effect.Transitions.linear,
|
||||||
var reverser = function(pos){ return transition(1-Effect.Transitions.pulse(pos, options.pulses)) };
|
reverser = function(pos){
|
||||||
reverser.bind(transition);
|
return 1 - transition((-Math.cos((pos*(options.pulses||5)*2)*Math.PI)/2) + .5);
|
||||||
return new Effect.Opacity(element,
|
};
|
||||||
|
|
||||||
|
return new Effect.Opacity(element,
|
||||||
Object.extend(Object.extend({ duration: 2.0, from: 0,
|
Object.extend(Object.extend({ duration: 2.0, from: 0,
|
||||||
afterFinishInternal: function(effect) { effect.element.setStyle({opacity: oldOpacity}); }
|
afterFinishInternal: function(effect) { effect.element.setStyle({opacity: oldOpacity}); }
|
||||||
}, options), {transition: reverser}));
|
}, options), {transition: reverser}));
|
||||||
|
@ -896,12 +904,12 @@ Effect.Fold = function(element) {
|
||||||
width: element.style.width,
|
width: element.style.width,
|
||||||
height: element.style.height };
|
height: element.style.height };
|
||||||
element.makeClipping();
|
element.makeClipping();
|
||||||
return new Effect.Scale(element, 5, Object.extend({
|
return new Effect.Scale(element, 5, Object.extend({
|
||||||
scaleContent: false,
|
scaleContent: false,
|
||||||
scaleX: false,
|
scaleX: false,
|
||||||
afterFinishInternal: function(effect) {
|
afterFinishInternal: function(effect) {
|
||||||
new Effect.Scale(element, 1, {
|
new Effect.Scale(element, 1, {
|
||||||
scaleContent: false,
|
scaleContent: false,
|
||||||
scaleY: false,
|
scaleY: false,
|
||||||
afterFinishInternal: function(effect) {
|
afterFinishInternal: function(effect) {
|
||||||
effect.element.hide().undoClipping().setStyle(oldStyle);
|
effect.element.hide().undoClipping().setStyle(oldStyle);
|
||||||
|
@ -916,7 +924,7 @@ Effect.Morph = Class.create(Effect.Base, {
|
||||||
var options = Object.extend({
|
var options = Object.extend({
|
||||||
style: { }
|
style: { }
|
||||||
}, arguments[1] || { });
|
}, arguments[1] || { });
|
||||||
|
|
||||||
if (!Object.isString(options.style)) this.style = $H(options.style);
|
if (!Object.isString(options.style)) this.style = $H(options.style);
|
||||||
else {
|
else {
|
||||||
if (options.style.include(':'))
|
if (options.style.include(':'))
|
||||||
|
@ -934,18 +942,18 @@ Effect.Morph = Class.create(Effect.Base, {
|
||||||
effect.transforms.each(function(transform) {
|
effect.transforms.each(function(transform) {
|
||||||
effect.element.style[transform.style] = '';
|
effect.element.style[transform.style] = '';
|
||||||
});
|
});
|
||||||
}
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
this.start(options);
|
this.start(options);
|
||||||
},
|
},
|
||||||
|
|
||||||
setup: function(){
|
setup: function(){
|
||||||
function parseColor(color){
|
function parseColor(color){
|
||||||
if (!color || ['rgba(0, 0, 0, 0)','transparent'].include(color)) color = '#ffffff';
|
if (!color || ['rgba(0, 0, 0, 0)','transparent'].include(color)) color = '#ffffff';
|
||||||
color = color.parseColor();
|
color = color.parseColor();
|
||||||
return $R(0,2).map(function(i){
|
return $R(0,2).map(function(i){
|
||||||
return parseInt( color.slice(i*2+1,i*2+3), 16 )
|
return parseInt( color.slice(i*2+1,i*2+3), 16 );
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
this.transforms = this.style.map(function(pair){
|
this.transforms = this.style.map(function(pair){
|
||||||
|
@ -965,9 +973,9 @@ Effect.Morph = Class.create(Effect.Base, {
|
||||||
}
|
}
|
||||||
|
|
||||||
var originalValue = this.element.getStyle(property);
|
var originalValue = this.element.getStyle(property);
|
||||||
return {
|
return {
|
||||||
style: property.camelize(),
|
style: property.camelize(),
|
||||||
originalValue: unit=='color' ? parseColor(originalValue) : parseFloat(originalValue || 0),
|
originalValue: unit=='color' ? parseColor(originalValue) : parseFloat(originalValue || 0),
|
||||||
targetValue: unit=='color' ? parseColor(value) : value,
|
targetValue: unit=='color' ? parseColor(value) : value,
|
||||||
unit: unit
|
unit: unit
|
||||||
};
|
};
|
||||||
|
@ -978,13 +986,13 @@ Effect.Morph = Class.create(Effect.Base, {
|
||||||
transform.unit != 'color' &&
|
transform.unit != 'color' &&
|
||||||
(isNaN(transform.originalValue) || isNaN(transform.targetValue))
|
(isNaN(transform.originalValue) || isNaN(transform.targetValue))
|
||||||
)
|
)
|
||||||
)
|
);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
update: function(position) {
|
update: function(position) {
|
||||||
var style = { }, transform, i = this.transforms.length;
|
var style = { }, transform, i = this.transforms.length;
|
||||||
while(i--)
|
while(i--)
|
||||||
style[(transform = this.transforms[i]).style] =
|
style[(transform = this.transforms[i]).style] =
|
||||||
transform.unit=='color' ? '#'+
|
transform.unit=='color' ? '#'+
|
||||||
(Math.round(transform.originalValue[0]+
|
(Math.round(transform.originalValue[0]+
|
||||||
(transform.targetValue[0]-transform.originalValue[0])*position)).toColorPart() +
|
(transform.targetValue[0]-transform.originalValue[0])*position)).toColorPart() +
|
||||||
|
@ -993,7 +1001,7 @@ Effect.Morph = Class.create(Effect.Base, {
|
||||||
(Math.round(transform.originalValue[2]+
|
(Math.round(transform.originalValue[2]+
|
||||||
(transform.targetValue[2]-transform.originalValue[2])*position)).toColorPart() :
|
(transform.targetValue[2]-transform.originalValue[2])*position)).toColorPart() :
|
||||||
(transform.originalValue +
|
(transform.originalValue +
|
||||||
(transform.targetValue - transform.originalValue) * position).toFixed(3) +
|
(transform.targetValue - transform.originalValue) * position).toFixed(3) +
|
||||||
(transform.unit === null ? '' : transform.unit);
|
(transform.unit === null ? '' : transform.unit);
|
||||||
this.element.setStyle(style, true);
|
this.element.setStyle(style, true);
|
||||||
}
|
}
|
||||||
|
@ -1030,7 +1038,7 @@ Effect.Transform = Class.create({
|
||||||
});
|
});
|
||||||
|
|
||||||
Element.CSS_PROPERTIES = $w(
|
Element.CSS_PROPERTIES = $w(
|
||||||
'backgroundColor backgroundPosition borderBottomColor borderBottomStyle ' +
|
'backgroundColor backgroundPosition borderBottomColor borderBottomStyle ' +
|
||||||
'borderBottomWidth borderLeftColor borderLeftStyle borderLeftWidth ' +
|
'borderBottomWidth borderLeftColor borderLeftStyle borderLeftWidth ' +
|
||||||
'borderRightColor borderRightStyle borderRightWidth borderSpacing ' +
|
'borderRightColor borderRightStyle borderRightWidth borderSpacing ' +
|
||||||
'borderTopColor borderTopStyle borderTopWidth bottom clip color ' +
|
'borderTopColor borderTopStyle borderTopWidth bottom clip color ' +
|
||||||
|
@ -1039,7 +1047,7 @@ Element.CSS_PROPERTIES = $w(
|
||||||
'maxWidth minHeight minWidth opacity outlineColor outlineOffset ' +
|
'maxWidth minHeight minWidth opacity outlineColor outlineOffset ' +
|
||||||
'outlineWidth paddingBottom paddingLeft paddingRight paddingTop ' +
|
'outlineWidth paddingBottom paddingLeft paddingRight paddingTop ' +
|
||||||
'right textIndent top width wordSpacing zIndex');
|
'right textIndent top width wordSpacing zIndex');
|
||||||
|
|
||||||
Element.CSS_LENGTH = /^(([\+\-]?[0-9\.]+)(em|ex|px|in|cm|mm|pt|pc|\%))|0$/;
|
Element.CSS_LENGTH = /^(([\+\-]?[0-9\.]+)(em|ex|px|in|cm|mm|pt|pc|\%))|0$/;
|
||||||
|
|
||||||
String.__parseStyleElement = document.createElement('div');
|
String.__parseStyleElement = document.createElement('div');
|
||||||
|
@ -1051,11 +1059,11 @@ String.prototype.parseStyle = function(){
|
||||||
String.__parseStyleElement.innerHTML = '<div style="' + this + '"></div>';
|
String.__parseStyleElement.innerHTML = '<div style="' + this + '"></div>';
|
||||||
style = String.__parseStyleElement.childNodes[0].style;
|
style = String.__parseStyleElement.childNodes[0].style;
|
||||||
}
|
}
|
||||||
|
|
||||||
Element.CSS_PROPERTIES.each(function(property){
|
Element.CSS_PROPERTIES.each(function(property){
|
||||||
if (style[property]) styleRules.set(property, style[property]);
|
if (style[property]) styleRules.set(property, style[property]);
|
||||||
});
|
});
|
||||||
|
|
||||||
if (Prototype.Browser.IE && this.include('opacity'))
|
if (Prototype.Browser.IE && this.include('opacity'))
|
||||||
styleRules.set('opacity', this.match(/opacity:\s*((?:0|1)?(?:\.\d*)?)/)[1]);
|
styleRules.set('opacity', this.match(/opacity:\s*((?:0|1)?(?:\.\d*)?)/)[1]);
|
||||||
|
|
||||||
|
@ -1074,14 +1082,14 @@ if (document.defaultView && document.defaultView.getComputedStyle) {
|
||||||
Element.getStyles = function(element) {
|
Element.getStyles = function(element) {
|
||||||
element = $(element);
|
element = $(element);
|
||||||
var css = element.currentStyle, styles;
|
var css = element.currentStyle, styles;
|
||||||
styles = Element.CSS_PROPERTIES.inject({ }, function(hash, property) {
|
styles = Element.CSS_PROPERTIES.inject({ }, function(results, property) {
|
||||||
hash.set(property, css[property]);
|
results[property] = css[property];
|
||||||
return hash;
|
return results;
|
||||||
});
|
});
|
||||||
if (!styles.opacity) styles.set('opacity', element.getOpacity());
|
if (!styles.opacity) styles.opacity = element.getOpacity();
|
||||||
return styles;
|
return styles;
|
||||||
};
|
};
|
||||||
};
|
}
|
||||||
|
|
||||||
Effect.Methods = {
|
Effect.Methods = {
|
||||||
morph: function(element, style) {
|
morph: function(element, style) {
|
||||||
|
@ -1090,7 +1098,7 @@ Effect.Methods = {
|
||||||
return element;
|
return element;
|
||||||
},
|
},
|
||||||
visualEffect: function(element, effect, options) {
|
visualEffect: function(element, effect, options) {
|
||||||
element = $(element)
|
element = $(element);
|
||||||
var s = effect.dasherize().camelize(), klass = s.charAt(0).toUpperCase() + s.substring(1);
|
var s = effect.dasherize().camelize(), klass = s.charAt(0).toUpperCase() + s.substring(1);
|
||||||
new Effect[klass](element, options);
|
new Effect[klass](element, options);
|
||||||
return element;
|
return element;
|
||||||
|
@ -1104,17 +1112,17 @@ Effect.Methods = {
|
||||||
|
|
||||||
$w('fade appear grow shrink fold blindUp blindDown slideUp slideDown '+
|
$w('fade appear grow shrink fold blindUp blindDown slideUp slideDown '+
|
||||||
'pulsate shake puff squish switchOff dropOut').each(
|
'pulsate shake puff squish switchOff dropOut').each(
|
||||||
function(effect) {
|
function(effect) {
|
||||||
Effect.Methods[effect] = function(element, options){
|
Effect.Methods[effect] = function(element, options){
|
||||||
element = $(element);
|
element = $(element);
|
||||||
Effect[effect.charAt(0).toUpperCase() + effect.substring(1)](element, options);
|
Effect[effect.charAt(0).toUpperCase() + effect.substring(1)](element, options);
|
||||||
return element;
|
return element;
|
||||||
}
|
};
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
$w('getInlineOpacity forceRerendering setContentZoom collectTextNodes collectTextNodesIgnoreClass getStyles').each(
|
$w('getInlineOpacity forceRerendering setContentZoom collectTextNodes collectTextNodesIgnoreClass getStyles').each(
|
||||||
function(f) { Effect.Methods[f] = Element[f]; }
|
function(f) { Effect.Methods[f] = Element[f]; }
|
||||||
);
|
);
|
||||||
|
|
||||||
Element.addMethods(Effect.Methods);
|
Element.addMethods(Effect.Methods);
|
629
public/javascripts/prototype.js
vendored
629
public/javascripts/prototype.js
vendored
File diff suppressed because it is too large
Load diff
|
@ -1 +1,4 @@
|
||||||
require "action_mailer"
|
require "action_mailer"
|
||||||
|
require "exception_notifier"
|
||||||
|
require "exception_notifiable"
|
||||||
|
require "exception_notifier_helper"
|
||||||
|
|
|
@ -33,25 +33,25 @@ class ExceptionNotifier < ActionMailer::Base
|
||||||
@@sections = %w(request session environment backtrace)
|
@@sections = %w(request session environment backtrace)
|
||||||
cattr_accessor :sections
|
cattr_accessor :sections
|
||||||
|
|
||||||
def self.reloadable?; false; end
|
self.template_root = "#{File.dirname(__FILE__)}/../views"
|
||||||
|
|
||||||
|
def self.reloadable?() false end
|
||||||
|
|
||||||
def exception_notification(exception, controller, request, data={})
|
def exception_notification(exception, controller, request, data={})
|
||||||
|
content_type "text/plain"
|
||||||
|
|
||||||
subject "#{email_prefix}#{controller.controller_name}##{controller.action_name} (#{exception.class}) #{exception.message.inspect}"
|
subject "#{email_prefix}#{controller.controller_name}##{controller.action_name} (#{exception.class}) #{exception.message.inspect}"
|
||||||
|
|
||||||
recipients exception_recipients
|
recipients exception_recipients
|
||||||
from sender_address
|
from sender_address
|
||||||
|
|
||||||
body data.merge({ :controller => controller, :request => request,
|
body data.merge({ :controller => controller, :request => request,
|
||||||
:exception => exception, :host => request.env["HTTP_HOST"],
|
:exception => exception, :host => (request.env["HTTP_X_FORWARDED_HOST"] || request.env["HTTP_HOST"]),
|
||||||
:backtrace => sanitize_backtrace(exception.backtrace),
|
:backtrace => sanitize_backtrace(exception.backtrace),
|
||||||
:rails_root => rails_root, :data => data,
|
:rails_root => rails_root, :data => data,
|
||||||
:sections => sections })
|
:sections => sections })
|
||||||
end
|
end
|
||||||
|
|
||||||
def template_root
|
|
||||||
"#{File.dirname(__FILE__)}/../views"
|
|
||||||
end
|
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|
||||||
def sanitize_backtrace(trace)
|
def sanitize_backtrace(trace)
|
||||||
|
@ -60,8 +60,7 @@ class ExceptionNotifier < ActionMailer::Base
|
||||||
end
|
end
|
||||||
|
|
||||||
def rails_root
|
def rails_root
|
||||||
return @rails_root if @rails_root
|
@rails_root ||= Pathname.new(RAILS_ROOT).cleanpath.to_s
|
||||||
@rails_root = Pathname.new(RAILS_ROOT).cleanpath.to_s
|
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
|
@ -67,11 +67,12 @@ module ExceptionNotifierHelper
|
||||||
end
|
end
|
||||||
|
|
||||||
def filter_sensitive_post_data_parameters(parameters)
|
def filter_sensitive_post_data_parameters(parameters)
|
||||||
exclude_raw_post_parameters? ? @controller.filter_parameters(parameters) : parameters
|
exclude_raw_post_parameters? ? @controller.__send__(:filter_parameters, parameters) : parameters
|
||||||
end
|
end
|
||||||
|
|
||||||
def filter_sensitive_post_data_from_env(env_key, env_value)
|
def filter_sensitive_post_data_from_env(env_key, env_value)
|
||||||
return env_value unless exclude_raw_post_parameters?
|
return env_value unless exclude_raw_post_parameters?
|
||||||
(env_key =~ /RAW_POST_DATA/i) ? PARAM_FILTER_REPLACEMENT : env_value
|
return PARAM_FILTER_REPLACEMENT if (env_key =~ /RAW_POST_DATA/i)
|
||||||
|
return @controller.__send__(:filter_parameters, {env_key => env_value}).values[0]
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<% max = @request.env.keys.max { |a,b| a.length <=> b.length } -%>
|
<% max = @request.env.keys.max { |a,b| a.length <=> b.length } -%>
|
||||||
<% @request.env.keys.sort.each do |key| -%>
|
<% @request.env.keys.sort.each do |key| -%>
|
||||||
* <%= "%*-s: %s" % [max.length, key, filter_sensitive_post_data_from_env(key, @request.env[key].to_s.strip)] %>
|
* <%= "%-*s: %s" % [max.length, key, filter_sensitive_post_data_from_env(key, @request.env[key].to_s.strip)] %>
|
||||||
<% end -%>
|
<% end -%>
|
||||||
|
|
||||||
* Process: <%= $$ %>
|
* Process: <%= $$ %>
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
* URL: <%= @request.protocol %><%= @host %><%= @request.request_uri %>
|
* URL : <%= @request.protocol %><%= @host %><%= @request.request_uri %>
|
||||||
|
* IP address: <%= @request.env["HTTP_X_FORWARDED_FOR"] || @request.env["REMOTE_ADDR"] %>
|
||||||
* Parameters: <%= filter_sensitive_post_data_parameters(@request.parameters).inspect %>
|
* Parameters: <%= filter_sensitive_post_data_parameters(@request.parameters).inspect %>
|
||||||
* Rails root: <%= @rails_root %>
|
* Rails root: <%= @rails_root %>
|
||||||
|
|
20
vendor/plugins/l10n-simplified-0.8/MIT-LICENSE
vendored
20
vendor/plugins/l10n-simplified-0.8/MIT-LICENSE
vendored
|
@ -1,20 +0,0 @@
|
||||||
Copyright (c) 2006 Jesper Rønn-Jensen
|
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining
|
|
||||||
a copy of this software and associated documentation files (the
|
|
||||||
"Software"), to deal in the Software without restriction, including
|
|
||||||
without limitation the rights to use, copy, modify, merge, publish,
|
|
||||||
distribute, sublicense, and/or sell copies of the Software, and to
|
|
||||||
permit persons to whom the Software is furnished to do so, subject to
|
|
||||||
the following conditions:
|
|
||||||
|
|
||||||
The above copyright notice and this permission notice shall be
|
|
||||||
included in all copies or substantial portions of the Software.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
|
||||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
|
||||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
|
||||||
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
|
||||||
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
|
||||||
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
|
||||||
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
158
vendor/plugins/l10n-simplified-0.8/README
vendored
158
vendor/plugins/l10n-simplified-0.8/README
vendored
|
@ -1,158 +0,0 @@
|
||||||
= Localization Simplified (aka LocalizationSimplified or L10n-simplified)
|
|
||||||
|
|
||||||
Localization Simplified plugin for Ruby on Rails. Really simple localization. Written by Jesper Rønn-Jensen ( http://justaddwater.dk/ )
|
|
||||||
|
|
||||||
The goal is to have a dead simple plugin for one-language (non-english) Rails
|
|
||||||
applications. Many of the existing localization / internationalization plugins are
|
|
||||||
too big for this and hard to get started with. Just dump this plugin in
|
|
||||||
/vendor/plugins/, set your language and off you go.
|
|
||||||
|
|
||||||
Unlike the more advanced plugins, you don't have to translate anything in your
|
|
||||||
view files. Just use the standard Rails commands you're used to.
|
|
||||||
|
|
||||||
The simple approach also makes limits. Make sure you understand them to decide if
|
|
||||||
this plugin is right for you.
|
|
||||||
|
|
||||||
I use this plugin when creating new projects. Then later in the development
|
|
||||||
process I can decide to change to a more advanced localization plugin (if necessary)
|
|
||||||
|
|
||||||
=== What it does
|
|
||||||
This plugin modifies the following most used helpers for Rails
|
|
||||||
* Sets UTF-8 connection to database (known to work with MySQL and PostgreSQL)
|
|
||||||
* Localized monthnames on date_select etc. (changing the order of Y-M-D, on date_select and datetime_select from 0.7)
|
|
||||||
* Localized ActiveRecord errors (and error headings)
|
|
||||||
* Localized distance_of_time_in_words
|
|
||||||
* Localized to_currency (from 0.7 also changing the order of unit/currency)
|
|
||||||
* Simple pluralization also available in the lang-file
|
|
||||||
* Uses standard Rails methods. In this way, there is no tedious rewrite required
|
|
||||||
to localize your view files
|
|
||||||
|
|
||||||
|
|
||||||
=== Limitations
|
|
||||||
* More advanced features are not likely to be available here.
|
|
||||||
* If you want support for multiple languages, use another L10N/I18n plugin, like
|
|
||||||
GLoc or Globalize
|
|
||||||
It could be a good idea to take a look at the [comparison chart](http://wiki.rubyonrails.org/rails/pages/InternationalizationComparison) on the Ruby on Rails wiki
|
|
||||||
|
|
||||||
=== Version notes
|
|
||||||
* For Rails 1.1.x or below, use version 0.7.1 of this plugin
|
|
||||||
* For Rails 1.2 or above, use version 0.8 (or higher) of this plugin
|
|
||||||
|
|
||||||
=== Supported languages
|
|
||||||
Curr ently supported languages:
|
|
||||||
* English (for running test cases and comparing to normal texts)
|
|
||||||
* German
|
|
||||||
* Spanish
|
|
||||||
* Spanish (argentinian)
|
|
||||||
* French
|
|
||||||
* Dutch
|
|
||||||
* Italian
|
|
||||||
* Danish
|
|
||||||
* Swedish
|
|
||||||
* Finnish
|
|
||||||
* Canadian French
|
|
||||||
* Korean
|
|
||||||
* Swedish Chef, and Pirate talk (just for the fun of it)
|
|
||||||
* any other language you want. Just dump your translation in the /lib folder
|
|
||||||
|
|
||||||
=== Download code
|
|
||||||
* Project homepage: http://rubyforge.org/projects/l10n-simplified/
|
|
||||||
* Subversion access: svn checkout svn://rubyforge.org/var/svn/l10n-simplified
|
|
||||||
* Browse: http://rubyforge.org/plugins/scmsvn/viewcvs.php/?root=l10n-simplified
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
=== Usage:
|
|
||||||
in init.rb, set your language. That's it. Now your db connection is running UTF-8 and standard Rails output is localized.
|
|
||||||
|
|
||||||
If your view files contains text containing non-English characters (such as ß,ö,ñ or å), you probably also want to save your files as UTF-8.
|
|
||||||
|
|
||||||
|
|
||||||
=== Installation:
|
|
||||||
|
|
||||||
1. Just copy this plugin into your /vendor/plugins/ folder
|
|
||||||
2. Choose your lang-file in init.rb (default is Danish because I am Danish)
|
|
||||||
3. no step three :)
|
|
||||||
|
|
||||||
|
|
||||||
A special note of WARNING: All files here are saved using UTF-8 encoding.
|
|
||||||
It's not required for working, I guess, but other encodings could bring you in trouble.
|
|
||||||
|
|
||||||
=== Your help
|
|
||||||
Feel free to use, translate, modify and improve this code.
|
|
||||||
Do send me translations, improvements, etc. I cannot promise to use it,
|
|
||||||
but chances are that I will unless it bloats the code here completely or makes
|
|
||||||
code harder to maintain.
|
|
||||||
|
|
||||||
I added FIXME notes in the code to indicate where I also could use help.
|
|
||||||
|
|
||||||
=== TODO / wishlist
|
|
||||||
* A Rails application for testing L10n-simplified. This is top of my wish-list.
|
|
||||||
I'd like it to contain a test suite testing ActiveRecord errors, datehelper, necessary
|
|
||||||
numberhelper etc.
|
|
||||||
* Rake task to create a release
|
|
||||||
* Better tests to verify both hooks in Rails and this plugin
|
|
||||||
* Better tests to verify each lang-file
|
|
||||||
* Create rdoc in UTF-8 format and not including every lang-file (only lang_en.rb)
|
|
||||||
* Rake task that modifies all view-files and converts them to UTF-8
|
|
||||||
* Also a task that modifies all generators to use UTF-8
|
|
||||||
|
|
||||||
=== DONE
|
|
||||||
* --- release 0.8 ---
|
|
||||||
* Works with Rails 1.2 (not working with earlier versions)
|
|
||||||
* Whitespace/formatting modifications. Removed commented code not needed
|
|
||||||
* Removed code from plugin because Rails 1.2 date_select and datetime_select
|
|
||||||
now support :order
|
|
||||||
* ActiveRecord hooks updated for Rails 1.2 (thanks Casper Fabricius)
|
|
||||||
* Dots after day number in time formats (Danish), to keep it consistent with Date formats
|
|
||||||
* --- release 0.7.1 ---
|
|
||||||
* Fixed RJS bug where javascript content-header was overwritten with text/html (thanks Jakob Skjerning)
|
|
||||||
* Small language corrections by Wijnand Wiersma
|
|
||||||
* PostGres friendly: Added quotes around ActiveRecord::Base.connection.execute "SET NAMES 'UTF8'" (thanks Wijnand Wiersma)
|
|
||||||
* German language errors corrected by Matthias Tarasiewicz
|
|
||||||
* Added "no step three" in installation section :)
|
|
||||||
* --- release 0.7 ---
|
|
||||||
* Fixed messed-up ø's and a few wording changes in README
|
|
||||||
* Override +number_to_currency+ and +datetime_select+ to support :order
|
|
||||||
even though I prefer these changes to go into Rails Core (2006-10-10)
|
|
||||||
* Added italian lang file (thanks Michele Franzin) (2006-10-08)
|
|
||||||
* Added argentinian flavoured Spanish lang File + corrected bug in lang_es (thanks Damian Janowski) (2006-10-03)
|
|
||||||
* German translation issues (thanks Christian W. Zuckschwerdt) (2006-10-03)
|
|
||||||
* Fixed typo in README File (thanks Diego Algorta Casamayou) (2006-10-02)
|
|
||||||
* Bugfix removed incorrect 'then' after 'else' (thanks Michele Franzin)(2006-09-16)
|
|
||||||
* Added augmented and corrected distance_of_time_in_words from Rails trunk (2006-09-07)
|
|
||||||
* Added date_select and datetime_select on the helper page (2006-09-07)
|
|
||||||
* Updated dutch date-time formats, thanks Jeroen Houben (2006-09-07)
|
|
||||||
* --- release 0.6.1 ---
|
|
||||||
* Added comments in all lang-files, thanks Jarkko Laine for the idea (2006-09-07)
|
|
||||||
* Bugfix: Replaced hardcoded string in distance_of_time_in_words when :include_seconds was false (2006-08-30)
|
|
||||||
* Added Canadian French translation (thanks Daniel) (2006-08-25)
|
|
||||||
* Added comments in lang-file for documentation of how to localize (2006-08-25)
|
|
||||||
* Added French translation (thanks Fred Cavazza) (2006-08-25)
|
|
||||||
* Added Finnish translation (thanks Jarkko Laine) (2006-08-25)
|
|
||||||
* Bugfix re-added HTTP header for UTF-8. Necessary for some lang-files (2004-08-24)
|
|
||||||
* --- release 0.6 ---
|
|
||||||
* Renamed test files to make rake test command work (2006-08-23)
|
|
||||||
* Localized time "Wed Aug 23 12:38:22 Romance Daylight Time 2006" =>
|
|
||||||
"onsdag d. 23 august 2006 12:38:22" (Danish)
|
|
||||||
* Reordering of date_select fields (2006-08-23)
|
|
||||||
* Test that plugin works with the Rails version it is installed next to (2006-08-20)
|
|
||||||
* Added Dutch translation lang_nl.rb, thanks to Jeroen Houben (2006-08-20)
|
|
||||||
* Added Pirate language lang_pirate.rb, thanks to Tobias Michaelsen (2006-08-18)
|
|
||||||
* Added Date and Time#to_formatted_s with locale specific strings (2006-08-18)
|
|
||||||
* Added MIT-license, copied from Ruby on Rails (2006-08-13)
|
|
||||||
* Added tests for plugin (2006-08-13)
|
|
||||||
* Localized version of Array.to_sentence (2006-08-09)
|
|
||||||
* Added test scaffold (2006-08-09)
|
|
||||||
* Added swedish language, thanks to Olle Jonsson (2006-08-09)
|
|
||||||
* Localized version of to_currency helper (2006-08-07)
|
|
||||||
|
|
||||||
|
|
||||||
=== Credits
|
|
||||||
This plugin uses a few bits and pieces from other Rails plugins GLoc (http://rubyforge.org/projects/gloc/) and swe_rails (http://opensource.ki.se/swe_rails.html)
|
|
||||||
|
|
||||||
|
|
||||||
Created 2006-07-28 by
|
|
||||||
Jesper Rønn-Jensen http://justaddwater.dk/
|
|
||||||
http://rubyforge.org/projects/l10n-simplified/
|
|
||||||
http://agilewebdevelopment.com/plugins/localization_simplified
|
|
22
vendor/plugins/l10n-simplified-0.8/Rakefile
vendored
22
vendor/plugins/l10n-simplified-0.8/Rakefile
vendored
|
@ -1,22 +0,0 @@
|
||||||
require 'rake'
|
|
||||||
require 'rake/testtask'
|
|
||||||
require 'rake/rdoctask'
|
|
||||||
|
|
||||||
desc 'Default: run unit tests.'
|
|
||||||
task :default => :test
|
|
||||||
|
|
||||||
desc 'Test the l10n_simplified plugin.'
|
|
||||||
Rake::TestTask.new(:test) do |t|
|
|
||||||
t.libs << 'lib'
|
|
||||||
t.pattern = 'test/**/*_test.rb'
|
|
||||||
t.verbose = true
|
|
||||||
end
|
|
||||||
|
|
||||||
desc 'Generate documentation for the l10n_simplified plugin.'
|
|
||||||
Rake::RDocTask.new(:rdoc) do |rdoc|
|
|
||||||
rdoc.rdoc_dir = 'rdoc'
|
|
||||||
rdoc.title = 'LocalizationSimplified'
|
|
||||||
rdoc.options << '--line-numbers' << '--inline-source'
|
|
||||||
rdoc.rdoc_files.include('README')
|
|
||||||
rdoc.rdoc_files.include('lib/**/*.rb')
|
|
||||||
end
|
|
|
@ -1,24 +0,0 @@
|
||||||
cd ..
|
|
||||||
svn export l10n-simplified export\l10n-simplified-0.8
|
|
||||||
(right-click to create zip file)
|
|
||||||
FIXME make a rake task and
|
|
||||||
|
|
||||||
cd export
|
|
||||||
tar -czf l10n-simplified-0.8.tar.gz l10n-simplified-0.8
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# ==========
|
|
||||||
# other commands that I use with this plugin
|
|
||||||
# ==========
|
|
||||||
|
|
||||||
|
|
||||||
FIXME Create rdoc in UTF-8 format and not including every lang-file (only lang_en.rb)
|
|
||||||
FIXME describe upload of rdoc to l10n-simplified website
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
20
vendor/plugins/l10n-simplified-0.8/init.rb
vendored
20
vendor/plugins/l10n-simplified-0.8/init.rb
vendored
|
@ -1,20 +0,0 @@
|
||||||
# Choose language file here
|
|
||||||
# ONLY choose one of the ones below:
|
|
||||||
#require 'lang_en' #default language to run the test cases
|
|
||||||
#require 'lang_da'
|
|
||||||
require 'lang_de'
|
|
||||||
#require 'lang_es'
|
|
||||||
#require 'lang_fi'
|
|
||||||
#require 'lang_fr'
|
|
||||||
#require 'lang_nl'
|
|
||||||
#require 'lang_ko'
|
|
||||||
#require 'lang_se'
|
|
||||||
#require 'lang_chef'
|
|
||||||
#require 'lang_pirate'
|
|
||||||
# You can Add your own localization file and add it here
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# Also include hook code here
|
|
||||||
require 'localization_simplified'
|
|
||||||
|
|
118
vendor/plugins/l10n-simplified-0.8/lib/lang_cf.rb
vendored
118
vendor/plugins/l10n-simplified-0.8/lib/lang_cf.rb
vendored
|
@ -1,118 +0,0 @@
|
||||||
# lang_cf.rb
|
|
||||||
# french canadian translation file
|
|
||||||
# Translation by Daniel Lepage ( http://www.solulabs.com/ )
|
|
||||||
|
|
||||||
module LocalizationSimplified
|
|
||||||
About = {
|
|
||||||
:lang => "cf",
|
|
||||||
:updated => "2006-09-07"
|
|
||||||
}
|
|
||||||
|
|
||||||
class ActiveRecord
|
|
||||||
# ErrorMessages to override default messages in
|
|
||||||
# +ActiveRecord::Errors::@@default_error_messages+
|
|
||||||
# This plugin also replaces hardcoded 3 text messages
|
|
||||||
# :error_translation is inflected using the Rails
|
|
||||||
# inflector.
|
|
||||||
#
|
|
||||||
# Remember to modify the Inflector with your localized translation
|
|
||||||
# of "error" and "errors" in the bottom of this file
|
|
||||||
#
|
|
||||||
ErrorMessages = {
|
|
||||||
:inclusion => "n'est pas inclus dans la liste",
|
|
||||||
:exclusion => "est réservé",
|
|
||||||
:invalid => "est non valide",
|
|
||||||
:confirmation => "ne correspond pas à la confirmation",
|
|
||||||
:accepted => "doit être accepté",
|
|
||||||
:empty => "ne peut pas être vide",
|
|
||||||
:blank => "ne peut pas être laissé à blanc",
|
|
||||||
:too_long => "dépasse la longueur permise (le maximum étant de %d caractères)",
|
|
||||||
:too_short => "est trop court (le minimum étant de %d caractères)",
|
|
||||||
:wrong_length => "n'est pas de la bonne longueur (doit être de %d caractères)",
|
|
||||||
:taken => "as déjà été pris",
|
|
||||||
:not_a_number => "n'est pas un nombre",
|
|
||||||
#Jespers additions:
|
|
||||||
:error_translation => "erreur",
|
|
||||||
:error_header => "%s interdit d'enregistrer %s ",
|
|
||||||
:error_subheader => "Il y a des erreurs dans les champs suivants : "
|
|
||||||
}
|
|
||||||
end
|
|
||||||
|
|
||||||
# Texts to override +distance_of_time_in_words()+
|
|
||||||
class DateHelper
|
|
||||||
Texts = {
|
|
||||||
:less_than_x_seconds => "moins de %d secondes",
|
|
||||||
:half_a_minute => "30 secondes",
|
|
||||||
:less_than_a_minute => "moins d'une minute",
|
|
||||||
:one_minute => "1 minute",
|
|
||||||
:x_minutes => "%d minutes",
|
|
||||||
:one_hour => "environ 1 heure",
|
|
||||||
:x_hours => "environ %d heures",
|
|
||||||
:one_day => "1 jour",
|
|
||||||
:x_days => "%d jours",
|
|
||||||
:one_month => "1 mois",
|
|
||||||
:x_months => "%d mois",
|
|
||||||
:one_year => "1 an",
|
|
||||||
:x_years => "%d ans"
|
|
||||||
}
|
|
||||||
|
|
||||||
# Rails uses Month names in Date and time select boxes
|
|
||||||
# (+date_select+ and +datetime_select+ )
|
|
||||||
# Currently (as of version 1.1.6), Rails doesn't use daynames
|
|
||||||
Monthnames = [nil] + %w{Janvier Février Mars Avril Mai Juin Juillet Août Septembre Octobre Novembre Décembre}
|
|
||||||
AbbrMonthnames = [nil] + %w{Jan Fev Mar Avr Mai Jun Jui Aou Sep Oct Nov Dec}
|
|
||||||
Daynames = %w{Dimanche Lundi Mardi Mercredi Jeudi Vendredi Samedi}
|
|
||||||
AbbrDaynames = %w{Dim Lun Mar Mer Jeu Ven Sam}
|
|
||||||
|
|
||||||
# Date and time format syntax explained in http://www.rubycentral.com/ref/ref_c_time.html#strftime
|
|
||||||
# These are sent to strftime that Ruby's date and time handlers use internally
|
|
||||||
# Same options as php (that has a better list: http://www.php.net/strftime )
|
|
||||||
DateFormats = {
|
|
||||||
:default => "%Y-%m-%d",
|
|
||||||
:short => "%b %e",
|
|
||||||
:long => "%B %e, %Y"
|
|
||||||
}
|
|
||||||
|
|
||||||
TimeFormats = {
|
|
||||||
:default => "%a, %d %b %Y %H:%M:%S %z",
|
|
||||||
:short => "%d %b %H:%M",
|
|
||||||
:long => "%B %d, %Y %H:%M"
|
|
||||||
}
|
|
||||||
# Set the order of +date_select+ and +datetime_select+ boxes
|
|
||||||
# Note that at present, the current Rails version only supports ordering of date_select boxes
|
|
||||||
DateSelectOrder = {
|
|
||||||
:order => [:year, :month, :day] #default Rails is US ordered: :order => [:year, :month, :day]
|
|
||||||
}
|
|
||||||
end
|
|
||||||
|
|
||||||
class NumberHelper
|
|
||||||
# CurrencyOptions are used as default for +Number#to_currency()+
|
|
||||||
# http://api.rubyonrails.org/classes/ActionView/Helpers/NumberHelper.html#M000449
|
|
||||||
CurrencyOptions = {
|
|
||||||
:unit => "$",
|
|
||||||
:separator => ".", #unit separator (between integer part and fraction part)
|
|
||||||
:delimiter => ",", #delimiter between each group of thousands. Example: 1.234.567
|
|
||||||
:order => [:unit, :number] #order is at present unsupported in Rails
|
|
||||||
#to support for instance Danish format, the order is different: Unit comes last (ex. "1.234,00 dkr.")
|
|
||||||
}
|
|
||||||
end
|
|
||||||
|
|
||||||
class ArrayHelper
|
|
||||||
# Modifies +Array#to_sentence()+
|
|
||||||
# http://api.rubyonrails.org/classes/ActiveSupport/CoreExtensions/Array/Conversions.html#M000274
|
|
||||||
ToSentenceTexts = {
|
|
||||||
:connector => 'et',
|
|
||||||
:skip_last_comma => false
|
|
||||||
}
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
|
|
||||||
# Use the inflector below to pluralize "error" from
|
|
||||||
# @@default_error_messages[:error_translation] above (if necessary)
|
|
||||||
# Inflector.inflections do |inflect|
|
|
||||||
# inflect.plural /^(ox)$/i, '\1en'
|
|
||||||
# inflect.singular /^(ox)en/i, '\1'
|
|
||||||
# inflect.irregular 'person people'
|
|
||||||
# inflect.uncountable %w( information )
|
|
||||||
# end
|
|
119
vendor/plugins/l10n-simplified-0.8/lib/lang_chef.rb
vendored
119
vendor/plugins/l10n-simplified-0.8/lib/lang_chef.rb
vendored
|
@ -1,119 +0,0 @@
|
||||||
# lang_chef.rb
|
|
||||||
# Swedish Chef language file for Ruby on Rails
|
|
||||||
# Translation by Jesper Rønn-Jensen ( http://justaddwater.dk/ ), via web based translator
|
|
||||||
|
|
||||||
|
|
||||||
module LocalizationSimplified
|
|
||||||
About = {
|
|
||||||
:lang => "chef",
|
|
||||||
:updated => "2006-09-07"
|
|
||||||
}
|
|
||||||
|
|
||||||
class ActiveRecord
|
|
||||||
# ErrorMessages to override default messages in
|
|
||||||
# +ActiveRecord::Errors::@@default_error_messages+
|
|
||||||
# This plugin also replaces hardcoded 3 text messages
|
|
||||||
# :error_translation is inflected using the Rails
|
|
||||||
# inflector.
|
|
||||||
#
|
|
||||||
# Remember to modify the Inflector with your localized translation
|
|
||||||
# of "error" and "errors" in the bottom of this file
|
|
||||||
#
|
|
||||||
ErrorMessages = {
|
|
||||||
:inclusion => "is nut inclooded in zee leest",
|
|
||||||
:exclusion => "is reserfed",
|
|
||||||
:invalid => "is infeleed",
|
|
||||||
:confirmation => "duesn't metch cunffurmeshun",
|
|
||||||
:accepted => "moost be-a eccepted",
|
|
||||||
:empty => "cun't be-a impty",
|
|
||||||
:blank => "ees reeequired",# alternate, formulation: "is required"
|
|
||||||
:too_long => "is tuu lung (mexeemoom is %d cherecters)",
|
|
||||||
:too_short => "is tuu shurt (meenimoom is %d cherecters)",
|
|
||||||
:wrong_length => "is zee vrung lengt (shuoold be-a %d cherecters)",
|
|
||||||
:taken => "hes elreedy beee tekee",
|
|
||||||
:not_a_number => "is nut a noomber",
|
|
||||||
#Jespers additions:
|
|
||||||
:error_translation => "irrur",
|
|
||||||
:error_header => "%s pruheebited thees %s frum beeeng sefed. Børk! Børk! Børk!",
|
|
||||||
:error_subheader => "Zeere-a vere-a prublems veet zee fullooeeng feeelds:"
|
|
||||||
}
|
|
||||||
end
|
|
||||||
|
|
||||||
# Texts to override +distance_of_time_in_words()+
|
|
||||||
class DateHelper
|
|
||||||
Texts = {
|
|
||||||
:less_than_x_seconds => "less thun %d secunds",
|
|
||||||
:half_a_minute => "helff a meenoote-a",
|
|
||||||
:less_than_a_minute => "less thun a meenoote-a",
|
|
||||||
:one_minute => "one-a meenoote-a",
|
|
||||||
:x_minutes => "%d meenootes",
|
|
||||||
:one_hour => "ebuoot one-a huoor",
|
|
||||||
:x_hours => "ebuoot %d huoors",
|
|
||||||
:one_day => "one-a dey",
|
|
||||||
:x_days => "%d deys",
|
|
||||||
:one_month => "one-a munt",
|
|
||||||
:x_months => "%d munts",
|
|
||||||
:one_year => "one-a yeer",
|
|
||||||
:x_years => "%d yeers"
|
|
||||||
}
|
|
||||||
|
|
||||||
# Rails uses Month names in Date and time select boxes
|
|
||||||
# (+date_select+ and +datetime_select+ )
|
|
||||||
# Currently (as of version 1.1.6), Rails doesn't use daynames
|
|
||||||
Monthnames = [nil] + %w{Junooery Febrooery Merch Epreel Mey Joone-a Jooly Oogoost Seeptembooor Ooctuber Nufember Deezember}
|
|
||||||
AbbrMonthnames = [nil] + %w{Jun Feb Mer Epr Mey Joon Jool Oog Sep Ooct Nuf Deez}
|
|
||||||
Daynames = %w{Soondey Mundey Tooesdey Vednesdey Thoorsdey Freedey Setoordey}
|
|
||||||
AbbrDaynames = %w{Soon Mun Tooe-a Ved Thoo Free Set}
|
|
||||||
|
|
||||||
# Date and time format syntax explained in http://www.rubycentral.com/ref/ref_c_time.html#strftime
|
|
||||||
# These are sent to strftime that Ruby's date and time handlers use internally
|
|
||||||
# Same options as php (that has a better list: http://www.php.net/strftime )
|
|
||||||
DateFormats = {
|
|
||||||
:default => "%Y-%m-%d",
|
|
||||||
:short => "%b %e",
|
|
||||||
:long => "%B %e, %Y"
|
|
||||||
}
|
|
||||||
|
|
||||||
TimeFormats = {
|
|
||||||
:default => "%a, %d %b %Y %H:%M:%S %z",
|
|
||||||
:short => "%d %b %H:%M",
|
|
||||||
:long => "%B %d, %Y %H:%M"
|
|
||||||
}
|
|
||||||
# Set the order of +date_select+ and +datetime_select+ boxes
|
|
||||||
# Note that at present, the current Rails version only supports ordering of date_select boxes
|
|
||||||
DateSelectOrder = {
|
|
||||||
:order => [:year, :month, :day] #default Rails is US ordered: :order => [:year, :month, :day]
|
|
||||||
}
|
|
||||||
end
|
|
||||||
|
|
||||||
class NumberHelper
|
|
||||||
# CurrencyOptions are used as default for +Number#to_currency()+
|
|
||||||
# http://api.rubyonrails.org/classes/ActionView/Helpers/NumberHelper.html#M000449
|
|
||||||
CurrencyOptions = {
|
|
||||||
:unit => "$",
|
|
||||||
:separator => ".", #unit separator (between integer part and fraction part)
|
|
||||||
:delimiter => ",", #delimiter between each group of thousands. Example: 1.234.567
|
|
||||||
:order => [:unit, :number] #order is at present unsupported in Rails
|
|
||||||
#to support for instance Danish format, the order is different: Unit comes last (ex. "1.234,00 dkr.")
|
|
||||||
}
|
|
||||||
end
|
|
||||||
|
|
||||||
class ArrayHelper
|
|
||||||
# Modifies +Array#to_sentence()+
|
|
||||||
# http://api.rubyonrails.org/classes/ActiveSupport/CoreExtensions/Array/Conversions.html#M000274
|
|
||||||
ToSentenceTexts = {
|
|
||||||
:connector => 'eend',
|
|
||||||
:skip_last_comma => false
|
|
||||||
}
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
|
|
||||||
# Use the inflector below to pluralize "error" from
|
|
||||||
# @@default_error_messages[:error_translation] above (if necessary)
|
|
||||||
# Inflector.inflections do |inflect|
|
|
||||||
# inflect.plural /^(ox)$/i, '\1en'
|
|
||||||
# inflect.singular /^(ox)en/i, '\1'
|
|
||||||
# inflect.irregular 'person people'
|
|
||||||
# inflect.uncountable %w( information )
|
|
||||||
# end
|
|
117
vendor/plugins/l10n-simplified-0.8/lib/lang_da.rb
vendored
117
vendor/plugins/l10n-simplified-0.8/lib/lang_da.rb
vendored
|
@ -1,117 +0,0 @@
|
||||||
# lang_da.rb
|
|
||||||
# Danish translation file
|
|
||||||
# Translation by Jesper Rønn-Jensen ( http://justaddwater.dk/ )
|
|
||||||
|
|
||||||
|
|
||||||
module LocalizationSimplified
|
|
||||||
About = {
|
|
||||||
:lang => "da",
|
|
||||||
:updated => "2006-09-07"
|
|
||||||
}
|
|
||||||
|
|
||||||
class ActiveRecord
|
|
||||||
# ErrorMessages to override default messages in
|
|
||||||
# +ActiveRecord::Errors::@@default_error_messages+
|
|
||||||
# This plugin also replaces hardcoded 3 text messages
|
|
||||||
# :error_translation is inflected using the Rails
|
|
||||||
# inflector.
|
|
||||||
#
|
|
||||||
# Remember to modify the Inflector with your localized translation
|
|
||||||
# of "error" and "errors" in the bottom of this file
|
|
||||||
#
|
|
||||||
ErrorMessages = {
|
|
||||||
:inclusion => "er ikke med på listen",
|
|
||||||
:exclusion => "er et reserveret ord",
|
|
||||||
:invalid => "er ugyldig",
|
|
||||||
:confirmation => "matcher ikke med bekræftelsen",
|
|
||||||
:accepted => "skal accepteres",
|
|
||||||
:empty => "kan ikke være tom",
|
|
||||||
:blank => "skal udfyldes",
|
|
||||||
:too_long => "er for langt (max er %d tegn)",
|
|
||||||
:too_short => "er for kort (minimum er %d tegn)",
|
|
||||||
:wrong_length => "har forkert længde (skal være %d tegn)",
|
|
||||||
:taken => "er allerede taget",
|
|
||||||
:not_a_number => "er ikke et tal",
|
|
||||||
#Jespers additions:
|
|
||||||
:error_translation => "fejl",
|
|
||||||
:error_header => "%s forhindrede %s i at blive gemt",
|
|
||||||
:error_subheader => "Problemer med følgende felter:"
|
|
||||||
}
|
|
||||||
end
|
|
||||||
|
|
||||||
# Texts to override +distance_of_time_in_words()+
|
|
||||||
class DateHelper
|
|
||||||
Texts = {
|
|
||||||
:less_than_x_seconds => "under %d sekunder",
|
|
||||||
:half_a_minute => "et halvt minut",
|
|
||||||
:less_than_a_minute => "under et minut",
|
|
||||||
:one_minute => "1 minut",
|
|
||||||
:x_minutes => "%d minutter",
|
|
||||||
:one_hour => "omkring en time",
|
|
||||||
:x_hours => "omkring %d timer",
|
|
||||||
:one_day => "1 dag",
|
|
||||||
:x_days => "%d dage",
|
|
||||||
:one_month => "1 måned",
|
|
||||||
:x_months => "%d måneder",
|
|
||||||
:one_year => "1 år",
|
|
||||||
:x_years => "%d år"
|
|
||||||
}
|
|
||||||
|
|
||||||
# Rails uses Month names in Date and time select boxes
|
|
||||||
# (+date_select+ and +datetime_select+ )
|
|
||||||
# Currently (as of version 1.1.6), Rails doesn't use daynames
|
|
||||||
Monthnames = [nil] + %w{januar februar marts april maj juni juli august september oktober november december}
|
|
||||||
AbbrMonthnames = [nil] + %w{jan feb mar apr maj jun jul aug sep okt nov dec}
|
|
||||||
Daynames = %w{søndag mandag tirsdag onsdag torsdag fredag lørdag}
|
|
||||||
AbbrDaynames = %w{søn man tir ons tors fre lør}
|
|
||||||
|
|
||||||
|
|
||||||
# Date and time format syntax explained in http://www.rubycentral.com/ref/ref_c_time.html#strftime
|
|
||||||
# These are sent to strftime that Ruby's date and time handlers use internally
|
|
||||||
# Same options as php (that has a better list: http://www.php.net/strftime )
|
|
||||||
DateFormats = {
|
|
||||||
:default => "%Y-%m-%d",
|
|
||||||
:short => "%e. %b",
|
|
||||||
:long => "%e. %B, %Y"
|
|
||||||
}
|
|
||||||
|
|
||||||
TimeFormats = {
|
|
||||||
:default => "%A d. %d %B %Y %H:%M", #no timezone
|
|
||||||
:short => "%d. %b %H:%M",
|
|
||||||
:long => "%d. %B %Y %H:%M"
|
|
||||||
}
|
|
||||||
# Set the order of +date_select+ and +datetime_select+ boxes
|
|
||||||
# Note that at present, the current Rails version only supports ordering of date_select boxes
|
|
||||||
DateSelectOrder = {
|
|
||||||
:order => [:day, :month, :year] #default Rails is US ordered: :order => [:year, :month, :day]
|
|
||||||
}
|
|
||||||
end
|
|
||||||
|
|
||||||
class NumberHelper
|
|
||||||
# CurrencyOptions are used as default for +Number#to_currency()+
|
|
||||||
# http://api.rubyonrails.org/classes/ActionView/Helpers/NumberHelper.html#M000449
|
|
||||||
CurrencyOptions = {
|
|
||||||
:unit => "kr.",
|
|
||||||
:separator => ",", #unit separator (between integer part and fraction part)
|
|
||||||
:delimiter => ".", #delimiter between each group of thousands. Example: 1.234.567
|
|
||||||
:order => [:number, :unit] #order is at present unsupported in Rails
|
|
||||||
#to support for instance Danish format, the order is different: Unit comes last (ex. "1.234,00 dkr.")
|
|
||||||
}
|
|
||||||
end
|
|
||||||
|
|
||||||
class ArrayHelper
|
|
||||||
# Modifies +Array#to_sentence()+
|
|
||||||
# http://api.rubyonrails.org/classes/ActiveSupport/CoreExtensions/Array/Conversions.html#M000274
|
|
||||||
ToSentenceTexts = {
|
|
||||||
:connector => 'og',
|
|
||||||
:skip_last_comma => true
|
|
||||||
}
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
|
|
||||||
# Use the inflector below to pluralize "error" from
|
|
||||||
# @@default_error_messages[:error_translation] above (if necessary)
|
|
||||||
Inflector.inflections do |inflect|
|
|
||||||
inflect.uncountable %w( fejl )
|
|
||||||
end
|
|
117
vendor/plugins/l10n-simplified-0.8/lib/lang_de.rb
vendored
117
vendor/plugins/l10n-simplified-0.8/lib/lang_de.rb
vendored
|
@ -1,117 +0,0 @@
|
||||||
# lang_de.rb
|
|
||||||
# German translation file
|
|
||||||
# Translation by Benedikt Huber
|
|
||||||
# Additions by Matthias Tarasiewicz - parasew (at) gmail
|
|
||||||
|
|
||||||
module LocalizationSimplified
|
|
||||||
About = {
|
|
||||||
:lang => "de",
|
|
||||||
:updated => "2006-09-28"
|
|
||||||
}
|
|
||||||
|
|
||||||
class ActiveRecord
|
|
||||||
# ErrorMessages to override default messages in
|
|
||||||
# +ActiveRecord::Errors::@@default_error_messages+
|
|
||||||
# This plugin also replaces hardcoded 3 text messages
|
|
||||||
# :error_translation is inflected using the Rails
|
|
||||||
# inflector.
|
|
||||||
#
|
|
||||||
# Remember to modify the Inflector with your localized translation
|
|
||||||
# of "error" and "errors" in the bottom of this file
|
|
||||||
#
|
|
||||||
ErrorMessages = {
|
|
||||||
:inclusion => "ist nicht in der Liste gültiger Optionen enthalten",
|
|
||||||
:exclusion => "ist reserviert",
|
|
||||||
:invalid => "ist ungültig",
|
|
||||||
:confirmation => "entspricht nicht der Bestätigung",
|
|
||||||
:accepted => "muss akzeptiert werden",
|
|
||||||
:empty => "darf nicht leer sein",
|
|
||||||
:blank => "wird benötigt",# alternate, formulation: "is required"
|
|
||||||
:too_long => "ist zu lang (höchstens %d Zeichen)",
|
|
||||||
:too_short => "ist zu kurz (mindestens %d Zeichen)",
|
|
||||||
:wrong_length => "hat eine falsche Länge (sollte %d Zeichen sein)",
|
|
||||||
:taken => "ist schon vergeben",
|
|
||||||
:not_a_number => "ist keine Zahl",
|
|
||||||
#Bennis additions
|
|
||||||
:greater_than => "muss größer sein als %d",
|
|
||||||
#Jespers additions:
|
|
||||||
:error_translation => "Fehler",
|
|
||||||
:error_header => "%s hinderte %s daran, gespeichert zu werden",
|
|
||||||
:error_subheader => "Es gab folgende Probleme: "
|
|
||||||
}
|
|
||||||
end
|
|
||||||
|
|
||||||
# Texts to override +distance_of_time_in_words()+
|
|
||||||
class DateHelper
|
|
||||||
Texts = {
|
|
||||||
:less_than_x_seconds => "weniger als %d Sekunden",
|
|
||||||
:half_a_minute => "eine halbe Minute",
|
|
||||||
:less_than_a_minute => "weniger als eine Minute",
|
|
||||||
:one_minute => "1 Minute",
|
|
||||||
:x_minutes => "%d Minuten",
|
|
||||||
:one_hour => "ungefähr 1 Stunde",
|
|
||||||
:x_hours => "ungefähr %d Stunden",
|
|
||||||
:one_day => "1 Tag",
|
|
||||||
:x_days => "%d Tage",
|
|
||||||
:one_month => "1 Monat",
|
|
||||||
:x_months => "%d Monate",
|
|
||||||
:one_year => "1 Jahr",
|
|
||||||
:x_years => "%d Jahre"
|
|
||||||
}
|
|
||||||
|
|
||||||
# Rails uses Month names in Date and time select boxes
|
|
||||||
# (+date_select+ and +datetime_select+ )
|
|
||||||
# Currently (as of version 1.1.6), Rails doesn't use daynames
|
|
||||||
Monthnames = [nil] + %w{Januar Februar März April Mai Juni Juli August September Oktober November Dezember}
|
|
||||||
AbbrMonthnames = [nil] + %w{Jan Feb Mrz Apr Mai Jun Jul Aug Sep Okt Nov Dez}
|
|
||||||
Daynames = %w{Sonntag Montag Dienstag Mittwoch Donnerstag Freitag Samstag}
|
|
||||||
AbbrDaynames = %w{So Mo Di Mi Do Fr Sa}
|
|
||||||
|
|
||||||
# Date and time format syntax explained in http://www.rubycentral.com/ref/ref_c_time.html#strftime
|
|
||||||
# These are sent to strftime that Ruby's date and time handlers use internally
|
|
||||||
# Same options as php (that has a better list: http://www.php.net/strftime )
|
|
||||||
DateFormats = {
|
|
||||||
:default => "%Y-%m-%d",
|
|
||||||
:short => "%b %e",
|
|
||||||
:long => "%B %e, %Y"
|
|
||||||
}
|
|
||||||
|
|
||||||
TimeFormats = {
|
|
||||||
:default => "%A, %d %B %Y %H:%M:%S %Z",
|
|
||||||
:short => "%d %b. %H:%M",
|
|
||||||
:long => "%d %B %Y, %H:%M"
|
|
||||||
}
|
|
||||||
# Set the order of +date_select+ and +datetime_select+ boxes
|
|
||||||
# Note that at present, the current Rails version only supports ordering of date_select boxes
|
|
||||||
DateSelectOrder = {
|
|
||||||
:order => [:day, :month, :year] #default Rails is US ordered: :order => [:year, :month, :day]
|
|
||||||
}
|
|
||||||
end
|
|
||||||
|
|
||||||
class NumberHelper
|
|
||||||
# CurrencyOptions are used as default for +Number#to_currency()+
|
|
||||||
# http://api.rubyonrails.org/classes/ActionView/Helpers/NumberHelper.html#M000449
|
|
||||||
CurrencyOptions = {
|
|
||||||
:unit => "€",
|
|
||||||
:separator => ",", #unit separator (between integer part and fraction part)
|
|
||||||
:delimiter => ".", #delimiter between each group of thousands. Example: 1.234.567
|
|
||||||
:order => [:number, :unit] #order is at present unsupported in Rails
|
|
||||||
}
|
|
||||||
end
|
|
||||||
|
|
||||||
class ArrayHelper
|
|
||||||
# Modifies +Array#to_sentence()+
|
|
||||||
# http://api.rubyonrails.org/classes/ActiveSupport/CoreExtensions/Array/Conversions.html#M000274
|
|
||||||
ToSentenceTexts = {
|
|
||||||
:connector => 'und',
|
|
||||||
:skip_last_comma => true
|
|
||||||
}
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
|
|
||||||
# Use the inflector below to pluralize "error" from
|
|
||||||
# @@default_error_messages[:error_translation] above (if necessary)
|
|
||||||
Inflector.inflections do |inflect|
|
|
||||||
inflect.uncountable %w( Fehler )
|
|
||||||
end
|
|
119
vendor/plugins/l10n-simplified-0.8/lib/lang_en.rb
vendored
119
vendor/plugins/l10n-simplified-0.8/lib/lang_en.rb
vendored
|
@ -1,119 +0,0 @@
|
||||||
# lang_en.rb
|
|
||||||
# English baseline translation file. Comes in handy for testing purposes
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
module LocalizationSimplified
|
|
||||||
About = {
|
|
||||||
:lang => "en",
|
|
||||||
:updated => "2006-09-01"
|
|
||||||
}
|
|
||||||
|
|
||||||
class ActiveRecord
|
|
||||||
# ErrorMessages to override default messages in
|
|
||||||
# +ActiveRecord::Errors::@@default_error_messages+
|
|
||||||
# This plugin also replaces hardcoded 3 text messages
|
|
||||||
# :error_translation is inflected using the Rails
|
|
||||||
# inflector.
|
|
||||||
#
|
|
||||||
# Remember to modify the Inflector with your localized translation
|
|
||||||
# of "error" and "errors" in the bottom of this file
|
|
||||||
#
|
|
||||||
ErrorMessages = {
|
|
||||||
:inclusion => "is not included in the list",
|
|
||||||
:exclusion => "is reserved",
|
|
||||||
:invalid => "is invalid",
|
|
||||||
:confirmation => "doesn't match confirmation",
|
|
||||||
:accepted => "must be accepted",
|
|
||||||
:empty => "can't be empty",
|
|
||||||
:blank => "can't be blank",# alternate, formulation: "is required"
|
|
||||||
:too_long => "is too long (maximum is %d characters)",
|
|
||||||
:too_short => "is too short (minimum is %d characters)",
|
|
||||||
:wrong_length => "is the wrong length (should be %d characters)",
|
|
||||||
:taken => "has already been taken",
|
|
||||||
:not_a_number => "is not a number",
|
|
||||||
#Jespers additions:
|
|
||||||
:error_translation => "error",
|
|
||||||
:error_header => "%s prohibited this %s from being saved",
|
|
||||||
:error_subheader => "There were problems with the following fields:"
|
|
||||||
}
|
|
||||||
end
|
|
||||||
|
|
||||||
# Texts to override +distance_of_time_in_words()+
|
|
||||||
class DateHelper
|
|
||||||
Texts = {
|
|
||||||
:less_than_x_seconds => "less than %d seconds",
|
|
||||||
:half_a_minute => "half a minute",
|
|
||||||
:less_than_a_minute => "less than a minute",
|
|
||||||
:one_minute => "1 minute",
|
|
||||||
:x_minutes => "%d minutes",
|
|
||||||
:one_hour => "about 1 hour",
|
|
||||||
:x_hours => "about %d hours",
|
|
||||||
:one_day => "1 day",
|
|
||||||
:x_days => "%d days",
|
|
||||||
:one_month => "1 month",
|
|
||||||
:x_months => "%d months",
|
|
||||||
:one_year => "1 year",
|
|
||||||
:x_years => "%d years"
|
|
||||||
}
|
|
||||||
|
|
||||||
# Rails uses Month names in Date and time select boxes
|
|
||||||
# (+date_select+ and +datetime_select+ )
|
|
||||||
# Currently (as of version 1.1.6), Rails doesn't use daynames
|
|
||||||
Monthnames = [nil] + %w{January February March April May June July August September October November December}
|
|
||||||
AbbrMonthnames = [nil] + %w{Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec}
|
|
||||||
Daynames = %w{Sunday Monday Tuesday Wednesday Thursday Friday Saturday}
|
|
||||||
AbbrDaynames = %w{Sun Mon Tue Wed Thu Fri Sat}
|
|
||||||
|
|
||||||
# Date and time format syntax explained in http://www.rubycentral.com/ref/ref_c_time.html#strftime
|
|
||||||
# These are sent to strftime that Ruby's date and time handlers use internally
|
|
||||||
# Same options as php (that has a better list: http://www.php.net/strftime )
|
|
||||||
DateFormats = {
|
|
||||||
:default => "%Y-%m-%d",
|
|
||||||
:short => "%b %e",
|
|
||||||
:long => "%B %e, %Y"
|
|
||||||
}
|
|
||||||
|
|
||||||
TimeFormats = {
|
|
||||||
:default => "%a, %d %b %Y %H:%M:%S %z",
|
|
||||||
:short => "%d %b %H:%M",
|
|
||||||
:long => "%B %d, %Y %H:%M"
|
|
||||||
}
|
|
||||||
# Set the order of +date_select+ and +datetime_select+ boxes
|
|
||||||
# Note that at present, the current Rails version only supports ordering of date_select boxes
|
|
||||||
DateSelectOrder = {
|
|
||||||
:order => [:year, :month, :day] #default Rails is US ordered: :order => [:year, :month, :day]
|
|
||||||
}
|
|
||||||
end
|
|
||||||
|
|
||||||
class NumberHelper
|
|
||||||
# CurrencyOptions are used as default for +Number#to_currency()+
|
|
||||||
# http://api.rubyonrails.org/classes/ActionView/Helpers/NumberHelper.html#M000449
|
|
||||||
CurrencyOptions = {
|
|
||||||
:unit => "$",
|
|
||||||
:separator => ".", #unit separator (between integer part and fraction part)
|
|
||||||
:delimiter => ",", #delimiter between each group of thousands. Example: 1.234.567
|
|
||||||
:order => [:unit, :number] #order is at present unsupported in Rails
|
|
||||||
#to support for instance Danish format, the order is different: Unit comes last (ex. "1.234,00 dkr.")
|
|
||||||
}
|
|
||||||
end
|
|
||||||
|
|
||||||
class ArrayHelper
|
|
||||||
# Modifies +Array#to_sentence()+
|
|
||||||
# http://api.rubyonrails.org/classes/ActiveSupport/CoreExtensions/Array/Conversions.html#M000274
|
|
||||||
ToSentenceTexts = {
|
|
||||||
:connector => 'and',
|
|
||||||
:skip_last_comma => false
|
|
||||||
}
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
|
|
||||||
# Use the inflector below to pluralize "error" from
|
|
||||||
# @@default_error_messages[:error_translation] above (if necessary)
|
|
||||||
# Inflector.inflections do |inflect|
|
|
||||||
# inflect.plural /^(ox)$/i, '\1en'
|
|
||||||
# inflect.singular /^(ox)en/i, '\1'
|
|
||||||
# inflect.irregular 'person people'
|
|
||||||
# inflect.uncountable %w( information )
|
|
||||||
# end
|
|
115
vendor/plugins/l10n-simplified-0.8/lib/lang_es.rb
vendored
115
vendor/plugins/l10n-simplified-0.8/lib/lang_es.rb
vendored
|
@ -1,115 +0,0 @@
|
||||||
# lang_es.rb
|
|
||||||
# Spanish translation file.
|
|
||||||
# Translation by Luis Villa del Campo (www.grancomo.com)
|
|
||||||
|
|
||||||
|
|
||||||
module LocalizationSimplified
|
|
||||||
About = {
|
|
||||||
:lang => "es",
|
|
||||||
:updated => "2006-10-03"
|
|
||||||
}
|
|
||||||
|
|
||||||
class ActiveRecord
|
|
||||||
# ErrorMessages to override default messages in
|
|
||||||
# +ActiveRecord::Errors::@@default_error_messages+
|
|
||||||
# This plugin also replaces hardcoded 3 text messages
|
|
||||||
# :error_translation is inflected using the Rails
|
|
||||||
# inflector.
|
|
||||||
#
|
|
||||||
# Remember to modify the Inflector with your localized translation
|
|
||||||
# of "error" and "errors" in the bottom of this file
|
|
||||||
#
|
|
||||||
ErrorMessages = {
|
|
||||||
:inclusion => "no está incluido en la lista",
|
|
||||||
:exclusion => "está reservado",
|
|
||||||
:invalid => "no es válido",
|
|
||||||
:confirmation => "no coincide con la conformación",
|
|
||||||
:accepted => "debe ser aceptado",
|
|
||||||
:empty => "no puede estar vacío",
|
|
||||||
:blank => "no puede estar en blanco",# alternate, formulation: "is required"
|
|
||||||
:too_long => "es demasiado largo (el máximo es %d caracteres)",
|
|
||||||
:too_short => "es demasiado corto (el mínimo es %d caracteres)",
|
|
||||||
:wrong_length => "no posee el largo correcto (debería ser de %d caracteres)",
|
|
||||||
:taken => "ya está ocupado",
|
|
||||||
:not_a_number => "no es un número",
|
|
||||||
#Jespers additions:
|
|
||||||
:error_translation => "error",
|
|
||||||
:error_header => "%s no permite guardar %s",
|
|
||||||
:error_subheader => "Ha habido problemas con los siguientes campos:"
|
|
||||||
}
|
|
||||||
end
|
|
||||||
|
|
||||||
# Texts to override +distance_of_time_in_words()+
|
|
||||||
class DateHelper
|
|
||||||
Texts = {
|
|
||||||
:less_than_x_seconds => "menos de %d segundos",
|
|
||||||
:half_a_minute => "medio minuto",
|
|
||||||
:less_than_a_minute => "menos de un minuto",
|
|
||||||
:one_minute => "1 minuto",
|
|
||||||
:x_minutes => "%d minutos",
|
|
||||||
:one_hour => "sobre una hora",
|
|
||||||
:x_hours => "sobre %d horas",
|
|
||||||
:one_day => "un día",
|
|
||||||
:x_days => "%d días",
|
|
||||||
:one_month => "1 mes",
|
|
||||||
:x_months => "%d meses",
|
|
||||||
:one_year => "1 año",
|
|
||||||
:x_years => "%d años"
|
|
||||||
}
|
|
||||||
|
|
||||||
# Rails uses Month names in Date and time select boxes
|
|
||||||
# (+date_select+ and +datetime_select+ )
|
|
||||||
# Currently (as of version 1.1.6), Rails doesn't use daynames
|
|
||||||
Monthnames = [nil] + %w{enero febrero marzo abril mayo junio julio agosto septiembre octubre noviembre diciembre}
|
|
||||||
AbbrMonthnames = [nil] + %w{ene feb mar abr may jun jul ago sep oct nov dic}
|
|
||||||
Daynames = %w{domingo lunes martes miércoles jueves viernes sábado}
|
|
||||||
AbbrDaynames = %w{dom lun mar mié jue vie sáb}
|
|
||||||
|
|
||||||
# Date and time format syntax explained in http://www.rubycentral.com/ref/ref_c_time.html#strftime
|
|
||||||
# These are sent to strftime that Ruby's date and time handlers use internally
|
|
||||||
# Same options as php (that has a better list: http://www.php.net/strftime )
|
|
||||||
DateFormats = {
|
|
||||||
:default => "%Y-%m-%d",
|
|
||||||
:short => "%b %e",
|
|
||||||
:long => "%B %e, %Y"
|
|
||||||
}
|
|
||||||
|
|
||||||
TimeFormats = {
|
|
||||||
:default => "%a, %d %b %Y %H:%M:%S %z",
|
|
||||||
:short => "%d %b %H:%M",
|
|
||||||
:long => "%B %d, %Y %H:%M"
|
|
||||||
}
|
|
||||||
# Set the order of +date_select+ and +datetime_select+ boxes
|
|
||||||
# Note that at present, the current Rails version only supports ordering of date_select boxes
|
|
||||||
DateSelectOrder = {
|
|
||||||
:order => [:day, :month, :year] #default Rails is US ordered: :order => [:year, :month, :day]
|
|
||||||
}
|
|
||||||
end
|
|
||||||
|
|
||||||
class NumberHelper
|
|
||||||
# CurrencyOptions are used as default for +Number#to_currency()+
|
|
||||||
# http://api.rubyonrails.org/classes/ActionView/Helpers/NumberHelper.html#M000449
|
|
||||||
CurrencyOptions = {
|
|
||||||
:unit => "€",
|
|
||||||
:separator => ",", #unit separator (between integer part and fraction part)
|
|
||||||
:delimiter => ".", #delimiter between each group of thousands. Example: 1.234.567
|
|
||||||
:order => [:unit, :number] #order is at present unsupported in Rails
|
|
||||||
}
|
|
||||||
end
|
|
||||||
|
|
||||||
class ArrayHelper
|
|
||||||
# Modifies +Array#to_sentence()+
|
|
||||||
# http://api.rubyonrails.org/classes/ActiveSupport/CoreExtensions/Array/Conversions.html#M000274
|
|
||||||
ToSentenceTexts = {
|
|
||||||
:connector => 'y',
|
|
||||||
:skip_last_comma => true
|
|
||||||
}
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
|
|
||||||
# Use the inflector below to pluralize "error" from
|
|
||||||
# @@default_error_messages[:error_translation] above (if necessary)
|
|
||||||
Inflector.inflections do |inflect|
|
|
||||||
inflect.plural /^(error)$/i, '\1es'
|
|
||||||
end
|
|
120
vendor/plugins/l10n-simplified-0.8/lib/lang_es_ar.rb
vendored
120
vendor/plugins/l10n-simplified-0.8/lib/lang_es_ar.rb
vendored
|
@ -1,120 +0,0 @@
|
||||||
# lang_es-AR.rb
|
|
||||||
# Argentinean-flavored Spanish translation file.
|
|
||||||
# Translation by Damian Janowski damian.janowski@gmail.com
|
|
||||||
# (based on lang_es.rb by Luis Villa del Campo)
|
|
||||||
|
|
||||||
module LocalizationSimplified
|
|
||||||
About = {
|
|
||||||
:lang => "es-ar",
|
|
||||||
:updated => "2006-10-03"
|
|
||||||
}
|
|
||||||
|
|
||||||
class ActiveRecord
|
|
||||||
# ErrorMessages to override default messages in
|
|
||||||
# +ActiveRecord::Errors::@@default_error_messages+
|
|
||||||
# This plugin also replaces hardcoded 3 text messages
|
|
||||||
# :error_translation is inflected using the Rails
|
|
||||||
# inflector.
|
|
||||||
#
|
|
||||||
# Remember to modify the Inflector with your localized translation
|
|
||||||
# of "error" and "errors" in the bottom of this file
|
|
||||||
#
|
|
||||||
ErrorMessages = {
|
|
||||||
:inclusion => "no está incluido en la lista",
|
|
||||||
:exclusion => "está reservado",
|
|
||||||
:invalid => "es inválido",
|
|
||||||
:confirmation => "no coincide con la confirmación",
|
|
||||||
:accepted => "debe ser aceptado",
|
|
||||||
:empty => "no puede estar vacío",
|
|
||||||
:blank => "no puede estar en blanco", # alternate, formulation: "es requerido"
|
|
||||||
:too_long => "es demasiado largo (el máximo es de %d caracteres)",
|
|
||||||
:too_short => "es demasiado corto (el mínimo es de %d caracteres)",
|
|
||||||
:wrong_length => "no posee el largo correcto (debería ser de %d caracteres)",
|
|
||||||
:taken => "ya está tomado",
|
|
||||||
:not_a_number => "no es un número",
|
|
||||||
#Jespers additions:
|
|
||||||
:error_translation => "error ocurrió",
|
|
||||||
:error_header => "%s al guardar su %s",
|
|
||||||
:error_subheader => "Los siguientes campos presentan problemas:"
|
|
||||||
}
|
|
||||||
end
|
|
||||||
|
|
||||||
# Texts to override +distance_of_time_in_words()+
|
|
||||||
class DateHelper
|
|
||||||
Texts = {
|
|
||||||
:less_than_x_seconds => "menos de %d segundos",
|
|
||||||
:half_a_minute => "medio minuto",
|
|
||||||
:less_than_a_minute => "menos de un minuto",
|
|
||||||
:one_minute => "1 minuto",
|
|
||||||
:x_minutes => "%d minutos",
|
|
||||||
:one_hour => "una hora",
|
|
||||||
:x_hours => "%d horas",
|
|
||||||
:one_day => "un día",
|
|
||||||
:x_days => "%d días",
|
|
||||||
:one_month => "un mes",
|
|
||||||
:x_months => "%d meses",
|
|
||||||
:one_year => "un año",
|
|
||||||
:x_years => "%d años"
|
|
||||||
}
|
|
||||||
|
|
||||||
# Rails uses Month names in Date and time select boxes
|
|
||||||
# (+date_select+ and +datetime_select+ )
|
|
||||||
# Currently (as of version 1.1.6), Rails doesn't use daynames
|
|
||||||
Monthnames = [nil] + %w{enero febrero marzo abril mayo junio julio agosto septiembre octubre noviembre diciembre}
|
|
||||||
AbbrMonthnames = [nil] + %w{ene feb mar abr may jun jul ago sep oct nov dic}
|
|
||||||
Daynames = %w{domingo lunes martes miércoles jueves viernes sábado}
|
|
||||||
AbbrDaynames = %w{dom lun mar mié jue vie sáb}
|
|
||||||
|
|
||||||
# Date and time format syntax explained in http://www.rubycentral.com/ref/ref_c_time.html#strftime
|
|
||||||
# These are sent to strftime that Ruby's date and time handlers use internally
|
|
||||||
# Same options as php (that has a better list: http://www.php.net/strftime )
|
|
||||||
DateFormats = {
|
|
||||||
:default => "%Y-%m-%d",
|
|
||||||
:short => "%e %b",
|
|
||||||
:long => "%e de %B de %Y"
|
|
||||||
}
|
|
||||||
|
|
||||||
TimeFormats = {
|
|
||||||
:default => "%a, %d de %b de %Y %H:%M:%S %z",
|
|
||||||
:short => "%b %d %H:%M",
|
|
||||||
:long => "%d de %B de %Y %H:%M"
|
|
||||||
}
|
|
||||||
# Set the order of +date_select+ and +datetime_select+ boxes
|
|
||||||
# Note that at present, the current Rails version only supports ordering of date_select boxes
|
|
||||||
DateSelectOrder = {
|
|
||||||
:order => [:day, :month, :year] #default Rails is US ordered: :order => [:year, :month, :day]
|
|
||||||
}
|
|
||||||
end
|
|
||||||
|
|
||||||
class NumberHelper
|
|
||||||
# CurrencyOptions are used as default for +Number#to_currency()+
|
|
||||||
# http://api.rubyonrails.org/classes/ActionView/Helpers/NumberHelper.html#M000449
|
|
||||||
CurrencyOptions = {
|
|
||||||
:unit => "$",
|
|
||||||
:separator => ",", #unit separator (between integer part and fraction part)
|
|
||||||
:delimiter => ".", #delimiter between each group of thousands. Example: 1.234.567
|
|
||||||
:order => [:unit, :number] #order is at present unsupported in Rails
|
|
||||||
#to support for instance Danish format, the order is different: Unit comes last (ex. "1.234,00 dkr.")
|
|
||||||
}
|
|
||||||
end
|
|
||||||
|
|
||||||
class ArrayHelper
|
|
||||||
# Modifies +Array#to_sentence()+
|
|
||||||
# http://api.rubyonrails.org/classes/ActiveSupport/CoreExtensions/Array/Conversions.html#M000274
|
|
||||||
ToSentenceTexts = {
|
|
||||||
:connector => 'y',
|
|
||||||
:skip_last_comma => true
|
|
||||||
}
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
|
|
||||||
# Use the inflector below to pluralize "error" from
|
|
||||||
# @@default_error_messages[:error_translation] above (if necessary)
|
|
||||||
Inflector.inflections do |inflect|
|
|
||||||
# inflect.plural /^(ox)$/i, '\1en'
|
|
||||||
# inflect.singular /^(ox)en/i, '\1'
|
|
||||||
# inflect.irregular 'person people'
|
|
||||||
# inflect.uncountable %w( information )
|
|
||||||
inflect.plural /^(error ocurrió)$/i, 'errores ocurrieron'
|
|
||||||
end
|
|
119
vendor/plugins/l10n-simplified-0.8/lib/lang_fi.rb
vendored
119
vendor/plugins/l10n-simplified-0.8/lib/lang_fi.rb
vendored
|
@ -1,119 +0,0 @@
|
||||||
# lang_fi.rb
|
|
||||||
# Finnish translation file.
|
|
||||||
# Translation by Jarkko Laine ( http://jlaine.net/ )
|
|
||||||
|
|
||||||
|
|
||||||
module LocalizationSimplified
|
|
||||||
About = {
|
|
||||||
:lang => "fi",
|
|
||||||
:updated => "2006-09-07"
|
|
||||||
}
|
|
||||||
|
|
||||||
class ActiveRecord
|
|
||||||
# ErrorMessages to override default messages in
|
|
||||||
# +ActiveRecord::Errors::@@default_error_messages+
|
|
||||||
# This plugin also replaces hardcoded 3 text messages
|
|
||||||
# :error_translation is inflected using the Rails
|
|
||||||
# inflector.
|
|
||||||
#
|
|
||||||
# Remember to modify the Inflector with your localized translation
|
|
||||||
# of "error" and "errors" in the bottom of this file
|
|
||||||
#
|
|
||||||
ErrorMessages = {
|
|
||||||
:inclusion => "ei löydy listalta",
|
|
||||||
:exclusion => "on varattu",
|
|
||||||
:invalid => "on virheellinen",
|
|
||||||
:confirmation => "ei vastaa vahvistusta",
|
|
||||||
:accepted => "on hyväksyttävä",
|
|
||||||
:empty => "ei voi olla tyhjä",
|
|
||||||
:blank => "ei voi olla tyhjä",
|
|
||||||
:too_long => "on liian pitkä (maksimi on %d merkkiä)",
|
|
||||||
:too_short => "on liian lyhyt (minimi on %d merkkiä)",
|
|
||||||
:wrong_length => "on väärän pituinen (oikea pituus %d merkkiä)",
|
|
||||||
:taken => "on jo varattu",
|
|
||||||
:not_a_number => "ei ole numero",
|
|
||||||
#Jespers additions:
|
|
||||||
:error_translation => "virhe",
|
|
||||||
:error_header => "%s esti tämän %s tallentamisen",
|
|
||||||
:error_subheader => "Seuraavat kentät aiheuttivat ongelmia:"
|
|
||||||
}
|
|
||||||
end
|
|
||||||
|
|
||||||
# Texts to override +distance_of_time_in_words()+
|
|
||||||
class DateHelper
|
|
||||||
Texts = {
|
|
||||||
:less_than_x_seconds => "alle %d sekuntia",
|
|
||||||
:half_a_minute => "puoli minuuttia",
|
|
||||||
:less_than_a_minute => "alle minuutti",
|
|
||||||
:one_minute => "1 minuutti",
|
|
||||||
:x_minutes => "%d minuuttia",
|
|
||||||
:one_hour => "noin tunti",
|
|
||||||
:x_hours => "noin %d tuntia",
|
|
||||||
:one_day => "1 päivä",
|
|
||||||
:x_days => "%d päivää",
|
|
||||||
:one_month => "1 month",
|
|
||||||
:x_months => "%d months",
|
|
||||||
:one_year => "1 year",
|
|
||||||
:x_years => "%d years"
|
|
||||||
}
|
|
||||||
|
|
||||||
# Rails uses Month names in Date and time select boxes
|
|
||||||
# (+date_select+ and +datetime_select+ )
|
|
||||||
# Currently (as of version 1.1.6), Rails doesn't use daynames
|
|
||||||
Monthnames = [nil] + %w{tammikuu helmikuu maaliskuu huhtikuu toukokuu kesäkuu heinäkuu elokuu syyskuu lokakuu marraskuu joulukuu}
|
|
||||||
AbbrMonthnames = [nil] + %w{tammi helmi maalis huhti touko kesä heinä elo syys loka marras joulu}
|
|
||||||
Daynames = %w{sunnuntai maanantai tiistai keskiviikko torstai perjantai lauantai}
|
|
||||||
AbbrDaynames = %w{su ma ti ke to pe la}
|
|
||||||
|
|
||||||
# Date and time format syntax explained in http://www.rubycentral.com/ref/ref_c_time.html#strftime
|
|
||||||
# These are sent to strftime that Ruby's date and time handlers use internally
|
|
||||||
# Same options as php (that has a better list: http://www.php.net/strftime )
|
|
||||||
DateFormats = {
|
|
||||||
:default => "%e.%m.%Y",
|
|
||||||
:short => "%d.%m.",
|
|
||||||
:long => "%e. %Bta %Y"
|
|
||||||
}
|
|
||||||
|
|
||||||
TimeFormats = {
|
|
||||||
:default => "%a %Bn %e. %H:%M:%S %Z %Y",
|
|
||||||
:short => "%d.%m.%Y %H:%M",
|
|
||||||
:long => "%a %e. %Bta %Y %T"
|
|
||||||
}
|
|
||||||
# Set the order of +date_select+ and +datetime_select+ boxes
|
|
||||||
# Note that at present, the current Rails version only supports ordering of date_select boxes
|
|
||||||
DateSelectOrder = {
|
|
||||||
:order => [:day, :month, :year] #default Rails is US ordered: :order => [:year, :month, :day]
|
|
||||||
}
|
|
||||||
end
|
|
||||||
|
|
||||||
class NumberHelper
|
|
||||||
# CurrencyOptions are used as default for +Number#to_currency()+
|
|
||||||
# http://api.rubyonrails.org/classes/ActionView/Helpers/NumberHelper.html#M000449
|
|
||||||
CurrencyOptions = {
|
|
||||||
:unit => "€",
|
|
||||||
:separator => " ", #unit separator (between integer part and fraction part)
|
|
||||||
:delimiter => ",", #delimiter between each group of thousands. Example: 1.234.567
|
|
||||||
:order => [:unit, :number] #order is at present unsupported in Rails
|
|
||||||
#to support for instance Danish format, the order is different: Unit comes last (ex. "1.234,00 dkr.")
|
|
||||||
}
|
|
||||||
end
|
|
||||||
|
|
||||||
class ArrayHelper
|
|
||||||
# Modifies +Array#to_sentence()+
|
|
||||||
# http://api.rubyonrails.org/classes/ActiveSupport/CoreExtensions/Array/Conversions.html#M000274
|
|
||||||
ToSentenceTexts = {
|
|
||||||
:connector => 'ja',
|
|
||||||
:skip_last_comma => true
|
|
||||||
}
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
|
|
||||||
# Use the inflector below to pluralize "error" from
|
|
||||||
# @@default_error_messages[:error_translation] above (if necessary)
|
|
||||||
# Inflector.inflections do |inflect|
|
|
||||||
# inflect.plural /^(ox)$/i, '\1en'
|
|
||||||
# inflect.singular /^(ox)en/i, '\1'
|
|
||||||
# inflect.irregular 'person people'
|
|
||||||
# inflect.uncountable %w( information )
|
|
||||||
# end
|
|
118
vendor/plugins/l10n-simplified-0.8/lib/lang_fr.rb
vendored
118
vendor/plugins/l10n-simplified-0.8/lib/lang_fr.rb
vendored
|
@ -1,118 +0,0 @@
|
||||||
# lang_fr.rb
|
|
||||||
# Traduction française des messages d'erruer. A compléter ou corriger.
|
|
||||||
# Translation by Frédéric Cavazza ( www.fredcavazza.net )
|
|
||||||
|
|
||||||
|
|
||||||
module LocalizationSimplified
|
|
||||||
About = {
|
|
||||||
:lang => "fr",
|
|
||||||
:updated => "2006-09-07"
|
|
||||||
}
|
|
||||||
|
|
||||||
class ActiveRecord
|
|
||||||
# ErrorMessages to override default messages in
|
|
||||||
# +ActiveRecord::Errors::@@default_error_messages+
|
|
||||||
# This plugin also replaces hardcoded 3 text messages
|
|
||||||
# :error_translation is inflected using the Rails
|
|
||||||
# inflector.
|
|
||||||
#
|
|
||||||
# Remember to modify the Inflector with your localized translation
|
|
||||||
# of "error" and "errors" in the bottom of this file
|
|
||||||
#
|
|
||||||
ErrorMessages = {
|
|
||||||
:inclusion => "n'est pas inclut dans la liste",
|
|
||||||
:exclusion => "est réservé",
|
|
||||||
:invalid => "est invalide",
|
|
||||||
:confirmation => "ne correspond pas à la confirmation",
|
|
||||||
:accepted => "doit être accepté",
|
|
||||||
:empty => "ne peut pas être vide",
|
|
||||||
:blank => "ne peut pas être vierge",# alternate, formulation: "is required"
|
|
||||||
:too_long => "est trop long (%d caractères maximum)",
|
|
||||||
:too_short => "est trop court(%d caractères minimum)",
|
|
||||||
:wrong_length => "n'est pas de la bonne longueur (devrait être de %d caractères)",
|
|
||||||
:taken => "est déjà prit",
|
|
||||||
:not_a_number => "n'est pas le nombre",
|
|
||||||
#Jespers additions:
|
|
||||||
:error_translation => "erreur",
|
|
||||||
:error_header => "%s interdit ce %s d'être sauvegardé",
|
|
||||||
:error_subheader => "Il y a des problèmes avec les champs suivants :"
|
|
||||||
}
|
|
||||||
end
|
|
||||||
|
|
||||||
# Texts to override +distance_of_time_in_words()+
|
|
||||||
class DateHelper
|
|
||||||
Texts = {
|
|
||||||
:less_than_x_seconds => "moins de %d secondes",
|
|
||||||
:half_a_minute => "une demi-minute",
|
|
||||||
:less_than_a_minute => "moins d'une minute",
|
|
||||||
:one_minute => "1 minute",
|
|
||||||
:x_minutes => "%d minutes",
|
|
||||||
:one_hour => "à peut près 1 heure",
|
|
||||||
:x_hours => "à peu près %d heures",
|
|
||||||
:one_day => "1 jour",
|
|
||||||
:x_days => "%d jours",
|
|
||||||
:one_month => "1 mois",
|
|
||||||
:x_months => "%d mois",
|
|
||||||
:one_year => "1 an",
|
|
||||||
:x_years => "%d ans"
|
|
||||||
}
|
|
||||||
|
|
||||||
# Rails uses Month names in Date and time select boxes
|
|
||||||
# (+date_select+ and +datetime_select+ )
|
|
||||||
# Currently (as of version 1.1.6), Rails doesn't use daynames
|
|
||||||
Monthnames = [nil] + %w{Janvier Février Mars Avril Mai Juin Juillet Août Septembre Octobre Novembre Decembre}
|
|
||||||
AbbrMonthnames = [nil] + %w{Jan Fev Mar Avr Mai Jui Jul Aoû Sep Oct Nov Dec}
|
|
||||||
Daynames = %w{Dimanche Lundi Mardi Mercredi Jeudi Vendredi Samedi}
|
|
||||||
AbbrDaynames = %w{Dim Lun Mar Mer Jeu Ven Sam}
|
|
||||||
|
|
||||||
# Date and time format syntax explained in http://www.rubycentral.com/ref/ref_c_time.html#strftime
|
|
||||||
# These are sent to strftime that Ruby's date and time handlers use internally
|
|
||||||
# Same options as php (that has a better list: http://www.php.net/strftime )
|
|
||||||
DateFormats = {
|
|
||||||
:default => "%Y-%m-%d",
|
|
||||||
:short => "%b %e",
|
|
||||||
:long => "%B %e, %Y"
|
|
||||||
}
|
|
||||||
|
|
||||||
TimeFormats = {
|
|
||||||
:default => "%a, %d %b %Y %H:%M:%S %z",
|
|
||||||
:short => "%d %b %H:%M",
|
|
||||||
:long => "%B %d, %Y %H:%M"
|
|
||||||
}
|
|
||||||
# Set the order of +date_select+ and +datetime_select+ boxes
|
|
||||||
# Note that at present, the current Rails version only supports ordering of date_select boxes
|
|
||||||
DateSelectOrder = {
|
|
||||||
:order => [:year, :month, :day] #default Rails is US ordered: :order => [:year, :month, :day]
|
|
||||||
}
|
|
||||||
end
|
|
||||||
|
|
||||||
class NumberHelper
|
|
||||||
# CurrencyOptions are used as default for +Number#to_currency()+
|
|
||||||
# http://api.rubyonrails.org/classes/ActionView/Helpers/NumberHelper.html#M000449
|
|
||||||
CurrencyOptions = {
|
|
||||||
:unit => "€",
|
|
||||||
:separator => ".", #unit separator (between integer part and fraction part)
|
|
||||||
:delimiter => ",", #delimiter between each group of thousands. Example: 1.234.567
|
|
||||||
:order => [:unit, :number] #order is at present unsupported in Rails
|
|
||||||
}
|
|
||||||
end
|
|
||||||
|
|
||||||
class ArrayHelper
|
|
||||||
# Modifies +Array#to_sentence()+
|
|
||||||
# http://api.rubyonrails.org/classes/ActiveSupport/CoreExtensions/Array/Conversions.html#M000274
|
|
||||||
ToSentenceTexts = {
|
|
||||||
:connector => 'et',
|
|
||||||
:skip_last_comma => false
|
|
||||||
}
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
|
|
||||||
# Use the inflector below to pluralize "error" from
|
|
||||||
# @@default_error_messages[:error_translation] above (if necessary)
|
|
||||||
# Inflector.inflections do |inflect|
|
|
||||||
# inflect.plural /^(ox)$/i, '\1en'
|
|
||||||
# inflect.singular /^(ox)en/i, '\1'
|
|
||||||
# inflect.irregular 'person people'
|
|
||||||
# inflect.uncountable %w( information )
|
|
||||||
# end
|
|
120
vendor/plugins/l10n-simplified-0.8/lib/lang_it.rb
vendored
120
vendor/plugins/l10n-simplified-0.8/lib/lang_it.rb
vendored
|
@ -1,120 +0,0 @@
|
||||||
# lang_it.rb
|
|
||||||
# Traduzione italiana.
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
module LocalizationSimplified
|
|
||||||
About = {
|
|
||||||
:lang => "it",
|
|
||||||
:updated => "2006-09-16"
|
|
||||||
}
|
|
||||||
|
|
||||||
class ActiveRecord
|
|
||||||
# ErrorMessages to override default messages in
|
|
||||||
# +ActiveRecord::Errors::@@default_error_messages+
|
|
||||||
# This plugin also replaces hardcoded 3 text messages
|
|
||||||
# :error_translation is inflected using the Rails
|
|
||||||
# inflector.
|
|
||||||
#
|
|
||||||
# Remember to modify the Inflector with your localized translation
|
|
||||||
# of "error" and "errors" in the bottom of this file
|
|
||||||
#
|
|
||||||
ErrorMessages = {
|
|
||||||
:inclusion => "non è incluso nella lista",
|
|
||||||
:exclusion => "è riservato",
|
|
||||||
:invalid => "non è valido",
|
|
||||||
:confirmation => "doesn't match confirmation",
|
|
||||||
:accepted => "deve essere accettato",
|
|
||||||
:empty => "non può essere vuoto",
|
|
||||||
:blank => "è richiesto",# alternate, formulation: "is required"
|
|
||||||
:too_long => "è troppo lungo (massimo %d caratteri)",
|
|
||||||
:too_short => "è troppo corto (minimo %d caratteri)",
|
|
||||||
:wrong_length => "è della lunghezza sbagliata (dovrebbe essere di %d caratteri)",
|
|
||||||
:taken => "è già stato assegnato",
|
|
||||||
:not_a_number => "non è un numero",
|
|
||||||
#Jespers additions:
|
|
||||||
:error_translation => "errore",
|
|
||||||
:error_header => "%s impedisce a %s di essere salvato",
|
|
||||||
:error_subheader => "Ci sono dei problemi con i seguenti campi:"
|
|
||||||
}
|
|
||||||
end
|
|
||||||
|
|
||||||
# Texts to override +distance_of_time_in_words()+
|
|
||||||
class DateHelper
|
|
||||||
Texts = {
|
|
||||||
:less_than_x_seconds => "meno di %d secondi",
|
|
||||||
:half_a_minute => "mezzo minuto",
|
|
||||||
:less_than_a_minute => "meno di un minuto",
|
|
||||||
:one_minute => "un minuto",
|
|
||||||
:x_minutes => "%d minuti",
|
|
||||||
:one_hour => "circa un'ora",
|
|
||||||
:x_hours => "circa %d ore",
|
|
||||||
:one_day => "un giorno",
|
|
||||||
:x_days => "%d giorni",
|
|
||||||
:one_month => "un mese",
|
|
||||||
:x_months => "%d mesi",
|
|
||||||
:one_year => "un anno",
|
|
||||||
:x_years => "%d anni"
|
|
||||||
}
|
|
||||||
|
|
||||||
# Rails uses Month names in Date and time select boxes
|
|
||||||
# (+date_select+ and +datetime_select+ )
|
|
||||||
# Currently (as of version 1.1.6), Rails doesn't use daynames
|
|
||||||
Monthnames = [nil] + %w( Gennaio Febbraio Marzo Aprile Maggio Giugno Luglio
|
|
||||||
Agosto Settembre Ottobre Novembre Dicembre )
|
|
||||||
Daynames = %w( Domenica Lunedì Martedì Marcoledì Giovedì Venerdì Sabato )
|
|
||||||
AbbrMonthnames = [nil] + %w( Gen Feb Mar Apr Mag Giu
|
|
||||||
Lug Ago Set Ott Nov Dic )
|
|
||||||
AbbrDaynames = %w( Dom Lun Mar Mer Gio Ven Sab )
|
|
||||||
|
|
||||||
# Date and time format syntax explained in http://www.rubycentral.com/ref/ref_c_time.html#strftime
|
|
||||||
# These are sent to strftime that Ruby's date and time handlers use internally
|
|
||||||
# Same options as php (that has a better list: http://www.php.net/strftime )
|
|
||||||
DateFormats = {
|
|
||||||
:default => "%d-%m-%Y",
|
|
||||||
:short => "%e %b",
|
|
||||||
:long => "%e %B, %Y"
|
|
||||||
}
|
|
||||||
|
|
||||||
TimeFormats = {
|
|
||||||
:default => "%a, %d %b %Y %H:%M:%S %z",
|
|
||||||
:short => "%d %b %H:%M",
|
|
||||||
:long => "%d %B, %Y %H:%M"
|
|
||||||
}
|
|
||||||
# Set the order of +date_select+ and +datetime_select+ boxes
|
|
||||||
# Note that at present, the current Rails version only supports ordering of date_select boxes
|
|
||||||
DateSelectOrder = {
|
|
||||||
:order => [:day, :month, :year] #default Rails is US ordered: :order => [:year, :month, :day]
|
|
||||||
}
|
|
||||||
end
|
|
||||||
|
|
||||||
class NumberHelper
|
|
||||||
# CurrencyOptions are used as default for +Number#to_currency()+
|
|
||||||
# http://api.rubyonrails.org/classes/ActionView/Helpers/NumberHelper.html#M000449
|
|
||||||
CurrencyOptions = {
|
|
||||||
:unit => "¤",
|
|
||||||
:separator => ",", #unit separator (between integer part and fraction part)
|
|
||||||
:delimiter => ".", #delimiter between each group of thousands. Example: 1.234.567
|
|
||||||
:order => [:unit, :number] #order is at present unsupported in Rails
|
|
||||||
#to support for instance Danish format, the order is different: Unit comes last (ex. "1.234,00 dkr.")
|
|
||||||
}
|
|
||||||
end
|
|
||||||
|
|
||||||
class ArrayHelper
|
|
||||||
# Modifies +Array#to_sentence()+
|
|
||||||
# http://api.rubyonrails.org/classes/ActiveSupport/CoreExtensions/Array/Conversions.html#M000274
|
|
||||||
ToSentenceTexts = {
|
|
||||||
:connector => 'e',
|
|
||||||
:skip_last_comma => false
|
|
||||||
}
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
# Use the inflector below to pluralize "error" from
|
|
||||||
# @@default_error_messages[:error_translation] above (if necessary)
|
|
||||||
# Inflector.inflections do |inflect|
|
|
||||||
# inflect.plural /^(ox)$/i, '\1en'
|
|
||||||
# inflect.singular /^(ox)en/i, '\1'
|
|
||||||
# inflect.irregular 'person people'
|
|
||||||
# inflect.uncountable %w( information )
|
|
||||||
# end
|
|
119
vendor/plugins/l10n-simplified-0.8/lib/lang_ko.rb
vendored
119
vendor/plugins/l10n-simplified-0.8/lib/lang_ko.rb
vendored
|
@ -1,119 +0,0 @@
|
||||||
# lang_ko.rb
|
|
||||||
# Translation by Jeong Mok, Cho ( http://niceview.egloos.com )
|
|
||||||
|
|
||||||
|
|
||||||
module LocalizationSimplified
|
|
||||||
About = {
|
|
||||||
:lang => "ko",
|
|
||||||
:updated => "2006-09-29"
|
|
||||||
}
|
|
||||||
|
|
||||||
class ActiveRecord
|
|
||||||
# ErrorMessages to override default messages in
|
|
||||||
# +ActiveRecord::Errors::@@default_error_messages+
|
|
||||||
# This plugin also replaces hardcoded 3 text messages
|
|
||||||
# :error_translation is inflected using the Rails
|
|
||||||
# inflector.
|
|
||||||
#
|
|
||||||
# Remember to modify the Inflector with your localized translation
|
|
||||||
# of "error" and "errors" in the bottom of this file
|
|
||||||
#
|
|
||||||
ErrorMessages = {
|
|
||||||
:inclusion => "값은 목록에 없습니다.",
|
|
||||||
:exclusion => "값은 이미 사용중입니다.",
|
|
||||||
:invalid => "값이 잘못되었습니다.",
|
|
||||||
:confirmation => "가 일치하지 않습니다.",
|
|
||||||
:accepted => "항목이 채크되어야 합니다.",
|
|
||||||
:empty => "값은 꼭 입력하셔야 합니다.",
|
|
||||||
:blank => "값은 꼭 입력하셔야 합니다.",# alternate, formulation: "is required"
|
|
||||||
:too_long => "값이 너무 깁니다. (최대 %d자 이내)",
|
|
||||||
:too_short => "값이 너무 짧습니다. (최소 %d자 이상)",
|
|
||||||
:wrong_length => "값은 길이가 잘못되었습니다. (%d자로 입력하세요)",
|
|
||||||
:taken => "값은 이미 사용중입니다.",
|
|
||||||
:not_a_number => "값은 숫자가 아닙니다.",
|
|
||||||
#Jespers additions:
|
|
||||||
:error_translation => "개의 애러",
|
|
||||||
:error_header => "%s가 발생하였습니다. 이 %s는(은) 저장되지 않았습니다.",
|
|
||||||
:error_subheader => "다음의 항목에 대한 입력값들이 잘못되었습니다."
|
|
||||||
}
|
|
||||||
end
|
|
||||||
|
|
||||||
# Texts to override +distance_of_time_in_words()+
|
|
||||||
class DateHelper
|
|
||||||
Texts = {
|
|
||||||
:less_than_x_seconds => "%d초 이내",
|
|
||||||
:half_a_minute => "30초",
|
|
||||||
:less_than_a_minute => "1분 이내",
|
|
||||||
:one_minute => "1분",
|
|
||||||
:x_minutes => "%d분",
|
|
||||||
:one_hour => "약 1시간",
|
|
||||||
:x_hours => "약 %d시간",
|
|
||||||
:one_day => "1일",
|
|
||||||
:x_days => "%d일",
|
|
||||||
:one_month => "1개월",
|
|
||||||
:x_months => "%d개월",
|
|
||||||
:one_year => "1년",
|
|
||||||
:x_years => "%d년"
|
|
||||||
}
|
|
||||||
|
|
||||||
# Rails uses Month names in Date and time select boxes
|
|
||||||
# (+date_select+ and +datetime_select+ )
|
|
||||||
# Currently (as of version 1.1.6), Rails doesn't use daynames
|
|
||||||
Monthnames = [nil] + %w{1월 2월 3월 4월 5월 6월 7월 8월 9월 10월 11월 12월}
|
|
||||||
AbbrMonthnames = [nil] + %w{1 2 3 4 5 6 7 8 9 10 11 12}
|
|
||||||
Daynames = %w{일요일 월요일 화요일 수요일 목요일 금요일 토요일}
|
|
||||||
AbbrDaynames = %w{일 월 화 수 목 금 토}
|
|
||||||
|
|
||||||
# Date and time format syntax explained in http://www.rubycentral.com/ref/ref_c_time.html#strftime
|
|
||||||
# These are sent to strftime that Ruby's date and time handlers use internally
|
|
||||||
# Same options as php (that has a better list: http://www.php.net/strftime )
|
|
||||||
DateFormats = {
|
|
||||||
:default => "%Y/%m/%d",
|
|
||||||
:short => "%m/%d",
|
|
||||||
:long => "%Y년 %b월 %e일 %A"
|
|
||||||
}
|
|
||||||
|
|
||||||
TimeFormats = {
|
|
||||||
#:default => "%a, %d %b %Y %H:%M:%S %z",
|
|
||||||
:default => "%Y/%m/%d (%a) %p %H:%M:%S",
|
|
||||||
:short => "%H:%M",
|
|
||||||
:long => "%Y년 %b월 %e일 %A %p %I시 %M분 %S초"
|
|
||||||
}
|
|
||||||
# Set the order of +date_select+ and +datetime_select+ boxes
|
|
||||||
# Note that at present, the current Rails version only supports ordering of date_select boxes
|
|
||||||
DateSelectOrder = {
|
|
||||||
:order => [:year, :month, :day] #default Rails is US ordered: :order => [:year, :month, :day]
|
|
||||||
}
|
|
||||||
end
|
|
||||||
|
|
||||||
class NumberHelper
|
|
||||||
# CurrencyOptions are used as default for +Number#to_currency()+
|
|
||||||
# http://api.rubyonrails.org/classes/ActionView/Helpers/NumberHelper.html#M000449
|
|
||||||
CurrencyOptions = {
|
|
||||||
:unit => "₩",
|
|
||||||
:separator => ".", #unit separator (between integer part and fraction part)
|
|
||||||
:delimiter => ",", #delimiter between each group of thousands. Example: 1.234.567
|
|
||||||
:order => [:unit, :number] #order is at present unsupported in Rails
|
|
||||||
}
|
|
||||||
end
|
|
||||||
|
|
||||||
class ArrayHelper
|
|
||||||
# Modifies +Array#to_sentence()+
|
|
||||||
# http://api.rubyonrails.org/classes/ActiveSupport/CoreExtensions/Array/Conversions.html#M000274
|
|
||||||
ToSentenceTexts = {
|
|
||||||
:connector => '그리고',
|
|
||||||
:skip_last_comma => true
|
|
||||||
}
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
|
|
||||||
# Use the inflector below to pluralize "error" from
|
|
||||||
# @@default_error_messages[:error_translation] above (if necessary)
|
|
||||||
Inflector.inflections do |inflect|
|
|
||||||
# inflect.plural /^(ox)$/i, '\1en'
|
|
||||||
# inflect.singular /^(ox)en/i, '\1'
|
|
||||||
# inflect.irregular 'person people'
|
|
||||||
inflect.uncountable '개의 애러'
|
|
||||||
end
|
|
||||||
|
|
115
vendor/plugins/l10n-simplified-0.8/lib/lang_nl.rb
vendored
115
vendor/plugins/l10n-simplified-0.8/lib/lang_nl.rb
vendored
|
@ -1,115 +0,0 @@
|
||||||
# lang_nl.rb
|
|
||||||
# Dutch translation by Jeroen Houben
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
module LocalizationSimplified
|
|
||||||
About = {
|
|
||||||
:lang => "nl",
|
|
||||||
:updated => "2006-08-23"
|
|
||||||
}
|
|
||||||
|
|
||||||
class ActiveRecord
|
|
||||||
# ErrorMessages to override default messages in
|
|
||||||
# +ActiveRecord::Errors::@@default_error_messages+
|
|
||||||
# This plugin also replaces hardcoded 3 text messages
|
|
||||||
# :error_translation is inflected using the Rails
|
|
||||||
# inflector.
|
|
||||||
#
|
|
||||||
# Remember to modify the Inflector with your localized translation
|
|
||||||
# of "error" and "errors" in the bottom of this file
|
|
||||||
#
|
|
||||||
ErrorMessages = {
|
|
||||||
:inclusion => "zit niet in de lijst",
|
|
||||||
:exclusion => "is gereserveerd",
|
|
||||||
:invalid => "is ongeldig",
|
|
||||||
:confirmation => "is niet hetzelfde als de verificatie",
|
|
||||||
:accepted => "moet worden geaccepteerd",
|
|
||||||
:empty => "mag niet leeg zijn",
|
|
||||||
:blank => "mag niet blanko zijn",# alternate, formulation: "is required"
|
|
||||||
:too_long => "is te lang (maximum is %d karakters)",
|
|
||||||
:too_short => "is te kort (minimum is %d karakters)",
|
|
||||||
:wrong_length => "is de verkeerde lengte (dient %d karakters te zijn)",
|
|
||||||
:taken => "is reeds in gebruik",
|
|
||||||
:not_a_number => "is geen nummer",
|
|
||||||
#Jespers additions:
|
|
||||||
:error_translation => "fout",
|
|
||||||
:error_header => "%s zorgen ervoor dat %s niet kan worden opgeslagen",
|
|
||||||
:error_subheader => "Er zijn problemen met de volgende velden:"
|
|
||||||
}
|
|
||||||
end
|
|
||||||
|
|
||||||
# Texts to override +distance_of_time_in_words()+
|
|
||||||
class DateHelper
|
|
||||||
Texts = {
|
|
||||||
:less_than_x_seconds => "minder dan %d seconden",
|
|
||||||
:half_a_minute => "een halve minuut",
|
|
||||||
:less_than_a_minute => "minder dan een halve minuut",
|
|
||||||
:one_minute => "1 minuut",
|
|
||||||
:x_minutes => "%d minuten",
|
|
||||||
:one_hour => "ongeveer 1 uur",
|
|
||||||
:x_hours => "ongeveer %d uur",
|
|
||||||
:one_day => "1 dag",
|
|
||||||
:x_days => "%d dagen",
|
|
||||||
:one_month => "1 maand",
|
|
||||||
:x_months => "%d maanden",
|
|
||||||
:one_year => "1 jaar",
|
|
||||||
:x_years => "%d jaar"
|
|
||||||
}
|
|
||||||
# Rails uses Month names in Date and time select boxes
|
|
||||||
# (+date_select+ and +datetime_select+ )
|
|
||||||
# Currently (as of version 1.1.6), Rails doesn't use daynames
|
|
||||||
Monthnames = [nil] + %w{Januari Februari Maart April Mei Juni Juli Augustus September Oktober November December}
|
|
||||||
AbbrMonthnames = [nil] + %w{Jan Feb Mar Apr Mei Jun Jul Aug Sep Okt Nov Dec}
|
|
||||||
Daynames = %w{Zondag Maandag Dinsdag Woensdag Donderdag Vrijdag Zaterdag}
|
|
||||||
AbbrDaynames = %w{Zo Ma Di Wo Do Vr Za}
|
|
||||||
|
|
||||||
# Date and time format syntax explained in http://www.rubycentral.com/ref/ref_c_time.html#strftime
|
|
||||||
# These are sent to strftime that Ruby's date and time handlers use internally
|
|
||||||
# Same options as php (that has a better list: http://www.php.net/strftime )
|
|
||||||
DateFormats = {
|
|
||||||
:default => "%d-%m-%Y",
|
|
||||||
:short => "%d %b",
|
|
||||||
:long => "%d %B %Y"
|
|
||||||
}
|
|
||||||
|
|
||||||
TimeFormats = {
|
|
||||||
:default => "%a, %d %b %Y %H:%M:%S %z",
|
|
||||||
:short => "%d %b %H:%M",
|
|
||||||
:long => "%d %B %Y %H:%M"
|
|
||||||
}
|
|
||||||
# Set the order of +date_select+ and +datetime_select+ boxes
|
|
||||||
# Note that at present, the current Rails version only supports ordering of date_select boxes
|
|
||||||
DateSelectOrder = {
|
|
||||||
:order => [:day, :month, :year] #default Rails is US ordered: :order => [:year, :month, :day]
|
|
||||||
}
|
|
||||||
end
|
|
||||||
|
|
||||||
class NumberHelper
|
|
||||||
# CurrencyOptions are used as default for +Number#to_currency()+
|
|
||||||
# http://api.rubyonrails.org/classes/ActionView/Helpers/NumberHelper.html#M000449
|
|
||||||
CurrencyOptions = {
|
|
||||||
:unit => "€",
|
|
||||||
:separator => ".", #unit separator (between integer part and fraction part)
|
|
||||||
:delimiter => ",", #delimiter between each group of thousands. Example: 1.234.567
|
|
||||||
:order => [:unit, :number] #order is at present unsupported in Rails
|
|
||||||
#to support for instance Danish format, the order is different: Unit comes last (ex. "1.234,00 dkr.")
|
|
||||||
}
|
|
||||||
end
|
|
||||||
|
|
||||||
class ArrayHelper
|
|
||||||
# Modifies +Array#to_sentence()+
|
|
||||||
# http://api.rubyonrails.org/classes/ActiveSupport/CoreExtensions/Array/Conversions.html#M000274
|
|
||||||
ToSentenceTexts = {
|
|
||||||
:connector => 'en',
|
|
||||||
:skip_last_comma => false
|
|
||||||
}
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
|
|
||||||
# Use the inflector below to pluralize "error" from
|
|
||||||
# @@default_error_messages[:error_translation] above (if necessary)
|
|
||||||
Inflector.inflections do |inflect|
|
|
||||||
inflect.irregular 'fout', 'fouten'
|
|
||||||
end
|
|
|
@ -1,119 +0,0 @@
|
||||||
# lang_pirate.rb
|
|
||||||
# Pirate baseline translation file.
|
|
||||||
# Translated by Tobias Michaelsen , additions by Jesper Rønn-Jensen ( http://justaddwater.dk/ )
|
|
||||||
|
|
||||||
|
|
||||||
module LocalizationSimplified
|
|
||||||
About = {
|
|
||||||
:lang => "pirate",
|
|
||||||
:updated => "2006-09-07"
|
|
||||||
}
|
|
||||||
|
|
||||||
class ActiveRecord
|
|
||||||
# ErrorMessages to override default messages in
|
|
||||||
# +ActiveRecord::Errors::@@default_error_messages+
|
|
||||||
# This plugin also replaces hardcoded 3 text messages
|
|
||||||
# :error_translation is inflected using the Rails
|
|
||||||
# inflector.
|
|
||||||
#
|
|
||||||
# Remember to modify the Inflector with your localized translation
|
|
||||||
# of "error" and "errors" in the bottom of this file
|
|
||||||
#
|
|
||||||
ErrorMessages = {
|
|
||||||
:inclusion => "be not included in the list, me hearty",
|
|
||||||
:exclusion => "be reserrrrved",
|
|
||||||
:invalid => "be innvalid, m hearty",
|
|
||||||
:confirmation => "doesn't match confirmation",
|
|
||||||
:accepted => "must be accepted, arrrrh!",
|
|
||||||
:empty => "no nay ne'er be empty",
|
|
||||||
:blank => "no nay be blank, ye scurvy dog!",# alternate, formulation: "is required"
|
|
||||||
:too_long => "be too vastly in length (no more than %d characters or ye drivin' me nuts)",
|
|
||||||
:too_short => "be way too short (at least %d characters or ye drivin' me nuts)",
|
|
||||||
:wrong_length => "be the wrong length (should be %d characters)",
|
|
||||||
:taken => "has already been taken",
|
|
||||||
:not_a_number => "be not a number, matey",
|
|
||||||
#Jespers additions:
|
|
||||||
:error_translation => "errrorrr",
|
|
||||||
:error_header => "Ahoy me hearty! %s prohibited ye %s from bein' saved",
|
|
||||||
:error_subheader => "Turn the steering wheeel and corrrect these fields, arrrrh."
|
|
||||||
}
|
|
||||||
end
|
|
||||||
|
|
||||||
# Texts to override +distance_of_time_in_words()+
|
|
||||||
class DateHelper
|
|
||||||
Texts = {
|
|
||||||
:less_than_x_seconds => "less than %d seconds",
|
|
||||||
:half_a_minute => "half arrr minute",
|
|
||||||
:less_than_a_minute => "less than arrr minute",
|
|
||||||
:one_minute => "1 minute ye landlubber",
|
|
||||||
:x_minutes => "%d minutes accounted ferrrr",
|
|
||||||
:one_hour => "about one hourrr and a bottle of rum",
|
|
||||||
:x_hours => "about %d hourrrs and a bottle of rum",
|
|
||||||
:one_day => "1 day and a dead mans chest arrr",
|
|
||||||
:x_days => "%d days and a ship full of hornpipes",
|
|
||||||
:one_month => "1 full moon",
|
|
||||||
:x_months => "%d full moons",
|
|
||||||
:one_year => "1 yearrrr",
|
|
||||||
:x_years => "%d yearrrrrs"
|
|
||||||
}
|
|
||||||
|
|
||||||
# Rails uses Month names in Date and time select boxes
|
|
||||||
# (+date_select+ and +datetime_select+ )
|
|
||||||
# Currently (as of version 1.1.6), Rails doesn't use daynames
|
|
||||||
Monthnames = [nil] + %w{January February March April May June July August September October November December}
|
|
||||||
AbbrMonthnames = [nil] + %w{Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec}
|
|
||||||
Daynames = %w{Sunday Monday Tuesday Wednesday Thurrrrrrsday Frrriday Saturrrrday}
|
|
||||||
AbbrDaynames = %w{Sun Mon Tue Wed Thurrrr Frri Sat}
|
|
||||||
|
|
||||||
# Date and time format syntax explained in http://www.rubycentral.com/ref/ref_c_time.html#strftime
|
|
||||||
# These are sent to strftime that Ruby's date and time handlers use internally
|
|
||||||
# Same options as php (that has a better list: http://www.php.net/strftime )
|
|
||||||
DateFormats = {
|
|
||||||
:default => "%Y-%m-%d",
|
|
||||||
:short => "%b %e",
|
|
||||||
:long => "%B %e, %Y"
|
|
||||||
}
|
|
||||||
|
|
||||||
TimeFormats = {
|
|
||||||
:default => "%A, %d %b %Y %H:%M:%S",
|
|
||||||
:short => "%d %b %H:%M",
|
|
||||||
:long => "%B %d, %Y %H:%M"
|
|
||||||
}
|
|
||||||
# Set the order of +date_select+ and +datetime_select+ boxes
|
|
||||||
# Note that at present, the current Rails version only supports ordering of date_select boxes
|
|
||||||
DateSelectOrder = {
|
|
||||||
:order => [:year, :month, :day] #default Rails is US ordered: :order => [:year, :month, :day]
|
|
||||||
}
|
|
||||||
end
|
|
||||||
|
|
||||||
class NumberHelper
|
|
||||||
# CurrencyOptions are used as default for +Number#to_currency()+
|
|
||||||
# http://api.rubyonrails.org/classes/ActionView/Helpers/NumberHelper.html#M000449
|
|
||||||
CurrencyOptions = {
|
|
||||||
:unit => "pieces o' silver",
|
|
||||||
:separator => ".", #unit separator (between integer part and fraction part)
|
|
||||||
:delimiter => ",", #delimiter between each group of thousands. Example: 1.234.567
|
|
||||||
:order => [:number, :unit] #order is at present unsupported in Rails
|
|
||||||
#to support for instance Danish format, the order is different: Unit comes last (ex. "1.234,00 dkr.")
|
|
||||||
}
|
|
||||||
end
|
|
||||||
|
|
||||||
class ArrayHelper
|
|
||||||
# Modifies +Array#to_sentence()+
|
|
||||||
# http://api.rubyonrails.org/classes/ActiveSupport/CoreExtensions/Array/Conversions.html#M000274
|
|
||||||
ToSentenceTexts = {
|
|
||||||
:connector => 'and',
|
|
||||||
:skip_last_comma => false
|
|
||||||
}
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
|
|
||||||
# Use the inflector below to pluralize "error" from
|
|
||||||
# @@default_error_messages[:error_translation] above (if necessary)
|
|
||||||
# Inflector.inflections do |inflect|
|
|
||||||
# inflect.plural /^(ox)$/i, '\1en'
|
|
||||||
# inflect.singular /^(ox)en/i, '\1'
|
|
||||||
# inflect.irregular 'person people'
|
|
||||||
# inflect.uncountable %w( information )
|
|
||||||
# end
|
|
116
vendor/plugins/l10n-simplified-0.8/lib/lang_se.rb
vendored
116
vendor/plugins/l10n-simplified-0.8/lib/lang_se.rb
vendored
|
@ -1,116 +0,0 @@
|
||||||
# lang_se.rb
|
|
||||||
# Swedish translation file.
|
|
||||||
# Translation from plugin swe_rails by Ola Bini ( http://ola-bini.blogspot.com/ ) and Olle Jonsson ( http://olleolleolle.dk )
|
|
||||||
|
|
||||||
|
|
||||||
module LocalizationSimplified
|
|
||||||
About = {
|
|
||||||
:lang => "se",
|
|
||||||
:updated => "2006-09-07"
|
|
||||||
}
|
|
||||||
|
|
||||||
class ActiveRecord
|
|
||||||
# ErrorMessages to override default messages in
|
|
||||||
# +ActiveRecord::Errors::@@default_error_messages+
|
|
||||||
# This plugin also replaces hardcoded 3 text messages
|
|
||||||
# :error_translation is inflected using the Rails
|
|
||||||
# inflector.
|
|
||||||
#
|
|
||||||
# Remember to modify the Inflector with your localized translation
|
|
||||||
# of "error" and "errors" in the bottom of this file
|
|
||||||
#
|
|
||||||
ErrorMessages = {
|
|
||||||
:inclusion => "finns inte i listan",
|
|
||||||
:exclusion => "Är reserverat",
|
|
||||||
:invalid => "Är ogiltigt",
|
|
||||||
:confirmation => "stämmer inte övererens",
|
|
||||||
:accepted => "måste vara accepterad",
|
|
||||||
:empty => "för ej vara tom",
|
|
||||||
:blank => "för ej vara blank",
|
|
||||||
:too_long => "Är för lång (maximum är %d tecken)",
|
|
||||||
:too_short => "Är för kort (minimum är %d tecken)",
|
|
||||||
:wrong_length => "har fel längd (ska vara %d tecken)",
|
|
||||||
:taken => "har redan tagits",
|
|
||||||
:not_a_number => "Är ej ett nummer",
|
|
||||||
#Jespers additions:
|
|
||||||
:error_translation => "fel",
|
|
||||||
:error_header => "%s förhindrade %s från at sparse",
|
|
||||||
:error_subheader => "Problemar met dissa felterne:"
|
|
||||||
}
|
|
||||||
end
|
|
||||||
|
|
||||||
# Texts to override +distance_of_time_in_words()+
|
|
||||||
class DateHelper
|
|
||||||
Texts = {
|
|
||||||
:less_than_x_seconds => "mindre än %d sekunder",
|
|
||||||
:half_a_minute => "en halv minut",
|
|
||||||
:less_than_a_minute => "mindre än en minut",
|
|
||||||
:one_minute => "1 minut",
|
|
||||||
:x_minutes => "%d minutter",
|
|
||||||
:one_hour => "ungefär 1 timma",
|
|
||||||
:x_hours => "ungefär %d timmar",
|
|
||||||
:one_day => "1 dygn",
|
|
||||||
:x_days => "%d dygn",
|
|
||||||
:one_month => "1 month",
|
|
||||||
:x_months => "%d months",
|
|
||||||
:one_year => "1 year",
|
|
||||||
:x_years => "%d years"
|
|
||||||
}
|
|
||||||
# Rails uses Month names in Date and time select boxes
|
|
||||||
# (+date_select+ and +datetime_select+ )
|
|
||||||
# Currently (as of version 1.1.6), Rails doesn't use daynames
|
|
||||||
Monthnames = [nil] + %w{januari februari mars april maj juni juli augusti september oktober november december}
|
|
||||||
AbbrMonthnames = [nil] + %w{jan feb mar apr maj jun jul aug sep okt nov dec}
|
|
||||||
Daynames = %w{söndag måndag tisdag onsdag torsdag fredag lördag}
|
|
||||||
AbbrDaynames = %w{sön mån tis ons tors fre lör}
|
|
||||||
|
|
||||||
|
|
||||||
# Date and time format syntax explained in http://www.rubycentral.com/ref/ref_c_time.html#strftime
|
|
||||||
# These are sent to strftime that Ruby's date and time handlers use internally
|
|
||||||
# Same options as php (that has a better list: http://www.php.net/strftime )
|
|
||||||
DateFormats = {
|
|
||||||
:default => "%Y-%m-%d",
|
|
||||||
:short => "%b %e",
|
|
||||||
:long => "%B %e, %Y"
|
|
||||||
}
|
|
||||||
|
|
||||||
TimeFormats = {
|
|
||||||
:default => "%a, %d %b %Y %H:%M:%S %z",
|
|
||||||
:short => "%d %b %H:%M",
|
|
||||||
:long => "%B %d, %Y %H:%M"
|
|
||||||
}
|
|
||||||
# Set the order of +date_select+ and +datetime_select+ boxes
|
|
||||||
# Note that at present, the current Rails version only supports ordering of date_select boxes
|
|
||||||
DateSelectOrder = {
|
|
||||||
:order => [:day, :month, :year] #default Rails is US ordered: :order => [:year, :month, :day]
|
|
||||||
}
|
|
||||||
end
|
|
||||||
|
|
||||||
class NumberHelper
|
|
||||||
# CurrencyOptions are used as default for +Number#to_currency()+
|
|
||||||
# http://api.rubyonrails.org/classes/ActionView/Helpers/NumberHelper.html#M000449
|
|
||||||
CurrencyOptions = {
|
|
||||||
:unit => "kr.",
|
|
||||||
:separator => ",", #unit separator (between integer part and fraction part)
|
|
||||||
:delimiter => ".", #delimiter between each group of thousands. Example: 1.234.567
|
|
||||||
:order => [:number, :unit] #order is at present unsupported in Rails
|
|
||||||
#to support for instance Swedish format, the order is different: Unit comes last (ex. "1.234,00 kr.")
|
|
||||||
}
|
|
||||||
end
|
|
||||||
|
|
||||||
class ArrayHelper
|
|
||||||
# Modifies +Array#to_sentence()+
|
|
||||||
# http://api.rubyonrails.org/classes/ActiveSupport/CoreExtensions/Array/Conversions.html#M000274
|
|
||||||
ToSentenceTexts = {
|
|
||||||
:connector => 'och',
|
|
||||||
:skip_last_comma => true
|
|
||||||
}
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
|
|
||||||
# Use the inflector below to pluralize "error" from
|
|
||||||
# @@default_error_messages[:error_translation] above (if necessary)
|
|
||||||
Inflector.inflections do |inflect|
|
|
||||||
inflect.uncountable %w( fel )
|
|
||||||
end
|
|
|
@ -1,229 +0,0 @@
|
||||||
# LocalizationSimplified (L10n-simplified)
|
|
||||||
# Really simple localization for Rails
|
|
||||||
# By Jesper Rønn-Jensen ( http://justaddwater.dk/ )
|
|
||||||
# Plugin available at http://rubyforge.org/projects/l10n-simplified/
|
|
||||||
#
|
|
||||||
module LocalizationSimplified
|
|
||||||
@@ignore = "\xFF\xFF\xFF\xFF" # %% == Literal "%" character
|
|
||||||
# substitute all daynames and monthnames with localized names
|
|
||||||
# from RUtils plugin
|
|
||||||
def self.localize_strftime(date='%d.%m.%Y', time='')
|
|
||||||
date.gsub!(/%%/, @@ignore)
|
|
||||||
date.gsub!(/%a/, LocalizationSimplified::DateHelper::AbbrDaynames[time.wday])
|
|
||||||
date.gsub!(/%A/, LocalizationSimplified::DateHelper::Daynames[time.wday])
|
|
||||||
date.gsub!(/%b/, LocalizationSimplified::DateHelper::AbbrMonthnames[time.mon])
|
|
||||||
date.gsub!(/%B/, LocalizationSimplified::DateHelper::Monthnames[time.mon])
|
|
||||||
date.gsub!(@@ignore, '%%')
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
|
|
||||||
module ActiveRecord
|
|
||||||
class Errors
|
|
||||||
#Error messages modified in lang file
|
|
||||||
@@default_error_messages.update(LocalizationSimplified::ActiveRecord::ErrorMessages)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
module ActionView
|
|
||||||
module Helpers
|
|
||||||
|
|
||||||
#Modify ActiveRecord to use error message headers (text from lang-file)
|
|
||||||
module ActiveRecordHelper
|
|
||||||
alias_method :old_error_messages_for, :error_messages_for
|
|
||||||
|
|
||||||
def error_messages_for(*params)
|
|
||||||
options = params.last.is_a?(Hash) ? params.pop.symbolize_keys : {}
|
|
||||||
objects = params.collect {|object_name| instance_variable_get("@#{object_name}") }.compact
|
|
||||||
count = objects.inject(0) {|sum, object| sum + object.errors.count }
|
|
||||||
unless count.zero?
|
|
||||||
html = {}
|
|
||||||
[:id, :class].each do |key|
|
|
||||||
if options.include?(key)
|
|
||||||
value = options[key]
|
|
||||||
html[key] = value unless value.blank?
|
|
||||||
else
|
|
||||||
html[key] = 'errorExplanation'
|
|
||||||
end
|
|
||||||
end
|
|
||||||
messages = ActiveRecord:: Errors.default_error_messages
|
|
||||||
header_message = format( messages[:error_header],
|
|
||||||
pluralize(count, messages[:error_translation]),
|
|
||||||
(options[:object_name] ||
|
|
||||||
params.first).to_s.gsub("_", " "))
|
|
||||||
error_messages = objects.map {|object| object.errors.full_messages.map {|msg| content_tag(:li, msg) } }
|
|
||||||
content_tag(:div,
|
|
||||||
content_tag(options[:header_tag] || :h2, header_message) <<
|
|
||||||
content_tag(:p, messages[:error_subheader]) <<
|
|
||||||
content_tag(:ul, error_messages),
|
|
||||||
html
|
|
||||||
)
|
|
||||||
else
|
|
||||||
''
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
end
|
|
||||||
|
|
||||||
# Modify DateHelper to use text from lang-file
|
|
||||||
module DateHelper
|
|
||||||
#Modify DateHelper distance_of_time_in_words
|
|
||||||
alias_method :old_distance_of_time_in_words, :distance_of_time_in_words
|
|
||||||
def distance_of_time_in_words(from_time, to_time = 0, include_seconds = false)
|
|
||||||
from_time = from_time.to_time if from_time.respond_to?(:to_time)
|
|
||||||
to_time = to_time.to_time if to_time.respond_to?(:to_time)
|
|
||||||
distance_in_minutes = (((to_time - from_time).abs)/60).round
|
|
||||||
distance_in_seconds = ((to_time - from_time).abs).round
|
|
||||||
|
|
||||||
#First, I invent a variable (makes it easier for future localization)
|
|
||||||
messages = LocalizationSimplified::DateHelper::Texts #localized
|
|
||||||
case distance_in_minutes
|
|
||||||
when 0..1
|
|
||||||
return (distance_in_minutes==0) ? messages[:less_than_a_minute] : messages[:one_minute] unless include_seconds
|
|
||||||
case distance_in_seconds
|
|
||||||
when 0..5 then format( messages[:less_than_x_seconds], 5 )
|
|
||||||
when 6..10 then format( messages[:less_than_x_seconds], 10 )
|
|
||||||
when 11..20 then format( messages[:less_than_x_seconds], 20 )
|
|
||||||
when 21..40 then messages[:half_a_minute]
|
|
||||||
when 41..59 then messages[:less_than_a_minute]
|
|
||||||
else messages[:one_minute]
|
|
||||||
end
|
|
||||||
|
|
||||||
when 2..44 then format(messages[:x_minutes], distance_in_minutes)
|
|
||||||
when 45..89 then messages[:one_hour]
|
|
||||||
when 90..1439 then format( messages[:x_hours], (distance_in_minutes.to_f / 60.0).round )
|
|
||||||
when 1440..2879 then messages[:one_day]
|
|
||||||
when 2880..43199 then format( messages[:x_days], (distance_in_minutes / 1440).round )
|
|
||||||
when 43200..86399 then messages[:one_month]
|
|
||||||
when 86400..525959 then format( messages[:x_months], (distance_in_minutes / 43200).round )
|
|
||||||
when 525960..1051919 then messages[:one_year]
|
|
||||||
else format( messages[:x_years], (distance_in_minutes / 525960).round )
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
|
|
||||||
# Give default settings to number_to_currency()
|
|
||||||
module NumberHelper
|
|
||||||
alias_method :orig_number_to_currency, :number_to_currency
|
|
||||||
#modify number_to_currency to accept :order option
|
|
||||||
def number_to_currency(number, options = {})
|
|
||||||
# Blend default options with localized currency options
|
|
||||||
options.reverse_merge!(LocalizationSimplified::NumberHelper::CurrencyOptions)
|
|
||||||
options[:order] ||= [:unit, :number]
|
|
||||||
options = options.stringify_keys
|
|
||||||
precision, unit, separator, delimiter = options.delete("precision") { 2 }, options.delete("unit") { "$" }, options.delete("separator") { "." }, options.delete("delimiter") { "," }
|
|
||||||
separator = "" unless precision > 0
|
|
||||||
|
|
||||||
#add leading space before trailing unit
|
|
||||||
unit = " " + unit if options["order"] == [:number, :unit]
|
|
||||||
output = ''
|
|
||||||
begin
|
|
||||||
options["order"].each do |param|
|
|
||||||
case param
|
|
||||||
when :unit
|
|
||||||
output << unit
|
|
||||||
when :number
|
|
||||||
parts = number_with_precision(number, precision).split('.')
|
|
||||||
output << number_with_delimiter(parts[0], delimiter) + separator + parts[1].to_s
|
|
||||||
end
|
|
||||||
end
|
|
||||||
rescue
|
|
||||||
output = number
|
|
||||||
end
|
|
||||||
output
|
|
||||||
end
|
|
||||||
end# module NumberHelper
|
|
||||||
|
|
||||||
module DateHelper
|
|
||||||
alias_method :orig_date_select, :date_select
|
|
||||||
# Blend default options with localized :order option
|
|
||||||
def date_select(object_name, method, options = {})
|
|
||||||
options.reverse_merge!(LocalizationSimplified::DateHelper::DateSelectOrder)
|
|
||||||
orig_date_select(object_name, method, options)
|
|
||||||
end
|
|
||||||
|
|
||||||
alias_method :orig_datetime_select, :datetime_select
|
|
||||||
# Blend default options with localized :order option
|
|
||||||
def datetime_select(object_name, method, options = {})
|
|
||||||
options.reverse_merge!(LocalizationSimplified::DateHelper::DateSelectOrder)
|
|
||||||
orig_datetime_select(object_name, method, options)
|
|
||||||
end
|
|
||||||
end #module DateHelper
|
|
||||||
|
|
||||||
end #module Helpers
|
|
||||||
end #module ActionView
|
|
||||||
|
|
||||||
|
|
||||||
class Array
|
|
||||||
alias :orig_to_sentence :to_sentence
|
|
||||||
def to_sentence(options = {})
|
|
||||||
#Blend default options with sent through options
|
|
||||||
options.reverse_merge!(LocalizationSimplified::ArrayHelper::ToSentenceTexts)
|
|
||||||
orig_to_sentence(options)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
|
|
||||||
# Modification of ruby constants
|
|
||||||
class Date
|
|
||||||
#FIXME as these are defined as Ruby constants, they can not be overwritten
|
|
||||||
MONTHNAMES = LocalizationSimplified::DateHelper::Monthnames
|
|
||||||
ABBR_MONTHNAMES = LocalizationSimplified::DateHelper::AbbrMonthnames
|
|
||||||
#DAYNAMES = LocalizationSimplified::DateHelper::Daynames #not in use by Rails
|
|
||||||
#ABBR_DAYNAMES = LocalizationSimplified::DateHelper::AbbrDaynames #not in use by Rails
|
|
||||||
end
|
|
||||||
|
|
||||||
# Modification of default Time format using Time.to_formatted_s(:default)
|
|
||||||
# Localizes the hash with the formats :default, :short, :long
|
|
||||||
# Usage:
|
|
||||||
# <% t = Time.parse('2006-12-25 13:55') %>
|
|
||||||
# <%= t.to_formatted_s(:short) #=> outputs time in localized format %>
|
|
||||||
# <%= t #=> outputs time in localized format %>
|
|
||||||
class Time
|
|
||||||
alias_method :old_strftime, :strftime
|
|
||||||
# Pre-translate format of Time before the time string is translated by strftime.
|
|
||||||
# The <tt>:default</tt> time format is changed by localizing month and daynames.
|
|
||||||
# Also Rails ActiveSupport allow us to modify the <tt>:default</tt> timeformatting string.
|
|
||||||
# Originally, its <tt>:default => "%a, %d %b %Y %H:%M:%S %z"</tt> (RFC2822 names), but as it can be
|
|
||||||
# modified in this plugin, and we can end up with a different file format in logfiles, etc
|
|
||||||
def strftime(date)
|
|
||||||
LocalizationSimplified::localize_strftime(date, self)
|
|
||||||
old_strftime(date)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
# Modification of default Date format using Date.to_formatted_s(:default)
|
|
||||||
# Localizes the hash with the formats :default, :short, :long
|
|
||||||
# Usage:
|
|
||||||
# <% d = Date.parse('2006-12-25') %>
|
|
||||||
# <%= d.to_formatted_s(:short) #=> outputs date in localized format %>
|
|
||||||
#
|
|
||||||
# FIXME The Time conversion still does not modify week day and month (for some reason)
|
|
||||||
ActiveSupport::CoreExtensions::Date::Conversions::DATE_FORMATS.merge!(LocalizationSimplified::DateHelper::DateFormats)
|
|
||||||
|
|
||||||
# Modification of default Time format using Time.to_formatted_s(:default)
|
|
||||||
# Localizes the hash with the formats :default, :short, :long
|
|
||||||
# Usage:
|
|
||||||
# <% t = Time.parse('2006-12-25 13:55') %>
|
|
||||||
# <%= t.to_formatted_s(:short) #=> outputs time in localized format %>
|
|
||||||
# <%= t #=> outputs time in localized format %>
|
|
||||||
#
|
|
||||||
# FIXME The Time conversion still does not modify week day and month (for some reason)
|
|
||||||
ActiveSupport::CoreExtensions::Time::Conversions::DATE_FORMATS.merge!(LocalizationSimplified::DateHelper::TimeFormats)
|
|
||||||
|
|
||||||
|
|
||||||
# Modify Actioncontroller to always use UTF-8
|
|
||||||
# Currently this modifies MySQL. Please add other databases you find necessary
|
|
||||||
class ActionController::Base
|
|
||||||
before_filter :configure_charsets
|
|
||||||
|
|
||||||
def configure_charsets(charset='utf-8')
|
|
||||||
# Set connection charset. MySQL 4.0 doesn't support this so it
|
|
||||||
# will throw an error, MySQL 4.1+ needs this.
|
|
||||||
suppress(ActiveRecord::StatementInvalid) do
|
|
||||||
ActiveRecord::Base.connection.execute "SET NAMES 'UTF8'"
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
|
@ -1,107 +0,0 @@
|
||||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
|
||||||
<!DOCTYPE html
|
|
||||||
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
|
||||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
|
||||||
|
|
||||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
|
||||||
<head>
|
|
||||||
<title>Module: ActionController</title>
|
|
||||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
|
||||||
<meta http-equiv="Content-Script-Type" content="text/javascript" />
|
|
||||||
<link rel="stylesheet" href=".././rdoc-style.css" type="text/css" media="screen" />
|
|
||||||
<script type="text/javascript">
|
|
||||||
// <![CDATA[
|
|
||||||
|
|
||||||
function popupCode( url ) {
|
|
||||||
window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
|
|
||||||
}
|
|
||||||
|
|
||||||
function toggleCode( id ) {
|
|
||||||
if ( document.getElementById )
|
|
||||||
elem = document.getElementById( id );
|
|
||||||
else if ( document.all )
|
|
||||||
elem = eval( "document.all." + id );
|
|
||||||
else
|
|
||||||
return false;
|
|
||||||
|
|
||||||
elemStyle = elem.style;
|
|
||||||
|
|
||||||
if ( elemStyle.display != "block" ) {
|
|
||||||
elemStyle.display = "block"
|
|
||||||
} else {
|
|
||||||
elemStyle.display = "none"
|
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Make codeblocks hidden by default
|
|
||||||
document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
|
|
||||||
|
|
||||||
// ]]>
|
|
||||||
</script>
|
|
||||||
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<div id="classHeader">
|
|
||||||
<table class="header-table">
|
|
||||||
<tr class="top-aligned-row">
|
|
||||||
<td><strong>Module</strong></td>
|
|
||||||
<td class="class-name-in-header">ActionController</td>
|
|
||||||
</tr>
|
|
||||||
<tr class="top-aligned-row">
|
|
||||||
<td><strong>In:</strong></td>
|
|
||||||
<td>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
|
|
||||||
</table>
|
|
||||||
</div>
|
|
||||||
<!-- banner header -->
|
|
||||||
|
|
||||||
<div id="bodyContent">
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<div id="contextContent">
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
<!-- if includes -->
|
|
||||||
|
|
||||||
<div id="section">
|
|
||||||
|
|
||||||
<div id="class-list">
|
|
||||||
<h3 class="section-bar">Classes and Modules</h3>
|
|
||||||
|
|
||||||
Class <a href="ActionController/Base.html" class="link">ActionController::Base</a><br />
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<!-- if method_list -->
|
|
||||||
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
<div id="validator-badges">
|
|
||||||
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</body>
|
|
||||||
</html>
|
|
|
@ -1,161 +0,0 @@
|
||||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
|
||||||
<!DOCTYPE html
|
|
||||||
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
|
||||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
|
||||||
|
|
||||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
|
||||||
<head>
|
|
||||||
<title>Class: ActionController::Base</title>
|
|
||||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
|
||||||
<meta http-equiv="Content-Script-Type" content="text/javascript" />
|
|
||||||
<link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
|
|
||||||
<script type="text/javascript">
|
|
||||||
// <![CDATA[
|
|
||||||
|
|
||||||
function popupCode( url ) {
|
|
||||||
window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
|
|
||||||
}
|
|
||||||
|
|
||||||
function toggleCode( id ) {
|
|
||||||
if ( document.getElementById )
|
|
||||||
elem = document.getElementById( id );
|
|
||||||
else if ( document.all )
|
|
||||||
elem = eval( "document.all." + id );
|
|
||||||
else
|
|
||||||
return false;
|
|
||||||
|
|
||||||
elemStyle = elem.style;
|
|
||||||
|
|
||||||
if ( elemStyle.display != "block" ) {
|
|
||||||
elemStyle.display = "block"
|
|
||||||
} else {
|
|
||||||
elemStyle.display = "none"
|
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Make codeblocks hidden by default
|
|
||||||
document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
|
|
||||||
|
|
||||||
// ]]>
|
|
||||||
</script>
|
|
||||||
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<div id="classHeader">
|
|
||||||
<table class="header-table">
|
|
||||||
<tr class="top-aligned-row">
|
|
||||||
<td><strong>Class</strong></td>
|
|
||||||
<td class="class-name-in-header">ActionController::Base</td>
|
|
||||||
</tr>
|
|
||||||
<tr class="top-aligned-row">
|
|
||||||
<td><strong>In:</strong></td>
|
|
||||||
<td>
|
|
||||||
<a href="../../files/lib/localization_simplified_rb.html">
|
|
||||||
lib/localization_simplified.rb
|
|
||||||
</a>
|
|
||||||
<br />
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
|
|
||||||
<tr class="top-aligned-row">
|
|
||||||
<td><strong>Parent:</strong></td>
|
|
||||||
<td>
|
|
||||||
Object
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
</table>
|
|
||||||
</div>
|
|
||||||
<!-- banner header -->
|
|
||||||
|
|
||||||
<div id="bodyContent">
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<div id="contextContent">
|
|
||||||
|
|
||||||
<div id="description">
|
|
||||||
<p>
|
|
||||||
Modify Actioncontroller to always use UTF-8 Currently this modifies MySQL.
|
|
||||||
Please add other databases you find necessary
|
|
||||||
</p>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div id="method-list">
|
|
||||||
<h3 class="section-bar">Methods</h3>
|
|
||||||
|
|
||||||
<div class="name-list">
|
|
||||||
<a href="#M000003">configure_charsets</a>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
<!-- if includes -->
|
|
||||||
|
|
||||||
<div id="section">
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<!-- if method_list -->
|
|
||||||
<div id="methods">
|
|
||||||
<h3 class="section-bar">Public Instance methods</h3>
|
|
||||||
|
|
||||||
<div id="method-M000003" class="method-detail">
|
|
||||||
<a name="M000003"></a>
|
|
||||||
|
|
||||||
<div class="method-heading">
|
|
||||||
<a href="#M000003" class="method-signature">
|
|
||||||
<span class="method-name">configure_charsets</span><span class="method-args">(charset='utf-8')</span>
|
|
||||||
</a>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="method-description">
|
|
||||||
<p><a class="source-toggle" href="#"
|
|
||||||
onclick="toggleCode('M000003-source');return false;">[Source]</a></p>
|
|
||||||
<div class="method-source-code" id="M000003-source">
|
|
||||||
<pre>
|
|
||||||
<span class="ruby-comment cmt"># File lib/localization_simplified.rb, line 197</span>
|
|
||||||
197: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">configure_charsets</span>(<span class="ruby-identifier">charset</span>=<span class="ruby-value str">'utf-8'</span>)
|
|
||||||
198: <span class="ruby-identifier">$KCODE</span> = <span class="ruby-value str">'u'</span>
|
|
||||||
199: <span class="ruby-comment cmt"># Response header necessary with some lang-files (like lang_pirate.rb for some reason)</span>
|
|
||||||
200: <span class="ruby-ivar">@response</span>.<span class="ruby-identifier">headers</span>[<span class="ruby-value str">"Content-Type"</span>] = <span class="ruby-value str">"text/html; charset=utf-8"</span>
|
|
||||||
201:
|
|
||||||
202: <span class="ruby-comment cmt"># Set connection charset. MySQL 4.0 doesn't support this so it</span>
|
|
||||||
203: <span class="ruby-comment cmt"># will throw an error, MySQL 4.1 needs this</span>
|
|
||||||
204: <span class="ruby-identifier">suppress</span>(<span class="ruby-constant">ActiveRecord</span><span class="ruby-operator">::</span><span class="ruby-constant">StatementInvalid</span>) <span class="ruby-keyword kw">do</span>
|
|
||||||
205: <span class="ruby-constant">ActiveRecord</span><span class="ruby-operator">::</span><span class="ruby-constant">Base</span>.<span class="ruby-identifier">connection</span>.<span class="ruby-identifier">execute</span> <span class="ruby-value str">'SET NAMES UTF8'</span>
|
|
||||||
206: <span class="ruby-keyword kw">end</span>
|
|
||||||
207: <span class="ruby-keyword kw">end</span>
|
|
||||||
</pre>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
<div id="validator-badges">
|
|
||||||
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</body>
|
|
||||||
</html>
|
|
|
@ -1,117 +0,0 @@
|
||||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
|
||||||
<!DOCTYPE html
|
|
||||||
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
|
||||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
|
||||||
|
|
||||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
|
||||||
<head>
|
|
||||||
<title>Module: ActionView</title>
|
|
||||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
|
||||||
<meta http-equiv="Content-Script-Type" content="text/javascript" />
|
|
||||||
<link rel="stylesheet" href=".././rdoc-style.css" type="text/css" media="screen" />
|
|
||||||
<script type="text/javascript">
|
|
||||||
// <![CDATA[
|
|
||||||
|
|
||||||
function popupCode( url ) {
|
|
||||||
window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
|
|
||||||
}
|
|
||||||
|
|
||||||
function toggleCode( id ) {
|
|
||||||
if ( document.getElementById )
|
|
||||||
elem = document.getElementById( id );
|
|
||||||
else if ( document.all )
|
|
||||||
elem = eval( "document.all." + id );
|
|
||||||
else
|
|
||||||
return false;
|
|
||||||
|
|
||||||
elemStyle = elem.style;
|
|
||||||
|
|
||||||
if ( elemStyle.display != "block" ) {
|
|
||||||
elemStyle.display = "block"
|
|
||||||
} else {
|
|
||||||
elemStyle.display = "none"
|
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Make codeblocks hidden by default
|
|
||||||
document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
|
|
||||||
|
|
||||||
// ]]>
|
|
||||||
</script>
|
|
||||||
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<div id="classHeader">
|
|
||||||
<table class="header-table">
|
|
||||||
<tr class="top-aligned-row">
|
|
||||||
<td><strong>Module</strong></td>
|
|
||||||
<td class="class-name-in-header">ActionView</td>
|
|
||||||
</tr>
|
|
||||||
<tr class="top-aligned-row">
|
|
||||||
<td><strong>In:</strong></td>
|
|
||||||
<td>
|
|
||||||
<a href="../files/lib/localization_simplified_rb.html">
|
|
||||||
lib/localization_simplified.rb
|
|
||||||
</a>
|
|
||||||
<br />
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
|
|
||||||
</table>
|
|
||||||
</div>
|
|
||||||
<!-- banner header -->
|
|
||||||
|
|
||||||
<div id="bodyContent">
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<div id="contextContent">
|
|
||||||
|
|
||||||
<div id="description">
|
|
||||||
<p>
|
|
||||||
Give default settings to number_to_currency()
|
|
||||||
</p>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
<!-- if includes -->
|
|
||||||
|
|
||||||
<div id="section">
|
|
||||||
|
|
||||||
<div id="class-list">
|
|
||||||
<h3 class="section-bar">Classes and Modules</h3>
|
|
||||||
|
|
||||||
Module <a href="ActionView/Helpers.html" class="link">ActionView::Helpers</a><br />
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<!-- if method_list -->
|
|
||||||
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
<div id="validator-badges">
|
|
||||||
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</body>
|
|
||||||
</html>
|
|
|
@ -1,113 +0,0 @@
|
||||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
|
||||||
<!DOCTYPE html
|
|
||||||
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
|
||||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
|
||||||
|
|
||||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
|
||||||
<head>
|
|
||||||
<title>Module: ActionView::Helpers</title>
|
|
||||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
|
||||||
<meta http-equiv="Content-Script-Type" content="text/javascript" />
|
|
||||||
<link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
|
|
||||||
<script type="text/javascript">
|
|
||||||
// <![CDATA[
|
|
||||||
|
|
||||||
function popupCode( url ) {
|
|
||||||
window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
|
|
||||||
}
|
|
||||||
|
|
||||||
function toggleCode( id ) {
|
|
||||||
if ( document.getElementById )
|
|
||||||
elem = document.getElementById( id );
|
|
||||||
else if ( document.all )
|
|
||||||
elem = eval( "document.all." + id );
|
|
||||||
else
|
|
||||||
return false;
|
|
||||||
|
|
||||||
elemStyle = elem.style;
|
|
||||||
|
|
||||||
if ( elemStyle.display != "block" ) {
|
|
||||||
elemStyle.display = "block"
|
|
||||||
} else {
|
|
||||||
elemStyle.display = "none"
|
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Make codeblocks hidden by default
|
|
||||||
document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
|
|
||||||
|
|
||||||
// ]]>
|
|
||||||
</script>
|
|
||||||
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<div id="classHeader">
|
|
||||||
<table class="header-table">
|
|
||||||
<tr class="top-aligned-row">
|
|
||||||
<td><strong>Module</strong></td>
|
|
||||||
<td class="class-name-in-header">ActionView::Helpers</td>
|
|
||||||
</tr>
|
|
||||||
<tr class="top-aligned-row">
|
|
||||||
<td><strong>In:</strong></td>
|
|
||||||
<td>
|
|
||||||
<a href="../../files/lib/localization_simplified_rb.html">
|
|
||||||
lib/localization_simplified.rb
|
|
||||||
</a>
|
|
||||||
<br />
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
|
|
||||||
</table>
|
|
||||||
</div>
|
|
||||||
<!-- banner header -->
|
|
||||||
|
|
||||||
<div id="bodyContent">
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<div id="contextContent">
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
<!-- if includes -->
|
|
||||||
|
|
||||||
<div id="section">
|
|
||||||
|
|
||||||
<div id="class-list">
|
|
||||||
<h3 class="section-bar">Classes and Modules</h3>
|
|
||||||
|
|
||||||
Module <a href="Helpers/ActiveRecordHelper.html" class="link">ActionView::Helpers::ActiveRecordHelper</a><br />
|
|
||||||
Module <a href="Helpers/DateHelper.html" class="link">ActionView::Helpers::DateHelper</a><br />
|
|
||||||
Module <a href="Helpers/NumberHelper.html" class="link">ActionView::Helpers::NumberHelper</a><br />
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<!-- if method_list -->
|
|
||||||
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
<div id="validator-badges">
|
|
||||||
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</body>
|
|
||||||
</html>
|
|
|
@ -1,176 +0,0 @@
|
||||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
|
||||||
<!DOCTYPE html
|
|
||||||
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
|
||||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
|
||||||
|
|
||||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
|
||||||
<head>
|
|
||||||
<title>Module: ActionView::Helpers::ActiveRecordHelper</title>
|
|
||||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
|
||||||
<meta http-equiv="Content-Script-Type" content="text/javascript" />
|
|
||||||
<link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
|
|
||||||
<script type="text/javascript">
|
|
||||||
// <![CDATA[
|
|
||||||
|
|
||||||
function popupCode( url ) {
|
|
||||||
window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
|
|
||||||
}
|
|
||||||
|
|
||||||
function toggleCode( id ) {
|
|
||||||
if ( document.getElementById )
|
|
||||||
elem = document.getElementById( id );
|
|
||||||
else if ( document.all )
|
|
||||||
elem = eval( "document.all." + id );
|
|
||||||
else
|
|
||||||
return false;
|
|
||||||
|
|
||||||
elemStyle = elem.style;
|
|
||||||
|
|
||||||
if ( elemStyle.display != "block" ) {
|
|
||||||
elemStyle.display = "block"
|
|
||||||
} else {
|
|
||||||
elemStyle.display = "none"
|
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Make codeblocks hidden by default
|
|
||||||
document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
|
|
||||||
|
|
||||||
// ]]>
|
|
||||||
</script>
|
|
||||||
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<div id="classHeader">
|
|
||||||
<table class="header-table">
|
|
||||||
<tr class="top-aligned-row">
|
|
||||||
<td><strong>Module</strong></td>
|
|
||||||
<td class="class-name-in-header">ActionView::Helpers::ActiveRecordHelper</td>
|
|
||||||
</tr>
|
|
||||||
<tr class="top-aligned-row">
|
|
||||||
<td><strong>In:</strong></td>
|
|
||||||
<td>
|
|
||||||
<a href="../../../files/lib/localization_simplified_rb.html">
|
|
||||||
lib/localization_simplified.rb
|
|
||||||
</a>
|
|
||||||
<br />
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
|
|
||||||
</table>
|
|
||||||
</div>
|
|
||||||
<!-- banner header -->
|
|
||||||
|
|
||||||
<div id="bodyContent">
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<div id="contextContent">
|
|
||||||
|
|
||||||
<div id="description">
|
|
||||||
<p>
|
|
||||||
Modify <a href="../../ActiveRecord.html">ActiveRecord</a> to use error
|
|
||||||
message headers (text from lang-file)
|
|
||||||
</p>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div id="method-list">
|
|
||||||
<h3 class="section-bar">Methods</h3>
|
|
||||||
|
|
||||||
<div class="name-list">
|
|
||||||
<a href="#M000005">error_messages_for</a>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
<!-- if includes -->
|
|
||||||
|
|
||||||
<div id="section">
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<div id="aliases-list">
|
|
||||||
<h3 class="section-bar">External Aliases</h3>
|
|
||||||
|
|
||||||
<div class="name-list">
|
|
||||||
<table summary="aliases">
|
|
||||||
<tr class="top-aligned-row context-row">
|
|
||||||
<td class="context-item-name">error_messages_for</td>
|
|
||||||
<td>-></td>
|
|
||||||
<td class="context-item-value">old_error_messages_for</td>
|
|
||||||
</tr>
|
|
||||||
</table>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<!-- if method_list -->
|
|
||||||
<div id="methods">
|
|
||||||
<h3 class="section-bar">Public Instance methods</h3>
|
|
||||||
|
|
||||||
<div id="method-M000005" class="method-detail">
|
|
||||||
<a name="M000005"></a>
|
|
||||||
|
|
||||||
<div class="method-heading">
|
|
||||||
<a href="#M000005" class="method-signature">
|
|
||||||
<span class="method-name">error_messages_for</span><span class="method-args">(object_name, options = {})</span>
|
|
||||||
</a>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="method-description">
|
|
||||||
<p><a class="source-toggle" href="#"
|
|
||||||
onclick="toggleCode('M000005-source');return false;">[Source]</a></p>
|
|
||||||
<div class="method-source-code" id="M000005-source">
|
|
||||||
<pre>
|
|
||||||
<span class="ruby-comment cmt"># File lib/localization_simplified.rb, line 65</span>
|
|
||||||
65: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">error_messages_for</span>(<span class="ruby-identifier">object_name</span>, <span class="ruby-identifier">options</span> = {})
|
|
||||||
66: <span class="ruby-identifier">messages</span> = <span class="ruby-constant">ActiveRecord</span><span class="ruby-operator">::</span><span class="ruby-constant">Errors</span>.<span class="ruby-identifier">default_error_messages</span>
|
|
||||||
67: <span class="ruby-identifier">options</span> = <span class="ruby-identifier">options</span>.<span class="ruby-identifier">symbolize_keys</span>
|
|
||||||
68: <span class="ruby-identifier">object</span> = <span class="ruby-identifier">instance_variable_get</span>(<span class="ruby-node">"@#{object_name}"</span>)
|
|
||||||
69: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">object</span> <span class="ruby-operator">&&</span> <span class="ruby-operator">!</span><span class="ruby-identifier">object</span>.<span class="ruby-identifier">errors</span>.<span class="ruby-identifier">empty?</span>
|
|
||||||
70: <span class="ruby-identifier">content_tag</span>(<span class="ruby-value str">"div"</span>,
|
|
||||||
71: <span class="ruby-identifier">content_tag</span>(
|
|
||||||
72: <span class="ruby-identifier">options</span>[<span class="ruby-identifier">:header_tag</span>] <span class="ruby-operator">||</span> <span class="ruby-value str">"h2"</span>,
|
|
||||||
73: <span class="ruby-identifier">format</span>( <span class="ruby-identifier">messages</span>[<span class="ruby-identifier">:error_header</span>], <span class="ruby-identifier">pluralize</span>(<span class="ruby-identifier">object</span>.<span class="ruby-identifier">errors</span>.<span class="ruby-identifier">count</span>, <span class="ruby-identifier">messages</span>[<span class="ruby-identifier">:error_translation</span>]), <span class="ruby-identifier">object_name</span>.<span class="ruby-identifier">to_s</span>.<span class="ruby-identifier">gsub</span>(<span class="ruby-value str">"_"</span>, <span class="ruby-value str">" "</span>) )
|
|
||||||
74: <span class="ruby-comment cmt">#"#{pluralize(object.errors.count, "error")} prohibited this #{object_name.to_s.gsub("_", " ")} from being saved"</span>
|
|
||||||
75: ) <span class="ruby-operator">+</span>
|
|
||||||
76: <span class="ruby-identifier">content_tag</span>(<span class="ruby-value str">"p"</span>, <span class="ruby-identifier">messages</span>[<span class="ruby-identifier">:error_subheader</span>]) <span class="ruby-operator">+</span>
|
|
||||||
77: <span class="ruby-identifier">content_tag</span>(<span class="ruby-value str">"ul"</span>, <span class="ruby-identifier">object</span>.<span class="ruby-identifier">errors</span>.<span class="ruby-identifier">full_messages</span>.<span class="ruby-identifier">collect</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">msg</span><span class="ruby-operator">|</span> <span class="ruby-identifier">content_tag</span>(<span class="ruby-value str">"li"</span>, <span class="ruby-identifier">msg</span>) }),
|
|
||||||
78: <span class="ruby-value str">"id"</span> =<span class="ruby-operator">></span> <span class="ruby-identifier">options</span>[<span class="ruby-identifier">:id</span>] <span class="ruby-operator">||</span> <span class="ruby-value str">"errorExplanation"</span>, <span class="ruby-value str">"class"</span> =<span class="ruby-operator">></span> <span class="ruby-identifier">options</span>[<span class="ruby-identifier">:class</span>] <span class="ruby-operator">||</span> <span class="ruby-value str">"errorExplanation"</span>
|
|
||||||
79: )
|
|
||||||
80: <span class="ruby-keyword kw">else</span>
|
|
||||||
81: <span class="ruby-value str">""</span>
|
|
||||||
82: <span class="ruby-keyword kw">end</span>
|
|
||||||
83: <span class="ruby-keyword kw">end</span>
|
|
||||||
</pre>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
<div id="validator-badges">
|
|
||||||
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</body>
|
|
||||||
</html>
|
|
|
@ -1,233 +0,0 @@
|
||||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
|
||||||
<!DOCTYPE html
|
|
||||||
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
|
||||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
|
||||||
|
|
||||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
|
||||||
<head>
|
|
||||||
<title>Module: ActionView::Helpers::DateHelper</title>
|
|
||||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
|
||||||
<meta http-equiv="Content-Script-Type" content="text/javascript" />
|
|
||||||
<link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
|
|
||||||
<script type="text/javascript">
|
|
||||||
// <![CDATA[
|
|
||||||
|
|
||||||
function popupCode( url ) {
|
|
||||||
window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
|
|
||||||
}
|
|
||||||
|
|
||||||
function toggleCode( id ) {
|
|
||||||
if ( document.getElementById )
|
|
||||||
elem = document.getElementById( id );
|
|
||||||
else if ( document.all )
|
|
||||||
elem = eval( "document.all." + id );
|
|
||||||
else
|
|
||||||
return false;
|
|
||||||
|
|
||||||
elemStyle = elem.style;
|
|
||||||
|
|
||||||
if ( elemStyle.display != "block" ) {
|
|
||||||
elemStyle.display = "block"
|
|
||||||
} else {
|
|
||||||
elemStyle.display = "none"
|
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Make codeblocks hidden by default
|
|
||||||
document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
|
|
||||||
|
|
||||||
// ]]>
|
|
||||||
</script>
|
|
||||||
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<div id="classHeader">
|
|
||||||
<table class="header-table">
|
|
||||||
<tr class="top-aligned-row">
|
|
||||||
<td><strong>Module</strong></td>
|
|
||||||
<td class="class-name-in-header">ActionView::Helpers::DateHelper</td>
|
|
||||||
</tr>
|
|
||||||
<tr class="top-aligned-row">
|
|
||||||
<td><strong>In:</strong></td>
|
|
||||||
<td>
|
|
||||||
<a href="../../../files/lib/localization_simplified_rb.html">
|
|
||||||
lib/localization_simplified.rb
|
|
||||||
</a>
|
|
||||||
<br />
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
|
|
||||||
</table>
|
|
||||||
</div>
|
|
||||||
<!-- banner header -->
|
|
||||||
|
|
||||||
<div id="bodyContent">
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<div id="contextContent">
|
|
||||||
|
|
||||||
<div id="description">
|
|
||||||
<p>
|
|
||||||
Modify <a href="DateHelper.html">DateHelper</a> to use text from lang-file
|
|
||||||
</p>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div id="method-list">
|
|
||||||
<h3 class="section-bar">Methods</h3>
|
|
||||||
|
|
||||||
<div class="name-list">
|
|
||||||
<a href="#M000007">date_select</a>
|
|
||||||
<a href="#M000008">datetime_select</a>
|
|
||||||
<a href="#M000006">distance_of_time_in_words</a>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
<!-- if includes -->
|
|
||||||
|
|
||||||
<div id="section">
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<div id="aliases-list">
|
|
||||||
<h3 class="section-bar">External Aliases</h3>
|
|
||||||
|
|
||||||
<div class="name-list">
|
|
||||||
<table summary="aliases">
|
|
||||||
<tr class="top-aligned-row context-row">
|
|
||||||
<td class="context-item-name">distance_of_time_in_words</td>
|
|
||||||
<td>-></td>
|
|
||||||
<td class="context-item-value">old_distance_of_time_in_words</td>
|
|
||||||
</tr>
|
|
||||||
<tr class="top-aligned-row context-row">
|
|
||||||
<td> </td>
|
|
||||||
<td colspan="2" class="context-item-desc">
|
|
||||||
Modify <a href="DateHelper.html">DateHelper</a> <a
|
|
||||||
href="DateHelper.html#M000006">distance_of_time_in_words</a>
|
|
||||||
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr class="top-aligned-row context-row">
|
|
||||||
<td class="context-item-name">date_select</td>
|
|
||||||
<td>-></td>
|
|
||||||
<td class="context-item-value">orig_date_select</td>
|
|
||||||
</tr>
|
|
||||||
<tr class="top-aligned-row context-row">
|
|
||||||
<td class="context-item-name">datetime_select</td>
|
|
||||||
<td>-></td>
|
|
||||||
<td class="context-item-value">orig_datetime_select</td>
|
|
||||||
</tr>
|
|
||||||
</table>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<!-- if method_list -->
|
|
||||||
<div id="methods">
|
|
||||||
<h3 class="section-bar">Public Instance methods</h3>
|
|
||||||
|
|
||||||
<div id="method-M000007" class="method-detail">
|
|
||||||
<a name="M000007"></a>
|
|
||||||
|
|
||||||
<div class="method-heading">
|
|
||||||
<a href="#M000007" class="method-signature">
|
|
||||||
<span class="method-name">date_select</span><span class="method-args">(object_name, method, options = {})</span>
|
|
||||||
</a>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="method-description">
|
|
||||||
<p>
|
|
||||||
Blend default options with localized :order option
|
|
||||||
</p>
|
|
||||||
<p><a class="source-toggle" href="#"
|
|
||||||
onclick="toggleCode('M000007-source');return false;">[Source]</a></p>
|
|
||||||
<div class="method-source-code" id="M000007-source">
|
|
||||||
<pre>
|
|
||||||
<span class="ruby-comment cmt"># File lib/localization_simplified.rb, line 117</span>
|
|
||||||
117: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">date_select</span>(<span class="ruby-identifier">object_name</span>, <span class="ruby-identifier">method</span>, <span class="ruby-identifier">options</span> = {})
|
|
||||||
118: <span class="ruby-identifier">options</span>.<span class="ruby-identifier">reverse_merge!</span>(<span class="ruby-constant">LocalizationSimplified</span><span class="ruby-operator">::</span><span class="ruby-constant">DateHelper</span><span class="ruby-operator">::</span><span class="ruby-constant">DateSelectOrder</span>)
|
|
||||||
119: <span class="ruby-identifier">orig_date_select</span>(<span class="ruby-identifier">object_name</span>, <span class="ruby-identifier">method</span>, <span class="ruby-identifier">options</span>)
|
|
||||||
120: <span class="ruby-keyword kw">end</span>
|
|
||||||
</pre>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div id="method-M000008" class="method-detail">
|
|
||||||
<a name="M000008"></a>
|
|
||||||
|
|
||||||
<div class="method-heading">
|
|
||||||
<a href="#M000008" class="method-signature">
|
|
||||||
<span class="method-name">datetime_select</span><span class="method-args">(object_name, method, options = {})</span>
|
|
||||||
</a>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="method-description">
|
|
||||||
<p>
|
|
||||||
Blend default options with localized :order option
|
|
||||||
</p>
|
|
||||||
<p><a class="source-toggle" href="#"
|
|
||||||
onclick="toggleCode('M000008-source');return false;">[Source]</a></p>
|
|
||||||
<div class="method-source-code" id="M000008-source">
|
|
||||||
<pre>
|
|
||||||
<span class="ruby-comment cmt"># File lib/localization_simplified.rb, line 126</span>
|
|
||||||
126: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">datetime_select</span>(<span class="ruby-identifier">object_name</span>, <span class="ruby-identifier">method</span>, <span class="ruby-identifier">options</span> = {})
|
|
||||||
127: <span class="ruby-identifier">options</span>.<span class="ruby-identifier">reverse_merge!</span>(<span class="ruby-constant">LocalizationSimplified</span><span class="ruby-operator">::</span><span class="ruby-constant">DateHelper</span><span class="ruby-operator">::</span><span class="ruby-constant">DateSelectOrder</span>)
|
|
||||||
128: <span class="ruby-identifier">orig_datetime_select</span>(<span class="ruby-identifier">object_name</span>, <span class="ruby-identifier">method</span>, <span class="ruby-identifier">options</span>)
|
|
||||||
129: <span class="ruby-keyword kw">end</span>
|
|
||||||
</pre>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div id="method-M000006" class="method-detail">
|
|
||||||
<a name="M000006"></a>
|
|
||||||
|
|
||||||
<div class="method-heading">
|
|
||||||
<a href="#M000006" class="method-signature">
|
|
||||||
<span class="method-name">distance_of_time_in_words</span><span class="method-args">(from_time, to_time = 0, include_seconds = false)</span>
|
|
||||||
</a>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="method-description">
|
|
||||||
<p><a class="source-toggle" href="#"
|
|
||||||
onclick="toggleCode('M000006-source');return false;">[Source]</a></p>
|
|
||||||
<div class="method-source-code" id="M000006-source">
|
|
||||||
<pre>
|
|
||||||
<span class="ruby-comment cmt"># File lib/localization_simplified.rb, line 93</span>
|
|
||||||
93: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">distance_of_time_in_words</span>(<span class="ruby-identifier">from_time</span>, <span class="ruby-identifier">to_time</span> = <span class="ruby-value">0</span>, <span class="ruby-identifier">include_seconds</span> = <span class="ruby-keyword kw">false</span>)
|
|
||||||
94: <span class="ruby-constant">LocalizationSimplified</span><span class="ruby-operator">::</span><span class="ruby-identifier">distance_of_time_in_words</span>(<span class="ruby-identifier">from_time</span>, <span class="ruby-identifier">to_time</span>, <span class="ruby-identifier">include_seconds</span>)
|
|
||||||
95: <span class="ruby-keyword kw">end</span>
|
|
||||||
</pre>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
<div id="validator-badges">
|
|
||||||
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</body>
|
|
||||||
</html>
|
|
|
@ -1,157 +0,0 @@
|
||||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
|
||||||
<!DOCTYPE html
|
|
||||||
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
|
||||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
|
||||||
|
|
||||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
|
||||||
<head>
|
|
||||||
<title>Module: ActionView::Helpers::NumberHelper</title>
|
|
||||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
|
||||||
<meta http-equiv="Content-Script-Type" content="text/javascript" />
|
|
||||||
<link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
|
|
||||||
<script type="text/javascript">
|
|
||||||
// <![CDATA[
|
|
||||||
|
|
||||||
function popupCode( url ) {
|
|
||||||
window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
|
|
||||||
}
|
|
||||||
|
|
||||||
function toggleCode( id ) {
|
|
||||||
if ( document.getElementById )
|
|
||||||
elem = document.getElementById( id );
|
|
||||||
else if ( document.all )
|
|
||||||
elem = eval( "document.all." + id );
|
|
||||||
else
|
|
||||||
return false;
|
|
||||||
|
|
||||||
elemStyle = elem.style;
|
|
||||||
|
|
||||||
if ( elemStyle.display != "block" ) {
|
|
||||||
elemStyle.display = "block"
|
|
||||||
} else {
|
|
||||||
elemStyle.display = "none"
|
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Make codeblocks hidden by default
|
|
||||||
document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
|
|
||||||
|
|
||||||
// ]]>
|
|
||||||
</script>
|
|
||||||
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<div id="classHeader">
|
|
||||||
<table class="header-table">
|
|
||||||
<tr class="top-aligned-row">
|
|
||||||
<td><strong>Module</strong></td>
|
|
||||||
<td class="class-name-in-header">ActionView::Helpers::NumberHelper</td>
|
|
||||||
</tr>
|
|
||||||
<tr class="top-aligned-row">
|
|
||||||
<td><strong>In:</strong></td>
|
|
||||||
<td>
|
|
||||||
<a href="../../../files/lib/localization_simplified_rb.html">
|
|
||||||
lib/localization_simplified.rb
|
|
||||||
</a>
|
|
||||||
<br />
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
|
|
||||||
</table>
|
|
||||||
</div>
|
|
||||||
<!-- banner header -->
|
|
||||||
|
|
||||||
<div id="bodyContent">
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<div id="contextContent">
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div id="method-list">
|
|
||||||
<h3 class="section-bar">Methods</h3>
|
|
||||||
|
|
||||||
<div class="name-list">
|
|
||||||
<a href="#M000004">number_to_currency</a>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
<!-- if includes -->
|
|
||||||
|
|
||||||
<div id="section">
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<div id="aliases-list">
|
|
||||||
<h3 class="section-bar">External Aliases</h3>
|
|
||||||
|
|
||||||
<div class="name-list">
|
|
||||||
<table summary="aliases">
|
|
||||||
<tr class="top-aligned-row context-row">
|
|
||||||
<td class="context-item-name">number_to_currency</td>
|
|
||||||
<td>-></td>
|
|
||||||
<td class="context-item-value">orig_number_to_currency</td>
|
|
||||||
</tr>
|
|
||||||
</table>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<!-- if method_list -->
|
|
||||||
<div id="methods">
|
|
||||||
<h3 class="section-bar">Public Instance methods</h3>
|
|
||||||
|
|
||||||
<div id="method-M000004" class="method-detail">
|
|
||||||
<a name="M000004"></a>
|
|
||||||
|
|
||||||
<div class="method-heading">
|
|
||||||
<a href="#M000004" class="method-signature">
|
|
||||||
<span class="method-name">number_to_currency</span><span class="method-args">(number, options = {})</span>
|
|
||||||
</a>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="method-description">
|
|
||||||
<p>
|
|
||||||
Blend default options with localized currency options
|
|
||||||
</p>
|
|
||||||
<p><a class="source-toggle" href="#"
|
|
||||||
onclick="toggleCode('M000004-source');return false;">[Source]</a></p>
|
|
||||||
<div class="method-source-code" id="M000004-source">
|
|
||||||
<pre>
|
|
||||||
<span class="ruby-comment cmt"># File lib/localization_simplified.rb, line 107</span>
|
|
||||||
107: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">number_to_currency</span>(<span class="ruby-identifier">number</span>, <span class="ruby-identifier">options</span> = {})
|
|
||||||
108: <span class="ruby-identifier">options</span>.<span class="ruby-identifier">reverse_merge!</span>(<span class="ruby-constant">LocalizationSimplified</span><span class="ruby-operator">::</span><span class="ruby-constant">NumberHelper</span><span class="ruby-operator">::</span><span class="ruby-constant">CurrencyOptions</span>)
|
|
||||||
109: <span class="ruby-identifier">orig_number_to_currency</span>(<span class="ruby-identifier">number</span>, <span class="ruby-identifier">options</span>)
|
|
||||||
110: <span class="ruby-keyword kw">end</span>
|
|
||||||
</pre>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
<div id="validator-badges">
|
|
||||||
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</body>
|
|
||||||
</html>
|
|
|
@ -1,111 +0,0 @@
|
||||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
|
||||||
<!DOCTYPE html
|
|
||||||
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
|
||||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
|
||||||
|
|
||||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
|
||||||
<head>
|
|
||||||
<title>Module: ActiveRecord</title>
|
|
||||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
|
||||||
<meta http-equiv="Content-Script-Type" content="text/javascript" />
|
|
||||||
<link rel="stylesheet" href=".././rdoc-style.css" type="text/css" media="screen" />
|
|
||||||
<script type="text/javascript">
|
|
||||||
// <![CDATA[
|
|
||||||
|
|
||||||
function popupCode( url ) {
|
|
||||||
window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
|
|
||||||
}
|
|
||||||
|
|
||||||
function toggleCode( id ) {
|
|
||||||
if ( document.getElementById )
|
|
||||||
elem = document.getElementById( id );
|
|
||||||
else if ( document.all )
|
|
||||||
elem = eval( "document.all." + id );
|
|
||||||
else
|
|
||||||
return false;
|
|
||||||
|
|
||||||
elemStyle = elem.style;
|
|
||||||
|
|
||||||
if ( elemStyle.display != "block" ) {
|
|
||||||
elemStyle.display = "block"
|
|
||||||
} else {
|
|
||||||
elemStyle.display = "none"
|
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Make codeblocks hidden by default
|
|
||||||
document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
|
|
||||||
|
|
||||||
// ]]>
|
|
||||||
</script>
|
|
||||||
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<div id="classHeader">
|
|
||||||
<table class="header-table">
|
|
||||||
<tr class="top-aligned-row">
|
|
||||||
<td><strong>Module</strong></td>
|
|
||||||
<td class="class-name-in-header">ActiveRecord</td>
|
|
||||||
</tr>
|
|
||||||
<tr class="top-aligned-row">
|
|
||||||
<td><strong>In:</strong></td>
|
|
||||||
<td>
|
|
||||||
<a href="../files/lib/localization_simplified_rb.html">
|
|
||||||
lib/localization_simplified.rb
|
|
||||||
</a>
|
|
||||||
<br />
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
|
|
||||||
</table>
|
|
||||||
</div>
|
|
||||||
<!-- banner header -->
|
|
||||||
|
|
||||||
<div id="bodyContent">
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<div id="contextContent">
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
<!-- if includes -->
|
|
||||||
|
|
||||||
<div id="section">
|
|
||||||
|
|
||||||
<div id="class-list">
|
|
||||||
<h3 class="section-bar">Classes and Modules</h3>
|
|
||||||
|
|
||||||
Class <a href="ActiveRecord/Errors.html" class="link">ActiveRecord::Errors</a><br />
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<!-- if method_list -->
|
|
||||||
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
<div id="validator-badges">
|
|
||||||
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</body>
|
|
||||||
</html>
|
|
|
@ -1,111 +0,0 @@
|
||||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
|
||||||
<!DOCTYPE html
|
|
||||||
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
|
||||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
|
||||||
|
|
||||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
|
||||||
<head>
|
|
||||||
<title>Class: ActiveRecord::Errors</title>
|
|
||||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
|
||||||
<meta http-equiv="Content-Script-Type" content="text/javascript" />
|
|
||||||
<link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
|
|
||||||
<script type="text/javascript">
|
|
||||||
// <![CDATA[
|
|
||||||
|
|
||||||
function popupCode( url ) {
|
|
||||||
window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
|
|
||||||
}
|
|
||||||
|
|
||||||
function toggleCode( id ) {
|
|
||||||
if ( document.getElementById )
|
|
||||||
elem = document.getElementById( id );
|
|
||||||
else if ( document.all )
|
|
||||||
elem = eval( "document.all." + id );
|
|
||||||
else
|
|
||||||
return false;
|
|
||||||
|
|
||||||
elemStyle = elem.style;
|
|
||||||
|
|
||||||
if ( elemStyle.display != "block" ) {
|
|
||||||
elemStyle.display = "block"
|
|
||||||
} else {
|
|
||||||
elemStyle.display = "none"
|
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Make codeblocks hidden by default
|
|
||||||
document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
|
|
||||||
|
|
||||||
// ]]>
|
|
||||||
</script>
|
|
||||||
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<div id="classHeader">
|
|
||||||
<table class="header-table">
|
|
||||||
<tr class="top-aligned-row">
|
|
||||||
<td><strong>Class</strong></td>
|
|
||||||
<td class="class-name-in-header">ActiveRecord::Errors</td>
|
|
||||||
</tr>
|
|
||||||
<tr class="top-aligned-row">
|
|
||||||
<td><strong>In:</strong></td>
|
|
||||||
<td>
|
|
||||||
<a href="../../files/lib/localization_simplified_rb.html">
|
|
||||||
lib/localization_simplified.rb
|
|
||||||
</a>
|
|
||||||
<br />
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
|
|
||||||
<tr class="top-aligned-row">
|
|
||||||
<td><strong>Parent:</strong></td>
|
|
||||||
<td>
|
|
||||||
Object
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
</table>
|
|
||||||
</div>
|
|
||||||
<!-- banner header -->
|
|
||||||
|
|
||||||
<div id="bodyContent">
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<div id="contextContent">
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
<!-- if includes -->
|
|
||||||
|
|
||||||
<div id="section">
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<!-- if method_list -->
|
|
||||||
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
<div id="validator-badges">
|
|
||||||
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</body>
|
|
||||||
</html>
|
|
|
@ -1,161 +0,0 @@
|
||||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
|
||||||
<!DOCTYPE html
|
|
||||||
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
|
||||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
|
||||||
|
|
||||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
|
||||||
<head>
|
|
||||||
<title>Class: Array</title>
|
|
||||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
|
||||||
<meta http-equiv="Content-Script-Type" content="text/javascript" />
|
|
||||||
<link rel="stylesheet" href=".././rdoc-style.css" type="text/css" media="screen" />
|
|
||||||
<script type="text/javascript">
|
|
||||||
// <![CDATA[
|
|
||||||
|
|
||||||
function popupCode( url ) {
|
|
||||||
window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
|
|
||||||
}
|
|
||||||
|
|
||||||
function toggleCode( id ) {
|
|
||||||
if ( document.getElementById )
|
|
||||||
elem = document.getElementById( id );
|
|
||||||
else if ( document.all )
|
|
||||||
elem = eval( "document.all." + id );
|
|
||||||
else
|
|
||||||
return false;
|
|
||||||
|
|
||||||
elemStyle = elem.style;
|
|
||||||
|
|
||||||
if ( elemStyle.display != "block" ) {
|
|
||||||
elemStyle.display = "block"
|
|
||||||
} else {
|
|
||||||
elemStyle.display = "none"
|
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Make codeblocks hidden by default
|
|
||||||
document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
|
|
||||||
|
|
||||||
// ]]>
|
|
||||||
</script>
|
|
||||||
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<div id="classHeader">
|
|
||||||
<table class="header-table">
|
|
||||||
<tr class="top-aligned-row">
|
|
||||||
<td><strong>Class</strong></td>
|
|
||||||
<td class="class-name-in-header">Array</td>
|
|
||||||
</tr>
|
|
||||||
<tr class="top-aligned-row">
|
|
||||||
<td><strong>In:</strong></td>
|
|
||||||
<td>
|
|
||||||
<a href="../files/lib/localization_simplified_rb.html">
|
|
||||||
lib/localization_simplified.rb
|
|
||||||
</a>
|
|
||||||
<br />
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
|
|
||||||
<tr class="top-aligned-row">
|
|
||||||
<td><strong>Parent:</strong></td>
|
|
||||||
<td>
|
|
||||||
Object
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
</table>
|
|
||||||
</div>
|
|
||||||
<!-- banner header -->
|
|
||||||
|
|
||||||
<div id="bodyContent">
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<div id="contextContent">
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div id="method-list">
|
|
||||||
<h3 class="section-bar">Methods</h3>
|
|
||||||
|
|
||||||
<div class="name-list">
|
|
||||||
<a href="#M000002">to_sentence</a>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
<!-- if includes -->
|
|
||||||
|
|
||||||
<div id="section">
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<div id="aliases-list">
|
|
||||||
<h3 class="section-bar">External Aliases</h3>
|
|
||||||
|
|
||||||
<div class="name-list">
|
|
||||||
<table summary="aliases">
|
|
||||||
<tr class="top-aligned-row context-row">
|
|
||||||
<td class="context-item-name">to_sentence</td>
|
|
||||||
<td>-></td>
|
|
||||||
<td class="context-item-value">orig_to_sentence</td>
|
|
||||||
</tr>
|
|
||||||
</table>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<!-- if method_list -->
|
|
||||||
<div id="methods">
|
|
||||||
<h3 class="section-bar">Public Instance methods</h3>
|
|
||||||
|
|
||||||
<div id="method-M000002" class="method-detail">
|
|
||||||
<a name="M000002"></a>
|
|
||||||
|
|
||||||
<div class="method-heading">
|
|
||||||
<a href="#M000002" class="method-signature">
|
|
||||||
<span class="method-name">to_sentence</span><span class="method-args">(options = {})</span>
|
|
||||||
</a>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="method-description">
|
|
||||||
<p><a class="source-toggle" href="#"
|
|
||||||
onclick="toggleCode('M000002-source');return false;">[Source]</a></p>
|
|
||||||
<div class="method-source-code" id="M000002-source">
|
|
||||||
<pre>
|
|
||||||
<span class="ruby-comment cmt"># File lib/localization_simplified.rb, line 137</span>
|
|
||||||
137: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">to_sentence</span>(<span class="ruby-identifier">options</span> = {})
|
|
||||||
138: <span class="ruby-comment cmt">#Blend default options with sent through options</span>
|
|
||||||
139: <span class="ruby-identifier">options</span>.<span class="ruby-identifier">reverse_merge!</span>(<span class="ruby-constant">LocalizationSimplified</span><span class="ruby-operator">::</span><span class="ruby-constant">ArrayHelper</span><span class="ruby-operator">::</span><span class="ruby-constant">ToSentenceTexts</span>)
|
|
||||||
140: <span class="ruby-identifier">orig_to_sentence</span>(<span class="ruby-identifier">options</span>)
|
|
||||||
141: <span class="ruby-keyword kw">end</span>
|
|
||||||
</pre>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
<div id="validator-badges">
|
|
||||||
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</body>
|
|
||||||
</html>
|
|
|
@ -1,136 +0,0 @@
|
||||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
|
||||||
<!DOCTYPE html
|
|
||||||
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
|
||||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
|
||||||
|
|
||||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
|
||||||
<head>
|
|
||||||
<title>Class: Date</title>
|
|
||||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
|
||||||
<meta http-equiv="Content-Script-Type" content="text/javascript" />
|
|
||||||
<link rel="stylesheet" href=".././rdoc-style.css" type="text/css" media="screen" />
|
|
||||||
<script type="text/javascript">
|
|
||||||
// <![CDATA[
|
|
||||||
|
|
||||||
function popupCode( url ) {
|
|
||||||
window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
|
|
||||||
}
|
|
||||||
|
|
||||||
function toggleCode( id ) {
|
|
||||||
if ( document.getElementById )
|
|
||||||
elem = document.getElementById( id );
|
|
||||||
else if ( document.all )
|
|
||||||
elem = eval( "document.all." + id );
|
|
||||||
else
|
|
||||||
return false;
|
|
||||||
|
|
||||||
elemStyle = elem.style;
|
|
||||||
|
|
||||||
if ( elemStyle.display != "block" ) {
|
|
||||||
elemStyle.display = "block"
|
|
||||||
} else {
|
|
||||||
elemStyle.display = "none"
|
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Make codeblocks hidden by default
|
|
||||||
document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
|
|
||||||
|
|
||||||
// ]]>
|
|
||||||
</script>
|
|
||||||
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<div id="classHeader">
|
|
||||||
<table class="header-table">
|
|
||||||
<tr class="top-aligned-row">
|
|
||||||
<td><strong>Class</strong></td>
|
|
||||||
<td class="class-name-in-header">Date</td>
|
|
||||||
</tr>
|
|
||||||
<tr class="top-aligned-row">
|
|
||||||
<td><strong>In:</strong></td>
|
|
||||||
<td>
|
|
||||||
<a href="../files/lib/localization_simplified_rb.html">
|
|
||||||
lib/localization_simplified.rb
|
|
||||||
</a>
|
|
||||||
<br />
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
|
|
||||||
<tr class="top-aligned-row">
|
|
||||||
<td><strong>Parent:</strong></td>
|
|
||||||
<td>
|
|
||||||
Object
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
</table>
|
|
||||||
</div>
|
|
||||||
<!-- banner header -->
|
|
||||||
|
|
||||||
<div id="bodyContent">
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<div id="contextContent">
|
|
||||||
|
|
||||||
<div id="description">
|
|
||||||
<p>
|
|
||||||
Modification of ruby constants
|
|
||||||
</p>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
<!-- if includes -->
|
|
||||||
|
|
||||||
<div id="section">
|
|
||||||
|
|
||||||
|
|
||||||
<div id="constants-list">
|
|
||||||
<h3 class="section-bar">Constants</h3>
|
|
||||||
|
|
||||||
<div class="name-list">
|
|
||||||
<table summary="Constants">
|
|
||||||
<tr class="top-aligned-row context-row">
|
|
||||||
<td class="context-item-name">MONTHNAMES</td>
|
|
||||||
<td>=</td>
|
|
||||||
<td class="context-item-value">LocalizationSimplified::DateHelper::Monthnames</td>
|
|
||||||
<td width="3em"> </td>
|
|
||||||
<td class="context-item-desc">
|
|
||||||
FIXME as these are defined as Ruby constants, they can’t be
|
|
||||||
overwritten
|
|
||||||
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
</table>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<!-- if method_list -->
|
|
||||||
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
<div id="validator-badges">
|
|
||||||
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</body>
|
|
||||||
</html>
|
|
|
@ -1,344 +0,0 @@
|
||||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
|
||||||
<!DOCTYPE html
|
|
||||||
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
|
||||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
|
||||||
|
|
||||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
|
||||||
<head>
|
|
||||||
<title>Module: LocalizationSimplified</title>
|
|
||||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
|
||||||
<meta http-equiv="Content-Script-Type" content="text/javascript" />
|
|
||||||
<link rel="stylesheet" href=".././rdoc-style.css" type="text/css" media="screen" />
|
|
||||||
<script type="text/javascript">
|
|
||||||
// <![CDATA[
|
|
||||||
|
|
||||||
function popupCode( url ) {
|
|
||||||
window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
|
|
||||||
}
|
|
||||||
|
|
||||||
function toggleCode( id ) {
|
|
||||||
if ( document.getElementById )
|
|
||||||
elem = document.getElementById( id );
|
|
||||||
else if ( document.all )
|
|
||||||
elem = eval( "document.all." + id );
|
|
||||||
else
|
|
||||||
return false;
|
|
||||||
|
|
||||||
elemStyle = elem.style;
|
|
||||||
|
|
||||||
if ( elemStyle.display != "block" ) {
|
|
||||||
elemStyle.display = "block"
|
|
||||||
} else {
|
|
||||||
elemStyle.display = "none"
|
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Make codeblocks hidden by default
|
|
||||||
document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
|
|
||||||
|
|
||||||
// ]]>
|
|
||||||
</script>
|
|
||||||
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<div id="classHeader">
|
|
||||||
<table class="header-table">
|
|
||||||
<tr class="top-aligned-row">
|
|
||||||
<td><strong>Module</strong></td>
|
|
||||||
<td class="class-name-in-header">LocalizationSimplified</td>
|
|
||||||
</tr>
|
|
||||||
<tr class="top-aligned-row">
|
|
||||||
<td><strong>In:</strong></td>
|
|
||||||
<td>
|
|
||||||
<a href="../files/lib/lang_cf_rb.html">
|
|
||||||
lib/lang_cf.rb
|
|
||||||
</a>
|
|
||||||
<br />
|
|
||||||
<a href="../files/lib/lang_chef_rb.html">
|
|
||||||
lib/lang_chef.rb
|
|
||||||
</a>
|
|
||||||
<br />
|
|
||||||
<a href="../files/lib/lang_da_rb.html">
|
|
||||||
lib/lang_da.rb
|
|
||||||
</a>
|
|
||||||
<br />
|
|
||||||
<a href="../files/lib/lang_de_rb.html">
|
|
||||||
lib/lang_de.rb
|
|
||||||
</a>
|
|
||||||
<br />
|
|
||||||
<a href="../files/lib/lang_en_rb.html">
|
|
||||||
lib/lang_en.rb
|
|
||||||
</a>
|
|
||||||
<br />
|
|
||||||
<a href="../files/lib/lang_es_rb.html">
|
|
||||||
lib/lang_es.rb
|
|
||||||
</a>
|
|
||||||
<br />
|
|
||||||
<a href="../files/lib/lang_fi_rb.html">
|
|
||||||
lib/lang_fi.rb
|
|
||||||
</a>
|
|
||||||
<br />
|
|
||||||
<a href="../files/lib/lang_fr_rb.html">
|
|
||||||
lib/lang_fr.rb
|
|
||||||
</a>
|
|
||||||
<br />
|
|
||||||
<a href="../files/lib/lang_fr__rb.html">
|
|
||||||
lib/lang_fr_.rb
|
|
||||||
</a>
|
|
||||||
<br />
|
|
||||||
<a href="../files/lib/lang_nl_rb.html">
|
|
||||||
lib/lang_nl.rb
|
|
||||||
</a>
|
|
||||||
<br />
|
|
||||||
<a href="../files/lib/lang_pirate_rb.html">
|
|
||||||
lib/lang_pirate.rb
|
|
||||||
</a>
|
|
||||||
<br />
|
|
||||||
<a href="../files/lib/lang_se_rb.html">
|
|
||||||
lib/lang_se.rb
|
|
||||||
</a>
|
|
||||||
<br />
|
|
||||||
<a href="../files/lib/lang_template_rb.html">
|
|
||||||
lib/lang_template.rb
|
|
||||||
</a>
|
|
||||||
<br />
|
|
||||||
<a href="../files/lib/localization_simplified_rb.html">
|
|
||||||
lib/localization_simplified.rb
|
|
||||||
</a>
|
|
||||||
<br />
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
|
|
||||||
</table>
|
|
||||||
</div>
|
|
||||||
<!-- banner header -->
|
|
||||||
|
|
||||||
<div id="bodyContent">
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<div id="contextContent">
|
|
||||||
|
|
||||||
<div id="description">
|
|
||||||
<p>
|
|
||||||
<a href="LocalizationSimplified.html">LocalizationSimplified</a> Really
|
|
||||||
simple localization for Rails By Jesper Rønn-Jensen ( <a
|
|
||||||
href="http://justaddwater.dk">justaddwater.dk</a>/ ) Plugin available at <a
|
|
||||||
href="http://rubyforge.org/projects/l10n-simplified">rubyforge.org/projects/l10n-simplified</a>/
|
|
||||||
</p>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div id="method-list">
|
|
||||||
<h3 class="section-bar">Methods</h3>
|
|
||||||
|
|
||||||
<div class="name-list">
|
|
||||||
<a href="#M000010">distance_of_time_in_words</a>
|
|
||||||
<a href="#M000009">localize_strftime</a>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
<!-- if includes -->
|
|
||||||
|
|
||||||
<div id="section">
|
|
||||||
|
|
||||||
<div id="class-list">
|
|
||||||
<h3 class="section-bar">Classes and Modules</h3>
|
|
||||||
|
|
||||||
Class <a href="LocalizationSimplified/ActiveRecord.html" class="link">LocalizationSimplified::ActiveRecord</a><br />
|
|
||||||
Class <a href="LocalizationSimplified/ArrayHelper.html" class="link">LocalizationSimplified::ArrayHelper</a><br />
|
|
||||||
Class <a href="LocalizationSimplified/DateHelper.html" class="link">LocalizationSimplified::DateHelper</a><br />
|
|
||||||
Class <a href="LocalizationSimplified/NumberHelper.html" class="link">LocalizationSimplified::NumberHelper</a><br />
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div id="constants-list">
|
|
||||||
<h3 class="section-bar">Constants</h3>
|
|
||||||
|
|
||||||
<div class="name-list">
|
|
||||||
<table summary="Constants">
|
|
||||||
<tr class="top-aligned-row context-row">
|
|
||||||
<td class="context-item-name">About</td>
|
|
||||||
<td>=</td>
|
|
||||||
<td class="context-item-value">{ :lang => "cf", :updated => "2006-09-07"</td>
|
|
||||||
</tr>
|
|
||||||
<tr class="top-aligned-row context-row">
|
|
||||||
<td class="context-item-name">About</td>
|
|
||||||
<td>=</td>
|
|
||||||
<td class="context-item-value">{ :lang => "chef", :updated => "2006-09-07"</td>
|
|
||||||
</tr>
|
|
||||||
<tr class="top-aligned-row context-row">
|
|
||||||
<td class="context-item-name">About</td>
|
|
||||||
<td>=</td>
|
|
||||||
<td class="context-item-value">{ :lang => "da", :updated => "2006-09-07"</td>
|
|
||||||
</tr>
|
|
||||||
<tr class="top-aligned-row context-row">
|
|
||||||
<td class="context-item-name">About</td>
|
|
||||||
<td>=</td>
|
|
||||||
<td class="context-item-value">{ :lang => "de", :updated => "2006-09-07"</td>
|
|
||||||
</tr>
|
|
||||||
<tr class="top-aligned-row context-row">
|
|
||||||
<td class="context-item-name">About</td>
|
|
||||||
<td>=</td>
|
|
||||||
<td class="context-item-value">{ :lang => "en", :updated => "2006-09-01"</td>
|
|
||||||
</tr>
|
|
||||||
<tr class="top-aligned-row context-row">
|
|
||||||
<td class="context-item-name">About</td>
|
|
||||||
<td>=</td>
|
|
||||||
<td class="context-item-value">{ :lang => "es", :updated => "2006-09-07"</td>
|
|
||||||
</tr>
|
|
||||||
<tr class="top-aligned-row context-row">
|
|
||||||
<td class="context-item-name">About</td>
|
|
||||||
<td>=</td>
|
|
||||||
<td class="context-item-value">{ :lang => "fi", :updated => "2006-09-07"</td>
|
|
||||||
</tr>
|
|
||||||
<tr class="top-aligned-row context-row">
|
|
||||||
<td class="context-item-name">About</td>
|
|
||||||
<td>=</td>
|
|
||||||
<td class="context-item-value">{ :lang => "fr", :updated => "2006-09-03"</td>
|
|
||||||
</tr>
|
|
||||||
<tr class="top-aligned-row context-row">
|
|
||||||
<td class="context-item-name">About</td>
|
|
||||||
<td>=</td>
|
|
||||||
<td class="context-item-value">{ :lang => "fr", :updated => "2006-08-24"</td>
|
|
||||||
</tr>
|
|
||||||
<tr class="top-aligned-row context-row">
|
|
||||||
<td class="context-item-name">About</td>
|
|
||||||
<td>=</td>
|
|
||||||
<td class="context-item-value">{ :lang => "nl", :updated => "2006-08-23"</td>
|
|
||||||
</tr>
|
|
||||||
<tr class="top-aligned-row context-row">
|
|
||||||
<td class="context-item-name">About</td>
|
|
||||||
<td>=</td>
|
|
||||||
<td class="context-item-value">{ :lang => "pirate", :updated => "2006-09-07"</td>
|
|
||||||
</tr>
|
|
||||||
<tr class="top-aligned-row context-row">
|
|
||||||
<td class="context-item-name">About</td>
|
|
||||||
<td>=</td>
|
|
||||||
<td class="context-item-value">{ :lang => "se", :updated => "2006-09-07"</td>
|
|
||||||
</tr>
|
|
||||||
<tr class="top-aligned-row context-row">
|
|
||||||
<td class="context-item-name">About</td>
|
|
||||||
<td>=</td>
|
|
||||||
<td class="context-item-value">{ :lang => "en",#add locale code here :updated => "2006-09-01"</td>
|
|
||||||
</tr>
|
|
||||||
</table>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<!-- if method_list -->
|
|
||||||
<div id="methods">
|
|
||||||
<h3 class="section-bar">Public Class methods</h3>
|
|
||||||
|
|
||||||
<div id="method-M000010" class="method-detail">
|
|
||||||
<a name="M000010"></a>
|
|
||||||
|
|
||||||
<div class="method-heading">
|
|
||||||
<a href="#M000010" class="method-signature">
|
|
||||||
<span class="method-name">distance_of_time_in_words</span><span class="method-args">(from_time, to_time = 0, include_seconds = false)</span>
|
|
||||||
</a>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="method-description">
|
|
||||||
<p>
|
|
||||||
Modify <a href="LocalizationSimplified/DateHelper.html">DateHelper</a> <a
|
|
||||||
href="LocalizationSimplified.html#M000010">distance_of_time_in_words</a>
|
|
||||||
</p>
|
|
||||||
<p><a class="source-toggle" href="#"
|
|
||||||
onclick="toggleCode('M000010-source');return false;">[Source]</a></p>
|
|
||||||
<div class="method-source-code" id="M000010-source">
|
|
||||||
<pre>
|
|
||||||
<span class="ruby-comment cmt"># File lib/localization_simplified.rb, line 20</span>
|
|
||||||
20: <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">distance_of_time_in_words</span>(<span class="ruby-identifier">from_time</span>, <span class="ruby-identifier">to_time</span> = <span class="ruby-value">0</span>, <span class="ruby-identifier">include_seconds</span> = <span class="ruby-keyword kw">false</span>)
|
|
||||||
21: <span class="ruby-identifier">from_time</span> = <span class="ruby-identifier">from_time</span>.<span class="ruby-identifier">to_time</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">from_time</span>.<span class="ruby-identifier">respond_to?</span>(<span class="ruby-identifier">:to_time</span>)
|
|
||||||
22: <span class="ruby-identifier">to_time</span> = <span class="ruby-identifier">to_time</span>.<span class="ruby-identifier">to_time</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">to_time</span>.<span class="ruby-identifier">respond_to?</span>(<span class="ruby-identifier">:to_time</span>)
|
|
||||||
23: <span class="ruby-identifier">distance_in_minutes</span> = (((<span class="ruby-identifier">to_time</span> <span class="ruby-operator">-</span> <span class="ruby-identifier">from_time</span>).<span class="ruby-identifier">abs</span>)<span class="ruby-operator">/</span><span class="ruby-value">60</span>).<span class="ruby-identifier">round</span>
|
|
||||||
24: <span class="ruby-identifier">distance_in_seconds</span> = ((<span class="ruby-identifier">to_time</span> <span class="ruby-operator">-</span> <span class="ruby-identifier">from_time</span>).<span class="ruby-identifier">abs</span>).<span class="ruby-identifier">round</span>
|
|
||||||
25:
|
|
||||||
26: <span class="ruby-comment cmt">#First, I invent a variable (makes it easier for future i10n)</span>
|
|
||||||
27: <span class="ruby-identifier">messages</span> = <span class="ruby-constant">LocalizationSimplified</span><span class="ruby-operator">::</span><span class="ruby-constant">DateHelper</span><span class="ruby-operator">::</span><span class="ruby-constant">Texts</span> <span class="ruby-comment cmt">#localized</span>
|
|
||||||
28: <span class="ruby-keyword kw">case</span> <span class="ruby-identifier">distance_in_minutes</span>
|
|
||||||
29: <span class="ruby-keyword kw">when</span> <span class="ruby-value">0</span><span class="ruby-operator">..</span><span class="ruby-value">1</span>
|
|
||||||
30: <span class="ruby-keyword kw">return</span> (<span class="ruby-identifier">distance_in_minutes</span><span class="ruby-operator">==</span><span class="ruby-value">0</span>) <span class="ruby-operator">?</span> <span class="ruby-identifier">messages</span>[<span class="ruby-identifier">:less_than_a_minute</span>] <span class="ruby-operator">:</span> <span class="ruby-identifier">messages</span>[<span class="ruby-identifier">:one_minute</span>] <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">include_seconds</span>
|
|
||||||
31: <span class="ruby-keyword kw">case</span> <span class="ruby-identifier">distance_in_seconds</span>
|
|
||||||
32: <span class="ruby-keyword kw">when</span> <span class="ruby-value">0</span><span class="ruby-operator">..</span><span class="ruby-value">5</span> <span class="ruby-keyword kw">then</span> <span class="ruby-identifier">format</span>( <span class="ruby-identifier">messages</span>[<span class="ruby-identifier">:less_than_x_seconds</span>], <span class="ruby-value">5</span> )
|
|
||||||
33: <span class="ruby-keyword kw">when</span> <span class="ruby-value">6</span><span class="ruby-operator">..</span><span class="ruby-value">10</span> <span class="ruby-keyword kw">then</span> <span class="ruby-identifier">format</span>( <span class="ruby-identifier">messages</span>[<span class="ruby-identifier">:less_than_x_seconds</span>], <span class="ruby-value">10</span> )
|
|
||||||
34: <span class="ruby-keyword kw">when</span> <span class="ruby-value">11</span><span class="ruby-operator">..</span><span class="ruby-value">20</span> <span class="ruby-keyword kw">then</span> <span class="ruby-identifier">format</span>( <span class="ruby-identifier">messages</span>[<span class="ruby-identifier">:less_than_x_seconds</span>], <span class="ruby-value">20</span> )
|
|
||||||
35: <span class="ruby-keyword kw">when</span> <span class="ruby-value">21</span><span class="ruby-operator">..</span><span class="ruby-value">40</span> <span class="ruby-keyword kw">then</span> <span class="ruby-identifier">messages</span>[<span class="ruby-identifier">:half_a_minute</span>]
|
|
||||||
36: <span class="ruby-keyword kw">when</span> <span class="ruby-value">41</span><span class="ruby-operator">..</span><span class="ruby-value">59</span> <span class="ruby-keyword kw">then</span> <span class="ruby-identifier">messages</span>[<span class="ruby-identifier">:less_than_a_minute</span>]
|
|
||||||
37: <span class="ruby-keyword kw">else</span> <span class="ruby-identifier">messages</span>[<span class="ruby-identifier">:one_minute</span>]
|
|
||||||
38: <span class="ruby-keyword kw">end</span>
|
|
||||||
39:
|
|
||||||
40: <span class="ruby-keyword kw">when</span> <span class="ruby-value">2</span><span class="ruby-operator">..</span><span class="ruby-value">45</span> <span class="ruby-keyword kw">then</span> <span class="ruby-identifier">format</span>(<span class="ruby-identifier">messages</span>[<span class="ruby-identifier">:x_minutes</span>], <span class="ruby-identifier">distance_in_minutes</span>)
|
|
||||||
41: <span class="ruby-keyword kw">when</span> <span class="ruby-value">46</span><span class="ruby-operator">..</span><span class="ruby-value">90</span> <span class="ruby-keyword kw">then</span> <span class="ruby-identifier">messages</span>[<span class="ruby-identifier">:one_hour</span>]
|
|
||||||
42: <span class="ruby-keyword kw">when</span> <span class="ruby-value">90</span><span class="ruby-operator">..</span><span class="ruby-value">1440</span> <span class="ruby-keyword kw">then</span> <span class="ruby-identifier">format</span>( <span class="ruby-identifier">messages</span>[<span class="ruby-identifier">:x_hours</span>], (<span class="ruby-identifier">distance_in_minutes</span>.<span class="ruby-identifier">to_f</span> <span class="ruby-operator">/</span> <span class="ruby-value">60.0</span>).<span class="ruby-identifier">round</span> )
|
|
||||||
43: <span class="ruby-keyword kw">when</span> <span class="ruby-value">1441</span><span class="ruby-operator">..</span><span class="ruby-value">2880</span> <span class="ruby-keyword kw">then</span> <span class="ruby-identifier">messages</span>[<span class="ruby-identifier">:one_day</span>]
|
|
||||||
44: <span class="ruby-keyword kw">else</span> <span class="ruby-identifier">format</span>( <span class="ruby-identifier">messages</span>[<span class="ruby-identifier">:x_days</span>], (<span class="ruby-identifier">distance_in_minutes</span> <span class="ruby-operator">/</span> <span class="ruby-value">1440</span>).<span class="ruby-identifier">round</span> )
|
|
||||||
45: <span class="ruby-keyword kw">end</span>
|
|
||||||
46: <span class="ruby-keyword kw">end</span>
|
|
||||||
</pre>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div id="method-M000009" class="method-detail">
|
|
||||||
<a name="M000009"></a>
|
|
||||||
|
|
||||||
<div class="method-heading">
|
|
||||||
<a href="#M000009" class="method-signature">
|
|
||||||
<span class="method-name">localize_strftime</span><span class="method-args">(date='%d.%m.%Y', time='')</span>
|
|
||||||
</a>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="method-description">
|
|
||||||
<p>
|
|
||||||
substitute all daynames and monthnames with localized names from RUtils
|
|
||||||
plugin
|
|
||||||
</p>
|
|
||||||
<p><a class="source-toggle" href="#"
|
|
||||||
onclick="toggleCode('M000009-source');return false;">[Source]</a></p>
|
|
||||||
<div class="method-source-code" id="M000009-source">
|
|
||||||
<pre>
|
|
||||||
<span class="ruby-comment cmt"># File lib/localization_simplified.rb, line 10</span>
|
|
||||||
10: <span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">localize_strftime</span>(<span class="ruby-identifier">date</span>=<span class="ruby-value str">'%d.%m.%Y'</span>, <span class="ruby-identifier">time</span>=<span class="ruby-value str">''</span>)
|
|
||||||
11: <span class="ruby-identifier">date</span>.<span class="ruby-identifier">gsub!</span>(<span class="ruby-regexp re">/%%/</span>, <span class="ruby-ivar">@@ignore</span>)
|
|
||||||
12: <span class="ruby-identifier">date</span>.<span class="ruby-identifier">gsub!</span>(<span class="ruby-regexp re">/%a/</span>, <span class="ruby-constant">LocalizationSimplified</span><span class="ruby-operator">::</span><span class="ruby-constant">DateHelper</span><span class="ruby-operator">::</span><span class="ruby-constant">AbbrDaynames</span>[<span class="ruby-identifier">time</span>.<span class="ruby-identifier">wday</span>])
|
|
||||||
13: <span class="ruby-identifier">date</span>.<span class="ruby-identifier">gsub!</span>(<span class="ruby-regexp re">/%A/</span>, <span class="ruby-constant">LocalizationSimplified</span><span class="ruby-operator">::</span><span class="ruby-constant">DateHelper</span><span class="ruby-operator">::</span><span class="ruby-constant">Daynames</span>[<span class="ruby-identifier">time</span>.<span class="ruby-identifier">wday</span>])
|
|
||||||
14: <span class="ruby-identifier">date</span>.<span class="ruby-identifier">gsub!</span>(<span class="ruby-regexp re">/%b/</span>, <span class="ruby-constant">LocalizationSimplified</span><span class="ruby-operator">::</span><span class="ruby-constant">DateHelper</span><span class="ruby-operator">::</span><span class="ruby-constant">AbbrMonthnames</span>[<span class="ruby-identifier">time</span>.<span class="ruby-identifier">mon</span>])
|
|
||||||
15: <span class="ruby-identifier">date</span>.<span class="ruby-identifier">gsub!</span>(<span class="ruby-regexp re">/%B/</span>, <span class="ruby-constant">LocalizationSimplified</span><span class="ruby-operator">::</span><span class="ruby-constant">DateHelper</span><span class="ruby-operator">::</span><span class="ruby-constant">Monthnames</span>[<span class="ruby-identifier">time</span>.<span class="ruby-identifier">mon</span>])
|
|
||||||
16: <span class="ruby-identifier">date</span>.<span class="ruby-identifier">gsub!</span>(<span class="ruby-ivar">@@ignore</span>, <span class="ruby-value str">'%%'</span>)
|
|
||||||
17: <span class="ruby-keyword kw">end</span>
|
|
||||||
</pre>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
<div id="validator-badges">
|
|
||||||
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</body>
|
|
||||||
</html>
|
|
|
@ -1,376 +0,0 @@
|
||||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
|
||||||
<!DOCTYPE html
|
|
||||||
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
|
||||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
|
||||||
|
|
||||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
|
||||||
<head>
|
|
||||||
<title>Class: LocalizationSimplified::ActiveRecord</title>
|
|
||||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
|
||||||
<meta http-equiv="Content-Script-Type" content="text/javascript" />
|
|
||||||
<link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
|
|
||||||
<script type="text/javascript">
|
|
||||||
// <![CDATA[
|
|
||||||
|
|
||||||
function popupCode( url ) {
|
|
||||||
window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
|
|
||||||
}
|
|
||||||
|
|
||||||
function toggleCode( id ) {
|
|
||||||
if ( document.getElementById )
|
|
||||||
elem = document.getElementById( id );
|
|
||||||
else if ( document.all )
|
|
||||||
elem = eval( "document.all." + id );
|
|
||||||
else
|
|
||||||
return false;
|
|
||||||
|
|
||||||
elemStyle = elem.style;
|
|
||||||
|
|
||||||
if ( elemStyle.display != "block" ) {
|
|
||||||
elemStyle.display = "block"
|
|
||||||
} else {
|
|
||||||
elemStyle.display = "none"
|
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Make codeblocks hidden by default
|
|
||||||
document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
|
|
||||||
|
|
||||||
// ]]>
|
|
||||||
</script>
|
|
||||||
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<div id="classHeader">
|
|
||||||
<table class="header-table">
|
|
||||||
<tr class="top-aligned-row">
|
|
||||||
<td><strong>Class</strong></td>
|
|
||||||
<td class="class-name-in-header">LocalizationSimplified::ActiveRecord</td>
|
|
||||||
</tr>
|
|
||||||
<tr class="top-aligned-row">
|
|
||||||
<td><strong>In:</strong></td>
|
|
||||||
<td>
|
|
||||||
<a href="../../files/lib/lang_cf_rb.html">
|
|
||||||
lib/lang_cf.rb
|
|
||||||
</a>
|
|
||||||
<br />
|
|
||||||
<a href="../../files/lib/lang_chef_rb.html">
|
|
||||||
lib/lang_chef.rb
|
|
||||||
</a>
|
|
||||||
<br />
|
|
||||||
<a href="../../files/lib/lang_da_rb.html">
|
|
||||||
lib/lang_da.rb
|
|
||||||
</a>
|
|
||||||
<br />
|
|
||||||
<a href="../../files/lib/lang_de_rb.html">
|
|
||||||
lib/lang_de.rb
|
|
||||||
</a>
|
|
||||||
<br />
|
|
||||||
<a href="../../files/lib/lang_en_rb.html">
|
|
||||||
lib/lang_en.rb
|
|
||||||
</a>
|
|
||||||
<br />
|
|
||||||
<a href="../../files/lib/lang_es_rb.html">
|
|
||||||
lib/lang_es.rb
|
|
||||||
</a>
|
|
||||||
<br />
|
|
||||||
<a href="../../files/lib/lang_fi_rb.html">
|
|
||||||
lib/lang_fi.rb
|
|
||||||
</a>
|
|
||||||
<br />
|
|
||||||
<a href="../../files/lib/lang_fr_rb.html">
|
|
||||||
lib/lang_fr.rb
|
|
||||||
</a>
|
|
||||||
<br />
|
|
||||||
<a href="../../files/lib/lang_fr__rb.html">
|
|
||||||
lib/lang_fr_.rb
|
|
||||||
</a>
|
|
||||||
<br />
|
|
||||||
<a href="../../files/lib/lang_nl_rb.html">
|
|
||||||
lib/lang_nl.rb
|
|
||||||
</a>
|
|
||||||
<br />
|
|
||||||
<a href="../../files/lib/lang_pirate_rb.html">
|
|
||||||
lib/lang_pirate.rb
|
|
||||||
</a>
|
|
||||||
<br />
|
|
||||||
<a href="../../files/lib/lang_se_rb.html">
|
|
||||||
lib/lang_se.rb
|
|
||||||
</a>
|
|
||||||
<br />
|
|
||||||
<a href="../../files/lib/lang_template_rb.html">
|
|
||||||
lib/lang_template.rb
|
|
||||||
</a>
|
|
||||||
<br />
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
|
|
||||||
<tr class="top-aligned-row">
|
|
||||||
<td><strong>Parent:</strong></td>
|
|
||||||
<td>
|
|
||||||
Object
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
</table>
|
|
||||||
</div>
|
|
||||||
<!-- banner header -->
|
|
||||||
|
|
||||||
<div id="bodyContent">
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<div id="contextContent">
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
<!-- if includes -->
|
|
||||||
|
|
||||||
<div id="section">
|
|
||||||
|
|
||||||
|
|
||||||
<div id="constants-list">
|
|
||||||
<h3 class="section-bar">Constants</h3>
|
|
||||||
|
|
||||||
<div class="name-list">
|
|
||||||
<table summary="Constants">
|
|
||||||
<tr class="top-aligned-row context-row">
|
|
||||||
<td class="context-item-name">ErrorMessages</td>
|
|
||||||
<td>=</td>
|
|
||||||
<td class="context-item-value">{ :inclusion => "n'est pas inclus dans la liste", :exclusion => "est réservé", :invalid => "est non valide", :confirmation => "ne correspond pas à la confirmation", :accepted => "doit être accepté", :empty => "ne peut pas être vide", :blank => "ne peut pas être laissé à blanc", :too_long => "dépasse la longueur permise (le maximum étant de %d caractères)", :too_short => "est trop court (le minimum étant de %d caractères)", :wrong_length => "n'est pas de la bonne longueur (doit être de %d caractères)", :taken => "as déjà été pris", :not_a_number => "n'est pas un nombre", #Jespers additions: :error_translation => "erreur", :error_header => "%s interdit d'enregistrer %s ", :error_subheader => "Il y a des erreurs dans les champs suivants : "</td>
|
|
||||||
<td width="3em"> </td>
|
|
||||||
<td class="context-item-desc">
|
|
||||||
ErrorMessages to override default messages in
|
|
||||||
+ActiveRecord::Errors::@@default_error_messages+ This plugin also replaces
|
|
||||||
hardcoded 3 text messages :error_translation is inflected using the Rails
|
|
||||||
inflector.
|
|
||||||
|
|
||||||
<p>
|
|
||||||
Remember to modify the Inflector with your localized translation of
|
|
||||||
"error" and "errors" in the bottom of this file
|
|
||||||
</p>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr class="top-aligned-row context-row">
|
|
||||||
<td class="context-item-name">ErrorMessages</td>
|
|
||||||
<td>=</td>
|
|
||||||
<td class="context-item-value">{ :inclusion => "is nut inclooded in zee leest", :exclusion => "is reserfed", :invalid => "is infeleed", :confirmation => "duesn't metch cunffurmeshun", :accepted => "moost be-a eccepted", :empty => "cun't be-a impty", :blank => "ees reeequired",# alternate, formulation: "is required" :too_long => "is tuu lung (mexeemoom is %d cherecters)", :too_short => "is tuu shurt (meenimoom is %d cherecters)", :wrong_length => "is zee vrung lengt (shuoold be-a %d cherecters)", :taken => "hes elreedy beee tekee", :not_a_number => "is nut a noomber", #Jespers additions: :error_translation => "irrur", :error_header => "%s pruheebited thees %s frum beeeng sefed", :error_subheader => "Zeere-a vere-a prublems veet zee fullooeeng feeelds:"</td>
|
|
||||||
<td width="3em"> </td>
|
|
||||||
<td class="context-item-desc">
|
|
||||||
ErrorMessages to override default messages in
|
|
||||||
+ActiveRecord::Errors::@@default_error_messages+ This plugin also replaces
|
|
||||||
hardcoded 3 text messages :error_translation is inflected using the Rails
|
|
||||||
inflector.
|
|
||||||
|
|
||||||
<p>
|
|
||||||
Remember to modify the Inflector with your localized translation of
|
|
||||||
"error" and "errors" in the bottom of this file
|
|
||||||
</p>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr class="top-aligned-row context-row">
|
|
||||||
<td class="context-item-name">ErrorMessages</td>
|
|
||||||
<td>=</td>
|
|
||||||
<td class="context-item-value">{ :inclusion => "er ikke med på listen", :exclusion => "er et reserveret ord", :invalid => "er ugyldig", :confirmation => "matcher ikke med bekræftelsen", :accepted => "skal accepteres", :empty => "kan ikke være tom", :blank => "skal udfyldes", :too_long => "er for langt (max er %d tegn)", :too_short => "er for kort (minimum er %d tegn)", :wrong_length => "har forkert længde (skal være %d tegn)", :taken => "er allerede taget", :not_a_number => "er ikke et tal", #Jespers additions: :error_translation => "fejl", :error_header => "%s forhindrede %s i at blive gemt", :error_subheader => "Problemer med følgende felter:"</td>
|
|
||||||
<td width="3em"> </td>
|
|
||||||
<td class="context-item-desc">
|
|
||||||
ErrorMessages to override default messages in
|
|
||||||
+ActiveRecord::Errors::@@default_error_messages+ This plugin also replaces
|
|
||||||
hardcoded 3 text messages :error_translation is inflected using the Rails
|
|
||||||
inflector.
|
|
||||||
|
|
||||||
<p>
|
|
||||||
Remember to modify the Inflector with your localized translation of
|
|
||||||
"error" and "errors" in the bottom of this file
|
|
||||||
</p>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr class="top-aligned-row context-row">
|
|
||||||
<td class="context-item-name">ErrorMessages</td>
|
|
||||||
<td>=</td>
|
|
||||||
<td class="context-item-value">{ :inclusion => "ist nicht in Liste gültiger Optionen enthalten", :exclusion => "ist reserviert", :invalid => "ist ungültig", :confirmation => "entspricht nicht der Best<73>tigung", :accepted => "muß akzeptiert werden", :empty => "darf nicht leer sein", :blank => "darf nicht leer sein",# alternate, formulation: "is required" :too_long => "ist zu lang (höchstens %d Zeichen)", :too_short => "ist zu kurz (mindestens %d Zeichen)", :wrong_length => "hat eine falsche Länge (es sollten %d Zeichen sein)", :taken => "ist schon vergeben", :not_a_number => "ist keine Zahl", #Jespers additions: :error_translation => "Fehl", :error_header => "%s verhinderte dieser %s gespeichert werden", :error_subheader => "Es gab probleme mit dem folgenden:"</td>
|
|
||||||
<td width="3em"> </td>
|
|
||||||
<td class="context-item-desc">
|
|
||||||
ErrorMessages to override default messages in
|
|
||||||
+ActiveRecord::Errors::@@default_error_messages+ This plugin also replaces
|
|
||||||
hardcoded 3 text messages :error_translation is inflected using the Rails
|
|
||||||
inflector.
|
|
||||||
|
|
||||||
<p>
|
|
||||||
Remember to modify the Inflector with your localized translation of
|
|
||||||
"error" and "errors" in the bottom of this file
|
|
||||||
</p>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr class="top-aligned-row context-row">
|
|
||||||
<td class="context-item-name">ErrorMessages</td>
|
|
||||||
<td>=</td>
|
|
||||||
<td class="context-item-value">{ :inclusion => "is not included in the list", :exclusion => "is reserved", :invalid => "is invalid", :confirmation => "doesn't match confirmation", :accepted => "must be accepted", :empty => "can't be empty", :blank => "can't be blank",# alternate, formulation: "is required" :too_long => "is too long (maximum is %d characters)", :too_short => "is too short (minimum is %d characters)", :wrong_length => "is the wrong length (should be %d characters)", :taken => "has already been taken", :not_a_number => "is not a number", #Jespers additions: :error_translation => "error", :error_header => "%s prohibited this %s from being saved", :error_subheader => "There were problems with the following fields:"</td>
|
|
||||||
<td width="3em"> </td>
|
|
||||||
<td class="context-item-desc">
|
|
||||||
ErrorMessages to override default messages in
|
|
||||||
+ActiveRecord::Errors::@@default_error_messages+ This plugin also replaces
|
|
||||||
hardcoded 3 text messages :error_translation is inflected using the Rails
|
|
||||||
inflector.
|
|
||||||
|
|
||||||
<p>
|
|
||||||
Remember to modify the Inflector with your localized translation of
|
|
||||||
"error" and "errors" in the bottom of this file
|
|
||||||
</p>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr class="top-aligned-row context-row">
|
|
||||||
<td class="context-item-name">ErrorMessages</td>
|
|
||||||
<td>=</td>
|
|
||||||
<td class="context-item-value">{ :inclusion => "no está incluido en la lista", :exclusion => "está reservado", :invalid => "no es válido", :confirmation => "no coincide con la conformación", :accepted => "debe ser aceptado", :empty => "no puede estar vacío", :blank => "no puede estar en blanco",# alternate, formulation: "is required" :too_long => "es demasiado largo (el máximo es %d caracteres)", :too_short => "es demasiado cordo (el minimo es %d caracteres)", :wrong_length => "is the wrong length (should be %d characters)", :taken => "ya está ocupado", :not_a_number => "no es un número", #Jespers additions: :error_translation => "error", :error_header => "%s no permite guardar %s", :error_subheader => "Ha habido problemas con los siguientes campos:"</td>
|
|
||||||
<td width="3em"> </td>
|
|
||||||
<td class="context-item-desc">
|
|
||||||
ErrorMessages to override default messages in
|
|
||||||
+ActiveRecord::Errors::@@default_error_messages+ This plugin also replaces
|
|
||||||
hardcoded 3 text messages :error_translation is inflected using the Rails
|
|
||||||
inflector.
|
|
||||||
|
|
||||||
<p>
|
|
||||||
Remember to modify the Inflector with your localized translation of
|
|
||||||
"error" and "errors" in the bottom of this file
|
|
||||||
</p>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr class="top-aligned-row context-row">
|
|
||||||
<td class="context-item-name">ErrorMessages</td>
|
|
||||||
<td>=</td>
|
|
||||||
<td class="context-item-value">{ :inclusion => "ei löydy listalta", :exclusion => "on varattu", :invalid => "on virheellinen", :confirmation => "ei vastaa vahvistusta", :accepted => "on hyväksyttävä", :empty => "ei voi olla tyhjä", :blank => "ei voi olla tyhjä", :too_long => "on liian pitkä (maksimi on %d merkkiä)", :too_short => "on liian lyhyt (minimi on %d merkkiä)", :wrong_length => "on väärän pituinen (oikea pituus %d merkkiä)", :taken => "on jo varattu", :not_a_number => "ei ole numero", #Jespers additions: :error_translation => "virhe", :error_header => "%s esti tämän %s tallentamisen", :error_subheader => "Seuraavat kentät aiheuttivat ongelmia:"</td>
|
|
||||||
<td width="3em"> </td>
|
|
||||||
<td class="context-item-desc">
|
|
||||||
ErrorMessages to override default messages in
|
|
||||||
+ActiveRecord::Errors::@@default_error_messages+ This plugin also replaces
|
|
||||||
hardcoded 3 text messages :error_translation is inflected using the Rails
|
|
||||||
inflector.
|
|
||||||
|
|
||||||
<p>
|
|
||||||
Remember to modify the Inflector with your localized translation of
|
|
||||||
"error" and "errors" in the bottom of this file
|
|
||||||
</p>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr class="top-aligned-row context-row">
|
|
||||||
<td class="context-item-name">ErrorMessages</td>
|
|
||||||
<td>=</td>
|
|
||||||
<td class="context-item-value">{ :inclusion => "n'est pas inclut dans la liste", :exclusion => "est réservé", :invalid => "est invalide", :confirmation => "ne correspond pas à la confirmation", :accepted => "doit être accepté", :empty => "ne peut pas être vide", :blank => "ne peut pas être vierge",# alternate, formulation: "is required" :too_long => "est trop long (%d caractères maximum)", :too_short => "est trop court(%d caractères minimum)", :wrong_length => "n'est pas de la bonne longueur (devrait être de %d caractères)", :taken => "est déjà prit", :not_a_number => "n'est pas le nombre", #Jespers additions: :error_translation => "erreur", :error_header => "%s interdit ce %s d'être sauvegardé", :error_subheader => "Il y a des problèmes avec les champs suivants :"</td>
|
|
||||||
<td width="3em"> </td>
|
|
||||||
<td class="context-item-desc">
|
|
||||||
ErrorMessages to override default messages in
|
|
||||||
+ActiveRecord::Errors::@@default_error_messages+ This plugin also replaces
|
|
||||||
hardcoded 3 text messages :error_translation is inflected using the Rails
|
|
||||||
inflector.
|
|
||||||
|
|
||||||
<p>
|
|
||||||
Remember to modify the Inflector with your localized translation of
|
|
||||||
"error" and "errors" in the bottom of this file
|
|
||||||
</p>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr class="top-aligned-row context-row">
|
|
||||||
<td class="context-item-name">ErrorMessages</td>
|
|
||||||
<td>=</td>
|
|
||||||
<td class="context-item-value">{ :inclusion => "n'est pas inclus dans la liste", :exclusion => "est réservé", :invalid => "est non valide", :confirmation => "ne correspond pas à la confirmation", :accepted => "doit être accepté", :empty => "ne peut pas être vide", :blank => "ne peut pas être laissé à blanc", :too_long => "dépasse la longueur permise (le maximum étant de %d caractères)", :too_short => "est trop court (le minimum étant de %d caractères)", :wrong_length => "n'est pas de la bonne longueur (doit être de %d caractères)", :taken => "as déjà été pris", :not_a_number => "n'est pas un nombre", #Jespers additions: :error_translation => "erreur", :error_header => "%s interdit d'enregistrer %s ", :error_subheader => "Il y a des erreurs dans les champs suivants : "</td>
|
|
||||||
</tr>
|
|
||||||
<tr class="top-aligned-row context-row">
|
|
||||||
<td class="context-item-name">ErrorMessages</td>
|
|
||||||
<td>=</td>
|
|
||||||
<td class="context-item-value">{ :inclusion => "zit niet in de lijst", :exclusion => "is gereserveerd", :invalid => "is ongeldig", :confirmation => "is niet hetzelfde als de verificatie", :accepted => "moet worden geaccepteerd", :empty => "mag niet leeg zijn", :blank => "mag niet blanko zijn",# alternate, formulation: "is required" :too_long => "is te land (maximum is %d karakters)", :too_short => "is te kort (minimum is %d karakters)", :wrong_length => "is de verkeerde lengte (dient %d karakters te zijn)", :taken => "is reeds in gebruik", :not_a_number => "is geen nummer", #Jespers additions: :error_translation => "fout", :error_header => "%s zorgen ervoor dat %s niet kan worden opgeslagen", :error_subheader => "Er zijn problemen met de volgende velden:"</td>
|
|
||||||
<td width="3em"> </td>
|
|
||||||
<td class="context-item-desc">
|
|
||||||
ErrorMessages to override default messages in
|
|
||||||
+ActiveRecord::Errors::@@default_error_messages+ This plugin also replaces
|
|
||||||
hardcoded 3 text messages :error_translation is inflected using the Rails
|
|
||||||
inflector.
|
|
||||||
|
|
||||||
<p>
|
|
||||||
Remember to modify the Inflector with your localized translation of
|
|
||||||
"error" and "errors" in the bottom of this file
|
|
||||||
</p>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr class="top-aligned-row context-row">
|
|
||||||
<td class="context-item-name">ErrorMessages</td>
|
|
||||||
<td>=</td>
|
|
||||||
<td class="context-item-value">{ :inclusion => "be not included in the list, me hearty", :exclusion => "be reserrrrved", :invalid => "be innvalid, m hearty", :confirmation => "doesn't match confirmation", :accepted => "must be accepted, arrrrh!", :empty => "no nay ne'er be empty", :blank => "no nay be blank, ye scurvy dog!",# alternate, formulation: "is required" :too_long => "be too vastly in length (no more than %d characters or ye drivin' me nuts)", :too_short => "be way too short (at least %d characters or ye drivin' me nuts)", :wrong_length => "be the wrong length (should be %d characters)", :taken => "has already been taken", :not_a_number => "be not a number, matey", #Jespers additions: :error_translation => "errrorrr", :error_header => "Ohoy! %s prohibited ye %s from bein' saved", :error_subheader => "Turn the steering wheeel and corrrect these fields, arrrrh."</td>
|
|
||||||
<td width="3em"> </td>
|
|
||||||
<td class="context-item-desc">
|
|
||||||
ErrorMessages to override default messages in
|
|
||||||
+ActiveRecord::Errors::@@default_error_messages+ This plugin also replaces
|
|
||||||
hardcoded 3 text messages :error_translation is inflected using the Rails
|
|
||||||
inflector.
|
|
||||||
|
|
||||||
<p>
|
|
||||||
Remember to modify the Inflector with your localized translation of
|
|
||||||
"error" and "errors" in the bottom of this file
|
|
||||||
</p>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr class="top-aligned-row context-row">
|
|
||||||
<td class="context-item-name">ErrorMessages</td>
|
|
||||||
<td>=</td>
|
|
||||||
<td class="context-item-value">{ :inclusion => "finns inte i listan", :exclusion => "Är reserverat", :invalid => "Är ogiltigt", :confirmation => "stämmer inte övererens", :accepted => "måste vara accepterad", :empty => "för ej vara tom", :blank => "för ej vara blank", :too_long => "Är för lång (maximum är %d tecken)", :too_short => "Är för kort (minimum är %d tecken)", :wrong_length => "har fel längd (ska vara %d tecken)", :taken => "har redan tagits", :not_a_number => "Är ej ett nummer", #Jespers additions: :error_translation => "fel", :error_header => "%s förhindrade %s från at sparse", :error_subheader => "Problemar met dissa felterne:"</td>
|
|
||||||
<td width="3em"> </td>
|
|
||||||
<td class="context-item-desc">
|
|
||||||
ErrorMessages to override default messages in
|
|
||||||
+ActiveRecord::Errors::@@default_error_messages+ This plugin also replaces
|
|
||||||
hardcoded 3 text messages :error_translation is inflected using the Rails
|
|
||||||
inflector.
|
|
||||||
|
|
||||||
<p>
|
|
||||||
Remember to modify the Inflector with your localized translation of
|
|
||||||
"error" and "errors" in the bottom of this file
|
|
||||||
</p>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr class="top-aligned-row context-row">
|
|
||||||
<td class="context-item-name">ErrorMessages</td>
|
|
||||||
<td>=</td>
|
|
||||||
<td class="context-item-value">{ :inclusion => "is not included in the list", :exclusion => "is reserved", :invalid => "is invalid", :confirmation => "doesn't match confirmation", :accepted => "must be accepted", :empty => "can't be empty", :blank => "can't be blank",# alternate, formulation: "is required" :too_long => "is too long (maximum is %d characters)", :too_short => "is too short (minimum is %d characters)", :wrong_length => "is the wrong length (should be %d characters)", :taken => "has already been taken", :not_a_number => "is not a number", #Jespers additions: :error_translation => "error", :error_header => "%s prohibited this %s from being saved", :error_subheader => "There were problems with the following fields:"</td>
|
|
||||||
<td width="3em"> </td>
|
|
||||||
<td class="context-item-desc">
|
|
||||||
ErrorMessages to override default messages in
|
|
||||||
+ActiveRecord::Errors::@@default_error_messages+ This plugin also replaces
|
|
||||||
hardcoded 3 text messages :error_translation is inflected using the Rails
|
|
||||||
inflector.
|
|
||||||
|
|
||||||
<p>
|
|
||||||
Remember to modify the Inflector with your localized translation of
|
|
||||||
"error" and "errors" in the bottom of this file
|
|
||||||
</p>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
</table>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<!-- if method_list -->
|
|
||||||
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
<div id="validator-badges">
|
|
||||||
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</body>
|
|
||||||
</html>
|
|
|
@ -1,304 +0,0 @@
|
||||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
|
||||||
<!DOCTYPE html
|
|
||||||
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
|
||||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
|
||||||
|
|
||||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
|
||||||
<head>
|
|
||||||
<title>Class: LocalizationSimplified::ArrayHelper</title>
|
|
||||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
|
||||||
<meta http-equiv="Content-Script-Type" content="text/javascript" />
|
|
||||||
<link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
|
|
||||||
<script type="text/javascript">
|
|
||||||
// <![CDATA[
|
|
||||||
|
|
||||||
function popupCode( url ) {
|
|
||||||
window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
|
|
||||||
}
|
|
||||||
|
|
||||||
function toggleCode( id ) {
|
|
||||||
if ( document.getElementById )
|
|
||||||
elem = document.getElementById( id );
|
|
||||||
else if ( document.all )
|
|
||||||
elem = eval( "document.all." + id );
|
|
||||||
else
|
|
||||||
return false;
|
|
||||||
|
|
||||||
elemStyle = elem.style;
|
|
||||||
|
|
||||||
if ( elemStyle.display != "block" ) {
|
|
||||||
elemStyle.display = "block"
|
|
||||||
} else {
|
|
||||||
elemStyle.display = "none"
|
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Make codeblocks hidden by default
|
|
||||||
document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
|
|
||||||
|
|
||||||
// ]]>
|
|
||||||
</script>
|
|
||||||
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<div id="classHeader">
|
|
||||||
<table class="header-table">
|
|
||||||
<tr class="top-aligned-row">
|
|
||||||
<td><strong>Class</strong></td>
|
|
||||||
<td class="class-name-in-header">LocalizationSimplified::ArrayHelper</td>
|
|
||||||
</tr>
|
|
||||||
<tr class="top-aligned-row">
|
|
||||||
<td><strong>In:</strong></td>
|
|
||||||
<td>
|
|
||||||
<a href="../../files/lib/lang_cf_rb.html">
|
|
||||||
lib/lang_cf.rb
|
|
||||||
</a>
|
|
||||||
<br />
|
|
||||||
<a href="../../files/lib/lang_chef_rb.html">
|
|
||||||
lib/lang_chef.rb
|
|
||||||
</a>
|
|
||||||
<br />
|
|
||||||
<a href="../../files/lib/lang_da_rb.html">
|
|
||||||
lib/lang_da.rb
|
|
||||||
</a>
|
|
||||||
<br />
|
|
||||||
<a href="../../files/lib/lang_de_rb.html">
|
|
||||||
lib/lang_de.rb
|
|
||||||
</a>
|
|
||||||
<br />
|
|
||||||
<a href="../../files/lib/lang_en_rb.html">
|
|
||||||
lib/lang_en.rb
|
|
||||||
</a>
|
|
||||||
<br />
|
|
||||||
<a href="../../files/lib/lang_es_rb.html">
|
|
||||||
lib/lang_es.rb
|
|
||||||
</a>
|
|
||||||
<br />
|
|
||||||
<a href="../../files/lib/lang_fi_rb.html">
|
|
||||||
lib/lang_fi.rb
|
|
||||||
</a>
|
|
||||||
<br />
|
|
||||||
<a href="../../files/lib/lang_fr_rb.html">
|
|
||||||
lib/lang_fr.rb
|
|
||||||
</a>
|
|
||||||
<br />
|
|
||||||
<a href="../../files/lib/lang_fr__rb.html">
|
|
||||||
lib/lang_fr_.rb
|
|
||||||
</a>
|
|
||||||
<br />
|
|
||||||
<a href="../../files/lib/lang_nl_rb.html">
|
|
||||||
lib/lang_nl.rb
|
|
||||||
</a>
|
|
||||||
<br />
|
|
||||||
<a href="../../files/lib/lang_pirate_rb.html">
|
|
||||||
lib/lang_pirate.rb
|
|
||||||
</a>
|
|
||||||
<br />
|
|
||||||
<a href="../../files/lib/lang_se_rb.html">
|
|
||||||
lib/lang_se.rb
|
|
||||||
</a>
|
|
||||||
<br />
|
|
||||||
<a href="../../files/lib/lang_template_rb.html">
|
|
||||||
lib/lang_template.rb
|
|
||||||
</a>
|
|
||||||
<br />
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
|
|
||||||
<tr class="top-aligned-row">
|
|
||||||
<td><strong>Parent:</strong></td>
|
|
||||||
<td>
|
|
||||||
Object
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
</table>
|
|
||||||
</div>
|
|
||||||
<!-- banner header -->
|
|
||||||
|
|
||||||
<div id="bodyContent">
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<div id="contextContent">
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
<!-- if includes -->
|
|
||||||
|
|
||||||
<div id="section">
|
|
||||||
|
|
||||||
|
|
||||||
<div id="constants-list">
|
|
||||||
<h3 class="section-bar">Constants</h3>
|
|
||||||
|
|
||||||
<div class="name-list">
|
|
||||||
<table summary="Constants">
|
|
||||||
<tr class="top-aligned-row context-row">
|
|
||||||
<td class="context-item-name">ToSentenceTexts</td>
|
|
||||||
<td>=</td>
|
|
||||||
<td class="context-item-value">{ :connector => 'et', :skip_last_comma => false</td>
|
|
||||||
<td width="3em"> </td>
|
|
||||||
<td class="context-item-desc">
|
|
||||||
Modifies +<a href="../Array.html#M000002">Array#to_sentence</a>()+ <a
|
|
||||||
href="http://api.rubyonrails.org/classes/ActiveSupport/CoreExtensions/Array/Conversions.html#M000274">api.rubyonrails.org/classes/ActiveSupport/CoreExtensions/Array/Conversions.html#M000274</a>
|
|
||||||
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr class="top-aligned-row context-row">
|
|
||||||
<td class="context-item-name">ToSentenceTexts</td>
|
|
||||||
<td>=</td>
|
|
||||||
<td class="context-item-value">{ :connector => 'eend', :skip_last_comma => false</td>
|
|
||||||
<td width="3em"> </td>
|
|
||||||
<td class="context-item-desc">
|
|
||||||
Modifies +<a href="../Array.html#M000002">Array#to_sentence</a>()+ <a
|
|
||||||
href="http://api.rubyonrails.org/classes/ActiveSupport/CoreExtensions/Array/Conversions.html#M000274">api.rubyonrails.org/classes/ActiveSupport/CoreExtensions/Array/Conversions.html#M000274</a>
|
|
||||||
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr class="top-aligned-row context-row">
|
|
||||||
<td class="context-item-name">ToSentenceTexts</td>
|
|
||||||
<td>=</td>
|
|
||||||
<td class="context-item-value">{ :connector => 'og', :skip_last_comma => true</td>
|
|
||||||
<td width="3em"> </td>
|
|
||||||
<td class="context-item-desc">
|
|
||||||
Modifies +<a href="../Array.html#M000002">Array#to_sentence</a>()+ <a
|
|
||||||
href="http://api.rubyonrails.org/classes/ActiveSupport/CoreExtensions/Array/Conversions.html#M000274">api.rubyonrails.org/classes/ActiveSupport/CoreExtensions/Array/Conversions.html#M000274</a>
|
|
||||||
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr class="top-aligned-row context-row">
|
|
||||||
<td class="context-item-name">ToSentenceTexts</td>
|
|
||||||
<td>=</td>
|
|
||||||
<td class="context-item-value">{ :connector => 'und', :skip_last_comma => true</td>
|
|
||||||
<td width="3em"> </td>
|
|
||||||
<td class="context-item-desc">
|
|
||||||
Modifies +<a href="../Array.html#M000002">Array#to_sentence</a>()+ <a
|
|
||||||
href="http://api.rubyonrails.org/classes/ActiveSupport/CoreExtensions/Array/Conversions.html#M000274">api.rubyonrails.org/classes/ActiveSupport/CoreExtensions/Array/Conversions.html#M000274</a>
|
|
||||||
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr class="top-aligned-row context-row">
|
|
||||||
<td class="context-item-name">ToSentenceTexts</td>
|
|
||||||
<td>=</td>
|
|
||||||
<td class="context-item-value">{ :connector => 'and', :skip_last_comma => false</td>
|
|
||||||
<td width="3em"> </td>
|
|
||||||
<td class="context-item-desc">
|
|
||||||
Modifies +<a href="../Array.html#M000002">Array#to_sentence</a>()+ <a
|
|
||||||
href="http://api.rubyonrails.org/classes/ActiveSupport/CoreExtensions/Array/Conversions.html#M000274">api.rubyonrails.org/classes/ActiveSupport/CoreExtensions/Array/Conversions.html#M000274</a>
|
|
||||||
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr class="top-aligned-row context-row">
|
|
||||||
<td class="context-item-name">ToSentenceTexts</td>
|
|
||||||
<td>=</td>
|
|
||||||
<td class="context-item-value">{ :connector => 'y', :skip_last_comma => true</td>
|
|
||||||
<td width="3em"> </td>
|
|
||||||
<td class="context-item-desc">
|
|
||||||
Modifies +<a href="../Array.html#M000002">Array#to_sentence</a>()+ <a
|
|
||||||
href="http://api.rubyonrails.org/classes/ActiveSupport/CoreExtensions/Array/Conversions.html#M000274">api.rubyonrails.org/classes/ActiveSupport/CoreExtensions/Array/Conversions.html#M000274</a>
|
|
||||||
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr class="top-aligned-row context-row">
|
|
||||||
<td class="context-item-name">ToSentenceTexts</td>
|
|
||||||
<td>=</td>
|
|
||||||
<td class="context-item-value">{ :connector => 'ja', :skip_last_comma => true</td>
|
|
||||||
<td width="3em"> </td>
|
|
||||||
<td class="context-item-desc">
|
|
||||||
Modifies +<a href="../Array.html#M000002">Array#to_sentence</a>()+ <a
|
|
||||||
href="http://api.rubyonrails.org/classes/ActiveSupport/CoreExtensions/Array/Conversions.html#M000274">api.rubyonrails.org/classes/ActiveSupport/CoreExtensions/Array/Conversions.html#M000274</a>
|
|
||||||
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr class="top-aligned-row context-row">
|
|
||||||
<td class="context-item-name">ToSentenceTexts</td>
|
|
||||||
<td>=</td>
|
|
||||||
<td class="context-item-value">{ :connector => 'et', :skip_last_comma => false</td>
|
|
||||||
<td width="3em"> </td>
|
|
||||||
<td class="context-item-desc">
|
|
||||||
Modifies +<a href="../Array.html#M000002">Array#to_sentence</a>()+ <a
|
|
||||||
href="http://api.rubyonrails.org/classes/ActiveSupport/CoreExtensions/Array/Conversions.html#M000274">api.rubyonrails.org/classes/ActiveSupport/CoreExtensions/Array/Conversions.html#M000274</a>
|
|
||||||
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr class="top-aligned-row context-row">
|
|
||||||
<td class="context-item-name">ToSentenceTexts</td>
|
|
||||||
<td>=</td>
|
|
||||||
<td class="context-item-value">{ :connector => 'et', :skip_last_comma => false</td>
|
|
||||||
</tr>
|
|
||||||
<tr class="top-aligned-row context-row">
|
|
||||||
<td class="context-item-name">ToSentenceTexts</td>
|
|
||||||
<td>=</td>
|
|
||||||
<td class="context-item-value">{ :connector => 'en', :skip_last_comma => false</td>
|
|
||||||
<td width="3em"> </td>
|
|
||||||
<td class="context-item-desc">
|
|
||||||
Modifies +<a href="../Array.html#M000002">Array#to_sentence</a>()+ <a
|
|
||||||
href="http://api.rubyonrails.org/classes/ActiveSupport/CoreExtensions/Array/Conversions.html#M000274">api.rubyonrails.org/classes/ActiveSupport/CoreExtensions/Array/Conversions.html#M000274</a>
|
|
||||||
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr class="top-aligned-row context-row">
|
|
||||||
<td class="context-item-name">ToSentenceTexts</td>
|
|
||||||
<td>=</td>
|
|
||||||
<td class="context-item-value">{ :connector => 'and', :skip_last_comma => false</td>
|
|
||||||
<td width="3em"> </td>
|
|
||||||
<td class="context-item-desc">
|
|
||||||
Modifies +<a href="../Array.html#M000002">Array#to_sentence</a>()+ <a
|
|
||||||
href="http://api.rubyonrails.org/classes/ActiveSupport/CoreExtensions/Array/Conversions.html#M000274">api.rubyonrails.org/classes/ActiveSupport/CoreExtensions/Array/Conversions.html#M000274</a>
|
|
||||||
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr class="top-aligned-row context-row">
|
|
||||||
<td class="context-item-name">ToSentenceTexts</td>
|
|
||||||
<td>=</td>
|
|
||||||
<td class="context-item-value">{ :connector => 'och', :skip_last_comma => true</td>
|
|
||||||
<td width="3em"> </td>
|
|
||||||
<td class="context-item-desc">
|
|
||||||
Modifies +<a href="../Array.html#M000002">Array#to_sentence</a>()+ <a
|
|
||||||
href="http://api.rubyonrails.org/classes/ActiveSupport/CoreExtensions/Array/Conversions.html#M000274">api.rubyonrails.org/classes/ActiveSupport/CoreExtensions/Array/Conversions.html#M000274</a>
|
|
||||||
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr class="top-aligned-row context-row">
|
|
||||||
<td class="context-item-name">ToSentenceTexts</td>
|
|
||||||
<td>=</td>
|
|
||||||
<td class="context-item-value">{ :connector => 'and', :skip_last_comma => false</td>
|
|
||||||
<td width="3em"> </td>
|
|
||||||
<td class="context-item-desc">
|
|
||||||
Modifies +<a href="../Array.html#M000002">Array#to_sentence</a>()+ <a
|
|
||||||
href="http://api.rubyonrails.org/classes/ActiveSupport/CoreExtensions/Array/Conversions.html#M000274">api.rubyonrails.org/classes/ActiveSupport/CoreExtensions/Array/Conversions.html#M000274</a>
|
|
||||||
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
</table>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<!-- if method_list -->
|
|
||||||
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
<div id="validator-badges">
|
|
||||||
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</body>
|
|
||||||
</html>
|
|
|
@ -1,969 +0,0 @@
|
||||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
|
||||||
<!DOCTYPE html
|
|
||||||
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
|
||||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
|
||||||
|
|
||||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
|
||||||
<head>
|
|
||||||
<title>Class: LocalizationSimplified::DateHelper</title>
|
|
||||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
|
||||||
<meta http-equiv="Content-Script-Type" content="text/javascript" />
|
|
||||||
<link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
|
|
||||||
<script type="text/javascript">
|
|
||||||
// <![CDATA[
|
|
||||||
|
|
||||||
function popupCode( url ) {
|
|
||||||
window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
|
|
||||||
}
|
|
||||||
|
|
||||||
function toggleCode( id ) {
|
|
||||||
if ( document.getElementById )
|
|
||||||
elem = document.getElementById( id );
|
|
||||||
else if ( document.all )
|
|
||||||
elem = eval( "document.all." + id );
|
|
||||||
else
|
|
||||||
return false;
|
|
||||||
|
|
||||||
elemStyle = elem.style;
|
|
||||||
|
|
||||||
if ( elemStyle.display != "block" ) {
|
|
||||||
elemStyle.display = "block"
|
|
||||||
} else {
|
|
||||||
elemStyle.display = "none"
|
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Make codeblocks hidden by default
|
|
||||||
document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
|
|
||||||
|
|
||||||
// ]]>
|
|
||||||
</script>
|
|
||||||
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<div id="classHeader">
|
|
||||||
<table class="header-table">
|
|
||||||
<tr class="top-aligned-row">
|
|
||||||
<td><strong>Class</strong></td>
|
|
||||||
<td class="class-name-in-header">LocalizationSimplified::DateHelper</td>
|
|
||||||
</tr>
|
|
||||||
<tr class="top-aligned-row">
|
|
||||||
<td><strong>In:</strong></td>
|
|
||||||
<td>
|
|
||||||
<a href="../../files/lib/lang_cf_rb.html">
|
|
||||||
lib/lang_cf.rb
|
|
||||||
</a>
|
|
||||||
<br />
|
|
||||||
<a href="../../files/lib/lang_chef_rb.html">
|
|
||||||
lib/lang_chef.rb
|
|
||||||
</a>
|
|
||||||
<br />
|
|
||||||
<a href="../../files/lib/lang_da_rb.html">
|
|
||||||
lib/lang_da.rb
|
|
||||||
</a>
|
|
||||||
<br />
|
|
||||||
<a href="../../files/lib/lang_de_rb.html">
|
|
||||||
lib/lang_de.rb
|
|
||||||
</a>
|
|
||||||
<br />
|
|
||||||
<a href="../../files/lib/lang_en_rb.html">
|
|
||||||
lib/lang_en.rb
|
|
||||||
</a>
|
|
||||||
<br />
|
|
||||||
<a href="../../files/lib/lang_es_rb.html">
|
|
||||||
lib/lang_es.rb
|
|
||||||
</a>
|
|
||||||
<br />
|
|
||||||
<a href="../../files/lib/lang_fi_rb.html">
|
|
||||||
lib/lang_fi.rb
|
|
||||||
</a>
|
|
||||||
<br />
|
|
||||||
<a href="../../files/lib/lang_fr_rb.html">
|
|
||||||
lib/lang_fr.rb
|
|
||||||
</a>
|
|
||||||
<br />
|
|
||||||
<a href="../../files/lib/lang_fr__rb.html">
|
|
||||||
lib/lang_fr_.rb
|
|
||||||
</a>
|
|
||||||
<br />
|
|
||||||
<a href="../../files/lib/lang_nl_rb.html">
|
|
||||||
lib/lang_nl.rb
|
|
||||||
</a>
|
|
||||||
<br />
|
|
||||||
<a href="../../files/lib/lang_pirate_rb.html">
|
|
||||||
lib/lang_pirate.rb
|
|
||||||
</a>
|
|
||||||
<br />
|
|
||||||
<a href="../../files/lib/lang_se_rb.html">
|
|
||||||
lib/lang_se.rb
|
|
||||||
</a>
|
|
||||||
<br />
|
|
||||||
<a href="../../files/lib/lang_template_rb.html">
|
|
||||||
lib/lang_template.rb
|
|
||||||
</a>
|
|
||||||
<br />
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
|
|
||||||
<tr class="top-aligned-row">
|
|
||||||
<td><strong>Parent:</strong></td>
|
|
||||||
<td>
|
|
||||||
Object
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
</table>
|
|
||||||
</div>
|
|
||||||
<!-- banner header -->
|
|
||||||
|
|
||||||
<div id="bodyContent">
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<div id="contextContent">
|
|
||||||
|
|
||||||
<div id="description">
|
|
||||||
<p>
|
|
||||||
Texts to override +distance_of_time_in_words()+
|
|
||||||
</p>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
<!-- if includes -->
|
|
||||||
|
|
||||||
<div id="section">
|
|
||||||
|
|
||||||
|
|
||||||
<div id="constants-list">
|
|
||||||
<h3 class="section-bar">Constants</h3>
|
|
||||||
|
|
||||||
<div class="name-list">
|
|
||||||
<table summary="Constants">
|
|
||||||
<tr class="top-aligned-row context-row">
|
|
||||||
<td class="context-item-name">Texts</td>
|
|
||||||
<td>=</td>
|
|
||||||
<td class="context-item-value">{ :less_than_x_seconds => "moins de %d secondes", :half_a_minute => "30 secondes", :less_than_a_minute => "moins d'une minute", :one_minute => "1 minute", :x_minutes => "%d minutes", :one_hour => "environ 1 heure", :x_hours => "environ %d heures", :one_day => "1 jour", :x_days => "%d jours"</td>
|
|
||||||
</tr>
|
|
||||||
<tr class="top-aligned-row context-row">
|
|
||||||
<td class="context-item-name">Monthnames</td>
|
|
||||||
<td>=</td>
|
|
||||||
<td class="context-item-value">[nil] + %w{Janvier Février Mars Avril Mai Juin Juillet Août Septembre Octobre Novembre Décembre}</td>
|
|
||||||
<td width="3em"> </td>
|
|
||||||
<td class="context-item-desc">
|
|
||||||
Rails uses Month names in <a href="../Date.html">Date</a> and time select
|
|
||||||
boxes (<tt>date_select</tt> and <tt>datetime_select</tt> ) Currently (as of
|
|
||||||
version 1.1.6), Rails doesn’t use daynames
|
|
||||||
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr class="top-aligned-row context-row">
|
|
||||||
<td class="context-item-name">AbbrMonthnames</td>
|
|
||||||
<td>=</td>
|
|
||||||
<td class="context-item-value">[nil] + %w{Jan Fev Mar Avr Mai Jun Jui Aou Sep Oct Nov Dec}</td>
|
|
||||||
</tr>
|
|
||||||
<tr class="top-aligned-row context-row">
|
|
||||||
<td class="context-item-name">Daynames</td>
|
|
||||||
<td>=</td>
|
|
||||||
<td class="context-item-value">%w{Dimanche Lundi Mardi Mercredi Jeudi Vendredi Samedi}</td>
|
|
||||||
</tr>
|
|
||||||
<tr class="top-aligned-row context-row">
|
|
||||||
<td class="context-item-name">AbbrDaynames</td>
|
|
||||||
<td>=</td>
|
|
||||||
<td class="context-item-value">%w{Dim Lun Mar Mer Jeu Ven Sam}</td>
|
|
||||||
</tr>
|
|
||||||
<tr class="top-aligned-row context-row">
|
|
||||||
<td class="context-item-name">DateFormats</td>
|
|
||||||
<td>=</td>
|
|
||||||
<td class="context-item-value">{ :default => "%Y-%m-%d", :short => "%b %e", :long => "%B %e, %Y"</td>
|
|
||||||
<td width="3em"> </td>
|
|
||||||
<td class="context-item-desc">
|
|
||||||
<a href="../Date.html">Date</a> and time format syntax explained in <a
|
|
||||||
href="http://www.rubycentral.com/ref/ref_c_time.html#strftime">www.rubycentral.com/ref/ref_c_time.html#strftime</a>
|
|
||||||
These are sent to strftime that Ruby’s date and time handlers use
|
|
||||||
internally Same options as php (that has a better list: <a
|
|
||||||
href="http://www.php.net/strftime">www.php.net/strftime</a> )
|
|
||||||
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr class="top-aligned-row context-row">
|
|
||||||
<td class="context-item-name">TimeFormats</td>
|
|
||||||
<td>=</td>
|
|
||||||
<td class="context-item-value">{ :default => "%a, %d %b %Y %H:%M:%S %z", :short => "%d %b %H:%M", :long => "%B %d, %Y %H:%M"</td>
|
|
||||||
</tr>
|
|
||||||
<tr class="top-aligned-row context-row">
|
|
||||||
<td class="context-item-name">DateSelectOrder</td>
|
|
||||||
<td>=</td>
|
|
||||||
<td class="context-item-value">{ :order => [:year, :month, :day]</td>
|
|
||||||
<td width="3em"> </td>
|
|
||||||
<td class="context-item-desc">
|
|
||||||
Set the order of <tt>date_select</tt> and <tt>datetime_select</tt> boxes
|
|
||||||
Note that at present, the current Rails version only supports ordering of
|
|
||||||
date_select boxes
|
|
||||||
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr class="top-aligned-row context-row">
|
|
||||||
<td class="context-item-name">Texts</td>
|
|
||||||
<td>=</td>
|
|
||||||
<td class="context-item-value">{ :less_than_x_seconds => "less thun %d secunds", :half_a_minute => "helff a meenoote-a", :less_than_a_minute => "less thun a meenoote-a", :one_minute => "1 meenoote-a", :x_minutes => "%d meenootes", :one_hour => "ebuoot 1 huoor", :x_hours => "ebuoot %d huoors", :one_day => "1 dey", :x_days => "%d deys"</td>
|
|
||||||
</tr>
|
|
||||||
<tr class="top-aligned-row context-row">
|
|
||||||
<td class="context-item-name">Monthnames</td>
|
|
||||||
<td>=</td>
|
|
||||||
<td class="context-item-value">[nil] + %w{Junooery Febrooery Merch Epreel Mey Joone-a Jooly Oogoost Seeptembooor Ooctuber Nufember Deezember}</td>
|
|
||||||
<td width="3em"> </td>
|
|
||||||
<td class="context-item-desc">
|
|
||||||
Rails uses Month names in <a href="../Date.html">Date</a> and time select
|
|
||||||
boxes (<tt>date_select</tt> and <tt>datetime_select</tt> ) Currently (as of
|
|
||||||
version 1.1.6), Rails doesn’t use daynames
|
|
||||||
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr class="top-aligned-row context-row">
|
|
||||||
<td class="context-item-name">AbbrMonthnames</td>
|
|
||||||
<td>=</td>
|
|
||||||
<td class="context-item-value">[nil] + %w{Jun Feb Mer Epr Mey Joon Jool Oog Sep Ooct Nuf Deez}</td>
|
|
||||||
</tr>
|
|
||||||
<tr class="top-aligned-row context-row">
|
|
||||||
<td class="context-item-name">Daynames</td>
|
|
||||||
<td>=</td>
|
|
||||||
<td class="context-item-value">%w{Soondey Mundey Tooesdey Vednesdey Thoorsdey Freedey Setoordey}</td>
|
|
||||||
</tr>
|
|
||||||
<tr class="top-aligned-row context-row">
|
|
||||||
<td class="context-item-name">AbbrDaynames</td>
|
|
||||||
<td>=</td>
|
|
||||||
<td class="context-item-value">%w{Soon Mun Tooe-a Ved Thoo Free Set}</td>
|
|
||||||
</tr>
|
|
||||||
<tr class="top-aligned-row context-row">
|
|
||||||
<td class="context-item-name">DateFormats</td>
|
|
||||||
<td>=</td>
|
|
||||||
<td class="context-item-value">{ :default => "%Y-%m-%d", :short => "%b %e", :long => "%B %e, %Y"</td>
|
|
||||||
<td width="3em"> </td>
|
|
||||||
<td class="context-item-desc">
|
|
||||||
<a href="../Date.html">Date</a> and time format syntax explained in <a
|
|
||||||
href="http://www.rubycentral.com/ref/ref_c_time.html#strftime">www.rubycentral.com/ref/ref_c_time.html#strftime</a>
|
|
||||||
These are sent to strftime that Ruby’s date and time handlers use
|
|
||||||
internally Same options as php (that has a better list: <a
|
|
||||||
href="http://www.php.net/strftime">www.php.net/strftime</a> )
|
|
||||||
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr class="top-aligned-row context-row">
|
|
||||||
<td class="context-item-name">TimeFormats</td>
|
|
||||||
<td>=</td>
|
|
||||||
<td class="context-item-value">{ :default => "%a, %d %b %Y %H:%M:%S %z", :short => "%d %b %H:%M", :long => "%B %d, %Y %H:%M"</td>
|
|
||||||
</tr>
|
|
||||||
<tr class="top-aligned-row context-row">
|
|
||||||
<td class="context-item-name">DateSelectOrder</td>
|
|
||||||
<td>=</td>
|
|
||||||
<td class="context-item-value">{ :order => [:year, :month, :day]</td>
|
|
||||||
<td width="3em"> </td>
|
|
||||||
<td class="context-item-desc">
|
|
||||||
Set the order of <tt>date_select</tt> and <tt>datetime_select</tt> boxes
|
|
||||||
Note that at present, the current Rails version only supports ordering of
|
|
||||||
date_select boxes
|
|
||||||
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr class="top-aligned-row context-row">
|
|
||||||
<td class="context-item-name">Texts</td>
|
|
||||||
<td>=</td>
|
|
||||||
<td class="context-item-value">{ :less_than_x_seconds => "under %d sekunder", :half_a_minute => "et halvt minut", :less_than_a_minute => "under et minut", :one_minute => "1 minut", :x_minutes => "%d minutter", :one_hour => "omkring en time", :x_hours => "omkring %d timer", :one_day => "1 dag", :x_days => "%d dage"</td>
|
|
||||||
</tr>
|
|
||||||
<tr class="top-aligned-row context-row">
|
|
||||||
<td class="context-item-name">Monthnames</td>
|
|
||||||
<td>=</td>
|
|
||||||
<td class="context-item-value">[nil] + %w{januar februar marts april maj juni juli august september oktober november december}</td>
|
|
||||||
<td width="3em"> </td>
|
|
||||||
<td class="context-item-desc">
|
|
||||||
Rails uses Month names in <a href="../Date.html">Date</a> and time select
|
|
||||||
boxes (<tt>date_select</tt> and <tt>datetime_select</tt> ) Currently (as of
|
|
||||||
version 1.1.6), Rails doesn’t use daynames
|
|
||||||
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr class="top-aligned-row context-row">
|
|
||||||
<td class="context-item-name">AbbrMonthnames</td>
|
|
||||||
<td>=</td>
|
|
||||||
<td class="context-item-value">[nil] + %w{jan feb mar apr maj jun jul aug sep okt nov dec}</td>
|
|
||||||
</tr>
|
|
||||||
<tr class="top-aligned-row context-row">
|
|
||||||
<td class="context-item-name">Daynames</td>
|
|
||||||
<td>=</td>
|
|
||||||
<td class="context-item-value">%w{søndag mandag tirsdag onsdag torsdag fredag lørdag}</td>
|
|
||||||
</tr>
|
|
||||||
<tr class="top-aligned-row context-row">
|
|
||||||
<td class="context-item-name">AbbrDaynames</td>
|
|
||||||
<td>=</td>
|
|
||||||
<td class="context-item-value">%w{søn man tir ons tors fre lør}</td>
|
|
||||||
</tr>
|
|
||||||
<tr class="top-aligned-row context-row">
|
|
||||||
<td class="context-item-name">DateFormats</td>
|
|
||||||
<td>=</td>
|
|
||||||
<td class="context-item-value">{ :default => "%Y-%m-%d", :short => "%e %b", :long => "%e %B, %Y"</td>
|
|
||||||
<td width="3em"> </td>
|
|
||||||
<td class="context-item-desc">
|
|
||||||
<a href="../Date.html">Date</a> and time format syntax explained in <a
|
|
||||||
href="http://www.rubycentral.com/ref/ref_c_time.html#strftime">www.rubycentral.com/ref/ref_c_time.html#strftime</a>
|
|
||||||
These are sent to strftime that Ruby’s date and time handlers use
|
|
||||||
internally Same options as php (that has a better list: <a
|
|
||||||
href="http://www.php.net/strftime">www.php.net/strftime</a> )
|
|
||||||
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr class="top-aligned-row context-row">
|
|
||||||
<td class="context-item-name">TimeFormats</td>
|
|
||||||
<td>=</td>
|
|
||||||
<td class="context-item-value">{ :default => "%A d. %d %B %Y %H:%M", #no timezone :short => "%d. %b %H:%M", :long => "%d. %B %Y %H:%M"</td>
|
|
||||||
</tr>
|
|
||||||
<tr class="top-aligned-row context-row">
|
|
||||||
<td class="context-item-name">DateSelectOrder</td>
|
|
||||||
<td>=</td>
|
|
||||||
<td class="context-item-value">{ :order => [:day, :month, :year]</td>
|
|
||||||
<td width="3em"> </td>
|
|
||||||
<td class="context-item-desc">
|
|
||||||
Set the order of <tt>date_select</tt> and <tt>datetime_select</tt> boxes
|
|
||||||
Note that at present, the current Rails version only supports ordering of
|
|
||||||
date_select boxes
|
|
||||||
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr class="top-aligned-row context-row">
|
|
||||||
<td class="context-item-name">Texts</td>
|
|
||||||
<td>=</td>
|
|
||||||
<td class="context-item-value">{ :less_than_x_seconds => "weniger als %d Sekunden", :half_a_minute => "hälfte ein Minute", :less_than_a_minute => "weniger als ein Minute", :one_minute => "1 minute", :x_minutes => "%d Minuten", :one_hour => "ungefähr 1 Stunden", :x_hours => "ungefähr %d Stunden", :one_day => "1 Tag", :x_days => "%d Tage"</td>
|
|
||||||
</tr>
|
|
||||||
<tr class="top-aligned-row context-row">
|
|
||||||
<td class="context-item-name">Monthnames</td>
|
|
||||||
<td>=</td>
|
|
||||||
<td class="context-item-value">[nil] + %w{Januar Februar Märtz April Mai Juni Juli August September Oktober November Dezember}</td>
|
|
||||||
<td width="3em"> </td>
|
|
||||||
<td class="context-item-desc">
|
|
||||||
Rails uses Month names in <a href="../Date.html">Date</a> and time select
|
|
||||||
boxes (<tt>date_select</tt> and <tt>datetime_select</tt> ) Currently (as of
|
|
||||||
version 1.1.6), Rails doesn’t use daynames
|
|
||||||
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr class="top-aligned-row context-row">
|
|
||||||
<td class="context-item-name">AbbrMonthnames</td>
|
|
||||||
<td>=</td>
|
|
||||||
<td class="context-item-value">[nil] + %w{Jan Feb Mrz Apr Mai Jun Jul Aug Sep Oct Nov Dez}</td>
|
|
||||||
</tr>
|
|
||||||
<tr class="top-aligned-row context-row">
|
|
||||||
<td class="context-item-name">Daynames</td>
|
|
||||||
<td>=</td>
|
|
||||||
<td class="context-item-value">%w{Sontag Montag Dienstag Mittwoch Donnerstag Freitag Samstag}</td>
|
|
||||||
</tr>
|
|
||||||
<tr class="top-aligned-row context-row">
|
|
||||||
<td class="context-item-name">AbbrDaynames</td>
|
|
||||||
<td>=</td>
|
|
||||||
<td class="context-item-value">%w{Son Mon Die Mit Don Fre Sam}</td>
|
|
||||||
</tr>
|
|
||||||
<tr class="top-aligned-row context-row">
|
|
||||||
<td class="context-item-name">DateFormats</td>
|
|
||||||
<td>=</td>
|
|
||||||
<td class="context-item-value">{ :default => "%Y-%m-%d", :short => "%b %e", :long => "%B %e, %Y"</td>
|
|
||||||
<td width="3em"> </td>
|
|
||||||
<td class="context-item-desc">
|
|
||||||
<a href="../Date.html">Date</a> and time format syntax explained in <a
|
|
||||||
href="http://www.rubycentral.com/ref/ref_c_time.html#strftime">www.rubycentral.com/ref/ref_c_time.html#strftime</a>
|
|
||||||
These are sent to strftime that Ruby’s date and time handlers use
|
|
||||||
internally Same options as php (that has a better list: <a
|
|
||||||
href="http://www.php.net/strftime">www.php.net/strftime</a> )
|
|
||||||
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr class="top-aligned-row context-row">
|
|
||||||
<td class="context-item-name">TimeFormats</td>
|
|
||||||
<td>=</td>
|
|
||||||
<td class="context-item-value">{ :default => "%a, %d %b %Y %H:%M:%S %z", :short => "%d %b %H:%M", :long => "%B %d, %Y %H:%M"</td>
|
|
||||||
</tr>
|
|
||||||
<tr class="top-aligned-row context-row">
|
|
||||||
<td class="context-item-name">DateSelectOrder</td>
|
|
||||||
<td>=</td>
|
|
||||||
<td class="context-item-value">{ :order => [:day, :month, :year]</td>
|
|
||||||
<td width="3em"> </td>
|
|
||||||
<td class="context-item-desc">
|
|
||||||
Set the order of <tt>date_select</tt> and <tt>datetime_select</tt> boxes
|
|
||||||
Note that at present, the current Rails version only supports ordering of
|
|
||||||
date_select boxes
|
|
||||||
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr class="top-aligned-row context-row">
|
|
||||||
<td class="context-item-name">Texts</td>
|
|
||||||
<td>=</td>
|
|
||||||
<td class="context-item-value">{ :less_than_x_seconds => "less than %d seconds", :half_a_minute => "half a minute", :less_than_a_minute => "less than a minute", :one_minute => "1 minute", :x_minutes => "%d minutes", :one_hour => "about 1 hour", :x_hours => "about %d hours", :one_day => "1 day", :x_days => "%d days"</td>
|
|
||||||
</tr>
|
|
||||||
<tr class="top-aligned-row context-row">
|
|
||||||
<td class="context-item-name">Monthnames</td>
|
|
||||||
<td>=</td>
|
|
||||||
<td class="context-item-value">[nil] + %w{January February March April May June July August September October November December}</td>
|
|
||||||
<td width="3em"> </td>
|
|
||||||
<td class="context-item-desc">
|
|
||||||
Rails uses Month names in <a href="../Date.html">Date</a> and time select
|
|
||||||
boxes (<tt>date_select</tt> and <tt>datetime_select</tt> ) Currently (as of
|
|
||||||
version 1.1.6), Rails doesn’t use daynames
|
|
||||||
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr class="top-aligned-row context-row">
|
|
||||||
<td class="context-item-name">AbbrMonthnames</td>
|
|
||||||
<td>=</td>
|
|
||||||
<td class="context-item-value">[nil] + %w{Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec}</td>
|
|
||||||
</tr>
|
|
||||||
<tr class="top-aligned-row context-row">
|
|
||||||
<td class="context-item-name">Daynames</td>
|
|
||||||
<td>=</td>
|
|
||||||
<td class="context-item-value">%w{Sunday Monday Tuesday Wednesday Thursday Friday Saturday}</td>
|
|
||||||
</tr>
|
|
||||||
<tr class="top-aligned-row context-row">
|
|
||||||
<td class="context-item-name">AbbrDaynames</td>
|
|
||||||
<td>=</td>
|
|
||||||
<td class="context-item-value">%w{Sun Mon Tue Wed Thu Fri Sat}</td>
|
|
||||||
</tr>
|
|
||||||
<tr class="top-aligned-row context-row">
|
|
||||||
<td class="context-item-name">DateFormats</td>
|
|
||||||
<td>=</td>
|
|
||||||
<td class="context-item-value">{ :default => "%Y-%m-%d", :short => "%b %e", :long => "%B %e, %Y"</td>
|
|
||||||
<td width="3em"> </td>
|
|
||||||
<td class="context-item-desc">
|
|
||||||
<a href="../Date.html">Date</a> and time format syntax explained in <a
|
|
||||||
href="http://www.rubycentral.com/ref/ref_c_time.html#strftime">www.rubycentral.com/ref/ref_c_time.html#strftime</a>
|
|
||||||
These are sent to strftime that Ruby’s date and time handlers use
|
|
||||||
internally Same options as php (that has a better list: <a
|
|
||||||
href="http://www.php.net/strftime">www.php.net/strftime</a> )
|
|
||||||
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr class="top-aligned-row context-row">
|
|
||||||
<td class="context-item-name">TimeFormats</td>
|
|
||||||
<td>=</td>
|
|
||||||
<td class="context-item-value">{ :default => "%a, %d %b %Y %H:%M:%S %z", :short => "%d %b %H:%M", :long => "%B %d, %Y %H:%M"</td>
|
|
||||||
</tr>
|
|
||||||
<tr class="top-aligned-row context-row">
|
|
||||||
<td class="context-item-name">DateSelectOrder</td>
|
|
||||||
<td>=</td>
|
|
||||||
<td class="context-item-value">{ :order => [:year, :month, :day]</td>
|
|
||||||
<td width="3em"> </td>
|
|
||||||
<td class="context-item-desc">
|
|
||||||
Set the order of <tt>date_select</tt> and <tt>datetime_select</tt> boxes
|
|
||||||
Note that at present, the current Rails version only supports ordering of
|
|
||||||
date_select boxes
|
|
||||||
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr class="top-aligned-row context-row">
|
|
||||||
<td class="context-item-name">Texts</td>
|
|
||||||
<td>=</td>
|
|
||||||
<td class="context-item-value">{ :less_than_x_seconds => "menos de %d segundos", :half_a_minute => "medio minuto", :less_than_a_minute => "menos de un minuto", :one_minute => "1 minuto", :x_minutes => "%d minutos", :one_hour => "sobre una hora", :x_hours => "sobre %d horas", :one_day => "un día", :x_days => "%d días"</td>
|
|
||||||
</tr>
|
|
||||||
<tr class="top-aligned-row context-row">
|
|
||||||
<td class="context-item-name">Monthnames</td>
|
|
||||||
<td>=</td>
|
|
||||||
<td class="context-item-value">[nil] + %w{enero febrero marzo abril mayo junio julio agosto septiembre octubre noviembre diciembre}</td>
|
|
||||||
<td width="3em"> </td>
|
|
||||||
<td class="context-item-desc">
|
|
||||||
Rails uses Month names in <a href="../Date.html">Date</a> and time select
|
|
||||||
boxes (<tt>date_select</tt> and <tt>datetime_select</tt> ) Currently (as of
|
|
||||||
version 1.1.6), Rails doesn’t use daynames
|
|
||||||
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr class="top-aligned-row context-row">
|
|
||||||
<td class="context-item-name">AbbrMonthnames</td>
|
|
||||||
<td>=</td>
|
|
||||||
<td class="context-item-value">[nil] + %w{ene feb mar abr may jun jul ago sep oct nov dic}</td>
|
|
||||||
</tr>
|
|
||||||
<tr class="top-aligned-row context-row">
|
|
||||||
<td class="context-item-name">Daynames</td>
|
|
||||||
<td>=</td>
|
|
||||||
<td class="context-item-value">%w{domingo lunes martes miércoles jueves viernes sábado}</td>
|
|
||||||
</tr>
|
|
||||||
<tr class="top-aligned-row context-row">
|
|
||||||
<td class="context-item-name">AbbrDaynames</td>
|
|
||||||
<td>=</td>
|
|
||||||
<td class="context-item-value">%w{dom lun mar mié jue vie sáb }</td>
|
|
||||||
</tr>
|
|
||||||
<tr class="top-aligned-row context-row">
|
|
||||||
<td class="context-item-name">DateFormats</td>
|
|
||||||
<td>=</td>
|
|
||||||
<td class="context-item-value">{ :default => "%Y-%m-%d", :short => "%b %e", :long => "%B %e, %Y"</td>
|
|
||||||
<td width="3em"> </td>
|
|
||||||
<td class="context-item-desc">
|
|
||||||
<a href="../Date.html">Date</a> and time format syntax explained in <a
|
|
||||||
href="http://www.rubycentral.com/ref/ref_c_time.html#strftime">www.rubycentral.com/ref/ref_c_time.html#strftime</a>
|
|
||||||
These are sent to strftime that Ruby’s date and time handlers use
|
|
||||||
internally Same options as php (that has a better list: <a
|
|
||||||
href="http://www.php.net/strftime">www.php.net/strftime</a> )
|
|
||||||
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr class="top-aligned-row context-row">
|
|
||||||
<td class="context-item-name">TimeFormats</td>
|
|
||||||
<td>=</td>
|
|
||||||
<td class="context-item-value">{ :default => "%a, %d %b %Y %H:%M:%S %z", :short => "%d %b %H:%M", :long => "%B %d, %Y %H:%M"</td>
|
|
||||||
</tr>
|
|
||||||
<tr class="top-aligned-row context-row">
|
|
||||||
<td class="context-item-name">DateSelectOrder</td>
|
|
||||||
<td>=</td>
|
|
||||||
<td class="context-item-value">{ :order => [:day, :month, :year]</td>
|
|
||||||
<td width="3em"> </td>
|
|
||||||
<td class="context-item-desc">
|
|
||||||
Set the order of <tt>date_select</tt> and <tt>datetime_select</tt> boxes
|
|
||||||
Note that at present, the current Rails version only supports ordering of
|
|
||||||
date_select boxes
|
|
||||||
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr class="top-aligned-row context-row">
|
|
||||||
<td class="context-item-name">Texts</td>
|
|
||||||
<td>=</td>
|
|
||||||
<td class="context-item-value">{ :less_than_x_seconds => "alle %d sekuntia", :half_a_minute => "puoli minuuttia", :less_than_a_minute => "alle minuutti", :one_minute => "1 minuutti", :x_minutes => "%d minuuttia", :one_hour => "noin tunti", :x_hours => "noin %d tuntia", :one_day => "1 päivä", :x_days => "%d päivää"</td>
|
|
||||||
</tr>
|
|
||||||
<tr class="top-aligned-row context-row">
|
|
||||||
<td class="context-item-name">Monthnames</td>
|
|
||||||
<td>=</td>
|
|
||||||
<td class="context-item-value">[nil] + %w{tammikuu helmikuu maaliskuu huhtikuu toukokuu kesäkuu heinäkuu elokuu syyskuu lokakuu marraskuu joulukuu}</td>
|
|
||||||
<td width="3em"> </td>
|
|
||||||
<td class="context-item-desc">
|
|
||||||
Rails uses Month names in <a href="../Date.html">Date</a> and time select
|
|
||||||
boxes (<tt>date_select</tt> and <tt>datetime_select</tt> ) Currently (as of
|
|
||||||
version 1.1.6), Rails doesn’t use daynames
|
|
||||||
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr class="top-aligned-row context-row">
|
|
||||||
<td class="context-item-name">AbbrMonthnames</td>
|
|
||||||
<td>=</td>
|
|
||||||
<td class="context-item-value">[nil] + %w{tammi helmi maalis huhti touko kesä heinä elo syys loka marras joulu}</td>
|
|
||||||
</tr>
|
|
||||||
<tr class="top-aligned-row context-row">
|
|
||||||
<td class="context-item-name">Daynames</td>
|
|
||||||
<td>=</td>
|
|
||||||
<td class="context-item-value">%w{sunnuntai maanantai tiistai keskiviikko torstai perjantai lauantai}</td>
|
|
||||||
</tr>
|
|
||||||
<tr class="top-aligned-row context-row">
|
|
||||||
<td class="context-item-name">AbbrDaynames</td>
|
|
||||||
<td>=</td>
|
|
||||||
<td class="context-item-value">%w{su ma ti ke to pe la}</td>
|
|
||||||
</tr>
|
|
||||||
<tr class="top-aligned-row context-row">
|
|
||||||
<td class="context-item-name">DateFormats</td>
|
|
||||||
<td>=</td>
|
|
||||||
<td class="context-item-value">{ :default => "%e.%m.%Y", :short => "%d.%m.", :long => "%e. %Bta %Y"</td>
|
|
||||||
<td width="3em"> </td>
|
|
||||||
<td class="context-item-desc">
|
|
||||||
<a href="../Date.html">Date</a> and time format syntax explained in <a
|
|
||||||
href="http://www.rubycentral.com/ref/ref_c_time.html#strftime">www.rubycentral.com/ref/ref_c_time.html#strftime</a>
|
|
||||||
These are sent to strftime that Ruby’s date and time handlers use
|
|
||||||
internally Same options as php (that has a better list: <a
|
|
||||||
href="http://www.php.net/strftime">www.php.net/strftime</a> )
|
|
||||||
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr class="top-aligned-row context-row">
|
|
||||||
<td class="context-item-name">TimeFormats</td>
|
|
||||||
<td>=</td>
|
|
||||||
<td class="context-item-value">{ :default => "%a %Bn %e. %H:%M:%S %Z %Y", :short => "%d.%m.%Y %H:%M", :long => "%a %e. %Bta %Y %T"</td>
|
|
||||||
</tr>
|
|
||||||
<tr class="top-aligned-row context-row">
|
|
||||||
<td class="context-item-name">DateSelectOrder</td>
|
|
||||||
<td>=</td>
|
|
||||||
<td class="context-item-value">{ :order => [:day, :month, :year]</td>
|
|
||||||
<td width="3em"> </td>
|
|
||||||
<td class="context-item-desc">
|
|
||||||
Set the order of <tt>date_select</tt> and <tt>datetime_select</tt> boxes
|
|
||||||
Note that at present, the current Rails version only supports ordering of
|
|
||||||
date_select boxes
|
|
||||||
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr class="top-aligned-row context-row">
|
|
||||||
<td class="context-item-name">Texts</td>
|
|
||||||
<td>=</td>
|
|
||||||
<td class="context-item-value">{ :less_than_x_seconds => "moins de %d secondes", :half_a_minute => "une demi-minute", :less_than_a_minute => "moins d'une minute", :one_minute => "1 minute", :x_minutes => "%d minutes", :one_hour => "à peut près 1 heure", :x_hours => "à peu près %d heures", :one_day => "1 jour", :x_days => "%d jours"</td>
|
|
||||||
</tr>
|
|
||||||
<tr class="top-aligned-row context-row">
|
|
||||||
<td class="context-item-name">Monthnames</td>
|
|
||||||
<td>=</td>
|
|
||||||
<td class="context-item-value">[nil] + %w{Janvier Février Mars Avril Mai Juin Juillet Août Septembre Octobre Novembre Decembre}</td>
|
|
||||||
<td width="3em"> </td>
|
|
||||||
<td class="context-item-desc">
|
|
||||||
Rails uses Month names in <a href="../Date.html">Date</a> and time select
|
|
||||||
boxes (<tt>date_select</tt> and <tt>datetime_select</tt> ) Currently (as of
|
|
||||||
version 1.1.6), Rails doesn’t use daynames
|
|
||||||
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr class="top-aligned-row context-row">
|
|
||||||
<td class="context-item-name">AbbrMonthnames</td>
|
|
||||||
<td>=</td>
|
|
||||||
<td class="context-item-value">[nil] + %w{Jan Fev Mar Avr Mai Jui Jul Aoû Sep Oct Nov Dec}</td>
|
|
||||||
</tr>
|
|
||||||
<tr class="top-aligned-row context-row">
|
|
||||||
<td class="context-item-name">Daynames</td>
|
|
||||||
<td>=</td>
|
|
||||||
<td class="context-item-value">%w{Dimanche Lundi Mardi Mercredi Jeudi Vendredi Samedi}</td>
|
|
||||||
</tr>
|
|
||||||
<tr class="top-aligned-row context-row">
|
|
||||||
<td class="context-item-name">AbbrDaynames</td>
|
|
||||||
<td>=</td>
|
|
||||||
<td class="context-item-value">%w{Dim Lun Mar Mer Jeu Ven Sam}</td>
|
|
||||||
</tr>
|
|
||||||
<tr class="top-aligned-row context-row">
|
|
||||||
<td class="context-item-name">DateFormats</td>
|
|
||||||
<td>=</td>
|
|
||||||
<td class="context-item-value">{ :default => "%Y-%m-%d", :short => "%b %e", :long => "%B %e, %Y"</td>
|
|
||||||
<td width="3em"> </td>
|
|
||||||
<td class="context-item-desc">
|
|
||||||
<a href="../Date.html">Date</a> and time format syntax explained in <a
|
|
||||||
href="http://www.rubycentral.com/ref/ref_c_time.html#strftime">www.rubycentral.com/ref/ref_c_time.html#strftime</a>
|
|
||||||
These are sent to strftime that Ruby’s date and time handlers use
|
|
||||||
internally Same options as php (that has a better list: <a
|
|
||||||
href="http://www.php.net/strftime">www.php.net/strftime</a> )
|
|
||||||
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr class="top-aligned-row context-row">
|
|
||||||
<td class="context-item-name">TimeFormats</td>
|
|
||||||
<td>=</td>
|
|
||||||
<td class="context-item-value">{ :default => "%a, %d %b %Y %H:%M:%S %z", :short => "%d %b %H:%M", :long => "%B %d, %Y %H:%M"</td>
|
|
||||||
</tr>
|
|
||||||
<tr class="top-aligned-row context-row">
|
|
||||||
<td class="context-item-name">DateSelectOrder</td>
|
|
||||||
<td>=</td>
|
|
||||||
<td class="context-item-value">{ :order => [:year, :month, :day]</td>
|
|
||||||
<td width="3em"> </td>
|
|
||||||
<td class="context-item-desc">
|
|
||||||
Set the order of <tt>date_select</tt> and <tt>datetime_select</tt> boxes
|
|
||||||
Note that at present, the current Rails version only supports ordering of
|
|
||||||
date_select boxes
|
|
||||||
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr class="top-aligned-row context-row">
|
|
||||||
<td class="context-item-name">Texts</td>
|
|
||||||
<td>=</td>
|
|
||||||
<td class="context-item-value">{ :less_than_x_seconds => "moins de %d secondes", :half_a_minute => "30 secondes", :less_than_a_minute => "moins d'une minute", :one_minute => "1 minute", :x_minutes => "%d minutes", :one_hour => "environ 1 heure", :x_hours => "environ %d heures", :one_day => "1 jour", :x_days => "%d jours"</td>
|
|
||||||
</tr>
|
|
||||||
<tr class="top-aligned-row context-row">
|
|
||||||
<td class="context-item-name">Monthnames</td>
|
|
||||||
<td>=</td>
|
|
||||||
<td class="context-item-value">[nil] + %w{Janvier Février Mars Avril Mai Juin Juillet Août Septembre Octobre Novembre Décembre}</td>
|
|
||||||
</tr>
|
|
||||||
<tr class="top-aligned-row context-row">
|
|
||||||
<td class="context-item-name">AbbrMonthnames</td>
|
|
||||||
<td>=</td>
|
|
||||||
<td class="context-item-value">[nil] + %w{Jan Fev Mar Avr Mai Jun Jui Aou Sep Oct Nov Dec}</td>
|
|
||||||
</tr>
|
|
||||||
<tr class="top-aligned-row context-row">
|
|
||||||
<td class="context-item-name">Daynames</td>
|
|
||||||
<td>=</td>
|
|
||||||
<td class="context-item-value">%w{Dimanche Lundi Mardi Mercredi Jeudi Vendredi Samedi}</td>
|
|
||||||
</tr>
|
|
||||||
<tr class="top-aligned-row context-row">
|
|
||||||
<td class="context-item-name">AbbrDaynames</td>
|
|
||||||
<td>=</td>
|
|
||||||
<td class="context-item-value">%w{Dim Lun Mar Mer Jeu Ven Sam}</td>
|
|
||||||
</tr>
|
|
||||||
<tr class="top-aligned-row context-row">
|
|
||||||
<td class="context-item-name">DateFormats</td>
|
|
||||||
<td>=</td>
|
|
||||||
<td class="context-item-value">{ :default => "%Y-%m-%d", :short => "%b %e", :long => "%B %e, %Y"</td>
|
|
||||||
</tr>
|
|
||||||
<tr class="top-aligned-row context-row">
|
|
||||||
<td class="context-item-name">TimeFormats</td>
|
|
||||||
<td>=</td>
|
|
||||||
<td class="context-item-value">{ :default => "%a, %d %b %Y %H:%M:%S %z", :short => "%d %b %H:%M", :long => "%B %d, %Y %H:%M"</td>
|
|
||||||
</tr>
|
|
||||||
<tr class="top-aligned-row context-row">
|
|
||||||
<td class="context-item-name">DateSelectOrder</td>
|
|
||||||
<td>=</td>
|
|
||||||
<td class="context-item-value">{ :order => [:year, :month, :day]</td>
|
|
||||||
</tr>
|
|
||||||
<tr class="top-aligned-row context-row">
|
|
||||||
<td class="context-item-name">Texts</td>
|
|
||||||
<td>=</td>
|
|
||||||
<td class="context-item-value">{ :less_than_x_seconds => "minder dan %d seconden", :half_a_minute => "een halve minuut", :less_than_a_minute => "minder dan een halve minuut", :one_minute => "1 minuut", :x_minutes => "%d minuten", :one_hour => "ongeveer 1 uur", :x_hours => "ongeveer %d uur", :one_day => "1 dag", :x_days => "%d dagen"</td>
|
|
||||||
</tr>
|
|
||||||
<tr class="top-aligned-row context-row">
|
|
||||||
<td class="context-item-name">Monthnames</td>
|
|
||||||
<td>=</td>
|
|
||||||
<td class="context-item-value">[nil] + %w{Januari Februari Maart April Mei Juni Juli Augustus September October November December}</td>
|
|
||||||
<td width="3em"> </td>
|
|
||||||
<td class="context-item-desc">
|
|
||||||
Rails uses Month names in <a href="../Date.html">Date</a> and time select
|
|
||||||
boxes (<tt>date_select</tt> and <tt>datetime_select</tt> ) Currently (as of
|
|
||||||
version 1.1.6), Rails doesn’t use daynames
|
|
||||||
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr class="top-aligned-row context-row">
|
|
||||||
<td class="context-item-name">AbbrMonthnames</td>
|
|
||||||
<td>=</td>
|
|
||||||
<td class="context-item-value">[nil] + %w{Jan Feb Mar Apr Mei Jun Jul Aug Sep Oct Nov Dec}</td>
|
|
||||||
</tr>
|
|
||||||
<tr class="top-aligned-row context-row">
|
|
||||||
<td class="context-item-name">Daynames</td>
|
|
||||||
<td>=</td>
|
|
||||||
<td class="context-item-value">%w{Zondag Maandag Dinsdag Woensdag Donderdag Vrijdag Zaterdag}</td>
|
|
||||||
</tr>
|
|
||||||
<tr class="top-aligned-row context-row">
|
|
||||||
<td class="context-item-name">AbbrDaynames</td>
|
|
||||||
<td>=</td>
|
|
||||||
<td class="context-item-value">%w{Zo Ma Di Wo Do Vr Za}</td>
|
|
||||||
</tr>
|
|
||||||
<tr class="top-aligned-row context-row">
|
|
||||||
<td class="context-item-name">DateFormats</td>
|
|
||||||
<td>=</td>
|
|
||||||
<td class="context-item-value">{ :default => "%Y-%m-%d", :short => "%b %e", :long => "%B %e, %Y"</td>
|
|
||||||
<td width="3em"> </td>
|
|
||||||
<td class="context-item-desc">
|
|
||||||
<a href="../Date.html">Date</a> and time format syntax explained in <a
|
|
||||||
href="http://www.rubycentral.com/ref/ref_c_time.html#strftime">www.rubycentral.com/ref/ref_c_time.html#strftime</a>
|
|
||||||
These are sent to strftime that Ruby’s date and time handlers use
|
|
||||||
internally Same options as php (that has a better list: <a
|
|
||||||
href="http://www.php.net/strftime">www.php.net/strftime</a> )
|
|
||||||
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr class="top-aligned-row context-row">
|
|
||||||
<td class="context-item-name">TimeFormats</td>
|
|
||||||
<td>=</td>
|
|
||||||
<td class="context-item-value">{ :default => "%a, %d %b %Y %H:%M:%S %z", :short => "%d %b %H:%M", :long => "%B %d, %Y %H:%M"</td>
|
|
||||||
</tr>
|
|
||||||
<tr class="top-aligned-row context-row">
|
|
||||||
<td class="context-item-name">DateSelectOrder</td>
|
|
||||||
<td>=</td>
|
|
||||||
<td class="context-item-value">{ :order => [:day, :month, :year]</td>
|
|
||||||
<td width="3em"> </td>
|
|
||||||
<td class="context-item-desc">
|
|
||||||
Set the order of <tt>date_select</tt> and <tt>datetime_select</tt> boxes
|
|
||||||
Note that at present, the current Rails version only supports ordering of
|
|
||||||
date_select boxes
|
|
||||||
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr class="top-aligned-row context-row">
|
|
||||||
<td class="context-item-name">Texts</td>
|
|
||||||
<td>=</td>
|
|
||||||
<td class="context-item-value">{ :less_than_x_seconds => "less than %d seconds", :half_a_minute => "half arrr minute", :less_than_a_minute => "less than arrr minute", :one_minute => "1 minute ye landlubber", :x_minutes => "%d minutes accounted ferrrr", :one_hour => "about one hourrr and a bottle of rum", :x_hours => "about %d hourrrs and a bottle of rum", :one_day => "1 day and a dead mans chest arrr", :x_days => "%d days and a ship full of hornpipes"</td>
|
|
||||||
</tr>
|
|
||||||
<tr class="top-aligned-row context-row">
|
|
||||||
<td class="context-item-name">Monthnames</td>
|
|
||||||
<td>=</td>
|
|
||||||
<td class="context-item-value">[nil] + %w{January February March April May June July August September October November December}</td>
|
|
||||||
<td width="3em"> </td>
|
|
||||||
<td class="context-item-desc">
|
|
||||||
Rails uses Month names in <a href="../Date.html">Date</a> and time select
|
|
||||||
boxes (<tt>date_select</tt> and <tt>datetime_select</tt> ) Currently (as of
|
|
||||||
version 1.1.6), Rails doesn’t use daynames
|
|
||||||
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr class="top-aligned-row context-row">
|
|
||||||
<td class="context-item-name">AbbrMonthnames</td>
|
|
||||||
<td>=</td>
|
|
||||||
<td class="context-item-value">[nil] + %w{Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec}</td>
|
|
||||||
</tr>
|
|
||||||
<tr class="top-aligned-row context-row">
|
|
||||||
<td class="context-item-name">Daynames</td>
|
|
||||||
<td>=</td>
|
|
||||||
<td class="context-item-value">%w{Sunday Monday Tuesday Wednesday Thurrrrrrsday Frrriday Saturrrrday}</td>
|
|
||||||
</tr>
|
|
||||||
<tr class="top-aligned-row context-row">
|
|
||||||
<td class="context-item-name">AbbrDaynames</td>
|
|
||||||
<td>=</td>
|
|
||||||
<td class="context-item-value">%w{Sun Mon Tue Wed Thurrrr Frri Sat}</td>
|
|
||||||
</tr>
|
|
||||||
<tr class="top-aligned-row context-row">
|
|
||||||
<td class="context-item-name">DateFormats</td>
|
|
||||||
<td>=</td>
|
|
||||||
<td class="context-item-value">{ :default => "%Y-%m-%d", :short => "%b %e", :long => "%B %e, %Y"</td>
|
|
||||||
<td width="3em"> </td>
|
|
||||||
<td class="context-item-desc">
|
|
||||||
<a href="../Date.html">Date</a> and time format syntax explained in <a
|
|
||||||
href="http://www.rubycentral.com/ref/ref_c_time.html#strftime">www.rubycentral.com/ref/ref_c_time.html#strftime</a>
|
|
||||||
These are sent to strftime that Ruby’s date and time handlers use
|
|
||||||
internally Same options as php (that has a better list: <a
|
|
||||||
href="http://www.php.net/strftime">www.php.net/strftime</a> )
|
|
||||||
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr class="top-aligned-row context-row">
|
|
||||||
<td class="context-item-name">TimeFormats</td>
|
|
||||||
<td>=</td>
|
|
||||||
<td class="context-item-value">{ :default => "%A, %d %b %Y %H:%M:%S", :short => "%d %b %H:%M", :long => "%B %d, %Y %H:%M"</td>
|
|
||||||
</tr>
|
|
||||||
<tr class="top-aligned-row context-row">
|
|
||||||
<td class="context-item-name">DateSelectOrder</td>
|
|
||||||
<td>=</td>
|
|
||||||
<td class="context-item-value">{ :order => [:year, :month, :day]</td>
|
|
||||||
<td width="3em"> </td>
|
|
||||||
<td class="context-item-desc">
|
|
||||||
Set the order of <tt>date_select</tt> and <tt>datetime_select</tt> boxes
|
|
||||||
Note that at present, the current Rails version only supports ordering of
|
|
||||||
date_select boxes
|
|
||||||
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr class="top-aligned-row context-row">
|
|
||||||
<td class="context-item-name">Texts</td>
|
|
||||||
<td>=</td>
|
|
||||||
<td class="context-item-value">{ :less_than_x_seconds => "mindre än %d sekunder", :half_a_minute => "en halv minut", :less_than_a_minute => "mindre än en minut", :one_minute => "1 minut", :x_minutes => "%d minutter", :one_hour => "ungefär 1 timma", :x_hours => "ungefär %d timmar", :one_day => "1 dygn", :x_days => "%d dygn"</td>
|
|
||||||
</tr>
|
|
||||||
<tr class="top-aligned-row context-row">
|
|
||||||
<td class="context-item-name">Monthnames</td>
|
|
||||||
<td>=</td>
|
|
||||||
<td class="context-item-value">[nil] + %w{januari februari mars april maj juni juli augusti september oktober november december}</td>
|
|
||||||
<td width="3em"> </td>
|
|
||||||
<td class="context-item-desc">
|
|
||||||
Rails uses Month names in <a href="../Date.html">Date</a> and time select
|
|
||||||
boxes (<tt>date_select</tt> and <tt>datetime_select</tt> ) Currently (as of
|
|
||||||
version 1.1.6), Rails doesn’t use daynames
|
|
||||||
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr class="top-aligned-row context-row">
|
|
||||||
<td class="context-item-name">AbbrMonthnames</td>
|
|
||||||
<td>=</td>
|
|
||||||
<td class="context-item-value">[nil] + %w{jan feb mar apr maj jun jul aug sep okt nov dec}</td>
|
|
||||||
</tr>
|
|
||||||
<tr class="top-aligned-row context-row">
|
|
||||||
<td class="context-item-name">Daynames</td>
|
|
||||||
<td>=</td>
|
|
||||||
<td class="context-item-value">%w{söndag måndag tisdag onsdag torsdag fredag lördag}</td>
|
|
||||||
</tr>
|
|
||||||
<tr class="top-aligned-row context-row">
|
|
||||||
<td class="context-item-name">AbbrDaynames</td>
|
|
||||||
<td>=</td>
|
|
||||||
<td class="context-item-value">%w{sön mån tis ons tors fre lör}</td>
|
|
||||||
</tr>
|
|
||||||
<tr class="top-aligned-row context-row">
|
|
||||||
<td class="context-item-name">DateFormats</td>
|
|
||||||
<td>=</td>
|
|
||||||
<td class="context-item-value">{ :default => "%Y-%m-%d", :short => "%b %e", :long => "%B %e, %Y"</td>
|
|
||||||
<td width="3em"> </td>
|
|
||||||
<td class="context-item-desc">
|
|
||||||
<a href="../Date.html">Date</a> and time format syntax explained in <a
|
|
||||||
href="http://www.rubycentral.com/ref/ref_c_time.html#strftime">www.rubycentral.com/ref/ref_c_time.html#strftime</a>
|
|
||||||
These are sent to strftime that Ruby’s date and time handlers use
|
|
||||||
internally Same options as php (that has a better list: <a
|
|
||||||
href="http://www.php.net/strftime">www.php.net/strftime</a> )
|
|
||||||
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr class="top-aligned-row context-row">
|
|
||||||
<td class="context-item-name">TimeFormats</td>
|
|
||||||
<td>=</td>
|
|
||||||
<td class="context-item-value">{ :default => "%a, %d %b %Y %H:%M:%S %z", :short => "%d %b %H:%M", :long => "%B %d, %Y %H:%M"</td>
|
|
||||||
</tr>
|
|
||||||
<tr class="top-aligned-row context-row">
|
|
||||||
<td class="context-item-name">DateSelectOrder</td>
|
|
||||||
<td>=</td>
|
|
||||||
<td class="context-item-value">{ :order => [:day, :month, :year]</td>
|
|
||||||
<td width="3em"> </td>
|
|
||||||
<td class="context-item-desc">
|
|
||||||
Set the order of <tt>date_select</tt> and <tt>datetime_select</tt> boxes
|
|
||||||
Note that at present, the current Rails version only supports ordering of
|
|
||||||
date_select boxes
|
|
||||||
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr class="top-aligned-row context-row">
|
|
||||||
<td class="context-item-name">Texts</td>
|
|
||||||
<td>=</td>
|
|
||||||
<td class="context-item-value">{ :less_than_x_seconds => "less than %d seconds", :half_a_minute => "half a minute", :less_than_a_minute => "less than a minute", :one_minute => "1 minute", :x_minutes => "%d minutes", :one_hour => "about 1 hour", :x_hours => "about %d hours", :one_day => "1 day", :x_days => "%d days"</td>
|
|
||||||
</tr>
|
|
||||||
<tr class="top-aligned-row context-row">
|
|
||||||
<td class="context-item-name">Monthnames</td>
|
|
||||||
<td>=</td>
|
|
||||||
<td class="context-item-value">[nil] + %w{January February March April May June July August September October November December}</td>
|
|
||||||
<td width="3em"> </td>
|
|
||||||
<td class="context-item-desc">
|
|
||||||
Monthnames used by Rails in <a href="../Date.html">Date</a> and time select
|
|
||||||
boxes (<tt>date_select</tt> and <tt>datetime_select</tt> ) Currently (as of
|
|
||||||
version 1.1.6), Rails doesn’t use daynames
|
|
||||||
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr class="top-aligned-row context-row">
|
|
||||||
<td class="context-item-name">AbbrMonthnames</td>
|
|
||||||
<td>=</td>
|
|
||||||
<td class="context-item-value">[nil] + %w{Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec}</td>
|
|
||||||
</tr>
|
|
||||||
<tr class="top-aligned-row context-row">
|
|
||||||
<td class="context-item-name">Daynames</td>
|
|
||||||
<td>=</td>
|
|
||||||
<td class="context-item-value">%w{Sunday Monday Tuesday Wednesday Thursday Friday Saturday}</td>
|
|
||||||
</tr>
|
|
||||||
<tr class="top-aligned-row context-row">
|
|
||||||
<td class="context-item-name">AbbrDaynames</td>
|
|
||||||
<td>=</td>
|
|
||||||
<td class="context-item-value">%w{Sun Mon Tue Wed Thu Fri Sat}</td>
|
|
||||||
</tr>
|
|
||||||
<tr class="top-aligned-row context-row">
|
|
||||||
<td class="context-item-name">DateFormats</td>
|
|
||||||
<td>=</td>
|
|
||||||
<td class="context-item-value">{ :default => "%Y-%m-%d", :short => "%b %e", :long => "%B %e, %Y"</td>
|
|
||||||
<td width="3em"> </td>
|
|
||||||
<td class="context-item-desc">
|
|
||||||
<a href="../Date.html">Date</a> and time format syntax explained in <a
|
|
||||||
href="http://www.rubycentral.com/ref/ref_c_time.html#strftime">www.rubycentral.com/ref/ref_c_time.html#strftime</a>
|
|
||||||
These are sent to strftime that Ruby’s date and time handlers use
|
|
||||||
internally Same options as php (that has a better list: <a
|
|
||||||
href="http://www.php.net/strftime">www.php.net/strftime</a> )
|
|
||||||
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr class="top-aligned-row context-row">
|
|
||||||
<td class="context-item-name">TimeFormats</td>
|
|
||||||
<td>=</td>
|
|
||||||
<td class="context-item-value">{ :default => "%a, %d %b %Y %H:%M:%S %z", :short => "%d %b %H:%M", :long => "%B %d, %Y %H:%M"</td>
|
|
||||||
</tr>
|
|
||||||
<tr class="top-aligned-row context-row">
|
|
||||||
<td class="context-item-name">DateSelectOrder</td>
|
|
||||||
<td>=</td>
|
|
||||||
<td class="context-item-value">{ :order => [:year, :month, :day]</td>
|
|
||||||
<td width="3em"> </td>
|
|
||||||
<td class="context-item-desc">
|
|
||||||
Set the order of <tt>date_select</tt> and <tt>datetime_select</tt> boxes
|
|
||||||
Note that at present, the current Rails version only supports ordering of
|
|
||||||
date_select boxes
|
|
||||||
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
</table>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<!-- if method_list -->
|
|
||||||
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
<div id="validator-badges">
|
|
||||||
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</body>
|
|
||||||
</html>
|
|
|
@ -1,304 +0,0 @@
|
||||||
<?xml version="1.0" encoding="iso-8859-1"?>
|
|
||||||
<!DOCTYPE html
|
|
||||||
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
|
||||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
|
||||||
|
|
||||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
|
||||||
<head>
|
|
||||||
<title>Class: LocalizationSimplified::NumberHelper</title>
|
|
||||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
|
||||||
<meta http-equiv="Content-Script-Type" content="text/javascript" />
|
|
||||||
<link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
|
|
||||||
<script type="text/javascript">
|
|
||||||
// <![CDATA[
|
|
||||||
|
|
||||||
function popupCode( url ) {
|
|
||||||
window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
|
|
||||||
}
|
|
||||||
|
|
||||||
function toggleCode( id ) {
|
|
||||||
if ( document.getElementById )
|
|
||||||
elem = document.getElementById( id );
|
|
||||||
else if ( document.all )
|
|
||||||
elem = eval( "document.all." + id );
|
|
||||||
else
|
|
||||||
return false;
|
|
||||||
|
|
||||||
elemStyle = elem.style;
|
|
||||||
|
|
||||||
if ( elemStyle.display != "block" ) {
|
|
||||||
elemStyle.display = "block"
|
|
||||||
} else {
|
|
||||||
elemStyle.display = "none"
|
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Make codeblocks hidden by default
|
|
||||||
document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
|
|
||||||
|
|
||||||
// ]]>
|
|
||||||
</script>
|
|
||||||
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<div id="classHeader">
|
|
||||||
<table class="header-table">
|
|
||||||
<tr class="top-aligned-row">
|
|
||||||
<td><strong>Class</strong></td>
|
|
||||||
<td class="class-name-in-header">LocalizationSimplified::NumberHelper</td>
|
|
||||||
</tr>
|
|
||||||
<tr class="top-aligned-row">
|
|
||||||
<td><strong>In:</strong></td>
|
|
||||||
<td>
|
|
||||||
<a href="../../files/lib/lang_cf_rb.html">
|
|
||||||
lib/lang_cf.rb
|
|
||||||
</a>
|
|
||||||
<br />
|
|
||||||
<a href="../../files/lib/lang_chef_rb.html">
|
|
||||||
lib/lang_chef.rb
|
|
||||||
</a>
|
|
||||||
<br />
|
|
||||||
<a href="../../files/lib/lang_da_rb.html">
|
|
||||||
lib/lang_da.rb
|
|
||||||
</a>
|
|
||||||
<br />
|
|
||||||
<a href="../../files/lib/lang_de_rb.html">
|
|
||||||
lib/lang_de.rb
|
|
||||||
</a>
|
|
||||||
<br />
|
|
||||||
<a href="../../files/lib/lang_en_rb.html">
|
|
||||||
lib/lang_en.rb
|
|
||||||
</a>
|
|
||||||
<br />
|
|
||||||
<a href="../../files/lib/lang_es_rb.html">
|
|
||||||
lib/lang_es.rb
|
|
||||||
</a>
|
|
||||||
<br />
|
|
||||||
<a href="../../files/lib/lang_fi_rb.html">
|
|
||||||
lib/lang_fi.rb
|
|
||||||
</a>
|
|
||||||
<br />
|
|
||||||
<a href="../../files/lib/lang_fr_rb.html">
|
|
||||||
lib/lang_fr.rb
|
|
||||||
</a>
|
|
||||||
<br />
|
|
||||||
<a href="../../files/lib/lang_fr__rb.html">
|
|
||||||
lib/lang_fr_.rb
|
|
||||||
</a>
|
|
||||||
<br />
|
|
||||||
<a href="../../files/lib/lang_nl_rb.html">
|
|
||||||
lib/lang_nl.rb
|
|
||||||
</a>
|
|
||||||
<br />
|
|
||||||
<a href="../../files/lib/lang_pirate_rb.html">
|
|
||||||
lib/lang_pirate.rb
|
|
||||||
</a>
|
|
||||||
<br />
|
|
||||||
<a href="../../files/lib/lang_se_rb.html">
|
|
||||||
lib/lang_se.rb
|
|
||||||
</a>
|
|
||||||
<br />
|
|
||||||
<a href="../../files/lib/lang_template_rb.html">
|
|
||||||
lib/lang_template.rb
|
|
||||||
</a>
|
|
||||||
<br />
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
|
|
||||||
<tr class="top-aligned-row">
|
|
||||||
<td><strong>Parent:</strong></td>
|
|
||||||
<td>
|
|
||||||
Object
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
</table>
|
|
||||||
</div>
|
|
||||||
<!-- banner header -->
|
|
||||||
|
|
||||||
<div id="bodyContent">
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<div id="contextContent">
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
<!-- if includes -->
|
|
||||||
|
|
||||||
<div id="section">
|
|
||||||
|
|
||||||
|
|
||||||
<div id="constants-list">
|
|
||||||
<h3 class="section-bar">Constants</h3>
|
|
||||||
|
|
||||||
<div class="name-list">
|
|
||||||
<table summary="Constants">
|
|
||||||
<tr class="top-aligned-row context-row">
|
|
||||||
<td class="context-item-name">CurrencyOptions</td>
|
|
||||||
<td>=</td>
|
|
||||||
<td class="context-item-value">{ :unit => "$", :separator => ".", #unit separator (between integer part and fraction part) :delimiter => ",", #delimiter between each group of thousands. Example: 1.234.567 :order => [:unit, :number]</td>
|
|
||||||
<td width="3em"> </td>
|
|
||||||
<td class="context-item-desc">
|
|
||||||
CurrencyOptions are used as default for +Number#to_currency()+ <a
|
|
||||||
href="http://api.rubyonrails.org/classes/ActionView/Helpers/NumberHelper.html#M000449">api.rubyonrails.org/classes/ActionView/Helpers/NumberHelper.html#M000449</a>
|
|
||||||
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr class="top-aligned-row context-row">
|
|
||||||
<td class="context-item-name">CurrencyOptions</td>
|
|
||||||
<td>=</td>
|
|
||||||
<td class="context-item-value">{ :unit => "$", :separator => ".", #unit separator (between integer part and fraction part) :delimiter => ",", #delimiter between each group of thousands. Example: 1.234.567 :order => [:unit, :number]</td>
|
|
||||||
<td width="3em"> </td>
|
|
||||||
<td class="context-item-desc">
|
|
||||||
CurrencyOptions are used as default for +Number#to_currency()+ <a
|
|
||||||
href="http://api.rubyonrails.org/classes/ActionView/Helpers/NumberHelper.html#M000449">api.rubyonrails.org/classes/ActionView/Helpers/NumberHelper.html#M000449</a>
|
|
||||||
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr class="top-aligned-row context-row">
|
|
||||||
<td class="context-item-name">CurrencyOptions</td>
|
|
||||||
<td>=</td>
|
|
||||||
<td class="context-item-value">{ :unit => "kr. ", :separator => ",", #unit separator (between integer part and fraction part) :delimiter => ".", #delimiter between each group of thousands. Example: 1.234.567 :order => [:number, :unit]</td>
|
|
||||||
<td width="3em"> </td>
|
|
||||||
<td class="context-item-desc">
|
|
||||||
CurrencyOptions are used as default for +Number#to_currency()+ <a
|
|
||||||
href="http://api.rubyonrails.org/classes/ActionView/Helpers/NumberHelper.html#M000449">api.rubyonrails.org/classes/ActionView/Helpers/NumberHelper.html#M000449</a>
|
|
||||||
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr class="top-aligned-row context-row">
|
|
||||||
<td class="context-item-name">CurrencyOptions</td>
|
|
||||||
<td>=</td>
|
|
||||||
<td class="context-item-value">{ :unit => "€", :separator => ",", #unit separator (between integer part and fraction part) :delimiter => ".", #delimiter between each group of thousands. Example: 1.234.567 :order => [:unit, :number]</td>
|
|
||||||
<td width="3em"> </td>
|
|
||||||
<td class="context-item-desc">
|
|
||||||
CurrencyOptions are used as default for +Number#to_currency()+ <a
|
|
||||||
href="http://api.rubyonrails.org/classes/ActionView/Helpers/NumberHelper.html#M000449">api.rubyonrails.org/classes/ActionView/Helpers/NumberHelper.html#M000449</a>
|
|
||||||
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr class="top-aligned-row context-row">
|
|
||||||
<td class="context-item-name">CurrencyOptions</td>
|
|
||||||
<td>=</td>
|
|
||||||
<td class="context-item-value">{ :unit => "$", :separator => ".", #unit separator (between integer part and fraction part) :delimiter => ",", #delimiter between each group of thousands. Example: 1.234.567 :order => [:unit, :number]</td>
|
|
||||||
<td width="3em"> </td>
|
|
||||||
<td class="context-item-desc">
|
|
||||||
CurrencyOptions are used as default for +Number#to_currency()+ <a
|
|
||||||
href="http://api.rubyonrails.org/classes/ActionView/Helpers/NumberHelper.html#M000449">api.rubyonrails.org/classes/ActionView/Helpers/NumberHelper.html#M000449</a>
|
|
||||||
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr class="top-aligned-row context-row">
|
|
||||||
<td class="context-item-name">CurrencyOptions</td>
|
|
||||||
<td>=</td>
|
|
||||||
<td class="context-item-value">{ :unit => "€", :separator => ",", #unit separator (between integer part and fraction part) :delimiter => ".", #delimiter between each group of thousands. Example: 1.234.567 :order => [:unit, :number]</td>
|
|
||||||
<td width="3em"> </td>
|
|
||||||
<td class="context-item-desc">
|
|
||||||
CurrencyOptions are used as default for +Number#to_currency()+ <a
|
|
||||||
href="http://api.rubyonrails.org/classes/ActionView/Helpers/NumberHelper.html#M000449">api.rubyonrails.org/classes/ActionView/Helpers/NumberHelper.html#M000449</a>
|
|
||||||
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr class="top-aligned-row context-row">
|
|
||||||
<td class="context-item-name">CurrencyOptions</td>
|
|
||||||
<td>=</td>
|
|
||||||
<td class="context-item-value">{ :unit => "€", :separator => " ", #unit separator (between integer part and fraction part) :delimiter => ",", #delimiter between each group of thousands. Example: 1.234.567 :order => [:unit, :number]</td>
|
|
||||||
<td width="3em"> </td>
|
|
||||||
<td class="context-item-desc">
|
|
||||||
CurrencyOptions are used as default for +Number#to_currency()+ <a
|
|
||||||
href="http://api.rubyonrails.org/classes/ActionView/Helpers/NumberHelper.html#M000449">api.rubyonrails.org/classes/ActionView/Helpers/NumberHelper.html#M000449</a>
|
|
||||||
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr class="top-aligned-row context-row">
|
|
||||||
<td class="context-item-name">CurrencyOptions</td>
|
|
||||||
<td>=</td>
|
|
||||||
<td class="context-item-value">{ :unit => "€", :separator => ".", #unit separator (between integer part and fraction part) :delimiter => ",", #delimiter between each group of thousands. Example: 1.234.567 :order => [:unit, :number]</td>
|
|
||||||
<td width="3em"> </td>
|
|
||||||
<td class="context-item-desc">
|
|
||||||
CurrencyOptions are used as default for +Number#to_currency()+ <a
|
|
||||||
href="http://api.rubyonrails.org/classes/ActionView/Helpers/NumberHelper.html#M000449">api.rubyonrails.org/classes/ActionView/Helpers/NumberHelper.html#M000449</a>
|
|
||||||
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr class="top-aligned-row context-row">
|
|
||||||
<td class="context-item-name">CurrencyOptions</td>
|
|
||||||
<td>=</td>
|
|
||||||
<td class="context-item-value">{ :unit => "$", :separator => ".", :delimiter => ",", :order => nil</td>
|
|
||||||
</tr>
|
|
||||||
<tr class="top-aligned-row context-row">
|
|
||||||
<td class="context-item-name">CurrencyOptions</td>
|
|
||||||
<td>=</td>
|
|
||||||
<td class="context-item-value">{ :unit => "€", :separator => ".", #unit separator (between integer part and fraction part) :delimiter => ",", #delimiter between each group of thousands. Example: 1.234.567 :order => [:unit, :number]</td>
|
|
||||||
<td width="3em"> </td>
|
|
||||||
<td class="context-item-desc">
|
|
||||||
CurrencyOptions are used as default for +Number#to_currency()+ <a
|
|
||||||
href="http://api.rubyonrails.org/classes/ActionView/Helpers/NumberHelper.html#M000449">api.rubyonrails.org/classes/ActionView/Helpers/NumberHelper.html#M000449</a>
|
|
||||||
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr class="top-aligned-row context-row">
|
|
||||||
<td class="context-item-name">CurrencyOptions</td>
|
|
||||||
<td>=</td>
|
|
||||||
<td class="context-item-value">{ :unit => "pieces o' silver", :separator => ".", #unit separator (between integer part and fraction part) :delimiter => ",", #delimiter between each group of thousands. Example: 1.234.567 :order => [:unit, :number]</td>
|
|
||||||
<td width="3em"> </td>
|
|
||||||
<td class="context-item-desc">
|
|
||||||
CurrencyOptions are used as default for +Number#to_currency()+ <a
|
|
||||||
href="http://api.rubyonrails.org/classes/ActionView/Helpers/NumberHelper.html#M000449">api.rubyonrails.org/classes/ActionView/Helpers/NumberHelper.html#M000449</a>
|
|
||||||
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr class="top-aligned-row context-row">
|
|
||||||
<td class="context-item-name">CurrencyOptions</td>
|
|
||||||
<td>=</td>
|
|
||||||
<td class="context-item-value">{ :unit => "kr. ", :separator => ",", #unit separator (between integer part and fraction part) :delimiter => ".", #delimiter between each group of thousands. Example: 1.234.567 :order => [:number, :unit]</td>
|
|
||||||
<td width="3em"> </td>
|
|
||||||
<td class="context-item-desc">
|
|
||||||
CurrencyOptions are used as default for +Number#to_currency()+ <a
|
|
||||||
href="http://api.rubyonrails.org/classes/ActionView/Helpers/NumberHelper.html#M000449">api.rubyonrails.org/classes/ActionView/Helpers/NumberHelper.html#M000449</a>
|
|
||||||
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<tr class="top-aligned-row context-row">
|
|
||||||
<td class="context-item-name">CurrencyOptions</td>
|
|
||||||
<td>=</td>
|
|
||||||
<td class="context-item-value">{ :unit => "$", :separator => ".", #unit separator (between integer part and fraction part) :delimiter => ",", #delimiter between each group of thousands. Example: 1.234.567 :order => [:unit, :number]</td>
|
|
||||||
<td width="3em"> </td>
|
|
||||||
<td class="context-item-desc">
|
|
||||||
CurrencyOptions are used as default for +Number#to_currency()+ <a
|
|
||||||
href="http://api.rubyonrails.org/classes/ActionView/Helpers/NumberHelper.html#M000449">api.rubyonrails.org/classes/ActionView/Helpers/NumberHelper.html#M000449</a>
|
|
||||||
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
</table>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<!-- if method_list -->
|
|
||||||
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
<div id="validator-badges">
|
|
||||||
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</body>
|
|
||||||
</html>
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue