Skip to content

Commit 0324402

Browse files
committed
Removed direct db call from controllers
1 parent 71e2f55 commit 0324402

File tree

6 files changed

+28
-40
lines changed

6 files changed

+28
-40
lines changed

README.md

Lines changed: 13 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
OpenNote [![Build Status](https://travis-ci.org/FoxUSA/OpenNote.png?branch=master)](https://travis-ci.org/FoxUSA/OpenNote)
2-
=============
1+
# OpenNote [![Build Status](https://travis-ci.org/FoxUSA/OpenNote.png?branch=master)](https://travis-ci.org/FoxUSA/OpenNote)
2+
33
![][responsive]
4-
OpenNote was built to be a open source(MIT License), web based note taking software.
5-
It is designed to be self hosted and gives you ownership of your data.
4+
OpenNote is a progressive web application(PWA)/HTML5 offline app that was built to be a open source(MIT License), web based text editor/note taking software.
5+
It is designed to be self hosted and gives you ownership of your data
66

77
Please support this project by:
88
- [Using GitTip][GitTip],
@@ -25,9 +25,7 @@ https://foxusa.github.io/OpenNote/OpenNote/
2525
Features
2626
--------
2727
- BYOS(Bring Your Own Server)
28-
- Full WYSIWYG editor
2928
- Touch friendly and mouse friendly ui
30-
- Upload manager (not enabled in demo :) )
3129
- Light weight
3230
- Multi user support
3331
- Search
@@ -36,36 +34,25 @@ Features
3634
- Move Folders(Drag into another folder in the list view.)
3735
- Rename/Delete Folders(Click on folder title to get menu.)
3836
- Responsive
39-
37+
- Tags
38+
- [CLI](https://github.com/FoxUSA/OpenNote-CLI)
4039
Upcoming Features
4140
-----------------
42-
- Tags (You win)
4341
- Email to note
44-
- Implement history viewer
45-
- Install script
46-
- Move Notes (Feature lost when migrating to Angular based list)
4742
- Mobile App
4843

4944
Documentation
5045
-----------------
51-
[How to install][Install]
52-
53-
[How to upgrade][Upgrade]
54-
55-
[How to build](https://github.com/FoxUSA/OpenNote/blob/master/docs/Build.md)
56-
57-
[Themes][Themes]
58-
59-
[PHP backend][php]
60-
46+
- [How to install][Install]
47+
- [How to upgrade][Upgrade]
48+
- [How to build](https://github.com/FoxUSA/OpenNote/blob/master/docs/Build.md)
49+
-[Themes][Themes]
6150

62-
![][dark]
6351
License
6452
-------
6553
JQuery - Distributed under the MIT License
6654
Angular - Distributed under the MIT License
6755
Bootstrap - Distributed under the MIT License
68-
CKEditor - Distributed under the MPL License
6956
Angular UI Tree - Distributed under the MIT License
7057
Alertify.js - Distributed under the MIT License
7158
PouchDB - Distributed under the Apache License
@@ -74,21 +61,19 @@ License
7461

7562
OpenNote Code - Distributed under the MIT License
7663

77-
© Jacob Liscom 2017
64+
© Jacob Liscom 2018
7865

7966
Credits
8067
-------
8168
J. Liscom - Creator
8269

8370
Kam Bnkamalesh - His TODO project heavily influenced my UI design
8471

85-
[topLevel]: https://raw.github.com/FoxUSA/OpenNote/master/docs/screenShots/topLevel.png
86-
[dark]: https://raw.github.com/FoxUSA/OpenNote/master/docs/screenShots/dark1.png
87-
[responsive]: https://raw.githubusercontent.com/FoxUSA/OpenNote/master/docs/screenShots/OpenNote.png
72+
[topLevel]: ./docs/screenShots/topLevel.png
73+
[responsive]: ./docs/screenShots/OpenNote.png
8874

8975
[Install]: https://github.com/FoxUSA/OpenNote/blob/master/docs/Install.md
9076
[Upgrade]: https://github.com/FoxUSA/OpenNote/blob/master/docs/Upgrade.md
91-
[PHP]: https://github.com/FoxUSA/OpenNoteService-PHP
9277
[Dependencies]: https://github.com/FoxUSA/OpenNote/blob/master/docs/Dependencies.md
9378
[Themes]: https://github.com/FoxUSA/OpenNote/blob/master/docs/Themes.md
9479
[GitTip]: https://www.gittip.com/FoxUSA/

docs/Upgrade.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# How to upgrade
22

3+
//TODO
4+
5+
If you have an issue with the html use https://domchristie.github.io/turndown/ to convert
6+
37
##Upgrading from 14.xx(Locomotive) to 15.07.01
48
All you need to do is merge your existing deployment with the release folder while keeping your config files (`openNote\openNote.config.js` and `\Service\Config.php`).
59
Make sure to backup your old folder and database.

openNote/controllers/folderController.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ openNote.controller("folderController", ["$scope",
100100
};
101101
loadCurrentFolderContents();
102102
} else {
103-
storageService.database().get($routeParams.id).then(function(doc) {
103+
storageService.get($routeParams.id).then(function(doc) {
104104
$scope.currentFolder = doc;
105105
loadCurrentFolderContents();
106106

@@ -109,7 +109,7 @@ openNote.controller("folderController", ["$scope",
109109
name: "Home"
110110
};
111111
else
112-
storageService.database().get($scope.currentFolder.parentFolderID).then(function(doc) {
112+
storageService.get($scope.currentFolder.parentFolderID).then(function(doc) {
113113
$scope.parentFolder = doc;
114114
$scope.$apply();
115115
});
@@ -175,7 +175,7 @@ openNote.controller("folderController", ["$scope",
175175
return;
176176

177177
$scope.currentFolder.name = data;
178-
storageService.database().put($scope.currentFolder).then(function(result) {
178+
storageService.put($scope.currentFolder).then(function(result) {
179179
$scope.currentFolder._rev = result.rev;
180180
$rootScope.$emit("reloadListView", {});
181181
$scope.$apply();
@@ -227,7 +227,7 @@ openNote.controller("folderController", ["$scope",
227227
*/
228228
var createFolder = function(folder) {
229229
folder.type = "folder";
230-
storageService.database().post(folder).then(function(response) {
230+
storageService.post(folder).then(function(response) {
231231
if (!response.ok)
232232
throw "//FIXME";
233233
$rootScope.$emit("reloadListView", {});
@@ -243,7 +243,7 @@ openNote.controller("folderController", ["$scope",
243243
* Load the current folders contents
244244
*/
245245
var loadCurrentFolderContents = function() {
246-
storageService.loadFolderContents($scope.currentFolder._id, function(results) {
246+
storageService.loadFolderContents($scope.currentFolder._id).then(function(results) {
247247
$scope.currentFolderContents = results.rows;
248248

249249
$scope.$apply();

openNote/controllers/noteController.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -149,11 +149,11 @@ openNote.controller("noteController", ["$scope",
149149

150150
//Upsert
151151
if (!$scope.note._id)
152-
storageService.database().post($scope.note).then(saveCallback, function() {
152+
storageService.post($scope.note).then(saveCallback, function() {
153153
alertify.error("Error saving note");
154154
});
155155
else
156-
storageService.database().put($scope.note).then(saveCallback, function() {
156+
storageService.put($scope.note).then(saveCallback, function() {
157157
alertify.error("Error modifing note");
158158
});
159159
});
@@ -170,7 +170,7 @@ openNote.controller("noteController", ["$scope",
170170

171171
var folderID = $scope.note.parentFolderID; //need to keep track of this because we are about to delete it
172172
$(".notePartial").fadeOut(config.fadeSpeedShort());
173-
storageService.database().remove($scope.note).then(function() {
173+
storageService.delete($scope.note).then(function() {
174174
$rootScope.$emit("noteDeleted", $scope.note);
175175
detachWindowUnload();
176176
alertify.success("Note Deleted"); //all done. close the notify dialog
@@ -234,7 +234,7 @@ openNote.controller("noteController", ["$scope",
234234
/**
235235
* Load note
236236
*/
237-
storageService.database().get($routeParams.id).then(function(doc) {
237+
storageService.get($routeParams.id).then(function(doc) {
238238
$scope.note = doc;
239239
$scope.noteHTML = marked($scope.note.note);
240240
$(".notePartial").fadeIn(config.fadeSpeedLong());

openNote/controllers/tagController.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,8 @@ openNote.controller("tagController", ["$scope",
3232
var loadTags = function() {
3333
tagService.getMap().then(function(map) {
3434
var tags = map.tags[$scope.tag];
35-
var db = storageService.database();
3635
tags.forEach(function(tag) {
37-
db.get(tag).then(function(note) {
36+
storageService.get(tag).then(function(note) {
3837
$scope.notes.push(note);
3938
$scope.$apply();
4039
});

openNote/controllers/tagListController.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ openNote.controller("tagListController", [
5353
var origParentFolderID = request.moveObject.parentFolderID;
5454

5555
request.moveObject.parentFolderID = request.destFolder._id;
56-
storageService.database().put(request.moveObject).then(function() {
56+
storageService.put(request.moveObject).then(function() {
5757
$rootScope.$emit("changedFolder", { //fire off an event to tell everyone we just modified a folder
5858
folder: request.moveObject,
5959
oldParentFolderID: origParentFolderID

0 commit comments

Comments
 (0)