ldapsaisie/trunk/includes/js/LSformElement_image.js
Benjamin Renard 8d8ede930c - Passage à Mootools v1.2templates/LSrelations.tpl
-> 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)
2008-07-05 20:28:49 +00:00

63 lines
2.2 KiB
JavaScript

var LSformElement_image = new Class({
initialize: function(){
$$('div.LSformElement_image').each(function(el) {
el.addEvent('mouseenter',this.onMouseEnterImage.bind(this));
}, this);
$$('div.LSformElement_image').each(function(el) {
el.addEvent('mouseleave',this.onMouseLeaveImage.bind(this));
}, this);
$$('img.LSformElement_image_action_zoom').each(function(el) {
var getId = /LSformElement_image_action_zoom_(.*)/
var id = getId.exec(el.id)[1];
var img = $('LSformElement_image_' + id);
var src = img.src;
el.addEvent('click',this.zoomImg.bindWithEvent(this,img));
}, this);
$$('img.LSformElement_image_action_delete').each(function(el) {
el.addEvent('click',this.onImageDeleteBtnClick.bind(this,el));
}, this);
},
zoomImg: function(event, img) {
new Event(event).stop();
varLSsmoothbox.hideValidBtn();
varLSsmoothbox.openImg(img.src,{startElement: img});
},
onMouseEnterImage: function() {
$$('ul.LSformElement_image_actions').each(function(el) {
el.setStyle('visibility','visible');
}, this);
},
onMouseLeaveImage: function() {
$$('ul.LSformElement_image_actions').each(function(el) {
el.setStyle('visibility','hidden');
}, this);
},
onImageDeleteBtnClick: function(img) {
$$('form.LSform').each(function(el) {
var input = new Element('input');
input.type = 'hidden';
var getInputId = /LSformElement_image_action_delete_(.*)/
var id = 'LSformElement_image_input_' + getInputId.exec(img.id)[1];
input.name = $(id).name + '_delete';
input.value='delete';
input.injectInside(el);
},this);
var main = img.getParent().getParent().getParent();
var hidder = new Fx.Tween(main,{property: 'opacity',duration:600,onComplete:main.dispose.bind(this)});
hidder.start(1,0);
//img.getParent().getParent().getParent().destroy();
}
});
window.addEvent(window.ie ? 'load' : 'domready', function() {
varLSformElement_image = new LSformElement_image();
});