Merge remote-tracking branch 'refs/remotes/origin/master' into wl-update-languages

This commit is contained in:
Wliu
2016-08-29 09:59:44 -04:00
13 changed files with 111 additions and 24 deletions

View File

@@ -176,11 +176,8 @@ module.exports = (grunt) ->
cp path.join('resources', 'mac', 'speakeasy.pem'), path.resolve(appDir, '..', 'speakeasy.pem')
if process.platform is 'win32'
cp path.join('resources', 'win', 'atom.cmd'), path.join(shellAppDir, 'resources', 'cli', 'atom.cmd')
cp path.join('resources', 'win', 'atom.sh'), path.join(shellAppDir, 'resources', 'cli', 'atom.sh')
cp path.join('resources', 'win', 'atom.js'), path.join(shellAppDir, 'resources', 'cli', 'atom.js')
cp path.join('resources', 'win', 'apm.cmd'), path.join(shellAppDir, 'resources', 'cli', 'apm.cmd')
cp path.join('resources', 'win', 'apm.sh'), path.join(shellAppDir, 'resources', 'cli', 'apm.sh')
[ 'atom.cmd', 'atom.sh', 'atom.js', 'apm.cmd', 'apm.sh', 'file.ico' ]
.forEach (file) -> cp path.join('resources', 'win', file), path.join(shellAppDir, 'resources', 'cli', file)
if process.platform is 'linux'
cp path.join('resources', 'app-icons', channel, 'png'), path.join(buildDir, 'icons')

View File

@@ -40,3 +40,9 @@ test:
post:
- zip -r out/Atom.zip out/Atom.app
experimental:
notify:
branches:
only:
- master

View File

