mirror of
https://github.com/atom/atom.git
synced 2026-01-23 05:48:10 -05:00
window.path is now window.url
This commit is contained in:
@@ -13,7 +13,7 @@ class TinyTest extends Extension
|
||||
'Command-Ctrl-T': 'runTests'
|
||||
|
||||
runTests: ->
|
||||
_.map File.list(window.path + '/test'), @runTest
|
||||
_.map File.list(window.url + '/test'), @runTest
|
||||
|
||||
runTest: (path) ->
|
||||
# Even though we already have the path, run it
|
||||
|
||||
@@ -38,7 +38,7 @@ class FilefinderPane extends Pane
|
||||
|
||||
paths: ->
|
||||
_paths = []
|
||||
for dir in File.list window.path
|
||||
for dir in File.list window.url
|
||||
continue if /\.git|Cocoa/.test dir
|
||||
_paths.push File.listDirectoryTree dir
|
||||
_.reject _.flatten(_paths), (dir) -> File.isDirectory dir
|
||||
@@ -47,7 +47,7 @@ class FilefinderPane extends Pane
|
||||
@modal.show()
|
||||
@files = []
|
||||
for file in @paths()
|
||||
@files.push file.replace "#{window.path}/", ''
|
||||
@files.push file.replace "#{window.url}/", ''
|
||||
@filterFiles()
|
||||
|
||||
findMatchingFiles: (query) ->
|
||||
@@ -80,7 +80,7 @@ class FilefinderPane extends Pane
|
||||
$('#filefinder li:first').addClass 'selected'
|
||||
|
||||
openSelected: ->
|
||||
dir = window.path
|
||||
dir = window.url
|
||||
file = $('#filefinder .selected').text()
|
||||
window.open "#{dir}/#{file}"
|
||||
@toggle()
|
||||
|
||||
@@ -46,7 +46,7 @@ class TreePane extends Pane
|
||||
true
|
||||
|
||||
reload: ->
|
||||
@html.children('#tree .cwd').text _.last window.path.split '/'
|
||||
@html.children('#tree .cwd').text _.last window.url.split '/'
|
||||
fileList = @createList @tree.paths
|
||||
fileList.addClass 'files'
|
||||
@html.children('#tree .files').replaceWith fileList
|
||||
|
||||
@@ -18,7 +18,7 @@ class Tree extends Extension
|
||||
atom.keybinder.load require.resolve "tree/key-bindings.coffee"
|
||||
|
||||
# watch the root dir
|
||||
Watcher.watch window.path, @watchDir
|
||||
Watcher.watch window.url, @watchDir
|
||||
|
||||
# Hide dirs that no longer exist, watch dirs that do.
|
||||
for dir in @shownDirs()
|
||||
@@ -27,25 +27,25 @@ class Tree extends Extension
|
||||
else
|
||||
Watcher.watch dir, @watchDir
|
||||
|
||||
@paths = @findPaths window.path
|
||||
@paths = @findPaths window.url
|
||||
@pane = new TreePane @
|
||||
|
||||
startup: ->
|
||||
@pane.show()
|
||||
|
||||
shutdown: ->
|
||||
@unwatchDir window.path
|
||||
@unwatchDir window.url
|
||||
@unwatchDir dir for dir in @shownDirs()
|
||||
|
||||
reload: ->
|
||||
@pane.reload()
|
||||
|
||||
shownDirStorageKey: ->
|
||||
@.constructor.name + ":" + window.path + ":shownDirs"
|
||||
@.constructor.name + ":" + window.url + ":shownDirs"
|
||||
|
||||
watchDir: (changeType, dir) =>
|
||||
# Update the paths
|
||||
@paths = @findPaths window.path
|
||||
@paths = @findPaths window.url
|
||||
@pane.reload()
|
||||
|
||||
unwatchDir: (dir) ->
|
||||
|
||||
@@ -4,10 +4,10 @@ _ = require 'underscore'
|
||||
# This a weirdo file. We don't create a Window class, we just add stuff to
|
||||
# the DOM window.
|
||||
windowAdditions =
|
||||
path: null
|
||||
url: null
|
||||
|
||||
startup: ->
|
||||
@path = $atomController.path?.toString()
|
||||
@url = $atomController.url?.toString()
|
||||
$atomController.window.makeKeyWindow
|
||||
|
||||
shutdown: ->
|
||||
@@ -20,13 +20,13 @@ windowAdditions =
|
||||
|
||||
reload: ->
|
||||
@close()
|
||||
OSX.NSApp.createController @path
|
||||
OSX.NSApp.createController @url
|
||||
|
||||
open: (path) ->
|
||||
path = atom.native.openPanel() unless path
|
||||
(atom.document.open path) or atom.app.open path
|
||||
open: (url) ->
|
||||
url = atom.native.openPanel() unless url
|
||||
(atom.document.open url) or atom.app.open url
|
||||
|
||||
close: (path) ->
|
||||
close: (url) ->
|
||||
@shutdown()
|
||||
$atomController.close
|
||||
|
||||
|
||||
@@ -33,10 +33,10 @@ atom.app = new App
|
||||
for name, method of atom.app
|
||||
atom[name] = atom.app[name]
|
||||
|
||||
if handler = Document.handler window.path
|
||||
if handler = Document.handler window.url
|
||||
atom.document = new handler
|
||||
atom.document.open window.path
|
||||
atom.document.open window.url
|
||||
else
|
||||
throw "I DON'T KNOW ABOUT #{path}"
|
||||
throw "I DON'T KNOW ABOUT #{window.url}"
|
||||
|
||||
window.startup()
|
||||
|
||||
Reference in New Issue
Block a user