Andreas Hartmann schrieb:
> Hi Lenya devs,
>
> Jörn and I wondered if we could replace the <lenya:asset> element
> with a plain link, using for instance a CSS class or an attribute
> from a different namespace to denote that we're dealing with a
> special download link:
>
> <a class="asset" href="lenya-document:...">Foo</a>
> <a lenya:type="asset" href="...
>
> or something like that.
>
> The size and type attributes of the <lenya:asset> element can't
> be used anyway (see
> http://issues.apache.org/bugzilla/show_bug.cgi?id=42878).
>
> I have started to implement the first version in my local sandbox
> (with BXE editing), and up to now it looks quite good.
Well, it did look good in the beginning ...
But BXE contains some hard-coded asset handling in bxeFunctions.js
which we probably have to change:
function bxe_InsertAsset() {
//this code is quite lenya specific....
// especially the unizh: check
var sel = window.getSelection();
if (bxe_checkForSourceMode(sel)) {
return false;
}
var cssr = sel.getEditableRange();
var pN = cssr.startContainer.parentNode;
//FIXME: unizh code should be outsourced...
if ((pN.XMLNode.localName == "highlight-title" &&
pN.XMLNode.namespaceURI == "http://unizh.ch/doctypes/elements/1.0") ||
(pN.XMLNode.localName == "asset" && pN.XMLNode.namespaceURI ==
"http://apache.org/cocoon/lenya/page-envelope/1.0")) {
alert("Asset is not allowed here");
return false;
}
if
(!bxe_checkIsAllowedChild("http://apache.org/cocoon/lenya/page-envelope/1.0","asset",sel,
true) &&
!bxe_checkIsAllowedChildOfNode("http://apache.org/cocoon/lenya/page-envelope/1.0","asset",pN.parentNode,
true)) {
alert ("Asset is not allowed here");
return false;
}
var object =
document.createElementNS("http://apache.org/cocoon/lenya/page-envelope/1.0","asset");
var cb =
bxe_getCallback("asset","http://apache.org/cocoon/lenya/page-envelope/1.0");
-- Andreas
--
Andreas Hartmann, CTO
BeCompany GmbH
http://www.becompany.ch
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]