From cf8ecf1fc9942dc00f0a5a11b313f8babbc9c3cd Mon Sep 17 00:00:00 2001 From: Aaron Parecki Date: Sun, 7 Sep 2014 11:48:52 -0700 Subject: adds bookmark posting interface with bookmarklet. now any URL can auto-login given a login token. --- lib/helpers.php | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'lib') diff --git a/lib/helpers.php b/lib/helpers.php index 60eda75..cf751c6 100644 --- a/lib/helpers.php +++ b/lib/helpers.php @@ -27,6 +27,10 @@ function partial($template, $data=array(), $debug=false) { return ob_get_clean(); } +function js_bookmarklet($partial, $context) { + return str_replace('+','%20',urlencode(str_replace(array("\n"),array(''),partial($partial, $context)))); +} + function session($key) { if(array_key_exists($key, $_SESSION)) return $_SESSION[$key]; -- cgit v1.2.3