torba-rails 1.0.0 → 1.0.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (102) hide show
  1. checksums.yaml +5 -5
  2. data/.gitignore +1 -1
  3. data/.ruby-version +1 -0
  4. data/.travis.yml +35 -3
  5. data/CHANGELOG.md +20 -0
  6. data/CONTRIBUTING.md +7 -1
  7. data/README.md +32 -1
  8. data/Rakefile +11 -17
  9. data/lib/torba/rails.rb +8 -4
  10. data/torba-rails.gemspec +5 -6
  11. metadata +15 -198
  12. data/test/3.2/Gemfile +0 -12
  13. data/test/3.2/Gemfile.lock +0 -116
  14. data/test/3.2/Rakefile +0 -7
  15. data/test/3.2/Torbafile +0 -8
  16. data/test/3.2/app/assets/javascripts/application.js +0 -2
  17. data/test/3.2/app/assets/stylesheets/application.scss +0 -6
  18. data/test/3.2/app/controllers/application_controller.rb +0 -3
  19. data/test/3.2/app/helpers/application_helper.rb +0 -2
  20. data/test/3.2/app/views/layouts/application.html.erb +0 -14
  21. data/test/3.2/bin/rails +0 -6
  22. data/test/3.2/config/application.rb +0 -62
  23. data/test/3.2/config/boot.rb +0 -6
  24. data/test/3.2/config/environment.rb +0 -5
  25. data/test/3.2/config/environments/development.rb +0 -27
  26. data/test/3.2/config/environments/production.rb +0 -64
  27. data/test/3.2/config/environments/test.rb +0 -29
  28. data/test/3.2/config/initializers/backtrace_silencers.rb +0 -7
  29. data/test/3.2/config/initializers/secret_token.rb +0 -7
  30. data/test/3.2/config/initializers/wrap_parameters.rb +0 -10
  31. data/test/3.2/config/locales/en.yml +0 -5
  32. data/test/3.2/config/routes.rb +0 -58
  33. data/test/3.2/config.ru +0 -4
  34. data/test/3.2/script/rails +0 -6
  35. data/test/4.2/Gemfile +0 -6
  36. data/test/4.2/Gemfile.lock +0 -128
  37. data/test/4.2/Rakefile +0 -6
  38. data/test/4.2/Torbafile +0 -8
  39. data/test/4.2/app/assets/javascripts/application.js +0 -2
  40. data/test/4.2/app/assets/stylesheets/application.scss +0 -6
  41. data/test/4.2/app/controllers/application_controller.rb +0 -5
  42. data/test/4.2/app/helpers/application_helper.rb +0 -2
  43. data/test/4.2/app/views/layouts/application.html.erb +0 -13
  44. data/test/4.2/bin/rails +0 -4
  45. data/test/4.2/config/application.rb +0 -25
  46. data/test/4.2/config/boot.rb +0 -3
  47. data/test/4.2/config/environment.rb +0 -5
  48. data/test/4.2/config/environments/development.rb +0 -35
  49. data/test/4.2/config/environments/production.rb +0 -76
  50. data/test/4.2/config/environments/test.rb +0 -37
  51. data/test/4.2/config/initializers/assets.rb +0 -11
  52. data/test/4.2/config/initializers/cookies_serializer.rb +0 -3
  53. data/test/4.2/config/initializers/filter_parameter_logging.rb +0 -4
  54. data/test/4.2/config/initializers/session_store.rb +0 -3
  55. data/test/4.2/config/initializers/wrap_parameters.rb +0 -9
  56. data/test/4.2/config/locales/en.yml +0 -23
  57. data/test/4.2/config/routes.rb +0 -56
  58. data/test/4.2/config/secrets.yml +0 -22
  59. data/test/4.2/config.ru +0 -4
  60. data/test/5.0/Gemfile +0 -6
  61. data/test/5.0/Gemfile.lock +0 -138
  62. data/test/5.0/Rakefile +0 -6
  63. data/test/5.0/Torbafile +0 -8
  64. data/test/5.0/app/assets/javascripts/application.js +0 -2
  65. data/test/5.0/app/assets/stylesheets/application.scss +0 -6
  66. data/test/5.0/app/controllers/application_controller.rb +0 -5
  67. data/test/5.0/app/helpers/application_helper.rb +0 -2
  68. data/test/5.0/app/views/layouts/application.html.erb +0 -13
  69. data/test/5.0/bin/rails +0 -4
  70. data/test/5.0/config/application.rb +0 -17
  71. data/test/5.0/config/boot.rb +0 -3
  72. data/test/5.0/config/cable.yml +0 -10
  73. data/test/5.0/config/environment.rb +0 -5
  74. data/test/5.0/config/environments/development.rb +0 -52
  75. data/test/5.0/config/environments/production.rb +0 -79
  76. data/test/5.0/config/environments/test.rb +0 -36
  77. data/test/5.0/config/initializers/assets.rb +0 -11
  78. data/test/5.0/config/initializers/cookies_serializer.rb +0 -5
  79. data/test/5.0/config/initializers/filter_parameter_logging.rb +0 -4
  80. data/test/5.0/config/initializers/per_form_csrf_tokens.rb +0 -4
  81. data/test/5.0/config/initializers/request_forgery_protection.rb +0 -4
  82. data/test/5.0/config/initializers/session_store.rb +0 -3
  83. data/test/5.0/config/initializers/wrap_parameters.rb +0 -14
  84. data/test/5.0/config/locales/en.yml +0 -23
  85. data/test/5.0/config/puma.rb +0 -47
  86. data/test/5.0/config/routes.rb +0 -6
  87. data/test/5.0/config/secrets.yml +0 -22
  88. data/test/5.0/config.ru +0 -4
  89. data/test/5.0/db/seeds.rb +0 -7
  90. data/test/Torbafile +0 -8
  91. data/test/acceptance_test.rb +0 -68
  92. data/test/application.js +0 -2
  93. data/test/application.scss +0 -6
  94. data/test/compiled_assets/3.2/application-32cc93d3c658f24842cdb4028d7f6a6a.js +0 -1
  95. data/test/compiled_assets/3.2/application-406b208e73b83fe37135274c5157c8e3.css +0 -1
  96. data/test/compiled_assets/3.2/trumbowyg/icons-0b2826fbd974348c269c2b8017a14314.png +0 -0
  97. data/test/compiled_assets/3.2/trumbowyg/icons-2x-cc69d8bc62651602e75c2f7097cf5187.png +0 -0
  98. data/test/compiled_assets/4.2+/application-7cdb22c682ee9bf44774492034be6952becd2c75184c101017152af1476b12a8.css +0 -1
  99. data/test/compiled_assets/4.2+/application-c7e50f0b91ececdd620e1c86789b65677d9bbe0f35ab4717a9a522e6c89a56f9.js +0 -1
  100. data/test/compiled_assets/4.2+/trumbowyg/icons-2x-39fe92cd396082eb94f0c92103537209ba97ffa3079377bbe55fea857abe5341.png +0 -0
  101. data/test/compiled_assets/4.2+/trumbowyg/icons-efc940454e4e764063875def5c909a2f9c8b2c4d2a41c6a98dc41fb111868f1f.png +0 -0
  102. data/test/test_helper.rb +0 -35
