mirror of
https://github.com/atom/atom.git
synced 2026-01-24 22:38:20 -05:00
document handlers
This commit is contained in:
@@ -4,6 +4,8 @@ Document = require 'document'
|
||||
|
||||
module.exports =
|
||||
class Browser extends Document
|
||||
@register (path) -> /^https?:/.test path
|
||||
|
||||
buffers: {}
|
||||
|
||||
html: $ "<div id='browser'></div>"
|
||||
|
||||
@@ -1,9 +1,17 @@
|
||||
_ = require 'underscore'
|
||||
Pane = require 'pane'
|
||||
|
||||
module.exports =
|
||||
class Document extends Pane
|
||||
position: "main"
|
||||
|
||||
@handlers: {}
|
||||
@handler: (path) ->
|
||||
for handler, test of Document.handlers
|
||||
return handler if test path
|
||||
@register: (cb) ->
|
||||
Document.handlers[this] = cb
|
||||
|
||||
open: ->
|
||||
close: ->
|
||||
save: ->
|
||||
|
||||
@@ -9,6 +9,8 @@ ace = require 'ace/ace'
|
||||
|
||||
module.exports =
|
||||
class Editor extends Document
|
||||
@register (path) -> fs.isFile path
|
||||
|
||||
activePath: null
|
||||
|
||||
buffers: {}
|
||||
|
||||
Reference in New Issue
Block a user