Browse Source

get bookmarklet base url from config

pull/5/head
Aaron Parecki 10 years ago
parent
commit
37c516216e
  1. 1
      lib/config.template.php
  2. 2
      views/partials/bookmark-bookmarklet.php

1
lib/config.template.php

@ -1,6 +1,7 @@
<?php <?php
class Config { class Config {
public static $hostname = 'quill.dev'; public static $hostname = 'quill.dev';
public static $base_url = 'http://quill.dev/';
public static $gaid = ''; public static $gaid = '';
public static $dbHost = '127.0.0.1'; public static $dbHost = '127.0.0.1';

2
views/partials/bookmark-bookmarklet.php

@ -1,5 +1,5 @@
javascript:(function(){ javascript:(function(){
var t;try{t=((window.getSelection&&window.getSelection())||(document.getSelection&&document.getSelection())||(document.selection&&document.selection.createRange&&document.selection.createRange().text));}catch(e){t="";}; var t;try{t=((window.getSelection&&window.getSelection())||(document.getSelection&&document.getSelection())||(document.selection&&document.selection.createRange&&document.selection.createRange().text));}catch(e){t="";};
window.location="http://quill.dev/bookmark?url="+encodeURIComponent(window.location.href)+"&content="+encodeURIComponent('"'+t+'"')+"&name="+encodeURIComponent(document.title)+"&token=<?= $this->token ?>";
window.location="<?= Config::$base_url ?>bookmark?url="+encodeURIComponent(window.location.href)+"&content="+encodeURIComponent('"'+t+'"')+"&name="+encodeURIComponent(document.title)+"&token=<?= $this->token ?>";
})(); })();
Loading…
Cancel
Save