@@ -1,36 +0,0 @@
1
- Rails.application.configure do
2
- # Settings specified here will take precedence over those in config/application.rb.
3
-
4
- # The test environment is used exclusively to run your application's
5
- # test suite. You never need to work with it otherwise. Remember that
6
- # your test database is "scratch space" for the test suite and is wiped
7
- # and recreated between test runs. Don't rely on the data there!
8
- config.cache_classes = true
9
-
10
- # Do not eager load code on boot. This avoids loading your whole application
11
- # just for the purpose of running a single test. If you are using a tool that
12
- # preloads Rails for running tests, you may have to set it to true.
13
- config.eager_load = false
14
-
15
- # Configure public file server for tests with Cache-Control for performance.
16
- config.public_file_server.enabled = true
17
- config.public_file_server.headers = {
18
- 'Cache-Control' => 'public, max-age=3600'
19
- }
20
-
21
- # Show full error reports and disable caching.
22
- config.consider_all_requests_local = true
23
- config.action_controller.perform_caching = false
24
-
25
- # Raise exceptions instead of rendering exception templates.
26
- config.action_dispatch.show_exceptions = false
27
-
28
- # Disable request forgery protection in test environment.
29
- config.action_controller.allow_forgery_protection = false
30
-
31
- # Print deprecation notices to the stderr.
32
- config.active_support.deprecation = :stderr
33
-
34
- # Raises error for missing translations
35
- # config.action_view.raise_on_missing_translations = true
36
- end
@@ -1,11 +0,0 @@
1
- # Be sure to restart your server when you modify this file.
2
-
3
- # Version of your assets, change this if you want to expire all your assets.
4
- Rails.application.config.assets.version = '1.0'
5
-
6
- # Add additional assets to the asset load path
7
- # Rails.application.config.assets.paths << Emoji.images_path
8
-
9
- # Precompile additional assets.
10
- # application.js, application.css, and all non-JS/CSS in app/assets folder are already added.
11
- # Rails.application.config.assets.precompile += %w( search.js )
@@ -1,5 +0,0 @@
1
- # Be sure to restart your server when you modify this file.
2
-
3
- # Specify a serializer for the signed and encrypted cookie jars.
4
- # Valid options are :json, :marshal, and :hybrid.
5
- Rails.application.config.action_dispatch.cookies_serializer = :json
@@ -1,4 +0,0 @@
1
- # Be sure to restart your server when you modify this file.
2
-
3
- # Configure sensitive parameters which will be filtered from the log file.
4
- Rails.application.config.filter_parameters += [:password]
@@ -1,4 +0,0 @@
1
- # Be sure to restart your server when you modify this file.
2
-
3
- # Enable per-form CSRF tokens.
4
- Rails.application.config.action_controller.per_form_csrf_tokens = true
@@ -1,4 +0,0 @@
1
- # Be sure to restart your server when you modify this file.
2
-
3
- # Enable origin-checking CSRF mitigation.
4
- Rails.application.config.action_controller.forgery_protection_origin_check = true
@@ -1,3 +0,0 @@
1
- # Be sure to restart your server when you modify this file.
2
-
3
- Rails.application.config.session_store :cookie_store, key: '_torba_test_session'
@@ -1,14 +0,0 @@
1
- # Be sure to restart your server when you modify this file.
2
-
3
- # This file contains settings for ActionController::ParamsWrapper which
4
- # is enabled by default.
5
-
6
- # Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array.
7
- ActiveSupport.on_load(:action_controller) do
8
- wrap_parameters format: [:json]
9
- end
10
-
11
- # To enable root element in JSON for ActiveRecord objects.
12
- # ActiveSupport.on_load(:active_record) do
13
- # self.include_root_in_json = true
14
- # end
@@ -1,23 +0,0 @@
1
- # Files in the config/locales directory are used for internationalization
2
- # and are automatically loaded by Rails. If you want to use locales other
3
- # than English, add the necessary files in this directory.
4
- #
5
- # To use the locales, use `I18n.t`:
6
- #
7
- # I18n.t 'hello'
8
- #
9
- # In views, this is aliased to just `t`:
10
- #
11
- # <%= t('hello') %>
12
- #
13
- # To use a different locale, set it with `I18n.locale`:
14
- #
15
- # I18n.locale = :es
16
- #
17
- # This would use the information in config/locales/es.yml.
18
- #
19
- # To learn more, please read the Rails Internationalization guide
20
- # available at http://guides.rubyonrails.org/i18n.html.
21
-
22
- en:
23
- hello: "Hello world"
@@ -1,47 +0,0 @@
1
- # Puma can serve each request in a thread from an internal thread pool.
2
- # The `threads` method setting takes two numbers a minimum and maximum.
3
- # Any libraries that use thread pools should be configured to match
4
- # the maximum value specified for Puma. Default is set to 5 threads for minimum
5
- # and maximum, this matches the default thread size of Active Record.
6
- #
7
- threads_count = ENV.fetch("RAILS_MAX_THREADS") { 5 }.to_i
8
- threads threads_count, threads_count
9
-
10
- # Specifies the `port` that Puma will listen on to receive requests, default is 3000.
11
- #
12
- port ENV.fetch("PORT") { 3000 }
13
-
14
- # Specifies the `environment` that Puma will run in.
15
- #
16
- environment ENV.fetch("RAILS_ENV") { "development" }
17
-
18
- # Specifies the number of `workers` to boot in clustered mode.
19
- # Workers are forked webserver processes. If using threads and workers together
20
- # the concurrency of the application would be max `threads` * `workers`.
21
- # Workers do not work on JRuby or Windows (both of which do not support
22
- # processes).
23
- #
24
- # workers ENV.fetch("WEB_CONCURRENCY") { 2 }
25
-
26
- # Use the `preload_app!` method when specifying a `workers` number.
27
- # This directive tells Puma to first boot the application and load code
28
- # before forking the application. This takes advantage of Copy On Write
29
- # process behavior so workers use less memory. If you use this option
30
- # you need to make sure to reconnect any threads in the `on_worker_boot`
31
- # block.
32
- #
33
- # preload_app!
34
-
35
- # The code in the `on_worker_boot` will be called if you are using
36
- # clustered mode by specifying a number of `workers`. After each worker
37
- # process is booted this block will be run, if you are using `preload_app!`
38
- # option you will want to use this block to reconnect to any threads
39
- # or connections that may have been created at application boot, Ruby
40
- # cannot share connections between processes.
41
- #
42
- # on_worker_boot do
43
- # ActiveRecord::Base.establish_connection if defined?(ActiveRecord)
44
- # end
45
-
46
- # Allow puma to be restarted by `rails restart` command.
47
- plugin :tmp_restart
@@ -1,6 +0,0 @@
1
- Rails.application.routes.draw do
2
- # For details on the DSL available within this file, see http://guides.rubyonrails.org/routing.html
3
-
4
- # Serve websocket cable requests in-process
5
- # mount ActionCable.server => '/cable'
6
- end
@@ -1,22 +0,0 @@
1
- # Be sure to restart your server when you modify this file.
2
-
3
- # Your secret key is used for verifying the integrity of signed cookies.
4
- # If you change this key, all old signed cookies will become invalid!
5
-
6
- # Make sure the secret is at least 30 characters and all random,
7
- # no regular words or you'll be exposed to dictionary attacks.
8
- # You can use `rake secret` to generate a secure secret key.
9
-
10
- # Make sure the secrets in this file are kept private
11
- # if you're sharing your code publicly.
12
-
13
- development:
14
- secret_key_base: 3c3d4f90a7f43a6ff4aa84bbc404d6d0294e494046c4b310714de80aac2dbcaa6c2b11e83821e3216442c318fc3c2b83d1090a558fc878488efd4c67a6551195
15
-
16
- test:
17
- secret_key_base: 5a3daec7e70d5b20a8f7385a1d2bee36951ade36ef335dcb4513b7b4172a58f9e355719edcbdd04aa1be24a324753f45ca49920f25d5e883554ca3ebdb5a5730
18
-
19
- # Do not keep production secrets in the repository,
20
- # instead read values from the environment.
21
- production:
22
- secret_key_base: <%= ENV["SECRET_KEY_BASE"] %>
data/test/5.0/config.ru DELETED
@@ -1,4 +0,0 @@
1
- # This file is used by Rack-based servers to start the application.
2
-
3
- require ::File.expand_path('../config/environment', __FILE__)
4
- run Rails.application
data/test/5.0/db/seeds.rb DELETED
@@ -1,7 +0,0 @@
1
- # This file should contain all the record creation needed to seed the database with its default values.
2
- # The data can then be loaded with the rake db:seed (or created alongside the db with db:setup).
3
- #
4
- # Examples:
5
- #
6
- # cities = City.create([{ name: 'Chicago' }, { name: 'Copenhagen' }])
7
- # Mayor.create(name: 'Emanuel', city: cities.first)
data/test/Torbafile DELETED
@@ -1,8 +0,0 @@
1
- gh_release "trumbowyg",
2
- source: "torba-rb/Trumbowyg",
3
- tag: "1.1.6",
4
- import: %w[
5
- dist/trumbowyg.js
6
- dist/ui/trumbowyg.css
7
- dist/ui/images/
8
- ]
@@ -1,68 +0,0 @@
1
- require "test_helper"
2
- require "open3"
3
-
4
- module Torba
5
- class RailsTest < Minitest::Test
6
- def test_verify_runs_in_dev_with_default_settings
7
- out, err, status = run_project_cmd(%{bin/rails runner 'puts "hello"'})
8
- refute status.success?, out
9
- assert_includes err, "Torba::Errors::MissingPackages"
10
-
11
- out, err, status = run_project_cmd(%{bundle exec torba pack})
12
- assert status.success?, err
13
- assert_includes out, "Torba has been packed!"
14
-
15
- out, err, status = run_project_cmd(%{bin/rails runner 'puts "hello"'})
16
- assert status.success?, err
17
- assert_includes out, "hello"
18
- end
19
-
20
- def test_verify_runs_in_test_with_default_settings
21
- out, err, status = run_project_cmd(%{bin/rails runner 'puts "hello"'}, "RAILS_ENV" => "test")
22
- refute status.success?, out
23
- assert_includes err, "Torba::Errors::MissingPackages"
24
-
25
- out, err, status = run_project_cmd(%{bundle exec torba pack})
26
- assert status.success?, err
27
- assert_includes out, "Torba has been packed!"
28
-
29
- out, err, status = run_project_cmd(%{bin/rails runner 'puts "hello"'}, "RAILS_ENV" => "test")
30
- assert status.success?, err
31
- assert_includes out, "hello"
32
- end
33
-
34
- def test_verify_is_skipped_in_production_with_default_settings
35
- out, err, status = run_project_cmd(%{bin/rails runner 'puts "hello"'}, "RAILS_ENV" => "production")
36
- assert status.success?, err
37
- assert_equal out, "hello\n"
38
- end
39
-
40
- def test_assets_precompile
41
- out, err, status = run_project_cmd(%{bundle exec rake assets:precompile}, "RAILS_ENV" => "production")
42
- assert status.success?, err
43
- assets_version = (rails_version == "3.2") ? "3.2" : "4.2+"
44
- assert_dir_included "test/compiled_assets/#{assets_version}", "test/#{rails_version}/public/assets"
45
- end
46
-
47
- def rails_version
48
- ENV["RAILS_VERSION"] || "4.2"
49
- end
50
-
51
- def in_project_dir(&blk)
52
- Dir.chdir("test/#{rails_version}", &blk)
53
- end
54
-
55
- def run_project_cmd(cmd, env = {})
56
- default_env = {
57
- "BUNDLE_GEMFILE" => nil,
58
- "TORBA_HOME_PATH" => torba_tmp_dir,
59
- "TORBA_CACHE_PATH" => Test::TmpDir.persistent
60
- }
61
- env = default_env.merge(env)
62
-
63
- in_project_dir do
64
- Open3.capture3(env, cmd)
65
- end
66
- end
67
- end
68
- end
data/test/application.js DELETED
@@ -1,2 +0,0 @@
1
- //= require trumbowyg/trumbowyg
2
- //= require_tree .
@@ -1,6 +0,0 @@
1
- /*
2
- *= require_self
3
- *= require_tree .
4
- */
5
-
6
- @import "trumbowyg/trumbowyg";
@@ -1 +0,0 @@
1
- jQuery.trumbowyg={langs:{en:{viewHTML:"View HTML",formatting:"Formatting",p:"Paragraph",blockquote:"Quote",code:"Code",header:"Header",bold:"Bold",italic:"Italic",strikethrough:"Stroke",underline:"Underline",strong:"Strong",em:"Emphasis",del:"Deleted",unorderedList:"Unordered list",orderedList:"Ordered list",insertImage:"Insert Image",insertVideo:"Insert Video",link:"Link",createLink:"Insert link",unlink:"Remove link",justifyLeft:"Align Left",justifyCenter:"Align Center",justifyRight:"Align Right",justifyFull:"Align Justify",horizontalRule:"Insert horizontal rule",fullscreen:"fullscreen",close:"Close",submit:"Confirm",reset:"Cancel",invalidUrl:"Invalid URL",required:"Required",description:"Description",title:"Title",text:"Text"}},opts:{},btnsGrps:{design:["bold","italic","underline","strikethrough"],semantic:["strong","em","del"],justify:["justifyLeft","justifyCenter","justifyRight","justifyFull"],lists:["unorderedList","orderedList"]}},function(e,t,n,o){"use strict";n.fn.trumbowyg=function(e,t){if(e===Object(e)||!e)return this.each(function(){n(this).data("trumbowyg")||n(this).data("trumbowyg",new i(this,e))});if(1===this.length)try{var o=n(this).data("trumbowyg");switch(e){case"openModal":return o.openModal(t.title,t.content);case"closeModal":return o.closeModal();case"openModalInsert":return o.openModalInsert(t.title,t.fields,t.callback);case"saveSelection":return o.saveSelection();case"getSelection":return o.selection;case"getSelectedText":return o.selection+"";case"restoreSelection":return o.restoreSelection();case"destroy":return o.destroy();case"empty":return o.empty();case"lang":return o.lang;case"duration":return o.o.duration;case"html":return o.html(t)}}catch(r){}return!1};var i=function(e,o){var i=this;i.doc=e.ownerDocument||t,i.$e=n(e),i.$creator=n(e),o=n.extend(!0,{},o,n.trumbowyg.opts),"undefined"==typeof o.lang||"undefined"==typeof n.trumbowyg.langs[o.lang]?i.lang=n.trumbowyg.langs.en:i.lang=n.extend(!0,{},n.trumbowyg.langs.en,n.trumbowyg.langs[o.lang]),i.o=n.extend(!0,{},{lang:"en",dir:"ltr",duration:200,mobile:!1,tablet:!0,closable:!1,fullscreenable:!0,fixedBtnPane:!1,fixedFullWidth:!1,autogrow:!1,prefix:"trumbowyg-",convertLink:!0,semantic:!1,resetCss:!1,btns:["viewHTML","|","formatting","|",n.trumbowyg.btnsGrps.design,"|","link","|","insertImage","|",n.trumbowyg.btnsGrps.justify,"|",n.trumbowyg.btnsGrps.lists,"|","horizontalRule"],btnsAdd:[],btnsDef:{viewHTML:{func:"toggle"},p:{func:"formatBlock"},blockquote:{func:"formatBlock"},h1:{func:"formatBlock",title:i.lang.header+" 1"},h2:{func:"formatBlock",title:i.lang.header+" 2"},h3:{func:"formatBlock",title:i.lang.header+" 3"},h4:{func:"formatBlock",title:i.lang.header+" 4"},bold:{},italic:{},underline:{},strikethrough:{},strong:{func:"bold"},em:{func:"italic"},del:{func:"strikethrough"},createLink:{},unlink:{},insertImage:{},justifyLeft:{},justifyCenter:{},justifyRight:{},justifyFull:{},unorderedList:{func:"insertUnorderedList"},orderedList:{func:"insertOrderedList"},horizontalRule:{func:"insertHorizontalRule"},formatting:{dropdown:["p","blockquote","h1","h2","h3","h4"]},link:{dropdown:["createLink","unlink"]}}},o),i.o.semantic&&!o.btns?i.o.btns=["viewHTML","|","formatting","|",n.trumbowyg.btnsGrps.semantic,"|","link","|","insertImage","|",n.trumbowyg.btnsGrps.justify,"|",n.trumbowyg.btnsGrps.lists,"|","horizontalRule"]:o&&o.btns&&(i.o.btns=o.btns),i.init()};i.prototype={init:function(){var e=this;return e.height=e.$e.css("height"),e.isEnabled()?void e.buildEditor(!0):(e.buildEditor(),e.buildBtnPane(),e.fixedBtnPaneEvents(),void e.buildOverlay())},buildEditor:function(e){var t=this,o=t.o.prefix,i="";if(e!==!0)t.$box=n("<div/>",{"class":o+"box "+o+t.o.lang+" trumbowyg"}),t.isTextarea=!0,t.$e.is("textarea")?t.$editor=n("<div/>"):(t.$editor=t.$e,t.$e=t.buildTextarea().val(t.$e.val()),t.isTextarea=!1),t.$creator.is("[placeholder]")&&t.$editor.attr("placeholder",t.$creator.attr("placeholder")),t.$e.hide().addClass(o+"textarea"),t.isTextarea?(i=t.$e.val(),t.$box.insertAfter(t.$e).append(t.$editor).append(t.$e)):(i=t.$editor.html(),t.$box.insertAfter(t.$editor).append(t.$e).append(t.$editor),t.syncCode()),t.$editor.addClass(o+"editor").attr("contenteditable",!0).attr("dir",t.lang._dir||t.o.dir).html(i),t.o.resetCss&&t.$editor.addClass(o+"reset-css"),t.o.autogrow||n.each([t.$editor,t.$e],function(e,n){n.css({height:t.height,overflow:"auto"})}),t.o.semantic&&(t.$editor.html(t.$editor.html().replace("<br>","</p><p>").replace("&nbsp;","")),t.semanticCode()),t.$editor.on("dblclick","img",function(e){var o=n(this);t.openModalInsert(t.lang.insertImage,{url:{label:"URL",value:o.attr("src"),required:!0},alt:{label:"description",value:o.attr("alt")}},function(e){o.attr({src:e.url,alt:e.alt})}),e.stopPropagation()}).on("keyup",function(e){t.semanticCode(!1,13===e.which)}).on("focus",function(){t.$creator.trigger("tbwfocus")}).on("blur",function(){t.syncCode(),t.$creator.trigger("tbwblur")});else if(!t.$e.is("textarea")){var r=t.buildTextarea().val(t.$e.val());t.$e.hide().after(r)}},buildTextarea:function(){return n("<textarea/>",{name:this.$e.attr("id"),height:this.height})},buildBtnPane:function(){var t=this,i=t.o.prefix;if(t.o.btns!==!1){t.$btnPane=n("<ul/>",{"class":i+"button-pane"}),n.each(t.o.btns.concat(t.o.btnsAdd),function(e,r){try{var a=r.split("btnGrp-");a[1]!==o&&(r=n.trumbowyg.btnsGrps[a[1]])}catch(s){}n.isArray(r)||(r=[r]),n.each(r,function(e,o){try{var r=n("<li/>");"|"===o?r.addClass(i+"separator"):t.isSupportedBtn(o)&&r.append(t.buildBtn(o)),t.$btnPane.append(r)}catch(a){}})});var r=n("<li/>",{"class":i+"not-disable "+i+"buttons-right"});t.o.fullscreenable&&r.append(t.buildRightBtn("fullscreen").on("click",function(){var o=i+"fullscreen";t.$box.toggleClass(o),t.$box.hasClass(o)?(n("body").css("overflow","hidden"),n.each([t.$editor,t.$e],function(){n(this).css({height:"calc(100% - 35px)",overflow:"auto"})}),t.$btnPane.css("width","100%")):(n("body").css("overflow","auto"),t.$box.removeAttr("style"),t.o.autogrow||n.each([t.$editor,t.$e],function(){n(this).css("height",t.height)})),n(e).trigger("scroll")})),t.o.closable&&r.append(t.buildRightBtn("close").on("click",function(){t.$box.hasClass(i+"fullscreen")&&n("body").css("overflow","auto"),t.destroy()})),r.not(":empty")&&t.$btnPane.append(r),t.$box.prepend(t.$btnPane)}},buildBtn:function(e){var t=this,o=t.o.prefix,i=t.o.btnsDef[e],r=i.dropdown,a=t.lang[e]||e,s=n("<button/>",{type:"button","class":o+e+"-button"+(i.ico?" "+o+i.ico+"-button":""),text:i.text||i.title||a,title:i.title||i.text||a,mousedown:function(a){return r&&!t.$box.find("."+e+"-"+o+"dropdown").is(":hidden")||n("body",t.doc).trigger("mousedown"),!t.$btnPane.hasClass(o+"disable")||n(this).hasClass(o+"active")||n(this).parent().hasClass(o+"not-disable")?(t.execCmd((r?"dropdown":!1)||i.func||e,i.param||e),a.stopPropagation(),void a.preventDefault()):!1}});if(r){s.addClass(o+"open-dropdown");var l=o+"dropdown",d=n("<div/>",{"class":e+"-"+l+" "+l+" "+o+"fixed-top"});n.each(r,function(e,n){t.o.btnsDef[n]&&t.isSupportedBtn(n)&&d.append(t.buildSubBtn(n))}),t.$box.append(d.hide())}return s},buildSubBtn:function(e){var t=this,o=t.o.btnsDef[e];return n("<button/>",{type:"button",text:o.text||o.title||t.lang[e]||e,style:o.style||null,mousedown:function(i){n("body",t.doc).trigger("mousedown"),t.execCmd(o.func||e,o.param||e),i.stopPropagation()}})},buildRightBtn:function(e){return n("<button/>",{type:"button","class":this.o.prefix+e+"-button",title:this.lang[e],text:this.lang[e]})},isSupportedBtn:function(e){var t=this.o.btnsDef[e];return"function"!=typeof t.isSupported||t.isSupported()},buildOverlay:function(){var e=this;return e.$overlay=n("<div/>",{"class":e.o.prefix+"overlay"}).css({top:e.$btnPane.outerHeight(),height:parseInt(e.$editor.outerHeight())+1+"px"}).appendTo(e.$box),e.$overlay},showOverlay:function(){var t=this;n(e).trigger("scroll"),t.$overlay.fadeIn(t.o.duration),t.$box.addClass(t.o.prefix+"box-blur")},hideOverlay:function(){var e=this;e.$overlay.fadeOut(e.o.duration/4),e.$box.removeClass(e.o.prefix+"box-blur")},fixedBtnPaneEvents:function(){var t=this,o=t.o.fixedFullWidth;t.o.fixedBtnPane&&(t.isFixed=!1,n(e).on("scroll resize",function(){if(t.$box){t.syncCode();var i=n(e).scrollTop(),r=t.$box.offset().top+1,a=i-r>0&&i-r-parseInt(t.height)<0,s=t.$btnPane,l=s.css("height"),d=s.outerHeight();a?(t.isFixed||(t.isFixed=!0,s.css({position:"fixed",top:0,left:o?"0":"auto",zIndex:7}),n([t.$editor,t.$e]).css({marginTop:l})),s.css({width:o?"100%":parseInt(t.$box.css("width"))-1+"px"}),n("."+t.o.prefix+"fixed-top",t.$box).css({position:o?"fixed":"absolute",top:o?d:parseInt(d)+(i-r)+"px",zIndex:15})):t.isFixed&&(t.isFixed=!1,s.removeAttr("style"),n([t.$editor,t.$e]).css({marginTop:0}),n("."+t.o.prefix+"fixed-top",t.$box).css({position:"absolute",top:d}))}}))},destroy:function(){var e=this,t=e.o.prefix,n=e.height,o=e.html();e.isTextarea?e.$box.after(e.$e.css({height:n}).val(o).removeClass(t+"textarea").show()):e.$box.after(e.$editor.css({height:n}).removeClass(t+"editor").removeAttr("contenteditable").html(o).show()),e.$box.remove(),e.$creator.removeData("trumbowyg")},empty:function(){this.$e.val(""),this.syncCode(!0)},toggle:function(){var e=this,t=e.o.prefix;e.semanticCode(!1,!0),e.$editor.toggle(),e.$e.toggle(),e.$btnPane.toggleClass(t+"disable"),e.$btnPane.find("."+t+"viewHTML-button").toggleClass(t+"active")},dropdown:function(t){var o=this,i=o.doc,r=o.o.prefix,a=o.$box.find("."+t+"-"+r+"dropdown"),s=o.$btnPane.find("."+r+t+"-button");if(a.is(":hidden")){var l=s.offset().left;s.addClass(r+"active"),a.css({position:"absolute",top:o.$btnPane.outerHeight(),left:o.o.fixedFullWidth&&o.isFixed?l+"px":l-o.$btnPane.offset().left+"px"}).show(),n(e).trigger("scroll"),n("body",i).on("mousedown",function(){n("."+r+"dropdown",i).hide(),n("."+r+"active",i).removeClass(r+"active"),n("body",i).off("mousedown")})}else n("body",i).trigger("mousedown")},html:function(e){var t=this;return e?(t.$e.val(e),t.syncCode(!0),t):t.$e.val()},syncCode:function(e){var t=this;!e&&t.$editor.is(":visible")?t.$e.val(t.$editor.html()):t.$editor.html(t.$e.val()),t.o.autogrow&&(t.height=t.$editor.css("height"),t.$e.css({height:t.height}))},semanticCode:function(e,t){var o=this;o.syncCode(e),o.o.semantic&&(o.semanticTag("b","strong"),o.semanticTag("i","em"),o.semanticTag("strike","del"),t&&(o.$editor.contents().filter(function(){return 3===this.nodeType&&n.trim(this.nodeValue).length>0}).wrap("<p></p>").end().filter("br").remove(),o.saveSelection(),o.semanticTag("div","p"),o.restoreSelection()),o.$e.val(o.$editor.html()))},semanticTag:function(e,t){n(e,this.$editor).each(function(){n(this).replaceWith(function(){return"<"+t+">"+n(this).html()+"</"+t+">"})})},createLink:function(){var e=this;e.saveSelection(),e.openModalInsert(e.lang.createLink,{url:{label:"URL",value:"http://",required:!0},title:{label:e.lang.title,value:e.selection},text:{label:e.lang.text,value:e.selection}},function(t){e.execCmd("createLink",t.url);var o=n('a[href="'+t.url+'"]:not([title])',e.$box);return t.text.length>0&&o.text(t.text),t.title.length>0&&o.attr("title",t.title),!0})},insertImage:function(){var e=this;e.saveSelection(),e.openModalInsert(e.lang.insertImage,{url:{label:"URL",value:"http://",required:!0},alt:{label:e.lang.description,value:e.selection}},function(t){return e.execCmd("insertImage",t.url),n('img[src="'+t.url+'"]:not([alt])',e.$box).attr("alt",t.alt),!0})},execCmd:function(e,t){var n=this;"dropdown"!=e&&n.$editor.focus();try{n[e](t)}catch(o){try{e(t,n)}catch(i){"insertHorizontalRule"==e?t=null:"formatBlock"==e&&(-1!==navigator.userAgent.indexOf("MSIE")||navigator.appVersion.indexOf("Trident/")>0)&&(t="<"+t+">"),n.doc.execCommand(e,!1,t)}}n.syncCode()},openModal:function(t,o){var i=this,r=i.o.prefix;if(n("."+r+"modal-box",i.$box).size()>0)return!1;i.saveSelection(),i.showOverlay(),i.$btnPane.addClass(r+"disable");var a=n("<div/>",{"class":r+"modal "+r+"fixed-top"}).css({top:parseInt(i.$btnPane.css("height"))+1+"px"}).appendTo(i.$box);i.$overlay.one("click",function(e){e.preventDefault(),a.trigger(r+"cancel")});var s=n("<form/>",{action:"",html:o}).on("submit",function(e){e.preventDefault(),a.trigger(r+"confirm")}).on("reset",function(e){e.preventDefault(),a.trigger(r+"cancel")}),l=n("<div/>",{"class":r+"modal-box",html:s}).css({top:"-"+parseInt(i.$btnPane.outerHeight())+"px",opacity:0}).appendTo(a).animate({top:0,opacity:1},i.o.duration/2);return n("<span/>",{text:t,"class":r+"modal-title"}).prependTo(l),l.find("input:first").focus(),i.buildModalBtn("submit",l),i.buildModalBtn("reset",l),n(e).trigger("scroll"),a},buildModalBtn:function(e,t){var o=this,i=o.o.prefix;return n("<button/>",{"class":i+"modal-button "+i+"modal-"+e,type:e,text:o.lang[e]||e}).appendTo(t.find("form"))},closeModal:function(){var e=this,t=e.o.prefix;e.$btnPane.removeClass(t+"disable"),e.$overlay.off();var o=n("."+t+"modal-box",e.$box);o.animate({top:"-"+o.css("height")},e.o.duration/2,function(){n(this).parent().remove(),e.hideOverlay()})},openModalInsert:function(e,t,i){var r=this,a=r.o.prefix,s=r.lang,l="";for(var d in t){var c=t[d],u=c.label===o?s[d]?s[d]:d:s[c.label]?s[c.label]:c.label;c.name===o&&(c.name=d),c.pattern||"url"!==d||(c.pattern=/^(http|https):\/\/([\w~#!:.?+=&%@!\-\/]+)$/,c.patternError=s.invalidUrl),l+='<label><input type="'+(c.type||"text")+'" name="'+c.name+'" value="'+(c.value||"")+'"><span class="'+a+'input-infos"><span>'+u+"</span></span></label>"}return r.openModal(e,l).on(a+"confirm",function(){var e=n(this).find("form"),o=!0,s={};for(var l in t){var d=n('input[name="'+l+'"]',e);s[l]=n.trim(d.val()),t[l].required&&""===s[l]?(o=!1,r.addErrorOnModalField(d,r.lang.required)):t[l].pattern&&!t[l].pattern.test(s[l])&&(o=!1,r.addErrorOnModalField(d,t[l].patternError))}o&&(r.restoreSelection(),i(s,t)&&(r.syncCode(),r.closeModal(),n(this).off(a+"confirm")))}).one(a+"cancel",function(){n(this).off(a+"confirm"),r.closeModal(),r.restoreSelection()})},addErrorOnModalField:function(e,t){var o=this.o.prefix,i=e.parent();e.on("change keyup",function(){i.removeClass(o+"input-error")}),i.addClass(o+"input-error").find("input+span").append(n("<span/>",{"class":o+"msg-error",text:t}))},saveSelection:function(){var t=this,n=t.doc;if(t.selection=null,e.getSelection){var o=e.getSelection();o.getRangeAt&&o.rangeCount&&(t.selection=o.getRangeAt(0))}else n.selection&&n.selection.createRange&&(t.selection=n.selection.createRange())},restoreSelection:function(){var t=this,n=t.selection;if(n)if(e.getSelection){var o=e.getSelection();o.removeAllRanges(),o.addRange(n)}else t.doc.selection&&n.select&&n.select()},isEnabled:function(){var e=new RegExp("(iPad|webOS)"),t=new RegExp("(iPhone|iPod|Android|BlackBerry|Windows Phone|ZuneWP7)"),n=navigator.userAgent;return this.o.tablet===!0&&e.test(n)||this.o.mobile===!0&&t.test(n)}}}(window,document,jQuery);
@@ -1 +0,0 @@
1
- .trumbowyg-box,.trumbowyg-editor{display:block;position:relative;border:1px solid #DDD;width:96%;min-height:300px;margin:17px auto}.trumbowyg-box .trumbowyg-editor{margin:0 auto}.trumbowyg-box.trumbowyg-fullscreen{background:#FEFEFE}.trumbowyg-editor,.trumbowyg-textarea{position:relative;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;padding:1% 2%;min-height:300px;width:100%;border-style:none;resize:none;outline:none}.trumbowyg-box-blur .trumbowyg-editor *{color:transparent !important;text-shadow:0 0 7px #333}.trumbowyg-box-blur .trumbowyg-editor img{opacity:0.2}.trumbowyg-textarea{position:relative;display:block;overflow:auto;border:none;white-space:normal}.trumbowyg-editor[contenteditable=true]:empty:before{content:attr(placeholder);color:#999}.trumbowyg-button-pane{position:relative;width:100%;background:#ecf0f1;border-bottom:1px solid #d7e0e2;margin:0;padding:0;list-style-type:none;line-height:10px;-webkit-backface-visibility:hidden;backface-visibility:hidden}.trumbowyg-button-pane li{display:inline-block;text-align:center;overflow:hidden}.trumbowyg-button-pane li.trumbowyg-separator{width:1px;background:#d7e0e2;margin:0 5px;height:35px}.trumbowyg-button-pane.trumbowyg-disable li:not(.trumbowyg-not-disable) button:not(.trumbowyg-active){opacity:0.2;cursor:default}.trumbowyg-button-pane.trumbowyg-disable li.trumbowyg-separator{background:#e3e9eb}.trumbowyg-button-pane:not(.trumbowyg-disable) li button:hover,.trumbowyg-button-pane:not(.trumbowyg-disable) li button:focus,.trumbowyg-button-pane li button.trumbowyg-active,.trumbowyg-button-pane li.trumbowyg-not-disable button:hover,.trumbowyg-button-pane li.trumbowyg-not-disable button:focus{background-color:#FFF;outline:none}.trumbowyg-button-pane li .trumbowyg-open-dropdown:after{display:block;content:" ";position:absolute;top:25px;right:3px;height:0;width:0;border:3px solid transparent;border-top-color:#555}.trumbowyg-button-pane .trumbowyg-buttons-right{float:right;width:auto}.trumbowyg-button-pane .trumbowyg-buttons-right button{float:left}.trumbowyg-dropdown{width:200px;border:1px solid #ecf0f1;padding:5px 0;border-top:none;background:#FFF;margin-left:-1px;-webkit-box-shadow:rgba(0,0,0,0.1) 0 2px 3px;box-shadow:rgba(0,0,0,0.1) 0 2px 3px}.trumbowyg-dropdown button{display:block;width:100%;height:35px;line-height:35px;text-decoration:none;background:#FFF;padding:0 14px;color:#333;border:none;cursor:pointer;text-align:left;font-size:15px;-webkit-transition:all 0.15s;-o-transition:all 0.15s;transition:all 0.15s}.trumbowyg-dropdown button:hover,.trumbowyg-dropdown button:focus{background:#ecf0f1}.trumbowyg-modal{position:absolute;top:0;left:50%;margin-left:-260px;width:520px;height:290px;overflow:hidden}.trumbowyg-modal-box{position:absolute;top:0;left:50%;margin-left:-250px;width:500px;height:275px;z-index:1;background-color:#FFF;text-align:center;-webkit-box-shadow:rgba(0,0,0,0.2) 0 2px 3px;box-shadow:rgba(0,0,0,0.2) 0 2px 3px;-webkit-backface-visibility:hidden;backface-visibility:hidden}.trumbowyg-modal-box .trumbowyg-modal-title{font-size:24px;font-weight:bold;margin:0 0 20px;padding:15px 0 13px;display:block;border-bottom:1px solid #EEE;color:#333;background:#fbfcfc}.trumbowyg-modal-box .trumbowyg-progress{width:100%;background:#F00;height:3px;position:absolute;top:58px}.trumbowyg-modal-box .trumbowyg-progress .trumbowyg-progress-bar{background:#2BC06A;height:100%;-webkit-transition:width 0.15s linear;-o-transition:width 0.15s linear;transition:width 0.15s linear}.trumbowyg-modal-box label{display:block;position:relative;margin:15px 12px;height:27px;line-height:27px;overflow:hidden}.trumbowyg-modal-box label .trumbowyg-input-infos{display:block;text-align:left;height:25px;line-height:25px;-webkit-transition:all 0.15;-o-transition:all 0.15;transition:all 0.15}.trumbowyg-modal-box label .trumbowyg-input-infos span{display:block;color:#859fa5;background-color:#fbfcfc;border:1px solid #DEDEDE;padding:0 2%;width:19.5%}.trumbowyg-modal-box label .trumbowyg-input-infos span.trumbowyg-msg-error{color:#e74c3c}.trumbowyg-modal-box label.trumbowyg-input-error input,.trumbowyg-modal-box label.trumbowyg-input-error textarea{border:1px solid #e74c3c}.trumbowyg-modal-box label.trumbowyg-input-error .trumbowyg-input-infos{margin-top:-27px}.trumbowyg-modal-box label input{position:absolute;top:0;right:0;height:25px;line-height:25px;border:1px solid #DEDEDE;background:transparent;width:72%;padding:0 2%;margin:0 0 0 23%;-webkit-transition:all 0.15s;-o-transition:all 0.15s;transition:all 0.15s}.trumbowyg-modal-box label input:hover,.trumbowyg-modal-box label input:focus{outline:none;border:1px solid #95a5a6}.trumbowyg-modal-box label input:focus{background:rgba(230,230,255,0.1)}.trumbowyg-modal-box .error{margin-top:25px;display:block;color:red}.trumbowyg-modal-box .trumbowyg-modal-button{position:absolute;bottom:10px;right:0;text-decoration:none;color:#FFF;display:block;width:100px;height:35px;line-height:33px;margin:0 10px;background-color:#333;border:none;border-top:none;cursor:pointer;font-family:"Trebuchet MS", Helvetica, Verdana, sans-serif;font-size:16px;-webkit-transition:all 0.15s;-o-transition:all 0.15s;transition:all 0.15s}.trumbowyg-modal-box .trumbowyg-modal-button.trumbowyg-modal-submit{right:110px;background:#2bc069}.trumbowyg-modal-box .trumbowyg-modal-button.trumbowyg-modal-submit:hover,.trumbowyg-modal-box .trumbowyg-modal-button.trumbowyg-modal-submit:focus{background:#40d47d;outline:none}.trumbowyg-modal-box .trumbowyg-modal-button.trumbowyg-modal-submit:active{background:#25a259}.trumbowyg-modal-box .trumbowyg-modal-button.trumbowyg-modal-reset{color:#555;background:#e6e6e6}.trumbowyg-modal-box .trumbowyg-modal-button.trumbowyg-modal-reset:hover,.trumbowyg-modal-box .trumbowyg-modal-button.trumbowyg-modal-reset:focus{background:#fbfbfb;outline:none}.trumbowyg-modal-box .trumbowyg-modal-button.trumbowyg-modal-reset:active{background:#d4d4d4}.trumbowyg-overlay{position:absolute;background-color:rgba(255,255,255,0.5);width:100%;left:0;display:none}.trumbowyg-fullscreen{position:fixed;top:0;left:0;width:100%;height:100%;margin:0;padding:0;z-index:99999}.trumbowyg-fullscreen.trumbowyg-box,.trumbowyg-fullscreen .trumbowyg-editor{border:none}.trumbowyg-fullscreen .trumbowyg-overlay{height:100% !important}.trumbowyg-editor object,.trumbowyg-editor embed,.trumbowyg-editor video,.trumbowyg-editor img{width:auto;max-width:100%}.trumbowyg-editor video,.trumbowyg-editor img{height:auto}.trumbowyg-editor img{cursor:move}.trumbowyg-editor.trumbowyg-reset-css{background:#FEFEFE !important;font-family:"Trebuchet MS", Helvetica, Verdana, sans-serif !important;font-size:14px !important;line-height:1.45em !important;white-space:normal !important;color:#333}.trumbowyg-editor.trumbowyg-reset-css a{color:#15c !important;text-decoration:underline !important}.trumbowyg-editor.trumbowyg-reset-css div,.trumbowyg-editor.trumbowyg-reset-css p,.trumbowyg-editor.trumbowyg-reset-css ul,.trumbowyg-editor.trumbowyg-reset-css ol,.trumbowyg-editor.trumbowyg-reset-css blockquote{-webkit-box-shadow:none !important;box-shadow:none !important;background:none !important;margin:0 !important;margin-bottom:15px !important;line-height:1.4em !important;font-family:"Trebuchet MS", Helvetica, Verdana, sans-serif !important;font-size:14px !important;border:none}.trumbowyg-editor.trumbowyg-reset-css iframe,.trumbowyg-editor.trumbowyg-reset-css object,.trumbowyg-editor.trumbowyg-reset-css hr{margin-bottom:15px !important}.trumbowyg-editor.trumbowyg-reset-css blockquote{margin-left:32px !important;font-style:italic !important;color:#555}.trumbowyg-editor.trumbowyg-reset-css ul,.trumbowyg-editor.trumbowyg-reset-css ol{padding-left:20px !important}.trumbowyg-editor.trumbowyg-reset-css ul ul,.trumbowyg-editor.trumbowyg-reset-css ol ol,.trumbowyg-editor.trumbowyg-reset-css ul ol,.trumbowyg-editor.trumbowyg-reset-css ol ul{border:none;margin:2px !important;padding:0 !important;padding-left:24px !important}.trumbowyg-editor.trumbowyg-reset-css hr{display:block;height:1px;border:none;border-top:1px solid #CCC}.trumbowyg-editor.trumbowyg-reset-css h1,.trumbowyg-editor.trumbowyg-reset-css h2,.trumbowyg-editor.trumbowyg-reset-css h3,.trumbowyg-editor.trumbowyg-reset-css h4{color:#111;background:none;margin:0 !important;padding:0 !important;font-weight:bold}.trumbowyg-editor.trumbowyg-reset-css h1{font-size:32px !important;line-height:38px !important;margin-bottom:20px !important}.trumbowyg-editor.trumbowyg-reset-css h2{font-size:26px !important;line-height:34px !important;margin-bottom:15px !important}.trumbowyg-editor.trumbowyg-reset-css h3{font-size:22px !important;line-height:28px !important;margin-bottom:7px !important}.trumbowyg-editor.trumbowyg-reset-css h4{font-size:16px !important;line-height:22px !important;margin-bottom:7px !important}.trumbowyg-button-pane li button{display:block;position:relative;text-indent:-9999px;width:35px;height:35px;overflow:hidden;background:transparent url("/assets/trumbowyg/icons-0b2826fbd974348c269c2b8017a14314.png") no-repeat;border:none;cursor:pointer;-webkit-transition:background-color 0.15s, background-image 0.15s, opacity 0.15s;-o-transition:background-color 0.15s, background-image 0.15s, opacity 0.15s;transition:background-color 0.15s, background-image 0.15s, opacity 0.15s}.trumbowyg-button-pane li button.trumbowyg-viewHTML-button{background-position:5px -545px}.trumbowyg-button-pane li button.trumbowyg-formatting-button{background-position:5px -120px}.trumbowyg-button-pane li button.trumbowyg-bold-button,.trumbowyg-button-pane li button.trumbowyg-strong-button{background-position:5px -45px}.trumbowyg-button-pane li button.trumbowyg-italic-button,.trumbowyg-button-pane li button.trumbowyg-em-button{background-position:5px 5px}.trumbowyg-button-pane li button.trumbowyg-underline-button{background-position:5px -470px}.trumbowyg-button-pane li button.trumbowyg-strikethrough-button,.trumbowyg-button-pane li button.trumbowyg-del-button{background-position:5px -445px}.trumbowyg-button-pane li button.trumbowyg-link-button{background-position:5px -345px}.trumbowyg-button-pane li button.trumbowyg-insertImage-button{background-position:5px -245px}.trumbowyg-button-pane li button.trumbowyg-justifyLeft-button{background-position:5px -320px}.trumbowyg-button-pane li button.trumbowyg-justifyCenter-button{background-position:5px -70px}.trumbowyg-button-pane li button.trumbowyg-justifyRight-button{background-position:5px -395px}.trumbowyg-button-pane li button.trumbowyg-justifyFull-button{background-position:5px -295px}.trumbowyg-button-pane li button.trumbowyg-unorderedList-button{background-position:5px -495px}.trumbowyg-button-pane li button.trumbowyg-orderedList-button{background-position:5px -370px}.trumbowyg-button-pane li button.trumbowyg-horizontalRule-button{background-position:5px -220px}.trumbowyg-button-pane li button.trumbowyg-fullscreen-button{background-position:5px -170px}.trumbowyg-button-pane li button.trumbowyg-close-button{background-position:5px -95px}.trumbowyg-fullscreen .trumbowyg-button-pane li button.trumbowyg-fullscreen-button{background-position:5px -145px}.trumbowyg-button-pane li:first-child button{margin-left:6px}.trumbowyg-button-pane li:last-child button{margin-right:6px}.trumbowyg-fr .trumbowyg-button-pane li button.trumbowyg-bold-button,.trumbowyg-fr .trumbowyg-button-pane li button.trumbowyg-strong-button{background-position:5px -195px}.trumbowyg-fr .trumbowyg-button-pane li button.trumbowyg-underline-button{background-position:5px -420px}.trumbowyg-fr .trumbowyg-button-pane li button.trumbowyg-strikethrough-button,.trumbowyg-fr .trumbowyg-button-pane li button.trumbowyg-del-button{background-position:5px -270px}@media only screen and (-webkit-min-device-pixel-ratio: 1.3), only screen and (min--moz-device-pixel-ratio: 1.3), only screen and (-o-min-device-pixel-ratio: 4 / 3), only screen and (min-device-pixel-ratio: 1.3), only screen and (min-resolution: 192dpi), only screen and (min-resolution: 2dppx){.trumbowyg-button-pane li button{-webkit-background-size:25px 575px !important;background-size:25px 575px !important;background-image:url("/assets/trumbowyg/icons-2x-cc69d8bc62651602e75c2f7097cf5187.png") !important}.trumbowyg-button-pane li button.trumbowyg-viewHTML-button{background-position:5px -545px}.trumbowyg-button-pane li button.trumbowyg-formatting-button{background-position:5px -120px}.trumbowyg-button-pane li button.trumbowyg-bold-button,.trumbowyg-button-pane li button.trumbowyg-strong-button{background-position:5px -45px}.trumbowyg-button-pane li button.trumbowyg-italic-button,.trumbowyg-button-pane li button.trumbowyg-em-button{background-position:5px 5px}.trumbowyg-button-pane li button.trumbowyg-underline-button{background-position:5px -470px}.trumbowyg-button-pane li button.trumbowyg-strikethrough-button,.trumbowyg-button-pane li button.trumbowyg-del-button{background-position:5px -445px}.trumbowyg-button-pane li button.trumbowyg-link-button{background-position:5px -345px}.trumbowyg-button-pane li button.trumbowyg-insertImage-button{background-position:5px -245px}.trumbowyg-button-pane li button.trumbowyg-justifyLeft-button{background-position:5px -320px}.trumbowyg-button-pane li button.trumbowyg-justifyCenter-button{background-position:5px -70px}.trumbowyg-button-pane li button.trumbowyg-justifyRight-button{background-position:5px -395px}.trumbowyg-button-pane li button.trumbowyg-justifyFull-button{background-position:5px -295px}.trumbowyg-button-pane li button.trumbowyg-unorderedList-button{background-position:5px -495px}.trumbowyg-button-pane li button.trumbowyg-orderedList-button{background-position:5px -370px}.trumbowyg-button-pane li button.trumbowyg-horizontalRule-button{background-position:5px -220px}.trumbowyg-button-pane li button.trumbowyg-fullscreen-button{background-position:5px -170px}.trumbowyg-button-pane li button.trumbowyg-close-button{background-position:5px -95px}.trumbowyg-fullscreen .trumbowyg-button-pane li a.trumbowyg-fullscreen-button{background-position:5px -145px}.trumbowyg-fr .trumbowyg-button-pane li button.trumbowyg-bold-button,.trumbowyg-fr .trumbowyg-button-pane li button.trumbowyg-strong-button{background-position:5px -195px}.trumbowyg-fr .trumbowyg-button-pane li button.trumbowyg-underline-button{background-position:5px -420px}.trumbowyg-fr .trumbowyg-button-pane li button.trumbowyg-strikethrough-button,.trumbowyg-fr .trumbowyg-button-pane li button.trumbowyg-del-button{background-position:5px -270px}}
@@ -1 +0,0 @@
1
- .trumbowyg-box,.trumbowyg-editor{display:block;position:relative;border:1px solid #DDD;width:96%;min-height:300px;margin:17px auto}.trumbowyg-box .trumbowyg-editor{margin:0 auto}.trumbowyg-box.trumbowyg-fullscreen{background:#FEFEFE}.trumbowyg-editor,.trumbowyg-textarea{position:relative;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;padding:1% 2%;min-height:300px;width:100%;border-style:none;resize:none;outline:none}.trumbowyg-box-blur .trumbowyg-editor *{color:transparent !important;text-shadow:0 0 7px #333}.trumbowyg-box-blur .trumbowyg-editor img{opacity:0.2}.trumbowyg-textarea{position:relative;display:block;overflow:auto;border:none;white-space:normal}.trumbowyg-editor[contenteditable=true]:empty:before{content:attr(placeholder);color:#999}.trumbowyg-button-pane{position:relative;width:100%;background:#ecf0f1;border-bottom:1px solid #d7e0e2;margin:0;padding:0;list-style-type:none;line-height:10px;-webkit-backface-visibility:hidden;backface-visibility:hidden}.trumbowyg-button-pane li{display:inline-block;text-align:center;overflow:hidden}.trumbowyg-button-pane li.trumbowyg-separator{width:1px;background:#d7e0e2;margin:0 5px;height:35px}.trumbowyg-button-pane.trumbowyg-disable li:not(.trumbowyg-not-disable) button:not(.trumbowyg-active){opacity:0.2;cursor:default}.trumbowyg-button-pane.trumbowyg-disable li.trumbowyg-separator{background:#e3e9eb}.trumbowyg-button-pane:not(.trumbowyg-disable) li button:hover,.trumbowyg-button-pane:not(.trumbowyg-disable) li button:focus,.trumbowyg-button-pane li button.trumbowyg-active,.trumbowyg-button-pane li.trumbowyg-not-disable button:hover,.trumbowyg-button-pane li.trumbowyg-not-disable button:focus{background-color:#FFF;outline:none}.trumbowyg-button-pane li .trumbowyg-open-dropdown:after{display:block;content:" ";position:absolute;top:25px;right:3px;height:0;width:0;border:3px solid transparent;border-top-color:#555}.trumbowyg-button-pane .trumbowyg-buttons-right{float:right;width:auto}.trumbowyg-button-pane .trumbowyg-buttons-right button{float:left}.trumbowyg-dropdown{width:200px;border:1px solid #ecf0f1;padding:5px 0;border-top:none;background:#FFF;margin-left:-1px;-webkit-box-shadow:rgba(0,0,0,0.1) 0 2px 3px;box-shadow:rgba(0,0,0,0.1) 0 2px 3px}.trumbowyg-dropdown button{display:block;width:100%;height:35px;line-height:35px;text-decoration:none;background:#FFF;padding:0 14px;color:#333;border:none;cursor:pointer;text-align:left;font-size:15px;-webkit-transition:all 0.15s;-o-transition:all 0.15s;transition:all 0.15s}.trumbowyg-dropdown button:hover,.trumbowyg-dropdown button:focus{background:#ecf0f1}.trumbowyg-modal{position:absolute;top:0;left:50%;margin-left:-260px;width:520px;height:290px;overflow:hidden}.trumbowyg-modal-box{position:absolute;top:0;left:50%;margin-left:-250px;width:500px;height:275px;z-index:1;background-color:#FFF;text-align:center;-webkit-box-shadow:rgba(0,0,0,0.2) 0 2px 3px;box-shadow:rgba(0,0,0,0.2) 0 2px 3px;-webkit-backface-visibility:hidden;backface-visibility:hidden}.trumbowyg-modal-box .trumbowyg-modal-title{font-size:24px;font-weight:bold;margin:0 0 20px;padding:15px 0 13px;display:block;border-bottom:1px solid #EEE;color:#333;background:#fbfcfc}.trumbowyg-modal-box .trumbowyg-progress{width:100%;background:#F00;height:3px;position:absolute;top:58px}.trumbowyg-modal-box .trumbowyg-progress .trumbowyg-progress-bar{background:#2BC06A;height:100%;-webkit-transition:width 0.15s linear;-o-transition:width 0.15s linear;transition:width 0.15s linear}.trumbowyg-modal-box label{display:block;position:relative;margin:15px 12px;height:27px;line-height:27px;overflow:hidden}.trumbowyg-modal-box label .trumbowyg-input-infos{display:block;text-align:left;height:25px;line-height:25px;-webkit-transition:all 0.15;-o-transition:all 0.15;transition:all 0.15}.trumbowyg-modal-box label .trumbowyg-input-infos span{display:block;color:#859fa5;background-color:#fbfcfc;border:1px solid #DEDEDE;padding:0 2%;width:19.5%}.trumbowyg-modal-box label .trumbowyg-input-infos span.trumbowyg-msg-error{color:#e74c3c}.trumbowyg-modal-box label.trumbowyg-input-error input,.trumbowyg-modal-box label.trumbowyg-input-error textarea{border:1px solid #e74c3c}.trumbowyg-modal-box label.trumbowyg-input-error .trumbowyg-input-infos{margin-top:-27px}.trumbowyg-modal-box label input{position:absolute;top:0;right:0;height:25px;line-height:25px;border:1px solid #DEDEDE;background:transparent;width:72%;padding:0 2%;margin:0 0 0 23%;-webkit-transition:all 0.15s;-o-transition:all 0.15s;transition:all 0.15s}.trumbowyg-modal-box label input:hover,.trumbowyg-modal-box label input:focus{outline:none;border:1px solid #95a5a6}.trumbowyg-modal-box label input:focus{background:rgba(230,230,255,0.1)}.trumbowyg-modal-box .error{margin-top:25px;display:block;color:red}.trumbowyg-modal-box .trumbowyg-modal-button{position:absolute;bottom:10px;right:0;text-decoration:none;color:#FFF;display:block;width:100px;height:35px;line-height:33px;margin:0 10px;background-color:#333;border:none;border-top:none;cursor:pointer;font-family:"Trebuchet MS", Helvetica, Verdana, sans-serif;font-size:16px;-webkit-transition:all 0.15s;-o-transition:all 0.15s;transition:all 0.15s}.trumbowyg-modal-box .trumbowyg-modal-button.trumbowyg-modal-submit{right:110px;background:#2bc069}.trumbowyg-modal-box .trumbowyg-modal-button.trumbowyg-modal-submit:hover,.trumbowyg-modal-box .trumbowyg-modal-button.trumbowyg-modal-submit:focus{background:#40d47d;outline:none}.trumbowyg-modal-box .trumbowyg-modal-button.trumbowyg-modal-submit:active{background:#25a259}.trumbowyg-modal-box .trumbowyg-modal-button.trumbowyg-modal-reset{color:#555;background:#e6e6e6}.trumbowyg-modal-box .trumbowyg-modal-button.trumbowyg-modal-reset:hover,.trumbowyg-modal-box .trumbowyg-modal-button.trumbowyg-modal-reset:focus{background:#fbfbfb;outline:none}.trumbowyg-modal-box .trumbowyg-modal-button.trumbowyg-modal-reset:active{background:#d4d4d4}.trumbowyg-overlay{position:absolute;background-color:rgba(255,255,255,0.5);width:100%;left:0;display:none}.trumbowyg-fullscreen{position:fixed;top:0;left:0;width:100%;height:100%;margin:0;padding:0;z-index:99999}.trumbowyg-fullscreen.trumbowyg-box,.trumbowyg-fullscreen .trumbowyg-editor{border:none}.trumbowyg-fullscreen .trumbowyg-overlay{height:100% !important}.trumbowyg-editor object,.trumbowyg-editor embed,.trumbowyg-editor video,.trumbowyg-editor img{width:auto;max-width:100%}.trumbowyg-editor video,.trumbowyg-editor img{height:auto}.trumbowyg-editor img{cursor:move}.trumbowyg-editor.trumbowyg-reset-css{background:#FEFEFE !important;font-family:"Trebuchet MS", Helvetica, Verdana, sans-serif !important;font-size:14px !important;line-height:1.45em !important;white-space:normal !important;color:#333}.trumbowyg-editor.trumbowyg-reset-css a{color:#15c !important;text-decoration:underline !important}.trumbowyg-editor.trumbowyg-reset-css div,.trumbowyg-editor.trumbowyg-reset-css p,.trumbowyg-editor.trumbowyg-reset-css ul,.trumbowyg-editor.trumbowyg-reset-css ol,.trumbowyg-editor.trumbowyg-reset-css blockquote{-webkit-box-shadow:none !important;box-shadow:none !important;background:none !important;margin:0 !important;margin-bottom:15px !important;line-height:1.4em !important;font-family:"Trebuchet MS", Helvetica, Verdana, sans-serif !important;font-size:14px !important;border:none}.trumbowyg-editor.trumbowyg-reset-css iframe,.trumbowyg-editor.trumbowyg-reset-css object,.trumbowyg-editor.trumbowyg-reset-css hr{margin-bottom:15px !important}.trumbowyg-editor.trumbowyg-reset-css blockquote{margin-left:32px !important;font-style:italic !important;color:#555}.trumbowyg-editor.trumbowyg-reset-css ul,.trumbowyg-editor.trumbowyg-reset-css ol{padding-left:20px !important}.trumbowyg-editor.trumbowyg-reset-css ul ul,.trumbowyg-editor.trumbowyg-reset-css ol ol,.trumbowyg-editor.trumbowyg-reset-css ul ol,.trumbowyg-editor.trumbowyg-reset-css ol ul{border:none;margin:2px !important;padding:0 !important;padding-left:24px !important}.trumbowyg-editor.trumbowyg-reset-css hr{display:block;height:1px;border:none;border-top:1px solid #CCC}.trumbowyg-editor.trumbowyg-reset-css h1,.trumbowyg-editor.trumbowyg-reset-css h2,.trumbowyg-editor.trumbowyg-reset-css h3,.trumbowyg-editor.trumbowyg-reset-css h4{color:#111;background:none;margin:0 !important;padding:0 !important;font-weight:bold}.trumbowyg-editor.trumbowyg-reset-css h1{font-size:32px !important;line-height:38px !important;margin-bottom:20px !important}.trumbowyg-editor.trumbowyg-reset-css h2{font-size:26px !important;line-height:34px !important;margin-bottom:15px !important}.trumbowyg-editor.trumbowyg-reset-css h3{font-size:22px !important;line-height:28px !important;margin-bottom:7px !important}.trumbowyg-editor.trumbowyg-reset-css h4{font-size:16px !important;line-height:22px !important;margin-bottom:7px !important}.trumbowyg-button-pane li button{display:block;position:relative;text-indent:-9999px;width:35px;height:35px;overflow:hidden;background:transparent url("/assets/trumbowyg/icons-efc940454e4e764063875def5c909a2f9c8b2c4d2a41c6a98dc41fb111868f1f.png") no-repeat;border:none;cursor:pointer;-webkit-transition:background-color 0.15s, background-image 0.15s, opacity 0.15s;-o-transition:background-color 0.15s, background-image 0.15s, opacity 0.15s;transition:background-color 0.15s, background-image 0.15s, opacity 0.15s}.trumbowyg-button-pane li button.trumbowyg-viewHTML-button{background-position:5px -545px}.trumbowyg-button-pane li button.trumbowyg-formatting-button{background-position:5px -120px}.trumbowyg-button-pane li button.trumbowyg-bold-button,.trumbowyg-button-pane li button.trumbowyg-strong-button{background-position:5px -45px}.trumbowyg-button-pane li button.trumbowyg-italic-button,.trumbowyg-button-pane li button.trumbowyg-em-button{background-position:5px 5px}.trumbowyg-button-pane li button.trumbowyg-underline-button{background-position:5px -470px}.trumbowyg-button-pane li button.trumbowyg-strikethrough-button,.trumbowyg-button-pane li button.trumbowyg-del-button{background-position:5px -445px}.trumbowyg-button-pane li button.trumbowyg-link-button{background-position:5px -345px}.trumbowyg-button-pane li button.trumbowyg-insertImage-button{background-position:5px -245px}.trumbowyg-button-pane li button.trumbowyg-justifyLeft-button{background-position:5px -320px}.trumbowyg-button-pane li button.trumbowyg-justifyCenter-button{background-position:5px -70px}.trumbowyg-button-pane li button.trumbowyg-justifyRight-button{background-position:5px -395px}.trumbowyg-button-pane li button.trumbowyg-justifyFull-button{background-position:5px -295px}.trumbowyg-button-pane li button.trumbowyg-unorderedList-button{background-position:5px -495px}.trumbowyg-button-pane li button.trumbowyg-orderedList-button{background-position:5px -370px}.trumbowyg-button-pane li button.trumbowyg-horizontalRule-button{background-position:5px -220px}.trumbowyg-button-pane li button.trumbowyg-fullscreen-button{background-position:5px -170px}.trumbowyg-button-pane li button.trumbowyg-close-button{background-position:5px -95px}.trumbowyg-fullscreen .trumbowyg-button-pane li button.trumbowyg-fullscreen-button{background-position:5px -145px}.trumbowyg-button-pane li:first-child button{margin-left:6px}.trumbowyg-button-pane li:last-child button{margin-right:6px}.trumbowyg-fr .trumbowyg-button-pane li button.trumbowyg-bold-button,.trumbowyg-fr .trumbowyg-button-pane li button.trumbowyg-strong-button{background-position:5px -195px}.trumbowyg-fr .trumbowyg-button-pane li button.trumbowyg-underline-button{background-position:5px -420px}.trumbowyg-fr .trumbowyg-button-pane li button.trumbowyg-strikethrough-button,.trumbowyg-fr .trumbowyg-button-pane li button.trumbowyg-del-button{background-position:5px -270px}@media only screen and (-webkit-min-device-pixel-ratio: 1.3), only screen and (min--moz-device-pixel-ratio: 1.3), only screen and (-o-min-device-pixel-ratio: 4 / 3), only screen and (min-device-pixel-ratio: 1.3), only screen and (min-resolution: 192dpi), only screen and (min-resolution: 2dppx){.trumbowyg-button-pane li button{-webkit-background-size:25px 575px !important;background-size:25px 575px !important;background-image:url("/assets/trumbowyg/icons-2x-39fe92cd396082eb94f0c92103537209ba97ffa3079377bbe55fea857abe5341.png") !important}.trumbowyg-button-pane li button.trumbowyg-viewHTML-button{background-position:5px -545px}.trumbowyg-button-pane li button.trumbowyg-formatting-button{background-position:5px -120px}.trumbowyg-button-pane li button.trumbowyg-bold-button,.trumbowyg-button-pane li button.trumbowyg-strong-button{background-position:5px -45px}.trumbowyg-button-pane li button.trumbowyg-italic-button,.trumbowyg-button-pane li button.trumbowyg-em-button{background-position:5px 5px}.trumbowyg-button-pane li button.trumbowyg-underline-button{background-position:5px -470px}.trumbowyg-button-pane li button.trumbowyg-strikethrough-button,.trumbowyg-button-pane li button.trumbowyg-del-button{background-position:5px -445px}.trumbowyg-button-pane li button.trumbowyg-link-button{background-position:5px -345px}.trumbowyg-button-pane li button.trumbowyg-insertImage-button{background-position:5px -245px}.trumbowyg-button-pane li button.trumbowyg-justifyLeft-button{background-position:5px -320px}.trumbowyg-button-pane li button.trumbowyg-justifyCenter-button{background-position:5px -70px}.trumbowyg-button-pane li button.trumbowyg-justifyRight-button{background-position:5px -395px}.trumbowyg-button-pane li button.trumbowyg-justifyFull-button{background-position:5px -295px}.trumbowyg-button-pane li button.trumbowyg-unorderedList-button{background-position:5px -495px}.trumbowyg-button-pane li button.trumbowyg-orderedList-button{background-position:5px -370px}.trumbowyg-button-pane li button.trumbowyg-horizontalRule-button{background-position:5px -220px}.trumbowyg-button-pane li button.trumbowyg-fullscreen-button{background-position:5px -170px}.trumbowyg-button-pane li button.trumbowyg-close-button{background-position:5px -95px}.trumbowyg-fullscreen .trumbowyg-button-pane li a.trumbowyg-fullscreen-button{background-position:5px -145px}.trumbowyg-fr .trumbowyg-button-pane li button.trumbowyg-bold-button,.trumbowyg-fr .trumbowyg-button-pane li button.trumbowyg-strong-button{background-position:5px -195px}.trumbowyg-fr .trumbowyg-button-pane li button.trumbowyg-underline-button{background-position:5px -420px}.trumbowyg-fr .trumbowyg-button-pane li button.trumbowyg-strikethrough-button,.trumbowyg-fr .trumbowyg-button-pane li button.trumbowyg-del-button{background-position:5px -270px}}
@@ -1 +0,0 @@
1
- jQuery.trumbowyg={langs:{en:{viewHTML:"View HTML",formatting:"Formatting",p:"Paragraph",blockquote:"Quote",code:"Code",header:"Header",bold:"Bold",italic:"Italic",strikethrough:"Stroke",underline:"Underline",strong:"Strong",em:"Emphasis",del:"Deleted",unorderedList:"Unordered list",orderedList:"Ordered list",insertImage:"Insert Image",insertVideo:"Insert Video",link:"Link",createLink:"Insert link",unlink:"Remove link",justifyLeft:"Align Left",justifyCenter:"Align Center",justifyRight:"Align Right",justifyFull:"Align Justify",horizontalRule:"Insert horizontal rule",fullscreen:"fullscreen",close:"Close",submit:"Confirm",reset:"Cancel",invalidUrl:"Invalid URL",required:"Required",description:"Description",title:"Title",text:"Text"}},opts:{},btnsGrps:{design:["bold","italic","underline","strikethrough"],semantic:["strong","em","del"],justify:["justifyLeft","justifyCenter","justifyRight","justifyFull"],lists:["unorderedList","orderedList"]}},function(e,t,n,o){"use strict";n.fn.trumbowyg=function(e,t){if(e===Object(e)||!e)return this.each(function(){n(this).data("trumbowyg")||n(this).data("trumbowyg",new i(this,e))});if(1===this.length)try{var o=n(this).data("trumbowyg");switch(e){case"openModal":return o.openModal(t.title,t.content);case"closeModal":return o.closeModal();case"openModalInsert":return o.openModalInsert(t.title,t.fields,t.callback);case"saveSelection":return o.saveSelection();case"getSelection":return o.selection;case"getSelectedText":return o.selection+"";case"restoreSelection":return o.restoreSelection();case"destroy":return o.destroy();case"empty":return o.empty();case"lang":return o.lang;case"duration":return o.o.duration;case"html":return o.html(t)}}catch(r){}return!1};var i=function(e,o){var i=this;i.doc=e.ownerDocument||t,i.$e=n(e),i.$creator=n(e),o=n.extend(!0,{},o,n.trumbowyg.opts),"undefined"==typeof o.lang||"undefined"==typeof n.trumbowyg.langs[o.lang]?i.lang=n.trumbowyg.langs.en:i.lang=n.extend(!0,{},n.trumbowyg.langs.en,n.trumbowyg.langs[o.lang]),i.o=n.extend(!0,{},{lang:"en",dir:"ltr",duration:200,mobile:!1,tablet:!0,closable:!1,fullscreenable:!0,fixedBtnPane:!1,fixedFullWidth:!1,autogrow:!1,prefix:"trumbowyg-",convertLink:!0,semantic:!1,resetCss:!1,btns:["viewHTML","|","formatting","|",n.trumbowyg.btnsGrps.design,"|","link","|","insertImage","|",n.trumbowyg.btnsGrps.justify,"|",n.trumbowyg.btnsGrps.lists,"|","horizontalRule"],btnsAdd:[],btnsDef:{viewHTML:{func:"toggle"},p:{func:"formatBlock"},blockquote:{func:"formatBlock"},h1:{func:"formatBlock",title:i.lang.header+" 1"},h2:{func:"formatBlock",title:i.lang.header+" 2"},h3:{func:"formatBlock",title:i.lang.header+" 3"},h4:{func:"formatBlock",title:i.lang.header+" 4"},bold:{},italic:{},underline:{},strikethrough:{},strong:{func:"bold"},em:{func:"italic"},del:{func:"strikethrough"},createLink:{},unlink:{},insertImage:{},justifyLeft:{},justifyCenter:{},justifyRight:{},justifyFull:{},unorderedList:{func:"insertUnorderedList"},orderedList:{func:"insertOrderedList"},horizontalRule:{func:"insertHorizontalRule"},formatting:{dropdown:["p","blockquote","h1","h2","h3","h4"]},link:{dropdown:["createLink","unlink"]}}},o),i.o.semantic&&!o.btns?i.o.btns=["viewHTML","|","formatting","|",n.trumbowyg.btnsGrps.semantic,"|","link","|","insertImage","|",n.trumbowyg.btnsGrps.justify,"|",n.trumbowyg.btnsGrps.lists,"|","horizontalRule"]:o&&o.btns&&(i.o.btns=o.btns),i.init()};i.prototype={init:function(){var e=this;return e.height=e.$e.css("height"),e.isEnabled()?void e.buildEditor(!0):(e.buildEditor(),e.buildBtnPane(),e.fixedBtnPaneEvents(),void e.buildOverlay())},buildEditor:function(e){var t=this,o=t.o.prefix,i="";if(e!==!0)t.$box=n("<div/>",{"class":o+"box "+o+t.o.lang+" trumbowyg"}),t.isTextarea=!0,t.$e.is("textarea")?t.$editor=n("<div/>"):(t.$editor=t.$e,t.$e=t.buildTextarea().val(t.$e.val()),t.isTextarea=!1),t.$creator.is("[placeholder]")&&t.$editor.attr("placeholder",t.$creator.attr("placeholder")),t.$e.hide().addClass(o+"textarea"),t.isTextarea?(i=t.$e.val(),t.$box.insertAfter(t.$e).append(t.$editor).append(t.$e)):(i=t.$editor.html(),t.$box.insertAfter(t.$editor).append(t.$e).append(t.$editor),t.syncCode()),t.$editor.addClass(o+"editor").attr("contenteditable",!0).attr("dir",t.lang._dir||t.o.dir).html(i),t.o.resetCss&&t.$editor.addClass(o+"reset-css"),t.o.autogrow||n.each([t.$editor,t.$e],function(e,n){n.css({height:t.height,overflow:"auto"})}),t.o.semantic&&(t.$editor.html(t.$editor.html().replace("<br>","</p><p>").replace("&nbsp;","")),t.semanticCode()),t.$editor.on("dblclick","img",function(e){var o=n(this);t.openModalInsert(t.lang.insertImage,{url:{label:"URL",value:o.attr("src"),required:!0},alt:{label:"description",value:o.attr("alt")}},function(e){o.attr({src:e.url,alt:e.alt})}),e.stopPropagation()}).on("keyup",function(e){t.semanticCode(!1,13===e.which)}).on("focus",function(){t.$creator.trigger("tbwfocus")}).on("blur",function(){t.syncCode(),t.$creator.trigger("tbwblur")});else if(!t.$e.is("textarea")){var r=t.buildTextarea().val(t.$e.val());t.$e.hide().after(r)}},buildTextarea:function(){return n("<textarea/>",{name:this.$e.attr("id"),height:this.height})},buildBtnPane:function(){var t=this,i=t.o.prefix;if(t.o.btns!==!1){t.$btnPane=n("<ul/>",{"class":i+"button-pane"}),n.each(t.o.btns.concat(t.o.btnsAdd),function(e,r){try{var a=r.split("btnGrp-");a[1]!==o&&(r=n.trumbowyg.btnsGrps[a[1]])}catch(s){}n.isArray(r)||(r=[r]),n.each(r,function(e,o){try{var r=n("<li/>");"|"===o?r.addClass(i+"separator"):t.isSupportedBtn(o)&&r.append(t.buildBtn(o)),t.$btnPane.append(r)}catch(a){}})});var r=n("<li/>",{"class":i+"not-disable "+i+"buttons-right"});t.o.fullscreenable&&r.append(t.buildRightBtn("fullscreen").on("click",function(){var o=i+"fullscreen";t.$box.toggleClass(o),t.$box.hasClass(o)?(n("body").css("overflow","hidden"),n.each([t.$editor,t.$e],function(){n(this).css({height:"calc(100% - 35px)",overflow:"auto"})}),t.$btnPane.css("width","100%")):(n("body").css("overflow","auto"),t.$box.removeAttr("style"),t.o.autogrow||n.each([t.$editor,t.$e],function(){n(this).css("height",t.height)})),n(e).trigger("scroll")})),t.o.closable&&r.append(t.buildRightBtn("close").on("click",function(){t.$box.hasClass(i+"fullscreen")&&n("body").css("overflow","auto"),t.destroy()})),r.not(":empty")&&t.$btnPane.append(r),t.$box.prepend(t.$btnPane)}},buildBtn:function(e){var t=this,o=t.o.prefix,i=t.o.btnsDef[e],r=i.dropdown,a=t.lang[e]||e,s=n("<button/>",{type:"button","class":o+e+"-button"+(i.ico?" "+o+i.ico+"-button":""),text:i.text||i.title||a,title:i.title||i.text||a,mousedown:function(a){return r&&!t.$box.find("."+e+"-"+o+"dropdown").is(":hidden")||n("body",t.doc).trigger("mousedown"),!t.$btnPane.hasClass(o+"disable")||n(this).hasClass(o+"active")||n(this).parent().hasClass(o+"not-disable")?(t.execCmd((r?"dropdown":!1)||i.func||e,i.param||e),a.stopPropagation(),void a.preventDefault()):!1}});if(r){s.addClass(o+"open-dropdown");var l=o+"dropdown",d=n("<div/>",{"class":e+"-"+l+" "+l+" "+o+"fixed-top"});n.each(r,function(e,n){t.o.btnsDef[n]&&t.isSupportedBtn(n)&&d.append(t.buildSubBtn(n))}),t.$box.append(d.hide())}return s},buildSubBtn:function(e){var t=this,o=t.o.btnsDef[e];return n("<button/>",{type:"button",text:o.text||o.title||t.lang[e]||e,style:o.style||null,mousedown:function(i){n("body",t.doc).trigger("mousedown"),t.execCmd(o.func||e,o.param||e),i.stopPropagation()}})},buildRightBtn:function(e){return n("<button/>",{type:"button","class":this.o.prefix+e+"-button",title:this.lang[e],text:this.lang[e]})},isSupportedBtn:function(e){var t=this.o.btnsDef[e];return"function"!=typeof t.isSupported||t.isSupported()},buildOverlay:function(){var e=this;return e.$overlay=n("<div/>",{"class":e.o.prefix+"overlay"}).css({top:e.$btnPane.outerHeight(),height:parseInt(e.$editor.outerHeight())+1+"px"}).appendTo(e.$box),e.$overlay},showOverlay:function(){var t=this;n(e).trigger("scroll"),t.$overlay.fadeIn(t.o.duration),t.$box.addClass(t.o.prefix+"box-blur")},hideOverlay:function(){var e=this;e.$overlay.fadeOut(e.o.duration/4),e.$box.removeClass(e.o.prefix+"box-blur")},fixedBtnPaneEvents:function(){var t=this,o=t.o.fixedFullWidth;t.o.fixedBtnPane&&(t.isFixed=!1,n(e).on("scroll resize",function(){if(t.$box){t.syncCode();var i=n(e).scrollTop(),r=t.$box.offset().top+1,a=i-r>0&&i-r-parseInt(t.height)<0,s=t.$btnPane,l=s.css("height"),d=s.outerHeight();a?(t.isFixed||(t.isFixed=!0,s.css({position:"fixed",top:0,left:o?"0":"auto",zIndex:7}),n([t.$editor,t.$e]).css({marginTop:l})),s.css({width:o?"100%":parseInt(t.$box.css("width"))-1+"px"}),n("."+t.o.prefix+"fixed-top",t.$box).css({position:o?"fixed":"absolute",top:o?d:parseInt(d)+(i-r)+"px",zIndex:15})):t.isFixed&&(t.isFixed=!1,s.removeAttr("style"),n([t.$editor,t.$e]).css({marginTop:0}),n("."+t.o.prefix+"fixed-top",t.$box).css({position:"absolute",top:d}))}}))},destroy:function(){var e=this,t=e.o.prefix,n=e.height,o=e.html();e.isTextarea?e.$box.after(e.$e.css({height:n}).val(o).removeClass(t+"textarea").show()):e.$box.after(e.$editor.css({height:n}).removeClass(t+"editor").removeAttr("contenteditable").html(o).show()),e.$box.remove(),e.$creator.removeData("trumbowyg")},empty:function(){this.$e.val(""),this.syncCode(!0)},toggle:function(){var e=this,t=e.o.prefix;e.semanticCode(!1,!0),e.$editor.toggle(),e.$e.toggle(),e.$btnPane.toggleClass(t+"disable"),e.$btnPane.find("."+t+"viewHTML-button").toggleClass(t+"active")},dropdown:function(t){var o=this,i=o.doc,r=o.o.prefix,a=o.$box.find("."+t+"-"+r+"dropdown"),s=o.$btnPane.find("."+r+t+"-button");if(a.is(":hidden")){var l=s.offset().left;s.addClass(r+"active"),a.css({position:"absolute",top:o.$btnPane.outerHeight(),left:o.o.fixedFullWidth&&o.isFixed?l+"px":l-o.$btnPane.offset().left+"px"}).show(),n(e).trigger("scroll"),n("body",i).on("mousedown",function(){n("."+r+"dropdown",i).hide(),n("."+r+"active",i).removeClass(r+"active"),n("body",i).off("mousedown")})}else n("body",i).trigger("mousedown")},html:function(e){var t=this;return e?(t.$e.val(e),t.syncCode(!0),t):t.$e.val()},syncCode:function(e){var t=this;!e&&t.$editor.is(":visible")?t.$e.val(t.$editor.html()):t.$editor.html(t.$e.val()),t.o.autogrow&&(t.height=t.$editor.css("height"),t.$e.css({height:t.height}))},semanticCode:function(e,t){var o=this;o.syncCode(e),o.o.semantic&&(o.semanticTag("b","strong"),o.semanticTag("i","em"),o.semanticTag("strike","del"),t&&(o.$editor.contents().filter(function(){return 3===this.nodeType&&n.trim(this.nodeValue).length>0}).wrap("<p></p>").end().filter("br").remove(),o.saveSelection(),o.semanticTag("div","p"),o.restoreSelection()),o.$e.val(o.$editor.html()))},semanticTag:function(e,t){n(e,this.$editor).each(function(){n(this).replaceWith(function(){return"<"+t+">"+n(this).html()+"</"+t+">"})})},createLink:function(){var e=this;e.saveSelection(),e.openModalInsert(e.lang.createLink,{url:{label:"URL",value:"http://",required:!0},title:{label:e.lang.title,value:e.selection},text:{label:e.lang.text,value:e.selection}},function(t){e.execCmd("createLink",t.url);var o=n('a[href="'+t.url+'"]:not([title])',e.$box);return t.text.length>0&&o.text(t.text),t.title.length>0&&o.attr("title",t.title),!0})},insertImage:function(){var e=this;e.saveSelection(),e.openModalInsert(e.lang.insertImage,{url:{label:"URL",value:"http://",required:!0},alt:{label:e.lang.description,value:e.selection}},function(t){return e.execCmd("insertImage",t.url),n('img[src="'+t.url+'"]:not([alt])',e.$box).attr("alt",t.alt),!0})},execCmd:function(e,t){var n=this;"dropdown"!=e&&n.$editor.focus();try{n[e](t)}catch(o){try{e(t,n)}catch(i){"insertHorizontalRule"==e?t=null:"formatBlock"==e&&(-1!==navigator.userAgent.indexOf("MSIE")||navigator.appVersion.indexOf("Trident/")>0)&&(t="<"+t+">"),n.doc.execCommand(e,!1,t)}}n.syncCode()},openModal:function(t,o){var i=this,r=i.o.prefix;if(n("."+r+"modal-box",i.$box).size()>0)return!1;i.saveSelection(),i.showOverlay(),i.$btnPane.addClass(r+"disable");var a=n("<div/>",{"class":r+"modal "+r+"fixed-top"}).css({top:parseInt(i.$btnPane.css("height"))+1+"px"}).appendTo(i.$box);i.$overlay.one("click",function(e){e.preventDefault(),a.trigger(r+"cancel")});var s=n("<form/>",{action:"",html:o}).on("submit",function(e){e.preventDefault(),a.trigger(r+"confirm")}).on("reset",function(e){e.preventDefault(),a.trigger(r+"cancel")}),l=n("<div/>",{"class":r+"modal-box",html:s}).css({top:"-"+parseInt(i.$btnPane.outerHeight())+"px",opacity:0}).appendTo(a).animate({top:0,opacity:1},i.o.duration/2);return n("<span/>",{text:t,"class":r+"modal-title"}).prependTo(l),l.find("input:first").focus(),i.buildModalBtn("submit",l),i.buildModalBtn("reset",l),n(e).trigger("scroll"),a},buildModalBtn:function(e,t){var o=this,i=o.o.prefix;return n("<button/>",{"class":i+"modal-button "+i+"modal-"+e,type:e,text:o.lang[e]||e}).appendTo(t.find("form"))},closeModal:function(){var e=this,t=e.o.prefix;e.$btnPane.removeClass(t+"disable"),e.$overlay.off();var o=n("."+t+"modal-box",e.$box);o.animate({top:"-"+o.css("height")},e.o.duration/2,function(){n(this).parent().remove(),e.hideOverlay()})},openModalInsert:function(e,t,i){var r=this,a=r.o.prefix,s=r.lang,l="";for(var d in t){var c=t[d],u=c.label===o?s[d]?s[d]:d:s[c.label]?s[c.label]:c.label;c.name===o&&(c.name=d),c.pattern||"url"!==d||(c.pattern=/^(http|https):\/\/([\w~#!:.?+=&%@!\-\/]+)$/,c.patternError=s.invalidUrl),l+='<label><input type="'+(c.type||"text")+'" name="'+c.name+'" value="'+(c.value||"")+'"><span class="'+a+'input-infos"><span>'+u+"</span></span></label>"}return r.openModal(e,l).on(a+"confirm",function(){var e=n(this).find("form"),o=!0,s={};for(var l in t){var d=n('input[name="'+l+'"]',e);s[l]=n.trim(d.val()),t[l].required&&""===s[l]?(o=!1,r.addErrorOnModalField(d,r.lang.required)):t[l].pattern&&!t[l].pattern.test(s[l])&&(o=!1,r.addErrorOnModalField(d,t[l].patternError))}o&&(r.restoreSelection(),i(s,t)&&(r.syncCode(),r.closeModal(),n(this).off(a+"confirm")))}).one(a+"cancel",function(){n(this).off(a+"confirm"),r.closeModal(),r.restoreSelection()})},addErrorOnModalField:function(e,t){var o=this.o.prefix,i=e.parent();e.on("change keyup",function(){i.removeClass(o+"input-error")}),i.addClass(o+"input-error").find("input+span").append(n("<span/>",{"class":o+"msg-error",text:t}))},saveSelection:function(){var t=this,n=t.doc;if(t.selection=null,e.getSelection){var o=e.getSelection();o.getRangeAt&&o.rangeCount&&(t.selection=o.getRangeAt(0))}else n.selection&&n.selection.createRange&&(t.selection=n.selection.createRange())},restoreSelection:function(){var t=this,n=t.selection;if(n)if(e.getSelection){var o=e.getSelection();o.removeAllRanges(),o.addRange(n)}else t.doc.selection&&n.select&&n.select()},isEnabled:function(){var e=new RegExp("(iPad|webOS)"),t=new RegExp("(iPhone|iPod|Android|BlackBerry|Windows Phone|ZuneWP7)"),n=navigator.userAgent;return this.o.tablet===!0&&e.test(n)||this.o.mobile===!0&&t.test(n)}}}(window,document,jQuery);
data/test/test_helper.rb DELETED
@@ -1,35 +0,0 @@
1
- require "bundler/setup"
2
- require "minitest/autorun"
3
- require "minitest/assert_dirs_equal"
4
- require "tmpdir"
5
- require "fileutils"
6
-
7
- module Torba
8
- module Test
9
- module TmpDir
10
- attr_reader :torba_tmp_dir
11
-
12
- def self.persistent
13
- @persistent ||= File.realpath(Dir.mktmpdir("torba"))
14
- end
15
-
16
- def before_setup
17
- @torba_tmp_dir = File.realpath(Dir.mktmpdir("torba"))
18
- super
19
- end
20
-
21
- def after_teardown
22
- FileUtils.rm_rf(torba_tmp_dir)
23
- super
24
- end
25
-
26
- Minitest.after_run do
27
- FileUtils.rm_rf(persistent)
28
- end
29
- end
30
- end
31
- end
32
-
33
- class Minitest::Test
34
- include Torba::Test::TmpDir
35
- end