This adds pinterest as an option on social icons, and adds per-slide sharing links. #834

Merged
merged 4 commits into from Jul 25, 2014

Projects

None yet

2 participants

@chee
Contributor
chee commented Jul 24, 2014

The code might be mental. if it is, i am sorry.

RFC

@Ianfeather Ianfeather and 1 other commented on an outdated diff Jul 24, 2014
app/assets/javascripts/lib/components/gallery.js
};
Gallery.prototype._updateImageInfo = function() {
var slideDetails = this.slider.$currentSlide.find(".js-slide-details"),
caption = slideDetails.find(".caption").text(),
poi = slideDetails.find(".poi").html(),
- breadcrumb = slideDetails.find(".breadcrumb").html();
+ breadcrumb = slideDetails.find(".breadcrumb").html(),
@Ianfeather
Ianfeather Jul 24, 2014 Contributor

Can these four selectors use js- prefixed classes?

@chee
chee Jul 24, 2014 Contributor

yes they certainly should, shouldn't they? yes i'll fix that.

@Ianfeather Ianfeather commented on the diff Jul 24, 2014
app/assets/javascripts/lib/components/gallery.js
this.galleryTitle.text(caption);
this.galleryPoi.html(poi);
this.galleryBreadcrumb.html(breadcrumb);
+ this.gallerySocial.html(social);
@Ianfeather
Ianfeather Jul 24, 2014 Contributor

Can you add a spec for this? Should be pretty clear/easy to continue the one I wrote.

@chee
chee Jul 24, 2014 Contributor

sure thing

@Ianfeather Ianfeather commented on the diff Jul 24, 2014
app/views/components/_social_buttons.html.haml
@@ -1,5 +1,8 @@
-- encoded_url = CGI.escape(properties[:url])
-- tweet = properties[:tweet] || encoded_url
+:ruby
+ show = properties[:show] || %w(facebook twitter google-plus stumbleupon)
+ show = show - (properties[:hide] || [])
@Ianfeather
Ianfeather Jul 24, 2014 Contributor

This is nice. It would probably have been enough just to do pinterest, but cool - nice and flexible

@chee
chee Jul 24, 2014 Contributor

Yeah, I suppose I don't know if we'll ever need it. But it's nice that if there is a page where, for example, the stumbleupon icon makes more sense displayed somewhere other than the social bar we can just pass hide: ['stumbleupon']

i'm glad i found this code. i thought i'd chee'd it, i wrote it a few weeks ago in rockton.

@Ianfeather
Contributor

Looks good otherwise

@chee
Contributor
chee commented Jul 24, 2014

Cool. Thanks, Ian. I'll fix those things up, :housekiller:.

Related: https://github.com/lonelyplanet/waldorf/pull/1361

@chee
Contributor
chee commented Jul 24, 2014

Yay.

@Ianfeather
Contributor

+1

@chee chee merged commit 5d21303 into master Jul 25, 2014
@chee chee deleted the chee/social branch Jul 25, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment