mirror of
https://gitlab.easter-eggs.com/ee/ldapsaisie.git
synced 2024-12-23 17:03:47 +01:00
8d8ede930c
-> config.inc.php : - Deux fichiers js à include au lieu d'un seul - Suppression du Debugger (Debugger.js incompatible) - LSformElement_image : refonte de l'affichage - Templates : - LSview-action : Passage aux balises ul/li plutôt que p/a - select.tpl : correction d'un bug concernant la sélection du subDn actif - Création de LSconfirmBox : module de confirmation - JS : -> LSform.js : Modularisation du code : - LSformElement_select_object.js - LSformElement_image.js - LSformElement_password.js - CSS : -> Modularisation : - LSselect.css - LSrelation.css - LSrelation : -> Refonte du mécanisme JS -> Modification de l'affichage -> Ajout d'une confirmation à la suppresion (LSconfirmBox) - LSsmoothbox : Refonte profonde - view.php : - Correction d'un bug : la colone action était vide lors de la mise en cache par LSselect. - LSldapObject : - getDisplayValue() : ajout d'une possibilité de l'affichage du subDn en plus du nom - LSsession : ajout d'un méthode haveSubDn() - JS : - Modularisation de la verification d'une requete Ajax -> LSdefault : nouvelles méthodes : -> checkAjaxReturn() : Pour les retours JSON -> ajaxDisplayDebugAndError() : Pour les retours HTML (Type LSselect)
80 lines
3 KiB
JavaScript
80 lines
3 KiB
JavaScript
var LSformElement_select_object = new Class({
|
|
initialize: function(){
|
|
this.initialiseLSformElement_select_object();
|
|
},
|
|
|
|
initialiseLSformElement_select_object: function() {
|
|
$$('a.LSformElement_select_object_addBtn').each(function(el) {
|
|
el.addEvent('click',this.onLSformElement_select_object_addBtnClick.bindWithEvent(this,el));
|
|
}, this);
|
|
|
|
$$('img.LSformElement_select_object_deleteBtn').each(function(el) {
|
|
el.addEvent('click',this.LSformElement_select_object_deleteBtn.bind(this,el));
|
|
}, this);
|
|
},
|
|
|
|
onLSformElement_select_object_addBtnClick: function(event,a) {
|
|
new Event(event).stop();
|
|
var getFieldId = /a_(.*)/
|
|
var fieldId = getFieldId.exec(a.id)[1];
|
|
var getId = /a_LSformElement_select_object_.*_([0-9]*)$/
|
|
var Id = getId.exec(a.id)[1];
|
|
|
|
values = new Array();
|
|
$$('input.LSformElement_select_object').each(function(el) {
|
|
values.push(el.getProperty('value'));
|
|
}, this);
|
|
|
|
var data = {
|
|
template: 'LSselect',
|
|
action: 'refreshSession',
|
|
objecttype: $('LSformElement_select_object_objecttype_'+Id).value,
|
|
values: JSON.encode(values),
|
|
href: a.href
|
|
};
|
|
|
|
data.imgload=varLSdefault.loadingImgDisplay(a,'inside');
|
|
this.refreshFields=fieldId;
|
|
new Request({url: 'index_ajax.php', data: data, onSuccess: this.onLSformElement_select_object_addBtnClickComplete.bind(this)}).send();
|
|
},
|
|
|
|
onLSformElement_select_object_addBtnClickComplete: function(responseText, responseXML) {
|
|
var data = JSON.decode(responseText);
|
|
if ( varLSdefault.checkAjaxReturn(data) ) {
|
|
varLSsmoothbox.setRefreshElement(this);
|
|
varLSsmoothbox.displayValidBtn();
|
|
varLSsmoothbox.openURL(data.href,{width: 615});
|
|
}
|
|
},
|
|
|
|
refresh: function() {
|
|
var getAttrName = /LSformElement_select_object_(.*)_[0-9]*/
|
|
var attrName = getAttrName.exec(this.refreshFields)[1];
|
|
var data = {
|
|
template: 'LSform',
|
|
action: 'refreshField',
|
|
attribute: attrName,
|
|
objecttype: $('LSform_objecttype').value,
|
|
objectdn: $('LSform_objectdn').value,
|
|
idform: $('LSform_idform').value,
|
|
ul: this.refreshFields
|
|
};
|
|
data.imgload=varLSdefault.loadingImgDisplay($('a_' + this.refreshFields));
|
|
new Request({url: 'index_ajax.php', data: data, onSuccess: this.onRefreshComplete.bind(this)}).send();
|
|
},
|
|
|
|
onRefreshComplete: function(responseText, responseXML) {
|
|
var data = JSON.decode(responseText);
|
|
if ( varLSdefault.checkAjaxReturn(data) ) {
|
|
$(this.refreshFields).getParent().set('html',data.html);
|
|
this.initialiseLSformElement_select_object();
|
|
}
|
|
},
|
|
|
|
LSformElement_select_object_deleteBtn: function(img) {
|
|
img.getParent().destroy();
|
|
}
|
|
});
|
|
window.addEvent(window.ie ? 'load' : 'domready', function() {
|
|
varLSformElement_select_object = new LSformElement_select_object();
|
|
});
|