@@ -27,7 +27,12 @@ const atomExport = {
// Shell integration is required by both Squirrel and Settings-View
if (process.platform === 'win32') {
atomExport.WinShell = require('../src/main-process/win-shell')
Object.defineProperty(atomExport, 'WinShell', {
enumerable: true,
get () {
return require('../src/main-process/win-shell')
}
})
}
// The following classes can't be used from a Task handler and should therefore

View File

@@ -69,15 +69,15 @@
"atom-dark-ui": "0.52.0",
"atom-light-syntax": "0.28.0",
"atom-light-ui": "0.44.0",
"base16-tomorrow-dark-theme": "1.1.0",
"base16-tomorrow-light-theme": "1.1.1",
"base16-tomorrow-dark-theme": "1.2.0",
"base16-tomorrow-light-theme": "1.2.0",
"one-dark-ui": "1.5.0",
"one-light-ui": "1.5.0",
"one-dark-syntax": "1.3.0",
"one-light-syntax": "1.3.0",
"solarized-dark-syntax": "1.0.2",
"solarized-light-syntax": "1.0.2",
"about": "1.6.0",
"about": "1.7.0",
"archive-view": "0.61.1",
"autocomplete-atom-api": "0.10.0",
"autocomplete-css": "0.11.2",
@@ -87,13 +87,13 @@
"autoflow": "0.27.0",
"autosave": "0.23.1",
"background-tips": "0.26.1",
"bookmarks": "0.41.1",
"bookmarks": "0.42.0",
"bracket-matcher": "0.82.1",
"command-palette": "0.38.0",
"deprecation-cop": "0.54.1",
"dev-live-reload": "0.47.0",
"encoding-selector": "0.22.0",
"exception-reporting": "0.39.0",
"exception-reporting": "0.40.0",
"find-and-replace": "0.201.1",
"fuzzy-finder": "1.4.0",
"git-diff": "1.1.0",
@@ -105,11 +105,11 @@
"line-ending-selector": "0.5.0",
"link": "0.31.1",
"markdown-preview": "0.158.0",
"metrics": "0.53.1",
"notifications": "0.65.0",
"metrics": "1.0.0",
"notifications": "0.65.1",
"open-on-github": "1.2.0",
"package-generator": "1.0.0",
"settings-view": "0.241.2",
"settings-view": "0.242.0",
"snippets": "1.0.2",
"spell-check": "0.68.2",
"status-bar": "1.4.1",
@@ -117,9 +117,9 @@
"symbols-view": "0.113.1",
"tabs": "0.101.0",
"timecop": "0.33.2",
"tree-view": "0.209.0",
"tree-view": "0.209.2",
"update-package-dependencies": "0.10.0",
"welcome": "0.34.0",
"welcome": "0.35.1",
"whitespace": "0.33.0",
"wrap-guide": "0.38.2",
"language-c": "0.53.0",

BIN
resources/win/file.ico Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 64 KiB

View File

@@ -149,6 +149,55 @@ describe "ContextMenuManager", ->
shouldDisplay = false
expect(contextMenu.templateForEvent(dispatchedEvent)).toEqual []
it "prunes a trailing separator", ->
contextMenu.add
'.grandchild': [
{label: 'A', command: 'a'},
{type: 'separator'},
{label: 'B', command: 'b'},
{type: 'separator'}
]
expect(contextMenu.templateForEvent({target: grandchild}).length).toBe(3)
it "prunes a leading separator", ->
contextMenu.add
'.grandchild': [
{type: 'separator'},
{label: 'A', command: 'a'},
{type: 'separator'},
{label: 'B', command: 'b'}
]
expect(contextMenu.templateForEvent({target: grandchild}).length).toBe(3)
it "prunes duplicate separators", ->
contextMenu.add
'.grandchild': [
{label: 'A', command: 'a'},
{type: 'separator'},
{type: 'separator'},
{label: 'B', command: 'b'}
]
expect(contextMenu.templateForEvent({target: grandchild}).length).toBe(3)
it "prunes all redundant separators", ->
contextMenu.add
'.grandchild': [
{type: 'separator'},
{type: 'separator'},
{label: 'A', command: 'a'},
{type: 'separator'},
{type: 'separator'},
{label: 'B', command: 'b'}
{label: 'C', command: 'c'}
{type: 'separator'},
{type: 'separator'},
]
expect(contextMenu.templateForEvent({target: grandchild}).length).toBe(4)
it "throws an error when the selector is invalid", ->
addError = null
try

View File

@@ -1,5 +0,0 @@
"*":
welcome:
showOnStartup: false
"exception-reporting":
userId: "7c0a3c52-795c-5e20-5323-64efcf91f212"

View File

@@ -1,5 +1,6 @@
fs = require 'fs-plus'
path = require 'path'
season = require 'season'
temp = require('temp').track()
runAtom = require './helpers/start-atom'
@@ -8,7 +9,12 @@ describe "Smoke Test", ->
beforeEach ->
jasmine.useRealClock()
fs.writeFileSync(path.join(atomHome, 'config.cson'), fs.readFileSync(path.join(__dirname, 'fixtures', 'atom-home', 'config.cson')))
season.writeFileSync(path.join(atomHome, 'config.cson'), {
'*': {
welcome: {showOnStartup: false},
core: {telemetryConsent: 'no'}
}
})
it "can open a file in Atom and perform basic operations on it", ->
tempDirPath = temp.mkdirSync("empty-dir")

View File

@@ -22,7 +22,10 @@ describe('AtomApplication', function () {
// Symlinking the compile cache into the temporary home dir makes the windows load much faster
fs.symlinkSync(path.join(originalAtomHome, 'compile-cache'), path.join(process.env.ATOM_HOME, 'compile-cache'))
season.writeFileSync(path.join(process.env.ATOM_HOME, 'config.cson'), {
'*': {welcome: {showOnStartup: false}}
'*': {
welcome: {showOnStartup: false},
core: {telemetryConsent: 'no'}
}
})
atomApplicationsToDestroy = []
})

View File

@@ -85,6 +85,10 @@ export default class Color {
return `rgba(${this.red}, ${this.green}, ${this.blue}, ${this.alpha})`
}
toJSON () {
return this.alpha === 1 ? this.toHexString() : this.toRGBAString()
}
isEqual (color) {
if (this === color) {
return true

View File

@@ -145,8 +145,23 @@ class ContextMenuManager
currentTarget = currentTarget.parentElement
@pruneRedundantSeparators(template)
template
pruneRedundantSeparators: (menu) ->
keepNextItemIfSeparator = false
index = 0
while index < menu.length
if menu[index].type is 'separator'
if not keepNextItemIfSeparator or index is menu.length - 1
menu.splice(index, 1)
else
index++
else
keepNextItemIfSeparator = true
index++
# Returns an object compatible with `::add()` or `null`.
cloneItemForEvent: (item, event) ->
return null if item.devMode and not @devMode

View File

@@ -109,6 +109,8 @@ class AtomApplication
@loadState(options) or @openPath(options)
openWithOptions: ({initialPaths, pathsToOpen, executedFrom, urlsToOpen, test, pidToKillWhenClosed, devMode, safeMode, newWindow, logFile, profileStartup, timeout, clearWindowState, addToLastWindow, env}) ->
app.focus()
if test
@runTests({headless: true, devMode, @resourcePath, executedFrom, pathsToOpen, logFile, timeout, env})
else if pathsToOpen.length > 0

View File

@@ -3,6 +3,7 @@ Path = require 'path'
exeName = Path.basename(process.execPath)
appPath = "\"#{process.execPath}\""
fileIconPath = "\"#{Path.join(process.execPath, '..', 'resources', 'cli', 'file.ico')}\""
isBeta = appPath.includes(' Beta')
appName = exeName.replace('atom', (if isBeta then 'Atom Beta' else 'Atom' )).replace('.exe', '')
@@ -40,7 +41,11 @@ class ShellOption
exports.appName = appName
exports.fileHandler = new ShellOption("\\Software\\Classes\\Applications\\#{exeName}",
[{key: 'shell\\open\\command', name: '', value: "#{appPath} \"%1\""}]
[
{key: 'shell\\open\\command', name: '', value: "#{appPath} \"%1\""},
{key: 'shell\\open', name: 'FriendlyAppName', value: "#{appName}"},
{key: 'DefaultIcon', name: '', value: "#{fileIconPath}"}
]
)
contextParts = [