by driven » Wed Apr 02, 2014 1:36 am
thanks dan You need a platform code branch and use element.innerText= on PC.
innerText works on mac, so I'll just change that... can you run show_encoding_issue.rb and see if they show in the dialog... the extra // in your console return confuses me. I had to add more to escape ruby escaping javascript... john
learn from the mistakes of others, you may not live long enough to make them all yourself...
-
driven
- PluginStore Author

-
- Posts: 3034
- Joined: Fri May 01, 2009 11:50 pm
- Name: driven
- Operating system: Mac
- SketchUp version: 2015
- License type: Pro
- SketchUp use: engineering and mechanical design
- Level of SketchUp: Intermediate
by Dan Rathbun » Wed Apr 02, 2014 1:47 am
OK, that latest tweek, after hitting enter: WebDialog_param_encoding_fix3_after_enter.png And the console, after hitting enter: load "test/show_encoding_issue.rb" true return using add_action_callback "lid1,\\u00E9lan \\u52E2\\u3044 Schwung \\u0438\\u043C\\u043F\\u0443\\u043B\\u044C\\u0441" return using get_element_value => \u00E9lan \u52E2\u3044 Schwung \u0438\u043C\u043F\u0443\u043B\u044C\u0441
BTW.. if the WebDialog has focus after hitting ENTER, and I need to use the ALT key (for ALT+PrintScreen to copy the active window image to the clipboard, so I can save it from Paint.NET,) there is a whole bunch of repeated console output, like 15 times while I held the ALT key down.
I'm not here much anymore. But a PM will fire email notifications.
-

Dan Rathbun
- PluginStore Author

-
- Posts: 5051
- Joined: Tue Oct 06, 2009 3:06 am
- Location: Florida, USA
- Name: Dan Rathbun
- Operating system: Windows
- SketchUp version: 2015
- License type: Pro
- SketchUp use: education
- Level of SketchUp: Advanced
by driven » Wed Apr 02, 2014 2:15 am
yeh it works... Dan Rathbun wrote:BTW.. if the WebDialog has focus after hitting ENTER, and I need to use the ALT key (for ALT+PrintScreen to copy the active window image to the clipboard, so I can save it from Paint.NET,) there is a whole bunch of repeated console output, like 15 times while I held the ALT key down.
with this should I just add a screen grab and dump it to desktop? - Code: Select all
@dlg2.write_image(File.join((File.expand_path("~")), "Desktop", "dlg_test.png"))
dlg_test.png what's the PC equiv... EDIT: for completeness I'll add the unmodified pair back into the mix after sleep... thanks again dan john
learn from the mistakes of others, you may not live long enough to make them all yourself...
-
driven
- PluginStore Author

-
- Posts: 3034
- Joined: Fri May 01, 2009 11:50 pm
- Name: driven
- Operating system: Mac
- SketchUp version: 2015
- License type: Pro
- SketchUp use: engineering and mechanical design
- Level of SketchUp: Intermediate
by Dan Rathbun » Wed Apr 02, 2014 4:05 am
driven wrote:... should I just add a screen grab and dump it to desktop?
NO. Replace the onkeydown= with: onkeyup=" if (event.keyCode == 13) { this.value=unicodeLiteral(this.value); trans_L8(); }"Notice that I enclose BOTH the following statements within a "curly block", so that the test only fires when ENTER key is released (after being pressed.) The condition will not even be tested while any key is down, including any modifier key.
I'm not here much anymore. But a PM will fire email notifications.
-

Dan Rathbun
- PluginStore Author

-
- Posts: 5051
- Joined: Tue Oct 06, 2009 3:06 am
- Location: Florida, USA
- Name: Dan Rathbun
- Operating system: Windows
- SketchUp version: 2015
- License type: Pro
- SketchUp use: education
- Level of SketchUp: Advanced
by Dan Rathbun » Wed Apr 02, 2014 4:07 am
FYI: I am one of those who hates programs putting stuff on MY Desktop.
I'm not here much anymore. But a PM will fire email notifications.
-

Dan Rathbun
- PluginStore Author

-
- Posts: 5051
- Joined: Tue Oct 06, 2009 3:06 am
- Location: Florida, USA
- Name: Dan Rathbun
- Operating system: Windows
- SketchUp version: 2015
- License type: Pro
- SketchUp use: education
- Level of SketchUp: Advanced
by driven » Wed Apr 02, 2014 3:35 pm
Dan Rathbun wrote:FYI: I am one of those who hates programs putting stuff on MY Desktop.
so do I so I added it as a button... NEW VERSION... I split the input method to make it function the same in all versions of SU... I can't get the raw code too display in the dialog, so here it is for v2014, the others are similarly wrong... EDIT: made a small adjustment to get 'fixed' to display correctly [puts v p] - Code: Select all
true return using add_action_callback [id,value] "\xE2\x88\x9A\xC2\xA9lan \xC3\x82\xC3\xA3\xC2\xA2\xE2\x80\x9E\xC3\x85\xC3\x91 Schwung \xE2\x80\x93\xE2\x88\x8F\xE2\x80\x93\xC2\xBA\xE2\x80\x93\xC3\xB8\xE2\x80\x94\xC3\x89\xE2\x80\x93\xC2\xAA\xE2\x80\x94\xC3\xA5\xE2\x80\x94\xC3\x85" return using get_element_value => élan 勢い Schwung импульс return using add_action_callback [id,value_fixed] \u00E9lan \u52E2\u3044 Schwung \u0438\u043C\u043F\u0443\u043B\u044C\u0441 return using get_element_value fixed => \u00E9lan \u52E2\u3044 Schwung \u0438\u043C\u043F\u0443\u043B\u044C\u0441
encoding_issue_14.0.4899.png encoding_issue_13.0.4811.png encoding_issue_8.0.16845.png Please test the new script... show_encoding_issue.rb john
learn from the mistakes of others, you may not live long enough to make them all yourself...
-
driven
- PluginStore Author

