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

    [concept] plugin launcher

    Scheduled Pinned Locked Moved Developers' Forum
    39 Posts 10 Posters 5.0k Views 10 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.
    • J Offline
      Jim
      last edited by

      This topic might get more views if it were moved to the Plugins forum. It could be tagged as a "concept" there also. I understand why it's posted in the Dev forum, but it is too hard to find here because it is not listed in the index.

      Hi

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

        Hi,

        I've had a play on the mac,
        I can only get some of it to work if I use 'enable debug' in scripts mode on the WebDialog.

        Once I've done that the Problems are:
        auto resize is not taking the menu bar height into account.
        when I have the WD menu with images, and click the image/area the commands to ruby don't run.

        Attached is the actual output html as seen by Safari in SU.
        Safari_LaunchUp.htm.zip

        Maybe someone can spot the problem...

        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
        • A Offline
          Aerilius
          last edited by

          Hi,
          I think it could have been the problem with Safari+onload. I added my current version (0.2).

          Note that that I added an index for demonstration purposes (it lists tools that are maybe not installed). That's because the fundamental obstacle is still that we don't have access to the commands of other plugins (I'm curious about Thomthom's aliasing or interception approach).

          The plugin contains a method LaunchUp.build_index which parses the other plugins to find their UI:Commands but the resulting index can contain mistakes and it's not a solution that I want to publish for common use, so it's still experimental.

          Actually a "search" user interface fits well in the scope of Google.

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

            @aerilius said:

            Hi,
            I think it could have been the problem with Safari+onload. I added my current version (0.2).

            hi,
            I got some of it working, sort of, and I don't think the loading was the issue, on Safari.
            It seems more to do with the focus function and works better if I comment out line 261

            // $("combo-input").focus();
            

            otherwise you add to the placeholder text rather then replace it.
            Tab and Return key codes are intermittent.
            Mostly they appear to be locked into the input box, even after the arrows have worked as intended.

            When I changed it to show_modal, JPP worked once. soap skin, a couple of times...

            also
            in the ruby:
            there seems to be an error line 90 it has if width I changed to if height so it doesn't 'over' shrink now.
            in html:
            Input type "search" [with css- margin top:4px;] looks better and doesn't seem to add to the problems.

            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
            • J Offline
              Jim
              last edited by

              I don't know what's going on - it's probably my computer. LaunchUp used to work, but now I get this at first:

              0087.png

              And expanded:

              0088.png

              I do tend to have a lot of problems with WebDialogs. I've never been able to figure out what is happening.

              Hi

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

                @Jim,
                did you ever get the default text?
                what happens if you type into the box?

                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
                • J Offline
                  Jim
                  last edited by

                  @driven said:

                  @Jim,
                  did you ever get the default text?
                  what happens if you type into the box?

                  john

                  LaunchUp worked when I first tried it a few weeks ago - now a get the dialog which only shows me the source for the html. No idea what I did.

                  Hi

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

                    @jim said:

                    • now a get the dialog which only shows me the source for the html. No idea what I did.

                    I would check other WD's first to see if it's a 'LaunchUp' specific problem

                    If you haven't touched the files, I'd look at the IE settings.

                    have you disabled js or set it to 'show as plain text'.

                    can you set those type of things a PC?

                    sorry, not very helpful

                    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
                    • A Offline
                      Aerilius
                      last edited by

                      I have never seen this problem.
                      What happens when you create a webdialog on the console and then set_file(".../LaunchUp.htm") ?

                      I don't believe that, but could there be a reason that Internet Explorer thinks it's a plain text file and not html? (confused mime type, or is the encoding or file header wrong?)

                      1 Reply Last reply Reply Quote 0
                      • J Offline
                        Jim
                        last edited by

                        When I inspect the html in the dialog, I see it is incorrectly nested somehow..

                        <HTML><HEAD></HEAD>
                        <BODY><PRE>&lt;!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/strict.dtd"&gt;
                        &lt;!--
                        This file is required by LaunchUp.rb"
                        
                        Copyright 2011, Andreas Eisenbarth
                        All Rights Reserved
                        
                        
                        

                        Hi

                        1 Reply Last reply Reply Quote 0
                        • A Offline
                          Aerilius
                          last edited by

                          I'm not sure what is nested wrong? (I haven't found it yet)
                          I know many browsers internally prepend a <HTML><HEAD></HEAD><BODY><PRE> when they display plain text files, so maybe this is only the result instead of the cause why IE shows the plain text.

                          I found that the doctype makes no sense (transitional <-> strict). Can you try
                          <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">

                          1 Reply Last reply Reply Quote 0
                          • J Offline
                            Jim
                            last edited by

                            I tried the new doctype - nope. I got rid of the doctype and comment beginning the .htm file with <html> and it started working again.

                            I put the doctype back in and removed just the comment - it worked.

                            Hi

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

                              I've got v2 stable enough to start looking at it on Safari... Selection from the search results only works with new keycodes and not the mouse...

                              HTML Changes include:
                              added a break after 'form' and moved the js to below that break... so line numbers reflect this.

                              Line 01- DOCTYPE html
                              Line 22- added to body>> height:100%;
                              Line 23- changed in form>> top:4px;height:inherit;
                              Line 49- input type="search"
                              Line 57- [<]br /[>] ...without []
                              Line 59>>296- scripts
                              Line 210/211- // left-arrow: select first entry
                              if (keycode == 37) {
                              Line 222/223- // right-arrow: execute entry
                              if (keycode == 39) {
                              Line 275- // $("combo-input").focus(); #jb_mac

                              in the Rudy:
                              this forces it to only scroll down
                              Line 54- changed to @launchdlg = UI::WebDialog.new("LaunchUp", false, false, 0, 1140, 270, 50, true)
                              Line 92- added @launchdlg.set_position(1140,0)
                              to get it to show_modal
                              Line 98>>102 + Line 110>>102- if RUBY_PLATFORM.include?('darwin') # Do NOT 'do this if on a PC! @launchdlg.show_modal else @launchdlg.show end #mac _modal

                              I also set a shortcut key in 'system' preferences and have started updating the txt file.

                              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
                              • A Offline
                                Aerilius
                                last edited by

                                Thank you so much for your efforts! I included it in the code. For me it used to work in my browsers/configurations, so otherwise I couldn't have found these solutions on my own.

                                I did some search about comments between doctype and <html>, but didn't find anything about issues. I probably leave the comment completely away (or does it work with the comment after <html> ?)

                                I was a bit hesitant about %(#000000)[input type="search"] because it's not standard (html4), but since unknown type defaults always to text, it shouldn't be a problem and doesn't break anything in Internet Explorer.

                                1 Reply Last reply Reply Quote 0
                                • Dan RathbunD Offline
                                  Dan Rathbun
                                  last edited by

                                  @jim said:

                                  I put the doctype back in and removed just the comment - it worked.

                                  It IS a bit weird that the comment is outside the <html> block... I would put it inside the <head> block as well.

                                  I'm not here much anymore.

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

                                    Hi all,

                                    I'm bumping this, because I want to modify it to work with 'on_off' http://forums.sketchucation.com/viewtopic.php?f=180&t=41994#p372262

                                    Using the option to open SU without rubies but with Ruby we have the ability to open individual .rbfiles or folders containing .rb files using Alex's + Jim's methods or load from RC, which is great.

                                    However if you want TIG's 2DTools [for example] you need to change all the 'requires' in all the scripts into 'load' + full the path before it will run with 'rubies' turned 'off'. I've got that working and it will still run as normal with them 'on', but would be a pain to do for each new version for all my rubies. I haven't worked out any of Fredo's yet, but I'm sure there's a way.

                                    So I'm thinking it would be a lot easier to parse the plugins each time you call one to 'load' and leave the originals intact,
                                    if it needs support files they can be added, but also need full path's.

                                    Basically, use 'LaunchUp' to select the 'standard' ruby rather then it's individual items,
                                    because you only need to have a few sets on at a time the toolbar count is still low.
                                    when you get to many you start again.

                                    I'm stumbling through so any feed back is appreciated.
                                    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
                                    • A Offline
                                      Aerilius
                                      last edited by

                                      Hi,
                                      This is very far from a proper plugin. Parsing other ruby files in order to get commands is not an ideal solution and needs always manual editing. I would not publish the current state as a plugin.

                                      I've played around with alternatives (should probably make my current version ready and post it here). I tried aliasing the UI::Command before all plugins load. Problem is that this way I modify core methods, I have to make sure that my plugin loads always first and it can be harmful if another plugin aliases UI::Command.

                                      Jim inspired me to get the commands with Objectspace, which works for all the command's metadata, but I haven't figured out how to call the proc.

                                      Third possibility is to continue hoping and begging for SU9 that we will have better access to commands (and maybe removing/modifying toolbars and menus).

                                      1 Reply Last reply Reply Quote 0
                                      • L Offline
                                        lapx
                                        last edited by

                                        This idea deserves an award! I spend too much time trying to find certain commands and dealing with grey out issue.
                                        Is it necessary to create another plugin folder or can I just check not load at start up.
                                        Have'nt tried yet but appears to be a winning concept if it can work smoothly.

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

                                          Hi Aerilius,

                                          thanks for replying

                                          I may have found a workaround for what I'm after using Fred's '000_AdditionalPluginFolders.rb' with 'on off.rb',

                                          I've made and registered some subfolders in SU, then when I launch with 'rubies OFF' and run '000_AdditionalPluginFolders.rb' I get asked which I want to instal, so I can choose 'Base Set', '2D', 'Fredo' or 'TIG', etc...

                                          This avoids having to look at or modify the rubies content at all and with a simple folder creator/sorter WebDialog this is almost doing what I want [on mac at least] and without any .rbs [but they can be accessed via a full startup].

                                          I'll keep digging
                                          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
                                          • J Offline
                                            Jim
                                            last edited by

                                            @aerilius said:

                                            but I haven't figured out how to call the proc.

                                            Once you have a reference to a proc, call call on it.

                                            pr = Proc.new { puts "Hi" } pr.call Hi

                                            Hi

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

                                            Advertisement