pageflow 15.3.0 → 15.4.0

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of pageflow might be problematic. Click here for more details.

Files changed (87) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +158 -353
  3. data/README.md +2 -3
  4. data/app/assets/javascripts/pageflow/dist/ui.js +99 -32
  5. data/app/assets/javascripts/pageflow/vendor.js +0 -1
  6. data/app/assets/stylesheets/pageflow/editor/base.scss +3 -2
  7. data/app/assets/stylesheets/pageflow/editor/drop_down_button.scss +1 -1
  8. data/app/assets/stylesheets/pageflow/editor/select_button.scss +1 -1
  9. data/app/assets/stylesheets/pageflow/editor/sidebar_footer.scss +1 -1
  10. data/app/assets/stylesheets/pageflow/entries.scss +1 -1
  11. data/app/assets/stylesheets/pageflow/loading_spinner.scss +4 -1
  12. data/app/assets/stylesheets/pageflow/navigation_mobile.scss +4 -4
  13. data/app/assets/stylesheets/pageflow/themes/default/anchors.scss +1 -1
  14. data/app/assets/stylesheets/pageflow/themes/default/logo/variant/watermark.scss +1 -1
  15. data/app/assets/stylesheets/pageflow/themes/default/page/anchors.scss +1 -1
  16. data/app/assets/stylesheets/pageflow/themes/default/player_controls/classic/control_bar.scss +1 -1
  17. data/app/assets/stylesheets/pageflow/themes/default/player_controls/classic/info_box.scss +1 -1
  18. data/app/assets/stylesheets/pageflow/themes/default/player_controls/shared/menu_bar.scss +2 -2
  19. data/app/assets/stylesheets/pageflow/themes/default/player_controls/slim/control_bar.scss +2 -2
  20. data/app/assets/stylesheets/pageflow/themes/default/player_controls/slim/info_box.scss +1 -1
  21. data/app/assets/stylesheets/pageflow/themes/default/player_controls/slim/quality_menu.scss +2 -2
  22. data/app/assets/stylesheets/pageflow/themes/default/player_controls/waveform/wave.scss +1 -1
  23. data/app/assets/stylesheets/pageflow/ui/forms.scss +9 -2
  24. data/app/assets/stylesheets/pageflow/ui/input/extended_select_input.scss +2 -2
  25. data/app/models/pageflow/account_role_query.rb +1 -1
  26. data/app/models/pageflow/managed_user_query.rb +1 -1
  27. data/app/policies/pageflow/folder_policy.rb +2 -2
  28. data/app/policies/pageflow/membership_policy.rb +2 -2
  29. data/app/policies/pageflow/theming_policy.rb +2 -2
  30. data/app/policies/pageflow/user_policy.rb +1 -1
  31. data/app/views/pageflow/video_files/_video_file.json.jbuilder +8 -1
  32. data/entry_types/paged/app/assets/javascripts/pageflow_paged/dist/editor.js +103 -36
  33. data/entry_types/paged/app/assets/javascripts/pageflow_paged/dist/frontend.js +42 -15
  34. data/entry_types/paged/app/assets/javascripts/pageflow_paged/vendor.js +1 -0
  35. data/entry_types/paged/app/assets/javascripts/pageflow_paged/videojs.js +6 -0
  36. data/entry_types/paged/app/views/layouts/pageflow_paged/_loading_spinner_inline_script.html.erb +1 -0
  37. data/entry_types/paged/app/views/layouts/pageflow_paged/application.html.erb +1 -1
  38. data/entry_types/paged/app/views/pageflow_paged/editor/entries/_head.html.erb +2 -0
  39. data/entry_types/paged/lib/tasks/pageflow_paged_tasks.rake +7 -0
  40. data/{vendor/assets/javascripts → entry_types/paged/vendor/assets/javascripts/pageflow_paged/vendor}/dash.all.min.js +0 -0
  41. data/{vendor/assets/javascripts → entry_types/paged/vendor/assets/javascripts/pageflow_paged/vendor}/videojs-dash.js +0 -0
  42. data/{vendor/assets/javascripts → entry_types/paged/vendor/assets/javascripts/pageflow_paged/vendor}/videojs.js +0 -0
  43. data/entry_types/scrolled/app/controllers/pageflow_scrolled/entries_controller.rb +2 -0
  44. data/entry_types/scrolled/app/helpers/pageflow_scrolled/editor/seed_html_helper.rb +1 -0
  45. data/entry_types/scrolled/app/helpers/pageflow_scrolled/favicon_helper.rb +21 -0
  46. data/entry_types/scrolled/app/helpers/pageflow_scrolled/react_server_side_rendering_helper.rb +12 -5
  47. data/entry_types/scrolled/app/views/pageflow_scrolled/entries/show.html.erb +5 -7
  48. data/entry_types/scrolled/app/views/pageflow_scrolled/entry_json_seed/_theme.json.jbuilder +1 -0
  49. data/entry_types/scrolled/app/views/pageflow_scrolled/favicons/_entry.html.erb +10 -0
  50. data/entry_types/scrolled/config/locales/de.yml +655 -0
  51. data/entry_types/scrolled/config/locales/en.yml +522 -0
  52. data/entry_types/scrolled/lib/generators/pageflow_scrolled/install/install_generator.rb +5 -0
  53. data/entry_types/scrolled/lib/generators/pageflow_scrolled/install/templates/theme/favicons/android-chrome-192x192.png +0 -0
  54. data/entry_types/scrolled/lib/generators/pageflow_scrolled/install/templates/theme/favicons/android-chrome-512x512.png +0 -0
  55. data/entry_types/scrolled/lib/generators/pageflow_scrolled/install/templates/theme/favicons/apple-touch-icon.png +0 -0
  56. data/entry_types/scrolled/lib/generators/pageflow_scrolled/install/templates/theme/favicons/browserconfig.xml +9 -0
  57. data/entry_types/scrolled/lib/generators/pageflow_scrolled/install/templates/theme/favicons/favicon-16x16.png +0 -0
  58. data/entry_types/scrolled/lib/generators/pageflow_scrolled/install/templates/theme/favicons/favicon-32x32.png +0 -0
  59. data/entry_types/scrolled/lib/generators/pageflow_scrolled/install/templates/theme/favicons/favicon.ico +0 -0
  60. data/entry_types/scrolled/lib/generators/pageflow_scrolled/install/templates/theme/favicons/mstile-150x150.png +0 -0
  61. data/entry_types/scrolled/lib/generators/pageflow_scrolled/install/templates/theme/favicons/safari-pinned-tab.svg +46 -0
  62. data/entry_types/scrolled/lib/generators/pageflow_scrolled/install/templates/theme/favicons/site.webmanifest +19 -0
  63. data/entry_types/scrolled/lib/generators/pageflow_scrolled/install/templates/theme/unmute.mp3 +0 -0
  64. data/entry_types/scrolled/lib/tasks/pageflow_scrolled_tasks.rake +1 -0
  65. data/entry_types/scrolled/package/contentElements-editor.js +14 -1
  66. data/entry_types/scrolled/package/contentElements-frontend.css +1 -1
  67. data/entry_types/scrolled/package/contentElements-frontend.js +338 -104
  68. data/entry_types/scrolled/package/editor.js +594 -242
  69. data/entry_types/scrolled/package/frontend/{EditableText-4264c349.js → EditableText-43c50894.js} +331 -163
  70. data/entry_types/scrolled/package/frontend/{Wavesurfer-c3c45324.js → Wavesurfer-b88b02e0.js} +0 -3
  71. data/entry_types/scrolled/package/frontend/{components-cfe6a479.js → components-3ead1b4a.js} +509 -91
  72. data/entry_types/scrolled/package/frontend/index.css +2 -2
  73. data/entry_types/scrolled/package/frontend/index.js +2107 -1025
  74. data/entry_types/scrolled/package/package.json +15 -3
  75. data/lib/generators/pageflow/initializer/templates/pageflow.rb +2 -1
  76. data/lib/pageflow/engine.rb +0 -1
  77. data/lib/pageflow/themes.rb +4 -0
  78. data/lib/pageflow/version.rb +1 -1
  79. data/package/config/jest/index.js +7 -2
  80. data/package/config/webpack.js +1 -2
  81. data/package/editor.js +4 -4
  82. data/package/frontend.js +30 -13
  83. data/package/ui.js +99 -32
  84. metadata +25 -11
  85. data/app/assets/javascripts/pageflow/videojs.js +0 -6
  86. data/entry_types/scrolled/config/locales/new/de.yml +0 -601
  87. data/entry_types/scrolled/config/locales/new/en.yml +0 -507
