diff --git a/trunk/includes/class/class.LSformElement_boolean.php b/trunk/includes/class/class.LSformElement_boolean.php index ec2771b0..af80c6a6 100644 --- a/trunk/includes/class/class.LSformElement_boolean.php +++ b/trunk/includes/class/class.LSformElement_boolean.php @@ -45,14 +45,15 @@ class LSformElement_boolean extends LSformElement { if (!$this -> isFreeze()) { $return['html'] = "\n"; + $GLOBALS['LSsession'] -> addJSscript('LSformElement_boolean.js'); } else { $return['html'] = "\n"; @@ -63,7 +63,7 @@ class LSformElement_mail extends LSformElement { } else { foreach ($this -> values as $value) { - $return['html'] .= "
  • ".$value.""._(
  • \n"; + $return['html'] .= "
  • ".$value."
  • \n"; } } $return['html'] .= "\n"; @@ -84,7 +84,7 @@ class LSformElement_mail extends LSformElement { */ function getEmptyField() { $multiple = $this -> getMultipleData(); - return ""._(".$multiple; + return "".$multiple; } } diff --git a/trunk/includes/class/class.LSformElement_rss.php b/trunk/includes/class/class.LSformElement_rss.php index f5c5e73c..53152992 100644 --- a/trunk/includes/class/class.LSformElement_rss.php +++ b/trunk/includes/class/class.LSformElement_rss.php @@ -51,7 +51,7 @@ class LSformElement_rss extends LSformElement { foreach ($this -> values as $value) { $multiple = $this -> getMultipleData(); $id = "LSform_".$this -> name."_".rand(); - $return['html'] .= "
  • "._(".$multiple."
  • \n"; + $return['html'] .= "
  • $multiple
  • \n"; } } $return['html'] .= "\n"; @@ -64,7 +64,7 @@ class LSformElement_rss extends LSformElement { } else { foreach ($this -> values as $value) { - $return['html'] .= "
  • ".$value.""._(
  • \n"; + $return['html'] .= "
  • ".$value."
  • \n"; $GLOBALS['LSsession'] -> addJSscript('LSformElement_rss.js'); } } @@ -80,7 +80,7 @@ class LSformElement_rss extends LSformElement { */ function getEmptyField() { $multiple = $this -> getMultipleData(); - return ""._(".$multiple; + return "".$multiple; } } diff --git a/trunk/includes/class/class.LSformElement_select.php b/trunk/includes/class/class.LSformElement_select.php index fc5997da..a71d34a5 100644 --- a/trunk/includes/class/class.LSformElement_select.php +++ b/trunk/includes/class/class.LSformElement_select.php @@ -61,6 +61,7 @@ class LSformElement_select extends LSformElement { $return['html'].="\n"; } $return['html'].="\n"; + $GLOBALS['LSsession'] -> addJSscript('LSformElement_select.js'); } else { $return['html']="\n"; @@ -64,7 +64,7 @@ class LSformElement_xmpp extends LSformElement { } else { foreach ($this -> values as $value) { - $return['html'] .= "
  • ".$value.""._(
  • \n"; + $return['html'] .= "
  • ".$value."
  • \n"; $GLOBALS['LSsession'] -> addJSscript('LSformElement_xmpp.js'); } } @@ -80,7 +80,7 @@ class LSformElement_xmpp extends LSformElement { */ function getEmptyField() { $multiple = $this -> getMultipleData(); - return ""._(".$multiple; + return "".$multiple; } } diff --git a/trunk/includes/js/LSformElement_boolean.js b/trunk/includes/js/LSformElement_boolean.js new file mode 100644 index 00000000..6bd68cec --- /dev/null +++ b/trunk/includes/js/LSformElement_boolean.js @@ -0,0 +1,30 @@ +var LSformElement_boolean = new Class({ + initialize: function(){ + this.initialiseLSformElement_boolean(); + }, + + initialiseLSformElement_boolean: function() { + $$('li.LSformElement_boolean').each(function(el) { + var btn = new Element('img'); + btn.setProperties({ + src: 'templates/images/clear.png', + alt: 'Reset', + title: 'Reset' + }); + btn.addClass('btn'); + btn.setStyle('vertical-align','top'); + btn.addEvent('click',this.onClearBtnClick.bind(this,btn)); + btn.injectInside(el); + }, this); + }, + + onClearBtnClick: function(btn) { + var li = btn.getParent(); + li.getElements('input').each(function(input) { + input.checked=false; + },this); + } +}); +window.addEvent(window.ie ? 'load' : 'domready', function() { + varLSformElement_boolean = new LSformElement_boolean(); +}); diff --git a/trunk/includes/js/LSformElement_mail.js b/trunk/includes/js/LSformElement_mail.js index e0f3607e..b3d797a4 100644 --- a/trunk/includes/js/LSformElement_mail.js +++ b/trunk/includes/js/LSformElement_mail.js @@ -11,9 +11,24 @@ var LSformElement_mail = new Class({ if (typeof(el) == 'undefined') { el = document; } - el.getElements('img.LSformElement_mail_btn').each(function(btn) { - btn.addEvent('click',this.onBtnClick.bind(this,btn)); + el.getElements('input.LSformElement_mail').each(function(input) { + this.addBtnAfter.bind(this)(input); }, this); + el.getElements('a.LSformElement_mail').each(function(a) { + this.addBtnAfter.bind(this)(a); + }, this); + }, + + addBtnAfter: function(el) { + var btn = new Element('img'); + btn.setProperties({ + src: 'templates/images/mail.png', + alt: 'Envoyer un mail', + title: 'Envoyer un mail' + }); + btn.addClass('btn'); + btn.injectAfter(el); + btn.addEvent('click',this.onBtnClick.bind(this,btn)); }, reinitialize: function(el) { diff --git a/trunk/includes/js/LSformElement_rss.js b/trunk/includes/js/LSformElement_rss.js index ecab313b..c41df6dd 100644 --- a/trunk/includes/js/LSformElement_rss.js +++ b/trunk/includes/js/LSformElement_rss.js @@ -10,9 +10,24 @@ var LSformElement_rss = new Class({ if (typeof(el) == 'undefined') { el = document; } - el.getElements('img.LSformElement_rss_btn').each(function(btn) { - btn.addEvent('click',this.onBtnClick.bind(this,btn)); + el.getElements('input.LSformElement_rss').each(function(input) { + this.addBtnAfter.bind(this)(input); }, this); + el.getElements('a.LSformElement_rss').each(function(a) { + this.addBtnAfter.bind(this)(a); + }, this); + }, + + addBtnAfter: function(el) { + var btn = new Element('img'); + btn.setProperties({ + src: 'templates/images/rss.png', + alt: 'File RSS', + title: 'File RSS' + }); + btn.addClass('btn'); + btn.injectAfter(el); + btn.addEvent('click',this.onBtnClick.bind(this,btn)); }, reinitialize: function(el) { diff --git a/trunk/includes/js/LSformElement_select.js b/trunk/includes/js/LSformElement_select.js new file mode 100644 index 00000000..a79c318f --- /dev/null +++ b/trunk/includes/js/LSformElement_select.js @@ -0,0 +1,34 @@ +var LSformElement_select = new Class({ + initialize: function(){ + this.initialiseLSformElement_select(); + }, + + initialiseLSformElement_select: function() { + $$('select.LSform').each(function(el) { + var btn = new Element('img'); + btn.setProperties({ + src: 'templates/images/clear.png', + alt: 'Reset', + title: 'Reset' + }); + btn.addClass('btn'); + btn.setStyle('vertical-align','top'); + btn.addEvent('click',this.onClearBtnClick.bind(this,btn)); + btn.injectAfter(el); + }, this); + }, + + onClearBtnClick: function(btn) { + var select = btn.getPrevious(); + this.resetSelect(select); + }, + + resetSelect: function(select) { + for(var i=0;i