/*
-* © 2009 Luxia SAS. All rights reserved.
-* Contributors
-* — Benoît Pin <pinbe@luxia.fr>
-*
-*
-*
+* 2009 Benoit Pin - MINES ParisTech
+* http://plinn.org
+* Licence GPL
*/
req.send(null);
hideProgressImage();
- if (req.status != 200){
+ if (req.status !== 200){
alert(req.status);
return;
}
var wdgtNode = this.wdgtNode = getCopyOfNode(doc);
slide.appendChild(wdgtNode);
- var descriptions = this.descriptions = new Array();
+ var descriptions = this.descriptions = [];
var divs = wdgtNode.getElementsByTagName('div');
- var d;
- for (var i=0; i<divs.length; i++) {
+ var d, i;
+ for (i=0; i<divs.length; i++) {
d = divs[i];
- if (d.className =='ppt-description') {
+ if (d.className === 'ppt-description') {
descriptions[d.getAttribute('name')] = d;
}
}
fm.onBeforeSubmit = function(fm, evt){return thisCart.onBeforeSubmit(fm, evt);};
fm.onResponseLoad = function(req){return thisCart.loadResponse(req);};
- with (descriptions[itemSelector.value].style) {
- visibility = 'visible';
- display='block';
- }
+ descriptions[itemSelector.value].style.visibility = 'visible';
+ descriptions[itemSelector.value].style.display='block';
this.selectedItem = itemSelector.value;
- addListener(itemSelector, 'change', function(evt){thisCart.selectItem(evt)})
-}
+ addListener(itemSelector, 'change', function(evt){thisCart.selectItem(evt);});
+};
CartWidget.prototype.selectItem = function(evt) {
- with(this.descriptions[this.selectedItem].style) {
- visibility = 'hidden';
- display = 'none'
- }
+ this.descriptions[this.selectedItem].style.visibility = 'hidden';
+ this.descriptions[this.selectedItem].style.display = 'none';
var name = this.itemSelector.value;
- with (this.descriptions[name].style) {
- visibility = 'visible';
- display='block';
- }
+ this.descriptions[name].style.visibility = 'visible';
+ this.descriptions[name].style.display='block';
+
this.selectedItem = name;
};
CartWidget.prototype.onBeforeSubmit = function(fm, evt) {
- if (fm.submitButton.name == 'cancel') {
+ if (fm.submitButton.name === 'cancel') {
this.onCancel();
return 'cancelSubmit';
}
confirm.innerHTML = text;
slide.appendChild(confirm);
- var duration = parseInt(doc.getAttribute('duration')) * 1000;
+ var duration = parseInt(doc.getAttribute('duration'), 10) * 1000;
var thisCart = this;
setTimeout(function(){
CartWidget.prototype.onAfterConfirm = function(){};
-})();
\ No newline at end of file
+}());
\ No newline at end of file