diff --git a/lib/image-edit-session.coffee b/lib/image-edit-session.coffee index a496a0f..8833c49 100644 --- a/lib/image-edit-session.coffee +++ b/lib/image-edit-session.coffee @@ -1,10 +1,8 @@ path = require 'path' -_ = require 'underscore' +{_, fs} = require 'atom' telepath = require 'telepath' -fsUtils = require 'fs-utils' - # Public: Manages the states between {Editor}s, images, and the project as a whole. # # Essentially, the graphical version of a {EditSession}. @@ -17,15 +15,14 @@ class ImageEditSession @activate: -> # Files with these extensions will be opened as images imageExtensions = ['.gif', '.jpeg', '.jpg', '.png'] - Project = require 'project' - Project.registerOpener (filePath) -> + project.registerOpener (filePath) -> if _.include(imageExtensions, path.extname(filePath)) new ImageEditSession(path: filePath) @deserialize: (state) -> relativePath = state.get('relativePath') resolvedPath = project.resolve(relativePath) if relativePath - if fsUtils.isFileSync(resolvedPath) + if fs.isFileSync(resolvedPath) new ImageEditSession(state) else console.warn "Could not build image edit session for path '#{relativePath}' because that file no longer exists" diff --git a/lib/image-view.coffee b/lib/image-view.coffee index 4655a86..233daa1 100644 --- a/lib/image-view.coffee +++ b/lib/image-view.coffee @@ -1,6 +1,4 @@ -ScrollView = require 'scroll-view' -_ = require 'underscore' -$ = require 'jquery' +{_, $, ScrollView} = require 'atom' # Public: Renders images in the {Editor}. module.exports =