-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathindex.html
More file actions
197 lines (156 loc) · 7.63 KB
/
index.html
File metadata and controls
197 lines (156 loc) · 7.63 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
<!DOCTYPE html>
<html>
<head>
<title>Reddit Image Browser</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="description" content="Reddit Image Browser (RIB) is an image browser for Reddit built completely with JavaScript. It comes with awesome keyboard navigation and infinite scroll!">
<link href="css/main.css" media="screen" rel="stylesheet" type="text/css" />
<link href='http://fonts.googleapis.com/css?family=Raleway:700' rel='stylesheet' type='text/css'>
<link rel="shortcut icon" href="./img/favicon.ico" type="image/x-icon">
<link rel="icon" href="./img/favicon.ico" type="image/x-icon">
<link rel="image_src" href="./img/logo.png" />
</head>
<body>
<div id="wrap">
<div id="header">
<div class="content">
<h1><a href="">Reddit Image Browser</a></h1>
<h3>by <span><a href="http://soraven.com/about/" target="_blank">Raven</a></span></h3>
<div class="nav">
<a href="#" class="drawer-handle hsub shadow" data-name='subreddits'>Subs</a>
<a href="#" class="drawer-handle hfaq shadow" data-name='faq'><span>FAQ</span></a>
<a href="#" class="drawer-handle hguide shadow" data-name='guide'><span>Key</span></a>
</div>
</div>
</div>
<div id="subreddits-container" class="side shadow">
<div id="subreddits-controls">
<a href="#" class="close"><span>Close</span></a>
<a href="#" class="add"><span>Add</span></a>
<div id="subreddits-add">
<div>Type name and press enter</div>
<form action="#">
<input type="text" name="sub_name" />
</form>
</div>
</div>
<ul id="subreddits"></ul>
</div>
<div id="container">
<div id="ribcage">
<div id="loading"><span>Loading</span></div>
<div id="top-nav">
<div id="scroll-left" class="scroll"></div>
<div id="scroll-right" class="scroll"></div>
<div id="link-container" class="shadow box pad">
<div id="links"></div>
</div>
</div>
<div id="post-meta"></div>
<div id="post"></div>
</div>
</div>
</div>
<div id="footer"></div>
<div id="guide">
<h2>Keyboard Shortcuts</h2>
<ul>
<li><span><em>k</em></span>go to previous post</li>
<li><span><em>j</em></span>go to next post</li>
<li><span><em>c</em>/<em>n</em></span>open comments page</li>
<li><span><em>↩</em>/<em>v</em></span>open current link</li>
<li><span><em>r</em></span>open subreddit page</li>
<li><span><em>o</em></span>toggle subreddit menu</li>
<li><span><em>s</em></span>toggle simple mode</li>
<li><span><em>ESC</em></span>close overlay</li>
</ul>
</div>
<div id="faq" class="page">
<div class="page-content">
<h2>Frequently<sup>1</sup> Asked Questions</h2>
<div>
<h3>WTF is RIB?</h3>
<p>Reddit Image Browser (RIB) is an image browser for Reddit (duh) built completely with JavaScript. It lets you browse through the frontpage posts on image subreddits like an image album, complete with keyboard navigation and infinite autoloading.<sup>2</sup> Technically it works fine with self, link, and video posts but I created it primarily to rapidly and lazily browse images.</p>
<h3>How do I use RIB?</h3>
<p>Just keep pressing j on your keyboard. Press o to choose different subreddits or add your own.</p>
<h3>Why JavaScript?</h3>
<p>JavaScript is awesome. Actually, the main reason is that JavaScript runs completely in your browser. Being a poor college student, I cannot afford running anything on the server side, which means no Rails or databases. All interactions with Reddit's API used by RIB are performed by your browser.</p>
<h3>Why can't I upvote links or post comments?</h3>
<p>Unfortunately, the limitations imposed by <a href="http://en.wikipedia.org/wiki/Same_origin_policy" target="_blank">same origin policy</a> and JSONP prevents me from using any API functions requiring user authentication. That's what I get for being cheap.</p>
<h3>How are you saving my subreddit selection?</h3>
<p>HTML 5 Local Storage. It's like cookies, but better!</p>
<h3>I want to request a feature!</h3>
<p>You can drop me <a href="http://soraven.com/contact" target="_blank">an email</a> via my blog. I will send you a polite reply.<sup>3</sup></p>
<h3>Things are broken!</h3>
<p>See above.</p>
<h3>Can I help to fix something?</h3>
<p>Submit a patch to the <a href="https://github.com/darkmirage/reddit-image-browser" target="_blank">Github</a> repository.</p>
<h3>Which JavaScript libraries did you use?</h3>
<p>jQuery, D3.js, and Underscore.js. It's overkill for the present task, but I chose D3.js because I had some ideas on doing visualizations like treemaps using the image posts from Reddit. I do intend to get to that someday.<sup>4</sup></p>
<h3>Where did you get those icons?</h3>
<p>Most of the icons used in RIB came from the <a href="http://www.fontsquirrel.com/fonts/modern-pictograms" target="_blank">Modern Pictograms</a> dingbat font by John Caserta. The rest came from the unicode charset.</p>
</div>
<ul class="footnotes">
<li>1. No one asked these questions. Ever.</li>
<li>2. Infinite until your RAM explodes from the inefficient object array I used.</li>
<li>3. Reply may take up to 10 business days.</li>
<li>4. Sometime between now and the heat death of the universe.</li>
</ul>
</div>
</div>
<div id="dark"></div>
<div id="first"><span>Keep pressing J or scroll down to proceed<br/>Press K or scroll up to go back<br/>Press O to add Subreddit</span></div>
<script src="lib/jquery-2.0.3.min.js" type="text/javascript"></script>
<script src="lib/underscore-min.js" type="text/javascript"></script>
<script src="lib/d3.v3.min.js" type="text/javascript"></script>
<script src="lib/storage.js" type="text/javascript"></script>
<script src="js/rib.js" type="text/javascript"></script>
<!-- Analytics -->
<script src="js/google.js" type="text/javascript"></script>
</body>
<!-- Underscore.js templates -->
<script type="text/template" id="template-meta">
<h3><a href="http://www.reddit.com<%= item.permalink %>" target="_blank"><%= item.title %></a></h3>
<div>
<ul>
<li class="author">
posted by <a href="http://www.reddit.com/u/<%= item.author %>" target="_blank"><%= item.author %></a><br/>
in <a href="http://www.reddit.com/r/<%= item.subreddit %>" target="_blank">r/<%= item.subreddit %></a>
</li>
<li>
<span class="meta-score"><%= item.score %></span>
<span class="meta-ups"><%= item.ups %></span>
<span class="meta-downs"><%= item.downs %></span>
</li>
</ul>
</div>
</script>
<script type="text/template" id="template-link">
<a href="<%= item.url %>" target="_blank"><h2><%= item.title %></h2></a>
</script>
<script type="text/template" id="template-self">
<% if (item.selftext != '') { %>
<div class="self-text post-content">
<%= item.selftext %>
<a href="http://www.reddit.com/user/<%= item.author %>" target="_blank">— <%= item.author %></a>
</div>
<% } else { %>
<a href="<%= item.url %>" class="empty-content" target="_blank">
<div>
<span>Click to open link</span>
Alternatively, press <em>v</em> on your keyboard
</div>
</a>
<% } %>
</script>
<script type="text/template" id="template-subreddit">
<li>
<a href="#" data-name="<%= item.display_name %>"><%= item.display_name %></a>
</li>
</script>
<script type="text/template" id="template-user">
<div>
<%= item.name %>
</div>
</script>
</html>