Menu

PopUp window when edit or add a new person?!?

Tobbe
2008-11-27
2013-05-30
  • Tobbe

    Tobbe - 2008-11-27

    Hi, it's me again :)

    Every time when I wanna add or edit a persons data the popup window has a default size to it. Can I change that popup somewhere so I don't have to resize it manually every time and be able too see all information and fields?

    //Tobbe

     
    • Wes Groleau

      Wes Groleau - 2008-11-27

      There is a feature request for this.

       
      • Greg Roach

        Greg Roach - 2008-11-27

        It's not quite so simple.  My desktop machine has a 1920x1200 display, but my laptop is 1024x600.

        Anything big enough to look good on my desktop won't work on my laptop.

        The different windows have different sizes.  Heights/widths vary from 400-600 pixels.

        So, we need different sizes for each type of popup window, and they need to be different for each client.

        A possible solution might involve the popup window detecting when it is resized, storing the new size in the session, so that the parent application can use this new size when opening subsequent windows.  This would mean you only need to resize each type of window once.

        A bigger annoyance of mine is that when you resize the raw-gedcom edit window, it doesn't resize the textarea.  I did have a quick look at this, but I couldn't find a way of setting the size of the edit control in pixels (it wants rows/columns).  Any javascript gurus out there with any ideas?

         
    • Anonymous

      Anonymous - 2008-11-27

      Greg's right in that its not easy, and Wes is right that there is a Feature Request to improve this. However, in the short term, if you don't mind hacking the core code, it can be fixed. Do keep a copy of the original though, and notes of the changes you make, because they will be over-written when you next upgrade.

      The settings are all in the file phpgedview/phpgedview.js

      Each pop-up window has its own dimensions, so you need to identify the one you want to change, then just alter its height and width. For example, row 303 controls the pop-up for Raw GEDCOM edit:
      window.open('edit_interface.php?action=editraw&pid='+pid+"&"+sessionname+"="+sessionid, '_blank', 'top=50,left=50,width=400,height=400,resizable=1,scrollbars=1');

      Change the height and width to alter size, change top and left to alter position.

      Greg, I can partially answer your question. I don't know how to dynamically change the size of the text area, but you can permanently change it by adjusting row 350 of phpgedview/edit_interface.php. Adjust the settings for 'rows' and 'cols'.  I've done this, and it makes editing much easier.

      Of course, all these changes are permanent, so remember they may cause problems for your other users if they use small screens, low resolution, laptops, etc.

       
    • Wes Groleau

      Wes Groleau - 2008-11-27

      I am not a Javascript expert, but I have written some.

      Here's the approach I would pursue until running against evidence that it can't be done:

      1. If the item has a text box, compute the ideal size to just fit the initial contents.  This should be easy, because textareas are rows and columns, while the contents are lines and rows.

      2. Estimate (if you can't calculate) the size of everything else.

      3. Determine the popup size.

      4. Query the browser for the size of the screen.

      5. If the popup is bigger, work backwards adjusting accordingly.

       
      • Greg Roach

        Greg Roach - 2008-11-27

        The problem I had was that text areas are specified in lines and rows, while the window is specified in pixels.

        If the windows is resized to, say, 850x700 pixels, how do you convert this to rows/columns to resize the textarea?

        It depends on the screen font size and DPI settings, and I couldn't find a way of doing this.

        Javascript isn't my strong point, so I'm open to suggestions.

         
    • Thomas52

      Thomas52 - 2009-08-02

      I had saved all my "mods" before upgrading to 4.2.2 (I thought,) but I lost one.
      I prefer my popup edit windows on the RIGHT side of the screen, so I thought I changed edit_interface.php lines from "top=50,left=50" to "top=50,left=350" but it's not working.
      Suggestions?

       
    • Anonymous

      Anonymous - 2009-08-03

      Answered in HELP forum.

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.