[sword-devel] XHTML Filterset

Greg Hellings greg.hellings at gmail.com
Sun Jan 20 08:25:47 MST 2013


On Sun, Jan 20, 2013 at 3:43 AM, Jonathan Morgan <jonmmorgan at gmail.com>wrote:

> Hi Greg,
>
> On Sun, Jan 20, 2013 at 3:52 AM, Greg Hellings <greg.hellings at gmail.com>wrote:
>
>>
>>
>>
>> On Sat, Jan 19, 2013 at 10:28 AM, Troy A. Griffitts <scribe at crosswire.org
>> > wrote:
>>
>>> I've done my part and changed one more tag.  transChange has been
>>> upgraded from:
>>> <i></i>
>>>
>>> to:
>>>
>>> .transChangeSupplied {
>>>       font-style: italic;
>>> }
>>>
>>> <span class="transChangeSupplied"></**span>
>>>
>>> More changes welcome.
>>>
>>> Nic, you mentioned doing similar work on your own copies of our filters.
>>>  Any experience you'd like to share?
>>>
>>> Bibletime, same.  I know you guys have had stuff styled for quite some
>>> time.
>>>
>>
>> BT outputs the following (found on lines 383ff of
>> src/backend/filters/osistohtml.cpp):
>> <span class="transchange"><span class="**type**"> ...... </span></span>
>>
>> where **type** is the value of the type attribute of transChange. If no
>> type attribute is specified, the value of the changeType attribute is used.
>> If the type or changeType attribute of transChange is equal to "added" then
>> the outer span gets a title="Added text" and if it is equal to
>> "tenseChange" it gets a title="Verb tense changed" added to it.
>>
>
> Would you really want a title to be output for this?  It seems very
> specific markup, quite different from the "class based" markup, and also
> raises the questions "How do we change the text displayed for a transChange?
>

I'm thinking we may have gotten our wires crossed in that line. The title
is not instead of the class but in addition to. So a <transChange
type="tenseChange"> is replaced with <span class="transchange" title="Verb
tense changed"><span class="tenseChange">**textual content of
original**</span></span>

So the CSS still works as intended. Granted, you can set CSS selectors on
arbitrary attributes with XPath-inspired syntax if you have a new enough
rendering engine, which both BibleTime and Xiphos have at this time. Based
on the code, I'm guessing this handling was originally limited to only
added and tenseChange and later people just got a little lazy with it and
didn't add in those titles.


>   Or translate it?
>

It's translated the same way every other UI string in BibleTime is
translated.

                    buf.append("<span class=\"transchange\" title=\"");
                    buf.append(QObject::tr("Verb tense
changed").toUtf8().constData());
                    buf.append("\"><span class=\"tenseChange\">");


> Or show it in some other way than a tooltip?"
>

At least in the QtWebKit bindings, you can listen in on mouseover/hover
events and pull out the text of the elements to display it however you want.

Also, to be clear, I wasn't suggesting that this BT code is /the way to
go/, I was just answering Troy's question about how do those frontends
which customize their HTML renderers handle the transChange element by
telling him what the BT code does for the sake of comparison and discussion.

--Greg


>
> Jon
>
>
>>
>> Only some of our styles have CSS associated with the .transchange, but
>> those which do have font-style=italic.
>>
>> Looking at the particular C++ code, I see a very straightforward
>> simplification we could do for it, so I'll probably simplify that logic
>> down.
>>
>> --Greg
>>
>>
>>>
>>> Would ultimately like to get this filter set to something we all can
>>> share and improve.
>>>
>>> Troy
>>>
>>>
>>>
>>> ______________________________**_________________
>>> sword-devel mailing list: sword-devel at crosswire.org
>>> http://www.crosswire.org/**mailman/listinfo/sword-devel<http://www.crosswire.org/mailman/listinfo/sword-devel>
>>> Instructions to unsubscribe/change your settings at above page
>>>
>>
>>
>> _______________________________________________
>> sword-devel mailing list: sword-devel at crosswire.org
>> http://www.crosswire.org/mailman/listinfo/sword-devel
>> Instructions to unsubscribe/change your settings at above page
>>
>
>
> _______________________________________________
> sword-devel mailing list: sword-devel at crosswire.org
> http://www.crosswire.org/mailman/listinfo/sword-devel
> Instructions to unsubscribe/change your settings at above page
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.crosswire.org/pipermail/sword-devel/attachments/20130120/65858274/attachment-0001.html>


More information about the sword-devel mailing list