[Xerte-dev] Re: wizard files and modules

Tom Reijnders reijnders at tor.nl
Sat May 11 12:01:58 BST 2013


I looked into this further as well, and I've got it working (sort of). 
The original problem is beyond our control. Something gets changed by 
showing and closing the preview. I concentrated on the call to popup 
preview:

Where url is 'preview.php&template_id=4'

getURL("javascript:NewWindow = window.open('" + url + 
"','previewwindow','height=" + this.template_height+ ",width=" + 
this.template_width+ ",linkID=" + tree.selectedNode.attributes.linkID+ 
"'); NewWindow.focus(); setunload(); void(0);");

What I did:
  1. I changed the code to do exactly the same but in a different way:

- From flash call: ExternalInterface.call("openPreview", url, 
this.template_height, this.template_width);
- Supply javascript function in edit.php that does:

     function openPreview(url, height, width)
     {
         NewWindow = window.open(url, 'previewwindow', 'height=' + 
height, ',width=' + width);
         NewWindow.focus();
     }

This behaves exactly the same, as in,  it doesn't work. After closing 
preview, the file browser doesn't pop up any more.

  2. So, different approach, without using javascript:

- From flash call: getURL(url, "_blank")

This has as a drawback (or advantage) that the preview is shown in a new 
window/tab in stead of a popup, and so it ignores/doesn't use the sizes 
of the window.

BUT it does work!

Is that a viable solution? For firefox only?

Tom

