Commit b2e6083ed2c4b97d9f50bf070e4fb0c66d96e446
1 parent
af3ce65f
Exists in
master
and in
2 other branches
Add picture param to FB.ui
Showing
3 changed files
with
7 additions
and
6 deletions
Show diff stats
index.html
@@ -163,7 +163,7 @@ | @@ -163,7 +163,7 @@ | ||
163 | <a href="#/programas">Programas</a> | 163 | <a href="#/programas">Programas</a> |
164 | </div> | 164 | </div> |
165 | <div class="social top"> | 165 | <div class="social top"> |
166 | - {{#social_share "Dialoga Brasil" "Aqui suas ideias viram propostas e você ajuda a melhorar as ações do governo" "#"}}{{/social_share}} | 166 | + {{#social_share "Dialoga Brasil" "Aqui suas ideias viram propostas e você ajuda a melhorar as ações do governo" "#" "http://dialoga.gov.br/images/logo.png"}}{{/social_share}} |
167 | </div> | 167 | </div> |
168 | </header> | 168 | </header> |
169 | 169 | ||
@@ -283,7 +283,7 @@ | @@ -283,7 +283,7 @@ | ||
283 | <div class="col-sm-4 col-sm-offset-4"> | 283 | <div class="col-sm-4 col-sm-offset-4"> |
284 | <div class="social right"> | 284 | <div class="social right"> |
285 | <span>COMPARTILHE<br>ESTE PROGRAMA</span> | 285 | <span>COMPARTILHE<br>ESTE PROGRAMA</span> |
286 | - {{{social_share title abstract (program_detail_url id)}}} | 286 | + {{{social_share title abstract (program_detail_url id) image.url }}} |
287 | </div> | 287 | </div> |
288 | </div> | 288 | </div> |
289 | </div> | 289 | </div> |
@@ -381,7 +381,7 @@ | @@ -381,7 +381,7 @@ | ||
381 | </div> | 381 | </div> |
382 | <div class="social"> | 382 | <div class="social"> |
383 | <span>Compartilhe esta proposta</span> | 383 | <span>Compartilhe esta proposta</span> |
384 | - {{{social_share parent.title abstract (proposal_url parent.id id)}}} | 384 | + {{{social_share parent.title abstract (proposal_url parent.id id) parent.image.url}}} |
385 | </div> | 385 | </div> |
386 | </script> | 386 | </script> |
387 | 387 | ||
@@ -571,7 +571,7 @@ | @@ -571,7 +571,7 @@ | ||
571 | 571 | ||
572 | <script id="social-share" type="text/x-handlebars-template"> | 572 | <script id="social-share" type="text/x-handlebars-template"> |
573 | <ul> | 573 | <ul> |
574 | - <li><a href="{{url}}" class="fb-share icon icon-facebook" data-caption="{{title}}" data-description="{{stripTags description}}"><span class="fa fa-facebook"></span><span class="sr-only">Compartilhar no Facebook</span></a></li> | 574 | + <li><a href="{{url}}" class="fb-share icon icon-facebook" data-caption="{{title}}" data-description="{{stripTags description}}" data-picture="{{image_url}}"><span class="fa fa-facebook"></span><span class="sr-only">Compartilhar no Facebook</span></a></li> |
575 | <li><a href="https://twitter.com/intent/tweet?url={{encodeURI url}}&text={{stripTags description}}" target="_blank" class="tw-share icon icon-twitter popup"><span class="fa fa-twitter"></span><span class="sr-only">Compartilhar no Twitter</span></a></li> | 575 | <li><a href="https://twitter.com/intent/tweet?url={{encodeURI url}}&text={{stripTags description}}" target="_blank" class="tw-share icon icon-twitter popup"><span class="fa fa-twitter"></span><span class="sr-only">Compartilhar no Twitter</span></a></li> |
576 | <li><a href="https://plus.google.com/share?url={{encodeURI url}}" target="_blank" class="gp-share icon icon-gplus popup"><span class="fa fa-google-plus"></span><span class="sr-only">Compartilhar no Google Plus</span></a></li> | 576 | <li><a href="https://plus.google.com/share?url={{encodeURI url}}" target="_blank" class="gp-share icon icon-gplus popup"><span class="fa fa-google-plus"></span><span class="sr-only">Compartilhar no Google Plus</span></a></li> |
577 | <li><a href="whatsapp://send?text={{stripTags description}} {{encodeURI url}}" target="_blank" class="ws-share icon icon-whatsapp"><span class="fa fa-whatsapp"></span><span class="sr-only">Compartilhar no WhatsApp</span></a></li> | 577 | <li><a href="whatsapp://send?text={{stripTags description}} {{encodeURI url}}" target="_blank" class="ws-share icon icon-whatsapp"><span class="fa fa-whatsapp"></span><span class="sr-only">Compartilhar no WhatsApp</span></a></li> |
js/handlebars-helpers.js
@@ -103,13 +103,13 @@ define(['handlebars'], function(Handlebars){ | @@ -103,13 +103,13 @@ define(['handlebars'], function(Handlebars){ | ||
103 | return +(Math.round(num + "e+2") + "e-2"); | 103 | return +(Math.round(num + "e+2") + "e-2"); |
104 | }); | 104 | }); |
105 | 105 | ||
106 | - Handlebars.registerHelper('social_share', function(title, description, url) { | 106 | + Handlebars.registerHelper('social_share', function(title, description, url, image_url) { |
107 | var template = Handlebars.compile($('#social-share').html()); | 107 | var template = Handlebars.compile($('#social-share').html()); |
108 | if(url==='#') { | 108 | if(url==='#') { |
109 | url = ''; | 109 | url = ''; |
110 | } | 110 | } |
111 | url = 'http:'+Url.addBaseUrl(url); | 111 | url = 'http:'+Url.addBaseUrl(url); |
112 | - return template({title: title, description: description, url: url}); | 112 | + return template({title: title, description: description, url: url, image_url: image_url}); |
113 | }); | 113 | }); |
114 | 114 | ||
115 | Handlebars.registerHelper('proposal_url', function(parent_id, id) { | 115 | Handlebars.registerHelper('proposal_url', function(parent_id, id) { |
js/main.js
@@ -1458,6 +1458,7 @@ define(['jquery', 'handlebars', 'fastclick', 'proposal_app', 'handlebars_helpers | @@ -1458,6 +1458,7 @@ define(['jquery', 'handlebars', 'fastclick', 'proposal_app', 'handlebars_helpers | ||
1458 | name: $(this).data('name') || 'Dialoga Brasil', | 1458 | name: $(this).data('name') || 'Dialoga Brasil', |
1459 | caption: $(this).data('caption') || 'dialoga.gov.br', | 1459 | caption: $(this).data('caption') || 'dialoga.gov.br', |
1460 | description: $(this).data('description'), | 1460 | description: $(this).data('description'), |
1461 | + picture: $(this).data('picture'), | ||
1461 | }, function(response){ | 1462 | }, function(response){ |
1462 | console.log('response', response); | 1463 | console.log('response', response); |
1463 | }); | 1464 | }); |