locomotivecms 3.0.0.pre.beta.1 → 3.0.0.rc1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (175) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile +4 -3
  3. data/app/api/locomotive/api.rb +1 -0
  4. data/app/api/locomotive/api/entities/page_entity.rb +1 -1
  5. data/app/api/locomotive/api/entities/site_entity.rb +9 -1
  6. data/app/api/locomotive/api/exception_rescuers.rb +3 -5
  7. data/app/api/locomotive/api/forms/page_form.rb +1 -1
  8. data/app/api/locomotive/api/forms/site_form.rb +1 -2
  9. data/app/api/locomotive/api/helpers/authentication_helper.rb +6 -1
  10. data/app/api/locomotive/api/helpers/locales_helper.rb +15 -0
  11. data/app/api/locomotive/api/helpers/params_helper.rb +13 -0
  12. data/app/api/locomotive/api/middlewares/locale_middleware.rb +6 -1
  13. data/app/api/locomotive/api/resources/content_entry_resource.rb +2 -0
  14. data/app/api/locomotive/api/resources/content_type_resource.rb +2 -2
  15. data/app/api/locomotive/api/resources/current_site_resource.rb +2 -1
  16. data/app/api/locomotive/api/resources/membership_resource.rb +0 -4
  17. data/app/api/locomotive/api/resources/page_resource.rb +6 -1
  18. data/app/api/locomotive/api/resources/site_resource.rb +4 -2
  19. data/app/assets/javascripts/locomotive.js +1 -0
  20. data/app/assets/javascripts/locomotive/utils/nprogress.js.coffee +3 -1
  21. data/app/assets/javascripts/locomotive/views/editable_elements/index_view.js.coffee +10 -3
  22. data/app/assets/javascripts/locomotive/views/inputs/markdown_view.js.coffee +82 -0
  23. data/app/assets/javascripts/locomotive/views/inputs/rte/file_view.js.coffee +1 -1
  24. data/app/assets/javascripts/locomotive/views/inputs/rte/link_view.js.coffee +1 -1
  25. data/app/assets/javascripts/locomotive/views/inputs/rte_view.js.coffee.erb +1 -1
  26. data/app/assets/javascripts/locomotive/views/inputs/text_view.js.coffee +4 -1
  27. data/app/assets/javascripts/locomotive/views/pages/list_view.js.coffee +3 -0
  28. data/app/assets/javascripts/locomotive/views/shared/form_view.js.coffee +22 -1
  29. data/app/assets/javascripts/locomotive/views/shared/header_view.js.coffee +2 -2
  30. data/app/assets/stylesheets/locomotive/application.scss +2 -0
  31. data/app/assets/stylesheets/locomotive/base/_form.scss +2 -0
  32. data/app/assets/stylesheets/locomotive/base/form/_api_key.scss +0 -1
  33. data/app/assets/stylesheets/locomotive/base/form/_array_input.scss +2 -0
  34. data/app/assets/stylesheets/locomotive/base/form/_base.scss +13 -2
  35. data/app/assets/stylesheets/locomotive/base/form/_color_input.scss +12 -0
  36. data/app/assets/stylesheets/locomotive/base/form/_markdown.scss +292 -0
  37. data/app/assets/stylesheets/locomotive/base/form/_popover.scss +22 -0
  38. data/app/assets/stylesheets/locomotive/base/form/_rte.scss +2 -1
  39. data/app/assets/stylesheets/locomotive/components/_activity_feed.scss +1 -0
  40. data/app/assets/stylesheets/locomotive/components/_dashboard.scss +29 -0
  41. data/app/assets/stylesheets/locomotive/components/_live_editing.scss +13 -1
  42. data/app/assets/stylesheets/locomotive/components/_main.scss +1 -1
  43. data/app/assets/stylesheets/locomotive/components/_transitions.scss +24 -3
  44. data/app/assets/stylesheets/locomotive/components/sidebar/_base.scss +1 -0
  45. data/app/assets/stylesheets/locomotive/globals/_bootstrap.scss +2 -2
  46. data/app/assets/stylesheets/locomotive/globals/_variables.scss +4 -3
  47. data/app/assets/stylesheets/locomotive/layouts/_live_editing.scss +4 -0
  48. data/app/controllers/locomotive/concerns/locale_helpers_controller.rb +1 -0
  49. data/app/controllers/locomotive/content_entries_controller.rb +10 -2
  50. data/app/controllers/locomotive/pages_controller.rb +2 -1
  51. data/app/controllers/locomotive/passwords_controller.rb +17 -1
  52. data/app/helpers/locomotive/base_helper.rb +19 -0
  53. data/app/helpers/locomotive/content_types_helper.rb +2 -1
  54. data/app/helpers/locomotive/custom_fields_helper.rb +14 -1
  55. data/app/helpers/locomotive/dashboard_helper.rb +12 -0
  56. data/app/helpers/locomotive/editable_elements_helper.rb +9 -4
  57. data/app/helpers/locomotive/pages_helper.rb +1 -14
  58. data/app/helpers/locomotive/shared/pages_helper.rb +17 -0
  59. data/app/helpers/locomotive/translations_helper.rb +0 -14
  60. data/app/inputs/locomotive/color_input.rb +18 -0
  61. data/app/inputs/locomotive/markdown_input.rb +19 -0
  62. data/app/models/locomotive/account.rb +2 -1
  63. data/app/models/locomotive/concerns/content_entry/file_size.rb +27 -0
  64. data/app/models/locomotive/concerns/content_type/group_by.rb +3 -1
  65. data/app/models/locomotive/concerns/page/layout.rb +63 -19
  66. data/app/models/locomotive/concerns/shared/site_scope.rb +37 -0
  67. data/app/models/locomotive/concerns/site/cache.rb +32 -0
  68. data/app/models/locomotive/concerns/theme_asset/plain_text.rb +85 -0
  69. data/app/models/locomotive/content_entry.rb +7 -7
  70. data/app/models/locomotive/content_type.rb +12 -6
  71. data/app/models/locomotive/page.rb +12 -14
  72. data/app/models/locomotive/site.rb +9 -3
  73. data/app/models/locomotive/snippet.rb +6 -4
  74. data/app/models/locomotive/theme_asset.rb +8 -73
  75. data/app/models/locomotive/translation.rb +6 -5
  76. data/app/policies/locomotive/site_policy.rb +2 -2
  77. data/app/services/locomotive/content_entry_service.rb +7 -6
  78. data/app/services/locomotive/site_service.rb +1 -0
  79. data/app/views/locomotive/content_entries/_entry.html.slim +1 -0
  80. data/app/views/locomotive/content_entries/edit.html.slim +1 -1
  81. data/app/views/locomotive/content_entries/new.html.slim +1 -1
  82. data/app/views/locomotive/current_site/_membership.html.slim +1 -0
  83. data/app/views/locomotive/current_site/edit.html.slim +1 -1
  84. data/app/views/locomotive/current_site/form/_access_points.html.slim +1 -1
  85. data/app/views/locomotive/current_site/form/_advanced.html.slim +2 -0
  86. data/app/views/locomotive/dashboard/_activity.html.slim +26 -0
  87. data/app/views/locomotive/dashboard/_url.html.slim +9 -0
  88. data/app/views/locomotive/dashboard/show.html.slim +3 -21
  89. data/app/views/locomotive/devise_mailer/reset_password_instructions.html.slim +1 -1
  90. data/app/views/locomotive/editable_elements/_edit.html.slim +8 -1
  91. data/app/views/locomotive/editable_elements/_form.html.slim +1 -1
  92. data/app/views/locomotive/editable_elements/index_without_preview.html.slim +24 -17
  93. data/app/views/locomotive/layouts/application.html.slim +6 -4
  94. data/app/views/locomotive/layouts/live_editing.html.slim +9 -0
  95. data/app/views/locomotive/layouts/not_logged_in.html.slim +1 -1
  96. data/app/views/locomotive/layouts/without_site.html.slim +2 -0
  97. data/app/views/locomotive/memberships/edit.html.slim +1 -1
  98. data/app/views/locomotive/memberships/new.html.slim +1 -1
  99. data/app/views/locomotive/my_account/edit.html.slim +7 -5
  100. data/app/views/locomotive/pages/_header.html.slim +7 -0
  101. data/app/views/locomotive/pages/edit.html.slim +2 -4
  102. data/app/views/locomotive/pages/form/_main.html.slim +4 -1
  103. data/app/views/locomotive/pages/form/_tabs.html.slim +4 -3
  104. data/app/views/locomotive/public_submission_accounts/_account.html.slim +1 -1
  105. data/app/views/locomotive/public_submission_accounts/edit.html.slim +1 -1
  106. data/app/views/locomotive/shared/_header.html.slim +25 -22
  107. data/app/views/locomotive/shared/_locale_picker_link.html.slim +3 -0
  108. data/app/views/locomotive/shared/_main_app_header.html.slim +1 -1
  109. data/app/views/locomotive/shared/_sidebar.html.slim +15 -11
  110. data/app/views/locomotive/shared/rte/_markdown_toolbar.html.slim +42 -0
  111. data/config/locales/admin_ui.en.yml +9 -4
  112. data/config/locales/default.en.yml +4 -0
  113. data/config/locales/devise.en.yml +1 -0
  114. data/config/locales/simple_form.en.yml +6 -2
  115. data/lib/locomotive/action_controller/responder.rb +5 -0
  116. data/lib/locomotive/engine.rb +5 -0
  117. data/lib/locomotive/middlewares/site.rb +39 -21
  118. data/lib/locomotive/simple_form.rb +3 -31
  119. data/lib/locomotive/steam/middlewares/cache.rb +62 -0
  120. data/lib/locomotive/steam/middlewares/page_editing.rb +9 -3
  121. data/lib/locomotive/steam/services/api_entry_submission_service.rb +6 -3
  122. data/lib/locomotive/steam/services/liquid_parser_with_cache_service.rb +74 -0
  123. data/lib/locomotive/steam_adaptor.rb +7 -1
  124. data/lib/locomotive/version.rb +1 -1
  125. data/lib/tasks/development.rake +4 -0
  126. data/lib/tasks/locomotive.rake +14 -0
  127. data/spec/lib/locomotive/steam/services/api_entry_submission_service_spec.rb +10 -1
  128. data/spec/lib/locomotive/steam/services/liquid_parser_with_cache_service_spec.rb +53 -0
  129. data/spec/models/locomotive/concerns/content_entry/file_size_spec.rb +40 -0
  130. data/spec/models/locomotive/concerns/page/layout_spec.rb +122 -17
  131. data/spec/models/locomotive/concerns/site/cache_spec.rb +60 -0
  132. data/spec/models/locomotive/content_entry_spec.rb +7 -0
  133. data/spec/models/locomotive/content_type_spec.rb +18 -11
  134. data/spec/models/locomotive/page_spec.rb +32 -8
  135. data/spec/models/locomotive/snippet_spec.rb +13 -4
  136. data/spec/models/locomotive/theme_asset_spec.rb +10 -3
  137. data/spec/models/locomotive/translation_spec.rb +28 -0
  138. data/spec/requests/locomotive/steam/cache_spec.rb +83 -0
  139. data/spec/requests/site_spec.rb +24 -0
  140. data/spec/support/capybara.rb +5 -13
  141. data/spec/support/factories.rb +9 -0
  142. data/spec/support/features/session_helpers.rb +19 -3
  143. data/spec/support/features/site_helpers.rb +27 -0
  144. data/spec/support/shared_examples/site_scope_examples.rb +27 -0
  145. data/vendor/assets/images/locomotive/bootstrap-colorpicker/alpha-horizontal.png +0 -0
  146. data/vendor/assets/images/locomotive/bootstrap-colorpicker/alpha.png +0 -0
  147. data/vendor/assets/images/locomotive/bootstrap-colorpicker/hue-horizontal.png +0 -0
  148. data/vendor/assets/images/locomotive/bootstrap-colorpicker/hue.png +0 -0
  149. data/vendor/assets/images/locomotive/bootstrap-colorpicker/saturation.png +0 -0
  150. data/vendor/assets/javascripts/locomotive/bootstrap-colorpicker.js +1 -0
  151. data/vendor/assets/javascripts/locomotive/datepicker_i18n.js.erb +6 -6
  152. data/vendor/assets/javascripts/locomotive/kramed.min.js +11 -0
  153. data/vendor/assets/stylesheets/locomotive/bootstrap-colorpicker.scss +9 -0
  154. metadata +59 -44
  155. data/app/controllers/locomotive/api/accounts_controller.rb +0 -60
  156. data/app/controllers/locomotive/api/base_controller.rb +0 -35
  157. data/app/controllers/locomotive/api/content_assets_controller.rb +0 -51
  158. data/app/controllers/locomotive/api/content_entries_controller.rb +0 -71
  159. data/app/controllers/locomotive/api/content_types_controller.rb +0 -52
  160. data/app/controllers/locomotive/api/current_site_controller.rb +0 -34
  161. data/app/controllers/locomotive/api/memberships_controller.rb +0 -52
  162. data/app/controllers/locomotive/api/my_account_controller.rb +0 -46
  163. data/app/controllers/locomotive/api/pages_controller.rb +0 -53
  164. data/app/controllers/locomotive/api/sites_controller.rb +0 -58
  165. data/app/controllers/locomotive/api/snippets_controller.rb +0 -52
  166. data/app/controllers/locomotive/api/theme_assets_controller.rb +0 -51
  167. data/app/controllers/locomotive/api/tokens_controller.rb +0 -36
  168. data/app/controllers/locomotive/api/translations_controller.rb +0 -51
  169. data/app/controllers/locomotive/api/version_controller.rb +0 -11
  170. data/spec/models/locomotive/editable_control_spec.rb +0 -79
  171. data/spec/models/locomotive/editable_file_spec.rb +0 -94
  172. data/spec/models/locomotive/editable_text_spec.rb +0 -219
  173. data/vendor/assets/images/select2-spinner.gif +0 -0
  174. data/vendor/assets/images/select2.png +0 -0
  175. data/vendor/assets/images/select2x2.png +0 -0