@@ -11,18 +11,30 @@
11
11
  "debounce": "^1.2.0",
12
12
  "deep-assign": "^3.0.0",
13
13
  "intersection-observer": "^0.7.0",
14
+ "invert-color": "^2.0.0",
14
15
  "prop-types": "^15.7.2",
15
16
  "react-compare-image": "https://github.com/codevise/react-compare-image#offset-width-fix",
17
+ "react-dnd": "^11.1.3",
18
+ "react-dnd-html5-backend": "^11.1.3",
16
19
  "react-draggable": "^4.4.2",
17
20
  "react-measure": "^2.3.0",
18
21
  "react-player": "^1.15.2",
19
22
  "react-tooltip": "^3.11.1",
20
23
  "react_ujs": "^2.6.1",
24
+ "reselect": "^4.0.0",
21
25
  "slate": "^0.57.3",
22
26
  "slate-react": "^0.57.3",
27
+ "slugify": "^1.4.6",
28
+ "striptags": "^3.1.1",
29
+ "use-context-selector": "^1.2.11",
30
+ "video.js": "6.2.7",
31
+ "videojs-contrib-dash": "2.11.0",
23
32
  "wavesurfer.js": "https://github.com/tf/wavesurfer.js#patches",
24
33
  "whatwg-fetch": "^3.0.0"
