mirror of
https://github.com/aquatix/digimarks.git
synced 2025-12-06 23:05:10 +01:00
Initialise with 'url' url parameter if exists, enabling bookmarklet
This commit is contained in:
10
README.rst
10
README.rst
@@ -45,6 +45,16 @@ url's when wanted.
|
|||||||
Url's are of the form https://marks.example.com/<userkey>/<action>
|
Url's are of the form https://marks.example.com/<userkey>/<action>
|
||||||
|
|
||||||
|
|
||||||
|
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
|
Creating a new user
|
||||||
-------------------
|
-------------------
|
||||||
|
|
||||||
|
|||||||
@@ -279,7 +279,10 @@ def editbookmark(userkey, urlhash):
|
|||||||
@app.route('/<userkey>/add')
|
@app.route('/<userkey>/add')
|
||||||
def addbookmark(userkey):
|
def addbookmark(userkey):
|
||||||
""" Bookmark add form """
|
""" 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')
|
message = request.args.get('message')
|
||||||
tags = get_cached_tags(userkey)
|
tags = get_cached_tags(userkey)
|
||||||
return render_template('edit.html', action='Add bookmark', userkey=userkey, bookmark=bookmark, tags=tags, message=message)
|
return render_template('edit.html', action='Add bookmark', userkey=userkey, bookmark=bookmark, tags=tags, message=message)
|
||||||
|
|||||||
Reference in New Issue
Block a user