So I e-mailed the author of ARC directly (he responded the same day) and he provided the following info on modding his widget to support onClick functionality.
Sorry I haven't replied. I don't monitor that thread much any more.
The answer, is yes. It would be a very small modification.
Off the top of my head it would be something like the following;
/*-- pseudo javascript --*/
var originalOnclick = label.onclick;
label.onclick = function(){
/* do whatever the onclick was being replaced with here */
/* and call the original click function */
originalClick();
}
If I was to do this all again, now being older and wiser, I'd be attaching events using something like prototype's addEventListener, rather than on the onclick directly.
Hope that helps. I'll consider rewriting this using as a prototype class again shortly.
So I modified mainjs.js around line 342 from this;
- Code: Select all
//when the label is clicked, call toggleLabelStyle and toggle the label
inputs[i].label.onclick = function (){ toggleLabelStyle(formId, this, onClassRadio, offClassRadio);
return false;
};
To This;
- Code: Select all
//when the label is clicked, call toggleLabelStyle and toggle the label
if(inputs[i].label.onclick){
var originalOnclick = inputs[i].label.onclick;
inputs[i].label.onclick = function (){ toggleLabelStyle(formId, this, onClassRadio, offClassRadio);
originalOnclick();
return false;
};
}else{
inputs[i].label.onclick = function (){ toggleLabelStyle(formId, this, onClassRadio, offClassRadio);
return false;
};
}
I did some basic testing and didn't find any issues with it, it works without producing errors if the onclick function is set or ignored. Could a developer take a look at the code and consider adding it to the main code.
It should probably be repeated for checkboxes as well, currently the code above only modifys radio buttons.
-Vlorn
-Vlorn