From 5ac106dc9c6043a99c7c6e8ed8eb38f84842576a Mon Sep 17 00:00:00 2001 From: Ross Allen Date: Wed, 26 Aug 2015 17:54:14 -0700 Subject: [PATCH 1/6] Document all options for creating Notifications The defaults for the 'icon' values come from Notification::getIcon[0]. [0]: https://github.com/atom/atom/blob/v1.0.7/src/notification.coffee#L79 --- src/notification-manager.coffee | 45 +++++++++++++++++++++++++-------- 1 file changed, 35 insertions(+), 10 deletions(-) diff --git a/src/notification-manager.coffee b/src/notification-manager.coffee index f4ebd97db..46e4c60d4 100644 --- a/src/notification-manager.coffee +++ b/src/notification-manager.coffee @@ -29,40 +29,65 @@ class NotificationManager # Public: Add a success notification. # # * `message` A {String} message - # * `options` An options {Object} with optional keys such as: - # * `detail` A {String} with additional details about the notification + # * `options` (optional) An options {Object} with the following keys: + # * `detail` (optional) A {String} with additional details about the + # notification. + # * `dismissable` (optional) A {Boolean} indicating whether this + # notification can be dismissed by the user. Defaults to `false`. + # * `icon` (optional) A {String} name of an icon from Octicons to display + # in the notification header. Defaults to `'check'`. addSuccess: (message, options) -> @addNotification(new Notification('success', message, options)) # Public: Add an informational notification. # # * `message` A {String} message - # * `options` An options {Object} with optional keys such as: - # * `detail` A {String} with additional details about the notification + # * `options` (optional) An options {Object} with the following keys: + # * `detail` (optional) A {String} with additional details about the + # notification. + # * `dismissable` (optional) A {Boolean} indicating whether this + # notification can be dismissed by the user. Defaults to `false`. + # * `icon` (optional) A {String} name of an icon from Octicons to display + # in the notification header. Defaults to `'info'`. addInfo: (message, options) -> @addNotification(new Notification('info', message, options)) # Public: Add a warning notification. # # * `message` A {String} message - # * `options` An options {Object} with optional keys such as: - # * `detail` A {String} with additional details about the notification + # * `options` (optional) An options {Object} with the following keys: + # * `detail` (optional) A {String} with additional details about the + # notification. + # * `dismissable` (optional) A {Boolean} indicating whether this + # notification can be dismissed by the user. Defaults to `false`. + # * `icon` (optional) A {String} name of an icon from Octicons to display + # in the notification header. Defaults to `'alert'`. addWarning: (message, options) -> @addNotification(new Notification('warning', message, options)) # Public: Add an error notification. # # * `message` A {String} message - # * `options` An options {Object} with optional keys such as: - # * `detail` A {String} with additional details about the notification + # * `options` (optional) An options {Object} with the following keys: + # * `detail` (optional) A {String} with additional details about the + # notification. + # * `dismissable` (optional) A {Boolean} indicating whether this + # notification can be dismissed by the user. Defaults to `false`. + # * `icon` (optional) A {String} name of an icon from Octicons to display + # in the notification header. Defaults to `'flame'`. addError: (message, options) -> @addNotification(new Notification('error', message, options)) # Public: Add a fatal error notification. # # * `message` A {String} message - # * `options` An options {Object} with optional keys such as: - # * `detail` A {String} with additional details about the notification + # * `options` (optional) An options {Object} with the following keys: + # * `detail` (optional) A {String} with additional details about the + # notification. + # * `dismissable` (optional) A {Boolean} indicating whether this + # notification can be dismissed by the user. Defaults to `false`. + # * `icon` (optional) A {String} name of an icon from Octicons to display + # in the notification header. Defaults to `'bug'`. addFatalError: (message, options) -> @addNotification(new Notification('fatal', message, options)) From b19db0f0c0a7a6f5ea108ca2891a011e11cd66e8 Mon Sep 17 00:00:00 2001 From: Friedrich von Never Date: Mon, 12 Oct 2015 21:22:34 +0600 Subject: [PATCH 2/6] Fix coffeescript source maps. The file paths on Windows should be URLs with proper slashes and starting with file:/// --- src/coffee-script.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/coffee-script.js b/src/coffee-script.js index 90f23bfa5..967d07cdd 100644 --- a/src/coffee-script.js +++ b/src/coffee-script.js @@ -29,6 +29,10 @@ exports.compile = function (sourceCode, filePath) { Error.prepareStackTrace = previousPrepareStackTrace } + if (process.platform === 'win32') { + filePath = 'file:///' + path.resolve(filePath).replace(/\\/g, '/') + } + var output = CoffeeScript.compile(sourceCode, { filename: filePath, sourceFiles: [filePath], From 93de5ccb79c4972e55bb7bf1edc241f8525ad8e9 Mon Sep 17 00:00:00 2001 From: Nathan Sobo Date: Mon, 12 Oct 2015 15:32:36 -0600 Subject: [PATCH 3/6] Assign window.onbeforeunload instead of addEventListener MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This allows us to cancel the unloading if the user doesn’t confirm the save dialog. --- src/window-event-handler.coffee | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/window-event-handler.coffee b/src/window-event-handler.coffee index 270650b2f..53c2aa2e2 100644 --- a/src/window-event-handler.coffee +++ b/src/window-event-handler.coffee @@ -16,9 +16,10 @@ class WindowEventHandler @on(ipc, 'command', @handleIPCCommand) @on(ipc, 'context-command', @handleIPCContextCommand) + @previousOnbeforeunloadHandler = window.onbeforeunload + window.onbeforeunload = @handleWindowBeforeunload @addEventListener(window, 'focus', @handleWindowFocus) @addEventListener(window, 'blur', @handleWindowBlur) - @addEventListener(window, 'beforeunload', @handleWindowBeforeunload) @addEventListener(window, 'unload', @handleWindowUnload) @addEventListener(document, 'keydown', @handleDocumentKeydown) @@ -60,6 +61,7 @@ class WindowEventHandler bindCommandToAction('core:cut', 'cut') unsubscribe: -> + window.onbeforeunload = @previousOnbeforeunloadHandler @subscriptions.dispose() on: (target, eventName, handler) -> From 321996a68466a4306efe817d404903026b59b989 Mon Sep 17 00:00:00 2001 From: Max Brunsfeld Date: Mon, 12 Oct 2015 16:51:30 -0700 Subject: [PATCH 4/6] :arrow_up: line-ending-selector --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index fcf4e3721..dbc569bee 100644 --- a/package.json +++ b/package.json @@ -93,7 +93,7 @@ "image-view": "0.55.0", "incompatible-packages": "0.25.0", "keybinding-resolver": "0.33.0", - "line-ending-selector": "0.0.5", + "line-ending-selector": "0.1.0", "link": "0.31.0", "markdown-preview": "0.154.0", "metrics": "0.52.0", From d04769907c9319c04b15e3e6ac0db0f41c2286df Mon Sep 17 00:00:00 2001 From: Jacek Kopecky Date: Sat, 29 Aug 2015 09:46:31 +0100 Subject: [PATCH 5/6] prevent use of socket in apm test --- src/browser/atom-application.coffee | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/browser/atom-application.coffee b/src/browser/atom-application.coffee index 0be160b5d..df4254acf 100644 --- a/src/browser/atom-application.coffee +++ b/src/browser/atom-application.coffee @@ -65,6 +65,8 @@ class AtomApplication constructor: (options) -> {@resourcePath, @devResourcePath, @version, @devMode, @safeMode, @socketPath} = options + @socketPath = null if options.test + global.atomApplication = this @pidsToOpenWindows = {} @@ -130,6 +132,7 @@ class AtomApplication # the other launches will just pass their information to this server and then # close immediately. listenForArgumentsFromNewProcess: -> + return unless @socketPath? @deleteSocketFile() server = net.createServer (connection) => connection.on 'data', (data) => @@ -139,7 +142,7 @@ class AtomApplication server.on 'error', (error) -> console.error 'Application server failed', error deleteSocketFile: -> - return if process.platform is 'win32' + return if process.platform is 'win32' or not @socketPath? if fs.existsSync(@socketPath) try From 5b37d3e1aa4289e5f463c9ea9fe24d7faa5a6ed8 Mon Sep 17 00:00:00 2001 From: Martin Rodalgaard Date: Tue, 13 Oct 2015 20:29:24 +0200 Subject: [PATCH 6/6] :memo: Better workspace scan and replace docs --- src/workspace.coffee | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/src/workspace.coffee b/src/workspace.coffee index 2ff12ac19..dbd781bd3 100644 --- a/src/workspace.coffee +++ b/src/workspace.coffee @@ -812,13 +812,14 @@ class Workspace extends Model Section: Searching and Replacing ### - # Public: Performs a search across all the files in the workspace. + # Public: Performs a search across all files in the workspace. # # * `regex` {RegExp} to search with. - # * `options` (optional) {Object} (default: {}) - # * `paths` An {Array} of glob patterns to search within - # * `onPathsSearched` (optional) {Function} - # * `iterator` {Function} callback on each file found + # * `options` (optional) {Object} + # * `paths` An {Array} of glob patterns to search within. + # * `onPathsSearched` (optional) {Function} to be periodically called + # with number of paths searched. + # * `iterator` {Function} callback on each file found. # # Returns a `Promise` with a `cancel()` method that will cancel all # of the underlying searches that were started as part of this scan. @@ -918,10 +919,10 @@ class Workspace extends Model # Public: Performs a replace across all the specified files in the project. # # * `regex` A {RegExp} to search with. - # * `replacementText` Text to replace all matches of regex with - # * `filePaths` List of file path strings to run the replace on. + # * `replacementText` {String} to replace all matches of regex with. + # * `filePaths` An {Array} of file path strings to run the replace on. # * `iterator` A {Function} callback on each file with replacements: - # * `options` {Object} with keys `filePath` and `replacements` + # * `options` {Object} with keys `filePath` and `replacements`. # # Returns a `Promise`. replace: (regex, replacementText, filePaths, iterator) ->