Commit 781d38f1 authored by chris's avatar chris

menus configrable

parent 7864492b
......@@ -41,7 +41,7 @@ class ChangeCaseTool extends Tool {
$$('div')
.addClass('choose-case')
.attr('title', `Change Case Action`)
.append('Choose Action')
.append('Transform Cases')
.append(dropDownCarret)
.on('click', this.toggleDropdown),
)
......
......@@ -11,7 +11,7 @@ export default {
config.addComponent('code', AnnotationComponent)
config.addCommand('code', WaxAnnotationCommand, {
nodeType: Code.type,
commandGroup: 'annotations',
commandGroup: 'insert-inline-code',
})
config.addIcon('code', { fontawesome: 'fa-code' })
config.addLabel('code', {
......
......@@ -15,7 +15,7 @@ export default {
config.addConverter('html', ImageHTMLConverter)
config.addCommand('insert-image', InsertImageCommand, {
nodeType: ImageNode.type,
commandGroup: 'annotations',
commandGroup: 'insert-image',
})
config.addCommand('edit-caption', EditCaptionCommand, {
nodeType: 'image',
......
......@@ -11,7 +11,7 @@ export default {
config.addComponent('strong', StrongComponent)
config.addCommand('strong', WaxAnnotationCommand, {
nodeType: 'strong',
commandGroup: 'annotations',
commandGroup: 'insert-strong',
})
config.addIcon('strong', { fontawesome: 'fa-bold' })
config.addLabel('strong', {
......
......@@ -23,6 +23,13 @@ export default {
style: 'minimal',
commandGroups: ['change-case'],
},
{
name: 'insert-strong',
type: 'tool-group',
showDisabled: true,
style: 'minimal',
commandGroups: ['insert-strong'],
},
{
name: 'annotations',
type: 'tool-group',
......@@ -30,6 +37,20 @@ export default {
style: 'minimal',
commandGroups: ['annotations'],
},
{
name: 'insert-inline-code',
type: 'tool-group',
showDisabled: true,
style: 'minimal',
commandGroups: ['insert-inline-code'],
},
{
name: 'insert-image',
type: 'tool-group',
showDisabled: true,
style: 'minimal',
commandGroups: ['insert-image'],
},
{
name: 'note',
type: 'tool-group',
......
export default {
configure: config => {
name: 'ucpToolPanels',
config.addToolPanel('topDefault', [
config.addToolPanel('ucpTopToolBar', [
{
name: 'undo-redo',
type: 'tool-group',
......@@ -30,6 +30,13 @@ export default {
style: 'minimal',
commandGroups: ['annotations'],
},
{
name: 'insert-image',
type: 'tool-group',
showDisabled: true,
style: 'minimal',
commandGroups: ['insert-image'],
},
{
name: 'note',
type: 'tool-group',
......@@ -79,13 +86,6 @@ export default {
style: 'minimal',
commandGroups: ['spell-check-toggle'],
},
{
name: 'insert-script',
type: 'tool-group',
showDisabled: true,
style: 'minimal',
commandGroups: ['insert-script'],
},
{
name: 'full-screen-control',
type: 'tool-group',
......@@ -116,7 +116,7 @@ export default {
},
])
config.addToolPanel('sideDefault', [
config.addToolPanel('ucpSideToolBar', [
{
name: 'text-display',
type: 'tool-group',
......
......@@ -3,7 +3,7 @@ import { Component, Toolbar } from 'substance'
class SideToolbar extends Component {
render($$) {
const { configurator } = this.props
const menu = configurator.menus[1]
const menu = configurator.menus.sideToolBar
const wrapper = $$('div').addClass('sidenav')
const sideNav = $$('div')
.addClass('se-toolbar-wrapper')
......
......@@ -17,7 +17,7 @@ class Toolbar extends Component {
.addClass('view-mode')
.append('Read-Only')
: ''
const menu = configurator.menus[0]
const menu = configurator.menus.topToolBar
return $$('div')
.addClass('se-toolbar-wrapper')
.append(
......
......@@ -120,7 +120,10 @@ class Wax extends React.Component {
this.configurator = new Configurator().import(config)
this.configurator.addImporter('html', Importer)
const editorSession = this.createSession(content)
this.configurator.menus = ['topDefault', 'sideDefault']
this.configurator.menus = {
topToolBar: 'topDefault',
sideToolBar: 'sideDefault',
}
const onClose = this.onClose
// TODO -- make this configurable
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment