Christoph Droste wrote:
> Hello developer of Exhibit,
>
> first of all I have to state, that Exhibit is a great tool and has become a
> mature tool in version 2.0.
> Nevertheless I have difficulies in using the colspan attribute for table data
> elements. Trying
> the following lens div does render correctly in FireFox but fails in IE 7.
> The td with class="Filler" only does provide space to indent the following
> td. It is necessary to be able
> to give the first line in the next td a negativ text-indent and therefore
> left shift the first word:
>
> <div class="item" ex:role="lens" ex:itemTypes="Feature" >
> <table cellpadding="1" width="100%" >
> <tr valign="middle">
> <td class="image" width="1px" >
> <a target="DataFrame"
> ex:id-content=".label"
> ex:href-content=".label" >
> <img src="../../images/map.gif" />
> </a>
> </td>
> <td>
> <table>
> <tr>
> <td colspan="2">
> <div>Fläche: <span
> ex:content=".Flaeche"></span> m²</div>
> </td>
> </tr>
> <tr>
> <td class="Filler"></td>
> <td>
> <div class="indented">
> <span >
> <span
> class="ListDescriptor">Person: </span>
> <span ex:content=".person"></span>
> </span>
> <div>
> <div class="indented">
> <span
> class="ListDescriptor">Buchungsblätter:</span>
> <span
> ex:content=".Buchungsblaetter"></span>
> </div>
> <!-- div ex:control="item-link"></div>
> -->
> <td>
> </tr>
> <tr>
> <td colspan="2">
> <img class="Printline" src="button.gif"
> /> <a target="DataFrame" ex:id-content=".label"
> ex:href-content=".label">printer</a>
> </td>
> </tr>
> </table>
> </td>
> </tr>
> </table>
> </div>
>
> When looking at the generated HTML code produced by the scissors tool the
> colspans are swallowed.
> I monitored the function Exhibit.Lens._processTemplateElement and found that
> in IE 7 it doesn|t pass
> colspan attributes. At the end of this funciton I read that "IE swallows
> style and event handler
> attributes of HTML elements". Perhabs this is also true for the colspan
> elements.
>
> Can you give me any hints how to procede?
>
You're in the right place... I'd suggest overriding
Exhibit.Lens._processTemplateAttribute
by inserting your own code after you include exhibit-api.js.
<script>
Exhibit.Lens._processTemplateAttribute = function(uiContext,
templateNode, settings, name, value) {
if (...) {
...
}
if (...) {
...
} else if (...) {
...
} else {
if (name == "style") {
...
} else if (name != "id") {
if ...
...
} else if (name == "colspan") {
name = "colSpan";
}
...
}
}
}
</script>
Note the capitalization of "s" in colspan.
We'll move this fix into the API. But see if it works for you now.
David
_______________________________________________
General mailing list
[email protected]
http://simile.mit.edu/mailman/listinfo/general