all files / packages/link/ LinkPackage.js

93.75% Statements 15/16
83.33% Branches 5/6
100% Functions 1/1
93.75% Lines 15/16
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58                            365× 365× 365× 365× 365×       365×     365×     365×     365× 365× 365×       365×       365×       365× 365×                      
import { platform } from '../../util'
import { AnnotationTool, EditAnnotationCommand } from '../../ui'
import Link from './Link'
import LinkComponent from './LinkComponent'
import LinkCommand from './LinkCommand'
import LinkHTMLConverter from './LinkHTMLConverter'
import EditLinkTool from './EditLinkTool'
 
export default {
  name: 'link',
  configure: function(config, {
    toolGroup,
    editLinkToolGroup
  }) {
    config.addNode(Link)
    config.addComponent('link', LinkComponent)
    config.addConverter('html', LinkHTMLConverter)
    config.addConverter('xml', LinkHTMLConverter)
    config.addCommand('link', LinkCommand, {
      nodeType: 'link',
      disableCollapsedCursor: true
    })
    config.addCommand('edit-link', EditAnnotationCommand, {
      nodeType: 'link'
    })
    config.addTool('link', AnnotationTool, {
      toolGroup: toolGroup || 'annotations'
    })
    config.addTool('edit-link', EditLinkTool, {
      toolGroup: editLinkToolGroup || 'overlay'
    })
    config.addIcon('link', { 'fontawesome': 'fa-link'})
    config.addIcon('open-link', { 'fontawesome': 'fa-external-link' })
    config.addLabel('link', {
      en: 'Link',
      de: 'Link'
    })
    config.addLabel('open-link', {
      en: 'Open Link',
      de: 'Link öffnen'
    })
    config.addLabel('delete-link', {
      en: 'Remove Link',
      de: 'Link löschen'
    })
    Eif (platform.isMac) {
      config.addKeyboardShortcut('cmd+k', { command: 'link' })
    } else {
      config.addKeyboardShortcut('ctrl+k', { command: 'link' })
    }
  },
  Link,
  LinkComponent,
  LinkCommand,
  LinkHTMLConverter,
  EditLinkTool
}