Hi,
Thanks for finding that. You should not be using BETA 5.5, the final release has a lot of fixes in code and to the database.
Unfortunately this bug is in the final version.
Replace the contents of this file with the below:\components\com_simple_review\javascript\TitleManager.js
/**
* Manager for adding titles to a component.
* instanceVariableName: the name of the variable which references the instance of this class
* idPrefix: the prefix for the html elements id e.g. "title"
* idPostfix: the postfix for the html elements id e.g. ""
* maxTitles: the number of titles allowed to be created e.g. 20
*/
function TitleManager(instanceVariableName, idPrefix, idPostfix, maxTitles)
{
this._instanceVariableName = instanceVariableName;
this._prefix = idPrefix;
this._postfix = idPostfix;
this._maxTitles = maxTitles;
this._numberOfTitles = 0;
}
TitleManager.prototype =
{
AddTitle : function(titleValue, titleName, titleDBIDs)
{
if(this._numberOfTitles >= this._maxTitles)
{
alert("Only " + this._maxTitles + " fields are allowed");
return;
}
var titles = document.getElementById("titlesdiv");
++this._numberOfTitles;
var titleID = this._prefix+this._numberOfTitles;
//add the text label
var newTitleText = document.createElement("label");
newTitleText.setAttribute("for", titleID);
newTitleText.setAttribute("class", "titleLabel");
//add the text to the label
var labelText = document.createTextNode(titleName);
newTitleText.appendChild(labelText);
titles.appendChild(newTitleText);
//add the text area
var newTitle = null;
try
{
var attrs = "name='"+titleID+"' id='"+titleID+"' rows='1' cols='70'";
newTitle = document.createElement("<textarea "+attrs+"></textarea>");
}
catch(e)
{
newTitle = document.createElement("textarea");
newTitle.setAttribute("name", titleID);
newTitle.setAttribute("id", titleID);
newTitle.setAttribute("rows", "1");
newTitle.setAttribute("cols", "70");
}
//add the text to the text area
newTitle.appendChild(document.createTextNode(titleValue));
titles.appendChild(newTitle);
//expand/contract image
var expander = document.createElement("img");
expander.setAttribute("src", "images/expandall.png");
expander.setAttribute("onclick", this._instanceVariableName+".Expand('"+titleID+"');");
expander.setAttribute("id", "expand"+titleID);
expander.setAttribute("alt", "Expand");
expander.setAttribute("title", "Expand");
expander.setAttribute("style", "vertical-align: top;");
titles.appendChild(expander);
//category/review title id, hidden field
//name format : prefix_hiddenFieldNumber_titleNumber
for(var i=0; i < titleDBIDs.length; i++)
{
var hfCategoryTitleID = null;
try
{
var attrs = "type='hidden' name='"+this._prefix + "ID_" + i + "_" + this._numberOfTitles + this._postfix+"' value='"+titleDBIDs[i]+"'";
hfCategoryTitleID = document.createElement("<input "+attrs +"/>");
}
catch(e)
{
hfCategoryTitleID = document.createElement("input");
hfCategoryTitleID.setAttribute("type", "hidden");
hfCategoryTitleID.setAttribute("name", this._prefix + "ID_" + i + "_" + this._numberOfTitles + this._postfix );
hfCategoryTitleID.setAttribute("value", titleDBIDs[i]);
titles.appendChild(hfCategoryTitleID);
}
titles.appendChild(hfCategoryTitleID);
}
if(isIE())
{
//i.e needs this
//http://whyiesucks.blogspot.com/2006/07/_ie-cannot-set-events-via-dom-in-order.html
expander.parentNode.innerHTML = expander.parentNode.innerHTML ;
}
titles.appendChild( document.createElement("br"));
},
Expand : function(textAreaID)
{
var dynamicfield = document.getElementById(textAreaID);
var expander = document.getElementById("expand"+textAreaID);
if (dynamicfield.getAttribute("rows") > 1)
{
dynamicfield.setAttribute("rows", "1");
expander.setAttribute("src", "images/expandall.png");
expander.setAttribute("alt", "Expand");
expander.setAttribute("title", "Expand");
}
else
{
dynamicfield.setAttribute("rows", "5");
expander.setAttribute("src", "images/collapseall.png");
expander.setAttribute("alt", "Contract");
expander.setAttribute("title", "Contract");
}
},
GetNextNumberedTitleName : function(namePrefix)
{
return namePrefix + " " + (this._numberOfTitles + 1);
}
}
var _ie = null;
function isIE()
{
if(_ie == null)
{
var version=0
if (navigator.appVersion.indexOf("MSIE")!=-1)
{
temp=navigator.appVersion.split("MSIE")
version=parseFloat(temp[1])
}
_ie = (version > 0);
}
return _ie;
}