David Larlet committed 764c7cf

Added a basic bookmarklet, fixes #3

  • Participants
  • Parent commits d76b04d

Comments (0)

Files changed (3)

 * pre-fetching of links in background, need to be asynchronuous
 * add the location of the browsing using [doko](, can be useful for search (I often remember where I read articles)
 * deal with non-article pages (homepages, lists, etc)
-* create a bookmarklet to ease the URL submission process

File src/

             elif 'search' in request.form:
                 search = request.form['search']
                 return redirect('/s?terms=%s' % url_quote_plus(search))
-        return self.render_template('new_url.html', error=error, url=url)
+        return self.render_template('new_url.html',
+            error=error,
+            url=url,
+            proxy_url=self.proxy_url
+        )
     def on_render_content(self, request):
         """View that renders content from the `url` GET argument."""

File src/templates/new_url.html

       <input type=text name=search value="{{ search }}" class=searchinput>
       <input type=submit value="Search contents">
+  <h2>Pro tip: use a bookmarklet!</h2>
+  <p><a href="javascript:location.href='http://{{ proxy_url }}/r?url='+encodeURIComponent(location.href);">Browser</a> ← drop this bookmarklet in your favs' bar and click it when you're reading an article to jump to this content browser.</p>
 {% endblock %}