/* global UE, addStyle */
UE.plugins['xiumi-connect'] = function () {
  var editor = this
  editor.commands['xiumi-connect'] = {
    execCommand: function (cmd, name) {
      var dialog = new UE.ui.Dialog({
        iframeUrl: './lib/neditor/com.zving/xiumieditor/xiumi.html',
        editor: editor,
        name: 'xiumi-connect',
        title: '秀米编辑器',
        cssRules: 'width: ' + (window.innerWidth - 60) + 'px;' + 'height: ' + (window.innerHeight - 60) + 'px;'
      })
      dialog.render()
      dialog.open()
    }
  }
}
addStyle('.edui-notadd .edui-toolbar .edui-button.edui-for-xiumi-connect .edui-button-wrap{background-image:url("./lib/neditor/com.zving/images/icons-editor.png");background-position:0 -64px;background-repeat: no-repeat;}')
addStyle('.edui-notadd .edui-toolbar .edui-button.edui-for-xiumi-connect .edui-state-disabled .edui-button-wrap{background-position:0 -96px;}')
