sketchucation logo sketchucation
    • Login
    ℹ️ Licensed Extensions | FredoBatch, ElevationProfile, FredoSketch, LayOps, MatSim and Pic2Shape will require license from Sept 1st More Info

    WebDialog.set_html fails under Safari 5.0.6

    Scheduled Pinned Locked Moved Developers' Forum
    111 Posts 7 Posters 17.2k Views 7 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • D Offline
      driven
      last edited by

      on my computers, both running OSX 10.5.6.

      under Safari 5.0.3

      Fredo's WD all work correctly.
      TT_SelectionToys works EXCEPT for 'cheat sheet' which shows as about:blank and loads nothing, not even error messages, so may be a different issue.
      TT_CleanUp3 all works with original file (will test new one now) UPDATE: new file works

      under Safari 5.0.6
      Fredo's WD failed to load images and failed on check for updates . with the temp file test, it will now switch from about:blank if a manual reset is induced, It THEN works correctly.
      TT_SelectionToys works EXCEPT [as above]
      TT_CleanUp3 all now work with the latest patch EXCEPT temp file are not purged on close of dialog or SU.
      temp files accumulate...

      from my testing .set_file and .set_url seem to be interchangeable (with the corrected path), i.e. the same resource from the same source can be used with either method.

      john

      learn from the mistakes of others, you may not live long enough to make them all yourself...

      1 Reply Last reply Reply Quote 0
      • D Offline
        driven
        last edited by

        @TT new patch works on Safari 5.0.3 as well, updated above... and temp files also don't purge.

        learn from the mistakes of others, you may not live long enough to make them all yourself...

        1 Reply Last reply Reply Quote 0
        • thomthomT Offline
          thomthom
          last edited by

          It appears that the Garbage Collector is no invoked when SketchUp exits under OSX - as oppose to under Windows. Gonna have to look for another way to cleanup.

          Thomas Thomassen — SketchUp Monkey & Coding addict
          List of my plugins and link to the CookieWare fund

          1 Reply Last reply Reply Quote 0
          • thomthomT Offline
            thomthom
            last edited by

            Cursed - this is more troublesome than I thought.
            Under Windows I can clean up all temps by using AppObserver.onQuit - but under OSX it appear to never trigger.

            Thomas Thomassen — SketchUp Monkey & Coding addict
            List of my plugins and link to the CookieWare fund

            1 Reply Last reply Reply Quote 0
            • D Offline
              driven
              last edited by

              SketchUpUndo0.log is an on quit event, so it is possible. and I think Fredo's DebugLog class purges the old trace files in his tmpdir

              /Library/Application Support/Google SketchUp 8/SketchUp/plugins/LIBFREDO6_Dir_40/Lib6PluginDialogs.rb line1047

              learn from the mistakes of others, you may not live long enough to make them all yourself...

              1 Reply Last reply Reply Quote 0
              • thomthomT Offline
                thomthom
                last edited by

                I got lots of Fredo tracelogs in my Window folder...

                Thomas Thomassen — SketchUp Monkey & Coding addict
                List of my plugins and link to the CookieWare fund

                1 Reply Last reply Reply Quote 0
                • thomthomT Offline
                  thomthom
                  last edited by

                  @driven said:

                  SketchUpUndo0.log is an on quit event

                  Doesn't seem to trigger from the Ruby API...

                  Thomas Thomassen — SketchUp Monkey & Coding addict
                  List of my plugins and link to the CookieWare fund

                  1 Reply Last reply Reply Quote 0
                  • thomthomT Offline
                    thomthom
                    last edited by

                    I'm finding no way to get anything to trigger when OSX exits. onDelete model triggers when you close a model, but not upon exit. It's like all Ruby callbacks are stopped when SU exits under OSX.

                    Thomas Thomassen — SketchUp Monkey & Coding addict
                    List of my plugins and link to the CookieWare fund

                    1 Reply Last reply Reply Quote 0
                    • D Offline
                      driven
                      last edited by

                      sorry if I'm barking up the wrong tree, but this bit of code overwrites an existing file.
                      could something similar not work for .html's

                      	@sfile = "/Library/Application\ Support/Google\ SketchUp\ 8/SketchUp/plugins/audit_mac_ruby/audit.txt "
                      		@debug_file = File.new(@sfile, "w")
                      

                      john

                      learn from the mistakes of others, you may not live long enough to make them all yourself...

                      1 Reply Last reply Reply Quote 0
                      • fredo6F Offline
                        fredo6
                        last edited by

                        @thomthom said:

                        I got lots of Fredo tracelogs in my Window folder...

                        Normally LibFredo6 keeps the last 10 or 15 log files (purge is done above).
                        This is to allow consulting traces from previous sessions.

                        Fredo

                        1 Reply Last reply Reply Quote 0
                        • fredo6F Offline
                          fredo6
                          last edited by

                          @thomthom said:

                          Cursed - this is more troublesome than I thought.
                          Under Windows I can clean up all temps by using AppObserver.onQuit - but under OSX it appear to never trigger.

                          You should not worry too much with the temporary file.
                          You create it with a unique name and then delete it when you close the dialog box (I guess you have a hook in the on_close() event).
                          And if there are a few files remaining, the user or the system will purge them at some points.

                          The question I had on temp file is whether the html file should absolutely be in the ENV["TMPDIR"] folder or in any folder (like /tmp)

                          Fredo

                          1 Reply Last reply Reply Quote 0
                          • D Offline
                            driven
                            last edited by

                            @unknownuser said:

                            @thomthom said:

                            The question I had on temp file is whether the html file should absolutely be in the ENV["TMPDIR"] folder or in any folder (like /tmp)

                            Fredo

                            I just did a test and

                            @tempfile = File.join( "/Library/Application Support/Google\ SketchUp\ 8/SketchUp/plugins/TT_Lib2/webdialog", filename )
                            

                            runs the same as the former, but I can find it easier...

                            learn from the mistakes of others, you may not live long enough to make them all yourself...

                            1 Reply Last reply Reply Quote 0
                            • thomthomT Offline
                              thomthom
                              last edited by

                              I'm thinking I might not need temp files at all. I just need to send the HTML to the webdialog via .execute_script to a proxy HTML document that replaces the content.

                              Thomas Thomassen — SketchUp Monkey & Coding addict
                              List of my plugins and link to the CookieWare fund

                              1 Reply Last reply Reply Quote 0
                              • D Offline
                                driven
                                last edited by

                                another thing...

                                I decided to check the html temp files from both paths to see if they where identical (they are)

                                I also get this identical message when opening in TextWrangler.
                                temp_file_message.png

                                never seen that for any other html files, so I checked Fredo's tmp htmls as well and they are fine.

                                here's the other file, contents is the same
                                EDIT- it may be this <title>CleanUp� unidentified character(in TextWrangler)

                                learn from the mistakes of others, you may not live long enough to make them all yourself...

                                1 Reply Last reply Reply Quote 0
                                • thomthomT Offline
                                  thomthom
                                  last edited by

                                  @driven said:

                                  @unknownuser said:

                                  @thomthom said:

                                  The question I had on temp file is whether the html file should absolutely be in the ENV["TMPDIR"] folder or in any folder (like /tmp)

                                  Fredo

                                  I just did a test and

                                  @tempfile = File.join( "/Library/Application Support/Google\ SketchUp\ 8/SketchUp/plugins/TT_Lib2/webdialog", filename )
                                  

                                  runs the same as the former, but I can find it easier...

                                  If the file is in the system temp then it's more likely that stray files will be removed.

                                  @driven said:

                                  another thing...

                                  I decided to check the html temp files from both paths to see if they where identical (they are)

                                  I also get this identical message when opening in TextWrangler.

                                  temp_file_message.png
                                  temp_file_message.png (47.92 KiB) Viewed 4 times

                                  never seen that for any other html files, so I checked Fredo's tmp htmls as well and they are fine.

                                  That's because I have sent a ³ character in ANSI format instead of UTF-8. It's nothing important.

                                  Thomas Thomassen — SketchUp Monkey & Coding addict
                                  List of my plugins and link to the CookieWare fund

                                  1 Reply Last reply Reply Quote 0
                                  • D Offline
                                    driven
                                    last edited by

                                    if your proxy is in your webdialog folder, all your links are then relative... I'd vote for that... if I can

                                    learn from the mistakes of others, you may not live long enough to make them all yourself...

                                    1 Reply Last reply Reply Quote 0
                                    • thomthomT Offline
                                      thomthom
                                      last edited by

                                      @unknownuser said:

                                      @thomthom said:

                                      Cursed - this is more troublesome than I thought.
                                      Under Windows I can clean up all temps by using AppObserver.onQuit - but under OSX it appear to never trigger.

                                      You should not worry too much with the temporary file.
                                      You create it with a unique name and then delete it when you close the dialog box (I guess you have a hook in the on_close() event).

                                      w = WebDialogPatch.new( 'Hello World' ) w.show w.set_html( 'Lorem Ipsum' ) w.close w.show # HTML file would now be missing...

                                      Thomas Thomassen — SketchUp Monkey & Coding addict
                                      List of my plugins and link to the CookieWare fund

                                      1 Reply Last reply Reply Quote 0
                                      • thomthomT Offline
                                        thomthom
                                        last edited by

                                        @driven said:

                                        if your proxy is in your webdialog folder, all your links are then relative... I'd vote for that... if I can

                                        ❓

                                        Thomas Thomassen — SketchUp Monkey & Coding addict
                                        List of my plugins and link to the CookieWare fund

                                        1 Reply Last reply Reply Quote 0
                                        • fredo6F Offline
                                          fredo6
                                          last edited by

                                          @thomthom said:

                                          I'm thinking I might not need temp files at all. I just need to send the HTML to the webdialog via .execute_script to a proxy HTML document that replaces the content.

                                          I remember that execute_script suffered from a string size limitation on Mac?
                                          Maybe this is fine now.

                                          Fredo

                                          1 Reply Last reply Reply Quote 0
                                          • D Offline
                                            driven
                                            last edited by

                                            @thomthom said:

                                            I'm thinking I might not need temp files at all. I just need to send the HTML to the webdialog via .execute_script to a proxy HTML document that replaces the content.

                                            by proxy HTML document I assumed you meant a html file that is basically populated by your current window.html + ruby, which is then sent to web dialog and is then updated via ruby.

                                            if that's what you mean, and it lived beside window.html can't all your links then be relative i.e. href=css/ui.css, src=js/base.js, etc...

                                            john

                                            learn from the mistakes of others, you may not live long enough to make them all yourself...

                                            1 Reply Last reply Reply Quote 0
                                            • 1
                                            • 2
                                            • 3
                                            • 4
                                            • 5
                                            • 6
                                            • 4 / 6
                                            • First post
                                              Last post
                                            Buy SketchPlus
                                            Buy SUbD
                                            Buy WrapR
                                            Buy eBook
                                            Buy Modelur
                                            Buy Vertex Tools
                                            Buy SketchCuisine
                                            Buy FormFonts

                                            Advertisement