This topic is locked

Innovaeditor stylesheet configuration

3/23/2009 9:17:09 AM
ASPRunnerPro General questions
author

I am trying to configure the Style Selection tool on the Innovaeditor toolbar. It works fine in the Example02_complete folder that is installed with Innovaeditor, but I can't seem to configure it to work in my edit and add pages.
I have the tool button display set to true, so the button shows up, but when I click on it, a popup appears with the message, No stylesheet found.
Below is the script from the developer documentation. I think I just need to know where and on what page to place this script in my add and edit pages.
<script>

var oEdit1 = new InnovaEditor("oEdit1");

oEdit1.css="style/test.css";

oEdit1.REPLACE("txtContent");

</script>
Thanks in advance.

J
Jane 3/23/2009

Hi,
check BuildEditControl function in the generated include/commonfunctions.asp file.

501343 3/23/2009

Thanks, Jane. That code is below. I don't see what I would change to tell Innovaeditor where the test.css stylesheet is located.
function BuildEditControl(field, value, fformat, edit, secondfield, id)

if secondfield="" then secondfield=false

cfieldname=GoodFieldName(field)

cfield="value" & GoodFieldName(field)

ctype="type
" & GoodFieldName(field)

if secondfield then

cfield="value1" & GoodFieldName(field)

ctype="type1
" & GoodFieldName(field)

end if

ttype=GetFieldType(field,"")

arr=""

501344 3/23/2009

Jane? Anyone? Sergey?

J
Jane 3/24/2009

Hi,
add InnovaEditor for your field, build project, open include/commonfunctions.asp file and check code just after these lines:

if UseRTE(field, strTableName) then

value = RTESafe(value)

...

501345 3/24/2009

Thanks, Jane. I located that code, but where do I add the line to link to the style sheet? I obviously don't know much about ASP. Sorry to be such a dunderhead...
Here is the code:

if UseRTE(field, strTableName) then

value = RTESafe(value)



if edit=MODE_INLINE_EDIT or edit=MODE_INLINE_ADD then

cfield = cfield & "_" & id

cfieldname = cfieldname & "_" & id

browser=""

if postvalue("browser")="ie" and nWidth<565 then nWidth=565

if postvalue("browser")="ie" then browser="&browser=ie"

response.Write "<iframe scrolling=no name=""" & cfield & """ style='width: " & (nWidth+1) & "px;height: " & (nHeight+1) & "px;'"

if edit=MODE_INLINE_EDIT then

response.Write " src=""" & GetTableURL(strTableName) & "_innova.asp?mode=edit&id=" & id & "&" & iquery & browser & """>"

else

response.Write " src=""" & GetTableURL(strTableName) & "_innova.asp?mode=add&id=" & id & "&" & iquery & browser & """>"

end if

response.Write "</iframe>"

else

response.Write "<textarea id='" & cfield & "' name=""" & cfield & """ style=""width: " & nWidth & "px;height: " & nHeight & "px;"">" & my_htmlspecialchars(value) & "</textarea>"

response.Write "<script>"

response.Write "var oEdit" & cfieldname & " = new InnovaEditor(""oEdit" & cfieldname & """);"

response.Write "oEdit" & cfieldname & ".mode=""HTMLBody"";"

response.Write "oEdit" & cfieldname & ".width=""" & nWidth & "px"";"

response.Write "oEdit" & cfieldname & ".height=""" & nHeight & "px"";"

response.Write "oEdit" & cfieldname & ".cmdAssetManager=""modalDialogShow('../assetmanager/assetmanager.asp',640,445);"";"

response.Write "oEdit" & cfieldname & ".REPLACE(""" & cfield & """);"

response.Write "</script>"

end if
J
Jane 3/25/2009

Hi,
here is a sample:

response.Write "var oEdit" & cfieldname & " = new InnovaEditor(""oEdit" & cfieldname & """);"

response.Write "oEdit" & cfieldname & ".css = ""style/test.css"";"

response.Write "oEdit" & cfieldname & ".REPLACE(""txtContent"");"

501346 3/25/2009

YES!!!! It works!
FYI: All I needed to do is paste this line as you instructed into the commonfunctions.asp file:

response.Write "oEdit" & cfieldname & ".css = ""style/test.css"";"


And then copy the "style" folder (containing the test.css file) into the main project folder.
I didn't use any of the other code you suggested.
THANK YOU JANE!