-
Notifications
You must be signed in to change notification settings - Fork 105
Bookmarks Plugin
This should be implemented using a clientside plugin, see https://github.com/owncloud/news/wiki/How-to-write-Plugins#clientside-plugin
Take a look at the share via mail plugin if you want to check out a real world client side plugin example.
After clicking a bookmarks icon button (first idea: simply copy the bookmarks app's icon) it should send a request to the bookmarks app looking like this:
POST /apps/bookmarks/bookmarks
{
"url": article.url,
"name": article.title
}
The following cases for the response exist:
- Success (HTTP 200-299)
- Error (HTTP 400-599)
A successful request should probably show a notification using the notification API (I'm not sure about this yet).
Error messages should be shown using the ownCloud notification API:
var text = $('<p>').text('error message goes here').html();
OC.Notification.showTemporary(text);
The Bookmarks app does not expose an API for this yet but there is an open issue:https://github.com/owncloud/bookmarks/issues/215
The URL to the bookmarks app can be generated like this:
OC.generateUrl('/apps/bookmarks');