From a2fdd0fd16124334e089bd3dd71ed98bb817bcc2 Mon Sep 17 00:00:00 2001 From: Corey Johnson Date: Fri, 11 Nov 2011 11:24:50 -0800 Subject: [PATCH] window.path is now window.url --- extensions-to-port/tinytest/tinytest.coffee | 2 +- extensions/filefinder/filefinder-pane.coffee | 6 +++--- extensions/tree/tree-pane.coffee | 2 +- extensions/tree/tree.coffee | 10 +++++----- src/atom/window.coffee | 14 +++++++------- src/startup.coffee | 6 +++--- 6 files changed, 20 insertions(+), 20 deletions(-) diff --git a/extensions-to-port/tinytest/tinytest.coffee b/extensions-to-port/tinytest/tinytest.coffee index 79a14043c..f6aa01290 100644 --- a/extensions-to-port/tinytest/tinytest.coffee +++ b/extensions-to-port/tinytest/tinytest.coffee @@ -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 diff --git a/extensions/filefinder/filefinder-pane.coffee b/extensions/filefinder/filefinder-pane.coffee index b8279e19e..5d6fbb6ce 100644 --- a/extensions/filefinder/filefinder-pane.coffee +++ b/extensions/filefinder/filefinder-pane.coffee @@ -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() diff --git a/extensions/tree/tree-pane.coffee b/extensions/tree/tree-pane.coffee index e202e5264..3eedffd44 100644 --- a/extensions/tree/tree-pane.coffee +++ b/extensions/tree/tree-pane.coffee @@ -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 diff --git a/extensions/tree/tree.coffee b/extensions/tree/tree.coffee index 3f98a33aa..d92650194 100644 --- a/extensions/tree/tree.coffee +++ b/extensions/tree/tree.coffee @@ -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) -> diff --git a/src/atom/window.coffee b/src/atom/window.coffee index 66358815a..3563e678e 100644 --- a/src/atom/window.coffee +++ b/src/atom/window.coffee @@ -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 diff --git a/src/startup.coffee b/src/startup.coffee index 4af9caf71..799463aa4 100644 --- a/src/startup.coffee +++ b/src/startup.coffee @@ -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()