diff --git a/README.rst b/README.rst index 9bc1cc7..4d6d84e 100644 --- a/README.rst +++ b/README.rst @@ -45,6 +45,16 @@ url's when wanted. Url's are of the form https://marks.example.com// +Bookmarklet +~~~~~~~~~~~ + +To easily save a link from your browser, open its bookmark manager and create a new bookmark with as url: + +.. code-block:: javascript + + javascript:location.href='http://marks.example.com/1234567890abcdef/add?url='+encodeURIComponent(location.href); + + Creating a new user ------------------- diff --git a/digimarks.py b/digimarks.py index 3ba55c2..0499118 100644 --- a/digimarks.py +++ b/digimarks.py @@ -279,7 +279,10 @@ def editbookmark(userkey, urlhash): @app.route('//add') def addbookmark(userkey): """ Bookmark add form """ - bookmark = Bookmark(title='', url='', tags='') + url = request.args.get('url') + if not url: + url = '' + bookmark = Bookmark(title='', url=url, tags='') message = request.args.get('message') tags = get_cached_tags(userkey) return render_template('edit.html', action='Add bookmark', userkey=userkey, bookmark=bookmark, tags=tags, message=message)