Skip to content

Commit

Permalink
Merged release/0.0.1 into master
Browse files Browse the repository at this point in the history
  • Loading branch information
federicoiosue committed Jan 4, 2017
2 parents 79b12e2 + 38aabff commit 2813fb4
Show file tree
Hide file tree
Showing 65 changed files with 1,913 additions and 19 deletions.
8 changes: 8 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
node_modules
bower_components
*.log
.sonar
data/
omni-notes-desktop-*/
*.iml
.idea/
75 changes: 56 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,30 +1,67 @@
# electron-quick-start
# Omni Notes Desktop

**Clone and run for a quick way to see an Electron in action.**
[![Stories in Ready](https://badge.waffle.io/federicoiosue/omni-notes-desktop.png?label=ready&title=Ready)](http://waffle.io/federicoiosue/omni-notes-desktop)
[![Codacy grade](https://img.shields.io/codacy/grade/a8a70aae80314f78bae3042fcac432db.svg?style=plastic)](https://www.codacy.com/app/federico-iosue/omni-notes-desktop/dashboard)

This is a minimal Electron application based on the [Quick Start Guide](http://electron.atom.io/docs/latest/tutorial/quick-start) within the Electron documentation.
<img src="https://github.com/federicoiosue/omni-notes-desktop/raw/develop/etc/img1.png" width="600" alt="Notes' list">
<img src="https://github.com/federicoiosue/omni-notes-desktop/raw/develop/etc/img2.png" width="600" alt="Note editing">

A basic Electron application needs just these files:
<img src="https://github.com/federicoiosue/omni-notes-desktop/raw/develop/etc/img3.png" width="600" alt="Keyboard hotkeys">

- `index.html` - A web page to render.
- `main.js` - Starts the app and creates a browser window to render HTML.
- `package.json` - Points to the app's main file and lists its details and dependencies.
This is the official desktop counterpart of the Android open-source note-taking app [Omni Notes](https://github.com/federicoiosue/Omni-Notes).
It's built on top [Electron](http://electron.atom.io) and [AngularJS](https://angularjs.org) technologies.

You can learn more about each of these components within the [Quick Start Guide](http://electron.atom.io/docs/latest/tutorial/quick-start).
## Features

## To Use
- Textual notes with title and content
- Full-text search
- Sorting
- Categorization
- Attachments with thumbnails
- Bulk actions (change category, archive, trash)
- Keyboard hotkeys

To clone and run this repository you'll need [Git](https://git-scm.com) and [Node.js](https://nodejs.org/en/download/) (which comes with [npm](http://npmjs.com)) installed on your computer. From your command line:
### Todo

```bash
# Clone this repository
git clone https://github.com/atom/electron-quick-start
# Go into the repository
cd electron-quick-start
# Install dependencies and run the app
npm install && npm start
- Checklist implementation
- Reminders
- Geolocation

## Compatibility

The application is cross-platform and runs on Linux, Windows and Mac.

It currently has no backend and just uses JSONs to store and read data. So, **no sync is supported**, if you want to keep data updated through different platforms you have to use third-party synchronization applications.

## Development

### Environment
To download all the needed dependencies for the application to run, listed into the _package.json_ file use the command: ```npm install angular```

### Build
[Electron Packager](https://github.com/electron-userland/electron-packager) is needed to build the project into executable binary.
```
sudo npm install electron-packager -g
```

After that simply run ```electron-packager .``` command from inside the project app to build for your platform.

Otherwise here the specific platform shortcuts for build commands (64bit architectures for Linux and MacOS, 32bit for Windows) that will prepare distributable folders into _dist_:

```
package-linux
```

```
package-mac
```

```
package-win
```

Learn more about Electron and its API in the [documentation](http://electron.atom.io/docs/latest).
## Developed with love and passion by
* Federico Iosue - [Website](http://www.iosue.it/federico)

#### License [CC0 (Public Domain)](LICENSE.md)
## License
The application is licensed under [GPL3](LICENSE.md) so, if you want to use it fully or any part of it you **have to** release the source code.
27 changes: 27 additions & 0 deletions app/app.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
var ONApp;

(function () {
'use strict';

var _templateBase = 'app/scripts';

ONApp = angular.module('ONApp', [
'ngRoute',
'ngMaterial',
'ngAnimate',
'ngMdIcons',
'colorpicker.module',
'LocalStorageModule',
'cfp.hotkeys',
'ngFileUpload',
'angularMoment'])
.config(['$routeProvider', function ($routeProvider) {
$routeProvider
.when('/', {
templateUrl: _templateBase + '/list/list.html'
});
$routeProvider.otherwise({
redirectTo: '/'
});
}]);
})();
172 changes: 172 additions & 0 deletions app/assets/css/common.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,172 @@
:root {
--selection-color: #E7E7E7;
--gray: #BBB;
}

body {
overflow: hidden;
}

::-webkit-scrollbar {
width: 0;
background: transparent;
}

/*Workaround for nested dmDialog instances*/

.md-dialog-backdrop:nth-of-type(even) {
z-index: 81;
}

.md-dialog-backdrop:nth-of-type(odd) {
z-index: 79;
}

.md-dialog-container:nth-of-type(even) {
z-index: 82;
}

.md-dialog-container:nth-of-type(odd) {
z-index: 80;
}

/*Toolbar*/

md-toolbar.md-hue-1 {
background-color: #fff !important;
}

md-toolbar.md-hue-1 md-input-container {
top: 9px;
margin-right: 16px;
}

/*Sidenav*/

#sidenav {
height: 100%;
overflow-y: scroll;
}

#rootView {
width: 100%;
overflow-y: scroll;
}

.menu-item ng-md-icon {
margin: auto;
margin-right: 15px;
}

ng-md-icon {
fill: currentColor;
vertical-align: middle;
display: inline-block;
line-height: 1;
}

.nav-active {
background-color: var(--selection-color);
font-weight: bold;
}

/* List */

.list-root {
height: 100%;
}

empty-view {
margin: auto;
}

empty-view p {
text-align: center;
color: var(--gray);
font-weight: bolder;
}

.selected-note {
background-color: var(--selection-color);
}

.note {
width: 100%;
height: 150px;
}

.note .category-ribbon {
width: 15px;
position: relative;
left: -15px;
}

.note .attachment-container {
position: relative;
left: 16px;
width: 150px;
height: 150px;
overflow: hidden;
}

.attachment {
width: 150px;
height: 150px;
object-fit: cover;
}

.generic-attachment {
padding: 16px;
}

.note-container {
height: 100%;
}

.note-title, .note-body, .note-date {
margin: 0;
}

.note-title {
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}

.note-body {
display: -webkit-box;
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
overflow: hidden;
text-overflow: ellipsis;
}
.note-date {
font-size: x-small;
}


/* Fab */

md-fab-speed-dial md-fab-trigger {
transition: 0.3s ease-in-out;
}

md-fab-speed-dial.ng-hide md-fab-trigger {
transform: scale(0);
}

md-fab-speed-dial.ng-hide-animate:not(.ng-hide) md-fab-trigger {
transform: scale(0);
}

/* Detail */

.note-detail .note-title input {
font-weight: bolder;
font-size: x-large;
}

.note-detail .attachment-container, .note-detail .attachment-inner-container, .note-detail .attachment {
width: 100%;
height: 100%;
}
1 change: 1 addition & 0 deletions app/assets/images/file-music.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions app/assets/images/file-pdf.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions app/assets/images/file-video.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions app/assets/images/file.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 added app/assets/images/logo_small.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
17 changes: 17 additions & 0 deletions app/scripts/Constants.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
ONApp.constant('CONSTANTS', {
NOTES_LOADED: 'notes_loaded',
NOTES_FILTERED: 'notes_filtered',
NOTE_MODIFIED: 'note_modified',
NOTES_SELECTED: 'notes_selected',
NOTES_SELECTED_CONFIRM: 'notes_selected_confirm',
NOTES_SORTED: 'notes_sorted',
NOTES_SEARCH_CANCELED: 'notes_search_canceled',
NAVIGATION_CHANGED: 'navigation_changed',
CATEGORY_MODIFIED: 'category_modified',
ATTACHMENTS_SUBFOLDER: 'attachments_subfolder',
ATTACHMENTS_THUMB_POSTFIX: '_thumb.jpg',
SORT_TITLE: 'title',
SORT_ALARM: 'alarm',
SORT_CREATION: 'creation',
SORT_LAST_MODIFICATION: 'lastModification'
});
8 changes: 8 additions & 0 deletions app/scripts/attachments/attachment.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<div class="attachment-inner-container" ng-controller="attachmentsController" ng-switch="isImgOrPdf(attachment)">
<img ng-switch-when="true" class="attachment" ng-src="{{getNoteThumbnail(attachment)}}" alt="{{attachment.name}}"/>
<div ng-switch-default class="generic-attachment">
<p>{{attachment.name}}</p>
<img ng-src="{{getNoteThumbnail(attachment)}}" alt="{{attachment.name}}"/>
<span>{{getMimeTypeSimple(attachment)}}</span>
</div>
</div>
35 changes: 35 additions & 0 deletions app/scripts/attachments/attachmentsController.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
angular.module('ONApp').controller('attachmentsController', ['$scope', 'storageService', 'thumbnailService', function ($scope, storageService, thumbnailService) {

$scope.attachmentsRoot = storageService.getAttachmentsFolder();

$scope.getNoteThumbnail = function (attachment) {
return thumbnailService.getAttachmentThumbnail(attachment, $scope.attachmentsRoot);
};

// $scope.getNotePdfThumbnail = function (note) {
// thumbnailService.getAttachmentThumbnail(note.attachmentsList[0], $scope.attachmentsRoot)
// .then(function (page) {
// var viewport = page.getViewport(0.2);
// var canvas = $('#pdf-' + note.attachmentsList[0].id)[0];
// canvas.height = viewport.height;
// canvas.width = viewport.width;
// page.render({
// canvasContext: canvas.getContext('2d'),
// viewport: viewport
// });
// });
// };

$scope.isImgOrPdf = function (attachment) {
return _.some(['image', 'pdf'], function (mimeType) {
return attachment.mime_type.indexOf(mimeType) > -1;
});
};

$scope.getMimeTypeSimple = function (attachment) {
var simpleMimeType = _.last(attachment.mime_type.split('/')[1].split('.'));
return simpleMimeType.charAt(0).toUpperCase() + simpleMimeType.slice(1);
};


}]);
25 changes: 25 additions & 0 deletions app/scripts/categories/categoriesSelection.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<md-dialog>

<md-dialog-content class="md-dialog-content">
<md-list>
<md-list-item class="menu-item md-2-line" ng-repeat="(key, category) in categories" role="link"
ng-click="categorySelected(category)" ng-class="{'nav-active': isPreselected(category)}">
<ng-md-icon icon="label" style="fill: {{category.color}}"/>
<div class="md-list-item-text">
<span>{{category.name}}</span>
</div>
</md-list-item>
</md-list>
</md-dialog-content>

<md-dialog-actions>
<md-button class="md-warn" ng-click="removeCategory()" aria-label="Remove category">Remove category</md-button>
<md-button ng-if="allowAdd" class="md-primary" ng-click="addNewCategory()" aria-label="Add new category">New
category
</md-button>
</md-dialog-actions>

</md-dialog>
</md-dialog-actions>

</md-dialog>
Loading

0 comments on commit 2813fb4

Please sign in to comment.