@@ -233,6 +233,15 @@ FactoryGirl.define do
233
233
  end
234
234
  end
235
235
 
236
+ factory 'photo content type' do
237
+ name 'Photos'
238
+ description 'The list of photos'
239
+ after(:build) do |content_type, _|
240
+ content_type.entries_custom_fields.build label: 'Title', name: 'title', type: 'string'
241
+ content_type.entries_custom_fields.build label: 'Photo', name: 'photo', type: 'file'
242
+ end
243
+ end
244
+
236
245
  trait :with_field do
237
246
  after(:build) do |content_type, evaluator|
238
247
  content_type.entries_custom_fields.build label: 'Title', name: 'title', type: 'string'
@@ -11,11 +11,27 @@ module Features
11
11
  end
12
12
 
13
13
  def sign_in
14
- account = create(:account)
14
+ @account = create(:account)
15
15
  visit locomotive.new_locomotive_account_session_path
16
- fill_in 'Email', with: account.email
17
- fill_in 'Password', with: account.password
16
+ fill_in 'Email', with: @account.email
17
+ fill_in 'Password', with: @account.password
18
18
  click_button 'Sign in'
19
19
  end
20
+
21
+ def forgot_password(js = false, &block)
22
+ sign_up_with 'John Doe', 'john@doe.net', 'password'
23
+ click_link 'Welcome, John Doe' if js
24
+ within('.header') { click_link 'Log out' }
25
+ click_link 'I forgot my password'
26
+ fill_in 'Your email', with: 'john@doe.net'
27
+ click_button 'Forgot password'
28
+
29
+ if block_given?
30
+ last_email = ActionMailer::Base.deliveries.last
31
+ last_email.body.to_s =~ /<a href="http:\/\/localhost:9886(\S+)">/
32
+ yield last_email, $1
33
+ end
34
+ end
35
+
20
36
  end
21
37
  end
