Skip to content

Commit

Permalink
Merge branch 'master' into subdir
Browse files Browse the repository at this point in the history
  • Loading branch information
korelstar authored Jan 8, 2017
2 parents e649c67 + 1f9bd60 commit b4cc80d
Show file tree
Hide file tree
Showing 77 changed files with 401 additions and 159 deletions.
9 changes: 9 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,18 @@ before_install:
script:
# Test lint
- cd apps/$APP_NAME
# Check info.xml schema validity
- wget https://apps.nextcloud.com/schema/apps/info.xsd
- xmllint appinfo/info.xml --schema info.xsd --noout
- rm info.xsd
# Check PHP syntax errors
- find . -name \*.php -exec php -l "{}" \;
# Check app validity
- php ../../occ app:check-code notes
# Run PHP unit tests
- phpunit --coverage-clover clover.xml -c phpunit.xml
- phpunit -c phpunit.integration.xml
# Generate Code Coverage
- wget https://scrutinizer-ci.com/ocular.phar
- php ocular.phar code-coverage:upload --format=php-clover clover.xml

Expand Down
18 changes: 9 additions & 9 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
## Submitting issues

If you have questions about how to install or use ownCloud, please direct these to the [mailing list][mailinglist] or our [forum][forum]. We are also available on [IRC][irc].
If you have questions about how to install or use Nextcloud, please direct these to the [mailing list][mailinglist] or our [forum][forum]. We are also available on [IRC][irc].

### Short version