-
- Posts: 3034
- Joined: Fri May 01, 2009 11:50 pm
- Name: driven
- Operating system: Mac
- SketchUp version: 2015
- License type: Pro
- SketchUp use: engineering and mechanical design
- Level of SketchUp: Intermediate
by TIG » Wed Apr 02, 2014 6:59 pm
Here are my PC results. Win7 IE11. Note how v2014 misses platform ? Only the v8 Russian text seems to have a problem on get_element_value ??
TIG
-

TIG
- Global Moderator
-
- Posts: 20239
- Joined: Mon Nov 12, 2007 7:24 pm
- Location: Northumbria UK
- Name: TIG
- Operating system: Windows
- License type: Pro
- SketchUp use: architecture
- Level of SketchUp: Advanced
by Garry K » Wed Apr 02, 2014 7:02 pm
Here you go. I've got SU 7 Free, SU 8 Free, SU 2013 Trial, SU 2014 Trial
-
Garry K
- Premium Member

-
- Posts: 983
- Joined: Sun Jan 13, 2013 8:34 pm
- Name: Garry Kernan
- Operating system: Windows
- SketchUp version: 2017
- License type: Pro
- SketchUp use: other
- Level of SketchUp: Advanced
-
by Garry K » Wed Apr 02, 2014 7:05 pm
Sorry - missed clicking the button for SU 7
-
Garry K
- Premium Member

-
- Posts: 983
- Joined: Sun Jan 13, 2013 8:34 pm
- Name: Garry Kernan
- Operating system: Windows
- SketchUp version: 2017
- License type: Pro
- SketchUp use: other
- Level of SketchUp: Advanced
-
by driven » Wed Apr 02, 2014 8:31 pm
Thanks Tig and Garry,
from your images it appears that v8 had an issue with the standard call but shows correctly if SU is handed a Unicode charset string with it's separators gsub'd.
The ongoing v2014 (PC) handles both standard or 'fixed', where my mac's fail.
I'll write up a bug report for this, and at least I can now carry on with my language translator...
The only conditions, in this script, are for the 'extra' system info, which I won't need...
@garry, if you click into the text field, then hit return and then click the button, you'll see the default results as well...
I had to split them onto Two buttons for v8 to use the same code as the others...
john
learn from the mistakes of others, you may not live long enough to make them all yourself...
-
driven
- PluginStore Author

-
- Posts: 3034
- Joined: Fri May 01, 2009 11:50 pm
- Name: driven
- Operating system: Mac
- SketchUp version: 2015
- License type: Pro
- SketchUp use: engineering and mechanical design
- Level of SketchUp: Intermediate
by fredo6 » Wed Apr 02, 2014 11:30 pm
Here are my results on SU14, Windows 7 64-bits, IE11 1) When starting SketchupDriven encoding UTF - Fredo - 0.png 2) After putting the focus in the field and typing EnterDriven encoding UTF - Fredo.png Fredo
-

fredo6
- Premium Member

-
- Posts: 4778
- Joined: Mon Nov 12, 2007 9:07 pm
- Location: France
- Name: Fredo6
- Operating system: Windows
- License type: Pro
- SketchUp use: interior design
- Level of SketchUp: Intermediate
by driven » Wed Apr 02, 2014 11:43 pm
Thanks Fredo, I updated the script since then to shows both the default and fixed returns... the default shows with the return from the input box and the button shows the 'fix' i.e. Unicode literals with separators fixed... on the PC it appears v8 may have an issue with the 'default' return for 'get_element_value' some of these chars, and mac has issues on all versions, but the Unicode literals appear to work on all, so far... Thanks for taking the time. john show_encoding_issue_1404022050.rbz
learn from the mistakes of others, you may not live long enough to make them all yourself...
-
driven
- PluginStore Author

-
- Posts: 3034
- Joined: Fri May 01, 2009 11:50 pm
- Name: driven
- Operating system: Mac
- SketchUp version: 2015
- License type: Pro
- SketchUp use: engineering and mechanical design
- Level of SketchUp: Intermediate
by fredo6 » Thu Apr 03, 2014 7:31 am
Driven, Here is the result with the updated script 1) Initial stateEncoding issue before.png 2) After hitting the buttonEncoding issue after Enter in the field.png Fredo
-

fredo6
- Premium Member

-
- Posts: 4778
- Joined: Mon Nov 12, 2007 9:07 pm
- Location: France
- Name: Fredo6
- Operating system: Windows
- License type: Pro
- SketchUp use: interior design
- Level of SketchUp: Intermediate
by greatoe » Fri Apr 04, 2014 5:50 pm
Sketchup 2014 Mac 10.9.2 testing text in Simplified Chinese encoding_issue_14.0.4899.png
-
greatoe
-
- Posts: 59
- Joined: Sun Aug 24, 2008 7:15 pm
- Operating system: Mac
- SketchUp version: 2019
- License type: Pro
- SketchUp use: interior design
- Level of SketchUp: Advanced
by Ad Machine » 5 minutes ago
-
Ad Machine
- Robot
-
- Posts: 2012
-
Return to Developers' Forum
|