IRC Log Viewer » #firebreath » 2013-04-16

IRC Nick Time (GMT-7) Message
Gabree 00:04 hi, friends) Can you help me? i cant find any information about how to create gui on FB plugin....just few buttons and text line...and no information.)
johannes 00:04 Gabree:
Gabree 00:04 thanks a lot)
reichi 09:04 hmm
maybe you can help me
following problem
Element.prototype.$remove = function () {
if (this.parentNode) {
return this
my jsapiauto object doesn't seem to actually implement that
or well
is that browser-specific?
i am not under control of the page
kylehuff 09:04 reichi: have you looked at the wiki page for invoking methods on the DOM?
reichi 09:04 i am not under control of the page ;)
i just write a standartized plugin
that pages "just use"
kylehuff 09:04 yeah, you don't need control of the page to interact with the DOM
it happens from within the plugin
reichi 09:04 the remote page is doing that
not me
the problem is that
is missing
though Element.prototype is being extended
so javascript later on calls
which throws and undefined is not a function ;)
kylehuff 09:04 okay. so couldn't you implement that method?
reichi 09:04 mmh
that's not the point of prototypes
and that would be basically "hacks" i would have to implement for everyone out there you does that
that's not really the point of protoypes
kylehuff 09:04 well, it sounds to me like the fault of the page for not implement that method on the plugin object, but expecting it to be there. I'm not sure what else you could do, except slap the author of the page with a dead fish.
reichi 09:04 no
you don't understand
i am implementing a plugin
based on a standard
which can be used by "any" page
now pages to use protyping to extend the "Element"
but my npapi plugin doesn't seem to "respect" the protyped methods
or well
it doesn't implement them
taxilian 09:04 reichi: there are two possibilities
1) the object tag may not actually etend element
2) your plugin may need to add $remove to the reserved list
reichi 09:04 hmm
i don't like either of them ;)
can have a 3rd one?
can I
taxilian 09:04 the 2nd option is easy to test
just looking for the call
reichi 09:04 yeah
taxilian 09:04 I don't use it often
reichi 09:04 setReserved
taxilian 09:04 yeah, that one
reichi 09:04 mmh
that's very hackish :/
taxilian 09:04 dude, you're trying to use .prototype to add methods to the element wrapping an npapi plugin and you're complaining about hackish?
reichi 09:04 no
that's the problem
it#s not ME
it's a tv-station
taxilian 09:04 tell 'em this version doesn't support it, then
reichi 09:04 lol
I'm not in the position to do so
taxilian 09:04 I guess they'll figure it out on their own, then
reichi 09:04 well... i guess not
that market is currently almost opera-only
and i assume it works there...
taxilian 09:04 that would rather shock me, to be honest, if that worked anywhere without adding it to reserved
reichi 09:04 how does that whole reserved thing work?
taxilian 09:04 basically any time the browser asks if a given property exists on the plugin it responds "yes!" unless of course you have that property on the reserved list
I think there might be a flag to turn that behavior off
but usually it's convenient so I don't remember offhand
reichi 09:04 bool FB::JSAPIAuto::s_allowDynamicAttributes = true;
taxilian 09:04 yeah, that sounds right
reichi 09:04 mmh
i could set the member to false
and give it a shot
taxilian 09:04 you could
reichi 09:04 but i'll bet my ass something else breaks than
(it always does, right?)
taxilian 09:04 do you ever access the plugin not through the DOM element?
reichi 09:04 hmm
what do you mean with that?
taxilian 09:04 short answer, I think you probably won't have a problem
reichi 09:04 i'll se that in a minute
reichi 09:04 nope
it breaks
taxilian 09:04 what breaks exactly?
reichi 09:04 JavaScript Console: Error: The specified member does not exist: data (undefined:0)
now that may be related to my code actually
taxilian 10:04 it could be a jquery or similar thing
reichi 10:04 well
taxilian 10:04 that's why I enabled dyanamic properties is so that js frameworks that use arbitrary attribute names would work
reichi 10:04 i bascially assigned a data property to my API Object
so that's what dynamic attributes are?
taxilian 10:04 yeah
reichi 10:04 all thos things?
and yeah
taxilian 10:04 object.* where the "*" isn't something that you specifically defiend
reichi 10:04 the code uses jquery
on the page mentioned
they actually always use a $ for their methods
so maybe i'll just check if the method requested starts with a $ sign...
reichi 11:04 taxilian: i do think about using something like " Object.keys("Element.protoype") "
to get a less maintenance-intense solution
any negative thoughts on that?
Object.keys(Element.protoype) :)
taxilian 11:04 not sure I follow
reichi 11:04 well i am thinking about a way
to determine functions add to Element.prototype
and set them reserved
taxilian 11:04 is Element.prototype available in all supported browsers?
we have actually talked about doing that
there was a ticket for it once
but nobody had time to do it
reichi 11:04 for me it is
taxilian 11:04 and I don't
reichi 11:04 i only have one
Object.keys is not
that's for sure
taxilian 11:04 lol. well, you could add something I suppose. you can use Enumerate to get a list of then
reichi 11:04 but afaik Element.prototype is available everywhere
taxilian 11:04 you could certainly try it
reichi 11:04 where would you implement that?
i mean the enumeration
i don't know how "costy" it is
taxilian 11:04 I'd do it on startup
before the onready event, probably
probably what I'd do is inject a js script into the dom that would return an array of properties and then call it
reichi 11:04 injecting is not ap roblem
i can do that on the browser-side
independent of the npapi plugin
(saves some overhead i guess)
ok perfect
taxilian 11:04 you could do it that way; if you do it from the plugin then you can make it automatic
reichi 11:04 thanks for your time and thoughts!
taxilian 11:04 so the page doesn't know about it
doesn't need to know about it
reichi 11:04 i can do the same from the browser-side actually
i am lready doing that
because the standard requires a method which creates the dom-element for you...
(of the npapi plugin)
dougma 19:04 when i'm working on my plugin i like to be in the channel. :)
taxilian 19:04 dougma: thanksf or merging that; I haven't had tmie to look at things lately
been really swamped
and good to see you =]
dougma 19:04 no trouble.
got another good fix to contribute too. :)
taxilian 19:04 yeah?
dougma 19:04 the use of the tribool in PluginCore::isWindowless isn't quite right
comparing to indeterminate returns indeterminate... :/
taxilian 19:04 ahh
I'm not sure I've ever 100% understood the tribool
dougma 19:04 that anti-pattern occurs again in some tribool variant stuff too
taxilian 19:04 come to think of it I'm not 100% sure I wrote that code either
but I welcome the fixes =]
dougma 19:04 i propose getting rid of the tribool variant conversions
taxilian 19:04 why is that?
dougma 19:04 no one could be using them because they don't work right.
and there is the boost::optional variant stuff
or... i could just fix them too. :)
taxilian 19:04 lol. sounds like a reasonable argument =] trying to remember; can you return a boost::optional<bool> and use it to return true, false, or undefined?
dougma 19:04 i will check that
taxilian 19:04 that's bascially the functionality I was going for with that
if it's not hard to fix I think it might be better to keep it… but if it doesn't work as you say then it probably isn't a huge issue either way
dougma 19:04 will just fix... :)
taxilian 19:04 it's nice to be reminded now and again that there are still a few users who fix issues that they find
dougma 19:04 :)
rr 20:04 hey there
taxilian 20:04 hello
rr 20:04 i was downloaded axWrapper sample. but it can not work
after running test.html, there is no answer
taxilian 20:04 does it build?
rr 20:04 no i did
ah.. build first ?
so i can not find plugin.. ?
taxilian 20:04 I really don't understand what you mean
but you need to build it first, yes
rr 20:04 thanks..
taxilian 20:04 I did not write axWrapper and probably can't help much