/*jslint plusplus:false,white:false,undef: false, rhino: true, onevar: true, evil: true */ /* Title: Social Arquivo: i3geo/classesjs/classe_social.js Licenca: GPL2 i3Geo Interface Integrada de Ferramentas de Geoprocessamento para Internet Direitos Autorais Reservados (c) 2006 Ministério do Meio Ambiente Brasil Desenvolvedor: Edmar Moretti edmar.moretti@mma.gov.br Este programa é software livre; você pode redistribuí-lo e/ou modificá-lo sob os termos da Licença Pública Geral GNU conforme publicada pela Free Software Foundation; Este programa é distribuído na expectativa de que seja útil, porém, SEM NENHUMA GARANTIA; nem mesmo a garantia implícita de COMERCIABILIDADE OU ADEQUAÇÃO A UMA FINALIDADE ESPECÍFICA. Consulte a Licença Pública Geral do GNU para mais detalhes. Você deve ter recebido uma cópia da Licença Pública Geral do GNU junto com este programa; se não, escreva para a Free Software Foundation, Inc., no endereço 59 Temple Street, Suite 330, Boston, MA 02111-1307 USA. */ if(typeof(i3GEO) === 'undefined'){ i3GEO = []; } /* Classe: i3GEO.social Opções de compartilhamento e uso de redes sociais. */ i3GEO.social = { curtirFacebook: function(url,tipo){ if(tipo === "comtotal") {return "";} if(tipo === "semtotal") {return "";} }, publicarTwitter: function(url,tipo){ var re = new RegExp("=","g"); url = url.replace(re,'%3d'); if(tipo === "comtotal") {return '';} if(tipo === "semtotal") {return '';} }, /* Function: compartilhar Cria os botões de publicar no Twitter e curtir/compartilhar no Facebook Gera o HTML contendo as tags IMG com os links Parametro: id {string} - id do elemento HTML que receberá os links urlcf {string} - url para o Facebook urlpt {string} - url para o Twitter tipo {string} - tipo de botão comtotal|semtotal locaplic {string} - url onde está o i3Geo. Se não for especificada, será obtida de i3GEO.configura.locaplic Return: HTML com os botões */ compartilhar: function(id,urlcf,urlpt,tipo,locaplic){ if(!locaplic) {locaplic = i3GEO.configura.locaplic;} if(!tipo) {tipo = "comtotal";} var onde = $i(id), tabela = ""; if(tipo === "comtotal") {tabela += "";} if(tipo === "semtotal") {tabela += "
";} if(onde || id === ""){ if(urlpt !== ""){ tabela += ""; } if(urlcf !== ""){ //tabela += ""; tabela += ""; } tabela += "
"+i3GEO.social.publicarTwitter(urlpt,tipo)+""+i3GEO.social.curtirFacebook(urlcf,tipo)+"
"; if(id !== "") {onde.innerHTML = tabela;} return tabela; } else {return false;} }, /* Function: bookmark Cria os botões de bookmark em redes sociais Gera o HTML contendo as tags IMG com os links Parametro: link {string} - link que será marcado locaplic {string} - url onde está o i3Geo. Se não for especificada, será obtida de i3GEO.configura.locaplic Return: HTML com os botões */ bookmark: function(link,locaplic){ if(!locaplic) {locaplic = i3GEO.configura.locaplic;} var ins = " "; ins += " "; ins += " "; ins += ""; return ins; } };