Window.open webdialog on MAC close parent
-
Ok,
if I just rundialog = UI;;WebDialog.new("PVGYS", true, "sk_pvgys", 930, 830, 500, 0, true) dialog.set_url('http://re.jrc.ec.europa.eu/pvgis/apps3/pvest.php') dialog.show_modal
I can go to child windows and then right click to go back to the parent etc...
I get an error for each because the request is asking for a new TAB not window, but because this WebDialog doesn't have Tabs, The new windows appear to be sized by the content.
[@Dan, you highlight so often for so many reasons I loose track... and I tend to paste rather than read...]
john -
@unknownuser said:
What's not working
Using javascript command "myWindow = window.open();" in Safari and IE you have two windows opened.
But inside a webdialog this command in MAC not open a new window, only load it inside parent window. In IE works normally, and you have two windows at same time.
I give up with this, I achieved the plugin to work in MAC whith only one window.
Thank you all
-
Why not just open a new WebDialog?
-
I want to open this webdialog 'http://re.jrc.ec.europa.eu/pvgis/apps3/pvest.php' and when I press "calculate" the server
sends a response, opened in a new window (in Safari and IE), but not in MAC webdialogs.
I only wanted to know why window.open() works differently in MAC webdialogs, nothing more.
(I can't modify server files) -
Hi Jauntxo,
The reasons for WebDialogs and Safari behaving differently [on the same machine] are two fold.
1: WebDialogs can't and don't use Safari.app,
Safari is a separate Apple application that also uses WebKit and WebCore frameworks.Sketchup UI can use Safari.app
Safari = UI.openURL "http://re.jrc.ec.europa.eu/pvgis/apps3/pvest.php"
Opens your target in Safari.
2: When using WebDialogs, you are being routed through Sketchup server settings.
Sketchup generates the headers based on the best way for it to access dynamic Google Resources [SU Licensing, G Warehouse, G Earth, etc...]If you point WD at a dynamic site that has a different structure to the Sketchup<=>Google template your results will vary.
Even going to the SU API pages from inside SU is problematic.However, the pages you want to access are nicely constructed and can be accessed and work from a Webdialog.
The settings may vary from the ones for PC, but with a couple of slight impositions this works.dlg = UI;;WebDialog.new("PVGIS", true,"pvgis", 900, 930, 150, 150, true, true); dlg.set_url "http://re.jrc.ec.europa.eu/pvgis/apps3/pvest.php" dlg.min_width = 900 dlg.min_height = 930 dlg.max_width = 900 dlg.max_height = 930 dlg.set_position(150,150) dlg.navigation_buttons_enabled=true dlg.show_modal
With these settings you can do all your navigation from one window, and use the back/forward buttons for most things [Back after PDF doesn't work].
If you are sent to a different width page, the WD will narrow, but when you grab the corner it will resize to the defined max/min settings.
All the 'onscreen' information appears to work.
Selecting 'Text' as output doesn't appear to work. [in a quick test], but PDF output can be saved locally from the WD.Hope this helps answer your query.
john -
Today I finish to change Skelion plugin to run on MAC and it seems all is running ok.
Thank you John. -
SO.. the lesson is, do not try and open a new window from the webdialog JS.. instead write a Ruby callback and fire it FROM the JS, .. and let the Ruby callback open the window using either
UI.openURL
or instantiating anotherWebDialog
instance. -
@unknownuser said:
SO.. the lesson is, do not try and open a new window from the webdialog JS..
not necessarily SO..
Dynamic Components works fine writing new windows. SU, as both client and server allows for it.
Get Photo Textures can go full screen with 'Flash', because SU allows for it.Creating new windows in js works, it's just needs special handling to deal with resizing.
If you add the back/home/forward buttons you can have multiple new windows, all packed neatly into one chrome.
What you can't do via 'SU as Server' is Download or Upload local content. [that's what broke set_html if html = local_file.img]
@unknownuser said:
instead write a Ruby callback and fire it FROM the JS, .. and let the Ruby callback open the window using either UI.openURL or instantiating another WebDialog
Curiously, in mac SU, GoogleEarth.app is controlled by an Applescript, that sets and gets contents, takes a screenshot and inserts that it back into SU.
I had a go an applescript version for this topics site last night that uses
UI.openURL
to open in Safari but positioned [by script] 'as if' in SU.I then manually filled in the form and downloaded the text file.
I then used a folder action to automatically move and rename the new file to match a WD
dlg.set_file "path/text.txt"
to
open in SU. [WD even wraps it in <pre with formating> automatically].You could do the Safari stuff in the background, including filling in the form fields, requesting the calculation and download.
SO.. you could use SU to launch a WD1 to collate all the required input,
then have SU complete an Applescript with that information before running that script [in own thread] via system
WD1 could spin a progress bar until the new file is available.
then SU can launch a WD2 with the required output, closing WD1 as it opens.john
-
@driven said:
What you can't do via 'SU as Server' is Download or Upload local content. [that's what broke set_html if html = local_file.img]
Is this local content still broken on Safari ??
-
Advertisement