@@ -3,7 +3,7 @@ |
||
| 3 | 3 |
|
| 4 | 4 |
<head> |
| 5 | 5 |
<title>Codex</title> |
| 6 |
- |
|
| 6 |
+ <meta charset="UTF-8"> |
|
| 7 | 7 |
<!-- Stylesheets --> |
| 8 | 8 |
<link rel="stylesheet" href="../css/photon.min.css"> |
| 9 | 9 |
<link rel="stylesheet" href="../css/codex.css"> |
@@ -43,10 +43,10 @@ |
||
| 43 | 43 |
</button> |
| 44 | 44 |
|
| 45 | 45 |
<div class="btn-group"> |
| 46 |
- <button class="btn btn-default" ng-class="noteEditBtnClass" ng-click="goBack()"> |
|
| 46 |
+ <button class="btn btn-default" ng-click="goBack()"> |
|
| 47 | 47 |
<span class="icon icon-left"></span> |
| 48 | 48 |
</button> |
| 49 |
- <button class="btn btn-default" ng-class="noteViewBtnClass" ng-click="goForward()"> |
|
| 49 |
+ <button class="btn btn-default" ng-click="goForward()"> |
|
| 50 | 50 |
<span class="icon icon-right"></span> |
| 51 | 51 |
</button> |
| 52 | 52 |
</div> |
@@ -39,11 +39,27 @@ angular.module('codexApp.header', [])
|
||
| 39 | 39 |
|
| 40 | 40 |
// Go To Home note |
| 41 | 41 |
$scope.goToHome = function() {
|
| 42 |
+ $rootScope.$broadcast('window-view:change');
|
|
| 42 | 43 |
FileService.setCurrentNote(FileService.getDefaultNote()); |
| 43 | 44 |
$rootScope.$broadcast('note-view:reload');
|
| 44 | 45 |
$state.go("note-view");
|
| 45 | 46 |
} |
| 46 | 47 |
|
| 48 |
+ // Go to the precious note |
|
| 49 |
+ $scope.goBack = function() {
|
|
| 50 |
+ $rootScope.$broadcast('window-view:change');
|
|
| 51 |
+ FileService.goToPreviousNote(); |
|
| 52 |
+ $rootScope.$broadcast('note-view:reload');
|
|
| 53 |
+ $state.go("note-view");
|
|
| 54 |
+ } |
|
| 55 |
+ |
|
| 56 |
+ // Go to the next note |
|
| 57 |
+ $scope.goForward = function() {
|
|
| 58 |
+ $rootScope.$broadcast('window-view:change');
|
|
| 59 |
+ FileService.goToNextNote(); |
|
| 60 |
+ $rootScope.$broadcast('note-view:reload');
|
|
| 61 |
+ $state.go("note-view");
|
|
| 62 |
+ } |
|
| 47 | 63 |
|
| 48 | 64 |
// Note View active button |
| 49 | 65 |
|
@@ -6,6 +6,8 @@ angular.module('codexApp')
|
||
| 6 | 6 |
var default_home_note = "/Users/james/dev/codex/codex/index.md" |
| 7 | 7 |
var notes = []; |
| 8 | 8 |
var current_note = ""; |
| 9 |
+ var note_history = []; |
|
| 10 |
+ var note_history_index = 0; |
|
| 9 | 11 |
|
| 10 | 12 |
var prettySize = function(bytes) {
|
| 11 | 13 |
if (bytes <= 1024) {
|
@@ -163,7 +165,7 @@ angular.module('codexApp')
|
||
| 163 | 165 |
|
| 164 | 166 |
this.saveFile = function(file_path, content){
|
| 165 | 167 |
var fs = require('fs');
|
| 166 |
- fs.writeFile(file_path, content, function(err) {
|
|
| 168 |
+ fs.writeFile(file_path, content, 'utf-8', function(err) {
|
|
| 167 | 169 |
if(err) {
|
| 168 | 170 |
return console.log(err); |
| 169 | 171 |
} |
@@ -208,10 +210,34 @@ angular.module('codexApp')
|
||
| 208 | 210 |
this.setCurrentNote = function(note) {
|
| 209 | 211 |
//console.log("searcing for: " + note_id)
|
| 210 | 212 |
current_note = note; |
| 213 |
+ if((note_history.length -1) != note_history_index){
|
|
| 214 |
+ var dif = note_history.length - note_history_index - 1; |
|
| 215 |
+ for (var i = 0; i < dif; i++) {
|
|
| 216 |
+ note_history.pop(); |
|
| 217 |
+ } |
|
| 218 |
+ } |
|
| 219 |
+ |
|
| 220 |
+ note_history.push(current_note); |
|
| 221 |
+ note_history_index = note_history.length -1; |
|
| 222 |
+ |
|
| 211 | 223 |
//console.log(current_note); |
| 212 | 224 |
//console.log("Current_note: " + current_note.title)
|
| 213 | 225 |
} |
| 214 | 226 |
|
| 227 |
+ this.goToPreviousNote = function(){
|
|
| 228 |
+ if(note_history_index > 0) {
|
|
| 229 |
+ note_history_index = note_history_index - 1; |
|
| 230 |
+ current_note = note_history[note_history_index]; |
|
| 231 |
+ } |
|
| 232 |
+ } |
|
| 233 |
+ |
|
| 234 |
+ this.goToNextNote = function(){
|
|
| 235 |
+ if(note_history_index < (note_history.length - 1)){
|
|
| 236 |
+ note_history_index = note_history_index + 1; |
|
| 237 |
+ current_note = note_history[note_history_index]; |
|
| 238 |
+ } |
|
| 239 |
+ } |
|
| 240 |
+ |
|
| 215 | 241 |
this.getNotesDir = function() {
|
| 216 | 242 |
return notes_dir; |
| 217 | 243 |
} |
@@ -7,5 +7,5 @@ |
||
| 7 | 7 |
firstLineNumber: 1, |
| 8 | 8 |
onLoad: aceLoaded, |
| 9 | 9 |
onChange: aceChanged |
| 10 |
- }" ng-model="raw_data"></div> |
|
| 10 |
+ }" ng-model="raw_data" charset="utf-8"></div> |
|
| 11 | 11 |
</div> |
@@ -1,11 +1,8 @@ |
||
| 1 | 1 |
# Index |
| 2 | 2 |
|
| 3 |
-#### Test Stack |
|
| 3 |
+## Research |
|
| 4 | 4 |
|
| 5 |
-* [Test-Stack/Notebook 2/Note-0001](Test-Stack/Notebook 2/Test-0001/index.md) |
|
| 6 |
-* [Test-Stack/Notebook 2/Note-0002](Test-Stack/Notebook 2/Test-0001/index.md) |
|
| 7 |
-* |
|
| 8 |
- |
|
| 9 |
-#### Research |
|
| 10 |
- |
|
| 11 |
-* [Chem Lights](Research/ChemLights/index.md) |
|
| 5 |
+* [Chem Lights](Research/ChemLights/index.md) |
|
| 6 |
+* [The Press Kit is Dead - Use this instead](Research/startups/The Press Kit is Dead - Use this instead.md) |
|
| 7 |
+* [Markdown Syntax](inbox/test_note.md) |
|
| 8 |
+* [Test Note 0001](Test-Stack/Notebook 2/Test-0001/index.md) |