NineChime forum

Furry stuff, oekaki stuff, and other stuff.

You are not logged in.

#1 04-06-2008 18:48:00

~*Eevee1*~
Member

Applet Resize?

Ah first of all thank you so much for answering my previous post Waccoon! You truly are a life saver for me. ;D

I jsut upgraded to Wacintaki for my advanced board and a few of the members are upset that they can't resize the applet for really long pictures. The fit applet to window button works but it stops at a certain height, is there any way I can fix that?


Owner of the Suta-Raito Oekakis:
Sutaro Sketcher
SR Oekaki
SRO is the merged form of SRON and SROA, with new templates and funnn contests <3

Offline

#2 04-06-2008 23:19:17

Waccoon
Administrator

Re: Applet Resize?

More JavaScript code for ya:

Code:

    <script type="text/javascript">
        function size_app(apptype) {
            var appchange = document.getElementById(apptype);
            var button_x = document.getElementById("button_x");
            var button_y = document.getElementById("button_y");

            if (!appchange) {
                alert("Can't maximize '" + apptype + "'!\n\nEither your browser is either too old, there is an error in the HTML, or Java can't load " + apptype + ".");
                return (false);
            }
            if (button_x && button_x.value > 0 && button_y && button_y.value > 0) {
                new_x = button_x.value;
                new_y = button_y.value;
            } else {
                return (false);
            }

            if(new_x > 500 && new_x < 10000) {
                appchange.style.width = new_x + "px";
                appchange.width = new_x;
            } else {
                appchange.style.width = "500px";
                appchange.width = "500";
            }

            if(new_y > 530 & new_y < 10000) {
                appchange.style.height = new_y + "px";
                appchange.height = new_y;
            } else {
                appchange.style.height = "530px";
                appchange.height = "530";
            }
        }
    </script>

Then, add this to each applet page, where ever you want it to show up.  Make sure it has the same applet name specified as the "Resize applet to fit window" button.  In this case, it is "paintbbs" -- for ShiPainter, use "shibbs":

Code:

<p style="text-align: center;">
    <input onclick="size_app('paintbbs');" type="button" value="Resize to this:" class="submit" />
    X:<input id="button_x" type="text" size="3" value="<?=$xhack?>" class="txtinput" />
    Y:<input id="button_y" type="text" size="3" value="<?=$yhack?>" class="txtinput" />
</p>

I removed the hard-coded applet resize because it caused some older browsers (most notably, Safari) to completely crash.  I don't think any modern browsers have crashing problems these days, so I'll probably add that code back into Wacintaki.

Last edited by Waccoon (04-08-2008 06:27:18)

Offline

#3 04-06-2008 23:46:42

~*Eevee1*~
Member

Re: Applet Resize?

Works like a charm, thank you again! Everyone at SROA appreciates it a lot! =>


Owner of the Suta-Raito Oekakis:
Sutaro Sketcher
SR Oekaki
SRO is the merged form of SRON and SROA, with new templates and funnn contests <3

Offline

Board footer

Yep, still running PunBB
© Copyright 2002–2008 PunBB