diff --git a/.gitignore b/.gitignore index 439e494..d4f8479 100644 --- a/.gitignore +++ b/.gitignore @@ -3,4 +3,5 @@ *.log .bundle/ *.bundle/install.log -Gemfile.lock \ No newline at end of file +Gemfile.lock +tmp/ \ No newline at end of file diff --git a/.ruby-version b/.ruby-version index 276cbf9..0bee604 100644 --- a/.ruby-version +++ b/.ruby-version @@ -1 +1 @@ -2.3.0 +2.3.3 diff --git a/bin/cybele b/bin/cybele index 22e09e6..0bdd8ef 100755 --- a/bin/cybele +++ b/bin/cybele @@ -1,7 +1,19 @@ #!/usr/bin/env ruby +require 'pathname' require File.expand_path(File.join('..', 'lib', 'cybele', 'generators', 'app_generator'), File.dirname(__FILE__)) require File.expand_path(File.join('..', 'lib', 'cybele', 'app_builder'), File.dirname(__FILE__)) +require File.expand_path(File.join('..', 'lib', 'cybele', 'version'), File.dirname(__FILE__)) + +if ARGV.empty? + puts 'Please provide a path for the new application' + puts + puts 'See --help for more info' + exit 0 +elsif ['-v', '--version'].include? ARGV[0] + puts Cybele::VERSION + exit 0 +end templates_root = File.expand_path(File.join('..', 'templates'), File.dirname(__FILE__)) Cybele::AppGenerator.source_root templates_root diff --git a/cybele.gemspec b/cybele.gemspec index d8b783f..e5bca4b 100644 --- a/cybele.gemspec +++ b/cybele.gemspec @@ -11,8 +11,8 @@ Gem::Specification.new do |spec| spec.version = Cybele::VERSION spec.authors = %w[lab2023] spec.email = %w[info@lab2023.com] - spec.description = %q{Rails 4.x template with responder, simple form, haml, exception notification, etc etc ...} - spec.summary = %q{Rails 4.x template with responder, simple form, haml, exception notification, etc etc ...} + spec.description = %q{Rails 5.x App template} + spec.summary = %q{Rails 5.x template with responder, simple form, haml, exception notification, etc etc ...} spec.homepage = 'https://github.com/kebab-project/cybele' spec.license = 'MIT' spec.date = Date.today.strftime('%Y-%m-%d') @@ -21,9 +21,9 @@ Gem::Specification.new do |spec| spec.test_files = spec.files.grep(%r{^(test|spec|features)/}) spec.require_paths = %w[lib] - spec.add_development_dependency 'rake' spec.add_dependency 'bundler', '~> 1.5' - spec.add_dependency 'rails', Cybele::RAILS_VERSION + spec.add_runtime_dependency 'rails', '~> 5.0', Cybele::RAILS_VERSION + spec.add_development_dependency 'rspec', '~> 3.5' spec.extra_rdoc_files = %w[README.md MIT-LICENSE] end diff --git a/lib/cybele.rb b/lib/cybele.rb new file mode 100644 index 0000000..733bce8 --- /dev/null +++ b/lib/cybele.rb @@ -0,0 +1,3 @@ +require 'cybele/version' +require 'cybele/generators/app_generator' +require 'cybele/app_builder' diff --git a/lib/cybele/app_builder.rb b/lib/cybele/app_builder.rb index e03b180..ff36085 100644 --- a/lib/cybele/app_builder.rb +++ b/lib/cybele/app_builder.rb @@ -6,16 +6,16 @@ def readme template 'README.md.erb', 'README.md', force: true end - def remove_readme_rdoc - remove_file 'README.rdoc', force: true - end - def replace_gemfile remove_file 'Gemfile', force: true copy_file 'cybele_Gemfile', 'Gemfile' end - def add_editorconfig + def remove_readme_rdoc + remove_file 'README.rdoc', force: true + end + + def add_editor_config copy_file 'editorconfig', '.editorconfig' end @@ -23,512 +23,5 @@ def add_ruby_version copy_file 'ruby-version', '.ruby-version' end - def add_disable_xml_params - copy_file 'config/initializers/disable_xml_params.rb', 'config/initializers/disable_xml_params.rb' - end - - def add_paperclip_aws - copy_file 'config/initializers/paperclip.rb', 'config/initializers/paperclip.rb' - end - - def replace_erb_with_haml - remove_file 'app/views/layouts/application.html.erb', force: true - template 'app/views/layouts/application.html.haml.erb', 'app/views/layouts/application.html.haml', force: true - end - - def install_responder_gem - copy_file 'lib/application_responder.rb', 'lib/application_responder.rb' - remove_file 'app/controllers/application_controller.rb', force: true - copy_file 'app/controllers/application_controller.rb', 'app/controllers/application_controller.rb' - copy_file 'app/controllers/concerns/basic_authentication.rb', 'app/controllers/concerns/basic_authentication.rb' - copy_file 'lib/templates/rails/responders_controller/controller.rb', 'lib/templates/rails/responders_controller/controller.rb' - copy_file 'config/locales/responders.tr.yml', 'config/locales/responders.tr.yml' - end - - def replace_database_yml - template 'config/database.yml.erb', 'config/database.yml', force: true - end - - def create_database - bundle_command 'exec rake db:create' - end - - def setup_gitignore_files - remove_file '.gitignore', force: true - copy_file 'cybele_gitignore', '.gitignore' - end - - def setup_gitignore_folders - %w( - app/assets/images - db/migrate - spec/support - spec/lib - spec/models - spec/views - spec/controllers - spec/helpers - ).each do |dir| - empty_directory_with_keep_file dir - end - end - - def setup_asset_precompile - config = <<-RUBY - config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s] - config.assets.precompile += %w(*.png *.jpg *.jpeg *.gif) - config.sass.preferred_syntax = :sass - config.i18n.default_locale = :tr - config.time_zone = 'Istanbul' - config.i18n.fallbacks = true - config.active_job.queue_adapter = :sidekiq - RUBY - inject_into_file 'config/application.rb', config, after: '# config.i18n.default_locale = :de' - end - - def convert_application_js_to_coffee - remove_file 'app/assets/javascripts/application.js', force: true - copy_file 'app/assets/javascripts/application.js.coffee', 'app/assets/javascripts/application.js.coffee' - end - - def convert_application_css_to_sass - remove_file 'app/assets/stylesheets/application.css', force: true - copy_file 'app/assets/stylesheets/application.css.sass', 'app/assets/stylesheets/application.css.sass' - end - - def copy_vendor_assets - directory 'vendor/assets', 'vendor/assets' - end - - def configure_smtp - remove_file 'config/settings/production.yml', force: true - copy_file 'config/settings/production.yml', 'config/settings/production.yml' - copy_file 'config/settings/staging.yml', 'config/settings/staging.yml' - - config = <<-RUBY - Mail.register_interceptor RecipientInterceptor.new(Settings.email.sandbox, subject_prefix: '[STAGING]') - RUBY - configure_environment 'staging', config - - config = <<-RUBY - config.action_mailer.delivery_method = :smtp - config.action_mailer.raise_delivery_errors = false - config.action_mailer.smtp_settings = { - address: Settings.smtp.address, - port: Settings.smtp.port, - enable_starttls_auto: Settings.smtp.enable_starttls_auto, - user_name: Settings.smtp.user_name, - password: Settings.smtp.password, - authentication: Settings.smtp.authentication - } - RUBY - configure_environment 'production', config - configure_environment 'staging', config - end - - def configure_bullet - config = <<-RUBY - config.after_initialize do - Bullet.enable = true - Bullet.alert = true - Bullet.bullet_logger = true - Bullet.console = true - Bullet.rails_logger = true - Bullet.add_footer = false - end - RUBY - configure_environment 'development', config - end - - def setup_staging_environment - run 'cp config/environments/production.rb config/environments/staging.rb' - config = <<-YML -email: - sandbox: sandbox@#{app_name}.com - noreply: no-reply@#{app_name}.com - admin: admin@#{app_name}.com - -basic_auth: - username: #{app_name} - password: #{app_name} - -sidekiq: - username: #{app_name} - password: #{app_name} - -root_path: <%= ENV['ROOT_PATH'] %> - -smtp: - address: <%= ENV['SMTP_ADDRESS'] %> - port: 587 - enable_starttls_auto: true - user_name: <%= ENV['SMTP_USER_NAME'] %> - password: <%= ENV['SMTP_PASSWORD'] %> - authentication: 'plain' - -AWS: - S3: - bucket: <%= ENV['S3_BUCKET_NAME'] %> - access_key_id: <%= ENV['AWS_ACCESS_KEY_ID'] %> - secret_access_key: <%= ENV['AWS_SECRET_ACCESS_KEY'] %> - aws_url: http://<%= ENV['AWS_RAW_URL'] %> - aws_raw_url: <%= ENV['AWS_RAW_URL'] %> - # Bucket region should be ireland for this setting - end_point: s3-eu-west-1.amazonaws.com - YML - prepend_file 'config/settings.yml', config - end - - def configure_action_mailer - action_mailer_host 'development' - action_mailer_host 'staging' - action_mailer_host 'production' - end - - def setup_letter_opener - config = <<-RUBY - config.action_mailer.delivery_method = :letter_opener - RUBY - configure_environment 'development', config - end - - def generate_rspec - generate 'rspec:install' - end - - def generate_capybara - inject_into_file 'spec/spec_helper.rb', after: "require 'rspec/autorun'" do <<-CODE -require 'capybara/rspec' - CODE - end - inject_into_file 'spec/spec_helper.rb', after: ' config.order = "random"' do <<-CODE - # Capybara DSL - config.include Capybara::DSL - CODE - end - end - - def generate_factory_girl - inject_into_file 'spec/spec_helper.rb', after: ' config.include Capybara::DSL' do <<-CODE - # Factory girl - config.include FactoryGirl::Syntax::Methods - CODE - end - end - - def generate_simple_form - generate 'simple_form:install --bootstrap --force' - copy_file 'config/locales/simple_form.tr.yml', 'config/locales/simple_form.tr.yml' - copy_file 'config/locales/tr.yml', 'config/locales/tr.yml' - end - - def generate_exception_notification - generate 'exception_notification:install' - generate 'rollbar your_token' - end - - def add_exception_notification_to_environments - config = <<-CODE - config.middleware.use ExceptionNotification::Rack, - email: { - email_prefix: "[#{app_name}]", - sender_address: %{"Notifier" }, - exception_recipients: %w{your_email@address.com} - } - CODE - configure_environment('production', config) - configure_environment('staging', config) - inject_into_file 'config/initializers/exception_notification.rb', before: 'config.add_notifier :email, {' do <<-RUBY - unless Rails.env == 'development' - RUBY - end - inject_into_file 'config/initializers/exception_notification.rb', before: '# Campfire notifier sends notifications to your Campfire room.' do <<-RUBY - end - RUBY - end - end - - def generate_rails_config - generate 'rails_config:install' - end - - def generate_devise_settings - generate 'devise:install' - gsub_file 'config/initializers/filter_parameter_logging.rb', /:password/, ':password, :password_confirmation' - gsub_file 'config/initializers/devise.rb', /please-change-me-at-config-initializers-devise@example.com/, "no-reply@#{app_name}.com" - inject_into_file 'config/initializers/devise.rb', after: "# config.mailer = 'Devise::Mailer'\n" do <<-RUBY - Devise::Mailer.layout 'mailer' - RUBY - end - end - - def generate_devise_user - generate 'devise User name:string surname:string is_active:boolean time_zone:string' - generate_devise_strong_parameters('user') - remove_file 'config/locales/devise.en.yml', force: true - end - - def generate_devise_views - directory 'app/views/devise', 'app/views/devise' - end - - def generate_welcome_page - copy_file 'app/controllers/welcome_controller.rb', 'app/controllers/welcome_controller.rb' - template 'app/views/welcome/index.html.haml.erb', 'app/views/welcome/index.html.haml', force: true - end - - def setup_namespaces - generate 'devise Admin name:string surname:string is_active:boolean time_zone:string' - - directory 'app/controllers/hq', 'app/controllers/hq' - directory 'app/views/hq', 'app/views/hq' - - # User controllers - directory 'app/controllers/user', 'app/controllers/user' - directory 'app/views/user', 'app/views/user' - - end - - def create_hierapolis_theme - remove_file 'lib/templates/rails/responders_controller/controller.rb', force: true - remove_file 'lib/templates/haml/scaffold/_form.html.haml', force: true - generate 'hierapolis:install' - end - - def replace_simple_form_wrapper - remove_file 'config/initializers/simple_form.rb', force: true - remove_file 'config/initializers/simple_form_bootstrap.rb', force: true - - copy_file 'config/initializers/simple_form.rb', 'config/initializers/simple_form.rb' - copy_file 'config/initializers/simple_form_bootstrap.rb', 'config/initializers/simple_form_bootstrap.rb' - end - - def setup_capistrano - run 'bundle exec cap install' - end - - def setup_capistrano_settings - run 'rm config/deploy.rb' - # Copy teplates/config/deploy.rb to app directory - copy_file 'config/deploy.rb', 'config/deploy.rb' - # Change my_app_name string in the deploy.rb file with app_name that is created - gsub_file 'config/deploy.rb', /my_app_name/, "#{app_name}" - - inject_into_file 'Capfile', after: "require 'capistrano/deploy'\n" do <<-RUBY -require 'capistrano/rails' -require 'capistrano/bundler' -require 'sshkit/sudo' -require 'capistrano/maintenance' - RUBY - end - - append_to_file 'config/deploy/production.rb' do - 'server "example.com", user: "#{fetch(:local_user)}", roles: %w{app db web}, primary: true, port: 22 -set :rails_env, "production" -set :branch, "master" -set :project_domain, "example.com"' - end - append_to_file 'config/deploy/staging.rb' do - 'server "staging.example.com", user: "#{fetch(:local_user)}", roles: %w{app db web}, primary: true, port: 22 -set :rails_env, "staging" -set :branch, "develop" -set :project_domain, "staging.example.com"' - end - end - - def setup_recipes - generate 'recipes_matic:install' - end - - def setup_client_side_validations - generate 'client_side_validations:install' - end - - def update_secret_token - remove_file 'config/initializers/secret_token.rb', force: true - template 'config/initializers/secret_token.erb', 'config/initializers/secret_token.rb' - end - - def setup_show_for - copy_file 'config/initializers/show_for.rb', 'config/initializers/show_for.rb' - end - - def create_dev_rake - end - - def custom_exception_page - copy_file 'app/views/errors/internal_server_error.html.haml', 'app/views/errors/internal_server_error.html.haml' - end - - def custom_404 - copy_file 'app/views/errors/not_found.html.haml', 'app/views/errors/not_found.html.haml' - end - - def add_seeds - inject_into_file 'db/seeds.rb', after: "# Mayor.create(name: 'Emanuel', city: cities.first)\n" do <<-RUBY - Admin.create(email: "admin@#{app_name}.com", name: 'Admin', surname: 'Admin', password: '12341234', password_confirmation: '12341234') - RUBY - end - end - - # Copy files - def copy_files - - # Locale files - say 'Coping files..' - remove_file 'config/locales/en.yml', force: true - remove_file 'config/locales/simple_form.en.yml', force: true - copy_file 'config/locales/models.tr.yml', 'config/locales/models.tr.yml' - copy_file 'config/locales/show_for.tr.yml', 'config/locales/show_for.tr.yml' - copy_file 'config/locales/simple_form.tr.yml', 'config/locales/simple_form.tr.yml' - copy_file 'config/locales/view.tr.yml', 'config/locales/view.tr.yml' - copy_file 'config/locales/email.tr.yml', 'config/locales/email.tr.yml' - - # Model files - remove_file 'app/models/admin.rb', force: true - remove_file 'app/models/user.rb', force: true - remove_file 'app/models/city.rb', force: true - remove_file 'app/models/country.rb', force: true - directory 'app/models', 'app/models' - - # Helper files - remove_file 'app/helpers/application_helper.rb', force: true - template 'app/helpers/application_helper.rb.erb', 'app/helpers/application_helper.rb' - - # Route file - say 'Restore routes.rb' - remove_file 'config/routes.rb', force: true - template 'config/routes.erb', 'config/routes.rb' - - # Hq layout files - say 'Set hq layouts' - remove_file 'app/views/layouts/hq/application.html.haml', force: true - template 'app/views/layouts/hq/application.html.haml.erb', 'app/views/layouts/hq/application.html.haml', force: true - remove_file 'app/views/layouts/login.html.haml', force: true - template 'app/views/layouts/hq/login.html.haml.erb', 'app/views/layouts/hq/login.html.haml', force: true - remove_file 'app/views/layouts/hq/partials/_navbar.haml', force: true - template 'app/views/layouts/hq/partials/_navbar.html.haml.erb', 'app/views/layouts/hq/partials/_navbar.html.haml', force: true - remove_file 'app/views/layouts/hq/partials/_dock.haml', force: true - template 'app/views/layouts/hq/partials/_dock.html.haml.erb', 'app/views/layouts/hq/partials/_dock.html.haml', force: true - remove_file 'app/views/layouts/hq/partials/_footer.haml', force: true - template 'app/views/layouts/hq/partials/_footer.html.haml.erb', 'app/views/layouts/hq/partials/_footer.html.haml', force: true - remove_file 'app/views/layouts/hq/partials/_trackers.haml', force: true - template 'app/views/layouts/hq/partials/_trackers.html.haml.erb', 'app/views/layouts/hq/partials/_trackers.html.haml', force: true - - # Mailer layout files - template 'app/views/layouts/mailer.html.haml.erb', 'app/views/layouts/mailer.html.haml', force: true - copy_file 'app/views/layouts/mailer.text.haml', 'app/views/layouts/mailer.text.haml' - - # Assets files - remove_file 'app/assets/javascripts/application.js', force: true - remove_file 'app/assets/stylesheets/application.css', force: true - - # Hq assets files - remove_file 'app/assets/javascripts/hq/application.js.coffee', force: true - remove_file 'app/assets/stylesheets/hq/application.css.sass', force: true - copy_file 'app/assets/javascripts/hq/application.js.coffee','app/assets/javascripts/hq/application.js.coffee' - copy_file 'app/assets/stylesheets/hq/application.css.sass', 'app/assets/stylesheets/hq/application.css.sass' - - # Partial files in layouts folder - remove_file 'app/views/layouts/partials/_footer.haml', force: true - template 'app/views/layouts/partials/_footer.html.haml.erb', 'app/views/layouts/partials/_footer.html.haml', force: true - remove_file 'app/views/layouts/partials/_trackers.haml', force: true - template 'app/views/layouts/partials/_trackers.html.haml.erb', 'app/views/layouts/partials/_trackers.html.haml', force: true - template 'app/views/layouts/partials/_warnings.html.haml.erb', 'app/views/layouts/partials/_warnings.html.haml', force: true - - # Root folder files - copy_file 'cybele_version.txt', 'VERSION.txt' - directory 'public/images', 'public/images' - template '.env.local.erb', '.env.local', force: true - template '.env.production.erb', '.env.production', force: true - template '.env.staging.erb', '.env.staging', force: true - template 'env.sample.erb', 'env.sample', force: true - template 'Procfile.erb', 'Procfile', force: true - - # Library files - directory 'lib/tasks', 'lib/tasks' - directory 'lib/data', 'lib/data' - - # Config files - copy_file 'config/initializers/sidekiq.rb', 'config/initializers/sidekiq.rb' - copy_file 'config/initializers/devise_async.rb', 'config/initializers/devise_async.rb' - copy_file 'config/schedule.yml', 'config/schedule.yml' - copy_file 'config/sidekiq.yml', 'config/sidekiq.yml' - remove_file 'config/settings.local.yml', force: true - - # Mailer files - directory 'app/mailers', 'app/mailers' - directory 'app/views/admin_mailer', 'app/views/admin_mailer' - directory 'app/views/user_mailer', 'app/views/user_mailer' - - # Controllers - remove_file 'app/controllers/application_controller.rb', force: true - template 'app/controllers/application_controller.rb.erb', 'app/controllers/application_controller.rb', force: true - end - - def git_commands - git :init - end - - def create_location_models - generate 'model Country name:string' - generate 'model City name:string country:references' - generate 'audited:install' - end - - def create_jobs_helper_lib - create_file "lib/jobs_helper.rb", <<-CODE -# Get system admin -def system_admin - admin = Admin.where(email: "system@#{app_name}.com").first - if admin.nil? - password = Devise.friendly_token.first(12) - admin = Admin.create(name: 'System', surname: 'System', email: "system@#{app_name}.com", password: password, password_confirmation: password) - end - admin -end - CODE - end - - private - - def action_mailer_host(rails_env) - config = <<-RUBY - # Mail Setting - config.action_mailer.default_url_options = { host: ENV['ROOT_PATH'] } - RUBY - configure_environment(rails_env, config) - end - - def configure_environment(rails_env, config) - inject_into_file("config/environments/#{rails_env}.rb", "\n#{config}", before: "\nend") - end - - def generate_devise_strong_parameters(model_name) - create_sanitizer_lib(model_name) - create_sanitizer_initializer(model_name) - end - - def create_sanitizer_lib(model_name) - create_file "lib/#{model_name.parameterize}_sanitizer.rb", <<-CODE -class #{model_name.classify}::ParameterSanitizer < Devise::ParameterSanitizer - private - def sign_up - default_params.permit(:name, :surname, :email, :password, :password_confirmation, :time_zone) # TODO add other params here - end -end - CODE - end - - def create_sanitizer_initializer(model_name) - path = "#" - path << "{Rails.application.root}" - path << "/lib/#{model_name.parameterize}_sanitizer.rb" - initializer 'sanitizers.rb', <<-CODE -require "#{path}" - CODE - end - - end end diff --git a/lib/cybele/generators/app_generator.rb b/lib/cybele/generators/app_generator.rb index c4e284d..919cd3b 100644 --- a/lib/cybele/generators/app_generator.rb +++ b/lib/cybele/generators/app_generator.rb @@ -5,54 +5,14 @@ module Cybele class AppGenerator < Rails::Generators::AppGenerator - class_option :database, :type => :string, :aliases => '-d', :default => 'postgresql', - :desc => "Preconfigure for selected database (options: #{DATABASES.join('/')})" - - class_option :skip_test_unit, :type => :boolean, :aliases => '-T', :default => true, - :desc => 'Skip Test::Unit files' - - def finish_template - invoke :customization - super - end - - def customization - invoke :customize_gemfile - invoke :setup_editorconfig - invoke :setup_ruby_version - invoke :setup_add_disable_xml_params - invoke :setup_add_paperclip_aws - invoke :setup_database - invoke :remove_files_we_dont_need - invoke :replace_files - invoke :install_gems - invoke :gitignore_files_and_folders - invoke :setup_bootstrap_sass_coffee - invoke :copy_vendor_files - invoke :setup_rails_config - invoke :setup_staging_environment - invoke :configure_mail_setting - invoke :setup_rspec - invoke :setup_capybara - invoke :setup_factory_girl - invoke :setup_simple_form - invoke :setup_exception_notification - invoke :setup_exception_notification_to_environments - invoke :setup_welcome_page - invoke :setup_devise - invoke :setup_time_zone - invoke :setup_bullet_config - invoke :setup_namespaces - end - def customize_gemfile build :replace_gemfile bundle_command 'install --binstubs=bin/stubs' end - def setup_editorconfig - say 'Add .editorconfig file' - build :add_editorconfig + def setup_editor_config + say 'Add .editor_config file' + build :add_editor_config end def setup_ruby_version @@ -60,216 +20,11 @@ def setup_ruby_version build :add_ruby_version end - def setup_add_disable_xml_params - say 'Add disable_xml_params.rb file to initilizers' - build :add_disable_xml_params - end - - def setup_add_paperclip_aws - say 'Add paperclip.rb file to initilizers' - build :add_paperclip_aws - end - def remove_files_we_dont_need say 'Remove files we don\'t need' build :remove_readme_rdoc end - def replace_files - say 'Replace files' - build :replace_erb_with_haml - build :replace_database_yml - end - - def install_gems - say 'Install gems' - say 'Install responder gem' - build :install_responder_gem - end - - def setup_database - say 'Setting up database' - - if 'postgresql' == options[:database] - build :replace_database_yml - end - - build :create_database - end - - def setup_staging_environment - say 'Setting up the staging environment' - build :setup_staging_environment - end - - def gitignore_files_and_folders - build :setup_gitignore_files - build :setup_gitignore_folders - end - - def setup_bootstrap_sass_coffee - say 'Setup bootstrap' - build :setup_asset_precompile - build :setup_application_js - build :convert_application_js_to_coffee - build :convert_application_css_to_sass - end - - def copy_vendor_files - say 'Copy vendor assets' - build :copy_vendor_assets - end - - def configure_mail_setting - say 'Setup mail settings' - build :configure_action_mailer - build :configure_smtp - build :setup_letter_opener - end - - def setup_rspec - say 'Generate rspec' - build :generate_rspec - end - - def setup_capybara - say 'Generate capybara' - build :generate_capybara - end - - def setup_factory_girl - say 'Generate factory girl' - build :generate_factory_girl - end - - def setup_simple_form - say 'Generate simple form files' - build :generate_simple_form - end - - def setup_exception_notification - say 'Generate exception notification' - say 'Do not forget to configure config/initializers/exception_notification.rb file' - build :generate_exception_notification - end - - def setup_rails_config - say 'Generate rails config' - build :generate_rails_config - end - - def setup_devise - say 'Generate devise' - build :generate_devise_settings - say 'Adding devise user model' - build :generate_devise_user - build :generate_devise_views - end - - def setup_welcome_page - say 'Generate Welcome Page' - build :generate_welcome_page - end - - def setup_time_zone - say 'Setup time zone' - build :set_time_zone - end - - def setup_hierapolis - say 'Setup hierapolis' - build :create_hierapolis_theme - end - - def setup_sipmle_form_wrapper - say 'Setup sipmle form wrapper' - build :replace_simple_form_wrapper - end - - def setup_exception_notification_to_environments - say 'Setup exception notification for environments' - build :add_exception_notification_to_environments - end - - def install_capistrano - say 'Setup capistrano' - build :setup_capistrano - end - - def setup_capistrano_settings - say 'Setup capistrano settings' - build :setup_capistrano_settings - end - - def setup_recipes - build :setup_recipes - end - - def setup_client_side_validations - say 'Setup client_side_validations' - build :setup_client_side_validations - end - - def setup_secret_token - say 'Setup secret token' - build :update_secret_token - end - - def setup_bullet_config - say 'Setup bullet config' - build :configure_bullet - end - - def install_show_for - say 'Setup show_for' - build :setup_show_for - end - - def create_dev_rake - say 'Create dev_rake' - build :create_dev_rake - end - - def custom_exception_page - say 'Setup custom exception pages' - build :custom_exception_page - end - - def custom_404 - say 'Setup 404 page' - build :custom_404 - end - - def add_seeds - say 'Add seeds main' - build :add_seeds - end - - def setup_namespaces - say 'Generate namespaces' - build :setup_namespaces - end - - def setup_models - say 'Setup models' - build :create_location_models - end - - def copy_all_files - say 'Copy files' - build :copy_files - end - - def setup_helpers - say 'Create helpers' - build :create_jobs_helper_lib - end - - def setup_git - say 'Initialize git' - build :git_commands - end - def goodbye say 'Congratulations! That\'s all...' end diff --git a/lib/cybele/version.rb b/lib/cybele/version.rb index b747f2b..9626ba9 100644 --- a/lib/cybele/version.rb +++ b/lib/cybele/version.rb @@ -1,5 +1,5 @@ module Cybele - RAILS_VERSION = '~> 4.2.6' + RAILS_VERSION = '~> 5.0.1' RUBY_VERSION = IO.read("#{File.dirname(__FILE__)}/../../.ruby-version").strip - VERSION = '1.9.2' + VERSION = '2.0.0' end \ No newline at end of file diff --git a/spec/features/new_project_spec.rb b/spec/features/new_project_spec.rb new file mode 100644 index 0000000..f59b0fd --- /dev/null +++ b/spec/features/new_project_spec.rb @@ -0,0 +1,27 @@ +require 'spec_helper' + +RSpec.describe 'Create new project with default configuration' do + + before(:all) do + remove_project_directory + run_cybele + setup_app_dependencies + end + + it 'uses default Gemfile' do + gemfile_file = IO.read("#{project_path}/Gemfile") + readme_file = IO.read("#{project_path}/README.md") + expect(gemfile_file).to match( + /^ruby '#{Cybele::RUBY_VERSION}'/, + ) + expect(gemfile_file).to match( + /^gem 'autoprefixer-rails'/, + ) + expect(gemfile_file).to match( + /^gem 'rails', '#{Cybele::RAILS_VERSION}'/, + ) + expect(readme_file).to match( + /^# #{CybeleTestHelpers::APP_NAME.capitalize}/, + ) + end +end \ No newline at end of file diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb new file mode 100644 index 0000000..46d6e43 --- /dev/null +++ b/spec/spec_helper.rb @@ -0,0 +1,25 @@ +require 'bundler/setup' + +Bundler.require(:default, :test) + +require (Pathname.new(__FILE__).dirname + '../lib/cybele').expand_path + +Dir['./spec/support/**/*.rb'].each { |file| require file } + +RSpec.configure do |config| + config.include CybeleTestHelpers + + config.before(:all) do + create_tmp_directory + end + + # Use color in STDOUT + config.color = true + + # Use color not only in STDOUT but also in pagers and files + config.tty = true + + # Use the specified formatter + config.formatter = :documentation + +end \ No newline at end of file diff --git a/spec/support/CybeleTestHelpers.rb b/spec/support/CybeleTestHelpers.rb new file mode 100644 index 0000000..49aa565 --- /dev/null +++ b/spec/support/CybeleTestHelpers.rb @@ -0,0 +1,61 @@ +module CybeleTestHelpers + + APP_NAME = 'dummy_app' + + def remove_project_directory + FileUtils.rm_rf(project_path) + end + + def create_tmp_directory + FileUtils.mkdir_p(tmp_path) + end + + def run_cybele(arguments = nil) + arguments = "--path=#{root_path} #{arguments}" + Dir.chdir(tmp_path) do + Bundler.with_clean_env do + ` + #{cybele_bin} #{APP_NAME} #{arguments} + ` + end + end + end + + def project_path + @project_path ||= Pathname.new("#{tmp_path}/#{APP_NAME}") + end + + def cybele_help_command + Dir.chdir(tmp_path) do + Bundler.with_clean_env do + ` + #{cybele_bin} -h + ` + end + end + end + + def setup_app_dependencies + if File.exist?(project_path) + Dir.chdir(project_path) do + Bundler.with_clean_env do + `bundle check || bundle install` + end + end + end + end + + private + + def tmp_path + @tmp_path ||= Pathname.new("#{root_path}/tmp") + end + + def cybele_bin + File.join(root_path, 'bin', 'cybele') + end + + def root_path + File.expand_path('../../../', __FILE__) + end +end \ No newline at end of file diff --git a/templates/.env.local.erb b/templates/.env.local.erb deleted file mode 100644 index 6dd5547..0000000 --- a/templates/.env.local.erb +++ /dev/null @@ -1,11 +0,0 @@ -ROOT_PATH=http://localhost:3000 - -SMTP_PASSWORD= -SMTP_USER_NAME=admin@<%= app_name %>.com -SMTP_ADDRESS=smtp.sendgrid.net - -BASIC_AUTH_IS_ACTIVE=no -S3_BUCKET_NAME=<%= app_name %>-v3-staging -AWS_RAW_URL=<%= app_name %>-v3-staging.s3.amazonaws.com -AWS_ACCESS_KEY_ID= -AWS_SECRET_ACCESS_KEY= diff --git a/templates/.env.production.erb b/templates/.env.production.erb deleted file mode 100644 index 53afa30..0000000 --- a/templates/.env.production.erb +++ /dev/null @@ -1,11 +0,0 @@ -ROOT_PATH=https://<%= app_name %>.herokuapp.com - -SMTP_PASSWORD= -SMTP_USER_NAME=admin@<%= app_name %>.com -SMTP_ADDRESS=smtp.sendgrid.net - -BASIC_AUTH_IS_ACTIVE=no -S3_BUCKET_NAME=<%= app_name %> -AWS_RAW_URL=<%= app_name %>.s3.amazonaws.com -AWS_ACCESS_KEY_ID= -AWS_SECRET_ACCESS_KEY= \ No newline at end of file diff --git a/templates/.env.staging.erb b/templates/.env.staging.erb deleted file mode 100644 index 9c04a3d..0000000 --- a/templates/.env.staging.erb +++ /dev/null @@ -1,11 +0,0 @@ -ROOT_PATH=https://staging-<%= app_name %>.herokuapp.com - -SMTP_PASSWORD= -SMTP_USER_NAME=admin@<%= app_name %>.com -SMTP_ADDRESS=smtp.sendgrid.net - -BASIC_AUTH_IS_ACTIVE=yes -S3_BUCKET_NAME=<%= app_name %>-staging -AWS_RAW_URL=<%= app_name %>-staging.s3.amazonaws.com -AWS_ACCESS_KEY_ID= -AWS_SECRET_ACCESS_KEY= diff --git a/templates/Procfile.erb b/templates/Procfile.erb deleted file mode 100644 index 16a5cc0..0000000 --- a/templates/Procfile.erb +++ /dev/null @@ -1,2 +0,0 @@ -web: bin/rails server -p $PORT -e $RAILS_ENV -worker: bundle exec sidekiq -C config/sidekiq.yml \ No newline at end of file diff --git a/templates/README.md.erb b/templates/README.md.erb index 65c3694..47c13fc 100644 --- a/templates/README.md.erb +++ b/templates/README.md.erb @@ -2,23 +2,4 @@ # TODOs -* Set .env.local variables -* Set access_token in config/initializers/rollbar.rb -* Set default values for is_active, time_zone variable using in User and Admin model migrations db/migrate/*.rb -* Change username and password in config/settings.yml -* In public folder run this command ln -s ../VERSION.txt VERSION.txt - -We are using sidekiq with redis-server for background jobs. -Clone project run this commands in terminal -Before the run application look our env.sample file. It should be in project root directory with this name .env.local -```bash -bundle -redis-server -rake sidekiq:start -rake db:create -rake db:migrate -rake dev:seed -rails s -``` - diff --git a/templates/app/assets/javascripts/application.js.coffee b/templates/app/assets/javascripts/application.js.coffee deleted file mode 100644 index e8ef487..0000000 --- a/templates/app/assets/javascripts/application.js.coffee +++ /dev/null @@ -1,81 +0,0 @@ -# This is a manifest file that will be compiled into application.js, which will include all the files -# listed below. -# -# Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts, -# or vendor/assets/javascripts of plugins, if any, can be referenced here using a relative path. -# -# It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the -# compiled file. -# -# WARNING: THE FIRST BLANK LINE MARKS THE END OF WHAT'S TO BE PROCESSED, ANY BLANK LINE SHOULD -# GO AFTER THE REQUIRES BELOW. -# -#= require jquery -#= require jquery_ujs -#= require turbolinks -#= require bootstrap -#= require chosen-jquery -#= require jquery.maskedinput.min -#= require jquery.datetimepicker -#= require nprogress -#= require trix -#= require rails.validations -#= require rails.validations.simple_form - -class @App - - @tooltip = -> - $('[data-toggle="tooltip"]').tooltip() - $('[data-toggle="toolbar-tooltip"]').tooltip() - - @ready = -> - App.tooltip() - - $('.datetimepicker').datetimepicker - format: $('.datetimepicker').data('format') - step: 60 - lang: 'tr' - minDate: 0 - defaultTime: '12:00' - - $( "[data-mask]").each (index, element) -> - $element = $(element) - $element.mask($element.data('mask')) - - $('.chosen-select').chosen - allow_single_deselect: true - placeholder_text: $('.chosen-select').attr('include_blank') - - $('.chosen-select-with-width').chosen - allow_single_deselect: true - placeholder_text: $('.chosen-select-with-width').attr('include_blank') - width: '370px' - - $('form[data-turboform]').on('submit', (e) -> - Turbolinks.visit @action + (if @action.indexOf('?') == -1 then '?' else '&') + $(this).serialize() - false - ) - -$(document).ready(App.ready) -$(document).on('page:load', App.ready) -$(window).on('page:load', App.ready) - -# Turbolinks events -$(document).on 'page:fetch', -> - NProgress.start() - return -$(document).on 'page:change', -> - NProgress.done() - return -$(document).on 'page:restore', -> - NProgress.remove() - return -# jQuery events -# Trigger whenever ajax start -$(document).ajaxStart -> - NProgress.start() - return -# Complete the NProcess when ajax end -$(document).ajaxComplete -> - NProgress.done() - return \ No newline at end of file diff --git a/templates/app/assets/javascripts/hq/application.js.coffee b/templates/app/assets/javascripts/hq/application.js.coffee deleted file mode 100644 index b8613e0..0000000 --- a/templates/app/assets/javascripts/hq/application.js.coffee +++ /dev/null @@ -1,94 +0,0 @@ -# This is a manifest file that will be compiled into application.js, which will include all the files -# listed below. -# -# Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts, -# or vendor/assets/javascripts of plugins, if any, can be referenced here using a relative path. -# -# It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the -# compiled file. -# -# WARNING: THE FIRST BLANK LINE MARKS THE END OF WHAT'S TO BE PROCESSED, ANY BLANK LINE SHOULD -# GO AFTER THE REQUIRES BELOW. -# -#= require jquery -#= require jquery_ujs -#= require turbolinks -#= require bootstrap -#= require hierapolis -#= require chosen-jquery -#= require jquery.maskedinput.min -#= require trix -#= require jquery.datetimepicker -#= require nprogress -#= require rails.validations -#= require rails.validations.simple_form - -class @App - @tooltip = -> - $('[data-toggle="tooltip"]').tooltip() - $('[data-toggle="toolbar-tooltip"]').tooltip() - - @ready = -> - App.tooltip() - - $('.chosen-select').chosen - allow_single_deselect: true - placeholder_text: $('.chosen-select').attr('include_blank') - - $('.chosen-select-with-width').chosen - allow_single_deselect: true - placeholder_text: $('.chosen-select-with-width').attr('include_blank') - width: '370px' - - $('.changeable_select').on 'change', -> - $hiden_area = $($('#hider-id').data('hiden-area')) - values = $('#hider-id').data('hiden-on').split(',') - if $.inArray($(this).val(), values) != -1 - $hiden_area.addClass('hidden') - else - $hiden_area.removeClass('hidden') - -ready = -> - App.ready() - - $('.datetimepicker').datetimepicker - format: $('.datetimepicker').data('format') - step: 60 - lang: 'tr' - minDate: 0 - defaultTime: '12:00' - - $( "[data-mask]").each (index, element) -> - $element = $(element) - $element.mask($element.data('mask')) - - $('form[data-turboform]').on('submit', (e) -> - Turbolinks.visit @action + (if @action.indexOf('?') == -1 then '?' else '&') + $(this).serialize() - false - ) - -$(document).ready(ready) -$(document).on('page:load', ready) -$(window).on('page:load', ready) - - -# Turbolinks.enableProgressBar() -# Turbolinks events -$(document).on 'page:fetch', -> - NProgress.start() - return -$(document).on 'page:change', -> - NProgress.done() - return -$(document).on 'page:restore', -> - NProgress.remove() - return -# jQuery events -# Trigger whenever ajax start -$(document).ajaxStart -> - NProgress.start() - return -# Complete the NProcess when ajax end -$(document).ajaxComplete -> - NProgress.done() - return \ No newline at end of file diff --git a/templates/app/assets/stylesheets/application.css.sass b/templates/app/assets/stylesheets/application.css.sass deleted file mode 100644 index e02b008..0000000 --- a/templates/app/assets/stylesheets/application.css.sass +++ /dev/null @@ -1,57 +0,0 @@ -/* - * This is a manifest file that will be compiled into application.css, which will include all the files - * listed below. - * - * Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets, - * or vendor/assets/stylesheets of plugins, if any, can be referenced here using a relative path. - * - * You're free to add application-wide styles to this file and they'll appear at the top of the - * compiled file, but it's generally better to create a new file per style scope. - * - *= require_self - -@import "compass" -@import "bootstrap" -@import 'nprogress' -@import "bootstrap-chosen" -@import "jquery.datetimepicker" -@import "nprogress" -@import 'trix' - - -/* Trix editor -trix-editor - min-height: 100px !important - @extend .form-control - height: 100% !important - margin: 0px 0px 12px 0px - -/* Custom container - -body - padding-bottom: 40px - -.container-narrow - margin: 0 auto - max-width: 700px - > hr - margin: 30px 0 - -/* Main marketing message and sign up button - -.jumbotron - margin: 60px 0 - text-align: center - h1 - font-size: 72px - line-height: 1 - .btn - font-size: 21px - padding: 14px 24px - -/* Supporting marketing content - -.marketing - margin: 60px 0 - p + h4 - margin-top: 28px \ No newline at end of file diff --git a/templates/app/assets/stylesheets/hq/application.css.sass b/templates/app/assets/stylesheets/hq/application.css.sass deleted file mode 100644 index 798e5dd..0000000 --- a/templates/app/assets/stylesheets/hq/application.css.sass +++ /dev/null @@ -1,92 +0,0 @@ -/* - * This is a manifest file that will be compiled into application.css, which will include all the files - * listed below. - * - * Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets, - * or vendor/assets/stylesheets of plugins, if any, can be referenced here using a relative path. - * - * You're free to add application-wide styles to this file and they'll appear at the top of the - * compiled file, but it's generally better to create a new file per style scope. - * - *= require_self - -@import 'nprogress' -@import 'hierapolis' -@import 'trix' -@import "bootstrap-chosen" -@import "jquery.datetimepicker" - -.admins, .users - .active - color: green !important - .passive - background-color: rgba(230, 161, 161, 0.37) !important - .paid - color: green !important - .not-paid - background-color: rgba(230, 161, 161, 0.37) !important - -.chosen-container .chosen-container-multi - width: 500px !important - -.btn - margin: 0px 1px - -.date.date_fields - select - width: 32% - float: left - margin: 2px - margin-bottom: 10px - label - width: 100% - -.tool-label - font-size: 14px - padding: 7px 10px - margin-right: 5px - -#sidebar ul#dock li.launcher ul.dropdown-menu - width: 310px - -.btn - margin: 0px 2px - -.form-actions - background-color: rgba(2, 2, 2, 0) !important - -#wrapper form .form-actions - float: right !important - -.query-buttons - .btn - margin: 2px - -.query-inputs - .pull-right - margin: 2px 0px - -trix-editor - min-height: 100px !important - @extend .form-control - height: 100% !important - margin: 0px 0px 12px 0px - -.form-group.nested-fields-wrapper - select - position: relative - top: -1px - .chosen-container - top: -2px - &.last - margin-bottom: 5px - -.show_for - .wrapper - padding: 3px 0px !important - -.grid table td.action - width: 9% - -#beaker - background-image: url('/images/sprite.png') \ No newline at end of file diff --git a/templates/app/controllers/application_controller.rb.erb b/templates/app/controllers/application_controller.rb.erb deleted file mode 100644 index 5339bb1..0000000 --- a/templates/app/controllers/application_controller.rb.erb +++ /dev/null @@ -1,48 +0,0 @@ -require 'application_responder' - -class ApplicationController < ActionController::Base - include BasicAuthentication - - rescue_from Exception, with: :server_error if Rails.env.production? or Rails.env.staging? - rescue_from ActiveRecord::RecordNotFound, with: :page_not_found if Rails.env.production? or Rails.env.staging? - rescue_from ActionController::RoutingError, with: :page_not_found if Rails.env.production? or Rails.env.staging? - - self.responder = ApplicationResponder - respond_to :html, :json - - # Prevent CSRF attacks by raising an exception. - # For APIs, you may want to use :null_session instead. - before_filter :set_audit_user, :set_user_time_zone - protect_from_forgery with: :exception - - def server_error(exception) - Rollbar.error "ApplicationController#server_error --exception: #{exception}" - render template: 'errors/internal_server_error', status: 500 - end - - def page_not_found - render template: 'errors/not_found', status: 404 - end - - protected - - def set_user_time_zone - Time.zone = current_user.time_zone if user_signed_in? && current_user.time_zone.present? - end - - def devise_parameter_sanitizer - if resource_class == User - User::ParameterSanitizer.new(User, :user, params) - else - super # Use the default one - end - end - - private - - def set_audit_user - # Set audit current user - Audited.current_user_method = :current_user - end - -end \ No newline at end of file diff --git a/templates/app/controllers/concerns/basic_authentication.rb b/templates/app/controllers/concerns/basic_authentication.rb deleted file mode 100644 index 28fe8ae..0000000 --- a/templates/app/controllers/concerns/basic_authentication.rb +++ /dev/null @@ -1,18 +0,0 @@ -module BasicAuthentication - extend ActiveSupport::Concern - - included do - before_filter :authenticate - end - - private - - def authenticate - if ENV['BASIC_AUTH_IS_ACTIVE'] == 'yes' - authenticate_or_request_with_http_basic do |username, password| - username == Settings.basic_auth.username && password == Settings.basic_auth.password - end - end - end - -end \ No newline at end of file diff --git a/templates/app/controllers/hq/admins_controller.rb b/templates/app/controllers/hq/admins_controller.rb deleted file mode 100644 index 07fe32e..0000000 --- a/templates/app/controllers/hq/admins_controller.rb +++ /dev/null @@ -1,64 +0,0 @@ -class Hq::AdminsController < Hq::ApplicationController - - before_action :set_admin, only: [:show, :edit, :update, :destroy, :toggle_is_active] - add_breadcrumb I18n.t('activerecord.models.admins'), :hq_admins_path - - def index - @search = Admin.order(id: :desc).search(params[:q]) - @admins = @search.result(distinct: true).paginate(page: params[:page]) - respond_with(@admins) - end - - def show - add_breadcrumb @admin.name, hq_admin_path(@admin) - respond_with(@admin) - end - - def new - add_breadcrumb t('tooltips.new'), new_hq_admin_path - @admin = Admin.new - respond_with(@admin) - end - - def edit - add_breadcrumb @admin.name, hq_admin_path(@admin) - add_breadcrumb t('tooltips.edit'), edit_hq_admin_path - end - - def create - @admin = Admin.new(admin_params) - @admin.save - respond_with(:hq, @admin) - end - - def update - @admin.update(admin_params) - respond_with(:hq, @admin) - end - - def destroy - @admin.destroy - respond_with(:hq, @admin, location: request.referer) - end - - def toggle_is_active - if @admin.update( is_active: !@admin.is_active ) - @admin.is_active ? - flash[:info] = t('flash.actions.toggle_is_active.active', resource_name: Admin.model_name.human) : - flash[:info] = t('flash.actions.toggle_is_active.passive', resource_name: Admin.model_name.human) - else - flash[:danger] = t('flash.messages.error_occurred') - end - respond_with(:hq, @admin, location: request.referer) - end - - private - - def set_admin - @admin = Admin.find(params[:id]) - end - - def admin_params - params.require(:admin).permit(:email, :name, :surname) - end -end diff --git a/templates/app/controllers/hq/application_controller.rb b/templates/app/controllers/hq/application_controller.rb deleted file mode 100644 index dbf323d..0000000 --- a/templates/app/controllers/hq/application_controller.rb +++ /dev/null @@ -1,18 +0,0 @@ -require 'application_responder' - -class Hq::ApplicationController < ActionController::Base - - before_filter :set_audit_user - before_action :authenticate_admin! - - self.responder = ApplicationResponder - respond_to :html, :json - - private - - def set_audit_user - # Set audit current user - Audited.current_user_method = :current_admin - end - -end \ No newline at end of file diff --git a/templates/app/controllers/hq/audits_controller.rb b/templates/app/controllers/hq/audits_controller.rb deleted file mode 100644 index 125196c..0000000 --- a/templates/app/controllers/hq/audits_controller.rb +++ /dev/null @@ -1,16 +0,0 @@ -class Hq::AuditsController < Hq::ApplicationController - - add_breadcrumb I18n.t('activerecord.models.audits'), :hq_audits_path - - def index - @search = Audit.includes(:user).reorder('id DESC').search(params[:q]) - @audits = @search.result(distinct: true).paginate(page: params[:page]) - @auditable_types = Audited::Adapters::ActiveRecord::Audit.select('auditable_type').group('auditable_type').reorder('') - end - - def show - @audit = Audit.find(params[:id]) - add_breadcrumb @audit.id, hq_audit_path(id: @audit) - end - -end diff --git a/templates/app/controllers/hq/cities_controller.rb b/templates/app/controllers/hq/cities_controller.rb deleted file mode 100755 index 62d04e8..0000000 --- a/templates/app/controllers/hq/cities_controller.rb +++ /dev/null @@ -1,54 +0,0 @@ -class Hq::CitiesController < Hq::ApplicationController - - before_action :set_city, only: [:show, :edit, :update, :destroy] - add_breadcrumb I18n.t('activerecord.models.cities'), :hq_cities_path - - def index - @search = City.includes(:country).order(id: :desc).search(params[:q]) - @cities = @search.result(distinct: true).paginate(page: params[:page]) - respond_with(@cities) - end - - def show - add_breadcrumb @city.name, hq_city_path(@city) - respond_with(@city) - end - - def new - add_breadcrumb t('tooltips.new'), new_hq_city_path - @city = City.new - respond_with(@city) - end - - def edit - add_breadcrumb @city.name, hq_city_path(@city) - add_breadcrumb t('tooltips.edit'), edit_hq_city_path - end - - def create - @city = City.new(city_params) - @city.save - respond_with(:hq, @city) - end - - def update - @city.update(city_params) - respond_with(:hq, @city) - end - - def destroy - @city.destroy - respond_with(:hq, @city, location: request.referer) - end - - private - - def city_params - params.require(:city).permit(:name, :country_id) - end - - def set_city - @city = City.find(params[:id]) - end - -end diff --git a/templates/app/controllers/hq/countries_controller.rb b/templates/app/controllers/hq/countries_controller.rb deleted file mode 100755 index a187496..0000000 --- a/templates/app/controllers/hq/countries_controller.rb +++ /dev/null @@ -1,54 +0,0 @@ -class Hq::CountriesController < Hq::ApplicationController - - before_action :set_country, only: [:show, :edit, :update, :destroy] - add_breadcrumb I18n.t('activerecord.models.countries'), :hq_countries_path - - def index - @search = Country.order(id: :desc).search(params[:q]) - @countries = @search.result(distinct: true).paginate(page: params[:page]) - respond_with(@countries) - end - - def show - add_breadcrumb @country.name, hq_country_path(@country) - respond_with(@country) - end - - def new - add_breadcrumb t('tooltips.new'), new_hq_country_path - @country = Country.new - respond_with(@country) - end - - def edit - add_breadcrumb @country.name, hq_country_path(@country) - add_breadcrumb t('tooltips.edit'), edit_hq_country_path - end - - def create - @country = Country.new(country_params) - @country.save - respond_with(:hq, @country) - end - - def update - @country.update(country_params) - respond_with(:hq, @country) - end - - def destroy - @country.destroy - respond_with(:hq, @country, location: request.referer) - end - - private - - def country_params - params.require(:country).permit(:name) - end - - def set_country - @country = Country.find(params[:id]) - end - -end diff --git a/templates/app/controllers/hq/dashboard_controller.rb b/templates/app/controllers/hq/dashboard_controller.rb deleted file mode 100644 index 2dc434e..0000000 --- a/templates/app/controllers/hq/dashboard_controller.rb +++ /dev/null @@ -1,8 +0,0 @@ -class Hq::DashboardController < Hq::ApplicationController - - add_breadcrumb I18n.t('dock.dashboard'), :hq_dashboard_index_path - - def index - end - -end \ No newline at end of file diff --git a/templates/app/controllers/hq/passwords_controller.rb b/templates/app/controllers/hq/passwords_controller.rb deleted file mode 100644 index f7b93ed..0000000 --- a/templates/app/controllers/hq/passwords_controller.rb +++ /dev/null @@ -1,10 +0,0 @@ -class Hq::PasswordsController < Devise::PasswordsController - layout 'hq/login' - - private - - def after_resetting_password_path_for(resource) - hq_root_path - end - -end diff --git a/templates/app/controllers/hq/registrations_controller.rb b/templates/app/controllers/hq/registrations_controller.rb deleted file mode 100644 index 2fdb83c..0000000 --- a/templates/app/controllers/hq/registrations_controller.rb +++ /dev/null @@ -1,21 +0,0 @@ -class Hq::RegistrationsController < Devise::RegistrationsController - layout 'hq/application' - before_action :authenticate_admin! - before_action :redirect_admin, only: [:new, :create, :destroy] - add_breadcrumb I18n.t('dock.dashboard'), :hq_dashboard_index_path - - def edit - add_breadcrumb I18n.t('tt.edit', resource_name: Admin.model_name.human) - end - - private - - def redirect_admin - redirect_to hq_root_path - end - - def after_update_path_for(resource) - hq_root_path - end - -end \ No newline at end of file diff --git a/templates/app/controllers/hq/sessions_controller.rb b/templates/app/controllers/hq/sessions_controller.rb deleted file mode 100644 index a9d3d04..0000000 --- a/templates/app/controllers/hq/sessions_controller.rb +++ /dev/null @@ -1,16 +0,0 @@ -class Hq::SessionsController < Devise::SessionsController - layout 'hq/login' - - private - - # Overwriting the sign_out redirect path method - def after_sign_in_path_for(resource_or_scope) - hq_root_path - end - - # Overwriting the sign_out redirect path method - def after_sign_out_path_for(resource_or_scope) - new_admin_session_path - end - -end \ No newline at end of file diff --git a/templates/app/controllers/hq/users_controller.rb b/templates/app/controllers/hq/users_controller.rb deleted file mode 100644 index 518bce2..0000000 --- a/templates/app/controllers/hq/users_controller.rb +++ /dev/null @@ -1,64 +0,0 @@ -class Hq::UsersController < Hq::ApplicationController - - before_action :set_user, only: [:show, :edit, :update, :destroy, :toggle_is_active] - add_breadcrumb I18n.t('activerecord.models.users'), :hq_users_path - - def index - @search = User.order(id: :desc).search(params[:q]) - @users = @search.result(distinct: true).paginate(page: params[:page]) - respond_with(@users) - end - - def show - add_breadcrumb @user.name, hq_user_path(@user) - respond_with(@user) - end - - def new - add_breadcrumb t('tooltips.new'), new_hq_user_path - @user = User.new - respond_with(@user) - end - - def edit - add_breadcrumb @user.name, hq_user_path(@user) - add_breadcrumb t('tooltips.edit'), edit_hq_user_path - end - - def create - @user = User.new(user_params) - @user.save - respond_with(:hq, @user) - end - - def update - @user.update(user_params) - respond_with(:hq, @user) - end - - def destroy - @user.destroy - respond_with(:hq, @user, location: request.referer) - end - - def toggle_is_active - if @user.update( is_active: !@user.is_active ) - @user.is_active ? - flash[:info] = t('flash.actions.toggle_is_active.active', resource_name: User.model_name.human) : - flash[:info] = t('flash.actions.toggle_is_active.passive', resource_name: User.model_name.human) - else - flash[:danger] = t('flash.messages.error_occurred') - end - respond_with(:hq, @user, location: request.referer) - end - - private - - def set_user - @user = User.find(params[:id]) - end - - def user_params - params.require(:user).permit(:email, :name, :surname, :time_zone) - end -end diff --git a/templates/app/controllers/user/dashboard_controller.rb b/templates/app/controllers/user/dashboard_controller.rb deleted file mode 100644 index 1b7c7c7..0000000 --- a/templates/app/controllers/user/dashboard_controller.rb +++ /dev/null @@ -1,8 +0,0 @@ -class User::DashboardController < User::UserApplicationController - - add_breadcrumb I18n.t('dock.dashboard'), :user_dashboard_index_path - - def index - end - -end \ No newline at end of file diff --git a/templates/app/controllers/user/passwords_controller.rb b/templates/app/controllers/user/passwords_controller.rb deleted file mode 100644 index 231d4c9..0000000 --- a/templates/app/controllers/user/passwords_controller.rb +++ /dev/null @@ -1,10 +0,0 @@ -class User::PasswordsController < Devise::PasswordsController - # layout 'user/login' - - private - - def after_resetting_password_path_for(resource) - user_root_path - end - -end diff --git a/templates/app/controllers/user/profile_controller.rb b/templates/app/controllers/user/profile_controller.rb deleted file mode 100644 index a5150d2..0000000 --- a/templates/app/controllers/user/profile_controller.rb +++ /dev/null @@ -1,34 +0,0 @@ -class User::ProfileController < User::UserApplicationController - - before_action :set_profile, only: [:show, :edit, :update] - add_breadcrumb I18n.t('dock.profile'), :user_profile_path - - def show - add_breadcrumb @profile.full_name, user_profile_path - respond_with(:user, @profile) - end - - def edit - add_breadcrumb t('tooltips.edit'), edit_user_profile_path - end - - def update - @profile.update(profile_params) - respond_with(:user, @profile, location: user_profile_path) - end - - private - - def set_profile - @profile = current_user - end - - def profile_params - params.require(:user) - .permit( - :name, - :surname, - :time_zone - ) - end -end diff --git a/templates/app/controllers/user/registrations_controller.rb b/templates/app/controllers/user/registrations_controller.rb deleted file mode 100644 index 1740759..0000000 --- a/templates/app/controllers/user/registrations_controller.rb +++ /dev/null @@ -1,20 +0,0 @@ -class User::RegistrationsController < Devise::RegistrationsController - # layout 'user/application' - before_action :authenticate_user!, except: [:new, :create] - before_action :redirect_user, only: [:destroy] - add_breadcrumb I18n.t('activerecord.models.user'), :user_root_path - - def edit - end - - private - - def redirect_user - redirect_to user_root_path - end - - def after_update_path_for(resource) - user_root_path - end - -end \ No newline at end of file diff --git a/templates/app/controllers/user/sessions_controller.rb b/templates/app/controllers/user/sessions_controller.rb deleted file mode 100644 index 2ecb281..0000000 --- a/templates/app/controllers/user/sessions_controller.rb +++ /dev/null @@ -1,16 +0,0 @@ -class User::SessionsController < Devise::SessionsController - # layout 'user/login' - - private - - # Overwriting the sign_out redirect path method - def after_sign_in_path_for(resource_or_scope) - user_root_path - end - - # Overwriting the sign_out redirect path method - def after_sign_out_path_for(resource_or_scope) - new_user_session_path - end - -end \ No newline at end of file diff --git a/templates/app/controllers/user/user_application_controller.rb b/templates/app/controllers/user/user_application_controller.rb deleted file mode 100644 index f6902cc..0000000 --- a/templates/app/controllers/user/user_application_controller.rb +++ /dev/null @@ -1,26 +0,0 @@ -require 'application_responder' - -class User::UserApplicationController < ActionController::Base - - # layout 'user/application' - layout 'application' - before_filter :set_audit_user, :set_user_time_zone - before_action :authenticate_user! - - self.responder = ApplicationResponder - respond_to :html, :json - - protected - - def set_user_time_zone - Time.zone = current_user.time_zone if current_user.time_zone.present? - end - - private - - def set_audit_user - # Set audit current user - Audited.current_user_method = :current_user - end - -end \ No newline at end of file diff --git a/templates/app/controllers/welcome_controller.rb b/templates/app/controllers/welcome_controller.rb deleted file mode 100644 index 89f412e..0000000 --- a/templates/app/controllers/welcome_controller.rb +++ /dev/null @@ -1,4 +0,0 @@ -class WelcomeController < ApplicationController - def index - end -end \ No newline at end of file diff --git a/templates/app/helpers/application_helper.rb.erb b/templates/app/helpers/application_helper.rb.erb deleted file mode 100644 index e91813d..0000000 --- a/templates/app/helpers/application_helper.rb.erb +++ /dev/null @@ -1,27 +0,0 @@ -module ApplicationHelper - - def get_countries - Country.all.map{|c| ["#{c.name}", c.id] } - end - - def get_cities - City.all.map{|c| ["#{c.name}", c.id] } - end - - def get_active_users - User.active.map{|c| ["#{c.email} - #{c.full_name}", c.id] } - end - - def get_users - User.all.map{|c| ["#{c.email} - #{c.full_name}", c.id] } - end - - def get_admins - Admin.all.map{|c| ["#{c.email} - #{c.full_name}", c.id] } - end - - def get_audit_users - [[t('activerecord.models.admin'), 'Admin'], [t('activerecord.models.user'), 'User']] - end - -end diff --git a/templates/app/mailers/admin_mailer.rb b/templates/app/mailers/admin_mailer.rb deleted file mode 100644 index d6e9e8e..0000000 --- a/templates/app/mailers/admin_mailer.rb +++ /dev/null @@ -1,10 +0,0 @@ -class AdminMailer < BaseMailer - - def login_info(admin_id, password) - @admin = Admin.find admin_id - @password = password - @subject = t('email.admin.login_info.title') - mail(to: @admin.email, subject: @subject) - end - -end diff --git a/templates/app/mailers/base_mailer.rb b/templates/app/mailers/base_mailer.rb deleted file mode 100644 index 96cc425..0000000 --- a/templates/app/mailers/base_mailer.rb +++ /dev/null @@ -1,4 +0,0 @@ -class BaseMailer < ActionMailer::Base - default from: Settings.email.noreply - layout 'mailer' -end \ No newline at end of file diff --git a/templates/app/mailers/user_mailer.rb b/templates/app/mailers/user_mailer.rb deleted file mode 100644 index 286457b..0000000 --- a/templates/app/mailers/user_mailer.rb +++ /dev/null @@ -1,10 +0,0 @@ -class UserMailer < BaseMailer - - def login_info(user_id, password) - @user = User.find user_id - @password = password - @subject = t('email.user.login_info.title') - mail(to: @user.email, subject: @subject) - end - -end diff --git a/templates/app/models/admin.rb b/templates/app/models/admin.rb deleted file mode 100644 index bf79ee6..0000000 --- a/templates/app/models/admin.rb +++ /dev/null @@ -1,51 +0,0 @@ -class Admin < ActiveRecord::Base - # Virtual attributes - attr_accessor :is_generated_password - - # Include default devise modules. Others available are: - # :confirmable, :lockable, :timeoutable and :omniauthable - devise :database_authenticatable, - :async, - :recoverable, - :rememberable, - :trackable, - :validatable - - # Helpers - audited except: [:password] - - # Validations - validates_presence_of :name, :email, :surname - validates :email, uniqueness: true - - # Callbacks - after_commit :send_login_info, on: :create - before_validation :create_password, on: :create - after_initialize do |obj| - obj.is_generated_password = false - end - - def active_for_authentication? - super && self.is_active - end - - def full_name - "#{self.name} #{self.surname}" - end - - private - - def create_password - if self.password.nil? - password = Devise.friendly_token.first(8) - self.password = password - self.password_confirmation = password - self.is_generated_password = true - end - end - - def send_login_info - AdminMailer.login_info(self.id, self.password).deliver_later! if self.is_generated_password - end - -end diff --git a/templates/app/models/audit.rb b/templates/app/models/audit.rb deleted file mode 100644 index ea4f541..0000000 --- a/templates/app/models/audit.rb +++ /dev/null @@ -1,3 +0,0 @@ -class Audit < Audited::Adapters::ActiveRecord::Audit - -end \ No newline at end of file diff --git a/templates/app/models/city.rb b/templates/app/models/city.rb deleted file mode 100644 index 8b1b529..0000000 --- a/templates/app/models/city.rb +++ /dev/null @@ -1,12 +0,0 @@ -class City < ActiveRecord::Base - - # Helpers - audited - - # Relations - belongs_to :country - - # Validations - validates_presence_of :name, :country_id - -end diff --git a/templates/app/models/country.rb b/templates/app/models/country.rb deleted file mode 100644 index 737399b..0000000 --- a/templates/app/models/country.rb +++ /dev/null @@ -1,12 +0,0 @@ -class Country < ActiveRecord::Base - - # Helpers - audited - - # Relations - has_many :cities, dependent: :restrict_with_error - - # Validations - validates_presence_of :name - -end diff --git a/templates/app/models/user.rb b/templates/app/models/user.rb deleted file mode 100644 index 2a90ebe..0000000 --- a/templates/app/models/user.rb +++ /dev/null @@ -1,54 +0,0 @@ -class User < ActiveRecord::Base - # Virtual attributes - attr_accessor :is_generated_password - - # Scopes - scope :active, -> { where(is_active: true) } - - # Include default devise modules. Others available are: - # :confirmable, :lockable, :timeoutable and :omniauthable - devise :database_authenticatable, - :registerable, - :async, - :recoverable, - :rememberable, - :trackable, - :validatable - - # Helpers - audited except: [:password] - - # Validations - validates_presence_of :name, :email, :surname - validates :email, uniqueness: true - - # Callbacks - after_commit :send_login_info, on: :create - before_validation :create_password, on: :create - after_initialize do |obj| - obj.is_generated_password = false - end - - def active_for_authentication? - super && self.is_active - end - - def full_name - "#{self.name} #{self.surname}" - end - - private - - def create_password - if self.password.nil? - password = Devise.friendly_token.first(8) - self.password = password - self.password_confirmation = password - self.is_generated_password = true - end - end - - def send_login_info - UserMailer.login_info(self.id, self.password).deliver_later! if self.is_generated_password - end -end diff --git a/templates/app/views/admin_mailer/login_info.html.haml b/templates/app/views/admin_mailer/login_info.html.haml deleted file mode 100644 index 09a247a..0000000 --- a/templates/app/views/admin_mailer/login_info.html.haml +++ /dev/null @@ -1,13 +0,0 @@ -%h2= t('email.hello') - -%p= t('email.admin.login_info.first_info') -%p= "#{t('email.admin.login_info.second_info')} :" -%p - %strong= "#{t('activerecord.attributes.admin.email')} :" - = @admin.email -%p - %strong= "#{t('activerecord.attributes.admin.password')} :" - = @password -%p= link_to t('email.admin.login_info.btn_login'), new_admin_session_url - -%p= t('email.admin.login_info.last_info', link: new_admin_session_url ).html_safe \ No newline at end of file diff --git a/templates/app/views/devise/confirmations/new.html.haml b/templates/app/views/devise/confirmations/new.html.haml deleted file mode 100644 index 75479be..0000000 --- a/templates/app/views/devise/confirmations/new.html.haml +++ /dev/null @@ -1,10 +0,0 @@ -%h2 - = t('devise.confirmation.new.title') -= simple_form_for(resource, as: resource_name, url: confirmation_path(resource_name), html: { method: :post }) do |f| - = f.error_notification - = f.full_error :confirmation_token - .form-inputs - = f.input :email, required: true, autofocus: true - .form-actions - = f.button :submit, t('devise.confirmation.btn.resend'), class: 'btn btn-primary' -= render 'devise/shared/links' diff --git a/templates/app/views/devise/mailer/confirmation_instructions.html.haml b/templates/app/views/devise/mailer/confirmation_instructions.html.haml deleted file mode 100644 index 5d77634..0000000 --- a/templates/app/views/devise/mailer/confirmation_instructions.html.haml +++ /dev/null @@ -1,6 +0,0 @@ -%p - = t( 'email.salut', user: @resource.email ) -%p - = "#{t( 'email.devise.confirmation_instruction.desc1')} :" -%p - = link_to t( 'email.devise.confirmation_instruction.btn_confirm'), confirmation_url(@resource, confirmation_token: @token) diff --git a/templates/app/views/devise/mailer/reset_password_instructions.html.haml b/templates/app/views/devise/mailer/reset_password_instructions.html.haml deleted file mode 100644 index e35ac0d..0000000 --- a/templates/app/views/devise/mailer/reset_password_instructions.html.haml +++ /dev/null @@ -1,9 +0,0 @@ -%p - = t( 'email.salut', user: @resource.email ) -%p - = t( 'email.devise.reset_password.desc1') -%p= link_to t( 'email.devise.reset_password.change'), edit_password_url(@resource, reset_password_token: @token) -%p - = t( 'email.devise.reset_password.desc2') -%p - = t( 'email.devise.reset_password.desc3') \ No newline at end of file diff --git a/templates/app/views/devise/mailer/unlock_instructions.html.haml b/templates/app/views/devise/mailer/unlock_instructions.html.haml deleted file mode 100644 index 72f6a0b..0000000 --- a/templates/app/views/devise/mailer/unlock_instructions.html.haml +++ /dev/null @@ -1,5 +0,0 @@ -%p - Hello #{@resource.email}! -%p Your account has been locked due to an excessive number of unsuccessful sign in attempts. -%p Click the link below to unlock your account: -%p= link_to 'Unlock my account', unlock_url(@resource, :unlock_token => @resource.unlock_token) diff --git a/templates/app/views/devise/passwords/edit.html.haml b/templates/app/views/devise/passwords/edit.html.haml deleted file mode 100644 index 326e2e6..0000000 --- a/templates/app/views/devise/passwords/edit.html.haml +++ /dev/null @@ -1,11 +0,0 @@ -%h2= t('devise.password.edit.title') -= simple_form_for(resource, as: resource_name, url: password_path(resource_name), html: { method: :put }) do |f| - = f.error_notification - = f.input :reset_password_token, as: :hidden - = f.full_error :reset_password_token - .form-inputs - = f.input :password, label: t('devise.password.edit.new_password'), required: true, autofocus: true - = f.input :password_confirmation, label: t('devise.password.edit.confirmation'), required: true - .form-actions - = f.button :submit, t('devise.password.edit.button'), class: 'btn btn-primary' -= render 'devise/shared/links' \ No newline at end of file diff --git a/templates/app/views/devise/passwords/new.html.haml b/templates/app/views/devise/passwords/new.html.haml deleted file mode 100644 index a6b3fe9..0000000 --- a/templates/app/views/devise/passwords/new.html.haml +++ /dev/null @@ -1,9 +0,0 @@ -%h2= t('devise.password.reset.title') -= simple_form_for(resource, as: resource_name, url: password_path(resource_name), html: { method: :post }) do |f| - = f.error_notification - .form-inputs - = f.input :email, required: true, autofocus: true - .form-actions - = f.button :submit, t('devise.password.reset.instructions'), class: 'btn btn-primary' -%br -= render 'devise/shared/links' \ No newline at end of file diff --git a/templates/app/views/devise/registrations/edit.html.haml b/templates/app/views/devise/registrations/edit.html.haml deleted file mode 100644 index 44b3212..0000000 --- a/templates/app/views/devise/registrations/edit.html.haml +++ /dev/null @@ -1,12 +0,0 @@ -%h2 - = t('devise.registration.title', model: resource.class.model_name.human ) -= simple_form_for(resource, as: resource_name, url: registration_path(resource_name), html: { method: :put }, validate: true) do |f| - = f.error_notification - .form-inputs - = f.input :email, required: true, autofocus: true - = f.input :password, autocomplete: 'off', hint: t('devise.registration.hint_password'), required: false - = f.input :password_confirmation, required: false - = f.input :current_password, hint: t('devise.registration.hint_current_password'), required: true - .form-actions - = f.button :submit, t('btn.update'), class: 'btn btn-primary' -= link_to t('btn.back'), :back diff --git a/templates/app/views/devise/registrations/new.html.haml b/templates/app/views/devise/registrations/new.html.haml deleted file mode 100644 index 79d1f8a..0000000 --- a/templates/app/views/devise/registrations/new.html.haml +++ /dev/null @@ -1,24 +0,0 @@ -%h2 - = t('devise.registration.new.title', model: resource.class.model_name.human) -%hr/ -- if devise_mapping.omniauthable? - - resource_class.omniauth_providers.each do |provider| - = link_to omniauth_authorize_path(resource_name, provider), class: 'btn btn-lg btn-primary btn-block' do - %i.fa.fa-facebook - = t('devise.shared.links.signup_with', name: provider.to_s.titleize) - %hr/ - %h3.text-center - = t('view.or') - %hr/ -= simple_form_for(resource, as: resource_name, url: registration_path(resource_name), validate: true) do |f| - = f.error_notification - .form-inputs - = f.input :email - = f.input :password - = f.input :password_confirmation - = f.input :name - = f.input :surname - = f.input :time_zone, input_html: { class: 'chosen-select'}, include_blank: t('view.select') - .form-actions - = f.button :submit, t('devise.registration.new.button'), class: 'btn btn-primary' -= render 'devise/shared/links' \ No newline at end of file diff --git a/templates/app/views/devise/sessions/new.html.haml b/templates/app/views/devise/sessions/new.html.haml deleted file mode 100644 index ce058de..0000000 --- a/templates/app/views/devise/sessions/new.html.haml +++ /dev/null @@ -1,10 +0,0 @@ -%h2 - = t('devise.session.title', model: resource.class.model_name.human ) -= simple_form_for(resource, as: resource_name, url: session_path(resource_name)) do |f| - .form-inputs - = f.input :email, required: false, autofocus: true - = f.input :password, required: false - = f.input :remember_me, label: t('devise.session.remember_me'), as: :boolean if devise_mapping.rememberable? - .form-actions - = f.button :submit, t('devise.session.button'), class: 'btn btn-primary' -= render 'devise/shared/links' diff --git a/templates/app/views/devise/shared/_links.haml b/templates/app/views/devise/shared/_links.haml deleted file mode 100644 index c2aca8f..0000000 --- a/templates/app/views/devise/shared/_links.haml +++ /dev/null @@ -1,22 +0,0 @@ -%br -- if controller_name != 'sessions' - = link_to t('devise.shared.links.signin'), new_session_path(resource_name) - %br/ -- if devise_mapping.registerable? && controller_name != 'registrations' - = link_to t('devise.shared.links.signup'), new_registration_path(resource_name) - %br/ -- if devise_mapping.recoverable? && controller_name != 'passwords' && controller_name != 'registrations' - = link_to t('devise.shared.links.forgot_password'), new_password_path(resource_name) - %br/ -- if devise_mapping.confirmable? && controller_name != 'confirmations' - = link_to t('devise.shared.links.confirmation_instructions'), new_confirmation_path(resource_name) - %br/ -- if devise_mapping.lockable? && resource_class.unlock_strategy_enabled?(:email) && controller_name != 'unlocks' - = link_to t('devise.shared.links.unlock_instructions'), new_unlock_path(resource_name) - %br/ -- if devise_mapping.omniauthable? - - resource_class.omniauth_providers.each do |provider| - = link_to t('devise.shared.links.signin_with', name: provider.to_s.titleize), omniauth_authorize_path(resource_name, provider) - %br/ -= link_to t('navbar.home_page'), root_path -%br/ \ No newline at end of file diff --git a/templates/app/views/devise/unlocks/new.html.haml b/templates/app/views/devise/unlocks/new.html.haml deleted file mode 100644 index c4dd03f..0000000 --- a/templates/app/views/devise/unlocks/new.html.haml +++ /dev/null @@ -1,9 +0,0 @@ -%h2 Resend unlock instructions -= simple_form_for(resource, as: resource_name, url: unlock_path(resource_name), html: { method: :post }) do |f| - = f.error_notification - = f.full_error :unlock_token - .form-inputs - = f.input :email, required: true, autofocus: true - .form-actions - = f.button :submit, 'Resend unlock instructions' -= render 'devise/shared/links' diff --git a/templates/app/views/errors/internal_server_error.html.haml b/templates/app/views/errors/internal_server_error.html.haml deleted file mode 100644 index 5eb9f5a..0000000 --- a/templates/app/views/errors/internal_server_error.html.haml +++ /dev/null @@ -1,2 +0,0 @@ -.well - %p= t('internal_server_error') \ No newline at end of file diff --git a/templates/app/views/errors/not_found.html.haml b/templates/app/views/errors/not_found.html.haml deleted file mode 100644 index db835b5..0000000 --- a/templates/app/views/errors/not_found.html.haml +++ /dev/null @@ -1,2 +0,0 @@ -.well - %p= t('not_found') \ No newline at end of file diff --git a/templates/app/views/hq/admins/_admin.html.haml b/templates/app/views/hq/admins/_admin.html.haml deleted file mode 100644 index 1647de6..0000000 --- a/templates/app/views/hq/admins/_admin.html.haml +++ /dev/null @@ -1,21 +0,0 @@ -%tr{class: admin.is_active ? 'active' : 'passive'} - %td= admin.id - %td= admin.full_name - %td= mail_to admin.email, admin.email - %td=l admin.current_sign_in_at if admin.current_sign_in_at.present? - %td=l admin.last_sign_in_at if admin.last_sign_in_at.present? - %td= admin.is_active ? t('view.active') : t('view.passive') - %td.action - = link_to([:hq, admin], class: 'btn btn-success', data: { toggle: :tooltip}, title: t('tooltips.zoom')) do - %i.icon-zoom-in - = link_to(edit_hq_admin_path(admin) , class: 'btn btn-info', data: { toggle: :tooltip }, title: t('tooltips.edit')) do - %i.icon-edit - - if admin.id != current_admin.id - = link_to([:hq, admin], class: 'btn btn-danger', method: :delete, data: { confirm: t('tooltips.are_you_sure'), toggle: :tooltip }, title: t('tooltips.delete')) do - %i.icon-trash - - if admin.is_active - = link_to(toggle_is_active_hq_admin_path(admin), class: 'btn btn-danger', method: :post, data: { toggle: :tooltip}, title: t('view.make_passive') ) do - %i.icon-ban-circle - - else - = link_to(toggle_is_active_hq_admin_path(admin), class: 'btn btn-info', method: :post, data: { toggle: :tooltip}, title: t('view.make_active')) do - %i.icon-check diff --git a/templates/app/views/hq/admins/_blank.html.haml b/templates/app/views/hq/admins/_blank.html.haml deleted file mode 100644 index 4efdfad..0000000 --- a/templates/app/views/hq/admins/_blank.html.haml +++ /dev/null @@ -1,9 +0,0 @@ -- if params[:q].present? - = render 'list' -- else - .alert.alert-warning - %p - %h3= t('view.there_is_no_data', resource: Admin.model_name.human.downcase) - = link_to new_hq_admin_path, class: 'btn btn-primary' do - = t('action_button.new', resource_name: Admin.model_name.human) - = t('btn.add') \ No newline at end of file diff --git a/templates/app/views/hq/admins/_filters.html.haml b/templates/app/views/hq/admins/_filters.html.haml deleted file mode 100644 index 1258558..0000000 --- a/templates/app/views/hq/admins/_filters.html.haml +++ /dev/null @@ -1,20 +0,0 @@ -.table-header.row - .col-lg-3 - = link_to hq_admins_path(q: {is_active_true: 1}), class: 'btn btn-success' do - = t('view.active') - %span.badge= Admin.where(is_active: true).count - = link_to hq_admins_path(q: {is_active_false: 1}), class: 'btn btn-warning' do - = t('view.passive') - %span.badge= Admin.where(is_active: false).count - - if params[:q].present? && (params[:q][:is_active_true].present? || params[:q][:is_active_false].present? || params[:q][:name_or_surname_cont].present?) - = link_to hq_admins_path, class: 'btn btn-info' do - = t('view.all') - %span.badge= Admin.count - .col-lg-9 - = search_form_for [:hq, @search], builder: SimpleForm::FormBuilder, html: {class: 'form-inline', data: { turboform: true }} do |f| - .pull-right - .input-group - = f.input_field :name_or_surname_cont, label: false, class: 'form-control', placeholder: t('view.quick_search') - %span.input-group-btn - = button_tag( class: 'btn btn-primary') do - %i.icon-search \ No newline at end of file diff --git a/templates/app/views/hq/admins/_form.html.haml b/templates/app/views/hq/admins/_form.html.haml deleted file mode 100644 index 1be8c84..0000000 --- a/templates/app/views/hq/admins/_form.html.haml +++ /dev/null @@ -1,17 +0,0 @@ -.panel.panel-default - .panel-heading - %i.icon-edit.icon-large - = yield :form_title - .panel-body - = simple_form_for([:hq, @admin], validate: true) do |f| - = f.error_notification - - .form-inputs - = f.input :name - = f.input :surname - = f.input :email - - .form-actions - - text = @admin.id.present? ? t('btn.update') : t('btn.add') - = f.button :submit, text, class: 'btn btn-primary' - = link_to t('cancel'), hq_admins_path, class: 'btn' diff --git a/templates/app/views/hq/admins/_list.html.haml b/templates/app/views/hq/admins/_list.html.haml deleted file mode 100644 index f565f6c..0000000 --- a/templates/app/views/hq/admins/_list.html.haml +++ /dev/null @@ -1,15 +0,0 @@ -.panel-body.filters - = render 'filters' -%table.table - %thead - %tr - %th= sort_link(@search, :id, t('activerecord.attributes.admin.id')) - %th= sort_link(@search, :name, t('activerecord.attributes.admin.name')) - %th= sort_link(@search, :email, t('activerecord.attributes.admin.email')) - %th= sort_link(@search, :current_sign_in_at, t('activerecord.attributes.admin.current_sign_in_at')) - %th= sort_link(@search, :last_sign_in_at, t('activerecord.attributes.admin.last_sign_in_at')) - %th= sort_link(@search, :is_active, t('activerecord.attributes.admin.is_active')) - %th.actions - = t('view.actions') - %tbody.admins - = render @admins diff --git a/templates/app/views/hq/admins/edit.html.haml b/templates/app/views/hq/admins/edit.html.haml deleted file mode 100644 index 9000772..0000000 --- a/templates/app/views/hq/admins/edit.html.haml +++ /dev/null @@ -1,3 +0,0 @@ -- content_for :form_title do - = t('tt.edit', resource_name: 'Yönetici bilgilerini') -= render 'form' \ No newline at end of file diff --git a/templates/app/views/hq/admins/index.html.haml b/templates/app/views/hq/admins/index.html.haml deleted file mode 100644 index 6879306..0000000 --- a/templates/app/views/hq/admins/index.html.haml +++ /dev/null @@ -1,18 +0,0 @@ -- content_for :toolbar do - = link_to new_hq_admin_path, class: 'btn btn-default' do - %i.icon-plus - = t('action_button.new', resource_name: Admin.model_name.human) - -.panel.panel-default.grid - .panel-heading - %i.fa.fa-table.icon-large - = t('activerecord.models.admins') - .panel-tools - .btn-group - %a.btn{href: hq_admins_path, data: {toggle: 'toolbar-tooltip'}, title: t('view.reload')} - %i.fa.fa-refresh - .badge= @admins.total_entries - =blankable(@admins) - .panel-footer - .pagination.pagination-sm - = will_paginate @admins, renderer: BootstrapPagination::Rails, bootstrap: 3 \ No newline at end of file diff --git a/templates/app/views/hq/admins/new.html.haml b/templates/app/views/hq/admins/new.html.haml deleted file mode 100644 index 095ba1f..0000000 --- a/templates/app/views/hq/admins/new.html.haml +++ /dev/null @@ -1,5 +0,0 @@ -- content_for :form_title do - = t('tt.new', resource_name: Admin.model_name.human) -.alert.alert-info - = t('view.create_resource_mail_info', resource: Admin.model_name.human.downcase) -= render 'form' diff --git a/templates/app/views/hq/admins/show.html.haml b/templates/app/views/hq/admins/show.html.haml deleted file mode 100644 index 4532554..0000000 --- a/templates/app/views/hq/admins/show.html.haml +++ /dev/null @@ -1,19 +0,0 @@ -- content_for :toolbar do - = link_to edit_hq_admin_path(@admin ), class: 'btn btn-default' do - %i.icon-pencil - = t('action_button.edit') -.panel.panel-default - .panel-heading - %i.icon-edit.icon-large - = t('tt.show', resource_name: Admin.model_name.human) - .panel-body - = show_for @admin do |s| - = s.attribute :name - = s.attribute :surname - = s.attribute :email do - = mail_to @admin.email, @admin.email - = s.attribute :is_active - = s.attribute :current_sign_in_at - = s.attribute :last_sign_in_at - = s.attribute :created_at - = s.attribute :updated_at diff --git a/templates/app/views/hq/audits/_filters.html.haml b/templates/app/views/hq/audits/_filters.html.haml deleted file mode 100644 index 9f03818..0000000 --- a/templates/app/views/hq/audits/_filters.html.haml +++ /dev/null @@ -1,32 +0,0 @@ -.table-header.row - .col-lg-2 - - if params[:q].present? - = link_to hq_audits_path, class: 'btn btn-info' do - = t('view.all') - %span.badge= Audit.count - .col-lg-10 - .pull-right - = search_form_for @search, builder: SimpleForm::FormBuilder, html: {class: 'form-inline', data: { turboform: true }}, url: hq_audits_path do |f| - .form-group - = f.label :user_type, label: t('activerecord.attributes.audits.user_type') - = f.input_field :user_type_eq, label: false, class: 'form-control chosen-select', placeholder: t('activerecord.attributes.audits.user'), collection: get_audit_users, include_blank: t('view.select') - - - if params[:q].present? and params[:q][:user_type_eq].present? - - type = params[:q][:user_type_eq] - - if type == 'Admin' - = f.label :user, label: t('activerecord.attributes.audits.user') - = f.input_field :user_id_eq, label: false, class: 'form-control chosen-select', placeholder: t('activerecord.attributes.audits.user'), collection: get_admins, include_blank: t('view.select') - - elsif type == 'User' - = f.label :user, label: t('activerecord.attributes.audits.user') - = f.input_field :user_id_eq, label: false, class: 'form-control chosen-select', placeholder: t('activerecord.attributes.audits.user'), collection: get_users, include_blank: t('view.select') - - = f.label :auditable_type, label: t('activerecord.attributes.audits.auditable_type') - = f.input_field :auditable_type_eq, label: false, class: 'form-control chosen-select', placeholder: t('activerecord.attributes.audits.auditable_type'), collection: @auditable_types.map{|a| [t("activerecord.models.#{a.auditable_type.try(:underscore)}"), a.auditable_type]}, include_blank: t('view.select') - - = f.label :user, label: t('activerecord.attributes.audits.auditable_id') - = f.input_field :auditable_id_eq, label: false, class: 'form-control', placeholder: t('activerecord.attributes.audits.auditable_id') - - = f.label :user, label: t('activerecord.attributes.audits.action') - = f.input_field :action_eq, label: false, class: 'form-control chosen-select', placeholder: t('activerecord.attributes.audits.action'), collection: %w(create update destroy).map{|a| [t("actions.#{a}"), a]}, include_blank: t('view.select') - = button_tag( class: 'btn btn-success btn-group') do - %i.fa.fa-search \ No newline at end of file diff --git a/templates/app/views/hq/audits/_list.html.haml b/templates/app/views/hq/audits/_list.html.haml deleted file mode 100644 index bc8024e..0000000 --- a/templates/app/views/hq/audits/_list.html.haml +++ /dev/null @@ -1,37 +0,0 @@ -.panel-heading - %i.fa.fa-list - = t('activerecord.models.audits') - .panel-tools - .btn-group - %a.btn{href: hq_audits_path, data: {toggle: 'toolbar-tooltip'}, title: t('view.reload')} - %i.icon-refresh - .badge= @audits.total_entries -.panel-body.filters - = render 'filters' -.table-responsive - %table.table - %thead - %tr - %th= sort_link(@search, :id, t('activerecord.attributes.audits.id')) - %th= sort_link(@search, :user_type, t('activerecord.attributes.audits.user_type')) - %th= sort_link(@search, :user_id, t('activerecord.attributes.audits.user')) - %th= sort_link(@search, :auditable_type, t('activerecord.attributes.audits.auditable_type')) - %th= sort_link(@search, :auditable_id, t('activerecord.attributes.audits.auditable_id')) - %th= sort_link(@search, :auditable_id, t('activerecord.attributes.audits.created_at')) - %th= sort_link(@search, :action, t('activerecord.attributes.audits.action')) - %th.actions - = t('view.actions') - %tbody - - @audits.each do |audit| - %tr - %td= audit.id - %td - = t("activerecord.models.#{audit.try(:user_type).try(:downcase)}") if audit.try(:user_type).present? - %td= "#{audit.try(:user).try(:full_name)} - #{audit.try(:user).try(:email)}" - %td= t("activerecord.models.#{audit.try(:auditable_type).try(:underscore)}") if audit.try(:auditable_type).present? - %td= audit.auditable_id - %td= l audit.created_at - %td= t("actions.#{audit.action}") - %td.actions - = link_to(hq_audit_path(id: audit), class: 'btn btn-success btn-xs', 'data-toggle' => 'tooltip', title: t('tooltips.zoom')) do - %i.fa.fa-eye \ No newline at end of file diff --git a/templates/app/views/hq/audits/index.html.haml b/templates/app/views/hq/audits/index.html.haml deleted file mode 100644 index eac51e8..0000000 --- a/templates/app/views/hq/audits/index.html.haml +++ /dev/null @@ -1,5 +0,0 @@ -.panel.panel-default.grid - = render 'list' - .panel-footer - .pagination.pagination-sm - = will_paginate @audits, renderer: BootstrapPagination::Rails, bootstrap: 3 diff --git a/templates/app/views/hq/audits/show.html.haml b/templates/app/views/hq/audits/show.html.haml deleted file mode 100644 index b1d45d6..0000000 --- a/templates/app/views/hq/audits/show.html.haml +++ /dev/null @@ -1,5 +0,0 @@ -- @audit.audited_changes.keys.each do |key| - %p - %strong - = t("activerecord.attributes.#{@audit.try(:auditable_type).try(:underscore)}.#{key}") if @audit.try(:auditable_type).present? - = @audit.audited_changes[key] diff --git a/templates/app/views/hq/cities/_blank.html.haml b/templates/app/views/hq/cities/_blank.html.haml deleted file mode 100644 index ab6784a..0000000 --- a/templates/app/views/hq/cities/_blank.html.haml +++ /dev/null @@ -1,9 +0,0 @@ -- if params[:q].present? - = render 'list' -- else - .alert.alert-warning - %p - %h3= t('view.there_is_no_data', resource: City.model_name.human.downcase) - = link_to new_hq_city_path, class: 'btn btn-primary' do - = t('action_button.new', resource_name: City.model_name.human) - = t('btn.add') \ No newline at end of file diff --git a/templates/app/views/hq/cities/_city.html.haml b/templates/app/views/hq/cities/_city.html.haml deleted file mode 100644 index fdf13ca..0000000 --- a/templates/app/views/hq/cities/_city.html.haml +++ /dev/null @@ -1,12 +0,0 @@ -%tr - %td= city.id - %td= city.name - %td= city.country.name - %td=l city.created_at - %td.action - = link_to([:hq, city], class: 'btn btn-success', data: { toggle: :tooltip}, title: t('tooltips.zoom')) do - %i.icon-eye-open - = link_to(edit_hq_city_path(city) , class: 'btn btn-info', data: { toggle: :tooltip }, title: t('tooltips.edit')) do - %i.icon-edit - = link_to([:hq, city], class: 'btn btn-danger', method: :delete, data: { confirm: t('tooltips.are_you_sure'), toggle: :tooltip }, title: t('tooltips.delete')) do - %i.icon-trash \ No newline at end of file diff --git a/templates/app/views/hq/cities/_filters.html.haml b/templates/app/views/hq/cities/_filters.html.haml deleted file mode 100644 index efb10b8..0000000 --- a/templates/app/views/hq/cities/_filters.html.haml +++ /dev/null @@ -1,15 +0,0 @@ -.table-header.row - .col-lg-3 - - if params[:q].present? && (params[:q][:name_cont].present?) - = link_to hq_cities_path, class: 'btn btn-info' do - = t('view.all') - %span.badge= City.count - .col-lg-9 - = search_form_for [:hq, @search], builder: SimpleForm::FormBuilder, html: {class: 'form-inline', data: { turboform: true }} do |f| - .pull-right - = f.input :country_id_eq, label: false, collection: get_countries, include_blank: "#{t('activerecord.attributes.city.country')} #{t('view.select').downcase}", input_html: { class: 'chosen-select form-control'} - .input-group - = f.input_field :name_cont, label: false, class: 'form-control', placeholder: t('view.quick_search') - %span.input-group-btn - = button_tag( class: 'btn btn-primary') do - %i.icon-search \ No newline at end of file diff --git a/templates/app/views/hq/cities/_form.html.haml b/templates/app/views/hq/cities/_form.html.haml deleted file mode 100644 index f795484..0000000 --- a/templates/app/views/hq/cities/_form.html.haml +++ /dev/null @@ -1,15 +0,0 @@ -.panel.panel-default - .panel-heading - %i.icon-edit.icon-large - = yield :form_title - .panel-body - = simple_form_for([:hq, @city], validate: true) do |f| - = f.error_notification - - .form-inputs - = f.input :name - = f.input :country_id, collection: get_countries, include_blank: t('view.select'), input_html: { class: 'chosen-select' } - - .form-actions - = f.button :submit, class: 'btn btn-primary' - = link_to t('cancel'), hq_cities_path, class: 'btn' diff --git a/templates/app/views/hq/cities/_list.html.haml b/templates/app/views/hq/cities/_list.html.haml deleted file mode 100644 index b2f780c..0000000 --- a/templates/app/views/hq/cities/_list.html.haml +++ /dev/null @@ -1,13 +0,0 @@ -.panel-body.filters - = render 'filters' -%table.table - %thead - %tr - %th= sort_link(@search, :id, t('activerecord.attributes.city.id')) - %th= sort_link(@search, :name, t('activerecord.attributes.city.name')) - %th= sort_link(@search, :country_id, t('activerecord.attributes.city.country_id')) - %th= sort_link(@search, :created_at, t('activerecord.attributes.city.created_at')) - %th.actions - = t('view.actions') - %tbody - = render @cities diff --git a/templates/app/views/hq/cities/edit.html.haml b/templates/app/views/hq/cities/edit.html.haml deleted file mode 100644 index 9342bf2..0000000 --- a/templates/app/views/hq/cities/edit.html.haml +++ /dev/null @@ -1,3 +0,0 @@ -- content_for :form_title do - = t('tt.edit', resource_name: City.model_name.human) -= render 'form' \ No newline at end of file diff --git a/templates/app/views/hq/cities/index.html.haml b/templates/app/views/hq/cities/index.html.haml deleted file mode 100644 index 70f918a..0000000 --- a/templates/app/views/hq/cities/index.html.haml +++ /dev/null @@ -1,18 +0,0 @@ -- content_for :toolbar do - = link_to new_hq_city_path, class: 'btn btn-default' do - %i.icon-plus - = t('action_button.new', resource_name: City.model_name.human) - -.panel.panel-default.grid - .panel-heading - %i.icon-table.icon-large - = t('tt.index', resource_name: City.model_name.human) - .panel-tools - .btn-group - %a.btn{href: hq_cities_path, data: {toggle: 'toolbar-tooltip'}, title: t('view.reload')} - %i.icon-refresh - .badge= @cities.count - =blankable(@cities) - .panel-footer - .pagination.pagination-sm - = will_paginate @cities, renderer: BootstrapPagination::Rails, bootstrap: 3 \ No newline at end of file diff --git a/templates/app/views/hq/cities/new.html.haml b/templates/app/views/hq/cities/new.html.haml deleted file mode 100644 index afc0ad5..0000000 --- a/templates/app/views/hq/cities/new.html.haml +++ /dev/null @@ -1,3 +0,0 @@ -- content_for :form_title do - = t('tt.new', resource_name: City.model_name.human) -= render 'form' diff --git a/templates/app/views/hq/cities/show.html.haml b/templates/app/views/hq/cities/show.html.haml deleted file mode 100644 index 5ca4148..0000000 --- a/templates/app/views/hq/cities/show.html.haml +++ /dev/null @@ -1,13 +0,0 @@ -- content_for :toolbar do - = link_to edit_hq_city_path(@city ), class: 'btn btn-default' do - %i.icon-pencil - = t('action_button.edit') -.panel.panel-default - .panel-heading - %i.icon-edit.icon-large - = t('tt.show', resource_name: City.model_name.human) - .panel-body - = show_for @city do |s| - = s.attribute :id - = s.attribute :name - = s.attribute :name, in: :country diff --git a/templates/app/views/hq/countries/_blank.html.haml b/templates/app/views/hq/countries/_blank.html.haml deleted file mode 100644 index 6dba0f1..0000000 --- a/templates/app/views/hq/countries/_blank.html.haml +++ /dev/null @@ -1,9 +0,0 @@ -- if params[:q].present? - = render 'list' -- else - .alert.alert-warning - %p - %h3= t('view.there_is_no_data', resource: Country.model_name.human.downcase) - = link_to new_hq_country_path, class: 'btn btn-primary' do - = t('action_button.new', resource_name: Country.model_name.human) - = t('btn.add') \ No newline at end of file diff --git a/templates/app/views/hq/countries/_country.html.haml b/templates/app/views/hq/countries/_country.html.haml deleted file mode 100644 index 863fe1b..0000000 --- a/templates/app/views/hq/countries/_country.html.haml +++ /dev/null @@ -1,11 +0,0 @@ -%tr - %td= country.id - %td= country.name - %td=l country.created_at - %td.action - = link_to([:hq, country], class: 'btn btn-success', data: { toggle: :tooltip}, title: t('tooltips.zoom')) do - %i.icon-eye-open - = link_to(edit_hq_country_path(country) , class: 'btn btn-info', data: { toggle: :tooltip }, title: t('tooltips.edit')) do - %i.icon-edit - = link_to([:hq, country], class: 'btn btn-danger', method: :delete, data: { confirm: t('tooltips.are_you_sure'), toggle: :tooltip }, title: t('tooltips.delete')) do - %i.icon-trash \ No newline at end of file diff --git a/templates/app/views/hq/countries/_filters.html.haml b/templates/app/views/hq/countries/_filters.html.haml deleted file mode 100644 index 2601bb5..0000000 --- a/templates/app/views/hq/countries/_filters.html.haml +++ /dev/null @@ -1,14 +0,0 @@ -.table-header.row - .col-lg-3 - - if params[:q].present? && (params[:q][:name_cont].present?) - = link_to hq_countries_path, class: 'btn btn-info' do - = t('view.all') - %span.badge= Country.count - .col-lg-9 - = search_form_for [:hq, @search], builder: SimpleForm::FormBuilder, html: {class: 'form-inline', data: { turboform: true }} do |f| - .pull-right - .input-group - = f.input_field :name_cont, label: false, class: 'form-control', placeholder: t('view.quick_search') - %span.input-group-btn - = button_tag( class: 'btn btn-primary') do - %i.icon-search \ No newline at end of file diff --git a/templates/app/views/hq/countries/_form.html.haml b/templates/app/views/hq/countries/_form.html.haml deleted file mode 100644 index 3999e73..0000000 --- a/templates/app/views/hq/countries/_form.html.haml +++ /dev/null @@ -1,14 +0,0 @@ -.panel.panel-default - .panel-heading - %i.icon-edit.icon-large - = yield :form_title - .panel-body - = simple_form_for([:hq, @country], validate: true) do |f| - = f.error_notification - - .form-inputs - = f.input :name - - .form-actions - = f.button :submit, class: 'btn btn-primary' - = link_to t('cancel'), hq_countries_path, class: 'btn' diff --git a/templates/app/views/hq/countries/_list.html.haml b/templates/app/views/hq/countries/_list.html.haml deleted file mode 100644 index dcb0834..0000000 --- a/templates/app/views/hq/countries/_list.html.haml +++ /dev/null @@ -1,12 +0,0 @@ -.panel-body.filters - = render 'filters' -%table.table - %thead - %tr - %th= sort_link(@search, :id, t('activerecord.attributes.country.id')) - %th= sort_link(@search, :name, t('activerecord.attributes.country.name')) - %th= sort_link(@search, :created_at, t('activerecord.attributes.country.created_at')) - %th.actions - = t('view.actions') - %tbody - = render @countries diff --git a/templates/app/views/hq/countries/edit.html.haml b/templates/app/views/hq/countries/edit.html.haml deleted file mode 100644 index 8cec095..0000000 --- a/templates/app/views/hq/countries/edit.html.haml +++ /dev/null @@ -1,3 +0,0 @@ -- content_for :form_title do - = t('tt.edit', resource_name: Country.model_name.human) -= render 'form' \ No newline at end of file diff --git a/templates/app/views/hq/countries/index.html.haml b/templates/app/views/hq/countries/index.html.haml deleted file mode 100644 index f2e1f03..0000000 --- a/templates/app/views/hq/countries/index.html.haml +++ /dev/null @@ -1,18 +0,0 @@ -- content_for :toolbar do - = link_to new_hq_country_path, class: 'btn btn-default' do - %i.icon-plus - = t('action_button.new', resource_name: Country.model_name.human) - -.panel.panel-default.grid - .panel-heading - %i.fa.fa-table.icon-large - = t('tt.index', resource_name: Country.model_name.human) - .panel-tools - .btn-group - %a.btn{href: hq_countries_path, data: {toggle: 'toolbar-tooltip'}, title: t('view.reload')} - %i.fa.fa-refresh - .badge= @countries.total_entries - =blankable(@countries) - .panel-footer - .pagination.pagination-sm - = will_paginate @countries, renderer: BootstrapPagination::Rails, bootstrap: 3 \ No newline at end of file diff --git a/templates/app/views/hq/countries/new.html.haml b/templates/app/views/hq/countries/new.html.haml deleted file mode 100644 index 086ad8e..0000000 --- a/templates/app/views/hq/countries/new.html.haml +++ /dev/null @@ -1,3 +0,0 @@ -- content_for :form_title do - = t('tt.new', resource_name: Country.model_name.human) -= render 'form' diff --git a/templates/app/views/hq/countries/show.html.haml b/templates/app/views/hq/countries/show.html.haml deleted file mode 100644 index 209f8f4..0000000 --- a/templates/app/views/hq/countries/show.html.haml +++ /dev/null @@ -1,14 +0,0 @@ -- content_for :toolbar do - = link_to edit_hq_country_path(@country ), class: 'btn btn-default' do - %i.icon-pencil - = t('action_button.edit') -.panel.panel-default - .panel-heading - %i.icon-edit.icon-large - = t('tt.show', resource_name: Country.model_name.human) - .panel-body - = show_for @country do |s| - = s.attribute :id - = s.attribute :name - = s.attribute :created_at - = s.attribute :updated_at diff --git a/templates/app/views/hq/dashboard/index.html.haml b/templates/app/views/hq/dashboard/index.html.haml deleted file mode 100644 index 75d7d4e..0000000 --- a/templates/app/views/hq/dashboard/index.html.haml +++ /dev/null @@ -1,8 +0,0 @@ -.panel.panel-default - .panel-body - .row - .col-lg-12 - .alert.alert-info - = t('view.hello', user: current_admin.email) - = link_to t('navbar.sign_out'), destroy_admin_session_path, method: :delete, class: 'btn btn-danger' - = link_to t('navbar.edit_login_info'), edit_admin_registration_path, class: 'btn btn-primary' \ No newline at end of file diff --git a/templates/app/views/hq/passwords/edit.html.haml b/templates/app/views/hq/passwords/edit.html.haml deleted file mode 100644 index 7bd5b6c..0000000 --- a/templates/app/views/hq/passwords/edit.html.haml +++ /dev/null @@ -1,12 +0,0 @@ -%h2= t('devise.password.edit.title') -= simple_form_for(resource, as: resource_name, url: password_path(resource_name), html: { method: :put }) do |f| - = f.error_notification - = f.input :reset_password_token, as: :hidden - = f.full_error :reset_password_token - .form-inputs - = f.input :password, required: true, autofocus: true - = f.input :password_confirmation, required: true - .form-actions - = f.button :submit, t('devise.password.edit.button') , class: 'btn btn-primary' -%br/ -= render 'devise/shared/links' \ No newline at end of file diff --git a/templates/app/views/hq/passwords/new.html.haml b/templates/app/views/hq/passwords/new.html.haml deleted file mode 100644 index 3624b2b..0000000 --- a/templates/app/views/hq/passwords/new.html.haml +++ /dev/null @@ -1,9 +0,0 @@ -%h2= t('devise.password.new.title') -= simple_form_for(resource, as: resource_name, url: password_path(resource_name), html: { method: :post }) do |f| - = f.error_notification - .form-inputs - = f.input :email, required: true, autofocus: true - .form-actions - = f.button :submit, t('devise.password.reset.instructions'), class: 'btn btn-primary' -%br/ -= render 'devise/shared/links' \ No newline at end of file diff --git a/templates/app/views/hq/registrations/edit.html.haml b/templates/app/views/hq/registrations/edit.html.haml deleted file mode 100644 index 0129a8a..0000000 --- a/templates/app/views/hq/registrations/edit.html.haml +++ /dev/null @@ -1,19 +0,0 @@ -.panel.panel-default - .panel-heading - %i.icon-edit.icon-large - = t('devise.registration.edit.title', model: resource.class.model_name.human) - .panel-body - = simple_form_for(resource, as: resource_name, url: admin_registration_path, html: { method: :put }) do |f| - = f.error_notification - .form-inputs - = f.input :email, required: true, autofocus: true - - if devise_mapping.confirmable? && resource.pending_reconfirmation? - %p - = t('devise.registration.waiting_confirmation', email: resource.unconfirmed_email ) - %hr - = f.input :password, label: t('activerecord.attributes.admin.password'), autocomplete: 'off', hint: t('devise.registration.hint_password'), required: false - = f.input :password_confirmation, label: t('activerecord.attributes.admin.password_confirmation'), required: false - %hr - = f.input :current_password, label: t('activerecord.attributes.admin.current_password'), hint: t('devise.registration.hint_current_password'), required: true - .form-actions - = f.button :submit, t('btn.update'), class: 'btn btn-primary' \ No newline at end of file diff --git a/templates/app/views/hq/sessions/new.html.haml b/templates/app/views/hq/sessions/new.html.haml deleted file mode 100644 index 8138934..0000000 --- a/templates/app/views/hq/sessions/new.html.haml +++ /dev/null @@ -1,11 +0,0 @@ -%h2 - = t('devise.session.title', model: resource.class.model_name.human ) -= simple_form_for(resource, as: resource_name, url: session_path(resource_name)) do |f| - .form-inputs - = f.input :email, required: false, autofocus: true - = f.input :password, required: false - = f.input :remember_me, as: :boolean,label: t('devise.session.remember_me') if devise_mapping.rememberable? - .form-actions - = f.button :submit, t('devise.session.button'), class: 'btn btn-primary' -%br/ -= render 'devise/shared/links' \ No newline at end of file diff --git a/templates/app/views/hq/users/_blank.html.haml b/templates/app/views/hq/users/_blank.html.haml deleted file mode 100644 index c8abd2b..0000000 --- a/templates/app/views/hq/users/_blank.html.haml +++ /dev/null @@ -1,9 +0,0 @@ -- if params[:q].present? - = render 'list' -- else - .alert.alert-warning - %p - %h3= t('view.there_is_no_data', resource: User.model_name.human.downcase) - = link_to new_hq_user_path, class: 'btn btn-primary' do - = t('action_button.new', resource_name: User.model_name.human) - = t('btn.add') \ No newline at end of file diff --git a/templates/app/views/hq/users/_filters.html.haml b/templates/app/views/hq/users/_filters.html.haml deleted file mode 100644 index f9966a3..0000000 --- a/templates/app/views/hq/users/_filters.html.haml +++ /dev/null @@ -1,20 +0,0 @@ -.table-header.row - .col-lg-3 - = link_to hq_users_path(q: {is_active_true: 1}), class: 'btn btn-success' do - = t('view.active') - %span.badge= User.where(is_active: true).count - = link_to hq_users_path(q: {is_active_false: 1}), class: 'btn btn-warning' do - = t('view.passive') - %span.badge= User.where(is_active: false).count - - if params[:q].present? && (params[:q][:is_active_true].present? || params[:q][:is_active_false].present? || params[:q][:name_or_surname_cont].present?) - = link_to hq_users_path, class: 'btn btn-info' do - = t('view.all') - %span.badge= User.count - .col-lg-9 - = search_form_for [:hq, @search], builder: SimpleForm::FormBuilder, html: {class: 'form-inline', data: { turboform: true }} do |f| - .pull-right - .input-group - = f.input_field :name_or_surname_cont, label: false, class: 'form-control', placeholder: t('view.quick_search') - %span.input-group-btn - = button_tag( class: 'btn btn-primary') do - %i.icon-search \ No newline at end of file diff --git a/templates/app/views/hq/users/_form.html.haml b/templates/app/views/hq/users/_form.html.haml deleted file mode 100644 index 186039b..0000000 --- a/templates/app/views/hq/users/_form.html.haml +++ /dev/null @@ -1,18 +0,0 @@ -.panel.panel-default - .panel-heading - %i.icon-edit.icon-large - = yield :form_title - .panel-body - = simple_form_for([:hq, @user], validate: true) do |f| - = f.error_notification - - .form-inputs - = f.input :name - = f.input :surname - = f.input :email - = f.input :time_zone, input_html: { class: 'chosen-select'}, include_blank: t('view.select') - - .form-actions - - text = @user.id.present? ? t('btn.update') : t('btn.add') - = f.button :submit, text, class: 'btn btn-primary' - = link_to t('cancel'), hq_users_path, class: 'btn' diff --git a/templates/app/views/hq/users/_list.html.haml b/templates/app/views/hq/users/_list.html.haml deleted file mode 100644 index 90978a3..0000000 --- a/templates/app/views/hq/users/_list.html.haml +++ /dev/null @@ -1,15 +0,0 @@ -.panel-body.filters - = render 'filters' -%table.table - %thead - %tr - %th= sort_link(@search, :id, t('activerecord.attributes.user.id')) - %th= sort_link(@search, :name, t('activerecord.attributes.user.name')) - %th= sort_link(@search, :email, t('activerecord.attributes.user.email')) - %th= sort_link(@search, :current_sign_in_at, t('activerecord.attributes.user.current_sign_in_at')) - %th= sort_link(@search, :last_sign_in_at, t('activerecord.attributes.user.last_sign_in_at')) - %th= sort_link(@search, :is_active, t('activerecord.attributes.user.is_active')) - %th.actions - = t('view.actions') - %tbody.users - = render @users diff --git a/templates/app/views/hq/users/_user.html.haml b/templates/app/views/hq/users/_user.html.haml deleted file mode 100644 index d29cf8b..0000000 --- a/templates/app/views/hq/users/_user.html.haml +++ /dev/null @@ -1,20 +0,0 @@ -%tr{class: user.is_active ? 'active' : 'passive'} - %td= user.id - %td= user.full_name - %td= mail_to user.email, user.email - %td=l user.current_sign_in_at if user.current_sign_in_at.present? - %td=l user.last_sign_in_at if user.last_sign_in_at.present? - %td= user.is_active ? t('view.active') : t('view.passive') - %td.action - = link_to([:hq, user], class: 'btn btn-success', data: { toggle: :tooltip}, title: t('tooltips.zoom')) do - %i.icon-zoom-in - = link_to(edit_hq_user_path(user) , class: 'btn btn-info', data: { toggle: :tooltip }, title: t('tooltips.edit')) do - %i.icon-edit - = link_to([:hq, user], class: 'btn btn-danger', method: :delete, data: { confirm: t('tooltips.are_you_sure'), toggle: :tooltip }, title: t('tooltips.delete')) do - %i.icon-trash - - if user.is_active - = link_to(toggle_is_active_hq_user_path(user), class: 'btn btn-danger', method: :post, data: { toggle: :tooltip}, title: t('view.make_passive') ) do - %i.icon-ban-circle - - else - = link_to(toggle_is_active_hq_user_path(user), class: 'btn btn-info', method: :post, data: { toggle: :tooltip}, title: t('view.make_active')) do - %i.icon-check diff --git a/templates/app/views/hq/users/edit.html.haml b/templates/app/views/hq/users/edit.html.haml deleted file mode 100644 index 9000772..0000000 --- a/templates/app/views/hq/users/edit.html.haml +++ /dev/null @@ -1,3 +0,0 @@ -- content_for :form_title do - = t('tt.edit', resource_name: 'Yönetici bilgilerini') -= render 'form' \ No newline at end of file diff --git a/templates/app/views/hq/users/index.html.haml b/templates/app/views/hq/users/index.html.haml deleted file mode 100644 index 7c8946a..0000000 --- a/templates/app/views/hq/users/index.html.haml +++ /dev/null @@ -1,18 +0,0 @@ -- content_for :toolbar do - = link_to new_hq_user_path, class: 'btn btn-default' do - %i.icon-plus - = t('action_button.new', resource_name: User.model_name.human) - -.panel.panel-default.grid - .panel-heading - %i.fa.fa-table.icon-large - = t('activerecord.models.users') - .panel-tools - .btn-group - %a.btn{href: hq_users_path, data: {toggle: 'toolbar-tooltip'}, title: t('view.reload')} - %i.fa.fa-refresh - .badge= @users.total_entries - =blankable(@users) - .panel-footer - .pagination.pagination-sm - = will_paginate @users, renderer: BootstrapPagination::Rails, bootstrap: 3 \ No newline at end of file diff --git a/templates/app/views/hq/users/new.html.haml b/templates/app/views/hq/users/new.html.haml deleted file mode 100644 index 19a2e9c..0000000 --- a/templates/app/views/hq/users/new.html.haml +++ /dev/null @@ -1,5 +0,0 @@ -- content_for :form_title do - = t('tt.new', resource_name: User.model_name.human) -.alert.alert-info - = t('view.create_resource_mail_info', resource: User.model_name.human.downcase) -= render 'form' diff --git a/templates/app/views/hq/users/show.html.haml b/templates/app/views/hq/users/show.html.haml deleted file mode 100644 index be75617..0000000 --- a/templates/app/views/hq/users/show.html.haml +++ /dev/null @@ -1,20 +0,0 @@ -- content_for :toolbar do - = link_to edit_hq_user_path(@user ), class: 'btn btn-default' do - %i.icon-pencil - = t('action_button.edit') -.panel.panel-default - .panel-heading - %i.icon-edit.icon-large - = t('tt.show', resource_name: User.model_name.human) - .panel-body - = show_for @user do |s| - = s.attribute :name - = s.attribute :surname - = s.attribute :email do - = mail_to @user.email, @user.email - = s.attribute :is_active - = s.attribute :time_zone - = s.attribute :current_sign_in_at - = s.attribute :last_sign_in_at - = s.attribute :created_at - = s.attribute :updated_at diff --git a/templates/app/views/layouts/application.html.haml.erb b/templates/app/views/layouts/application.html.haml.erb deleted file mode 100644 index 527a049..0000000 --- a/templates/app/views/layouts/application.html.haml.erb +++ /dev/null @@ -1,56 +0,0 @@ -!!! -%html{lang: I18n.locale} - %head - %title= content_for?(:title) ? "#{yield(:title)} - <%= app_name.capitalize %>" : '<%= app_name.capitalize %>' - %meta(http-equiv="content-type" content="text/html" charset="utf-8") - %meta(http-equiv="x-ua-compatible" content="ie=edge,chrome=1") - %meta(name="description" content="<%= app_name.capitalize %>") - %meta(name="author" content="<%= app_name.capitalize %>") - %link(rel="shortcut icon" href="/images/favicon.png") - - = stylesheet_link_tag 'application', '//maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css', - media: 'all', 'data-turbolinks-track' => true - = javascript_include_tag 'application', 'data-turbolinks-track' => true - = csrf_meta_tags - = yield :head - %body - = render 'layouts/partials/warnings' - .container-narrow - %nav.navbar.navbar-default - .container-fluid - / Brand and toggle get grouped for better mobile display - .navbar-header - %button.navbar-toggle.collapsed{"aria-expanded" => "false", "data-target" => "#bs-example-navbar-collapse-1", "data-toggle" => "collapse", :type => "button"} - %span.sr-only Toggle navigation - %span.icon-bar - %span.icon-bar - %span.icon-bar - = link_to root_path, class: 'navbar-brand' do - %i.fa.fa-home - = "<%= app_name.capitalize %>" - / Collect the nav links, forms, and other content for toggling - #bs-example-navbar-collapse-1.collapse.navbar-collapse - %ul.nav.navbar-nav.navbar-right - - if user_signed_in? - %li - = link_to destroy_user_session_path, method: :delete do - %i.fa.fa-sign-out - = t('navbar.sign_out') - %li - = link_to user_profile_path(current_user) do - %i.fa.fa-user - = t('navbar.profile') - - else - %li - = link_to new_user_session_path do - %i.fa.fa-pencil-square-o{"aria-hidden" => "true"} - = t('navbar.signin') - %li - = link_to new_user_registration_path do - %i.fa.fa-user{"aria-hidden" => "true"} - = t('navbar.signup') - = render partial: 'layouts/partials/messages' - = yield - %hr/ - .footer - %p <%= app_name.capitalize %> Copyright © #{Time.zone.now.year} Tüm Hakları Saklıdır. \ No newline at end of file diff --git a/templates/app/views/layouts/hq/application.html.haml.erb b/templates/app/views/layouts/hq/application.html.haml.erb deleted file mode 100644 index 8fb9be8..0000000 --- a/templates/app/views/layouts/hq/application.html.haml.erb +++ /dev/null @@ -1,55 +0,0 @@ -!!! 5 -/[if IE 8] -/[if IE 9] -/[if lt IE 10] -%html{lang: I18n.locale, class: 'no-js'} - %head - %title= content_for?(:title) ? "#{yield(:title)} - <%= app_name.capitalize %>" : '<%= app_name.capitalize %>' - %meta(http-equiv="content-type" content="text/html" charset="utf-8") - %meta(http-equiv="x-ua-compatible" content="ie=edge,chrome=1") - %meta(name="description" content="<%= app_name.capitalize %>") - %meta(name="author" content="<%= app_name.capitalize %>") - %meta{content: 'initial-scale=1.0,user-scalable=no,maximum-scale=1,width=device-width', name: 'viewport'} - %meta(name="viewport" content="initial-scale=1.0,user-scalable=no,maximum-scale=1" media="(device-height: 568px)") - %meta(name='apple-mobile-web-app-capable' content='yes') - %meta(name='apple-mobile-web-app-status-bar-style' content='translucent-black') - - %link(rel="shortcut icon" href="/images/favicon.png") - - = csrf_meta_tags - - / Stylesheets (Don't change include order) - = stylesheet_link_tag 'hq/application', - '//netdna.bootstrapcdn.com/font-awesome/3.2.0/css/font-awesome.min.css', - '//maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css', - media: 'all', 'data-turbolinks-track' => true - - / Javascripts - = javascript_include_tag '//cdnjs.cloudflare.com/ajax/libs/modernizr/2.6.2/modernizr.min.js', - 'hq/application', 'data-turbolinks-track' => true - = yield :head - - %body.main - - / Navbar - = render partial: 'layouts/hq/partials/navbar' - - #wrapper - - / Sidebar - %section#sidebar - = render partial: 'layouts/hq/partials/dock' - - / Tools - %section#tools - = render partial: 'layouts/hq/partials/breadcrumb' - = render partial: 'layouts/hq/partials/toolbar' - - / Content - #content - = render 'layouts/partials/warnings' - = render partial: 'layouts/partials/messages' - = yield - - / Footer - = render partial: 'layouts/hq/partials/footer' \ No newline at end of file diff --git a/templates/app/views/layouts/hq/login.html.haml.erb b/templates/app/views/layouts/hq/login.html.haml.erb deleted file mode 100644 index f5af077..0000000 --- a/templates/app/views/layouts/hq/login.html.haml.erb +++ /dev/null @@ -1,35 +0,0 @@ -!!! 5 -/[if IE 8] -/[if IE 9] -/[if lt IE 10] -%html{lang: I18n.locale, class: 'no-js'} - %head - %title= content_for?(:title) ? "#{yield(:title)} - <%= app_name.capitalize %>" : '<%= app_name.capitalize %>' - %meta(http-equiv="content-type" content="text/html" charset="utf-8") - %meta(http-equiv="x-ua-compatible" content="ie=edge,chrome=1") - %meta(name="description" content="<%= app_name.capitalize %>") - %meta(name="author" content="<%= app_name.capitalize %>") - %meta{content: 'initial-scale=1.0,user-scalable=no,maximum-scale=1,width=device-width', name: 'viewport'} - %meta(name="viewport" content="initial-scale=1.0,user-scalable=no,maximum-scale=1" media="(device-height: 568px)") - %meta(name='apple-mobile-web-app-capable' content='yes') - %meta(name='apple-mobile-web-app-status-bar-style' content='translucent-black') - - %link(rel="shortcut icon" href="/images/favicon.png") - - / Stylesheets (Don't change include order) - = stylesheet_link_tag 'hq/application', - '//netdna.bootstrapcdn.com/font-awesome/3.2.0/css/font-awesome.min.css', - '//maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css', - media: 'all', 'data-turbolinks-track' => true - = yield :head - - %body.login - = render 'layouts/partials/warnings' - .wrapper - = render partial: 'layouts/partials/messages' - = yield - - %br/ - .text-center.text-muted - = render partial: 'layouts/hq/partials/footer' - = render file: 'public/VERSION.txt' \ No newline at end of file diff --git a/templates/app/views/layouts/hq/partials/_dock.html.haml.erb b/templates/app/views/layouts/hq/partials/_dock.html.haml.erb deleted file mode 100644 index 44536c0..0000000 --- a/templates/app/views/layouts/hq/partials/_dock.html.haml.erb +++ /dev/null @@ -1,36 +0,0 @@ -%i#toggle.icon-align-justify.icon-large - -%ul#dock - - %li.launcher - %i.icon-dashboard - =link_to t('dock.dashboard'), hq_dashboard_index_path - - %li.launcher.dropdown.hover - %i.fa.fa-list - %a{href: '#'}= t('dock.system_users') - %ul.dropdown-menu - %li - = link_to hq_admins_path do - %i.fa.fa-users - = t('activerecord.models.admins') - %li - = link_to hq_users_path do - %i.fa.fa-users - = t('activerecord.models.users') - - %br/ - %li.launcher.dropdown.hover - %i.fa.fa-list - %a{href: '#'}= t('dock.system_datas') - %ul.dropdown-menu - %li - =link_to hq_countries_path do - %i.fa.fa-database - = t('activerecord.models.countries') - %li - =link_to hq_cities_path do - %i.fa.fa-database - = t('activerecord.models.cities') - -#beaker{data: {toggle: 'tooltip'}, title: 'Made by lab2023'} \ No newline at end of file diff --git a/templates/app/views/layouts/hq/partials/_footer.html.haml.erb b/templates/app/views/layouts/hq/partials/_footer.html.haml.erb deleted file mode 100644 index e69de29..0000000 diff --git a/templates/app/views/layouts/hq/partials/_navbar.html.haml.erb b/templates/app/views/layouts/hq/partials/_navbar.html.haml.erb deleted file mode 100644 index 037310a..0000000 --- a/templates/app/views/layouts/hq/partials/_navbar.html.haml.erb +++ /dev/null @@ -1,22 +0,0 @@ -#navbar.navbar.navbar-default - %a.navbar-brand{href: hq_dashboard_index_path} - %i.icon-beer - <%= app_name.capitalize %> - = t('navbar.admin_portal') - %ul.nav.navbar-nav.pull-right - %li - = link_to hq_audits_path do - %i.icon-cog - = t('activerecord.models.audits') - %li.dropdown.user - %a.dropdown-toggle{'data-toggle' => 'dropdown', href: '#'} - %i.icon-user - %strong - = current_admin.email - %b.caret - %ul.dropdown-menu - %li - =link_to t('navbar.edit_login_info'), edit_admin_registration_path - %li.divider - %li - =link_to t('navbar.signout'), destroy_admin_session_path, method: :delete diff --git a/templates/app/views/layouts/hq/partials/_trackers.html.haml.erb b/templates/app/views/layouts/hq/partials/_trackers.html.haml.erb deleted file mode 100644 index e69de29..0000000 diff --git a/templates/app/views/layouts/mailer.html.haml.erb b/templates/app/views/layouts/mailer.html.haml.erb deleted file mode 100644 index 8864453..0000000 --- a/templates/app/views/layouts/mailer.html.haml.erb +++ /dev/null @@ -1,321 +0,0 @@ -!!! -%html{:xmlns => "http://www.w3.org/1999/xhtml", "xmlns:mc" => "http://www.w3.org/1999/xhtml"} - %head - %meta{:content => "text/html; charset=UTF-8", "http-equiv" => "Content-Type"}/ - %title= @subject - :css - #outlook a{padding:0;} - .ReadMsgBody{width:100%;} .ExternalClass{width:100%;} - .ExternalClass, .ExternalClass p, .ExternalClass span, .ExternalClass font, .ExternalClass td, .ExternalClass div {line-height: 100%;} - body, table, td, p, a, li, blockquote{-webkit-text-size-adjust:100%; -ms-text-size-adjust:100%;} - table, td{mso-table-lspace:0pt; mso-table-rspace:0pt;} - img{-ms-interpolation-mode:bicubic;} - body{margin:0; padding:0;} - img{border:0; height:auto; line-height:100%; outline:none; text-decoration:none;} - table{border-collapse:collapse !important;} - body, #bodyTable, #bodyCell{height:100% !important; margin:0; padding:0; width:100% !important;} - #bodyCell{padding:20px;} - #templateContainer{width:600px;} - body, #bodyTable{ - /*@editable*/ background-color:#DEE0E2; - } - #bodyCell{ - /*@editable*/ border-top:4px solid #BBBBBB; - } - #templateContainer{ - /*@editable*/ border:1px solid #BBBBBB; - } - h1{ - /*@editable*/ color:#202020 !important; - display:block; - /*@editable*/ font-family:Helvetica; - /*@editable*/ font-size:26px; - /*@editable*/ font-style:normal; - /*@editable*/ font-weight:bold; - /*@editable*/ line-height:100%; - /*@editable*/ letter-spacing:normal; - margin-top:0; - margin-right:0; - margin-bottom:10px; - margin-left:0; - /*@editable*/ text-align:left; - } - h2{ - /*@editable*/ color:#404040 !important; - display:block; - /*@editable*/ font-family:Helvetica; - /*@editable*/ font-size:20px; - /*@editable*/ font-style:normal; - /*@editable*/ font-weight:bold; - /*@editable*/ line-height:100%; - /*@editable*/ letter-spacing:normal; - margin-top:0; - margin-right:0; - margin-bottom:10px; - margin-left:0; - /*@editable*/ text-align:left; - } - h3{ - /*@editable*/ color:#606060 !important; - display:block; - /*@editable*/ font-family:Helvetica; - /*@editable*/ font-size:16px; - /*@editable*/ font-style:italic; - /*@editable*/ font-weight:normal; - /*@editable*/ line-height:100%; - /*@editable*/ letter-spacing:normal; - margin-top:0; - margin-right:0; - margin-bottom:10px; - margin-left:0; - /*@editable*/ text-align:left; - } - h4{ - /*@editable*/ color:#808080 !important; - display:block; - /*@editable*/ font-family:Helvetica; - /*@editable*/ font-size:14px; - /*@editable*/ font-style:italic; - /*@editable*/ font-weight:normal; - /*@editable*/ line-height:100%; - /*@editable*/ letter-spacing:normal; - margin-top:0; - margin-right:0; - margin-bottom:10px; - margin-left:0; - /*@editable*/ text-align:left; - } - #templatePreheader{ - /*@editable*/ background-color:#F4F4F4; - /*@editable*/ border-bottom:1px solid #CCCCCC; - } - .preheaderContent{ - /*@editable*/ color:#808080; - /*@editable*/ font-family:Helvetica; - /*@editable*/ font-size:10px; - /*@editable*/ line-height:125%; - /*@editable*/ text-align:left; - } - .preheaderContent a:link, .preheaderContent a:visited, /* Yahoo! Mail Override */ .preheaderContent a .yshortcuts /* Yahoo! Mail Override */{ - /*@editable*/ color:#606060; - /*@editable*/ font-weight:normal; - /*@editable*/ text-decoration:underline; - } - #templateHeader{ - /*@editable*/ background-color:#F4F4F4; - /*@editable*/ border-top:1px solid #FFFFFF; - /*@editable*/ border-bottom:1px solid #CCCCCC; - } - .headerContent{ - /*@editable*/ color:#505050; - /*@editable*/ font-family:Helvetica; - /*@editable*/ font-size:20px; - /*@editable*/ font-weight:bold; - /*@editable*/ line-height:100%; - /*@editable*/ padding-top:0; - /*@editable*/ padding-right:0; - /*@editable*/ padding-bottom:0; - /*@editable*/ padding-left:0; - /*@editable*/ text-align:left; - /*@editable*/ vertical-align:middle; - } - .headerContent a:link, .headerContent a:visited, /* Yahoo! Mail Override */ .headerContent a .yshortcuts /* Yahoo! Mail Override */{ - /*@editable*/ color:#EB4102; - /*@editable*/ font-weight:normal; - /*@editable*/ text-decoration:underline; - } - #headerImage{ - height:auto; - max-width:600px; - } - #templateBody{ - /*@editable*/ background-color:#F4F4F4; - /*@editable*/ border-top:1px solid #FFFFFF; - /*@editable*/ border-bottom:1px solid #CCCCCC; - } - .bodyContent{ - /*@editable*/ color:#505050; - /*@editable*/ font-family:Helvetica; - /*@editable*/ font-size:16px; - /*@editable*/ line-height:150%; - padding-top:20px; - padding-right:20px; - padding-bottom:20px; - padding-left:20px; - /*@editable*/ text-align:left; - } - .bodyContent a:link, .bodyContent a:visited, /* Yahoo! Mail Override */ .bodyContent a .yshortcuts /* Yahoo! Mail Override */{ - /*@editable*/ color:#EB4102; - /*@editable*/ font-weight:normal; - /*@editable*/ text-decoration:underline; - } - .bodyContent img{ - display:inline; - height:auto; - max-width:560px; - } - .templateColumnContainer{width:260px;} - #templateColumns{ - /*@editable*/ background-color:#F4F4F4; - /*@editable*/ border-top:1px solid #FFFFFF; - /*@editable*/ border-bottom:1px solid #CCCCCC; - } - .leftColumnContent{ - /*@editable*/ color:#505050; - /*@editable*/ font-family:Helvetica; - /*@editable*/ font-size:14px; - /*@editable*/ line-height:150%; - padding-top:0; - padding-right:20px; - padding-bottom:20px; - padding-left:20px; - /*@editable*/ text-align:left; - } - .leftColumnContent a:link, .leftColumnContent a:visited, /* Yahoo! Mail Override */ .leftColumnContent a .yshortcuts /* Yahoo! Mail Override */{ - /*@editable*/ color:#EB4102; - /*@editable*/ font-weight:normal; - /*@editable*/ text-decoration:underline; - } - .rightColumnContent{ - /*@editable*/ color:#505050; - /*@editable*/ font-family:Helvetica; - /*@editable*/ font-size:14px; - /*@editable*/ line-height:150%; - padding-top:0; - padding-right:20px; - padding-bottom:20px; - padding-left:20px; - /*@editable*/ text-align:left; - } - .rightColumnContent a:link, .rightColumnContent a:visited, /* Yahoo! Mail Override */ .rightColumnContent a .yshortcuts /* Yahoo! Mail Override */{ - /*@editable*/ color:#EB4102; - /*@editable*/ font-weight:normal; - /*@editable*/ text-decoration:underline; - } - .leftColumnContent img, .rightColumnContent img{ - display:inline; - height:auto; - max-width:260px; - } - #templateFooter{ - /*@editable*/ background-color:#F4F4F4; - /*@editable*/ border-top:1px solid #FFFFFF; - } - .footerContent{ - /*@editable*/ color:#808080; - /*@editable*/ font-family:Helvetica; - /*@editable*/ font-size:10px; - /*@editable*/ line-height:150%; - padding-top:20px; - padding-right:20px; - padding-bottom:20px; - padding-left:20px; - /*@editable*/ text-align:left; - } - .footerContent a:link, .footerContent a:visited, /* Yahoo! Mail Override */ .footerContent a .yshortcuts, .footerContent a span /* Yahoo! Mail Override */{ - /*@editable*/ color:#606060; - /*@editable*/ font-weight:normal; - /*@editable*/ text-decoration:underline; - } - @media only screen and (max-width: 480px){ - body, table, td, p, a, li, blockquote{-webkit-text-size-adjust:none !important;} /* Prevent Webkit platforms from changing default text sizes */ - body{width:100% !important; min-width:100% !important;} /* Prevent iOS Mail from adding padding to the body */ - #bodyCell{padding:10px !important;} - #templateContainer{ - max-width:600px !important; - /*@editable*/ width:100% !important; - } - h1{ - /*@editable*/ font-size:24px !important; - /*@editable*/ line-height:100% !important; - } - h2{ - /*@editable*/ font-size:20px !important; - /*@editable*/ line-height:100% !important; - } - h3{ - /*@editable*/ font-size:18px !important; - /*@editable*/ line-height:100% !important; - } - h4{ - /*@editable*/ font-size:16px !important; - /*@editable*/ line-height:100% !important; - } - #templatePreheader{display:none !important;} - #headerImage{ - height:auto !important; - /*@editable*/ max-width:600px !important; - /*@editable*/ width:100% !important; - } - .headerContent{ - /*@editable*/ font-size:20px !important; - /*@editable*/ line-height:125% !important; - } - .bodyContent{ - /*@editable*/ font-size:18px !important; - /*@editable*/ line-height:125% !important; - } - .templateColumnContainer{display:block !important; width:100% !important;} - .columnImage{ - height:auto !important; - /*@editable*/ max-width:480px !important; - /*@editable*/ width:100% !important; - } - .leftColumnContent{ - /*@editable*/ font-size:16px !important; - /*@editable*/ line-height:125% !important; - } - .rightColumnContent{ - /*@editable*/ font-size:16px !important; - /*@editable*/ line-height:125% !important; - } - .footerContent{ - /*@editable*/ font-size:14px !important; - /*@editable*/ line-height:115% !important; - } - .footerContent a{display:block !important;} - } - %body{:leftmargin => "0", :marginheight => "0", :marginwidth => "0", :offset => "0", :topmargin => "0"} - %center - %table#bodyTable{:align => "center", :border => "0", :cellpadding => "0", :cellspacing => "0", :height => "100%", :width => "100%"} - %tr - %td#bodyCell{:align => "center", :valign => "top"} - %table#templateContainer{:border => "0", :cellpadding => "0", :cellspacing => "0"} - %tr - %td{:align => "center", :valign => "top"} - %table#templateBody{:border => "0", :cellpadding => "0", :cellspacing => "0", :width => "100%"} - %tr - %td{:align => "left", :valign => "top"} - = image_tag "#{Settings.root_path}/images/mail-logo.png", width: 150, height: 150, style: 'padding: 10px 20px' - %tr - %td.bodyContent{"mc:edit" => "body_content", :valign => "top"} - = yield - %br/ - %br/ - %tr - %td{:align => "center", :valign => "top"} - %table#templateFooter{:border => "0", :cellpadding => "0", :cellspacing => "0", :width => "100%"} - %tr - %td.footerContent{"mc:edit" => "footer_content01", :style => "padding-top:0;", :valign => "top"} - %br/ - %strong - Web adresi - \: - www.<%= app_name %>.com - %br/ - %strong - E-posta - \: - info@<%= app_name %>.com - %br/ - %strong - Telefon - \: - +90 (850) XXX XX-XX - %br/ - %strong - İşlem Zamanı - \: - #{I18n.localize(Time.zone.now)} - %br/ - <%= app_name.capitalize %> Copyright © #{Time.zone.now.year} Tüm Hakları Saklıdır. diff --git a/templates/app/views/layouts/mailer.text.haml b/templates/app/views/layouts/mailer.text.haml deleted file mode 100644 index f1d0cc8..0000000 --- a/templates/app/views/layouts/mailer.text.haml +++ /dev/null @@ -1 +0,0 @@ -= yield \ No newline at end of file diff --git a/templates/app/views/layouts/partials/_footer.html.haml.erb b/templates/app/views/layouts/partials/_footer.html.haml.erb deleted file mode 100644 index e69de29..0000000 diff --git a/templates/app/views/layouts/partials/_trackers.html.haml.erb b/templates/app/views/layouts/partials/_trackers.html.haml.erb deleted file mode 100644 index e69de29..0000000 diff --git a/templates/app/views/layouts/partials/_warnings.html.haml.erb b/templates/app/views/layouts/partials/_warnings.html.haml.erb deleted file mode 100644 index ca0b8d3..0000000 --- a/templates/app/views/layouts/partials/_warnings.html.haml.erb +++ /dev/null @@ -1,3 +0,0 @@ -- if Rails.env.staging? - #warnings.alert.alert-warning.panel-reset.text-center{style: 'margin-bottom: 10px;' } - = t('staging_warning').html_safe \ No newline at end of file diff --git a/templates/app/views/user/dashboard/index.html.haml b/templates/app/views/user/dashboard/index.html.haml deleted file mode 100644 index e5fa3a7..0000000 --- a/templates/app/views/user/dashboard/index.html.haml +++ /dev/null @@ -1,8 +0,0 @@ -.panel.panel-default - .panel-body - .row - .col-lg-12 - .alert.alert-info - = t('view.hello', user: current_user.email) - = link_to t('navbar.sign_out'), destroy_user_session_path, method: :delete, class: 'btn btn-danger' - = link_to t('navbar.edit_login_info'), edit_user_registration_path, class: 'btn btn-primary' \ No newline at end of file diff --git a/templates/app/views/user/passwords/edit.html.haml b/templates/app/views/user/passwords/edit.html.haml deleted file mode 100644 index 315d5d7..0000000 --- a/templates/app/views/user/passwords/edit.html.haml +++ /dev/null @@ -1,12 +0,0 @@ -%h2= t('devise.password.edit.title') -= simple_form_for(resource, as: resource_name, url: password_path(resource_name), html: { method: :put }) do |f| - = f.error_notification - = f.input :reset_password_token, as: :hidden - = f.full_error :reset_password_token - .form-inputs - = f.input :password, required: true, autofocus: true - = f.input :password_confirmation, required: true - .form-actions - = f.button :submit, t('devise.password.edit.button') , class: 'btn btn-primary' - %hr - = render 'devise/shared/links' diff --git a/templates/app/views/user/passwords/new.html.haml b/templates/app/views/user/passwords/new.html.haml deleted file mode 100644 index eb890d7..0000000 --- a/templates/app/views/user/passwords/new.html.haml +++ /dev/null @@ -1,10 +0,0 @@ -%h2= t('devise.password.new.title') -= simple_form_for(resource, as: resource_name, url: password_path(resource_name), html: { method: :post }) do |f| - = f.error_notification - .form-inputs - = f.input :email, required: true, autofocus: true - .form-actions - = f.button :submit, t('devise.password.reset.instructions'), class: 'btn btn-primary' - - %hr - = render 'devise/shared/links' \ No newline at end of file diff --git a/templates/app/views/user/profile/_form.html.haml b/templates/app/views/user/profile/_form.html.haml deleted file mode 100644 index 4cb7c55..0000000 --- a/templates/app/views/user/profile/_form.html.haml +++ /dev/null @@ -1,15 +0,0 @@ -.panel.panel-default - .panel-heading - %i.icon-edit.icon-large - = yield :form_title - .panel-body - = simple_form_for([:user, @profile], url: user_profile_path, validate: true) do |f| - = f.error_notification - - .form-inputs - = f.input :name - = f.input :surname - - .form-actions - = f.button :submit, class: 'btn btn-primary' - = link_to t('cancel'), user_profile_path, class: 'btn' diff --git a/templates/app/views/user/profile/edit.html.haml b/templates/app/views/user/profile/edit.html.haml deleted file mode 100644 index bd029eb..0000000 --- a/templates/app/views/user/profile/edit.html.haml +++ /dev/null @@ -1,3 +0,0 @@ -- content_for :form_title do - = t('tt.edit', resource_name: User.model_name.human) -= render 'form' \ No newline at end of file diff --git a/templates/app/views/user/profile/show.html.haml b/templates/app/views/user/profile/show.html.haml deleted file mode 100644 index d2b5a73..0000000 --- a/templates/app/views/user/profile/show.html.haml +++ /dev/null @@ -1,18 +0,0 @@ -.panel.panel-default - .panel-heading - %i.icon-edit.icon-large - = t('tt.show', resource_name: User.model_name.human) - .panel-body - = show_for @profile do |s| - = s.attribute :name - = s.attribute :surname - = s.attribute :email - = s.attribute :created_at - = s.attribute :updated_at - .panel-footer - = link_to root_path, class: 'btn-link' do - %i.fa.fa-arrow-left - = t('btn.back') - = link_to edit_user_profile_path(@profile), class: 'btn btn-link' do - %i.fa.fa-pencil - = t('navbar.edit_profile_info') \ No newline at end of file diff --git a/templates/app/views/user/registrations/edit.html.haml b/templates/app/views/user/registrations/edit.html.haml deleted file mode 100644 index 4360d71..0000000 --- a/templates/app/views/user/registrations/edit.html.haml +++ /dev/null @@ -1,19 +0,0 @@ -.panel.panel-default - .panel-heading - %i.icon-edit.icon-large - = t('devise.registration.edit.title', model: resource.class.model_name.human) - .panel-body - = simple_form_for(resource, as: resource_name, url: user_registration_path, html: { method: :put }) do |f| - = f.error_notification - .form-inputs - = f.input :email, required: true, autofocus: true - - if devise_mapping.confirmable? && resource.pending_reconfirmation? - %p - = t('devise.registration.waiting_confirmation', email: resource.unconfirmed_email ) - %hr - = f.input :password, label: t('activerecord.attributes.user.password'), autocomplete: 'off', hint: t('devise.registration.hint_password'), required: false - = f.input :password_confirmation, label: t('activerecord.attributes.user.password_confirmation'), required: false - %hr - = f.input :current_password, label: t('activerecord.attributes.user.current_password'), hint: t('devise.registration.hint_current_password'), required: true - .form-actions - = f.button :submit, t('btn.update'), class: 'btn btn-primary' \ No newline at end of file diff --git a/templates/app/views/user/sessions/new.html.haml b/templates/app/views/user/sessions/new.html.haml deleted file mode 100644 index fa09f94..0000000 --- a/templates/app/views/user/sessions/new.html.haml +++ /dev/null @@ -1,11 +0,0 @@ -%h2 - = t('devise.session.title', model: resource.class.model_name.human ) -= simple_form_for(resource, as: resource_name, url: session_path(resource_name)) do |f| - .form-inputs - = f.input :email, required: false, autofocus: true - = f.input :password, required: false - = f.input :remember_me, as: :boolean,label: t('devise.session.remember_me') if devise_mapping.rememberable? - .form-actions - = f.button :submit, t('devise.session.button'), class: 'btn btn-primary' -%hr - = render 'devise/shared/links' \ No newline at end of file diff --git a/templates/app/views/user_mailer/login_info.html.haml b/templates/app/views/user_mailer/login_info.html.haml deleted file mode 100644 index af0d712..0000000 --- a/templates/app/views/user_mailer/login_info.html.haml +++ /dev/null @@ -1,13 +0,0 @@ -%h2= t('email.hello') - -%p= t('email.user.login_info.first_info') -%p= t('email.user.login_info.second_info') -%p - %strong= "#{t('activerecord.attributes.user.email')} :" - = @user.email -%p - %strong= "#{t('activerecord.attributes.user.password')} :" - = @password -%p= link_to t('email.user.login_info.btn_login'), new_user_session_url - -%p= t('email.user.login_info.last_info', link: new_user_session_url ).html_safe \ No newline at end of file diff --git a/templates/app/views/welcome/index.html.haml.erb b/templates/app/views/welcome/index.html.haml.erb deleted file mode 100644 index 4d980e6..0000000 --- a/templates/app/views/welcome/index.html.haml.erb +++ /dev/null @@ -1,16 +0,0 @@ -.jumbotron - %h1 Welcome to <%= app_name.capitalize %> - - if current_user - = link_to t('navbar.sign_out'), destroy_user_session_path, class: 'btn btn-large', method: :delete - .row-fluid.marketing - %p - %strong Name: - = current_user.name - %p - %strong Email: - = current_user.email - = link_to t('navbar.edit_login_info'), edit_user_registration_path, class: 'btn btn-large' - = link_to t('navbar.profile'), user_profile_path(current_user), class: 'btn btn-link' - - else - = link_to t('navbar.signup'), new_user_registration_path, class: 'btn btn-large btn-success' - = link_to t('navbar.signin'), new_user_session_path, class: 'btn btn-large' \ No newline at end of file diff --git a/templates/config/database.yml.erb b/templates/config/database.yml.erb deleted file mode 100644 index ecf6e1e..0000000 --- a/templates/config/database.yml.erb +++ /dev/null @@ -1,21 +0,0 @@ -development: &default - adapter: postgresql - database: <%= app_name %>_development - encoding: utf8 - min_messages: warning - pool: 5 - timeout: 5000 - host: localhost - port: 5432 - -test: - <<: *default - database: <%= app_name %>_test - -production: - <<: *default - database: <%= app_name %>_production - -staging: - <<: *default - database: <%= app_name %>_staging \ No newline at end of file diff --git a/templates/config/deploy.rb b/templates/config/deploy.rb deleted file mode 100644 index 357ff76..0000000 --- a/templates/config/deploy.rb +++ /dev/null @@ -1,56 +0,0 @@ -# config valid only for current version of Capistrano -lock '3.4.0' - -set :application, 'my_app_name' -set :local_user, 'deploy' -set :stages, %w(staging production) -set :default_stage, 'production' -set :repo_url, 'git@example.com:me/my_repo.git' - -# Default branch is :master -# ask :branch, `git rev-parse --abbrev-ref HEAD`.chomp - -# Default deploy_to directory is /var/www/blog2 -set :deploy_to, "/home/#{fetch(:local_user)}/apps/#{fetch(:application)}" - -# Default value for :scm is :git -set :scm, :git - -# Default value for :format is :pretty -# set :format, :pretty - -# Default value for :log_level is :debug -# set :log_level, :debug - -# Default value for :pty is false -set :pty, true - -# Default value for :linked_files is [] -set :linked_files, fetch(:linked_files, []).push('config/database.yml') - -# Default value for linked_dirs is [] -set :linked_dirs, fetch(:linked_dirs, []).push('log', 'tmp/pids', 'tmp/cache', 'tmp/sockets', 'vendor/bundle', 'public/system', 'public/upload', 'public/images') - -# Default value for default_env is {} -# set :default_env, { path: "/opt/ruby/bin:$PATH" } -set :default_env, { path: '$HOME/.rbenv/shims:$HOME/.rbenv/bin:$PATH' } - -# Default value for keep_releases is 5 -# set :keep_releases, 5 - -# Look our recipes -# https://github.com/lab2023/recipes_matic -load 'config/deploy/recipes/base.rb' - -namespace :deploy do - - after :restart, :clear_cache do - on roles(:web), in: :groups, limit: 3, wait: 10 do - # Here we can do anything such as: - # within release_path do - # execute :rake, 'cache:clear' - # end - end - end - -end diff --git a/templates/config/initializers/devise_async.rb b/templates/config/initializers/devise_async.rb deleted file mode 100644 index 1cfea5e..0000000 --- a/templates/config/initializers/devise_async.rb +++ /dev/null @@ -1,6 +0,0 @@ -# Supported options: :resque, :sidekiq, :delayed_job, :queue_classic, :torquebox, :backburner, :que, :sucker_punch -Devise::Async.setup do |config| - config.enabled = true - config.backend = :sidekiq - config.queue = :mailers -end \ No newline at end of file diff --git a/templates/config/initializers/disable_xml_params.rb b/templates/config/initializers/disable_xml_params.rb deleted file mode 100644 index 319f4ff..0000000 --- a/templates/config/initializers/disable_xml_params.rb +++ /dev/null @@ -1,3 +0,0 @@ -# Protect against injection attacks -# http://www.kb.cert.org/vuls/id/380039 -ActionDispatch::ParamsParser::DEFAULT_PARSERS.delete(Mime::XML) \ No newline at end of file diff --git a/templates/config/initializers/mail.rb b/templates/config/initializers/mail.rb deleted file mode 100644 index 4f267dd..0000000 --- a/templates/config/initializers/mail.rb +++ /dev/null @@ -1,13 +0,0 @@ -if Rails.env.production? - MAIL_SETTING = { - address: ENV['MAIL_ADDRESS'], # example 'smtp.mandrillapp.com' - port: '587', - enable_starttls_auto: true, - domain: ENV['MAIL_DOMAIN'], # example 'domain.com' - user_name: ENV['MAIL_USERNAME'], # example 'email@gmail.com' - password: ENV['MAIL_PASSWORD'], - authentication: 'plain' - } -end - - diff --git a/templates/config/initializers/paperclip.rb b/templates/config/initializers/paperclip.rb deleted file mode 100644 index 0b0d173..0000000 --- a/templates/config/initializers/paperclip.rb +++ /dev/null @@ -1,10 +0,0 @@ -#Remove command lines - -#Paperclip::Attachment.default_options[:storage] = :s3 -#Paperclip::Attachment.default_options[:s3_host_name] = Settings.AWS.S3.end_point -#Paperclip::Attachment.default_options[:s3_host_alias] = Settings.AWS.S3.aws_raw_url -#Paperclip::Attachment.default_options[:bucket] = Settings.AWS.S3.bucket -#Paperclip::Attachment.default_options[:s3_credentials] = { -# access_key_id: Settings.AWS.S3.access_key_id, -# secret_access_key: Settings.AWS.S3.secret_access_key -#} diff --git a/templates/config/initializers/secret_token.erb b/templates/config/initializers/secret_token.erb deleted file mode 100644 index 4517d1b..0000000 --- a/templates/config/initializers/secret_token.erb +++ /dev/null @@ -1,25 +0,0 @@ -# Be sure to restart your server when you modify this file. - -# Your secret key is used for verifying the integrity of signed cookies. -# If you change this key, all old signed cookies will become invalid! - -# Make sure the secret is at least 30 characters and all random, -# no regular words or you'll be exposed to dictionary attacks. -# You can use `rake secret` to generate a secure secret key. - -# Make sure your secret_key_base is kept private -# if you're sharing your code publicly. -def find_secure_token - token_file = Rails.root.join('.secret') - if File.exist? token_file - # Use the existing token. - File.read(token_file).chomp - else - # Generate a new token of 64 random hexadecimal characters and store it in token_file. - token = SecureRandom.hex(64) - File.write(token_file, token) - token - end -end - -<%= app_name.classify %>::Application.config.secret_key_base = find_secure_token \ No newline at end of file diff --git a/templates/config/initializers/show_for.rb b/templates/config/initializers/show_for.rb deleted file mode 100644 index 1ccd07d..0000000 --- a/templates/config/initializers/show_for.rb +++ /dev/null @@ -1,3 +0,0 @@ -ShowFor.setup do |config| - config.label_class = nil -end \ No newline at end of file diff --git a/templates/config/initializers/sidekiq.rb b/templates/config/initializers/sidekiq.rb deleted file mode 100644 index 621a3e1..0000000 --- a/templates/config/initializers/sidekiq.rb +++ /dev/null @@ -1,13 +0,0 @@ -Sidekiq.configure_server do |config| - config.redis = {url: ENV['REDISTOGO_URL'] } -end unless ENV['REDISTOGO_URL'].blank? - -Sidekiq.configure_client do |config| - config.redis = { url: ENV['REDISTOGO_URL']} -end unless ENV['REDISTOGO_URL'].blank? - -# Open this if you have scheduled jobs -# schedule_file = 'config/schedule.yml' -# if File.exists?(schedule_file) && Sidekiq.server? -# Sidekiq::Cron::Job.load_from_hash YAML.load_file(schedule_file) -# end \ No newline at end of file diff --git a/templates/config/initializers/simple_form.rb b/templates/config/initializers/simple_form.rb deleted file mode 100644 index 40b05d8..0000000 --- a/templates/config/initializers/simple_form.rb +++ /dev/null @@ -1,142 +0,0 @@ -# Use this setup block to configure all options available in SimpleForm. -SimpleForm.setup do |config| - # Wrappers are used by the form builder to generate a - # complete input. You can remove any component from the - # wrapper, change the order or even add your own to the - # stack. The options given below are used to wrap the - # whole input. - config.wrappers :default, class: :input, - hint_class: :field_with_hint, error_class: :field_with_errors do |b| - ## Extensions enabled by default - # Any of these extensions can be disabled for a - # given input by passing: `f.input EXTENSION_NAME => false`. - # You can make any of these extensions optional by - # renaming `b.use` to `b.optional`. - - # Determines whether to use HTML5 (:email, :url, ...) - # and required attributes - b.use :html5 - - # Calculates placeholders automatically from I18n - # You can also pass a string as f.input placeholder: "Placeholder" - b.use :placeholder - - ## Optional extensions - # They are disabled unless you pass `f.input EXTENSION_NAME => :lookup` - # to the input. If so, they will retrieve the values from the model - # if any exists. If you want to enable the lookup for any of those - # extensions by default, you can change `b.optional` to `b.use`. - - # Calculates maxlength from length validations for string inputs - b.optional :maxlength - - # Calculates pattern from format validations for string inputs - b.optional :pattern - - # Calculates min and max from length validations for numeric inputs - b.optional :min_max - - # Calculates readonly automatically from readonly attributes - b.optional :readonly - - ## Inputs - b.use :label_input - b.use :hint, wrap_with: { tag: :span, class: :hint } - b.use :error, wrap_with: { tag: :span, class: :error } - end - - # The default wrapper to be used by the FormBuilder. - config.default_wrapper = :default - - # Define the way to render check boxes / radio buttons with labels. - # Defaults to :nested for bootstrap config. - # inline: input + label - # nested: label > input - config.boolean_style = :nested - - # Default class for buttons - config.button_class = 'btn' - - # Method used to tidy up errors. Specify any Rails Array method. - # :first lists the first message for each field. - # Use :to_sentence to list all errors for each field. - # config.error_method = :first - - # Default tag used for error notification helper. - config.error_notification_tag = :div - - # CSS class to add for error notification helper. - config.error_notification_class = 'alert alert-error' - - # ID to add for error notification helper. - # config.error_notification_id = nil - - # Series of attempts to detect a default label method for collection. - # config.collection_label_methods = [ :to_label, :name, :title, :to_s ] - - # Series of attempts to detect a default value method for collection. - # config.collection_value_methods = [ :id, :to_s ] - - # You can wrap a collection of radio/check boxes in a pre-defined tag, defaulting to none. - # config.collection_wrapper_tag = nil - - # You can define the class to use on all collection wrappers. Defaulting to none. - # config.collection_wrapper_class = nil - - # You can wrap each item in a collection of radio/check boxes with a tag, - # defaulting to :span. Please note that when using :boolean_style = :nested, - # SimpleForm will force this option to be a label. - # config.item_wrapper_tag = :span - - # You can define a class to use in all item wrappers. Defaulting to none. - # config.item_wrapper_class = nil - - # How the label text should be generated altogether with the required text. - # config.label_text = lambda { |label, required| "#{required} #{label}" } - - # You can define the class to use on all labels. Default is nil. - config.label_class = 'control-label' - - # You can define the class to use on all forms. Default is simple_form. - # config.form_class = :simple_form - - # You can define which elements should obtain additional classes - # config.generate_additional_classes_for = [:wrapper, :label, :input] - - # Whether attributes are required by default (or not). Default is true. - # config.required_by_default = true - - # Tell browsers whether to use the native HTML5 validations (novalidate form option). - # These validations are enabled in SimpleForm's internal config but disabled by default - # in this configuration, which is recommended due to some quirks from different browsers. - # To stop SimpleForm from generating the novalidate option, enabling the HTML5 validations, - # change this configuration to true. - config.browser_validations = false - - # Collection of methods to detect if a file type was given. - # config.file_methods = [ :mounted_as, :file?, :public_filename ] - - # Custom mappings for input types. This should be a hash containing a regexp - # to match as key, and the input type that will be used when the field name - # matches the regexp as value. - # config.input_mappings = { /count/ => :integer } - - # Custom wrappers for input types. This should be a hash containing an input - # type as key and the wrapper that will be used for all inputs with specified type. - # config.wrapper_mappings = { string: :prepend } - - # Default priority for time_zone inputs. - # config.time_zone_priority = nil - - # Default priority for country inputs. - # config.country_priority = nil - - # When false, do not use translations for labels. - # config.translate_labels = true - - # Automatically discover new inputs in Rails' autoload path. - # config.inputs_discovery = true - - # Cache SimpleForm inputs discovery - # config.cache_discovery = !Rails.env.development? -end diff --git a/templates/config/initializers/simple_form_bootstrap.rb b/templates/config/initializers/simple_form_bootstrap.rb deleted file mode 100644 index 96176a3..0000000 --- a/templates/config/initializers/simple_form_bootstrap.rb +++ /dev/null @@ -1,207 +0,0 @@ -# Use this setup block to configure all options available in SimpleForm. -SimpleForm.setup do |config| - config.error_notification_class = 'alert alert-danger' - config.button_class = 'btn btn-default' - config.boolean_label_class = nil - - config.wrappers :vertical_form, tag: 'div', class: 'form-group', error_class: 'has-error' do |b| - b.use :html5 - b.use :placeholder - b.optional :maxlength - b.optional :pattern - b.optional :min_max - b.optional :readonly - b.use :label, class: 'control-label' - - b.use :input, class: 'form-control' - b.use :error, wrap_with: { tag: 'span', class: 'help-block' } - b.use :hint, wrap_with: { tag: 'p', class: 'help-block' } - end - - config.wrappers :vertical_file_input, tag: 'div', class: 'form-group', error_class: 'has-error' do |b| - b.use :html5 - b.use :placeholder - b.optional :maxlength - b.optional :readonly - b.use :label, class: 'control-label' - - b.use :input - b.use :error, wrap_with: { tag: 'span', class: 'help-block' } - b.use :hint, wrap_with: { tag: 'p', class: 'help-block' } - end - - config.wrappers :vertical_boolean, tag: 'div', class: 'form-group', error_class: 'has-error' do |b| - b.use :html5 - b.optional :readonly - - b.wrapper tag: 'div', class: 'checkbox checkbox-primary' do |ba| - ba.use :label_input - end - - b.use :error, wrap_with: { tag: 'span', class: 'help-block' } - b.use :hint, wrap_with: { tag: 'p', class: 'help-block' } - end - - config.wrappers :vertical_radio_and_checkboxes, tag: 'div', class: 'form-group', error_class: 'has-error' do |b| - b.use :html5 - b.optional :readonly - b.use :label, class: 'control-label' - b.use :input - b.use :error, wrap_with: { tag: 'span', class: 'help-block' } - b.use :hint, wrap_with: { tag: 'p', class: 'help-block' } - end - - config.wrappers :horizontal_form, tag: 'div', class: 'form-group', error_class: 'has-error' do |b| - b.use :html5 - b.use :placeholder - b.optional :maxlength - b.optional :pattern - b.optional :min_max - b.optional :readonly - b.use :label, class: 'col-sm-3 control-label' - - b.wrapper tag: 'div', class: 'col-sm-9' do |ba| - ba.use :input, class: 'form-control' - ba.use :error, wrap_with: { tag: 'span', class: 'help-block' } - ba.use :hint, wrap_with: { tag: 'p', class: 'help-block' } - end - end - - config.wrappers :horizontal_file_input, tag: 'div', class: 'form-group', error_class: 'has-error' do |b| - b.use :html5 - b.use :placeholder - b.optional :maxlength - b.optional :readonly - b.use :label, class: 'col-sm-3 control-label' - - b.wrapper tag: 'div', class: 'col-sm-9' do |ba| - ba.use :input - ba.use :error, wrap_with: { tag: 'span', class: 'help-block' } - ba.use :hint, wrap_with: { tag: 'p', class: 'help-block' } - end - end - - config.wrappers :horizontal_boolean, tag: 'div', class: 'form-group', error_class: 'has-error' do |b| - b.use :html5 - b.optional :readonly - - b.wrapper tag: 'div', class: 'col-sm-offset-3 col-sm-9' do |wr| - wr.wrapper tag: 'div', class: 'checkbox' do |ba| - ba.use :label_input, class: 'col-sm-9' - end - - wr.use :error, wrap_with: { tag: 'span', class: 'help-block' } - wr.use :hint, wrap_with: { tag: 'p', class: 'help-block' } - end - end - - config.wrappers :horizontal_radio_and_checkboxes, tag: 'div', class: 'form-group', error_class: 'has-error' do |b| - b.use :html5 - b.optional :readonly - - b.use :label, class: 'col-sm-3 control-label' - - b.wrapper tag: 'div', class: 'col-sm-9' do |ba| - ba.use :input - ba.use :error, wrap_with: { tag: 'span', class: 'help-block' } - ba.use :hint, wrap_with: { tag: 'p', class: 'help-block' } - end - end - - config.wrappers :inline_form, tag: 'div', class: 'form-group', error_class: 'has-error' do |b| - b.use :html5 - b.use :placeholder - b.optional :maxlength - b.optional :pattern - b.optional :min_max - b.optional :readonly - b.use :label, class: 'sr-only' - - b.use :input, class: 'form-control' - b.use :error, wrap_with: { tag: 'span', class: 'help-block' } - b.use :hint, wrap_with: { tag: 'p', class: 'help-block' } - end - - # Wrappers for forms and inputs using the Bootstrap toolkit. - # Check the Bootstrap docs (http://getbootstrap.com) - # to learn about the different styles for forms and inputs, - # buttons and other elements. - config.default_wrapper = :vertical_form - config.wrapper_mappings = { - check_boxes: :vertical_radio_and_checkboxes, - radio_buttons: :vertical_radio_and_checkboxes, - file: :vertical_file_input, - boolean: :vertical_boolean, - } -end - -# # Use this setup block to configure all options available in SimpleForm. -# # File Path: RAILS_ROOT/config/initializers/simple_form_bootstrap.rb -# SimpleForm.setup do |config| -# config.wrappers :bootstrap, tag: 'div', class: 'form-group', error_class: 'has-error' do |b| -# b.use :html5 -# b.use :placeholder -# b.use :label, class: 'control-label' -# b.use :input -# b.use :error, wrap_with: { tag: 'span', class: 'help-block' } -# b.use :hint, wrap_with: { tag: 'p', class: 'help-block' } -# end -# -# config.wrappers :prepend, tag: 'div', class: 'form-group', error_class: 'has-error' do |b| -# b.use :html5 -# b.use :placeholder -# b.use :label, class: 'control-label' -# b.wrapper tag: 'div', class: 'input-group' do |input| -# input.wrapper tag: 'div', class: 'input-prepend' do |prepend| -# prepend.use :input -# end -# input.use :hint, wrap_with: { tag: 'span', class: 'help-block' } -# input.use :error, wrap_with: { tag: 'span', class: 'help-inline' } -# end -# end -# -# config.wrappers :append, tag: 'div', class: 'form-group', error_class: 'has-error' do |b| -# b.use :html5 -# b.use :placeholder -# b.use :label -# b.wrapper tag: 'div', class: 'input-group' do |input| -# input.wrapper tag: 'div', class: 'input-append' do |append| -# append.use :input -# end -# input.use :hint, wrap_with: { tag: 'span', class: 'help-block' } -# input.use :error, wrap_with: { tag: 'span', class: 'help-inline' } -# end -# end -# config.error_notification_class = 'alert alert-danger' -# -# # Wrappers for forms and inputs using the Twitter Bootstrap toolkit. -# # Check the Bootstrap docs (http://twitter.github.com/bootstrap) -# # to learn about the different styles for forms and inputs, -# # buttons and other elements. -# config.default_wrapper = :bootstrap -# end -# -# -# inputs = %w[ -# CollectionSelectInput -# DateTimeInput -# FileInput -# GroupedCollectionSelectInput -# NumericInput -# PasswordInput -# RangeInput -# StringInput -# TextInput -# ] -# -# inputs.each do |input_type| -# superclass = "SimpleForm::Inputs::#{input_type}".constantize -# -# new_class = Class.new(superclass) do -# def input_html_classes -# super.push('form-control') -# end -# end -# -# Object.const_set(input_type, new_class) -# end diff --git a/templates/config/locales/email.tr.yml b/templates/config/locales/email.tr.yml deleted file mode 100644 index 4f6700d..0000000 --- a/templates/config/locales/email.tr.yml +++ /dev/null @@ -1,28 +0,0 @@ ---- -tr: - email: - salut: 'Merhaba %{user};' - hello: 'Merhaba;' - devise: - confirmation_instruction: - desc1: E-posta adresinizi aşağıdaki link ile doğrulayabilirsiniz - btn_confirm: Hesabımı doğrula - reset_password: - desc1: Parolanızı değiştirmek için link isteğinde bulundunuz. Aşağıdaki link ile bunu yapabilirsiniz. - change: Parolamı değiştir - desc2: Eğer bu isteği siz yapmadıysanız bu e-posta'yı yok sayınız. - desc3: Parolanız yukarıdaki link'e erişip yeni bir parola oluşturmadığınız sürece değişmeyecektir. - admin: - login_info: - title: Yönetici Giriş Bilgileriniz - first_info: Portal üzerinden yönetici hesabınız oluşturuldu. Artık yönetici portalına giriş yapabilirsiniz. - second_info: Giriş bilgileriniz şu şekildedir - btn_login: Giriş yapmak için tıklayınız - last_info: "Eğer 'Giriş Yap' butonunu kullanamıyorsanız giriş linkiniz şu şekildedir
Link : %{link}
Bu linki kopyalayıp tarayıcınıza yapıştırınız.." - user: - login_info: - title: Kullanıcı Giriş Bilgileriniz - first_info: Portal üzerinden kullanıcı hesabınız oluşturuldu. Artık kullanıcı portalına giriş yapabilirsiniz. - second_info: Giriş bilgileriniz şu şekildedir - btn_login: Giriş yapmak için tıklayınız - last_info: "Eğer 'Giriş Yap' butonunu kullanamıyorsanız giriş linkiniz şu şekildedir
Link : %{link}
Bu linki kopyalayıp tarayıcınıza yapıştırınız.." diff --git a/templates/config/locales/models.tr.yml b/templates/config/locales/models.tr.yml deleted file mode 100644 index b09afa3..0000000 --- a/templates/config/locales/models.tr.yml +++ /dev/null @@ -1,87 +0,0 @@ ---- -tr: - activerecord: - models: - schemamigration: Schemamigration - user: Kullanıcı - users: Kullanıcılar - admin: Yönetici - admins: Yöneticiler - country: Ülke - countries: Ülkeler - city: Şehir - cities: Şehirler - audit: İşlem Geçmişi - audits: İşlem Geçmişleri - attributes: - user: - id: ID - email: E-posta - password: Parola - current_password: Şu anki parolanız - password_confirmation: Parola tekrarı - remember_me: Beni hatırla - encrypted_password: Şifrelenmiş parola - reset_password_token: Parola sıfırlama token'ı - reset_password_sent_at: Parola sıfırlama isteği gönderilme zamanı - remember_created_at: Beni hatırla oluşturulma zamanı - sign_in_count: Giriş sayısı - current_sign_in_at: Güncel giriş tarihi - last_sign_in_at: Son giriş tarihi - last_seen_at: Son görülme tarihi - current_sign_in_ip: Güncel girişe ait IP - last_sign_in_ip: Son giriş işlemine ait IP - authentication_token: Giriş token'ı - name: İsim - surname: Soyisim - is_active: Aktif mi? - time_zone: Zaman bölgesi - created_at: Oluşturulma tarihi - updated_at: Güncellenme tarihi - admin: - id: ID - email: E-posta - password: Parola - current_password: Şu anki parolanız - password_confirmation: Parola tekrarı - remember_me: Beni hatırla - encrypted_password: Şifrelenmiş parola - reset_password_token: Parola sıfırlama token'ı - reset_password_sent_at: Parola sıfırlama isteği gönderilme zamanı - remember_created_at: Beni hatırla oluşturulma zamanı - sign_in_count: Giriş sayısı - current_sign_in_at: Güncel giriş tarihi - last_sign_in_at: Son giriş tarihi - last_seen_at: Son görülme tarihi - current_sign_in_ip: Güncel girişe ait IP - last_sign_in_ip: Son giriş işlemine ait IP - authentication_token: Giriş token'ı - name: İsim - surname: Soyisim - is_active: Aktif mi? - created_at: Oluşturulma tarihi - updated_at: Güncellenme tarihi - country: - id: Id - name: Ülke ismi - created_at: Oluşturulma tarihi - updated_at: Güncellenme tarihi - city: - id: Id - name: Şehir ismi - country: Ülke - country_id: Ülke - created_at: Oluşturulma tarihi - updated_at: Güncellenme tarihi - audits: - id: ID - user_type: İşlemi yapan kullanıcı tipi - user: İşlemi yapan kullanıcı - type: Tip - type_id: Tip ID - action: İşlem - user_id: İşlemi yapan - auditable_type: İşlem yapılan - auditable_id: İşlem yapılan ID - action: İşlem Türü - created_at: Oluşturulma tarihi \ No newline at end of file diff --git a/templates/config/locales/responders.tr.yml b/templates/config/locales/responders.tr.yml deleted file mode 100644 index b7983c4..0000000 --- a/templates/config/locales/responders.tr.yml +++ /dev/null @@ -1,14 +0,0 @@ ---- -tr: - flash: - actions: - toggle_is_active: - passive: '%{resource_name} başarıyla pasif edildi.' - active: '%{resource_name} başarıyla aktif edildi.' - create: - notice: '%{resource_name} başarı ile yaratıldı.' - update: - notice: '%{resource_name} başarı ile güncellendi.' - destroy: - notice: '%{resource_name} başarı ile silindi.' - alert: '%{resource_name} silinemedi.' \ No newline at end of file diff --git a/templates/config/locales/show_for.tr.yml b/templates/config/locales/show_for.tr.yml deleted file mode 100644 index 90cf7fc..0000000 --- a/templates/config/locales/show_for.tr.yml +++ /dev/null @@ -1,6 +0,0 @@ ---- -tr: - show_for: - blank: "Belirtilmedi" - "yes": "Evet" - "no": "Hayır" \ No newline at end of file diff --git a/templates/config/locales/simple_form.tr.yml b/templates/config/locales/simple_form.tr.yml deleted file mode 100644 index c1e1f12..0000000 --- a/templates/config/locales/simple_form.tr.yml +++ /dev/null @@ -1,17 +0,0 @@ ---- -tr: - simple_form: - "yes": 'Evet' - "no": 'Hayır' - required: - text: 'zorunlu' - mark: '*' - error_notification: - default_message: "Lütfen aşağıdaki problemleri gözden geçiriniz:" - hints: - user: - new: - password: 'En az 8 karakter olmalıdır' -# labels: -# defaults: -# password: 'Password' \ No newline at end of file diff --git a/templates/config/locales/tr.yml b/templates/config/locales/tr.yml deleted file mode 100644 index a135f80..0000000 --- a/templates/config/locales/tr.yml +++ /dev/null @@ -1,34 +0,0 @@ ---- -tr: - phone: - formats: - long: '+99 (999) 999-9999' - date: - formats: - excel: - rails: '%d/%m/%Y' - datepicker: - rails: '%d/%m/%Y' - js: 'd/m/Y' - default: "%d/%m/%Y" - year_month: "%Y-%B" - date: '%d %B %Y' - time: - formats: - certificate_completed_at_english: '%m/%d/%Y' - certificate_completed_at: '%d/%m/%Y' - datetimepicker_rails: '%d/%m/%Y %H:%M' - datetimepicker: - rails: '%d/%m/%Y %H:%M' - js: 'd/m/Y H:i' - default: "%d/%m/%Y %H:%M" - year_month: "%Y-%B" - date: '%d %B %Y' - due_at: - rails: '%d/%m/%Y %H:%M' - js: 'd/m/Y H:i' - number: - currency: - format: - format: "%u %n" - unit: "₺" \ No newline at end of file diff --git a/templates/config/locales/view.tr.yml b/templates/config/locales/view.tr.yml deleted file mode 100644 index 11ed116..0000000 --- a/templates/config/locales/view.tr.yml +++ /dev/null @@ -1,100 +0,0 @@ ---- -tr: - actions: - update: Güncelleme - create: Oluşturma - destroy: Silme - delete: Silme - btn: - back: Geri - update: Güncelle - view: - excel_export: Excel Olarak Çıkart - make_passive: Pasif et - make_active: Aktif et - actions: İşlemler - select: Seçiniz - active: Aktif - passive: Pasif - start: Başlangıç - end: Bitiş - used: Kullanılan - not_used: Kullanılmayan - cancel: İptal et - all: Hepsi - reset: Temizle - quick_search: Arama yap.. - reload: Yeniden yükle - hello: Merhaba %{user} - there_is_no_data: Hiç %{resource} eklenmemiş. - create_resource_mail_info: "Yeni bir %{resource} eklediğinizde e-posta adresine giriş bilgileri gönderilecektir." - navbar: - settings: Ayarlar - signup: Kayıt ol - signin: Giriş Yap - sign_out: Çıkış yap - edit_login_info: Giriş bilgilerini güncelle - edit_profile_info: Profil bilgilerini güncelle - home_page: Anasayfa - admin_portal: Yönetici Portalı - profile: Profil - tooltips: - delete: Sil - are_you_sure: Devam etmek istedğinize emin misiniz? - choose: Seç - btn: - add: Ekle - update: Güncelle - back: Geri - detail: Detaylar - delete: Sil - dock: - dashboard: Kontrol Paneli - dashboard: Kontrol paneli - profile: Profil - system_users: Sistem kullanıcıları - system_datas: Sistem verileri - staging_warning: " Dikkat! Lütfen yapacağınız işlemlerde dikkatli olunuz. Şuan da test sunucusu üzerinde işlem yapıyorsunuz." - internal_server_error: "Üzgünüz. Şu anda bir hata var. Mühendislerimiz bu hata üzerinde çalışma yapıyorlar. En kısa sürede çözeceğiz." - not_found: "Üzgünüz. Bu sayfa bulunamadı. Taşınmış olabilir. Buraya gitmek istediğinizden emin olun." - devise: - session: - title: '%{model} Girişi' - button: Giriş Yap - remember_me: Beni Hatırla - deactivated: Üzgünüz, bu hesap pasif hale getirilmiştir. - registration: - title: '%{model} Giriş Bilgilerini Güncelle' - waiting_confirmation: 'E-posta addresi onayı için bekleniyor: %{email}' - hint_password: Değiştirmek istemiyorsanız boş bırakınız - hint_current_password: Değişiklikleri onaylamak için şuan ki parolanız girmelisiniz - new: - title: '%{model} Kayıt İşlemi' - character_hint: 'Minimum %{length} karakter' - button: Kayıt Ol - edit: - title: '%{model} Giriş Bilgilerini Güncelle' - shared: - links: - signup: Kayıt Ol - signin: Giriş Yap - forgot_password: Parolanızı mı unuttunuz? - confirmation_instructions: Onaylama yönergesini mi almadınız? - unlock_instructions: Kapatma yönergesini mi almadınız? - signin_with: '%{name} ile Giriş Yap' - signup_with: '%{name} ile Kayıt Ol' - confirmation: - new: - title: Onaylama Talimatlarını Yeniden Gönder - btn: - resend: Gönder - password: - new: - title: Parolanızı mı unuttunuz? - reset: - instructions: Parola sıfırlama talimatlarını gönder - edit: - title: Parolanızı Değiştiriniz - new_password: Yeni parolanız - confirmation: Yeni parola doğrulması - button: Parolamı Değiştir \ No newline at end of file diff --git a/templates/config/routes.erb b/templates/config/routes.erb deleted file mode 100644 index e341f7e..0000000 --- a/templates/config/routes.erb +++ /dev/null @@ -1,51 +0,0 @@ -require 'sidekiq/web' -require 'sidekiq/cron/web' - -Rails.application.routes.draw do - - Sidekiq::Web.use Rack::Auth::Basic do |username, password| - username == Settings.sidekiq.username && password == Settings.sidekiq.password - end if Rails.env.production? - mount Sidekiq::Web, at: '/sidekiq' - - concern :activeable do - post :toggle_is_active, on: :member - end - - # Admins - devise_for :admins, controllers: { sessions: 'hq/sessions', registrations: 'hq/registrations', passwords: 'hq/passwords' }, path: 'hq', - path_names: { sign_in: 'login', sign_out: 'logout', password: 'secret', confirmation: 'verification' } - as :admin do - get 'hq/edit' => 'hq/registrations#edit', as: 'edit_admin_registration' - put 'hq' => 'hq/registrations#update', as: 'admin_registration' - end - namespace :hq do - root to: 'dashboard#index' - resources :dashboard, only: [:index] - resources :admins, concerns: [:activeable] - resources :users, concerns: [:activeable] - resources :countries - resources :cities - resources :audits, only: [:index, :show] - end - # Users - devise_for :users, controllers: { sessions: 'user/sessions', registrations: 'user/registrations', passwords: 'user/passwords' }, path: 'user', - path_names: { sign_in: 'login', sign_out: 'logout', password: 'secret', confirmation: 'verification' } - as :user do - get 'user/edit' => 'user/registrations#edit', as: 'edit_user_profile_registration' - put 'user' => 'user/registrations#update', as: 'user_profile_registration' - end - namespace :user do - root to: 'dashboard#index' - resources :dashboard, only: [:index] - resources :profile, only: [:show, :edit, :update] - end - - # Common pages - root to: 'welcome#index' - - if Rails.env.production? or Rails.env.staging? - match '*unmatched_route', to: 'application#page_not_found', via: :all - end - -end diff --git a/templates/config/schedule.yml b/templates/config/schedule.yml deleted file mode 100644 index b58845d..0000000 --- a/templates/config/schedule.yml +++ /dev/null @@ -1,16 +0,0 @@ -# 00 * * * * -> Daily at midnight -# */5 * * * * -> Every 5 minutes -# */20 * * * * -> Every 20 minutes -# 0 0 * * * -> Every day at midnight -# 1 0 * * * -> Every day at 00:01 -# 20 0 * * * -> Every day at 00:20 -# 30 0 * * * -> Every day at 00:30 -# 40 0 * * * -> Every day at 00:40 - -# Look config/initializers/sidekiq.rb - -# Every day at 00:01 -#check_course_hosting_date_job: -# cron: 1 0 * * * Europe/Istanbul -# class: JobName -# queue: high_priority \ No newline at end of file diff --git a/templates/config/settings.yml b/templates/config/settings.yml deleted file mode 100644 index e69de29..0000000 diff --git a/templates/config/settings/production.yml b/templates/config/settings/production.yml deleted file mode 100644 index e69de29..0000000 diff --git a/templates/config/settings/staging.yml b/templates/config/settings/staging.yml deleted file mode 100644 index e69de29..0000000 diff --git a/templates/config/sidekiq.yml b/templates/config/sidekiq.yml deleted file mode 100644 index 8dcbf83..0000000 --- a/templates/config/sidekiq.yml +++ /dev/null @@ -1,13 +0,0 @@ -production: - :concurrency: 25 -staging: - :concurrency: 3 -development: - :concurrency: 25 - :logfile: ./log/sidekiq.log - :pidfile: ./tmp/pids/sidekiq.pid - :daemon: true -:queues: - - default - - mailers - - [high_priority, 2] \ No newline at end of file diff --git a/templates/cybele_Gemfile b/templates/cybele_Gemfile index 5920bb0..0bb7362 100644 --- a/templates/cybele_Gemfile +++ b/templates/cybele_Gemfile @@ -1,106 +1,66 @@ source 'https://rubygems.org' -gem 'dotenv-rails', require: 'dotenv/rails-now' -gem 'rails', '~> 4.2.6' -gem 'pg', '~> 0.18.4' -gem 'rails_config', '~> 0.4.2' -gem 'devise', '~> 3.4.1' -gem 'devise-i18n', '~> 0.9.0' -gem 'paperclip', '~> 4.3.0' -gem 'kangal', '~> 1.2.3' -gem 'annotate', '~> 2.6.0' -gem 'recipient_interceptor', '~> 0.1.2' -gem 'rails-i18n', '~> 4.0.4' -gem 'ransack', '~> 1.6.6' -gem 'polyamorous', '~> 1.2.0' +ruby '2.3.3' -# Deployment gems -gem 'capistrano', '~> 3.4.0' -group :development do - gem 'capistrano-rails', '~> 1.1', require: false - gem 'capistrano-bundler', '~> 1.1', require: false - gem 'sshkit-sudo', require: false - gem 'capistrano-maintenance', '~> 1.0', require: false - gem 'recipes_matic', '~> 1.3.0' +git_source(:github) do |repo_name| + repo_name = "#{repo_name}/#{repo_name}" unless repo_name.include?("/") + "https://github.com/#{repo_name}.git" end -gem 'exception_notification', '~> 4.1.1' -gem 'responders', '~> 2.1.0' -gem 'will_paginate', '~> 3.0.4' -gem 'will_paginate-bootstrap', '~> 0.2.3' -gem 'will-paginate-i18n', '~> 0.1.13' -gem 'rails_best_practices', '~> 1.15.1' -gem 'simple_form', '~> 3.2.0' -gem 'client_side_validations', '~> 4.2', '>= 4.2.1' -gem 'client_side_validations-simple_form', '~> 3.2', '>= 3.2.1' -gem 'show_for', '~> 0.4.0' -gem 'uglifier', '~> 2.7.1' -gem 'coffee-rails', '~> 4.1.0' -gem 'jquery-rails', '~> 4.0.4' -gem 'turbolinks', '~> 2.5.3' -gem 'haml', '~> 4.0.2' -gem 'haml-rails', '0.9.0' -gem 'breadcrumbs_on_rails', '~> 2.3.1' -gem 'blankable', '~> 0.2.0' -gem 'hierapolis-rails', '~> 1.1.3' -gem 'sass-rails', '~> 5.0.3' -gem 'compass-rails', '~> 2.0.5' -gem 'bootstrap-sass', '~> 3.3.4' -gem 'enum_help', '~> 0.0.14' -gem 'chosen-rails', '1.4.1' -gem 'bootstrap-chosen-rails', '0.0.4' -gem 'model_to_locale' -gem 'link_to_active_state' -gem 'jbuilder', '~> 2.4' +# Bundle edge Rails instead: gem 'rails', github: 'rails/rails' +gem 'rails', '~> 5.0.1' +# Use sqlite3 as the database for Active Record +gem 'sqlite3' +# Use Puma as the app server +gem 'puma', '~> 3.0' +# Use SCSS for stylesheets +gem 'sass-rails', '~> 5.0' +gem 'bootstrap-sass', '~> 3.3' +gem 'autoprefixer-rails', '~> 6.3' +# Use Uglifier as compressor for JavaScript assets +gem 'uglifier', '>= 1.3' +# Use CoffeeScript for .coffee assets and views +gem 'coffee-rails', '~> 4.2' +# See https://github.com/rails/execjs#readme for more supported runtimes +# gem 'therubyracer', platforms: :ruby -group :doc do - gem 'sdoc', require: false -end +# Use jquery as the JavaScript library +gem 'jquery-rails' +# Turbolinks makes navigating your web application faster. Read more: https://github.com/turbolinks/turbolinks +gem 'turbolinks', '~> 5' +# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder +gem 'jbuilder', '~> 2.5' + +gem 'devise', '~> 4.2.0' +# Use Redis adapter to run Action Cable in production +# gem 'redis', '~> 3.0' +# Use ActiveModel has_secure_password +# gem 'bcrypt', '~> 3.1.7' + +# Use Capistrano for deployment +# gem 'capistrano-rails', group: :development group :development, :test do - gem 'better_errors' - gem 'letter_opener' - gem 'rspec-rails' - gem 'binding_of_caller' - gem 'katip' - gem 'capybara' - gem 'bullet' - gem 'quiet_assets' + # Call 'byebug' anywhere in the code to stop execution and get a debugger console + gem 'byebug', platform: :mri + gem 'rspec-rails', '~> 3.5' end -# For heroku -group :production, :staging do - gem 'rails_12factor' +group :test do + gem 'capybara', '~> 2.12' end -# Notifications -gem 'rollbar', '~> 2.7.1' - -# App server -# gem 'unicorn', '~> 4.9.0' -gem 'puma', '~> 3.4.0' - -# Backgorund jobs -# Sidekiq -gem 'sidekiq', '~> 4.1' -gem 'devise-async', '~> 0.10.1' -gem 'sidekiq-cron', '~> 0.4.2' -gem 'sinatra', require: nil - -# Comand line execution -gem 'cocaine', '~> 0.5.8' - -# AWS -gem 'aws-sdk', '~> 1.6' - -# Phony Rails -gem 'phony_rails', '~> 0.12.11' - -# Excell export -gem 'to_xls', '~> 1.5', '>= 1.5.3' - -# Keep user activities -gem 'audited-activerecord', '~> 4.2' +group :development do + # Access an IRB console on exception pages or by using <%= console %> anywhere in the code. + gem 'web-console', '>= 3.3.0' + gem 'listen', '~> 3.0.5' + # Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring + gem 'spring' + gem 'spring-watcher-listen', '~> 2.0.0' + gem 'guard', '~> 2.14' + gem 'guard-rspec', '~> 4.7' + gem 'guard-cucumber', '~> 2.1' +end -# GSM service -# gem 'bulutfon_sdk', '~> 1.1', '>= 1.1.3' \ No newline at end of file +# Windows does not include zoneinfo files, so bundle the tzinfo-data gem +gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby] diff --git a/templates/env.sample.erb b/templates/env.sample.erb deleted file mode 100644 index 6dd5547..0000000 --- a/templates/env.sample.erb +++ /dev/null @@ -1,11 +0,0 @@ -ROOT_PATH=http://localhost:3000 - -SMTP_PASSWORD= -SMTP_USER_NAME=admin@<%= app_name %>.com -SMTP_ADDRESS=smtp.sendgrid.net - -BASIC_AUTH_IS_ACTIVE=no -S3_BUCKET_NAME=<%= app_name %>-v3-staging -AWS_RAW_URL=<%= app_name %>-v3-staging.s3.amazonaws.com -AWS_ACCESS_KEY_ID= -AWS_SECRET_ACCESS_KEY= diff --git a/templates/lib/application_responder.rb b/templates/lib/application_responder.rb deleted file mode 100644 index e82ed38..0000000 --- a/templates/lib/application_responder.rb +++ /dev/null @@ -1,8 +0,0 @@ -class ApplicationResponder < ActionController::Responder - include Responders::FlashResponder - include Responders::HttpCacheResponder - - # Uncomment this responder if you want your resources to redirect to the collection - # path (index action) instead of the resource path for POST/PUT/DELETE requests. - # include Responders::CollectionResponder -end diff --git a/templates/lib/data/cities.yml b/templates/lib/data/cities.yml deleted file mode 100644 index d5d6193..0000000 --- a/templates/lib/data/cities.yml +++ /dev/null @@ -1,163 +0,0 @@ ---- - - - name: "Adana" - - - name: "Adıyaman" - - - name: "Afyonkarahisar" - - - name: "Ağrı" - - - name: "Amasya" - - - name: "Ankara" - - - name: "Antalya" - - - name: "Artvin" - - - name: "Aydın" - - - name: "Balıkesir" - - - name: "Bilecik" - - - name: "Bingöl" - - - name: "Bitlis" - - - name: "Bolu" - - - name: "Burdur" - - - name: "Bursa" - - - name: "Çanakkale" - - - name: "Çankırı" - - - name: "Çorum" - - - name: "Denizli" - - - name: "Diyarbakır" - - - name: "Edirne" - - - name: "Elazığ" - - - name: "Erzincan" - - - name: "Erzurum" - - - name: "Eskişehir" - - - name: "Gaziantep" - - - name: "Giresun" - - - name: "Gümüşhane" - - - name: "Hakkari" - - - name: "Hatay" - - - name: "Isparta" - - - name: "Mersin" - - - name: "İstanbul" - - - name: "İzmir" - - - name: "Kars" - - - name: "Kastamonu" - - - name: "Kayseri" - - - name: "Kırklareli" - - - name: "Kırşehir" - - - name: "Kocaeli" - - - name: "Konya" - - - name: "Kütahya" - - - name: "Malatya" - - - name: "Manisa" - - - name: "Kahramanmaraş" - - - name: "Mardin" - - - name: "Muğla" - - - name: "Muş" - - - name: "Nevşehir" - - - name: "Niğde" - - - name: "Ordu" - - - name: "Rize" - - - name: "Sakarya" - - - name: "Samsun" - - - name: "Siirt" - - - name: "Sinop" - - - name: "Sivas" - - - name: "Tekirdağ" - - - name: "Tokat" - - - name: "Trabzon" - - - name: "Tunceli" - - - name: "Şanlıurfa" - - - name: "Uşak" - - - name: "Van" - - - name: "Yozgat" - - - name: "Zonguldak" - - - name: "Aksaray" - - - name: "Bayburt" - - - name: "Karaman" - - - name: "Kırıkkale" - - - name: "Batman" - - - name: "Şırnak" - - - name: "Bartın" - - - name: "Ardahan" - - - name: "Iğdır" - - - name: "Yalova" - - - name: "Karabük" - - - name: "Kilis" - - - name: "Osmaniye" - - - name: "Düzce" \ No newline at end of file diff --git a/templates/lib/tasks/annotate.rake b/templates/lib/tasks/annotate.rake deleted file mode 100644 index dad051d..0000000 --- a/templates/lib/tasks/annotate.rake +++ /dev/null @@ -1,6 +0,0 @@ -namespace :annotate do - desc 'Annotate your models!' - task models: :environment do |t, args| - exec 'annotate --exclude tests,fixtures,factories -p before' - end -end \ No newline at end of file diff --git a/templates/lib/tasks/dev.rake b/templates/lib/tasks/dev.rake deleted file mode 100644 index 6e67444..0000000 --- a/templates/lib/tasks/dev.rake +++ /dev/null @@ -1,56 +0,0 @@ -namespace :dev do - # Just run development env - # This code run insert seed and agency data - # A simple trick to over migration problem - task setup: [:environment] do - raise 'Nah, You are at production' if Rails.env.production? - Rake::Task['dev:kill_postgres_connections'].execute - Rake::Task['db:drop'].execute - Rake::Task['db:create'].execute - Rake::Task['db:migrate'].execute - Rake::Task['dev:seed'].execute - end - - desc 'seed test data' - task seed: [:environment] do - Rake::Task['db:seed'].execute - Rake::Task['dev:countries'].execute - Rake::Task['dev:cities'].execute - end - - desc 'import countries' - task countries: [:environment] do - Country.destroy_all - Country.create!(name: 'Türkiye') - end - - desc 'import turkey cities' - task cities: [:environment] do - City.destroy_all - cities = YAML.load_file( "#{Rails.root.to_s}/lib/data/cities.yml") - cities_array = [] - turkey = Country.first - cities.each do |city| - print '.' - cities_array << { - name: city['name'], - country_id: turkey.id - } - end - City.create!(cities_array) - end - - task kill_postgres_connections: [:environment] do - db_name = "#{File.basename(Rails.root)}_#{Rails.env}" - sh = < -class <%= controller_class_name %>Controller < ApplicationController -before_action :<%= "set_#{singular_table_name}" %>, only: [:show, :edit, :update, :destroy] -add_breadcrumb I18n.t('activerecord.models.<%= singular_table_name %>'), :<%= table_name %>_path -<% unless options[:singleton] -%> -def index - @search = <%= class_name %>.order(id: :desc).search(params[:q]) - @<%= table_name %> = @search.result(distinct: true).paginate(page: params[:page]) - respond_with(@<%= table_name %>) - end -<% end -%> - - def show - add_breadcrumb @<%= file_name %>.<%= attributes.first.name %>, <%= singular_table_name %>_path(@<%= file_name %>) - respond_with(@<%= file_name %>) -end - -def new - add_breadcrumb t('tooltips.new'), new_<%= singular_table_name %>_path - @<%= file_name %> = <%= orm_class.build(class_name) %> - respond_with(@<%= file_name %>) -end - -def edit - add_breadcrumb @<%= singular_table_name %>.id, <%= singular_table_name %>_path(@<%= singular_table_name %>) - add_breadcrumb t('tooltips.edit'), edit_<%= singular_table_name %>_path -end - -def create - @<%= file_name %> = <%= orm_class.build(class_name, "#{singular_table_name}_params") %> - @<%= orm_instance.save %> - respond_with(@<%= file_name %>) -end - -def update - @<%= orm_instance.update("#{singular_table_name}_params") %> - respond_with(@<%= file_name %>) -end - -def destroy - @<%= orm_instance.destroy %> - respond_with(@<%= file_name %>) -end - -private - -def <%= "set_#{singular_table_name}" %> - @<%= file_name %> = <%= orm_class.find(class_name, "params[:id]") %> - end - - def <%= "#{singular_table_name}_params" %> - params.require(<%= ":#{singular_table_name}" %>).permit(<%= attributes.map {|a| ":#{a.name}" }.sort.join(', ') %>) -end -end -<% end -%> \ No newline at end of file diff --git a/templates/public/images/favicon.png b/templates/public/images/favicon.png deleted file mode 100644 index 279640f..0000000 Binary files a/templates/public/images/favicon.png and /dev/null differ diff --git a/templates/public/images/mail-logo.png b/templates/public/images/mail-logo.png deleted file mode 100644 index 58a2667..0000000 Binary files a/templates/public/images/mail-logo.png and /dev/null differ diff --git a/templates/public/images/missing_cover.png b/templates/public/images/missing_cover.png deleted file mode 100644 index 58a2667..0000000 Binary files a/templates/public/images/missing_cover.png and /dev/null differ diff --git a/templates/public/images/missing_cover@2x.png b/templates/public/images/missing_cover@2x.png deleted file mode 100644 index 52fd271..0000000 Binary files a/templates/public/images/missing_cover@2x.png and /dev/null differ diff --git a/templates/public/images/missing_logo.png b/templates/public/images/missing_logo.png deleted file mode 100644 index 2a1a6eb..0000000 Binary files a/templates/public/images/missing_logo.png and /dev/null differ diff --git a/templates/public/images/missing_logo@2x.png b/templates/public/images/missing_logo@2x.png deleted file mode 100644 index 4647f37..0000000 Binary files a/templates/public/images/missing_logo@2x.png and /dev/null differ diff --git a/templates/public/images/sprite.png b/templates/public/images/sprite.png deleted file mode 100644 index fad2c4a..0000000 Binary files a/templates/public/images/sprite.png and /dev/null differ diff --git a/templates/ruby-version b/templates/ruby-version index 276cbf9..0bee604 100644 --- a/templates/ruby-version +++ b/templates/ruby-version @@ -1 +1 @@ -2.3.0 +2.3.3 diff --git a/templates/vendor/assets/javascripts/jquery.datetimepicker.js b/templates/vendor/assets/javascripts/jquery.datetimepicker.js deleted file mode 100644 index 2cf8d73..0000000 --- a/templates/vendor/assets/javascripts/jquery.datetimepicker.js +++ /dev/null @@ -1,1871 +0,0 @@ -/** - * @preserve jQuery DateTimePicker plugin v2.4.1 - * @homepage http://xdsoft.net/jqplugins/datetimepicker/ - * (c) 2014, Chupurnov Valeriy. - */ -/*global document,window,jQuery,setTimeout,clearTimeout*/ -(function ($) { - 'use strict'; - var default_options = { - i18n: { - ar: { // Arabic - months: [ - "كانون الثاني", "شباط", "آذار", "نيسان", "مايو", "حزيران", "تموز", "آب", "أيلول", "تشرين الأول", "تشرين الثاني", "كانون الأول" - ], - dayOfWeek: [ - "ن", "ث", "ع", "خ", "ج", "س", "ح" - ] - }, - ro: { // Romanian - months: [ - "ianuarie", "februarie", "martie", "aprilie", "mai", "iunie", "iulie", "august", "septembrie", "octombrie", "noiembrie", "decembrie" - ], - dayOfWeek: [ - "l", "ma", "mi", "j", "v", "s", "d" - ] - }, - id: { // Indonesian - months: [ - "Januari", "Februari", "Maret", "April", "Mei", "Juni", "Juli", "Agustus", "September", "Oktober", "November", "Desember" - ], - dayOfWeek: [ - "Sen", "Sel", "Rab", "Kam", "Jum", "Sab", "Min" - ] - }, - bg: { // Bulgarian - months: [ - "Януари", "Февруари", "Март", "Април", "Май", "Юни", "Юли", "Август", "Септември", "Октомври", "Ноември", "Декември" - ], - dayOfWeek: [ - "Нд", "Пн", "Вт", "Ср", "Чт", "Пт", "Сб" - ] - }, - fa: { // Persian/Farsi - months: [ - 'فروردین', 'اردیبهشت', 'خرداد', 'تیر', 'مرداد', 'شهریور', 'مهر', 'آبان', 'آذر', 'دی', 'بهمن', 'اسفند' - ], - dayOfWeek: [ - 'یکشنبه', 'دوشنبه', 'سه شنبه', 'چهارشنبه', 'پنجشنبه', 'جمعه', 'شنبه' - ] - }, - ru: { // Russian - months: [ - 'Январь', 'Февраль', 'Март', 'Апрель', 'Май', 'Июнь', 'Июль', 'Август', 'Сентябрь', 'Октябрь', 'Ноябрь', 'Декабрь' - ], - dayOfWeek: [ - "Вск", "Пн", "Вт", "Ср", "Чт", "Пт", "Сб" - ] - }, - uk: { // Ukrainian - months: [ - 'Січень', 'Лютий', 'Березень', 'Квітень', 'Травень', 'Червень', 'Липень', 'Серпень', 'Вересень', 'Жовтень', 'Листопад', 'Грудень' - ], - dayOfWeek: [ - "Ндл", "Пнд", "Втр", "Срд", "Чтв", "Птн", "Сбт" - ] - }, - en: { // English - months: [ - "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December" - ], - dayOfWeek: [ - "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat" - ] - }, - el: { // Ελληνικά - months: [ - "Ιανουάριος", "Φεβρουάριος", "Μάρτιος", "Απρίλιος", "Μάιος", "Ιούνιος", "Ιούλιος", "Αύγουστος", "Σεπτέμβριος", "Οκτώβριος", "Νοέμβριος", "Δεκέμβριος" - ], - dayOfWeek: [ - "Κυρ", "Δευ", "Τρι", "Τετ", "Πεμ", "Παρ", "Σαβ" - ] - }, - de: { // German - months: [ - 'Januar', 'Februar', 'März', 'April', 'Mai', 'Juni', 'Juli', 'August', 'September', 'Oktober', 'November', 'Dezember' - ], - dayOfWeek: [ - "So", "Mo", "Di", "Mi", "Do", "Fr", "Sa" - ] - }, - nl: { // Dutch - months: [ - "januari", "februari", "maart", "april", "mei", "juni", "juli", "augustus", "september", "oktober", "november", "december" - ], - dayOfWeek: [ - "zo", "ma", "di", "wo", "do", "vr", "za" - ] - }, - tr: { // Turkish - months: [ - "Ocak", "Şubat", "Mart", "Nisan", "Mayıs", "Haziran", "Temmuz", "Ağustos", "Eylül", "Ekim", "Kasım", "Aralık" - ], - dayOfWeek: [ - "Paz", "Pts", "Sal", "Çar", "Per", "Cum", "Cts" - ] - }, - fr: { //French - months: [ - "Janvier", "Février", "Mars", "Avril", "Mai", "Juin", "Juillet", "Août", "Septembre", "Octobre", "Novembre", "Décembre" - ], - dayOfWeek: [ - "Dim", "Lun", "Mar", "Mer", "Jeu", "Ven", "Sam" - ] - }, - es: { // Spanish - months: [ - "Enero", "Febrero", "Marzo", "Abril", "Mayo", "Junio", "Julio", "Agosto", "Septiembre", "Octubre", "Noviembre", "Diciembre" - ], - dayOfWeek: [ - "Dom", "Lun", "Mar", "Mié", "Jue", "Vie", "Sáb" - ] - }, - th: { // Thai - months: [ - 'มกราคม', 'กุมภาพันธ์', 'มีนาคม', 'เมษายน', 'พฤษภาคม', 'มิถุนายน', 'กรกฎาคม', 'สิงหาคม', 'กันยายน', 'ตุลาคม', 'พฤศจิกายน', 'ธันวาคม' - ], - dayOfWeek: [ - 'อา.', 'จ.', 'อ.', 'พ.', 'พฤ.', 'ศ.', 'ส.' - ] - }, - pl: { // Polish - months: [ - "styczeń", "luty", "marzec", "kwiecień", "maj", "czerwiec", "lipiec", "sierpień", "wrzesień", "październik", "listopad", "grudzień" - ], - dayOfWeek: [ - "nd", "pn", "wt", "śr", "cz", "pt", "sb" - ] - }, - pt: { // Portuguese - months: [ - "Janeiro", "Fevereiro", "Março", "Abril", "Maio", "Junho", "Julho", "Agosto", "Setembro", "Outubro", "Novembro", "Dezembro" - ], - dayOfWeek: [ - "Dom", "Seg", "Ter", "Qua", "Qui", "Sex", "Sab" - ] - }, - ch: { // Simplified Chinese - months: [ - "一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "十二月" - ], - dayOfWeek: [ - "日", "一", "二", "三", "四", "五", "六" - ] - }, - se: { // Swedish - months: [ - "Januari", "Februari", "Mars", "April", "Maj", "Juni", "Juli", "Augusti", "September", "Oktober", "November", "December" - ], - dayOfWeek: [ - "Sön", "Mån", "Tis", "Ons", "Tor", "Fre", "Lör" - ] - }, - kr: { // Korean - months: [ - "1월", "2월", "3월", "4월", "5월", "6월", "7월", "8월", "9월", "10월", "11월", "12월" - ], - dayOfWeek: [ - "일", "월", "화", "수", "목", "금", "토" - ] - }, - it: { // Italian - months: [ - "Gennaio", "Febbraio", "Marzo", "Aprile", "Maggio", "Giugno", "Luglio", "Agosto", "Settembre", "Ottobre", "Novembre", "Dicembre" - ], - dayOfWeek: [ - "Dom", "Lun", "Mar", "Mer", "Gio", "Ven", "Sab" - ] - }, - da: { // Dansk - months: [ - "January", "Februar", "Marts", "April", "Maj", "Juni", "July", "August", "September", "Oktober", "November", "December" - ], - dayOfWeek: [ - "Søn", "Man", "Tir", "Ons", "Tor", "Fre", "Lør" - ] - }, - no: { // Norwegian - months: [ - "Januar", "Februar", "Mars", "April", "Mai", "Juni", "Juli", "August", "September", "Oktober", "November", "Desember" - ], - dayOfWeek: [ - "Søn", "Man", "Tir", "Ons", "Tor", "Fre", "Lør" - ] - }, - ja: { // Japanese - months: [ - "1月", "2月", "3月", "4月", "5月", "6月", "7月", "8月", "9月", "10月", "11月", "12月" - ], - dayOfWeek: [ - "日", "月", "火", "水", "木", "金", "土" - ] - }, - vi: { // Vietnamese - months: [ - "Tháng 1", "Tháng 2", "Tháng 3", "Tháng 4", "Tháng 5", "Tháng 6", "Tháng 7", "Tháng 8", "Tháng 9", "Tháng 10", "Tháng 11", "Tháng 12" - ], - dayOfWeek: [ - "CN", "T2", "T3", "T4", "T5", "T6", "T7" - ] - }, - sl: { // Slovenščina - months: [ - "Januar", "Februar", "Marec", "April", "Maj", "Junij", "Julij", "Avgust", "September", "Oktober", "November", "December" - ], - dayOfWeek: [ - "Ned", "Pon", "Tor", "Sre", "Čet", "Pet", "Sob" - ] - }, - cs: { // Čeština - months: [ - "Leden", "Únor", "Březen", "Duben", "Květen", "Červen", "Červenec", "Srpen", "Září", "Říjen", "Listopad", "Prosinec" - ], - dayOfWeek: [ - "Ne", "Po", "Út", "St", "Čt", "Pá", "So" - ] - }, - hu: { // Hungarian - months: [ - "Január", "Február", "Március", "Április", "Május", "Június", "Július", "Augusztus", "Szeptember", "Október", "November", "December" - ], - dayOfWeek: [ - "Va", "Hé", "Ke", "Sze", "Cs", "Pé", "Szo" - ] - }, - az: { //Azerbaijanian (Azeri) - months: [ - "Yanvar", "Fevral", "Mart", "Aprel", "May", "Iyun", "Iyul", "Avqust", "Sentyabr", "Oktyabr", "Noyabr", "Dekabr" - ], - dayOfWeek: [ - "B", "Be", "Ça", "Ç", "Ca", "C", "Ş" - ] - }, - bs: { //Bosanski - months: [ - "Januar", "Februar", "Mart", "April", "Maj", "Jun", "Jul", "Avgust", "Septembar", "Oktobar", "Novembar", "Decembar" - ], - dayOfWeek: [ - "Ned", "Pon", "Uto", "Sri", "Čet", "Pet", "Sub" - ] - }, - ca: { //Català - months: [ - "Gener", "Febrer", "Març", "Abril", "Maig", "Juny", "Juliol", "Agost", "Setembre", "Octubre", "Novembre", "Desembre" - ], - dayOfWeek: [ - "Dg", "Dl", "Dt", "Dc", "Dj", "Dv", "Ds" - ] - }, - 'en-GB': { //English (British) - months: [ - "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December" - ], - dayOfWeek: [ - "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat" - ] - }, - et: { //"Eesti" - months: [ - "Jaanuar", "Veebruar", "Märts", "Aprill", "Mai", "Juuni", "Juuli", "August", "September", "Oktoober", "November", "Detsember" - ], - dayOfWeek: [ - "P", "E", "T", "K", "N", "R", "L" - ] - }, - eu: { //Euskara - months: [ - "Urtarrila", "Otsaila", "Martxoa", "Apirila", "Maiatza", "Ekaina", "Uztaila", "Abuztua", "Iraila", "Urria", "Azaroa", "Abendua" - ], - dayOfWeek: [ - "Ig.", "Al.", "Ar.", "Az.", "Og.", "Or.", "La." - ] - }, - fi: { //Finnish (Suomi) - months: [ - "Tammikuu", "Helmikuu", "Maaliskuu", "Huhtikuu", "Toukokuu", "Kesäkuu", "Heinäkuu", "Elokuu", "Syyskuu", "Lokakuu", "Marraskuu", "Joulukuu" - ], - dayOfWeek: [ - "Su", "Ma", "Ti", "Ke", "To", "Pe", "La" - ] - }, - gl: { //Galego - months: [ - "Xan", "Feb", "Maz", "Abr", "Mai", "Xun", "Xul", "Ago", "Set", "Out", "Nov", "Dec" - ], - dayOfWeek: [ - "Dom", "Lun", "Mar", "Mer", "Xov", "Ven", "Sab" - ] - }, - hr: { //Hrvatski - months: [ - "Siječanj", "Veljača", "Ožujak", "Travanj", "Svibanj", "Lipanj", "Srpanj", "Kolovoz", "Rujan", "Listopad", "Studeni", "Prosinac" - ], - dayOfWeek: [ - "Ned", "Pon", "Uto", "Sri", "Čet", "Pet", "Sub" - ] - }, - ko: { //Korean (한국어) - months: [ - "1월", "2월", "3월", "4월", "5월", "6월", "7월", "8월", "9월", "10월", "11월", "12월" - ], - dayOfWeek: [ - "일", "월", "화", "수", "목", "금", "토" - ] - }, - lt: { //Lithuanian (lietuvių) - months: [ - "Sausio", "Vasario", "Kovo", "Balandžio", "Gegužės", "Birželio", "Liepos", "Rugpjūčio", "Rugsėjo", "Spalio", "Lapkričio", "Gruodžio" - ], - dayOfWeek: [ - "Sek", "Pir", "Ant", "Tre", "Ket", "Pen", "Šeš" - ] - }, - lv: { //Latvian (Latviešu) - months: [ - "Janvāris", "Februāris", "Marts", "Aprīlis ", "Maijs", "Jūnijs", "Jūlijs", "Augusts", "Septembris", "Oktobris", "Novembris", "Decembris" - ], - dayOfWeek: [ - "Sv", "Pr", "Ot", "Tr", "Ct", "Pk", "St" - ] - }, - mk: { //Macedonian (Македонски) - months: [ - "јануари", "февруари", "март", "април", "мај", "јуни", "јули", "август", "септември", "октомври", "ноември", "декември" - ], - dayOfWeek: [ - "нед", "пон", "вто", "сре", "чет", "пет", "саб" - ] - }, - mn: { //Mongolian (Монгол) - months: [ - "1-р сар", "2-р сар", "3-р сар", "4-р сар", "5-р сар", "6-р сар", "7-р сар", "8-р сар", "9-р сар", "10-р сар", "11-р сар", "12-р сар" - ], - dayOfWeek: [ - "Дав", "Мяг", "Лха", "Пүр", "Бсн", "Бям", "Ням" - ] - }, - 'pt-BR': { //Português(Brasil) - months: [ - "Janeiro", "Fevereiro", "Março", "Abril", "Maio", "Junho", "Julho", "Agosto", "Setembro", "Outubro", "Novembro", "Dezembro" - ], - dayOfWeek: [ - "Dom", "Seg", "Ter", "Qua", "Qui", "Sex", "Sáb" - ] - }, - sk: { //Slovenčina - months: [ - "Január", "Február", "Marec", "Apríl", "Máj", "Jún", "Júl", "August", "September", "Október", "November", "December" - ], - dayOfWeek: [ - "Ne", "Po", "Ut", "St", "Št", "Pi", "So" - ] - }, - sq: { //Albanian (Shqip) - months: [ - "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December" - ], - dayOfWeek: [ - "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat" - ] - }, - 'sr-YU': { //Serbian (Srpski) - months: [ - "Januar", "Februar", "Mart", "April", "Maj", "Jun", "Jul", "Avgust", "Septembar", "Oktobar", "Novembar", "Decembar" - ], - dayOfWeek: [ - "Ned", "Pon", "Uto", "Sre", "čet", "Pet", "Sub" - ] - }, - sr: { //Serbian Cyrillic (Српски) - months: [ - "јануар", "фебруар", "март", "април", "мај", "јун", "јул", "август", "септембар", "октобар", "новембар", "децембар" - ], - dayOfWeek: [ - "нед", "пон", "уто", "сре", "чет", "пет", "суб" - ] - }, - sv: { //Svenska - months: [ - "Januari", "Februari", "Mars", "April", "Maj", "Juni", "Juli", "Augusti", "September", "Oktober", "November", "December" - ], - dayOfWeek: [ - "Sön", "Mån", "Tis", "Ons", "Tor", "Fre", "Lör" - ] - }, - 'zh-TW': { //Traditional Chinese (繁體中文) - months: [ - "一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "十二月" - ], - dayOfWeek: [ - "日", "一", "二", "三", "四", "五", "六" - ] - }, - zh: { //Simplified Chinese (简体中文) - months: [ - "一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一月", "十二月" - ], - dayOfWeek: [ - "日", "一", "二", "三", "四", "五", "六" - ] - }, - he: { //Hebrew (עברית) - months: [ - 'ינואר', 'פברואר', 'מרץ', 'אפריל', 'מאי', 'יוני', 'יולי', 'אוגוסט', 'ספטמבר', 'אוקטובר', 'נובמבר', 'דצמבר' - ], - dayOfWeek: [ - 'א\'', 'ב\'', 'ג\'', 'ד\'', 'ה\'', 'ו\'', 'שבת' - ] - }, - hy: { // Armenian - months: [ - "Հունվար", "Փետրվար", "Մարտ", "Ապրիլ", "Մայիս", "Հունիս", "Հուլիս", "Օգոստոս", "Սեպտեմբեր", "Հոկտեմբեր", "Նոյեմբեր", "Դեկտեմբեր" - ], - dayOfWeek: [ - "Կի", "Երկ", "Երք", "Չոր", "Հնգ", "Ուրբ", "Շբթ" - ] - } - }, - value: '', - lang: 'en', - - format: 'Y/m/d H:i', - formatTime: 'H:i', - formatDate: 'Y/m/d', - - startDate: false, // new Date(), '1986/12/08', '-1970/01/05','-1970/01/05', - step: 60, - monthChangeSpinner: true, - - closeOnDateSelect: false, - closeOnWithoutClick: true, - closeOnInputClick: true, - - timepicker: true, - datepicker: true, - weeks: false, - - defaultTime: false, // use formatTime format (ex. '10:00' for formatTime: 'H:i') - defaultDate: false, // use formatDate format (ex new Date() or '1986/12/08' or '-1970/01/05' or '-1970/01/05') - - minDate: false, - maxDate: false, - minTime: false, - maxTime: false, - - allowTimes: [], - opened: false, - initTime: true, - inline: false, - theme: '', - - onSelectDate: function () {}, - onSelectTime: function () {}, - onChangeMonth: function () {}, - onChangeYear: function () {}, - onChangeDateTime: function () {}, - onShow: function () {}, - onClose: function () {}, - onGenerate: function () {}, - - withoutCopyright: true, - inverseButton: false, - hours12: false, - next: 'xdsoft_next', - prev : 'xdsoft_prev', - dayOfWeekStart: 0, - parentID: 'body', - timeHeightInTimePicker: 25, - timepickerScrollbar: true, - todayButton: true, - defaultSelect: true, - - scrollMonth: true, - scrollTime: true, - scrollInput: true, - - lazyInit: false, - mask: false, - validateOnBlur: true, - allowBlank: true, - yearStart: 1950, - yearEnd: 2050, - style: '', - id: '', - fixed: false, - roundTime: 'round', // ceil, floor - className: '', - weekends: [], - disabledDates : [], - yearOffset: 0, - beforeShowDay: null, - - enterLikeTab: true - }; - // fix for ie8 - if (!Array.prototype.indexOf) { - Array.prototype.indexOf = function (obj, start) { - var i, j; - for (i = (start || 0), j = this.length; i < j; i += 1) { - if (this[i] === obj) { return i; } - } - return -1; - }; - } - Date.prototype.countDaysInMonth = function () { - return new Date(this.getFullYear(), this.getMonth() + 1, 0).getDate(); - }; - $.fn.xdsoftScroller = function (percent) { - return this.each(function () { - var timeboxparent = $(this), - pointerEventToXY = function (e) { - var out = {x: 0, y: 0}, - touch; - if (e.type === 'touchstart' || e.type === 'touchmove' || e.type === 'touchend' || e.type === 'touchcancel') { - touch = e.originalEvent.touches[0] || e.originalEvent.changedTouches[0]; - out.x = touch.clientX; - out.y = touch.clientY; - } else if (e.type === 'mousedown' || e.type === 'mouseup' || e.type === 'mousemove' || e.type === 'mouseover' || e.type === 'mouseout' || e.type === 'mouseenter' || e.type === 'mouseleave') { - out.x = e.clientX; - out.y = e.clientY; - } - return out; - }, - move = 0, - timebox, - parentHeight, - height, - scrollbar, - scroller, - maximumOffset = 100, - start = false, - startY = 0, - startTop = 0, - h1 = 0, - touchStart = false, - startTopScroll = 0, - calcOffset = function () {}; - if (percent === 'hide') { - timeboxparent.find('.xdsoft_scrollbar').hide(); - return; - } - if (!$(this).hasClass('xdsoft_scroller_box')) { - timebox = timeboxparent.children().eq(0); - parentHeight = timeboxparent[0].clientHeight; - height = timebox[0].offsetHeight; - scrollbar = $('
'); - scroller = $('
'); - scrollbar.append(scroller); - - timeboxparent.addClass('xdsoft_scroller_box').append(scrollbar); - calcOffset = function calcOffset(event) { - var offset = pointerEventToXY(event).y - startY + startTopScroll; - if (offset < 0) { - offset = 0; - } - if (offset + scroller[0].offsetHeight > h1) { - offset = h1 - scroller[0].offsetHeight; - } - timeboxparent.trigger('scroll_element.xdsoft_scroller', [maximumOffset ? offset / maximumOffset : 0]); - }; - - scroller - .on('touchstart.xdsoft_scroller mousedown.xdsoft_scroller', function (event) { - if (!parentHeight) { - timeboxparent.trigger('resize_scroll.xdsoft_scroller', [percent]); - } - - startY = pointerEventToXY(event).y; - startTopScroll = parseInt(scroller.css('margin-top'), 10); - h1 = scrollbar[0].offsetHeight; - - if (event.type === 'mousedown') { - if (document) { - $(document.body).addClass('xdsoft_noselect'); - } - $([document.body, window]).on('mouseup.xdsoft_scroller', function arguments_callee() { - $([document.body, window]).off('mouseup.xdsoft_scroller', arguments_callee) - .off('mousemove.xdsoft_scroller', calcOffset) - .removeClass('xdsoft_noselect'); - }); - $(document.body).on('mousemove.xdsoft_scroller', calcOffset); - } else { - touchStart = true; - event.stopPropagation(); - event.preventDefault(); - } - }) - .on('touchmove', function (event) { - if (touchStart) { - event.preventDefault(); - calcOffset(event); - } - }) - .on('touchend touchcancel', function (event) { - touchStart = false; - startTopScroll = 0; - }); - - timeboxparent - .on('scroll_element.xdsoft_scroller', function (event, percentage) { - if (!parentHeight) { - timeboxparent.trigger('resize_scroll.xdsoft_scroller', [percentage, true]); - } - percentage = percentage > 1 ? 1 : (percentage < 0 || isNaN(percentage)) ? 0 : percentage; - - scroller.css('margin-top', maximumOffset * percentage); - - setTimeout(function () { - timebox.css('marginTop', -parseInt((timebox[0].offsetHeight - parentHeight) * percentage, 10)); - }, 10); - }) - .on('resize_scroll.xdsoft_scroller', function (event, percentage, noTriggerScroll) { - var percent, sh; - parentHeight = timeboxparent[0].clientHeight; - height = timebox[0].offsetHeight; - percent = parentHeight / height; - sh = percent * scrollbar[0].offsetHeight; - if (percent > 1) { - scroller.hide(); - } else { - scroller.show(); - scroller.css('height', parseInt(sh > 10 ? sh : 10, 10)); - maximumOffset = scrollbar[0].offsetHeight - scroller[0].offsetHeight; - if (noTriggerScroll !== true) { - timeboxparent.trigger('scroll_element.xdsoft_scroller', [percentage || Math.abs(parseInt(timebox.css('marginTop'), 10)) / (height - parentHeight)]); - } - } - }); - - timeboxparent.on('mousewheel', function (event) { - var top = Math.abs(parseInt(timebox.css('marginTop'), 10)); - - top = top - (event.deltaY * 20); - if (top < 0) { - top = 0; - } - - timeboxparent.trigger('scroll_element.xdsoft_scroller', [top / (height - parentHeight)]); - event.stopPropagation(); - return false; - }); - - timeboxparent.on('touchstart', function (event) { - start = pointerEventToXY(event); - startTop = Math.abs(parseInt(timebox.css('marginTop'), 10)); - }); - - timeboxparent.on('touchmove', function (event) { - if (start) { - event.preventDefault(); - var coord = pointerEventToXY(event); - timeboxparent.trigger('scroll_element.xdsoft_scroller', [(startTop - (coord.y - start.y)) / (height - parentHeight)]); - } - }); - - timeboxparent.on('touchend touchcancel', function (event) { - start = false; - startTop = 0; - }); - } - timeboxparent.trigger('resize_scroll.xdsoft_scroller', [percent]); - }); - }; - - $.fn.datetimepicker = function (opt) { - var KEY0 = 48, - KEY9 = 57, - _KEY0 = 96, - _KEY9 = 105, - CTRLKEY = 17, - DEL = 46, - ENTER = 13, - ESC = 27, - BACKSPACE = 8, - ARROWLEFT = 37, - ARROWUP = 38, - ARROWRIGHT = 39, - ARROWDOWN = 40, - TAB = 9, - F5 = 116, - AKEY = 65, - CKEY = 67, - VKEY = 86, - ZKEY = 90, - YKEY = 89, - ctrlDown = false, - options = ($.isPlainObject(opt) || !opt) ? $.extend(true, {}, default_options, opt) : $.extend(true, {}, default_options), - - lazyInitTimer = 0, - createDateTimePicker, - destroyDateTimePicker, - - lazyInit = function (input) { - input - .on('open.xdsoft focusin.xdsoft mousedown.xdsoft', function initOnActionCallback(event) { - if (input.is(':disabled') || input.data('xdsoft_datetimepicker')) { - return; - } - clearTimeout(lazyInitTimer); - lazyInitTimer = setTimeout(function () { - - if (!input.data('xdsoft_datetimepicker')) { - createDateTimePicker(input); - } - input - .off('open.xdsoft focusin.xdsoft mousedown.xdsoft', initOnActionCallback) - .trigger('open.xdsoft'); - }, 100); - }); - }; - - createDateTimePicker = function (input) { - var datetimepicker = $('
'), - xdsoft_copyright = $(''), - datepicker = $('
'), - mounth_picker = $('
' + - '
' + - '
' + - '
'), - calendar = $('
'), - timepicker = $('
'), - timeboxparent = timepicker.find('.xdsoft_time_box').eq(0), - timebox = $('
'), - /*scrollbar = $('
'), - scroller = $('
'),*/ - monthselect = $('
'), - yearselect = $('
'), - triggerAfterOpen = false, - XDSoft_datetime, - //scroll_element, - xchangeTimer, - timerclick, - current_time_index, - setPos, - timer = 0, - timer1 = 0, - _xdsoft_datetime; - - mounth_picker - .find('.xdsoft_month span') - .after(monthselect); - mounth_picker - .find('.xdsoft_year span') - .after(yearselect); - - mounth_picker - .find('.xdsoft_month,.xdsoft_year') - .on('mousedown.xdsoft', function (event) { - var select = $(this).find('.xdsoft_select').eq(0), - val = 0, - top = 0, - visible = select.is(':visible'), - items, - i; - - mounth_picker - .find('.xdsoft_select') - .hide(); - if (_xdsoft_datetime.currentTime) { - val = _xdsoft_datetime.currentTime[$(this).hasClass('xdsoft_month') ? 'getMonth' : 'getFullYear'](); - } - - select[visible ? 'hide' : 'show'](); - for (items = select.find('div.xdsoft_option'), i = 0; i < items.length; i += 1) { - if (items.eq(i).data('value') === val) { - break; - } else { - top += items[0].offsetHeight; - } - } - - select.xdsoftScroller(top / (select.children()[0].offsetHeight - (select[0].clientHeight))); - event.stopPropagation(); - return false; - }); - - mounth_picker - .find('.xdsoft_select') - .xdsoftScroller() - .on('mousedown.xdsoft', function (event) { - event.stopPropagation(); - event.preventDefault(); - }) - .on('mousedown.xdsoft', '.xdsoft_option', function (event) { - var year = _xdsoft_datetime.currentTime.getFullYear(); - if (_xdsoft_datetime && _xdsoft_datetime.currentTime) { - _xdsoft_datetime.currentTime[$(this).parent().parent().hasClass('xdsoft_monthselect') ? 'setMonth' : 'setFullYear']($(this).data('value')); - } - - $(this).parent().parent().hide(); - - datetimepicker.trigger('xchange.xdsoft'); - if (options.onChangeMonth && $.isFunction(options.onChangeMonth)) { - options.onChangeMonth.call(datetimepicker, _xdsoft_datetime.currentTime, datetimepicker.data('input')); - } - - if (year !== _xdsoft_datetime.currentTime.getFullYear() && $.isFunction(options.onChangeYear)) { - options.onChangeYear.call(datetimepicker, _xdsoft_datetime.currentTime, datetimepicker.data('input')); - } - }); - - datetimepicker.setOptions = function (_options) { - options = $.extend(true, {}, options, _options); - - if (_options.allowTimes && $.isArray(_options.allowTimes) && _options.allowTimes.length) { - options.allowTimes = $.extend(true, [], _options.allowTimes); - } - - if (_options.weekends && $.isArray(_options.weekends) && _options.weekends.length) { - options.weekends = $.extend(true, [], _options.weekends); - } - - if (_options.disabledDates && $.isArray(_options.disabledDates) && _options.disabledDates.length) { - options.disabledDates = $.extend(true, [], _options.disabledDates); - } - - if ((options.open || options.opened) && (!options.inline)) { - input.trigger('open.xdsoft'); - } - - if (options.inline) { - triggerAfterOpen = true; - datetimepicker.addClass('xdsoft_inline'); - input.after(datetimepicker).hide(); - } - - if (options.inverseButton) { - options.next = 'xdsoft_prev'; - options.prev = 'xdsoft_next'; - } - - if (options.datepicker) { - datepicker.addClass('active'); - } else { - datepicker.removeClass('active'); - } - - if (options.timepicker) { - timepicker.addClass('active'); - } else { - timepicker.removeClass('active'); - } - - if (options.value) { - if (input && input.val) { - input.val(options.value); - } - _xdsoft_datetime.setCurrentTime(options.value); - } - - if (isNaN(options.dayOfWeekStart)) { - options.dayOfWeekStart = 0; - } else { - options.dayOfWeekStart = parseInt(options.dayOfWeekStart, 10) % 7; - } - - if (!options.timepickerScrollbar) { - timeboxparent.xdsoftScroller('hide'); - } - - if (options.minDate && /^-(.*)$/.test(options.minDate)) { - options.minDate = _xdsoft_datetime.strToDateTime(options.minDate).dateFormat(options.formatDate); - } - - if (options.maxDate && /^\+(.*)$/.test(options.maxDate)) { - options.maxDate = _xdsoft_datetime.strToDateTime(options.maxDate).dateFormat(options.formatDate); - } - - mounth_picker - .find('.xdsoft_today_button') - .css('visibility', !options.todayButton ? 'hidden' : 'visible'); - - if (options.mask) { - var e, - getCaretPos = function (input) { - try { - if (document.selection && document.selection.createRange) { - var range = document.selection.createRange(); - return range.getBookmark().charCodeAt(2) - 2; - } - if (input.setSelectionRange) { - return input.selectionStart; - } - } catch (e) { - return 0; - } - }, - setCaretPos = function (node, pos) { - node = (typeof node === "string" || node instanceof String) ? document.getElementById(node) : node; - if (!node) { - return false; - } - if (node.createTextRange) { - var textRange = node.createTextRange(); - textRange.collapse(true); - textRange.moveEnd('character', pos); - textRange.moveStart('character', pos); - textRange.select(); - return true; - } - if (node.setSelectionRange) { - node.setSelectionRange(pos, pos); - return true; - } - return false; - }, - isValidValue = function (mask, value) { - var reg = mask - .replace(/([\[\]\/\{\}\(\)\-\.\+]{1})/g, '\\$1') - .replace(/_/g, '{digit+}') - .replace(/([0-9]{1})/g, '{digit$1}') - .replace(/\{digit([0-9]{1})\}/g, '[0-$1_]{1}') - .replace(/\{digit[\+]\}/g, '[0-9_]{1}'); - return (new RegExp(reg)).test(value); - }; - input.off('keydown.xdsoft'); - - if (options.mask === true) { - options.mask = options.format - .replace(/Y/g, '9999') - .replace(/F/g, '9999') - .replace(/m/g, '19') - .replace(/d/g, '39') - .replace(/H/g, '29') - .replace(/i/g, '59') - .replace(/s/g, '59'); - } - - if ($.type(options.mask) === 'string') { - if (!isValidValue(options.mask, input.val())) { - input.val(options.mask.replace(/[0-9]/g, '_')); - } - - input.on('keydown.xdsoft', function (event) { - var val = this.value, - key = event.which, - pos, - digit; - - if (((key >= KEY0 && key <= KEY9) || (key >= _KEY0 && key <= _KEY9)) || (key === BACKSPACE || key === DEL)) { - pos = getCaretPos(this); - digit = (key !== BACKSPACE && key !== DEL) ? String.fromCharCode((_KEY0 <= key && key <= _KEY9) ? key - KEY0 : key) : '_'; - - if ((key === BACKSPACE || key === DEL) && pos) { - pos -= 1; - digit = '_'; - } - - while (/[^0-9_]/.test(options.mask.substr(pos, 1)) && pos < options.mask.length && pos > 0) { - pos += (key === BACKSPACE || key === DEL) ? -1 : 1; - } - - val = val.substr(0, pos) + digit + val.substr(pos + 1); - if ($.trim(val) === '') { - val = options.mask.replace(/[0-9]/g, '_'); - } else { - if (pos === options.mask.length) { - event.preventDefault(); - return false; - } - } - - pos += (key === BACKSPACE || key === DEL) ? 0 : 1; - while (/[^0-9_]/.test(options.mask.substr(pos, 1)) && pos < options.mask.length && pos > 0) { - pos += (key === BACKSPACE || key === DEL) ? -1 : 1; - } - - if (isValidValue(options.mask, val)) { - this.value = val; - setCaretPos(this, pos); - } else if ($.trim(val) === '') { - this.value = options.mask.replace(/[0-9]/g, '_'); - } else { - input.trigger('error_input.xdsoft'); - } - } else { - if (([AKEY, CKEY, VKEY, ZKEY, YKEY].indexOf(key) !== -1 && ctrlDown) || [ESC, ARROWUP, ARROWDOWN, ARROWLEFT, ARROWRIGHT, F5, CTRLKEY, TAB, ENTER].indexOf(key) !== -1) { - return true; - } - } - - event.preventDefault(); - return false; - }); - } - } - if (options.validateOnBlur) { - input - .off('blur.xdsoft') - .on('blur.xdsoft', function () { - if (options.allowBlank && !$.trim($(this).val()).length) { - $(this).val(null); - datetimepicker.data('xdsoft_datetime').empty(); - } else if (!Date.parseDate($(this).val(), options.format)) { - var splittedHours = +([$(this).val()[0], $(this).val()[1]].join('')), - splittedMinutes = +([$(this).val()[2], $(this).val()[3]].join('')); - - // parse the numbers as 0312 => 03:12 - if(!options.datepicker && options.timepicker && splittedHours >= 0 && splittedHours < 24 && splittedMinutes >= 0 && splittedMinutes < 60) { - $(this).val([splittedHours, splittedMinutes].map(function(item) { - return item > 9 ? item : '0' + item - }).join(':')); - } else { - $(this).val((_xdsoft_datetime.now()).dateFormat(options.format)); - } - - datetimepicker.data('xdsoft_datetime').setCurrentTime($(this).val()); - } else { - datetimepicker.data('xdsoft_datetime').setCurrentTime($(this).val()); - } - - datetimepicker.trigger('changedatetime.xdsoft'); - }); - } - options.dayOfWeekStartPrev = (options.dayOfWeekStart === 0) ? 6 : options.dayOfWeekStart - 1; - - datetimepicker - .trigger('xchange.xdsoft') - .trigger('afterOpen.xdsoft'); - }; - - datetimepicker - .data('options', options) - .on('mousedown.xdsoft', function (event) { - event.stopPropagation(); - event.preventDefault(); - yearselect.hide(); - monthselect.hide(); - return false; - }); - - //scroll_element = timepicker.find('.xdsoft_time_box'); - timeboxparent.append(timebox); - timeboxparent.xdsoftScroller(); - - datetimepicker.on('afterOpen.xdsoft', function () { - timeboxparent.xdsoftScroller(); - }); - - datetimepicker - .append(datepicker) - .append(timepicker); - - if (options.withoutCopyright !== true) { - datetimepicker - .append(xdsoft_copyright); - } - - datepicker - .append(mounth_picker) - .append(calendar); - - $(options.parentID) - .append(datetimepicker); - - XDSoft_datetime = function () { - var _this = this; - _this.now = function (norecursion) { - var d = new Date(), - date, - time; - - if (!norecursion && options.defaultDate) { - date = _this.strToDate(options.defaultDate); - d.setFullYear(date.getFullYear()); - d.setMonth(date.getMonth()); - d.setDate(date.getDate()); - } - - if (options.yearOffset) { - d.setFullYear(d.getFullYear() + options.yearOffset); - } - - if (!norecursion && options.defaultTime) { - time = _this.strtotime(options.defaultTime); - d.setHours(time.getHours()); - d.setMinutes(time.getMinutes()); - } - - return d; - }; - - _this.isValidDate = function (d) { - if (Object.prototype.toString.call(d) !== "[object Date]") { - return false; - } - return !isNaN(d.getTime()); - }; - - _this.setCurrentTime = function (dTime) { - _this.currentTime = (typeof dTime === 'string') ? _this.strToDateTime(dTime) : _this.isValidDate(dTime) ? dTime : _this.now(); - datetimepicker.trigger('xchange.xdsoft'); - }; - - _this.empty = function () { - _this.currentTime = null; - }; - - _this.getCurrentTime = function (dTime) { - return _this.currentTime; - }; - - _this.nextMonth = function () { - var month = _this.currentTime.getMonth() + 1, - year; - if (month === 12) { - _this.currentTime.setFullYear(_this.currentTime.getFullYear() + 1); - month = 0; - } - - year = _this.currentTime.getFullYear(); - - _this.currentTime.setDate( - Math.min( - new Date(_this.currentTime.getFullYear(), month + 1, 0).getDate(), - _this.currentTime.getDate() - ) - ); - _this.currentTime.setMonth(month); - - if (options.onChangeMonth && $.isFunction(options.onChangeMonth)) { - options.onChangeMonth.call(datetimepicker, _xdsoft_datetime.currentTime, datetimepicker.data('input')); - } - - if (year !== _this.currentTime.getFullYear() && $.isFunction(options.onChangeYear)) { - options.onChangeYear.call(datetimepicker, _xdsoft_datetime.currentTime, datetimepicker.data('input')); - } - - datetimepicker.trigger('xchange.xdsoft'); - return month; - }; - - _this.prevMonth = function () { - var month = _this.currentTime.getMonth() - 1; - if (month === -1) { - _this.currentTime.setFullYear(_this.currentTime.getFullYear() - 1); - month = 11; - } - _this.currentTime.setDate( - Math.min( - new Date(_this.currentTime.getFullYear(), month + 1, 0).getDate(), - _this.currentTime.getDate() - ) - ); - _this.currentTime.setMonth(month); - if (options.onChangeMonth && $.isFunction(options.onChangeMonth)) { - options.onChangeMonth.call(datetimepicker, _xdsoft_datetime.currentTime, datetimepicker.data('input')); - } - datetimepicker.trigger('xchange.xdsoft'); - return month; - }; - - _this.getWeekOfYear = function (datetime) { - var onejan = new Date(datetime.getFullYear(), 0, 1); - return Math.ceil((((datetime - onejan) / 86400000) + onejan.getDay() + 1) / 7); - }; - - _this.strToDateTime = function (sDateTime) { - var tmpDate = [], timeOffset, currentTime; - - if (sDateTime && sDateTime instanceof Date && _this.isValidDate(sDateTime)) { - return sDateTime; - } - - tmpDate = /^(\+|\-)(.*)$/.exec(sDateTime); - if (tmpDate) { - tmpDate[2] = Date.parseDate(tmpDate[2], options.formatDate); - } - if (tmpDate && tmpDate[2]) { - timeOffset = tmpDate[2].getTime() - (tmpDate[2].getTimezoneOffset()) * 60000; - currentTime = new Date((_xdsoft_datetime.now()).getTime() + parseInt(tmpDate[1] + '1', 10) * timeOffset); - } else { - currentTime = sDateTime ? Date.parseDate(sDateTime, options.format) : _this.now(); - } - - if (!_this.isValidDate(currentTime)) { - currentTime = _this.now(); - } - - return currentTime; - }; - - _this.strToDate = function (sDate) { - if (sDate && sDate instanceof Date && _this.isValidDate(sDate)) { - return sDate; - } - - var currentTime = sDate ? Date.parseDate(sDate, options.formatDate) : _this.now(true); - if (!_this.isValidDate(currentTime)) { - currentTime = _this.now(true); - } - return currentTime; - }; - - _this.strtotime = function (sTime) { - if (sTime && sTime instanceof Date && _this.isValidDate(sTime)) { - return sTime; - } - var currentTime = sTime ? Date.parseDate(sTime, options.formatTime) : _this.now(true); - if (!_this.isValidDate(currentTime)) { - currentTime = _this.now(true); - } - return currentTime; - }; - - _this.str = function () { - return _this.currentTime.dateFormat(options.format); - }; - _this.currentTime = this.now(); - }; - - _xdsoft_datetime = new XDSoft_datetime(); - - mounth_picker - .find('.xdsoft_today_button') - .on('mousedown.xdsoft', function () { - datetimepicker.data('changed', true); - _xdsoft_datetime.setCurrentTime(0); - datetimepicker.trigger('afterOpen.xdsoft'); - }).on('dblclick.xdsoft', function () { - input.val(_xdsoft_datetime.str()); - datetimepicker.trigger('close.xdsoft'); - }); - mounth_picker - .find('.xdsoft_prev,.xdsoft_next') - .on('mousedown.xdsoft', function () { - var $this = $(this), - timer = 0, - stop = false; - - (function arguments_callee1(v) { - var month = _xdsoft_datetime.currentTime.getMonth(); - if ($this.hasClass(options.next)) { - _xdsoft_datetime.nextMonth(); - } else if ($this.hasClass(options.prev)) { - _xdsoft_datetime.prevMonth(); - } - if (options.monthChangeSpinner) { - if (!stop) { - timer = setTimeout(arguments_callee1, v || 100); - } - } - }(500)); - - $([document.body, window]).on('mouseup.xdsoft', function arguments_callee2() { - clearTimeout(timer); - stop = true; - $([document.body, window]).off('mouseup.xdsoft', arguments_callee2); - }); - }); - - timepicker - .find('.xdsoft_prev,.xdsoft_next') - .on('mousedown.xdsoft', function () { - var $this = $(this), - timer = 0, - stop = false, - period = 110; - (function arguments_callee4(v) { - var pheight = timeboxparent[0].clientHeight, - height = timebox[0].offsetHeight, - top = Math.abs(parseInt(timebox.css('marginTop'), 10)); - if ($this.hasClass(options.next) && (height - pheight) - options.timeHeightInTimePicker >= top) { - timebox.css('marginTop', '-' + (top + options.timeHeightInTimePicker) + 'px'); - } else if ($this.hasClass(options.prev) && top - options.timeHeightInTimePicker >= 0) { - timebox.css('marginTop', '-' + (top - options.timeHeightInTimePicker) + 'px'); - } - timeboxparent.trigger('scroll_element.xdsoft_scroller', [Math.abs(parseInt(timebox.css('marginTop'), 10) / (height - pheight))]); - period = (period > 10) ? 10 : period - 10; - if (!stop) { - timer = setTimeout(arguments_callee4, v || period); - } - }(500)); - $([document.body, window]).on('mouseup.xdsoft', function arguments_callee5() { - clearTimeout(timer); - stop = true; - $([document.body, window]) - .off('mouseup.xdsoft', arguments_callee5); - }); - }); - - xchangeTimer = 0; - // base handler - generating a calendar and timepicker - datetimepicker - .on('xchange.xdsoft', function (event) { - clearTimeout(xchangeTimer); - xchangeTimer = setTimeout(function () { - var table = '', - start = new Date(_xdsoft_datetime.currentTime.getFullYear(), _xdsoft_datetime.currentTime.getMonth(), 1, 12, 0, 0), - i = 0, - j, - today = _xdsoft_datetime.now(), - maxDate = false, - minDate = false, - d, - y, - m, - w, - classes = [], - customDateSettings, - newRow = true, - time = '', - h = '', - line_time; - - while (start.getDay() !== options.dayOfWeekStart) { - start.setDate(start.getDate() - 1); - } - - table += ''; - - if (options.weeks) { - table += ''; - } - - for (j = 0; j < 7; j += 1) { - table += ''; - } - - table += ''; - table += ''; - - if (options.maxDate !== false) { - maxDate = _xdsoft_datetime.strToDate(options.maxDate); - maxDate = new Date(maxDate.getFullYear(), maxDate.getMonth(), maxDate.getDate(), 23, 59, 59, 999); - } - - if (options.minDate !== false) { - minDate = _xdsoft_datetime.strToDate(options.minDate); - minDate = new Date(minDate.getFullYear(), minDate.getMonth(), minDate.getDate()); - } - - while (i < _xdsoft_datetime.currentTime.countDaysInMonth() || start.getDay() !== options.dayOfWeekStart || _xdsoft_datetime.currentTime.getMonth() === start.getMonth()) { - classes = []; - i += 1; - - d = start.getDate(); - y = start.getFullYear(); - m = start.getMonth(); - w = _xdsoft_datetime.getWeekOfYear(start); - - classes.push('xdsoft_date'); - - if (options.beforeShowDay && $.isFunction(options.beforeShowDay.call)) { - customDateSettings = options.beforeShowDay.call(datetimepicker, start); - } else { - customDateSettings = null; - } - - if ((maxDate !== false && start > maxDate) || (minDate !== false && start < minDate) || (customDateSettings && customDateSettings[0] === false)) { - classes.push('xdsoft_disabled'); - } else if (options.disabledDates.indexOf(start.dateFormat(options.formatDate)) !== -1) { - classes.push('xdsoft_disabled'); - } - - if (customDateSettings && customDateSettings[1] !== "") { - classes.push(customDateSettings[1]); - } - - if (_xdsoft_datetime.currentTime.getMonth() !== m) { - classes.push('xdsoft_other_month'); - } - - if ((options.defaultSelect || datetimepicker.data('changed')) && _xdsoft_datetime.currentTime.dateFormat(options.formatDate) === start.dateFormat(options.formatDate)) { - classes.push('xdsoft_current'); - } - - if (today.dateFormat(options.formatDate) === start.dateFormat(options.formatDate)) { - classes.push('xdsoft_today'); - } - - if (start.getDay() === 0 || start.getDay() === 6 || ~options.weekends.indexOf(start.dateFormat(options.formatDate))) { - classes.push('xdsoft_weekend'); - } - - if (options.beforeShowDay && $.isFunction(options.beforeShowDay)) { - classes.push(options.beforeShowDay(start)); - } - - if (newRow) { - table += ''; - newRow = false; - if (options.weeks) { - table += ''; - } - } - - table += ''; - - if (start.getDay() === options.dayOfWeekStartPrev) { - table += ''; - newRow = true; - } - - start.setDate(d + 1); - } - table += '
' + options.i18n[options.lang].dayOfWeek[(j + options.dayOfWeekStart) % 7] + '
' + w + '' + - '
' + d + '
' + - '
'; - - calendar.html(table); - - mounth_picker.find('.xdsoft_label span').eq(0).text(options.i18n[options.lang].months[_xdsoft_datetime.currentTime.getMonth()]); - mounth_picker.find('.xdsoft_label span').eq(1).text(_xdsoft_datetime.currentTime.getFullYear()); - - // generate timebox - time = ''; - h = ''; - m = ''; - line_time = function line_time(h, m) { - var now = _xdsoft_datetime.now(); - now.setHours(h); - h = parseInt(now.getHours(), 10); - now.setMinutes(m); - m = parseInt(now.getMinutes(), 10); - var optionDateTime = new Date(_xdsoft_datetime.currentTime); - optionDateTime.setHours(h); - optionDateTime.setMinutes(m); - classes = []; - if((options.minDateTime !== false && options.minDateTime > optionDateTime) || (options.maxTime !== false && _xdsoft_datetime.strtotime(options.maxTime).getTime() < now.getTime()) || (options.minTime !== false && _xdsoft_datetime.strtotime(options.minTime).getTime() > now.getTime())) { - classes.push('xdsoft_disabled'); - } - if ((options.initTime || options.defaultSelect || datetimepicker.data('changed')) && parseInt(_xdsoft_datetime.currentTime.getHours(), 10) === parseInt(h, 10) && (options.step > 59 || Math[options.roundTime](_xdsoft_datetime.currentTime.getMinutes() / options.step) * options.step === parseInt(m, 10))) { - if (options.defaultSelect || datetimepicker.data('changed')) { - classes.push('xdsoft_current'); - } else if (options.initTime) { - classes.push('xdsoft_init_time'); - } - } - if (parseInt(today.getHours(), 10) === parseInt(h, 10) && parseInt(today.getMinutes(), 10) === parseInt(m, 10)) { - classes.push('xdsoft_today'); - } - time += '
' + now.dateFormat(options.formatTime) + '
'; - }; - - if (!options.allowTimes || !$.isArray(options.allowTimes) || !options.allowTimes.length) { - for (i = 0, j = 0; i < (options.hours12 ? 12 : 24); i += 1) { - for (j = 0; j < 60; j += options.step) { - h = (i < 10 ? '0' : '') + i; - m = (j < 10 ? '0' : '') + j; - line_time(h, m); - } - } - } else { - for (i = 0; i < options.allowTimes.length; i += 1) { - h = _xdsoft_datetime.strtotime(options.allowTimes[i]).getHours(); - m = _xdsoft_datetime.strtotime(options.allowTimes[i]).getMinutes(); - line_time(h, m); - } - } - - timebox.html(time); - - opt = ''; - i = 0; - - for (i = parseInt(options.yearStart, 10) + options.yearOffset; i <= parseInt(options.yearEnd, 10) + options.yearOffset; i += 1) { - opt += '
' + i + '
'; - } - yearselect.children().eq(0) - .html(opt); - - for (i = 0, opt = ''; i <= 11; i += 1) { - opt += '
' + options.i18n[options.lang].months[i] + '
'; - } - monthselect.children().eq(0).html(opt); - $(datetimepicker) - .trigger('generate.xdsoft'); - }, 10); - event.stopPropagation(); - }) - .on('afterOpen.xdsoft', function () { - if (options.timepicker) { - var classType, pheight, height, top; - if (timebox.find('.xdsoft_current').length) { - classType = '.xdsoft_current'; - } else if (timebox.find('.xdsoft_init_time').length) { - classType = '.xdsoft_init_time'; - } - if (classType) { - pheight = timeboxparent[0].clientHeight; - height = timebox[0].offsetHeight; - top = timebox.find(classType).index() * options.timeHeightInTimePicker + 1; - if ((height - pheight) < top) { - top = height - pheight; - } - timeboxparent.trigger('scroll_element.xdsoft_scroller', [parseInt(top, 10) / (height - pheight)]); - } else { - timeboxparent.trigger('scroll_element.xdsoft_scroller', [0]); - } - } - }); - - timerclick = 0; - calendar - .on('click.xdsoft', 'td', function (xdevent) { - xdevent.stopPropagation(); // Prevents closing of Pop-ups, Modals and Flyouts in Bootstrap - timerclick += 1; - var $this = $(this), - currentTime = _xdsoft_datetime.currentTime; - - if (currentTime === undefined || currentTime === null) { - _xdsoft_datetime.currentTime = _xdsoft_datetime.now(); - currentTime = _xdsoft_datetime.currentTime; - } - - if ($this.hasClass('xdsoft_disabled')) { - return false; - } - - currentTime.setDate(1); - currentTime.setFullYear($this.data('year')); - currentTime.setMonth($this.data('month')); - currentTime.setDate($this.data('date')); - - datetimepicker.trigger('select.xdsoft', [currentTime]); - - input.val(_xdsoft_datetime.str()); - if ((timerclick > 1 || (options.closeOnDateSelect === true || (options.closeOnDateSelect === 0 && !options.timepicker))) && !options.inline) { - datetimepicker.trigger('close.xdsoft'); - } - - if (options.onSelectDate && $.isFunction(options.onSelectDate)) { - options.onSelectDate.call(datetimepicker, _xdsoft_datetime.currentTime, datetimepicker.data('input'), xdevent); - } - - datetimepicker.data('changed', true); - datetimepicker.trigger('xchange.xdsoft'); - datetimepicker.trigger('changedatetime.xdsoft'); - setTimeout(function () { - timerclick = 0; - }, 200); - }); - - timebox - .on('click.xdsoft', 'div', function (xdevent) { - xdevent.stopPropagation(); - var $this = $(this), - currentTime = _xdsoft_datetime.currentTime; - - if (currentTime === undefined || currentTime === null) { - _xdsoft_datetime.currentTime = _xdsoft_datetime.now(); - currentTime = _xdsoft_datetime.currentTime; - } - - if ($this.hasClass('xdsoft_disabled')) { - return false; - } - currentTime.setHours($this.data('hour')); - currentTime.setMinutes($this.data('minute')); - datetimepicker.trigger('select.xdsoft', [currentTime]); - - datetimepicker.data('input').val(_xdsoft_datetime.str()); - if (!options.inline) { - datetimepicker.trigger('close.xdsoft'); - } - - if (options.onSelectTime && $.isFunction(options.onSelectTime)) { - options.onSelectTime.call(datetimepicker, _xdsoft_datetime.currentTime, datetimepicker.data('input'), xdevent); - } - datetimepicker.data('changed', true); - datetimepicker.trigger('xchange.xdsoft'); - datetimepicker.trigger('changedatetime.xdsoft'); - }); - - - datepicker - .on('mousewheel.xdsoft', function (event) { - if (!options.scrollMonth) { - return true; - } - if (event.deltaY < 0) { - _xdsoft_datetime.nextMonth(); - } else { - _xdsoft_datetime.prevMonth(); - } - return false; - }); - - input - .on('mousewheel.xdsoft', function (event) { - if (!options.scrollInput) { - return true; - } - if (!options.datepicker && options.timepicker) { - current_time_index = timebox.find('.xdsoft_current').length ? timebox.find('.xdsoft_current').eq(0).index() : 0; - if (current_time_index + event.deltaY >= 0 && current_time_index + event.deltaY < timebox.children().length) { - current_time_index += event.deltaY; - } - if (timebox.children().eq(current_time_index).length) { - timebox.children().eq(current_time_index).trigger('mousedown'); - } - return false; - } - if (options.datepicker && !options.timepicker) { - datepicker.trigger(event, [event.deltaY, event.deltaX, event.deltaY]); - if (input.val) { - input.val(_xdsoft_datetime.str()); - } - datetimepicker.trigger('changedatetime.xdsoft'); - return false; - } - }); - - datetimepicker - .on('changedatetime.xdsoft', function (event) { - if (options.onChangeDateTime && $.isFunction(options.onChangeDateTime)) { - var $input = datetimepicker.data('input'); - options.onChangeDateTime.call(datetimepicker, _xdsoft_datetime.currentTime, $input, event); - delete options.value; - $input.trigger('change'); - } - }) - .on('generate.xdsoft', function () { - if (options.onGenerate && $.isFunction(options.onGenerate)) { - options.onGenerate.call(datetimepicker, _xdsoft_datetime.currentTime, datetimepicker.data('input')); - } - if (triggerAfterOpen) { - datetimepicker.trigger('afterOpen.xdsoft'); - triggerAfterOpen = false; - } - }) - .on('click.xdsoft', function (xdevent) { - xdevent.stopPropagation(); - }); - - current_time_index = 0; - - setPos = function () { - var offset = datetimepicker.data('input').offset(), top = offset.top + datetimepicker.data('input')[0].offsetHeight - 1, left = offset.left, position = "absolute"; - if (options.fixed) { - top -= $(window).scrollTop(); - left -= $(window).scrollLeft(); - position = "fixed"; - } else { - if (top + datetimepicker[0].offsetHeight > $(window).height() + $(window).scrollTop()) { - top = offset.top - datetimepicker[0].offsetHeight + 1; - } - if (top < 0) { - top = 0; - } - if (left + datetimepicker[0].offsetWidth > $(window).width()) { - left = $(window).width() - datetimepicker[0].offsetWidth; - } - } - datetimepicker.css({ - left: left, - top: top, - position: position - }); - }; - datetimepicker - .on('open.xdsoft', function (event) { - var onShow = true; - if (options.onShow && $.isFunction(options.onShow)) { - onShow = options.onShow.call(datetimepicker, _xdsoft_datetime.currentTime, datetimepicker.data('input'), event); - } - if (onShow !== false) { - datetimepicker.show(); - setPos(); - $(window) - .off('resize.xdsoft', setPos) - .on('resize.xdsoft', setPos); - - if (options.closeOnWithoutClick) { - $([document.body, window]).on('mousedown.xdsoft', function arguments_callee6() { - datetimepicker.trigger('close.xdsoft'); - $([document.body, window]).off('mousedown.xdsoft', arguments_callee6); - }); - } - } - }) - .on('close.xdsoft', function (event) { - var onClose = true; - mounth_picker - .find('.xdsoft_month,.xdsoft_year') - .find('.xdsoft_select') - .hide(); - if (options.onClose && $.isFunction(options.onClose)) { - onClose = options.onClose.call(datetimepicker, _xdsoft_datetime.currentTime, datetimepicker.data('input'), event); - } - if (onClose !== false && !options.opened && !options.inline) { - datetimepicker.hide(); - } - event.stopPropagation(); - }) - .on('toggle.xdsoft', function (event) { - if (datetimepicker.is(':visible')) { - datetimepicker.trigger('close.xdsoft'); - } else { - datetimepicker.trigger('open.xdsoft'); - } - }) - .data('input', input); - - timer = 0; - timer1 = 0; - - datetimepicker.data('xdsoft_datetime', _xdsoft_datetime); - datetimepicker.setOptions(options); - - function getCurrentValue() { - - var ct = false, time; - - if (options.startDate) { - ct = _xdsoft_datetime.strToDate(options.startDate); - } else { - ct = options.value || ((input && input.val && input.val()) ? input.val() : ''); - if (ct) { - ct = _xdsoft_datetime.strToDateTime(ct); - } else if (options.defaultDate) { - ct = _xdsoft_datetime.strToDate(options.defaultDate); - if (options.defaultTime) { - time = _xdsoft_datetime.strtotime(options.defaultTime); - ct.setHours(time.getHours()); - ct.setMinutes(time.getMinutes()); - } - } - } - - if (ct && _xdsoft_datetime.isValidDate(ct)) { - datetimepicker.data('changed', true); - } else { - ct = ''; - } - - return ct || 0; - } - - _xdsoft_datetime.setCurrentTime(getCurrentValue()); - - input - .data('xdsoft_datetimepicker', datetimepicker) - .on('open.xdsoft focusin.xdsoft mousedown.xdsoft', function (event) { - if (input.is(':disabled') || (input.data('xdsoft_datetimepicker').is(':visible') && options.closeOnInputClick)) { - return; - } - clearTimeout(timer); - timer = setTimeout(function () { - if (input.is(':disabled')) { - return; - } - - triggerAfterOpen = true; - _xdsoft_datetime.setCurrentTime(getCurrentValue()); - - datetimepicker.trigger('open.xdsoft'); - }, 100); - }) - .on('keydown.xdsoft', function (event) { - var val = this.value, elementSelector, - key = event.which; - if ([ENTER].indexOf(key) !== -1 && options.enterLikeTab) { - elementSelector = $("input:visible,textarea:visible"); - datetimepicker.trigger('close.xdsoft'); - elementSelector.eq(elementSelector.index(this) + 1).focus(); - return false; - } - if ([TAB].indexOf(key) !== -1) { - datetimepicker.trigger('close.xdsoft'); - return true; - } - }); - }; - destroyDateTimePicker = function (input) { - var datetimepicker = input.data('xdsoft_datetimepicker'); - if (datetimepicker) { - datetimepicker.data('xdsoft_datetime', null); - datetimepicker.remove(); - input - .data('xdsoft_datetimepicker', null) - .off('.xdsoft'); - $(window).off('resize.xdsoft'); - $([window, document.body]).off('mousedown.xdsoft'); - if (input.unmousewheel) { - input.unmousewheel(); - } - } - }; - $(document) - .off('keydown.xdsoftctrl keyup.xdsoftctrl') - .on('keydown.xdsoftctrl', function (e) { - if (e.keyCode === CTRLKEY) { - ctrlDown = true; - } - }) - .on('keyup.xdsoftctrl', function (e) { - if (e.keyCode === CTRLKEY) { - ctrlDown = false; - } - }); - return this.each(function () { - var datetimepicker = $(this).data('xdsoft_datetimepicker'); - if (datetimepicker) { - if ($.type(opt) === 'string') { - switch (opt) { - case 'show': - $(this).select().focus(); - datetimepicker.trigger('open.xdsoft'); - break; - case 'hide': - datetimepicker.trigger('close.xdsoft'); - break; - case 'toggle': - datetimepicker.trigger('toggle.xdsoft'); - break; - case 'destroy': - destroyDateTimePicker($(this)); - break; - case 'reset': - this.value = this.defaultValue; - if (!this.value || !datetimepicker.data('xdsoft_datetime').isValidDate(Date.parseDate(this.value, options.format))) { - datetimepicker.data('changed', false); - } - datetimepicker.data('xdsoft_datetime').setCurrentTime(this.value); - break; - } - } else { - datetimepicker - .setOptions(opt); - } - return 0; - } - if ($.type(opt) !== 'string') { - if (!options.lazyInit || options.open || options.inline) { - createDateTimePicker($(this)); - } else { - lazyInit($(this)); - } - } - }); - }; - $.fn.datetimepicker.defaults = default_options; -}(jQuery)); -(function () { - -/*! Copyright (c) 2013 Brandon Aaron (http://brandon.aaron.sh) - * Licensed under the MIT License (LICENSE.txt). - * - * Version: 3.1.12 - * - * Requires: jQuery 1.2.2+ - */ -!function(a){"function"==typeof define&&define.amd?define(["jquery"],a):"object"==typeof exports?module.exports=a:a(jQuery)}(function(a){function b(b){var g=b||window.event,h=i.call(arguments,1),j=0,l=0,m=0,n=0,o=0,p=0;if(b=a.event.fix(g),b.type="mousewheel","detail"in g&&(m=-1*g.detail),"wheelDelta"in g&&(m=g.wheelDelta),"wheelDeltaY"in g&&(m=g.wheelDeltaY),"wheelDeltaX"in g&&(l=-1*g.wheelDeltaX),"axis"in g&&g.axis===g.HORIZONTAL_AXIS&&(l=-1*m,m=0),j=0===m?l:m,"deltaY"in g&&(m=-1*g.deltaY,j=m),"deltaX"in g&&(l=g.deltaX,0===m&&(j=-1*l)),0!==m||0!==l){if(1===g.deltaMode){var q=a.data(this,"mousewheel-line-height");j*=q,m*=q,l*=q}else if(2===g.deltaMode){var r=a.data(this,"mousewheel-page-height");j*=r,m*=r,l*=r}if(n=Math.max(Math.abs(m),Math.abs(l)),(!f||f>n)&&(f=n,d(g,n)&&(f/=40)),d(g,n)&&(j/=40,l/=40,m/=40),j=Math[j>=1?"floor":"ceil"](j/f),l=Math[l>=1?"floor":"ceil"](l/f),m=Math[m>=1?"floor":"ceil"](m/f),k.settings.normalizeOffset&&this.getBoundingClientRect){var s=this.getBoundingClientRect();o=b.clientX-s.left,p=b.clientY-s.top}return b.deltaX=l,b.deltaY=m,b.deltaFactor=f,b.offsetX=o,b.offsetY=p,b.deltaMode=0,h.unshift(b,j,l,m),e&&clearTimeout(e),e=setTimeout(c,200),(a.event.dispatch||a.event.handle).apply(this,h)}}function c(){f=null}function d(a,b){return k.settings.adjustOldDeltas&&"mousewheel"===a.type&&b%120===0}var e,f,g=["wheel","mousewheel","DOMMouseScroll","MozMousePixelScroll"],h="onwheel"in document||document.documentMode>=9?["wheel"]:["mousewheel","DomMouseScroll","MozMousePixelScroll"],i=Array.prototype.slice;if(a.event.fixHooks)for(var j=g.length;j;)a.event.fixHooks[g[--j]]=a.event.mouseHooks;var k=a.event.special.mousewheel={version:"3.1.12",setup:function(){if(this.addEventListener)for(var c=h.length;c;)this.addEventListener(h[--c],b,!1);else this.onmousewheel=b;a.data(this,"mousewheel-line-height",k.getLineHeight(this)),a.data(this,"mousewheel-page-height",k.getPageHeight(this))},teardown:function(){if(this.removeEventListener)for(var c=h.length;c;)this.removeEventListener(h[--c],b,!1);else this.onmousewheel=null;a.removeData(this,"mousewheel-line-height"),a.removeData(this,"mousewheel-page-height")},getLineHeight:function(b){var c=a(b),d=c["offsetParent"in a.fn?"offsetParent":"parent"]();return d.length||(d=a("body")),parseInt(d.css("fontSize"),10)||parseInt(c.css("fontSize"),10)||16},getPageHeight:function(b){return a(b).height()},settings:{adjustOldDeltas:!0,normalizeOffset:!0}};a.fn.extend({mousewheel:function(a){return a?this.bind("mousewheel",a):this.trigger("mousewheel")},unmousewheel:function(a){return this.unbind("mousewheel",a)}})}); - -// Parse and Format Library -//http://www.xaprb.com/blog/2005/12/12/javascript-closures-for-runtime-efficiency/ -/* - * Copyright (C) 2004 Baron Schwartz - * - * This program is free software; you can redistribute it and/or modify it - * under the terms of the GNU Lesser General Public License as published by the - * Free Software Foundation, version 2.1. - * - * This program is distributed in the hope that it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more - * details. - */ -Date.parseFunctions={count:0};Date.parseRegexes=[];Date.formatFunctions={count:0};Date.prototype.dateFormat=function(b){if(b=="unixtime"){return parseInt(this.getTime()/1000);}if(Date.formatFunctions[b]==null){Date.createNewFormat(b);}var a=Date.formatFunctions[b];return this[a]();};Date.createNewFormat=function(format){var funcName="format"+Date.formatFunctions.count++;Date.formatFunctions[format]=funcName;var code="Date.prototype."+funcName+" = function() {return ";var special=false;var ch="";for(var i=0;i 0) {";var regex="";var special=false;var ch="";for(var i=0;i 0 && z > 0){\nvar doyDate = new Date(y,0);\ndoyDate.setDate(z);\nm = doyDate.getMonth();\nd = doyDate.getDate();\n}";code+="if (y > 0 && m >= 0 && d > 0 && h >= 0 && i >= 0 && s >= 0)\n{return new Date(y, m, d, h, i, s);}\nelse if (y > 0 && m >= 0 && d > 0 && h >= 0 && i >= 0)\n{return new Date(y, m, d, h, i);}\nelse if (y > 0 && m >= 0 && d > 0 && h >= 0)\n{return new Date(y, m, d, h);}\nelse if (y > 0 && m >= 0 && d > 0)\n{return new Date(y, m, d);}\nelse if (y > 0 && m >= 0)\n{return new Date(y, m);}\nelse if (y > 0)\n{return new Date(y);}\n}return null;}";Date.parseRegexes[regexNum]=new RegExp("^"+regex+"$");eval(code);};Date.formatCodeToRegex=function(b,a){switch(b){case"D":return{g:0,c:null,s:"(?:Sun|Mon|Tue|Wed|Thu|Fri|Sat)"};case"j":case"d":return{g:1,c:"d = parseInt(results["+a+"], 10);\n",s:"(\\d{1,2})"};case"l":return{g:0,c:null,s:"(?:"+Date.dayNames.join("|")+")"};case"S":return{g:0,c:null,s:"(?:st|nd|rd|th)"};case"w":return{g:0,c:null,s:"\\d"};case"z":return{g:1,c:"z = parseInt(results["+a+"], 10);\n",s:"(\\d{1,3})"};case"W":return{g:0,c:null,s:"(?:\\d{2})"};case"F":return{g:1,c:"m = parseInt(Date.monthNumbers[results["+a+"].substring(0, 3)], 10);\n",s:"("+Date.monthNames.join("|")+")"};case"M":return{g:1,c:"m = parseInt(Date.monthNumbers[results["+a+"]], 10);\n",s:"(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)"};case"n":case"m":return{g:1,c:"m = parseInt(results["+a+"], 10) - 1;\n",s:"(\\d{1,2})"};case"t":return{g:0,c:null,s:"\\d{1,2}"};case"L":return{g:0,c:null,s:"(?:1|0)"};case"Y":return{g:1,c:"y = parseInt(results["+a+"], 10);\n",s:"(\\d{4})"};case"y":return{g:1,c:"var ty = parseInt(results["+a+"], 10);\ny = ty > Date.y2kYear ? 1900 + ty : 2000 + ty;\n",s:"(\\d{1,2})"};case"a":return{g:1,c:"if (results["+a+"] == 'am') {\nif (h == 12) { h = 0; }\n} else { if (h < 12) { h += 12; }}",s:"(am|pm)"};case"A":return{g:1,c:"if (results["+a+"] == 'AM') {\nif (h == 12) { h = 0; }\n} else { if (h < 12) { h += 12; }}",s:"(AM|PM)"};case"g":case"G":case"h":case"H":return{g:1,c:"h = parseInt(results["+a+"], 10);\n",s:"(\\d{1,2})"};case"i":return{g:1,c:"i = parseInt(results["+a+"], 10);\n",s:"(\\d{2})"};case"s":return{g:1,c:"s = parseInt(results["+a+"], 10);\n",s:"(\\d{2})"};case"O":return{g:0,c:null,s:"[+-]\\d{4}"};case"T":return{g:0,c:null,s:"[A-Z]{3}"};case"Z":return{g:0,c:null,s:"[+-]\\d{1,5}"};default:return{g:0,c:null,s:String.escape(b)};}};Date.prototype.getTimezone=function(){return this.toString().replace(/^.*? ([A-Z]{3}) [0-9]{4}.*$/,"$1").replace(/^.*?\(([A-Z])[a-z]+ ([A-Z])[a-z]+ ([A-Z])[a-z]+\)$/,"$1$2$3");};Date.prototype.getGMTOffset=function(){return(this.getTimezoneOffset()>0?"-":"+")+String.leftPad(Math.floor(Math.abs(this.getTimezoneOffset())/60),2,"0")+String.leftPad(Math.abs(this.getTimezoneOffset())%60,2,"0");};Date.prototype.getDayOfYear=function(){var a=0;Date.daysInMonth[1]=this.isLeapYear()?29:28;for(var b=0;b0){h=a(this[0]);var p=h.data(a.mask.dataName);return p?p():void 0}return g=a.extend({autoclear:a.mask.autoclear,placeholder:a.mask.placeholder,completed:null},g),i=a.mask.definitions,j=[],k=n=c.length,l=null,a.each(c.split(""),function(a,b){"?"==b?(n--,k=a):i[b]?(j.push(new RegExp(i[b])),null===l&&(l=j.length-1),k>a&&(m=j.length-1)):j.push(null)}),this.trigger("unmask").each(function(){function h(){if(g.completed){for(var a=l;m>=a;a++)if(j[a]&&C[a]===p(a))return;g.completed.call(B)}}function p(a){return g.placeholder.charAt(a=0&&!j[a];);return a}function s(a,b){var c,d;if(!(0>a)){for(c=a,d=q(b);n>c;c++)if(j[c]){if(!(n>d&&j[c].test(C[d])))break;C[c]=C[d],C[d]=p(d),d=q(d)}z(),B.caret(Math.max(l,a))}}function t(a){var b,c,d,e;for(b=a,c=p(a);n>b;b++)if(j[b]){if(d=q(b),e=C[b],C[b]=c,!(n>d&&j[d].test(e)))break;c=e}}function u(){var a=B.val(),b=B.caret();if(o&&o.length&&o.length>a.length){for(A(!0);b.begin>0&&!j[b.begin-1];)b.begin--;if(0===b.begin)for(;b.beging)&&g&&13!==g){if(i.end-i.begin!==0&&(y(i.begin,i.end),s(i.begin,i.end-1)),c=q(i.begin-1),n>c&&(d=String.fromCharCode(g),j[c].test(d))){if(t(c),C[c]=d,z(),e=q(c),f){var k=function(){a.proxy(a.fn.caret,B,e)()};setTimeout(k,0)}else B.caret(e);i.begin<=m&&h()}b.preventDefault()}}}function y(a,b){var c;for(c=a;b>c&&n>c;c++)j[c]&&(C[c]=p(c))}function z(){B.val(C.join(""))}function A(a){var b,c,d,e=B.val(),f=-1;for(b=0,d=0;n>b;b++)if(j[b]){for(C[b]=p(b);d++e.length){y(b+1,n);break}}else C[b]===e.charAt(d)&&d++,k>b&&(f=b);return a?z():k>f+1?g.autoclear||C.join("")===D?(B.val()&&B.val(""),y(0,n)):z():(z(),B.val(B.val().substring(0,f+1))),k?b:l}var B=a(this),C=a.map(c.split(""),function(a,b){return"?"!=a?i[a]?p(b):a:void 0}),D=C.join(""),E=B.val();B.data(a.mask.dataName,function(){return a.map(C,function(a,b){return j[b]&&a!=p(b)?a:null}).join("")}),B.one("unmask",function(){B.off(".mask").removeData(a.mask.dataName)}).on("focus.mask",function(){if(!B.prop("readonly")){clearTimeout(b);var a;E=B.val(),a=A(),b=setTimeout(function(){B.get(0)===document.activeElement&&(z(),a==c.replace("?","").length?B.caret(0,a):B.caret(a))},10)}}).on("blur.mask",v).on("keydown.mask",w).on("keypress.mask",x).on("input.mask paste.mask",function(){B.prop("readonly")||setTimeout(function(){var a=A(!0);B.caret(a),h()},0)}),e&&f&&B.off("input.mask").on("input.mask",u),A()})}})}); \ No newline at end of file diff --git a/templates/vendor/assets/javascripts/nprogress.js b/templates/vendor/assets/javascripts/nprogress.js deleted file mode 100644 index 708bee1..0000000 --- a/templates/vendor/assets/javascripts/nprogress.js +++ /dev/null @@ -1,491 +0,0 @@ -/* NProgress, (c) 2013, 2014 Rico Sta. Cruz - http://ricostacruz.com/nprogress - * @license MIT */ - -;(function(root, factory) { - - if (typeof define === 'function' && define.amd) { - define(factory); - } else if (typeof exports === 'object') { - module.exports = factory(); - } else { - root.NProgress = factory(); - } - -})(this, function() { - var NProgress = {}; - - NProgress.version = '0.2.0'; - - var Settings = NProgress.settings = { - minimum: 0.08, - easing: 'linear', - positionUsing: '', - speed: 350, - trickle: true, - trickleSpeed: 250, - showSpinner: true, - barSelector: '[role="bar"]', - spinnerSelector: '[role="spinner"]', - parent: 'body', - template: '
' - }; - - /** - * Updates configuration. - * - * NProgress.configure({ - * minimum: 0.1 - * }); - */ - NProgress.configure = function(options) { - var key, value; - for (key in options) { - value = options[key]; - if (value !== undefined && options.hasOwnProperty(key)) Settings[key] = value; - } - - return this; - }; - - /** - * Last number. - */ - - NProgress.status = null; - - /** - * Sets the progress bar status, where `n` is a number from `0.0` to `1.0`. - * - * NProgress.set(0.4); - * NProgress.set(1.0); - */ - - NProgress.set = function(n) { - var started = NProgress.isStarted(); - - n = clamp(n, Settings.minimum, 1); - NProgress.status = (n === 1 ? null : n); - - var progress = NProgress.render(!started), - bar = progress.querySelector(Settings.barSelector), - speed = Settings.speed, - ease = Settings.easing; - - progress.offsetWidth; /* Repaint */ - - queue(function(next) { - // Set positionUsing if it hasn't already been set - if (Settings.positionUsing === '') Settings.positionUsing = NProgress.getPositioningCSS(); - - // Add transition - css(bar, barPositionCSS(n, speed, ease)); - - if (n === 1) { - // Fade out - css(progress, { - transition: 'none', - opacity: 1 - }); - progress.offsetWidth; /* Repaint */ - - setTimeout(function() { - css(progress, { - transition: 'all ' + speed + 'ms linear', - opacity: 0 - }); - setTimeout(function() { - NProgress.remove(); - next(); - }, speed); - }, speed); - } else { - setTimeout(next, speed); - } - }); - - return this; - }; - - NProgress.isStarted = function() { - return typeof NProgress.status === 'number'; - }; - - /** - * Shows the progress bar. - * This is the same as setting the status to 0%, except that it doesn't go backwards. - * - * NProgress.start(); - * - */ - NProgress.start = function() { - if (!NProgress.status) NProgress.set(0); - - var work = function() { - setTimeout(function() { - if (!NProgress.status) return; - NProgress.trickle(); - work(); - }, Settings.trickleSpeed); - }; - - if (Settings.trickle) work(); - - return this; - }; - - /** - * Hides the progress bar. - * This is the *sort of* the same as setting the status to 100%, with the - * difference being `done()` makes some placebo effect of some realistic motion. - * - * NProgress.done(); - * - * If `true` is passed, it will show the progress bar even if its hidden. - * - * NProgress.done(true); - */ - - NProgress.done = function(force) { - if (!force && !NProgress.status) return this; - - return NProgress.inc(0.3 + 0.5 * Math.random()).set(1); - }; - - /** - * Increments by a random amount. - */ - - NProgress.inc = function(amount) { - var n = NProgress.status; - - if (!n) { - return NProgress.start(); - } else if(n > 1) { - return; - } else { - if (typeof amount !== 'number') { - if (n >= 0 && n < 0.25) { - // Start out between 3 - 6% increments - amount = (Math.random() * (5 - 3 + 1) + 3) / 100; - } else if (n >= 0.25 && n < 0.65) { - // increment between 0 - 3% - amount = (Math.random() * 3) / 100; - } else if (n >= 0.65 && n < 0.9) { - // increment between 0 - 2% - amount = (Math.random() * 2) / 100; - } else if (n >= 0.9 && n < 0.99) { - // finally, increment it .5 % - amount = 0.005; - } else { - // after 99%, don't increment: - amount = 0; - } - } - - n = clamp(n + amount, 0, 0.994); - return NProgress.set(n); - } - }; - - NProgress.trickle = function() { - return NProgress.inc(); - }; - - /** - * Waits for all supplied jQuery promises and - * increases the progress as the promises resolve. - * - * @param $promise jQUery Promise - */ - (function() { - var initial = 0, current = 0; - - NProgress.promise = function($promise) { - if (!$promise || $promise.state() === "resolved") { - return this; - } - - if (current === 0) { - NProgress.start(); - } - - initial++; - current++; - - $promise.always(function() { - current--; - if (current === 0) { - initial = 0; - NProgress.done(); - } else { - NProgress.set((initial - current) / initial); - } - }); - - return this; - }; - - })(); - - /** - * (Internal) renders the progress bar markup based on the `template` - * setting. - */ - - NProgress.render = function(fromStart) { - if (NProgress.isRendered()) return document.getElementById('nprogress'); - - addClass(document.documentElement, 'nprogress-busy'); - - var progress = document.createElement('div'); - progress.id = 'nprogress'; - progress.innerHTML = Settings.template; - - var bar = progress.querySelector(Settings.barSelector), - perc = fromStart ? '-100' : toBarPerc(NProgress.status || 0), - parent = document.querySelector(Settings.parent), - spinner; - - css(bar, { - transition: 'all 0 linear', - transform: 'translate3d(' + perc + '%,0,0)' - }); - - if (!Settings.showSpinner) { - spinner = progress.querySelector(Settings.spinnerSelector); - spinner && removeElement(spinner); - } - - if (parent != document.body) { - addClass(parent, 'nprogress-custom-parent'); - } - - parent.appendChild(progress); - return progress; - }; - - /** - * Removes the element. Opposite of render(). - */ - - NProgress.remove = function() { - removeClass(document.documentElement, 'nprogress-busy'); - removeClass(document.querySelector(Settings.parent), 'nprogress-custom-parent'); - var progress = document.getElementById('nprogress'); - progress && removeElement(progress); - }; - - /** - * Checks if the progress bar is rendered. - */ - - NProgress.isRendered = function() { - return !!document.getElementById('nprogress'); - }; - - /** - * Determine which positioning CSS rule to use. - */ - - NProgress.getPositioningCSS = function() { - // Sniff on document.body.style - var bodyStyle = document.body.style; - - // Sniff prefixes - var vendorPrefix = ('WebkitTransform' in bodyStyle) ? 'Webkit' : - ('MozTransform' in bodyStyle) ? 'Moz' : - ('msTransform' in bodyStyle) ? 'ms' : - ('OTransform' in bodyStyle) ? 'O' : ''; - - if (vendorPrefix + 'Perspective' in bodyStyle) { - // Modern browsers with 3D support, e.g. Webkit, IE10 - return 'translate3d'; - } else if (vendorPrefix + 'Transform' in bodyStyle) { - // Browsers without 3D support, e.g. IE9 - return 'translate'; - } else { - // Browsers without translate() support, e.g. IE7-8 - return 'margin'; - } - }; - - /** - * Helpers - */ - - function clamp(n, min, max) { - if (n < min) return min; - if (n > max) return max; - return n; - } - - /** - * (Internal) converts a percentage (`0..1`) to a bar translateX - * percentage (`-100%..0%`). - */ - - function toBarPerc(n) { - return (-1 + n) * 100; - } - - - /** - * (Internal) returns the correct CSS for changing the bar's - * position given an n percentage, and speed and ease from Settings - */ - - function barPositionCSS(n, speed, ease) { - var barCSS; - - if (Settings.positionUsing === 'translate3d') { - barCSS = { transform: 'translate3d('+toBarPerc(n)+'%,0,0)' }; - } else if (Settings.positionUsing === 'translate') { - barCSS = { transform: 'translate('+toBarPerc(n)+'%,0)' }; - } else { - barCSS = { 'margin-left': toBarPerc(n)+'%' }; - } - - barCSS.transition = 'all '+speed+'ms '+ease; - - return barCSS; - } - - /** - * (Internal) Queues a function to be executed. - */ - - var queue = (function() { - var pending = []; - - function next() { - var fn = pending.shift(); - if (fn) { - fn(next); - } - } - - return function(fn) { - pending.push(fn); - if (pending.length == 1) next(); - }; - })(); - - /** - * (Internal) Applies css properties to an element, similar to the jQuery - * css method. - * - * While this helper does assist with vendor prefixed property names, it - * does not perform any manipulation of values prior to setting styles. - */ - - var css = (function() { - var cssPrefixes = [ 'Webkit', 'O', 'Moz', 'ms' ], - cssProps = {}; - - function camelCase(string) { - return string.replace(/^-ms-/, 'ms-').replace(/-([\da-z])/gi, function(match, letter) { - return letter.toUpperCase(); - }); - } - - function getVendorProp(name) { - var style = document.body.style; - if (name in style) return name; - - var i = cssPrefixes.length, - capName = name.charAt(0).toUpperCase() + name.slice(1), - vendorName; - while (i--) { - vendorName = cssPrefixes[i] + capName; - if (vendorName in style) return vendorName; - } - - return name; - } - - function getStyleProp(name) { - name = camelCase(name); - return cssProps[name] || (cssProps[name] = getVendorProp(name)); - } - - function applyCss(element, prop, value) { - prop = getStyleProp(prop); - element.style[prop] = value; - } - - return function(element, properties) { - var args = arguments, - prop, - value; - - if (args.length == 2) { - for (prop in properties) { - value = properties[prop]; - if (value !== undefined && properties.hasOwnProperty(prop)) applyCss(element, prop, value); - } - } else { - applyCss(element, args[1], args[2]); - } - } - })(); - - /** - * (Internal) Determines if an element or space separated list of class names contains a class name. - */ - - function hasClass(element, name) { - var list = typeof element == 'string' ? element : classList(element); - return list.indexOf(' ' + name + ' ') >= 0; - } - - /** - * (Internal) Adds a class to an element. - */ - - function addClass(element, name) { - var oldList = classList(element), - newList = oldList + name; - - if (hasClass(oldList, name)) return; - - // Trim the opening space. - element.className = newList.substring(1); - } - - /** - * (Internal) Removes a class from an element. - */ - - function removeClass(element, name) { - var oldList = classList(element), - newList; - - if (!hasClass(element, name)) return; - - // Replace the class name. - newList = oldList.replace(' ' + name + ' ', ' '); - - // Trim the opening and closing spaces. - element.className = newList.substring(1, newList.length - 1); - } - - /** - * (Internal) Gets a space separated list of the class names on the element. - * The list is wrapped with a single space on each end to facilitate finding - * matches within the list. - */ - - function classList(element) { - return (' ' + (element && element.className || '') + ' ').replace(/\s+/gi, ' '); - } - - /** - * (Internal) Removes an element from the DOM. - */ - - function removeElement(element) { - element && element.parentNode && element.parentNode.removeChild(element); - } - - return NProgress; -}); diff --git a/templates/vendor/assets/javascripts/trix.js b/templates/vendor/assets/javascripts/trix.js deleted file mode 100644 index 5d7ee8b..0000000 --- a/templates/vendor/assets/javascripts/trix.js +++ /dev/null @@ -1,25 +0,0 @@ -/* -Trix 0.9.1 -Copyright © 2015 Basecamp, LLC -http://trix-editor.org/ - */ -(function(){}).call(this),function(){var t;null==window.Set&&(window.Set=t=function(){function t(){this.clear()}return t.prototype.clear=function(){return this.values=[]},t.prototype.has=function(t){return-1!==this.values.indexOf(t)},t.prototype.add=function(t){return this.has(t)||this.values.push(t),this},t.prototype["delete"]=function(t){var e;return-1===(e=this.values.indexOf(t))?!1:(this.values.splice(e,1),!0)},t.prototype.forEach=function(){var t;return(t=this.values).forEach.apply(t,arguments)},t}())}.call(this),/* -https://github.com/taylorhakes/promise-polyfill -Copyright (c) 2014 Taylor Hakes -Copyright (c) 2014 Forbes Lindesay -*/ -function(t){function e(t,e){return function(){t.apply(e,arguments)}}function n(t){if("object"!=typeof this)throw new TypeError("Promises must be constructed via new");if("function"!=typeof t)throw new TypeError("not a function");this._state=null,this._value=null,this._deferreds=[],u(t,e(o,this),e(r,this))}function i(t){var e=this;return null===this._state?void this._deferreds.push(t):void c(function(){var n=e._state?t.onFulfilled:t.onRejected;if(null===n)return void(e._state?t.resolve:t.reject)(e._value);var i;try{i=n(e._value)}catch(o){return void t.reject(o)}t.resolve(i)})}function o(t){try{if(t===this)throw new TypeError("A promise cannot be resolved with itself.");if(t&&("object"==typeof t||"function"==typeof t)){var n=t.then;if("function"==typeof n)return void u(e(n,t),e(o,this),e(r,this))}this._state=!0,this._value=t,s.call(this)}catch(i){r.call(this,i)}}function r(t){this._state=!1,this._value=t,s.call(this)}function s(){for(var t=0,e=this._deferreds.length;e>t;t++)i.call(this,this._deferreds[t]);this._deferreds=null}function a(t,e,n,i){this.onFulfilled="function"==typeof t?t:null,this.onRejected="function"==typeof e?e:null,this.resolve=n,this.reject=i}function u(t,e,n){var i=!1;try{t(function(t){i||(i=!0,e(t))},function(t){i||(i=!0,n(t))})}catch(o){if(i)return;i=!0,n(o)}}var c="function"==typeof setImmediate&&setImmediate||function(t){setTimeout(t,1)},l=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)};n.prototype["catch"]=function(t){return this.then(null,t)},n.prototype.then=function(t,e){var o=this;return new n(function(n,r){i.call(o,new a(t,e,n,r))})},n.all=function(){var t=Array.prototype.slice.call(1===arguments.length&&l(arguments[0])?arguments[0]:arguments);return new n(function(e,n){function i(r,s){try{if(s&&("object"==typeof s||"function"==typeof s)){var a=s.then;if("function"==typeof a)return void a.call(s,function(t){i(r,t)},n)}t[r]=s,0===--o&&e(t)}catch(u){n(u)}}if(0===t.length)return e([]);for(var o=t.length,r=0;ri;i++)t[i].then(e,n)})},n._setImmediateFn=function(t){c=t},"undefined"!=typeof module&&module.exports?module.exports=n:t.Promise||(t.Promise=n)}(this),/** - * @license - * Copyright (c) 2014 The Polymer Project Authors. All rights reserved. - * This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt - * The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt - * The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt - * Code distributed by Google as part of the polymer project is also - * subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt - */ -"undefined"==typeof WeakMap&&!function(){var t=Object.defineProperty,e=Date.now()%1e9,n=function(){this.name="__st"+(1e9*Math.random()>>>0)+(e++ +"__")};n.prototype={set:function(e,n){var i=e[this.name];return i&&i[0]===e?i[1]=n:t(e,this.name,{value:[e,n],writable:!0}),this},get:function(t){var e;return(e=t[this.name])&&e[0]===t?e[1]:void 0},"delete":function(t){var e=t[this.name];return e&&e[0]===t?(e[0]=e[1]=void 0,!0):!1},has:function(t){var e=t[this.name];return e?e[0]===t:!1}},window.WeakMap=n}(),function(t){function e(t){A.push(t),b||(b=!0,g(i))}function n(t){return window.ShadowDOMPolyfill&&window.ShadowDOMPolyfill.wrapIfNeeded(t)||t}function i(){b=!1;var t=A;A=[],t.sort(function(t,e){return t.uid_-e.uid_});var e=!1;t.forEach(function(t){var n=t.takeRecords();o(t),n.length&&(t.callback_(n,t),e=!0)}),e&&i()}function o(t){t.nodes_.forEach(function(e){var n=m.get(e);n&&n.forEach(function(e){e.observer===t&&e.removeTransientObservers()})})}function r(t,e){for(var n=t;n;n=n.parentNode){var i=m.get(n);if(i)for(var o=0;o0){var o=n[i-1],r=d(o,t);if(r)return void(n[i-1]=r)}else e(this.observer);n[i]=t},addListeners:function(){this.addListeners_(this.target)},addListeners_:function(t){var e=this.options;e.attributes&&t.addEventListener("DOMAttrModified",this,!0),e.characterData&&t.addEventListener("DOMCharacterDataModified",this,!0),e.childList&&t.addEventListener("DOMNodeInserted",this,!0),(e.childList||e.subtree)&&t.addEventListener("DOMNodeRemoved",this,!0)},removeListeners:function(){this.removeListeners_(this.target)},removeListeners_:function(t){var e=this.options;e.attributes&&t.removeEventListener("DOMAttrModified",this,!0),e.characterData&&t.removeEventListener("DOMCharacterDataModified",this,!0),e.childList&&t.removeEventListener("DOMNodeInserted",this,!0),(e.childList||e.subtree)&&t.removeEventListener("DOMNodeRemoved",this,!0)},addTransientObserver:function(t){if(t!==this.target){this.addListeners_(t),this.transientObservedNodes.push(t);var e=m.get(t);e||m.set(t,e=[]),e.push(this)}},removeTransientObservers:function(){var t=this.transientObservedNodes;this.transientObservedNodes=[],t.forEach(function(t){this.removeListeners_(t);for(var e=m.get(t),n=0;n=0)){n.push(t);for(var i,o=t.querySelectorAll("link[rel="+s+"]"),a=0,u=o.length;u>a&&(i=o[a]);a++)i.import&&r(i.import,e,n);e(t)}}var s=window.HTMLImports?window.HTMLImports.IMPORT_LINK_TYPE:"none";t.forDocumentTree=o,t.forSubtree=e}),window.CustomElements.addModule(function(t){function e(t,e){return n(t,e)||i(t,e)}function n(e,n){return t.upgrade(e,n)?!0:void(n&&s(e))}function i(t,e){b(t,function(t){return n(t,e)?!0:void 0})}function o(t){C.push(t),T||(T=!0,setTimeout(r))}function r(){T=!1;for(var t,e=C,n=0,i=e.length;i>n&&(t=e[n]);n++)t();C=[]}function s(t){x?o(function(){a(t)}):a(t)}function a(t){t.__upgraded__&&!t.__attached&&(t.__attached=!0,t.attachedCallback&&t.attachedCallback())}function u(t){c(t),b(t,function(t){c(t)})}function c(t){x?o(function(){l(t)}):l(t)}function l(t){t.__upgraded__&&t.__attached&&(t.__attached=!1,t.detachedCallback&&t.detachedCallback())}function h(t){for(var e=t,n=window.wrap(document);e;){if(e==n)return!0;e=e.parentNode||e.nodeType===Node.DOCUMENT_FRAGMENT_NODE&&e.host}}function p(t){if(t.shadowRoot&&!t.shadowRoot.__watched){v.dom&&console.log("watching shadow-root for: ",t.localName);for(var e=t.shadowRoot;e;)g(e),e=e.olderShadowRoot}}function d(t,n){if(v.dom){var i=n[0];if(i&&"childList"===i.type&&i.addedNodes&&i.addedNodes){for(var o=i.addedNodes[0];o&&o!==document&&!o.host;)o=o.parentNode;var r=o&&(o.URL||o._URL||o.host&&o.host.localName)||"";r=r.split("/?").shift().split("/").pop()}console.group("mutations (%d) [%s]",n.length,r||"")}var s=h(t);n.forEach(function(t){"childList"===t.type&&(w(t.addedNodes,function(t){t.localName&&e(t,s)}),w(t.removedNodes,function(t){t.localName&&u(t)}))}),v.dom&&console.groupEnd()}function f(t){for(t=window.wrap(t),t||(t=window.wrap(document));t.parentNode;)t=t.parentNode;var e=t.__observer;e&&(d(t,e.takeRecords()),r())}function g(t){if(!t.__observer){var e=new MutationObserver(d.bind(this,t));e.observe(t,{childList:!0,subtree:!0}),t.__observer=e}}function m(t){t=window.wrap(t),v.dom&&console.group("upgradeDocument: ",t.baseURI.split("/").pop());var n=t===window.wrap(document);e(t,n),g(t),v.dom&&console.groupEnd()}function y(t){A(t,m)}var v=t.flags,b=t.forSubtree,A=t.forDocumentTree,x=!window.MutationObserver||window.MutationObserver===window.JsMutationObserver;t.hasPolyfillMutations=x;var T=!1,C=[],w=Array.prototype.forEach.call.bind(Array.prototype.forEach),E=Element.prototype.createShadowRoot;E&&(Element.prototype.createShadowRoot=function(){var t=E.call(this);return window.CustomElements.watchShadow(this),t}),t.watchShadow=p,t.upgradeDocumentTree=y,t.upgradeDocument=m,t.upgradeSubtree=i,t.upgradeAll=e,t.attached=s,t.takeRecords=f}),window.CustomElements.addModule(function(t){function e(e,i){if(!e.__upgraded__&&e.nodeType===Node.ELEMENT_NODE){var o=e.getAttribute("is"),r=t.getRegisteredDefinition(e.localName)||t.getRegisteredDefinition(o);if(r&&(o&&r.tag==e.localName||!o&&!r.extends))return n(e,r,i)}}function n(e,n,o){return s.upgrade&&console.group("upgrade:",e.localName),n.is&&e.setAttribute("is",n.is),i(e,n),e.__upgraded__=!0,r(e),o&&t.attached(e),t.upgradeSubtree(e,o),s.upgrade&&console.groupEnd(),e}function i(t,e){Object.__proto__?t.__proto__=e.prototype:(o(t,e.prototype,e.native),t.__proto__=e.prototype)}function o(t,e,n){for(var i={},o=e;o!==n&&o!==HTMLElement.prototype;){for(var r,s=Object.getOwnPropertyNames(o),a=0;r=s[a];a++)i[r]||(Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(o,r)),i[r]=1);o=Object.getPrototypeOf(o)}}function r(t){t.createdCallback&&t.createdCallback()}var s=t.flags;t.upgrade=e,t.upgradeWithDefinition=n,t.implementPrototype=i}),window.CustomElements.addModule(function(t){function e(e,i){var u=i||{};if(!e)throw new Error("document.registerElement: first argument `name` must not be empty");if(e.indexOf("-")<0)throw new Error("document.registerElement: first argument ('name') must contain a dash ('-'). Argument provided was '"+String(e)+"'.");if(o(e))throw new Error("Failed to execute 'registerElement' on 'Document': Registration failed for type '"+String(e)+"'. The type name is invalid.");if(c(e))throw new Error("DuplicateDefinitionError: a type with name '"+String(e)+"' is already registered");return u.prototype||(u.prototype=Object.create(HTMLElement.prototype)),u.__name=e.toLowerCase(),u.lifecycle=u.lifecycle||{},u.ancestry=r(u.extends),s(u),a(u),n(u.prototype),l(u.__name,u),u.ctor=h(u),u.ctor.prototype=u.prototype,u.prototype.constructor=u.ctor,t.ready&&y(document),u.ctor}function n(t){if(!t.setAttribute._polyfilled){var e=t.setAttribute;t.setAttribute=function(t,n){i.call(this,t,n,e)};var n=t.removeAttribute;t.removeAttribute=function(t){i.call(this,t,null,n)},t.setAttribute._polyfilled=!0}}function i(t,e,n){t=t.toLowerCase();var i=this.getAttribute(t);n.apply(this,arguments);var o=this.getAttribute(t);this.attributeChangedCallback&&o!==i&&this.attributeChangedCallback(t,i,o)}function o(t){for(var e=0;e=0&&A(i,HTMLElement),i)}function f(t,e){var n=t[e];t[e]=function(){var t=n.apply(this,arguments);return v(t),t}}var g,m=t.isIE,y=t.upgradeDocumentTree,v=t.upgradeAll,b=t.upgradeWithDefinition,A=t.implementPrototype,x=t.useNative,T=["annotation-xml","color-profile","font-face","font-face-src","font-face-uri","font-face-format","font-face-name","missing-glyph"],C={},w="http://www.w3.org/1999/xhtml",E=document.createElement.bind(document),S=document.createElementNS.bind(document);g=Object.__proto__||x?function(t,e){return t instanceof e}:function(t,e){if(t instanceof e)return!0;for(var n=t;n;){if(n===e.prototype)return!0;n=n.__proto__}return!1},f(Node.prototype,"cloneNode"),f(document,"importNode"),m&&!function(){var t=document.importNode;document.importNode=function(){var e=t.apply(document,arguments);if(e.nodeType==e.DOCUMENT_FRAGMENT_NODE){var n=document.createDocumentFragment();return n.appendChild(e),n}return e}}(),document.registerElement=e,document.createElement=d,document.createElementNS=p,t.registry=C,t.instanceof=g,t.reservedTagList=T,t.getRegisteredDefinition=c,document.register=document.registerElement}),function(t){function e(){s(window.wrap(document)),window.CustomElements.ready=!0;var t=window.requestAnimationFrame||function(t){setTimeout(t,16)};t(function(){setTimeout(function(){window.CustomElements.readyTime=Date.now(),window.HTMLImports&&(window.CustomElements.elapsed=window.CustomElements.readyTime-window.HTMLImports.readyTime),document.dispatchEvent(new CustomEvent("WebComponentsReady",{bubbles:!0}))})})}var n=t.useNative,i=t.initializeModules,o=t.isIE;if(n){var r=function(){};t.watchShadow=r,t.upgrade=r,t.upgradeAll=r,t.upgradeDocumentTree=r,t.upgradeSubtree=r,t.takeRecords=r,t.instanceof=function(t,e){return t instanceof e}}else i();var s=t.upgradeDocumentTree,a=t.upgradeDocument;if(window.wrap||(window.ShadowDOMPolyfill?(window.wrap=window.ShadowDOMPolyfill.wrapIfNeeded,window.unwrap=window.ShadowDOMPolyfill.unwrapIfNeeded):window.wrap=window.unwrap=function(t){return t}),window.HTMLImports&&(window.HTMLImports.__importsParsingHook=function(t){t.import&&a(wrap(t.import))}),(!window.CustomEvent||o&&"function"!=typeof window.CustomEvent)&&(window.CustomEvent=function(t,e){e=e||{};var n=document.createEvent("CustomEvent");return n.initCustomEvent(t,Boolean(e.bubbles),Boolean(e.cancelable),e.detail),n.preventDefault=function(){Object.defineProperty(this,"defaultPrevented",{get:function(){return!0}})},n},window.CustomEvent.prototype=window.Event.prototype),"complete"===document.readyState||t.flags.eager)e();else if("interactive"!==document.readyState||window.attachEvent||window.HTMLImports&&!window.HTMLImports.ready){var u=window.HTMLImports&&!window.HTMLImports.ready?"HTMLImportsLoaded":"DOMContentLoaded";window.addEventListener(u,e)}else e()}(window.CustomElements),function(){}.call(this),function(){this.Trix={VERSION:"0.9.1",ZERO_WIDTH_SPACE:"\ufeff",NON_BREAKING_SPACE:"\xa0",OBJECT_REPLACEMENT_CHARACTER:"\ufffc",config:{}}}.call(this),function(){Trix.BasicObject=function(){function t(){}var e,n,i;return t.proxyMethod=function(t){var i,o,r,s,a;return r=n(t),i=r.name,s=r.toMethod,a=r.toProperty,o=r.optional,this.prototype[i]=function(){var t,n;return t=null!=s?o?"function"==typeof this[s]?this[s]():void 0:this[s]():null!=a?this[a]:void 0,o?(n=null!=t?t[i]:void 0,null!=n?e.call(n,t,arguments):void 0):(n=t[i],e.call(n,t,arguments))}},n=function(t){var e,n;if(!(n=t.match(i)))throw new Error("can't parse @proxyMethod expression: "+t);return e={name:n[4]},null!=n[2]?e.toMethod=n[1]:e.toProperty=n[1],null!=n[3]&&(e.optional=!0),e},e=Function.prototype.apply,i=/^(.+?)(\(\))?(\?)?\.(.+?)$/,t}()}.call(this),function(){var t=function(t,n){function i(){this.constructor=t}for(var o in n)e.call(n,o)&&(t[o]=n[o]);return i.prototype=n.prototype,t.prototype=new i,t.__super__=n.prototype,t},e={}.hasOwnProperty;Trix.Object=function(e){function n(){this.id=++i}var i;return t(n,e),i=0,n.fromJSONString=function(t){return this.fromJSON(JSON.parse(t))},n.prototype.hasSameConstructorAs=function(t){return this.constructor===(null!=t?t.constructor:void 0)},n.prototype.isEqualTo=function(t){return this===t},n.prototype.inspect=function(){var t,e,n;return t=function(){var t,i,o;i=null!=(t=this.contentsForInspection())?t:{},o=[];for(e in i)n=i[e],o.push(e+"="+n);return o}.call(this),"#<"+this.constructor.name+":"+this.id+(t.length?" "+t.join(", "):"")+">"},n.prototype.contentsForInspection=function(){},n.prototype.toJSONString=function(){return JSON.stringify(this)},n.prototype.toUTF16String=function(){return Trix.UTF16String.box(this)},n.prototype.getCacheKey=function(){return this.id.toString()},n}(Trix.BasicObject)}.call(this),function(){Trix.extend=function(t){var e,n;for(e in t)n=t[e],this[e]=n;return this}}.call(this),function(){var t,e;Trix.extend({defer:function(t){return setTimeout(t,1)},memoize:function(t){var n;return n=e++,function(){var e;return null==this.memos&&(this.memos={}),null!=(e=this.memos)[n]?e[n]:e[n]=t.apply(this,arguments)}}}),e=0,t=function(t){var e,n;return null!=(e=null!=(n=null!=t&&"function"==typeof t.inspect?t.inspect():void 0)?n:function(){try{return JSON.stringify(t)}catch(e){}}())?e:t}}.call(this),function(){var t,e;Trix.extend({normalizeSpaces:function(t){return t.replace(RegExp(""+Trix.ZERO_WIDTH_SPACE,"g"),"").replace(RegExp(""+Trix.NON_BREAKING_SPACE,"g")," ")},summarizeStringChange:function(t,n){var i,o,r,s;return t=Trix.UTF16String.box(t),n=Trix.UTF16String.box(n),n.lengthn&&t.charAt(n).isEqualTo(e.charAt(n));)n++;for(;i>n+1&&t.charAt(i-1).isEqualTo(e.charAt(o-1));)i--,o--;return{utf16String:t.slice(n,i),offset:n}}}.call(this),function(){Trix.extend({arraysAreEqual:function(t,e){var n,i,o,r;if(null==t&&(t=[]),null==e&&(e=[]),t.length!==e.length)return!1;for(i=n=0,o=t.length;o>n;i=++n)if(r=t[i],r!==e[i])return!1;return!0},objectsAreEqual:function(t,e){var n,i;if(null==t&&(t={}),null==e&&(e={}),Object.keys(t).length!==Object.keys(e).length)return!1;for(n in t)if(i=t[n],i!==e[n])return!1;return!0},summarizeArrayChange:function(t,e){var n,i,o,r,s,a,u,c,l,h,p;for(null==t&&(t=[]),null==e&&(e=[]),n=[],h=[],o=new Set,r=0,u=t.length;u>r;r++)p=t[r],o.add(p);for(i=new Set,s=0,c=e.length;c>s;s++)p=e[s],i.add(p),o.has(p)||n.push(p);for(a=0,l=t.length;l>a;a++)p=t[a],i.has(p)||h.push(p);return{added:n,removed:h}}})}.call(this),function(){var t,e,n,i,o;t=document.documentElement,e=null!=(n=null!=(i=null!=(o=t.matchesSelector)?o:t.webkitMatchesSelector)?i:t.msMatchesSelector)?n:t.mozMatchesSelector,Trix.extend({handleEvent:function(e,n){var i,o,r,s,a,u,c,l,h,p,d,f;return l=null!=n?n:{},u=l.onElement,a=l.matchingSelector,f=l.withCallback,s=l.inPhase,c=l.preventDefault,p=l.times,o=null!=u?u:t,h=a,i=f,d="capturing"===s,r=function(t){var e;return null!=p&&0===--p&&r.destroy(),e=Trix.findClosestElementFromNode(t.target,{matchingSelector:h}),null!=e&&null!=f&&f.call(e,t,e),c?t.preventDefault():void 0},r.destroy=function(){return o.removeEventListener(e,r,d)},o.addEventListener(e,r,d),r},handleEventOnce:function(t,e){return null==e&&(e={}),e.times=1,Trix.handleEvent(t,e)},triggerEvent:function(e,n){var i,o,r,s,a,u,c;return c=null!=n?n:{},u=c.onElement,o=c.bubbles,r=c.cancelable,i=c.attributes,s=null!=u?u:t,o=o!==!1,r=r!==!1,a=document.createEvent("Events"),a.initEvent(e,o,r),null!=i&&Trix.extend.call(a,i),s.dispatchEvent(a)},elementMatchesSelector:function(t,n){return 1===(null!=t?t.nodeType:void 0)?e.call(t,n):void 0},findClosestElementFromNode:function(t,e){var n;for(n=(null!=e?e:{}).matchingSelector;null!=t&&t.nodeType!==Node.ELEMENT_NODE;)t=t.parentNode;if(null==n)return t;for(;t;){if(Trix.elementMatchesSelector(t,n))return t;t=t.parentNode}},findInnerElement:function(t){for(;null!=t?t.firstElementChild:void 0;)t=t.firstElementChild;return t},innerElementIsActive:function(t){return document.activeElement!==t&&Trix.elementContainsNode(t,document.activeElement)},elementContainsNode:function(t,e){if(t&&e)for(;e;){if(e===t)return!0;e=e.parentNode}},findNodeFromContainerAndOffset:function(t,e){var n;if(t)return t.nodeType===Node.TEXT_NODE?t:0===e?null!=(n=t.firstChild)?n:t:t.childNodes.item(e-1)},findElementFromContainerAndOffset:function(t,e){var n;return n=Trix.findNodeFromContainerAndOffset(t,e),Trix.findClosestElementFromNode(n)},findChildIndexOfNode:function(t){var e;if(null!=t?t.parentNode:void 0){for(e=0;t=t.previousSibling;)e++;return e}},measureElement:function(t){return{width:t.offsetWidth,height:t.offsetHeight}},walkTree:function(t,e){var n,i,o,r,s;return o=null!=e?e:{},i=o.onlyNodesOfType,r=o.usingFilter,n=o.expandEntityReferences,s=function(){switch(i){case"element":return NodeFilter.SHOW_ELEMENT;case"text":return NodeFilter.SHOW_TEXT;case"comment":return NodeFilter.SHOW_COMMENT;default:return NodeFilter.SHOW_ALL}}(),document.createTreeWalker(t,s,null!=r?r:null,n===!0)},tagName:function(t){var e;return null!=t&&null!=(e=t.tagName)?e.toLowerCase():void 0},makeElement:function(t,e){var n,i,o,r,s,a,u,c,l,h;if(null==e&&(e={}),"object"==typeof t?(e=t,t=e.tagName):e={attributes:e},i=document.createElement(t),null!=e.editable&&(null==e.attributes&&(e.attributes={}),e.attributes.contenteditable=e.editable),e.attributes){a=e.attributes;for(r in a)h=a[r],i.setAttribute(r,h)}if(e.style){u=e.style;for(r in u)h=u[r],i.style[r]=h}if(e.data){c=e.data;for(r in c)h=c[r],i.dataset[r]=h}if(e.className)for(l=e.className.split(" "),o=0,s=l.length;s>o;o++)n=l[o],i.classList.add(n);return e.textContent&&(i.textContent=e.textContent),i},cloneFragment:function(t){var e,n,i,o,r;for(e=document.createDocumentFragment(),r=t.childNodes,n=0,i=r.length;i>n;n++)o=r[n],e.appendChild(o.cloneNode(!0));return e},makeFragment:function(t){var e,n,i;for(null==t&&(t=""),e=document.createElement("div"),e.innerHTML=t,n=document.createDocumentFragment();i=e.firstChild;)n.appendChild(i);return n},nodeIsBlockContainer:function(t){return Trix.nodeIsBlockStartComment(null!=t?t.firstChild:void 0)},nodeIsBlockStartComment:function(t){return Trix.nodeIsCommentNode(t)&&"block"===(null!=t?t.data:void 0)},nodeIsCommentNode:function(t){return(null!=t?t.nodeType:void 0)===Node.COMMENT_NODE},nodeIsCursorTarget:function(t){return t?Trix.nodeIsTextNode(t)?t.data===Trix.ZERO_WIDTH_SPACE:Trix.nodeIsCursorTarget(t.firstChild):void 0},nodeIsAttachmentElement:function(t){return Trix.elementMatchesSelector(t,Trix.AttachmentView.attachmentSelector)},nodeIsEmptyTextNode:function(t){return Trix.nodeIsTextNode(t)&&""===(null!=t?t.data:void 0)},nodeIsTextNode:function(t){return(null!=t?t.nodeType:void 0)===Node.TEXT_NODE}})}.call(this),function(){var t,e,n;Trix.extend({normalizeRange:e=function(e){var n;if(null!=e)return Array.isArray(e)||(e=[e,e]),[t(e[0]),t(null!=(n=e[1])?n:e[0])]},rangeIsCollapsed:function(t){var i,o,r;if(null!=t)return o=e(t),r=o[0],i=o[1],n(r,i)},rangesAreEqual:function(t,i){var o,r,s,a,u,c;if(null!=t&&null!=i)return s=e(t),r=s[0],o=s[1],a=e(i),c=a[0],u=a[1],n(r,c)&&n(o,u)}}),t=function(t){var e,n;return"number"==typeof t?t:(e=t.index,n=t.offset,{index:e,offset:n})},n=function(t,e){return"number"==typeof t?t===e:t.index===e.index&&t.offset===e.offset}}.call(this),function(){var t,e,n,i;t={extendsTagName:"div",css:"%t { display: block; }"},Trix.registerElement=function(e,o){var r,s,a,u,c,l,h;return null==o&&(o={}),e=e.toLowerCase(),c=i(o),u=null!=(h=c.extendsTagName)?h:t.extendsTagName,delete c.extendsTagName,s=c.defaultCSS,delete c.defaultCSS,null!=s&&u===t.extendsTagName?s+="\n"+t.css:s=t.css,n(s,e),a=Object.getPrototypeOf(document.createElement(u)),a.__super__=a,l=Object.create(a,c),r=document.registerElement(e,{prototype:l}),Object.defineProperty(l,"constructor",{value:r}),r},n=function(t,n){var i;return i=e(n),i.textContent=t.replace(/%t/g,n)},e=function(t){var e;return e=document.createElement("style"),e.setAttribute("type","text/css"),e.setAttribute("data-tag-name",t.toLowerCase()),document.head.insertBefore(e,document.head.firstChild),e},i=function(t){var e,n,i;n={};for(e in t)i=t[e],n[e]="function"==typeof i?{value:i}:i;return n}}.call(this),function(){}.call(this),function(){var t,e=function(t,e){function i(){this.constructor=t}for(var o in e)n.call(e,o)&&(t[o]=e[o]);return i.prototype=e.prototype,t.prototype=new i,t.__super__=e.prototype,t},n={}.hasOwnProperty;t=Trix.arraysAreEqual,Trix.Hash=function(n){function i(t){null==t&&(t={}),this.values=r(t),i.__super__.constructor.apply(this,arguments)}var o,r,s,a,u;return e(i,n),i.fromCommonAttributesOfObjects=function(t){var e,n,i,r,s,a;if(null==t&&(t=[]),!t.length)return new this;for(e=o(t[0]),i=e.getKeys(),a=t.slice(1),n=0,r=a.length;r>n;n++)s=a[n],i=e.getKeysCommonToHash(o(s)),e=e.slice(i);return e},i.box=function(t){return o(t)},i.prototype.add=function(t,e){return this.merge(a(t,e))},i.prototype.remove=function(t){return new Trix.Hash(r(this.values,t))},i.prototype.get=function(t){return this.values[t]},i.prototype.has=function(t){return t in this.values},i.prototype.merge=function(t){return new Trix.Hash(s(this.values,u(t)))},i.prototype.slice=function(t){var e,n,i,o;for(o={},e=0,i=t.length;i>e;e++)n=t[e],this.has(n)&&(o[n]=this.values[n]);return new Trix.Hash(o)},i.prototype.getKeys=function(){return Object.keys(this.values)},i.prototype.getKeysCommonToHash=function(t){var e,n,i,r,s;for(t=o(t),r=this.getKeys(),s=[],e=0,i=r.length;i>e;e++)n=r[e],this.values[n]===t.values[n]&&s.push(n);return s},i.prototype.isEqualTo=function(e){return t(this.toArray(),o(e).toArray())},i.prototype.isEmpty=function(){return 0===this.getKeys().length},i.prototype.toArray=function(){var t,e,n;return(null!=this.array?this.array:this.array=function(){var i;e=[],i=this.values;for(t in i)n=i[t],e.push(t,n);return e}.call(this)).slice(0)},i.prototype.toObject=function(){return r(this.values)},i.prototype.toJSON=function(){return this.toObject()},i.prototype.contentsForInspection=function(){return{values:JSON.stringify(this.values)}},a=function(t,e){var n;return n={},n[t]=e,n},s=function(t,e){var n,i,o;i=r(t);for(n in e)o=e[n],i[n]=o;return i},r=function(t,e){var n,i,o,r,s;for(r={},s=Object.keys(t).sort(),n=0,o=s.length;o>n;n++)i=s[n],i!==e&&(r[i]=t[i]);return r},o=function(t){return t instanceof Trix.Hash?t:new Trix.Hash(t)},u=function(t){return t instanceof Trix.Hash?t.values:t},i}(Trix.Object)}.call(this),function(){Trix.ObjectGroup=function(){function t(t,e){var n,i;this.objects=null!=t?t:[],i=e.depth,n=e.asTree,n&&(this.depth=i,this.objects=this.constructor.groupObjects(this.objects,{asTree:n,depth:this.depth+1}))}return t.groupObjects=function(t,e){var n,i,o,r,s,a,u,c,l;for(null==t&&(t=[]),l=null!=e?e:{},o=l.depth,n=l.asTree,n&&null==o&&(o=0),c=[],s=0,a=t.length;a>s;s++){if(u=t[s],r){if(("function"==typeof u.canBeGrouped?u.canBeGrouped(o):void 0)&&("function"==typeof(i=r[r.length-1]).canBeGroupedWith?i.canBeGroupedWith(u,o):void 0)){r.push(u);continue}c.push(new this(r,{depth:o,asTree:n})),r=null}("function"==typeof u.canBeGrouped?u.canBeGrouped(o):void 0)?r=[u]:c.push(u)}return r&&c.push(new this(r,{depth:o,asTree:n})),c},t.prototype.getObjects=function(){return this.objects},t.prototype.getDepth=function(){return this.depth},t.prototype.getCacheKey=function(){var t,e,n,i,o;for(e=["objectGroup"],o=this.getObjects(),t=0,n=o.length;n>t;t++)i=o[t],e.push(i.getCacheKey());return e.join("/")},t}()}.call(this),function(){var t=function(t,n){function i(){this.constructor=t}for(var o in n)e.call(n,o)&&(t[o]=n[o]);return i.prototype=n.prototype,t.prototype=new i,t.__super__=n.prototype,t},e={}.hasOwnProperty;Trix.ObjectMap=function(e){function n(t){var e,n,i,o,r;for(null==t&&(t=[]),this.objects={},i=0,o=t.length;o>i;i++)r=t[i],n=JSON.stringify(r),null==(e=this.objects)[n]&&(e[n]=r)}return t(n,e),n.prototype.find=function(t){var e;return e=JSON.stringify(t),this.objects[e]},n}(Trix.BasicObject)}.call(this),function(){Trix.ElementStore=function(){function t(t){this.reset(t)}var e;return t.prototype.add=function(t){var n;return n=e(t),this.elements[n]=t},t.prototype.remove=function(t){var n,i;return n=e(t),(i=this.elements[n])?(delete this.elements[n],i):void 0},t.prototype.reset=function(t){var e,n,i;for(null==t&&(t=[]),this.elements={},n=0,i=t.length;i>n;n++)e=t[n],this.add(e);return t},e=function(t){return t.dataset.trixStoreKey},t}()}.call(this),function(){}.call(this),function(){var t=function(t,n){function i(){this.constructor=t}for(var o in n)e.call(n,o)&&(t[o]=n[o]);return i.prototype=n.prototype,t.prototype=new i,t.__super__=n.prototype,t},e={}.hasOwnProperty;Trix.Operation=function(e){function n(){return n.__super__.constructor.apply(this,arguments)}return t(n,e),n.prototype.isPerforming=function(){return this.performing===!0},n.prototype.hasPerformed=function(){return this.performed===!0},n.prototype.hasSucceeded=function(){return this.performed&&this.succeeded},n.prototype.hasFailed=function(){return this.performed&&!this.succeeded},n.prototype.getPromise=function(){return null!=this.promise?this.promise:this.promise=new Promise(function(t){return function(e,n){return t.performing=!0,t.perform(function(i,o){return t.succeeded=i,t.performing=!1,t.performed=!0,t.succeeded?e(o):n(o)})}}(this))},n.prototype.perform=function(t){return t(!1)},n.prototype.release=function(){var t;return null!=(t=this.promise)&&"function"==typeof t.cancel&&t.cancel(),this.promise=null,this.performing=null,this.performed=null,this.succeeded=null},n.proxyMethod("getPromise().then"),n.proxyMethod("getPromise().catch"),n}(Trix.BasicObject)}.call(this),function(){var t,e,n,i,o,r=function(t,e){function n(){this.constructor=t}for(var i in e)s.call(e,i)&&(t[i]=e[i]);return n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype,t},s={}.hasOwnProperty;Trix.UTF16String=function(t){function e(t,e){this.ucs2String=t,this.codepoints=e,this.length=this.codepoints.length,this.ucs2Length=this.ucs2String.length}return r(e,t),e.box=function(t){return null==t&&(t=""),t instanceof this?t:this.fromUCS2String(null!=t?t.toString():void 0)},e.fromUCS2String=function(t){return new this(t,i(t))},e.fromCodepoints=function(t){return new this(o(t),t)},e.prototype.offsetToUCS2Offset=function(t){return o(this.codepoints.slice(0,Math.max(0,t))).length},e.prototype.offsetFromUCS2Offset=function(t){return i(this.ucs2String.slice(0,Math.max(0,t))).length},e.prototype.slice=function(){var t;return this.constructor.fromCodepoints((t=this.codepoints).slice.apply(t,arguments))},e.prototype.charAt=function(t){return this.slice(t,t+1)},e.prototype.isEqualTo=function(t){return this.constructor.box(t).ucs2String===this.ucs2String},e.prototype.toJSON=function(){return this.ucs2String},e.prototype.getCacheKey=function(){return this.ucs2String},e.prototype.toString=function(){return this.ucs2String},e}(Trix.BasicObject),t=1===("function"==typeof Array.from?Array.from("\ud83d\udc7c").length:void 0),e=null!=("function"==typeof" ".codePointAt?" ".codePointAt(0):void 0),n=" \ud83d\udc7c"===("function"==typeof String.fromCodePoint?String.fromCodePoint(32,128124):void 0),i=t&&e?function(t){return Array.from(t).map(function(t){return t.codePointAt(0)})}:function(t){var e,n,i,o,r;for(o=[],e=0,i=t.length;i>e;)r=t.charCodeAt(e++),r>=55296&&56319>=r&&i>e&&(n=t.charCodeAt(e++),56320===(64512&n)?r=((1023&r)<<10)+(1023&n)+65536:e--),o.push(r);return o},o=n?function(t){return String.fromCodePoint.apply(String,t)}:function(t){var e,n,i;return e=function(){var e,o,r;for(r=[],e=0,o=t.length;o>e;e++)i=t[e],n="",i>65535&&(i-=65536,n+=String.fromCharCode(i>>>10&1023|55296),i=56320|1023&i),r.push(n+String.fromCharCode(i));return r}(),e.join("")}}.call(this),function(){}.call(this),function(){}.call(this),function(){Trix.config.lang={bold:"Bold",bullets:"Bullets","byte":"Byte",bytes:"Bytes",captionPlaceholder:"Type a caption here\u2026",code:"Code",editCaption:"Edit caption",indent:"Increase Level",italic:"Italic",link:"Link",numbers:"Numbers",outdent:"Decrease Level",quote:"Quote",redo:"Redo",remove:"Remove",strike:"Strikethrough",undo:"Undo",unlink:"Unlink",urlPlaceholder:"Enter a URL\u2026",GB:"GB",KB:"KB",MB:"MB",PB:"PB",TB:"TB"}}.call(this),function(){Trix.config.css={classNames:{attachment:{container:"attachment",typePrefix:"attachment-",caption:"caption",captionEdited:"caption-edited",captionEditor:"caption-editor",editingCaption:"caption-editing",progressBar:"progress",removeButton:"remove",size:"size"}}} -}.call(this),function(){var t;Trix.config.blockAttributes=t={"default":{tagName:"div",parse:!1},quote:{tagName:"blockquote",nestable:!0},code:{tagName:"pre",text:{plaintext:!0}},bulletList:{tagName:"ul",parse:!1},bullet:{tagName:"li",listAttribute:"bulletList",test:function(e){return Trix.tagName(e.parentNode)===t[this.listAttribute].tagName}},numberList:{tagName:"ol",parse:!1},number:{tagName:"li",listAttribute:"numberList",test:function(e){return Trix.tagName(e.parentNode)===t[this.listAttribute].tagName}}}}.call(this),function(){var t,e;t=Trix.config.lang,e=[t.bytes,t.KB,t.MB,t.GB,t.TB,t.PB],Trix.config.fileSize={prefix:"IEC",precision:2,formatter:function(n){var i,o,r,s,a;switch(n){case 0:return"0 "+t.bytes;case 1:return"1 "+t.byte;default:return i=function(){switch(this.prefix){case"SI":return 1e3;case"IEC":return 1024}}.call(this),o=Math.floor(Math.log(n)/Math.log(i)),r=n/Math.pow(i,o),s=r.toFixed(this.precision),a=s.replace(/0*$/,"").replace(/\.$/,""),a+" "+e[o]}}}}.call(this),function(){Trix.config.textAttributes={bold:{tagName:"strong",inheritable:!0,parser:function(t){var e;return e=window.getComputedStyle(t),"bold"===e.fontWeight||e.fontWeight>=700}},italic:{tagName:"em",inheritable:!0,parser:function(t){var e;return e=window.getComputedStyle(t),"italic"===e.fontStyle}},href:{groupTagName:"a",parser:function(t){var e,n,i;return e=Trix.AttachmentView.attachmentSelector,i="a:not("+e+")",(n=Trix.findClosestElementFromNode(t,{matchingSelector:i}))?n.getAttribute("href"):void 0}},strike:{tagName:"del",inheritable:!0},frozen:{style:{backgroundColor:"highlight"}}}}.call(this),function(){var t,e,n,i,o;o="[data-trix-serialize=false]",i=["contenteditable","data-trix-id","data-trix-store-key","data-trix-mutable"],e="data-trix-serialized-attributes",n="["+e+"]",t=new RegExp("","g"),Trix.extend({serializers:{"application/json":function(t){var e;if(t instanceof Trix.Document)e=t;else{if(!(t instanceof HTMLElement))throw new Error("unserializable object");e=Trix.Document.fromHTML(t.innerHTML)}return e.toSerializableDocument().toJSONString()},"text/html":function(r){var s,a,u,c,l,h,p,d,f,g,m,y,v,b,A,x,T;if(r instanceof Trix.Document)c=Trix.DocumentView.render(r);else{if(!(r instanceof HTMLElement))throw new Error("unserializable object");c=r.cloneNode(!0)}for(b=c.querySelectorAll(o),l=0,f=b.length;f>l;l++)u=b[l],u.parentNode.removeChild(u);for(h=0,g=i.length;g>h;h++)for(s=i[h],A=c.querySelectorAll("["+s+"]"),p=0,m=A.length;m>p;p++)u=A[p],u.removeAttribute(s);for(x=c.querySelectorAll(n),d=0,y=x.length;y>d;d++){u=x[d];try{a=JSON.parse(u.getAttribute(e)),u.removeAttribute(e);for(v in a)T=a[v],u.setAttribute(v,T)}catch(C){}}return c.innerHTML.replace(t,"")}},deserializers:{"application/json":function(t){return Trix.Document.fromJSONString(t)},"text/html":function(t){return Trix.Document.fromHTML(t)}},serializeToContentType:function(t,e){var n;if(n=Trix.serializers[e])return n(t);throw new Error("unknown content type: "+e)},deserializeFromContentType:function(t,e){var n;if(n=Trix.deserializers[e])return n(t);throw new Error("unknown content type: "+e)}})}.call(this),function(){var t,e;e=Trix.makeFragment,t=Trix.config.lang,Trix.config.toolbar={content:e('
\n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n\n \n \n \n \n
\n\n
\n \n
')}}.call(this),function(){Trix.config.undoInterval=5e3}.call(this),function(){}.call(this),function(){var t;t=Trix.cloneFragment,Trix.registerElement("trix-toolbar",{defaultCSS:"%t {\n white-space: collapse;\n}\n\n%t .dialog {\n display: none;\n}\n\n%t .dialog.active {\n display: block;\n}\n\n%t .dialog input.validate:invalid {\n background-color: #ffdddd;\n}\n\n%t[native] {\n display: none;\n}",createdCallback:function(){return""===this.innerHTML?this.appendChild(t(Trix.config.toolbar.content)):void 0}})}.call(this),function(){var t=function(t,n){function i(){this.constructor=t}for(var o in n)e.call(n,o)&&(t[o]=n[o]);return i.prototype=n.prototype,t.prototype=new i,t.__super__=n.prototype,t},e={}.hasOwnProperty,n=[].indexOf||function(t){for(var e=0,n=this.length;n>e;e++)if(e in this&&this[e]===t)return e;return-1};Trix.ObjectView=function(e){function i(t,e){this.object=t,this.options=null!=e?e:{},this.childViews=[],this.rootView=this}return t(i,e),i.prototype.getNodes=function(){var t,e,n,i,o;for(null==this.nodes&&(this.nodes=this.createNodes()),i=this.nodes,o=[],t=0,e=i.length;e>t;t++)n=i[t],o.push(n.cloneNode(!0));return o},i.prototype.invalidate=function(){var t;return this.nodes=null,null!=(t=this.parentView)?t.invalidate():void 0},i.prototype.invalidateViewForObject=function(t){var e;return null!=(e=this.findViewForObject(t))?e.invalidate():void 0},i.prototype.findOrCreateCachedChildView=function(t,e){var n;return(n=this.getCachedViewForObject(e))?this.recordChildView(n):(n=this.createChildView.apply(this,arguments),this.cacheViewForObject(n,e)),n},i.prototype.createChildView=function(t,e,n){var i;return null==n&&(n={}),e instanceof Trix.ObjectGroup&&(n.viewClass=t,t=Trix.ObjectGroupView),i=new t(e,n),this.recordChildView(i)},i.prototype.recordChildView=function(t){return t.parentView=this,t.rootView=this.rootView,this.childViews.push(t),t},i.prototype.getAllChildViews=function(){var t,e,n,i,o;for(o=[],i=this.childViews,e=0,n=i.length;n>e;e++)t=i[e],o.push(t),o=o.concat(t.getAllChildViews());return o},i.prototype.findElement=function(){return this.findElementForObject(this.object)},i.prototype.findElementForObject=function(t){var e;return(e=null!=t?t.id:void 0)?this.rootView.element.querySelector("[data-trix-id='"+e+"']"):void 0},i.prototype.findViewForObject=function(t){var e,n,i,o;for(i=this.getAllChildViews(),e=0,n=i.length;n>e;e++)if(o=i[e],o.object===t)return o},i.prototype.getViewCache=function(){return this.rootView!==this?this.rootView.getViewCache():this.isViewCachingEnabled()?null!=this.viewCache?this.viewCache:this.viewCache={}:void 0},i.prototype.isViewCachingEnabled=function(){return this.shouldCacheViews!==!1},i.prototype.enableViewCaching=function(){return this.shouldCacheViews=!0},i.prototype.disableViewCaching=function(){return this.shouldCacheViews=!1},i.prototype.getCachedViewForObject=function(t){var e;return null!=(e=this.getViewCache())?e[t.getCacheKey()]:void 0},i.prototype.cacheViewForObject=function(t,e){var n;return null!=(n=this.getViewCache())?n[e.getCacheKey()]=t:void 0},i.prototype.garbageCollectCachedViews=function(){var t,e,i,o,r,s;if(t=this.getViewCache()){s=this.getAllChildViews().concat(this),i=function(){var t,e,n;for(n=[],t=0,e=s.length;e>t;t++)r=s[t],n.push(r.object.getCacheKey());return n}(),o=[];for(e in t)n.call(i,e)<0&&o.push(delete t[e]);return o}},i}(Trix.BasicObject)}.call(this),function(){var t=function(t,n){function i(){this.constructor=t}for(var o in n)e.call(n,o)&&(t[o]=n[o]);return i.prototype=n.prototype,t.prototype=new i,t.__super__=n.prototype,t},e={}.hasOwnProperty;Trix.ObjectGroupView=function(e){function n(){n.__super__.constructor.apply(this,arguments),this.objectGroup=this.object,this.viewClass=this.options.viewClass,delete this.options.viewClass}return t(n,e),n.prototype.getChildViews=function(){var t,e,n,i;if(!this.childViews.length)for(i=this.objectGroup.getObjects(),t=0,e=i.length;e>t;t++)n=i[t],this.findOrCreateCachedChildView(this.viewClass,n,this.options);return this.childViews},n.prototype.createNodes=function(){var t,e,n,i,o,r,s,a,u;for(t=this.createContainerElement(),s=this.getChildViews(),e=0,i=s.length;i>e;e++)for(u=s[e],a=u.getNodes(),n=0,o=a.length;o>n;n++)r=a[n],t.appendChild(r);return[t]},n.prototype.createContainerElement=function(t){return null==t&&(t=this.objectGroup.getDepth()),this.getChildViews()[0].createContainerElement(t)},n}(Trix.ObjectView)}.call(this),function(){var t=function(t,n){function i(){this.constructor=t}for(var o in n)e.call(n,o)&&(t[o]=n[o]);return i.prototype=n.prototype,t.prototype=new i,t.__super__=n.prototype,t},e={}.hasOwnProperty;Trix.Controller=function(e){function n(){return n.__super__.constructor.apply(this,arguments)}return t(n,e),n}(Trix.BasicObject)}.call(this),function(){var t,e,n,i,o,r=function(t,e){return function(){return t.apply(e,arguments)}},s=function(t,e){function n(){this.constructor=t}for(var i in e)a.call(e,i)&&(t[i]=e[i]);return n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype,t},a={}.hasOwnProperty,u=[].indexOf||function(t){for(var e=0,n=this.length;n>e;e++)if(e in this&&this[e]===t)return e;return-1};t=Trix.defer,e=Trix.findClosestElementFromNode,n=Trix.nodeIsEmptyTextNode,i=Trix.normalizeSpaces,o=Trix.summarizeStringChange,Trix.MutationObserver=function(t){function a(t){this.element=t,this.didMutate=r(this.didMutate,this),this.observer=new window.MutationObserver(this.didMutate),this.start()}var c,l;return s(a,t),c="[data-trix-mutable]",l={attributes:!0,childList:!0,characterData:!0,characterDataOldValue:!0,subtree:!0},a.prototype.start=function(){return this.reset(),this.observer.observe(this.element,l)},a.prototype.stop=function(){return this.observer.disconnect()},a.prototype.didMutate=function(t){var e,n;return(e=this.mutations).push.apply(e,this.findSignificantMutations(t)),this.mutations.length?(null!=(n=this.delegate)&&"function"==typeof n.elementDidMutate&&n.elementDidMutate(this.getMutationSummary()),this.reset()):void 0},a.prototype.reset=function(){return this.mutations=[]},a.prototype.findSignificantMutations=function(t){var e,n,i,o;for(o=[],e=0,n=t.length;n>e;e++)i=t[e],this.mutationIsSignificant(i)&&o.push(i);return o},a.prototype.mutationIsSignificant=function(t){var e,n,i,o;for(o=this.nodesModifiedByMutation(t),e=0,n=o.length;n>e;e++)if(i=o[e],this.nodeIsSignificant(i))return!0;return!1},a.prototype.nodeIsSignificant=function(t){return t!==this.element&&!this.nodeIsMutable(t)&&!n(t)},a.prototype.nodeIsMutable=function(t){return e(t,{matchingSelector:c})},a.prototype.nodesModifiedByMutation=function(t){var e;switch(e=[],t.type){case"attributes":e.push(t.target);break;case"characterData":e.push(t.target.parentNode),e.push(t.target);break;case"childList":e.push.apply(e,t.addedNodes),e.push.apply(e,t.removedNodes)}return e},a.prototype.getMutationSummary=function(){return this.getTextMutationSummary()},a.prototype.getTextMutationSummary=function(){var t,e,n,i,o,r,s,a,c,l,h;for(a=this.getTextChangesFromCharacterData(),n=a.additions,o=a.deletions,h=this.getTextChangesFromTextNodes(),c=h.additions,r=0,s=c.length;s>r;r++)e=c[r],u.call(n,e)<0&&n.push(e);return o.push.apply(o,h.deletions),l={},(t=n.join(""))&&(l.textAdded=t),(i=o.join(""))&&(l.textDeleted=i),l},a.prototype.getMutationsByType=function(t){var e,n,i,o,r;for(o=this.mutations,r=[],e=0,n=o.length;n>e;e++)i=o[e],i.type===t&&r.push(i);return r},a.prototype.getTextChangesFromTextNodes=function(){var t,e,n,i,o,r,s,a,u,c,l,h,p,d;for(c=[],l=[],h=this.getMutationsByType("childList"),t=0,o=h.length;o>t;t++){for(a=h[t],p=a.removedNodes,n=0,r=p.length;r>n;n++)u=p[n],u.nodeType===Node.TEXT_NODE&&l.push(u);for(d=a.addedNodes,i=0,s=d.length;s>i;i++)u=d[i],u.nodeType===Node.TEXT_NODE&&c.push(u)}return{additions:function(){var t,n,i,o;for(o=[],e=t=0,n=c.length;n>t;e=++t)u=c[e],u.data!==(null!=(i=l[e])?i.data:void 0)&&o.push(u.data);return o}(),deletions:function(){var t,n,i,o;for(o=[],e=t=0,n=l.length;n>t;e=++t)u=l[e],u.data!==(null!=(i=c[e])?i.data:void 0)&&o.push(u.data);return o}()}},a.prototype.getTextChangesFromCharacterData=function(){var t,e,n,r,s,a,u,c;return e=this.getMutationsByType("characterData"),e.length&&(c=e[0],n=e[e.length-1],s=i(c.oldValue),r=i(n.target.data),a=o(s,r),t=a.added,u=a.removed),{additions:t?[t]:[],deletions:u?[u]:[]}},a}(Trix.BasicObject)}.call(this),function(){var t=function(t,n){function i(){this.constructor=t}for(var o in n)e.call(n,o)&&(t[o]=n[o]);return i.prototype=n.prototype,t.prototype=new i,t.__super__=n.prototype,t},e={}.hasOwnProperty;Trix.FileVerificationOperation=function(e){function n(t){this.file=t}return t(n,e),n.prototype.perform=function(t){var e;return e=new FileReader,e.onerror=function(){return t(!1)},e.onload=function(n){return function(){e.onerror=null;try{e.abort()}catch(i){}return t(!0,n.file)}}(this),e.readAsArrayBuffer(this.file)},n}(Trix.Operation)}.call(this),function(){var t,e,n,i,o,r,s,a,u,c,l,h,p,d,f=function(t,e){function n(){this.constructor=t}for(var i in e)g.call(e,i)&&(t[i]=e[i]);return n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype,t},g={}.hasOwnProperty,m=[].indexOf||function(t){for(var e=0,n=this.length;n>e;e++)if(e in this&&this[e]===t)return e;return-1};r=Trix.handleEvent,i=Trix.findClosestElementFromNode,o=Trix.findElementFromContainerAndOffset,e=Trix.defer,l=Trix.makeElement,s=Trix.innerElementIsActive,p=Trix.summarizeStringChange,Trix.InputController=function(e){function i(t){var e;this.element=t,this.resetInputSummary(),this.mutationObserver=new Trix.MutationObserver(this.element),this.mutationObserver.delegate=this;for(e in this.events)r(e,{onElement:this.element,withCallback:this.handlerFor(e),inPhase:"capturing"})}var o;return f(i,e),o=0,i.keyNames={8:"backspace",9:"tab",13:"return",37:"left",39:"right",46:"delete",68:"d",72:"h",79:"o"},i.prototype.handlerFor=function(t){return function(e){return function(n){return e.handleInput(function(){return s(this.element)?void 0:(this.eventName=t,this.events[t].call(this,n))})}}(this)},i.prototype.setInputSummary=function(t){var e,n;null==t&&(t={}),this.inputSummary.eventName=this.eventName;for(e in t)n=t[e],this.inputSummary[e]=n;return this.inputSummary},i.prototype.resetInputSummary=function(){return this.inputSummary={}},i.prototype.editorWillSyncDocumentView=function(){return this.mutationObserver.stop()},i.prototype.editorDidSyncDocumentView=function(){return this.mutationObserver.start()},i.prototype.requestRender=function(){var t;return null!=(t=this.delegate)&&"function"==typeof t.inputControllerDidRequestRender?t.inputControllerDidRequestRender():void 0},i.prototype.elementDidMutate=function(t){return this.handleInput(function(){var e;return this.mutationIsExpected(t)||null!=(e=this.responder)&&e.replaceHTML(this.element.innerHTML),this.resetInputSummary(),this.requestRender(),Trix.selectionChangeObserver.reset()})},i.prototype.mutationIsExpected=function(t){var e,n;return this.inputSummary?null!=this.inputSummary.preferDocument?this.inputSummary.preferDocument:(e=t.textAdded!==this.inputSummary.textAdded,n=null!=t.textDeleted&&!this.inputSummary.didDelete,!(e||n)):void 0},i.prototype.attachFiles=function(t){var e,n;return n=function(){var n,i,o;for(o=[],n=0,i=t.length;i>n;n++)e=t[n],o.push(new Trix.FileVerificationOperation(e));return o}(),Promise.all(n).then(function(t){return function(n){return t.handleInput(function(){var t,i,o,r;for(null!=(o=this.delegate)&&o.inputControllerWillAttachFiles(),t=0,i=n.length;i>t;t++)e=n[t],null!=(r=this.responder)&&r.insertFile(e);return this.requestRender()})}}(this))},i.prototype.events={keydown:function(t){var e,n,i,o,r,s,u,c,l,h;if(this.inputSummary.composing||this.resetInputSummary(),r=this.constructor.keyNames[t.keyCode]){for(n=this.keys,l=["ctrl","alt","shift","meta"],i=0,u=l.length;u>i;i++)if(c=l[i],t[c+"Key"]&&("ctrl"===c&&(c="control"),n=this.keys[c],n[r])){o=c;break}null!=n[r]&&(this.setInputSummary({keyName:r,keyModifier:o}),Trix.selectionChangeObserver.reset(),n[r].call(this,t))}return a(t)&&(e=String.fromCharCode(t.keyCode).toLowerCase())&&(s=function(){var e,n,i,o;for(i=["alt","shift"],o=[],e=0,n=i.length;n>e;e++)c=i[e],t[c+"Key"]&&o.push(c);return o}(),s.push(e),null!=(h=this.delegate)?h.inputControllerDidReceiveKeyboardCommand(s):void 0)?t.preventDefault():void 0},keypress:function(t){var e,n,i;if(null==this.inputSummary.eventName&&(!t.metaKey&&!t.ctrlKey||t.altKey)&&!c(t)&&!u(t))return null===t.which?e=String.fromCharCode(t.keyCode):0!==t.which&&0!==t.charCode&&(e=String.fromCharCode(t.charCode)),null!=e?(null!=(n=this.delegate)&&n.inputControllerWillPerformTyping(),null!=(i=this.responder)&&i.insertString(e),this.setInputSummary({textAdded:e,didDelete:this.selectionIsExpanded()})):void 0},dragenter:function(t){return t.preventDefault()},dragstart:function(t){var e,n,i;return i=t.target,this.serializeSelectionToDataTransfer(t.dataTransfer),this.draggedRange=null!=(e=this.responder)?e.getSelectedRange():void 0,null!=(n=this.delegate)&&"function"==typeof n.inputControllerDidStartDrag?n.inputControllerDidStartDrag():void 0},dragover:function(t){var e,n,i;return(this.draggedRange||this.canAcceptDataTransfer(t.dataTransfer))&&(t.preventDefault(),e=[t.clientX,t.clientY],e.toString()!==(null!=(n=this.draggingPoint)?n.toString():void 0))?(this.draggingPoint=e,null!=(i=this.delegate)&&"function"==typeof i.inputControllerDidReceiveDragOverPoint?i.inputControllerDidReceiveDragOverPoint(this.draggingPoint):void 0):void 0},dragend:function(){var t;return null!=(t=this.delegate)&&"function"==typeof t.inputControllerDidCancelDrag&&t.inputControllerDidCancelDrag(),this.draggedRange=null,this.draggingPoint=null},drop:function(t){var e,n,i,o,r,s,a,u,c;return t.preventDefault(),i=null!=(r=t.dataTransfer)?r.files:void 0,o=[t.clientX,t.clientY],null!=(s=this.responder)&&s.setLocationRangeFromPoint(o),(null!=i?i.length:void 0)?this.attachFiles(i):this.draggedRange?(null!=(a=this.delegate)&&a.inputControllerWillMoveText(),null!=(u=this.responder)&&u.moveTextFromRange(this.draggedRange),this.draggedRange=null,this.requestRender()):(n=t.dataTransfer.getData("application/x-trix-document"))&&(e=Trix.Document.fromJSONString(n),null!=(c=this.responder)&&c.insertDocument(e),this.requestRender()),this.draggedRange=null,this.draggingPoint=null},cut:function(t){var e;return this.serializeSelectionToDataTransfer(t.clipboardData)&&t.preventDefault(),null!=(e=this.delegate)&&e.inputControllerWillCutText(),this.deleteInDirection("backward"),t.defaultPrevented?this.requestRender():void 0},copy:function(t){return this.serializeSelectionToDataTransfer(t.clipboardData)?t.preventDefault():void 0},paste:function(t){var e,i,r,s,a,u,c,l,p,d,f,g,y,v,b,A,x,T;return s=null!=(u=t.clipboardData)?u:t.testClipboardData,null!=s?(a={paste:s},h(t)?void this.getPastedHTMLUsingHiddenElement(function(t){return function(e){var n,i,o;return a.html=e,null!=(n=t.delegate)&&n.inputControllerWillPasteText(a),null!=(i=t.responder)&&i.insertHTML(e),t.requestRender(),null!=(o=t.delegate)?o.inputControllerDidPaste(a):void 0}}(this)):((r=s.getData("text/html"))?(a.html=r,null!=(c=this.delegate)&&c.inputControllerWillPasteText(a),null!=(d=this.responder)&&d.insertHTML(r),this.requestRender(),null!=(f=this.delegate)&&f.inputControllerDidPaste(a)):(T=s.getData("text/plain"))?(a.string=T,this.setInputSummary({textAdded:T,didDelete:this.selectionIsExpanded()}),null!=(g=this.delegate)&&g.inputControllerWillPasteText(a),null!=(y=this.responder)&&y.insertString(T),this.requestRender(),null!=(v=this.delegate)&&v.inputControllerDidPaste(a)):m.call(s.types,"Files")>=0&&(i=null!=(b=s.items)&&null!=(A=b[0])&&"function"==typeof A.getAsFile?A.getAsFile():void 0)&&(!i.name&&(e=n(i))&&(i.name="pasted-file-"+ ++o+"."+e),a.file=i,null!=(x=this.delegate)&&x.inputControllerWillAttachFiles(),null!=(l=this.responder)&&l.insertFile(i),this.requestRender(),null!=(p=this.delegate)&&p.inputControllerDidPaste(a)),t.preventDefault())):void 0},compositionstart:function(t){var e,n;return this.selectionIsExpanded()||(n=null!=(e=this.responder)?e.insertPlaceholder():void 0,this.setInputSummary({textAdded:n}),this.requestRender()),this.setInputSummary({composing:!0,compositionStart:t.data})},compositionupdate:function(t){var e,n;return(null!=(e=this.responder)?e.selectPlaceholder():void 0)&&null!=(n=this.responder)&&n.forgetPlaceholder(),this.setInputSummary({composing:!0,compositionUpdate:t.data})},compositionend:function(t){var e,n,i,o,r,s,a,u,c;return(null!=(o=this.responder)?o.selectPlaceholder():void 0)&&null!=(r=this.responder)&&r.forgetPlaceholder(),n=this.inputSummary.compositionStart,i=t.data,null!=n&&null!=i&&n!==i?(null!=(s=this.delegate)&&s.inputControllerWillPerformTyping(),null!=(a=this.responder)&&a.insertString(i),u=p(n,i),e=u.added,c=u.removed,this.setInputSummary({textAdded:e,didDelete:Boolean(c)})):void 0},input:function(t){return t.stopPropagation()}},i.prototype.keys={backspace:function(t){var e;return null!=(e=this.delegate)&&e.inputControllerWillPerformTyping(),this.deleteInDirection("backward",t)},"delete":function(t){var e;return null!=(e=this.delegate)&&e.inputControllerWillPerformTyping(),this.deleteInDirection("forward",t)},"return":function(){var t,e;return this.setInputSummary({preferDocument:!0}),null!=(t=this.delegate)&&t.inputControllerWillPerformTyping(),null!=(e=this.responder)?e.insertLineBreak():void 0},tab:function(t){var e,n;return(null!=(e=this.responder)?e.canIncreaseBlockAttributeLevel():void 0)?(null!=(n=this.responder)&&n.increaseBlockAttributeLevel(),this.requestRender(),t.preventDefault()):void 0},left:function(t){var e;return this.selectionIsInCursorTarget()?(t.preventDefault(),null!=(e=this.responder)?e.moveCursorInDirection("backward"):void 0):void 0},right:function(t){var e;return this.selectionIsInCursorTarget()?(t.preventDefault(),null!=(e=this.responder)?e.moveCursorInDirection("forward"):void 0):void 0},control:{d:function(t){var e;return null!=(e=this.delegate)&&e.inputControllerWillPerformTyping(),this.deleteInDirection("forward",t)},h:function(t){var e;return null!=(e=this.delegate)&&e.inputControllerWillPerformTyping(),this.deleteInDirection("backward",t)},o:function(t){var e,n;return t.preventDefault(),null!=(e=this.delegate)&&e.inputControllerWillPerformTyping(),null!=(n=this.responder)&&n.insertString("\n",{updatePosition:!1}),this.requestRender()}},shift:{"return":function(){var t,e;return null!=(t=this.delegate)&&t.inputControllerWillPerformTyping(),null!=(e=this.responder)?e.insertString("\n"):void 0},tab:function(t){var e,n;return(null!=(e=this.responder)?e.canDecreaseBlockAttributeLevel():void 0)?(null!=(n=this.responder)&&n.decreaseBlockAttributeLevel(),this.requestRender(),t.preventDefault()):void 0},left:function(t){return this.selectionIsInCursorTarget()?(t.preventDefault(),this.expandSelectionInDirection("backward")):void 0},right:function(t){return this.selectionIsInCursorTarget()?(t.preventDefault(),this.expandSelectionInDirection("forward")):void 0}},alt:{backspace:function(){var t;return this.setInputSummary({preferDocument:!1}),null!=(t=this.delegate)?t.inputControllerWillPerformTyping():void 0}},meta:{backspace:function(){var t;return this.setInputSummary({preferDocument:!1}),null!=(t=this.delegate)?t.inputControllerWillPerformTyping():void 0}}},i.prototype.handleInput=function(t){var e,n;try{return null!=(e=this.delegate)&&e.inputControllerWillHandleInput(),t.call(this)}finally{null!=(n=this.delegate)&&n.inputControllerDidHandleInput()}},i.prototype.deleteInDirection=function(t,e){var n;return(null!=(n=this.responder)?n.deleteInDirection(t):void 0)===!1?null!=e?e.preventDefault():void 0:this.setInputSummary({didDelete:!0})},i.prototype.serializeSelectionToDataTransfer=function(e){var n,i;if(t(e))return n=null!=(i=this.responder)?i.getSelectedDocument().toSerializableDocument():void 0,e.setData("application/x-trix-document",JSON.stringify(n)),e.setData("text/html",Trix.DocumentView.render(n).innerHTML),e.setData("text/plain",n.toString().replace(/\n$/,"")),!0},i.prototype.canAcceptDataTransfer=function(t){var e,n,i,o,r,s;for(s={},o=null!=(i=null!=t?t.types:void 0)?i:[],e=0,n=o.length;n>e;e++)r=o[e],s[r]=!0;return s.Files||s["application/x-trix-document"]||s["text/html"]||s["text/plain"]},i.prototype.getPastedHTMLUsingHiddenElement=function(t){var e,n,i,o;return i=null!=(n=this.responder)?n.getSelectedRange():void 0,o={position:"absolute",left:window.pageXOffset+"px",top:window.pageYOffset+"px",opacity:0},e=l({style:o,tagName:"div",editable:!0}),document.body.appendChild(e),e.focus(),requestAnimationFrame(function(n){return function(){var o,r;return o=e.innerHTML,document.body.removeChild(e),null!=(r=n.responder)&&r.setSelectedRange(i),t(o)}}(this))},i.proxyMethod("responder?.expandSelectionInDirection"),i.proxyMethod("responder?.selectionIsInCursorTarget"),i.proxyMethod("responder?.selectionIsExpanded"),i}(Trix.BasicObject),n=function(t){var e,n;return null!=(e=t.type)&&null!=(n=e.match(/\/(\w+)$/))?n[1]:void 0},c=function(t){return t.metaKey&&t.altKey&&!t.shiftKey&&94===t.keyCode},u=function(t){return t.metaKey&&t.altKey&&t.shiftKey&&9674===t.keyCode},a=function(t){return/Mac|^iP/.test(navigator.platform)?t.metaKey:t.ctrlKey},h=function(t){var e,n;return(n=null!=(e=t.clipboardData)?e.types:void 0)?m.call(n,"text/html")<0&&(m.call(n,"com.apple.webarchive")>=0||m.call(n,"com.apple.flat-rtfd")>=0):void 0},d={"application/x-trix-feature-detection":"test"},t=function(t){var e,n;if(null!=(null!=t?t.setData:void 0)){for(e in d)if(n=d[e],t.setData(e,n),t.getData(e)!==n)return;return!0}}}.call(this),function(){var t,e,n,i,o,r,s=function(t,e){return function(){return t.apply(e,arguments)}},a=function(t,e){function n(){this.constructor=t}for(var i in e)u.call(e,i)&&(t[i]=e[i]);return n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype,t},u={}.hasOwnProperty;e=Trix.handleEvent,o=Trix.makeElement,r=Trix.tagName,n=Trix.InputController.keyNames,i=Trix.config.lang,t=Trix.config.css.classNames,Trix.AttachmentEditorController=function(u){function c(t,e,n){this.attachmentPiece=t,this.element=e,this.container=n,this.uninstall=s(this.uninstall,this),this.didKeyDownCaption=s(this.didKeyDownCaption,this),this.didChangeCaption=s(this.didChangeCaption,this),this.didClickCaption=s(this.didClickCaption,this),this.didClickRemoveButton=s(this.didClickRemoveButton,this),this.attachment=this.attachmentPiece.attachment,"a"===r(this.element)&&(this.element=this.element.firstChild),this.install()}var l;return a(c,u),l=function(t){return function(){var e;return e=t.apply(this,arguments),e["do"](),null==this.undos&&(this.undos=[]),this.undos.push(e.undo)}},c.prototype.install=function(){return this.makeElementMutable(),this.attachment.isPreviewable()&&this.makeCaptionEditable(),this.addRemoveButton()},c.prototype.makeElementMutable=l(function(){return{"do":function(t){return function(){return t.element.dataset.trixMutable=!0}}(this),undo:function(t){return function(){return delete t.element.dataset.trixMutable}}(this)}}),c.prototype.makeCaptionEditable=l(function(){var t,n;return t=this.element.querySelector("figcaption"),n=null,{"do":function(i){return function(){return n=e("click",{onElement:t,withCallback:i.didClickCaption,inPhase:"capturing"})}}(this),undo:function(){return function(){return n.destroy()}}(this)}}),c.prototype.addRemoveButton=l(function(){var n;return n=o({tagName:"a",textContent:i.remove,className:t.attachment.removeButton,attributes:{href:"#",title:i.remove}}),e("click",{onElement:n,withCallback:this.didClickRemoveButton}),{"do":function(t){return function(){return t.element.appendChild(n)}}(this),undo:function(t){return function(){return t.element.removeChild(n)}}(this)}}),c.prototype.editCaption=l(function(){var n,r,s,a,u;return a=o({tagName:"textarea",className:t.attachment.captionEditor,attributes:{placeholder:i.captionPlaceholder}}),a.value=this.attachmentPiece.getCaption(),u=a.cloneNode(),u.classList.add("trix-autoresize-clone"),n=function(){return u.value=a.value,a.style.height=u.scrollHeight+"px"},e("input",{onElement:a,withCallback:n}),e("keydown",{onElement:a,withCallback:this.didKeyDownCaption}),e("change",{onElement:a,withCallback:this.didChangeCaption}),e("blur",{onElement:a,withCallback:this.uninstall}),s=this.element.querySelector("figcaption"),r=s.cloneNode(),{"do":function(){return s.style.display="none",r.appendChild(a),r.appendChild(u),r.classList.add(t.attachment.editingCaption),s.parentElement.insertBefore(r,s),n(),a.focus()},undo:function(){return r.parentNode.removeChild(r),s.style.display=null}}}),c.prototype.didClickRemoveButton=function(t){var e;return t.preventDefault(),t.stopPropagation(),null!=(e=this.delegate)?e.attachmentEditorDidRequestRemovalOfAttachment(this.attachment):void 0},c.prototype.didClickCaption=function(t){return t.preventDefault(),this.editCaption()},c.prototype.didChangeCaption=function(t){var e,n,i;return e=t.target.value.replace(/\s/g," ").trim(),e?null!=(n=this.delegate)&&"function"==typeof n.attachmentEditorDidRequestUpdatingAttributesForAttachment?n.attachmentEditorDidRequestUpdatingAttributesForAttachment({caption:e},this.attachment):void 0:null!=(i=this.delegate)&&"function"==typeof i.attachmentEditorDidRequestRemovingAttributeForAttachment?i.attachmentEditorDidRequestRemovingAttributeForAttachment("caption",this.attachment):void 0},c.prototype.didKeyDownCaption=function(t){var e;return"return"===n[t.keyCode]?(t.preventDefault(),this.didChangeCaption(t),null!=(e=this.delegate)&&"function"==typeof e.attachmentEditorDidRequestDeselectingAttachment?e.attachmentEditorDidRequestDeselectingAttachment(this.attachment):void 0):void 0},c.prototype.uninstall=function(){for(var t,e;e=this.undos.pop();)e();return null!=(t=this.delegate)?t.didUninstallAttachmentEditor(this):void 0},c}(Trix.BasicObject)}.call(this),function(){var t,e,n,i=function(t,e){function n(){this.constructor=t}for(var i in e)o.call(e,i)&&(t[i]=e[i]);return n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype,t},o={}.hasOwnProperty;n=Trix.makeElement,t=Trix.config.css.classNames,Trix.AttachmentView=function(o){function r(){r.__super__.constructor.apply(this,arguments),this.attachment=this.object,this.attachment.uploadProgressDelegate=this,this.attachmentPiece=this.options.piece}return i(r,o),r.attachmentSelector="[data-trix-attachment]",r.prototype.createContentNodes=function(){return[]},r.prototype.createNodes=function(){var e,i,o,r,s,a,u,c,l,h,p;if(r=n({tagName:"figure",className:this.getClassName()}),this.attachment.hasContent())r.innerHTML=this.attachment.getContent();else for(h=this.createContentNodes(),a=0,c=h.length;c>a;a++)l=h[a],r.appendChild(l);r.appendChild(this.createCaptionElement()),i={trixAttachment:JSON.stringify(this.attachment),trixContentType:this.attachment.getContentType(),trixId:this.attachment.id},e=this.attachmentPiece.getAttributesForAttachment(),e.isEmpty()||(i.trixAttributes=JSON.stringify(e)),this.attachment.isPending()&&(this.progressElement=n({tagName:"progress",attributes:{"class":t.attachment.progressBar,value:this.attachment.getUploadProgress(),max:100},data:{trixMutable:!0,trixStoreKey:this.attachment.getCacheKey("progressElement")}}),r.appendChild(this.progressElement),i.trixSerialize=!1),(s=this.getHref())?(o=n("a",{href:s}),o.appendChild(r)):o=r;for(u in i)p=i[u],o.dataset[u]=p;return o.setAttribute("contenteditable",!1),[this.createCursorTarget(),o,this.createCursorTarget()]},r.prototype.createCaptionElement=function(){var e,i,o,r,s; -return i=n({tagName:"figcaption",className:t.attachment.caption}),(e=this.attachmentPiece.getCaption())?(i.classList.add(t.attachment.captionEdited),i.textContent=e):(o=this.attachment.getFilename())&&(i.textContent=o,(r=this.attachment.getFormattedFilesize())&&(i.appendChild(document.createTextNode(" ")),s=n({tagName:"span",className:t.attachment.size,textContent:r}),i.appendChild(s))),i},r.prototype.getClassName=function(){var e,n;return n=[t.attachment.container,""+t.attachment.typePrefix+this.attachment.getType()],(e=this.attachment.getExtension())&&n.push(e),n.join(" ")},r.prototype.getHref=function(){return e(this.attachment.getContent(),"a")?void 0:this.attachment.getHref()},r.prototype.createCursorTarget=function(){return n({tagName:"span",textContent:Trix.ZERO_WIDTH_SPACE,data:{trixCursorTarget:!0,trixSerialize:!1}})},r.prototype.findProgressElement=function(){var t;return null!=(t=this.findElement())?t.querySelector("progress"):void 0},r.prototype.attachmentDidChangeUploadProgress=function(){var t,e;return e=this.attachment.getUploadProgress(),null!=(t=this.findProgressElement())?t.value=e:void 0},r}(Trix.ObjectView),e=function(t,e){var i;return i=n("div"),i.innerHTML=null!=t?t:"",i.querySelector(e)}}.call(this),function(){var t,e,n,i=function(t,e){function n(){this.constructor=t}for(var i in e)o.call(e,i)&&(t[i]=e[i]);return n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype,t},o={}.hasOwnProperty;t=Trix.defer,e=Trix.makeElement,n=Trix.measureElement,Trix.PreviewableAttachmentView=function(t){function n(){n.__super__.constructor.apply(this,arguments),this.attachment.previewDelegate=this}return i(n,t),n.prototype.createContentNodes=function(){return this.image=e({tagName:"img",attributes:{src:""},data:{trixMutable:!0,trixStoreKey:this.attachment.getCacheKey("imageElement")}}),this.refresh(this.image),[this.image]},n.prototype.refresh=function(t){var e;return null==t&&(t=null!=(e=this.findElement())?e.querySelector("img"):void 0),t?this.updateAttributesForImage(t):void 0},n.prototype.updateAttributesForImage=function(t){var e,n,i,o,r;return o=this.attachment.getURL(),n=this.attachment.getPreloadedURL(),t.src=n||o,n===o?t.removeAttribute("data-trix-serialized-attributes"):(i=JSON.stringify({src:o}),t.setAttribute("data-trix-serialized-attributes",i)),r=this.attachment.getWidth(),e=this.attachment.getHeight(),null!=r&&(t.width=r),null!=e?t.height=e:void 0},n.prototype.attachmentDidPreload=function(){return this.refresh(this.image),this.refresh()},n}(Trix.AttachmentView)}.call(this),function(){var t,e,n=function(t,e){function n(){this.constructor=t}for(var o in e)i.call(e,o)&&(t[o]=e[o]);return n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype,t},i={}.hasOwnProperty;e=Trix.makeElement,t=Trix.findInnerElement,Trix.PieceView=function(i){function o(){o.__super__.constructor.apply(this,arguments),this.piece=this.object,this.attributes=this.piece.getAttributes(),this.textConfig=this.options.textConfig,this.piece.attachment?this.attachment=this.piece.attachment:this.string=this.piece.toString()}var r;return n(o,i),o.prototype.createNodes=function(){var e,n,i,o,r,s;if(s=this.attachment?this.createAttachmentNodes():this.createStringNodes(),e=this.createElement()){for(i=t(e),n=0,o=s.length;o>n;n++)r=s[n],i.appendChild(r);s=[e]}return s},o.prototype.createAttachmentNodes=function(){var t,e;return t=this.attachment.isPreviewable()?Trix.PreviewableAttachmentView:Trix.AttachmentView,e=this.createChildView(t,this.piece.attachment,{piece:this.piece}),e.getNodes()},o.prototype.createStringNodes=function(){var t,n,i,o,s,a,u,c,l,h;if(null!=(c=this.textConfig)?c.plaintext:void 0)return[document.createTextNode(this.string)];for(u=[],l=this.string.split("\n"),i=n=0,o=l.length;o>n;i=++n)h=l[i],i>0&&(t=e("br"),u.push(t)),(s=h.length)&&(a=document.createTextNode(r(h)),u.push(a));return u},o.prototype.createElement=function(){var t,n,i,o,r,s,a,u;for(o in this.attributes)if((t=Trix.config.textAttributes[o])&&(t.tagName&&(r=e(t.tagName),i?(i.appendChild(r),i=r):n=i=r),t.style))if(a){s=t.style;for(o in s)u=s[o],a[o]=u}else a=t.style;if(a){null==n&&(n=e("span"));for(o in a)u=a[o],n.style[o]=u}return n},o.prototype.createContainerElement=function(){var t,n,i,o,r;o=this.attributes;for(i in o)if(r=o[i],(n=Trix.config.textAttributes[i])&&n.groupTagName)return t={},t[i]=r,e(n.groupTagName,t)},r=function(t){var e;return e=Trix.NON_BREAKING_SPACE,t.replace(/\ $/,e).replace(/(\S)\ {3}(\S)/g,"$1 "+e+" $2").replace(/\ {2}/g,e+" ").replace(/\ {2}/g," "+e).replace(/^\ /,e)},o}(Trix.ObjectView)}.call(this),function(){var t=function(t,n){function i(){this.constructor=t}for(var o in n)e.call(n,o)&&(t[o]=n[o]);return i.prototype=n.prototype,t.prototype=new i,t.__super__=n.prototype,t},e={}.hasOwnProperty;Trix.TextView=function(e){function n(){n.__super__.constructor.apply(this,arguments),this.text=this.object,this.textConfig=this.options.textConfig}return t(n,e),n.prototype.createNodes=function(){var t,e,n,i,o,r,s,a;for(n=[],s=function(){var t,e,n,i;for(n=this.text.getPieces(),i=[],t=0,e=n.length;e>t;t++)r=n[t],r.hasAttribute("blockBreak")||i.push(r);return i}.call(this),o=Trix.ObjectGroup.groupObjects(s),t=0,e=o.length;e>t;t++)i=o[t],a=this.findOrCreateCachedChildView(Trix.PieceView,i,{textConfig:this.textConfig}),n.push.apply(n,a.getNodes());return n},n}(Trix.ObjectView)}.call(this),function(){var t,e=function(t,e){function i(){this.constructor=t}for(var o in e)n.call(e,o)&&(t[o]=e[o]);return i.prototype=e.prototype,t.prototype=new i,t.__super__=e.prototype,t},n={}.hasOwnProperty;t=Trix.makeElement,Trix.BlockView=function(n){function i(){i.__super__.constructor.apply(this,arguments),this.block=this.object,this.attributes=this.block.getAttributes()}return e(i,n),i.prototype.createNodes=function(){var e,n,i,o,r,s,a,u,c;if(e=document.createComment("block"),s=[e],this.block.isEmpty()?s.push(t("br")):(u=null!=(a=Trix.config.blockAttributes[this.block.getLastAttribute()])?a.text:void 0,c=this.findOrCreateCachedChildView(Trix.TextView,this.block.text,{textConfig:u}),s.push.apply(s,c.getNodes()),this.shouldAddExtraNewlineElement()&&s.push(t("br"))),this.attributes.length)return s;for(n=t(Trix.config.blockAttributes["default"].tagName),i=0,o=s.length;o>i;i++)r=s[i],n.appendChild(r);return[n]},i.prototype.createContainerElement=function(e){var n,i;return n=this.attributes[e],i=Trix.config.blockAttributes[n],t(i.tagName)},i.prototype.shouldAddExtraNewlineElement=function(){return/\n\n$/.test(this.block.toString())},i}(Trix.ObjectView)}.call(this),function(){var t,e,n=function(t,e){function n(){this.constructor=t}for(var o in e)i.call(e,o)&&(t[o]=e[o]);return n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype,t},i={}.hasOwnProperty;t=Trix.defer,e=Trix.makeElement,Trix.DocumentView=function(i){function o(){o.__super__.constructor.apply(this,arguments),this.element=this.options.element,this.elementStore=new Trix.ElementStore,this.setDocument(this.object)}var r,s,a;return n(o,i),o.render=function(t){var n,i;return n=e("div"),i=new this(t,{element:n}),i.render(),i.sync(),n},o.prototype.setDocument=function(t){return t.isEqualTo(this.document)?void 0:this.document=this.object=t},o.prototype.render=function(){var t,n,i,o,r,s,a;if(this.childViews=[],this.shadowElement=e("div"),!this.document.isEmpty()){for(r=Trix.ObjectGroup.groupObjects(this.document.getBlocks(),{asTree:!0}),s=[],t=0,n=r.length;n>t;t++)o=r[t],a=this.findOrCreateCachedChildView(Trix.BlockView,o),s.push(function(){var t,e,n,o;for(n=a.getNodes(),o=[],t=0,e=n.length;e>t;t++)i=n[t],o.push(this.shadowElement.appendChild(i));return o}.call(this));return s}},o.prototype.isSynced=function(){return r(this.shadowElement,this.element)},o.prototype.sync=function(){var t;for(t=this.createDocumentFragmentForSync();this.element.lastChild;)this.element.removeChild(this.element.lastChild);return this.element.appendChild(t),this.didSync()},o.prototype.didSync=function(){return this.elementStore.reset(s(this.element)),t(function(t){return function(){return t.garbageCollectCachedViews()}}(this))},o.prototype.createDocumentFragmentForSync=function(){var t,e,n,i,o,r,a,u,c,l;for(e=document.createDocumentFragment(),u=this.shadowElement.childNodes,n=0,o=u.length;o>n;n++)a=u[n],e.appendChild(a.cloneNode(!0));for(c=s(e),i=0,r=c.length;r>i;i++)t=c[i],(l=this.elementStore.remove(t))&&t.parentNode.replaceChild(l,t);return e},s=function(t){return t.querySelectorAll("[data-trix-store-key]")},r=function(t,e){return a(t.innerHTML)===a(e.innerHTML)},a=function(t){return t.replace(/ /g," ")},o}(Trix.ObjectView)}.call(this),function(){var t,e,n,i,o,r,s=function(t,e){return function(){return t.apply(e,arguments)}},a=function(t,e){function n(){this.constructor=t}for(var i in e)u.call(e,i)&&(t[i]=e[i]);return n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype,t},u={}.hasOwnProperty;i=Trix.handleEvent,r=Trix.tagName,n=Trix.findClosestElementFromNode,o=Trix.innerElementIsActive,e=Trix.defer,t=Trix.AttachmentView.attachmentSelector,Trix.CompositionController=function(n){function r(e,n){this.element=e,this.composition=n,this.didClickAttachment=s(this.didClickAttachment,this),this.didBlur=s(this.didBlur,this),this.didFocus=s(this.didFocus,this),this.documentView=new Trix.DocumentView(this.composition.document,{element:this.element}),i("focus",{onElement:this.element,withCallback:this.didFocus}),i("blur",{onElement:this.element,withCallback:this.didBlur}),i("click",{onElement:this.element,matchingSelector:"a[contenteditable=false]",preventDefault:!0}),i("mousedown",{onElement:this.element,matchingSelector:t,withCallback:this.didClickAttachment}),i("click",{onElement:this.element,matchingSelector:"a"+t,preventDefault:!0})}return a(r,n),r.prototype.didFocus=function(){var t;return this.focused?void 0:(this.focused=!0,null!=(t=this.delegate)&&"function"==typeof t.compositionControllerDidFocus?t.compositionControllerDidFocus():void 0)},r.prototype.didBlur=function(){return e(function(t){return function(){var e;return o(t.element)?void 0:(t.focused=null,null!=(e=t.delegate)&&"function"==typeof e.compositionControllerDidBlur?e.compositionControllerDidBlur():void 0)}}(this))},r.prototype.didClickAttachment=function(t,e){var n,i;return n=this.findAttachmentForElement(e),null!=(i=this.delegate)&&"function"==typeof i.compositionControllerDidSelectAttachment?i.compositionControllerDidSelectAttachment(n):void 0},r.prototype.render=function(){var t,e,n;return this.revision!==this.composition.revision&&(this.documentView.setDocument(this.composition.document),this.documentView.render(),this.revision=this.composition.revision),this.documentView.isSynced()||(null!=(t=this.delegate)&&"function"==typeof t.compositionControllerWillSyncDocumentView&&t.compositionControllerWillSyncDocumentView(),this.documentView.sync(),this.reinstallAttachmentEditor(),null!=(e=this.delegate)&&"function"==typeof e.compositionControllerDidSyncDocumentView&&e.compositionControllerDidSyncDocumentView()),null!=(n=this.delegate)&&"function"==typeof n.compositionControllerDidRender?n.compositionControllerDidRender():void 0},r.prototype.rerenderViewForObject=function(t){return this.documentView.invalidateViewForObject(t),this.render()},r.prototype.isViewCachingEnabled=function(){return this.documentView.isViewCachingEnabled()},r.prototype.enableViewCaching=function(){return this.documentView.enableViewCaching()},r.prototype.disableViewCaching=function(){return this.documentView.disableViewCaching()},r.prototype.refreshViewCache=function(){return this.documentView.garbageCollectCachedViews()},r.prototype.installAttachmentEditorForAttachment=function(t){var e,n,i;if((null!=(i=this.attachmentEditor)?i.attachment:void 0)!==t&&(n=this.documentView.findElementForObject(t)))return this.uninstallAttachmentEditor(),e=this.composition.document.getAttachmentPieceForAttachment(t),this.attachmentEditor=new Trix.AttachmentEditorController(e,n,this.element),this.attachmentEditor.delegate=this},r.prototype.uninstallAttachmentEditor=function(){var t;return null!=(t=this.attachmentEditor)?t.uninstall():void 0},r.prototype.reinstallAttachmentEditor=function(){var t;return this.attachmentEditor?(t=this.attachmentEditor.attachment,this.uninstallAttachmentEditor(),this.installAttachmentEditorForAttachment(t)):void 0},r.prototype.editAttachmentCaption=function(){var t;return null!=(t=this.attachmentEditor)?t.editCaption():void 0},r.prototype.didUninstallAttachmentEditor=function(){return this.attachmentEditor=null,this.render()},r.prototype.attachmentEditorDidRequestUpdatingAttributesForAttachment=function(t,e){var n;return null!=(n=this.delegate)&&"function"==typeof n.compositionControllerWillUpdateAttachment&&n.compositionControllerWillUpdateAttachment(e),this.composition.updateAttributesForAttachment(t,e)},r.prototype.attachmentEditorDidRequestRemovingAttributeForAttachment=function(t,e){var n;return null!=(n=this.delegate)&&"function"==typeof n.compositionControllerWillUpdateAttachment&&n.compositionControllerWillUpdateAttachment(e),this.composition.removeAttributeForAttachment(t,e)},r.prototype.attachmentEditorDidRequestRemovalOfAttachment=function(t){var e;return null!=(e=this.delegate)&&"function"==typeof e.compositionControllerDidRequestRemovalOfAttachment?e.compositionControllerDidRequestRemovalOfAttachment(t):void 0},r.prototype.attachmentEditorDidRequestDeselectingAttachment=function(t){var e;return null!=(e=this.delegate)&&"function"==typeof e.compositionControllerDidRequestDeselectingAttachment?e.compositionControllerDidRequestDeselectingAttachment(t):void 0},r.prototype.findAttachmentForElement=function(t){return this.composition.document.getAttachmentById(parseInt(t.dataset.trixId,10))},r}(Trix.BasicObject)}.call(this),function(){var t,e,n,i=function(t,e){return function(){return t.apply(e,arguments)}},o=function(t,e){function n(){this.constructor=t}for(var i in e)r.call(e,i)&&(t[i]=e[i]);return n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype,t},r={}.hasOwnProperty;e=Trix.handleEvent,n=Trix.triggerEvent,t=Trix.findClosestElementFromNode,Trix.ToolbarController=function(r){function s(t){this.element=t,this.didKeyDownDialogInput=i(this.didKeyDownDialogInput,this),this.didClickDialogButton=i(this.didClickDialogButton,this),this.didClickAttributeButton=i(this.didClickAttributeButton,this),this.didClickActionButton=i(this.didClickActionButton,this),this.attributes={},this.actions={},this.resetDialogInputs(),e("mousedown",{onElement:this.element,matchingSelector:a,withCallback:this.didClickActionButton}),e("mousedown",{onElement:this.element,matchingSelector:c,withCallback:this.didClickAttributeButton}),e("click",{onElement:this.element,matchingSelector:y,preventDefault:!0}),e("click",{onElement:this.element,matchingSelector:l,withCallback:this.didClickDialogButton}),e("keydown",{onElement:this.element,matchingSelector:h,withCallback:this.didKeyDownDialogInput})}var a,u,c,l,h,p,d,f,g,m,y;return o(s,r),a="button[data-action]",c="button[data-attribute]",y=[a,c].join(", "),p=".dialog[data-dialog]",u=p+".active",l=p+" input[data-method]",h=p+" input[type=text], "+p+" input[type=url]",s.prototype.didClickActionButton=function(t,e){var n,i,o;return null!=(i=this.delegate)&&i.toolbarDidClickButton(),t.preventDefault(),n=d(e),this.getDialog(n)?this.toggleDialog(n):null!=(o=this.delegate)?o.toolbarDidInvokeAction(n):void 0},s.prototype.didClickAttributeButton=function(t,e){var n,i,o;return null!=(i=this.delegate)&&i.toolbarDidClickButton(),t.preventDefault(),n=f(e),this.getDialog(n)?this.toggleDialog(n):null!=(o=this.delegate)&&o.toolbarDidToggleAttribute(n),this.refreshAttributeButtons()},s.prototype.didClickDialogButton=function(e,n){var i,o;return i=t(n,{matchingSelector:p}),o=n.getAttribute("data-method"),this[o].call(this,i)},s.prototype.didKeyDownDialogInput=function(t,e){var n,i;return 13===t.keyCode&&(t.preventDefault(),n=e.getAttribute("name"),i=this.getDialog(n),this.setAttribute(i)),27===t.keyCode?(t.preventDefault(),this.hideDialog()):void 0},s.prototype.updateActions=function(t){return this.actions=t,this.refreshActionButtons()},s.prototype.refreshActionButtons=function(){return this.eachActionButton(function(t){return function(e,n){return e.disabled=t.actions[n]===!1}}(this))},s.prototype.eachActionButton=function(t){var e,n,i,o,r;for(o=this.element.querySelectorAll(a),r=[],n=0,i=o.length;i>n;n++)e=o[n],r.push(t(e,d(e)));return r},s.prototype.updateAttributes=function(t){return this.attributes=t,this.refreshAttributeButtons()},s.prototype.refreshAttributeButtons=function(){return this.eachAttributeButton(function(t){return function(e,n){return t.attributes[n]||t.dialogIsVisible(n)?e.classList.add("active"):e.classList.remove("active")}}(this))},s.prototype.eachAttributeButton=function(t){var e,n,i,o,r;for(o=this.element.querySelectorAll(c),r=[],n=0,i=o.length;i>n;n++)e=o[n],r.push(t(e,f(e)));return r},s.prototype.applyKeyboardCommand=function(t){var e,i,o,r,s,a,u;for(s=JSON.stringify(t.sort()),u=this.element.querySelectorAll("[data-key]"),r=0,a=u.length;a>r;r++)if(e=u[r],o=e.getAttribute("data-key").split("+"),i=JSON.stringify(o.sort()),i===s)return n("mousedown",{onElement:e}),!0;return!1},s.prototype.dialogIsVisible=function(t){var e;return(e=this.getDialog(t))?e.classList.contains("active"):void 0},s.prototype.toggleDialog=function(t){return this.dialogIsVisible(t)?this.hideDialog():this.showDialog(t)},s.prototype.showDialog=function(t){var e,n,i,o,r,s;return this.hideDialog(),null!=(o=this.delegate)&&o.toolbarWillShowDialog(),n=this.getDialog(t),n.classList.add("active"),(e=f(n))&&(i=m(n,t))&&(i.removeAttribute("disabled"),i.value=null!=(r=this.attributes[e])?r:"",i.select()),null!=(s=this.delegate)?s.toolbarDidShowDialog(t):void 0},s.prototype.setAttribute=function(t){var e,n,i;return e=f(t),n=m(t,e),n.willValidate&&!n.checkValidity()?(n.classList.add("validate"),n.focus()):(null!=(i=this.delegate)&&i.toolbarDidUpdateAttribute(e,n.value),this.hideDialog())},s.prototype.removeAttribute=function(t){var e,n;return e=f(t),null!=(n=this.delegate)&&n.toolbarDidRemoveAttribute(e),this.hideDialog()},s.prototype.hideDialog=function(){var t,e;return(t=this.element.querySelector(u))?(t.classList.remove("active"),this.resetDialogInputs(),null!=(e=this.delegate)?e.toolbarDidHideDialog(g(t)):void 0):void 0},s.prototype.resetDialogInputs=function(){var t,e,n,i,o;for(i=this.element.querySelectorAll(h),o=[],t=0,n=i.length;n>t;t++)e=i[t],e.setAttribute("disabled","disabled"),o.push(e.classList.remove("validate"));return o},s.prototype.getDialog=function(t){return this.element.querySelector(".dialog[data-dialog="+t+"]")},m=function(t,e){return null==e&&(e=f(t)),t.querySelector("input[name='"+e+"']")},d=function(t){return t.getAttribute("data-action")},f=function(t){return t.getAttribute("data-attribute")},g=function(t){return t.getAttribute("data-dialog")},s}(Trix.BasicObject)}.call(this),function(){var t=function(t,n){function i(){this.constructor=t}for(var o in n)e.call(n,o)&&(t[o]=n[o]);return i.prototype=n.prototype,t.prototype=new i,t.__super__=n.prototype,t},e={}.hasOwnProperty;Trix.ImagePreloadOperation=function(e){function n(t){this.url=t}return t(n,e),n.prototype.perform=function(t){var e;return e=new Image,e.onload=function(n){return function(){return e.width=n.width=e.naturalWidth,e.height=n.height=e.naturalHeight,t(!0,e)}}(this),e.onerror=function(){return t(!1)},e.src=this.url},n}(Trix.Operation)}.call(this),function(){var t=function(t,e){return function(){return t.apply(e,arguments)}},e=function(t,e){function i(){this.constructor=t}for(var o in e)n.call(e,o)&&(t[o]=e[o]);return i.prototype=e.prototype,t.prototype=new i,t.__super__=e.prototype,t},n={}.hasOwnProperty;Trix.Attachment=function(n){function i(e){null==e&&(e={}),this.releaseFile=t(this.releaseFile,this),i.__super__.constructor.apply(this,arguments),this.attributes=Trix.Hash.box(e),this.didChangeAttributes()}return e(i,n),i.previewablePattern=/^image(\/(gif|png|jpe?g)|$)/,i.attachmentForFile=function(t){var e,n;return n=this.attributesForFile(t),e=new this(n),e.setFile(t),e},i.attributesForFile=function(t){return new Trix.Hash({filename:t.name,filesize:t.size,contentType:t.type})},i.fromJSON=function(t){return new this(t)},i.prototype.getAttribute=function(t){return this.attributes.get(t)},i.prototype.hasAttribute=function(t){return this.attributes.has(t)},i.prototype.getAttributes=function(){return this.attributes.toObject()},i.prototype.setAttributes=function(t){var e,n;return null==t&&(t={}),e=this.attributes.merge(t),this.attributes.isEqualTo(e)?void 0:(this.attributes=e,this.didChangeAttributes(),null!=(n=this.delegate)&&"function"==typeof n.attachmentDidChangeAttributes?n.attachmentDidChangeAttributes(this):void 0)},i.prototype.didChangeAttributes=function(){return this.isPreviewable()?this.preloadURL():void 0},i.prototype.isPending=function(){return null!=this.file&&!(this.getURL()||this.getHref())},i.prototype.isPreviewable=function(){return this.attributes.has("previewable")?this.attributes.get("previewable"):this.constructor.previewablePattern.test(this.getContentType())},i.prototype.getType=function(){return this.hasContent()?"content":this.isPreviewable()?"preview":"file"},i.prototype.getURL=function(){return this.attributes.get("url")},i.prototype.getHref=function(){return this.attributes.get("href")},i.prototype.getFilename=function(){var t;return null!=(t=this.attributes.get("filename"))?t:""},i.prototype.getFilesize=function(){return this.attributes.get("filesize")},i.prototype.getFormattedFilesize=function(){var t;return t=this.attributes.get("filesize"),"number"==typeof t?Trix.config.fileSize.formatter(t):""},i.prototype.getExtension=function(){var t;return null!=(t=this.getFilename().match(/\.(\w+)$/))?t[1].toLowerCase():void 0},i.prototype.getContentType=function(){return this.attributes.get("contentType")},i.prototype.hasContent=function(){return this.attributes.has("content")},i.prototype.getContent=function(){return this.attributes.get("content")},i.prototype.getWidth=function(){return this.attributes.get("width")},i.prototype.getHeight=function(){return this.attributes.get("height")},i.prototype.getFile=function(){return this.file},i.prototype.setFile=function(t){return this.file=t,this.isPreviewable()?this.preloadFile():void 0},i.prototype.releaseFile=function(){return this.releasePreloadedFile(),this.file=null},i.prototype.getUploadProgress=function(){var t;return null!=(t=this.uploadProgress)?t:0},i.prototype.setUploadProgress=function(t){var e;return this.uploadProgress!==t?(this.uploadProgress=t,null!=(e=this.uploadProgressDelegate)&&"function"==typeof e.attachmentDidChangeUploadProgress?e.attachmentDidChangeUploadProgress(this):void 0):void 0},i.prototype.toJSON=function(){return this.getAttributes()},i.prototype.getCacheKey=function(t){var e;return e=[i.__super__.getCacheKey.apply(this,arguments),this.attributes.getCacheKey(),this.getPreloadedURL()],t&&e.unshift(t),e.join("/")},i.prototype.getPreloadedURL=function(){return this.preloadedURL},i.prototype.preloadURL=function(){return this.preload(this.getURL(),this.releaseFile)},i.prototype.preloadFile=function(){return this.file?(this.fileObjectURL=URL.createObjectURL(this.file),this.preload(this.fileObjectURL)):void 0},i.prototype.releasePreloadedFile=function(){return this.fileObjectURL?(URL.revokeObjectURL(this.fileObjectURL),this.fileObjectURL=null):void 0},i.prototype.preload=function(t,e){var n;return t&&t!==this.preloadedURL?(null==this.preloadedURL&&(this.preloadedURL=t),n=new Trix.ImagePreloadOperation(t),n.then(function(n){return function(i){var o,r,s;return s=i.width,o=i.height,n.preloadedURL=t,n.setAttributes({width:s,height:o}),null!=(r=n.previewDelegate)&&"function"==typeof r.attachmentDidPreload&&r.attachmentDidPreload(),"function"==typeof e?e():void 0}}(this))):void 0},i}(Trix.Object)}.call(this),function(){var t=function(t,n){function i(){this.constructor=t}for(var o in n)e.call(n,o)&&(t[o]=n[o]);return i.prototype=n.prototype,t.prototype=new i,t.__super__=n.prototype,t},e={}.hasOwnProperty;Trix.Piece=function(e){function n(t,e){null==e&&(e={}),n.__super__.constructor.apply(this,arguments),this.attributes=Trix.Hash.box(e)}return t(n,e),n.types={},n.registerType=function(t,e){return e.type=t,this.types[t]=e},n.fromJSON=function(t){var e;return(e=this.types[t.type])?e.fromJSON(t):void 0},n.prototype.copyWithAttributes=function(t){return new this.constructor(this.getValue(),t)},n.prototype.copyWithAdditionalAttributes=function(t){return this.copyWithAttributes(this.attributes.merge(t))},n.prototype.copyWithoutAttribute=function(t){return this.copyWithAttributes(this.attributes.remove(t))},n.prototype.copy=function(){return this.copyWithAttributes(this.attributes)},n.prototype.getAttribute=function(t){return this.attributes.get(t)},n.prototype.getAttributesHash=function(){return this.attributes},n.prototype.getAttributes=function(){return this.attributes.toObject()},n.prototype.getCommonAttributes=function(){var t,e,n;return(n=pieceList.getPieceAtIndex(0))?(t=n.attributes,e=t.getKeys(),pieceList.eachPiece(function(n){return e=t.getKeysCommonToHash(n.attributes),t=t.slice(e)}),t.toObject()):{}},n.prototype.hasAttribute=function(t){return this.attributes.has(t)},n.prototype.hasSameStringValueAsPiece=function(t){return null!=t&&this.toString()===t.toString()},n.prototype.hasSameAttributesAsPiece=function(t){return null!=t&&(this.attributes===t.attributes||this.attributes.isEqualTo(t.attributes))},n.prototype.isBlockBreak=function(){return!1},n.prototype.isEqualTo=function(t){return n.__super__.isEqualTo.apply(this,arguments)||this.hasSameConstructorAs(t)&&this.hasSameStringValueAsPiece(t)&&this.hasSameAttributesAsPiece(t)},n.prototype.isEmpty=function(){return 0===this.length},n.prototype.isSerializable=function(){return!0},n.prototype.toJSON=function(){return{type:this.constructor.type,attributes:this.getAttributes()}},n.prototype.contentsForInspection=function(){return{type:this.constructor.type,attributes:this.attributes.inspect()}},n.prototype.canBeGrouped=function(){return this.hasAttribute("href")},n.prototype.canBeGroupedWith=function(t){return this.getAttribute("href")===t.getAttribute("href")},n.prototype.getLength=function(){return this.length},n.prototype.canBeConsolidatedWith=function(){return!1},n}(Trix.Object)}.call(this),function(){var t=function(t,n){function i(){this.constructor=t}for(var o in n)e.call(n,o)&&(t[o]=n[o]);return i.prototype=n.prototype,t.prototype=new i,t.__super__=n.prototype,t},e={}.hasOwnProperty;Trix.Piece.registerType("attachment",Trix.AttachmentPiece=function(e){function n(t){this.attachment=t,n.__super__.constructor.apply(this,arguments),this.length=1,this.ensureAttachmentExclusivelyHasAttribute("href")}return t(n,e),n.fromJSON=function(t){return new this(Trix.Attachment.fromJSON(t.attachment),t.attributes)},n.prototype.ensureAttachmentExclusivelyHasAttribute=function(t){return this.hasAttribute(t)&&this.attachment.hasAttribute(t)?this.attributes=this.attributes.remove(t):void 0},n.prototype.getValue=function(){return this.attachment},n.prototype.isSerializable=function(){return!this.attachment.isPending()},n.prototype.getCaption=function(){var t;return null!=(t=this.attributes.get("caption"))?t:""},n.prototype.getAttributesForAttachment=function(){return this.attributes.slice(["caption"])},n.prototype.canBeGrouped=function(){return n.__super__.canBeGrouped.apply(this,arguments)&&!this.attachment.hasAttribute("href")},n.prototype.toString=function(){return Trix.OBJECT_REPLACEMENT_CHARACTER},n.prototype.toJSON=function(){var t;return t=n.__super__.toJSON.apply(this,arguments),t.attachment=this.attachment,t},n.prototype.getCacheKey=function(){return[n.__super__.getCacheKey.apply(this,arguments),this.attachment.getCacheKey()].join("/")},n.prototype.toConsole=function(){return JSON.stringify(this.toString())},n}(Trix.Piece))}.call(this),function(){var t=function(t,n){function i(){this.constructor=t}for(var o in n)e.call(n,o)&&(t[o]=n[o]);return i.prototype=n.prototype,t.prototype=new i,t.__super__=n.prototype,t},e={}.hasOwnProperty;Trix.Piece.registerType("string",Trix.StringPiece=function(e){function n(t){n.__super__.constructor.apply(this,arguments),this.string=t,this.length=this.string.length}return t(n,e),n.fromJSON=function(t){return new this(t.string,t.attributes)},n.prototype.getValue=function(){return this.string},n.prototype.toString=function(){return this.string.toString()},n.prototype.isBlockBreak=function(){return"\n"===this.toString()&&this.getAttribute("blockBreak")===!0},n.prototype.toJSON=function(){var t;return t=n.__super__.toJSON.apply(this,arguments),t.string=this.string,t},n.prototype.canBeConsolidatedWith=function(t){return null!=t&&this.hasSameConstructorAs(t)&&this.hasSameAttributesAsPiece(t)},n.prototype.consolidateWith=function(t){return new this.constructor(this.toString()+t.toString(),this.attributes)},n.prototype.splitAtOffset=function(t){var e,n;return 0===t?(e=null,n=this):t===this.length?(e=this,n=null):(e=new this.constructor(this.string.slice(0,t),this.attributes),n=new this.constructor(this.string.slice(t),this.attributes)),[e,n]},n.prototype.toConsole=function(){var t;return t=this.string,t.length>15&&(t=t.slice(0,14)+"\u2026"),JSON.stringify(t.toString())},n}(Trix.Piece))}.call(this),function(){var t=function(t,n){function i(){this.constructor=t}for(var o in n)e.call(n,o)&&(t[o]=n[o]);return i.prototype=n.prototype,t.prototype=new i,t.__super__=n.prototype,t},e={}.hasOwnProperty,n=[].slice;Trix.SplittableList=function(e){function i(t){null==t&&(t=[]),i.__super__.constructor.apply(this,arguments),this.objects=t.slice(0),this.length=this.objects.length}var o,r,s;return t(i,e),i.box=function(t){return t instanceof this?t:new this(t)},i.prototype.eachObject=function(t){var e,n,i,o,r,s;for(r=this.objects,s=[],n=e=0,i=r.length;i>e;n=++e)o=r[n],s.push(t(o,n));return s},i.prototype.insertObjectAtIndex=function(t,e){var n;return n=this.objects.slice(0),n.splice(e,0,t),new this.constructor(n)},i.prototype.insertSplittableListAtIndex=function(t,e){var i;return i=this.objects.slice(0),i.splice.apply(i,[e,0].concat(n.call(t.objects))),new this.constructor(i)},i.prototype.insertSplittableListAtPosition=function(t,e){var n,i,o;return o=this.splitObjectAtPosition(e),i=o[0],n=o[1],new this.constructor(i).insertSplittableListAtIndex(t,n)},i.prototype.editObjectAtIndex=function(t,e){return this.replaceObjectAtIndex(e(this.objects[t]),t)},i.prototype.replaceObjectAtIndex=function(t,e){var n;return n=this.objects.slice(0),n.splice(e,1,t),new this.constructor(n)},i.prototype.removeObjectAtIndex=function(t){var e;return e=this.objects.slice(0),e.splice(t,1),new this.constructor(e)},i.prototype.getObjectAtIndex=function(t){return this.objects[t]},i.prototype.getSplittableListInRange=function(t){var e,n,i,o;return i=this.splitObjectsAtRange(t),n=i[0],e=i[1],o=i[2],new this.constructor(n.slice(e,o+1))},i.prototype.selectSplittableList=function(t){var e,n;return n=function(){var n,i,o,r;for(o=this.objects,r=[],n=0,i=o.length;i>n;n++)e=o[n],t(e)&&r.push(e);return r}.call(this),new this.constructor(n)},i.prototype.removeObjectsInRange=function(t){var e,n,i,o;return i=this.splitObjectsAtRange(t),n=i[0],e=i[1],o=i[2],n.splice(e,o-e+1),new this.constructor(n)},i.prototype.transformObjectsInRange=function(t,e){var n,i,o,r,s,a,u;return s=this.splitObjectsAtRange(t),r=s[0],i=s[1],a=s[2],u=function(){var t,s,u;for(u=[],n=t=0,s=r.length;s>t;n=++t)o=r[n],u.push(n>=i&&a>=n?e(o):o);return u}(),new this.constructor(u)},i.prototype.splitObjectsAtRange=function(t){var e,n,i,r,a,u;return r=this.splitObjectAtPosition(s(t)),n=r[0],e=r[1],i=r[2],a=new this.constructor(n).splitObjectAtPosition(o(t)+i),n=a[0],u=a[1],[n,e,u-1]},i.prototype.getObjectAtPosition=function(t){var e,n,i;return i=this.findIndexAndOffsetAtPosition(t),e=i.index,n=i.offset,this.objects[e]},i.prototype.splitObjectAtPosition=function(t){var e,n,i,o,r,s,a,u,c,l;return s=this.findIndexAndOffsetAtPosition(t),e=s.index,r=s.offset,o=this.objects.slice(0),null!=e?0===r?(c=e,l=0):(i=this.getObjectAtIndex(e),a=i.splitAtOffset(r),n=a[0],u=a[1],o.splice(e,1,n,u),c=e+1,l=n.getLength()-r):(c=o.length,l=0),[o,c,l]},i.prototype.consolidate=function(){var t,e,n,i,o,r;for(i=[],o=this.objects[0],r=this.objects.slice(1),t=0,e=r.length;e>t;t++)n=r[t],("function"==typeof o.canBeConsolidatedWith?o.canBeConsolidatedWith(n):void 0)?o=o.consolidateWith(n):(i.push(o),o=n);return null!=o&&i.push(o),new this.constructor(i)},i.prototype.consolidateFromIndexToIndex=function(t,e){var i,o,r;return o=this.objects.slice(0),r=o.slice(t,e+1),i=new this.constructor(r).consolidate().toArray(),o.splice.apply(o,[t,r.length].concat(n.call(i))),new this.constructor(o) -},i.prototype.findIndexAndOffsetAtPosition=function(t){var e,n,i,o,r,s,a;for(e=0,a=this.objects,i=n=0,o=a.length;o>n;i=++n){if(s=a[i],r=e+s.getLength(),t>=e&&r>t)return{index:i,offset:t-e};e=r}return{index:null,offset:null}},i.prototype.findPositionAtIndexAndOffset=function(t,e){var n,i,o,r,s,a;for(s=0,a=this.objects,n=i=0,o=a.length;o>i;n=++i)if(r=a[n],t>n)s+=r.getLength();else if(n===t){s+=e;break}return s},i.prototype.getEndPosition=function(){var t,e;return null!=this.endPosition?this.endPosition:this.endPosition=function(){var n,i,o;for(e=0,o=this.objects,n=0,i=o.length;i>n;n++)t=o[n],e+=t.getLength();return e}.call(this)},i.prototype.toString=function(){return this.objects.join("")},i.prototype.toArray=function(){return this.objects.slice(0)},i.prototype.toJSON=function(){return this.toArray()},i.prototype.isEqualTo=function(t){return i.__super__.isEqualTo.apply(this,arguments)||r(this.objects,null!=t?t.objects:void 0)},r=function(t,e){var n,i,o,r,s;if(null==e&&(e=[]),t.length!==e.length)return!1;for(s=!0,i=n=0,o=t.length;o>n;i=++n)r=t[i],s&&!r.isEqualTo(e[i])&&(s=!1);return s},i.prototype.contentsForInspection=function(){var t;return{objects:"["+function(){var e,n,i,o;for(i=this.objects,o=[],e=0,n=i.length;n>e;e++)t=i[e],o.push(t.inspect());return o}.call(this).join(", ")+"]"}},s=function(t){return t[0]},o=function(t){return t[1]},i}(Trix.Object)}.call(this),function(){var t=function(t,n){function i(){this.constructor=t}for(var o in n)e.call(n,o)&&(t[o]=n[o]);return i.prototype=n.prototype,t.prototype=new i,t.__super__=n.prototype,t},e={}.hasOwnProperty;Trix.Text=function(e){function n(t){var e;null==t&&(t=[]),n.__super__.constructor.apply(this,arguments),this.pieceList=new Trix.SplittableList(function(){var n,i,o;for(o=[],n=0,i=t.length;i>n;n++)e=t[n],e.isEmpty()||o.push(e);return o}())}return t(n,e),n.textForAttachmentWithAttributes=function(t,e){var n;return n=new Trix.AttachmentPiece(t,e),new this([n])},n.textForStringWithAttributes=function(t,e){var n;return n=new Trix.StringPiece(t,e),new this([n])},n.fromJSON=function(t){var e,n;return n=function(){var n,i,o;for(o=[],n=0,i=t.length;i>n;n++)e=t[n],o.push(Trix.Piece.fromJSON(e));return o}(),new this(n)},n.prototype.copy=function(){return this.copyWithPieceList(this.pieceList)},n.prototype.copyWithPieceList=function(t){return new this.constructor(t.consolidate().toArray())},n.prototype.copyUsingObjectMap=function(t){var e,n;return n=function(){var n,i,o,r,s;for(o=this.getPieces(),s=[],n=0,i=o.length;i>n;n++)e=o[n],s.push(null!=(r=t.find(e))?r:e);return s}.call(this),new this.constructor(n)},n.prototype.appendText=function(t){return this.insertTextAtPosition(t,this.getLength())},n.prototype.insertTextAtPosition=function(t,e){return this.copyWithPieceList(this.pieceList.insertSplittableListAtPosition(t.pieceList,e))},n.prototype.removeTextAtRange=function(t){return this.copyWithPieceList(this.pieceList.removeObjectsInRange(t))},n.prototype.replaceTextAtRange=function(t,e){return this.removeTextAtRange(e).insertTextAtPosition(t,e[0])},n.prototype.moveTextFromRangeToPosition=function(t,e){var n,i;if(!(t[0]<=e&&e<=t[1]))return i=this.getTextAtRange(t),n=i.getLength(),t[0]t;t++)e=i[t],o.push(e.getAttributes());return o}.call(this),Trix.Hash.fromCommonAttributesOfObjects(t).toObject()},n.prototype.getCommonAttributesAtRange=function(t){var e;return null!=(e=this.getTextAtRange(t).getCommonAttributes())?e:{}},n.prototype.getExpandedRangeForAttributeAtOffset=function(t,e){var n,i,o;for(n=o=e,i=this.getLength();n>0&&this.getCommonAttributesAtRange([n-1,o])[t];)n--;for(;i>o&&this.getCommonAttributesAtRange([e,o+1])[t];)o++;return[n,o]},n.prototype.getTextAtRange=function(t){return this.copyWithPieceList(this.pieceList.getSplittableListInRange(t))},n.prototype.getStringAtRange=function(t){return this.pieceList.getSplittableListInRange(t).toString()},n.prototype.startsWithString=function(t){return this.getStringAtRange([0,t.length])===t},n.prototype.endsWithString=function(t){var e;return e=this.getLength(),this.getStringAtRange([e-t.length,e])===t},n.prototype.getAttachmentPieces=function(){var t,e,n,i,o;for(i=this.pieceList.toArray(),o=[],t=0,e=i.length;e>t;t++)n=i[t],null!=n.attachment&&o.push(n);return o},n.prototype.getAttachments=function(){var t,e,n,i,o;for(i=this.getAttachmentPieces(),o=[],t=0,e=i.length;e>t;t++)n=i[t],o.push(n.attachment);return o},n.prototype.getAttachmentAndPositionById=function(t){var e,n,i,o,r,s;for(o=0,r=this.pieceList.toArray(),e=0,n=r.length;n>e;e++){if(i=r[e],(null!=(s=i.attachment)?s.id:void 0)===t)return{attachment:i.attachment,position:o};o+=i.length}return{attachment:null,position:null}},n.prototype.getAttachmentById=function(t){var e,n,i;return i=this.getAttachmentAndPositionById(t),e=i.attachment,n=i.position,e},n.prototype.getRangeOfAttachment=function(t){var e,n;return n=this.getAttachmentAndPositionById(t.id),t=n.attachment,e=n.position,null!=t?[e,e+1]:void 0},n.prototype.updateAttributesForAttachment=function(t,e){var n;return(n=this.getRangeOfAttachment(e))?this.addAttributesAtRange(t,n):this},n.prototype.getLength=function(){return this.pieceList.getEndPosition()},n.prototype.isEmpty=function(){return 0===this.getLength()},n.prototype.isEqualTo=function(t){var e;return n.__super__.isEqualTo.apply(this,arguments)||(null!=t&&null!=(e=t.pieceList)?e.isEqualTo(this.pieceList):void 0)},n.prototype.isBlockBreak=function(){return 1===this.getLength()&&this.pieceList.getObjectAtIndex(0).isBlockBreak()},n.prototype.eachPiece=function(t){return this.pieceList.eachObject(t)},n.prototype.getPieces=function(){return this.pieceList.toArray()},n.prototype.getPieceAtPosition=function(t){return this.pieceList.getObjectAtPosition(t)},n.prototype.contentsForInspection=function(){return{pieceList:this.pieceList.inspect()}},n.prototype.toSerializableText=function(){var t;return t=this.pieceList.selectSplittableList(function(t){return t.isSerializable()}),this.copyWithPieceList(t)},n.prototype.toString=function(){return this.pieceList.toString()},n.prototype.toJSON=function(){return this.pieceList.toJSON()},n.prototype.toConsole=function(){var t;return JSON.stringify(function(){var e,n,i,o;for(i=this.pieceList.toArray(),o=[],e=0,n=i.length;n>e;e++)t=i[e],o.push(JSON.parse(t.toConsole()));return o}.call(this))},n}(Trix.Object)}.call(this),function(){var t,e=function(t,e){function i(){this.constructor=t}for(var o in e)n.call(e,o)&&(t[o]=e[o]);return i.prototype=e.prototype,t.prototype=new i,t.__super__=e.prototype,t},n={}.hasOwnProperty,i=[].slice;t=Trix.arraysAreEqual,Trix.Block=function(n){function o(t,e){null==t&&(t=new Trix.Text),null==e&&(e=[]),o.__super__.constructor.apply(this,arguments),this.text=s(t),this.attributes=e}var r,s,a,u,c,l,h,p;return e(o,n),o.fromJSON=function(t){var e;return e=Trix.Text.fromJSON(t.text),new this(e,t.attributes)},o.prototype.isEmpty=function(){return this.text.isBlockBreak()},o.prototype.isEqualTo=function(e){return o.__super__.isEqualTo.apply(this,arguments)||this.text.isEqualTo(null!=e?e.text:void 0)&&t(this.attributes,null!=e?e.attributes:void 0)},o.prototype.copyWithText=function(t){return new this.constructor(t,this.attributes)},o.prototype.copyWithoutText=function(){return this.copyWithText(null)},o.prototype.copyWithAttributes=function(t){return new this.constructor(this.text,t)},o.prototype.copyUsingObjectMap=function(t){var e;return this.copyWithText((e=t.find(this.text))?e:this.text.copyUsingObjectMap(t))},o.prototype.addAttribute=function(t){var e,n;return n=Trix.config.blockAttributes[t].listAttribute,e=this.attributes.concat(n?[n,t]:[t]),this.copyWithAttributes(e)},o.prototype.removeAttribute=function(t){var e,n;return n=Trix.config.blockAttributes[t].listAttribute,e=c(this.attributes,t),null!=n&&(e=c(e,n)),this.copyWithAttributes(e)},o.prototype.removeLastAttribute=function(){return this.removeAttribute(this.getLastAttribute())},o.prototype.getLastAttribute=function(){return u(this.attributes)},o.prototype.getAttributes=function(){return this.attributes.slice(0)},o.prototype.getAttributeLevel=function(){return this.attributes.length},o.prototype.getAttributeAtLevel=function(t){return this.attributes[t-1]},o.prototype.hasAttributes=function(){return this.getAttributeLevel()>0},o.prototype.getConfig=function(t){var e,n;if((e=this.getLastAttribute())&&(n=Trix.config.blockAttributes[e]))return t?n[t]:n},o.prototype.isListItem=function(){return null!=this.getConfig("listAttribute")},o.prototype.findLineBreakInDirectionFromPosition=function(t,e){var n,i;return i=this.toString(),n=function(){switch(t){case"forward":return i.indexOf("\n",e);case"backward":return i.slice(0,e).lastIndexOf("\n")}}(),-1!==n?n:void 0},o.prototype.contentsForInspection=function(){return{text:this.text.inspect(),attributes:this.attributes}},o.prototype.toString=function(){return this.text.toString()},o.prototype.toJSON=function(){return{text:this.text,attributes:this.attributes}},o.prototype.getLength=function(){return this.text.getLength()},o.prototype.canBeConsolidatedWith=function(t){return!this.hasAttributes()&&!t.hasAttributes()},o.prototype.consolidateWith=function(t){var e,n;return e=Trix.Text.textForStringWithAttributes("\n"),n=this.getTextWithoutBlockBreak().appendText(e),this.copyWithText(n.appendText(t.text))},o.prototype.splitAtOffset=function(t){var e,n;return 0===t?(e=null,n=this):t===this.getLength()?(e=this,n=null):(e=this.copyWithText(this.text.getTextAtRange([0,t])),n=this.copyWithText(this.text.getTextAtRange([t,this.getLength()]))),[e,n]},o.prototype.toString=function(){return this.text.toString()},o.prototype.getBlockBreakPosition=function(){return this.text.getLength()-1},o.prototype.getTextWithoutBlockBreak=function(){return l(this.text)?this.text.getTextAtRange([0,this.getBlockBreakPosition()]):this.text.copy()},o.prototype.canBeGrouped=function(t){return this.attributes[t]},o.prototype.canBeGroupedWith=function(t,e){var n,i,o,r;return n=this.attributes,i=t.getAttributes(),n[e]===i[e]?"bullet"!==(o=n[e])&&"number"!==o||"bulletList"===(r=i[e+1])||"numberList"===r?!0:!1:void 0},s=function(t){return t=p(t),t=r(t)},p=function(t){var e,n,o,r,s,a;return r=!1,a=t.getPieces(),n=2<=a.length?i.call(a,0,e=a.length-1):(e=0,[]),o=a[e++],null==o?t:(n=function(){var t,e,i;for(i=[],t=0,e=n.length;e>t;t++)s=n[t],s.isBlockBreak()?(r=!0,i.push(h(s))):i.push(s);return i}(),r?new Trix.Text(i.call(n).concat([o])):t)},a=Trix.Text.textForStringWithAttributes("\n",{blockBreak:!0}),r=function(t){return l(t)?t:t.appendText(a)},l=function(t){var e,n;return n=t.getLength(),0===n?!1:(e=t.getTextAtRange([n-1,n]),e.isBlockBreak())},h=function(t){return t.copyWithoutAttribute("blockBreak")},c=function(t,e){return u(t)===e?t.slice(0,-1):t},u=function(t){return t.slice(-1)[0]},o}(Trix.Object)}.call(this),function(){var t,e,n,i,o,r,s,a,u=function(t,e){function n(){this.constructor=t}for(var i in e)c.call(e,i)&&(t[i]=e[i]);return n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype,t},c={}.hasOwnProperty,l=[].indexOf||function(t){for(var e=0,n=this.length;n>e;e++)if(e in this&&this[e]===t)return e;return-1},h=[].slice;t=Trix.arraysAreEqual,r=Trix.normalizeSpaces,i=Trix.makeElement,s=Trix.tagName,a=Trix.walkTree,n=Trix.findClosestElementFromNode,e=Trix.elementContainsNode,o=Trix.nodeIsAttachmentElement,Trix.HTMLParser=function(c){function p(t){this.html=t,this.blocks=[],this.blockElements=[],this.processedElements=[]}var d,f,g,m,y,v,b,A,x,T,C,w;return u(p,c),d="style href src width height class".split(" "),p.parse=function(t,e){var n;return n=new this(t,e),n.parse(),n},p.prototype.getDocument=function(){return Trix.Document.fromJSON(this.blocks)},p.prototype.parse=function(){var t,e;try{for(this.createHiddenContainer(),t=w(this.html),this.container.innerHTML=t,e=a(this.container,{usingFilter:A});e.nextNode();)this.processNode(e.currentNode);return this.translateBlockElementMarginsToNewlines()}finally{this.removeHiddenContainer()}},A=function(t){return"style"===s(t)?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT},p.prototype.createHiddenContainer=function(){return this.container=i({tagName:"div",style:{display:"none"}}),document.body.appendChild(this.container)},p.prototype.removeHiddenContainer=function(){return document.body.removeChild(this.container)},p.prototype.processNode=function(t){switch(t.nodeType){case Node.TEXT_NODE:return this.processTextNode(t);case Node.ELEMENT_NODE:return this.appendBlockForElement(t),this.processElement(t)}},p.prototype.appendBlockForElement=function(n){var i;if(this.isBlockElement(n)&&!this.isBlockElement(n.firstChild)){if(i=m(n),!e(this.currentBlockElement,n)||!t(i,this.currentBlock.attributes))return this.currentBlock=this.appendBlockForAttributesWithElement(i,n),this.currentBlockElement=n}else if(this.currentBlockElement&&!e(this.currentBlockElement,n)&&!this.isBlockElement(n))return this.currentBlock=this.appendEmptyBlock(),this.currentBlockElement=null},p.prototype.isExtraBR=function(t){return"br"===s(t)&&this.isBlockElement(t.parentNode)&&t.parentNode.lastChild===t},p.prototype.isBlockElement=function(t){var e;if((null!=t?t.nodeType:void 0)===Node.ELEMENT_NODE&&!n(t,{matchingSelector:"td"}))return e=s(t),l.call(this.getBlockTagNames(),e)>=0||"block"===window.getComputedStyle(t).display},p.prototype.getBlockTagNames=function(){var t,e;return null!=this.blockTagNames?this.blockTagNames:this.blockTagNames=function(){var n,i;n=Trix.config.blockAttributes,i=[];for(t in n)e=n[t],i.push(e.tagName);return i}()},p.prototype.processTextNode=function(t){var e;return(e=r(t.data))?this.appendStringWithAttributes(e,b(t.parentNode)):void 0},p.prototype.processElement=function(t){var e,n,i,r,a;if(o(t))return e=g(t),Object.keys(e).length&&(r=b(t),this.appendAttachmentWithAttributes(e,r),t.innerHTML=""),this.processedElements.push(t);switch(s(t)){case"br":return this.isExtraBR(t)||this.appendStringWithAttributes("\n",b(t)),this.processedElements.push(t);case"img":e={url:t.src,contentType:"image"},i=v(t);for(n in i)a=i[n],e[n]=a;return this.appendAttachmentWithAttributes(e,b(t)),this.processedElements.push(t);case"tr":if(t.parentNode.firstChild!==t)return this.appendStringWithAttributes("\n");break;case"td":if(t.parentNode.firstChild!==t)return this.appendStringWithAttributes(" | ")}},p.prototype.appendBlockForAttributesWithElement=function(t,e){var n;return this.blockElements.push(e),n=f(t),this.blocks.push(n),n},p.prototype.appendEmptyBlock=function(){return this.appendBlockForAttributesWithElement([],null)},p.prototype.appendStringWithAttributes=function(t,e){return this.appendPiece(T(t,e))},p.prototype.appendAttachmentWithAttributes=function(t,e){return this.appendPiece(x(t,e))},p.prototype.appendPiece=function(t){return 0===this.blocks.length&&this.appendEmptyBlock(),this.blocks[this.blocks.length-1].text.push(t)},p.prototype.appendStringToTextAtIndex=function(t,e){var n,i;return i=this.blocks[e].text,n=i[i.length-1],"string"===(null!=n?n.type:void 0)?n.string+=t:i.push(T(t))},p.prototype.prependStringToTextAtIndex=function(t,e){var n,i;return i=this.blocks[e].text,n=i[0],"string"===(null!=n?n.type:void 0)?n.string=t+n.string:i.unshift(T(t))},p.prototype.getMarginOfBlockElementAtIndex=function(t){var e,n;return!(e=this.blockElements[t])||(n=s(e),l.call(this.getBlockTagNames(),n)>=0||l.call(this.processedElements,e)>=0)?void 0:y(e)},p.prototype.getMarginOfDefaultBlockElement=function(){var t;return t=i(Trix.config.blockAttributes["default"].tagName),this.container.appendChild(t),y(t)},p.prototype.translateBlockElementMarginsToNewlines=function(){var t,e,n,i,o,r,s,a;for(e=this.getMarginOfDefaultBlockElement(),s=this.blocks,a=[],i=n=0,o=s.length;o>n;i=++n)t=s[i],(r=this.getMarginOfBlockElementAtIndex(i))&&(r.top>2*e.top&&this.prependStringToTextAtIndex("\n",i),a.push(r.bottom>2*e.bottom?this.appendStringToTextAtIndex("\n",i):void 0));return a},T=function(t,e){var n;return null==e&&(e={}),n="string",{string:t,attributes:e,type:n}},x=function(t,e){var n;return null==e&&(e={}),n="attachment",{attachment:t,attributes:e,type:n}},f=function(t){var e;return null==t&&(t={}),e=[],{text:e,attributes:t}},b=function(t){var e,n,i,r,a,u,c,l;n={},u=Trix.config.textAttributes;for(e in u)i=u[e],i.parser?(l=i.parser(t))&&(n[e]=l):i.tagName&&s(t)===i.tagName&&(n[e]=!0);if(o(t)&&(r=t.dataset.trixAttributes)){c=JSON.parse(r);for(a in c)l=c[a],n[a]=l}return n},m=function(t){var e,n,i,o;for(n=[];t;){o=Trix.config.blockAttributes;for(e in o)i=o[e],i.parse!==!1&&s(t)===i.tagName&&(("function"==typeof i.test?i.test(t):void 0)||!i.test)&&(n.push(e),i.listAttribute&&n.push(i.listAttribute));t=t.parentNode}return n.reverse()},g=function(t){return JSON.parse(t.dataset.trixAttachment)},w=function(t){var e,n,i,o,r,s,u,c,p,f,g,m,y,v,b,A,x;for(t=C(t),n=document.implementation.createHTMLDocument(""),n.documentElement.innerHTML=t,e=n.body,o=n.head,v=o.querySelectorAll("style"),r=0,c=v.length;c>r;r++)A=v[r],e.appendChild(A);for(y=[],x=a(e);x.nextNode();)switch(m=x.currentNode,m.nodeType){case Node.ELEMENT_NODE:for(i=m,b=h.call(i.attributes),s=0,p=b.length;p>s;s++)g=b[s].name,l.call(d,g)>=0||0===g.indexOf("data-trix")||i.removeAttribute(g);break;case Node.COMMENT_NODE:y.push(m);break;case Node.TEXT_NODE:m.data.match(/^\s*$/)&&m.parentNode===e&&y.push(m)}for(u=0,f=y.length;f>u;u++)m=y[u],m.parentNode.removeChild(m);return e.innerHTML},C=function(t){return t.replace(/>\n+<").replace(/>\ + <")},y=function(t){var e;return e=window.getComputedStyle(t),"block"===e.display?{top:parseInt(e.marginTop),bottom:parseInt(e.marginBottom)}:void 0},v=function(t){var e,n,i;return i=t.getAttribute("width"),n=t.getAttribute("height"),e={},i&&(e.width=parseInt(i,10)),n&&(e.height=parseInt(n,10)),e},p}(Trix.BasicObject)}.call(this),function(){var t,e,n,i=function(t,e){function n(){this.constructor=t}for(var i in e)o.call(e,i)&&(t[i]=e[i]);return n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype,t},o={}.hasOwnProperty,r=[].slice,s=[].indexOf||function(t){for(var e=0,n=this.length;n>e;e++)if(e in this&&this[e]===t)return e;return-1};t=Trix.arraysAreEqual,e=Trix.normalizeRange,n=Trix.rangeIsCollapsed,Trix.Document=function(o){function a(t){null==t&&(t=[]),a.__super__.constructor.apply(this,arguments),0===t.length&&(t=[new Trix.Block]),this.blockList=Trix.SplittableList.box(t)}var u;return i(a,o),a.fromJSON=function(t){var e,n;return n=function(){var n,i,o;for(o=[],n=0,i=t.length;i>n;n++)e=t[n],o.push(Trix.Block.fromJSON(e));return o}(),new this(n)},a.fromHTML=function(t){return Trix.HTMLParser.parse(t).getDocument()},a.fromString=function(t,e){var n;return n=Trix.Text.textForStringWithAttributes(t,e),new this([new Trix.Block(n)])},a.prototype.isEmpty=function(){var t;return 1===this.blockList.length&&(t=this.getBlockAtIndex(0),t.isEmpty()&&!t.hasAttributes())},a.prototype.copy=function(t){var e;return null==t&&(t={}),e=t.consolidateBlocks?this.blockList.consolidate().toArray():this.blockList.toArray(),new this.constructor(e)},a.prototype.copyUsingObjectsFromDocument=function(t){var e;return e=new Trix.ObjectMap(t.getObjects()),this.copyUsingObjectMap(e)},a.prototype.copyUsingObjectMap=function(t){var e,n,i;return n=function(){var n,o,r,s;for(r=this.getBlocks(),s=[],n=0,o=r.length;o>n;n++)e=r[n],s.push((i=t.find(e))?i:e.copyUsingObjectMap(t));return s}.call(this),new this.constructor(n)},a.prototype.copyWithBaseBlockAttributes=function(t){var e,n,i;return null==t&&(t=[]),i=function(){var i,o,r,s;for(r=this.getBlocks(),s=[],i=0,o=r.length;o>i;i++)n=r[i],e=t.concat(n.getAttributes()),s.push(n.copyWithAttributes(e));return s}.call(this),new this.constructor(i)},a.prototype.insertDocumentAtRange=function(t,i){var o,r,s,a,u,c,l;return r=t.blockList,u=(i=e(i))[0],c=this.locationFromPosition(u),s=c.index,a=c.offset,l=this,o=this.getBlockAtPosition(u),n(i)&&o.isEmpty()&&!o.hasAttributes()?l=new this.constructor(l.blockList.removeObjectAtIndex(s)):o.getBlockBreakPosition()===a&&u++,l=l.removeTextAtRange(i),new this.constructor(l.blockList.insertSplittableListAtPosition(r,u))},a.prototype.mergeDocumentAtRange=function(n,i){var o,r,s,a,u,c,l,h,p,d,f,g;return f=(i=e(i))[0],d=this.locationFromPosition(f),r=this.getBlockAtIndex(d.index).getAttributes(),o=n.getBaseBlockAttributes(),g=r.slice(-o.length),t(o,g)?(l=r.slice(0,-o.length),c=n.copyWithBaseBlockAttributes(l)):c=n.copy({consolidateBlocks:!0}).copyWithBaseBlockAttributes(r),s=c.getBlockCount(),a=c.getBlockAtIndex(0),t(r,a.getAttributes())?(u=a.getTextWithoutBlockBreak(),p=this.insertTextAtRange(u,i),s>1&&(c=new this.constructor(c.getBlocks().slice(1)),h=f+u.getLength(),p=p.insertDocumentAtRange(c,h))):p=this.insertDocumentAtRange(c,i),p},a.prototype.insertTextAtRange=function(t,n){var i,o,r,s,a;return a=(n=e(n))[0],s=this.locationFromPosition(a),o=s.index,r=s.offset,i=this.removeTextAtRange(n),new this.constructor(i.blockList.editObjectAtIndex(o,function(e){return e.copyWithText(e.text.insertTextAtPosition(t,r))}))},a.prototype.removeTextAtRange=function(t){var i,o,r,s,a,u,c,l,h,p,d,f,g,m,y,v,b;return h=t=e(t),y=h[0],s=h[1],n(t)?this:(c=this.locationFromPosition(y),u=c.index,a=this.getBlockAtIndex(u),l=a.text.getTextAtRange([0,c.offset]),g=this.locationFromPosition(s),f=g.index,d=this.getBlockAtIndex(f),m=d.text.getTextAtRange([g.offset,d.getLength()]),v=l.appendText(m),p=u!==f&&0===c.offset,b=p&&a.getAttributeLevel()>=d.getAttributeLevel(),o=b?d.copyWithText(v):a.copyWithText(v),r=this.blockList.toArray(),i=f+1-u,r.splice(u,i,o),new this.constructor(r))},a.prototype.moveTextFromRangeToPosition=function(t,n){var i,o,s,a,u,c,l,h,p,d;if(c=t=e(t),p=c[0],s=c[1],n>=p&&s>=n)return this;if(o=this.getDocumentAtRange(t),h=this.removeTextAtRange(t),u=n>p,u&&(n-=o.getLength()),!h.firstBlockInRangeIsEntirelySelected(t)){if(l=o.getBlocks(),a=l[0],i=2<=l.length?r.call(l,1):[],0===i.length?(d=a.getTextWithoutBlockBreak(),u&&(n+=1)):d=a.text,h=h.insertTextAtRange(d,n),0===i.length)return h;o=new this.constructor(i),n+=d.getLength()}return h.insertDocumentAtRange(o,n)},a.prototype.addAttributeAtRange=function(t,e,n){var i;return i=this.blockList,this.eachBlockAtRange(n,function(n,o,r){return i=i.editObjectAtIndex(r,function(){return Trix.config.blockAttributes[t]?n.addAttribute(t,e):o[0]===o[1]?n:n.copyWithText(n.text.addAttributeAtRange(t,e,o))})}),new this.constructor(i)},a.prototype.addAttribute=function(t,e){var n;return n=this.blockList,this.eachBlock(function(i,o){return n=n.editObjectAtIndex(o,function(){return i.addAttribute(t,e)})}),new this.constructor(n)},a.prototype.removeAttributeAtRange=function(t,e){var n;return n=this.blockList,this.eachBlockAtRange(e,function(e,i,o){return Trix.config.blockAttributes[t]?n=n.editObjectAtIndex(o,function(){return e.removeAttribute(t)}):i[0]!==i[1]?n=n.editObjectAtIndex(o,function(){return e.copyWithText(e.text.removeAttributeAtRange(t,i))}):void 0}),new this.constructor(n)},a.prototype.updateAttributesForAttachment=function(t,e){var n,i,o,r;return o=(i=this.getRangeOfAttachment(e))[0],n=this.locationFromPosition(o).index,r=this.getTextAtIndex(n),new this.constructor(this.blockList.editObjectAtIndex(n,function(n){return n.copyWithText(r.updateAttributesForAttachment(t,e))}))},a.prototype.removeAttributeForAttachment=function(t,e){var n;return n=this.getRangeOfAttachment(e),this.removeAttributeAtRange(t,n)},a.prototype.insertBlockBreakAtRange=function(t){var n,i,o,r;return r=(t=e(t))[0],o=this.locationFromPosition(r).offset,i=this.removeTextAtRange(t),0===o&&(n=[new Trix.Block]),new this.constructor(i.blockList.insertSplittableListAtPosition(new Trix.SplittableList(n),r))},a.prototype.applyBlockAttributeAtRange=function(t,e,n){var i,o,r;return o=this.expandRangeToLineBreaksAndSplitBlocks(n),i=o.document,n=o.range,Trix.config.blockAttributes[t].listAttribute?(i=i.removeLastListAttributeAtRange(n,{exceptAttributeName:t}),r=i.convertLineBreaksToBlockBreaksInRange(n),i=r.document,n=r.range):i=i.consolidateBlocksAtRange(n),i.addAttributeAtRange(t,e,n)},a.prototype.removeLastListAttributeAtRange=function(t,e){var n;return null==e&&(e={}),n=this.blockList,this.eachBlockAtRange(t,function(t,i,o){var r;if((r=t.getLastAttribute())&&Trix.config.blockAttributes[r].listAttribute&&r!==e.exceptAttributeName)return n=n.editObjectAtIndex(o,function(){return t.removeAttribute(r)})}),new this.constructor(n)},a.prototype.firstBlockInRangeIsEntirelySelected=function(t){var n,i,o,r,s,a;return r=t=e(t),a=r[0],n=r[1],i=this.locationFromPosition(a),s=this.locationFromPosition(n),0===i.offset&&i.indexc.index?(o.index-=1,o.offset=n.getBlockAtIndex(o.index).getBlockBreakPosition()):(i=n.getBlockAtIndex(o.index),"\n"===i.text.getStringAtRange([o.offset-1,o.offset])?o.offset-=1:o.offset=i.findLineBreakInDirectionFromPosition("forward",o.offset),o.offset!==i.getBlockBreakPosition()&&(s=n.positionFromLocation(o),n=n.insertBlockBreakAtRange([s,s+1]))),l=n.positionFromLocation(c),r=n.positionFromLocation(o),t=e([l,r]),{document:n,range:t}},a.prototype.convertLineBreaksToBlockBreaksInRange=function(t){var n,i,o;return i=(t=e(t))[0],o=this.getStringAtRange(t).slice(0,-1),n=this,o.replace(/.*?\n/g,function(t){return i+=t.length,n=n.insertBlockBreakAtRange([i-1,i])}),{document:n,range:t}},a.prototype.consolidateBlocksAtRange=function(t){var n,i,o,r,s;return o=t=e(t),s=o[0],i=o[1],r=this.locationFromPosition(s).index,n=this.locationFromPosition(i).index,new this.constructor(this.blockList.consolidateFromIndexToIndex(r,n))},a.prototype.getDocumentAtRange=function(t){var n;return t=e(t),n=this.blockList.getSplittableListInRange(t).toArray(),new this.constructor(n)},a.prototype.getStringAtRange=function(t){return this.getDocumentAtRange(t).toString()},a.prototype.getBlockAtIndex=function(t){return this.blockList.getObjectAtIndex(t)},a.prototype.getBlockAtPosition=function(t){var e;return e=this.locationFromPosition(t).index,this.getBlockAtIndex(e)},a.prototype.getTextAtIndex=function(t){var e;return null!=(e=this.getBlockAtIndex(t))?e.text:void 0},a.prototype.getTextAtPosition=function(t){var e;return e=this.locationFromPosition(t).index,this.getTextAtIndex(e)},a.prototype.getPieceAtPosition=function(t){var e,n,i;return i=this.locationFromPosition(t),e=i.index,n=i.offset,this.getTextAtIndex(e).getPieceAtPosition(t)},a.prototype.getCharacterAtPosition=function(t){var e,n,i;return i=this.locationFromPosition(t),e=i.index,n=i.offset,this.getTextAtIndex(e).getStringAtRange([n,n+1])},a.prototype.getLength=function(){return this.blockList.getEndPosition()},a.prototype.getBlocks=function(){return this.blockList.toArray()},a.prototype.getBlockCount=function(){return this.blockList.length},a.prototype.getEditCount=function(){return this.editCount},a.prototype.eachBlock=function(t){return this.blockList.eachObject(t)},a.prototype.eachBlockAtRange=function(t,n){var i,o,r,s,a,u,c,l,h,p,d,f;if(u=t=e(t),d=u[0],r=u[1],p=this.locationFromPosition(d),o=this.locationFromPosition(r),p.index===o.index)return i=this.getBlockAtIndex(p.index),f=[p.offset,o.offset],n(i,f,p.index);for(h=[],a=s=c=p.index,l=o.index;l>=c?l>=s:s>=l;a=l>=c?++s:--s)(i=this.getBlockAtIndex(a))?(f=function(){switch(a){case p.index:return[p.offset,i.text.getLength()];case o.index:return[0,o.offset];default:return[0,i.text.getLength()]}}(),h.push(n(i,f,a))):h.push(void 0);return h},a.prototype.getCommonAttributesAtRange=function(t){var i,o,r;return o=(t=e(t))[0],n(t)?this.getCommonAttributesAtPosition(o):(r=[],i=[],this.eachBlockAtRange(t,function(t,e){return e[0]!==e[1]?(r.push(t.text.getCommonAttributesAtRange(e)),i.push(u(t))):void 0}),Trix.Hash.fromCommonAttributesOfObjects(r).merge(Trix.Hash.fromCommonAttributesOfObjects(i)).toObject())},a.prototype.getCommonAttributesAtPosition=function(t){var e,n,i,o,r,a,c,l,h,p;if(h=this.locationFromPosition(t),r=h.index,l=h.offset,i=this.getBlockAtIndex(r),!i)return{};o=u(i),e=i.text.getAttributesAtPosition(l),n=i.text.getAttributesAtPosition(l-1),a=function(){var t,e;t=Trix.config.textAttributes,e=[];for(c in t)p=t[c],p.inheritable&&e.push(c);return e}();for(c in n)p=n[c],(p===e[c]||s.call(a,c)>=0)&&(o[c]=p);return o},a.prototype.getRangeOfCommonAttributeAtPosition=function(t,n){var i,o,r,s,a,u,c,l,h;return a=this.locationFromPosition(n),r=a.index,s=a.offset,h=this.getTextAtIndex(r),u=h.getExpandedRangeForAttributeAtOffset(t,s),l=u[0],o=u[1],c=this.positionFromLocation({index:r,offset:l}),i=this.positionFromLocation({index:r,offset:o}),e([c,i])},a.prototype.getBaseBlockAttributes=function(){var t,e,n,i,o,r,s;for(t=this.getBlockAtIndex(0).getAttributes(),n=i=1,s=this.getBlockCount();s>=1?s>i:i>s;n=s>=1?++i:--i)e=this.getBlockAtIndex(n).getAttributes(),r=Math.min(t.length,e.length),t=function(){var n,i,s;for(s=[],o=n=0,i=r;(i>=0?i>n:n>i)&&e[o]===t[o];o=i>=0?++n:--n)s.push(e[o]);return s}();return t},u=function(t){var e,n;return n={},(e=t.getLastAttribute())&&(n[e]=!0),n},a.prototype.getAttachmentById=function(t){var e,n,i,o;for(o=this.getAttachments(),n=0,i=o.length;i>n;n++)if(e=o[n],e.id===t)return e},a.prototype.getAttachmentPieces=function(){var t;return t=[],this.blockList.eachObject(function(e){var n;return n=e.text,t=t.concat(n.getAttachmentPieces())}),t},a.prototype.getAttachments=function(){var t,e,n,i,o;for(i=this.getAttachmentPieces(),o=[],t=0,e=i.length;e>t;t++)n=i[t],o.push(n.attachment);return o},a.prototype.getRangeOfAttachment=function(t){var n,i,o,r,s,a,u;for(r=0,s=this.blockList.toArray(),i=n=0,o=s.length;o>n;i=++n){if(a=s[i].text,u=a.getRangeOfAttachment(t))return e([r+u[0],r+u[1]]);r+=a.getLength()}},a.prototype.getAttachmentPieceForAttachment=function(t){var e,n,i,o;for(o=this.getAttachmentPieces(),e=0,n=o.length;n>e;e++)if(i=o[e],i.attachment===t)return i},a.prototype.rangeFromLocationRange=function(t){var i,o;return t=e(t),i=this.positionFromLocation(t[0]),n(t)||(o=this.positionFromLocation(t[1])),[i,null!=o?o:i]},a.prototype.locationFromPosition=function(t){var e,n;return n=this.blockList.findIndexAndOffsetAtPosition(Math.max(0,t)),null!=n.index?n:(e=this.getBlocks(),{index:e.length-1,offset:e[e.length-1].getLength()})},a.prototype.positionFromLocation=function(t){return this.blockList.findPositionAtIndexAndOffset(t.index,t.offset)},a.prototype.locationRangeFromPosition=function(t){return e(this.locationFromPosition(t))},a.prototype.locationRangeFromRange=function(t){var n,i,o,r;if(t=e(t))return r=t[0],i=t[1],o=this.locationFromPosition(r),n=this.locationFromPosition(i),e([o,n])},a.prototype.rangeFromLocationRange=function(t){var i,o;return t=e(t),i=this.positionFromLocation(t[0]),n(t)||(o=this.positionFromLocation(t[1])),e([i,o])},a.prototype.isEqualTo=function(t){return this.blockList.isEqualTo(null!=t?t.blockList:void 0)},a.prototype.getTexts=function(){var t,e,n,i,o;for(i=this.getBlocks(),o=[],e=0,n=i.length;n>e;e++)t=i[e],o.push(t.text);return o},a.prototype.getPieces=function(){var t,e,n,i,o;for(n=[],i=this.getTexts(),t=0,e=i.length;e>t;t++)o=i[t],n.push.apply(n,o.getPieces());return n},a.prototype.getObjects=function(){return this.getBlocks().concat(this.getTexts()).concat(this.getPieces())},a.prototype.toSerializableDocument=function(){var t;return t=[],this.blockList.eachObject(function(e){return t.push(e.copyWithText(e.text.toSerializableText()))}),new this.constructor(t)},a.prototype.toString=function(){return this.blockList.toString() -},a.prototype.toJSON=function(){return this.blockList.toJSON()},a.prototype.toConsole=function(){var t;return JSON.stringify(function(){var e,n,i,o;for(i=this.blockList.toArray(),o=[],e=0,n=i.length;n>e;e++)t=i[e],o.push(JSON.parse(t.text.toConsole()));return o}.call(this))},a}(Trix.Object)}.call(this),function(){var t,e,n,i,o,r=function(t,e){function n(){this.constructor=t}for(var i in e)s.call(e,i)&&(t[i]=e[i]);return n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype,t},s={}.hasOwnProperty;e=Trix.normalizeRange,i=Trix.rangesAreEqual,n=Trix.objectsAreEqual,o=Trix.summarizeArrayChange,t=Trix.extend,Trix.Composition=function(s){function a(){this.document=new Trix.Document,this.attachments=[],this.currentAttributes={},this.revision=0}var u;return r(a,s),a.prototype.setDocument=function(t){var e;return t.isEqualTo(this.document)?void 0:(this.document=t,this.refreshAttachments(),this.revision++,null!=(e=this.delegate)&&"function"==typeof e.compositionDidChangeDocument?e.compositionDidChangeDocument(t):void 0)},a.prototype.getSnapshot=function(){return{document:this.document,selectedRange:this.getSelectedRange()}},a.prototype.loadSnapshot=function(t){var e,n,i,o;return e=t.document,o=t.selectedRange,null!=(n=this.delegate)&&"function"==typeof n.compositionWillLoadSnapshot&&n.compositionWillLoadSnapshot(),this.setDocument(null!=e?e:new Trix.Document),this.setSelection(null!=o?o:[0,0]),null!=(i=this.delegate)&&"function"==typeof i.compositionDidLoadSnapshot?i.compositionDidLoadSnapshot():void 0},a.prototype.insertText=function(t,e){var n,i,o,r;return r=(null!=e?e:{updatePosition:!0}).updatePosition,i=this.getSelectedRange(),this.setDocument(this.document.insertTextAtRange(t,i)),o=i[0],n=o+t.getLength(),r&&this.setSelection(n),this.notifyDelegateOfInsertionAtRange([o,n])},a.prototype.insertBlock=function(t){var e;return null==t&&(t=new Trix.Block),e=new Trix.Document([t]),this.insertDocument(e)},a.prototype.insertDocument=function(t){var e,n,i;return null==t&&(t=new Trix.Document),n=this.getSelectedRange(),this.setDocument(this.document.insertDocumentAtRange(t,n)),i=n[0],e=i+t.getLength(),this.setSelection(e),this.notifyDelegateOfInsertionAtRange([i,e])},a.prototype.insertString=function(t,e){var n,i;return n=this.getCurrentTextAttributes(),i=Trix.Text.textForStringWithAttributes(t,n),this.insertText(i,e)},a.prototype.insertBlockBreak=function(){var t,e,n;return e=this.getSelectedRange(),this.setDocument(this.document.insertBlockBreakAtRange(e)),n=e[0],t=n+1,this.setSelection(t),this.notifyDelegateOfInsertionAtRange([n,t])},a.prototype.breakFormattedBlock=function(){var t,e,n,i,o,r,s,a;return r=this.getPosition(),s=[r-1,r],e=this.document,a=e.locationFromPosition(r),n=a.index,o=a.offset,t=e.getBlockAtIndex(n),t.getBlockBreakPosition()===o?(e=e.removeTextAtRange(s),s=[r,r]):"\n"===t.text.getStringAtRange([o,o+1])?s=[r-1,r+1]:r+=1,i=new Trix.Document([t.removeLastAttribute().copyWithoutText()]),this.setDocument(e.insertDocumentAtRange(i,s)),this.setSelection(r)},a.prototype.insertLineBreak=function(){var t,e,n,i,o,r,s;return o=this.getSelectedRange(),s=o[0],i=o[1],r=this.document.locationFromPosition(s),n=this.document.locationFromPosition(i),t=this.document.getBlockAtIndex(n.index),t.hasAttributes()?t.isListItem()?t.isEmpty()?(this.decreaseListLevel(),this.setSelection(s)):0===r.offset?(e=new Trix.Document([t.copyWithoutText()]),this.insertDocument(e)):this.insertBlockBreak():t.isEmpty()?this.removeLastBlockAttribute():"\n"===t.text.getStringAtRange([n.offset-1,n.offset])?this.breakFormattedBlock():this.insertString("\n"):this.insertString("\n")},a.prototype.insertHTML=function(t){var e,n,i,o,r;return r=this.getPosition(),o=this.document.getLength(),e=Trix.Document.fromHTML(t),this.setDocument(this.document.mergeDocumentAtRange(e,this.getSelectedRange())),n=this.document.getLength(),i=r+(n-o),this.setSelection(i),this.notifyDelegateOfInsertionAtRange([i,i])},a.prototype.replaceHTML=function(t){var e;return e=Trix.Document.fromHTML(t).copyUsingObjectsFromDocument(this.document),this.preserveSelection(function(t){return function(){return t.setDocument(e)}}(this))},a.prototype.insertFile=function(t){var e,n;return(null!=(n=this.delegate)?n.compositionShouldAcceptFile(t):void 0)?(e=Trix.Attachment.attachmentForFile(t),this.insertAttachment(e)):void 0},a.prototype.insertAttachment=function(t){var e;return e=Trix.Text.textForAttachmentWithAttributes(t,this.currentAttributes),this.insertText(e)},a.prototype.deleteInDirection=function(t){var e,n,i,o,r,s,a;if(r=this.getSelectedRange(),a=r[0],i=r[1],o=r,n=this.getBlock(),a===i){if(s=this.document.locationFromPosition(a),"backward"===t&&0===s.offset&&n.isEmpty()&&this.canDecreaseBlockAttributeLevel())return n.isListItem()?this.decreaseListLevel():this.decreaseBlockAttributeLevel(),void this.setSelection(a);o=this.getExpandedRangeInDirection(t),"backward"===t&&(e=this.getAttachmentAtRange(o))}return e?(this.editAttachment(e),!1):(this.setDocument(this.document.removeTextAtRange(o)),this.setSelection(o[0]))},a.prototype.moveTextFromRange=function(t){var e;return e=this.getSelectedRange()[0],this.setDocument(this.document.moveTextFromRangeToPosition(t,e)),this.setSelection(e)},a.prototype.removeAttachment=function(t){var e;return(e=this.document.getRangeOfAttachment(t))?(this.stopEditingAttachment(),this.setDocument(this.document.removeTextAtRange(e)),this.setSelection(e[0])):void 0},a.prototype.removeLastBlockAttribute=function(){var t,e,n,i;return n=this.getSelectedRange(),i=n[0],e=n[1],t=this.document.getBlockAtPosition(e),this.removeCurrentAttribute(t.getLastAttribute()),this.setSelection(i)},u=" ",a.prototype.insertPlaceholder=function(){return this.placeholderPosition=this.getPosition(),this.insertString(u),u},a.prototype.selectPlaceholder=function(){return null!=this.placeholderPosition?(this.setSelectedRange([this.placeholderPosition,this.placeholderPosition+u.length]),!0):void 0},a.prototype.forgetPlaceholder=function(){return this.placeholderPosition=null},a.prototype.hasCurrentAttribute=function(t){return null!=this.currentAttributes[t]},a.prototype.toggleCurrentAttribute=function(t){var e;return(e=!this.currentAttributes[t])?this.setCurrentAttribute(t,e):this.removeCurrentAttribute(t)},a.prototype.canSetCurrentAttribute=function(t){switch(t){case"href":return!this.selectionContainsAttachmentWithAttribute(t);default:return!0}},a.prototype.setCurrentAttribute=function(t,e){return Trix.config.blockAttributes[t]?this.setBlockAttribute(t,e):(this.setTextAttribute(t,e),this.currentAttributes[t]=e,this.notifyDelegateOfCurrentAttributesChange())},a.prototype.setTextAttribute=function(t,e){var n,i,o,r;if(i=this.getSelectedRange())return o=i[0],n=i[1],o!==n?this.setDocument(this.document.addAttributeAtRange(t,e,i)):"href"===t?(r=Trix.Text.textForStringWithAttributes(e,{href:e}),this.insertText(r)):void 0},a.prototype.setBlockAttribute=function(t,e){var n;if(n=this.getSelectedRange())return this.setDocument(this.document.applyBlockAttributeAtRange(t,e,n)),this.setSelection(n)},a.prototype.removeCurrentAttribute=function(t){return Trix.config.blockAttributes[t]?(this.removeBlockAttribute(t),this.updateCurrentAttributes()):(this.removeTextAttribute(t),delete this.currentAttributes[t],this.notifyDelegateOfCurrentAttributesChange())},a.prototype.removeTextAttribute=function(t){var e;if(e=this.getSelectedRange())return this.setDocument(this.document.removeAttributeAtRange(t,e))},a.prototype.removeBlockAttribute=function(t){var e;if(e=this.getSelectedRange())return this.setDocument(this.document.removeAttributeAtRange(t,e))},a.prototype.increaseBlockAttributeLevel=function(){var t,e;return(t=null!=(e=this.getBlock())?e.getLastAttribute():void 0)?this.setCurrentAttribute(t):void 0},a.prototype.decreaseBlockAttributeLevel=function(){var t,e;return(t=null!=(e=this.getBlock())?e.getLastAttribute():void 0)?this.removeCurrentAttribute(t):void 0},a.prototype.decreaseListLevel=function(){var t,e,n,i,o,r;for(r=this.getSelectedRange()[0],o=this.document.locationFromPosition(r).index,n=o,t=this.getBlock().getAttributeLevel();(e=this.document.getBlockAtIndex(n+1))&&e.isListItem()&&e.getAttributeLevel()>t;)n++;return r=this.document.positionFromLocation({index:o,offset:0}),i=this.document.positionFromLocation({index:n,offset:0}),this.setDocument(this.document.removeLastListAttributeAtRange([r,i]))},a.prototype.canIncreaseBlockAttributeLevel=function(){var t,e,n,i;if(t=this.getBlock())return n=t.getConfig("nestable"),null!=n?n:t.isListItem()&&(i=this.getPreviousBlock())?(e=t.getAttributeLevel(),i.getAttributeAtLevel(e)===t.getAttributeAtLevel(e)):void 0},a.prototype.canDecreaseBlockAttributeLevel=function(){var t;return(null!=(t=this.getBlock())?t.getAttributeLevel():void 0)>0},a.prototype.updateCurrentAttributes=function(){var t,e;return(e=this.getSelectedRange({ignoreLock:!0}))&&(t=this.document.getCommonAttributesAtRange(e),!n(t,this.currentAttributes))?(this.currentAttributes=t,this.notifyDelegateOfCurrentAttributesChange()):void 0},a.prototype.getCurrentAttributes=function(){return t.call({},this.currentAttributes)},a.prototype.getCurrentTextAttributes=function(){var t,e,n,i;t={},n=this.currentAttributes;for(e in n)i=n[e],Trix.config.textAttributes[e]&&(t[e]=i);return t},a.prototype.freezeSelection=function(){return this.setCurrentAttribute("frozen",!0)},a.prototype.thawSelection=function(){return this.removeCurrentAttribute("frozen")},a.prototype.hasFrozenSelection=function(){return this.hasCurrentAttribute("frozen")},a.proxyMethod("getSelectionManager().setLocationRangeFromPoint"),a.proxyMethod("getSelectionManager().preserveSelection"),a.proxyMethod("getSelectionManager().locationIsCursorTarget"),a.proxyMethod("getSelectionManager().selectionIsExpanded"),a.proxyMethod("delegate?.getSelectionManager"),a.prototype.setSelection=function(t){var e,n;return e=this.document.locationRangeFromRange(t),null!=(n=this.delegate)&&"function"==typeof n.compositionDidRequestChangingSelectionToLocationRange?n.compositionDidRequestChangingSelectionToLocationRange(e):void 0},a.prototype.getSelectedRange=function(){var t;return(t=this.getLocationRange())?this.document.rangeFromLocationRange(t):void 0},a.prototype.setSelectedRange=function(t){var e;return e=this.document.locationRangeFromRange(t),this.getSelectionManager().setLocationRange(e)},a.prototype.getPosition=function(){var t;return(t=this.getLocationRange())?this.document.positionFromLocation(t[0]):void 0},a.prototype.getLocationRange=function(){var t;return null!=(t=this.getSelectionManager().getLocationRange())?t:e({index:0,offset:0})},a.prototype.getExpandedRangeInDirection=function(t){var n,i,o;return i=this.getSelectedRange(),o=i[0],n=i[1],"backward"===t?o=this.translateUTF16PositionFromOffset(o,-1):n=this.translateUTF16PositionFromOffset(n,1),e([o,n])},a.prototype.moveCursorInDirection=function(t){var e,n,o,r;return this.editingAttachment?o=this.document.getRangeOfAttachment(this.editingAttachment):(r=this.getSelectedRange(),o=this.getExpandedRangeInDirection(t),n=!i(r,o)),this.setSelectedRange("backward"===t?o[0]:o[1]),n&&(e=this.getAttachmentAtRange(o))?this.editAttachment(e):void 0},a.prototype.expandSelectionInDirection=function(t){var e;return e=this.getExpandedRangeInDirection(t),this.setSelectedRange(e)},a.prototype.expandSelectionForEditing=function(){return this.hasCurrentAttribute("href")?this.expandSelectionAroundCommonAttribute("href"):void 0},a.prototype.expandSelectionAroundCommonAttribute=function(t){var e,n;return e=this.getPosition(),n=this.document.getRangeOfCommonAttributeAtPosition(t,e),this.setSelectedRange(n)},a.prototype.selectionContainsAttachmentWithAttribute=function(t){var e,n,i,o,r;if(r=this.getSelectedRange()){for(o=this.document.getDocumentAtRange(r).getAttachments(),n=0,i=o.length;i>n;n++)if(e=o[n],e.hasAttribute(t))return!0;return!1}},a.prototype.selectionIsInCursorTarget=function(){return this.editingAttachment||this.positionIsCursorTarget(this.getPosition())},a.prototype.positionIsCursorTarget=function(t){var e;return(e=this.document.locationFromPosition(t))?this.locationIsCursorTarget(e):void 0},a.prototype.getSelectedDocument=function(){var t;return(t=this.getSelectedRange())?this.document.getDocumentAtRange(t):void 0},a.prototype.getAttachments=function(){return this.attachments.slice(0)},a.prototype.refreshAttachments=function(){var t,e,n,i,r,s,a,u,c,l,h;for(n=this.document.getAttachments(),u=o(this.attachments,n),t=u.added,h=u.removed,i=0,s=h.length;s>i;i++)e=h[i],e.delegate=null,null!=(c=this.delegate)&&"function"==typeof c.compositionDidRemoveAttachment&&c.compositionDidRemoveAttachment(e);for(r=0,a=t.length;a>r;r++)e=t[r],e.delegate=this,null!=(l=this.delegate)&&"function"==typeof l.compositionDidAddAttachment&&l.compositionDidAddAttachment(e);return this.attachments=n},a.prototype.attachmentDidChangeAttributes=function(t){var e;return this.revision++,null!=(e=this.delegate)&&"function"==typeof e.compositionDidEditAttachment?e.compositionDidEditAttachment(t):void 0},a.prototype.editAttachment=function(t){var e;if(t!==this.editingAttachment)return this.stopEditingAttachment(),this.editingAttachment=t,null!=(e=this.delegate)&&"function"==typeof e.compositionDidStartEditingAttachment?e.compositionDidStartEditingAttachment(this.editingAttachment):void 0},a.prototype.stopEditingAttachment=function(){var t;if(this.editingAttachment)return null!=(t=this.delegate)&&"function"==typeof t.compositionDidStopEditingAttachment&&t.compositionDidStopEditingAttachment(this.editingAttachment),this.editingAttachment=null},a.prototype.canEditAttachmentCaption=function(){var t;return null!=(t=this.editingAttachment)?t.isPreviewable():void 0},a.prototype.updateAttributesForAttachment=function(t,e){return this.setDocument(this.document.updateAttributesForAttachment(t,e))},a.prototype.removeAttributeForAttachment=function(t,e){return this.setDocument(this.document.removeAttributeForAttachment(t,e))},a.prototype.getPreviousBlock=function(){var t,e;return(e=this.getLocationRange())&&(t=e[0].index,t>0)?this.document.getBlockAtIndex(t-1):void 0},a.prototype.getBlock=function(){var t;return(t=this.getLocationRange())?this.document.getBlockAtIndex(t[0].index):void 0},a.prototype.getAttachmentAtRange=function(t){var e;return e=this.document.getDocumentAtRange(t),e.toString()===Trix.OBJECT_REPLACEMENT_CHARACTER+"\n"?e.getAttachments()[0]:void 0},a.prototype.notifyDelegateOfCurrentAttributesChange=function(){var t;return null!=(t=this.delegate)&&"function"==typeof t.compositionDidChangeCurrentAttributes?t.compositionDidChangeCurrentAttributes(this.currentAttributes):void 0},a.prototype.notifyDelegateOfInsertionAtRange=function(t){var e;return null!=(e=this.delegate)&&"function"==typeof e.compositionDidPerformInsertionAtRange?e.compositionDidPerformInsertionAtRange(t):void 0},a.prototype.translateUTF16PositionFromOffset=function(t,e){var n,i;return i=this.document.toUTF16String(),n=i.offsetFromUCS2Offset(t),i.offsetToUCS2Offset(n+e)},a}(Trix.BasicObject)}.call(this),function(){var t=function(t,n){function i(){this.constructor=t}for(var o in n)e.call(n,o)&&(t[o]=n[o]);return i.prototype=n.prototype,t.prototype=new i,t.__super__=n.prototype,t},e={}.hasOwnProperty;Trix.UndoManager=function(e){function n(t){this.composition=t,this.undoEntries=[],this.redoEntries=[]}var i;return t(n,e),n.prototype.recordUndoEntry=function(t,e){var n,o,r,s,a;return s=null!=e?e:{},o=s.context,n=s.consolidatable,r=this.undoEntries.slice(-1)[0],n&&i(r,t,o)?void 0:(a=this.createEntry({description:t,context:o}),this.undoEntries.push(a),this.redoEntries=[])},n.prototype.undo=function(){var t,e;return(e=this.undoEntries.pop())?(t=this.createEntry(e),this.redoEntries.push(t),this.composition.loadSnapshot(e.snapshot)):void 0},n.prototype.redo=function(){var t,e;return(t=this.redoEntries.pop())?(e=this.createEntry(t),this.undoEntries.push(e),this.composition.loadSnapshot(t.snapshot)):void 0},n.prototype.canUndo=function(){return this.undoEntries.length>0},n.prototype.canRedo=function(){return this.redoEntries.length>0},n.prototype.createEntry=function(t){var e,n,i;return i=null!=t?t:{},n=i.description,e=i.context,{description:null!=n?n.toString():void 0,context:JSON.stringify(e),snapshot:this.composition.getSnapshot()}},i=function(t,e,n){return(null!=t?t.description:void 0)===(null!=e?e.toString():void 0)&&(null!=t?t.context:void 0)===JSON.stringify(n)},n}(Trix.BasicObject)}.call(this),function(){Trix.Editor=function(){function t(t,e){this.composition=t,this.selectionManager=e,this.undoManager=new Trix.UndoManager(this.composition)}return t.prototype.loadDocument=function(t){return this.loadSnapshot({document:t,selectedRange:[0,0]})},t.prototype.loadHTML=function(t){return null==t&&(t=""),this.loadDocument(Trix.Document.fromHTML(t))},t.prototype.loadJSON=function(t){var e,n;return e=t.document,n=t.selectedRange,e=Trix.Document.fromJSON(e),this.loadSnapshot({document:e,selectedRange:n})},t.prototype.loadSnapshot=function(t){return this.undoManager=new Trix.UndoManager(this.composition),this.composition.loadSnapshot(t)},t.prototype.getDocument=function(){return this.composition.document},t.prototype.getSelectedDocument=function(){return this.composition.getSelectedDocument()},t.prototype.getSnapshot=function(){return this.composition.getSnapshot()},t.prototype.toJSON=function(){return this.getSnapshot()},t.prototype.deleteInDirection=function(t){return this.composition.deleteInDirection(t)},t.prototype.insertAttachment=function(t){return this.composition.insertAttachment(t)},t.prototype.insertDocument=function(t){return this.composition.insertDocument(t)},t.prototype.insertFile=function(t){return this.composition.insertFile(t)},t.prototype.insertHTML=function(t){return this.composition.insertHTML(t)},t.prototype.insertString=function(t){return this.composition.insertString(t)},t.prototype.insertText=function(t){return this.composition.insertText(t)},t.prototype.insertLineBreak=function(){return this.composition.insertLineBreak()},t.prototype.getSelectedRange=function(){return this.composition.getSelectedRange()},t.prototype.getPosition=function(){return this.composition.getPosition()},t.prototype.getClientRectAtPosition=function(t){var e;return e=this.getDocument().locationRangeFromRange([t,t+1]),this.selectionManager.getClientRectAtLocationRange(e)},t.prototype.expandSelectionInDirection=function(t){return this.composition.expandSelectionInDirection(t)},t.prototype.moveCursorInDirection=function(t){return this.composition.moveCursorInDirection(t)},t.prototype.setSelectedRange=function(t){return this.composition.setSelectedRange(t)},t.prototype.activateAttribute=function(t,e){return null==e&&(e=!0),this.composition.setCurrentAttribute(t,e)},t.prototype.attributeIsActive=function(t){return this.composition.hasCurrentAttribute(t)},t.prototype.canActivateAttribute=function(t){return this.composition.canSetCurrentAttribute(t)},t.prototype.deactivateAttribute=function(t){return this.composition.removeCurrentAttribute(t)},t.prototype.canDecreaseIndentationLevel=function(){return this.composition.canDecreaseBlockAttributeLevel()},t.prototype.canIncreaseIndentationLevel=function(){return this.composition.canIncreaseBlockAttributeLevel()},t.prototype.decreaseIndentationLevel=function(){return this.canDecreaseIndentationLevel()?this.composition.decreaseBlockAttributeLevel():void 0},t.prototype.increaseIndentationLevel=function(){return this.canIncreaseIndentationLevel()?this.composition.increaseBlockAttributeLevel():void 0},t.prototype.canRedo=function(){return this.undoManager.canRedo()},t.prototype.canUndo=function(){return this.undoManager.canUndo()},t.prototype.recordUndoEntry=function(t,e){var n,i,o;return o=null!=e?e:{},i=o.context,n=o.consolidatable,this.undoManager.recordUndoEntry(t,{context:i,consolidatable:n})},t.prototype.redo=function(){return this.canRedo()?this.undoManager.redo():void 0},t.prototype.undo=function(){return this.canUndo()?this.undoManager.undo():void 0},t}()}.call(this),function(){var t=function(t,n){function i(){this.constructor=t}for(var o in n)e.call(n,o)&&(t[o]=n[o]);return i.prototype=n.prototype,t.prototype=new i,t.__super__=n.prototype,t},e={}.hasOwnProperty;Trix.ManagedAttachment=function(e){function n(t,e){var n;this.attachmentManager=t,this.attachment=e,n=this.attachment,this.id=n.id,this.file=n.file}return t(n,e),n.prototype.remove=function(){return this.attachmentManager.requestRemovalOfAttachment(this.attachment)},n.proxyMethod("attachment.getAttribute"),n.proxyMethod("attachment.hasAttribute"),n.proxyMethod("attachment.setAttribute"),n.proxyMethod("attachment.getAttributes"),n.proxyMethod("attachment.setAttributes"),n.proxyMethod("attachment.isPending"),n.proxyMethod("attachment.isPreviewable"),n.proxyMethod("attachment.getURL"),n.proxyMethod("attachment.getHref"),n.proxyMethod("attachment.getFilename"),n.proxyMethod("attachment.getFilesize"),n.proxyMethod("attachment.getFormattedFilesize"),n.proxyMethod("attachment.getExtension"),n.proxyMethod("attachment.getContentType"),n.proxyMethod("attachment.getFile"),n.proxyMethod("attachment.setFile"),n.proxyMethod("attachment.releaseFile"),n.proxyMethod("attachment.getUploadProgress"),n.proxyMethod("attachment.setUploadProgress"),n}(Trix.BasicObject)}.call(this),function(){var t=function(t,n){function i(){this.constructor=t}for(var o in n)e.call(n,o)&&(t[o]=n[o]);return i.prototype=n.prototype,t.prototype=new i,t.__super__=n.prototype,t},e={}.hasOwnProperty;Trix.AttachmentManager=function(e){function n(t){var e,n,i;for(null==t&&(t=[]),this.managedAttachments={},n=0,i=t.length;i>n;n++)e=t[n],this.manageAttachment(e)}return t(n,e),n.prototype.getAttachments=function(){var t,e,n,i;n=this.managedAttachments,i=[];for(e in n)t=n[e],i.push(t);return i},n.prototype.manageAttachment=function(t){var e,n;return null!=(e=this.managedAttachments)[n=t.id]?e[n]:e[n]=new Trix.ManagedAttachment(this,t)},n.prototype.attachmentIsManaged=function(t){return t.id in this.managedAttachments},n.prototype.requestRemovalOfAttachment=function(t){var e;return this.attachmentIsManaged(t)&&null!=(e=this.delegate)&&"function"==typeof e.attachmentManagerDidRequestRemovalOfAttachment?e.attachmentManagerDidRequestRemovalOfAttachment(t):void 0},n.prototype.unmanageAttachment=function(t){var e;return e=this.managedAttachments[t.id],delete this.managedAttachments[t.id],e},n}(Trix.BasicObject)}.call(this),function(){var t,e,n,i,o,r,s,a,u,c,l,h;t=Trix.elementContainsNode,e=Trix.findChildIndexOfNode,n=Trix.findClosestElementFromNode,i=Trix.findNodeFromContainerAndOffset,s=Trix.nodeIsBlockStartComment,r=Trix.nodeIsBlockContainer,a=Trix.nodeIsCursorTarget,u=Trix.nodeIsEmptyTextNode,c=Trix.nodeIsTextNode,o=Trix.nodeIsAttachmentElement,l=Trix.tagName,h=Trix.walkTree,Trix.LocationMapper=function(){function n(t){this.element=t}var i,p,d,f;return n.prototype.findLocationFromContainerAndOffset=function(n,i){var o,r,u,l,f,g;for(r=0,u=!1,l={index:0,offset:0},(o=this.findAttachmentElementParentForNode(n))&&(n=o.parentNode,i=e(o)),g=h(this.element,{usingFilter:d});g.nextNode();){if(f=g.currentNode,f===n&&c(n)){a(f)||(l.offset+=i);break}if(f.parentNode===n){if(r++===i)break}else if(!t(n,f)&&r>0)break;s(f)?(u&&l.index++,l.offset=0,u=!0):l.offset+=p(f)}return l},n.prototype.findContainerAndOffsetFromLocation=function(t){var n,i,o,s,a,u;if(0===t.index&&0===t.offset){for(n=this.element,s=0;n.firstChild;)if(n=n.firstChild,r(n)){s=1;break}return[n,s]}if(a=this.findNodeAndOffsetFromLocation(t),i=a[0],o=a[1],i){if(c(i))n=i,u=i.textContent,s=t.offset-o;else{if(n=i.parentNode,!r(n))for(;i===n.lastChild&&(i=n,n=n.parentNode,!r(n)););s=e(i),0!==t.offset&&s++}return[n,s]}},n.prototype.findNodeAndOffsetFromLocation=function(t){var e,n,i,o,r,s,u,l;for(u=0,l=this.getSignificantNodesForIndex(t.index),n=0,i=l.length;i>n;n++){if(e=l[n],o=p(e),t.offset<=u+o)if(c(e)){if(r=e,s=u,t.offset===s&&a(r))break}else r||(r=e,s=u);if(u+=o,u>t.offset)break}return[r,s]},n.prototype.findAttachmentElementParentForNode=function(t){for(;t&&t!==this.element;){if(o(t))return t;t=t.parentNode}},n.prototype.getSignificantNodesForIndex=function(t){var e,n,o,r,a;for(o=[],a=h(this.element,{usingFilter:i}),r=!1;a.nextNode();)if(n=a.currentNode,s(n)){if("undefined"!=typeof e&&null!==e?e++:e=0,e===t)r=!0;else if(r)break}else r&&o.push(n);return o},p=function(t){var e;return t.nodeType===Node.TEXT_NODE?a(t)?0:(e=t.textContent,e.length):"br"===l(t)||o(t)?1:0},i=function(t){return f(t)===NodeFilter.FILTER_ACCEPT?d(t):NodeFilter.FILTER_REJECT},f=function(t){return u(t)?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT},d=function(t){return o(t.parentNode)?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT},n}()}.call(this),function(){var t=function(t,e){return function(){return t.apply(e,arguments)}},e=function(t,e){function i(){this.constructor=t}for(var o in e)n.call(e,o)&&(t[o]=e[o]);return i.prototype=e.prototype,t.prototype=new i,t.__super__=e.prototype,t},n={}.hasOwnProperty,i=[].indexOf||function(t){for(var e=0,n=this.length;n>e;e++)if(e in this&&this[e]===t)return e;return-1};Trix.SelectionChangeObserver=function(n){function o(){this.run=t(this.run,this),this.update=t(this.update,this),this.selectionManagers=[]}var r,s;return e(o,n),o.prototype.start=function(){return this.started?void 0:(this.started=!0,"onselectionchange"in document?document.addEventListener("selectionchange",this.update,!0):this.run())},o.prototype.stop=function(){return this.started?(this.started=!1,document.removeEventListener("selectionchange",this.update,!0)):void 0},o.prototype.registerSelectionManager=function(t){return i.call(this.selectionManagers,t)<0?(this.selectionManagers.push(t),this.start()):void 0},o.prototype.unregisterSelectionManager=function(t){var e;return this.selectionManagers=function(){var n,i,o,r;for(o=this.selectionManagers,r=[],n=0,i=o.length;i>n;n++)e=o[n],e!==t&&r.push(e);return r}.call(this),0===this.selectionManagers.length?this.stop():void 0},o.prototype.notifySelectionManagersOfSelectionChange=function(){var t,e,n,i,o;for(n=this.selectionManagers,i=[],t=0,e=n.length;e>t;t++)o=n[t],i.push(o.selectionDidChange());return i},o.prototype.update=function(){var t;return t=s(),r(t,this.domRange)?void 0:(this.domRange=t,this.notifySelectionManagersOfSelectionChange())},o.prototype.reset=function(){return this.domRange=null,this.update()},o.prototype.run=function(){return this.started?(this.update(),requestAnimationFrame(this.run)):void 0},s=function(){var t;return t=window.getSelection(),t.rangeCount>0?t.getRangeAt(0):void 0},r=function(t,e){return(null!=t?t.startContainer:void 0)===(null!=e?e.startContainer:void 0)&&(null!=t?t.startOffset:void 0)===(null!=e?e.startOffset:void 0)&&(null!=t?t.endContainer:void 0)===(null!=e?e.endContainer:void 0)&&(null!=t?t.endOffset:void 0)===(null!=e?e.endOffset:void 0)},o}(Trix.BasicObject),null==Trix.selectionChangeObserver&&(Trix.selectionChangeObserver=new Trix.SelectionChangeObserver)}.call(this),function(){var t,e,n,i,o,r,s,a,u,c=function(t,e){return function(){return t.apply(e,arguments)}},l=function(t,e){function n(){this.constructor=t}for(var i in e)h.call(e,i)&&(t[i]=e[i]);return n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype,t},h={}.hasOwnProperty,p=[].slice;t=Trix.defer,e=Trix.elementContainsNode,r=Trix.nodeIsCursorTarget,o=Trix.innerElementIsActive,n=Trix.handleEvent,i=Trix.handleEventOnce,s=Trix.normalizeRange,a=Trix.rangeIsCollapsed,u=Trix.rangesAreEqual,Trix.SelectionManager=function(t){function i(t){this.element=t,this.selectionDidChange=c(this.selectionDidChange,this),this.didMouseDown=c(this.didMouseDown,this),this.locationMapper=new Trix.LocationMapper(this.element),this.lockCount=0,n("mousedown",{onElement:this.element,withCallback:this.didMouseDown})}var h,d,f,g;return l(i,t),i.prototype.getLocationRange=function(t){var e,n;return null==t&&(t={}),e=t.ignoreLock?this.currentLocationRange:null!=(n=this.lockedLocationRange)?n:this.currentLocationRange},i.prototype.setLocationRange=function(t){var e;if(!this.lockedLocationRange)return t=s(t),(e=this.createDOMRangeFromLocationRange(t))?(g(e),this.updateCurrentLocationRange(t)):void 0},i.prototype.setLocationRangeFromPoint=function(t){var e;return(e=this.getLocationRangeAtPoint(t))?this.setLocationRange(e):void 0},i.prototype.getClientRectAtLocationRange=function(t){var e,n;return(e=this.createDOMRangeFromLocationRange(t))?(n=p.call(e.getClientRects()),n.slice(-1)[0]):void 0},i.prototype.locationIsCursorTarget=function(t){var e,n,i;return i=this.findNodeAndOffsetFromLocation(t),e=i[0],n=i[1],r(e)},i.prototype.lock=function(){return 0===this.lockCount++?(this.updateCurrentLocationRange(),this.lockedLocationRange=this.getLocationRange()):void 0},i.prototype.unlock=function(){var t;return 0===--this.lockCount&&(t=this.lockedLocationRange,this.lockedLocationRange=null,null!=t)?this.setLocationRange(t):void 0},i.prototype.preserveSelection=function(t){var e,n,i,o;return n=this.getSelectionEndPoints(),i=this.getLocationRange(),t(),n&&(o=this.getLocationRangeAtPoint(n[0]),e=this.getLocationRangeAtPoint(n[1]),null!=o&&null==e?e=o:null!=e&&null==o&&(o=e),null!=o&&null!=e&&(i=s([o,e]))),i?this.setLocationRange(i):void 0},i.prototype.clearSelection=function(){var t;return null!=(t=f())?t.removeAllRanges():void 0},i.prototype.selectionIsCollapsed=function(){var t;return(null!=(t=d())?t.collapsed:void 0)===!0},i.prototype.selectionIsExpanded=function(){return!this.selectionIsCollapsed()},i.proxyMethod("locationMapper.findLocationFromContainerAndOffset"),i.proxyMethod("locationMapper.findContainerAndOffsetFromLocation"),i.proxyMethod("locationMapper.findNodeAndOffsetFromLocation"),i.prototype.didMouseDown=function(){return this.pauseTemporarily()},i.prototype.pauseTemporarily=function(){var t,i,o,r;return this.paused=!0,i=function(t){return function(){var n,i,s;for(t.paused=!1,clearTimeout(r),i=0,s=o.length;s>i;i++)n=o[i],n.destroy();return e(document,t.element)?t.selectionDidChange():void 0}}(this),r=setTimeout(i,200),o=function(){var e,o,r,s;for(r=["mousemove","keydown"],s=[],e=0,o=r.length;o>e;e++)t=r[e],s.push(n(t,{onElement:document,withCallback:i}));return s}()},i.prototype.selectionDidChange=function(){return this.paused||o(this.element)?void 0:this.updateCurrentLocationRange()},i.prototype.updateCurrentLocationRange=function(t){var e,n;return null==t&&(t=this.createLocationRangeFromDOMRange(d())),u(t,this.currentLocationRange)?void 0:(this.currentLocationRange=t,null!=(e=this.delegate)&&"function"==typeof e.locationRangeDidChange?e.locationRangeDidChange(null!=(n=this.currentLocationRange)?n.slice(0):void 0):void 0)},i.prototype.createDOMRangeFromLocationRange=function(t){var e,n,i,o;return i=this.findContainerAndOffsetFromLocation(t[0]),n=a(t)?i:null!=(o=this.findContainerAndOffsetFromLocation(t[1]))?o:i,null!=i&&null!=n?(e=document.createRange(),e.setStart.apply(e,i),e.setEnd.apply(e,n),e):void 0},i.prototype.createLocationRangeFromDOMRange=function(t){var e,n;if(null!=t&&this.domRangeWithinElement(t)&&(n=this.findLocationFromContainerAndOffset(t.startContainer,t.startOffset)))return t.collapsed||(e=this.findLocationFromContainerAndOffset(t.endContainer,t.endOffset)),s([n,e])},i.prototype.domRangeWithinElement=function(t){return t.collapsed?e(this.element,t.startContainer):e(this.element,t.startContainer)&&e(this.element,t.endContainer)},i.prototype.getLocationRangeAtPoint=function(t){var e,n,i,o,r,s;if(e=t[0],n=t[1],document.caretPositionFromPoint)s=document.caretPositionFromPoint(e,n),r=s.offsetNode,o=s.offset,i=document.createRange(),i.setStart(r,o);else if(document.caretRangeFromPoint)i=document.caretRangeFromPoint(e,n);else if(document.body.createTextRange)try{i=document.body.createTextRange(),i.moveToPoint(e,n),i.select()}catch(a){}return this.createLocationRangeFromDOMRange(null!=i?i:d())},i.prototype.getSelectionEndPoints=function(){var t,e,n,i,o,r;if(t=d())return i=t.getClientRects(),i.length>0?(n=i[0],r=i[i.length-1],e=[n.left,n.top+n.height/2],o=[r.right,r.top+r.height/2],[e,o]):void 0},f=function(){var t;return t=window.getSelection(),t.rangeCount>0?t:void 0},d=function(){var t;return null!=(t=f())?t.getRangeAt(0):void 0},g=function(t){var e;return e=window.getSelection(),e.removeAllRanges(),e.addRange(t),Trix.selectionChangeObserver.update()},h=function(){var t,e;return t=null!=(e=d())?e.getClientRects():void 0,(null!=t?t.length:void 0)?t:void 0},i}(Trix.BasicObject)}.call(this),function(){var t,e,n,i=function(t,e){function n(){this.constructor=t}for(var i in e)o.call(e,i)&&(t[i]=e[i]);return n.prototype=e.prototype,t.prototype=new n,t.__super__=e.prototype,t},o={}.hasOwnProperty,r=[].slice;e=Trix.rangeIsCollapsed,n=Trix.rangesAreEqual,t=Trix.objectsAreEqual,Trix.EditorController=function(o){function s(t){var e,n; -this.editorElement=t.editorElement,e=t.document,n=t.html,this.selectionManager=new Trix.SelectionManager(this.editorElement),this.selectionManager.delegate=this,this.composition=new Trix.Composition,this.composition.delegate=this,this.attachmentManager=new Trix.AttachmentManager(this.composition.getAttachments()),this.attachmentManager.delegate=this,this.inputController=new Trix.InputController(this.editorElement),this.inputController.delegate=this,this.inputController.responder=this.composition,this.compositionController=new Trix.CompositionController(this.editorElement,this.composition),this.compositionController.delegate=this,this.toolbarController=new Trix.ToolbarController(this.editorElement.toolbarElement),this.toolbarController.delegate=this,this.editor=new Trix.Editor(this.composition,this.selectionManager),null!=e?this.editor.loadDocument(e):this.editor.loadHTML(n)}return i(s,o),s.prototype.registerSelectionManager=function(){return Trix.selectionChangeObserver.registerSelectionManager(this.selectionManager)},s.prototype.unregisterSelectionManager=function(){return Trix.selectionChangeObserver.unregisterSelectionManager(this.selectionManager)},s.prototype.compositionDidChangeDocument=function(){return this.editorElement.notify("document-change"),this.handlingInput?void 0:this.render()},s.prototype.compositionDidChangeCurrentAttributes=function(t){return this.currentAttributes=t,this.toolbarController.updateAttributes(this.currentAttributes),this.updateCurrentActions(),this.editorElement.notify("attributes-change",{attributes:this.currentAttributes})},s.prototype.compositionDidPerformInsertionAtRange=function(t){return this.pasting?this.pastedRange=t:void 0},s.prototype.compositionShouldAcceptFile=function(t){return this.editorElement.notify("file-accept",{file:t})},s.prototype.compositionDidAddAttachment=function(t){var e;return e=this.attachmentManager.manageAttachment(t),this.editorElement.notify("attachment-add",{attachment:e})},s.prototype.compositionDidEditAttachment=function(t){var e;return this.compositionController.rerenderViewForObject(t),e=this.attachmentManager.manageAttachment(t),this.editorElement.notify("attachment-edit",{attachment:e})},s.prototype.compositionDidRemoveAttachment=function(t){var e;return e=this.attachmentManager.unmanageAttachment(t),this.editorElement.notify("attachment-remove",{attachment:e})},s.prototype.compositionDidStartEditingAttachment=function(t){var e,n;return n=this.composition.document,e=n.getRangeOfAttachment(t),this.attachmentLocationRange=n.locationRangeFromRange(e),this.compositionController.installAttachmentEditorForAttachment(t),this.selectionManager.setLocationRange(this.attachmentLocationRange)},s.prototype.compositionDidStopEditingAttachment=function(){return this.compositionController.uninstallAttachmentEditor(),this.attachmentLocationRange=null},s.prototype.compositionDidRequestChangingSelectionToLocationRange=function(t){return!this.loadingSnapshot||this.isFocused()?(this.requestedLocationRange=t,this.documentWhenLocationRangeRequested=this.composition.document,this.handlingInput?void 0:this.render()):void 0},s.prototype.compositionWillLoadSnapshot=function(){return this.loadingSnapshot=!0},s.prototype.compositionDidLoadSnapshot=function(){return this.compositionController.refreshViewCache(),this.render(),this.loadingSnapshot=!1},s.prototype.getSelectionManager=function(){return this.selectionManager},s.proxyMethod("getSelectionManager().setLocationRange"),s.proxyMethod("getSelectionManager().getLocationRange"),s.prototype.attachmentManagerDidRequestRemovalOfAttachment=function(t){return this.removeAttachment(t)},s.prototype.compositionControllerWillSyncDocumentView=function(){return this.inputController.editorWillSyncDocumentView(),this.selectionManager.lock(),this.selectionManager.clearSelection()},s.prototype.compositionControllerDidSyncDocumentView=function(){return this.inputController.editorDidSyncDocumentView(),this.selectionManager.unlock(),this.updateCurrentActions(),this.editorElement.notify("sync")},s.prototype.compositionControllerDidRender=function(){return null!=this.requestedLocationRange&&(this.documentWhenLocationRangeRequested.isEqualTo(this.composition.document)&&this.selectionManager.setLocationRange(this.requestedLocationRange),this.composition.updateCurrentAttributes(),this.requestedLocationRange=null,this.documentWhenLocationRangeRequested=null),this.editorElement.notify("render")},s.prototype.compositionControllerDidFocus=function(){return this.toolbarController.hideDialog(),this.editorElement.notify("focus")},s.prototype.compositionControllerDidBlur=function(){return this.editorElement.notify("blur")},s.prototype.compositionControllerDidSelectAttachment=function(t){return this.composition.editAttachment(t)},s.prototype.compositionControllerDidRequestDeselectingAttachment=function(){return this.attachmentLocationRange?this.selectionManager.setLocationRange(this.attachmentLocationRange[1]):void 0},s.prototype.compositionControllerWillUpdateAttachment=function(t){return this.editor.recordUndoEntry("Edit Attachment",{context:t.id,consolidatable:!0})},s.prototype.compositionControllerDidRequestRemovalOfAttachment=function(t){return this.removeAttachment(t)},s.prototype.inputControllerWillHandleInput=function(){return this.handlingInput=!0,this.requestedRender=!1},s.prototype.inputControllerDidRequestRender=function(){return this.requestedRender=!0},s.prototype.inputControllerDidHandleInput=function(){return this.handlingInput=!1,this.requestedRender?(this.requestedRender=!1,this.render()):void 0},s.prototype.inputControllerWillPerformTyping=function(){return this.recordTypingUndoEntry()},s.prototype.inputControllerWillCutText=function(){return this.editor.recordUndoEntry("Cut")},s.prototype.inputControllerWillPasteText=function(){return this.editor.recordUndoEntry("Paste"),this.pasting=!0},s.prototype.inputControllerDidPaste=function(t){var e;return e=this.pastedRange,this.pastedRange=null,this.pasting=null,this.editorElement.notify("paste",{pasteData:t,range:e}),this.render()},s.prototype.inputControllerWillMoveText=function(){return this.editor.recordUndoEntry("Move")},s.prototype.inputControllerWillAttachFiles=function(){return this.editor.recordUndoEntry("Drop Files")},s.prototype.inputControllerDidReceiveKeyboardCommand=function(t){return this.toolbarController.applyKeyboardCommand(t)},s.prototype.inputControllerDidStartDrag=function(){return this.locationRangeBeforeDrag=this.selectionManager.getLocationRange()},s.prototype.inputControllerDidReceiveDragOverPoint=function(t){return this.selectionManager.setLocationRangeFromPoint(t)},s.prototype.inputControllerDidCancelDrag=function(){return this.selectionManager.setLocationRange(this.locationRangeBeforeDrag),this.locationRangeBeforeDrag=null},s.prototype.locationRangeDidChange=function(t){return this.composition.updateCurrentAttributes(),this.updateCurrentActions(),this.attachmentLocationRange&&!n(this.attachmentLocationRange,t)&&this.composition.stopEditingAttachment(),this.editorElement.notify("selection-change")},s.prototype.toolbarDidClickButton=function(){return this.getLocationRange()?void 0:this.setLocationRange({index:0,offset:0})},s.prototype.toolbarDidInvokeAction=function(t){return this.invokeAction(t)},s.prototype.toolbarDidToggleAttribute=function(t){return this.recordFormattingUndoEntry(),this.composition.toggleCurrentAttribute(t),this.render(),this.editorElement.focus()},s.prototype.toolbarDidUpdateAttribute=function(t,e){return this.recordFormattingUndoEntry(),this.composition.setCurrentAttribute(t,e),this.render(),this.editorElement.focus()},s.prototype.toolbarDidRemoveAttribute=function(t){return this.recordFormattingUndoEntry(),this.composition.removeCurrentAttribute(t),this.render(),this.editorElement.focus()},s.prototype.toolbarWillShowDialog=function(){return this.composition.expandSelectionForEditing(),this.freezeSelection()},s.prototype.toolbarDidShowDialog=function(t){return this.editorElement.notify("toolbar-dialog-show",{dialogName:t})},s.prototype.toolbarDidHideDialog=function(t){return this.editorElement.focus(),this.thawSelection(),this.editorElement.notify("toolbar-dialog-hide",{dialogName:t})},s.prototype.freezeSelection=function(){return this.selectionFrozen?void 0:(this.selectionManager.lock(),this.composition.freezeSelection(),this.selectionFrozen=!0,this.render())},s.prototype.thawSelection=function(){return this.selectionFrozen?(this.composition.thawSelection(),this.selectionManager.unlock(),this.selectionFrozen=!1,this.render()):void 0},s.prototype.actions={undo:{test:function(){return this.editor.canUndo()},perform:function(){return this.editor.undo()}},redo:{test:function(){return this.editor.canRedo()},perform:function(){return this.editor.redo()}},link:{test:function(){return this.editor.canActivateAttribute("href")}},increaseBlockLevel:{test:function(){return this.editor.canIncreaseIndentationLevel()},perform:function(){return this.editor.increaseIndentationLevel()&&this.render()}},decreaseBlockLevel:{test:function(){return this.editor.canDecreaseIndentationLevel()},perform:function(){return this.editor.decreaseIndentationLevel()&&this.render()}}},s.prototype.canInvokeAction=function(t){var e,n;return this.actionIsExternal(t)?!0:!!(null!=(e=this.actions[t])&&null!=(n=e.test)?n.call(this):void 0)},s.prototype.invokeAction=function(t){var e,n;return this.actionIsExternal(t)?this.editorElement.notify("action-invoke",{actionName:t}):null!=(e=this.actions[t])&&null!=(n=e.perform)?n.call(this):void 0},s.prototype.actionIsExternal=function(t){return/^x-./.test(t)},s.prototype.getCurrentActions=function(){var t,e;e={};for(t in this.actions)e[t]=this.canInvokeAction(t);return e},s.prototype.updateCurrentActions=function(){var e;return e=this.getCurrentActions(),t(e,this.currentActions)?void 0:(this.currentActions=e,this.toolbarController.updateActions(this.currentActions),this.editorElement.notify("actions-change",{actions:this.currentActions}))},s.prototype.reparse=function(){return this.composition.replaceHTML(this.editorElement.innerHTML)},s.prototype.render=function(){return this.compositionController.render()},s.prototype.removeAttachment=function(t){return this.editor.recordUndoEntry("Delete Attachment"),this.composition.removeAttachment(t),this.render()},s.prototype.recordFormattingUndoEntry=function(){var t;return t=this.selectionManager.getLocationRange(),e(t)?void 0:this.editor.recordUndoEntry("Formatting",{context:this.getUndoContext(),consolidatable:!0})},s.prototype.recordTypingUndoEntry=function(){return this.editor.recordUndoEntry("Typing",{context:this.getUndoContext(this.currentAttributes),consolidatable:!0})},s.prototype.getUndoContext=function(){var t;return t=1<=arguments.length?r.call(arguments,0):[],[this.getLocationContext(),this.getTimeContext()].concat(r.call(t))},s.prototype.getLocationContext=function(){var t;return t=this.selectionManager.getLocationRange(),e(t)?t[0].index:t},s.prototype.getTimeContext=function(){return Trix.config.undoInterval>0?Math.floor((new Date).getTime()/Trix.config.undoInterval):0},s.prototype.isFocused=function(){var t;return this.editorElement===(null!=(t=this.editorElement.ownerDocument)?t.activeElement:void 0)},s}(Trix.Controller)}.call(this),function(){var t,e,n,i,o,r;o=Trix.makeElement,r=Trix.triggerEvent,n=Trix.handleEvent,i=Trix.handleEventOnce,e=Trix.defer,t=Trix.AttachmentView.attachmentSelector,Trix.registerElement("trix-editor",function(){var e,s,a,u,c,l;return u=0,e=function(t){return!document.querySelector(":focus")&&t.hasAttribute("autofocus")&&document.querySelector("[autofocus]")===t?t.focus():void 0},c=function(t){return t.hasAttribute("contenteditable")?void 0:(t.setAttribute("contenteditable",""),i("focus",{onElement:t,withCallback:function(){return s(t)}}))},s=function(t){return a(t),l(t)},a=function(t){return("function"==typeof document.queryCommandSupported?document.queryCommandSupported("enableObjectResizing"):void 0)?(document.execCommand("enableObjectResizing",!1,!1),n("mscontrolselect",{onElement:t,preventDefault:!0})):void 0},l=function(){var t;return("function"==typeof document.queryCommandSupported?document.queryCommandSupported("DefaultParagraphSeparator"):void 0)&&(t=Trix.config.blockAttributes["default"].tagName,"div"===t||"p"===t)?document.execCommand("DefaultParagraphSeparator",!1,t):void 0},{defaultCSS:"%t:empty:not(:focus)::before {\n content: attr(placeholder);\n color: graytext;\n}\n\n%t a[contenteditable=false] {\n cursor: text;\n}\n\n%t img {\n max-width: 100%;\n height: auto;\n}\n\n%t "+t+" figcaption textarea {\n resize: none;\n}\n\n%t "+t+" figcaption textarea.trix-autoresize-clone {\n position: absolute;\n left: -9999px;\n max-height: 0px;\n}",trixId:{get:function(){return this.hasAttribute("trix-id")?this.getAttribute("trix-id"):(this.setAttribute("trix-id",++u),this.trixId)}},toolbarElement:{get:function(){var t,e,n;return this.hasAttribute("toolbar")?null!=(e=this.ownerDocument)?e.getElementById(this.getAttribute("toolbar")):void 0:this.parentElement?(n="trix-toolbar-"+this.trixId,this.setAttribute("toolbar",n),t=o("trix-toolbar",{id:n}),this.parentElement.insertBefore(t,this),t):void 0}},inputElement:{get:function(){var t,e,n;return this.hasAttribute("input")?null!=(n=this.ownerDocument)?n.getElementById(this.getAttribute("input")):void 0:this.parentElement?(e="trix-input-"+this.trixId,this.setAttribute("input",e),t=o("input",{type:"hidden",id:e}),this.parentElement.insertBefore(t,this.nextElementSibling),t):void 0}},editor:{get:function(){var t;return null!=(t=this.editorController)?t.editor:void 0}},name:{get:function(){var t;return null!=(t=this.inputElement)?t.name:void 0}},value:{get:function(){var t;return null!=(t=this.inputElement)?t.value:void 0},set:function(t){var e;return this.defaultValue=t,null!=(e=this.editor)?e.loadHTML(this.defaultValue):void 0}},notify:function(t,e){var n;switch(t){case"document-change":this.documentChangedSinceLastRender=!0;break;case"render":this.documentChangedSinceLastRender&&(this.documentChangedSinceLastRender=!1,this.notify("change"));break;case"change":case"attachment-add":case"attachment-edit":case"attachment-remove":null!=(n=this.inputElement)&&(n.value=Trix.serializeToContentType(this,"text/html"))}return this.editorController?r("trix-"+t,{onElement:this,attributes:e}):void 0},createdCallback:function(){return c(this)},attachedCallback:function(){return e(this),null==this.editorController&&(this.editorController=new Trix.EditorController({editorElement:this,html:this.defaultValue=this.value})),this.editorController.registerSelectionManager(),this.registerResetListener(),requestAnimationFrame(function(t){return function(){return t.notify("initialize")}}(this))},detachedCallback:function(){var t;return null!=(t=this.editorController)&&t.unregisterSelectionManager(),this.unregisterResetListener()},registerResetListener:function(){return this.resetListener=this.resetBubbled.bind(this),window.addEventListener("reset",this.resetListener,!1)},unregisterResetListener:function(){return window.removeEventListener("reset",this.resetListener,!1)},resetBubbled:function(t){var e;return t.target!==(null!=(e=this.inputElement)?e.form:void 0)||t.defaultPrevented?void 0:this.reset()},reset:function(){return this.value=this.defaultValue}}}())}.call(this); \ No newline at end of file diff --git a/templates/vendor/assets/stylesheets/jquery.datetimepicker.css b/templates/vendor/assets/stylesheets/jquery.datetimepicker.css deleted file mode 100644 index 198041d..0000000 --- a/templates/vendor/assets/stylesheets/jquery.datetimepicker.css +++ /dev/null @@ -1,418 +0,0 @@ -.xdsoft_datetimepicker{ - box-shadow: 0 5px 15px -5px rgba(0, 0, 0, 0.506); - background: #FFFFFF; - border-bottom: 1px solid #BBBBBB; - border-left: 1px solid #CCCCCC; - border-right: 1px solid #CCCCCC; - border-top: 1px solid #CCCCCC; - color: #333333; - font-family: "Helvetica Neue", "Helvetica", "Arial", sans-serif; - padding: 8px; - padding-left: 0; - padding-top: 2px; - position: absolute; - z-index: 9999; - -moz-box-sizing: border-box; - box-sizing: border-box; - display:none; -} - -.xdsoft_datetimepicker iframe { - position: absolute; - left: 0; - top: 0; - width: 75px; - height: 210px; - background: transparent; - border:none; -} -/*For IE8 or lower*/ -.xdsoft_datetimepicker button { - border:none !important; -} - -.xdsoft_noselect{ - -webkit-touch-callout: none; - -webkit-user-select: none; - -khtml-user-select: none; - -moz-user-select: none; - -ms-user-select: none; - -o-user-select: none; - user-select: none; -} -.xdsoft_noselect::selection { background: transparent; } -.xdsoft_noselect::-moz-selection { background: transparent; } -.xdsoft_datetimepicker.xdsoft_inline{ - display: inline-block; - position: static; - box-shadow: none; -} -.xdsoft_datetimepicker *{ - -moz-box-sizing: border-box; - box-sizing: border-box; - padding: 0; - margin: 0; -} -.xdsoft_datetimepicker .xdsoft_datepicker, .xdsoft_datetimepicker .xdsoft_timepicker{ - display:none; -} -.xdsoft_datetimepicker .xdsoft_datepicker.active, .xdsoft_datetimepicker .xdsoft_timepicker.active{ - display:block; -} -.xdsoft_datetimepicker .xdsoft_datepicker{ - width: 224px; - float:left; - margin-left:8px; -} -.xdsoft_datetimepicker.xdsoft_showweeks .xdsoft_datepicker{ - width: 256px; -} -.xdsoft_datetimepicker .xdsoft_timepicker{ - width: 58px; - float:left; - text-align:center; - margin-left:8px; - margin-top: 0; -} -.xdsoft_datetimepicker .xdsoft_datepicker.active+.xdsoft_timepicker{ - margin-top:8px; - margin-bottom:3px -} -.xdsoft_datetimepicker .xdsoft_mounthpicker{ - position: relative; - text-align: center; -} - -.xdsoft_datetimepicker .xdsoft_label i, -.xdsoft_datetimepicker .xdsoft_prev, -.xdsoft_datetimepicker .xdsoft_next, -.xdsoft_datetimepicker .xdsoft_today_button{ - background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGQAAAAeCAYAAADaW7vzAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyJpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMy1jMDExIDY2LjE0NTY2MSwgMjAxMi8wMi8wNi0xNDo1NjoyNyAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNiAoV2luZG93cykiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6Q0NBRjI1NjM0M0UwMTFFNDk4NkFGMzJFQkQzQjEwRUIiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6Q0NBRjI1NjQ0M0UwMTFFNDk4NkFGMzJFQkQzQjEwRUIiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDpDQ0FGMjU2MTQzRTAxMUU0OTg2QUYzMkVCRDNCMTBFQiIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDpDQ0FGMjU2MjQzRTAxMUU0OTg2QUYzMkVCRDNCMTBFQiIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/PoNEP54AAAIOSURBVHja7Jq9TsMwEMcxrZD4WpBYeKUCe+kTMCACHZh4BFfHO/AAIHZGFhYkBBsSEqxsLCAgXKhbXYOTxh9pfJVP+qutnZ5s/5Lz2Y5I03QhWji2GIcgAokWgfCxNvcOCCGKqiSqhUp0laHOne05vdEyGMfkdxJDVjgwDlEQgYQBgx+ULJaWSXXS6r/ER5FBVR8VfGftTKcITNs+a1XpcFoExREIDF14AVIFxgQUS+h520cdud6wNkC0UBw6BCO/HoCYwBhD8QCkQ/x1mwDyD4plh4D6DDV0TAGyo4HcawLIBBSLDkHeH0Mg2yVP3l4TQMZQDDsEOl/MgHQqhMNuE0D+oBh0CIr8MAKyazBH9WyBuKxDWgbXfjNf32TZ1KWm/Ap1oSk/R53UtQ5xTh3LUlMmT8gt6g51Q9p+SobxgJQ/qmsfZhWywGFSl0yBjCLJCMgXail3b7+rumdVJ2YRss4cN+r6qAHDkPWjPjdJCF4n9RmAD/V9A/Wp4NQassDjwlB6XBiCxcJQWmZZb8THFilfy/lfrTvLghq2TqTHrRMTKNJ0sIhdo15RT+RpyWwFdY96UZ/LdQKBGjcXpcc1AlSFEfLmouD+1knuxBDUVrvOBmoOC/rEcN7OQxKVeJTCiAdUzUJhA2Oez9QTkp72OTVcxDcXY8iKNkxGAJXmJCOQwOa6dhyXsOa6XwEGAKdeb5ET3rQdAAAAAElFTkSuQmCC); -} - -.xdsoft_datetimepicker .xdsoft_label i{ - opacity:0.5; - background-position:-92px -19px; - display: inline-block; - width: 9px; - height: 20px; - vertical-align: middle; -} - -.xdsoft_datetimepicker .xdsoft_prev{ - float: left; - background-position:-20px 0; -} -.xdsoft_datetimepicker .xdsoft_today_button{ - float: left; - background-position:-70px 0; - margin-left:5px; -} - -.xdsoft_datetimepicker .xdsoft_next{ - float: right; - background-position: 0 0; -} - -.xdsoft_datetimepicker .xdsoft_next, -.xdsoft_datetimepicker .xdsoft_prev , -.xdsoft_datetimepicker .xdsoft_today_button{ - background-color: transparent; - background-repeat: no-repeat; - border: 0 none currentColor; - cursor: pointer; - display: block; - height: 30px; - opacity: 0.5; - -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=50)"; - outline: medium none currentColor; - overflow: hidden; - padding: 0; - position: relative; - text-indent: 100%; - white-space: nowrap; - width: 20px; -} -.xdsoft_datetimepicker .xdsoft_timepicker .xdsoft_prev, -.xdsoft_datetimepicker .xdsoft_timepicker .xdsoft_next{ - float:none; - background-position:-40px -15px; - height: 15px; - width: 30px; - display: block; - margin-left:14px; - margin-top:7px; -} -.xdsoft_datetimepicker .xdsoft_timepicker .xdsoft_prev{ - background-position:-40px 0; - margin-bottom:7px; - margin-top: 0; -} -.xdsoft_datetimepicker .xdsoft_timepicker .xdsoft_time_box{ - height:151px; - overflow:hidden; - border-bottom:1px solid #DDDDDD; -} -.xdsoft_datetimepicker .xdsoft_timepicker .xdsoft_time_box >div >div{ - background: #F5F5F5; - border-top:1px solid #DDDDDD; - color: #666666; - font-size: 12px; - text-align: center; - border-collapse:collapse; - cursor:pointer; - border-bottom-width: 0; - height:25px; - line-height:25px; -} - -.xdsoft_datetimepicker .xdsoft_timepicker .xdsoft_time_box >div > div:first-child{ - border-top-width: 0; -} -.xdsoft_datetimepicker .xdsoft_today_button:hover, -.xdsoft_datetimepicker .xdsoft_next:hover, -.xdsoft_datetimepicker .xdsoft_prev:hover { - opacity: 1; - -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=100)"; -} -.xdsoft_datetimepicker .xdsoft_label{ - display: inline; - position: relative; - z-index: 9999; - margin: 0; - padding: 5px 3px; - font-size: 14px; - line-height: 20px; - font-weight: bold; - background-color: #fff; - float:left; - width:182px; - text-align:center; - cursor:pointer; -} -.xdsoft_datetimepicker .xdsoft_label:hover>span{ - text-decoration:underline; -} -.xdsoft_datetimepicker .xdsoft_label:hover i{ - opacity:1.0; -} -.xdsoft_datetimepicker .xdsoft_label > .xdsoft_select{ - border:1px solid #ccc; - position:absolute; - right: 0; - top:30px; - z-index:101; - display:none; - background:#fff; - max-height:160px; - overflow-y:hidden; -} -.xdsoft_datetimepicker .xdsoft_label > .xdsoft_select.xdsoft_monthselect{right:-7px;} -.xdsoft_datetimepicker .xdsoft_label > .xdsoft_select.xdsoft_yearselect{right:2px;} -.xdsoft_datetimepicker .xdsoft_label > .xdsoft_select > div > .xdsoft_option:hover{ - color: #fff; - background: #ff8000; -} -.xdsoft_datetimepicker .xdsoft_label > .xdsoft_select > div > .xdsoft_option{ - padding:2px 10px 2px 5px; - text-decoration:none !important; -} -.xdsoft_datetimepicker .xdsoft_label > .xdsoft_select > div > .xdsoft_option.xdsoft_current{ - background: #33AAFF; - box-shadow: #178FE5 0 1px 3px 0 inset; - color:#fff; - font-weight: 700; -} -.xdsoft_datetimepicker .xdsoft_month{ - width:100px; - text-align:right; -} -.xdsoft_datetimepicker .xdsoft_calendar{ - clear:both; -} -.xdsoft_datetimepicker .xdsoft_year{ - width: 48px; - margin-left: 5px; -} -.xdsoft_datetimepicker .xdsoft_calendar table{ - border-collapse:collapse; - width:100%; - -} -.xdsoft_datetimepicker .xdsoft_calendar td > div{ - padding-right:5px; -} -.xdsoft_datetimepicker .xdsoft_calendar th{ - height: 25px; -} -.xdsoft_datetimepicker .xdsoft_calendar td,.xdsoft_datetimepicker .xdsoft_calendar th{ - width:14.2857142%; - background: #F5F5F5; - border:1px solid #DDDDDD; - color: #666666; - font-size: 12px; - text-align: right; - vertical-align: middle; - padding: 0; - border-collapse:collapse; - cursor:pointer; - height: 25px; -} -.xdsoft_datetimepicker.xdsoft_showweeks .xdsoft_calendar td,.xdsoft_datetimepicker.xdsoft_showweeks .xdsoft_calendar th{ - width:12.5%; -} -.xdsoft_datetimepicker .xdsoft_calendar th{ - background: #F1F1F1; -} -.xdsoft_datetimepicker .xdsoft_calendar td.xdsoft_today{ - color:#33AAFF; -} -.xdsoft_datetimepicker .xdsoft_calendar td.xdsoft_default, -.xdsoft_datetimepicker .xdsoft_calendar td.xdsoft_current, -.xdsoft_datetimepicker .xdsoft_timepicker .xdsoft_time_box >div >div.xdsoft_current{ - background: #33AAFF; - box-shadow: #178FE5 0 1px 3px 0 inset; - color:#fff; - font-weight: 700; -} -.xdsoft_datetimepicker .xdsoft_calendar td.xdsoft_other_month, -.xdsoft_datetimepicker .xdsoft_calendar td.xdsoft_disabled, -.xdsoft_datetimepicker .xdsoft_time_box >div >div.xdsoft_disabled{ - opacity:0.5; - -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=50)"; -} -.xdsoft_datetimepicker .xdsoft_calendar td.xdsoft_other_month.xdsoft_disabled{ - opacity:0.2; - -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=20)"; -} -.xdsoft_datetimepicker .xdsoft_calendar td:hover, -.xdsoft_datetimepicker .xdsoft_timepicker .xdsoft_time_box >div >div:hover{ - color: #fff !important; - background: #ff8000 !important; - box-shadow: none !important; -} -.xdsoft_datetimepicker .xdsoft_calendar td.xdsoft_disabled:hover, -.xdsoft_datetimepicker .xdsoft_timepicker .xdsoft_time_box >div >div.xdsoft_disabled:hover{ - color: inherit !important; - background: inherit !important; - box-shadow: inherit !important; -} -.xdsoft_datetimepicker .xdsoft_calendar th{ - font-weight: 700; - text-align: center; - color: #999; - cursor:default; -} -.xdsoft_datetimepicker .xdsoft_copyright{ color:#ccc !important; font-size:10px;clear:both;float:none;margin-left:8px;} -.xdsoft_datetimepicker .xdsoft_copyright a{ color:#eee !important;} -.xdsoft_datetimepicker .xdsoft_copyright a:hover{ color:#aaa !important;} - - -.xdsoft_time_box{ - position:relative; - border:1px solid #ccc; -} -.xdsoft_scrollbar >.xdsoft_scroller{ - background:#ccc !important; - height:20px; - border-radius:3px; -} -.xdsoft_scrollbar{ - position:absolute; - width:7px; - right: 0; - top: 0; - bottom: 0; - cursor:pointer; -} -.xdsoft_scroller_box{ -position:relative; -} - - -.xdsoft_datetimepicker.xdsoft_dark{ - box-shadow: 0 5px 15px -5px rgba(255, 255, 255, 0.506); - background: #000000; - border-bottom: 1px solid #444444; - border-left: 1px solid #333333; - border-right: 1px solid #333333; - border-top: 1px solid #333333; - color: #cccccc; -} - -.xdsoft_datetimepicker.xdsoft_dark .xdsoft_timepicker .xdsoft_time_box{ - border-bottom:1px solid #222222; -} -.xdsoft_datetimepicker.xdsoft_dark .xdsoft_timepicker .xdsoft_time_box >div >div{ - background: #0a0a0a; - border-top:1px solid #222222; - color: #999999; -} - -.xdsoft_datetimepicker.xdsoft_dark .xdsoft_label{ - background-color: #000; -} -.xdsoft_datetimepicker.xdsoft_dark .xdsoft_label > .xdsoft_select{ - border:1px solid #333; - background:#000; -} - -.xdsoft_datetimepicker.xdsoft_dark .xdsoft_label > .xdsoft_select > div > .xdsoft_option:hover{ - color: #000; - background: #007fff; -} - -.xdsoft_datetimepicker.xdsoft_dark .xdsoft_label > .xdsoft_select > div > .xdsoft_option.xdsoft_current{ - background: #cc5500; - box-shadow: #b03e00 0 1px 3px 0 inset; - color:#000; -} - -.xdsoft_datetimepicker.xdsoft_dark .xdsoft_label i, -.xdsoft_datetimepicker.xdsoft_dark .xdsoft_prev, -.xdsoft_datetimepicker.xdsoft_dark .xdsoft_next, -.xdsoft_datetimepicker.xdsoft_dark .xdsoft_today_button{ - background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAGQAAAAeCAYAAADaW7vzAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAyJpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMy1jMDExIDY2LjE0NTY2MSwgMjAxMi8wMi8wNi0xNDo1NjoyNyAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvIiB4bWxuczp4bXBNTT0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wL21tLyIgeG1sbnM6c3RSZWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZVJlZiMiIHhtcDpDcmVhdG9yVG9vbD0iQWRvYmUgUGhvdG9zaG9wIENTNiAoV2luZG93cykiIHhtcE1NOkluc3RhbmNlSUQ9InhtcC5paWQ6QUExQUUzOTA0M0UyMTFFNDlBM0FFQTJENTExRDVBODYiIHhtcE1NOkRvY3VtZW50SUQ9InhtcC5kaWQ6QUExQUUzOTE0M0UyMTFFNDlBM0FFQTJENTExRDVBODYiPiA8eG1wTU06RGVyaXZlZEZyb20gc3RSZWY6aW5zdGFuY2VJRD0ieG1wLmlpZDpBQTFBRTM4RTQzRTIxMUU0OUEzQUVBMkQ1MTFENUE4NiIgc3RSZWY6ZG9jdW1lbnRJRD0ieG1wLmRpZDpBQTFBRTM4RjQzRTIxMUU0OUEzQUVBMkQ1MTFENUE4NiIvPiA8L3JkZjpEZXNjcmlwdGlvbj4gPC9yZGY6UkRGPiA8L3g6eG1wbWV0YT4gPD94cGFja2V0IGVuZD0iciI/Pp0VxGEAAAIASURBVHja7JrNSgMxEMebtgh+3MSLr1T1Xn2CHoSKB08+QmR8Bx9A8e7RixdB9CKCoNdexIugxFlJa7rNZneTbLIpM/CnNLsdMvNjM8l0mRCiQ9Ye61IKCAgZAUnH+mU3MMZaHYChBnJUDzWOFZdVfc5+ZFLbrWDeXPwbxIqrLLfaeS0hEBVGIRQCEiZoHQwtlGSByCCdYBl8g8egTTAWoKQMRBRBcZxYlhzhKegqMOageErsCHVkk3hXIFooDgHB1KkHIHVgzKB4ADJQ/A1jAFmAYhkQqA5TOBtocrKrgXwQA8gcFIuAIO8sQSA7hidvPwaQGZSaAYHOUWJABhWWw2EMIH9QagQERU4SArJXo0ZZL18uvaxejXt/Em8xjVBXmvFr1KVm/AJ10tRe2XnraNqaJvKE3KHuUbfK1E+VHB0q40/y3sdQSxY4FHWeKJCunP8UyDdqJZenT3ntVV5jIYCAh20vT7ioP8tpf6E2lfEMwERe+whV1MHjwZB7PBiCxcGQWwKZKD62lfGNnP/1poFAA60T7rF1UgcKd2id3KDeUS+oLWV8DfWAepOfq00CgQabi9zjcgJVYVD7PVzQUAUGAQkbNJTBICDhgwYTjDYD6XeW08ZKh+A4pYkzenOxXUbvZcWz7E8ykRMnIHGX1XPl+1m2vPYpL+2qdb8CDAARlKFEz/ZVkAAAAABJRU5ErkJggg==); -} - -.xdsoft_datetimepicker.xdsoft_dark .xdsoft_calendar td, -.xdsoft_datetimepicker.xdsoft_dark .xdsoft_calendar th{ - background: #0a0a0a; - border:1px solid #222222; - color: #999999; -} - -.xdsoft_datetimepicker.xdsoft_dark .xdsoft_calendar th{ - background: #0e0e0e; -} -.xdsoft_datetimepicker.xdsoft_dark .xdsoft_calendar td.xdsoft_today{ - color:#cc5500; -} -.xdsoft_datetimepicker.xdsoft_dark .xdsoft_calendar td.xdsoft_default, -.xdsoft_datetimepicker.xdsoft_dark .xdsoft_calendar td.xdsoft_current, -.xdsoft_datetimepicker.xdsoft_dark .xdsoft_timepicker .xdsoft_time_box >div >div.xdsoft_current{ - background: #cc5500; - box-shadow: #b03e00 0 1px 3px 0 inset; - color:#000; -} - -.xdsoft_datetimepicker.xdsoft_dark .xdsoft_calendar td:hover, -.xdsoft_datetimepicker.xdsoft_dark .xdsoft_timepicker .xdsoft_time_box >div >div:hover{ - color: #000 !important; - background: #007fff !important; -} - -.xdsoft_datetimepicker.xdsoft_dark .xdsoft_calendar th{ - color: #666; -} -.xdsoft_datetimepicker.xdsoft_dark .xdsoft_copyright{ color:#333 !important;} -.xdsoft_datetimepicker.xdsoft_dark .xdsoft_copyright a{ color:#111 !important;} -.xdsoft_datetimepicker.xdsoft_dark .xdsoft_copyright a:hover{ color:#555 !important;} - - -.xdsoft_dark .xdsoft_time_box{ - border:1px solid #333; -} -.xdsoft_dark .xdsoft_scrollbar >.xdsoft_scroller{ - background:#333 !important; -} diff --git a/templates/vendor/assets/stylesheets/nprogress.css b/templates/vendor/assets/stylesheets/nprogress.css deleted file mode 100644 index 4dd61b0..0000000 --- a/templates/vendor/assets/stylesheets/nprogress.css +++ /dev/null @@ -1,74 +0,0 @@ -/* Make clicks pass-through */ -#nprogress { - pointer-events: none; -} - -#nprogress .bar { - background: #1abc9c; - - position: fixed; - z-index: 1200; - top: 0; - left: 0; - - width: 100%; - height: 2px; -} - -/* Fancy blur effect */ -#nprogress .peg { - display: block; - position: absolute; - right: 0px; - width: 100px; - height: 100%; - box-shadow: 0 0 10px #1abc9c, 0 0 5px #1abc9c; - opacity: 1.0; - - -webkit-transform: rotate(3deg) translate(0px, -4px); - -ms-transform: rotate(3deg) translate(0px, -4px); - transform: rotate(3deg) translate(0px, -4px); -} - -/* Remove these to get rid of the spinner */ -#nprogress .spinner { - display: block; - position: fixed; - z-index: 1200; - top: 15px; - right: 15px; -} - -#nprogress .spinner-icon { - width: 18px; - height: 18px; - box-sizing: border-box; - - border: solid 2px transparent; - border-top-color: #1abc9c; - border-left-color: #1abc9c; - border-radius: 50%; - - -webkit-animation: nprogress-spinner 400ms linear infinite; - animation: nprogress-spinner 400ms linear infinite; -} - -.nprogress-custom-parent { - overflow: hidden; - position: relative; -} - -.nprogress-custom-parent #nprogress .spinner, -.nprogress-custom-parent #nprogress .bar { - position: absolute; -} - -@-webkit-keyframes nprogress-spinner { - 0% { -webkit-transform: rotate(0deg); } - 100% { -webkit-transform: rotate(360deg); } -} -@keyframes nprogress-spinner { - 0% { transform: rotate(0deg); } - 100% { transform: rotate(360deg); } -} - diff --git a/templates/vendor/assets/stylesheets/trix.css b/templates/vendor/assets/stylesheets/trix.css deleted file mode 100644 index c06811c..0000000 --- a/templates/vendor/assets/stylesheets/trix.css +++ /dev/null @@ -1,209 +0,0 @@ -@charset "UTF-8"; -/* -Trix 0.9.1 -Copyright © 2015 Basecamp, LLC -http://trix-editor.org/ -*/ -trix-editor { - color: #111; - border: 1px solid #bbb; - border-radius: 3px; - margin: 0; - padding: 4px 8px; - min-height: 54px; - outline: none; } -trix-toolbar * { - box-sizing: border-box; } -trix-toolbar .button_group { - display: inline-block; - font-size: 0; - margin: 0 8px 4px 0; - border: 1px solid #bbb; - border-top-color: #ccc; - border-bottom-color: #888; - border-radius: 5px; - overflow: hidden; } - trix-toolbar .button_group:last-of-type { - margin-right: 0; } - trix-toolbar .button_group button, trix-toolbar .button_group input[type=button] { - position: relative; - font-size: 0; - margin: 0; - height: 28px; - width: 40px; - background: #fff; - border: none; - border-bottom: 1px solid #ddd; } - trix-toolbar .button_group button::before, trix-toolbar .button_group input[type=button]::before { - display: inline-block; - position: absolute; - top: 0; - right: 0; - bottom: 0; - left: 0; - background-position: center; - background-repeat: no-repeat; - opacity: .6; - content: ""; } - trix-toolbar .button_group button.active, trix-toolbar .button_group input[type=button].active { - background: #cbeefa; } - trix-toolbar .button_group button.active::before, trix-toolbar .button_group input[type=button].active::before { - opacity: 1; } - trix-toolbar .button_group button:disabled::before, trix-toolbar .button_group input[type=button]:disabled::before { - opacity: .125; } - trix-toolbar .button_group button:not(:first-child), trix-toolbar .button_group input[type=button]:not(:first-child) { - border-left: 1px solid #ccc; } -trix-toolbar .dialogs { - position: relative; } - trix-toolbar .dialogs .dialog { - position: absolute; - top: 0; - left: 0; - right: 0; - padding: 12px 8px; - line-height: 12px; - background: #fff; - box-shadow: 0 0.3rem 1rem #ccc; - border-top: 2px solid #888; - border-radius: 5px; - z-index: 5; } - trix-toolbar .dialogs .dialog input[type=button] { - font-size: 12px; - height: 24px; - width: 50px; - padding: 1px 8px 0 8px; - width: auto; - opacity: .6; - -webkit-appearance: none; - -webkit-border-radius: 0; } - trix-toolbar .dialogs .dialog input[type=url], trix-toolbar .dialogs .dialog input[type=text] { - display: inline-block; - height: 26px; - font-size: 12px; - padding: 0 8px; - margin: 0 8px 0 0; - border-radius: 5px; - border: 1px solid #bbb; - background-color: #fff; - box-shadow: none; - outline: none; - -webkit-appearance: none; - -moz-appearance: none; } - trix-toolbar .dialogs .dialog input[type=url].validate:invalid, trix-toolbar .dialogs .dialog input[type=text].validate:invalid { - box-shadow: #F00 0px 0px 1.5px 1px; } - trix-toolbar .dialogs .dialog.link_dialog { - min-width: 300px; - max-width: 600px; } - trix-toolbar .dialogs .dialog.link_dialog .button_group { - max-width: 110px; } - trix-toolbar .dialogs .dialog.link_dialog input[type=url] { - float: left; - width: calc(100% - 120px); } -trix-toolbar .button_group button.bold::before { - background-image: url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjRweCIgd2lkdGg9IjI0cHgiIHZlcnNpb249IjEuMSIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHZpZXdCb3g9IjAgMCAyNCAyNCI%2BCiA8cGF0aCBpZD0iU2hhcGUiIGZpbGw9IiMwMDAiIGQ9Im0xNS42IDExLjc5YzAuOTY1LTAuNjc1IDEuNjUtMS43NjUgMS42NS0yLjc5IDAtMi4yNTUtMS43NDUtNC00LTRoLTYuMjV2MTRoNy4wNGMyLjA5NSAwIDMuNzEtMS43IDMuNzEtMy43OSAwLTEuNTItMC44NjUtMi44MTUtMi4xNS0zLjQyem0tNS42LTQuMjloM2MwLjgzIDAgMS41IDAuNjcgMS41IDEuNXMtMC42NyAxLjUtMS41IDEuNWgtM3YtM3ptMy41IDloLTMuNXYtM2gzLjVjMC44MyAwIDEuNSAwLjY3IDEuNSAxLjVzLTAuNjcgMS41LTEuNSAxLjV6Ii8%2BCjwvc3ZnPgo%3D); } -trix-toolbar .button_group button.italic::before { - background-image: url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjRweCIgd2lkdGg9IjI0cHgiIHZlcnNpb249IjEuMSIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHZpZXdCb3g9IjAgMCAyNCAyNCI%2BCiA8cGF0aCBpZD0iU2hhcGUiIGZpbGw9IiMwMDAiIGQ9Im0xMCA1djNoMi4yMTVsLTMuNDMgOGgtMi43ODV2M2g4di0zaC0yLjIxNWwzLjQzLThoMi43ODV2LTNoLTh6Ii8%2BCjwvc3ZnPgo%3D); } -trix-toolbar .button_group button.link::before { - background-image: url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9Im5vIj8%2BCjxzdmcgd2lkdGg9IjI0cHgiIGhlaWdodD0iMjRweCIgdmlld0JveD0iMCAwIDI0IDI0IiB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiPgogIDxwYXRoIGQ9Ik05Ljg3OTIzNDM3LDEzLjY5NjUgQzguMjA2OTIxODgsMTIuMDI0MTg3NSA4LjIwNjkyMTg4LDkuMzAzMzc1IDkuODc5MjM0MzcsNy42MzEwNjI1IEwxMy4yNTQyMzQ0LDQuMjU2MDYyNSBDMTQuMDY0MjM0NCwzLjQ0NjA2MjUgMTUuMTQxNDIxOSwzIDE2LjI4NzIzNDQsMyBDMTcuNDMzMDQ2OSwzIDE4LjUwOTY3MTksMy40NDYwNjI1IDE5LjMyMDIzNDQsNC4yNTYwNjI1IEMyMC45OTI1NDY5LDUuOTI4Mzc1IDIwLjk5MjU0NjksOC42NDkxODc1IDE5LjMyMDIzNDQsMTAuMzIxNSBMMTcuMzU4MDU0NywxMi4wMzY1NjY3IEMxNy4wMDA4NjcyLDEyLjM5Mzc1NDIgMTYuNDIyNjE3MiwxMi4zOTM3NTQyIDE2LjA2NTQyOTcsMTIuMDM2NTY2NyBDMTUuNzA4MjQyMiwxMS42NzkzNzkyIDE1LjcwODI0MjIsMTEuMTAxMTI5MiAxNi4wNjU0Mjk3LDEwLjc0Mzk0MTcgTDE4LjAyNzYwOTQsOS4wMjg4NzUgQzE4Ljk4NzIzNDQsOC4wNjkyNSAxOC45ODcyMzQ0LDYuNTA4MzEyNSAxOC4wMjc2MDk0LDUuNTQ4Njg3NSBDMTcuNTYyOTg0NCw1LjA4NDA2MjUgMTYuOTQ0Nzk2OSw0LjgyODEyNSAxNi4yODcyMzQ0LDQuODI4MTI1IEMxNS42Mjk2NzE5LDQuODI4MTI1IDE1LjAxMjA0NjksNS4wODQwNjI1IDE0LjU0Njg1OTQsNS41NDg2ODc1IEwxMS4xNzE4NTk0LDguOTIzNjg3NSBDMTAuMjEyMjM0NCw5Ljg4MzMxMjUgMTAuMjEyMjM0NCwxMS40NDQyNSAxMS4xNzE4NTk0LDEyLjQwMzg3NSBDMTEuNTI5MDQ2OSwxMi43NjEwNjI1IDExLjUyOTA0NjksMTMuMzM5MzEyNSAxMS4xNzE4NTk0LDEzLjY5NjUgQzEwLjk5MzU0NjksMTMuODc0ODEyNSAxMC43NTk1NDY5LDEzLjk2NDI1IDEwLjUyNTU0NjksMTMuOTY0MjUgQzEwLjI5MTU0NjksMTMuOTY0MjUgMTAuMDU3NTQ2OSwxMy44NzQ4MTI1IDkuODc5MjM0MzcsMTMuNjk2NSBaIiBpZD0iU2hhcGUiIGZpbGw9IiMwMDAiPjwvcGF0aD4KICA8cGF0aCBkPSJNNC4yNTQyMzQzNywxOS40NTgzMjgxIEMyLjU4MTkyMTg3LDE3Ljc4NjAxNTYgMi41ODE5MjE4NywxNS4wNjUyMDMxIDQuMjU0MjM0MzcsMTMuMzkyODkwNiBMNi4xNzg3MjkwMSwxMS40OTAyMzQ0IEM2LjUzNTkxNjUxLDExLjEzMzA0NjkgNy4xMTQ3MjkwMSwxMS4xMzMwNDY5IDcuNDcxMzU0MDEsMTEuNDkwMjM0NCBDNy44Mjc5NzkwMSwxMS44NDc0MjE5IDcuODI4NTQxNTEsMTIuNDI1NjcxOSA3LjQ3MTM1NDAxLDEyLjc4Mjg1OTQgTDUuNTQ2ODU5MzcsMTQuNjg1NTE1NiBDNC41ODcyMzQzNywxNS42NDUxNDA2IDQuNTg3MjM0MzcsMTcuMjA2MDc4MSA1LjU0Njg1OTM3LDE4LjE2NTcwMzEgQzYuMDExNDg0MzcsMTguNjMwMzI4MSA2LjYyOTY3MTg3LDE4Ljg4NjI2NTYgNy4yODcyMzQzNywxOC44ODYyNjU2IEM3Ljk0NDc5Njg3LDE4Ljg4NjI2NTYgOC41NjI0MjE4NywxOC42MzAzMjgxIDkuMDI3NjA5MzcsMTguMTY1NzAzMSBMMTIuNDAyNjA5NCwxNC43OTA3MDMxIEMxMy4zNjIyMzQ0LDEzLjgzMTA3ODEgMTMuMzYyMjM0NCwxMi4yNzAxNDA2IDEyLjQwMjYwOTQsMTEuMzEwNTE1NiBDMTIuMDQ1NDIxOSwxMC45NTMzMjgxIDEyLjA0NTQyMTksMTAuMzc1MDc4MSAxMi40MDI2MDk0LDEwLjAxNzg5MDYgQzEyLjc1OTc5NjksOS42NjA3MDMxMiAxMy4zMzgwNDY5LDkuNjYwNzAzMTIgMTMuNjk1MjM0NCwxMC4wMTc4OTA2IEMxNS4zNjc1NDY5LDExLjY5MDIwMzEgMTUuMzY3NTQ2OSwxNC40MTEwMTU2IDEzLjY5NTIzNDQsMTYuMDgzMzI4MSBMMTAuMzIwMjM0NCwxOS40NTgzMjgxIEM5LjUxMDIzNDM3LDIwLjI2ODMyODEgOC40MzMwNDY4NywyMC43MTQzOTA2IDcuMjg3MjM0MzcsMjAuNzE0MzkwNiBDNi4xNDE0MjE4NywyMC43MTQzOTA2IDUuMDY0MjM0MzcsMjAuMjY4MzI4MSA0LjI1NDIzNDM3LDE5LjQ1ODMyODEgWiIgaWQ9IlNoYXBlIiBmaWxsPSIjMDAwIj48L3BhdGg%2BCjwvc3ZnPgo%3D); } -trix-toolbar .button_group button.strike::before { - background-image: url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjRweCIgd2lkdGg9IjI0cHgiIHZlcnNpb249IjEuMSIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHZpZXdCb3g9IjAgMCAyNCAyNCI%2BCiA8cGF0aCBpZD0iUyIgZmlsbD0iIzAwMCIgZD0ibTEyLjcyOCAxNGMwLjEyMiAwLjA1NyAwLjIxNiAwLjEwNCAwLjI4MiAwLjE0MSAwLjI2MiAwLjE0NyAwLjQ1MSAwLjI5MyAwLjU3IDAuNDM2IDAuMTE4IDAuMTQ0IDAuMTc3IDAuMzEyIDAuMTc3IDAuNTAzIDAgMC4zMDctMC4xNDcgMC41NTgtMC40NDEgMC43NTItMC4yOTMgMC4xOTUtMC43NTUgMC4yOTMtMS4zODUgMC4yOTMtMC43MzEgMC0xLjUzMy0wLjEwNC0yLjQwNjYtMC4zMTItMC44NzM3LTAuMjA3LTEuNzE1Mi0wLjQ5Ni0yLjUyNDQtMC44Njd2My4zNzNjMC43NjYzIDAuMzI1IDEuNTAzOSAwLjU1NCAyLjIxMjkgMC42ODVzMS41ODYxIDAuMTk2IDIuNjMyMSAwLjE5NmMxLjI1MyAwIDIuMzQ1LTAuMTg3IDMuMjc2LTAuNTYgMC45MzEtMC4zNzQgMS42NDQtMC44OTggMi4xMzgtMS41NzJzMC43NDEtMS40NDUgMC43NDEtMi4zMTRjMC0wLjI2NC0wLjAyMS0wLjUxNS0wLjA2Mi0wLjc1NGgtNS4yMXptLTUuNDk3Ny00Yy0wLjA4MTktMC4zMzU4LTAuMTIyOS0wLjcwMjItMC4xMjI5LTEuMDk5NCAwLTEuMjkwMiAwLjUyNjQtMi4yOTYyIDEuNTc5MS0zLjAxOCAxLjA1MjgtMC43MjE3IDIuNDk5NS0xLjA4MjYgNC4zMzk1LTEuMDgyNiAxLjYyNiAwIDMuMjg0IDAuMzM1MyA0Ljk3NCAxLjAwNmwtMS4zIDIuOTIyMWMtMS40NjgtMC42MDA0LTIuNzM1LTAuOTAwNi0zLjgwMy0wLjkwMDYtMC41NTEgMC0wLjk1MiAwLjA4NjMtMS4yMDMgMC4yNTg3LTAuMjUgMC4xNzI1LTAuMzc2IDAuMzg2NS0wLjM3NiAwLjY0MTkgMCAwLjI3NDcgMC4xNiAwLjUyMDYgMC40NzggMC43Mzc4IDAuMTc5IDAuMTIxOCAwLjUzIDAuMjk5OCAxLjA1MiAwLjUzNDFoLTUuNjE3N3oiLz4KIDxwYXRoIGlkPSJQYXRoLTIiIGZpbGw9IiMwMDAiIGQ9Im0zIDEzaDE4di0yaC0xOHYyeiIvPgo8L3N2Zz4K); } -trix-toolbar .button_group button.quote::before { - background-image: url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4KPCEtLSBHZW5lcmF0ZWQgYnkgSWNvTW9vbi5pbyAtLT4KPCFET0NUWVBFIHN2ZyBQVUJMSUMgIi0vL1czQy8vRFREIFNWRyAxLjEvL0VOIiAiaHR0cDovL3d3dy53My5vcmcvR3JhcGhpY3MvU1ZHLzEuMS9EVEQvc3ZnMTEuZHRkIj4KPHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0Ij4KPHBhdGggZD0iTTYgMTdoM2wyLTR2LTZoLTZ2Nmgzek0xNCAxN2gzbDItNHYtNmgtNnY2aDN6IiBmaWxsPSIjMDAwIj48L3BhdGg%2BCjwvc3ZnPgo%3D); } -trix-toolbar .button_group button.code::before { - background-image: url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4KPCEtLSBHZW5lcmF0ZWQgYnkgSWNvTW9vbi5pbyAtLT4KPCFET0NUWVBFIHN2ZyBQVUJMSUMgIi0vL1czQy8vRFREIFNWRyAxLjEvL0VOIiAiaHR0cDovL3d3dy53My5vcmcvR3JhcGhpY3MvU1ZHLzEuMS9EVEQvc3ZnMTEuZHRkIj4KPHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0Ij4KPHBhdGggZD0iTTE4LjE3IDEybC0zLjE3IDMuMTcgMS40MTUgMS40MTUgNC41ODUtNC41ODUtNC41ODUtNC41ODUtMS40MTUgMS40MTUgMy4xNyAzLjE3ek01LjgzIDEybDMuMTctMy4xNy0xLjQxNS0xLjQxNS00LjU4NSA0LjU4NSA0LjU4NSA0LjU4NSAxLjQxNS0xLjQxNS0zLjE3LTMuMTd6IiBmaWxsPSIjMDAwIj48L3BhdGg%2BCjwvc3ZnPgo%3D); } -trix-toolbar .button_group button.bullets::before { - background-image: url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMjRweCIgd2lkdGg9IjI0cHgiIHZlcnNpb249IjEuMSIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHZpZXdCb3g9IjAgMCAyNCAyNCI%2BCiAgPHBhdGggaWQ9IlNoYXBlIiBmaWxsPSIjMDAwIiBkPSJtNCA0Yy0xLjEwNjcgMC0yIDAuODkzMy0yIDJzMC44OTMzIDIgMiAyIDItMC44OTMzIDItMi0wLjg5MzMtMi0yLTJ6bTAgNmMtMS4xMDY3IDAtMiAwLjg5My0yIDJzMC44OTMzIDIgMiAyIDItMC44OTMgMi0yLTAuODkzMy0yLTItMnptMCA2Yy0xLjEwNjcgMC0yIDAuODkzLTIgMnMwLjg5MzMgMiAyIDIgMi0wLjg5MyAyLTItMC44OTMzLTItMi0yem00IDNoMTR2LTJoLTE0djJ6bTAtNmgxNHYtMmgtMTR2MnptMC04djJoMTR2LTJoLTE0eiIvPgo8L3N2Zz4K); } -trix-toolbar .button_group button.numbers::before { - background-image: url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4KPCEtLSBHZW5lcmF0ZWQgYnkgSWNvTW9vbi5pbyAtLT4KPCFET0NUWVBFIHN2ZyBQVUJMSUMgIi0vL1czQy8vRFREIFNWRyAxLjEvL0VOIiAiaHR0cDovL3d3dy53My5vcmcvR3JhcGhpY3MvU1ZHLzEuMS9EVEQvc3ZnMTEuZHRkIj4KPHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0Ij4KPHBhdGggZD0iTTIgMTdoMnYwLjVoLTF2MWgxdjAuNWgtMnYxaDN2LTRoLTN2MXpNMyA4aDF2LTRoLTJ2MWgxdjN6TTIgMTFoMS44bC0xLjggMi4xdjAuOWgzdi0xaC0xLjhsMS44LTIuMXYtMC45aC0zdjF6TTcgNXYyaDE0di0yaC0xNHpNNyAxOWgxNHYtMmgtMTR2MnpNNyAxM2gxNHYtMmgtMTR2MnoiIGZpbGw9IiMwMDAiPjwvcGF0aD4KPC9zdmc%2BCg%3D%3D); } -trix-toolbar .button_group button.block-level.decrease::before { - background-image: url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9Im5vIj8%2BCjxzdmcgd2lkdGg9IjI0cHgiIGhlaWdodD0iMjRweCIgdmlld0JveD0iMCAwIDI0IDI0IiB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiPgogIDxwYXRoIGQ9Ik0zLDE5IEwyMiwxOSBMMjIsMTcgTDMsMTcgTDMsMTkgTDMsMTkgWiBNMTAsMTMgTDIyLDEzIEwyMiwxMSBMMTAsMTEgTDEwLDEzIEwxMCwxMyBaIE0xLjcwNzEwNjc4LDEyLjc0MjY0MDcgTDQuNTM1NTMzOTEsMTUuNTcxMDY3OCBMNS45NDk3NDc0NywxNC4xNTY4NTQyIEwzLjgyODQyNzEyLDEyLjAzNTUzMzkgTDUuOTQ5NzQ3NDcsOS45MTQyMTM1NiBMNC41MzU1MzM5MSw4LjUgTDEsMTIuMDM1NTMzOSBMMS43MDcxMDY3OCwxMi43NDI2NDA3IFogTTMsNSBMMyw3IEwyMiw3IEwyMiw1IEwzLDUgWiIgaWQ9IlNoYXBlIiBmaWxsPSIjMDAwIj48L3BhdGg%2BCjwvc3ZnPgo%3D); } -trix-toolbar .button_group button.block-level.increase::before { - background-image: url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9Im5vIj8%2BCjxzdmcgd2lkdGg9IjI0cHgiIGhlaWdodD0iMjRweCIgdmlld0JveD0iMCAwIDI0IDI0IiB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiPgogIDxwYXRoIGQ9Ik0zLDE5IEwyMiwxOSBMMjIsMTcgTDMsMTcgTDMsMTkgTDMsMTkgWiBNMTAsMTMgTDIyLDEzIEwyMiwxMSBMMTAsMTEgTDEwLDEzIEwxMCwxMyBaIE0zLjEyMTMyMDM0LDEyLjAzNTUzMzkgTDEsMTQuMTU2ODU0MiBMMi40MTQyMTM1NiwxNS41NzEwNjc4IEw1Ljk0OTc0NzQ3LDEyLjAzNTUzMzkgTDUuMjQyNjQwNjksMTEuMzI4NDI3MSBMMi40MTQyMTM1Niw4LjUgTDEsOS45MTQyMTM1NiBMMy4xMjEzMjAzNCwxMi4wMzU1MzM5IFogTTMsNSBMMyw3IEwyMiw3IEwyMiw1IEwzLDUgWiIgaWQ9IlNoYXBlLUNvcHkiIGZpbGw9IiMwMDAiPjwvcGF0aD4KPC9zdmc%2BCg%3D%3D); } -trix-toolbar .button_group button.undo::before { - background-image: url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4KPCEtLSBHZW5lcmF0ZWQgYnkgSWNvTW9vbi5pbyAtLT4KPCFET0NUWVBFIHN2ZyBQVUJMSUMgIi0vL1czQy8vRFREIFNWRyAxLjEvL0VOIiAiaHR0cDovL3d3dy53My5vcmcvR3JhcGhpY3MvU1ZHLzEuMS9EVEQvc3ZnMTEuZHRkIj4KPHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0Ij4KPHBhdGggZD0iTTEyLjUgOGMtMi42NDUgMC01LjA1NSAwLjk4NS02LjkgMi42bC0zLjYtMy42djloOWwtMy42MTUtMy42MTVjMS4zODUtMS4xNjUgMy4xNi0xLjg4NSA1LjExNS0xLjg4NSAzLjU0NSAwIDYuNTQ1IDIuMzA1IDcuNTk1IDUuNWwyLjM2NS0wLjc4Yy0xLjM3NS00LjE5LTUuMzEtNy4yMi05Ljk2LTcuMjJ6IiBmaWxsPSIjMDAwIj48L3BhdGg%2BCjwvc3ZnPgo%3D); } -trix-toolbar .button_group button.redo::before { - background-image: url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4KPCEtLSBHZW5lcmF0ZWQgYnkgSWNvTW9vbi5pbyAtLT4KPCFET0NUWVBFIHN2ZyBQVUJMSUMgIi0vL1czQy8vRFREIFNWRyAxLjEvL0VOIiAiaHR0cDovL3d3dy53My5vcmcvR3JhcGhpY3MvU1ZHLzEuMS9EVEQvc3ZnMTEuZHRkIj4KPHN2ZyB2ZXJzaW9uPSIxLjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sbnM6eGxpbms9Imh0dHA6Ly93d3cudzMub3JnLzE5OTkveGxpbmsiIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0Ij4KPHBhdGggZD0iTTE4LjM5NSAxMC42Yy0xLjg0LTEuNjE1LTQuMjUtMi42LTYuODk1LTIuNi00LjY1IDAtOC41ODUgMy4wMzAtOS45NiA3LjIybDIuMzY1IDAuNzhjMS4wNTAtMy4xOTUgNC4wNTAtNS41IDcuNTk1LTUuNSAxLjk1NSAwIDMuNzMgMC43MiA1LjExNSAxLjg4NWwtMy42MTUgMy42MTVoOXYtOWwtMy42MDUgMy42eiIgZmlsbD0iIzAwMCI%2BPC9wYXRoPgo8L3N2Zz4K); } -@charset "UTF-8"; -trix-editor a[data-trix-attachment] { - color: inherit; - text-decoration: none; } - trix-editor a[data-trix-attachment]:hover, trix-editor a[data-trix-attachment]:visited:hover { - color: inherit; } -trix-editor [data-trix-mutable=true] { - -webkit-user-select: none; - -moz-user-select: none; - -ms-user-select: none; - user-select: none; } - trix-editor [data-trix-mutable=true] img { - box-shadow: 0 0 0 2px highlight; } -trix-editor .attachment { - position: relative; - display: inline-block; - max-width: 100%; - margin: 0; - padding: 0; - color: #666; - font-size: 13px; } - trix-editor .attachment .remove { - display: block; - position: absolute; - top: -12px; - right: -12px; - width: 24px; - height: 24px; - border-radius: 24px; - line-height: 22px; - font-size: 0; - color: black; - text-align: center; - text-decoration: none; - background-color: #fff; - border: 1px solid #bbb; - box-shadow: 1px 1px 10px rgba(0, 0, 0, 0.1); } - trix-editor .attachment .remove:after { - content: '×'; - font-size: 18px; - font-weight: bold; - opacity: 0.6; } - trix-editor .attachment .remove:hover:after { - opacity: 1; } - trix-editor .attachment .caption { - display: block; - margin: 4px auto 0 auto; - padding: 0; - text-align: center; } - trix-editor .attachment .caption .size:before { - content: ' · '; } - trix-editor .attachment .caption.caption-editing textarea { - width: 100%; - margin: 0; - padding: 0; - font-size: 13px; - line-height: 13px; - text-align: center; - border: none; - outline: none; - -webkit-appearance: none; - -moz-appearance: none; } - trix-editor .attachment.attachment-file { - color: #333; - line-height: 30px; - padding: 0 16px; - border: 1px solid #bbb; - border-radius: 5px; } -.trix-content blockquote { - margin: 0 0 0 5px; - padding: 0 0 0 10px; - border-left: 5px solid #ccc; } -.trix-content pre { - font-family: monospace; - font-size: 12px; - margin: 0; - padding: 10px; - white-space: pre-wrap; - background-color: #eee; } -.trix-content ul, .trix-content ol, .trix-content li { - margin: 0; - padding: 0; } - .trix-content ul li, .trix-content ol li, .trix-content li li { - margin-left: 20px; }