Skip to content
This repository has been archived by the owner on Oct 8, 2021. It is now read-only.

Commit

Permalink
Merge pull request #167 from atdrago/release/v0.10.2
Browse files Browse the repository at this point in the history
Release/v0.10.2
  • Loading branch information
atdrago committed Oct 29, 2017
2 parents 5eab9f8 + 13dc671 commit e5e8148
Show file tree
Hide file tree
Showing 49 changed files with 8,926 additions and 948 deletions.
3 changes: 2 additions & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
"NegativeTabs": true,
"NegativeTrafficLights": true,
"SettingsForm": true,
"UndoManager": true
"UndoManager": true,
"__args__": true
},
"rules": {
"block-spacing": [
Expand Down
6 changes: 3 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ os: osx
language: node_js

node_js:
- "6.2.0"
- "8.1.2"

osx_image: xcode7.3
osx_image: xcode9

addons:
apt:
Expand All @@ -19,4 +19,4 @@ install:
- export DISPLAY=':99.0'
- Xvfb :99 -screen 0 1024x768x24 > /dev/null 2>&1 &
- npm install
- npm run build
- npm run build
9 changes: 4 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,21 +7,20 @@
Follow [@NegativeJS](https://twitter.com/negativejs) on Twitter for important updates.

## Download
**Important Note:** Users running Negative v0.10.0 may experience an application crash when opening the Settings window. Negative v0.10.1 solves this issue. If the update did not download automatically, please download it manually from the link below. If automatic updates were enabled, it is very likely that v0.10.1 was automatically installed after the crash. Please check your version in "Negative > About Negative". If the version is v0.10.1 or higher, no further action is needed on your part. I apologize for any inconvenience this may have caused you. - Adam
- [Negative v0.10.1 for Mac OS X](https://github.com/atdrago/negative/releases/download/v0.10.1/Negative-v0.10.1.dmg)
- [Negative v0.10.2 for Mac OS X](https://github.com/atdrago/negative/releases/download/v0.10.2/Negative-v0.10.2.dmg)

## User Documentation
Please check [negative/releases](https://github.com/atdrago/negative/releases) for details on changes between versions.
- [Usage](docs/usage.md)

## Contributing
All contributions are welcome!! Please check [negative/issues](https://github.com/atdrago/negative/issues) for things that need attention, or feel free to create your own. Please make sure you create an issue *first*, and then do the work and a submit a PR.
All contributions are welcome!! Please check [negative/issues](https://github.com/atdrago/negative/issues) for things that need attention, or feel free to create your own. Please make sure you create an issue *first*, and then do the work and a submit a PR.

## Build Negative.app

Currently only Mac OS X is supported.

1. [Install Node.js](https://nodejs.org/en/) >= v6
1. [Install Node.js](https://nodejs.org/en/) >= v8
2. `git clone https://github.com/atdrago/negative.git`
3. `cd negative`
4. `npm install`
Expand Down Expand Up @@ -51,7 +50,7 @@ Currently only Mac OS X is supported.
3. Runs `npm install --production` in `./release/`
4. Builds the app moves it to `./dist/`
- `npm run lint` - Run ESLint
- `npm test` - Run Mocha tests
- `npm test` - Run Mocha tests
- `npm run travis`
1. Run `build`
2. Run `test`
Expand Down
37 changes: 17 additions & 20 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,9 @@ const del = require('del');
const eslint = require('gulp-eslint');
const fs = require('fs');
const gulp = require('gulp');
const gulpUglify = require('gulp-uglify/minifier');
const packager = require('electron-packager');
const runSequence = require('run-sequence');
const sass = require('gulp-sass');
const uglifyJs = require('uglify-js');
const watch = require('gulp-watch');
const wrap = require('gulp-wrap');
const jsDest = 'view';
Expand All @@ -34,7 +32,6 @@ function compileJs(src, dest, filename) {
return gulp.src(src)
.pipe(concat(filename))
.pipe(wrap("(function (window, document, JSON) { <%= contents %> })(window, document, JSON);"))
.pipe(gulpUglify({}, uglifyJs).on('error', (err) => console.log(err)))
.pipe(changed(jsDest, {
hasChanged: changed.compareSha1Digest
}))
Expand Down Expand Up @@ -121,8 +118,8 @@ gulp.task('release:test', () => {

gulp.task('release', () => {
return runSequence(
'release:clean',
[ 'js:index', 'js:settings', 'sass'],
'release:clean',
[ 'js:index', 'js:settings', 'sass'],
['release:root', 'release:resources', 'release:view', 'release:lib', 'release:config', 'release:test']
);
});
Expand All @@ -132,29 +129,29 @@ gulp.task('release', () => {
gulp.task('build', (done) => {
const config = JSON.parse(fs.readFileSync('package.json'));
const appVersion = config.version;
const electronVersion = config.devDependencies['electron-prebuilt'].match(/[\d.]+/)[0];
const electronVersion = config.devDependencies['electron'].match(/[\d.]+/)[0];
const options = {
arch: 'x64',
asar: true,
asar: false,
dir: 'release',
icon: './resources/negative.icns',
name: 'Negative',
out: 'dist',
overwrite: true,
platform: 'darwin',
prune: true,
version: electronVersion,
'app-bundle-id': 'com.adamdrago.negative',
'helper-bundle-id': 'com.adamdrago.negative.helper',
'app-version': appVersion,
'extend-info': './resources-osx/Info.plist'
electronVersion: electronVersion,
appBundleId: 'com.adamdrago.negative',
helperBundleId: 'com.adamdrago.negative.helper',
appVersion: appVersion,
extendInfo: './resources-osx/Info.plist'
};

packager(options, (err, paths) => {
if (err) {
console.error(err);
}

done();
});
});
Expand All @@ -163,25 +160,25 @@ gulp.task('bump', (done) => {
const argv = require('yargs')
.alias('v', 'version')
.argv;

const config = JSON.parse(fs.readFileSync('package.json'));
const appVersion = config.version;
const newVersion = argv.version;

config.version = newVersion;

fs.writeFile('package.json', JSON.stringify(config, null, 2), (err) => {
if (err) {
throw err;
}

const readme = fs.readFileSync('README.md').toString();

fs.writeFile('README.md', readme.replace(new RegExp(appVersion, 'g'), newVersion), (err) => {
if (err) {
throw err;
}

done();
});
});
Expand Down
11 changes: 10 additions & 1 deletion lib/factories/window-factory.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@ const {
} = require('../../config/constants');

module.exports = {
/**
* Create a new Negative window
* @param {Object} _window Window settings object
* @return {BrowserWindow} A new Negative window
*/
negativeWindow(_window) {
const bounds = _window ? _window.bounds : {};

Expand All @@ -35,7 +40,11 @@ module.exports = {

return newWindow;
},


/**
* Create a new Settings window
* @return {BrowserWindow} A new Settings window
*/
settingsWindow() {
return electronWindow.createWindow({
acceptFirstMouse: true,
Expand Down
11 changes: 10 additions & 1 deletion lib/negative-menu.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ const DEFAULT_NEGATIVE_MENU_STATES = {
canRedo: false,
canCapture: true,
isImageEmpty: true,
isInverted: true,
isTranslucent: true,
canReload: true,
canToggleDevTools: true,
canMinimize: true,
Expand All @@ -42,6 +44,8 @@ const DEFAULT_SETTINGS_MENU_STATES = {
canRedo: false,
canCapture: false,
isImageEmpty: true,
isInverted: true,
isTranslucent: true,
canReload: false,
canToggleDevTools: true,
canMinimize: true,
Expand Down Expand Up @@ -76,9 +80,9 @@ module.exports = {
menuStates = Object.assign({}, DEFAULT_NEGATIVE_MENU_STATES, lastNegativeMenuStates, menuStates);
}

menuStates.isDarkMode = negative.isDarkMode;
menuStates.isAppHidden = negative.isAppHidden;
menuStates.isAppLocked = negative.isAppLocked;
menuStates.isDarkMode = negative.isDarkMode;

if (!isSettingsWindow) {
lastNegativeMenuStates = menuStates;
Expand All @@ -104,6 +108,8 @@ module.exports = {
isAppLocked,
isDarkMode,
isImageEmpty,
isInverted,
isTranslucent,
canReload,
canToggleDevTools,
canMinimize,
Expand Down Expand Up @@ -158,6 +164,9 @@ module.exports = {
MENU_SEPARATOR,
{ label: 'Dark Mode', accelerator: 'Command+D', click: () => negative.toggleDarkMode(), type: 'checkbox', checked: isDarkMode },
MENU_SEPARATOR,
{ label: 'Translucence', accelerator: 'Command+L', click: () => negative.toggleTranslucence(), type: 'checkbox', checked: isTranslucent },
{ label: 'Inversion', accelerator: 'Command+I', click: () => negative.toggleInversion(), type: 'checkbox', checked: isInverted },
MENU_SEPARATOR,
{ label: 'Actual Size', accelerator: 'Command+0', click: () => negative.zoomTo(DEFAULT_ZOOM_LEVEL), enabled: !isImageEmpty },
{ label: 'Zoom In', accelerator: 'Command+Plus', click: () => negative.zoomIn(), enabled: canZoomIn },
{ label: 'Zoom Out', accelerator: 'Command+-', click: () => negative.zoomOut(), enabled: canZoomOut },
Expand Down
2 changes: 2 additions & 0 deletions lib/negative-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,8 @@ module.exports = {
ipcMain.on('test-capture', () => simulateMenuClick(['View', 'Capture']));
ipcMain.on('test-clear', () => simulateMenuClick(['View', 'Clear']));
ipcMain.on('test-dark-mode', () => simulateMenuClick(['View', 'Dark Mode']));
ipcMain.on('test-translucence', () => simulateMenuClick(['View', 'Translucence']));
ipcMain.on('test-inversion', () => simulateMenuClick(['View', 'Inversion']));
ipcMain.on('test-actual-size', () => simulateMenuClick(['View', 'Actual Size']));
ipcMain.on('test-zoom-in', () => simulateMenuClick(['View', 'Zoom In']));
ipcMain.on('test-zoom-out', () => simulateMenuClick(['View', 'Zoom Out']));
Expand Down

0 comments on commit e5e8148

Please sign in to comment.