torba-rails 1.0.1 → 1.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (94) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +1 -1
  3. data/.ruby-version +1 -0
  4. data/.travis.yml +24 -2
  5. data/CHANGELOG.md +7 -0
  6. data/CONTRIBUTING.md +7 -1
  7. data/README.md +1 -1
  8. data/Rakefile +9 -17
  9. data/lib/torba/rails.rb +7 -3
  10. data/test/3.2/Gemfile +2 -1
  11. data/test/3.2/Torbafile +1 -0
  12. data/test/3.2/app/assets/javascripts/application.js +1 -0
  13. data/test/3.2/app/assets/stylesheets/application.scss +1 -0
  14. data/test/3.2/bin/rails +1 -0
  15. data/test/4.1/Gemfile +2 -1
  16. data/test/4.1/Torbafile +1 -0
  17. data/test/4.1/app/assets/javascripts/application.js +1 -0
  18. data/test/4.1/app/assets/stylesheets/application.scss +1 -0
  19. data/test/4.2/Gemfile +2 -1
  20. data/test/4.2/Torbafile +1 -0
  21. data/test/4.2/app/assets/javascripts/application.js +1 -0
  22. data/test/4.2/app/assets/stylesheets/application.scss +1 -0
  23. data/test/5.0/Gemfile +2 -1
  24. data/test/5.0/Torbafile +1 -0
  25. data/test/5.0/app/assets/javascripts/application.js +1 -0
  26. data/test/5.0/app/assets/stylesheets/application.scss +1 -0
  27. data/test/5.1/.gitignore +14 -0
  28. data/test/5.1/Gemfile +11 -0
  29. data/test/5.1/Rakefile +6 -0
  30. data/test/5.1/Torbafile +1 -0
  31. data/test/5.1/app/assets/config/manifest.js +3 -0
  32. data/test/5.1/app/assets/javascripts/application.js +1 -0
  33. data/test/5.1/app/assets/stylesheets/application.scss +1 -0
  34. data/test/5.1/app/controllers/application_controller.rb +3 -0
  35. data/test/5.1/app/helpers/application_helper.rb +2 -0
  36. data/test/5.1/app/views/layouts/application.html.erb +14 -0
  37. data/test/5.1/bin/rails +4 -0
  38. data/test/5.1/config.ru +5 -0
  39. data/test/5.1/config/application.rb +23 -0
  40. data/test/5.1/config/boot.rb +3 -0
  41. data/test/5.1/config/environment.rb +5 -0
  42. data/test/5.1/config/environments/development.rb +46 -0
  43. data/test/5.1/config/environments/production.rb +79 -0
  44. data/test/5.1/config/environments/test.rb +36 -0
  45. data/test/5.1/config/initializers/application_controller_renderer.rb +8 -0
  46. data/test/5.1/config/initializers/assets.rb +12 -0
  47. data/test/5.1/config/initializers/backtrace_silencers.rb +7 -0
  48. data/test/5.1/config/initializers/cookies_serializer.rb +5 -0
  49. data/test/5.1/config/initializers/filter_parameter_logging.rb +4 -0
  50. data/test/5.1/config/initializers/inflections.rb +16 -0
  51. data/test/5.1/config/initializers/mime_types.rb +4 -0
  52. data/test/5.1/config/initializers/wrap_parameters.rb +9 -0
  53. data/test/5.1/config/locales/en.yml +33 -0
  54. data/test/5.1/config/routes.rb +3 -0
  55. data/test/5.1/config/secrets.yml +32 -0
  56. data/test/acceptance_test.rb +6 -1
  57. data/test/compiled_assets/3.2/{application-406b208e73b83fe37135274c5157c8e3.css → application-%2A.css} +0 -0
  58. data/test/compiled_assets/3.2/application-%2A.js +1 -0
  59. data/test/compiled_assets/3.2/trumbowyg/{icons-0b2826fbd974348c269c2b8017a14314.png → icons-%3F%3F%5B%5E-%5D%2A.png} +0 -0
  60. data/test/compiled_assets/3.2/trumbowyg/{icons-2x-cc69d8bc62651602e75c2f7097cf5187.png → icons-2x-%2A.png} +0 -0
  61. data/test/compiled_assets/4.1/{application-b93806e6555eb26989308c4d06311423.css → application-%2A.css} +0 -0
  62. data/test/compiled_assets/4.1/application-%2A.js +1 -0
  63. data/test/compiled_assets/4.1/trumbowyg/{icons-60fe5a8fdf8b247fe07ca2454df66f80.png → icons-%3F%3F%5B%5E-%5D%2A.png} +0 -0
  64. data/test/compiled_assets/4.1/trumbowyg/{icons-2x-0977e4f2195ed320a8dcc57e194af523.png → icons-2x-%2A.png} +0 -0
  65. data/test/compiled_assets/4.2+/{application-7cdb22c682ee9bf44774492034be6952becd2c75184c101017152af1476b12a8.css → application-%2A.css} +0 -0
  66. data/test/compiled_assets/4.2+/application-%2A.js +1 -0
  67. data/test/compiled_assets/4.2+/trumbowyg/{icons-efc940454e4e764063875def5c909a2f9c8b2c4d2a41c6a98dc41fb111868f1f.png → icons-%3F%3F%5B%5E-%5D%2A.png} +0 -0
  68. data/test/compiled_assets/4.2+/trumbowyg/{icons-2x-39fe92cd396082eb94f0c92103537209ba97ffa3079377bbe55fea857abe5341.png → icons-2x-%2A.png} +0 -0
  69. data/test/environment.rb +6 -0
  70. data/test/rake_injector/lib/rake_injector.rb +6 -0
  71. data/test/rake_injector/rake_injector.gemspec +13 -0
  72. data/test/test_helper.rb +1 -0
  73. data/torba-rails.gemspec +2 -2
  74. metadata +94 -38
  75. data/test/3.2/Gemfile.lock +0 -116
  76. data/test/3.2/Torbafile +0 -8
  77. data/test/3.2/app/assets/javascripts/application.js +0 -2
  78. data/test/3.2/app/assets/stylesheets/application.scss +0 -6
  79. data/test/3.2/bin/rails +0 -6
  80. data/test/4.1/Gemfile.lock +0 -113
  81. data/test/4.1/Torbafile +0 -8
  82. data/test/4.1/app/assets/javascripts/application.js +0 -2
  83. data/test/4.1/app/assets/stylesheets/application.scss +0 -6
  84. data/test/4.2/Gemfile.lock +0 -128
  85. data/test/4.2/Torbafile +0 -8
  86. data/test/4.2/app/assets/javascripts/application.js +0 -2
  87. data/test/4.2/app/assets/stylesheets/application.scss +0 -6
  88. data/test/5.0/Gemfile.lock +0 -138
  89. data/test/5.0/Torbafile +0 -8
  90. data/test/5.0/app/assets/javascripts/application.js +0 -2
  91. data/test/5.0/app/assets/stylesheets/application.scss +0 -6
  92. data/test/compiled_assets/3.2/application-32cc93d3c658f24842cdb4028d7f6a6a.js +0 -1
  93. data/test/compiled_assets/4.1/application-959396ba4d98dd11cf6ac10b43f7fa97.js +0 -1
  94. data/test/compiled_assets/4.2+/application-c7e50f0b91ececdd620e1c86789b65677d9bbe0f35ab4717a9a522e6c89a56f9.js +0 -1
