Commit 69ac034f405ac8da24cba98b3d6dda4eafe50349
1 parent
da407e41
Exists in
master
and in
7 other branches
Inclusão do botão Facebook na função de compartilhamento e complementação da documentação
Showing
1 changed file
with
38 additions
and
7 deletions
Show diff stats
classesjs/classe_social.js
| ... | ... | @@ -39,7 +39,7 @@ Opções de compartilhamento e uso de redes sociais. |
| 39 | 39 | i3GEO.social = { |
| 40 | 40 | curtirFacebook: function(url,tipo){ |
| 41 | 41 | if(tipo == "comtotal") |
| 42 | - {return "<iframe src='http://www.facebook.com/plugins/like.php?href="+url+"&layout=button_count&show_faces=false&width=200&action=like&colorscheme=light&height=21' scrolling='no' frameborder='0' style='border:none; overflow:hidden; width:200px; height:21px;' allowTransparency='true'></iframe>";} | |
| 42 | + {return "<iframe src='http://www.facebook.com/plugins/like.php?href="+url+"&layout=button_count&show_faces=false&width=160&action=like&colorscheme=light&height=21' scrolling='no' frameborder='0' style='border:none; overflow:hidden; width:160px; height:21px;' allowTransparency='true'></iframe>";} | |
| 43 | 43 | if(tipo == "semtotal") |
| 44 | 44 | {return "<iframe src='http://www.facebook.com/plugins/like.php?href="+url+"&layout=button_count&show_faces=false&width=55&action=like&colorscheme=light&height=21' scrolling='no' frameborder='0' style='border:none; overflow:hidden; width:55px; height:21px;' allowTransparency='true'></iframe>";} |
| 45 | 45 | }, |
| ... | ... | @@ -49,7 +49,33 @@ i3GEO.social = { |
| 49 | 49 | if(tipo == "semtotal") |
| 50 | 50 | {return '<iframe allowtransparency="true" frameborder="0" scrolling="no" src="http://platform.twitter.com/widgets/tweet_button.html?count=none&via=i3geo&url='+url+'" style="width:55px; height:21px;"></iframe>';} |
| 51 | 51 | }, |
| 52 | - compartilhar: function(id,urlcf,urlpt,tipo){ | |
| 52 | + /* | |
| 53 | + Function: compartilhar | |
| 54 | + | |
| 55 | + Cria os botões de publicar no Twitter e curtir/compartilhar no Facebook | |
| 56 | + | |
| 57 | + Gera o HTML contendo as tags IMG com os links | |
| 58 | + | |
| 59 | + Parametro: | |
| 60 | + | |
| 61 | + id {string} - id do elemento HTML que receberá os links | |
| 62 | + | |
| 63 | + urlcf {string} - url para o Facebook | |
| 64 | + | |
| 65 | + urlpt {string} - url para o Twitter | |
| 66 | + | |
| 67 | + tipo {string} - tipo de botão comtotal|semtotal | |
| 68 | + | |
| 69 | + | |
| 70 | + locaplic {string} - url onde está o i3Geo. Se não for especificada, será obtida de i3GEO.configura.locaplic | |
| 71 | + | |
| 72 | + Return: | |
| 73 | + | |
| 74 | + HTML com os botões | |
| 75 | + */ | |
| 76 | + compartilhar: function(id,urlcf,urlpt,tipo,locaplic){ | |
| 77 | + if(!locaplic) | |
| 78 | + {locaplic = i3GEO.configura.locaplic;} | |
| 53 | 79 | if(!tipo) |
| 54 | 80 | {tipo = "comtotal";} |
| 55 | 81 | var onde = $i(id), |
| ... | ... | @@ -63,6 +89,7 @@ i3GEO.social = { |
| 63 | 89 | tabela += "<td>"+i3GEO.social.publicarTwitter(urlpt,tipo)+"</td>"; |
| 64 | 90 | } |
| 65 | 91 | if(urlcf !== ""){ |
| 92 | + tabela += "<td><img style='cursor:pointer' src='"+locaplic+"/imagens/facebook.gif' onclick='javascript:window.open(\"http://www.facebook.com/sharer.php?u="+urlcf+"\")' title='Compartilhar'/></td>"; | |
| 66 | 93 | tabela += "<td>"+i3GEO.social.curtirFacebook(urlcf,tipo)+"</td>"; |
| 67 | 94 | } |
| 68 | 95 | tabela += "</tr></table>"; |
| ... | ... | @@ -84,15 +111,19 @@ i3GEO.social = { |
| 84 | 111 | |
| 85 | 112 | link {string} - link que será marcado |
| 86 | 113 | |
| 114 | + locaplic {string} - url onde está o i3Geo. Se não for especificada, será obtida de i3GEO.configura.locaplic | |
| 115 | + | |
| 87 | 116 | Return: |
| 88 | 117 | |
| 89 | 118 | HTML com os botões |
| 90 | 119 | */ |
| 91 | - bookmark: function(link){ | |
| 92 | - ins = "<img src='"+i3GEO.configura.locaplic+"/imagens/delicious.gif' onclick='javascript:window.open(\"http://del.icio.us/post?url="+link+"\")' title='Delicious'/> "; | |
| 93 | - ins += "<img src='"+i3GEO.configura.locaplic+"/imagens/digg.gif' onclick='javascript:window.open(\"http://digg.com/submit/post?url="+link+"\")' title='Digg'/> "; | |
| 94 | - ins += "<img src='"+i3GEO.configura.locaplic+"/imagens/facebook.gif' onclick='javascript:window.open(\"http://www.facebook.com/sharer.php?u="+link+"\")' title='Facebook'/> "; | |
| 95 | - ins += "<img src='"+i3GEO.configura.locaplic+"/imagens/stumbleupon.gif' onclick='javascript:window.open(\"http://www.stumbleupon.com/submit?url="+link+"\")' title='StumbleUpon'/>"; | |
| 120 | + bookmark: function(link,locaplic){ | |
| 121 | + if(!locaplic) | |
| 122 | + {locaplic = i3GEO.configura.locaplic;} | |
| 123 | + var ins = "<img style='cursor:pointer' src='"+locaplic+"/imagens/delicious.gif' onclick='javascript:window.open(\"http://del.icio.us/post?url="+link+"\")' title='Delicious'/> "; | |
| 124 | + ins += "<img style='cursor:pointer' src='"+locaplic+"/imagens/digg.gif' onclick='javascript:window.open(\"http://digg.com/submit/post?url="+link+"\")' title='Digg'/> "; | |
| 125 | + ins += "<img style='cursor:pointer' src='"+locaplic+"/imagens/facebook.gif' onclick='javascript:window.open(\"http://www.facebook.com/sharer.php?u="+link+"\")' title='Facebook'/> "; | |
| 126 | + ins += "<img style='cursor:pointer' src='"+locaplic+"/imagens/stumbleupon.gif' onclick='javascript:window.open(\"http://www.stumbleupon.com/submit?url="+link+"\")' title='StumbleUpon'/>"; | |
| 96 | 127 | return ins; |
| 97 | 128 | } |
| 98 | 129 | }; | ... | ... |