Janne Jalkanen: Oh yeah, does anyone have any idea how to dynamically change the size of the editor window, according to the browser window size? Currently the window has been designed to be readable on a 800x600 laptop display, but on larger screens it's a bit inconvinient.

ebu: immediate reaction: a JavaScript method to figure the browser size out and include the values in a POST. We'd want to do that once, maybe on the main page, and carry the info in the session from there on. Here's a sample of the JS you'd need, found from the net:

<html>
   <body>
      <scri
          document.write("SCREEN RESOLUTION: ")
          document.write(screen.width + "*")
          document.write(screen.height + "<br>")
          document.write("AVAILABLE VIEW AREA: ")
          document.write(window.screen.availWidth + "*")
          document.write(window.screen.availHeight + "<br>")
          document.write("COLOR DEPTH: ")
          document.write(window.screen.colorDepth + "<br>")
      </script>
   </body>
</html>

Not good - we need the size of the table element in which the editor resides. --Janne Jalkanen.

MahlenMorris: Why make it autoconfigure? After all, I change the size of my browser during a session. I'd just like two buttons (Bigger) (Smaller), that change the width via a call to the server (and save the new value into a cookie). Making it depend on scripting makes it not work on my Palm, for example. I'm simple, so I like to keep it simple.

MatthewSimoneau: On our (perl-based) Wiki, we just set the width of the textarea to be 100% of the browser width with a stylesheet. Something like this:

 <textarea name=Text rows=30 cols=60 wrap=virtual style="width:100%;">
I don't know how well this will play with your left-hand nav-bar, but on ours it works beautifully on all browsers that have decent CSS support.

JanneJalkanen: YES! Thank you very much. Seems to work perfectly in Mozilla, and Konqueror at least.


To continue the discussion: Having the ability to change the editor window would probably be a good idea (for laptop people, and for people with Palms and other things). There are two ways to do this:

  • CSS (make the user specify a stylesheet. This is actually possible now: try setting EDIT.TEXTAREA)
  • Cookies stored on the client machine.

Currently, JSPWiki only uses cookies for session management, but nothing else, and I'm a bit hesitant to introduce more cookies. We'd need cookies for all sorts of different preferences, either in one super-megacookie, a bunch of individual cookies; or alternatively, we could keep all config info inside a central user database (text or otherwise).

--JanneJalkanen

Andrew Gilmartin: We have found just being able to turn on and off word-wrapping to be very useful. For internal tools where IE support is only needed the following is used

<form>
    <textarea name="content">
    ....
    </textarea>
    <input
        value="Change Wrap"
        type="button"
        onclick="form.content.wrap=form.content.wrap =='off' ? 'soft' : 'off';"
    >
</form>


height=50% works only when setting height=xx% for the form

--AnonymousCoward, 17-Oct-2008 03:13

Add new attachment

Only authorized users are allowed to upload new attachments.
« This page (revision-23) was last changed on 22-Mar-2010 21:57 by Allhours