Expand All @@ -11,19 +11,19 @@ If you have questions about how to install or use ownCloud, please direct these
- Go to one of the repositories, click "issues" and type any word in the top search/command bar.
- You can also filter by appending e. g. "state:open" to the search string.
- More info on [search syntax within github](https://help.github.com/articles/searching-issues)
* This repository ([notes](https://github.com/owncloud/notes/issues)) is *only* for issues within the ownCloud notes code.
* __SECURITY__: Report any potential security bug to security@owncloud.com following our [security policy](https://owncloud.org/security/) instead of filing an issue in our bug tracker
* This repository ([notes](https://github.com/nextcloud/notes/issues)) is *only* for issues within the Nextcloud notes code.
* __SECURITY__: Report any potential security bug to security@nextcloud.com following our [security policy](https://nextcloud.com/security/) instead of filing an issue in our bug tracker
* Report the issue using our [template][template], it includes all the information we need to track down the issue.

Help us to maximize the effort we can spend fixing issues and adding new features, by not reporting duplicate issues.

[template]: https://raw.github.com/owncloud/core/master/issue_template.md
[template]: https://raw.github.com/nextcloud/server/master/issue_template.md
[mailinglist]: https://mailman.owncloud.org/mailman/listinfo/owncloud
[forum]: https://forum.owncloud.org/
[irc]: https://webchat.freenode.net/?channels=owncloud&uio=d4
[irc-dev]: https://webchat.freenode.net/?channels=owncloud-dev&uio=d4
[forum]: https://help.nextcloud.com/
[irc]: https://webchat.freenode.net/?channels=nextcloud&uio=d4
[irc-dev]: https://webchat.freenode.net/?channels=nextcloud-dev&uio=d4

### Contribute Code and translations
Please check [core's contribution guidelines](https://github.com/owncloud/core/blob/master/CONTRIBUTING.md) for further information about contributing code and translations.
Please check [core's contribution guidelines](https://github.com/nextcloud/server/blob/master/CONTRIBUTING.md) for further information about contributing code and translations.

For further development questions / discussions you can also join the [#owncloud-dev][irc-dev] IRC channel.
For further development questions / discussions you can also join the [#nextcloud-dev][irc-dev] IRC channel.
43 changes: 37 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# ownCloud scaffolder tool
# Nextcloud scaffolder tool
#
# Copyright (C) 2013 Bernhard Posselt, <nukewhale@gmail.com>
#
Expand All @@ -21,8 +21,10 @@
app_name=notes
project_dir=$(CURDIR)/../$(app_name)
build_dir=$(CURDIR)/build/artifacts
sign_dir=$(build_dir)/sign
appstore_dir=$(build_dir)/appstore
package_name=$(app_name)
cert_dir=$(HOME)/.nextcloud/certificates

# binary directories for running the CI tests
firefox_bin=/usr/bin/firefox
Expand Down Expand Up @@ -99,8 +101,37 @@ clean:
dist: appstore

appstore: clean
mkdir -p $(appstore_dir)
tar cvzf $(appstore_dir)/$(package_name).tar.gz $(project_dir) \
--exclude-vcs --exclude=$(project_dir)/build/artifacts #\
# --exclude=$(project_dir)/tests \
#--exclude=$(project_dir)/.travis.yml
mkdir -p $(sign_dir)
rsync -a \
--exclude=.git \
--exclude=build \
--exclude=.gitignore \
--exclude=.travis.yml \
--exclude=.scrutinizer.yml \
--exclude=CONTRIBUTING.md \
--exclude=composer.json \
--exclude=composer.lock \
--exclude=composer.phar \
--exclude=l10n/.tx \
--exclude=l10n/no-php \
--exclude=Makefile \
--exclude=nbproject \
--exclude=screenshots \
--exclude=phpunit*xml \
--exclude=tests \
--exclude=vendor/bin \
--exclude=js/node_modules \
--exclude=js/tests \
--exclude=js/karma.conf.js \
--exclude=js/gulpfile.js \
--exclude=js/bower.json \
--exclude=js/package.json \
$(project_dir) $(sign_dir)
@echo "Signing…"
php ../../occ integrity:sign-app \
--privateKey=$(cert_dir)/$(app_name).key\
--certificate=$(cert_dir)/$(app_name).crt\
--path=$(sign_dir)/$(app_name)
tar -czf $(build_dir)/$(app_name).tar.gz \
-C $(sign_dir) $(app_name)
openssl dgst -sha512 -sign $(cert_dir)/$(app_name).key $(build_dir)/$(app_name).tar.gz | openssl base64
46 changes: 25 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,54 +1,58 @@
# Notes

[![build state](https://travis-ci.org/owncloud/notes.png)](https://travis-ci.org/owncloud/notes)[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/owncloud/notes/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/owncloud/notes/?branch=master)
[![build state](https://travis-ci.org/nextcloud/notes.png)](https://travis-ci.org/nextcloud/notes) [![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/nextcloud/notes/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/nextcloud/notes/?branch=master)

The Notes app is a distraction free notes taking app. It offers a [RESTful API](https://github.com/owncloud/notes/wiki/API-0.2) for app developers. The source code is [available on GitHub](https://github.com/owncloud/notes)
<!-- The following paragraph should be kept synchronized with the description in appinfo/info.xml -->
The Notes app is a distraction free notes taking app. It supports formatting using [Markdown](https://en.wikipedia.org/wiki/Markdown) syntax. Notes are saved as files in your Nextcloud, so you can view and edit them with every Nextcloud client. Furthermore, a separate [RESTful API](https://github.com/nextcloud/notes/wiki/API-0.2) allows for an easy integration into third-party apps such as the [Android client](https://github.com/stefan-niedermann/nextcloud-notes). Further features include marking notes as favorites and future versions will provide categories for better organization.

![Screenshot of ownCloud Notes](https://cloud.githubusercontent.com/assets/4741199/17731273/e557b5fe-646c-11e6-9975-d6b242454482.png)
![Screenshot of Nextcloud Notes](https://cloud.githubusercontent.com/assets/4741199/21027342/b70a6be2-bd90-11e6-9f12-eca46d6c505a.png)

For further developer and user documentation please visit [the wiki](https://github.com/owncloud/notes/wiki)
For further developer and user documentation please visit [the wiki](https://github.com/nextcloud/notes/wiki)

## Maintainers
## :busts_in_silhouette: Maintainers
- [Hendrik Leppelsack](https://github.com/Henni)
- [Lukas Reschke](https://github.com/LukasReschke)

##Requirements
##### Minimum PHP Version
## :link: Requirements
**Minimum PHP Version**
* PHP >= 5.4

##### Minimum ownCloud Version
* >= 8.1
**Minimum Nextcloud / ownCloud Version**
* Nextcloud >= 9.0
* ownCloud >= 8.1

##### Supported Webservers
**Supported Webservers**
* Apache

##### Supported Browsers
**Supported Browsers**
* latest 3 versions of Chrome, Firefox and Edge
* we *do not* officially support Internet Explorer and Safari (Patches accepted though)
* we *do not* officially support Internet Explorer and Safari (Patches are accepted though)


## Bugs
## :exclamation: Bugs
Before reporting bugs:

* check the requirements above
* get the newest version of the Notes app
* [check if they have already been reported](https://github.com/owncloud/notes/issues?state=open)
* [check if they have already been reported](https://github.com/nextcloud/notes/issues?state=open)


## Git (development version)
## :warning: Git (development version)

#### Installation
**Installation**

* Clone the **Notes** app into the **/var/www/owncloud/apps/** directory
* Clone the **Notes** app into the `/var/www/nextcloud/apps/` directory

```git clone https://github.com/owncloud/notes.git```
`git clone https://github.com/nextcloud/notes.git`

* Activate the **Notes** app in the apps menu


#### Keep up to date
**Keep up to date**

To update the Notes app use::

cd /var/www/owncloud/apps/notes
cd /var/www/nextcloud/apps/notes
git pull --rebase origin master

## Mobile clients
For iOS you can use [Notes app](https://github.com/owncloud/notes-iOS-App)
2 changes: 1 addition & 1 deletion appinfo/app.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php
/**
* ownCloud - Notes
* Nextcloud - Notes
*
* This file is licensed under the Affero General Public License version 3 or
* later. See the COPYING file.
Expand Down
26 changes: 19 additions & 7 deletions appinfo/info.xml
Original file line number Diff line number Diff line change
@@ -1,17 +1,29 @@
<?xml version="1.0"?>
<info>
<info xmlns:xsi= "http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="https://apps.nextcloud.com/schema/apps/info.xsd">
<id>notes</id>
<name>Notes</name>
<licence>AGPL</licence>
<name lang="de">Notizen</name>
<summary>Distraction-free notes and writing</summary>
<description><![CDATA[The Notes app is a distraction free notes taking app. It supports formatting using [Markdown](https://en.wikipedia.org/wiki/Markdown) syntax. Notes are saved as files in your Nextcloud, so you can view and edit them with every Nextcloud client. Furthermore, a separate [RESTful API](https://github.com/nextcloud/notes/wiki/API-0.2) allows for an easy integration into third-party apps such as the [Android client](https://github.com/stefan-niedermann/nextcloud-notes). Further features include marking notes as favorites and future versions will provide categories for better organization.]]></description>
<version>2.1.1</version>
<licence>agpl</licence>
<author>Bernhard Posselt, Jan-Christoph Borchardt, Hendrik Leppelsack</author>
<version>2.0.2</version>
<namespace>Notes</namespace>
<documentation>
<user>https://github.com/nextcloud/notes/wiki</user>
<developer>https://github.com/nextcloud/notes/wiki</developer>
</documentation>
<category>office</category>
<category>organization</category>
<category>tools</category>
<description>Distraction-free notes and writing</description>
<bugs>https://github.com/owncloud/notes/issues</bugs>
<repository type="git">https://github.com/owncloud/notes.git</repository>
<ocsid>174554</ocsid>
<website>https://github.com/nextcloud/notes</website>
<bugs>https://github.com/nextcloud/notes/issues</bugs>
<repository type="git">https://github.com/nextcloud/notes.git</repository>
<screenshot small-thumbnail="https://raw.githubusercontent.com/nextcloud/screenshots/master/apps/Notes/notes-thumbnail.jpg">https://raw.githubusercontent.com/nextcloud/screenshots/master/apps/Notes/notes.png</screenshot>
<dependencies>
<owncloud min-version="8.1" max-version="9.2" />
<nextcloud min-version="9" max-version="12" />
</dependencies>
<ocsid>174554</ocsid>
</info>
2 changes: 1 addition & 1 deletion appinfo/routes.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php
/**
* ownCloud - Notes
* Nextcloud - Notes
*
* This file is licensed under the Affero General Public License version 3 or
* later. See the COPYING file.
Expand Down
2 changes: 1 addition & 1 deletion controller/errors.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php
/**
* ownCloud - Notes
* Nextcloud - Notes
*
* This file is licensed under the Affero General Public License version 3 or
* later. See the COPYING file.
Expand Down
40 changes: 27 additions & 13 deletions controller/notesapicontroller.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php
/**
* ownCloud - Notes
* Nextcloud - Notes
*
* This file is licensed under the Affero General Public License version 3 or
* later. See the COPYING file.
Expand Down Expand Up @@ -108,12 +108,14 @@ public function get($id, $exclude='') {
* @NoCSRFRequired
*
* @param string $content
* @param int $modified
* @param boolean $favorite
* @return DataResponse
*/
public function create($content) {
return $this->respond(function () use ($content) {
public function create($content, $modified=0, $favorite=null) {
return $this->respond(function () use ($content, $modified, $favorite) {
$note = $this->service->create($this->userId);
return $this->service->update($note->getId(), $content, $this->userId);
return $this->updateData($note->getId(), $content, $modified, $favorite);
});
}

Expand All @@ -125,23 +127,35 @@ public function create($content) {
*
* @param int $id
* @param string $content
* @param int $modified
* @param boolean $favorite
* @return DataResponse
*/
public function update($id, $content=null, $favorite=null) {
public function update($id, $content=null, $modified=0, $favorite=null) {
return $this->respond(function () use ($id, $content, $modified, $favorite) {
return $this->updateData($id, $content, $modified, $favorite);
});
}

/**
* Updates a note, used by create and update
* @param int $id
* @param string $content
* @param int $modified
* @param boolean $favorite
* @return Note
*/
private function updateData($id, $content, $modified, $favorite) {
if($favorite!==null) {
$this->service->favorite($id, $favorite, $this->userId);
}
return $this->respond(function () use ($id, $content) {
if($content===null) {
return $this->service->get($id, $this->userId);
} else {
return $this->service->update($id, $content, $this->userId);
}
});
if($content===null) {
return $this->service->get($id, $this->userId);
} else {
return $this->service->update($id, $content, $this->userId, $modified);
}
}


/**
* @NoAdminRequired
* @CORS
Expand Down
2 changes: 1 addition & 1 deletion controller/notescontroller.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php
/**
* ownCloud - Notes
* Nextcloud - Notes
*
* This file is licensed under the Affero General Public License version 3 or
* later. See the COPYING file.
Expand Down
2 changes: 1 addition & 1 deletion controller/pagecontroller.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php
/**
* ownCloud - Notes
* Nextcloud - Notes
*
* This file is licensed under the Affero General Public License version 3 or
* later. See the COPYING file.
Expand Down
Loading

0 comments on commit b4cc80d

Please sign in to comment.