webdialogs: inputbox shows black background (sketchup webkit

Found a bug in SketchUp? Report it here

Re: webdialogs: inputbox shows black background (sketchup we

Postby rdeath » Thu May 24, 2012 2:10 pm

OK, purged cache in Safari and still no luck...!! anything else i can try..??? this is VERY frustrating..!!
0

rdeath 
 

Re: webdialogs: inputbox shows black background (sketchup we

Postby petersaal » Fri May 25, 2012 7:54 pm

Move "font-size: 12px;" down to its own line. I had that on the same line as background-color and that's an error on my part.

If that doesn't do the trick, the only difference might be the OS X version. I'm still on 10.6 and I don't have a way to test 10.7.

Just to be clear: this fix is only for dynamic components. It will not fix the 3D Warehouse search box or any other affected software on the mac.
0

petersaal 
 

Re: webdialogs: inputbox shows black background (sketchup we

Postby lwerner » Sat May 26, 2012 6:52 am

Thanks for posting this workaround! It worked perfectly for me. (On OSX 10.7.4 Lion, Sketchup 8.0.14345 Pro)

Laura
0

lwerner 
 

Re: webdialogs: inputbox shows black background (sketchup we

Postby Juantxo » Tue May 29, 2012 9:30 pm

When I updated to Safari to 5.1.7 in Mac Leopard webdialogs boxes turn black in Sketchup.
I've installed an older version of safari with pacifist and now it works again.

http://www.charlessoft.com/ (pacifist software)
http://mac.oldapps.com/safari.php (Safari 5.1.1 (Snow Leopard))
0
User avatar
Juantxo 
 

Re: webdialogs: inputbox shows black background (sketchup we

Postby jeff hammond » Tue May 29, 2012 11:39 pm

lwerner wrote:Thanks for posting this workaround! It worked perfectly for me. (On OSX 10.7.4 Lion, Sketchup 8.0.14345 Pro)

Laura


ditto.. works fine for me too..
thanks peter.
0
dotdotdot
User avatar
jeff hammond 
Global Moderator
 

Re: webdialogs: inputbox shows black background (sketchup we

Postby TeamSDA » Thu May 31, 2012 7:19 pm

Hi All,

The fix Peter provided worked for the fields in my DC options window. But when I open my custom attributes window and look at the "Display Label" it is black as well. I couldn't find the style in the css style sheet that changed this input field. Does anyone know the style I need to change.

Custom Attributes.png


(On OSX 10.6.8 Snow Leopard, Sketchup 8.0.14345 Pro)


Regards,
Christian
0

TeamSDA 
 

Re: webdialogs: inputbox shows black background (sketchup we

Postby mwm5053 » Mon Jun 25, 2012 6:10 am

Juantxo wrote:When I updated to Safari to 5.1.7 in Mac Leopard webdialogs boxes turn black in Sketchup.
I've installed an older version of safari with pacifist and now it works again.

http://www.charlessoft.com/ (pacifist software)
http://mac.oldapps.com/safari.php (Safari 5.1.1 (Snow Leopard))


Update If you find more black dialoge boxes blacked out like in profile builder or at 3d warehose this solution of Juantxo will work for all blacked
out dialoge boxes follow instructions on this page to revert Safari back to 5.1.1 even though it's for a earlier ver.

http://appletoolbox.com/2010/06/downgra ... ari-4-0-5/
0
2011 iMac
SU 2015 Pro, 2017 Make
V2 Twilight
macOS Sierra 10.12.5

mwm5053 
Premium Member
Premium Member
 

Re: webdialogs: inputbox shows black background (sketchup we

Postby jeff hammond » Mon Jun 25, 2012 4:09 pm

fwiw, i did the DC fix a while ago and yes, it works but as mentioned in this thread, it only works with the DC dialog.. skindigo was also exhibiting this blacked out behavior so i eventually downgraded safari using the method mentioned by Juantxo a few posts back.. pacifist with an older version of safari..

and that fixes everything in sketchup instead of just the DC dialog.
0
dotdotdot
User avatar
jeff hammond 
Global Moderator
 

Re: webdialogs: inputbox shows black background (sketchup we

Postby mwm5053 » Mon Jun 25, 2012 8:18 pm

I wonder if this has been reported to apple so the next Safari update will resolve this? BTW Still love my MAC
1
2011 iMac
SU 2015 Pro, 2017 Make
V2 Twilight
macOS Sierra 10.12.5

mwm5053 
Premium Member
Premium Member
 

Re: webdialogs: inputbox shows black background (sketchup we

Postby driven » Mon Jun 25, 2012 10:03 pm

I'm using the developer release of Safari 6 and the problem remains in SU.

Safari's User Agent Style Sheet, handles the input border correctly but SU doesn't use that, so it's a WebCore update that's needed. i'm looking for a patch at the moment.

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

driven 
PluginStore Author
PluginStore Author
 

Re: webdialogs: inputbox shows black background (sketchup we

Postby mwm5053 » Mon Jun 25, 2012 10:07 pm

Thanks John I'd like to stay updated on this as I like to stay updated on all software.
0
2011 iMac
SU 2015 Pro, 2017 Make
V2 Twilight
macOS Sierra 10.12.5

mwm5053 
Premium Member
Premium Member
 

Re: webdialogs: inputbox shows black background (sketchup we

Postby gohch » Thu Jun 28, 2012 1:33 am

Thanks guys!
I managed to get all the dialog boxes of 1001bit fixed following the suggestions on the css;

black_textbox_patch.jpg


It's a lot of work to edit all the html files, but at least the problem is solved. :D
Cheers!
0

gohch 
 

Re: webdialogs: inputbox shows black background (sketchup we

Postby RichMorin » Tue Jul 03, 2012 1:52 am

I grabbed a copy of Pacifist, but I can't find a copy of Safari 5.1.5 to install.

For example, the page http://support.apple.com/kb/DL1070
has a Download button that leads to http://www.apple.com/safari/download/.

However, this page only supports downloading of Safari 5.1.7.

Help?
0
User avatar
RichMorin 
 

Re: webdialogs: inputbox shows black background (sketchup we

Postby troypiggo » Tue Jul 03, 2012 2:03 am

0
This is not my signature. I type it at the end of every message for quality control.

troypiggo 
 

Re: webdialogs: inputbox shows black background (sketchup we

Postby driven » Tue Jul 03, 2012 3:02 am

Hi,
update to my investigation.

WebView uses a different version of Webkit than Safari (and not just in SU) and I can't find a way to change the userAgent from within SU, so been trying another approach.
Code: Select all
dlg.execute_script %(function addGlobalStyle(css) {
   var head, style;
   head = document.getElementsByTagName('head')[0];
   if (!head) { return; }
   style = document.createElement('style');
   style.type = 'text/css';
   style.innerHTML = css;
   head.appendChild(style);

}

addGlobalStyle('input {border: 1px solid gray;}'))

This works if you know the name of the dialog, but how can I get that with ruby to apply a global patch. Is it possible to get a new dialog name in ruby.
Using WebInspector to add the JS I can also exclude type with
Code: Select all
addGlobalStyle('input, input:not[type="submit"]:not[type="button"]:not[type="file"]:not[type="search"]{border: 1px solid gray;}'))
, but that returns true and fails in RubyConsole
john
0
learn from the mistakes of others, you may not live long enough to make them all yourself...

driven 
PluginStore Author
PluginStore Author
 

Re: webdialogs: inputbox shows black background (sketchup we

Postby Aerilius » Tue Jul 03, 2012 8:43 pm

You could carefully "alias" the WebDialog class in SketchUp, that means you add a script that is loaded first where you redefine the UI::WebDialog.open method so that it injects your JavaScript after the WebDialog has opened. Maybe like (untested):
Code: Select all
class UI::WebDialog

  # this gives a new name to the method "show"
  alias :show_orig :show
  private :show_orig

  def show(&proc)
    # this calls the original "show" method
    show_orig(&proc){ proc.call }
    execute_script(" /*your script*/ ")
  end

end

However re-defining base classes is something that no published plugin should do.
0
Last edited by Aerilius on Sun Jul 08, 2012 10:05 am, edited 3 times in total.

Aerilius 
PluginStore Author
PluginStore Author
 

Re: webdialogs: inputbox shows black background (sketchup we

Postby thomthom » Tue Jul 03, 2012 11:06 pm

Aerilius wrote:UI::WebDialog.open

You mean UI::WebDialog.show ?
0
Thomas Thomassen — SketchUp Monkey & Coding addict
List of my plugins and link to the CookieWare fund
User avatar
thomthom 
PluginStore Author
PluginStore Author
 

Re: webdialogs: inputbox shows black background (sketchup we

Postby Aerilius » Wed Jul 04, 2012 12:47 am

fixed it.
0

Aerilius 
PluginStore Author
PluginStore Author
 

Re: webdialogs: inputbox shows black background (sketchup we

Postby driven » Wed Jul 04, 2012 12:59 am

2012-07-04 12.29.45 am.png

I added GreaseKit to SketchUp Menu and wrote a userScript to intercept ALL WebDialogs to add the patch.

It only affects input[type=text] even when it's not been declared. (e.g. at 3D Warehouse site)

Here are some instructions and my userScript if anyones interested.

You need to instal SIMBL and GreaseKit in these locations
/Library/Application\ Support/SIMBL
/Library/Application\ Support/SIMBL/Plugins/GreaseKit.bundle
~/Library/Application Support/GreaseKit/apps.plist
~/Library/Application Support/GreaseKit/config.xml

~/Library/Application\ Support/GreaseKit/inputPatch.user.js

Edit: SCRIPT REMOVED - better version below


add SketchUp to greaseKit from Safari Menu, then in SU Reload All UserScripts and Select 'InputPatch'
that's it
john
0
Last edited by driven on Thu Jul 05, 2012 11:54 pm, edited 1 time in total.
learn from the mistakes of others, you may not live long enough to make them all yourself...

driven 
PluginStore Author
PluginStore Author
 

Re: webdialogs: inputbox shows black background (sketchup we

Postby driven » Wed Jul 04, 2012 1:09 am

Aerilius wrote:fixed it.

hi, I'm getting
Error: #<SyntaxError: (eval):24: compile error
(eval):15: parse error, unexpected '('
alias(:show_orig, :show)
^
(eval):20: both block arg and actual block given>
(eval):24


I'd much rather use a small amount of ruby to 'fix' the input problem

cheers for your efforts
john
0
learn from the mistakes of others, you may not live long enough to make them all yourself...

driven 
PluginStore Author
PluginStore Author
 

Re: webdialogs: inputbox shows black background (sketchup we

Postby Dan Rathbun » Thu Jul 05, 2012 10:45 pm

@Aerilius

It's much more complicated than that.

I have a patch that does similar.. (and more,) but we can't release such a thing without Boulder's blessing.

We have realized, that it's best not to show how to modify the API modules and classes. Some newbie's just run with it and start hacking away, and worse. (Yes we've all been guilty of openly discussing such things in the past. I'm sure I have. Sometimes we forget the "kids" come along and read what we've written later.)

Anyway... you don't need the literal block when you pass to the orig method, as the wrapper method has already converted any block argument to a Proc object.
So instead you do:
block_given? ? show_orig(&proc) : show_orig()

But it will not work like that, for the same reasons that the current API show(), show_modal() and set_on_close() block form methods do not work on Mac. (The webpage is never ready when Ruby executes the block.)
0
    I'm not here much anymore. But a PM will fire email notifications.
    User avatar
    Dan Rathbun 
    PluginStore Author
    PluginStore Author
     

    Re: webdialogs: inputbox shows black background (sketchup we

    Postby driven » Thu Jul 05, 2012 11:49 pm

    Improved my 'GreaseKit' UserScript using a file from Dan (cheers)
    2012-07-05 11.24.31 pm.png

    Code: Select all
    // ==UserScript==
    // @name           inputPatch
    // @author          driven
    // @namespace      http://drivenupthewall
    // @description    fixes webkit input boxes in SketchUp.
    // @include        *
    // ==/UserScript==

    (function() {   
       function main() {
    // ====== DO NOT TOUCH ANYTHING ABOVE =====
    // ===== PLACE CUSTOM CODE UNDER THIS LINE =====
          function patchStyle(css) {
       var head, style;
       head = document.getElementsByTagName('head')[0];
       if (!head) { return; }
       style = document.createElement('style');
       style.type = 'text/css';
       style.innerHTML = css;
       head.appendChild(style);

    }

    patchStyle('input:not([type=button]):not([type=file]):not([type=checkbox]):not([type=image]):not([type=radio]):not([type=reset]):not([type=search]):not([type=submit]){background-color: rgb(255, 255, 255); border-bottom-color: rgb(238, 238, 238); border-bottom-style: inset; border-bottom-width: 1px; border-collapse: separate; border-left-color: rgb(238, 238, 238); border-left-style: inset; border-left-width: 1px; border-right-color: rgb(238, 238, 238); border-right-style: inset; border-right-width: 1px; border-top-color: rgb(238, 238, 238); border-top-style: inset; border-top-width: 1px;}');
    // ===== KEEP CUSTOM CODE ABOVE THIS LINE =====      
    // ===== DO NOT TOUCH ANYTHING BELOW =====
       };
       var script = document.createElement('script');
       script.appendChild(document.createTextNode('('+ main + ') ();'));
       (document.body || document.head || document.documentElement).appendChild(script);
    })();



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

    driven 
    PluginStore Author
    PluginStore Author
     

    Re: webdialogs: inputbox shows black background (sketchup we

    Postby troyhome » Tue Jul 17, 2012 5:05 pm

    petersaal wrote:I found the same problem last week. The source of the problem is the Safari update that Apple pushed out last week (5.1.7). Here's a work-around for dynamic components: make the following edits in red to the manager.css and configurator.css files. (located in Library/Application Support/Google SketchUp 8/SketchUp/Tools/Dynamic Components/css)

    In Manager.css:

    .edit-field {
    position: absolute;
    border-top: 2px solid #3063C9;
    border-left: 2px solid #3063C9;
    border-right: 2px solid #A5C4FF;
    border-bottom: 2px solid #A5C4FF;
    background-color: white; font-size: 12px;
    font-family: sans-serif;
    width: 100%;
    height: 100%;
    overflow: hidden;
    padding-left: 2px;
    padding-top: 1px;
    border: 1px solid #000000;
    }

    In Configurator.css:

    .config-field {
    width: 100%;
    font-size: 11px;
    font-family: tahoma, sans-serif;
    height: 22px;
    background-color: white;
    border: 1px solid #000000;
    }

    .config-field-readonly {
    width: 100%;
    font-size: 11px;
    font-family: tahoma, sans-serif;
    height: 22px;
    background-color: threedface;
    border: 1px solid #000000;
    }

    Thank you!! this worked for me!!! :berserk:
    0
    IOviz.com
    SU Pro 2017 PC
    Thea: latest
    vray4SU latest
    User avatar
    troyhome 
     

    Re: webdialogs: inputbox shows black background (sketchup we

    Postby troyhome » Tue Jul 17, 2012 5:56 pm

    GOHCH wrote:Thanks guys!
    I managed to get all the dialog boxes of 1001bit fixed following the suggestions on the css;

    black_textbox_patch.jpg


    It's a lot of work to edit all the html files, but at least the problem is solved. :D
    Cheers!

    what files exactly did you modify?
    0
    IOviz.com
    SU Pro 2017 PC
    Thea: latest
    vray4SU latest
    User avatar
    troyhome 
     

    Re: webdialogs: inputbox shows black background (sketchup we

    Postby phaseOne » Sun Jul 22, 2012 5:11 pm

    To avoid any confusion over installation of the script, I created this guide:
    1. Download SIMBL
    2. Unzip the file
    3. Launch the SIMBL-*.*.*.pkg installer
    4. Download GreaseKit
    5. Mount the GreaseKit-*.*.dmg image
    6. Copy GreaseKit.bundle to /Library/Application Support/SIMBL/Plugins/
    7. Launch Safari
    8. Select the GreaseKit item in the menubar
    9. Select Manage Applications...
    10. Add Sketchup to the application list
    11. Quit Safari
    12. Download inputPatch.user.js created by driven (his original post)
    13. Copy inputPatch.user.js to ~/Library/Application Support/GreaseKit/
    14. Launch SketchUp
    15. Select inputPatch from the GreaseKit menu

    Your text boxes are now white!
    0

    phaseOne 
     

    Re: webdialogs: inputbox shows black background (sketchup we

    Postby driven » Wed Jul 25, 2012 2:23 am

    hi Phaseone,
    Welcome to SCF and thanks for the guide on how to instal my GreaseKit solution.

    It made me revisit the issue and I realise now that there is an even easier way to do this. [i.e. without SIMBL, GreaseKit or js injection]

    In an earlier post from Aerilius
    Another idea, would a WebView also accept a user stylesheet (that would override the default background in all websites+webdialogs in SketchUp)?


    Yes, Safari does it from the preference menu and I now have it working in SU, but what's the simplest way to share the 'how to'.

    First you need a css file containing the patch code, in a place SU can find. So copy paste this into Ruby Console and hit return.
    Code: Select all
    directory='/Library/Application Support/Google SketchUp 8/SketchUp/plugins/__InputPatch/'
    Dir::mkdir(directory) unless File.exists?(directory)
    filename='inputPatch.css'
    File.open(directory + filename, 'w') do |iP|
    iP.puts <<PATCH
    input:not([type=button]):not([type=file]):not([type=checkbox]):not([type=image]):not([type=radio]):not([type=reset]):not([type=search]):not([type=submit]){background-color: rgb(255, 255, 255); border-bottom-color: rgb(238, 238, 238); border-bottom-style: inset; border-bottom-width: 1px; border-collapse: separate; border-left-color: rgb(238, 238, 238); border-left-style: inset; border-left-width: 1px; border-right-color: rgb(238, 238, 238); border-right-style: inset; border-right-width: 1px; border-top-color: rgb(238, 238, 238); border-top-style: inset; border-top-width: 1px;}
    PATCH
    end

    it makes a folder + file in /Library/Application Support/Google SketchUp 8/SketchUp/plugins/

    Then if you have Pro8 copy/paste and return this.
    Code: Select all
    `defaults write ~/Library/Preferences/com.google.sketchuppro8.plist WebKitUserStyleSheetEnabledPreferenceKey -bool True`
    `defaults write ~/Library/Preferences/com.google.sketchuppro8.plist WebKitUserStyleSheetLocationPreferenceKey '/Library/Application Support/Google SketchUp 8/SketchUp/plugins/__InputPatch/inputPatch.css'`

    or for free try
    Code: Select all
    `defaults write ~/Library/Preferences/com.google.sketchupfree8.plist WebKitUserStyleSheetEnabledPreferenceKey -bool True`
    `defaults write ~/Library/Preferences/com.google.sketchupfree8.plist WebKitUserStyleSheetLocationPreferenceKey '/Library/Application Support/Google SketchUp 8/SketchUp/plugins/__InputPatch/inputPatch.css'`


    Restart SU
    You only need to do this once, and all your input boxes in SU will work correctly [without editing any files]
    If the problem is resolved in the future you can just bin the __inputPatch Folder

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

    driven 
    PluginStore Author
    PluginStore Author
     

    Re: webdialogs: inputbox shows black background (sketchup we

    Postby mwm5053 » Sun Jul 29, 2012 2:52 pm

    thanks John for this fix. Works great
    Walt
    0
    2011 iMac
    SU 2015 Pro, 2017 Make
    V2 Twilight
    macOS Sierra 10.12.5

    mwm5053 
    Premium Member
    Premium Member
     

    Re: webdialogs: inputbox shows black background (sketchup we

    Postby Nick » Sun Jul 29, 2012 11:54 pm

    Thanks John

    That's magic; a very elegant solution.

    Nick
    0
    User avatar
    Nick 
     

    Re: webdialogs: inputbox shows black background (sketchup we

    Postby mariocha » Fri Aug 03, 2012 2:36 pm

    YEaH !!! :D John !
    Corrected !
    I had to do it twice.
    (The cursor jumps at the end of the pasted text, so one does not see at once what has just been pasted in the Ruby console input field.)
    0
    Mario C.
    Certified SketchUp Trainer, QC CA.
    Every rule has exceptions, but some.
    User avatar
    mariocha 
    Premium Member
    Premium Member
     

    Re: webdialogs: inputbox shows black background (sketchup we

    Postby solid-wood » Fri Aug 31, 2012 11:11 am

    driven wrote:hi Phaseone,
    Welcome to SCF and thanks for the guide on how to instal my GreaseKit solution.

    It made me revisit the issue and I realise now that there is an even easier way to do this. [i.e. without SIMBL, GreaseKit or js injection]

    In an earlier post from Aerilius
    Another idea, would a WebView also accept a user stylesheet (that would override the default background in all websites+webdialogs in SketchUp)?


    Yes, Safari does it from the preference menu and I now have it working in SU, but what's the simplest way to share the 'how to'.

    First you need a css file containing the patch code, in a place SU can find. So copy paste this into Ruby Console and hit return.


    Restart SU
    You only need to do this once, and all your input boxes in SU will work correctly [without editing any files]
    If the problem is resolved in the future you can just bin the __inputPatch Folder

    john


    Hi,

    I have the same problem as a lot of others, I guess. Mac OS 10.6.8 + SU Pro 8.0.15157.
    Tried your solution, and it works on DC's, but not on everything...or at least not with Fredo6 Tools, SU Clock etc etc.
    I had the problem with 1001Bit plug but with the upgrade it was fixed.
    Is it that the maker of the plugin does something wrong when writing the code (miss something)?
    After your fix I seem to have no problem with DC's. That helps a lot - THANKS!
    Is there something else to do? Tried your fix many times to make sure I did it right. Think I did.
    Look at the result (pic). Is that "nil" OK?? ...or am I doing something when pasting?

    Do you know if a full upgrade to Mountain Lion helps? Does anyone know?
    Thankful for some help.
    Cheers
    0
    User avatar
    solid-wood 
     

    SketchUcation One-Liner Adverts

    by Ad Machine » 5 minutes ago



    Ad Machine 
    Robot
     

    Next


     

    Return to SketchUp Bug Reporting

    Who is online

    Users browsing this forum: Katshaguy and 2 guests

    Visit our sponsors: