Skip to content

Commit

Permalink
Merge branch 'master' into tab-views
Browse files Browse the repository at this point in the history
  • Loading branch information
45kb authored Mar 7, 2017
2 parents 5f0b705 + 68ec86f commit 6e1a94b
Show file tree
Hide file tree
Showing 31 changed files with 355 additions and 181 deletions.
110 changes: 2 additions & 108 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ script:
- npm run build-mac
- npm run build-linux
- export VERSION=$(echo $TRAVIS_TAG | tr -d "v")
- curl -F package=@releases/ndm_$(echo $VERSION)_amd64.deb https://[email protected]/720kb/
- curl -F package=@releases/ndm_$(echo $VERSION).rpm https://[email protected]/720kb/
deploy:
- provider: releases
api_key: $GITHUB_ACCESS_TOKEN
Expand All @@ -23,111 +25,3 @@ deploy:
skip_cleanup: true
on:
tags: true
- provider: packagecloud
repository: "ndm"
username: "wouldgo"
token: $PACKAGECLOUD_TOKEN
dist: "debian/buster"
package_glob: releases/**/*.deb
skip_cleanup: true
on:
tags: true
- provider: packagecloud
repository: "ndm"
username: "wouldgo"
token: $PACKAGECLOUD_TOKEN
dist: "elementaryos/freya"
package_glob: releases/**/*.deb
skip_cleanup: true
on:
tags: true
- provider: packagecloud
repository: "ndm"
username: "wouldgo"
token: $PACKAGECLOUD_TOKEN
dist: "ubuntu/trusty"
package_glob: releases/**/*.deb
skip_cleanup: true
on:
tags: true
- provider: packagecloud
repository: "ndm"
username: "wouldgo"
token: $PACKAGECLOUD_TOKEN
dist: "ubuntu/utopic"
package_glob: releases/**/*.deb
skip_cleanup: true
on:
tags: true
- provider: packagecloud
repository: "ndm"
username: "wouldgo"
token: $PACKAGECLOUD_TOKEN
dist: "ubuntu/vivid"
package_glob: releases/**/*.deb
skip_cleanup: true
on:
tags: true
- provider: packagecloud
repository: "ndm"
username: "wouldgo"
token: $PACKAGECLOUD_TOKEN
dist: "ubuntu/wily"
package_glob: releases/**/*.deb
skip_cleanup: true
on:
tags: true
- provider: packagecloud
repository: "ndm"
username: "wouldgo"
token: $PACKAGECLOUD_TOKEN
dist: "ubuntu/xenial"
package_glob: releases/**/*.deb
skip_cleanup: true
on:
tags: true
- provider: packagecloud
repository: "ndm"
username: "wouldgo"
token: $PACKAGECLOUD_TOKEN
dist: "ubuntu/yakkety"
package_glob: releases/**/*.deb
skip_cleanup: true
on:
tags: true
- provider: packagecloud
repository: "ndm"
username: "wouldgo"
token: $PACKAGECLOUD_TOKEN
dist: "linuxmint/serena"
package_glob: releases/**/*.deb
skip_cleanup: true
on:
tags: true
- provider: packagecloud
repository: "ndm"
username: "wouldgo"
token: $PACKAGECLOUD_TOKEN
dist: "opensuse/42.1"
package_glob: releases/**/*.rpm
skip_cleanup: true
on:
tags: true
- provider: packagecloud
repository: "ndm"
username: "wouldgo"
token: $PACKAGECLOUD_TOKEN
dist: "fedora/25"
package_glob: releases/**/*.rpm
skip_cleanup: true
on:
tags: true
- provider: packagecloud
repository: "ndm"
username: "wouldgo"
token: $PACKAGECLOUD_TOKEN
dist: "el/7"
package_glob: releases/**/*.rpm
skip_cleanup: true
on:
tags: true
3 changes: 0 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,6 @@ Runs on Linux, MacOS and Windows; **ndm** stands for "npm desktop manager".
<a href="https://ci.appveyor.com/project/45kb/ndm">
<img src="https://ci.appveyor.com/api/projects/status/da313gnkvdbbvflh?svg=true"/>
</a>
<a href="https://snyk.io/test/github/720kb/ndm/09d8e74149402546cdc48a3df11c76496b19e29d">
<img src="https://snyk.io/test/github/720kb/ndm/09d8e74149402546cdc48a3df11c76496b19e29d/badge.svg"/>
</a>
<a href="https://720kb.github.io/ndm/" target="_blank">
<img src="https://img.shields.io/github/downloads/720kb/ndm/total.svg"/>
</a>
Expand Down
7 changes: 5 additions & 2 deletions lib/footer.pug
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,13 @@
| v{{shell.npmCurrentVersionBadge}}
button.button-global(type="button", title="Enable ndm in global folder", ng-show="shell.globalDisabled", ng-click="shell.enableGlobal()")
i.fa.fa-globe.color-primary
| Enable globals
| Enable
button.button-update(type="button", ng-show="!shell.globalDisabled && shell.npmCurrentVersionBadge", title="Update npm", ng-click="shell.activeClickedLink('update'); shell.updateNpm()")
i.fa.fa-history
| Update npm
| Update
button.button-update(type="button", title="Run doctor", ng-click="shell.activeClickedLink('doctor'); shell.runDoctor()")
i.fa.fa-doctor
| Doctor
span(class="npm-status", ng-mouseenter="shell.checkRegistryStatus()")
i.fa.fa-disk(title="npm registry is available", ng-show="!shell.loadingRegistryStatus && shell.registryStatus")
i.fa.fa-disk(title="npm registry checking ...", ng-show="shell.loadingRegistryStatus")
Expand Down
6 changes: 6 additions & 0 deletions lib/icons/fontello/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,12 @@
"css": "globe",
"code": 59394,
"src": "fontawesome"
},
{
"uid": "5590d2f643b64d2d0757ae660f9c24cb",
"css": "doctor",
"code": 61681,
"src": "fontawesome"
}
]
}
1 change: 1 addition & 0 deletions lib/icons/fontello/css/fontello-codes.css
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
.fa-sort:before { content: '\f0dc'; } /* '' */
.fa-sort-down:before { content: '\f0dd'; } /* '' */
.fa-sort-up:before { content: '\f0de'; } /* '' */
.fa-doctor:before { content: '\f0f1'; } /* '' */
.fa-circle:before { content: '\f111'; } /* '' */
.fa-rocket:before { content: '\f135'; } /* '' */
.fa-level-up:before { content: '\f148'; } /* '' */
Expand Down
13 changes: 7 additions & 6 deletions lib/icons/fontello/css/fontello-embedded.css

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions lib/icons/fontello/css/fontello-ie7-codes.css
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
.fa-sort { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '&#xf0dc;&nbsp;'); }
.fa-sort-down { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '&#xf0dd;&nbsp;'); }
.fa-sort-up { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '&#xf0de;&nbsp;'); }
.fa-doctor { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '&#xf0f1;&nbsp;'); }
.fa-circle { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '&#xf111;&nbsp;'); }
.fa-rocket { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '&#xf135;&nbsp;'); }
.fa-level-up { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '&#xf148;&nbsp;'); }
Expand Down
1 change: 1 addition & 0 deletions lib/icons/fontello/css/fontello-ie7.css
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
.fa-sort { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '&#xf0dc;&nbsp;'); }
.fa-sort-down { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '&#xf0dd;&nbsp;'); }
.fa-sort-up { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '&#xf0de;&nbsp;'); }
.fa-doctor { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '&#xf0f1;&nbsp;'); }
.fa-circle { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '&#xf111;&nbsp;'); }
.fa-rocket { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '&#xf135;&nbsp;'); }
.fa-level-up { *zoom: expression( this.runtimeStyle['zoom'] = '1', this.innerHTML = '&#xf148;&nbsp;'); }
Expand Down
15 changes: 8 additions & 7 deletions lib/icons/fontello/css/fontello.css
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
@font-face {
font-family: 'fontello';
src: url('../font/fontello.eot?13933329');
src: url('../font/fontello.eot?13933329#iefix') format('embedded-opentype'),
url('../font/fontello.woff2?13933329') format('woff2'),
url('../font/fontello.woff?13933329') format('woff'),
url('../font/fontello.ttf?13933329') format('truetype'),
url('../font/fontello.svg?13933329#fontello') format('svg');
src: url('../font/fontello.eot?69907723');
src: url('../font/fontello.eot?69907723#iefix') format('embedded-opentype'),
url('../font/fontello.woff2?69907723') format('woff2'),
url('../font/fontello.woff?69907723') format('woff'),
url('../font/fontello.ttf?69907723') format('truetype'),
url('../font/fontello.svg?69907723#fontello') format('svg');
font-weight: normal;
font-style: normal;
}
Expand All @@ -15,7 +15,7 @@
@media screen and (-webkit-min-device-pixel-ratio:0) {
@font-face {
font-family: 'fontello';
src: url('../font/fontello.svg?13933329#fontello') format('svg');
src: url('../font/fontello.svg?69907723#fontello') format('svg');
}
}
*/
Expand Down Expand Up @@ -70,6 +70,7 @@
.fa-sort:before { content: '\f0dc'; } /* '' */
.fa-sort-down:before { content: '\f0dd'; } /* '' */
.fa-sort-up:before { content: '\f0de'; } /* '' */
.fa-doctor:before { content: '\f0f1'; } /* '' */
.fa-circle:before { content: '\f111'; } /* '' */
.fa-rocket:before { content: '\f135'; } /* '' */
.fa-level-up:before { content: '\f148'; } /* '' */
Expand Down
Binary file modified lib/icons/fontello/font/fontello.eot
Binary file not shown.
2 changes: 2 additions & 0 deletions lib/icons/fontello/font/fontello.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified lib/icons/fontello/font/fontello.ttf
Binary file not shown.
Binary file modified lib/icons/fontello/font/fontello.woff
Binary file not shown.
Binary file modified lib/icons/fontello/font/fontello.woff2
Binary file not shown.
16 changes: 14 additions & 2 deletions lib/install-new-package.pug
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
div.dialog.prompt(ng-if="activeLink === '1'")
form(ng-submit='installPackage(packageName, newPackageKind)')
<!--do not remove placeholder even if it's not an input-->
div(class="tags-input", ng-model="packageName", contenteditable="true", ng-attr-disabled="{{installingPackage ? 'disabled' : ''}}" placeholder="package<@version> ..." ng-tag-input, ng-autofocus)
div(class="tags-input", ng-tag-input, ng-autofocus, ng-model="topMenu.packageName", ng-keyup="topMenu.search(topMenu.packageName[topMenu.packageName.length - 1].name)", contenteditable="true", ng-attr-disabled="{{topMenu.installingPackage ? 'disabled' : ''}}" placeholder="package<@version> ...")
<!-- this input holds search keywords, do not remove it -->
input(ng-hide="true", ng-model="topMenu.searchKeywords", ng-bind="topMenu.packageName")
= " "
span(class="prompt-kind")
input(type="checkbox", ng-model='newPackageKind', ng-disabled='shell.globalSelected')
Expand All @@ -17,4 +19,14 @@ div.dialog.prompt(ng-if="activeLink === '1'")
img(src="img/loading.svg", width="13")
= " "
= " "
i(class="fa fa-times-circle-o button-close-prompt", ng-click="destroyActiveClickedLink()")
i(class="fa fa-times-circle-o button-close-prompt", ng-click="shell.activeLink = undefined")
.prompt-search
.prompt-search-content
.prompt-search-item(ng-repeat="item in topMenu.searchResults.objects", ng-click="topMenu.searchChoosePackage(item.package.name)")
h5
| {{item.package.name}}
div
| {{item.package.description}}
.prompt-search-loader(ng-show="topMenu.searchingNpm")
img(src="img/loading.svg")
| Loading results ...
21 changes: 19 additions & 2 deletions lib/js/directives/ng-tag-input.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import angular from 'angular';
const moduleName = 'npm-ui.ng-tag-input';

angular.module(moduleName, [])
.directive('ngTagInput', /*@ngInject*/ function ngTagInput($log) {
.directive('ngTagInput', /*@ngInject*/ function ngTagInput($rootScope, $log) {
return {
'require': '?ngModel',
'link': (scope, element, attrs, ngModel) => {
Expand Down Expand Up @@ -115,7 +115,23 @@ angular.module(moduleName, [])
}
, onKeypressDisabled = event => {
return event.preventDefault();
};
}
, updateOnSearchChoosenPackage = $rootScope.$on('top-menu:search-choosen-package', (eventInformation, data) => {
let newInputValue = '';

data.forEach(pkg => {
newInputValue += pkg.name;
if (pkg.version &&
pkg.version.length > 0) {
newInputValue += `@${pkg.version}`;
}
newInputValue += ' '; //leave a blank space at the end of the string to split into tags again
});

element[0].innerText = newInputValue;
createTags();
updateModel();
});

element.on('mousedown', onTrigger);
element.on('click', onTrigger);
Expand All @@ -133,6 +149,7 @@ angular.module(moduleName, [])
}
});
scope.$on('$destroy', () => {
updateOnSearchChoosenPackage();
element.unbind('keyup', onKeyUp);
element.unbind('keydown', onKeyDown);
element.unbind('paste', onPaste);
Expand Down
11 changes: 11 additions & 0 deletions lib/js/filters.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import angular from 'angular';
const moduleName = 'npm-ui.filters';

angular.module(moduleName, [])
.filter('removeHTML', () => {
return string => {
return string.replace(/<\/?[^>]+(>|$)/g, '');
};
});

export default moduleName;
10 changes: 6 additions & 4 deletions lib/js/index.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
/*globals require process navigator */
import angular from 'angular';
import loadingModule from './loading.js';
import notificationModule from './notification.js';
import shellModule from './interface/shell.js';
import contentModule from './interface/content.js';
import leftModule from './interface/left.js';
import topModule from './interface/top.js';
import errorsModule from './errors.js';
import ngRightClickModule from './directives/ng-right-click.js';
import ngDragDropModule from './directives/ng-drag-drop.js';
import ngAceEditor from './directives/ng-ace-editor.js';
Expand All @@ -17,6 +14,10 @@ import ngTagInput from './directives/ng-tag-input.js';
import ngTableKeyboard from './directives/ng-table-keyboard.js';

import assetsModule from './assets.js';
import loadingModule from './loading.js';
import errorsModule from './errors.js';
import filtersModule from './filters.js';
import notificationModule from './notification.js';

const Storage = require('electron-storage')
, {ipcRenderer} = require('electron')
Expand All @@ -42,7 +43,8 @@ angular.module('ndm', [
ngAutofocus,
ngTagInput,
ngTableKeyboard,
assetsModule
assetsModule,
filtersModule
])
.constant('timeoutForWhenUserIsPresent', 2500)
.constant('appHistoryFile', 'snapshots.json')
Expand Down
42 changes: 42 additions & 0 deletions lib/js/interface/shell.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ angular.module(moduleName, [
loadingFactory,
notificationFactory,
assets) {

const chooseProjectDir = files => {
let pathExt;

Expand Down Expand Up @@ -286,6 +287,47 @@ angular.module(moduleName, [
}
};


this.runDoctor = () => {

if (!this.runningDoctor) {
this.finishedRunningDoctor = false;
this.runningDoctor = true;
npm.npmInFolder('')
.then(npmInFolder => npmInFolder.doctor().then(doctorRes => {
//replace bad chars in log
$scope.$apply(() => {
this.doctorLog = doctorRes.map(logs => logs.map(log => log.replace(/\[\d\dm/g, '')));
this.runningDoctor = undefined;
this.finishedRunningDoctor = true;
});
$log.info('npm doctor:', doctorRes);
notificationFactory.notify('Finished running doctor.');
}))
.catch(err => {
$log.error('npm doctor error:', err);
$scope.$apply(() => {
this.runningDoctor = undefined;
this.finishedRunningDoctor = true;
});
});
}
};

this.activeClickedLink = activeLink => {
if ((activeLink === '1' || activeLink === '4') &&
this.activeLink === activeLink) {
//toggle prompts show/hide
this.activeLink = false;
} else {

this.activeLink = activeLink;
$rootScope.$emit('top-bar:active-link', {
'link': activeLink
});
}
};

this.openChooser = () => {

dialog.showOpenDialog({
Expand Down
Loading

0 comments on commit 6e1a94b

Please sign in to comment.