[kupu-dev] Avoid filtering of specific attribute
Max M
maxm at mxm.dk
Tue Oct 2 18:51:29 CEST 2007
Duncan Booth skrev:
> Max M <maxm at mxm.dk> wrote:
>
>> Duncan Booth skrev:
>>
>>> includeTagAttributes('span', 'dynafield:view')
>>>
>>> But I'm not sure that will work or if the unexpected namespace might
>>> caus
>> e
>>> problems.
>> Turned out that I was close all the time:
>>
>> editor.xhtmlvalid.setTagAttributes(['div','span'],['dynafield:uid','dyn
>> afield:view']); editor.xhtmlvalid.setAttrFilter(['dynafield:uid']);
>> editor.xhtmlvalid.setAttrFilter(['dynafield:view']);
>>
> setTagAttributes overrides the permitted attributes for the tag: so you
> have said that div and span can *only* have your custom attributes.
Hmmm .... yeah well I set it in 'kupuploneinit.js' and if I use
includeTagAttributes I get an error: "this.tagAttributes[tag] has no
properties" Seems that the attrs are not set at the time where I try to
call includeTagAttributes.
>> Det fik det til at køre. I missed the setAttrFilter at first. I
>> thought that would make it actually do filtering on the attribute not
>> allow it.
>
> It does, it makes it filter the attribute instead of ignoring it. The
> default filter function just copies the attribute.
It does not work when I don't do it. But setting the attrfilter like
that, also just copies.
I guess it probably doesn't work because I use setTagAttributes instead
of includeTagAttributes.
--
hilsen/regards Max M, Denmark
http://www.mxm.dk/
IT's Mad Science
More information about the kupu-dev
mailing list