summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorAaron Parecki <aaron@parecki.com>2014-09-07 11:48:52 -0700
committerAaron Parecki <aaron@parecki.com>2014-09-07 11:48:52 -0700
commitcf8ecf1fc9942dc00f0a5a11b313f8babbc9c3cd (patch)
treeaf6a3e99b19383ea5642f530451ff450072a9345 /lib
parent9cfa0ff2c18e25a9c00d80624e6abea487bd9136 (diff)
adds bookmark posting interface with bookmarklet. now any URL can auto-login given a login token.
Diffstat (limited to 'lib')
-rw-r--r--lib/helpers.php4
1 files changed, 4 insertions, 0 deletions
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];