ldct / rikaikun

Automatically exported from code.google.com/p/rikaikun
0 stars 2 forks source link

Add title support for buttons. #2

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Right now, since webkit doesn't do the hot parsing of button text, they don't 
get translated.  But I can treat them like title text which is probably good 
as well.

I'll have to figure out what to do if an object has both title text and inner 
text that I want to translate.

Original issue reported on code.google.com by melin...@gmail.com on 3 Jan 2010 at 7:02

GoogleCodeExporter commented 9 years ago
It might be related, I noticed that parsing of text-box and input-box values 
does not 
work.

Original comment by derekAthomas@gmail.com on 6 Jan 2010 at 4:16

GoogleCodeExporter commented 9 years ago
I'll look into whether that's possible, and if not will make those title too, 
but if 
there's a lot it would be bad.

The problem is that the webkit method for locating the character at the mouse 
pointer 
is much less robust than mozilla's and so it doesn't do stuff like parse text 
in 
buttons, and maybe not text area/inputs either.

I will test this.

Original comment by melin...@gmail.com on 6 Jan 2010 at 4:22

GoogleCodeExporter commented 9 years ago
Added this bit of code near the end of rikaicontent.js at the end of the // FF3 
section. 
It's a bit ugly and wont do well with long sentences, 
but works for the shorter stuff:

        // chrome ugly half fix
        else if (ev.target.nodeName == 'INPUT' && (ev.target.type == 'text' || ev.target.type == 'submit' || ev.target.type == 'button')) {
            tdata.title = ev.target.value;
        }
        else if (ev.target.nodeName == 'BUTTON') {
            tdata.title = ev.target.innerHTML;
        }

Original comment by ane...@gmail.com on 17 Apr 2011 at 7:20

GoogleCodeExporter commented 9 years ago
This issue was closed by revision r50.

Original comment by melin...@gmail.com on 17 Jan 2012 at 11:54

GoogleCodeExporter commented 9 years ago
Fixed by r50.  This should be better than anen87's ugly fix because it doesn't 
even use title text.  I have a few examples of nodeName=BUTTON working but it 
could be broke in some ways I suppose.

Original comment by melin...@gmail.com on 17 Jan 2012 at 11:55