ldapsaisie/trunk/includes/js/LSformElement_xmpp.js
Benjamin Renard 2e67cd7361 - LSformElement_mail & LSformElement_rss & LSformElement_xmpp :
-> Correction d'erreurs d'affichage
- LSformElement_mail.js & LSformElement_xmpp.js :
	-> Correction d'erreurs de comportement au clique sur les boutons
2008-08-04 10:45:42 +00:00

35 lines
994 B
JavaScript

var LSformElement_xmpp = new Class({
initialize: function(){
this.initialiseLSformElement_xmpp();
if (typeof(varLSform) != "undefined") {
varLSform.addModule("LSformElement_xmpp",this);
}
},
initialiseLSformElement_xmpp: function(el) {
if (typeof(el) == 'undefined') {
el = document;
}
el.getElements('img.LSformElement_xmpp_btn').each(function(btn) {
btn.addEvent('click',this.onBtnClick.bind(this,btn));
}, this);
},
reinitialize: function(el) {
this.initialiseLSformElement_xmpp(el);
},
onBtnClick: function(btn) {
var href = btn.getParent().getFirst().href;
if (typeof(href)=="undefined") {
href = 'xmpp:'+btn.getParent().getFirst().value;
}
if ((href!="")&&(href!="xmpp:")) {
location.href = href;
}
}
});
window.addEvent(window.ie ? 'load' : 'domready', function() {
varLSformElement_xmpp = new LSformElement_xmpp();
});