Move config view to a package

This commit is contained in:
probablycorey 2013-06-25 12:04:22 -07:00
parent 1252b94fcb
commit 2284435551
18 changed files with 60 additions and 35 deletions

View File

@ -0,0 +1,3 @@
# DOCUMENT: link to keymap documentation
'body':
'meta-alt-ctrl-o': 'config-view:toggle'

View File

@ -1,6 +1,6 @@
PackageConfigView = require 'package-config-view'
ConfigPanel = require 'config-panel'
packageManager = require 'package-manager'
PackageConfigView = require './package-config-view'
ConfigPanel = require './config-panel'
packageManager = require './package-manager'
### Internal ###
module.exports =

View File

@ -1,23 +1,33 @@
{View, $$} = require 'space-pen'
{$$} = require 'space-pen'
ScrollView = require 'scroll-view'
$ = require 'jquery'
_ = require 'underscore'
GeneralConfigPanel = require 'general-config-panel'
EditorConfigPanel = require 'editor-config-panel'
ThemeConfigPanel = require 'theme-config-panel'
PackageConfigPanel = require 'package-config-panel'
Pane = require 'pane'
GeneralConfigPanel = require './general-config-panel'
EditorConfigPanel = require './editor-config-panel'
ThemeConfigPanel = require './theme-config-panel'
PackageConfigPanel = require './package-config-panel'
###
# Internal #
###
module.exports =
class ConfigView extends View
class ConfigView extends ScrollView
registerDeserializer(this)
@deserialize: ({activePanelName}) ->
view = new ConfigView()
view.showPanel(activePanelName)
view
@activate: (state) ->
rootView.command 'config-view:toggle', ->
configView = new ConfigView()
activePane = rootView.getActivePane()
if activePane
activePane.showItem(configView)
else
activePane = new Pane(configView)
rootView.panes.append(activePane)
@deserialize: ({activePanelName}={}) ->
new ConfigView(activePanelName)
@content: ->
@div id: 'config-view', =>
@ -26,7 +36,10 @@ class ConfigView extends View
@button "open .atom", id: 'open-dot-atom', class: 'btn btn-default btn-small'
@div id: 'panels', outlet: 'panels'
initialize: ->
activePanelName: null
initialize: (activePanelName) ->
super
@panelsByName = {}
document.title = "Atom Configuration"
@on 'click', '#panels-menu li a', (e) =>
@ -39,6 +52,11 @@ class ConfigView extends View
@addPanel('Editor', new EditorConfigPanel)
@addPanel('Themes', new ThemeConfigPanel)
@addPanel('Packages', new PackageConfigPanel)
@showPanel(activePanelName) if activePanelName
serialize: ->
deserializer: 'ConfigView'
activePanelName: @activePanelName
addPanel: (name, panel) ->
panelItem = $$ -> @li name: name, => @a name
@ -64,6 +82,11 @@ class ConfigView extends View
else
@panelToShow = name
serialize: ->
deserializer: @constructor.name
activePanelName: @activePanelName
getTitle: ->
"Atom Config"
getUri: ->
"atom://config"
isEqual: (other) ->
other instanceof ConfigView

View File

@ -1,4 +1,4 @@
ConfigPanel = require 'config-panel'
ConfigPanel = require './config-panel'
Editor = require 'editor'
###

View File

@ -1,4 +1,4 @@
ConfigPanel = require 'config-panel'
ConfigPanel = require './config-panel'
{$$} = require 'space-pen'
$ = require 'jquery'
_ = require 'underscore'

View File

@ -1,7 +1,7 @@
_ = require 'underscore'
ConfigPanel = require 'config-panel'
PackageConfigView = require 'package-config-view'
packageManager = require 'package-manager'
ConfigPanel = require './config-panel'
PackageConfigView = require './package-config-view'
packageManager = require './package-manager'
### Internal ###
module.exports =

View File

@ -1,6 +1,6 @@
ConfigPanel = require 'config-panel'
InstalledPackagesConfigPanel = require 'installed-packages-config-panel'
AvailablePackagesConfigPanel = require 'available-packages-config-panel'
ConfigPanel = require './config-panel'
InstalledPackagesConfigPanel = require './installed-packages-config-panel'
AvailablePackagesConfigPanel = require './available-packages-config-panel'
_ = require 'underscore'
EventEmitter = require 'event-emitter'

View File

@ -1,6 +1,6 @@
Package = require 'package'
semver = require 'semver'
packageManager = require 'package-manager'
packageManager = require './package-manager'
_ = require 'underscore'
{$$, View} = require 'space-pen'
requireWithGlobals 'bootstrap/js/bootstrap-dropdown', jQuery: require 'jquery'

View File

@ -1,4 +1,4 @@
ConfigPanel = require 'config-panel'
ConfigPanel = require './config-panel'
{$$} = require 'space-pen'
$ = require 'jquery'
_ = require 'underscore'

View File

@ -0,0 +1,2 @@
'main': './lib/config-view'
'deferredDeserializers': ['ConfigView']

View File

@ -1,4 +1,4 @@
ConfigPanel = require 'config-panel'
ConfigPanel = require '../lib/config-panel'
Editor = require 'editor'
describe "ConfigPanel", ->

View File

@ -1,4 +1,4 @@
ConfigView = require 'config-view'
ConfigView = require '../lib/config-view'
{$$} = require 'space-pen'
describe "ConfigView", ->

View File

@ -1,5 +1,5 @@
PackageConfigPanel = require 'package-config-panel'
packageManager = require 'package-manager'
PackageConfigPanel = require '../lib/package-config-panel'
packageManager = require '../lib/package-manager'
_ = require 'underscore'
describe "PackageConfigPanel", ->

View File

@ -1,5 +1,5 @@
$ = require 'jquery'
ThemeConfigPanel = require 'theme-config-panel'
ThemeConfigPanel = require '../lib/theme-config-panel'
describe "ThemeConfigPanel", ->
panel = null

View File

@ -2,8 +2,6 @@
@import "octicon-mixins.less";
#config-view {
height: 100%;
width: 100%;
background: white;
display: -webkit-flex;

View File

@ -1,6 +1,5 @@
@import "bootstrap/less/bootstrap.less";
@import "root-view.less";
@import "config.less";
@import "overlay.less";
@import "popover-list.less";
@import "notification.less";