Skip to content

Commit

Permalink
site coverPrefs boilerplate #223
Browse files Browse the repository at this point in the history
  • Loading branch information
forresto committed Jul 29, 2016
1 parent 6c474b0 commit 0b4d179
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 2 deletions.
5 changes: 4 additions & 1 deletion src/components/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,8 @@ export default class App extends React.Component {
, onShareUrl
, onCommandsChanged
, onDropFiles
, widgetPath} = this.props
, widgetPath
, coverPrefs } = this.props

return el('div'
, { className: 'Ed-Content'
Expand All @@ -109,6 +110,7 @@ export default class App extends React.Component {
, onCommandsChanged
, onDropFiles
, widgetPath
, coverPrefs
}
)
)
Expand Down Expand Up @@ -174,5 +176,6 @@ App.propTypes =
, menuTip: React.PropTypes.bool
, imgfloConfig: React.PropTypes.object
, widgetPath: React.PropTypes.string
, coverPrefs: React.PropTypes.object
}
App.defaultProps = { widgetPath: './node_modules/' }
1 change: 1 addition & 0 deletions src/components/attribution-editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -332,6 +332,7 @@ AttributionEditor.childContextTypes =
AttributionEditor.propTypes =
{ initialBlock: React.PropTypes.object.isRequired
, id: React.PropTypes.string.isRequired
, coverPrefs: React.PropTypes.object
}
export default React.createFactory(AttributionEditor)

Expand Down
5 changes: 4 additions & 1 deletion src/components/editable.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@ class Editable extends React.Component {
, menuTip
, onChange
, onCommandsChanged
, widgetPath } = this.props
, widgetPath
, coverPrefs } = this.props
const {store} = this.context

// PM setup
Expand Down Expand Up @@ -94,6 +95,7 @@ class Editable extends React.Component {
, editableView: this
, container: plugins
, widgetPath
, coverPrefs
}

edPluginClasses.forEach(function (plugin) {
Expand Down Expand Up @@ -149,5 +151,6 @@ Editable.propTypes =
, menuBar: React.PropTypes.bool
, menuTip: React.PropTypes.bool
, widgetPath: React.PropTypes.string
, coverPrefs: React.PropTypes.object
}
export default React.createFactory(Editable)
3 changes: 3 additions & 0 deletions src/components/media.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,14 @@ class Media extends React.Component {
)
}
render () {
const {coverPrefs} = this.props
const {initialBlock, id} = this.state
const {type} = initialBlock
let Component = Components[type] || Components.attribution
return el(Component
, { initialBlock
, id
, coverPrefs
}
)
}
Expand Down Expand Up @@ -82,5 +84,6 @@ Media.propTypes =
{ initialBlock: React.PropTypes.object.isRequired
, store: React.PropTypes.object.isRequired
, imgfloConfig: React.PropTypes.object
, coverPrefs: React.PropTypes.object
}
export default React.createFactory(Media)
2 changes: 2 additions & 0 deletions src/plugins/widget.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ export default class PluginWidget {
this.editableView = options.editableView
this.pm = pm
this.widgetPath = options.widgetPath
this.coverPrefs = options.coverPrefs

this.widgets = {}
this.el = document.createElement('div')
Expand Down Expand Up @@ -228,6 +229,7 @@ export default class PluginWidget {
, initialRectangle: rectangle
, initialFocus
, widgetPath: this.widgetPath
, coverPrefs: this.coverPrefs
}
)

Expand Down

0 comments on commit 0b4d179

Please sign in to comment.