@@ -0,0 +1,36 @@
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=#{1.hour.seconds.to_i}"
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
@@ -0,0 +1,8 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # ActiveSupport::Reloader.to_prepare do
4
+ # ApplicationController.renderer.defaults.merge!(
5
+ # http_host: 'example.org',
6
+ # https: false
7
+ # )
8
+ # end
@@ -0,0 +1,12 @@
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 the app/assets
11
+ # folder are already added.
12
+ # Rails.application.config.assets.precompile += %w( admin.js admin.css )
@@ -0,0 +1,7 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces.
4
+ # Rails.backtrace_cleaner.add_silencer { |line| line =~ /my_noisy_library/ }
5
+
6
+ # You can also remove all the silencers if you're trying to debug a problem that might stem from framework code.
7
+ # Rails.backtrace_cleaner.remove_silencers!
@@ -0,0 +1,5 @@
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
@@ -0,0 +1,4 @@
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]
@@ -0,0 +1,16 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # Add new inflection rules using the following format. Inflections
4
+ # are locale specific, and you may define rules for as many different
5
+ # locales as you wish. All of these examples are active by default:
6
+ # ActiveSupport::Inflector.inflections(:en) do |inflect|
7
+ # inflect.plural /^(ox)$/i, '\1en'
8
+ # inflect.singular /^(ox)en/i, '\1'
9
+ # inflect.irregular 'person', 'people'
10
+ # inflect.uncountable %w( fish sheep )
11
+ # end
12
+
13
+ # These inflection rules are supported but not enabled by default:
14
+ # ActiveSupport::Inflector.inflections(:en) do |inflect|
15
+ # inflect.acronym 'RESTful'
16
+ # end
@@ -0,0 +1,4 @@
1
+ # Be sure to restart your server when you modify this file.
2
+
3
+ # Add new mime types for use in respond_to blocks:
4
+ # Mime::Type.register "text/richtext", :rtf
@@ -0,0 +1,9 @@
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
@@ -0,0 +1,33 @@
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
+ # The following keys must be escaped otherwise they will not be retrieved by
20
+ # the default I18n backend:
21
+ #
22
+ # true, false, on, off, yes, no
23
+ #
24
+ # Instead, surround them with single quotes.
25
+ #
26
+ # en:
27
+ # 'true': 'foo'
28
+ #
29
+ # To learn more, please read the Rails Internationalization guide
30
+ # available at http://guides.rubyonrails.org/i18n.html.
31
+
32
+ en:
33
+ hello: "Hello world"
@@ -0,0 +1,3 @@
1
+ Rails.application.routes.draw do
2
+ # For details on the DSL available within this file, see http://guides.rubyonrails.org/routing.html
3
+ end
@@ -0,0 +1,32 @@
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 `rails 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
+ # Shared secrets are available across all environments.
14
+
15
+ # shared:
16
+ # api_key: a1B2c3D4e5F6
17
+
18
+ # Environmental secrets are only available for that specific environment.
19
+
20
+ development:
21
+ secret_key_base: d73cf7066b5f3f45b4a40d9c59bfa3d13d59328a3c4ee17b29f3d523658f008cc653b8fb07a0c0740d4a18aa43941545dc3b77d0e17741e2a4a4d8605d78c483
22
+
23
+ test:
24
+ secret_key_base: ee34bc4f4bce68010398ddbbad8156bcb5d184b6ad08f7afceab861d51b262eec80f15aea71657587f2dc1059be0a7359f5318800c63ab24c85c6dea47aa2686
25
+
26
+ # Do not keep production secrets in the unencrypted secrets file.
27
+ # Instead, either read values from the environment.
28
+ # Or, use `bin/rails secrets:setup` to configure encrypted secrets
29
+ # and move the `production:` environment over there.
30
+
31
+ production:
32
+ secret_key_base: <%= ENV["SECRET_KEY_BASE"] %>
@@ -44,8 +44,13 @@ module Torba
44
44
  assert_dir_included "test/compiled_assets/#{assets_version}", "test/#{rails_version}/public/assets"
45
45
  end
46
46
 
47
+ def test_assets_precompile_with_serve_static_files_turned_on
48
+ out, err, status = run_project_cmd(%{bundle exec rake assets:precompile}, "RAILS_ENV" => "production", "RAILS_SERVE_STATIC_FILES" => "true")
49
+ assert status.success?, err
50
+ end
51
+
47
52
  def rails_version
48
- ENV["RAILS_VERSION"] || "4.2"
53
+ Torba::Test::RAILS_VERSION
49
54
  end
50
55
 
51
56
  def in_project_dir(&blk)
@@ -0,0 +1 @@
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(e){}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;if(e.height=e.$e.css("height"),e.isEnabled())return void e.buildEditor(!0);e.buildEditor(),e.buildBtnPane(),e.fixedBtnPaneEvents(),e.buildOverlay()},buildEditor:function(e){var t=this,o=t.o.prefix,i="";if(!0!==e)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(!1!==t.o.btns){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(e){}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(e){}})});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){if(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"))return!1;t.execCmd(!!r&&"dropdown"||i.func||e,i.param||e),a.stopPropagation(),a.preventDefault()}});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(o){"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!0===this.o.tablet&&e.test(n)||!0===this.o.mobile&&t.test(n)}}}(window,document,jQuery);
@@ -0,0 +1 @@
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(e){}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;if(e.height=e.$e.css("height"),e.isEnabled())return void e.buildEditor(!0);e.buildEditor(),e.buildBtnPane(),e.fixedBtnPaneEvents(),e.buildOverlay()},buildEditor:function(e){var t=this,o=t.o.prefix,i="";if(!0!==e)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(!1!==t.o.btns){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(e){}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(e){}})});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){if(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"))return!1;t.execCmd(!!r&&"dropdown"||i.func||e,i.param||e),a.stopPropagation(),a.preventDefault()}});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(o){"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!0===this.o.tablet&&e.test(n)||!0===this.o.mobile&&t.test(n)}}}(window,document,jQuery);
@@ -0,0 +1 @@
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(e){}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;if(e.height=e.$e.css("height"),e.isEnabled())return void e.buildEditor(!0);e.buildEditor(),e.buildBtnPane(),e.fixedBtnPaneEvents(),e.buildOverlay()},buildEditor:function(e){var t=this,o=t.o.prefix,i="";if(!0!==e)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(!1!==t.o.btns){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(e){}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(e){}})});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){if(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"))return!1;t.execCmd(!!r&&"dropdown"||i.func||e,i.param||e),a.stopPropagation(),a.preventDefault()}});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(o){"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!0===this.o.tablet&&e.test(n)||!0===this.o.mobile&&t.test(n)}}}(window,document,jQuery);
@@ -0,0 +1,6 @@
1
+ module Torba
2
+ module Test
3
+ SUPPORTED_RAILS_VERSIONS = %w[3.2 4.1 4.2 5.0 5.1]
4
+ RAILS_VERSION = ENV["RAILS_VERSION"] || SUPPORTED_RAILS_VERSIONS.last
5
+ end
6
+ end
@@ -0,0 +1,6 @@
1
+ # Here's Rake namespace is introduced, however, `Rake.application` is not
2
+ # accessible, since `rake` command was not run.
3
+ module Rake
4
+ module WeDontCareAboutThatModule
5
+ end
6
+ end
@@ -0,0 +1,13 @@
1
+ Gem::Specification.new do |spec|
2
+ spec.name = "rake_injector"
3
+ spec.version = "0.0.1"
4
+ spec.authors = ["Andrii Malyshko"]
5
+ spec.email = ["mail@nashbridges.me"]
6
+ spec.description = "Test gem that modifies Rake namespace thus introducing it"
7
+ spec.summary = spec.description
8
+ spec.homepage = "https://github.com/torba-rb/torba-rails"
9
+ spec.license = "MIT"
10
+
11
+ spec.files = `git ls-files`.split($/)
12
+ spec.require_paths = ["lib"]
13
+ end
@@ -1,3 +1,4 @@
1
+ require_relative "environment"
1
2
  require "bundler/setup"
2
3
  require "minitest/autorun"
3
4
  require "minitest/assert_dirs_equal"
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |spec|
2
2
  spec.name = "torba-rails"
3
- spec.version = "1.0.1"
3
+ spec.version = "1.0.2"
4
4
  spec.authors = ["Andrii Malyshko"]
5
5
  spec.email = ["mail@nashbridges.me"]
6
6
  spec.description = "Torba + Rails integration"
@@ -19,5 +19,5 @@ Gem::Specification.new do |spec|
19
19
  spec.add_development_dependency "bundler", "~> 1.6"
20
20
  spec.add_development_dependency "rake", "~> 10.0"
21
21
  spec.add_development_dependency "minitest", "~> 5.4"
22
- spec.add_development_dependency "assert_dirs_equal", "~> 0.2"
22
+ spec.add_development_dependency "assert_dirs_equal", "~> 0.3"
23
23
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: torba-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrii Malyshko
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-04-13 00:00:00.000000000 Z
11
+ date: 2017-10-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: torba
@@ -86,14 +86,14 @@ dependencies:
86
86
  requirements:
87
87
  - - "~>"
88
88
  - !ruby/object:Gem::Version
89
- version: '0.2'
89
+ version: '0.3'
90
90
  type: :development
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
94
  - - "~>"
95
95
  - !ruby/object:Gem::Version
96
- version: '0.2'
96
+ version: '0.3'
97
97
  description: Torba + Rails integration
98
98
  email:
99
99
  - mail@nashbridges.me
@@ -102,6 +102,7 @@ extensions: []
102
102
  extra_rdoc_files: []
103
103
  files:
104
104
  - ".gitignore"
105
+ - ".ruby-version"
105
106
  - ".travis.yml"
106
107
  - ".yardopts"
107
108
  - CHANGELOG.md
@@ -113,7 +114,6 @@ files:
113
114
  - lib/torba-rails.rb
114
115
  - lib/torba/rails.rb
115
116
  - test/3.2/Gemfile
116
- - test/3.2/Gemfile.lock
117
117
  - test/3.2/Rakefile
118
118
  - test/3.2/Torbafile
119
119
  - test/3.2/app/assets/javascripts/application.js
@@ -136,7 +136,6 @@ files:
136
136
  - test/3.2/config/routes.rb
137
137
  - test/3.2/script/rails
138
138
  - test/4.1/Gemfile
139
- - test/4.1/Gemfile.lock
140
139
  - test/4.1/Rakefile
141
140
  - test/4.1/Torbafile
142
141
  - test/4.1/app/assets/javascripts/application.js
@@ -163,7 +162,6 @@ files:
163
162
  - test/4.1/config/routes.rb
164
163
  - test/4.1/config/secrets.yml
165
164
  - test/4.2/Gemfile
166
- - test/4.2/Gemfile.lock
167
165
  - test/4.2/Rakefile
168
166
  - test/4.2/Torbafile
169
167
  - test/4.2/app/assets/javascripts/application.js
@@ -188,7 +186,6 @@ files:
188
186
  - test/4.2/config/routes.rb
189
187
  - test/4.2/config/secrets.yml
190
188
  - test/5.0/Gemfile
191
- - test/5.0/Gemfile.lock
192
189
  - test/5.0/Rakefile
193
190
  - test/5.0/Torbafile
194
191
  - test/5.0/app/assets/javascripts/application.js
@@ -217,22 +214,54 @@ files:
217
214
  - test/5.0/config/routes.rb
218
215
  - test/5.0/config/secrets.yml
219
216
  - test/5.0/db/seeds.rb
217
+ - test/5.1/.gitignore
218
+ - test/5.1/Gemfile
219
+ - test/5.1/Rakefile
220
+ - test/5.1/Torbafile
221
+ - test/5.1/app/assets/config/manifest.js
222
+ - test/5.1/app/assets/javascripts/application.js
223
+ - test/5.1/app/assets/stylesheets/application.scss
224
+ - test/5.1/app/controllers/application_controller.rb
225
+ - test/5.1/app/helpers/application_helper.rb
226
+ - test/5.1/app/views/layouts/application.html.erb
227
+ - test/5.1/bin/rails
228
+ - test/5.1/config.ru
229
+ - test/5.1/config/application.rb
230
+ - test/5.1/config/boot.rb
231
+ - test/5.1/config/environment.rb
232
+ - test/5.1/config/environments/development.rb
233
+ - test/5.1/config/environments/production.rb
234
+ - test/5.1/config/environments/test.rb
235
+ - test/5.1/config/initializers/application_controller_renderer.rb
236
+ - test/5.1/config/initializers/assets.rb
237
+ - test/5.1/config/initializers/backtrace_silencers.rb
238
+ - test/5.1/config/initializers/cookies_serializer.rb
239
+ - test/5.1/config/initializers/filter_parameter_logging.rb
240
+ - test/5.1/config/initializers/inflections.rb
241
+ - test/5.1/config/initializers/mime_types.rb
242
+ - test/5.1/config/initializers/wrap_parameters.rb
243
+ - test/5.1/config/locales/en.yml
244
+ - test/5.1/config/routes.rb
245
+ - test/5.1/config/secrets.yml
220
246
  - test/Torbafile
221
247
  - test/acceptance_test.rb
222
248
  - test/application.js
223
249
  - test/application.scss
224
- - test/compiled_assets/3.2/application-32cc93d3c658f24842cdb4028d7f6a6a.js
225
- - test/compiled_assets/3.2/application-406b208e73b83fe37135274c5157c8e3.css
226
- - test/compiled_assets/3.2/trumbowyg/icons-0b2826fbd974348c269c2b8017a14314.png
227
- - test/compiled_assets/3.2/trumbowyg/icons-2x-cc69d8bc62651602e75c2f7097cf5187.png
228
- - test/compiled_assets/4.1/application-959396ba4d98dd11cf6ac10b43f7fa97.js
229
- - test/compiled_assets/4.1/application-b93806e6555eb26989308c4d06311423.css
230
- - test/compiled_assets/4.1/trumbowyg/icons-2x-0977e4f2195ed320a8dcc57e194af523.png
231
- - test/compiled_assets/4.1/trumbowyg/icons-60fe5a8fdf8b247fe07ca2454df66f80.png
232
- - test/compiled_assets/4.2+/application-7cdb22c682ee9bf44774492034be6952becd2c75184c101017152af1476b12a8.css
233
- - test/compiled_assets/4.2+/application-c7e50f0b91ececdd620e1c86789b65677d9bbe0f35ab4717a9a522e6c89a56f9.js
234
- - test/compiled_assets/4.2+/trumbowyg/icons-2x-39fe92cd396082eb94f0c92103537209ba97ffa3079377bbe55fea857abe5341.png
235
- - test/compiled_assets/4.2+/trumbowyg/icons-efc940454e4e764063875def5c909a2f9c8b2c4d2a41c6a98dc41fb111868f1f.png
250
+ - test/compiled_assets/3.2/application-%2A.css
251
+ - test/compiled_assets/3.2/application-%2A.js
252
+ - test/compiled_assets/3.2/trumbowyg/icons-%3F%3F%5B%5E-%5D%2A.png
253
+ - test/compiled_assets/3.2/trumbowyg/icons-2x-%2A.png
254
+ - test/compiled_assets/4.1/application-%2A.css
255
+ - test/compiled_assets/4.1/application-%2A.js
256
+ - test/compiled_assets/4.1/trumbowyg/icons-%3F%3F%5B%5E-%5D%2A.png
257
+ - test/compiled_assets/4.1/trumbowyg/icons-2x-%2A.png
258
+ - test/compiled_assets/4.2+/application-%2A.css
259
+ - test/compiled_assets/4.2+/application-%2A.js
260
+ - test/compiled_assets/4.2+/trumbowyg/icons-%3F%3F%5B%5E-%5D%2A.png
261
+ - test/compiled_assets/4.2+/trumbowyg/icons-2x-%2A.png
262
+ - test/environment.rb
263
+ - test/rake_injector/lib/rake_injector.rb
264
+ - test/rake_injector/rake_injector.gemspec
236
265
  - test/test_helper.rb
237
266
  - torba-rails.gemspec
238
267
  homepage: https://github.com/torba-rb/torba-rails
@@ -255,13 +284,12 @@ required_rubygems_version: !ruby/object:Gem::Requirement
255
284
  version: '0'
256
285
  requirements: []
257
286
  rubyforge_project:
258
- rubygems_version: 2.4.5.1
287
+ rubygems_version: 2.6.14
259
288
  signing_key:
260
289
  specification_version: 4
261
290
  summary: Torba + Rails integration
262
291
  test_files:
263
292
  - test/3.2/Gemfile
264
- - test/3.2/Gemfile.lock
265
293
  - test/3.2/Rakefile
266
294
  - test/3.2/Torbafile
267
295
  - test/3.2/app/assets/javascripts/application.js
@@ -284,7 +312,6 @@ test_files:
284
312
  - test/3.2/config/routes.rb
285
313
  - test/3.2/script/rails
286
314
  - test/4.1/Gemfile
287
- - test/4.1/Gemfile.lock
288
315
  - test/4.1/Rakefile
289
316
  - test/4.1/Torbafile
290
317
  - test/4.1/app/assets/javascripts/application.js
@@ -311,7 +338,6 @@ test_files:
311
338
  - test/4.1/config/routes.rb
312
339
  - test/4.1/config/secrets.yml
313
340
  - test/4.2/Gemfile
314
- - test/4.2/Gemfile.lock
315
341
  - test/4.2/Rakefile
316
342
  - test/4.2/Torbafile
317
343
  - test/4.2/app/assets/javascripts/application.js
@@ -336,7 +362,6 @@ test_files:
336
362
  - test/4.2/config/routes.rb
337
363
  - test/4.2/config/secrets.yml
338
364
  - test/5.0/Gemfile
339
- - test/5.0/Gemfile.lock
340
365
  - test/5.0/Rakefile
341
366
  - test/5.0/Torbafile
342
367
  - test/5.0/app/assets/javascripts/application.js
@@ -365,21 +390,52 @@ test_files:
365
390
  - test/5.0/config/routes.rb
366
391
  - test/5.0/config/secrets.yml
367
392
  - test/5.0/db/seeds.rb
393
+ - test/5.1/.gitignore
394
+ - test/5.1/Gemfile
395
+ - test/5.1/Rakefile
396
+ - test/5.1/Torbafile
397
+ - test/5.1/app/assets/config/manifest.js
398
+ - test/5.1/app/assets/javascripts/application.js
399
+ - test/5.1/app/assets/stylesheets/application.scss
400
+ - test/5.1/app/controllers/application_controller.rb
401
+ - test/5.1/app/helpers/application_helper.rb
402
+ - test/5.1/app/views/layouts/application.html.erb
403
+ - test/5.1/bin/rails
404
+ - test/5.1/config.ru
405
+ - test/5.1/config/application.rb
406
+ - test/5.1/config/boot.rb
407
+ - test/5.1/config/environment.rb
408
+ - test/5.1/config/environments/development.rb
409
+ - test/5.1/config/environments/production.rb
410
+ - test/5.1/config/environments/test.rb
411
+ - test/5.1/config/initializers/application_controller_renderer.rb
412
+ - test/5.1/config/initializers/assets.rb
413
+ - test/5.1/config/initializers/backtrace_silencers.rb
414
+ - test/5.1/config/initializers/cookies_serializer.rb
415
+ - test/5.1/config/initializers/filter_parameter_logging.rb
416
+ - test/5.1/config/initializers/inflections.rb
417
+ - test/5.1/config/initializers/mime_types.rb
418
+ - test/5.1/config/initializers/wrap_parameters.rb
419
+ - test/5.1/config/locales/en.yml
420
+ - test/5.1/config/routes.rb
421
+ - test/5.1/config/secrets.yml
368
422
  - test/Torbafile
369
423
  - test/acceptance_test.rb
370
424
  - test/application.js
371
425
  - test/application.scss
372
- - test/compiled_assets/3.2/application-32cc93d3c658f24842cdb4028d7f6a6a.js
373
- - test/compiled_assets/3.2/application-406b208e73b83fe37135274c5157c8e3.css
374
- - test/compiled_assets/3.2/trumbowyg/icons-0b2826fbd974348c269c2b8017a14314.png
375
- - test/compiled_assets/3.2/trumbowyg/icons-2x-cc69d8bc62651602e75c2f7097cf5187.png
376
- - test/compiled_assets/4.1/application-959396ba4d98dd11cf6ac10b43f7fa97.js
377
- - test/compiled_assets/4.1/application-b93806e6555eb26989308c4d06311423.css
378
- - test/compiled_assets/4.1/trumbowyg/icons-2x-0977e4f2195ed320a8dcc57e194af523.png
379
- - test/compiled_assets/4.1/trumbowyg/icons-60fe5a8fdf8b247fe07ca2454df66f80.png
380
- - test/compiled_assets/4.2+/application-7cdb22c682ee9bf44774492034be6952becd2c75184c101017152af1476b12a8.css
381
- - test/compiled_assets/4.2+/application-c7e50f0b91ececdd620e1c86789b65677d9bbe0f35ab4717a9a522e6c89a56f9.js
382
- - test/compiled_assets/4.2+/trumbowyg/icons-2x-39fe92cd396082eb94f0c92103537209ba97ffa3079377bbe55fea857abe5341.png
383
- - test/compiled_assets/4.2+/trumbowyg/icons-efc940454e4e764063875def5c909a2f9c8b2c4d2a41c6a98dc41fb111868f1f.png
426
+ - test/compiled_assets/3.2/application-%2A.css
427
+ - test/compiled_assets/3.2/application-%2A.js
428
+ - test/compiled_assets/3.2/trumbowyg/icons-%3F%3F%5B%5E-%5D%2A.png
429
+ - test/compiled_assets/3.2/trumbowyg/icons-2x-%2A.png
430
+ - test/compiled_assets/4.1/application-%2A.css
431
+ - test/compiled_assets/4.1/application-%2A.js
432
+ - test/compiled_assets/4.1/trumbowyg/icons-%3F%3F%5B%5E-%5D%2A.png
433
+ - test/compiled_assets/4.1/trumbowyg/icons-2x-%2A.png
434
+ - test/compiled_assets/4.2+/application-%2A.css
435
+ - test/compiled_assets/4.2+/application-%2A.js
436
+ - test/compiled_assets/4.2+/trumbowyg/icons-%3F%3F%5B%5E-%5D%2A.png
437
+ - test/compiled_assets/4.2+/trumbowyg/icons-2x-%2A.png
438
+ - test/environment.rb
439
+ - test/rake_injector/lib/rake_injector.rb
440
+ - test/rake_injector/rake_injector.gemspec
384
441
  - test/test_helper.rb
385
- has_rdoc: