mirror of
https://github.com/pulsar-edit/pulsar.git
synced 2025-01-07 15:49:23 +03:00
Move config view to a package
This commit is contained in:
parent
1252b94fcb
commit
2284435551
3
src/packages/config-view/keymaps/config-view.cson
Normal file
3
src/packages/config-view/keymaps/config-view.cson
Normal file
@ -0,0 +1,3 @@
|
||||
# DOCUMENT: link to keymap documentation
|
||||
'body':
|
||||
'meta-alt-ctrl-o': 'config-view:toggle'
|
@ -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 =
|
@ -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
|
@ -1,4 +1,4 @@
|
||||
ConfigPanel = require 'config-panel'
|
||||
ConfigPanel = require './config-panel'
|
||||
Editor = require 'editor'
|
||||
|
||||
###
|
@ -1,4 +1,4 @@
|
||||
ConfigPanel = require 'config-panel'
|
||||
ConfigPanel = require './config-panel'
|
||||
{$$} = require 'space-pen'
|
||||
$ = require 'jquery'
|
||||
_ = require 'underscore'
|
@ -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 =
|
@ -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'
|
||||
|
@ -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'
|
@ -1,4 +1,4 @@
|
||||
ConfigPanel = require 'config-panel'
|
||||
ConfigPanel = require './config-panel'
|
||||
{$$} = require 'space-pen'
|
||||
$ = require 'jquery'
|
||||
_ = require 'underscore'
|
2
src/packages/config-view/package.cson
Normal file
2
src/packages/config-view/package.cson
Normal file
@ -0,0 +1,2 @@
|
||||
'main': './lib/config-view'
|
||||
'deferredDeserializers': ['ConfigView']
|
@ -1,4 +1,4 @@
|
||||
ConfigPanel = require 'config-panel'
|
||||
ConfigPanel = require '../lib/config-panel'
|
||||
Editor = require 'editor'
|
||||
|
||||
describe "ConfigPanel", ->
|
@ -1,4 +1,4 @@
|
||||
ConfigView = require 'config-view'
|
||||
ConfigView = require '../lib/config-view'
|
||||
{$$} = require 'space-pen'
|
||||
|
||||
describe "ConfigView", ->
|
@ -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", ->
|
@ -1,5 +1,5 @@
|
||||
$ = require 'jquery'
|
||||
ThemeConfigPanel = require 'theme-config-panel'
|
||||
ThemeConfigPanel = require '../lib/theme-config-panel'
|
||||
|
||||
describe "ThemeConfigPanel", ->
|
||||
panel = null
|
@ -2,8 +2,6 @@
|
||||
@import "octicon-mixins.less";
|
||||
|
||||
#config-view {
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
background: white;
|
||||
display: -webkit-flex;
|
||||
|
@ -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";
|
||||
|
Loading…
Reference in New Issue
Block a user