Skip to content
Browse files

remove trailing spaces, add maximum-scale, no more class variables.

  • Loading branch information...
1 parent c029e93 commit 30cbcbcf2df10d3d6e32cebf1ff32c38ca1656eb @funkaoshi committed
Showing with 40 additions and 38 deletions.
  1. +5 −5 README.markdown
  2. +1 −1 dreamhost.rb
  3. +5 −5 groupviewer.rb
  4. +21 −21 public/paging_keys.js
  5. +3 −3 public/site.css
  6. +1 −1 views/_analytics.haml
  7. +2 −2 views/group.haml
  8. +1 −0 views/index.haml
  9. +1 −0 views/wtf.haml
View
10 README.markdown
@@ -1,11 +1,11 @@
-This is a simple [Sinatra][1] backed web-app to view groups on Flickr. It
-doesn't do much beyond that. It's like Flickr River, only simpler/lamer. It
-might be a good example of how to get going with Sinatra. [I'm also using
-paging_keys.js written by hiddenloop.][2] There is some code in the repo I use
+This is a simple [Sinatra][1] backed web-app to view groups on Flickr. It
+doesn't do much beyond that. It's like Flickr River, only simpler/lamer. It
+might be a good example of how to get going with Sinatra. [I'm also using
+paging_keys.js written by hiddenloop.][2] There is some code in the repo I use
to run this on Dreamhost.
TODO:
- * Support URLs of the form: gv.vqvz.com/group/<group url name>, for example,
+ * Support URLs of the form: gv.vqvz.com/group/<group url name>, for example,
gv.vqvz.com/group/photographsonthebrain rather gv.vqvz.com/group/755579@N24
[1]: http://sinatrarb.com "Sinatra's website."
View
2 dreamhost.rb
@@ -1,5 +1,5 @@
# Used to get Rubygems running properly on Dreamhost.
ENV['GEM_HOME'] = '/home/ramanan/local/gems'
-ENV['GEM_PATH'] = '$GEM_HOME:/usr/lib/ruby/gems/1.8'
+ENV['GEM_PATH'] = '$GEM_HOME:/usr/lib/ruby/gems/1.8'
require 'rubygems'
Gem.clear_paths
View
10 groupviewer.rb
@@ -37,16 +37,16 @@ def initialize(photo)
set :haml, :format => :html5
# set the last mod time to now, when the app starts up. Updated via /update/now
- @@last_mod_time = Time.now
+ @last_mod_time = Time.now
## for google analytics
- @@analytics_token = 'UA-2675737-8'
+ @analytics_token = 'UA-2675737-8'
end
before do
unless request.path_info =~ /update/
expires 300, :public, :must_revalidate # always cache for 5 minutes ...
- last_modified(@@last_mod_time) # ... and rely on 304 query after that
+ last_modified(@last_mod_time) # ... and rely on 304 query after that
end
end
@@ -153,11 +153,11 @@ def nav_links
# Lame web-cache thing which I don't think really works.
get '/update/now' do
- @@last_mod_time = Time.now
+ @last_mod_time = Time.now
end
get '/update/show' do
- "Last-Update: #{@@last_mod_time}"
+ "Last-Update: #{@last_mod_time}"
end
# Error Handlers in Production
View
42 public/paging_keys.js
@@ -79,14 +79,14 @@ HotKey.prototype.remove = function(key){
/* by Matthew Hutchinson - hiddenloop.com */
var pagingKeys = function() {
-
+
// settings
var config = {
nodeSelector: '.hentry', // used to select each item on the page and place in the map (must be a link)
prevPageSelector: '.prev_page', // link on this element should always jump to prev page a.prev_page (must be a link)
nextPageSelector: '.next_page', // link on this element should always jump to next page a.next_page (must be a link)
pagingNavId: 'paging-nav', // dom id of the floating page navigation element
- keyNext: 'j', // hot keys used
+ keyNext: 'j', // hot keys used
keyPrev: 'k',
keyNextPage: 'h',
keyPrevPage: 'l',
@@ -94,21 +94,21 @@ var pagingKeys = function() {
additionalBodyClass: 'paging-keys', // this class is assigned to the page body on load
bottomAnchor: 'bottom' // the name of the anchor (without #) at end of page, e.g. set on last post on the page
};
-
+
var item_map = [];
var asset_loaded = false;
var hot_key = false;
var disable_hot_key = false;
-
+
// abstraction layer start <modify these methods for other library support>
// jquery
-
+
function windowScrollInit() {
$(window).scroll(function () {
positionNav();
});
}
-
+
function getWindowBounds() {
return {
'w': $(window).width(),
@@ -117,40 +117,40 @@ var pagingKeys = function() {
'y': $(window).scrollTop()
};
}
-
+
function getEl(selector) {
return $(selector);
}
-
+
function addItemToMap(n) {
var pos = $(n).offset();
item_map.push({id: n.id, y: Math.round(pos.top) - 20});
}
-
+
function setNavCSS() {
$(config.pagingNavId).css({ position: 'absolute', right: '10px', top: (getScrollTop()+10)+'px' });
}
-
+
function getScrollTop() {
return $(window).scrollTop();
}
-
+
function isIE() {
return $.browser.msie;
}
-
+
function isWebKit() {
return $.browser.safari;
}
-
+
function init() {
$(window).load(setupPagingKeys);
windowScrollInit();
}
-
+
// abstraction layer end
-
-
+
+
function setupPagingKeys() {
// TODO: escape/return when incompatible browser found
var b = document.body;
@@ -159,7 +159,7 @@ var pagingKeys = function() {
positionNav();
initHotKeys();
}
-
+
// 'prev' and 'next' are used to identify items and their position in the map
function buildItemMap() {
asset_loaded = false;
@@ -187,10 +187,10 @@ var pagingKeys = function() {
}
asset_loaded = true;
}
-
+
// optional, repositioning of the floating navigation element
function positionNav() {
- if($(config.pagingNavId))
+ if($(config.pagingNavId))
setNavCSS();
}
@@ -199,7 +199,7 @@ var pagingKeys = function() {
try {
hot_key = new HotKey();
}
- catch (e) {
+ catch (e) {
alert('Oops, paging_keys requires HotKeys.js (http://la.ma.la/blog/diary_200511041713.htm)');
alert(e);
}
@@ -340,7 +340,7 @@ var pagingKeys = function() {
}
else { return false; }
}
-
+
// return public pointers to the private methods and properties you want to reveal
return {
init:init,
View
6 public/site.css
@@ -1,6 +1,6 @@
body {
margin:0; padding:0;
- font:12px/16px Calibri, Helvetica, Arial, sans-serif;
+ font:12px/16px Calibri, Helvetica, Arial, sans-serif;
background:#000;
color:#FFF;
border-right:15px solid white;
@@ -10,12 +10,12 @@ body {
margin:0; padding:40px 80px; width:520px;
background:#FFF;
color:#000;
-
+
}
h1 {
font: 24px/32px Futura, "Bank Gothic", "Gotham", "Century Gothic", sans-serif;
- text-transform: uppercase;
+ text-transform: uppercase;
margin:0;
}
View
2 views/_analytics.haml
@@ -1,4 +1,4 @@
-- unless @@analytics_token.nil?
+- unless @analytics_token.nil?
:javascript
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
View
4 views/group.haml
@@ -2,7 +2,7 @@
%html
%head
%meta(charset='utf-8')
- %meta(name='viewport' content='width=600')
+ %meta(name='viewport' content='width=680, maximum-scale=1.0')
%title GROUP VIEWQVZ :: #{@name}
%link(rel='stylesheet' href='/site.css' type='text/css' media='screen' title='default style sheet')
%script(type='text/javascript' src='http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js')
@@ -17,7 +17,7 @@
%input#searchbox(type='url' name='url' value='http://flickr.com/groups/onthestreet')
%input#ok(type='submit' value='OK')
#nav
- %p= "#{nav_links} &nbsp; &nbsp; &nbsp; j/k keys will move between photos (and pages)"
+ %p= "#{nav_links} &nbsp; &nbsp; &nbsp; j/k keys will move between photos (and pages)"
#images
- @sequence.each do |img|
.photo.hentry{:id => img.id}
View
1 views/index.haml
@@ -2,6 +2,7 @@
%html
%head
%meta(charset='utf-8')
+ %meta(name='viewport' content='width=680, maximum-scale=1.0')
%title GROUP VIEWQVZ
%link(rel='stylesheet' href='/site.css' type='text/css' media='screen' title='default style sheet')
%body
View
1 views/wtf.haml
@@ -2,6 +2,7 @@
%html
%head
%meta(charset='utf-8')
+ %meta(name='viewport' content='width=680, maximum-scale=1.0')
%title GROUP VIEWQVZ :: WTF?!
%link(rel='stylesheet' href='/site.css' type='text/css' media='screen' title='default style sheet')
%body

0 comments on commit 30cbcbc

Please sign in to comment.
Something went wrong with that request. Please try again.