25
34
  },
35
+ "resolutions": {
36
+ "video.js": "6.2.7"
37
+ },
26
38
  "peerDependencies": {
27
39
  "pageflow": "15.1.0",
28
40
  "react": "^16.9.0",
@@ -57,8 +69,8 @@
57
69
  "scripts": {
58
70
  "test": "jest",
59
71
  "lint": "eslint .",
60
- "start-storybook": "start-storybook",
61
- "build-storybook": "build-storybook -o .storybook/out",
62
- "snapshot": "STORYBOOK_SPLIT=true build-storybook --quiet -o .storybook/out && PERCY_TOKEN=${PERCY_TOKEN:-$PT} percy-storybook --widths=1280 --build_dir=.storybook/out"
72
+ "start-storybook": "start-storybook -s .storybook/static",
73
+ "build-storybook": "build-storybook -s .storybook/static -o .storybook/out",
74
+ "snapshot": "STORYBOOK_SPLIT=true build-storybook --quiet -s .storybook/static -o .storybook/out && PERCY_TOKEN=${PERCY_TOKEN:-$PT} percy-storybook --widths=1280 --build_dir=.storybook/out"
63
75
  }
64
76
  }
@@ -25,7 +25,8 @@ Pageflow.configure do |config|
25
25
 
26
26
  config.for_entry_type(PageflowScrolled.entry_type) do |entry_type_config|
27
27
  entry_type_config.themes.register(:default,
28
- logo_alt_text: 'Pageflow')
28
+ logo_alt_text: 'Pageflow',
29
+ theme_color: '#ffffff')
29
30
  end
30
31
 
31
32
  # String to interpolate into paths of files generated by paperclip
@@ -118,7 +118,6 @@ module Pageflow
118
118
  pageflow/print_view.css
119
119
  pageflow/lt_ie9.js pageflow/lt_ie9.css pageflow/ie9.js pageflow/ie9.css
120
120
  pageflow/vendor.js
121
- pageflow/videojs
122
121
  pageflow/editor/vendor.js
123
122
  video-js.swf vjs.eot vjs.svg vjs.ttf vjs.woff
124
123
  )
@@ -36,6 +36,10 @@ module Pageflow
36
36
  # @option options :hide_logo_option [Boolean]
37
37
  # Pass true if hiding the logo on specific pages should be supported
38
38
  # as an option in the editor.
