I took a look at the javascripts and changed them a bit. If you use IE4+ the graemlins gets insert at the current caret. I just tweaked the existing script from threads to work with the popup.
I also enhanced the popup script to that you can define where it should be displayed on the screen (depending on the screen resolution.
Instructions:
ubbt_instant_ubbcode.tmpl
replace the function that shipped with this hack with:
[:"blue"]
myHeight --> window height
myWidth --> window width
adjust the values "+100" and "+50" to move the relative position of the windos (x and y axis).
[/]
function openGraemlinPanel() { <br /> var myHeight = 400; <br /> var myWidth = 300; <br /> var myLeft = ((screen.width-myWidth)/2)+100; <br /> var myTop = ((screen.height-myHeight)/2) +50; <br /> graemlinWindow = window.open('{$config['phpurl']}/graemlinpanel.php','graemlinpanel','width='+myWidth+',height='+myHeight+',scrollbars=yes,resizable=yes,left='+myLeft+',top='+myTop); <br /> if (graemlinWindow.opener == null) graemlinWindow.opener = self; <br /> graemlinWindow.focus(); <br />} <br /> <br />function DoPopupSmilie(addSmilie) { <br /> <br /> insertAtCaret(document.replier.Body, ' '+ addSmilie + ' ' ); <br /> document.replier.Body.focus(); <br /> return; <br /> <br />}
graemlinpanel.php
replace the existing updatePost Javascript function with:
function updatePost(GraemlinCode) { <br /> <br />window.opener.DoPopupSmilie(GraemlinCode); <br />}
I can't test this on a mac, so any feedback is appreciated.