@@ -0,0 +1,27 @@
1
+ module Features
2
+ module SiteHelpers
3
+
4
+ def create_full_site
5
+ # 1. create site
6
+ sign_in
7
+ click_link 'Add a new site'
8
+ fill_in 'Name', with: 'Acme'
9
+ click_button 'Create'
10
+ @site = Locomotive::Site.where(name: 'Acme').first
11
+
12
+ # 2. add content types
13
+ create('message content type', site: @site, public_submission_enabled: true)
14
+ articles = create('article content type', slug: 'articles', site: @site)
15
+ photos = create('photo content type', slug: 'photos', site: @site)
16
+
17
+ # create relationships
18
+ photos.entries_custom_fields.build(label: 'Article', name: 'article', type: 'belongs_to', class_name: articles.entries_class_name)
19
+ photos.save!
20
+ articles.entries_custom_fields.build(label: 'Photos', name: 'photos', type: 'has_many', class_name: photos.entries_class_name, inverse_of: 'article')
21
+ articles.save!
22
+
23
+ click_link 'Dashboard'
24
+ end
25
+
26
+ end
27
+ end
@@ -0,0 +1,27 @@
1
+ RSpec.shared_examples_for 'model scoped by a site' do
2
+
3
+ let!(:site) { model.site }
4
+
5
+ it { expect(model).to respond_to(:site) }
6
+
7
+ describe 'touch' do
8
+
9
+ let(:date) { Time.zone.local(2015, 4, 1, 12, 0, 0) }
10
+
11
+ subject { model.save! }
12
+
13
+ it 'updates the updated_at attribute of the site' do
14
+ Timecop.freeze(date) do
15
+ expect { subject }.to change { site.updated_at }.to date
16
+ end
17
+ end
18
+
19
+ it 'updates the template_version or content_version attribute of the site' do
20
+ Timecop.freeze(date) do
21
+ expect { subject }.to change { site.send(attribute) }.to date
22
+ end
23
+ end
24
+
25
+ end
26
+
27
+ end
@@ -0,0 +1 @@
1
+ !function(a){"use strict";"object"==typeof exports?module.exports=a(window.jQuery):"function"==typeof define&&define.amd?define(["jquery"],a):window.jQuery&&!window.jQuery.fn.colorpicker&&a(window.jQuery)}(function(a){"use strict";var b=function(b,c){this.value={h:0,s:0,b:0,a:1},this.origFormat=null,c&&a.extend(this.colors,c),b&&(void 0!==b.toLowerCase?(b+="",this.setColor(b)):void 0!==b.h&&(this.value=b))};b.prototype={constructor:b,colors:{aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgrey:"#d3d3d3",lightgreen:"#90ee90",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370d8",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#d87093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32",transparent:"transparent"},_sanitizeNumber:function(a){return"number"==typeof a?a:isNaN(a)||null===a||""===a||void 0===a?1:void 0!==a.toLowerCase?parseFloat(a):1},isTransparent:function(a){return a?(a=a.toLowerCase().trim(),"transparent"===a||a.match(/#?00000000/)||a.match(/(rgba|hsla)\(0,0,0,0?\.?0\)/)):!1},rgbaIsTransparent:function(a){return 0===a.r&&0===a.g&&0===a.b&&0===a.a},setColor:function(a){a=a.toLowerCase().trim(),a&&(this.isTransparent(a)?this.value={h:0,s:0,b:0,a:0}:this.value=this.stringToHSB(a)||{h:0,s:0,b:0,a:1})},stringToHSB:function(b){b=b.toLowerCase();var c;"undefined"!=typeof this.colors[b]&&(b=this.colors[b],c="alias");var d=this,e=!1;return a.each(this.stringParsers,function(a,f){var g=f.re.exec(b),h=g&&f.parse.apply(d,[g]),i=c||f.format||"rgba";return h?(e=i.match(/hsla?/)?d.RGBtoHSB.apply(d,d.HSLtoRGB.apply(d,h)):d.RGBtoHSB.apply(d,h),d.origFormat=i,!1):!0}),e},setHue:function(a){this.value.h=1-a},setSaturation:function(a){this.value.s=a},setBrightness:function(a){this.value.b=1-a},setAlpha:function(a){this.value.a=parseInt(100*(1-a),10)/100},toRGB:function(a,b,c,d){a||(a=this.value.h,b=this.value.s,c=this.value.b),a*=360;var e,f,g,h,i;return a=a%360/60,i=c*b,h=i*(1-Math.abs(a%2-1)),e=f=g=c-i,a=~~a,e+=[i,h,0,0,h,i][a],f+=[h,i,i,h,0,0][a],g+=[0,0,h,i,i,h][a],{r:Math.round(255*e),g:Math.round(255*f),b:Math.round(255*g),a:d||this.value.a}},toHex:function(a,b,c,d){var e=this.toRGB(a,b,c,d);return this.rgbaIsTransparent(e)?"transparent":"#"+(1<<24|parseInt(e.r)<<16|parseInt(e.g)<<8|parseInt(e.b)).toString(16).substr(1)},toHSL:function(a,b,c,d){a=a||this.value.h,b=b||this.value.s,c=c||this.value.b,d=d||this.value.a;var e=a,f=(2-b)*c,g=b*c;return g/=f>0&&1>=f?f:2-f,f/=2,g>1&&(g=1),{h:isNaN(e)?0:e,s:isNaN(g)?0:g,l:isNaN(f)?0:f,a:isNaN(d)?0:d}},toAlias:function(a,b,c,d){var e=this.toHex(a,b,c,d);for(var f in this.colors)if(this.colors[f]===e)return f;return!1},RGBtoHSB:function(a,b,c,d){a/=255,b/=255,c/=255;var e,f,g,h;return g=Math.max(a,b,c),h=g-Math.min(a,b,c),e=0===h?null:g===a?(b-c)/h:g===b?(c-a)/h+2:(a-b)/h+4,e=(e+360)%6*60/360,f=0===h?0:h/g,{h:this._sanitizeNumber(e),s:f,b:g,a:this._sanitizeNumber(d)}},HueToRGB:function(a,b,c){return 0>c?c+=1:c>1&&(c-=1),1>6*c?a+(b-a)*c*6:1>2*c?b:2>3*c?a+(b-a)*(2/3-c)*6:a},HSLtoRGB:function(a,b,c,d){0>b&&(b=0);var e;e=.5>=c?c*(1+b):c+b-c*b;var f=2*c-e,g=a+1/3,h=a,i=a-1/3,j=Math.round(255*this.HueToRGB(f,e,g)),k=Math.round(255*this.HueToRGB(f,e,h)),l=Math.round(255*this.HueToRGB(f,e,i));return[j,k,l,this._sanitizeNumber(d)]},toString:function(a){a=a||"rgba";var b=!1;switch(a){case"rgb":return b=this.toRGB(),this.rgbaIsTransparent(b)?"transparent":"rgb("+b.r+","+b.g+","+b.b+")";case"rgba":return b=this.toRGB(),"rgba("+b.r+","+b.g+","+b.b+","+b.a+")";case"hsl":return b=this.toHSL(),"hsl("+Math.round(360*b.h)+","+Math.round(100*b.s)+"%,"+Math.round(100*b.l)+"%)";case"hsla":return b=this.toHSL(),"hsla("+Math.round(360*b.h)+","+Math.round(100*b.s)+"%,"+Math.round(100*b.l)+"%,"+b.a+")";case"hex":return this.toHex();case"alias":return this.toAlias()||this.toHex();default:return b}},stringParsers:[{re:/rgb\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*?\)/,format:"rgb",parse:function(a){return[a[1],a[2],a[3],1]}},{re:/rgb\(\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*?\)/,format:"rgb",parse:function(a){return[2.55*a[1],2.55*a[2],2.55*a[3],1]}},{re:/rgba\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(?:,\s*(\d+(?:\.\d+)?)\s*)?\)/,format:"rgba",parse:function(a){return[a[1],a[2],a[3],a[4]]}},{re:/rgba\(\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d+(?:\.\d+)?)\s*)?\)/,format:"rgba",parse:function(a){return[2.55*a[1],2.55*a[2],2.55*a[3],a[4]]}},{re:/hsl\(\s*(\d+(?:\.\d+)?)\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*?\)/,format:"hsl",parse:function(a){return[a[1]/360,a[2]/100,a[3]/100,a[4]]}},{re:/hsla\(\s*(\d+(?:\.\d+)?)\s*,\s*(\d+(?:\.\d+)?)\%\s*,\s*(\d+(?:\.\d+)?)\%\s*(?:,\s*(\d+(?:\.\d+)?)\s*)?\)/,format:"hsla",parse:function(a){return[a[1]/360,a[2]/100,a[3]/100,a[4]]}},{re:/#?([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/,format:"hex",parse:function(a){return[parseInt(a[1],16),parseInt(a[2],16),parseInt(a[3],16),1]}},{re:/#?([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/,format:"hex",parse:function(a){return[parseInt(a[1]+a[1],16),parseInt(a[2]+a[2],16),parseInt(a[3]+a[3],16),1]}}],colorNameToHex:function(a){return"undefined"!=typeof this.colors[a.toLowerCase()]?this.colors[a.toLowerCase()]:!1}};var c={horizontal:!1,inline:!1,color:!1,format:!1,input:"input",container:!1,component:".add-on, .input-group-addon",sliders:{saturation:{maxLeft:100,maxTop:100,callLeft:"setSaturation",callTop:"setBrightness"},hue:{maxLeft:0,maxTop:100,callLeft:!1,callTop:"setHue"},alpha:{maxLeft:0,maxTop:100,callLeft:!1,callTop:"setAlpha"}},slidersHorz:{saturation:{maxLeft:100,maxTop:100,callLeft:"setSaturation",callTop:"setBrightness"},hue:{maxLeft:100,maxTop:0,callLeft:"setHue",callTop:!1},alpha:{maxLeft:100,maxTop:0,callLeft:"setAlpha",callTop:!1}},template:'<div class="colorpicker dropdown-menu"><div class="colorpicker-saturation"><i><b></b></i></div><div class="colorpicker-hue"><i></i></div><div class="colorpicker-alpha"><i></i></div><div class="colorpicker-color"><div /></div><div class="colorpicker-selectors"></div></div>',align:"right",customClass:null,colorSelectors:null},d=function(d,e){if(this.element=a(d).addClass("colorpicker-element"),this.options=a.extend(!0,{},c,this.element.data(),e),this.component=this.options.component,this.component=this.component!==!1?this.element.find(this.component):!1,this.component&&0===this.component.length&&(this.component=!1),this.container=this.options.container===!0?this.element:this.options.container,this.container=this.container!==!1?a(this.container):!1,this.input=this.element.is("input")?this.element:this.options.input?this.element.find(this.options.input):!1,this.input&&0===this.input.length&&(this.input=!1),this.color=new b(this.options.color!==!1?this.options.color:this.getValue(),this.options.colorSelectors),this.format=this.options.format!==!1?this.options.format:this.color.origFormat,this.picker=a(this.options.template),this.options.customClass&&this.picker.addClass(this.options.customClass),this.options.inline?this.picker.addClass("colorpicker-inline colorpicker-visible"):this.picker.addClass("colorpicker-hidden"),this.options.horizontal&&this.picker.addClass("colorpicker-horizontal"),("rgba"===this.format||"hsla"===this.format||this.options.format===!1)&&this.picker.addClass("colorpicker-with-alpha"),"right"===this.options.align&&this.picker.addClass("colorpicker-right"),this.options.colorSelectors){var f=this;a.each(this.options.colorSelectors,function(b,c){var d=a("<i />").css("background-color",c).data("class",b);d.click(function(){f.setValue(a(this).css("background-color"))}),f.picker.find(".colorpicker-selectors").append(d)}),this.picker.find(".colorpicker-selectors").show()}this.picker.on("mousedown.colorpicker touchstart.colorpicker",a.proxy(this.mousedown,this)),this.picker.appendTo(this.container?this.container:a("body")),this.input!==!1&&(this.input.on({"keyup.colorpicker":a.proxy(this.keyup,this)}),this.input.on({"change.colorpicker":a.proxy(this.change,this)}),this.component===!1&&this.element.on({"focus.colorpicker":a.proxy(this.show,this)}),this.options.inline===!1&&this.element.on({"focusout.colorpicker":a.proxy(this.hide,this)})),this.component!==!1&&this.component.on({"click.colorpicker":a.proxy(this.show,this)}),this.input===!1&&this.component===!1&&this.element.on({"click.colorpicker":a.proxy(this.show,this)}),this.input!==!1&&this.component!==!1&&"color"===this.input.attr("type")&&this.input.on({"click.colorpicker":a.proxy(this.show,this),"focus.colorpicker":a.proxy(this.show,this)}),this.update(),a(a.proxy(function(){this.element.trigger("create")},this))};d.Color=b,d.prototype={constructor:d,destroy:function(){this.picker.remove(),this.element.removeData("colorpicker").off(".colorpicker"),this.input!==!1&&this.input.off(".colorpicker"),this.component!==!1&&this.component.off(".colorpicker"),this.element.removeClass("colorpicker-element"),this.element.trigger({type:"destroy"})},reposition:function(){if(this.options.inline!==!1||this.options.container)return!1;var a=this.container&&this.container[0]!==document.body?"position":"offset",b=this.component||this.element,c=b[a]();"right"===this.options.align&&(c.left-=this.picker.outerWidth()-b.outerWidth()),this.picker.css({top:c.top+b.outerHeight(),left:c.left})},show:function(b){return this.isDisabled()?!1:(this.picker.addClass("colorpicker-visible").removeClass("colorpicker-hidden"),this.reposition(),a(window).on("resize.colorpicker",a.proxy(this.reposition,this)),!b||this.hasInput()&&"color"!==this.input.attr("type")||b.stopPropagation&&b.preventDefault&&(b.stopPropagation(),b.preventDefault()),this.options.inline===!1&&a(window.document).on({"mousedown.colorpicker":a.proxy(this.hide,this)}),void this.element.trigger({type:"showPicker",color:this.color}))},hide:function(){this.picker.addClass("colorpicker-hidden").removeClass("colorpicker-visible"),a(window).off("resize.colorpicker",this.reposition),a(document).off({"mousedown.colorpicker":this.hide}),this.update(),this.element.trigger({type:"hidePicker",color:this.color})},updateData:function(a){return a=a||this.color.toString(this.format),this.element.data("color",a),a},updateInput:function(a){if(a=a||this.color.toString(this.format),this.input!==!1){if(this.options.colorSelectors){var c=new b(a,this.options.colorSelectors),d=c.toAlias();"undefined"!=typeof this.options.colorSelectors[d]&&(a=d)}this.input.prop("value",a)}return a},updatePicker:function(a){void 0!==a&&(this.color=new b(a,this.options.colorSelectors));var c=this.options.horizontal===!1?this.options.sliders:this.options.slidersHorz,d=this.picker.find("i");return 0!==d.length?(this.options.horizontal===!1?(c=this.options.sliders,d.eq(1).css("top",c.hue.maxTop*(1-this.color.value.h)).end().eq(2).css("top",c.alpha.maxTop*(1-this.color.value.a))):(c=this.options.slidersHorz,d.eq(1).css("left",c.hue.maxLeft*(1-this.color.value.h)).end().eq(2).css("left",c.alpha.maxLeft*(1-this.color.value.a))),d.eq(0).css({top:c.saturation.maxTop-this.color.value.b*c.saturation.maxTop,left:this.color.value.s*c.saturation.maxLeft}),this.picker.find(".colorpicker-saturation").css("backgroundColor",this.color.toHex(this.color.value.h,1,1,1)),this.picker.find(".colorpicker-alpha").css("backgroundColor",this.color.toHex()),this.picker.find(".colorpicker-color, .colorpicker-color div").css("backgroundColor",this.color.toString(this.format)),a):void 0},updateComponent:function(a){if(a=a||this.color.toString(this.format),this.component!==!1){var b=this.component.find("i").eq(0);b.length>0?b.css({backgroundColor:a}):this.component.css({backgroundColor:a})}return a},update:function(a){var b;return(this.getValue(!1)!==!1||a===!0)&&(b=this.updateComponent(),this.updateInput(b),this.updateData(b),this.updatePicker()),b},setValue:function(a){this.color=new b(a,this.options.colorSelectors),this.update(!0),this.element.trigger({type:"changeColor",color:this.color,value:a})},getValue:function(a){a=void 0===a?"#000000":a;var b;return b=this.hasInput()?this.input.val():this.element.data("color"),(void 0===b||""===b||null===b)&&(b=a),b},hasInput:function(){return this.input!==!1},isDisabled:function(){return this.hasInput()?this.input.prop("disabled")===!0:!1},disable:function(){return this.hasInput()?(this.input.prop("disabled",!0),this.element.trigger({type:"disable",color:this.color,value:this.getValue()}),!0):!1},enable:function(){return this.hasInput()?(this.input.prop("disabled",!1),this.element.trigger({type:"enable",color:this.color,value:this.getValue()}),!0):!1},currentSlider:null,mousePointer:{left:0,top:0},mousedown:function(b){b.pageX||b.pageY||!b.originalEvent||(b.pageX=b.originalEvent.touches[0].pageX,b.pageY=b.originalEvent.touches[0].pageY),b.stopPropagation(),b.preventDefault();var c=a(b.target),d=c.closest("div"),e=this.options.horizontal?this.options.slidersHorz:this.options.sliders;if(!d.is(".colorpicker")){if(d.is(".colorpicker-saturation"))this.currentSlider=a.extend({},e.saturation);else if(d.is(".colorpicker-hue"))this.currentSlider=a.extend({},e.hue);else{if(!d.is(".colorpicker-alpha"))return!1;this.currentSlider=a.extend({},e.alpha)}var f=d.offset();this.currentSlider.guide=d.find("i")[0].style,this.currentSlider.left=b.pageX-f.left,this.currentSlider.top=b.pageY-f.top,this.mousePointer={left:b.pageX,top:b.pageY},a(document).on({"mousemove.colorpicker":a.proxy(this.mousemove,this),"touchmove.colorpicker":a.proxy(this.mousemove,this),"mouseup.colorpicker":a.proxy(this.mouseup,this),"touchend.colorpicker":a.proxy(this.mouseup,this)}).trigger("mousemove")}return!1},mousemove:function(a){a.pageX||a.pageY||!a.originalEvent||(a.pageX=a.originalEvent.touches[0].pageX,a.pageY=a.originalEvent.touches[0].pageY),a.stopPropagation(),a.preventDefault();var b=Math.max(0,Math.min(this.currentSlider.maxLeft,this.currentSlider.left+((a.pageX||this.mousePointer.left)-this.mousePointer.left))),c=Math.max(0,Math.min(this.currentSlider.maxTop,this.currentSlider.top+((a.pageY||this.mousePointer.top)-this.mousePointer.top)));return this.currentSlider.guide.left=b+"px",this.currentSlider.guide.top=c+"px",this.currentSlider.callLeft&&this.color[this.currentSlider.callLeft].call(this.color,b/this.currentSlider.maxLeft),this.currentSlider.callTop&&this.color[this.currentSlider.callTop].call(this.color,c/this.currentSlider.maxTop),"setAlpha"===this.currentSlider.callTop&&this.options.format===!1&&(1!==this.color.value.a?(this.format="rgba",this.color.origFormat="rgba"):(this.format="hex",this.color.origFormat="hex")),this.update(!0),this.element.trigger({type:"changeColor",color:this.color}),!1},mouseup:function(b){return b.stopPropagation(),b.preventDefault(),a(document).off({"mousemove.colorpicker":this.mousemove,"touchmove.colorpicker":this.mousemove,"mouseup.colorpicker":this.mouseup,"touchend.colorpicker":this.mouseup}),!1},change:function(a){this.keyup(a)},keyup:function(a){38===a.keyCode?(this.color.value.a<1&&(this.color.value.a=Math.round(100*(this.color.value.a+.01))/100),this.update(!0)):40===a.keyCode?(this.color.value.a>0&&(this.color.value.a=Math.round(100*(this.color.value.a-.01))/100),this.update(!0)):(this.color=new b(this.input.val(),this.options.colorSelectors),this.color.origFormat&&this.options.format===!1&&(this.format=this.color.origFormat),this.getValue(!1)!==!1&&(this.updateData(),this.updateComponent(),this.updatePicker())),this.element.trigger({type:"changeColor",color:this.color,value:this.input.val()})}},a.colorpicker=d,a.fn.colorpicker=function(b){var c,e=arguments,f=this.each(function(){var f=a(this),g=f.data("colorpicker"),h="object"==typeof b?b:{};g||"string"==typeof b?"string"==typeof b&&(c=g[b].apply(g,Array.prototype.slice.call(e,1))):f.data("colorpicker",new d(this,h))});return"getValue"===b?c:f},a.fn.colorpicker.constructor=d});
@@ -14,15 +14,15 @@ jQuery(function($){
14
14
  prevText: '<%= I18n.t('date_picker.prev_text', :default => '&#x3c;Prev') %>',
15
15
  nextText: '<%= I18n.t('date_picker.next_text', :default => 'Next&#x3e;') %>',
16
16
  currentText: '<%= I18n.t('date_picker.current_text', :default => 'Current') %>',
17
- monthNames: [<%= I18n.t('date.month_names').delete_if { |m| m.blank? }.map { |m| "'#{m.capitalize}'" }.join(', ') %>],
18
- monthNamesShort: [<%= I18n.t('date.abbr_month_names').delete_if { |m| m.blank? }.map { |m| "'#{m.capitalize.gsub(/\.$/, '')}'" }.join(', ') %>],
19
- dayNames: [<%= I18n.t('date.day_names').delete_if { |d| d.blank? }.map { |d| "'#{d.capitalize}'" }.join(', ') %>],
20
- dayNamesShort: [<%= I18n.t('date.abbr_day_names').delete_if { |d| d.blank? }.map { |d| "'#{d.capitalize}'" }.join(', ') %>],
21
- dayNamesMin: [<%= I18n.t('date.abbr_day_names').delete_if { |d| d.blank? }.map { |d| "'#{d[0..1].capitalize}'" }.join(', ') %>],
17
+ monthNames: [<%= I18n.t('date.month_names').dup.delete_if { |m| m.blank? }.map { |m| "'#{m.capitalize}'" }.join(', ') %>],
18
+ monthNamesShort: [<%= I18n.t('date.abbr_month_names').dup.delete_if { |m| m.blank? }.map { |m| "'#{m.capitalize.gsub(/\.$/, '')}'" }.join(', ') %>],
19
+ dayNames: [<%= I18n.t('date.day_names').dup.delete_if { |d| d.blank? }.map { |d| "'#{d.capitalize}'" }.join(', ') %>],
20
+ dayNamesShort: [<%= I18n.t('date.abbr_day_names').dup.delete_if { |d| d.blank? }.map { |d| "'#{d.capitalize}'" }.join(', ') %>],
21
+ dayNamesMin: [<%= I18n.t('date.abbr_day_names').dup.delete_if { |d| d.blank? }.map { |d| "'#{d[0..1].capitalize}'" }.join(', ') %>],
22
22
  dateFormat: '<%= I18n.t('date.formats.default').gsub('%d', 'dd').gsub('%m', 'mm').gsub('%Y', 'yy') %>',
23
23
  firstDay: 1,
24
24
  isRTL: false
25
25
  };
26
26
  <% end %>
27
27
  <% end %>
28
- });
28
+ });
@@ -0,0 +1,11 @@
1
+ /**
2
+ * kramed - a markdown parser
3
+ * Copyright (c) 2011-2014, Christopher Jeffrey. (MIT Licensed)
4
+ * https://github.com/GitbookIO/kramed
5
+ */
6
+ /**
7
+ * kramed - a kramdown parser, based off chjj's kramed
8
+ * Copyright (c) 2014, Aaron O'Mullan. (MIT Licensed)
9
+ * https://github.com/GitbookIO/kramed
10
+ */
11
+ (function(){var block={newline:/^\n+/,code:/^( {4}[^\n]+\n*)+/,fences:noop,hr:/^( *[-*_]){3,} *(?:\n+|$)/,heading:/^ *(#{1,6}) *([^\n]+?) *#* *(?:\n+|$)/,nptable:noop,lheading:/^([^\n]+)\n *(=|-){2,} *(?:\n+|$)/,blockquote:/^( *>[^\n]+(\n(?!def)[^\n]+)*\n*)+/,list:/^( *)(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?!\1bull )\n*|\s*$)/,html:/^ *(?:comment *(?:\n|\s*$)|closed *(?:\n{2,}|\s*$)|closing *(?:\n{2,}|\s*$))/,def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +["(]([^\n]+)[")])? *(?:\n+|$)/,table:noop,paragraph:/^((?:[^\n]+\n?(?!hr|heading|lheading|blockquote|tag|def|math))+)\n*/,text:/^[^\n]+/,math:/^ *(\${2,}) *([\s\S]+?)\s*\1 *(?:\n+|$)/};block.bullet=/(?:[*+-]|\d+\.)/;block.item=/^( *)(bull) [^\n]*(?:\n(?!\1bull )[^\n]*)*/;block.item=replace(block.item,"gm")(/bull/g,block.bullet)();block.list=replace(block.list)(/bull/g,block.bullet)("hr","\\n+(?=\\1?(?:[-*_] *){3,}(?:\\n+|$))")("def","\\n+(?="+block.def.source+")")();block.blockquote=replace(block.blockquote)("def",block.def)();block._tag="(?!(?:"+"a|em|strong|small|s|cite|q|dfn|abbr|data|time|code"+"|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo"+"|span|br|wbr|ins|del|img)\\b)\\w+(?!:/|[^\\w\\s@]*@)\\b";block.html=replace(block.html)("comment",/<!--[\s\S]*?-->/)("closed",/<(tag)[\s\S]+?<\/\1>/)("closing",/<tag(?:"[^"]*"|'[^']*'|[^'">])*?>/)(/tag/g,block._tag)();block.paragraph=replace(block.paragraph)("hr",block.hr)("heading",block.heading)("lheading",block.lheading)("blockquote",block.blockquote)("tag","<"+block._tag)("def",block.def)("math",block.math)();block.normal=merge({},block);block.gfm=merge({},block.normal,{fences:/^ *(`{3,}|~{3,}) *(\S+)? *\n([\s\S]+?)\s*\1 *(?:\n+|$)/,paragraph:/^/});block.gfm.paragraph=replace(block.paragraph)("(?!","(?!"+block.gfm.fences.source.replace("\\1","\\2")+"|"+block.list.source.replace("\\1","\\3")+"|")();block.tables=merge({},block.gfm,{nptable:/^ *(\S.*\|.*)\n *([-:]+ *\|[-| :]*)\n((?:.*\|.*(?:\n|$))*)\n*/,table:/^ *\|(.+)\n *\|( *[-:]+[-| :]*)\n((?: *\|.*(?:\n|$))*)\n*/});function Lexer(options){this.tokens=[];this.tokens.links={};this.options=options||kramed.defaults;this.rules=block.normal;if(this.options.gfm){if(this.options.tables){this.rules=block.tables}else{this.rules=block.gfm}}if(!this.options.mathjax){this.rules.math=noop}}Lexer.rules=block;Lexer.lex=function(src,options){var lexer=new Lexer(options);return lexer.lex(src)};Lexer.prototype.lex=function(src){src=src.replace(/\r\n|\r/g,"\n").replace(/\t/g," ").replace(/\u00a0/g," ").replace(/\u2424/g,"\n");return this.token(src,true)};Lexer.prototype.token=function(src,top,bq){var src=src.replace(/^ +$/gm,""),next,loose,cap,bull,b,item,space,i,l;while(src){if(cap=this.rules.newline.exec(src)){src=src.substring(cap[0].length);if(cap[0].length>1){this.tokens.push({type:"space"})}}if(cap=this.rules.code.exec(src)){src=src.substring(cap[0].length);cap=cap[0].replace(/^ {4}/gm,"");this.tokens.push({type:"code",text:!this.options.pedantic?cap.replace(/\n+$/,""):cap});continue}if(cap=this.rules.fences.exec(src)){src=src.substring(cap[0].length);this.tokens.push({type:"code",lang:cap[2],text:cap[3]});continue}if(cap=this.rules.math.exec(src)){src=src.substring(cap[0].length);this.tokens.push({type:"math",text:cap[2]});continue}if(cap=this.rules.heading.exec(src)){src=src.substring(cap[0].length);this.tokens.push({type:"heading",depth:cap[1].length,text:cap[2]});continue}if(top&&(cap=this.rules.nptable.exec(src))){src=src.substring(cap[0].length);item={type:"table",header:cap[1].replace(/^ *| *\| *$/g,"").split(/ *\| */),align:cap[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:cap[3].replace(/\n$/,"").split("\n")};for(i=0;i<item.align.length;i++){if(/^ *-+: *$/.test(item.align[i])){item.align[i]="right"}else if(/^ *:-+: *$/.test(item.align[i])){item.align[i]="center"}else if(/^ *:-+ *$/.test(item.align[i])){item.align[i]="left"}else{item.align[i]=null}}for(i=0;i<item.cells.length;i++){item.cells[i]=item.cells[i].split(/ *\| */)}this.tokens.push(item);continue}if(cap=this.rules.lheading.exec(src)){src=src.substring(cap[0].length);this.tokens.push({type:"heading",depth:cap[2]==="="?1:2,text:cap[1]});continue}if(cap=this.rules.hr.exec(src)){src=src.substring(cap[0].length);this.tokens.push({type:"hr"});continue}if(cap=this.rules.blockquote.exec(src)){src=src.substring(cap[0].length);this.tokens.push({type:"blockquote_start"});cap=cap[0].replace(/^ *> ?/gm,"");this.token(cap,top,true);this.tokens.push({type:"blockquote_end"});continue}if(cap=this.rules.list.exec(src)){src=src.substring(cap[0].length);bull=cap[2];this.tokens.push({type:"list_start",ordered:bull.length>1});cap=cap[0].match(this.rules.item);next=false;l=cap.length;i=0;for(;i<l;i++){item=cap[i];space=item.length;item=item.replace(/^ *([*+-]|\d+\.) +/,"");if(~item.indexOf("\n ")){space-=item.length;item=!this.options.pedantic?item.replace(new RegExp("^ {1,"+space+"}","gm"),""):item.replace(/^ {1,4}/gm,"")}if(this.options.smartLists&&i!==l-1){b=block.bullet.exec(cap[i+1])[0];if(bull!==b&&!(bull.length>1&&b.length>1)){src=cap.slice(i+1).join("\n")+src;i=l-1}}loose=next||/\n\n(?!\s*$)/.test(item);if(i!==l-1){next=item.charAt(item.length-1)==="\n";if(!loose)loose=next}this.tokens.push({type:loose?"loose_item_start":"list_item_start"});this.token(item,false,bq);this.tokens.push({type:"list_item_end"})}this.tokens.push({type:"list_end"});continue}if(cap=this.rules.html.exec(src)){src=src.substring(cap[0].length);this.tokens.push({type:this.options.sanitize?"paragraph":"html",pre:cap[1]==="pre"||cap[1]==="script"||cap[1]==="style",text:cap[0]});continue}if(!bq&&top&&(cap=this.rules.def.exec(src))){src=src.substring(cap[0].length);this.tokens.links[cap[1].toLowerCase()]={href:cap[2],title:cap[3]};continue}if(top&&(cap=this.rules.table.exec(src))){src=src.substring(cap[0].length);item={type:"table",header:cap[1].replace(/^ *| *\| *$/g,"").split(/ *\| */),align:cap[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:cap[3].replace(/(?: *\| *)?\n$/,"").split("\n")};for(i=0;i<item.align.length;i++){if(/^ *-+: *$/.test(item.align[i])){item.align[i]="right"}else if(/^ *:-+: *$/.test(item.align[i])){item.align[i]="center"}else if(/^ *:-+ *$/.test(item.align[i])){item.align[i]="left"}else{item.align[i]=null}}for(i=0;i<item.cells.length;i++){item.cells[i]=item.cells[i].replace(/^ *\| *| *\| *$/g,"").split(/ *\| */)}this.tokens.push(item);continue}if(top&&(cap=this.rules.paragraph.exec(src))){src=src.substring(cap[0].length);this.tokens.push({type:"paragraph",text:cap[1].charAt(cap[1].length-1)==="\n"?cap[1].slice(0,-1):cap[1]});continue}if(cap=this.rules.text.exec(src)){src=src.substring(cap[0].length);this.tokens.push({type:"text",text:cap[0]});continue}if(src){throw new Error("Infinite loop on byte: "+src.charCodeAt(0))}}return this.tokens};var inline={escape:/^\\([\\`*{}\[\]()#$+\-.!_>])/,autolink:/^<([^ >]+(@|:\/)[^ >]+)>/,url:noop,tag:/^<!--[\s\S]*?-->|^<\/?\w+(?:"[^"]*"|'[^']*'|[^'">])*?>/,link:/^!?\[(inside)\]\(href\)/,reflink:/^!?\[(inside)\]\s*\[([^\]]*)\]/,nolink:/^!?\[((?:\[[^\]]*\]|[^\[\]])*)\]/,strong:/^__([\s\S]+?)__(?!_)|^\*\*([\s\S]+?)\*\*(?!\*)/,em:/^\b_((?:__|[\s\S])+?)_\b|^\*((?:\*\*|[\s\S])+?)\*(?!\*)/,code:/^(`+)\s*([\s\S]*?[^`])\s*\1(?!`)/,br:/^ {2,}\n(?!\s*$)/,del:noop,text:/^[\s\S]+?(?=[\\<!\[_*`$]| {2,}\n|$)/,math:/^\$\s*([\s\S]*?[^\$])\s*\$(?!\$)/};inline._inside=/(?:\[[^\]]*\]|[^\[\]]|\](?=[^\[]*\]))*/;inline._href=/\s*<?([\s\S]*?)>?(?:\s+['"]([\s\S]*?)['"])?\s*/;inline.link=replace(inline.link)("inside",inline._inside)("href",inline._href)();inline.reflink=replace(inline.reflink)("inside",inline._inside)();inline.normal=merge({},inline);inline.pedantic=merge({},inline.normal,{strong:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,em:/^_(?=\S)([\s\S]*?\S)_(?!_)|^\*(?=\S)([\s\S]*?\S)\*(?!\*)/});inline.gfm=merge({},inline.normal,{escape:replace(inline.escape)("])","~|])")(),url:/^(https?:\/\/[^\s<]+[^<.,:;"')\]\s])/,del:/^~~(?=\S)([\s\S]*?\S)~~/,text:replace(inline.text)("]|","~]|")("|","|https?://|")()});inline.breaks=merge({},inline.gfm,{br:replace(inline.br)("{2,}","*")(),text:replace(inline.gfm.text)("{2,}","*")()});function InlineLexer(links,options){this.options=options||kramed.defaults;this.links=links;this.rules=inline.normal;this.renderer=this.options.renderer||new Renderer;this.renderer.options=this.options;if(!this.links){throw new Error("Tokens array requires a `links` property.")}if(this.options.gfm){if(this.options.breaks){this.rules=inline.breaks}else{this.rules=inline.gfm}}else if(this.options.pedantic){this.rules=inline.pedantic}if(!this.options.mathjax){this.rules.math=noop}}InlineLexer.rules=inline;InlineLexer.output=function(src,links,options){var inline=new InlineLexer(links,options);return inline.output(src)};InlineLexer.prototype.output=function(src){var out="",link,text,href,cap;while(src){if(cap=this.rules.escape.exec(src)){src=src.substring(cap[0].length);out+=cap[1];continue}if(cap=this.rules.autolink.exec(src)){src=src.substring(cap[0].length);if(cap[2]==="@"){text=cap[1].charAt(6)===":"?this.mangle(cap[1].substring(7)):this.mangle(cap[1]);href=this.mangle("mailto:")+text}else{text=escape(cap[1]);href=text}out+=this.renderer.link(href,null,text);continue}if(!this.inLink&&(cap=this.rules.url.exec(src))){src=src.substring(cap[0].length);text=escape(cap[1]);href=text;out+=this.renderer.link(href,null,text);continue}if(cap=this.rules.tag.exec(src)){if(!this.inLink&&/^<a /i.test(cap[0])){this.inLink=true}else if(this.inLink&&/^<\/a>/i.test(cap[0])){this.inLink=false}src=src.substring(cap[0].length);out+=this.options.sanitize?escape(cap[0]):cap[0];continue}if(cap=this.rules.link.exec(src)){src=src.substring(cap[0].length);this.inLink=true;out+=this.outputLink(cap,{href:cap[2],title:cap[3]});this.inLink=false;continue}if((cap=this.rules.reflink.exec(src))||(cap=this.rules.nolink.exec(src))){src=src.substring(cap[0].length);link=(cap[2]||cap[1]).replace(/\s+/g," ");link=this.links[link.toLowerCase()];if(!link||!link.href){out+=cap[0].charAt(0);src=cap[0].substring(1)+src;continue}this.inLink=true;out+=this.outputLink(cap,link);this.inLink=false;continue}if(cap=this.rules.strong.exec(src)){src=src.substring(cap[0].length);out+=this.renderer.strong(this.output(cap[2]||cap[1]));continue}if(cap=this.rules.em.exec(src)){src=src.substring(cap[0].length);out+=this.renderer.em(this.output(cap[2]||cap[1]));continue}if(cap=this.rules.code.exec(src)){src=src.substring(cap[0].length);out+=this.renderer.codespan(escape(cap[2],true));continue}if(cap=this.rules.math.exec(src)){src=src.substring(cap[0].length);out+=this.renderer.math(cap[1],"math/tex",false);continue}if(cap=this.rules.br.exec(src)){src=src.substring(cap[0].length);out+=this.renderer.br();continue}if(cap=this.rules.del.exec(src)){src=src.substring(cap[0].length);out+=this.renderer.del(this.output(cap[1]));continue}if(cap=this.rules.text.exec(src)){src=src.substring(cap[0].length);out+=escape(this.smartypants(cap[0]));continue}if(src){throw new Error("Infinite loop on byte: "+src.charCodeAt(0))}}return out};InlineLexer.prototype.outputLink=function(cap,link){var href=escape(link.href),title=link.title?escape(link.title):null;return cap[0].charAt(0)!=="!"?this.renderer.link(href,title,this.output(cap[1])):this.renderer.image(href,title,escape(cap[1]))};InlineLexer.prototype.smartypants=function(text){if(!this.options.smartypants)return text;return text.replace(/--/g,"—").replace(/(^|[-\u2014/(\[{"\s])'/g,"$1‘").replace(/'/g,"’").replace(/(^|[-\u2014/(\[{\u2018\s])"/g,"$1“").replace(/"/g,"”").replace(/\.{3}/g,"…")};InlineLexer.prototype.mangle=function(text){var out="",l=text.length,i=0,ch;for(;i<l;i++){ch=text.charCodeAt(i);if(Math.random()>.5){ch="x"+ch.toString(16)}out+="&#"+ch+";"}return out};function Renderer(options){this.options=options||{}}Renderer.prototype.code=function(code,lang,escaped){if(this.options.highlight){var out=this.options.highlight(code,lang);if(out!=null&&out!==code){escaped=true;code=out}}if(!lang){return"<pre><code>"+(escaped?code:escape(code,true))+"\n</code></pre>"}return'<pre><code class="'+this.options.langPrefix+escape(lang,true)+'">'+(escaped?code:escape(code,true))+"\n</code></pre>\n"};Renderer.prototype.blockquote=function(quote){return"<blockquote>\n"+quote+"</blockquote>\n"};Renderer.prototype.html=function(html){return html};Renderer.prototype.heading=function(text,level,raw){return"<h"+level+' id="'+this.options.headerPrefix+raw.toLowerCase().replace(/[^\w]+/g,"-")+'">'+text+"</h"+level+">\n"};Renderer.prototype.hr=function(){return this.options.xhtml?"<hr/>\n":"<hr>\n"};Renderer.prototype.list=function(body,ordered){var type=ordered?"ol":"ul";return"<"+type+">\n"+body+"</"+type+">\n"};Renderer.prototype.listitem=function(text){return"<li>"+text+"</li>\n"};Renderer.prototype.paragraph=function(text){return"<p>"+text+"</p>\n"};Renderer.prototype.table=function(header,body){return"<table>\n"+"<thead>\n"+header+"</thead>\n"+"<tbody>\n"+body+"</tbody>\n"+"</table>\n"};Renderer.prototype.tablerow=function(content){return"<tr>\n"+content+"</tr>\n"};Renderer.prototype.tablecell=function(content,flags){var type=flags.header?"th":"td";var tag=flags.align?"<"+type+' style="text-align:'+flags.align+'">':"<"+type+">";return tag+content+"</"+type+">\n"};Renderer.prototype.math=function(content,language,display){mode=display?"; mode=display":"";return'<script type="'+language+mode+'">'+content+"</script>"};Renderer.prototype.strong=function(text){return"<strong>"+text+"</strong>"};Renderer.prototype.em=function(text){return"<em>"+text+"</em>"};Renderer.prototype.codespan=function(text){return"<code>"+text+"</code>"};Renderer.prototype.br=function(){return this.options.xhtml?"<br/>":"<br>"};Renderer.prototype.del=function(text){return"<del>"+text+"</del>"};Renderer.prototype.link=function(href,title,text){if(this.options.sanitize){try{var prot=decodeURIComponent(unescape(href)).replace(/[^\w:]/g,"").toLowerCase()}catch(e){return""}if(prot.indexOf("javascript:")===0){return""}}var out='<a href="'+href+'"';if(title){out+=' title="'+title+'"'}out+=">"+text+"</a>";return out};Renderer.prototype.image=function(href,title,text){var out='<img src="'+href+'" alt="'+text+'"';if(title){out+=' title="'+title+'"'}out+=this.options.xhtml?"/>":">";return out};function Parser(options){this.tokens=[];this.token=null;this.options=options||kramed.defaults;this.options.renderer=this.options.renderer||new Renderer;this.renderer=this.options.renderer;this.renderer.options=this.options}Parser.parse=function(src,options,renderer){var parser=new Parser(options,renderer);return parser.parse(src)};Parser.prototype.parse=function(src){this.inline=new InlineLexer(src.links,this.options,this.renderer);this.tokens=src.reverse();var out="";while(this.next()){out+=this.tok()}return out};Parser.prototype.next=function(){return this.token=this.tokens.pop()};Parser.prototype.peek=function(){return this.tokens[this.tokens.length-1]||0};Parser.prototype.parseText=function(){var body=this.token.text;while(this.peek().type==="text"){body+="\n"+this.next().text}return this.inline.output(body)};Parser.prototype.tok=function(){switch(this.token.type){case"space":{return""}case"hr":{return this.renderer.hr()}case"heading":{return this.renderer.heading(this.inline.output(this.token.text),this.token.depth,this.token.text)}case"code":{return this.renderer.code(this.token.text,this.token.lang,this.token.escaped)}case"math":{return this.renderer.math(this.token.text,"math/tex",true)}case"table":{var header="",body="",i,row,cell,flags,j;cell="";for(i=0;i<this.token.header.length;i++){flags={header:true,align:this.token.align[i]};cell+=this.renderer.tablecell(this.inline.output(this.token.header[i]),{header:true,align:this.token.align[i]})}header+=this.renderer.tablerow(cell);for(i=0;i<this.token.cells.length;i++){row=this.token.cells[i];cell="";for(j=0;j<row.length;j++){cell+=this.renderer.tablecell(this.inline.output(row[j]),{header:false,align:this.token.align[j]})}body+=this.renderer.tablerow(cell)}return this.renderer.table(header,body)}case"blockquote_start":{var body="";while(this.next().type!=="blockquote_end"){body+=this.tok()}return this.renderer.blockquote(body)}case"list_start":{var body="",ordered=this.token.ordered;while(this.next().type!=="list_end"){body+=this.tok()}return this.renderer.list(body,ordered)}case"list_item_start":{var body="";while(this.next().type!=="list_item_end"){body+=this.token.type==="text"?this.parseText():this.tok()}return this.renderer.listitem(body)}case"loose_item_start":{var body="";while(this.next().type!=="list_item_end"){body+=this.tok()}return this.renderer.listitem(body)}case"html":{var html=!this.token.pre&&!this.options.pedantic?this.inline.output(this.token.text):this.token.text;return this.renderer.html(html)}case"paragraph":{return this.renderer.paragraph(this.inline.output(this.token.text))}case"text":{return this.renderer.paragraph(this.parseText())}}};function escape(html,encode){return html.replace(!encode?/&(?!#?\w+;)/g:/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}function unescape(html){return html.replace(/&([#\w]+);/g,function(_,n){n=n.toLowerCase();if(n==="colon")return":";if(n.charAt(0)==="#"){return n.charAt(1)==="x"?String.fromCharCode(parseInt(n.substring(2),16)):String.fromCharCode(+n.substring(1))}return""})}function replace(regex,opt){regex=regex.source;opt=opt||"";return function self(name,val){if(!name)return new RegExp(regex,opt);val=val.source||val;val=val.replace(/(^|[^\[])\^/g,"$1");regex=regex.replace(name,val);return self}}function noop(){}noop.exec=noop;function merge(obj){var i=1,target,key;for(;i<arguments.length;i++){target=arguments[i];for(key in target){if(Object.prototype.hasOwnProperty.call(target,key)){obj[key]=target[key]}}}return obj}function kramed(src,opt,callback){if(callback||typeof opt==="function"){if(!callback){callback=opt;opt=null}opt=merge({},kramed.defaults,opt||{});var highlight=opt.highlight,tokens,pending,i=0;try{tokens=Lexer.lex(src,opt)}catch(e){return callback(e)}pending=tokens.length;var done=function(err){if(err){opt.highlight=highlight;return callback(err)}var out;try{out=Parser.parse(tokens,opt)}catch(e){err=e}opt.highlight=highlight;return err?callback(err):callback(null,out)};if(!highlight||highlight.length<3){return done()}delete opt.highlight;if(!pending)return done();for(;i<tokens.length;i++){(function(token){if(token.type!=="code"){return--pending||done()}return highlight(token.text,token.lang,function(err,code){if(err)return done(err);if(code==null||code===token.text){return--pending||done()}token.text=code;token.escaped=true;--pending||done()})})(tokens[i])}return}try{if(opt)opt=merge({},kramed.defaults,opt);return Parser.parse(Lexer.lex(src,opt),opt)}catch(e){e.message+="\nPlease report this to https://github.com/GitbookIO/kramed.";if((opt||kramed.defaults).silent){return"<p>An error occured:</p><pre>"+escape(e.message+"",true)+"</pre>"}throw e}}kramed.options=kramed.setOptions=function(opt){merge(kramed.defaults,opt);return kramed};kramed.defaults={gfm:true,tables:true,breaks:false,pedantic:false,sanitize:false,smartLists:false,silent:false,highlight:null,langPrefix:"lang-",smartypants:false,headerPrefix:"",renderer:new Renderer,xhtml:false,mathjax:true};kramed.Parser=Parser;kramed.parser=Parser.parse;kramed.Renderer=Renderer;kramed.Lexer=Lexer;kramed.lexer=Lexer.lex;kramed.InlineLexer=InlineLexer;kramed.inlineLexer=InlineLexer.output;kramed.parse=kramed;if(typeof module!=="undefined"&&typeof exports==="object"){module.exports=kramed}else if(typeof define==="function"&&define.amd){define(function(){return kramed})}else{this.kramed=kramed}}).call(function(){return this||(typeof window!=="undefined"?window:global)}());
@@ -0,0 +1,9 @@
1
+ /*!
2
+ * Bootstrap Colorpicker
3
+ * http://mjolnic.github.io/bootstrap-colorpicker/
4
+ *
5
+ * Originally written by (c) 2012 Stefan Petre
6
+ * Licensed under the Apache License v2.0
7
+ * http://www.apache.org/licenses/LICENSE-2.0.txt
8
+ *
9
+ */.colorpicker-saturation{float:left;width:100px;height:100px;cursor:crosshair;background-image:image-url("locomotive/bootstrap-colorpicker/saturation.png")}.colorpicker-saturation i{position:absolute;top:0;left:0;display:block;width:5px;height:5px;margin:-4px 0 0 -4px;border:1px solid #000;-webkit-border-radius:5px;-moz-border-radius:5px;border-radius:5px}.colorpicker-saturation i b{display:block;width:5px;height:5px;border:1px solid #fff;-webkit-border-radius:5px;-moz-border-radius:5px;border-radius:5px}.colorpicker-hue,.colorpicker-alpha{float:left;width:15px;height:100px;margin-bottom:4px;margin-left:4px;cursor:row-resize}.colorpicker-hue i,.colorpicker-alpha i{position:absolute;top:0;left:0;display:block;width:100%;height:1px;margin-top:-1px;background:#000;border-top:1px solid #fff}.colorpicker-hue{background-image:image-url("locomotive/bootstrap-colorpicker/hue.png")}.colorpicker-alpha{display:none;background-image:image-url("locomotive/bootstrap-colorpicker/alpha.png")}.colorpicker-saturation,.colorpicker-hue,.colorpicker-alpha{background-size:contain}.colorpicker{top:0;left:0;z-index:2500;min-width:130px;padding:4px;margin-top:1px;-webkit-border-radius:4px;-moz-border-radius:4px;border-radius:4px;*zoom:1}.colorpicker:before,.colorpicker:after{display:table;line-height:0;content:""}.colorpicker:after{clear:both}.colorpicker:before{position:absolute;top:-7px;left:6px;display:inline-block;border-right:7px solid transparent;border-bottom:7px solid #ccc;border-left:7px solid transparent;border-bottom-color:rgba(0,0,0,0.2);content:''}.colorpicker:after{position:absolute;top:-6px;left:7px;display:inline-block;border-right:6px solid transparent;border-bottom:6px solid #fff;border-left:6px solid transparent;content:''}.colorpicker div{position:relative}.colorpicker.colorpicker-with-alpha{min-width:140px}.colorpicker.colorpicker-with-alpha .colorpicker-alpha{display:block}.colorpicker-color{height:10px;margin-top:5px;clear:both;background-image:image-url("locomotive/bootstrap-colorpicker/alpha.png");background-position:0 100%}.colorpicker-color div{height:10px}.colorpicker-selectors{display:none;height:10px;margin-top:5px;clear:both}.colorpicker-selectors i{float:left;width:10px;height:10px;cursor:pointer}.colorpicker-selectors i+i{margin-left:3px}.colorpicker-element .input-group-addon i,.colorpicker-element .add-on i{display:inline-block;width:16px;height:16px;vertical-align:text-top;cursor:pointer}.colorpicker.colorpicker-inline{position:relative;z-index:auto;display:inline-block;float:none}.colorpicker.colorpicker-horizontal{width:110px;height:auto;min-width:110px}.colorpicker.colorpicker-horizontal .colorpicker-saturation{margin-bottom:4px}.colorpicker.colorpicker-horizontal .colorpicker-color{width:100px}.colorpicker.colorpicker-horizontal .colorpicker-hue,.colorpicker.colorpicker-horizontal .colorpicker-alpha{float:left;width:100px;height:15px;margin-bottom:4px;margin-left:0;cursor:col-resize}.colorpicker.colorpicker-horizontal .colorpicker-hue i,.colorpicker.colorpicker-horizontal .colorpicker-alpha i{position:absolute;top:0;left:0;display:block;width:1px;height:15px;margin-top:0;background:#fff;border:0}.colorpicker.colorpicker-horizontal .colorpicker-hue{background-image:image-url("locomotive/bootstrap-colorpicker/hue-horizontal.png")}.colorpicker.colorpicker-horizontal .colorpicker-alpha{background-image:image-url("locomotive/bootstrap-colorpicker/alpha-horizontal.png")}.colorpicker.colorpicker-hidden{display:none}.colorpicker.colorpicker-visible{display:block}.colorpicker-inline.colorpicker-visible{display:inline-block}.colorpicker-right:before{right:6px;left:auto}.colorpicker-right:after{right:7px;left:auto}
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: locomotivecms
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.0.pre.beta.1
4
+ version: 3.0.0.rc1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Didier Lafforgue
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-08-31 00:00:00.000000000 Z
11
+ date: 2015-10-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
@@ -128,14 +128,14 @@ dependencies:
128
128
  requirements:
129
129
  - - "~>"
130
130
  - !ruby/object:Gem::Version
131
- version: 2.0.0
131
+ version: 2.0.1
132
132
  type: :runtime
133
133
  prerelease: false
134
134
  version_requirements: !ruby/object:Gem::Requirement
135
135
  requirements:
136
136
  - - "~>"
137
137
  - !ruby/object:Gem::Version
138
- version: 2.0.0
138
+ version: 2.0.1
139
139
  - !ruby/object:Gem::Dependency
140
140
  name: mongo_session_store-rails4
141
141
  requirement: !ruby/object:Gem::Requirement
@@ -170,28 +170,28 @@ dependencies:
170
170
  requirements:
171
171
  - - "~>"
172
172
  - !ruby/object:Gem::Version
173
- version: 2.4.0.rc3
173
+ version: 2.4.0.rc5
174
174
  type: :runtime
175
175
  prerelease: false
176
176
  version_requirements: !ruby/object:Gem::Requirement
177
177
  requirements:
178
178
  - - "~>"
179
179
  - !ruby/object:Gem::Version
180
- version: 2.4.0.rc3
180
+ version: 2.4.0.rc5
181
181
  - !ruby/object:Gem::Dependency
182
182
  name: locomotivecms_steam
183
183
  requirement: !ruby/object:Gem::Requirement
184
184
  requirements:
185
185
  - - "~>"
186
186
  - !ruby/object:Gem::Version
187
- version: 1.0.0.pre.beta.3
187
+ version: 1.0.0.rc1
188
188
  type: :runtime
189
189
  prerelease: false
190
190
  version_requirements: !ruby/object:Gem::Requirement
191
191
  requirements:
192
192
  - - "~>"
193
193
  - !ruby/object:Gem::Version
194
- version: 1.0.0.pre.beta.3
194
+ version: 1.0.0.rc1
195
195
  - !ruby/object:Gem::Dependency
196
196
  name: slim
197
197
  requirement: !ruby/object:Gem::Requirement
@@ -212,14 +212,14 @@ dependencies:
212
212
  requirements:
213
213
  - - "~>"
214
214
  - !ruby/object:Gem::Version
215
- version: 3.1.0
215
+ version: 3.2.0
216
216
  type: :runtime
217
217
  prerelease: false
218
218
  version_requirements: !ruby/object:Gem::Requirement
219
219
  requirements:
220
220
  - - "~>"
221
221
  - !ruby/object:Gem::Version
222
- version: 3.1.0
222
+ version: 3.2.0
223
223
  - !ruby/object:Gem::Dependency
224
224
  name: kaminari
225
225
  requirement: !ruby/object:Gem::Requirement
@@ -310,14 +310,14 @@ dependencies:
310
310
  requirements:
311
311
  - - "~>"
312
312
  - !ruby/object:Gem::Version
313
- version: '5.0'
313
+ version: '5.6'
314
314
  type: :runtime
315
315
  prerelease: false
316
316
  version_requirements: !ruby/object:Gem::Requirement
317
317
  requirements:
318
318
  - - "~>"
319
319
  - !ruby/object:Gem::Version
320
- version: '5.0'
320
+ version: '5.6'
321
321
  - !ruby/object:Gem::Dependency
322
322
  name: flash_cookie_session
323
323
  requirement: !ruby/object:Gem::Requirement
@@ -380,28 +380,28 @@ dependencies:
380
380
  requirements:
381
381
  - - "~>"
382
382
  - !ruby/object:Gem::Version
383
- version: 5.2.0
383
+ version: 6.0.3
384
384
  type: :runtime
385
385
  prerelease: false
386
386
  version_requirements: !ruby/object:Gem::Requirement
387
387
  requirements:
388
388
  - - "~>"
389
389
  - !ruby/object:Gem::Version
390
- version: 5.2.0
390
+ version: 6.0.3
391
391
  - !ruby/object:Gem::Dependency
392
392
  name: font-awesome-sass
393
393
  requirement: !ruby/object:Gem::Requirement
394
394
  requirements:
395
395
  - - "~>"
396
396
  - !ruby/object:Gem::Version
397
- version: 4.3.2.1
397
+ version: 4.4.0
398
398
  type: :runtime
399
399
  prerelease: false
400
400
  version_requirements: !ruby/object:Gem::Requirement
401
401
  requirements:
402
402
  - - "~>"
403
403
  - !ruby/object:Gem::Version
404
- version: 4.3.2.1
404
+ version: 4.4.0
405
405
  - !ruby/object:Gem::Dependency
406
406
  name: nprogress-rails
407
407
  requirement: !ruby/object:Gem::Requirement
@@ -464,28 +464,28 @@ dependencies:
464
464
  requirements:
465
465
  - - "~>"
466
466
  - !ruby/object:Gem::Version
467
- version: '0.7'
467
+ version: 0.7.1
468
468
  type: :runtime
469
469
  prerelease: false
470
470
  version_requirements: !ruby/object:Gem::Requirement
471
471
  requirements:
472
472
  - - "~>"
473
473
  - !ruby/object:Gem::Version
474
- version: '0.7'
474
+ version: 0.7.1
475
475
  - !ruby/object:Gem::Dependency
476
476
  name: fog
477
477
  requirement: !ruby/object:Gem::Requirement
478
478
  requirements:
479
479
  - - "~>"
480
480
  - !ruby/object:Gem::Version
481
- version: 1.32.0
481
+ version: 1.34.0
482
482
  type: :runtime
483
483
  prerelease: false
484
484
  version_requirements: !ruby/object:Gem::Requirement
485
485
  requirements:
486
486
  - - "~>"
487
487
  - !ruby/object:Gem::Version
488
- version: 1.32.0
488
+ version: 1.34.0
489
489
  - !ruby/object:Gem::Dependency
490
490
  name: dragonfly
491
491
  requirement: !ruby/object:Gem::Requirement
@@ -642,6 +642,7 @@ files:
642
642
  - app/api/locomotive/api/forms/theme_asset_form.rb
643
643
  - app/api/locomotive/api/forms/translation_form.rb
644
644
  - app/api/locomotive/api/helpers/authentication_helper.rb
645
+ - app/api/locomotive/api/helpers/locales_helper.rb
645
646
  - app/api/locomotive/api/helpers/pagination_helper.rb
646
647
  - app/api/locomotive/api/helpers/params_helper.rb
647
648
  - app/api/locomotive/api/helpers/persistence_helper.rb
@@ -717,6 +718,7 @@ files:
717
718
  - app/assets/javascripts/locomotive/views/inputs/array_view.js.coffee
718
719
  - app/assets/javascripts/locomotive/views/inputs/document_picker_view.js.coffee
719
720
  - app/assets/javascripts/locomotive/views/inputs/file_view.js.coffee
721
+ - app/assets/javascripts/locomotive/views/inputs/markdown_view.js.coffee
720
722
  - app/assets/javascripts/locomotive/views/inputs/rte/file_view.js.coffee
721
723
  - app/assets/javascripts/locomotive/views/inputs/rte/link_view.js.coffee
722
724
  - app/assets/javascripts/locomotive/views/inputs/rte_view.js.coffee.erb
@@ -749,10 +751,12 @@ files:
749
751
  - app/assets/stylesheets/locomotive/base/form/_array_input.scss
750
752
  - app/assets/stylesheets/locomotive/base/form/_base.scss
751
753
  - app/assets/stylesheets/locomotive/base/form/_code.scss
754
+ - app/assets/stylesheets/locomotive/base/form/_color_input.scss
752
755
  - app/assets/stylesheets/locomotive/base/form/_date.scss
753
756
  - app/assets/stylesheets/locomotive/base/form/_document_picker.scss
754
757
  - app/assets/stylesheets/locomotive/base/form/_file_input.scss
755
758
  - app/assets/stylesheets/locomotive/base/form/_link.scss
759
+ - app/assets/stylesheets/locomotive/base/form/_markdown.scss
756
760
  - app/assets/stylesheets/locomotive/base/form/_popover.scss
757
761
  - app/assets/stylesheets/locomotive/base/form/_rte.scss
758
762
  - app/assets/stylesheets/locomotive/base/form/_select2.scss
@@ -764,6 +768,7 @@ files:
764
768
  - app/assets/stylesheets/locomotive/base/not_logged_in/_typography.scss
765
769
  - app/assets/stylesheets/locomotive/components/_activity_feed.scss
766
770
  - app/assets/stylesheets/locomotive/components/_content_assets.scss
771
+ - app/assets/stylesheets/locomotive/components/_dashboard.scss
767
772
  - app/assets/stylesheets/locomotive/components/_developers.scss
768
773
  - app/assets/stylesheets/locomotive/components/_drawer.scss
769
774
  - app/assets/stylesheets/locomotive/components/_error.scss
@@ -802,21 +807,6 @@ files:
802
807
  - app/assets/stylesheets/locomotive/layouts/_responsive.scss
803
808
  - app/assets/stylesheets/locomotive/not_logged_in.scss
804
809
  - app/controllers/locomotive/accounts_controller.rb
805
- - app/controllers/locomotive/api/accounts_controller.rb
806
- - app/controllers/locomotive/api/base_controller.rb
807
- - app/controllers/locomotive/api/content_assets_controller.rb
808
- - app/controllers/locomotive/api/content_entries_controller.rb
809
- - app/controllers/locomotive/api/content_types_controller.rb
810
- - app/controllers/locomotive/api/current_site_controller.rb
811
- - app/controllers/locomotive/api/memberships_controller.rb
812
- - app/controllers/locomotive/api/my_account_controller.rb
813
- - app/controllers/locomotive/api/pages_controller.rb
814
- - app/controllers/locomotive/api/sites_controller.rb
815
- - app/controllers/locomotive/api/snippets_controller.rb
816
- - app/controllers/locomotive/api/theme_assets_controller.rb
817
- - app/controllers/locomotive/api/tokens_controller.rb
818
- - app/controllers/locomotive/api/translations_controller.rb
819
- - app/controllers/locomotive/api/version_controller.rb
820
810
  - app/controllers/locomotive/base_controller.rb
821
811
  - app/controllers/locomotive/concerns/account_controller.rb
822
812
  - app/controllers/locomotive/concerns/authorization_controller.rb
@@ -868,10 +858,12 @@ files:
868
858
  - app/inputs/locomotive/api_key_input.rb
869
859
  - app/inputs/locomotive/array_input.rb
870
860
  - app/inputs/locomotive/code_input.rb
861
+ - app/inputs/locomotive/color_input.rb
871
862
  - app/inputs/locomotive/document_picker_input.rb
872
863
  - app/inputs/locomotive/editable_select_input.rb
873
864
  - app/inputs/locomotive/file_input.rb
874
865
  - app/inputs/locomotive/locales_input.rb
866
+ - app/inputs/locomotive/markdown_input.rb
875
867
  - app/inputs/locomotive/rte_input.rb
876
868
  - app/inputs/locomotive/toggle_input.rb
877
869
  - app/mailers/locomotive/devise_mailer.rb
@@ -885,6 +877,7 @@ files:
885
877
  - app/models/locomotive/concerns/asset/vignette.rb
886
878
  - app/models/locomotive/concerns/content_entry/counter.rb
887
879
  - app/models/locomotive/concerns/content_entry/csv.rb
880
+ - app/models/locomotive/concerns/content_entry/file_size.rb
888
881
  - app/models/locomotive/concerns/content_entry/localized.rb
889
882
  - app/models/locomotive/concerns/content_entry/next_previous.rb
890
883
  - app/models/locomotive/concerns/content_entry/slug.rb
@@ -903,11 +896,14 @@ files:
903
896
  - app/models/locomotive/concerns/page/templatized.rb
904
897
  - app/models/locomotive/concerns/page/tree.rb
905
898
  - app/models/locomotive/concerns/shared/seo.rb
899
+ - app/models/locomotive/concerns/shared/site_scope.rb
906
900
  - app/models/locomotive/concerns/shared/slug.rb
907
901
  - app/models/locomotive/concerns/shared/userstamp.rb
908
902
  - app/models/locomotive/concerns/site/access_points.rb
903
+ - app/models/locomotive/concerns/site/cache.rb
909
904
  - app/models/locomotive/concerns/site/locales.rb
910
905
  - app/models/locomotive/concerns/site/timezone.rb
906
+ - app/models/locomotive/concerns/theme_asset/plain_text.rb
911
907
  - app/models/locomotive/content_asset.rb
912
908
  - app/models/locomotive/content_entry.rb
913
909
  - app/models/locomotive/content_type.rb
@@ -983,6 +979,8 @@ files:
983
979
  - app/views/locomotive/current_site/form/_tabs.html.slim
984
980
  - app/views/locomotive/custom_fields/select_options/_option.html.slim
985
981
  - app/views/locomotive/custom_fields/select_options/edit.html.slim
982
+ - app/views/locomotive/dashboard/_activity.html.slim
983
+ - app/views/locomotive/dashboard/_url.html.slim
986
984
  - app/views/locomotive/dashboard/show.html.slim
987
985
  - app/views/locomotive/developers_documentation/_api.html.slim
988
986
  - app/views/locomotive/developers_documentation/_wagon.html.slim
@@ -1010,6 +1008,7 @@ files:
1010
1008
  - app/views/locomotive/my_account/form/_panes.html.slim
1011
1009
  - app/views/locomotive/my_account/form/_tabs.html.slim
1012
1010
  - app/views/locomotive/notifications/new_content_entry.html.slim
1011
+ - app/views/locomotive/pages/_header.html.slim
1013
1012
  - app/views/locomotive/pages/edit.html.slim
1014
1013
  - app/views/locomotive/pages/form/_actions.html.slim
1015
1014
  - app/views/locomotive/pages/form/_main.html.slim
@@ -1042,6 +1041,7 @@ files:
1042
1041
  - app/views/locomotive/shared/header/_site.html.slim
1043
1042
  - app/views/locomotive/shared/rte/_image_popover.html.slim
1044
1043
  - app/views/locomotive/shared/rte/_link_popover.html.slim
1044
+ - app/views/locomotive/shared/rte/_markdown_toolbar.html.slim
1045
1045
  - app/views/locomotive/shared/rte/_toolbar.html.slim
1046
1046
  - app/views/locomotive/shared/sidebar/_content_types.html.slim
1047
1047
  - app/views/locomotive/shared/sidebar/_link.html.slim
@@ -1283,9 +1283,11 @@ files:
1283
1283
  - lib/locomotive/regexps.rb
1284
1284
  - lib/locomotive/simple_form.rb
1285
1285
  - lib/locomotive/simple_token_authentication.rb
1286
+ - lib/locomotive/steam/middlewares/cache.rb
1286
1287
  - lib/locomotive/steam/middlewares/missing_translations.rb
1287
1288
  - lib/locomotive/steam/middlewares/page_editing.rb
1288
1289
  - lib/locomotive/steam/services/api_entry_submission_service.rb
1290
+ - lib/locomotive/steam/services/liquid_parser_with_cache_service.rb
1289
1291
  - lib/locomotive/steam_adaptor.rb
1290
1292
  - lib/locomotive/version.rb
1291
1293
  - lib/locomotivecms.rb
@@ -1346,35 +1348,38 @@ files:
1346
1348
  - spec/lib/core_ext_spec.rb
1347
1349
  - spec/lib/locomotive/configuration_spec.rb
1348
1350
  - spec/lib/locomotive/steam/services/api_entry_submission_service_spec.rb
1351
+ - spec/lib/locomotive/steam/services/liquid_parser_with_cache_service_spec.rb
1349
1352
  - spec/mailers/locomotive/notifications_spec.rb
1350
1353
  - spec/models/locomotive/account_spec.rb
1351
1354
  - spec/models/locomotive/concerns/content_entry/counter_spec.rb
1352
1355
  - spec/models/locomotive/concerns/content_entry/csv_spec.rb
1356
+ - spec/models/locomotive/concerns/content_entry/file_size_spec.rb
1353
1357
  - spec/models/locomotive/concerns/content_type/entry_template_spec.rb
1354
1358
  - spec/models/locomotive/concerns/page/editable_elements_spec.rb
1355
1359
  - spec/models/locomotive/concerns/page/layout_spec.rb
1356
1360
  - spec/models/locomotive/concerns/page/redirect_spec.rb
1357
1361
  - spec/models/locomotive/concerns/page/render_spec.rb
1358
1362
  - spec/models/locomotive/concerns/site/access_points_spec.rb
1363
+ - spec/models/locomotive/concerns/site/cache_spec.rb
1359
1364
  - spec/models/locomotive/concerns/site/locales_spec.rb
1360
1365
  - spec/models/locomotive/content_asset_spec.rb
1361
1366
  - spec/models/locomotive/content_entry_spec.rb
1362
1367
  - spec/models/locomotive/content_type_spec.rb
1363
- - spec/models/locomotive/editable_control_spec.rb
1364
- - spec/models/locomotive/editable_file_spec.rb
1365
- - spec/models/locomotive/editable_text_spec.rb
1366
1368
  - spec/models/locomotive/membership_spec.rb
1367
1369
  - spec/models/locomotive/page_spec.rb
1368
1370
  - spec/models/locomotive/site_spec.rb
1369
1371
  - spec/models/locomotive/snippet_spec.rb
1370
1372
  - spec/models/locomotive/theme_asset_spec.rb
1373
+ - spec/models/locomotive/translation_spec.rb
1371
1374
  - spec/requests/admin_ssl_spec.rb
1375
+ - spec/requests/locomotive/steam/cache_spec.rb
1372
1376
  - spec/requests/site_spec.rb
1373
1377
  - spec/support/capybara.rb
1374
1378
  - spec/support/carrierwave.rb
1375
1379
  - spec/support/entity.rb
1376
1380
  - spec/support/factories.rb
1377
1381
  - spec/support/features/session_helpers.rb
1382
+ - spec/support/features/site_helpers.rb
1378
1383
  - spec/support/locomotive.rb
1379
1384
  - spec/support/matchers.rb
1380
1385
  - spec/support/middlewares.rb
@@ -1383,9 +1388,13 @@ files:
1383
1388
  - spec/support/sequences.rb
1384
1389
  - spec/support/shared_contexts/api_header_setup.rb
1385
1390
  - spec/support/shared_contexts/api_site_setup.rb
1386
- - vendor/assets/images/select2-spinner.gif
1387
- - vendor/assets/images/select2.png
1388
- - vendor/assets/images/select2x2.png
1391
+ - spec/support/shared_examples/site_scope_examples.rb
1392
+ - vendor/assets/images/locomotive/bootstrap-colorpicker/alpha-horizontal.png
1393
+ - vendor/assets/images/locomotive/bootstrap-colorpicker/alpha.png
1394
+ - vendor/assets/images/locomotive/bootstrap-colorpicker/hue-horizontal.png
1395
+ - vendor/assets/images/locomotive/bootstrap-colorpicker/hue.png
1396
+ - vendor/assets/images/locomotive/bootstrap-colorpicker/saturation.png
1397
+ - vendor/assets/javascripts/locomotive/bootstrap-colorpicker.js
1389
1398
  - vendor/assets/javascripts/locomotive/bootstrap-datetimepicker.js
1390
1399
  - vendor/assets/javascripts/locomotive/bootstrap-notify.js
1391
1400
  - vendor/assets/javascripts/locomotive/bootstrap-switch.js
@@ -1398,6 +1407,7 @@ files:
1398
1407
  - vendor/assets/javascripts/locomotive/highlight.pack.js
1399
1408
  - vendor/assets/javascripts/locomotive/history.js
1400
1409
  - vendor/assets/javascripts/locomotive/jquery-ui-timepicker-addon.js
1410
+ - vendor/assets/javascripts/locomotive/kramed.min.js
1401
1411
  - vendor/assets/javascripts/locomotive/liquid_mode.js
1402
1412
  - vendor/assets/javascripts/locomotive/moment.js
1403
1413
  - vendor/assets/javascripts/locomotive/resize.js
@@ -1407,6 +1417,7 @@ files:
1407
1417
  - vendor/assets/javascripts/locomotive/wysihtml5/parser_rules/advanced.js
1408
1418
  - vendor/assets/javascripts/locomotive/wysihtml5/parser_rules/advanced_unwrap.js
1409
1419
  - vendor/assets/javascripts/locomotive/wysihtml5x-toolbar.js
1420
+ - vendor/assets/stylesheets/locomotive/bootstrap-colorpicker.scss
1410
1421
  - vendor/assets/stylesheets/locomotive/bootstrap-datetimepicker.css
1411
1422
  - vendor/assets/stylesheets/locomotive/bootstrap-switch.css
1412
1423
  - vendor/assets/stylesheets/locomotive/bootstrap-tagsinput.css
@@ -1559,35 +1570,38 @@ test_files:
1559
1570
  - spec/lib/core_ext_spec.rb
1560
1571
  - spec/lib/locomotive/configuration_spec.rb
1561
1572
  - spec/lib/locomotive/steam/services/api_entry_submission_service_spec.rb
1573
+ - spec/lib/locomotive/steam/services/liquid_parser_with_cache_service_spec.rb
1562
1574
  - spec/mailers/locomotive/notifications_spec.rb
1563
1575
  - spec/models/locomotive/account_spec.rb
1564
1576
  - spec/models/locomotive/concerns/content_entry/counter_spec.rb
1565
1577
  - spec/models/locomotive/concerns/content_entry/csv_spec.rb
1578
+ - spec/models/locomotive/concerns/content_entry/file_size_spec.rb
1566
1579
  - spec/models/locomotive/concerns/content_type/entry_template_spec.rb
1567
1580
  - spec/models/locomotive/concerns/page/editable_elements_spec.rb
1568
1581
  - spec/models/locomotive/concerns/page/layout_spec.rb
1569
1582
  - spec/models/locomotive/concerns/page/redirect_spec.rb
1570
1583
  - spec/models/locomotive/concerns/page/render_spec.rb
1571
1584
  - spec/models/locomotive/concerns/site/access_points_spec.rb
1585
+ - spec/models/locomotive/concerns/site/cache_spec.rb
1572
1586
  - spec/models/locomotive/concerns/site/locales_spec.rb
1573
1587
  - spec/models/locomotive/content_asset_spec.rb
1574
1588
  - spec/models/locomotive/content_entry_spec.rb
1575
1589
  - spec/models/locomotive/content_type_spec.rb
1576
- - spec/models/locomotive/editable_control_spec.rb
1577
- - spec/models/locomotive/editable_file_spec.rb
1578
- - spec/models/locomotive/editable_text_spec.rb
1579
1590
  - spec/models/locomotive/membership_spec.rb
1580
1591
  - spec/models/locomotive/page_spec.rb
1581
1592
  - spec/models/locomotive/site_spec.rb
1582
1593
  - spec/models/locomotive/snippet_spec.rb
1583
1594
  - spec/models/locomotive/theme_asset_spec.rb
1595
+ - spec/models/locomotive/translation_spec.rb
1584
1596
  - spec/requests/admin_ssl_spec.rb
1597
+ - spec/requests/locomotive/steam/cache_spec.rb
1585
1598
  - spec/requests/site_spec.rb
1586
1599
  - spec/support/capybara.rb
1587
1600
  - spec/support/carrierwave.rb
1588
1601
  - spec/support/entity.rb
1589
1602
  - spec/support/factories.rb
1590
1603
  - spec/support/features/session_helpers.rb
1604
+ - spec/support/features/site_helpers.rb
1591
1605
  - spec/support/locomotive.rb
1592
1606
  - spec/support/matchers.rb
1593
1607
  - spec/support/middlewares.rb
@@ -1596,6 +1610,7 @@ test_files:
1596
1610
  - spec/support/sequences.rb
1597
1611
  - spec/support/shared_contexts/api_header_setup.rb
1598
1612
  - spec/support/shared_contexts/api_site_setup.rb
1613
+ - spec/support/shared_examples/site_scope_examples.rb
1599
1614
  - spec/dummy/Rakefile
1600
1615
  - spec/dummy/config.ru
1601
1616
  - spec/dummy/app/assets/javascripts/application.js