aboutsummaryrefslogtreecommitdiffstats
path: root/views
diff options
context:
space:
mode:
authorTeddy Wing2013-04-07 00:39:40 -0400
committerTeddy Wing2013-04-07 00:39:40 -0400
commitbfa6c83b8c9cfca37eb5c1ac07f2098b898c771b (patch)
tree0e46a3c8a44071ee2e65b9748326c39c6a3e5eaa /views
downloadclips-bfa6c83b8c9cfca37eb5c1ac07f2098b898c771b.tar.bz2
Initial commit v0.0.1
* List clips. * Route to post a new clip URL. * Bookmarlet to post a clip.
Diffstat (limited to 'views')
-rw-r--r--views/clips.json.erb1
-rw-r--r--views/index.html.erb13
-rw-r--r--views/layout.html.erb23
3 files changed, 37 insertions, 0 deletions
diff --git a/views/clips.json.erb b/views/clips.json.erb
new file mode 100644
index 0000000..6dc0abe
--- /dev/null
+++ b/views/clips.json.erb
@@ -0,0 +1 @@
+<%= @result %> \ No newline at end of file
diff --git a/views/index.html.erb b/views/index.html.erb
new file mode 100644
index 0000000..cb5b103
--- /dev/null
+++ b/views/index.html.erb
@@ -0,0 +1,13 @@
+<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>
+</div>
+
+<% unless @clips.empty? %>
+ <ul>
+ <% @clips.each do |c| %>
+ <li><%= c.url %></li>
+ <% end %>
+ </ul>
+<% else %>
+ No clips to display
+<% end %>
diff --git a/views/layout.html.erb b/views/layout.html.erb
new file mode 100644
index 0000000..845929f
--- /dev/null
+++ b/views/layout.html.erb
@@ -0,0 +1,23 @@
+<!doctype html>
+<html lang="en">
+<head>
+<meta http-equiv="content-type" content="text/html; charset=utf-8">
+ <meta charset="utf-8">
+ <title>Clips</title>
+ <meta name="description" content="">
+
+ <meta name="viewport" content="width=device-width">
+ <link rel="stylesheet" href="css/style.css">
+</head>
+<body>
+ <header>
+
+ </header>
+ <div role="main">
+ <%= yield %>
+ </div>
+ <footer>
+
+ </footer>
+</body>
+</html> \ No newline at end of file