HighDots Forums  

Re: Google funny

Javascript JavaScript language (comp.lang.javascript)


Discuss Re: Google funny in the Javascript forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Fabian
 
Posts: n/a

Default Re: Google funny - 11-05-2003 , 01:53 PM






Paul Blay hu kiteb:

Quote:
Hmm, maybe I should try again in English. ;-)

A ruby markup such as
ruby><rb>廃棄</rb><rp>(</rp><rt>ハイキ</rt><rp>)</rp></ruby
is 'honoured' by Internet Explorer, but not by Netscape* so in IE you
get furigana.

On browsers that dont support ruby it declines 'gracefully' to 廃棄(ハ
イキ)
(e.g. to word + reading). However if you prefer to see 廃棄 instead
of
廃棄(ハイキ)
for browsers that dont support ruby then a <span
style='display:none'> would hide the reading.

Given that I know of no browser that supports <ruby> but doesn't
support <span style='display:none'> it would be a very stupid thing
to do.
function ShowKanji() {
document.rb.style.display='inline';
document.rp.style.display='none';
document.rt.style.display='none';
}
function ShowFurigana() {
document.rb.style.display='none';
document.rp.style.display='none';
document.rt.style.display='inline';
}

Would these do what i think they would do? Couple those functions with
an appropriate user interface, and you could show the kanji or hiragana
easily.


--
--
Fabian
Visit my website often and for long periods!
http://www.lajzar.co.uk



Reply With Quote
  #2  
Old   
Paul Blay
 
Posts: n/a

Default Re: Google funny - 11-05-2003 , 03:23 PM






"Fabian" wrote ...
Quote:
Paul Blay hu kiteb:

Hmm, maybe I should try again in English. ;-)

A ruby markup such as
ruby><rb>廃棄</rb><rp>(</rp><rt>ハイキ</rt><rp>)</rp></ruby
is 'honoured' by Internet Explorer, but not by Netscape so in IE you
get furigana.

On browsers that dont support ruby it declines 'gracefully' to 廃棄(ハ
イキ) (e.g. to word + reading). However if you prefer to see 廃棄
instead of 廃棄(ハイキ) for browsers that dont support ruby then a
span style='display:none'> would hide the reading.

Given that I know of no browser that supports <ruby> but doesn't
support <span style='display:none'> it would be a very stupid thing
to do.

function ShowKanji() {
document.rb.style.display='inline';
document.rp.style.display='none';
document.rt.style.display='none';
}
function ShowFurigana() {
document.rb.style.display='none';
document.rp.style.display='none';
document.rt.style.display='inline';
}

Would these do what i think they would do?
I compliment you on your bravery in cross-posting to c.l.j ;-)
So here I go risking showing off my ignorance as well.

Assuming that the browser supports the ruby tag then the first
does (but you don't need* the
document.rp.style.display='none';
). However I'm not sure the second does, I'd have to try it and
see. Possibly you'd end up with small furigana text hovering
above the space where the kanji isn't displayed.

I've no idea how it would work on hypothetical browsers that
support javascript and styles but dont support ruby.

Quote:
Couple those functions with
an appropriate user interface, and you could show the kanji or
hiragana easily.
I'm not sure there's that much call for it.

* Because what's in the <rp> tags is not to be displayed by design.


Reply With Quote
  #3  
Old   
Fabian
 
Posts: n/a

Default Re: Google funny - 11-06-2003 , 07:30 PM



Paul Blay hu kiteb:

Quote:
"Fabian" wrote ...
Paul Blay hu kiteb:

Hmm, maybe I should try again in English. ;-)

A ruby markup such as
ruby><rb>廃棄</rb><rp>(</rp><rt>ハイキ</rt><rp>)</rp></ruby
is 'honoured' by Internet Explorer, but not by Netscape so in IE you
get furigana.


function ShowKanji() {
document.rb.style.display='inline';
document.rp.style.display='none';
document.rt.style.display='none';
}
function ShowFurigana() {
document.rb.style.display='none';
document.rp.style.display='none';
document.rt.style.display='inline';
}

Would these do what i think they would do?

I compliment you on your bravery in cross-posting to c.l.j ;-)
So here I go risking showing off my ignorance as well.
Just tested it; it doesn't work. I realise my mistake. That format is
for manipulating tags whose ID attribute has been set, and not for
manipulating tags directly. Anyone know the correct way to manipulate
the style for an entire tag?

Quote:
I've no idea how it would work on hypothetical browsers that
support javascript and styles but dont support ruby.
Assuming the browser has a document object model that allows
manipulation of arbitrary html tags, but doesnt recognise RUBY, the
principle is still sound. manipulating the RP tag is necessary in this
case to avoid having plain hiragana display inside parenthesis.


--
--
Fabian
Visit my website often and for long periods!
http://www.lajzar.co.uk



Reply With Quote
  #4  
Old   
Paul Blay
 
Posts: n/a

Default Re: Google funny - 11-07-2003 , 02:59 AM



"Fabian" wrote ...
Quote:
Just tested it; it doesn't work. I realise my mistake. That format is
for manipulating tags whose ID attribute has been set, and not for
manipulating tags directly. Anyone know the correct way to manipulate
the style for an entire tag?
Lots of people, but obviously I've forgotten.

Quote:
I've no idea how it would work on hypothetical browsers that
support javascript and styles but dont support ruby.

Assuming the browser has a document object model that allows
manipulation of arbitrary html tags,
But are there such browsers? Back when I was actually doing this
stuff I stuck to using tags that existed for the browsers I was
testing with.

Quote:
but doesnt recognise RUBY, the
principle is still sound. manipulating the RP tag is necessary in this
case to avoid having plain hiragana display inside parenthesis.

Reply With Quote
  #5  
Old   
Thomas 'PointedEars' Lahn
 
Posts: n/a

Default Re: Google funny - 11-12-2003 , 08:18 AM



Paul Blay wrote:

Quote:
"Fabian" wrote ...
Just tested it; it doesn't work. I realise my mistake. That format is
for manipulating tags whose ID attribute has been set, and not for
manipulating tags directly. Anyone know the correct way to manipulate
the style for an entire tag?
With the DOM of a UA you do not manipulate tags but elements represented
by objects.

Quote:
Lots of people, but obviously I've forgotten.
In the case Ruby markup (inside XHTML) allows for using the W3C-DOM, you
can access elements by their tag name:

document.getElementsByTagName("...")

returns an array of objects where the respective elements have `...' as tag
name. You need to check if such an object has a `style' property, and if it
has, you can access it.


HTH

PointedEars, F'up2 cljs


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.