Commit 4bd5b015eaad5307d46555bcee7ba8ae87f3071c
1 parent
92ef7cd7
Exists in
master
and in
7 other branches
Inclusão de opções de bookmark na ferramenta comentários
Showing
6 changed files
with
139 additions
and
125 deletions
Show diff stats
classesjs/classe_util.js
... | ... | @@ -1952,6 +1952,13 @@ i3GEO.util = { |
1952 | 1952 | if(typeof(console) !== 'undefined'){console.info(mensagem);} |
1953 | 1953 | var js = i3GEO.configura.locaplic+"/ferramentas/"+dir+"/index.js.php"; |
1954 | 1954 | i3GEO.util.scriptTag(js,"i3GEOF."+nome+".criaJanelaFlutuante()","i3GEOF."+nome+"_script"); |
1955 | + }, | |
1956 | + bookmark: function(link){ | |
1957 | + ins = "<img src='"+i3GEO.configura.locaplic+"/imagens/delicious.gif' onclick='javascript:window.open(\"http://del.icio.us/post?url="+link+"\")' title='Delicious'/> "; | |
1958 | + ins += "<img src='"+i3GEO.configura.locaplic+"/imagens/digg.gif' onclick='javascript:window.open(\"http://digg.com/submit/post?url="+link+"\")' title='Digg'/> "; | |
1959 | + ins += "<img src='"+i3GEO.configura.locaplic+"/imagens/facebook.gif' onclick='javascript:window.open(\"http://www.facebook.com/sharer.php?u="+link+"\")' title='Facebook'/> "; | |
1960 | + ins += "<img src='"+i3GEO.configura.locaplic+"/imagens/stumbleupon.gif' onclick='javascript:window.open(\"http://www.stumbleupon.com/submit?url="+link+"\")' title='StumbleUpon'/>"; | |
1961 | + return ins; | |
1955 | 1962 | } |
1956 | 1963 | }; |
1957 | 1964 | |
... | ... | @@ -1968,140 +1975,142 @@ i3GEO.util = { |
1968 | 1975 | // TODO: build hover script for highlighting header in IE |
1969 | 1976 | // TODO: attach behaviour based on rel attribute |
1970 | 1977 | //++++++++++++++++++++++++++++++++++++ |
1978 | +try{ | |
1979 | + YAHOO.namespace("lutsr"); | |
1980 | + YAHOO.lutsr.accordion = { | |
1981 | + properties : { | |
1982 | + animation : true, | |
1983 | + animationDuration : 10, | |
1984 | + multipleOpen : false, | |
1985 | + Id: "sanfona", | |
1986 | + altura: 200, | |
1987 | + ativa: 0 | |
1988 | + }, | |
1971 | 1989 | |
1972 | -YAHOO.namespace("lutsr"); | |
1973 | -YAHOO.lutsr.accordion = { | |
1974 | - properties : { | |
1975 | - animation : true, | |
1976 | - animationDuration : 10, | |
1977 | - multipleOpen : false, | |
1978 | - Id: "sanfona", | |
1979 | - altura: 200, | |
1980 | - ativa: 0 | |
1981 | - }, | |
1982 | - | |
1983 | - init : function(animation,animationDuration,multipleOpen,Id,altura,ativa) { | |
1984 | - if(animation) { | |
1985 | - this.properties.animation = animation; | |
1986 | - } | |
1987 | - if(animationDuration) { | |
1988 | - this.properties.animationDuration = animationDuration; | |
1989 | - } | |
1990 | - if(multipleOpen) { | |
1991 | - this.properties.multipleOpen = multipleOpen; | |
1992 | - } | |
1993 | - if(Id) { | |
1994 | - this.properties.Id = Id; | |
1995 | - } | |
1996 | - if(altura) { | |
1997 | - this.properties.altura = altura; | |
1998 | - } | |
1999 | - if(ativa) { | |
2000 | - this.properties.ativa = ativa; | |
2001 | - } | |
2002 | - var accordionObject = document.getElementById(this.properties.Id); | |
2003 | - if(accordionObject) { | |
2004 | - if(accordionObject.nodeName == "DL") { | |
2005 | - var headers = accordionObject.getElementsByTagName("dt"); | |
2006 | - var bodies = headers[0].parentNode.getElementsByTagName("dd"); | |
1990 | + init : function(animation,animationDuration,multipleOpen,Id,altura,ativa) { | |
1991 | + if(animation) { | |
1992 | + this.properties.animation = animation; | |
2007 | 1993 | } |
2008 | - this.attachEvents(headers,0); | |
2009 | - } | |
2010 | - }, | |
1994 | + if(animationDuration) { | |
1995 | + this.properties.animationDuration = animationDuration; | |
1996 | + } | |
1997 | + if(multipleOpen) { | |
1998 | + this.properties.multipleOpen = multipleOpen; | |
1999 | + } | |
2000 | + if(Id) { | |
2001 | + this.properties.Id = Id; | |
2002 | + } | |
2003 | + if(altura) { | |
2004 | + this.properties.altura = altura; | |
2005 | + } | |
2006 | + if(ativa) { | |
2007 | + this.properties.ativa = ativa; | |
2008 | + } | |
2009 | + var accordionObject = document.getElementById(this.properties.Id); | |
2010 | + if(accordionObject) { | |
2011 | + if(accordionObject.nodeName == "DL") { | |
2012 | + var headers = accordionObject.getElementsByTagName("dt"); | |
2013 | + var bodies = headers[0].parentNode.getElementsByTagName("dd"); | |
2014 | + } | |
2015 | + this.attachEvents(headers,0); | |
2016 | + } | |
2017 | + }, | |
2011 | 2018 | |
2012 | - attachEvents : function(headers,nr) { | |
2013 | - for(var i=0; i<headers.length; i++) { | |
2014 | - var headerProperties = { | |
2015 | - objRef : headers[i], | |
2016 | - nr : i, | |
2017 | - jsObj : this | |
2018 | - }; | |
2019 | - YAHOO.util.Event.addListener(headers[i],"click",this.clickHeader,headerProperties); | |
2020 | - } | |
2021 | - var parentObj = headers[this.properties.ativa].parentNode; | |
2022 | - var headers = parentObj.getElementsByTagName("dd"); | |
2023 | - var header = headers[this.properties.ativa]; | |
2019 | + attachEvents : function(headers,nr) { | |
2020 | + for(var i=0; i<headers.length; i++) { | |
2021 | + var headerProperties = { | |
2022 | + objRef : headers[i], | |
2023 | + nr : i, | |
2024 | + jsObj : this | |
2025 | + }; | |
2026 | + YAHOO.util.Event.addListener(headers[i],"click",this.clickHeader,headerProperties); | |
2027 | + } | |
2028 | + var parentObj = headers[this.properties.ativa].parentNode; | |
2029 | + var headers = parentObj.getElementsByTagName("dd"); | |
2030 | + var header = headers[this.properties.ativa]; | |
2024 | 2031 | |
2025 | - this.expand(header); | |
2026 | - }, | |
2032 | + this.expand(header); | |
2033 | + }, | |
2027 | 2034 | |
2028 | - clickHeader : function(e,headerProperties) { | |
2029 | - var parentObj = headerProperties.objRef.parentNode; | |
2030 | - var headers = parentObj.getElementsByTagName("dd"); | |
2031 | - var header = headers[headerProperties.nr]; | |
2035 | + clickHeader : function(e,headerProperties) { | |
2036 | + var parentObj = headerProperties.objRef.parentNode; | |
2037 | + var headers = parentObj.getElementsByTagName("dd"); | |
2038 | + var header = headers[headerProperties.nr]; | |
2032 | 2039 | |
2033 | - if(YAHOO.util.Dom.hasClass(header,"open")) { | |
2034 | - headerProperties.jsObj.collapse(header); | |
2035 | - } else { | |
2036 | - if(headerProperties.jsObj.properties.multipleOpen) { | |
2037 | - headerProperties.jsObj.expand(header); | |
2040 | + if(YAHOO.util.Dom.hasClass(header,"open")) { | |
2041 | + headerProperties.jsObj.collapse(header); | |
2038 | 2042 | } else { |
2039 | - for(var i=0; i<headers.length; i++) { | |
2040 | - if(YAHOO.util.Dom.hasClass(headers[i],"open")) { | |
2041 | - headerProperties.jsObj.collapse(headers[i]); | |
2043 | + if(headerProperties.jsObj.properties.multipleOpen) { | |
2044 | + headerProperties.jsObj.expand(header); | |
2045 | + } else { | |
2046 | + for(var i=0; i<headers.length; i++) { | |
2047 | + if(YAHOO.util.Dom.hasClass(headers[i],"open")) { | |
2048 | + headerProperties.jsObj.collapse(headers[i]); | |
2049 | + } | |
2042 | 2050 | } |
2051 | + headerProperties.jsObj.expand(header); | |
2043 | 2052 | } |
2044 | - headerProperties.jsObj.expand(header); | |
2045 | 2053 | } |
2046 | - } | |
2047 | - }, | |
2048 | - | |
2049 | - collapse : function(header) { | |
2050 | - YAHOO.util.Dom.removeClass(YAHOO.util.Dom.getPreviousSibling(header),"selected"); | |
2051 | - if(!this.properties.animation) { | |
2052 | - YAHOO.util.Dom.removeClass(header,"open"); | |
2053 | - } else { | |
2054 | - this.initAnimation(header,"close"); | |
2055 | - } | |
2056 | - }, | |
2057 | - expand : function(header) { | |
2058 | - YAHOO.util.Dom.addClass(YAHOO.util.Dom.getPreviousSibling(header),"selected"); | |
2059 | - if(!this.properties.animation) { | |
2060 | - YAHOO.util.Dom.addClass(header,"open"); | |
2061 | - } else { | |
2062 | - this.initAnimation(header,"open"); | |
2063 | - } | |
2064 | - }, | |
2065 | - initAnimation : function(header,dir) { | |
2066 | - if(dir == "open") { | |
2067 | - YAHOO.util.Dom.setStyle(header,"visibility","hidden"); | |
2068 | - YAHOO.util.Dom.setStyle(header,"height",this.properties.altura); | |
2069 | - YAHOO.util.Dom.addClass(header,"open"); | |
2070 | - var attributes = { | |
2071 | - height : { | |
2072 | - from : 0, | |
2073 | - to : this.properties.altura | |
2074 | - } | |
2075 | - }; | |
2076 | - YAHOO.util.Dom.setStyle(header,"height",0); | |
2077 | - YAHOO.util.Dom.setStyle(header,"visibility","visible"); | |
2078 | - | |
2079 | - var animation = new YAHOO.util.Anim(header,attributes); | |
2080 | - animationEnd = function() { | |
2081 | - //alert(this.properties.altura+"px") | |
2082 | - header.style.height = this.properties.altura+"px"; | |
2083 | - }; | |
2084 | - animation.duration = this.properties.animationDuration; | |
2085 | - animation.useSeconds = false; | |
2086 | - animation.onComplete.subscribe(animationEnd); | |
2087 | - animation.animate(); | |
2088 | - } else if ("close") { | |
2089 | - var attributes = { | |
2090 | - height : { | |
2091 | - to : 0 | |
2092 | - } | |
2093 | - }; | |
2094 | - animationEnd = function() { | |
2054 | + }, | |
2055 | + | |
2056 | + collapse : function(header) { | |
2057 | + YAHOO.util.Dom.removeClass(YAHOO.util.Dom.getPreviousSibling(header),"selected"); | |
2058 | + if(!this.properties.animation) { | |
2095 | 2059 | YAHOO.util.Dom.removeClass(header,"open"); |
2096 | - }; | |
2097 | - var animation = new YAHOO.util.Anim(header,attributes); | |
2098 | - animation.duration = this.properties.animationDuration; | |
2099 | - animation.useSeconds = false; | |
2100 | - animation.onComplete.subscribe(animationEnd); | |
2101 | - animation.animate(); | |
2060 | + } else { | |
2061 | + this.initAnimation(header,"close"); | |
2062 | + } | |
2063 | + }, | |
2064 | + expand : function(header) { | |
2065 | + YAHOO.util.Dom.addClass(YAHOO.util.Dom.getPreviousSibling(header),"selected"); | |
2066 | + if(!this.properties.animation) { | |
2067 | + YAHOO.util.Dom.addClass(header,"open"); | |
2068 | + } else { | |
2069 | + this.initAnimation(header,"open"); | |
2070 | + } | |
2071 | + }, | |
2072 | + initAnimation : function(header,dir) { | |
2073 | + if(dir == "open") { | |
2074 | + YAHOO.util.Dom.setStyle(header,"visibility","hidden"); | |
2075 | + YAHOO.util.Dom.setStyle(header,"height",this.properties.altura); | |
2076 | + YAHOO.util.Dom.addClass(header,"open"); | |
2077 | + var attributes = { | |
2078 | + height : { | |
2079 | + from : 0, | |
2080 | + to : this.properties.altura | |
2081 | + } | |
2082 | + }; | |
2083 | + YAHOO.util.Dom.setStyle(header,"height",0); | |
2084 | + YAHOO.util.Dom.setStyle(header,"visibility","visible"); | |
2085 | + | |
2086 | + var animation = new YAHOO.util.Anim(header,attributes); | |
2087 | + animationEnd = function() { | |
2088 | + //alert(this.properties.altura+"px") | |
2089 | + header.style.height = this.properties.altura+"px"; | |
2090 | + }; | |
2091 | + animation.duration = this.properties.animationDuration; | |
2092 | + animation.useSeconds = false; | |
2093 | + animation.onComplete.subscribe(animationEnd); | |
2094 | + animation.animate(); | |
2095 | + } else if ("close") { | |
2096 | + var attributes = { | |
2097 | + height : { | |
2098 | + to : 0 | |
2099 | + } | |
2100 | + }; | |
2101 | + animationEnd = function() { | |
2102 | + YAHOO.util.Dom.removeClass(header,"open"); | |
2103 | + }; | |
2104 | + var animation = new YAHOO.util.Anim(header,attributes); | |
2105 | + animation.duration = this.properties.animationDuration; | |
2106 | + animation.useSeconds = false; | |
2107 | + animation.onComplete.subscribe(animationEnd); | |
2108 | + animation.animate(); | |
2109 | + } | |
2102 | 2110 | } |
2103 | - } | |
2104 | -}; | |
2111 | + }; | |
2112 | +} | |
2113 | +catch(e){} | |
2105 | 2114 | // |
2106 | 2115 | //alias |
2107 | 2116 | // | ... | ... |
ferramentas/comentarios/index.php
... | ... | @@ -2,8 +2,10 @@ |
2 | 2 | <head> |
3 | 3 | <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=ISO-8859-1"> |
4 | 4 | <link rel="stylesheet" type="text/css" href="../../admin/html/admin.css"> |
5 | +<script type="text/javascript" src="../../classesjs/classe_util.js"></script> | |
5 | 6 | </head> |
6 | 7 | <body> |
8 | +<p>Bookmark esse tema com: <span id="bm" style="width:100px;cursor:pointer;"></span></p> | |
7 | 9 | <?php |
8 | 10 | /* |
9 | 11 | Parametros: |
... | ... | @@ -67,8 +69,6 @@ function listaComentarios() |
67 | 69 | $id_tema = $id_tema[0]["id_tema"]; |
68 | 70 | $lista = $dbh->query("select * from i3geoadmin_comentarios where id_tema = $id_tema ",PDO::FETCH_ASSOC); |
69 | 71 | $lista = $lista->fetchAll(); |
70 | - echo "<p><a href='../../admin/rsscomentariostemas.php'><img src='../../imagens/rss.gif' style='border:0px solid gray;' > todos os comentários</a>"; | |
71 | - echo " <a href='../../admin/rsscomentariostemas.php?id_tema=".$id_tema."'><img src='../../imagens/rss.gif' style='border:0px solid gray;' > comentários para o tema</a></p>"; | |
72 | 72 | |
73 | 73 | echo "<table>"; |
74 | 74 | foreach ($lista as $reg) |
... | ... | @@ -84,6 +84,9 @@ function listaComentarios() |
84 | 84 | echo "</table><hr>"; |
85 | 85 | $dbhw = null; |
86 | 86 | $dbh = null; |
87 | + echo "<p><a href='../../admin/rsscomentariostemas.php'><img src='../../imagens/rss.gif' style='border:0px solid gray;' > todos os comentários</a>"; | |
88 | + echo " <a href='../../admin/rsscomentariostemas.php?id_tema=".$id_tema."'><img src='../../imagens/rss.gif' style='border:0px solid gray;' > comentários para o tema</a></p>"; | |
89 | + | |
87 | 90 | } |
88 | 91 | function gravaComentario() |
89 | 92 | { |
... | ... | @@ -108,5 +111,7 @@ function converte($texto){ |
108 | 111 | } |
109 | 112 | ?> |
110 | 113 | <script> |
111 | - | |
114 | +i3GEO.configura = {"locaplic": "<?php echo $_SESSION["locaplic"];?>"}; | |
115 | +if(document.getElementById("bm")) | |
116 | +{document.getElementById("bm").innerHTML = i3GEO.util.bookmark("<?php echo $_SESSION["locaplic"]."/ms_criamapa.php?layers=".$_SESSION["tema"];?>");} | |
112 | 117 | </script> |
113 | 118 | \ No newline at end of file | ... | ... |
113 Bytes
248 Bytes
173 Bytes
1023 Bytes