diff options
| author | Teddy Wing | 2013-04-07 01:29:46 -0400 |
|---|---|---|
| committer | Teddy Wing | 2013-04-07 01:29:46 -0400 |
| commit | 793535261248be90908681b6712f29e1a02da579 (patch) | |
| tree | 3c6915c31e60056a314ff449146d1b86d059eaac | |
| parent | f6abae326cb768133b3e45b44092c2803bfb937d (diff) | |
| download | clips-793535261248be90908681b6712f29e1a02da579.tar.bz2 | |
Change bookmarklet code to dynamically grab request URI
| -rw-r--r-- | views/index.html.erb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/views/index.html.erb b/views/index.html.erb index cb5b103..351c34a 100644 --- a/views/index.html.erb +++ b/views/index.html.erb @@ -1,5 +1,5 @@ <div> - <a href="javascript:(function(){var xhr=new XMLHttpRequest();var params='url='+window.location.href;xhr.open('POST','http://localhost:9292/clips',true);xhr.onreadystatechange=function(){if(this.readyState==4){if(xhr.status==200){if(xhr.responseText.success){}}}};xhr.setRequestHeader('Content-Type','application/x-www-form-urlencoded');xhr.send(params);})()" onclick="alert('Drag this link onto your browser bookmarks bar.'); return false;">Clips</a> + <a href="javascript:(function(){var xhr=new XMLHttpRequest();var params='url='+window.location.href;xhr.open('POST','<%= @env['REQUEST_URI'] %>clips',true);xhr.onreadystatechange=function(){if(this.readyState==4){if(xhr.status==200){if(xhr.responseText.success){}}}};xhr.setRequestHeader('Content-Type','application/x-www-form-urlencoded');xhr.send(params);})()" onclick="alert('Drag this link onto your browser bookmarks bar.'); return false;">Clips</a> </div> <% unless @clips.empty? %> |
