Navigation Menu

Skip to content

Commit

Permalink
various cleanups
Browse files Browse the repository at this point in the history
  • Loading branch information
BernhardPosselt committed Apr 3, 2013
1 parent 961d780 commit 090e071
Show file tree
Hide file tree
Showing 9 changed files with 704 additions and 60 deletions.
661 changes: 661 additions & 0 deletions COPYING

Large diffs are not rendered by default.

7 changes: 4 additions & 3 deletions appinfo/info.xml
Expand Up @@ -3,8 +3,9 @@
<id>notes</id>
<name>Notes</name>
<licence>AGPL</licence>
<author>Robin Appelman, Jan-Christoph Borchardt, George Ruinelli</author>
<require>4.5</require>
<author>Bernhard Posselt, Jan-Christoph Borchardt</author>
<require>5.0</require>
<shipped>true</shipped>
<description>A simple Notes viewer and editor</description>
<version>0.1</version>
<description>Distraction-free notes and writing</description>
</info>
6 changes: 6 additions & 0 deletions appinfo/routes.php
Expand Up @@ -43,4 +43,10 @@ function($params){
function($params){
App::main('NotesController', 'save', $params, new DIContainer());
}
);

$this->create('notes_save', '/note/delete')->post()->action(
function($params){
App::main('NotesController', 'delete', $params, new DIContainer());
}
);
1 change: 0 additions & 1 deletion appinfo/version

This file was deleted.

6 changes: 3 additions & 3 deletions businesslayer/notesbusinesslayer.php
Expand Up @@ -60,18 +60,18 @@ public function saveNote($oldTitle, $newTitle, $content){

// prevent directory traversal
$oldTitle = str_replace(array('/', '\\'), '', $oldTitle);
$newTitle= str_replace(array('/', '\\'), '', $newTitle);
$newTitle = str_replace(array('/', '\\'), '', $newTitle);

// rename if the old file exists
// update the file name
if($this->fileSystem->file_exists('/' . $oldTitle . '.txt')){
$this->fileSystem->rename('/' . $oldTitle . '.txt', '/' .
$newTitle . '.txt');
}

// in any case save the content
// in case there is no file, this function creates one
$this->fileSystem->file_put_contents('/' . $newTitle . '.txt',
$content);

}


Expand Down
32 changes: 18 additions & 14 deletions css/notes.css
@@ -1,41 +1,45 @@
/**
* Copyright (c) 2013, Jan-Christoph Borchardt http://jancborchardt.net
* This file is licensed under the Affero General Public License version 3 or later.
* See the COPYING file.
*/

#app-navigation {
/* No settings bar */
padding-bottom: 0;
padding-bottom: 0; /* no settings bar, so no padding needed */
}

#app-navigation li.active {
font-weight: bold;
font-weight: bold; /* bold currently active note */
}

/* fancy handling of 'New Note' text */
#app-navigation #note-add span {
display: none;
font-weight: bold;
padding-left: 2px;
}
#app-navigation #note-add:hover span,
#app-navigation #note-add:focus span {
display: inline;
}
#app-navigation #note-add:hover span,
#app-navigation #note-add:focus span {
display: inline;
}

/* special styling to make textarea subtle and fit the window */
#app-content textarea {
display: block;
height: 100%;
width: 100%;
margin: 0;
padding: 30px 20% 100px 30px;
font-size: 18px;
line-height: 150%;
border: 0;
background: none;
box-shadow: none;
resize: none;
-moz-box-sizing: border-box;
box-sizing: border-box;
margin: 0;
padding: 30px;
padding-bottom: 100px;
padding-right: 20%;
-moz-box-sizing: border-box; box-sizing: border-box;
}


/* TODO: move into core app styles */
#app-content.loading {
background-image: url('%webroot%/core/img/loading.gif');
background-position: center;
Expand Down
Binary file removed img/icon.png
Binary file not shown.
15 changes: 12 additions & 3 deletions templates/main.php
@@ -1,4 +1,10 @@
<?php
/**
* Copyright (c) 2013, Bernhard Posselt <nukeawhale@gmail.com>
* Copyright (c) 2013, Jan-Christoph Borchardt http://jancborchardt.net
* This file is licensed under the Affero General Public License version 3 or later.
* See the COPYING file.
*/

\OCP\Util::addScript('appframework', 'vendor/angular/angular');
\OCP\Util::addScript('appframework', 'public/app');
Expand All @@ -12,11 +18,13 @@
<div id="app" ng-app="Notes" ng-controller="NotesController">
<div id="app-navigation">
<ul>
<!-- new note button -->
<li id="note-add" ng-click="createNew()"
oc-click-focus="{selector: '#app-content textarea'}">
<a href='#'>+ <span><?php p($l->t('New Note')); ?></span></a>
</li>

<!-- notes list -->
<li ng-repeat="note in notes|orderBy:'modified':'reverse'"
ng-show="note.content"
ng-class="{active: note==activeNote}">
Expand All @@ -26,11 +34,12 @@
</ul>
</div>

<div id="app-content"
ng-class="{loading: loading.isLoading()}">
<div id="app-content" ng-class="{loading: loading.isLoading()}">
<!-- actual note -->
<textarea ng-change="update(activeNote)"
ng-model="activeNote.content"
ng-hide="loading.isLoading()"
autofocus></textarea>
autofocus>
</textarea>
</div>
</div>
36 changes: 0 additions & 36 deletions templates/notes.php

This file was deleted.

0 comments on commit 090e071

Please sign in to comment.