Skip to content

Commit 3ca0fed

Browse files
committed
Add index page to gitmark_web with link to the bookmarklet
1 parent 40261b1 commit 3ca0fed

File tree

3 files changed

+18
-3
lines changed

3 files changed

+18
-3
lines changed

README

+4-2
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,11 @@ First, run the gitmark_web server:
5353

5454
python gitmark_web.py
5555

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

58-
javascript:(function(){void(open('http://localhost:44865/new?url='+window.location,'gitmark','resizable,scrollbars,width=250,height=250'))})();
58+
http://localhost:44865/
59+
60+
(where 44865 is the port you set in settings.py)
5961

6062

6163
=======

gitmark_web.py

+6-1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@
99
from gitmark import gitMark
1010
import settings
1111

12+
@route("/")
13+
def index():
14+
return template("index", port = settings.GITMARKS_WEB_PORT)
15+
1216
@route("/new")
1317
def new():
1418
url = request.GET.get('url')
@@ -21,6 +25,7 @@ def create():
2125
tags = request.forms.get('tags', '').strip()
2226
message = request.forms.get('message', '').strip()
2327
push = request.forms.get('nopush', True)
28+
2429
if push == '1':
2530
push = False
2631

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

3944
return template("create")
4045

41-
run(host="localhost", port=settings.GITMARKS_WEB_PORT, reloader=False)
46+
run(host="localhost", port=settings.GITMARKS_WEB_PORT, reloader=False)

views/index.tpl

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<h1>welcome to gitmarks</h1>
2+
3+
<p>
4+
Please drag this link to your browser:
5+
<a href="javascript:(function(){void(open('http://localhost:{{port}}/new?url='+window.location,'gitmark','resizable,scrollbars,width=250,height=250'))})();">gitmark</a>
6+
</p>
7+
8+
%rebase layout

0 commit comments

Comments
 (0)