From paul.boddie@biotek.uio.no Mon Jan 21 07:24:46 2013 From: Paul Boddie To: galaxy-dev@lists.galaxyproject.org Subject: [galaxy-dev] Redirecting to a URL and breaking the frameset Date: Mon, 21 Jan 2013 13:24:39 +0100 Message-ID: <50FD3387.1090302@biotek.uio.no> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0008953454632606570==" --===============0008953454632606570== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Hello, Is there a convenient recipe for redirecting to a URL and breaking the frameset? I have been trying to use trans.response.send_redirect with a variety of URLs, either something as simple as url_for("/") or as complicated as a url_for invocation with lots of arguments, but the resulting content produced for the centre frame is always confined to the centre frame and always includes the top navigation bar. I suppose an alternative query would concern whether it is possible to disable the navigation bar when redirecting within the centre frame, but I actually want to update the user information in the navigation bar. Paul --===============0008953454632606570==-- From jeremy.goecks@emory.edu Mon Jan 21 09:17:03 2013 From: Jeremy Goecks To: galaxy-dev@lists.galaxyproject.org Subject: Re: [galaxy-dev] Redirecting to a URL and breaking the frameset Date: Mon, 21 Jan 2013 09:16:48 -0500 Message-ID: In-Reply-To: <50FD3387.1090302@biotek.uio.no> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============2295958580844933073==" --===============2295958580844933073== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Adding the attribute target=3D"_top" to your URL will load the URL in the main browser window rather than a frame.= E.g. Load result in top window Best, J. On Jan 21, 2013, at 7:24 AM, Paul Boddie wrote: > Hello, >=20 > Is there a convenient recipe for redirecting to a URL and breaking the fram= eset? I have been trying to use trans.response.send_redirect with a variety o= f URLs, either something as simple as url_for("/") or as complicated as a url= _for invocation with lots of arguments, but the resulting content produced fo= r the centre frame is always confined to the centre frame and always includes= the top navigation bar. >=20 > I suppose an alternative query would concern whether it is possible to disa= ble the navigation bar when redirecting within the centre frame, but I actual= ly want to update the user information in the navigation bar. >=20 > Paul > ___________________________________________________________ > Please keep all replies on the list by using "reply all" > in your mail client. To manage your subscriptions to this > and other Galaxy lists, please use the interface at: >=20 > http://lists.bx.psu.edu/ --===============2295958580844933073==-- From paul.boddie@biotek.uio.no Mon Jan 21 09:26:49 2013 From: Paul Boddie To: galaxy-dev@lists.galaxyproject.org Subject: Re: [galaxy-dev] Redirecting to a URL and breaking the frameset Date: Mon, 21 Jan 2013 15:26:45 +0100 Message-ID: <50FD5025.7010407@biotek.uio.no> In-Reply-To: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============8181362624270072858==" --===============8181362624270072858== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable On 21/01/13 15:16, Jeremy Goecks wrote: > Adding the attribute > > target=3D"_top" > > to your URL will load the URL in the main browser window rather than a fram= e. E.g. > > Load result in top window But in the Python code itself? I'm writing an action in the user=20 controller that should redirect to the main page after interacting with=20 the user in the centre frame, and although I can see some JavaScript=20 magic in various template files, along with a refresh_frames parameter,=20 I can't get either trans.response.send_redirect or trans.fill_template=20 to produce something that breaks out of the frameset and refreshes the=20 entire browser window. Paul --===============8181362624270072858==-- From paul.boddie@biotek.uio.no Mon Jan 21 11:08:35 2013 From: Paul Boddie To: galaxy-dev@lists.galaxyproject.org Subject: Re: [galaxy-dev] Redirecting to a URL and breaking the frameset Date: Mon, 21 Jan 2013 17:08:28 +0100 Message-ID: <50FD67FC.3090705@biotek.uio.no> In-Reply-To: <50FD5025.7010407@biotek.uio.no> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0054931054730519401==" --===============0054931054730519401== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit On 21/01/13 15:26, Paul Boddie wrote: > On 21/01/13 15:16, Jeremy Goecks wrote: >> Adding the attribute >> >> target="_top" >> >> to your URL will load the URL in the main browser window rather than >> a frame. E.g. >> >> Load result in top window > > But in the Python code itself? I'm writing an action in the user > controller that should redirect to the main page after interacting > with the user in the centre frame, and although I can see some > JavaScript magic in various template files, along with a > refresh_frames parameter, I can't get either > trans.response.send_redirect or trans.fill_template to produce > something that breaks out of the frameset and refreshes the entire > browser window. Following up to myself with one solution that seemed to work: I defined a template that inherits from "base.mako" and which writes a message for browsers without JavaScript enabled, telling the user to follow a link to the main page in the way suggested above. But in the page's JavaScript I put the following: window.top.location.href = '${h.url_for( "/" )}'; Naturally, the value is translated to the root URL of the application. It feels like a nasty hack, but I suppose that any application using frames is more or less obliged to deploy JavaScript "redirects" of this nature for such operations. Paul --===============0054931054730519401==-- From jeremy.goecks@emory.edu Mon Jan 21 22:04:38 2013 From: Jeremy Goecks To: galaxy-dev@lists.galaxyproject.org Subject: Re: [galaxy-dev] Redirecting to a URL and breaking the frameset Date: Mon, 21 Jan 2013 22:04:22 -0500 Message-ID: <36B581CD-A280-4F5E-A854-596F23FD0FA8@emory.edu> In-Reply-To: <50FD67FC.3090705@biotek.uio.no> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============5889705190313811723==" --===============5889705190313811723== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable > On 21/01/13 15:26, Paul Boddie wrote: >> On 21/01/13 15:16, Jeremy Goecks wrote: >>> Adding the attribute >>>=20 >>> target=3D"_top" >>>=20 >>> to your URL will load the URL in the main browser window rather than a fr= ame. E.g. >>>=20 >>> Load result in top window >>=20 >> But in the Python code itself? I'm writing an action in the user controlle= r that should redirect to the main page after interacting with the user in th= e centre frame, and although I can see some JavaScript magic in various templ= ate files, along with a refresh_frames parameter, I can't get either trans.re= sponse.send_redirect or trans.fill_template to produce something that breaks = out of the frameset and refreshes the entire browser window. >=20 > Following up to myself with one solution that seemed to work: I defined a t= emplate that inherits from "base.mako" and which writes a message for browser= s without JavaScript enabled, telling the user to follow a link to the main p= age in the way suggested above. But in the page's JavaScript I put the follow= ing: >=20 > window.top.location.href =3D '${h.url_for( "/" )}'; Sure, this will accomplish what you want from the server side. You could gene= ralize this approach with an option that resembles refresh_frames if you want= ed. > It feels like a nasty hack, but I suppose that any application using frames= is more or less obliged to deploy JavaScript "redirects" of this nature for = such operations. We're slowly transitioning Galaxy to be a single-page, HTML5/JavaScript drive= n Web application so that we can provide more flexibility and power in the UI= like what you're after here. Best, J. --===============5889705190313811723==--