Page 1 of 1

Can the address bar in SeedcodeIWP on iPhone hide?

PostPosted: Sat Apr 05, 2008 11:44 am
by macfreq
Is it possible to hide the address bar on the iPhone and more screen space? I've seen this on other iPhone aware websites. Is that possible with IWP?

Thanks.

PostPosted: Mon Apr 07, 2008 8:51 am
by John Sindelar
Hi there. Hiding the address bar would require editing the javascript in the IWP homepage. I've done this before for a couple other things, but never to remove the address bar. Needless to say, FileMaker doesn't support modifying this kind of stuff, but let me look into what it would take to do this.

PostPosted: Mon Apr 07, 2008 9:18 am
by macfreq
This article references

http://www.alistapart.com/articles/puty ... ocketpart2

references a script in JavaScript, I think, that will hide the address bar. I want to do this because, after you login, you really can't use Safari's reload button or need access to the address bar. And it give more real estate.

The script is window.scrollTo(0,1)

Hope that helps.

Tom

PostPosted: Mon Apr 07, 2008 11:47 am
by John Sindelar
Try adding the script below to the head section of iwp_home.html. I believe you also need to add this to some of the iwp engine pages directly. These are in different places depending your server and OS so you'll have to find them on your own.

When publishing on a mac using FileMaker client they are in the Package Contents of the FM Web Publishig applications in Contents / Resources / iwpres. I'd add it to:

control_frame.html
iwp_auth.html
and
iwp_home.html

Obviously modify these files at your own risk.

Code: Select all
<script type="application/x-javascript">

function addLoadEvent(func) {
  var oldonload = window.onload;
  if (typeof window.onload != 'function') {
    window.onload = func;
  } else {
    window.onload = function() {
      if (oldonload) {
        oldonload();
      }
      func();
    }
  }
}

addLoadEvent(updateLayout);   

    var currentWidth = 0;
   
    function updateLayout()
    {
        if (window.innerWidth != currentWidth)
        {
            currentWidth = window.innerWidth;

            var orient = currentWidth == 320 ? "profile" : "landscape";
            document.body.setAttribute("orient", orient);
            setTimeout(function()
            {
                window.scrollTo(0, 1);
            }, 100);           
        }
    }

    setInterval(updateLayout, 400);
   
</script>

PostPosted: Tue Apr 08, 2008 10:06 am
by macfreq
I edited the files you suggested but I didn't see any change. Is there a specific place in the file I need to insert the script code you provided? I put the new code at the end of the existing script sections.

PostPosted: Tue Apr 08, 2008 11:33 am
by John Sindelar
You want to put them in the <head>, ideally ahead of any <script> sections already there. Unfortunately I'm not in a position to play with this currently, but hopefully you can fool around with this and see what works.