Smilies in the pop-up window
Adds a pop-up window with your emoticons to the response form.
Платформа: MyBB
<style> #button-smiles {background-image:url('http://extra smiley button'); padding:0; line-height:0; background-position:center; background-repeat:no-repeat; height:26px; width:100%} </style> <script language="JavaScript"> function popwnd() { var smiles = new Array smiles.push("link to picture of the smile") smiles.push("link to picture of the smile") smiles.push("link to picture of the smile") smiles.push("link to picture of the smile") smiles.push("link to picture of the smile") smiles.push("link to picture of the smile") smiles.push("link to picture of the smile") smiles.push("link to picture of the smile") smiles.push("link to picture of the smile") var msg = new String("") msg = "<html><head><TITLE><additional emoticons></TITLE></head>\r\n" msg += "<body bgcolor=#F5F5F5 >" msg = msg + "<" + "script language=\"JavaScript\">\r\n" msg += "function insert(a){\r\n" msg += "txt = \"[img]\"+a.src+\"[/img] \";\r\n" msg += "window.opener.smile(txt,'');\r\n" msg += "window.focus()\r\n" msg += "return false}\r\n" msg = msg + "</" + "script>\r\n" i=0 msg += "<div style=\"width: 100%; text-align : justify;\" >" while(smiles[i]) { msg = msg + "<img src=\"" + smiles[i] + "\" onclick=\"return insert(this)\">\r\n" i++ } msg += "</div><a href=\"\" onclick=\"window.close()\">Close a window</a>" msg += "</BODY></html>"; popup = window.open("","popDialog","height=700,width=500,directories=0 scrollbars=auto, status=0,location=0,copyhistory=0") popup.document.write(msg) popup.document.close() return false } </script> <script type="text/javascript"> if(form=document.getElementById("form-buttons")) form.getElementsByTagName("tr")[0].insertCell(17).innerHTML="<a href='' onclick=\"return popwnd()\"> <img title='Additional emoticons' src='/i/blank.gif' id='button-smiles' /></a>" </script> <script> function showhide(b){ p = b.parentNode.getElementsByTagName("p")[0] if(b.value=="Additional emoticons"){ b.value="Hide smileys" p.style.display="block"} else{ b.value="Additional emoticons" p.style.display="none"} return false} </script>
Instead of the text, we insert a link to the smile and copy as many smileys you needed:
smiles.push("link to picture of the smile")
The style of the additional smileys button in the submit form:
#button-smiles {background-image:url('extra smiley button'); padding:0; line-height:0; background-position:center; background-repeat:no-repeat; height:26px; width:100%}