mirror of
https://gitlab.easter-eggs.com/ee/ldapsaisie.git
synced 2024-11-14 22:43:02 +01:00
ab7120b589
-> Redimentionnement des dt pour laisser plus de place aux labels - LSformElement_boolean, LSformElement_select : Ajout d'un bouton clear - L'ajout des boutons javascript a été déporté dans le code javascript : -> LSformElement_url -> LSformElement_mail -> LSformElement_rss -> LSformElement_xmp - LSformElement_select_object -> Activation du champ de formulaire directement dans le javascript
49 lines
1.4 KiB
JavaScript
49 lines
1.4 KiB
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('input.LSformElement_xmpp').each(function(input) {
|
|
this.addBtnAfter.bind(this)(input);
|
|
}, this);
|
|
el.getElements('a.LSformElement_xmpp').each(function(a) {
|
|
this.addBtnAfter.bind(this)(a);
|
|
}, this);
|
|
},
|
|
|
|
addBtnAfter: function(el) {
|
|
var btn = new Element('img');
|
|
btn.setProperties({
|
|
src: 'templates/images/xmpp.png',
|
|
alt: 'Chat',
|
|
title: 'Chat'
|
|
});
|
|
btn.addClass('btn');
|
|
btn.injectAfter(el);
|
|
btn.addEvent('click',this.onBtnClick.bind(this,btn));
|
|
},
|
|
|
|
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();
|
|
});
|