Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Add a username sort, turn on pushState, and a few bugfixes. #6

Merged
merged 5 commits into from
This page is out of date. Refresh to see the latest.
View
4 reddit_about/__init__.py
@@ -40,7 +40,9 @@ class About(Plugin):
}
def add_routes(self, mc):
- mc('/about/:action', controller='about', conditions={'function':not_in_sr})
+ # handle wildcard after /about/:action/ for postcard pushState URLs.
+ for route in ('/about/:action', '/about/:action/*etc'):
+ mc(route, controller='about', conditions={'function':not_in_sr})
def load_controllers(self):
def load(name):
View
99 reddit_about/data/team.json
@@ -1,62 +1,63 @@
{
"sorts": [
- {"id": "random", "title": "random", "dir": 1},
- {"id": "new", "title": "new", "dir": -1},
- {"id": "top", "title": "top", "dir": -1},
- {"id": "beard", "title": "beard", "dir": -1},
- {"id": "pyro", "title": "pyromania", "dir": -1},
- {"id": "wpm", "title": "words per minute", "dir": -1}
+ {"id": "random", "title": "random", "dir": 1},
+ {"id": "username", "title": "username", "dir": 1},
+ {"id": "new", "title": "new", "dir": -1},
+ {"id": "top", "title": "top", "dir": -1},
+ {"id": "beard", "title": "beard", "dir": -1},
+ {"id": "pyro", "title": "pyromania", "dir": -1},
+ {"id": "wpm", "title": "words per minute", "dir": -1}
],
"extra_sorts": [
- {"id": "starcraft", "title": "love of starcraft", "dir": -1},
- {"id": "shatner", "title": "love of william shatner", "dir": -1},
- {"id": "arnold", "title": "love of arnold schwarzenegger", "dir": -1},
- {"id": "spy", "title": "most likely to be a spy", "dir": -1},
- {"id": "pokemon", "title": "love of Pokemon", "dir": -1},
- {"id": "scorpions", "title": "fear of scorpions", "dir": -1},
- {"id": "zombies", "title": "outrunning zombies", "dir": -1},
- {"id": "cycling", "title": "longest distance on a bicycle", "dir": -1},
- {"id": "cartman", "title": "Eric Cartman impression", "dir": -1},
- {"id": "whales", "title": "fear of whales", "dir": -1},
- {"id": "pronunciation", "title": "pronunciation", "dir": -1},
- {"id": "giants", "title": "giants schwag", "dir": -1},
- {"id": "mornings", "title": "early riser", "dir": -1},
- {"id": "pings", "title": "number of pings required, Vasily", "dir": -1},
- {"id": "rabbits", "title": "number of rabbits owned", "dir": -1},
- {"id": "cartoon", "title": "memorialized in cartoon form", "dir": -1},
- {"id": "physics", "title": "bona fide scientist", "dir": -1},
- {"id": "doodles", "title": "life-time reddit alien doodles", "dir": -1},
- {"id": "karma", "title": "total karma", "dir": -1}
+ {"id": "starcraft", "title": "love of starcraft", "dir": -1},
+ {"id": "shatner", "title": "love of william shatner", "dir": -1},
+ {"id": "arnold", "title": "love of arnold schwarzenegger", "dir": -1},
+ {"id": "spy", "title": "most likely to be a spy", "dir": -1},
+ {"id": "pokemon", "title": "love of Pokemon", "dir": -1},
+ {"id": "scorpions", "title": "fear of scorpions", "dir": -1},
+ {"id": "zombies", "title": "outrunning zombies", "dir": -1},
+ {"id": "cycling", "title": "longest distance on a bicycle", "dir": -1},
+ {"id": "cartman", "title": "Eric Cartman impression", "dir": -1},
+ {"id": "whales", "title": "fear of whales", "dir": -1},
+ {"id": "pronunciation", "title": "pronunciation", "dir": -1},
+ {"id": "giants", "title": "giants schwag", "dir": -1},
+ {"id": "mornings", "title": "early riser", "dir": -1},
+ {"id": "pings", "title": "number of pings required, Vasily", "dir": -1},
+ {"id": "rabbits", "title": "number of rabbits owned", "dir": -1},
+ {"id": "cartoon", "title": "memorialized in cartoon form", "dir": -1},
+ {"id": "physics", "title": "bona fide scientist", "dir": -1},
+ {"id": "doodles", "title": "life-time reddit alien doodles", "dir": -1},
+ {"id": "karma", "title": "total karma", "dir": -1}
],
"team": [
- {"beard": 6, "description": "\"I don't want a description, just put the word 'description'.\"", "favorite_subreddits": ["", "/r/tldr", "/r/diablo", "/r/AskScience", "/r/tipofmytongue"], "name": "Jason Harvey", "new": 201101, "pyro": 9, "role": "Systems Administrator", "role_details": "linux magician", "starcraft": 9999, "top": 1.83, "username": "alienth"},
- {"beard": 0, "description": "Like the night janitor - you know that *someone* is emptying the garbage cans, but you don't really think about it", "favorite_subreddits": ["/r/roomporn", "/r/aww", "/r/privacy", "/r/glutenfree", "/r/pandr"], "name": "Marta Gossage", "new": 201110, "pyro": 9, "role": "Community Operations", "role_details": "lubricant", "shatner": 9999, "top": 1.55, "username": "bitcrunch"},
- {"arnold": 9999, "beard": 2, "description": "I like reddit and I like working at reddit", "favorite_subreddits": ["/r/AskReddit", "/r/foodforthought", "/r/relationship_advice", "/r/woahdude"], "name": "Brian Simpson", "new": 201106, "pyro": 0, "role": "Programmer", "role_details": "hair model", "top": 1.75, "username": "bsimpson"},
- {"beard": 4, "description": "Max makes your web browser do stuff. Occasionally he draws aliens.", "favorite_subreddits": ["/r/starcraft", "/r/programming", "/r/music", "/r/askscience", "/r/theoryofreddit"], "name": "Max Goodman", "new": 201104, "pyro": 2, "role": "JavaScript Apologist", "role_details": "wearer of many hats", "spy": 9999, "top": 1.68, "username": "chromakode", "wpm": 100},
- {"beard": 0, "description": "Our first graduate from our esteemed internship program!", "favorite_subreddits": ["/r/fifthworldproblems", "/r/aww", "/r/AskScience", "/r/harrypotheads"], "name": "Alex Angel", "new": 201006, "pokemon": 9999, "pyro": 6, "role": "Community Outreach Manager", "role_details": "bringer of baked goods", "top": 1.63, "username": "cupcake1713", "wpm": 88},
- {"beard": 10, "description": "Erik is our general manager and nerd herder. He has an awesome dog named Mog who can often be found around the office.", "favorite_subreddits": ["/r/fifthworldproblems"], "name": "Erik Martin", "new": 200810, "pyro": 6, "role": "General Manager", "role_details": "psychic detective", "scorpions": 9999, "top": 1.83, "username": "hueypriest", "wpm": 12},
- {"beard": 3, "description": "Hacks reddit by day, races motorcycles by night. Or is it the other way around?", "favorite_subreddits": ["/r/motorcycles", "/r/forza", "/r/theoryofreddit", "/r/TheBook"], "name": "Logan Hanks", "new": 201106, "pyro": 3, "role": "Programmer", "role_details": "\\m/", "top": 1.83, "username": "intortus", "wpm": 9999},
- {"beard": 0, "description": "<insert witty comment about doing all the boring operational stuff here />", "favorite_subreddits": ["/r/TwoXChromosomes", "/r/GetMotivated", "/r/HistoryPorn", ""], "name": "Jena Donlin", "new": 201101, "pyro": 1, "role": "Business Operations", "role_details": "smooth operator", "top": 1.73, "username": "jenakalif", "wpm": 60, "zombies": 9999},
- {"beard": 8, "cycling": 125, "description": "Sneezes chronically. Attempts to make things less annoying. Sometimes fails.", "favorite_subreddits": ["/r/darksouls", "/r/games", "/r/technology", "/r/diablo"], "name": "Keith Mitchell", "new": 201106, "pyro": 4, "role": "Programmer", "role_details": "annoyance reducer", "top": 1.82, "username": "kemitche"},
- {"beard": 0, "cartman": 9999, "description": "When she's not thinking about second breakfast, Adriana makes sure ad campaigns go off smoothly.", "favorite_subreddits": ["/r/funny", "/r/fffffffuuuuuuuuuuuu", "/r/dubstep"], "name": "Adriana Gadala-Maria", "new": 201106, "pyro": 9, "role": "Digital Sales Planner", "role_details": "ad keeper", "top": 1.65, "username": "kirbyrules", "wpm": 72},
- {"beard": 0, "description": "I deal with people so they don't have to.", "favorite_subreddits": ["/r/skyrim", "/r/ladyboners", "/r/AskReddit"], "name": "Kristine Smith", "new": 201104, "pyro": 8, "role": "Advertising Support", "role_details": "self serve guru", "top": 1.52, "username": "krispykrackers", "whales": 9999, "wpm": 70},
- {"beard": 0, "description": "Lia is the go-to gal for large advertising campaigns.", "favorite_subreddits": ["/r/LifeProTips", "/r/grilledcheese", "/r/spaceporn", "/r/aww", "/r/iama", "/r/pics"], "name": "Lia Navarro", "pyro": 0, "role": "Account Executive", "role_details": "rainmaker", "top": 1.7, "username": "pixelinaa"},
- {"beard": 2, "description": "Josh endeavors to make things at reddit slightly more entertaining.", "favorite_subreddits": ["/r/ultimate", "/r/depthhub", "/r/fifthworldpics", "/r/futurebeats", "/r/sanfrancisco"], "name": "Josh Wardle", "new": 201109, "pronunciation": 9999, "pyro": 1, "role": "Office Artist", "role_details": "erstwhile gremlin", "top": 1.82, "username": "powerlanguage"},
- {"beard": 0, "description": "Handles corporate things.", "favorite_subreddits": ["/r/sfgiants", "/r/madmen", "/r/feminisms"], "giants": 9999, "name": "Rebecca Eisenberg", "new": 201202, "pyro": 8, "role": "General Counsel", "role_details": "freedom fighter ", "top": 1.63, "username": "rebecalyn", "wpm": 101},
- {"beard": 1, "description": "Our personal puertorrique\u00f1o pyromaniac pilot. The best days for him involve home made sangria, wrangling servers, and plenty of small fires.", "favorite_subreddits": ["/r/aviation", "/r/aww", "/r/iama"], "name": "Ricky Ramirez", "new": 201109, "pyro": 10, "role": "Systems Administrator", "role_details": "reboot master", "top": 1.65, "username": "rram", "wpm": 60},
- {"beard": 0, "description": "Valerie drinks a lot of coffee and writes code. She believes almost anything can be improved by adding robots.", "favorite_subreddits": ["/r/depthhub", "/r/foodforthought", "/r/dataisbeautiful"], "mornings": 9999, "name": "Valerie Hajdik", "new": 201204, "pyro": 8, "role": "Programmer", "role_details": "generalist", "top": 1.7, "username": "shlurbee", "wpm": 109},
- {"beard": 9, "description": "Neil tirelessly torches troublemakers in TF2. When he's not doing that he writes code. For a time, he was the only programmer at reddit.", "favorite_subreddits": ["/r/dogs", "/r/truetf2", "/r/boardgames"], "name": "Neil Williams", "new": 201011, "pings": 1, "pyro": 3, "role": "Lead Programmancer", "role_details": "mm mhm mmm!!", "top": 1.72, "username": "spladug", "wpm": 111},
- {"beard": 0, "description": "what is this i don't even", "favorite_subreddits": ["/r/yishansucks", "/r/starcraft2_class", "/r/theoryofreddit"], "name": "Yishan Wong", "new": 201202, "pyro": 1, "rabbits": 3, "role": "CEO", "role_details": "sparklepants", "top": 1.74, "username": "yishan", "wpm": 91}
+ {"beard": 6, "description": "\"I don't want a description, just put the word 'description'.\"", "favorite_subreddits": ["/r/tldr", "/r/diablo", "/r/AskScience", "/r/tipofmytongue"], "name": "Jason Harvey", "new": 201101, "pyro": 9, "role": "Systems Administrator", "role_details": "linux magician", "starcraft": 9999, "top": 1.83, "username": "alienth"},
+ {"beard": 0, "description": "Like the night janitor - you know that *someone* is emptying the garbage cans, but you don't really think about it", "favorite_subreddits": ["/r/roomporn", "/r/aww", "/r/privacy", "/r/glutenfree", "/r/pandr"], "name": "Marta Gossage", "new": 201110, "pyro": 9, "role": "Community Operations", "role_details": "lubricant", "shatner": 9999, "top": 1.55, "username": "bitcrunch"},
+ {"arnold": 9999, "beard": 2, "description": "I like reddit and I like working at reddit", "favorite_subreddits": ["/r/AskReddit", "/r/foodforthought", "/r/relationship_advice", "/r/woahdude"], "name": "Brian Simpson", "new": 201106, "pyro": 0, "role": "Programmer", "role_details": "hair model", "top": 1.75, "username": "bsimpson"},
+ {"beard": 4, "description": "Max makes your web browser do stuff. Occasionally he draws aliens.", "favorite_subreddits": ["/r/starcraft", "/r/programming", "/r/music", "/r/askscience", "/r/theoryofreddit"], "name": "Max Goodman", "new": 201104, "pyro": 2, "role": "JavaScript Apologist", "role_details": "wearer of many hats", "spy": 9999, "top": 1.68, "username": "chromakode", "wpm": 100},
+ {"beard": 0, "description": "Our first graduate from our esteemed internship program!", "favorite_subreddits": ["/r/fifthworldproblems", "/r/aww", "/r/AskScience", "/r/harrypotheads"], "name": "Alex Angel", "new": 201006, "pokemon": 9999, "pyro": 6, "role": "Community Outreach Manager", "role_details": "bringer of baked goods", "top": 1.63, "username": "cupcake1713", "wpm": 88},
+ {"beard": 10, "description": "Erik is our general manager and nerd herder. He has an awesome dog named Mog who can often be found around the office.", "favorite_subreddits": ["/r/fifthworldproblems"], "name": "Erik Martin", "new": 200810, "pyro": 6, "role": "General Manager", "role_details": "psychic detective", "scorpions": 9999, "top": 1.83, "username": "hueypriest", "wpm": 12},
+ {"beard": 3, "description": "Hacks reddit by day, races motorcycles by night. Or is it the other way around?", "favorite_subreddits": ["/r/motorcycles", "/r/forza", "/r/theoryofreddit", "/r/TheBook"], "name": "Logan Hanks", "new": 201106, "pyro": 3, "role": "Programmer", "role_details": "\\m/", "top": 1.83, "username": "intortus", "wpm": 9999},
+ {"beard": 0, "description": "<insert witty comment about doing all the boring operational stuff here />", "favorite_subreddits": ["/r/TwoXChromosomes", "/r/GetMotivated", "/r/HistoryPorn", ""], "name": "Jena Donlin", "new": 201101, "pyro": 1, "role": "Business Operations", "role_details": "smooth operator", "top": 1.73, "username": "jenakalif", "wpm": 60, "zombies": 9999},
+ {"beard": 8, "cycling": 125, "description": "Sneezes chronically. Attempts to make things less annoying. Sometimes fails.", "favorite_subreddits": ["/r/darksouls", "/r/games", "/r/technology", "/r/diablo"], "name": "Keith Mitchell", "new": 201106, "pyro": 4, "role": "Programmer", "role_details": "annoyance reducer", "top": 1.82, "username": "kemitche"},
+ {"beard": 0, "cartman": 9999, "description": "When she's not thinking about second breakfast, Adriana makes sure ad campaigns go off smoothly.", "favorite_subreddits": ["/r/funny", "/r/fffffffuuuuuuuuuuuu", "/r/dubstep"], "name": "Adriana Gadala-Maria", "new": 201106, "pyro": 9, "role": "Digital Sales Planner", "role_details": "ad keeper", "top": 1.65, "username": "kirbyrules", "wpm": 72},
+ {"beard": 0, "description": "I deal with people so they don't have to.", "favorite_subreddits": ["/r/skyrim", "/r/ladyboners", "/r/AskReddit"], "name": "Kristine Smith", "new": 201104, "pyro": 8, "role": "Advertising Support", "role_details": "self serve guru", "top": 1.52, "username": "krispykrackers", "whales": 9999, "wpm": 70},
+ {"beard": 0, "description": "Lia is the go-to gal for large advertising campaigns.", "favorite_subreddits": ["/r/LifeProTips", "/r/grilledcheese", "/r/spaceporn", "/r/aww", "/r/iama", "/r/pics"], "name": "Lia Navarro", "new": 200612, "pyro": 0, "role": "Account Executive", "role_details": "rainmaker", "top": 1.7, "username": "pixelinaa"},
+ {"beard": 2, "description": "Josh endeavors to make things at reddit slightly more entertaining.", "favorite_subreddits": ["/r/ultimate", "/r/depthhub", "/r/fifthworldpics", "/r/futurebeats", "/r/sanfrancisco"], "name": "Josh Wardle", "new": 201109, "pronunciation": 9999, "pyro": 1, "role": "Office Artist", "role_details": "erstwhile gremlin", "top": 1.82, "username": "powerlanguage"},
+ {"beard": 0, "description": "Handles corporate things.", "favorite_subreddits": ["/r/sfgiants", "/r/madmen", "/r/feminisms"], "giants": 9999, "name": "Rebecca Eisenberg", "new": 201202, "pyro": 8, "role": "General Counsel", "role_details": "freedom fighter ", "top": 1.63, "username": "rebecalyn", "wpm": 101},
+ {"beard": 1, "description": "Our personal puertorrique\u00f1o pyromaniac pilot. The best days for him involve home made sangria, wrangling servers, and plenty of small fires.", "favorite_subreddits": ["/r/aviation", "/r/aww", "/r/iama"], "name": "Ricky Ramirez", "new": 201109, "pyro": 10, "role": "Systems Administrator", "role_details": "reboot master", "top": 1.65, "username": "rram", "wpm": 60},
+ {"beard": 0, "description": "Valerie drinks a lot of coffee and writes code. She believes almost anything can be improved by adding robots.", "favorite_subreddits": ["/r/depthhub", "/r/foodforthought", "/r/dataisbeautiful"], "mornings": 9999, "name": "Valerie Hajdik", "new": 201204, "pyro": 8, "role": "Programmer", "role_details": "generalist", "top": 1.7, "username": "shlurbee", "wpm": 109},
+ {"beard": 9, "description": "Neil tirelessly torches troublemakers in TF2. When he's not doing that he writes code. For a time, he was the only programmer at reddit.", "favorite_subreddits": ["/r/dogs", "/r/truetf2", "/r/boardgames"], "name": "Neil Williams", "new": 201011, "pings": 1, "pyro": 3, "role": "Lead Programmancer", "role_details": "mm mhm mmm!!", "top": 1.72, "username": "spladug", "wpm": 111},
+ {"beard": 0, "description": "what is this i don't even", "favorite_subreddits": ["/r/yishansucks", "/r/starcraft2_class", "/r/theoryofreddit"], "name": "Yishan Wong", "new": 201202, "pyro": 1, "rabbits": 3, "role": "CEO", "role_details": "sparklepants", "top": 1.74, "username": "yishan", "wpm": 91}
],
"alumni": [
- {"beard": 5, "cartoon": 5, "description": "If reddit is down, that's probably still my fault.", "favorite_subreddits": ["/r/space", "/r/truereddit", "/r/IAMA", "/r/askscience"], "name": "Jeremy Edberg", "new": 200703, "pyro": 1, "role": "Information Cowboy", "role_details": "no really it says that on the business card", "top": 1.7, "username": "jedberg", "wpm": 57},
- {"beard": 8, "description": "If reddit's slow, that's probably my fault", "favorite_subreddits": ["/r/askscience", "/r/robotics", "/r/electronics", "/r/lingusitics", "/r/picturesofiansleeping", "/r/artificial", "/r/math"], "name": "David King", "new": 200802, "pyro": 0, "role": "Scaling/Data guy", "role_details": "the quiet one", "top": 1.72, "username": "ketralnis", "wpm": 80},
- {"beard": 7, "description": "Did all the hard math and inserts <div><!--iesux-></div> into the DOM. ", "favorite_subreddits": ["/r/shutupandtakemymoney", ""], "name": "Chris Slowe", "new": 200507, "physics": "Graham's number", "pyro": 0, "role": "Senior Programmer", "role_details": "Se\u00f1or Programmer", "top": 1.67, "username": "KeyserSosa"},
- {"beard": 4, "description": "Making people love reddit as board member.", "doodles": 420, "favorite_subreddits": ["/r/aww", "/r/worldnews", "/r/redskins"], "name": "Alexis Ohanian", "new": 200506, "pyro": 2, "role": "Co-founder", "role_details": "alien doodler", "top": 1.93, "username": "kn0thing", "wpm": 60},
- {"beard": 10, "description": "When reddit needed gum to hold itself together, he was there to chew it. ", "favorite_subreddits": ["/r/baseball", "/r/reddithax", "/r/vexillology"], "karma": "229822", "name": "Mike Schiraldi", "new": 200811, "pyro": 0, "role": "Programmer", "role_details": "good, fast, cheap -- pick any of the last two", "top": 1.721, "username": "raldi", "wpm": 92},
- {"beard": 0, "description": "The original reddit programmer. Steve wrote the first version of reddit in LISP and a huge part of every version since.", "favorite_subreddits": ["/r/circlejerk"], "name": "Steve Huffman", "new": 200506, "pyro": 0, "role": "co-founder", "role_details": "", "top": 1.83, "username": "spez"}
+ {"beard": 5, "cartoon": 5, "description": "If reddit is down, that's probably still my fault.", "favorite_subreddits": ["/r/space", "/r/truereddit", "/r/IAMA", "/r/askscience"], "name": "Jeremy Edberg", "new": 200703, "pyro": 1, "role": "Information Cowboy", "role_details": "no really it says that on the business card", "top": 1.7, "username": "jedberg", "wpm": 57},
+ {"beard": 8, "description": "If reddit's slow, that's probably my fault", "favorite_subreddits": ["/r/askscience", "/r/robotics", "/r/electronics", "/r/lingusitics", "/r/picturesofiansleeping", "/r/artificial", "/r/math"], "name": "David King", "new": 200802, "pyro": 0, "role": "Scaling/Data guy", "role_details": "the quiet one", "top": 1.72, "username": "ketralnis", "wpm": 80},
+ {"beard": 7, "description": "Did all the hard math and inserts <div><!--iesux-></div> into the DOM. ", "favorite_subreddits": ["/r/shutupandtakemymoney", ""], "name": "Chris Slowe", "new": 200507, "physics": "Graham's number", "pyro": 0, "role": "Senior Programmer", "role_details": "Se\u00f1or Programmer", "top": 1.67, "username": "KeyserSosa"},
+ {"beard": 4, "description": "Making people love reddit as board member.", "doodles": 420, "favorite_subreddits": ["/r/aww", "/r/worldnews", "/r/redskins"], "name": "Alexis Ohanian", "new": 200506, "pyro": 2, "role": "Co-founder", "role_details": "alien doodler", "top": 1.93, "username": "kn0thing", "wpm": 60},
+ {"beard": 10, "description": "When reddit needed gum to hold itself together, he was there to chew it. ", "favorite_subreddits": ["/r/baseball", "/r/reddithax", "/r/vexillology"], "karma": "229822", "name": "Mike Schiraldi", "new": 200811, "pyro": 0, "role": "Programmer", "role_details": "good, fast, cheap -- pick any of the last two", "top": 1.721, "username": "raldi", "wpm": 92},
+ {"beard": 0, "description": "The original reddit programmer. Steve wrote the first version of reddit in LISP and a huge part of every version since.", "favorite_subreddits": ["/r/circlejerk"], "name": "Steve Huffman", "new": 200506, "pyro": 0, "role": "co-founder", "role_details": "", "top": 1.83, "username": "spez"}
]
}
View
30 reddit_about/public/static/js/about/about-postcards.js
@@ -110,7 +110,7 @@ PostcardRouter = Backbone.Router.extend({
this.navigate('view/' + cardId + '/' + side, {replace: true})
}, this)
this.zoomer.on('hidecard', function(cardId) {
- this.navigate('browse', {replace: true})
+ this.navigate('/', {replace: true})
}, this)
},
@@ -182,17 +182,22 @@ var PostcardInfoView = PostcardOverlayView.extend({
},
updateMap: function(zoom) {
+ var mapSize = 85
+
this.$('.maplink').attr('href', mapURL({
lat: this.model.get('latitude'),
'long': this.model.get('longitude')
}))
- this.$('.map').attr('src', mapImageURL({
- lat: this.model.get('latitude'),
- 'long': this.model.get('longitude'),
- width: 85,
- height: 85,
- zoom: zoom
- }))
+ this.$('.map')
+ .attr('src', mapImageURL({
+ lat: this.model.get('latitude'),
+ 'long': this.model.get('longitude'),
+ width: mapSize,
+ height: mapSize,
+ zoom: zoom
+ }))
+ .width(mapSize)
+ .height(mapSize)
},
_target: function() {
@@ -210,7 +215,10 @@ var PostcardRedditView = PostcardOverlayView.extend({
className: 'redditbutton',
render: function() {
- var iframe = $('<iframe src="'+redditButtonURL({url: window.location})+'">')
+ // Strip the # from the URL to normalize to the pushState-style permalink URL.
+ var postcardURL = encodeURIComponent(String(window.location).replace('#', '')),
+ iframe = $('<iframe src="'+redditButtonURL({url: postcardURL})+'">')
+
iframe
.css('opacity', 0)
.load(function() {
@@ -569,9 +577,7 @@ r.about.pages['about-postcards'] = function() {
var cardRouter = new PostcardRouter({zoomer: grid})
postcards.load(function() {
- if (!Backbone.history.start()) {
- cardRouter.navigate('browse')
- }
+ Backbone.history.start({pushState: true, root: '/about/postcards/'})
$('.abouttitle h1')
.find('.count').text(postcards.totalCount).end()
.fadeIn(100)
View
7 reddit_about/public/static/js/about/about-team.js
@@ -65,7 +65,12 @@ SortableCollection = Backbone.Collection.extend({
if (!sort) {
return
}
- return sort.get('dir') * model.get(sort.id) || model.get('random')
+
+ var sortVal = model.get(sort.id)
+ if (_.isNumber(sortVal)) {
+ sortVal = sortVal * sort.get('dir')
+ }
+ return sortVal || model.get('random')
}
})
Something went wrong with that request. Please try again.