39
+ #
40
+ # @option options :logo_url [String]
41
+ # Pass logo url as string to turn the logo in navigation bar into a link.
42
+ #
39
43
  def register(name, options = {})
40
44
  @themes[name] = Theme.new(name, options)
41
45
  end
@@ -1,3 +1,3 @@
1
1
  module Pageflow
2
- VERSION = '15.3.0'.freeze
2
+ VERSION = '15.4.0'.freeze
3
3
  end
@@ -1,6 +1,12 @@
1
1
  const path = require('path');
2
2
 
3
3
  module.exports = {
4
+ globals: {
5
+ pageflow: {
6
+ config: {}
7
+ }
8
+ },
9
+
4
10
  moduleNameMapper: {
5
11
  '^jquery$': resolve('../../src/vendor/jquery'),
6
12
  '^jquery-ui$': resolve('../../src/vendor/jquery-ui'),
@@ -11,8 +17,7 @@ module.exports = {
11
17
  '^underscore$': resolve('../../src/vendor/underscore'),
12
18
  '^cocktail$': resolve('../../src/vendor/cocktail'),
13
19
  '^iscroll$': resolve('../../src/vendor/iscroll'),
14
- '^wysihtml5': resolve('../../spec/support/wysihtmlStub'),
15
- '^videojs$': resolve('../../../vendor/assets/javascripts/videojs')
20
+ '^wysihtml5': resolve('../../spec/support/wysihtmlStub')
16
21
  },
17
22
 
18
23
  transform: {
@@ -9,8 +9,7 @@ module.exports = {
9
9
  'underscore': '_',
10
10
  'backbone.marionette': 'Backbone.Marionette',
11
11
  'iscroll': 'IScroll',
12
- 'wysihtml5': 'wysihtml5',
13
- 'videojs': 'videojs',
12
+ 'wysihtml5': 'wysihtml5'
14
13
  },
15
14
  // Webpack's chunk loading code references `window` by default -
16
15
  // which is not available in server side rendering context.
@@ -1192,10 +1192,10 @@ var startEditor = function startEditor(options) {
1192
1192
  I18n$1.translations = window.I18n.translations;
1193
1193
  $(function () {
1194
1194
  editor.ensureBrowserSupport(function () {
1195
- $.when($.getJSON('/editor/entries/' + options.entryId + '/seed'), browser.detectFeatures()).done(function (result) {
1196
- app.start(result[0]);
1197
- }).fail(function () {
1198
- alert('Error while starting editor.');
1195
+ Promise.all([$.getJSON('/editor/entries/' + options.entryId + '/seed'), browser.detectFeatures()]).then(function (result) {
1196
+ return app.start(result[0]);
1197
+ }, function () {
1198
+ return alert('Error while starting editor.');
1199
1199
  });
1200
1200
  });
1201
1201
  });
@@ -14,7 +14,7 @@ import 'core-js/modules/esnext.promise.try';
14
14
  import 'core-js/modules/web.dom-collections.iterator';
15
15
  import 'classlist.js';
16
16
  import BackboneEvents from 'backbone-events-standalone';
17
- import VideoJS from 'videojs';
17
+ import VideoJS from 'video.js';
18
18
 
19
19
  var log = function log(text, options) {
20
20
  if (window.console && (debugMode() || options && options.force)) {
@@ -486,6 +486,9 @@ browser.feature('mp4 support only', function (has) {
486
486
  browser.feature('mse and native hls support', function (has) {
487
487
  return agent.matchesSafari() && !agent.matchesMobilePlatform();
488
488
  });
489
+ browser.feature('hls support', function (has) {
490
+ return agent.matchesSafari() || agent.matchesMobilePlatform();
491
+ });
489
492
  browser.feature('native video player', function (has) {
490
493
  return has('iphone platform');
491
494
  });
@@ -1540,6 +1543,10 @@ function _toConsumableArray(arr) {
1540
1543
  return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();
1541
1544
  }
1542
1545
 
1546
+ if (typeof window !== 'undefined') {
1547
+ window.VIDEOJS_NO_DYNAMIC_STYLE = true;
1548
+ }
1549
+
1543
1550
  var filterSources = function filterSources(playerElement) {
1544
1551
  if (playerElement.tagName.toLowerCase() !== 'video') {
1545
1552
  return playerElement;
@@ -1885,12 +1892,6 @@ var VideoPlayer = function VideoPlayer(element, options) {
1885
1892
  return player;
1886
1893
  };
1887
1894
 
1888
- if (VideoJS.Html5DashJS) {
1889
- VideoJS.Html5DashJS.hook('beforeinitialize', function (player, mediaPlayer) {
1890
- mediaPlayer.getDebug().setLogToBrowserConsole(false);
1891
- });
1892
- }
1893
-
1894
1895
  VideoPlayer.useSlimPlayerControlsDuringPhonePlayback = useSlimPlayerControlsDuringPhonePlayback;
1895
1896
  VideoPlayer.prebuffering = prebuffering;
1896
1897
  VideoPlayer.filterSources = filterSources;
@@ -1956,8 +1957,14 @@ var createMediaPlayer = function createMediaPlayer(options) {
1956
1957
  var BLANK_AUDIO_SRC = 'data:audio/wav;base64,UklGRjIAAABXQVZFZm10IBA' + 'AAAABAAEAIlY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1959
- 'audio': BLANK_AUDIO_SRC,
1960
- 'video': BLANK_VIDEO_SRC
1960
+ audio: {
1961
+ src: BLANK_AUDIO_SRC,
1962
+ type: 'audio/wav'
1963
+ },
1964
+ video: {
1965
+ src: BLANK_VIDEO_SRC,
1966
+ type: 'video/mp4'
1967
+ }
1961
1968
  };
1962
1969
 
1963
1970
  /** @const @enum {string} */
@@ -2009,7 +2016,8 @@ function () {
2009
2016
  _ref$loop = _ref.loop,
2010
2017
  loop = _ref$loop === void 0 ? false : _ref$loop,
2011
2018
  _ref$controls = _ref.controls,
2012
- controls = _ref$controls === void 0 ? false : _ref$controls;
2019
+ controls = _ref$controls === void 0 ? false : _ref$controls,
2020
+ altText = _ref.altText;
2013
2021
  var player = undefined;
2014
2022
 
2015
2023
  if (!this.unAllocatedPlayers[playerType]) {
@@ -2025,6 +2033,7 @@ function () {
2025
2033
  if (player) {
2026
2034
  player.pause();
2027
2035
  player.getMediaElement().loop = loop;
2036
+ player.getMediaElement().setAttribute('alt', altText);
2028
2037
  player.poster(poster);
2029
2038
  player.controls(controls);
2030
2039
 
@@ -2057,7 +2066,7 @@ function () {
2057
2066
  player.controls(false);
2058
2067
  player.getMediaElement().loop = false;
2059
2068
  player.playsinline(false);
2060
- player.getMediaElement().setAttribute('src', blankSources[type]);
2069
+ player.src(blankSources[type]);
2061
2070
  player.poster('');
2062
2071
  clearTextTracks(player);
2063
2072
  this.unAllocatedPlayers[type].push(player);
@@ -2128,7 +2137,7 @@ function () {
2128
2137
  mediaElement: mediaEl,
2129
2138
  tagName: type
2130
2139
  });
2131
- mediaEl.setAttribute('src', blankSources[type]);
2140
+ mediaEl.setAttribute('src', blankSources[type].src);
2132
2141
  this.unAllocatedPlayers[type].push(player);
2133
2142
  return player;
2134
2143
  }
@@ -2387,6 +2396,14 @@ var PlayerSourceIDMap = function PlayerSourceIDMap(media) {
2387
2396
  this[id] = sources;
2388
2397
  },
2389
2398
  get: function get(sourceID) {
2399
+ if (!this[sourceID]) {
2400
+ return new AudioPlayer.Null();
2401
+ }
2402
+
2403
+ if (this.current && this.current.playerId === sourceID) {
2404
+ return this.current;
2405
+ }
2406
+
2390
2407
  if (this.previous && this.previous.playerId === sourceID) {
2391
2408
  var holder = this.current;
2392
2409
  this.current = this.previous;
@@ -2522,4 +2539,4 @@ function documentHiddenState(callback) {
2522
2539
  };
2523
2540
  }
2524
2541
 
2525
- export { Audio, AudioPlayer, BLANK_AUDIO_SRC, BLANK_VIDEO_SRC, Features, MediaPool, MediaType, MultiPlayer, PlayerSourceIDMap, VideoPlayer, assetUrls, audioContext, blankSources, browser, cookies, debugMode, documentHiddenState, events, features, log, media, mediaPlayer, settings };
2542
+ export { Audio, AudioPlayer, Features, MediaPool, MediaType, MultiPlayer, PlayerSourceIDMap, VideoPlayer, assetUrls, audioContext, blankSources, browser, cookies, debugMode, documentHiddenState, events, features, log, media, mediaPlayer, settings };
@@ -1137,13 +1137,30 @@ var TooltipView = Marionette.ItemView.extend({
1137
1137
  * A text that will be appended to the translation based inline
1138
1138
  * text.
1139
1139
  *
1140
- * @param {boolean} [options.disabled]
1141
- * Render input as disabled.
1140
+ * @param {string|string[]} [options.disabledBinding]
1141
+ * Name of an attribute to control whether the input is disabled. If
1142
+ * the `disabled` and `disabledBinding` options are not set,
1143
+ * input will be disabled whenever this attribute has a truthy value.
1144
+ * When multiple attribute names are passed, the function passed to
1145
+ * the `disabled` option will receive an array of values in the same
1146
+ * order.
1147
+ *
1148
+ * @param {function|boolean} [options.disabled]
1149
+ * Render input as disabled. A Function taking the value of the
1150
+ * `disabledBinding` attribute as parameter. Input will be disabled
1151
+ * only if function returns `true`.
1152
+ *
1153
+ * @param {any} [options.disabledBindingValue]
1154
+ * Input will be disabled whenever the value of the `disabledBinding`
1155
+ * attribute equals the value of this option.
1142
1156
  *
1143
- * @param {string} [options.visibleBinding]
1157
+ * @param {string|string[]} [options.visibleBinding]
1144
1158
  * Name of an attribute to control whether the input is visible. If
1145
1159
  * the `visible` and `visibleBindingValue` options are not set,
1146
1160
  * input will be visible whenever this attribute has a truthy value.
1161
+ * When multiple attribute names are passed, the function passed to
1162
+ * the `visible` option will receive an array of values in the same
1163
+ * order.
1147
1164
  *
1148
1165
  * @param {function|boolean} [options.visible]
1149
1166
  * A Function taking the value of the `visibleBinding` attribute as
@@ -1198,15 +1215,10 @@ var inputView = {
1198
1215
  this.$el.data('labelText', this.labelText());
1199
1216
  this.$el.data('inlineHelpText', this.inlineHelpText());
1200
1217
  this.ui.labelText.text(this.labelText());
1201
- this.ui.inlineHelp.html(this.inlineHelpText());
1202
-
1203
- if (!this.inlineHelpText()) {
1204
- this.ui.inlineHelp.hide();
1205
- }
1206
-
1218
+ this.updateInlineHelp();
1207
1219
  this.setLabelFor();
1208
- this.updateDisabled();
1209
- this.setupVisibleBinding();
1220
+ this.setupAttributeBinding('disabled', this.updateDisabled);
1221
+ this.setupAttributeBinding('visible', this.updateVisible);
1210
1222
  },
1211
1223
 
1212
1224
  /**
@@ -1221,6 +1233,13 @@ var inputView = {
1221
1233
  fallbackPrefix: 'activerecord.attributes'
1222
1234
  }));
1223
1235
  },
1236
+ updateInlineHelp: function updateInlineHelp() {
1237
+ this.ui.inlineHelp.html(this.inlineHelpText());
1238
+
1239
+ if (!this.inlineHelpText()) {
1240
+ this.ui.inlineHelp.hide();
1241
+ }
1242
+ },
1224
1243
 
1225
1244
  /**
1226
1245
  * The inline help text for the form field.
@@ -1231,7 +1250,7 @@ var inputView = {
1231
1250
  fallbackPrefix: 'pageflow.ui.inline_help'
1232
1251
  });
1233
1252
 
1234
- if (this.options.disabled) {
1253
+ if (this.isDisabled()) {
1235
1254
  keys = translationKeysWithSuffix(keys, 'disabled');
1236
1255
  }
1237
1256
 
@@ -1247,40 +1266,61 @@ var inputView = {
1247
1266
  this.ui.label.attr('for', id);
1248
1267
  }
1249
1268
  },
1269
+ isDisabled: function isDisabled() {
1270
+ return this.getAttributeBoundOption('disabled');
1271
+ },
1250
1272
  updateDisabled: function updateDisabled() {
1273
+ this.updateInlineHelp();
1274
+
1251
1275
  if (this.ui.input) {
1252
1276
  this.updateDisabledAttribute(this.ui.input);
1253
1277
  }
1254
1278
  },
1255
1279
  updateDisabledAttribute: function updateDisabledAttribute(element) {
1256
- if (this.options.disabled) {
1280
+ if (this.isDisabled()) {
1257
1281
  element.attr('disabled', true);
1258
1282
  } else {
1259
1283
  element.removeAttr('disabled');
1260
1284
  }
1261
1285
  },
1262
- setupVisibleBinding: function setupVisibleBinding() {
1286
+ updateVisible: function updateVisible() {
1287
+ this.$el.toggleClass('input-hidden_via_binding', this.getAttributeBoundOption('visible') === false);
1288
+ },
1289
+ setupAttributeBinding: function setupAttributeBinding(optionName, updateMethod) {
1290
+ var _this = this;
1291
+
1292
+ var binding = this.options["".concat(optionName, "Binding")];
1263
1293
  var view = this;
1264
1294
 
1265
- if (this.options.visibleBinding) {
1266
- this.listenTo(this.model, 'change:' + this.options.visibleBinding, updateVisible);
1267
- updateVisible(this.model, this.model.get(this.options.visibleBinding));
1295
+ if (binding) {
1296
+ _.flatten([binding]).forEach(function (attribute) {
1297
+ _this.listenTo(_this.model, 'change:' + attribute, update);
1298
+ });
1268
1299
  }
1269
1300
 
1270
- function updateVisible(model, value) {
1271
- view.$el.toggleClass('input-hidden_via_binding', !isVisible(value));
1301
+ update();
1302
+
1303
+ function update() {
1304
+ updateMethod.call(view, view.getAttributeBoundOption(optionName));
1272
1305
  }
1306
+ },
1307
+ getAttributeBoundOption: function getAttributeBoundOption(optionName) {
1308
+ var _this2 = this;
1273
1309
 
1274
- function isVisible(value) {
1275
- if ('visibleBindingValue' in view.options) {
1276
- return value === view.options.visibleBindingValue;
1277
- } else if (typeof view.options.visible === 'function') {
1278
- return !!view.options.visible(value);
1279
- } else if ('visible' in view.options) {
1280
- return !!view.options.visible;
1281
- } else {
1282
- return !!value;
1283
- }
1310
+ var binding = this.options["".concat(optionName, "Binding")];
1311
+ var bindingValueOptionName = "".concat(optionName, "BindingValue");
1312
+ var value = Array.isArray(binding) ? binding.map(function (attribute) {
1313
+ return _this2.model.get(attribute);
1314
+ }) : this.model.get(binding);
1315
+
1316
+ if (bindingValueOptionName in this.options) {
1317
+ return value === this.options[bindingValueOptionName];
1318
+ } else if (typeof this.options[optionName] === 'function') {
1319
+ return !!this.options[optionName](value);
1320
+ } else if (optionName in this.options) {
1321
+ return !!this.options[optionName];
1322
+ } else if (binding) {
1323
+ return !!value;
1284
1324
  }
1285
1325
  }
1286
1326
  };
@@ -1431,11 +1471,14 @@ var inputWithPlaceholderText = {
1431
1471
  this.listenTo(this.model, 'change:' + this.options.placeholderBinding, this.updatePlaceholder);
1432
1472
  }
1433
1473
  },
1474
+ updateDisabled: function updateDisabled() {
1475
+ this.updatePlaceholder();
1476
+ },
1434
1477
  updatePlaceholder: function updatePlaceholder() {
1435
1478
  this.ui.input.attr('placeholder', this.placeholderText());
1436
1479
  },
1437
1480
  placeholderText: function placeholderText() {
1438
- if (!this.options.disabled || !this.options.hidePlaceholderIfDisabled) {
1481
+ if (!this.isDisabled() || !this.options.hidePlaceholderIfDisabled) {
1439
1482
  if (this.options.placeholder) {
1440
1483
  if (typeof this.options.placeholder == 'function') {
1441
1484
  return this.options.placeholder(this.model);
@@ -1446,6 +1489,8 @@ var inputWithPlaceholderText = {
1446
1489
  return this.placeholderModelValue();
1447
1490
  }
1448
1491
  }
1492
+
1493
+ return '';
1449
1494
  },
1450
1495
  placeholderModelValue: function placeholderModelValue() {
1451
1496
  return this.options.placeholderModel && this.options.placeholderModel.get(this.options.propertyName);
@@ -1598,12 +1643,22 @@ var ColorInputView = Marionette.ItemView.extend({
1598
1643
  this.updateSettings();
1599
1644
  },
1600
1645
  updateSettings: function updateSettings() {
1646
+ this.resetSwatchesInStoredSettings();
1601
1647
  this.ui.input.minicolors('settings', {
1602
1648
  defaultValue: this.defaultValue(),
1603
1649
  swatches: this.getSwatches()
1604
1650
  });
1605
1651
  this.load();
1606
1652
  },
1653
+ // see https://github.com/claviska/jquery-minicolors/issues/287
1654
+ resetSwatchesInStoredSettings: function resetSwatchesInStoredSettings() {
1655
+ var settings = this.ui.input.data('minicolors-settings');
1656
+
1657
+ if (settings) {
1658
+ delete settings.swatches;
1659
+ this.ui.input.data('minicolors-settings', settings);
1660
+ }
1661
+ },
1607
1662
  load: function load() {
1608
1663
  this.ui.input.minicolors('value', this.model.get(this.options.propertyName) || this.defaultValue());
1609
1664
  this.$el.toggleClass('is_default', !this.model.has(this.options.propertyName));
@@ -2456,6 +2511,15 @@ var SliderInputView = Marionette.ItemView.extend({
2456
2511
  });
2457
2512
  this.load();
2458
2513
  },
2514
+ updateDisabled: function updateDisabled(disabled) {
2515
+ this.$el.toggleClass('disabled', !!disabled);
2516
+
2517
+ if (disabled) {
2518
+ this.ui.widget.slider('disable');
2519
+ } else {
2520
+ this.ui.widget.slider('enable');
2521
+ }
2522
+ },
2459
2523
  save: function save() {
2460
2524
  var value = this.ui.widget.slider('option', 'value');
2461
2525
  var unit = 'unit' in this.options ? this.options.unit : '%';
@@ -2580,8 +2644,11 @@ var CheckBoxInputView = Marionette.ItemView.extend({
2580
2644
  this.load();
2581
2645
  this.listenTo(this.model, 'change:' + this.options.propertyName, this.load);
2582
2646
  },
2647
+ updateDisabled: function updateDisabled() {
2648
+ this.load();
2649
+ },
2583
2650
  save: function save() {
2584
- if (!this.options.disabled) {
2651
+ if (!this.isDisabled()) {
2585
2652
  this.model.set(this.options.propertyName, this.ui.input.is(':checked'));
2586
2653
  }
2587
2654
  },
@@ -2591,7 +2658,7 @@ var CheckBoxInputView = Marionette.ItemView.extend({
2591
2658
  }
2592
2659
  },
2593
2660
  displayValue: function displayValue() {
2594
- if (this.options.disabled && this.options.displayUncheckedIfDisabled) {
2661
+ if (this.isDisabled() && this.options.displayUncheckedIfDisabled) {
2595
2662
  return false;
2596
2663
  } else {
2597
2664
  return this.model.get(this.options.propertyName);