/* html editor functions */ var textContent; var lastSave; var cPRINT = 1; var cPREVIEW = 2; var cCUT = 3; var cCOPY = 4; var cPASTE = 5; var cBOLD = 6; var cITALIC = 7; var cUNDERLINE = 8; var cSTRIKETHRU = 9; var cSUBSCRIPT = 10; var cSUPERSCRIPT = 11; var cHX = 12; var cFONT_SIZE = 13; var cFONT_NAME = 14; var cFORE_COLOR = 15; var cBACK_COLOR = 16; var cOUTDENT = 17; var cINDENT = 18; var cLEFT = 19; var cCENTER = 20; var cRIGHT = 21; var cPARABUL = 22; var cPARANUM = 23; var cLINKWEB = 24; var cINSERTRULE = 25; var cUNDO = 26; var cREDO = 27; var editRange = null; var jsAllowed = true; function getUrCss(){ return ur_system.stylepath+"ur/ur_"+ur_system.browser_abbrev+".css"; } function checkDoAction(id) { if (lastSave != id) { return false; } if (document.getElementById(id + "htmlbeditor").document.selection.type == "Control") { editRange=document.getElementById(id + "htmlbeditor").document.selection.createRange(); } return true; } function checkParent(tester,id) { if ( tester.parentElement == null) { return false; } if ( tester.parentElement.id == id + "htmlbeditor") { return true; } return checkParent(tester.parentElement,id); } function save_userexit(id) { var x = document.getElementById(id + "_ADD"); if(x!=null && editRange !=null && (editRange.htmlText!=null||editRange.outerHTML!=null)) { if(editRange.htmlText==null) { x.value=editRange.outerHTML; } else { x.value = editRange.htmlText; } } } function save_restore(id) { var x = document.getElementById(id + "_OLD"); if(x!=null) x.value = document.getElementById(id + "htmlbeditor").innerHTML; } var myWindow; var myId; function showPreview(id) { save(id); myId = id; var editor=document.getElementById(id + "htmlbeditor"); var screenSize=document.getElementById(id + "_SCREEN"); if(screenSize!=null){ var sw, sh, features; switch (screenSize.value){ /*400x300, 640x480, 800x600, 1024x768*/ case '1': sh=300;sw=400;break; case '2': sht=480;sw=640;break; case '3': sh=600;sw=800;break; case '4': sh=768;sw=1024;break; default: sh=600;sw=800; } features="resizable=yes,scrollbars=yes,width="+sw+",height="+sh; mywindow = window.open(document.getElementById('htmlbJavaScriptPath').value + 'prev_htmlbedit.html','_blank',features); }else{ mywindow = window.open(document.getElementById('htmlbJavaScriptPath').value + 'prev_htmlbedit.html','_blank','resizable=yes,scrollbars=yes'); } window.setTimeout("setContent()",50); } function setContent() { var x = document.getElementById(myId + "htmlbeditor"); if(x!=null) { try { mywindow.document.createStyleSheet(getUrCss()); mywindow.document.body.innerHTML = x.innerHTML; mywindow.document.close(); } catch(e) { window.setTimeout("setContent()",50); } } } function htmlb_hed_matchSpecialTag(editor, elem, tagName) { try { if (elem.tagName==tagName){ return elem; } if(elem!=null){ elem = elem.parentElement; if (elem==null) return null; } return htmlb_hed_matchSpecialTag(editor, elem, tagName); } catch(ex) { return null; } } function insertLink(id) { var editor = document.getElementById(id + "htmlbeditor"); if (editRange == null) editRange = editor.document.selection.createRange(); var doUserExit=true; if (lastSave != id) { return false; } if (editor.document.selection.type == "Control") { var selectedRange = editor.document.selection.createRange(); editRange=selectedRange.item(0); // check if we just have a modify scenario... if (editRange.tagName.toUpperCase() == "IMG"){ if (editRange.id=="") editRange.id = htmlb_hed_getUniqueId("htmlb_hed_image"); // check if we found a link parent... var linkTag = htmlb_hed_matchTag(editor, editRange, "^A"); if (linkTag&&linkTag.tagName=="A"){ if (linkTag.id=="") linkTag.id = htmlb_hed_getUniqueId("htmlb_hed_link"); htmlb_hed_launchLinkPropPopup(editor.id, linkTag.id, false, "", true); return false; } } if (doUserExit){ save_userexit(id); save_restore(id); htmlb_hed_save_editor_state(id); lastSave = null; if (editRange.parentElement != null){ var parentRef=htmlb_hed_matchSpecialTag(editor, editRange.parentElement, 'A'); if (parentRef != null){ parentRef.id = "LINK_" + id; parentRef.name = "LINK_" + id; var x = document.getElementById(id + "_ADD"); if(x!=null) { x.value=parentRef.outerHTML; } save_restore(id); }else{ var p = editRange.parentElement; p.removeChild(editRange); var aRef = document.getElementById(id + "htmlbeditor").document.createElement('A'); aRef.id = "LINK_" + id; aRef.name = "LINK_" + id; aRef.appendChild(editRange); p.appendChild(aRef); } } //if (editRange.parentElement != null) } }else if(editRange==null){ return false; }else{ var elem = editRange.parentElement(); if (elem.tagName == 'A') { if (elem.id=="") elem.id = htmlb_hed_getUniqueId("htmlb_hed_link"); htmlb_hed_launchLinkPropPopup(editor.id, elem.id, false, "", false); save(id); return false; } save_userexit(id); save_restore(id); lastSave = null; htmlb_hed_save_offset(id); htmlb_hed_save_editor_state(id); if (editRange.parentElement().tagName == 'A') { editRange.parentElement().id = "LINK_" + id; editRange.parentElement().name = "LINK_" + id; } else { editRange.execCommand("Unlink"); myText = editRange.htmlText; myText = "" + myText + ""; editRange.pasteHTML(myText); } } save(id); return true; } function insertImage(id) { var editor = document.getElementById(id + "htmlbeditor"); if (lastSave != id) { return false; } save_restore(id); lastSave = null; if (editor.document.selection.type == "Control") { var selectedRange = editor.document.selection.createRange(); editRange=selectedRange.item(0); if (editRange.tagName=="IMG"){ if (editRange.id=="") editRange.id = htmlb_hed_getUniqueId("htmlb_hed_image"); htmlb_hed_launchImagePropPopup(editRange.id, editor.id); //save_userexit(id); //editRange.id = "IMG_" + id; return false; }else{ var txtMap = htmlb_hed_txt[ur_language]; alert(txtMap["TXT_HTMLB_HED_SEL_IMG"]); } }else if(editRange==null){ return false; }else{ save_userexit(id); if (editRange.parentElement().tagName == 'IMG') { editRange.parentElement().id = "IMG_" + id; editRange.parentElement().name = "IMG_" + id; } else { myText = editRange.htmlText; myText = myText + ""; editRange.pasteHTML(myText); } } save(id); return true; } function editortoolbarswitch(a, skipstart, skipend) { var id; var i=0; var index = 0; var newIndex = 0; var button; if (sapUrMapi_skip(skipstart, skipend, event)){ return true; } if(event.keyCode==37||event.keyCode==39) { id = a.id; i = id.lastIndexOf("_")+1; index = id.substr(i); if(event.keyCode==37) { newIndex = parseInt(index)-1; } else { newIndex = parseInt(index)+1; } newId = id.substring(0,i) + newIndex; button = document.getElementById(newId); if(button!=null) { button.focus(); return true; } } return false; } // html editor ----------------------------------------------------------------- function htmlb_hed_refreshTableIds(table) { var rowId=0, colId=0; table.id = htmlb_hed_getUniqueId("htmlb_hed_tbl"); for(i=0; i 0 ){ obj = selectedRange.item(0); } break; case 'None': obj = selectedRange.parentElement(); break; } return obj; } function htmlb_hed_matchTag(editor, elem, tagName) { try { if (elem.tagName.search(tagName)!=-1){ return elem; } if (elem.tagName.toUpperCase()=='TABLE'){ return elem; } if (elem.tagName.toUpperCase()=='DIV'){ if (editor){ elem = editor.getElementsByTagName('TABLE'); if(elem.length>0) elem = elem[0]; }else{ elem = null; } return elem; } if(elem!=null) elem = elem.parentElement; return htmlb_hed_matchTag(editor, elem, tagName); } catch(ex) { return null; } } function htmlb_hed_doDeleteTableCol(editor, errorText) { htmlb_hed_stackForUndo(editor); objRef = htmlb_hed_getRangeRef(editor); if(null==objRef)return; objRef = htmlb_hed_matchTag(editor, objRef, '/^(TABLE)|^(TR)|^(TD)|^(TBODY)/'); if(null==objRef)return; switch(objRef.tagName) { case 'TD': var rowIndex = objRef.parentElement.rowIndex; var cellIndex = objRef.cellIndex; var parentTable = objRef.parentElement.parentElement.parentElement; var newTable = parentTable.cloneNode(true); if (1==newTable.rows[0].cells.length){ parentTable.removeNode(true); return; } for(x=0; x=newTable.rows[0].cells.length){ cellIndex=newTable.rows[0].cells.length-1; } if (rowIndex>=newTable.rows.length){ rowIndex=newTable.rows.length-1; } htmlb_hed_refreshTableIds(newTable); parentTable.outerHTML = newTable.outerHTML; htmlb_hed_toogle_table_border(newTable.id, editor); if (cellIndex>=0&&rowIndex>=0){ var rg = editor.document.body.createTextRange(); var el = editor.document.getElementById(newTable.id+":"+rowIndex+'_'+cellIndex); if(el){ rg.moveToElementText(el); rg.moveStart('character',rg.text.length); rg.select(); } } break; default: alert(errorText); } } function htmlb_hed_doInsertTableRow(editor, errorText) { htmlb_hed_stackForUndo(editor); objRef = htmlb_hed_getRangeRef(editor); if(objRef==null){ alert(errorText); return; } objRef = htmlb_hed_matchTag(editor, objRef, '/^(TABLE)|^(TR)|^(TD)|^(TBODY)/'); if(objRef==null){ alert(errorText); return; } switch(objRef.tagName) { case 'TD': var parentRow = objRef.parentElement; var rowIndex = parentRow.rowIndex; var cellIndex = objRef.cellIndex; var parentTable = objRef.parentElement.parentElement.parentElement; var newTable = parentTable.cloneNode(true); var newRow = newTable.insertRow(rowIndex+1); var style = objRef.className; for(x=0; x< newTable.rows[0].cells.length; x++) { var newCell = newRow.insertCell(); newCell.innerHTML = " "; if (style!=""){ newCell.className=style; } } htmlb_hed_refreshTableIds(newTable); parentTable.outerHTML = newTable.outerHTML; htmlb_hed_toogle_table_border(newTable.id, editor); var rg = editor.document.body.createTextRange(); var el = editor.document.getElementById(newTable.id+":"+rowIndex+'_'+cellIndex); if(el){ rg.moveToElementText(el); rg.moveStart('character',rg.text.length); rg.select(); } break; case 'TR': var rowIndex = objRef.rowIndex; var parentTable = objRef.parentElement.parentElement; var newTable = parentTable.cloneNode(true); var newRow = newTable.insertRow(rowIndex+1); for(x=0; x< newTable.rows[0].cells.length; x++) { var newCell = newRow.insertCell(); } htmlb_hed_refreshTableIds(newTable); parentTable.outerHTML = newTable.outerHTML; htmlb_hed_toogle_table_border(newTable.id, editor); break; case 'TABLE': var newTable = objRef.cloneNode(true); var newRow = newTable.insertRow(); for(x=0; x=parentTable.rows.length) { rowIndex=parentTable.rows.length-1; } htmlb_hed_refreshTableIds(parentTable); if (rowIndex>=0) { var rg = editor.document.body.createTextRange(); var el = editor.document.getElementById(parentTable.id+":"+rowIndex+'_'+cellIndex); if(el){ rg.moveToElementText(el); rg.moveStart('character',rg.text.length); rg.select(); } } else { parentTable.removeNode(true); } break; case 'TR': var rowIndex = objRef.rowIndex; var parentTable = objRef.parentElement.parentElement; parentTable.deleteRow(rowIndex); htmlb_hed_refreshTableIds(parentTable); break; default: alert(errorText); } } function htmlb_hed_doInsertTableCol(editor, errorText) { htmlb_hed_stackForUndo(editor); objRef = htmlb_hed_getRangeRef(editor); if(objRef==null){ alert(errorText); return; } objRef = htmlb_hed_matchTag(editor, objRef, '/^(TABLE)|^(TR)|^(TD)|^(TBODY)/'); if(objRef==null){ alert(errorText); return; } switch(objRef.tagName) { case 'TABLE': var newTable=objRef.cloneNode(true); for(x=0; x"; sSizerHtml += ""; sSizerHtml += ""; sSizerHtml += ""; sSizerHtml += ""; sSizerHtml += ""; sSizerHtml += ""; sSizerHtml += ""; sSizerHtml += ""; sSizerHtml += ""; sSizerHtml += ""; sSizerHtml += ""; sSizerHtml += ""; sSizerHtml += ""; sSizerHtml += ""; sSizerHtml += ""; sSizerHtml += ""; sSizerHtml += ""; } sCharsHtml += "
"; sSizerHtml += ""; if(bInsertMode){ sSizerHtml += ""; sSizerHtml += txtMap["TXT_HTMLB_HED_TITLE_INS_TB"]; sSizerHtml += ""; }else{ sSizerHtml += ""; sSizerHtml += txtMap["TXT_HTMLB_HED_TITLE_MOD_TB"]; sSizerHtml += ""; } sSizerHtml += "
"; sSizerHtml += "
"; sSizerHtml += ""; sSizerHtml += ""; sSizerHtml += ""; if(bInsertMode){ sSizerHtml += ""; sSizerHtml += ""; sSizerHtml += ""; sSizerHtml += ""; sSizerHtml += ""; sSizerHtml += ""; sSizerHtml += ""; sSizerHtml += ""; } sSizerHtml += ""; sSizerHtml += ""; sSizerHtml += ""; sSizerHtml += ""; sSizerHtml += ""; sSizerHtml += ""; sSizerHtml += ""; sSizerHtml += ""; sSizerHtml += "
 
"; sSizerHtml += ""; sSizerHtml += ""; sSizerHtml += ""; sSizerHtml += htmlb_hed_render_input('htmlb_hed_rows', "3", htmlb_hed_ti_scope.START, txtMap["TXT_HTMLB_HED_ROWS"], false,3,3); sSizerHtml += "
"; sSizerHtml += ""; sSizerHtml += ""; sSizerHtml += ""; //sSizerHtml += ""; sSizerHtml += htmlb_hed_render_input('htmlb_hed_cols', "3", htmlb_hed_ti_scope.NONE, txtMap["TXT_HTMLB_HED_COLS"], false,3,3); sSizerHtml += "
"; sSizerHtml += ""; sSizerHtml += ""; sSizerHtml += ""; sSizerHtml += ""; sSizerHtml += ""; sSizerHtml += ""; sSizerHtml += ""; sSizerHtml += ""; sSizerHtml += ""; sSizerHtml += ""; sSizerHtml += ""; sSizerHtml += ""; sSizerHtml += ""; sSizerHtml += ""; sSizerHtml += ""; sSizerHtml += ""; /*if(bInsertMode){ sSizerHtml += ""; sSizerHtml += ""; sSizerHtml += ""; sSizerHtml += ""; }*/ sSizerHtml += ""; sSizerHtml += ""; sSizerHtml += ""; sSizerHtml += ""; sSizerHtml += "
=0){ modWidthUnit=1; modWidth=table.width.substring(0, unitIndx); }else{ modWidthUnit=2; modWidth=table.width; } modCellSpace=table.cellSpacing; modCellPad=table.cellPadding; modBorder=table.border; switch(table.align){ case 'left': modAlign=1; break; case 'center': modAlign=2; break; case 'right': modAlign=3; break; default: modAlign=0; } if(!modSaved){//cancel modSaved=true; modWidthSaved=table.width; if(modWidthUnit==1)modWidthUnitSaved="%"; else modWidthUnitSaved=""; modCellSpaceSaved=modCellSpace; modCellPadSaved=modCellPad; modBorderSaved=modBorder; modAlignSaved=table.align; } } } sSizerHtml += modWidth; sSizerHtml += "\" id=\"htmlb_hed_width\" onChange=\"me.htmlb_hed_tablesizer_val(this);return false;\" onBlur=\"me.htmlb_hed_tablesizer_val(this);return false;\"> "; sSizerHtml += ""; sSizerHtml += ""; sSizerHtml += ""; sSizerHtml += ""; sSizerHtml += "
"; sSizerHtml += ""; sSizerHtml += ""; sSizerHtml += ""; sSizerHtml += ""; sSizerHtml += "
"; sSizerHtml += ""; sSizerHtml += ""; sSizerHtml += ""; sSizerHtml += ""; sSizerHtml += "
"; sSizerHtml += ""; sSizerHtml += ""; sSizerHtml += ""; sSizerHtml += ""; sSizerHtml += "
 
"; sSizerHtml += ""; sSizerHtml += ""; sSizerHtml += "
"; if(bInsertMode){ sSizerHtml += ""; sSizerHtml += ""; sSizerHtml += txtMap["TXT_HTMLB_HED_OK"]; sSizerHtml += ""; sSizerHtml += ""; sSizerHtml += " "; sSizerHtml += ""; sSizerHtml += txtMap["TXT_HTMLB_HED_OK"]; sSizerHtml += ""; sSizerHtml += ""; sSizerHtml += ""; sSizerHtml += txtMap["TXT_HTMLB_HED_APPLY"]; sSizerHtml += ""; sSizerHtml += ""; sSizerHtml += txtMap["TXT_HTMLB_HED_CANCEL"]; sSizerHtml += ""; sSizerHtml += "
"; } sSizerHtml += "
"; sSizerHtml += ""; sSizerHtml += "
"; sSizerHtml += "
"; oPopup.innerHTML=sSizerHtml; return oPopup; } function htmlb_hed_tablesizer_val(input){ if (!input) return true; var obj = new Object; obj.id = input.id; obj.formelement = input; obj.getValue = _htmlbjsgetValue; obj.setValue = _htmlbjssetValue; obj.getChecked = _htmlbjsgetChecked; obj.getEnable = _htmlbjsgetEnable; obj.setEnable = _htmlbjssetEnable; obj.selectFocus = _htmlbjsselectfocus; obj.setErrorText = _htmlbInputFieldSetErrorText; if(!checkLength(obj,3)) e="Allowed maximal number of characters is 3"; else if(!checkInteger(obj,"P,","","")||input.value=="") e="Specify an integer value"; else e=null; obj.setErrorText(e); if (e){ input.className="urEdfiTxtEnbl"; return false; } else{ input.className="urEdfTxtEnbl"; return true; } } htmlb_hed_txt=new Array(); function htmlb_hed_addTexts(lang, texts) { if(htmlb_hed_txt[lang]) { for ( var i in texts) { if(!htmlb_hed_txt[lang][i]) { htmlb_hed_txt[lang][i] = texts[i]; } } } else { htmlb_hed_txt[lang] = texts; } } function htmlb_hed_specialChar_select(sId, specChar){ hidePopupMenu(); var editor = document.getElementById(sId); if (editRange!=null&&editRange.parentElement()!=null){ var _char = '&'+specChar; editRange.pasteHTML(_char); editor.focus(); } } function htmlb_hed_makeSpecialCharDialog(sId){ var oPopup = document.getElementById("htmlb_hed_specChar_popup"); if (!oPopup) { var oBody = document.getElementsByTagName("BODY")[0]; var editor = document.getElementById(sId); editor._offsetY=editor.scrollTop; editor._offsetX=editor.scrollLeft; oPopup = document.createElement("SPAN"); oPopup.id="htmlb_hed_specChar_popup"; oPopup.style.position="absolute"; oPopup.style.left="-1999px"; oPopup.style.top="-1999px"; oBody.appendChild(oPopup); setTimeout("htmlb_hed_adapt_offset('"+editor.id+"')", 50); } var txtMap = htmlb_hed_txt[ur_language]; var specials = new Array('cent;','euro;','pound;','yen;','curren;','deg;','copy;','reg;','trade;','nbsp;','mdash;','bull;','para;','sect;','dagger;','Dagger;','laquo;','raquo;','sum;','Delta;','asymp;','ne;','le;','ge;','plusmn;','times;','divide;','frac14;','frac12;','frac34;','permil;','isin;','middot;','hellip;','hArr;','rArr;','loz;','uarr;','darr;','larr;','harr;','rarr;'); var i=0; var sCharsHtml = ""; sCharsHtml += ""; sCharsHtml += ""; sCharsHtml += "
"; sCharsHtml += txtMap["TXT_HTMLB_HED_INS_SC"]; sCharsHtml += "
"; sCharsHtml += ""; sCharsHtml += ""; sCharsHtml += ""; sCharsHtml += "
"; sCharsHtml += ""; sCharsHtml += ""; sCharsHtml += ""; sCharsHtml += ""; sCharsHtml += ""; sCharsHtml += ""; sCharsHtml += ""; sCharsHtml += ""; sCharsHtml += ""; sCharsHtml += ""; sCharsHtml += ""; sCharsHtml += ""; sCharsHtml += ""; sCharsHtml += ""; sCharsHtml += ""; sCharsHtml += ""; sCharsHtml += ""; sCharsHtml += ""; sCharsHtml += ""; sCharsHtml += ""; sCharsHtml += ""; sCharsHtml += ""; sCharsHtml += ""; sCharsHtml += ""; sCharsHtml += ""; sCharsHtml += ""; sCharsHtml += ""; sCharsHtml += ""; sCharsHtml += ""; sCharsHtml += ""; sCharsHtml += ""; sCharsHtml += ""; sCharsHtml += ""; sCharsHtml += ""; sCharsHtml += ""; sCharsHtml += ""; sCharsHtml += ""; sCharsHtml += ""; sCharsHtml += ""; sCharsHtml += ""; sCharsHtml += ""; sCharsHtml += ""; sCharsHtml += ""; sCharsHtml += ""; sCharsHtml += ""; sCharsHtml += ""; sCharsHtml += ""; sCharsHtml += ""; sCharsHtml += ""; sCharsHtml += ""; sCharsHtml += ""; sCharsHtml += ""; sCharsHtml += ""; sCharsHtml += ""; sCharsHtml += ""; sCharsHtml += ""; sCharsHtml += ""; sCharsHtml += ""; sCharsHtml += ""; sCharsHtml += ""; sCharsHtml += ""; sCharsHtml += "
¢£¥¤°
©® 
§«»
Δ
±×÷¼½¾
·
"; sCharsHtml += ""; sCharsHtml += ""; sCharsHtml += txtMap["TXT_HTMLB_HED_CANCEL"]; sCharsHtml += ""; sCharsHtml += "
"; sCharsHtml += "
"; oPopup.innerHTML=sCharsHtml; return oPopup; } function htmlb_hed_insertDateAndTime(editor) { editor.focus(); var d = new Date(); var dateString = sapCal_makeDateString(gDateformat, d.getUTCFullYear(), d.getMonth(), d.getDate()); dateString += " "; dateString += d.toLocaleTimeString(); sel=editor.document.selection.createRange(); sel.pasteHTML(dateString); } function htmlb_hed_showPrintPreview(id) { save(id); myId = id; var editor=document.getElementById(id + "htmlbeditor"); var screenSize=document.getElementById(id + "_SCREEN"); if(screenSize!=null){ var sw, sh, features; switch (screenSize.value){ /*400x300, 640x480, 800x600, 1024x768*/ case '1': sh=300;sw=400;break; case '2': sht=480;sw=640;break; case '3': sh=600;sw=800;break; case '4': sh=768;sw=1024;break; default: sh=600;sw=800; } features="resizable=yes,scrollbars=yes,width="+sw+",height="+sh; mywindow = window.open(document.getElementById('htmlbJavaScriptPath').value + 'prev_htmlbedit.html','_blank',features); }else{ mywindow = window.open(document.getElementById('htmlbJavaScriptPath').value + 'prev_htmlbedit.html','_blank','resizable=yes,scrollbars=yes'); } window.setTimeout("htmlb_hed_printpreview_setContent()",50); } function htmlb_hed_printpreview_setContent() { var x = document.getElementById(myId + "htmlbeditor"); if(x!=null) { try { mywindow.document.createStyleSheet(getUrCss()); var content = ''; content += x.innerHTML; content += '__Browser.ExecWB(7, 1);__Browser.outerHTML = "";'; mywindow.document.write(content); mywindow.document.close(); mywindow.close(); } catch(e) { } } } function htmlb_hed_doInsertTextStylePopup(sId, control){ try { var editor = document.getElementById(sId + "htmlbeditor"); var o=control.document.parentWindow.event; var oPopupContent=htmlb_hed_makeTextStyleSelectPopup(editor.id); var arrUrls = new Array(getUrCss()); var oPopup = new sapPopup(window,arrUrls,oPopupContent,control,o,0); oPopup.show = htmlb_hed_Popup_show oPopup.onblur = hidePopupMenu; window.onfocus = hidePopupMenu; oPopup.show(true); if (ur_system.is508){ oField = oPopup.frame.window.document.getElementById("htmlb_hed_ts_item_0"); if (oField){ oField.className = "urMnuRowOn"; oField.focus(); oField.focus(); } } g_sLastUsedToolbarId = control.id; return oPopup; } catch(ex){ alert(ex); } } htmlb_hed_ur_text_styles=new Array(); htmlb_hed_ur_text_kstyles=new Array(); function htmlb_hed_addUrTextStyles(texts) { for ( var i in texts) { if(!htmlb_hed_ur_text_styles[i]){ htmlb_hed_ur_text_styles[i] = texts[i]; } } htmlb_hed_ur_text_kstyles = new Array('urTxtH1','urTxtH2','urTxtH3','urTxtH4','urTxtStd','urTxtEmph','urTxtMono','urTxtLeg','urTxtRef'); } function isHCB() { var stylepath = ur_system.stylepath; if(stylepath && stylepath.search("/sap_hcb/") > 0) return true ; else return false; } function htmlb_hed_hasStyle(style){ for (j=0; j=0){ if (j==selectedIndex) { sCharsHtml += "
"; sCharsHtml += ""; sCharsHtml += urStyleMap[htmlb_hed_ur_text_kstyles[j]]; sCharsHtml += " "; sCharsHtml += "
"; oPopup.innerHTML=sCharsHtml; return oPopup; } function htmlb_hed_MnuToggle(oItem){ oItem.className = "urMnuRowOn"; } function htmlb_hed_MnuToggleOut(obj){ obj.className= "urMnuRowOff"; obj.borderColor=""; } function htmlb_hed_Popup_show_nofocus(bDoNotAutoFocus) { this.poscalc(); if (this.onbeforerender) { if (!this.onbeforerender(this)) return; } if (!this.canrender) { showError("Cannot render Popup. Sizes and positions are not set."); return; } if (this.frame.window.mylevel==null) { this.write(bDoNotAutoFocus); } else { this.frame.window.document.getElementsByTagName("DIV").item(0).innerHTML=this.content.html; } if (bDoNotAutoFocus) { } else { //this.frame.window.document.body.focus(); } if (ur_system.direction=="rtl") this.frame.object.style.right = this.position.right+"px"; else this.frame.object.style.left = this.position.left+"px"; this.frame.object.style.top = this.position.top+"px"; this.frame.object.style.width = this.size.width+"px"; this.frame.object.style.height = this.size.height+"px"; return true; } function htmlb_hed_Popup_show(bDoNotAutoFocus) { var sourceoffset = getAbsolutePosition(this.source.object); this.position.left = sourceoffset.left; this.position.top = sourceoffset.top; this.positionbehavior = sapPopupPositionBehavior.EVENT; this.poscalc(); this.position.left = sourceoffset.left+1; this.position.top = sourceoffset.top+20; if (this.onbeforerender) { if (!this.onbeforerender(this)) return; } if (!this.canrender) { showError("Cannot render Popup. Sizes and positions are not set."); return; } if (this.frame.window.mylevel==null) { this.write(bDoNotAutoFocus); } else { this.frame.window.document.getElementsByTagName("DIV").item(0).innerHTML=this.content.html; } if (bDoNotAutoFocus) { } else { //this.frame.window.document.body.focus(); } if (ur_system.direction=="rtl") this.frame.object.style.right = this.position.right+"px"; else this.frame.object.style.left = this.position.left+"px"; this.frame.object.style.top = this.position.top+"px"; this.frame.object.style.width = this.size.width+"px"; this.frame.object.style.height = this.size.height+"px"; return true; } function htmlb_hed_doInsertTextSizePopup(sId, control){ try { var editor = document.getElementById(sId + "htmlbeditor"); var o=control.document.parentWindow.event; var oPopupContent=htmlb_hed_makeStyleSizeSelectPopup(editor.id); var arrUrls = new Array(getUrCss()); var oPopup = new sapPopup(window,arrUrls,oPopupContent,control,o,0); oPopup.show = htmlb_hed_Popup_show oPopup.onblur = hidePopupMenu; window.onfocus = hidePopupMenu; oPopup.show(true); oField = oPopup.frame.window.document.getElementById("htmlb_hed_ts_item_0"); if (ur_system.is508){ if (oField){ oField.className = "urMnuRowOn"; oField.focus(); oField.focus(); } } g_sLastUsedToolbarId = control.id; } catch(ex){ alert(ex); } } htmlb_hed_ur_text_sizes=new Array(); function htmlb_hed_addTextSizes(texts) { for ( var i in texts) { if(!htmlb_hed_ur_text_sizes[i]){ htmlb_hed_ur_text_sizes[i] = texts[i]; } } } function htmlb_hed_makeStyleSizeSelectPopup(sId){ var txtMap = htmlb_hed_txt[ur_language]; var maxEntries = 7; htmlb_hed_addTextSizes({1:txtMap["TXT_HTMLB_XXSMALL"],2:txtMap["TXT_HTMLB_XSMALL"],3:txtMap["TXT_HTMLB_SMALL"],4:txtMap["TXT_HTMLB_MEDIUM"],5:txtMap["TXT_HTMLB_LARGE"],6:txtMap["TXT_HTMLB_XLARGE"],7:txtMap["TXT_HTMLB_XXLARGE"]}); var editor = document.getElementById(sId); var selectedIndex=-1; var oPopup = document.getElementById("htmlb_hed_selectStyleSize_popup"); if (!oPopup) { var oBody = document.getElementsByTagName("BODY")[0]; var editor = document.getElementById(sId); editor._offsetY=editor.scrollTop; editor._offsetX=editor.scrollLeft; oPopup = document.createElement("SPAN"); oPopup.id="htmlb_hed_selectStyleSize_popup"; oPopup.style.position="absolute"; oPopup.style.left="-1999px"; oPopup.style.top="-1999px"; oBody.appendChild(oPopup); setTimeout("htmlb_hed_adapt_offset('"+editor.id+"')", 50); } if (editRange!=null){ var fontsize = editRange.queryCommandValue('FontSize'); if (fontsize != null) { selectedIndex=fontsize; }/*else{ var fontTag = htmlb_hed_matchTag(editor, editRange.parentElement(), "^FONT"); if (fontTag&&fontTag.tagName=="FONT"){ selectedIndex = fontTag.size; } }*/ } var sCharsHtml = ""; var urSizeMap = htmlb_hed_ur_text_sizes; var itemId; var preItemId = 0; this.selId=10; var hcbclass = ""; if(isHCB()) hcbclass = "urMnuRow"; for (j=0; j=0){ if (j==selectedIndex) { sCharsHtml += ""; } sCharsHtml += "
"; sCharsHtml += ""; sCharsHtml += " "; sCharsHtml += ""; sCharsHtml += "
"; oPopup.innerHTML=sCharsHtml; return oPopup; } function htmlb_hed_MnuToggleClickTextStyle(sId, span){ var editor = document.getElementById(sId); editor._offsetY=editor.scrollTop; editor._offsetX=editor.scrollLeft; hidePopupMenu(); htmlb_hed_stackForUndo(editor); var style = span.firstChild.className; var parentStyle=""; if (editRange!=null){ if (editRange.text!=""&&editRange.parentElement()!=null){ editRange.execCommand('RemoveFormat'); document.createStyleSheet(getUrCss()); var _content = editRange.htmlText; if (_content.indexOf("0){ _content = editRange.text; }else{ _content = _content.replace(/class[\s]*=[\s]*['"]*[\w]+['"]*/g, ''); _content = _content.replace(/style[\s]*=[\s]*['"]*[^'"]+['"]*/g, ''); } var pasteStr = ""; pasteStr += _content; pasteStr += ""; editRange.pasteHTML(pasteStr); }else{ var pasteStr = " "; pasteStr += ""; editRange.pasteHTML(pasteStr); } setTimeout("htmlb_hed_adapt_offset('"+editor.id+"')", 50); } } function htmlb_hed_doInsertTextForegroundColorPopup(sId, control){ try { var editor = document.getElementById(sId + "htmlbeditor"); var o=control.document.parentWindow.event; var oPopupContent=htmlb_hed_makeTextColorPopup(editor.id); var arrUrls = new Array(getUrCss()); var oPopup = new sapPopup(window,arrUrls,oPopupContent,control,o,0); var oField; oPopup.onblur = htmlb_hed_hidePopupMenu; window.onfocus = htmlb_hed_hidePopupMenu; if (ur_system.is508) oPopup.write = htmlb_hed_popup_write; oPopup.show(true); oField = oPopup.frame.window.document.getElementById("txt_color_0"); oField.focus(); oField.focus(); g_sLastUsedToolbarId = control.id; } catch(ex){ alert(ex); } } function htmlb_hed_doInsertTextBackgroundColorPopup(sId, control, browserCentric, colorRangeId, tableCellId){ try { var editor = document.getElementById(sId + "htmlbeditor"); var oPopup; var oPopupContent=htmlb_hed_makeBackgroundColorPopup(editor.id, colorRangeId, tableCellId); var arrUrls = new Array(getUrCss()); if (browserCentric != undefined && browserCentric){ oPopup = new sapPopup(window,arrUrls,oPopupContent,editor,window.event,1); oPopup.content.size = oPopupContent; oPopup.positionbehavior = sapPopupPositionBehavior.BROWSERCENTER; }else{ oPopup = new sapPopup(window,arrUrls,oPopupContent,control,control.document.parentWindow.event,0); } oPopup.onblur = htmlb_hed_hidePopupMenu; window.onfocus = htmlb_hed_hidePopupMenu; if (ur_system.is508) oPopup.write = htmlb_hed_popup_write; oPopup.show(true); oField = oPopup.frame.window.document.getElementById("txt_bcolor_0"); oField.focus(); oField.focus(); g_sLastUsedToolbarId = control.id; } catch(ex){ alert(ex); } } htmlb_hed_ur_bkcolors = new Array('urSTWhlTrans','urSTbvCellCritLight','urSTbvCellCritMedium','urSTbvCellCritDark','urSTbvCellBadLight','urSTbvCellBadMedium','urSTbvCellBadDark','urSTbvCellNeg','urCellBgPlain','urSTbvCellSubtotLight','urSTbvCellSubtot','urSTbvCellTot','urSTbvCellGoodLight','urSTbvCellGoodMedium','urSTbvCellGoodDark','urSTbvCellPos','urRIValueUnrated','urCellBgFill2','urGrpBdyWeb1','urCellBgFill1','urPrInNeutral','urVwsRowSel','urCellBgBorder','urSTbvCellAlt','urCellBgFill3','urSTbvCellGrpLvl3','urSTbvCellGrpLvl2','urSTbvCellGrpLvl1','urCellBgHeader','urSTbvCellKeyMedium','urSTbvCellGrpHL','urSTbvCellGrpHLLight'); function htmlb_hed_hasBackgroundColor(color){ for (j=0; j"+txtMap["TXT_HTMLB_TXT_BGCOLOR"]+""; sCharsHtml += ""; sCharsHtml += ""; sCharsHtml += ""; sCharsHtml += "
"; sCharsHtml += ""; sCharsHtml += ""; sCharsHtml += ""; if (counter++ == index) style = styleS; else style = styleN; sCharsHtml += htmlb_hed_makeBackgroundColorPopupCell("urSTbvCellTrans urCellBgPlain urBtnStd", style, sId, tableId, counter-1, htmlb_hed_ti_scope.START); if (counter++ == index) style = styleS; else style = styleN; sCharsHtml += htmlb_hed_makeBackgroundColorPopupCell("urSTbvCellCritLight urBtnStd", style, sId, tableId, counter-1, htmlb_hed_ti_scope.NONE); if (counter++ == index) style = styleS; else style = styleN; sCharsHtml += htmlb_hed_makeBackgroundColorPopupCell("urSTbvCellCritMedium urBtnStd", style, sId, tableId, counter-1, htmlb_hed_ti_scope.NONE); if (counter++ == index) style = styleS; else style = styleN; sCharsHtml += htmlb_hed_makeBackgroundColorPopupCell("urSTbvCellCritDark urBtnStd", style, sId, tableId, counter-1, htmlb_hed_ti_scope.NONE); if (counter++ == index) style = styleS; else style = styleN; sCharsHtml += htmlb_hed_makeBackgroundColorPopupCell("urSTbvCellBadLight urBtnStd", style, sId, tableId, counter-1, htmlb_hed_ti_scope.NONE); if (counter++ == index) style = styleS; else style = styleN; sCharsHtml += htmlb_hed_makeBackgroundColorPopupCell("urSTbvCellBadMedium urBtnStd", style, sId, tableId, counter-1, htmlb_hed_ti_scope.NONE); if (counter++ == index) style = styleS; else style = styleN; sCharsHtml += htmlb_hed_makeBackgroundColorPopupCell("urSTbvCellBadDark urBtnStd", style, sId, tableId, counter-1, htmlb_hed_ti_scope.NONE); if (counter++ == index) style = styleS; else style = styleN; sCharsHtml += htmlb_hed_makeBackgroundColorPopupCell("urSTbvCellNeg urBtnStd", style, sId, tableId, counter-1, htmlb_hed_ti_scope.NONE); sCharsHtml += ""; sCharsHtml += ""; if (counter++ == index) style = styleS; else style = styleN; sCharsHtml += htmlb_hed_makeBackgroundColorPopupCell("urCellBgPlain urBtnStd", style, sId, tableId, counter-1, htmlb_hed_ti_scope.NONE); if (counter++ == index) style = styleS; else style = styleN; sCharsHtml += htmlb_hed_makeBackgroundColorPopupCell("urSTbvCellSubtotLight urBtnStd", style, sId, tableId, counter-1, htmlb_hed_ti_scope.NONE); if (counter++ == index) style = styleS; else style = styleN; sCharsHtml += htmlb_hed_makeBackgroundColorPopupCell("urSTbvCellSubtot urBtnStd", style, sId, tableId, counter-1, htmlb_hed_ti_scope.NONE); if (counter++ == index) style = styleS; else style = styleN; sCharsHtml += htmlb_hed_makeBackgroundColorPopupCell("urSTbvCellTot urBtnStd", style, sId, tableId, counter-1, htmlb_hed_ti_scope.NONE); if (counter++ == index) style = styleS; else style = styleN; sCharsHtml += htmlb_hed_makeBackgroundColorPopupCell("urSTbvCellGoodLight urBtnStd", style, sId, tableId, counter-1, htmlb_hed_ti_scope.NONE); if (counter++ == index) style = styleS; else style = styleN; sCharsHtml += htmlb_hed_makeBackgroundColorPopupCell("urSTbvCellGoodMedium urBtnStd", style, sId, tableId, counter-1, htmlb_hed_ti_scope.NONE); if (counter++ == index) style = styleS; else style = styleN; sCharsHtml += htmlb_hed_makeBackgroundColorPopupCell("urSTbvCellGoodDark urBtnStd", style, sId, tableId, counter-1, htmlb_hed_ti_scope.NONE); if (counter++ == index) style = styleS; else style = styleN; sCharsHtml += htmlb_hed_makeBackgroundColorPopupCell("urSTbvCellPos urBtnStd", style, sId, tableId, counter-1, htmlb_hed_ti_scope.NONE); sCharsHtml += ""; sCharsHtml += ""; if (counter++ == index) style = styleS; else style = styleN; sCharsHtml += htmlb_hed_makeBackgroundColorPopupCell("urRIValueUnrated urBtnStd", style, sId, tableId, counter-1, htmlb_hed_ti_scope.NONE); if (counter++ == index) style = styleS; else style = styleN; sCharsHtml += htmlb_hed_makeBackgroundColorPopupCell("urCellBgFill2 urBtnStd", style, sId, tableId, counter-1, htmlb_hed_ti_scope.NONE); if (counter++ == index) style = styleS; else style = styleN; sCharsHtml += htmlb_hed_makeBackgroundColorPopupCell("urGrpBdyWeb1 urBtnStd", style, sId, tableId, counter-1, htmlb_hed_ti_scope.NONE); if (counter++ == index) style = styleS; else style = styleN; sCharsHtml += htmlb_hed_makeBackgroundColorPopupCell("urCellBgFill1 urBtnStd", style, sId, tableId, counter-1, htmlb_hed_ti_scope.NONE); if (counter++ == index) style = styleS; else style = styleN; sCharsHtml += htmlb_hed_makeBackgroundColorPopupCell("urPrInNeutral urBtnStd", style, sId, tableId, counter-1, htmlb_hed_ti_scope.NONE); if (counter++ == index) style = styleS; else style = styleN; sCharsHtml += htmlb_hed_makeBackgroundColorPopupCell("urVwsRowSel urBtnStd", style, sId, tableId, counter-1, htmlb_hed_ti_scope.NONE); if (counter++ == index) style = styleS; else style = styleN; sCharsHtml += htmlb_hed_makeBackgroundColorPopupCell("urCellBgBorder urBtnStd", style, sId, tableId, counter-1, htmlb_hed_ti_scope.NONE); if (counter++ == index) style = styleS; else style = styleN; sCharsHtml += htmlb_hed_makeBackgroundColorPopupCell("urSTbvCellAlt urBtnStd", style, sId, tableId, counter-1, htmlb_hed_ti_scope.NONE); sCharsHtml += ""; sCharsHtml += ""; if (counter++ == index) style = styleS; else style = styleN; sCharsHtml += htmlb_hed_makeBackgroundColorPopupCell("urCellBgFill3 urBtnStd", style, sId, tableId, counter-1, htmlb_hed_ti_scope.NONE); if (counter++ == index) style = styleS; else style = styleN; sCharsHtml += htmlb_hed_makeBackgroundColorPopupCell("urSTbvCellGrpLvl3 urBtnStd", style, sId, tableId, counter-1, htmlb_hed_ti_scope.NONE); if (counter++ == index) style = styleS; else style = styleN; sCharsHtml += htmlb_hed_makeBackgroundColorPopupCell("urSTbvCellGrpLvl2 urBtnStd", style, sId, tableId, counter-1, htmlb_hed_ti_scope.NONE); if (counter++ == index) style = styleS; else style = styleN; sCharsHtml += htmlb_hed_makeBackgroundColorPopupCell("urSTbvCellGrpLvl1 urBtnStd", style, sId, tableId, counter-1, htmlb_hed_ti_scope.NONE); if (counter++ == index) style = styleS; else style = styleN; sCharsHtml += htmlb_hed_makeBackgroundColorPopupCell("urCellBgHeader urBtnStd", style, sId, tableId, counter-1, htmlb_hed_ti_scope.NONE); if (counter++ == index) style = styleS; else style = styleN; sCharsHtml += htmlb_hed_makeBackgroundColorPopupCell("urSTbvCellKeyMedium urBtnStd", style, sId, tableId, counter-1, htmlb_hed_ti_scope.NONE); if (counter++ == index) style = styleS; else style = styleN; sCharsHtml += htmlb_hed_makeBackgroundColorPopupCell("urSTbvCellGrpHL urBtnStd", style, sId, tableId, counter-1, htmlb_hed_ti_scope.NONE); if (counter++ == index) style = styleS; else style = styleN; sCharsHtml += htmlb_hed_makeBackgroundColorPopupCell("urSTbvCellGrpHLLight urBtnStd", style, sId, tableId, counter-1, htmlb_hed_ti_scope.NONE); sCharsHtml += ""; sCharsHtml += ""; sCharsHtml += ""; sCharsHtml += ""; sCharsHtml += "
"; sCharsHtml += ""; sCharsHtml += ""; sCharsHtml += txtMap["TXT_HTMLB_HED_CANCEL"]; sCharsHtml += ""; sCharsHtml += "
"; sCharsHtml += "
"; sCharsHtml += ""; oPopup.innerHTML=sCharsHtml; return oPopup; } function htmlb_hed_colorSelect_cancel(popup){ hidePopupMenu(); } htmlb_hed_ur_txcolors = new Array('#ffffff','#dddddd','#c0c0c0','#969696','#808080','#646464','#4b4b4b','#242424','#000000','#00ffff','#00ccff','#0099cc','#00cc99','#009966','#009900','#00cc00','#00ff00','#00ff66','#99ffff','#99ccff','#9999cc','#99cc99','#999966','#999900','#99cc00','#99ff00','#99ff66','#ccffff','#ffccff','#ff99cc','#ffcc99','#ff9966','#ff9900','#ffcc00','#ffff00','#ffff66','#ff66ff','#ff33ff','#ff00cc','#ff3399','#ff0066','#ff0000','#ff3300','#ff6600','#ff6666','#9966ff','#9933ff','#9900cc','#993399','#990066','#990000','#993300','#996600','#996666','#0066ff','#0033ff','#0000cc','#003399','#000066','#330033','#003300','#006600','#006666'); function htmlb_hed_hasTextColor(color){ for (j=0; j "; return sContent; } function htmlb_hed_makeTextColorPopup(sId){ var oPopup = document.getElementById("htmlb_hed_selTextColor_popup"); if (!oPopup) { var oBody = document.getElementsByTagName("BODY")[0]; var editor = document.getElementById(sId); editor._offsetY=editor.scrollTop; editor._offsetX=editor.scrollLeft; oPopup = document.createElement("SPAN"); oPopup.id="htmlb_hed_selTextColor_popup"; oPopup.style.position="absolute"; oPopup.style.left="-1999px"; oPopup.style.top="-1999px"; oBody.appendChild(oPopup); setTimeout("htmlb_hed_adapt_offset('"+editor.id+"')", 50); } var txtMap = htmlb_hed_txt[ur_language]; var index = -1, counter = 0; if (editRange!=null) { var pElement; if (editRange.length) { pElement = editRange[0]; }else{ pElement = editRange.parentElement(); } while (pElement && pElement.tagName == "FONT" && (index = htmlb_hed_hasTextColor(pElement.color)) == -1){ pElement = pElement.parentElement; } } var styleS = "width:100%;border-width:2px!important;background-color:"; var styleN = "width:100%;background-color:"; var sCharsHtml = ""; sCharsHtml += ""; sCharsHtml += ""; sCharsHtml += "
"+txtMap["TXT_HTMLB_TXT_FGCOLOR"]+"
"; sCharsHtml += ""; sCharsHtml += ""; sCharsHtml += "
"; sCharsHtml += ""; sCharsHtml += ""; sCharsHtml += ""; sCharsHtml += htmlb_hed_makeTextColorPopupCell(counter++, index, sId, htmlb_hed_ti_scope.START); for (i=1;i<9;i++) sCharsHtml += htmlb_hed_makeTextColorPopupCell(counter++, index, sId, htmlb_hed_ti_scope.NONE); sCharsHtml += ""; sCharsHtml += ""; for (i=0;i<9;i++) sCharsHtml += htmlb_hed_makeTextColorPopupCell(counter++, index, sId, htmlb_hed_ti_scope.NONE); sCharsHtml += ""; sCharsHtml += ""; for (i=0;i<9;i++) sCharsHtml += htmlb_hed_makeTextColorPopupCell(counter++, index, sId, htmlb_hed_ti_scope.NONE); sCharsHtml += ""; sCharsHtml += ""; for (i=0;i<9;i++) sCharsHtml += htmlb_hed_makeTextColorPopupCell(counter++, index, sId, htmlb_hed_ti_scope.NONE); sCharsHtml += ""; sCharsHtml += ""; for (i=0;i<9;i++) sCharsHtml += htmlb_hed_makeTextColorPopupCell(counter++, index, sId, htmlb_hed_ti_scope.NONE); sCharsHtml += ""; sCharsHtml += ""; for (i=0;i<9;i++) sCharsHtml += htmlb_hed_makeTextColorPopupCell(counter++, index, sId, htmlb_hed_ti_scope.NONE); sCharsHtml += ""; sCharsHtml += ""; for (i=0;i<9;i++) sCharsHtml += htmlb_hed_makeTextColorPopupCell(counter++, index, sId, htmlb_hed_ti_scope.NONE); sCharsHtml += ""; sCharsHtml += ""; sCharsHtml += ""; sCharsHtml += ""; sCharsHtml += "
"; sCharsHtml += ""; sCharsHtml += ""; sCharsHtml += txtMap["TXT_HTMLB_HED_CANCEL"]; sCharsHtml += ""; sCharsHtml += "
"; sCharsHtml += "
"; sCharsHtml += "
"; oPopup.innerHTML=sCharsHtml; return oPopup; } function htmlb_hed_txcolor_val_click(aref, sId){ var editor = document.getElementById(sId); hidePopupMenu(); htmlb_hed_stackForUndo(editor); if (editRange!=null&&editRange.parentElement()!=null){ var color=aref.title; var pasteStr; if (editRange.text!=""){ editRange.execCommand('ForeColor', false, color); node = editRange.parentElement(); htmlb_hed_adaptSpanElemColor(node, color); }else{ /*var p = editRange.parentElement(); var span = editor.document.createElement('SPAN'); span.style.color = color; editor.document.appendChild(span);*/ pasteStr = " "; pasteStr += ""; editRange.pasteHTML(pasteStr); } } } function htmlb_hed_bkcolor_val_click(aref, sId, tableCellId){ var style=aref.className; style=style.replace(/urBtnStd/,""); style=style.replace(/^\s*|\s*$/g,""); // trim() if (style == "urSTbvCellTrans urCellBgPlain"){ if (tableCellId != "undefined") style = "urSTWhlTrans urSTbvCellTransStd urTxtStd"; else style = "urSTWhlTrans urCellBgPlain"; } if (tableCellId != "" && tableCellId != "undefined"){ hidePopupMenu(); ghtmlb_hed_stack_colorRange = style; ghtmlb_hed_stack_colorNum = aref.currentStyle.backgroundColor; var oPopupContent=htmlb_hed_makeTableCellPropDialog(tableCellId, false, sId); var arrUrls = new Array(getUrCss()); var oPopup = new sapPopup(window,arrUrls,oPopupContent,document.getElementById(sId),window.event,0); oPopup.content.size = oPopupContent; oPopup.positionbehavior = sapPopupPositionBehavior.BROWSERCENTER; oPopup.onblur = hidePopupMenu; oPopup.show = htmlb_hed_Popup_show_nofocus; window.onfocus = hidePopupMenu; oPopup.show(true); return false; } var editor = document.getElementById(sId); editor._offsetY=editor.scrollTop; editor._offsetX=editor.scrollLeft; htmlb_hed_hidePopupMenu(); htmlb_hed_stackForUndo(editor); if (editRange!=null&&editRange.parentElement()!=null){ var pasteStr; document.createStyleSheet(getUrCss()); if (editRange.text!=""){ var cutoff=editRange.htmlText, _token; for (ii=0;ii"; pasteStr += cutoff; pasteStr += ""; editRange.pasteHTML(pasteStr); }else{ editRange.execCommand('BackColor', false, aref.currentStyle.backgroundColor); } }else{ if (editor._usePortalStyle){ pasteStr = " "; }else{ pasteStr = " "; } pasteStr += ""; editRange.pasteHTML(pasteStr); } } setTimeout("htmlb_hed_adapt_offset('"+editor.id+"')", 50); } function htmlb_hed_MnuToggleClickTextSize(sId, size, sizeToken){ var sizeAttr = new Array("xx-small","x-small","small","medium","large","x-large","xx-large"); var editor = document.getElementById(sId); hidePopupMenu(); htmlb_hed_stackForUndo(editor); if (editRange!=null){ if (editRange.text!=""){ editRange.execCommand('RemoveFormat'); editRange.execCommand('FontSize',0,size); var _content = editRange.htmlText; var _regEx = /class[\s]*=[\s]*['"]*[^'"]+['"]*/g var _result = _regEx.exec(_content); var pasteStr = ""; pasteStr += _content; pasteStr += ""; var _result=""; if (_content.search("SPAN")!=-1){ var myArray = _content.split(/ "; pasteStr += ""; editRange.pasteHTML(pasteStr); } } } htmlb_hed_editor_sizes=new Array(); function htmlb_hed_expPanel_onclick(image, id){ var idStr=id + "htmlbeditor"; var editor = document.getElementById(id + "htmlbeditor"); if (image.className == "urTbarBtnCol urSTbvCellGrpLvl3"){ image.className = "urTbarBtnExp urSTbvCellGrpLvl3"; htmlb_hed_editor_hsize = editor.parentElement.parentElement.parentElement.parentElement.offsetWidth; editor.parentElement.parentElement.parentElement.parentElement.style.pixelWidth = document.body.clientWidth-40; editor._expanded = true; }else{ image.className = "urTbarBtnCol urSTbvCellGrpLvl3"; editor.parentElement.parentElement.parentElement.parentElement.style.pixelWidth = htmlb_hed_editor_hsize; editor._expanded = false; } } function htmlb_hed_doModTableStyle(editor, sColor, errorText){ try { editor.focus(); var objRef=null; var selectedRange; var selType = editor.document.selection.type; selectedRange = editor.document.selection.createRange(); if (selType=='Control'){ if (selectedRange.length > 0 ){ selectedRange = selectedRange.item(0); selectedRange.className=sColor; for(i=0; i"; sSizerHtml += ""; sSizerHtml += ""; sSizerHtml += ""; sSizerHtml += ""; sSizerHtml += ""; sSizerHtml += ""; sSizerHtml += ""; sSizerHtml += ""; sSizerHtml += ""; sSizerHtml += ""; sSizerHtml += ""; sSizerHtml += ""; sSizerHtml += ""; sSizerHtml += ""; sSizerHtml += ""; sSizerHtml += ""; sSizerHtml += "
"; sSizerHtml += ""; sSizerHtml += ""; sSizerHtml += txtMap["TXT_HTMLB_HED_MOD_CELL"]; sSizerHtml += ""; sSizerHtml += "
"; sSizerHtml += "
"; sSizerHtml += ""; sSizerHtml += ""; sSizerHtml += ""; sSizerHtml += ""; sSizerHtml += ""; sSizerHtml += ""; sSizerHtml += ""; sSizerHtml += ""; sSizerHtml += ""; sSizerHtml += ""; sSizerHtml += ""; sSizerHtml += "
 
"; sSizerHtml += ""; sSizerHtml += ""; sSizerHtml += ""; sSizerHtml += ""; sSizerHtml += ""; sSizerHtml += ""; sSizerHtml += ""; sSizerHtml += ""; sSizerHtml += ""; sSizerHtml += ""; sSizerHtml += ""; sSizerHtml += "
=0){ modWidthUnit=1; modWidth=cell.width.substring(0, unitIndx); }else{ modWidthUnit=2; modWidth=cell.width; } }else{ modWidthUnit=1; modWidth=""; } // padding... if (cell.style.paddingTop != ""){ modPadTop=cell.style.paddingTop; }else{ modPadTop=cell.currentStyle.paddingTop; } modPadTop=modPadTop.replace("px", ""); if (cell.style.paddingRight != ""){ modPadRight=cell.style.paddingRight; }else{ modPadRight=cell.currentStyle.paddingRight; } modPadRight=modPadRight.replace("px", ""); if (cell.style.paddingBottom != ""){ modPadBottom=cell.style.paddingBottom; }else{ modPadBottom=cell.currentStyle.paddingBottom; } modPadBottom=modPadBottom.replace("px", ""); if (cell.style.paddingLeft != ""){ modPadLeft=cell.style.paddingLeft; }else{ modPadLeft=cell.currentStyle.paddingLeft; } modPadLeft=modPadLeft.replace("px", ""); // align... var _hal, _val; if (cell.align != ""){ _hal = cell.align; }else{ _hal = cell.currentStyle.textAlign; } switch(_hal){ case 'center': modHAlign=1; break; case 'left': modHAlign=2; break; case 'right': modHAlign=3; break; default: modHAlign=0; } if (cell.vAlign != ""){ _val = cell.vAlign; }else{ _val = cell.currentStyle.verticalAlign; } switch(_val){ case 'baseline': modVAlign=1; break; case 'bottom': modVAlign=2; break; case 'top': modVAlign=3; break; default: modVAlign=0; //middle } ghtmlb_hed_stack_colorRange=""; ghtmlb_hed_stack_colorNum=""; for (i=0;i "; /*TB*/ sSizerHtml += ""; sSizerHtml += ""; /*L1*/ sSizerHtml += ""; sSizerHtml += ""; sSizerHtml += "";/*L1*/ sSizerHtml += ""; /*L2*/ // hor.select sSizerHtml += ""; sSizerHtml += ""; /*TB*/ sSizerHtml += ""; //LINE //------------------------------------------------ (2) sSizerHtml += ""; sSizerHtml += ""; sSizerHtml += ""; sSizerHtml += ""; sSizerHtml += ""; sSizerHtml += ""; sSizerHtml += ""; sSizerHtml += ""; sSizerHtml += ""; sSizerHtml += ""; sSizerHtml += ""; sSizerHtml += ""; sSizerHtml += ""; sSizerHtml += ""; sSizerHtml += ""; sSizerHtml += ""; sSizerHtml += ""; sSizerHtml += ""; sSizerHtml += ""; sSizerHtml += ""; sSizerHtml += ""; sSizerHtml += ""; sSizerHtml += "
"; sSizerHtml += ""; sSizerHtml += ""; sSizerHtml += ""; sSizerHtml += "
"; sSizerHtml += ""; sSizerHtml += ""; sSizerHtml += ""; /*TB*/ sSizerHtml += ""; sSizerHtml += ""; /*L1*/ sSizerHtml += ""; sSizerHtml += ""; sSizerHtml += ""; sSizerHtml += ""; sSizerHtml += "";/*L1*/ sSizerHtml += ""; /*L2*/ // top padd. sSizerHtml += ""; // right padd. sSizerHtml += ""; // Bottom padd. sSizerHtml += ""; // left padd. sSizerHtml += ""; sSizerHtml += ""; /*L2*/ sSizerHtml += "
"; sSizerHtml += ""; sSizerHtml += ""; sSizerHtml += ""; sSizerHtml += ""; sSizerHtml += ""; sSizerHtml += ""; sSizerHtml += ""; sSizerHtml += "
"; sSizerHtml += ""; sSizerHtml += ""; sSizerHtml += ""; sSizerHtml += "
"; sSizerHtml += "
"; sSizerHtml += ""; sSizerHtml += ""; sSizerHtml += ""; sSizerHtml += ""; sSizerHtml += "
 "; sSizerHtml += " "; sSizerHtml += ""; sSizerHtml += txtMap["TXT_HTMLB_HED_SELECT"]; sSizerHtml += ""; sSizerHtml += ""; sSizerHtml += "
"; sSizerHtml += ""; sSizerHtml += ""; sSizerHtml += ""; sSizerHtml += ""; sSizerHtml += "
"; sSizerHtml += ""; sSizerHtml += ""; sSizerHtml += "
"; sSizerHtml += ""; sSizerHtml += ""; sSizerHtml += "
 
"; sSizerHtml += ""; sSizerHtml += ""; sSizerHtml += "
"; sSizerHtml += ""; sSizerHtml += ""; sSizerHtml += txtMap["TXT_HTMLB_HED_OK"]; sSizerHtml += ""; sSizerHtml += ""; sSizerHtml += ""; sSizerHtml += txtMap["TXT_HTMLB_HED_APPLY"]; sSizerHtml += ""; sSizerHtml += ""; sSizerHtml += txtMap["TXT_HTMLB_HED_CANCEL"]; sSizerHtml += ""; sSizerHtml += "
"; sSizerHtml += "
"; sSizerHtml += ""; sSizerHtml += "
"; sSizerHtml += "
"; oPopup.innerHTML=sSizerHtml; return oPopup; } function htmlb_hed_launchContextMenu(sId, control){ try { var o=control.document.parentWindow.event; var oPopupContent=htmlb_hed_makeContextMenuPopup(sId); var arrUrls = new Array(getUrCss()); var oPopup = new sapPopup(window,arrUrls,oPopupContent,control,o,0); oPopup.show = htmlb_hed_PopupContextMenu_show oPopup.onblur = hidePopupMenu; window.onfocus = hidePopupMenu; oPopup.show(true); } catch(ex){ alert(ex); } return false; } function htmlb_hed_makeContextMenuPopup(sId){ var txtMap = htmlb_hed_txt[ur_language]; var menu = [ [true, 'CUT', txtMap["TXT_HTMLB_HED_CUT"], true], [true, 'COPY', txtMap["TXT_HTMLB_HED_COPY"], true], [true, 'PASTE', txtMap["TXT_HTMLB_HED_PASTE"], true], [true, 'DIV', "", true], [true, 'SELALL', txtMap["TXT_HTMLB_HED_SELALL"], true], [true, 'DIV', "", true], [true, 'UNDO', txtMap["TXT_HTMLB_UNDO"], false], [true, 'REDO', txtMap["TXT_HTMLB_REDO"], false], [false, 'DIV', "", true], [false, 'TABLEPROP', txtMap["TXT_HTMLB_TABLEPROP"], true], [false, 'CELLPROP', txtMap["TXT_HTMLB_TABLECELLPROP"], true], [false, 'IMGPROP', txtMap["TXT_HTMLB_IMAGEPROP"], true], [false, 'LINKPROP', txtMap["TXT_HTMLB_LINKPROP"], true], [false, 'DIV', "", true], [false, 'INSROW', txtMap["TXT_HTMLB_INSERTTABLEROW"], true], [false, 'DELROW', txtMap["TXT_HTMLB_DELETETABLEROW"], true], [false, 'INSCOL', txtMap["TXT_HTMLB_INSERTTABLECOL"], true], [false, 'DELCOL', txtMap["TXT_HTMLB_DELETETABLECOL"], true] //['MGRI', txtMap["TXT_HTMLB_MG_CELL_RIGHT"]], //['MGLE', txtMap["TXT_HTMLB_MG_CELL_LEFT"]], //['MGUP', txtMap["TXT_HTMLB_MG_CELL_UP"]], //['MGDW', txtMap["TXT_HTMLB_MG_CELL_DOWN"]] ]; var selectedIndex=-1; var editor = document.getElementById(sId + "htmlbeditor"); var oPopup = document.getElementById("htmlb_hed_context_menu_popup"); if (!oPopup) { var oBody = document.getElementsByTagName("BODY")[0]; editor._offsetY=editor.scrollTop; editor._offsetX=editor.scrollLeft; oPopup = document.createElement("SPAN"); oPopup.id="htmlb_hed_context_menu_popup"; oPopup.style.position="absolute"; oPopup.style.left="-1999px"; oPopup.style.top="-1999px"; oBody.appendChild(oPopup); setTimeout("htmlb_hed_adapt_offset('"+editor.id+"')", 50); } var tableCellScope = htmlb_hed_hasTableCellScope(editor); var tableScope = htmlb_hed_hasTableScope(editor); var imageScope = htmlb_hed_hasImageScope(editor); var linkScope = htmlb_hed_hasLinkScope(editor); var undoLength = ghtmlb_hed_undoMap[editor.id].length; var redoLength = ghtmlb_hed_redoMap[editor.id].length; for (i=0;i0&&menu[i][1]=="UNDO") menu[i][3] = true; if (redoLength>0&&menu[i][1]=="REDO") menu[i][3] = true; } var sCharsHtml = ""; this.selId=10; for (j=0; j"; }else{ sCharsHtml += ""; } } sCharsHtml += "
"; sCharsHtml += ""; sCharsHtml += ""; sCharsHtml += " "; sCharsHtml += ""; sCharsHtml += "
"; oPopup.innerHTML=sCharsHtml; return oPopup; } function htmlb_hed_PopupContextMenu_show(bDoNotAutoFocus) { var sourceoffset = getAbsolutePosition(this.source.object); this.position.left = sourceoffset.left; this.position.top = sourceoffset.top; this.positionbehavior = sapPopupPositionBehavior.EVENT; this.poscalc(); this.position.left = this.source.event.x + sourceoffset.left; this.position.top = this.source.event.y + sourceoffset.top; if (this.onbeforerender) { if (!this.onbeforerender(this)) return; } if (!this.canrender) { showError("Cannot render Popup. Sizes and positions are not set."); return; } if (this.frame.window.mylevel==null) { this.write(bDoNotAutoFocus); } else { this.frame.window.document.getElementsByTagName("DIV").item(0).innerHTML=this.content.html; } if (bDoNotAutoFocus) { } else { //this.frame.window.document.body.focus(); } if (ur_system.direction=="rtl") this.frame.object.style.right = this.position.right+"px"; else this.frame.object.style.left = this.position.left+"px"; this.frame.object.style.top = this.position.top+"px"; this.frame.object.style.width = this.size.width+"px"; this.frame.object.style.height = this.size.height+"px"; return true; } function htmlb_hed_MnuToggleClickContextMenuItem(sId, cmd){ hidePopupMenu(); var editor = document.getElementById(sId + "htmlbeditor"); editRange=document.getElementById(sId + "htmlbeditor").document.selection.createRange(); var txtMap = htmlb_hed_txt[ur_language]; var elem; switch (cmd){ case 'CUT': htmlb_hed_stackForUndo(editor); editor.document.execCommand('Cut', false); break; case 'COPY': editor.document.execCommand('Copy', false); break; case 'PASTE': editor.document.execCommand('Paste', false); htmlb_hed_stackForUndo(editor); break; case 'SELALL': editor.document.execCommand('SelectAll', false); break; case 'INSROW': doInsertTableRowAction(sId, txtMap["TXT_HTMLB_HED_SEL_CELL"]); break; case 'DELROW': doDeleteTableRowAction(sId, txtMap["TXT_HTMLB_HED_SEL_CELL"]); break; case 'INSCOL': doInsertTableColumnAction(sId, txtMap["TXT_HTMLB_HED_SEL_CELL"]); break; case 'DELCOL': doDeleteTableColumnAction(sId, txtMap["TXT_HTMLB_HED_SEL_CELL"]); break; case 'UNDO': htmlb_hed_update_for_undo(editor.id); break; case 'REDO': htmlb_hed_update_for_redo(editor.id); break; case 'TABLEPROP': var selType = editor.document.selection.type; if (selType == 'Control'){ elem=editRange(0); if (elem.tagName.toUpperCase() == "TABLE"){ var id=elem.id; if (id == ""){ htmlb_hed_cleanTableStyle(elem); id = htmlb_hed_refreshTableIds(elem); } var oPopupContent=htmlb_hed_makeTablePropDialog(id, false, editor.id); var arrUrls = new Array(getUrCss()); var oPopup = new sapPopup(window,arrUrls,oPopupContent,document.getElementById(id),window.event,0); oPopup.content.size = oPopupContent; oPopup.positionbehavior = sapPopupPositionBehavior.BROWSERCENTER; oPopup.onblur = hidePopupMenu; oPopup.show = htmlb_hed_Popup_show_nofocus; window.onfocus = hidePopupMenu; oPopup.show(true); } } break; case 'CELLPROP': elem = htmlb_hed_getRangeRef(editor); if (elem){ elem = htmlb_hed_matchTag(editor, elem, "^TD"); if(elem && elem.tagName.toUpperCase() == "TD") { var id=elem.id; if (id == ""){ htmlb_hed_cleanTableStyle(elem); id = htmlb_hed_refreshTableIds(elem); } // create here the Table Cell mod dialog... var oPopupContent=htmlb_hed_makeTableCellPropDialog(id, true, editor.id); var arrUrls = new Array(getUrCss()); var oPopup = new sapPopup(window,arrUrls,oPopupContent,document.getElementById(id),window.event,0); oPopup.content.size = oPopupContent; oPopup.positionbehavior = sapPopupPositionBehavior.BROWSERCENTER; oPopup.onblur = hidePopupMenu; oPopup.show = htmlb_hed_Popup_show_nofocus; window.onfocus = hidePopupMenu; oPopup.show(true); } } break; case 'IMGPROP': var selType = editor.document.selection.type; if (selType == 'Control'){ elem=editRange(0); if (elem.tagName.toUpperCase() == "IMG"){ if (elem.id=="") elem.id = htmlb_hed_getUniqueId("htmlb_hed_image"); htmlb_hed_launchImagePropPopup(elem.id, editor.id); } } break; case 'LINKPROP': var selType = editor.document.selection.type; if (selType == 'Control'){ elem=editRange(0); if (elem.tagName.toUpperCase() == "IMG"){ var elemTag = htmlb_hed_matchTag(null, elem, "^A"); if (elemTag&&elemTag.tagName=="A"){ if (elemTag.id=="") elemTag.id = htmlb_hed_getUniqueId("htmlb_hed_link"); htmlb_hed_launchLinkPropPopup(editor.id, elemTag.id, false, "", true); } } }else{ elem = editRange.parentElement(); if (elem.tagName == 'A') { if (elem.id=="") elem.id = htmlb_hed_getUniqueId("htmlb_hed_link"); htmlb_hed_launchLinkPropPopup(editor.id, elem.id, false, "", false); }else{ var elemTag = htmlb_hed_matchTag(null, elem, "^A"); if (elemTag&&elemTag.tagName=="A"){ if (elemTag.id=="") elemTag.id = htmlb_hed_getUniqueId("htmlb_hed_link"); htmlb_hed_launchLinkPropPopup(editor.id, elemTag.id, false, "", false); } } } break; } // switch... } function htmlb_hed_hasTableCellScope(editor) { var objRef = htmlb_hed_getRangeRef(editor); if(objRef==null){ return false; } if (objRef.tagName=="TD"||objRef.tagName=="TR"||objRef.tagName=="TBODY"){ return true; }else{ var elemTag = htmlb_hed_matchTag(null, objRef, "^TD"); if (elemTag&&elemTag.tagName=="TD") return true; } return false; } function htmlb_hed_hasTableScope(editor) { var selType = editor.document.selection.type; if (selType == 'Control'){ var selectedRange = editor.document.selection.createRange(); if(selectedRange(0).tagName.toUpperCase() == "TABLE") return true; } return false; } function htmlb_hed_hasImageScope(editor) { var selType = editor.document.selection.type; if (selType == 'Control'){ var selectedRange = editor.document.selection.createRange(); if(selectedRange(0).tagName.toUpperCase() == "IMG") return true; } return false; } function htmlb_hed_hasLinkScope(editor) { var selType = editor.document.selection.type; var selectedRange = editor.document.selection.createRange(); if (selType == 'Control'){ if(selectedRange(0).tagName.toUpperCase() == "IMG"){ var elem = selectedRange(0); var elemTag = htmlb_hed_matchTag(null, elem, "^A"); if (elemTag&&elemTag.tagName=="A") return true; } }else{ elem = selectedRange.parentElement(); if (elem){ var elemTag = htmlb_hed_matchTag(null, elem, "^A"); if (elemTag&&elemTag.tagName=="A") return true; } } return false; } function htmlb_hed_adaptSpanElemColor(elem, color){ if (node && node.hasChildNodes){ var childNode = node.firstChild; if (childNode.tagName == "SPAN"){ childNode.style.color = color; } for (var i = 1; childNode = childNode.nextSibling; ++i){ if (childNode.tagName == "SPAN"){ childNode.style.color = color; if (childNode.hasChildNodes){ htmlb_hed_adaptSpanElemColorR(childNode.firstChild, color); } } } } } function htmlb_hed_adaptSpanElemColorR(childNode, color){ if (childNode.tagName == "SPAN"){ childNode.style.color = color; } for (var i = 1; childNode = childNode.nextSibling; ++i){ if (childNode.tagName == "SPAN"){ childNode.style.color = color; if (childNode.hasChildNodes){ htmlb_hed_adaptSpanElemColorR(childNode.firstChild, color); } } } } function htmlb_hed_adaptSpanElemClass(elem, cn){ if (node && node.hasChildNodes){ var childNode = node.firstChild; //if (childNode.tagName == "SPAN"){ childNode.className = cn; //} for (var i = 1; childNode = childNode.nextSibling; ++i){ //if (childNode.tagName == "SPAN"){ childNode.className = cn; if (childNode.hasChildNodes){ htmlb_hed_adaptSpanElemClassR(childNode.firstChild, cn); } //} } } } function htmlb_hed_adaptSpanElemClassR(childNode, cn){ //if (childNode.tagName == "SPAN"){ childNode.className = cn; //} for (var i = 1; childNode = childNode.nextSibling; ++i){ //if (childNode.tagName == "SPAN"){ childNode.className = cn; if (childNode.hasChildNodes){ htmlb_hed_adaptSpanElemClassR(childNode.firstChild, cn); } //} } } function htmlb_hed_table_cell_color_modify(popup, sId, colorRangeId, tableCellId){ htmlb_hed_doInsertTextBackgroundColorPopup(sId.replace("htmlbeditor",""), this, true, colorRangeId, tableCellId); } function htmlb_hed_bkcolorSelect_cancel(popup){ htmlb_hed_hidePopupMenu(popup); } function htmlb_hed_hidePopupMenu(content){ if (sapPopupStore[1]){ sapPopupStore[1].hide(); }else{ hidePopupMenu(); } if (g_sLastUsedToolbarId != ""){ oObj = ur_get(g_sLastUsedToolbarId); if (oObj){ ur_focus(oObj); ur_focus(oObj); g_sLastUsedToolbarId = ""; } } return false; } function htmlb_hed_tablecell_stack_for_popups(width, widthUnit, halign, valign, padTop, padRight, padBottom, padLeft, wholeRow, wholeCol, allCols){ ghtmlb_hed_stack_width = width; ghtmlb_hed_stack_widthUnit = widthUnit; switch(halign){ case 'center': ghtmlb_hed_stack_halign=1; break; case 'left': ghtmlb_hed_stack_halign=2; break; case 'right': ghtmlb_hed_stack_halign=3; break; default: ghtmlb_hed_stack_halign=0; } switch(valign){ case 'baseline': ghtmlb_hed_stack_valign=1; break; case 'bottom': ghtmlb_hed_stack_valign=2; break; case 'top': ghtmlb_hed_stack_valign=3; break; default: ghtmlb_hed_stack_padTop = padTop; } ghtmlb_hed_stack_padRight = padRight; ghtmlb_hed_stack_padBottom = padBottom; ghtmlb_hed_stack_padLeft = padLeft; ghtmlb_hed_stack_wholeCol = wholeCol; ghtmlb_hed_stack_wholeRow = wholeRow; ghtmlb_hed_stack_allCols = allCols; } function htmlb_hed_tablecell_modify(sId, width, widthUnit, halign, valign, padTop, padRight, padBottom, padLeft, colorStyle, editorId, wholeRow, wholeCol, allCols){ editor = document.getElementById(editorId); if (editor){ htmlb_hed_stackForUndo(editor); } var cell=document.getElementById(sId); hidePopupMenu(); if(cell){ htmlb_hed_tablecell_apply(sId, width, widthUnit, halign, valign, padTop, padRight, padBottom, padLeft, colorStyle, wholeRow, wholeCol, allCols, editorId); cell.focus(); } /*if(cell){ var style = ghtmlb_hed_stack_colorRange; var myTable = document.getElementById(sId.substring(0, sId.indexOf(":"))); if (myTable&&myTable.border == 0) style += " urTxtStd"; else style += " urSTbvCellStd urTxtStd"; cell.className = style; if (width!=""&&width!="undefined"){ if (width == "0"){ cell.width = ""; }else{ if (widthUnit=="%") cell.width = width+" %"; else cell.width = width; } } if (padTop!=""){ if (padTop!=0)cell.style.paddingTop = padTop; else cell.style.paddingTop = ""; } if (padRight!=""){ if (padRight!=0)cell.style.paddingRight = padRight; else cell.style.paddingRight = ""; } if (padBottom!=""){ if (padBottom!=0)cell.style.paddingBottom = padBottom; else cell.style.paddingBottom = ""; } if (padLeft!=""){ if (padLeft!=0)cell.style.paddingLeft = padLeft; else cell.style.paddingLeft = ""; } // align... if (halign!="")cell.align = halign; if (valign!="")cell.vAlign = valign; cell.focus(); }*/ } function htmlb_hed_tablecell_cancel(sId, width, widthUnit, halign, valign, padTop, padRight, padBottom, padLeft, colorStyle){ var cell=document.getElementById(sId); hidePopupMenu(); var table = document.getElementById(sId.substring(0, sId.indexOf(":"))); if(table){ table.outerHTML = ghtmlb_hed_stack_table; }else{ if(cell){ var style = colorStyle; if (style != ""){ //style += " urSTbvCellStd urTxtStd"; cell.className = style; } if (width!=""&&width!="undefined"){ if (widthUnit=="%") cell.width = width+" %"; else cell.width = width; }else{ if (width=="undefined")width = ""; cell.width=width; } if (padTop!=""&&padTop!=0)cell.style.paddingTop = padTop; else if (padTop==0) cell.style.paddingTop = ""; if (padRight!=""&&padRight!=0)cell.style.paddingRight = padRight; else if (padRight==0) cell.style.paddingRight = ""; if (padBottom!=""&&padBottom!=0)cell.style.paddingBottom = padBottom; else if (padBottom==0) cell.style.paddingBottom = ""; if (padLeft!=""&&padLeft!=0)cell.style.paddingLeft = padLeft; else if (padLeft==0) cell.style.paddingLeft = ""; // align... cell.align = halign; cell.vAlign = valign; } } } function htmlb_hed_tablecell_applyInternal(cell, style, width, widthUnit, halign, valign, padTop, padRight, padBottom, padLeft, useUR){ if (useUR) cell.className = style; else{ cell.bgColor = style; cell.className = ""; } if (width!=""){ if (width == "0"){ cell.width = ""; }else{ if (widthUnit=="%") cell.width = width+" %"; else cell.width = width; } } if (padTop!=""){ if (padTop!=0)cell.style.paddingTop = padTop; else cell.style.paddingTop = ""; } if (padRight!=""){ if (padRight!=0)cell.style.paddingRight = padRight; else cell.style.paddingRight = ""; } if (padBottom!=""){ if (padBottom!=0)cell.style.paddingBottom = padBottom; else cell.style.paddingBottom = ""; } if (padLeft!=""){ if (padLeft!=0)cell.style.paddingLeft = padLeft; else cell.style.paddingLeft = ""; } // align... if (halign!="")cell.align = halign; if (valign!="")cell.vAlign = valign; } function htmlb_hed_tablecell_apply(sId, width, widthUnit, halign, valign, padTop, padRight, padBottom, padLeft, colorStyle, wholeRow, wholeCol, allCols, editorId){ var editor = document.getElementById(editorId); var cell=document.getElementById(sId); var table = document.getElementById(sId.substring(0, sId.indexOf(":"))); if(cell&&table){ var style = ghtmlb_hed_stack_colorRange; if (editor._usePortalStyle){ if (table.border == 0) style += " urTxtStd"; else{ if (style.indexOf("urSTWhlTrans")==-1) style += " urSTbvCellStd urTxtStd"; } }else{ style = ghtmlb_hed_stack_colorNum; } if (allCols){ for(i=0; i"; var titleLine; sSizerHtml += "
"; sSizerHtml += ""; sSizerHtml += "
"; sSizerHtml += "
"; sSizerHtml += ""; sSizerHtml += ""; sSizerHtml += ""; sSizerHtml += ""; sSizerHtml += ""; sSizerHtml += ""; sSizerHtml += ""; } sCharsHtml += "
"; sSizerHtml += ""; if(bInsertMode){ sSizerHtml += ""; sSizerHtml += txtMap["TXT_HTMLB_HED_TITLE_INS_WE"]; titleLine = txtMap["TXT_HTMLB_HED_TITLE_INS_WE"]+" "; sSizerHtml += ""; }else{ sSizerHtml += ""; sSizerHtml += txtMap["TXT_HTMLB_HED_TITLE_MOD_WE"]; titleLine = txtMap["TXT_HTMLB_HED_TITLE_MOD_WE"]; sSizerHtml += ""; } sSizerHtml += "
"; sSizerHtml += "
"; sSizerHtml += ""; sSizerHtml += ""; sSizerHtml += ""; if(bInsertMode){ modText=initText; modURL=""; }else{ var link=document.getElementById(sId); if(link){ var urlTokens = link.outerHTML.split(/href=\"/g); if (urlTokens[1]){ var urlStr = urlTokens[1].substring(0, urlTokens[1].indexOf("\"")); if (urlStr != ""){ link.href = urlStr; } } modText = link.innerText; modURL = link.href; switch(link.target){ case '_blank': modOpenMode=1; break; case '_parent': modOpenMode=2; break; case '_search': modOpenMode=3; break; case '_self': modOpenMode=4; break; case '_top': modOpenMode=5; break; default: modOpenMode=4; } if(!modSaved){//cancel modSaved=true; modTextSaved = modText; modURLSaved = modURL; modOpenModeSaved = link.target; } } } sSizerHtml += ""; sSizerHtml += ""; sSizerHtml += ""; sSizerHtml += ""; sSizerHtml += ""; sSizerHtml += ""; sSizerHtml += ""; sSizerHtml += ""; sSizerHtml += ""; sSizerHtml += ""; sSizerHtml += ""; sSizerHtml += ""; sSizerHtml += ""; sSizerHtml += ""; sSizerHtml += ""; sSizerHtml += ""; sSizerHtml += ""; sSizerHtml += ""; sSizerHtml += "
 
"; sSizerHtml += ""; sSizerHtml += ""; sSizerHtml += ""; sSizerHtml += htmlb_hed_render_input('htmlb_hed_link_text', modText, htmlb_hed_ti_scope.START, titleLine+txtMap["TXT_HTMLB_HED_POPUP_ESC"]+txtMap["TXT_HTMLB_HED_WEB_TEXT"], textReadOnly,55,1024); sSizerHtml += ""; sSizerHtml += "
"; sSizerHtml += ""; sSizerHtml += ""; sSizerHtml += ""; if (textReadOnly) tabIndexBorder = htmlb_hed_ti_scope.START; else tabIndexBorder = htmlb_hed_ti_scope.NONE; sSizerHtml += htmlb_hed_render_input('htmlb_hed_link_url', modURL, tabIndexBorder, txtMap["TXT_HTMLB_HED_WEB_URL"], false,55,1024); sSizerHtml += ""; sSizerHtml += "
"; sSizerHtml += ""; sSizerHtml += ""; sSizerHtml += ""; sSizerHtml += ""; sSizerHtml += ""; sSizerHtml += txtMap["TXT_HTMLB_HED_OK"]; sSizerHtml += ""; sSizerHtml += ""; sSizerHtml += ""; sSizerHtml += txtMap["TXT_HTMLB_HED_APPLY"]; sSizerHtml += ""; sSizerHtml += "
"; sSizerHtml += ""; sSizerHtml += "
"; sSizerHtml += "
"; sSizerHtml += ""; sSizerHtml += ""; sSizerHtml += ""; sSizerHtml += ""; sSizerHtml += ""; sSizerHtml += ""; sSizerHtml += ""; sSizerHtml += ""; sSizerHtml += ""; sSizerHtml += ""; sSizerHtml += ""; sSizerHtml += ""; sSizerHtml += "
"; sSizerHtml += ""; sSizerHtml += ""; sSizerHtml += txtMap["TXT_HTMLB_HED_MOD_IMG"]; sSizerHtml += ""; sSizerHtml += "
"; sSizerHtml += "
"; sSizerHtml += ""; sSizerHtml += ""; sSizerHtml += ""; var image=document.getElementById(sId); if(image){ modWidth = image.width; modHeight = image.height; modBorder = image.border; modText = image.alt; modSrc = image.src; if(!modSaved){//cancel modSaved=true; modWidthSaved = modWidth; modHeightSaved = modHeight; modBorderSaved = modBorder; modTextSaved = modText; modSrcSaved = modSrc; } } sSizerHtml += ""; sSizerHtml += ""; sSizerHtml += ""; sSizerHtml += ""; sSizerHtml += ""; sSizerHtml += ""; sSizerHtml += ""; sSizerHtml += ""; sSizerHtml += ""; sSizerHtml += ""; sSizerHtml += ""; sSizerHtml += ""; sSizerHtml += ""; sSizerHtml += ""; sSizerHtml += ""; sSizerHtml += ""; sSizerHtml += ""; sSizerHtml += ""; sSizerHtml += ""; sSizerHtml += ""; sSizerHtml += ""; sSizerHtml += ""; sSizerHtml += ""; sSizerHtml += ""; sSizerHtml += "
 
"; sSizerHtml += ""; sSizerHtml += ""; sSizerHtml += ""; sSizerHtml += ""; sSizerHtml += "
"; sSizerHtml += ""; sSizerHtml += ""; sSizerHtml += ""; sSizerHtml += ""; sSizerHtml += "
"; sSizerHtml += ""; sSizerHtml += ""; sSizerHtml += ""; sSizerHtml += ""; sSizerHtml += "
"; sSizerHtml += ""; sSizerHtml += ""; sSizerHtml += ""; sSizerHtml += ""; sSizerHtml += "
"; sSizerHtml += ""; sSizerHtml += ""; sSizerHtml += ""; sSizerHtml += ""; sSizerHtml += "
 
"; sSizerHtml += ""; sSizerHtml += ""; sSizerHtml += "
"; sSizerHtml += ""; sSizerHtml += ""; sSizerHtml += txtMap["TXT_HTMLB_HED_OK"]; sSizerHtml += ""; sSizerHtml += ""; sSizerHtml += ""; sSizerHtml += txtMap["TXT_HTMLB_HED_APPLY"]; sSizerHtml += ""; sSizerHtml += ""; sSizerHtml += ""; sSizerHtml += txtMap["TXT_HTMLB_HED_CANCEL"]; sSizerHtml += ""; sSizerHtml += "
"; sSizerHtml += "
"; sSizerHtml += "
"; sSizerHtml += "
"; sSizerHtml += "
"; oPopup.innerHTML=sSizerHtml; return oPopup; } function htmlb_hed_image_modify(sId, imageWidth, imageHeight, imageBorder, imageText, imageSrc, editorId){ hidePopupMenu(); var image=document.getElementById(sId); if(image){ var editor = document.getElementById(editorId); editor._offsetY=editor.scrollTop; editor._offsetX=editor.scrollLeft; htmlb_hed_stackForUndo(editor); image.width = imageWidth; image.height = imageHeight; image.border = imageBorder; image.alt = imageText; image.src = imageSrc; image.focus(); editor.focus(); setTimeout("htmlb_hed_adapt_offset('"+editor.id+"')", 50); } } function htmlb_hed_image_cancel(sId, imageWidth, imageHeight, imageBorder, imageText, imageSrc){ hidePopupMenu(); var image=document.getElementById(sId); if(image){ image.width = imageWidth; image.height = imageHeight; image.border = imageBorder; image.alt = imageText; image.src = imageSrc; } } function htmlb_hed_image_apply(sId, imageWidth, imageHeight, imageBorder, imageText, imageSrc){ var image=document.getElementById(sId); if(image){ image.width = imageWidth; image.height = imageHeight; image.border = imageBorder; image.alt = imageText; image.src = imageSrc; } } function htmlb_hed_toogle_table_border(id, editor){ var tb = document.getElementById(id); var useUR = editor._usePortalStyle; if (tb){ if (tb.border == 0){ tb.runtimeStyle.border = '1 Dotted #550055' tb.className = ""; }else{ tb.runtimeStyle.cssText = ""; if (tb.className == "" && useUR) tb.className = "urSTbvStd"; } var tds = tb.getElementsByTagName("td"); for (var i = 0; i < tds.length; i++){ if( tb.border == 0){ if (tds[i].className == "" && useUR) tds[i].className='urTxtStd'; else tds[i].className=tds[i].className.replace("urSTbvCellStd",""); tds[i].runtimeStyle.border = '1 Dotted #550055'; }else{ if (tds[i].className == "" && useUR) tds[i].className='urSTbvCellStd urTxtStd'; tds[i].runtimeStyle.cssText = ""; } } } } function htmlb_hed_doInsertSpecialCharPopup(sId, control){ try { var editor = document.getElementById(sId + "htmlbeditor"); var o=control.document.parentWindow.event; var oPopupContent=htmlb_hed_makeSpecialCharDialog(editor.id); var arrUrls = new Array(getUrCss()); var oPopup = new sapPopup(window,arrUrls,oPopupContent,control,o,0); oPopup.show = htmlb_hed_Popup_show oPopup.onblur = hidePopupMenu; window.onfocus = hidePopupMenu; if (ur_system.is508) oPopup.write = htmlb_hed_popup_write; oPopup.show(true); oField = oPopup.frame.window.document.getElementById("spec_char_1"); oField.focus(); oField.focus(); g_sLastUsedToolbarId = control.id; } catch(ex){ alert(ex); } } var ghtmlb_hed_undoMap,ghtmlb_hed_redoMap; function htmlb_hed_stackForUndo(editor){ if (ghtmlb_hed_undoMap){ var top = ghtmlb_hed_undoMap[editor.id][ghtmlb_hed_undoMap[editor.id].length-1]; if (top != editor.innerHTML) ghtmlb_hed_undoMap[editor.id].push(editor.innerHTML); } } function htmlb_hed_stackForRedo(editor){ if (ghtmlb_hed_redoMap){ var top = ghtmlb_hed_redoMap[editor.id][ghtmlb_hed_redoMap[editor.id].length-1]; if (top != editor.innerHTML) ghtmlb_hed_redoMap[editor.id].push(editor.innerHTML); } } function htmlb_hed_pasteEventHandler(sId) { var editor = document.getElementById(sId); htmlb_hed_stackForUndo(editor); setTimeout("htmlb_hed_toogle_tables_border('"+sId+"')", 125); setTimeout("htmlb_hed_check_for_unique_id('"+sId+"')", 250); return true; } function htmlb_hed_mouseEventHandler(sId) { var editor = document.getElementById(sId); var clickEvent = editor.contentWindow ? editor.contentWindow.event : event; if (clickEvent) { editor._offsetX = clickEvent.offsetX - clickEvent.x; editor._offsetY = clickEvent.offsetY - clickEvent.y; /*if (editor._offset){ var str = editor._offsetX; str += ","; str += editor._offsetY; editor._offset.value = str; }*/ } /*if (editRange == null) editRange = editor.document.selection.createRange(); var cmdActive = editRange.queryCommandState('Bold');*/ return htmlb_hed_hidePopupMenu(editor); } function htmlb_hed_eventHandler(sId) { var editor = document.getElementById(sId); var editEvent = editor.contentWindow ? editor.contentWindow.event : event; if (editEvent && editEvent.keyCode) { var code = editEvent.keyCode; var ctrlKey = editEvent.ctrlKey; var shiftKey = editEvent.shiftKey; if (ctrlKey && (code == 122 || code == 90)){ setTimeout("htmlb_hed_update_for_undo('"+sId+"')", 125); editEvent.cancelBubble = true; return false; } else if ((ctrlKey && (code == 121 || code == 89)) || ctrlKey && shiftKey && (code == 122 || code == 90)){ setTimeout("htmlb_hed_update_for_redo('"+sId+"')", 125); editEvent.cancelBubble = true; return false; } else if ((code == 32/*BL*/ || code == 13/*RT*/) && editEvent.type == 'keypress'){ htmlb_hed_stackForUndo(editor); editor._offsetX = editEvent.offsetX; editor._offsetY = editEvent.offsetY - editEvent.y; return true; } else if ((code == 8/*DEL*/ || code == 46/*BS*/) && editEvent.type == 'keydown'){ htmlb_hed_stackForUndo(editor); editor._offsetX = editEvent.offsetX; editor._offsetY = editEvent.offsetY - editEvent.y; return true; } } return true; } function htmlb_hed_update_for_undo(sId){ var editor = document.getElementById(sId); editor._offsetY=editor.scrollTop; editor._offsetX=editor.scrollLeft; var content = ghtmlb_hed_undoMap[editor.id].pop(); if (undefined != content){ htmlb_hed_stackForRedo(editor); if (content == editor.innerHTML) content = ghtmlb_hed_undoMap[editor.id].pop(); if (undefined == content) return; editor.innerHTML = content; htmlb_hed_stackForRedo(editor); setTimeout("htmlb_hed_toogle_tables_border('"+sId+"')", 125); }else{ htmlb_hed_stackForUndo(editor); } setTimeout("htmlb_hed_adapt_offset('"+sId+"')", 200); } function htmlb_hed_update_for_redo(sId){ var editor = document.getElementById(sId); editor._offsetY=editor.scrollTop; editor._offsetX=editor.scrollLeft; var content = ghtmlb_hed_redoMap[editor.id].pop(); if (undefined != content){ htmlb_hed_stackForUndo(editor); if (content == editor.innerHTML) content = ghtmlb_hed_redoMap[editor.id].pop(); if (undefined == content) return; editor.innerHTML = content; setTimeout("htmlb_hed_toogle_tables_border('"+sId+"')", 125); }else{ htmlb_hed_stackForRedo(editor); } setTimeout("htmlb_hed_adapt_offset('"+sId+"')", 200); } /* function htmlb_hed_startupHandler(sId, usePortalStyle){ var editor = document.getElementById(sId + "htmlbeditor"); var docHTML = document.getElementsByTagName("html")[0]; // var docHTML = editor.contentWindow.document.getElementsByTagName("html")[0]; if(docHTML && docHTML.id=="") { docHTML.id= sId+"HTML"; docHTML.title = editor.title; //Hardcoded support for HCB theme if(isHCB()) { docHTML.style.backgroundColor="#000000"; var classstyle= editor.className; if (classstyle == "" ) {docHTML.style.color = "#FFF";//this means no portal style editor.className="urTbarWhl";//adding white border } else { classstyle = classstyle.replace(/urTbarWhl/, "") docHTML.className= classstyle; } } } if (editor._initialized == null && editor.isContentEditable){ editor.onkeydown = function() { return htmlb_hed_eventHandler(editor.id); } editor.onkeypress = function() { return htmlb_hed_eventHandler(editor.id); } editor.onclick = function() { return htmlb_hed_mouseEventHandler(editor.id); } editor.onpaste = function() { return htmlb_hed_pasteEventHandler(editor.id); } editor.ondrop = function() { return htmlb_hed_pasteEventHandler(editor.id); } editor.oncut = function() { htmlb_hed_stackForUndo(editor); return true; } if (ghtmlb_hed_undoMap == null || ghtmlb_hed_undoMap == "undefined"){ ghtmlb_hed_undoMap = new Array(); ghtmlb_hed_undoMap[editor.id] = new Array(); }else if (ghtmlb_hed_undoMap[editor.id] == null || ghtmlb_hed_undoMap[editor.id] == "undefined"){ ghtmlb_hed_undoMap[editor.id] = new Array(); } htmlb_hed_stackForUndo(editor); if (ghtmlb_hed_redoMap == null || ghtmlb_hed_redoMap == "undefined"){ ghtmlb_hed_redoMap = new Array(); ghtmlb_hed_redoMap[editor.id] = new Array(); }else if (ghtmlb_hed_redoMap[editor.id] == null || ghtmlb_hed_redoMap[editor.id] == "undefined"){ ghtmlb_hed_redoMap[editor.id] = new Array(); } htmlb_hed_read_offset(sId); if (usePortalStyle == undefined){ editor._usePortalStyle = true; }else{ editor._usePortalStyle = usePortalStyle; } editor._initialized = true; } setTimeout("htmlb_hed_toogle_tables_border('"+editor.id+"')", 125); } */ function htmlb_hed_save_offset(sId){ var editor = document.getElementById(sId + "htmlbeditor"); var offset = document.getElementById(sId + "_OFFSET"); if(editor&&offset){ var str = editor.scrollLeft; str += ","; str += editor.scrollTop; offset.value = str; } } function htmlb_hed_save_editor_state(sId){ var editor = document.getElementById(sId + "htmlbeditor"); var expanded = document.getElementById(sId + "_EXPAND"); if(editor&&expanded){ if (editor._expanded!=undefined){ expanded.value = editor._expanded; }else{ expanded.value = 'false'; } } } function htmlb_hed_read_offset(sId){ var editor = document.getElementById(sId + "htmlbeditor"); var offset = document.getElementById(sId + "_OFFSET"); if (offset){ var offsetX = offset.value.substring(0, offset.value.indexOf(",")); var offsetY = offset.value.substring(offset.value.indexOf(",")+1, offset.length); if (offsetX && offsetY){ editor._offsetX = offsetX; editor._offsetY = offsetY; htmlb_hed_adapt_offset(editor.id); } } } function htmlb_hed_adapt_offset(sId){ var editor = document.getElementById(sId); editor.scrollTop = editor._offsetY; editor.scrollLeft = editor._offsetX; } function htmlb_hed_toogle_tables_border(sId){ var editor = document.getElementById(sId); if (editor && editor.hasChildNodes){ var childNode = editor.firstChild; if (childNode == null) return; if (childNode.tagName == "TABLE"){ htmlb_hed_toogle_table_borderInternal(childNode, editor._usePortalStyle); } for (var i = 1; childNode = childNode.nextSibling; ++i){ if (childNode.tagName == "TABLE"){ htmlb_hed_toogle_table_borderInternal(childNode, editor._usePortalStyle); } if (childNode&&childNode.hasChildNodes){ htmlb_hed_toogle_tables_borderR(childNode.firstChild, editor._usePortalStyle); } } } } function htmlb_hed_toogle_table_borderInternal(oTable, useUR){ if (oTable){ if (oTable.border == 0){ oTable.className = ""; oTable.runtimeStyle.border = '1 Dotted #550055' }else{ oTable.runtimeStyle.cssText = ""; if (oTable.className == "" && useUR) oTable.className = "urSTbvStd"; } var tds = oTable.getElementsByTagName("td"); for (var i = 0; i < tds.length; i++){ if( oTable.border == 0){ if (tds[i].className == "" && useUR) tds[i].className='urTxtStd'; tds[i].runtimeStyle.border = '1 Dotted #550055'; }else{ if (tds[i].className == "" && useUR) tds[i].className='urSTbvCellStd urTxtStd'; tds[i].runtimeStyle.cssText = ""; } } } } function htmlb_hed_toogle_tables_borderR(childNode, useUR){ if (childNode == null) return; if (childNode.tagName == "TABLE"){ htmlb_hed_toogle_table_borderInternal(childNode, useUR); } if (childNode.hasChildNodes){ htmlb_hed_toogle_tables_borderR(childNode.firstChild, useUR); } for (var i = 1; childNode = childNode.nextSibling; ++i){ if (childNode.tagName == "TABLE"){ htmlb_hed_toogle_table_borderInternal(childNode, useUR); } if (childNode.hasChildNodes){ htmlb_hed_toogle_tables_borderR(childNode.firstChild, useUR); } } } var htmlb_hed_elem_id_map; function htmlb_hed_check_for_unique_idInternal(childNode){ if (childNode.tagName == "TABLE"){ if (childNode.id != ""){ if (htmlb_hed_elem_id_map[childNode.id] == null) htmlb_hed_elem_id_map[childNode.id] = childNode.id; else htmlb_hed_refreshTableIds(childNode); }else{ htmlb_hed_refreshTableIds(childNode); } }else if(childNode.tagName == "IMG" || childNode.tagName == "A"){ if (childNode.id != ""){ if (htmlb_hed_elem_id_map[childNode.id] == null) htmlb_hed_elem_id_map[childNode.id] = childNode.id; else childNode.id = htmlb_hed_getUniqueId(childNode.tagName); }else{ childNode.id = htmlb_hed_getUniqueId(childNode.tagName); } } } function htmlb_hed_check_for_unique_id(sId){ htmlb_hed_elem_id_map = new Array(); var editor = document.getElementById(sId); if (editor && editor.hasChildNodes){ var childNode = editor.firstChild; if (childNode == null) return; htmlb_hed_check_for_unique_idR(childNode); } } function htmlb_hed_check_for_unique_idR(childNode){ if (childNode == null) return; htmlb_hed_check_for_unique_idInternal(childNode); if (childNode&&childNode.hasChildNodes){ htmlb_hed_check_for_unique_idR(childNode.firstChild); } for (var i = 1; childNode = childNode.nextSibling; ++i){ htmlb_hed_check_for_unique_idInternal(childNode); if (childNode.hasChildNodes){ htmlb_hed_check_for_unique_idR(childNode.firstChild); } } } function doSimpleAction(id,action){ // no check needed for these actions var editor = document.getElementById(id + "htmlbeditor"); if ( action == cPRINT) { htmlb_hed_showPrintPreview(id); return; } if ( action == cPREVIEW) { showPreview(id); return; } if (checkDoAction(id) == false) { return; } lastSave = null; switch (action){ case cCUT: htmlb_hed_stackForUndo(editor); editRange.execCommand("Cut"); break; case cCOPY: editRange.execCommand("Copy"); break; case cPASTE: htmlb_hed_stackForUndo(editor); editRange.execCommand("Paste"); break; case cBOLD: htmlb_hed_stackForUndo(editor); editRange.execCommand("Bold"); break; case cITALIC: htmlb_hed_stackForUndo(editor); editRange.execCommand("Italic"); break; case cUNDERLINE: htmlb_hed_stackForUndo(editor); editRange.execCommand("Underline"); break; case cSTRIKETHRU: editRange.execCommand("StrikeThrough"); break; case cSUBSCRIPT: editRange.execCommand("SubScript"); break; case cSUPERSCRIPT: editRange.execCommand("SuperScript"); break; case cOUTDENT: htmlb_hed_stackForUndo(editor); editRange.execCommand("Outdent"); break; case cINDENT: htmlb_hed_stackForUndo(editor); editRange.execCommand("Indent");break; case cLEFT: htmlb_hed_stackForUndo(editor); editRange.execCommand("JustifyLeft"); break; case cCENTER: htmlb_hed_stackForUndo(editor); editRange.execCommand("JustifyCenter"); break; case cRIGHT: htmlb_hed_stackForUndo(editor); editRange.execCommand("JustifyRight"); break; case cPARABUL: htmlb_hed_stackForUndo(editor); editRange.execCommand("InsertUnorderedList"); break; case cPARANUM: htmlb_hed_stackForUndo(editor); editRange.execCommand("InsertOrderedList"); break; case cINSERTRULE: htmlb_hed_stackForUndo(editor); editRange.execCommand("InsertHorizontalRule"); break; case cUNDO: editRange.execCommand("Undo"); break; case cREDO: editRange.execCommand("Redo"); break; case cSELECTALL: editRange.execCommand('selectall'); break; } save(id); editor.focus(); } function doComplexAction(id,action,param) { if (checkDoAction(id) == false) { return; } lastSave = null; if (param == "NOP") { return; } switch (action){ case cHX: editRange.execCommand("FormatBlock", 1,param); break; case cFONT_SIZE: editRange.execCommand("FontSize", 1,param); break; case cFORE_COLOR: editRange.execCommand("ForeColor", 1,param); break; case cBACK_COLOR: editRange.execCommand("BackColor", 1,param); break; } save(id); } function save(id) { lastSave = id; var x = document.getElementById(id); var editor = document.getElementById(id + "htmlbeditor"); if(x!=null) x.value = editor.innerHTML; if(editor.document.selection.type.toUpperCase() != "CONTROL") { if (editor.document.selection.createRange().parentElement().id == id + "htmlbeditor") { editRange = editor.document.selection.createRange(); } if (checkParent(editor.document.selection.createRange().parentElement(),id) == true) { editRange = editor.document.selection.createRange(); } } else if(editor.document.selection.type.toUpperCase() == "CONTROL") { ;//editRange = null; } if (0==htmlb_hed_StyleInit){ document.createStyleSheet(getUrCss()); htmlb_hed_StyleInit=1; } var y = document.getElementById(id+"_SCREEN"); if(y!=null&&y.value!=""){ doResizeEditor(id,y.value); } htmlb_hed_save_editor_state(id); htmlb_hed_toogle_tables_border(editor.id); } /* function htmlb_hed_initScreen(sId, expanderId) { var editor = document.getElementById(sId + "htmlbeditor"); if (editor){ if (expanderId != null && expanderId != 'undefined'){ var expander = document.getElementById(expanderId); if (expander&&expander.className == "urTbarBtnExp urSTbvCellGrpLvl3"){ htmlb_hed_editor_hsize = editor.parentElement.parentElement.parentElement.parentElement.offsetWidth; editor.parentElement.parentElement.parentElement.parentElement.style.pixelWidth = document.body.clientWidth-40; editor._expanded = true; } } } //editor.scrollIntoView(true); htmlb_hed_read_offset(sId); } */ HTMLB_HED_POPUP_FUNCTIONS = {"text_style":htmlb_hed_doInsertTextStylePopup,"text_size":htmlb_hed_doInsertTextSizePopup,"text_color":htmlb_hed_doInsertTextForegroundColorPopup,"text_backgroundcolor":htmlb_hed_doInsertTextBackgroundColorPopup,"insert_table":doInsertTableAction,"modify_table":doModifyTableAction,"insert_special_char":htmlb_hed_doInsertSpecialCharPopup}; function htmlb_hed_popup_openPopuMenu(sId, control, e, callback){ if (e.keyCode == 32){ return HTMLB_HED_POPUP_FUNCTIONS[callback](sId, control); }else{ return false; } } function htmlb_hed_doInsertNoPortalTextStylePopup(sId, control){ try { var editor = document.getElementById(sId + "htmlbeditor"); var o=control.document.parentWindow.event; var oPopupContent=htmlb_hed_makeNoPortalTextStyleSelectPopup(editor.id); var arrUrls = new Array(getUrCss()); var oPopup = new sapPopup(window,arrUrls,oPopupContent,control,o,0); oPopup.show = htmlb_hed_Popup_show oPopup.onblur = hidePopupMenu; window.onfocus = hidePopupMenu; oPopup.show(true); g_sLastUsedToolbarId = control.id; return oPopup; } catch(ex){ alert(ex); } } function htmlb_hed_doInsertNoPortalTextBackgroundColorPopup(sId, control, browserCentric, colorRangeId, tableCellId){ try { var editor = document.getElementById(sId + "htmlbeditor"); var oPopup; var oPopupContent=htmlb_hed_makeBackgroundColorPopup(editor.id, colorRangeId, tableCellId); var arrUrls = new Array(getUrCss()); if (browserCentric != undefined && browserCentric){ oPopup = new sapPopup(window,arrUrls,oPopupContent,editor,window.event,1); oPopup.content.size = oPopupContent; oPopup.positionbehavior = sapPopupPositionBehavior.BROWSERCENTER; }else{ oPopup = new sapPopup(window,arrUrls,oPopupContent,control,control.document.parentWindow.event,0); } oPopup.onblur = htmlb_hed_hidePopupMenu; window.onfocus = htmlb_hed_hidePopupMenu; oPopup.show(true); g_sLastUsedToolbarId = control.id; } catch(ex){ alert(ex); } } htmlb_hed_text_styles=new Array(); htmlb_hed_text_kstyles=new Array(); function htmlb_hed_addTextStyles(texts) { for ( var i in texts) { if(!htmlb_hed_text_styles[i]){ htmlb_hed_text_styles[i] = texts[i]; } } htmlb_hed_text_kstyles = new Array('arial','times','courier','verdana','terminal','tahoma','georgia','impact'); } function htmlb_hed_makeNoPortalTextStyleSelectPopup(sId){ var txtMap = htmlb_hed_txt[ur_language]; var maxEntries = 8; htmlb_hed_addTextStyles({standard:txtMap["TXT_HTMLB_STYLESTANDARD"],arial:"Arial",times:"Times New Roman",courier:"Courier",verdana:"Verdana",tahoma:"Tahoma",georgia:"Georgia",impact:"Impact",terminal:"Terminal",roman:"Roman"}); var selectedIndex=-1; var oPopup = document.getElementById("htmlb_hed_selectTextStyle_popup"); if (!oPopup) { var oBody = document.getElementsByTagName("BODY")[0]; var editor = document.getElementById(sId); editor._offsetY=editor.scrollTop; editor._offsetX=editor.scrollLeft; oPopup = document.createElement("SPAN"); oPopup.id="htmlb_hed_selectTextStyle_popup"; oPopup.style.position="absolute"; oPopup.style.left="-1999px"; oPopup.style.top="-1999px"; oBody.appendChild(oPopup); setTimeout("htmlb_hed_adapt_offset('"+editor.id+"')", 50); } var urStyleMap = htmlb_hed_text_styles; if (editRange!=null) { var fontName = editRange.queryCommandValue('FontName'); if (fontName){ for (i=0;i=0){ if (j==selectedIndex) { sCharsHtml += "
"; sCharsHtml += " "; sCharsHtml += "
"; oPopup.innerHTML=sCharsHtml; return oPopup; } function htmlb_hed_MnuToggleNoPortalClickTextStyle(sId, span){ var editor = document.getElementById(sId); editor._offsetY=editor.scrollTop; editor._offsetX=editor.scrollLeft; hidePopupMenu(); htmlb_hed_stackForUndo(editor); var font = span.firstChild.firstChild.style.fontFamily; if (editRange!=null&&editRange.text!=""&&editRange.parentElement()!=null){ editRange.execCommand('RemoveFormat'); if (font != ""){ editRange.execCommand('FontName', 0, font.toLowerCase()); } }else{ var pasteStr = " "; pasteStr += ""; editRange.pasteHTML(pasteStr); } setTimeout("htmlb_hed_adapt_offset('"+editor.id+"')", 50); } function htmlb_hed_MnuToggleClickTextSizeNoPortal(sId, size, sizeToken){ var sizeAttr = new Array("xx-small","x-small","small","medium","large","x-large","xx-large"); var editor = document.getElementById(sId); hidePopupMenu(); htmlb_hed_stackForUndo(editor); if (editRange!=null&&editRange.text!=""){ editRange.execCommand('FontSize',0,size); }else{ var pasteStr = " "; pasteStr += ""; editRange.pasteHTML(pasteStr); } } function htmlb_hed_popup_write(bDoNotAutoFocus) { if (ur_system.direction=="rtl") strContent = ""; else strContent = ""; if (this.domainrelax) strContent += strDomainRelaxScript; strContent += "var mover=false;var ispopup=true;var me=null;if (parent.sapPopupStore["+this.level+"]) {me=parent.sapPopupStore["+this.level+"].source.window;mylevel="+this.level+";}else{mylevel=null;}"; if (bDoNotAutoFocus) {} else {strContent += "window.focus();";} strContent += ""; for (var n=0; n"; } strContent+= ""; this.frame.window.document.write(strContent); this.frame.window.document.close(); } function htmlb_hed_refocusPopup() { var oPopup = sapPopupStore[0]; if (oPopup&&oPopup.frame){ if (oPopup.frame.window.event) oPopup.frame.window.event.cancelBubble = true; oPopup.frame.object.focus(); return false; } return true; } function htmlb_hed_render_input(sId, sValue, scope, title, readonly, len, maxLen){ sContent = "= 0 || text.toUpperCase().indexOf("= 0 || text.toUpperCase().indexOf("<SCRIPT")>= 0) { var txtMap = htmlb_hed_txt[ur_language]; errorText1=txtMap["TXT_HTMLB_ERROR_JAVASCRIPT"]; } } if (errorText1 != null) { doInsertErrorMessages(id,errorText1); window.event.returnValue=false; return false; } else return true; } function doInsertErrorMessages(id, errorText1) { editor = document.getElementById(id); var oPopupContent=htmlb_hed_makeErrorDialog(editor.id, true, "", true, editor.id,errorText1); var arrUrls = new Array(getUrCss()); var oPopup = new sapPopup(window,arrUrls,oPopupContent,document.getElementById(editor.id),window.event,0); oPopup.content.size = oPopupContent; oPopup.positionbehavior = sapPopupPositionBehavior.BROWSERCENTER; oPopup.onblur = hidePopupMenu; oPopup.show = htmlb_hed_Popup_show_nofocus; window.onfocus = hidePopupMenu; if (ur_system.is508) oPopup.write = htmlb_hed_popup_write; oPopup.show(true); g_sLastUsedToolbarId = null; } function htmlb_hed_makeErrorDialog(sId, bInsertMode, initText, textReadOnly, editorId, errorText1){ var oPopup = document.getElementById("htmlb_hed_weblink_popup"); var tabIndexBorder; if (!oPopup) { var oBody = document.getElementsByTagName("BODY")[0]; var editor = document.getElementById(editorId); editor._offsetY=editor.scrollTop; editor._offsetX=editor.scrollLeft; oPopup = document.createElement("SPAN"); oPopup.id="htmlb_hed_weblink_popup"; oPopup.style.position="absolute"; oPopup.style.left="-1999px"; oPopup.style.top="-1999px"; oBody.appendChild(oPopup); setTimeout("htmlb_hed_adapt_offset('"+editor.id+"')", 50); } var modText, modURL, modOpenMode=0; var txtMap = htmlb_hed_txt[ur_language]; var modSaved=false,modTextSaved, modURLSaved, modOpenModeSaved; var sSizerHtml = ""; var titleLine; sSizerHtml += ""; sSizerHtml += ""; sSizerHtml += ""; sSizerHtml += ""; sSizerHtml += ""; sSizerHtml += ""; sSizerHtml += "
"; sSizerHtml += ""; sSizerHtml += "
"; sSizerHtml += ""; sSizerHtml += ""; sSizerHtml += ""; sSizerHtml += ""; sSizerHtml += ""; sSizerHtml += ""; sSizerHtml += ""; sSizerHtml += "
"; sSizerHtml += ""; if(bInsertMode){ sSizerHtml += ""; sSizerHtml += txtMap["TXT_HTMLB_ERROR_MESSAGE"]; titleLine = txtMap["TXT_HTMLB_ERROR_MESSAGE"]+" "; sSizerHtml += ""; }else{ sSizerHtml += ""; sSizerHtml += txtMap["TXT_HTMLB_HED_TITLE_MOD_WE"]; titleLine = txtMap["TXT_HTMLB_HED_TITLE_INS_WE"]; sSizerHtml += ""; } sSizerHtml += "
"; sSizerHtml += "
"; sSizerHtml += ""; sSizerHtml += ""; sSizerHtml += ""; modText=initText; modURL=""; if (errorText1 != null) { sSizerHtml += ""; sSizerHtml += ""; sSizerHtml += ""; sSizerHtml += ""; } sSizerHtml += ""; sSizerHtml += "
 
"; sSizerHtml += ""; sSizerHtml += ""; sSizerHtml += ""; sSizerHtml += "
 
"; sSizerHtml += "