Skip to content

Commit

Permalink
Add index page to gitmark_web with link to the bookmarklet
Browse files Browse the repository at this point in the history
  • Loading branch information
jcn committed Dec 19, 2010
1 parent 40261b1 commit 3ca0fed
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 3 deletions.
6 changes: 4 additions & 2 deletions README
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -53,9 +53,11 @@ First, run the gitmark_web server:


python gitmark_web.py python gitmark_web.py


Copy this bookmarklet to your browser (where 44865 is the port you set in settings.py): Then, go to the following URL and drag the bookmarklet into your browser's toolbar:


javascript:(function(){void(open('http://localhost:44865/new?url='+window.location,'gitmark','resizable,scrollbars,width=250,height=250'))})(); http://localhost:44865/

(where 44865 is the port you set in settings.py)




======= =======
Expand Down
7 changes: 6 additions & 1 deletion gitmark_web.py
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@
from gitmark import gitMark from gitmark import gitMark
import settings import settings


@route("/")
def index():
return template("index", port = settings.GITMARKS_WEB_PORT)

@route("/new") @route("/new")
def new(): def new():
url = request.GET.get('url') url = request.GET.get('url')
Expand All @@ -21,6 +25,7 @@ def create():
tags = request.forms.get('tags', '').strip() tags = request.forms.get('tags', '').strip()
message = request.forms.get('message', '').strip() message = request.forms.get('message', '').strip()
push = request.forms.get('nopush', True) push = request.forms.get('nopush', True)

if push == '1': if push == '1':
push = False push = False


Expand All @@ -38,4 +43,4 @@ def create():


return template("create") return template("create")


run(host="localhost", port=settings.GITMARKS_WEB_PORT, reloader=False) run(host="localhost", port=settings.GITMARKS_WEB_PORT, reloader=False)
8 changes: 8 additions & 0 deletions views/index.tpl
Original file line number Original file line Diff line number Diff line change
@@ -0,0 +1,8 @@
<h1>welcome to gitmarks</h1>

<p>
Please drag this link to your browser:
<a href="javascript:(function(){void(open('http://localhost:{{port}}/new?url='+window.location,'gitmark','resizable,scrollbars,width=250,height=250'))})();">gitmark</a>
</p>

%rebase layout

0 comments on commit 3ca0fed

Please sign in to comment.