Judah Raine
Total posts: 332
24 Sep 2013 05:55

Hi there, I've discovered that the following happens:

1) The submit button doesn't post the comment although the comment appears after refresh

2) When the comment appears, it posts twice

On disabling the plugin both of these issues disappear.

Thanks,

Jude

Last Modified: 02 Mar 2014


Sergey
Total posts: 13,748
25 Sep 2013 06:20

The submit button doesn't post the comment

Submit button where? In profile? on the wall? in Cobalt?


Judah Raine
Total posts: 332
25 Sep 2013 10:18

The submit button in jomsocial discussion


Sergey
Total posts: 13,748
26 Sep 2013 01:19

Can you make screenshot?


Judah Raine
Total posts: 332
26 Sep 2013 03:44

I've attached the screenshot as requested. It's when we click on the add comment button that nothing happens, but when I do Ctrl F5 the comment appears. It's no longer duplicated though.


Sergey
Total posts: 13,748
27 Sep 2013 05:56

How does that relate to Cobalt?


Judah Raine
Total posts: 332
27 Sep 2013 06:05

I'm not sure. When I disable the Cobalt plugin, the problem disappears, i.e. The add comment button clicks through and the comment displays without having to refresh.


Sergey
Total posts: 13,748
27 Sep 2013 06:12

May be this is javascript error. What console is saying?


Judah Raine
Total posts: 332
27 Sep 2013 06:45

I've attached a screen print for you.


Judah Raine
Total posts: 332
27 Sep 2013 06:51

The rest of this image is:

and the error message is:

function Jax(){var loadingTimeout=400;var iframe;this.loadingFunction=function(){};this.doneLoadingFunction=function(){};this.cacheData=new Array();this.stringify=function(arg){var c,i,l,o,u,v;switch(typeof arg){case"object":if(arg){if(arg.constructor==Array){o="";for(i=0;i<arg.length;++i){v=this.stringify(arg[i]);if(o&&(v!==u)){o+=","}if(v!==u){o+=v}}return"["+o+"]"}else{if(typeof arg.toString!="undefined"){o="";for(i in arg){v=this.stringify(arg[i]);if(v!==u){if(o){o+=","}o+=this.stringify(i)+":"+v}}return"{"+o+"}"}else{return}}}return"";case"unknown":case"undefined":case"function":return u;case"string":arg=arg.replace(/"/g,'\"');l=arg.length;o='"';for(i=0;i<l;i+=1){c=arg.charAt(i);if(c>=" "){if(c=="\"||c=='"'){o+="\"}o+=c}else{switch(c){case'"':o+='\"';break;case"\b":o+="\b";break;case"\f":o+="\f";break;case"\n":o+="\n";break;case"\r":o+="\r";break;case"\t":o+="\t";break;default:c=c.charCodeAt();o+="\u00";o+=Math.floor(c/16).toString(16);o+=(c%16).toString(16)}}}return o+'"';default:return String(arg)}};this.getRequestObject=function(){if(window.XMLHttpRequest){http_request=new XMLHttpRequest()}else{if(window.ActiveXObject){var msxmlhttp=new Array("Msxml2.XMLHTTP.4.0","Msxml2.XMLHTTP.3.0","Msxml2.XMLHTTP","Microsoft.XMLHTTP");for(var i=0;i<msxmlhttp.length;i++){try{http_request=new ActiveXObject(msxmlhttp[i])}catch(e){http_request=null}}}}if(!http_request){alert("Unfortunatelly you browser doesn't support this feature.");return false}return http_request};this.$=function(sId){if(!sId){return null}var returnObj=document.getElementById(sId);if(!returnObj&&document.all){returnObj=document.all[sId]}return returnObj};this.addEvent=function(obj,type,fn){if(obj.attachEvent){obj["e"+type+fn]=fn;obj[type+fn]=function(){obj"e"+type+fn};obj.attachEvent("on"+type,obj[type+fn])}else{obj.addEventListener(type,fn,false)}};this.removeEvent=function(obj,type,fn){if(obj.detachEvent){obj.detachEvent("on"+type,obj[type+fn]);obj[type+fn]=null}else{obj.removeEventListener(type,fn,false)}};this.submitITask=function(comName,func,postData,responseFunc){var xmlReq=this.buildXmlReq(comName,func,postData,responseFunc,true);this.loadingFunction();if(!this.iframe){this.iframe=document.createElement("iframe");this.iframe.setAttribute("id","ajaxIframe");this.iframe.setAttribute("height",0);this.iframe.setAttribute("width",0);this.iframe.setAttribute("border",0);this.iframe.style.visibility="hidden";document.body.appendChild(this.iframe);this.iframe.src=xmlReq}else{this.iframe.src=xmlReq}};this.extractIFrameBody=function(iFrameEl){var doc=null;if(iFrameEl.contentDocument){doc=iFrameEl.contentDocument}else{if(iFrameEl.contentWindow){doc=iFrameEl.contentWindow.document}else{if(iFrameEl.document){doc=iFrameEl.document}else{alert("Error: could not find sumiFrame document");return null}}}return doc.body};this.buildXmlReq=function(comName,func,postData,responseFunc,iframe){var xmlReq="";if(iframe){xmlReq+="?"}else{xmlReq+="&"}xmlReq+="option="+comName;xmlReq+="&no_html=1";xmlReq+="&task=azrul_ajax";xmlReq+="&func="+func;xmlReq+="&"+jax_token_var+"=1";if(postData){xmlReq+="&"+postData}return xmlReq};this.submitTask=function(comName,func,postData,responseFunc,cacheKey){var xmlhttp=this.getRequestObject();var targetUrl=jax_live_site;var responseLength=0;var lastResponseLength=0;var lastResponse="";if(cacheKey){xmlhttp.cachekey=cacheKey}xmlhttp.open("POST",targetUrl,true);xmlhttp.onreadystatechange=function(){if(xmlhttp.readyState==4){if(xmlhttp.status==200){jax.doneLoadingFunction();var text=xmlhttp.responseText;if(text!==undefined&&text!==null){if(text.length>0){text=text.substr(responseLength-lastResponseLength);responseLength=xmlhttp.responseText.length;if(lastResponse!=text){jax.processResponse(text)}lastResponse=text}}else{lastResponseLength=0}if(xmlhttp.cachekey){jax.cacheData[xmlhttp.cachekey]=text}}else{}}else{if(xmlhttp.status==200&&xmlhttp.readyState==3){var text=xmlhttp.responseText;var validresponse=true;try{if(text!==undefined&&text!==null){if(text.length>0){text=text.substr(responseLength,text.length-responseLength);eval(text);responseLength=xmlhttp.responseText.length;lastResponseLength=text.length;if(lastResponse!=text){jax.processResponse(text)}lastResponse=text}}}catch(e){}}}};var id=1;var xmlReq=this.buildXmlReq(comName,func,postData,responseFunc);this.loadingFunction();xmlhttp.setRequestHeader("Content-Type","application/x-www-form-urlencoded");xmlhttp.send(xmlReq)};this.processIResponse=function(){jax.doneLoadingFunction();var resp=(this.extractIFrameBody(this.iframe).innerHTML);resp=resp.replace(/</g,"<");resp=resp.replace(/>/g,">");resp=resp.replace(/&/g,"&");resp=resp.replace(/"/g,'"');resp=resp.replace(/'/g,"'");this.processResponse(resp)};this.BetterInnerHTML=function(o,p,q){function r(a){var b;if(typeof DOMParser!="undefined"){b=(new DOMParser()).parseFromString(a,"application/xml")}else{var c=["MSXML2.DOMDocument","MSXML.DOMDocument","Microsoft.XMLDOM"];for(var i=0;i<c.len...rm":this.remove(id);break;case"cs":var scr=id+"(";if(this.isArray(data)){scr+="(data[0])";for(var l=1;l<data.length;l++){scr+=",(data["+l+"])"}}else{scr+="data"}scr+=");";eval(scr);break;default:alert("Unknow command: "+cmd)}}};this.isArray=function(obj){if(obj){return obj.constructor==Array}return false};this.buildCall=function(comName,sFunction){};this.icall=function(comName,sFunction){var arg="";if(arguments.length>2){for(var i=2;i<arguments.length;i++){var a=arguments[i];if(this.isArray(a)){arg+="arg"+i+"="+this.stringify(a)+"&"}else{if(typeof a=="string"){var t=new Array("d",encodeURIComponent(a));arg+="arg"+i+"="+this.stringify(t)+"&"}else{var t=new Array("d",encodeURIComponent(a));arg+="arg"+i+"="+this.stringify(t)+"&"}}}}this.submitITask(comName,sFunction,arg)};this.universalHash=function(s,tableSize){var b=27183,h=0,a=31415;if(tableSize>1){for(i=0;i<s.length;i++){var t=(s[i])?s[i]:s.charAt(i);h=(ah+t.charCodeAt())%tableSize;a=((a%tableSize)(b%tableSize))%(tableSize)}}return h};this.cacheCall=function(comName,sFunction){var arg=this.buildArgs(arguments);var key=this.universalHash(comName+"-"+sFunction+"-"+arg,8048);if(key in this.cacheData){this.processResponse(this.cacheData[key]);return}this.submitTask(comName,sFunction,arg,null,key)};this.call=function(comName,sFunction){var arg="";arg=this.buildArgs(arguments);this.submitTask(comName,sFunction,arg)};this.buildArgs=function(arguments){var arg="";if(arguments.length>2){for(var i=2;i<arguments.length;i++){var a=arguments[i];if(this.isArray(a)){arg+="arg"+i+"="+this.stringify(a)+"&"}else{if(typeof a=="string"){a=a.replace(/"/g,""");var t=new Array("d",encodeURIComponent(a));arg+="arg"+i+"="+this.stringify(t)+"&"}else{var t=new Array("d",encodeURIComponent(a));arg+="arg"+i+"="+this.stringify(t)+"&"}}}}return arg};this.create=function(sParentId,sTag,sId){var objParent=this.$(sParentId);objElement=document.createElement(sTag);objElement.setAttribute("id",sId);if(objParent){objParent.appendChild(objElement)}};this.remove=function(sId){objElement=this.$(sId);if(objElement&&objElement.parentNode&&objElement.parentNode.removeChild){objElement.parentNode.removeChild(objElement)}};this.getFormValues=function(frm){var objForm;objForm=this.$(frm);if(!Array.prototype.indexOf){Array.prototype.indexOf=function(elt){var len=this.length;var from=Number(arguments[1])||0;from=(from<0)?Math.ceil(from):Math.floor(from);if(from<0){from+=len}for(;from<len;from++){if(from in this&&this[from]===elt){return from}}return -1}}var postData=new Array();if(objForm&&objForm.tagName=="FORM"){var formElements=objForm.elements;var assCheckbox=new Array();var assCntIdx=0;var arrayHiddenValues=new Array();var arrayHiddenCount=0;if(formElements.length>0){for(var i=0;i<formElements.length;i++){if(!formElements[i].name){continue}if(formElements[i].type&&(formElements[i].type=="radio"||formElements[i].type=="checkbox")&&formElements[i].checked==false){continue}var name=formElements[i].name;if(name){if(formElements[i].type=="select-multiple"){postData[i]=new Array();for(var j=0;j<formElements[i].length;j++){if(formElements[i].options[j].selected===true){var value=formElements[i].options[j].value;postData[i][j]=new Array(name,encodeURIComponent(value))}}}else{if(formElements[i].type=="checkbox"){if(assCheckbox.indexOf(formElements[i].name)==-1){assCheckbox[assCntIdx]=formElements[i].name;assCntIdx++}}else{if(formElements[i].type=="hidden"){if(arrayHiddenValues.indexOf(formElements[i].name)==-1){arrayHiddenValues[arrayHiddenCount]=formElements[i].name;arrayHiddenCount++}}else{var value=formElements[i].value;value=value.replace(/"/g,""");postData[i]=new Array(name,encodeURIComponent(value))}}}}}}if(arrayHiddenValues.length>0){for(var i=0;i<arrayHiddenValues.length;i++){var hiddenElement=document.getElementsByName(arrayHiddenValues[i]);if(hiddenElement){if(hiddenElement.length>1){var curLen=postData.length;postData[curLen]=new Array();for(var j=0;j<hiddenElement.length;j++){var value=hiddenElement[j].value;value=value.replace(/"/g,""");postData[curLen][j]=new Array(arrayHiddenValues[i],encodeURIComponent(value))}}else{var value=hiddenElement[0].value;value=value.replace(/"/g,""");postData[postData.length]=new Array(arrayHiddenValues[i],encodeURIComponent(value))}}}}if(assCheckbox.length>0){for(var i=0;i<assCheckbox.length;i++){var objCheckbox=document.getElementsByName(assCheckbox[i]);if(objCheckbox){if(objCheckbox.length>1){var tmpIdx=0;var curLen=postData.length;postData[curLen]=new Array();for(var j=0;j<objCheckbox.length;j++){if(objCheckbox[j].checked){var value=objCheckbox[j].value;value=value.replace(/"/g,""");postData[curLen][j]=new Array(assCheckbox[i],encodeURIComponent(value));tmpIdx++}}}else{if(objCheckbox[0].checked){var value=objCheckbox[0].value;value=value.replace(/"/g,""");postData[postData.length]=new Array(assCheckbox[i],encodeURIComponent(value))}}}}}}return postData}}function jax_iresponse(){jax.processIResponse()}var jax=new Jax();


Sergey
Total posts: 13,748
27 Sep 2013 07:03

Give me URL of that page I'll check.


Judah Raine
Total posts: 332
27 Sep 2013 08:17

That's because I omitted to re-enable the plugin (I'm so embarrassed, so sorry, so tired Í can't think straight.


Sergey
Total posts: 13,748
30 Sep 2013 02:01

So, have you enabled it?


Judah Raine
Total posts: 332
30 Sep 2013 05:18

Yes. I have done so :)

Powered by Cobalt