Op 10-5-2013 16:01, Julian Tenney schreef:
>
> Tested the file button, and debugged the FileRef.browse and got 
> Function, so it does exist, before FileRef.browse is called.
>
> Took out all but the void(0) and still failing. Have stripped down the 
> function to this.
>
> I don't think it is our code. Going for beer.
>
> *From:*xerte-dev-bounces at lists.nottingham.ac.uk 
> [mailto:xerte-dev-bounces at lists.nottingham.ac.uk] *On Behalf Of 
> *xerte at pgogywebstuff.com
> *Sent:* 10 May 2013 14:58
> *To:* For Xerte technical developers
> *Subject:* [Xerte-dev] Re: wizard files and modules
>
> I'd be cautious of saying it is preview - perhaps it is the file button?
>
> try not setting focus? that seems a possible route?
>
> Pgogy Webstuff http://www.pgogywebstuff.com
>
> Makers of Web things of a fair to middling quality
>
>
>     ----- Original Message -----
>
>     *From:*
>
>     "For Xerte technical developers" <xerte-dev at lists.nottingham.ac.uk
>     <mailto:xerte-dev at lists.nottingham.ac.uk>>
>
>     *To:*
>
>     "For Xerte technical developers (xerte-dev at lists.nottingham.ac.uk
>     <mailto:xerte-dev at lists.nottingham.ac.uk>)"
>     <xerte-dev at lists.nottingham.ac.uk
>     <mailto:xerte-dev at lists.nottingham.ac.uk>>
>
>     *Cc:*
>
>     *Sent:*
>
>     Fri, 10 May 2013 14:54:16 +0100
>
>     *Subject:*
>
>     [Xerte-dev] Re: wizard files and modules
>
>     It boils down to this:
>
>     function preview(){
>
>     if(_root.apache!="false"){
>
>                          url = "preview_" + _root.template_id;
>
>                     }else{
>
>                          url = "preview.php?template_id=" +
>     _root.template_id;
>
>                     }
>
>                     saveFile();
>
>     ExternalInterface.call("hideunload");
>
>     getURL("javascript:NewWindow = window.open('" + url +
>     "','previewwindow','height=" + this.template_height+ ",width=" +
>     this.template_width+ ",linkID=" +
>     tree.selectedNode.attributes.linkID+ "'); NewWindow.focus();
>     setunload(); void(0);");
>
>     }
>
>     *From:*Tenney Julian
>     *Sent:* 10 May 2013 14:51
>     *To:* 'For Xerte technical developers'
>     *Subject:* RE: [Xerte-dev] Re: wizard files and modules
>
>     Here be function preview() (I'm guessing you can't see it? Can you
>     see anything obvious / or anything I can try commenting out /
>     testing to test your theory?)
>
>     Probably next week though, I have to go soon,
>
>     function preview(){
>
>          if (xerte){
>
>                if (wizard.nfoObject.wizard.runtime != undefined){
>     //post the xml data into the url specified
>
>                     saveFile();
>
>                } else {//play it in Xerte
>
>                     //if shift is down, jump straight to this page
>
>                     if (Key.isDown(Key.SHIFT)){
>
>                          if (tree.selectedNode.attributes.linkID ==
>     undefined){
>
>     tree.selectedNode.attributes.linkID = 'PG' + new Date().getTime();
>
>                          }
>
>                          //set the linkID in _level0 of the runtime
>     (it is deleted after onInit is fired)
>
>     mdm.Forms.preview.callFunction("setLinkID",
>     tree.selectedNode.attributes.linkID, "|");
>
>                     }
>
>                     saveFile();
>
>                     this.mode = 'preview';
>
>                     //show the preview form
>
>     mdm.form_show("preview");
>
>     mdm.form_restore("preview");
>
>                     //fire up the piece
>
>     mdm.form_callfunction("preview", "setMode", mode, "|");
>
>     mdm.form_callfunction("preview", "jumpFile", wizard.rloFile, "|");
>
>                }
>
>          } else { //this is toolkits - play or post?
>
>                if (wizard.nfoObject.wizard.runtime != undefined){
>
>                     //hardcoded in here for now - this is a bit messy,
>     needa better way of handling multiple runtimes with all the
>     security etc
>
>                     if (wizard.nfoObject.wizard.runtime ==
>     'preview_site.php'){
>
>     if(_root.apache!="false"){
>
>                                url = "preview_" + _root.template_id;
>
>                          }else{
>
>                                url = "preview.php?template_id=" +
>     _root.template_id;
>
>                          }
>
>     saveFile();
>
>     ExternalInterface.call("hideunload");
>
>     getURL("javascript:NewWindow = window.open('" + url +
>     "','previewwindow','scrollbars=yes'); NewWindow.focus();
>     setunload(); void(0);");
>
>                     } else {
>
>     saveFile();
>
>     wizard.createEmptyMovieClip('getURLHelper', 9999);
>
>     wizard.getURLHelper.data = KOData.format();
>
>     wizard.getURLHelper.getURL(wizard.nfoObject.wizard.runtime,
>     "_blank", "POST");
>
>                     }
>
>                } else {
>
>                     if (Key.isDown(Key.CONTROL)){ //play the html5 version
>
>     if(_root.apache!="false"){
>
>                                url = "preview_" + _root.template_id +
>     "&engine=other";
>
>                          }else{
>
>                                url = "preview.php?template_id=" +
>     _root.template_id + "&engine=other";
>
>                          }
>
>                     } else {
>
>     if(_root.apache!="false"){
>
>                                url = "preview_" + _root.template_id;
>
>                          }else{
>
>                                url = "preview.php?template_id=" +
>     _root.template_id;
>
>                          }
>
>                     }
>
>                     //if shift is down, jump straight to this page
>
>                     if (Key.isDown(Key.SHIFT)){
>
>                          if (tree.selectedNode.attributes.linkID ==
>     undefined){
>
>     tree.selectedNode.attributes.linkID = 'PG' + new Date().getTime();
>
>                          }
>
>     if(_root.apache!="false"){
>
>                                url += '_' +
>     tree.selectedNode.attributes.linkID;
>
>                          }else{
>
>                                url += '&linkID=' +
>     tree.selectedNode.attributes.linkID;
>
>                          }
>
>                     }
>
>                     saveFile();
>
>     ExternalInterface.call("hideunload");
>
>     getURL("javascript:NewWindow = window.open('" + url +
>     "','previewwindow','height=" + this.template_height+ ",width=" +
>     this.template_width+ ",linkID=" +
>     tree.selectedNode.attributes.linkID+ "'); NewWindow.focus();
>     setunload(); void(0);");
>
>                }
>
>          }
>
>     }
>
>     *From:*xerte-dev-bounces at lists.nottingham.ac.uk
>     <mailto:xerte-dev-bounces at lists.nottingham.ac.uk>
>     [mailto:xerte-dev-bounces at lists.nottingham.ac.uk] *On Behalf Of
>     *xerte at pgogywebstuff.com <mailto:xerte at pgogywebstuff.com>
>     *Sent:* 10 May 2013 14:38
>     *To:* For Xerte technical developers
>     *Subject:* [Xerte-dev] Re: wizard files and modules
>
>     Windows 7
>     Firefox 20.1.0
>     Preview button doesn't work for anything once you've previewed
>     Flash Player 11.7
>
>     Fine in Chrome
>     No Joy in FF
>
>     have commented out all of the JS
>
>     So I'm guessing it is in the engine somewhere for FF - possible
>     close event firing too soon?
>
>     I'd put some fscommand("console.log") into the wizard.
>
>     Pgogy Webstuff http://www.pgogywebstuff.com
>
>     Makers of Web things of a fair to middling quality
>
>
>         ----- Original Message -----
>
>         *From:*
>
>         "For Xerte technical developers"
>         <xerte-dev at lists.nottingham.ac.uk
>         <mailto:xerte-dev at lists.nottingham.ac.uk>>
>
>         *To:*
>
>         "For Xerte technical developers"
>         <xerte-dev at listsnottingham.ac.uk
>         <mailto:xerte-dev at listsnottingham.ac.uk>>
>
>         *Cc:*
>
>         *Sent:*
>
>         Fri, 10 May 2013 14:00:36 +0100
>
>         *Subject:*
>
>         [Xerte-dev] Re: wizard files and modules
>
>         More specifically 64bit Windows 7
>
>         *From:*xerte-dev-bounces at lists.nottingham.ac.uk
>         <mailto:xerte-dev-bounces at lists.nottingham.ac.uk>
>         [mailto:xerte-dev-bounces at lists.nottingham.ac.uk] *On Behalf
>         Of *Julian Tenney
>         *Sent:* 10 May 2013 13:58
>         *To:* For Xerte technical developers
>         *Subject:* [Xerte-dev] Re: wizard files and modules
>
>         Difference is Windows 7 -- everything else the same and I see
>         the problem in both.
>
>         *From:*xerte-dev-bounces at lists.nottingham.ac.uk
>         <mailto:xerte-dev-bounces at lists.nottingham.ac.uk>
>         [mailto:xerte-dev-bounces at lists.nottingham.ac.uk] *On Behalf
>         Of *Fay Cross
>         *Sent:* 10 May 2013 13:57
>         *To:* For Xerte technical developers
>         *Subject:* [Xerte-dev] Re: wizard files and modules
>
>         Windows XP
>
>         Firefox 20.0.1
>
>         Flash 11.7.700.169
>
>         Can't recreate problem in XOT or Bootstrap, XAMPP or
>         Nottingham install
>
>         *From:*xerte-dev-bounces at lists.nottingham.ac.uk
>         <mailto:xerte-dev-bounces at lists.nottingham.ac.uk>
>         [mailto:xerte-dev-bounces at lists.nottinghamac.uk
>         <mailto:xerte-dev-bounces at lists.nottingham.ac.uk>] *On Behalf
>         Of *Julian Tenney
>         *Sent:* 10 May 2013 13:52
>         *To:* For Xerte technical developers
>         *Subject:* [Xerte-dev] Re: wizard files and modules
>
>         It's like doing the Guardian crossword...
>
>         It would be good if everyone can test with the latest firefox
>         and report back
>
>         Create a project in Xerte Online Toolkit and Bootstrap
>
>         Add a media thing, upload some, press play button in bottom
>         right, close play window, upload media again
>
>         Fails in Bootstrap?
>         Fails in Xerte Online Toolkit?
>
>         Flash player version?
>
>         If you don't close the preview window it continues to work OK.
>
>         *From:*xerte-dev-bounces at lists.nottingham.acuk
>         <mailto:xerte-dev-bounces at lists.nottingham.ac.uk>
>         [mailto:xerte-dev-bounces at lists.nottingham.ac.uk] *On Behalf
>         Of *Tom Reijnders
>         *Sent:* 10 May 2013 13:40
>         *To:* For Xerte technical developers
>         *Subject:* [Xerte-dev] Re: wizard files and modules
>
>         What you have to realise, is that the files LOOK the same, and
>         have the same name, but they ARE different.
>
>         Op 10-5-2013 14:33, Julian Tenney schreef:
>
>             Probably before I realised that we had the same files in
>             lots of different places
>
>             *From:*xerte-dev-bounces at lists.nottingham.ac.uk
>             <mailto:xerte-dev-bounces at lists.nottingham.ac.uk>
>             [mailto:xerte-dev-bounces at lists.nottingham.ac.uk] *On
>             Behalf Of *xerte at pgogywebstuff.com
>             <mailto:xerte at pgogywebstuff.com>
>             *Sent:* 10 May 2013 13:28
>             *To:* For Xerte technical developers
>             *Subject:* [Xerte-dev] Re: wizard files and modules
>
>             http://code.google.com/p/xerteonlinetoolkits/source/diff?spec=svn885&r=840&format=side&path=/trunk/modules/xerte/edit.php
>
>             You might not built the structures, but you set the path
>
>
>
>             Pgogy Webstuff http://www.pgogywebstuff.com
>
>             Makers of Web things of a fair to middling quality
>
>
>                 ----- Original Message -----
>
>                 *From:*
>
>                 "For Xerte technical developers"
>                 <xerte-dev at lists.nottingham.ac.uk
>                 <mailto:xerte-dev at lists.nottingham.ac.uk>>
>
>                 *To:*
>
>                 "For Xerte technical developers"
>                 <xerte-dev at lists.nottingham.ac.uk
>                 <mailto:xerte-dev at lists.nottingham.ac.uk>>
>
>                 *Cc:*
>
>                 *Sent:*
>
>                 Fri, 10 May 2013 13:11:19 +0100
>
>                 *Subject:*
>
>                 [Xerte-dev] Re: wizard files and modules
>
>                 Nope, the wizard.swf file. I did not build the
>                 structures that contain modules/Xerte and
>                 modules/site, and I did not duplicate all the files
>                 that are in there.
>
>                 *From:*xerte-dev-bounces at lists.nottingham.ac.uk
>                 <mailto:xerte-dev-bounces at lists.nottingham.acuk>
>                 [mailto:xerte-dev-bounces at lists.nottingham.ac.uk] *On
>                 Behalf Of *Tom Reijnders
>                 *Sent:* 10 May 2013 13:09
>                 *To:* For Xerte technical developers
>                 *Subject:* [Xerte-dev] Re: wizard files and modules
>
>                 Hmmm... you did that yourself when you fixed the
>                 onbeforeunload=function{}(); on April 25....
>                 As far as I can tell you copied the editphp from site
>                 over to xerte.
>
>                 Op 10-5-2013 14:03, Julian Tenney schreef:
>
>                     OK, now I am really confused.
>
>                     When I use a xerte online template, the wizard
>                     comes from modules/site/engine, not the wizard in
>                     modules/Xerte/engine.
>
>                     Any more cryptic pathing issues set up just for fun?
>
>                     Sheesh.
>
>                     _______________________________________________
>
>                     Xerte-dev mailing list
>
>                     Xerte-dev at lists.nottingham.ac.uk  <mailto:Xerte-dev at lists.nottingham.ac.uk>
>
>                     http://lists.nottingham.acuk/mailman/listinfo/xerte-dev  <http://listsnottingham.ac.uk/mailman/listinfo/xerte-dev>
>
>                 -- 
>
>                 --
>
>                 Tom Reijnders
>
>                 TOR Informatica
>
>                 Chopinlaan 27
>
>                 5242HM Rosmalen
>
>                 Tel: 073 5226191
>
>                 Fax: 073 5226196
>
>             _______________________________________________
>
>             Xerte-dev mailing list
>
>             Xerte-dev at lists.nottingham.ac.uk  <mailto:Xerte-dev at lists.nottingham.ac.uk>
>
>             http://lists.nottingham.ac.uk/mailman/listinfo/xerte-dev
>
>         -- 
>
>         --
>
>         Tom Reijnders
>
>         TOR Informatica
>
>         Chopinlaan 27
>
>         5242HM Rosmalen
>
>         Tel: 073 5226191
>
>         Fax: 073 5226196
>
>
>
> _______________________________________________
> Xerte-dev mailing list
> Xerte-dev at lists.nottingham.ac.uk
> http://lists.nottingham.ac.uk/mailman/listinfo/xerte-dev

-- 
--

Tom Reijnders
TOR Informatica
Chopinlaan 27
5242HM Rosmalen
Tel: 073 5226191
Fax: 073 5226196

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.nottingham.ac.uk/pipermail/xerte-dev/attachments/20130511/5061ed5e/attachment-0003.html>


More information about the Xerte-dev mailing list