if (!window.ccs.ugc) {
ccs.ugc = {}; // package declaration
}
if (!window.ccs.ugc) {
ccs.ugc = {}; // package declaration
}
ccs.ugc.path = '/shared/content/ugc_content/';
ccs.ugc.rudejsonpath = ccs.contextPath + "/json/" + ccs.appName + "/" + ccs.languageCode + "/content/ugc_content/report/";
ccs.ugc.RudeReport = function() {
var self;
// constructor function
function constructorFn() {
self = this;
}
// init function called once document is loaded
constructorFn.prototype.init = function() {
}
// init function called once document is loaded
constructorFn.prototype.report = function(oid, submitImage, submitText) {
cambrient.loadFragment(null, ccs.ugc.path + 'report/fragments/rude_report_form', function(template) {
var pars = new Object();
pars["oid"] = oid;
pars["submitImage"] = submitImage;
pars["submitText"] = submitText;
t = cambrient.processTemplate(template , pars);
$("rudeForm_" + oid).innerHTML = "
" +t;
$("rudeForm_" + oid).style.display = "block";
$("rudeSubmitBtn_" + oid).style.display = "block";
});
}
//makes an ajax request to load the html for setting up the UGC
constructorFn.prototype.submitRude = function (theForm, oid) {
$("rudeSubmitBtn_" + oid).style.display = "none";
var pars = new Object();
pars = Form.serializeElements(Form.getElements(theForm), true);
pars["report_referer"] = location.href;
new Ajax.Request(ccs.ugc.rudejsonpath + "report.json",
{
method:'post',
parameters: pars,
onSuccess: function(transport) {
$("rudeForm_" + oid).innerHTML = "