rem: var attrClass=container.attributes.getNamedItem("class"); if(attrClass!=null)sClasses=attrClass.value; 
add:  if(ie) sClasses=container.className; if(moz) attrClass=container.attributes.getNamedItem("class"); if(attrClass!=null) sClasses=attrClass.value; 
context: function setClass(sValue,sAllowedContainers,sConflictingClasses,sAllowedClasses){	var bConflictFound=false;	var bAllowedFound=(sAllowedClasses=="" || sAllowedClasses==null);	var container=null;	var sClasses="";		if(sConflictingClasses==null)sConflictingClasses="";	if(sAllowedClasses==null)sAllowedClasses="";	//sAllowedContainers : string e.g. "P,DIV,SPAN"	// '*' = all containers allowed	var aCt=sAllowedContainers.split(",");	//find the container (from cursor pos or selected element)	container=getSelectedContainer();	var attrClass=container.attributes.getNamedItem("class");	if(attrClass!=null)sClasses=attrClass.value;	//find allowed container	//if current container isn't allowed, take the parent, and so on ...	if(container!=null)container=getAllowedContainer(container,aCt);		if(container!=null)	{		//check if there isn't a conflict with existent classes		var aClE=sClasses.split(" "); 							//array of classes already applied to the container		var aClC=sConflictingClasses.split(",");					//array of conflicting classes		var aClA=sAllowedClasses.split(",");						//array of compatible classes				if(sClasses=="")bAllowedFound=true;						//if no classes already applied, every class is allowed		for(var i=0;i<aClE.length;i++)		{			for(var j=0;j<aClC.length;j++)			{				if((aClC[j]==aClE[i] && aClC[j]!="") || (aClC[j]=="*" && aClE[i]!="" && aClE[i]!=sValue))				{					bConflictFound=true;					break;				}			}			if(bConflictFound)break;						if(!bAllowedFound)			{				for(var k=0;k<aClA.length;k++)				{					if((aClA[k]==aClE[i] && aClA[k]!="") || (aClA[k]=="*" && aClE[i]!="") || (aClE[i]==sValue))					{						bAllowedFound=true;						break;						}				}				if(bAllowedFound)break;			}		}		//apply or remove it if no conflict		if(!bConflictFound && bAllowedFound)		{			if(sClasses==sValue || sClasses.indexOf(sValue+" ")>-1 || sClasses.indexOf(" "+sValue)>-1)			{				sClasses=sClasses.replace(sValue,"");				sClasses=sClasses.replace("  "," ");				sValue=sClasses;			}			else			{				if(sClasses=="")sClasses=sValue;				else sValue=sClasses+" "+sValue;			}			sValue=sTrim(sValue);			if(sValue=="")			{				if(ie)container.removeAttribute("className");				else if(moz)container.attributes.removeNamedItem("class");			}			else			{				if(ie)container.setAttribute("className",sValue,0);				else if(moz)container.setAttribute("class",sValue);			}			displayClasses();		}	}}
meta: 3979	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/3979/21ac8c1c6089dcbc1445718375ff5d2e86dd7756/wym.js/buggy/editor/wym.js