-
function storePosition () {
-
-
-
-
if(g_state.aName == 'TABLE' || g_state.aName == 'IMG')
-
return;
-
-
var sel = this.selection;
-
if (!sel) {
-
if(!is_browserName_IE)
-
{
-
sel = document.getElementById("myEditor").contentDocument.getSelection();
-
rng=sel;
-
}
-
else
-
{
-
sel = document.frames["myEditor"].document.selection;
-
rng = sel.createRange();
-
}
-
}
-
-
-
-
if (!rng) {
-
return;
-
}
-
-
if (caretPos) {
-
prevPos = caretPos;
-
}
-
-
// Special case when the selection is a div:
-
if(rng.length) {
-
// This is a controlRange
-
var oElm = rng(0);
-
g_state.clickedElement = oElm;
-
}
-
else {
-
caretPos = rng.duplicate();
-
g_state.clickedElement = caretPos.parentElement();
-
-
}
-
return;
-
34 3312 Dormilich 8,658
Recognized Expert Moderator Expert
are there any messages in the Error Console?
@Dormilich
yeah...it just came "rng is not a function" in error console.Plz help me
Dormilich 8,658
Recognized Expert Moderator Expert
line #35: you call rng() as a function, but it’s a Selection object. maybe you mean rng[0]?
@Dormilich
yeah the error is showing @line 35( var oElm = rng(0);)and error msg is rng is not a function
Dormilich 8,658
Recognized Expert Moderator Expert @Dormilich
Nop...Just struggling with this.I am new to this.So I hav no idea.Also I am gettin 1 more error in another js file.I have to fix these two errors..Please help me fixing this.Tomorrow is a deadline
Dormilich 8,658
Recognized Expert Moderator Expert
maybe you mean rng[0]?
this fix!
@Dormilich
ok..thanks a lot..also I hav 1 more error @ the first line and the error msg is text is undefined.Please help me in this too
if(text.indexOf("<TABLE") >=0 || text.indexOf("<table") >=0)
return 'table';
Dormilich 8,658
Recognized Expert Moderator Expert
well, it’s just as the message says, the text variable is neither a string literal, nor object. thus you can’t apply the methods to it.
@Dormilich
what else can I do? Can't fix this?plz provide me a solution
Dormilich 8,658
Recognized Expert Moderator Expert
provide me with a code first ;)
@Dormilich
this is the function.If u want me to send the entire code den I will send it..Thanks - function hasTagsInText(text)
-
{
-
-
if(text.indexOf("<TABLE") >=0 || text.indexOf("<table") >=0)
-
return 'table';
-
-
if(text.indexOf("<TD") >=0 || text.indexOf("<td") >=0)
-
return 'column';
-
-
if(text.indexOf("<IMG") >=0 || text.indexOf("<img") >=0)
-
return 'image';
-
-
if(text.indexOf("<H2") >=0 || text.indexOf("<h2") >=0)
-
return 'h2';
-
-
if(text.indexOf("<DIV") >=0 || text.indexOf("<div") >=0)
-
return 'div';
-
-
if(text.indexOf("<A") >=0 || text.indexOf("<a") >=0)
-
return 'link';
-
-
if(text.indexOf("<FORM") >=0 || text.indexOf("<form") >=0)
-
return 'form';
-
-
if(text.indexOf("<P>") >=0 || text.indexOf("<p>") >=0)
-
return 'invisible paragraph-mark';
-
-
if(text.indexOf("<BR>") >=0 || text.indexOf("<br>") >=0)
-
return 'invisible new-line-mark';
-
-
return '';
-
}
Dormilich 8,658
Recognized Expert Moderator Expert
how do you call the function?
@Dormilich
In Java I dont hav much idea..In C/C++ we do call function by name or referrence
Dormilich 8,658
Recognized Expert Moderator Expert
this is neither Java nor C/C++, it’s JavaScript (subtle but important difference).
to apply logic, somewhere in your HTML you call that function, otherwise it wouldn’t be executed (and as far as I see it doesn’t have a parse error). I need to know that part.
you could also provide a page, it would make it a bit easier for me.
@Dormilich
thank you so much ..I applied that fix(rng[0]) and it worked..
Dormilich 8,658
Recognized Expert Moderator Expert
that fix was obvious (for the expert).
@Dormilich
I am new to this.So I am unaware of that.anyways thanks a lot.Can u help me in another error? -
var is_browserName_IE = navigator.appName == "Microsoft Internet Explorer"? true : false;
-
function editView_init(){
-
-
-
g_state = new _CState();
-
fixSizeTB();
-
if(!is_browserName_IE)
-
st = document.getElementById("myEditor").contentDocument;
-
else
-
st = frames.myEditor.document;
-
if (typeof testing == 'undefined') {
-
finalURL = "webcomposer/editor";
-
}
-
else {
-
if (testing) { // build testing url
-
finalURL = testURL;
-
}
-
else { // build production url
-
finalURL = prodURL;
-
}
-
-
}
-
-
if (isW3Mode) {
-
var strMethodName = "common.js::init()";
-
debugMsg(strMethodName);
-
if (typeof(window['template']) == "undefined") {
-
template = "";
-
}
-
if (template != null && template == 'w3_innovation')
-
loadEditorCss("http://v25http104.mkm.can.ibm.com/innovation/wctCss/style.css");
-
-
var ooDiaWin = document.createElement("DIV");
-
ooDiaWin.id = "diaWin";
-
ooDiaWin.className = "diaWinstyle";
-
document.body.appendChild(ooDiaWin);
-
checkLocation();
-
-
-
-
if(!is_browserName_IE)
-
{
-
-
addCSS(finalURL + "/css/screen.css");
-
addCSS(finalURL + "/css/interior.css");
-
addCSS(finalURL + "/css/icons.css");
-
addCSS(finalURL + "/css/tables.css");
-
-
}
-
else
-
{
-
styleSheet = st.createStyleSheet();
-
styleSheet.addImport(finalURL + "/css/screen.css");
-
styleSheet.addImport(finalURL + "/css/interior.css");
-
styleSheet.addImport(finalURL + "/css/icons.css");
-
styleSheet.addImport(finalURL + "/css/tables.css");
-
}
-
-
var oNode = st.createElement("div");
-
oNode.id = "content";
-
-
if(!is_browserName_IE)
-
{
-
st.body.insertBefore(oNode,null);
-
}
-
else
-
{
-
st.body.insertBefore(oNode);
-
st.execCommand("2D-Position", true, true);
-
st.execCommand("MultipleSelection", true, true);
-
st.execCommand("LiveResize", true, true);
-
}
-
if(!is_browserName_IE)
-
var body = document.getElementById("myEditor").contentDocument.body;
-
else
-
var body = document.frames.myEditor.document.body;
-
body.className = "article";
-
-
st = st.getElementById("content");
-
st.contentEditable = "True";
-
for (i = 0; i < document.all.length; i++)
-
document.all(i).unselectable = "on";
-
OCode.unselectable = "off";
-
-
// st.innerHTML=stdata;
-
st.innerHTML = stdata_v8;// + endOfLayout;
-
// remove terms of use.
-
removeTerms();
-
// set the attributes of this layout
-
setLayout(st);
-
// storePosition();
-
-
if(!is_browserName_IE){
-
-
-
var ele=document.getElementById("myEditor").contentDocument.createRange();
-
//alert("selection--"+ele);
-
caretPos=ele;
-
//alert(caretPos);
-
prevPos=document.getElementById("myEditor").contentDocument.createRange();
-
//prevPos = document.getElementById("myEditor").contentDocument.getSelection();
-
}
-
else{
-
caretPos = document.frames["myEditor"].document.body.createTextRange();
-
prevPos = document.frames["myEditor"].document.body.createTextRange();
-
}
-
insertCaretPlaceholder();
-
if(!is_browserName_IE)
-
st = document.getElementById("myEditor").contentDocument.body;
-
else
-
st = document.frames.myEditor.document.body;
-
-
setRange();
-
if(is_browserName_IE)
-
oRange.execCommand("Unselect", true, true);
-
if(!is_browserName_IE)
-
st = document.getElementById("myEditor").contentDocument.getElementById("content");
-
else
-
st = frames.myEditor.document.getElementById("content");
-
-
debugMsg("PreProcessing");
-
if(!is_browserName_IE)
-
var oElemContentHead = document.getElementById("myEditor").contentDocument.getElementById("content-head");
-
else
-
var oElemContentHead = frames.myEditor.document.getElementById("content-head");
-
-
if ((oElemContentHead != null) && (oElemContentHead.children.length > 0)) {
-
debugMsg(strMethodName + ":oElemContentHead != null and children > 0 ");
-
debugDumpChildrenList(oElemContentHead);
-
-
AddAttributeLanguageToggle(oElemContentHead.firstChild);
-
-
cleanupPlugin(oElemContentHead);
-
-
}
-
else {
-
-
debugMsg(strMethodName + "oElemContentHead is null or null or there are no children elem");
-
-
}
-
}
-
else {
-
var ooDiaWin = document.createElement("DIV");
-
ooDiaWin.id = "diaWin";
-
ooDiaWin.className = "diaWinstyle";
-
document.body.appendChild(ooDiaWin);
-
st.createStyleSheet(finalURL + "/css/v16/all.css");
-
st.createStyleSheet(finalURL + "/css/v16/screen.css");
-
st.createStyleSheet(finalURL + "/css/v16/screen-uas.css");
-
st.createStyleSheet(finalURL + "/css/v16/handheld.css");
-
st.createStyleSheet(finalURL + "/css/v16/print.css");
-
st.createStyleSheet(finalURL + "/css/v16/screen-fonts.css");
-
-
var oNode = st.createElement("div");
-
oNode.id = "Oedit";
-
st.body.insertBefore(oNode);
-
st.execCommand("2D-Position", true, true);
-
st.execCommand("MultipleSelection", true, true);
-
st.execCommand("LiveResize", true, true);
-
st = st.getElementById("Oedit");
-
st.contentEditable = "True";
-
for (i = 0; i < document.all.length; i++)
-
document.all(i).unselectable = "on";
-
OCode.unselectable = "off";
-
st.innerHTML = stdata;
-
if(!is_browserName_IE)
-
st = document.getElementById("myEditor").contentDocument.body;
-
else
-
st = document.frames.myEditor.document.body;
-
setRange();
-
oRange.execCommand("Unselect", true, true);
-
-
if(!is_browserName_IE){
-
caretPos = document.getElementById("myEditor").contentDocument.createTextRange();
-
prevPos = document.getElementById("myEditor").contentDocument.createTextRange();
-
}
-
else{
-
caretPos = document.frames["myEditor"].document.body.createTextRange();
-
prevPos = document.frames["myEditor"].document.body.createTextRange();
-
}
-
insertCaretPlaceholder();
-
-
st = frames.myEditor.document.getElementById("Oedit");
-
}
-
-
// event handlers
-
st.ondblclick = _Editor_DblClickHandler
-
st.onpaste = _Editor_PasteHandler
-
st.onmousedown = _Editor_ClickHandler
-
st.onmouseup = _Editor_MouseUpHandler
-
st.onkeydown = _Editor_KeyDownHandler
-
st.onkeyup = _Editor_KeyUpHandler
-
st.ondragstart = _Editor_DragStartHandler
-
st.ondrop = _Editor_DropHandler
-
st.oncontextmenu = _Editor_OnContextMenuHandler
-
st.ondeactivate = _Editor_OnDeactiveHandler
-
st.onbeforedeactivate = _Editor_OnBlurHandler
-
st.onselectstart = _Editor_OnSelectStartHandler
-
st.oncopy = _Editor_OnCopyHandler
-
st.oncut = _Editor_OnCutHandler
-
st.onclick = _StorePosition;
-
st.onselect = _StorePosition;
-
st.oncontrolselect = _ControlSelectHandler;
-
-
params[0] = finalURL;
-
params[1] = isW3Mode;
-
-
// @REDOUNDO
-
// Initializes the Redo/Undo feature:
-
initUndoRedo();
-
-
//START: Fix for SIS site include page
-
var content = st.innerHTML;
-
if (content.match(/<%=\w+%>/gi)) {
-
content = content.replace(/<\s*div\s*id=ibm-pcon\s*>/i, "");
-
content = content.replace(/<\s*div\s*id=ibm-content\s*>/i, "");
-
content = content.replace(/<\/div>$/i, "");
-
content = content.replace(/<\/div>$/i, "");
-
st.innerHTML = content;
-
}
-
//END: Fix for SIS site include pages
-
-
-
} // end function
-
-
-
-
-
function init_loader() {
-
window.onbeforeunload=beforeUnload;
-
if(isW3Mode){
-
document.getElementById("www_content_editor").parentElement.removeChild(document.getElementById("www_content_editor"));
-
document.getElementById("w3_content_editor").style.display="block";
-
stdata_v8=CELayout.innerHTML;
-
stdata="";
-
init();
-
checkLocation();
-
lib_bwcheck();
-
}else{
-
document.getElementById("w3_content_editor").parentElement.removeChild(document.getElementById("w3_content_editor"));
-
document.getElementById("www_content_editor").style.display="block";
-
stdata=CELayout.innerHTML;
-
stdata_v8="";
-
init();
-
}
-
}
-
-
function init_text_list() {
-
if(isW3Mode){
-
document.getElementById("www_text_list").parentElement.removeChild(document.getElementById("www_text_list"));
-
document.getElementById("w3_text_list").style.display="block";
-
document.body.className = elements[3];
-
resizeMe("240px", "440px");
-
}else{
-
document.getElementById("w3_text_list").parentElement.removeChild(document.getElementById("w3_text_list"));
-
document.getElementById("www_text_list").style.display="block";
-
resizeMe("327px", "265px");
-
resizeBody(320);
-
}
-
}
-
-
function init_image_data() {
-
if(isW3Mode){
-
document.getElementById("www_image_data").parentElement.removeChild(document.getElementById("www_image_data"));
-
document.getElementById("w3_image_data").style.display="block";
-
resizeMe("600px", "400px");
-
}else{
-
document.getElementById("w3_image_data").parentElement.removeChild(document.getElementById("w3_image_data"));
-
document.getElementById("www_image_data").style.display="block";
-
}
-
}
-
-
function init_link_data() {
-
if(isW3Mode){
-
var mainbody = document.getElementsByTagName("body")[0];
-
mainbody.innerHTML = w3Content;
-
document.body.className = elements[1];
-
resizeMe("550px", "400px");
-
}else{
-
var mainbody = document.getElementsByTagName("body")[0];
-
mainbody.innerHTML = wwwContent;
-
resizeMe("375px", "510px");
-
}
-
-
}
-
-
function init_edit_link_data() {
-
if(isW3Mode){
-
var mainDiv = document.getElementById("mainDiv");
-
link = getLink();
-
var formStr = '<table border="1" cellspacing="0">\n' + '<tr><td colspan="4" id="message"></td></tr>\n';
-
formStr += generateLabelField() + '\n';
-
formStr += generateURLField() + '\n';
-
formStr += '</table>\n';
-
mainDiv.innerHTML = formStr;
-
-
if (isBookmarkLink()){
-
document.getElementById('name').value = link.name;
-
}
-
else {
-
document.getElementById('url').value = link.href;
-
var text = "";
-
-
if(link.getElementsByTagName("B")[0] != undefined)
-
text = link.getElementsByTagName("B")[0].getAdjacentText("afterBegin");
-
else if (link.getElementsByTagName("SPAN")[0] != undefined)
-
text = link.getElementsByTagName("SPAN")[0].getAdjacentText("afterBegin");
-
else
-
text = link.getAdjacentText("afterBegin");
-
-
document.getElementById('label').value = text;
-
}
-
}else{
-
var mainDiv = document.getElementById("mainDiv");
-
link = getLink();
-
parentType = link.parentNode.nodeName;
-
divBox = link.parentNode.parentNode.parentNode.className;
-
divBoxContent = link.parentNode.parentNode.parentNode.innerHTML;
-
className = link.className;
-
var formStr = '<table border="1" cellspacing="0">\n' + '<tr><td colspan="4" id="message"></td></tr>\n';
-
formStr += generateLabelField() + '\n';
-
formStr += generateURLField() + '\n';
-
-
if (className.length > 0 && className != "ibm-feature-link" ){
-
// get the selected Icon index
-
for (i=0; i < icons.length; i++){
-
if (icons[i] == className){
-
selectedIcon = i;
-
}
-
}
-
-
formStr += generateIconOptions() + '\n';
-
}
-
-
formStr += '</table>\n';
-
mainDiv.innerHTML = formStr;
-
-
if (isBookmarkLink()){
-
document.getElementById('name').value = link.name;
-
}
-
else {
-
document.getElementById('url').value = link.href;
-
var text = "";
-
-
if(link.getElementsByTagName("B")[0] != undefined)
-
text = link.getElementsByTagName("B")[0].getAdjacentText("afterBegin");
-
else if (link.getElementsByTagName("SPAN")[0] != undefined)
-
text = link.getElementsByTagName("SPAN")[0].getAdjacentText("afterBegin");
-
else
-
text = link.getAdjacentText("afterBegin");
-
-
if(divBox != null && (divBox=="ibm-container-body" )){
-
text = link.innerHTML;
-
text1 = text.split("<BR>");
-
var text2="";
-
for(var i = 0; i < text1.length; i++){
-
text2 = text2 + text1[i];
-
}
-
text = text2;
-
}
-
document.getElementById('label').value = text;
-
}
-
}
-
-
}
-
-
function init_table_data() {
-
-
if (isW3Mode)
-
{
-
//alert("in ifff");
-
if (!is_browserName_IE)
-
document.getElementById("www_table_data").parentNode.removeChild(document.getElementById("www_table_data"));
-
else
-
document.getElementById("www_table_data").parentElement.removeChild(document.getElementById("www_table_data"));
-
document.getElementById("w3_table_data").style.display = "block";
-
//alert(tableInfo[0]);
-
if (!is_browserName_IE){}
-
//location=location;
-
else
-
location = tableInfo[0];
-
//alert(location);
-
//alert(tableInfo[1]);
-
document.body.className = tableInfo[1];
-
//alert(document.body.className);
-
resizeMe("500px", "600px");
-
//alert("in if");
-
}
-
else {
-
-
alert("hi in else");
-
if (!is_browserName_IE)
-
document.getElementById("w3_table_data").parentNode.removeChild(document.getElementById("w3_table_data"));
-
else
-
document.getElementById("w3_table_data").parentElement.removeChild(document.getElementById("w3_table_data"));
-
document.getElementById("www_table_data").style.display = "block";
-
resizeMe("550px", "550px");
-
// debugMsg(PACKAGE_NAME + "init()\n\tm_param_columnwidth="+
-
// m_param_columnwidth);
-
var strDisplayHTMLTable = null;
-
var regExp = null;
-
-
for (i = 0; i < dataTableNames.length; i++) {
-
regExp = / @@TABLE_WIDTH@@ /g;
-
strDisplayHTMLTable = dataTableCodes[i].replace(regExp, DISPLAY_WIDTH);
-
regExp = / @@HEADER@@ /g;
-
strDisplayHTMLTable = strDisplayHTMLTable.replace(regExp, REPLACE_STRING_DISPLA_HEADER);
-
regExp = / @@DATA@@ /g;
-
strDisplayHTMLTable = strDisplayHTMLTable.replace(regExp, REPLACE_STRING_DISPLA_DATA);
-
-
if (i == 0) {
-
regExp = / @@TABLE_HEADER@@ /g;
-
strDisplayHTMLTable = strDisplayHTMLTable.replace(regExp, REPLACE_STRING_DISPLA_TABLE_CAPTION_DATA);
-
}
-
else
-
if (i == 1) {
-
regExp = / @@TABLE_HEADER@@ /g;
-
strDisplayHTMLTable = strDisplayHTMLTable.replace(regExp, REPLACE_STRING_DISPLA_TABLE_CAPTION_COMPLEX);
-
}
-
else {
-
alert(PACKAGE_NAME + "init()\n\t" + ERR_1745);
-
} // end if
-
debugMsg(strDisplayHTMLTable);
-
-
if (strDisplayHTMLTable != null) {
-
row = textList.insertRow()
-
td = row.insertCell()
-
td.insertAdjacentHTML("afterBegin", "<br /><a onclick=\"selectText(\'" + i + "\');\">" + strDisplayHTMLTable + "</a><br />");
-
}
-
strDisplayHTMLTable = null;
-
regExp = null;
-
} // end for
-
resizeBody(530);
-
}
-
-
}
-
-
function init_component_data() {
-
if(isW3Mode){
-
var mainbody = document.getElementsByTagName("body")[0];
-
mainbody.innerHTML = w3Content;
-
location = para[0];
-
document.body.className = para[1];
-
// show breadcrumbs only when the cursor is at content-head
-
if(location=="content-head"){
-
// show Page Tabs and Page Toggles
-
var oOption1=document.createElement("OPTION");
-
oOption1.value=3;
-
oOption1.innerHTML=' \;Page Level Tabs \;';
-
document.text.type.appendChild(oOption1);
-
var oOption2=document.createElement("OPTION");
-
oOption2.value=5;
-
oOption2.innerHTML=' \;Page Toggles \;';
-
document.text.type.appendChild(oOption2);
-
// show breadcrumbs
-
var oOption=document.createElement("OPTION");
-
oOption.value=4;
-
oOption.innerHTML=' \;Breadcrumbs \;';
-
document.text.type.appendChild(oOption);
-
}
-
-
if(location=="content-main") {
-
// show Page Tabs and Page Toggles
-
var oOption1=document.createElement("OPTION");
-
oOption1.value=3;
-
oOption1.innerHTML=' \;Page Level Tabs \;';
-
document.text.type.appendChild(oOption1);
-
var oOption2=document.createElement("OPTION");
-
oOption2.value=5;
-
oOption2.innerHTML=' \;Page Toggles \;';
-
document.text.type.appendChild(oOption2);
-
}
-
document.text.type.focus();
-
document.text.type.selectedIndex = 0;
-
generateText();
-
-
}else{
-
// alert("www mode from rules engine");
-
// alert("going to resize");
-
resizeMe("570px", "700px");
-
var mainbody = document.getElementsByTagName("body")[0];
-
mainbody.innerHTML = wwwContent;
-
/*
-
* var div = document.createElement('div'); div.id =
-
* "www_component_data"; div.innerHTML = www; mainbody.appendChild(div);
-
*/
-
-
-
if(displayMode == "content" || displayMode == "ibm-content-main"){
-
document.getElementById("main_column_components").style.display = "";
-
}else if(displayMode == "ibm-content-sidebar"){
-
document.getElementById("sidebar_components").style.display = "";
-
}else if(displayMode == "content-3-1" || displayMode == "content-3-2"){
-
document.getElementById("content3_components").style.display = ""
-
}else if(displayMode == "content-4-1" || displayMode == "content-4-2" || displayMode == "content-4-3"){
-
document.getElementById("content4_components").style.display = ""
-
}else if(displayMode == "ibm-content-head"){
-
document.getElementById("ibm-content-head").style.display = ""
-
}
-
else{// must be popup layout
-
document.getElementById("miscellaneous_components").style.display = "";
-
}
-
-
window.focus();
-
resizeBody(545);
-
initDropDown();
-
}
-
}
-
-
function init_plugin_data() {
-
if(isW3Mode){
-
document.getElementById("www_plugin_data").parentElement.removeChild(document.getElementById("www_plugin_data"));
-
document.getElementById("w3_plugin_data").style.display="block";
-
resizeMe("650px", "400px");
-
// displayCustomizedComponents();
-
generateMainPluginTable();
-
// displayCustomComponents();
-
if(isSiteServ()) {
-
generateSiteServPluginTable();
-
}
-
if(isDynamicTrue) {
-
resizeMe("850px", "525px");
-
// generateChsPluginTable();
-
}
-
-
}else{
-
document.getElementById("w3_plugin_data").parentElement.removeChild(document.getElementById("w3_plugin_data"));
-
document.getElementById("www_plugin_data").style.display="block";
-
resizeMe("650px", "470px");
-
// displayCustomizedComponents();
-
generatePluginTable();
-
}
-
}
-
-
function getElementOf(parent, childName, attributeName, attributeValue, getFirstFound){
-
var targetElement = null;
-
var children = parent.all;
-
for(var i=0; i<children.length; i++){
-
var child = children(i);
-
if(child.nodeType == 1 && child.tagName == childName){
-
if(attributeName == ''){
-
return child;
-
}else{
-
var att = child.getAttributeNode(attributeName);
-
if(att != null && att.nodeValue == attributeValue){
-
targetElement = child;
-
if(getFirstFound){
-
return targetElement;
-
}
-
}
-
}
-
}
-
}
-
return targetElement;
-
}
-
-
-
// search for an element among all elements contained in parent
-
// function hasChildOf() only search one level
-
function hasElementOf(parent, childName, attributeName, attributeValue){
-
var children = parent.all;
-
for(var i=0; i<children.length; i++){
-
var child = children(i);
-
if(child.nodeType == 1 && child.tagName == childName){
-
if(attributeName == ""){
-
return true;
-
}
-
var att = child.getAttributeNode(attributeName);
-
if(att != null && att.nodeValue == attributeValue){
-
return true;
-
}
-
}
-
}
-
return false;
-
}
-
-
function raiseButton(el) {with (el.style) {borderTop ="1 solid buttonhighlight";borderLeft ="1 solid buttonhighlight";
-
borderBottom ="1 solid buttonshadow";borderRight ="1 solid buttonshadow";padding ="1";}}
-
-
function normalButton(el) {with (el.style) {background = "";border = "1px solid buttonface";padding = "1";}}
-
-
function pressedButton(el) {with (el.style){ borderTop ="1 solid buttonshadow";paddingTop = "2";borderLeft ="1 solid buttonshadow";
-
borderBottom ="1 solid buttonhighlight";paddingBottom= "0";borderRight = "1 solid buttonhighlight";}}
-
-
function getReal(evt, type, value) {
-
if (!evt) evt = window.event;
-
temp = evt;
-
while ((temp != null) && (temp.tagName != "BODY"))
-
{
-
if (eval("temp." + type) == value)
-
{
-
evt = temp;return evt;
-
}
-
if(!is_browserName_IE)
-
temp = temp.parentNode
-
else
-
temp = temp.parentElement;
-
-
-
}
-
return evt;
-
-
}
-
-
-
-
function setRange()
-
{
-
if(!is_browserName_IE)
-
{
-
st = document.getElementById("myEditor").contentDocument;
-
oSelect = st.getSelection();
-
-
oTop=oSelect.toString().length+st.body.scrollTop;
-
oLeft=oSelect.toString().length+st.body.scrollLeft;
-
-
-
}
-
else
-
{
-
st=document.frames["myEditor"].document;
-
oSelect = st.selection;
-
oRange=oSelect.createRange();
-
oTop=oRange.offsetTop+st.body.scrollTop;
-
oLeft=oRange.offsetLeft+st.body.scrollLeft;
-
}
-
}
-
-
function parentHasID_Of(idValue, childElement){
-
if(childElement != null){
-
var parent = childElement.parentElement;
-
if(parent != null){
-
if(parent.id.indexOf(idValue)!=-1){
-
return true
-
}else{
-
return parentHasID_Of(idValue, parent);
-
}
-
}
-
}
-
return false;
-
}
-
-
/**
-
* Position Context Menu
-
*/
-
function positionMenu(contextMenu, curposX, curposY, halfScreenWidth, halfScreenHeight) {
-
-
// Screen Quadrant
-
// |
-
// 2nd | 1st
-
// -------------------------
-
// |
-
// 3rd | 4th
-
-
// check if mouse cursor is at first quadrant of the screen
-
-
if (curposX > halfScreenWidth && curposY < halfScreenHeight) {
-
debugMsg("first quadrant\n\tev.clientX =" + ev.clientX + "\n\tev_clientY="+ev.clientY);
-
contextMenu.style.leftPos+=10;
-
contextMenu.style.posLeft=ev.clientX+50;
-
contextMenu.style.posTop=ev.clientY;
-
if(isW3Mode){
-
contextMenu.style.posTop += 100;
-
}
-
contextMenu.style.display="";
-
contextMenu.setCapture();
-
}
-
// check if mouse cursor is at second quadrant of the screen
-
else if (curposX < halfScreenWidth && curposY < halfScreenHeight) {
-
debugMsg("second quadrant\n\tev.clientX =" + ev.clientX + "\n\tev_clientY="+ev.clientY);
-
contextMenu.style.leftPos+=10;
-
contextMenu.style.posLeft=ev.clientX+200;
-
contextMenu.style.posTop=ev.clientY;
-
if(isW3Mode){
-
contextMenu.style.posTop += 100;
-
}
-
contextMenu.style.display="";
-
contextMenu.setCapture();
-
}
-
// check if mouse cursor is at 3rd quadrant of the screen
-
else if (curposX < halfScreenWidth && curposY > halfScreenHeight) {
-
debugMsg("thrid quadrant\n\tev.clientX =" + ev.clientX + "\n\tev_clientY="+ev.clientY);
-
contextMenu.style.leftPos+=10;
-
contextMenu.style.posLeft=ev.clientX+200;
-
contextMenu.style.posTop=ev.clientY-120;
-
contextMenu.style.display="";
-
contextMenu.setCapture();
-
}
-
// check if mouse cursor is at 3rd quadrant of the screen
-
else if (curposX > halfScreenWidth && curposY > halfScreenHeight) {
-
debugMsg("fourth quadrant\n\tev.clientX =" + ev.clientX + "\n\tev_clientY="+ev.clientY);
-
contextMenu.style.leftPos+=10;
-
contextMenu.style.posLeft=ev.clientX+50;
-
contextMenu.style.posTop=ev.clientY-120;
-
contextMenu.style.display="";
-
contextMenu.setCapture();
-
}
-
}
-
-
function validateURL(fieldObj)
-
{
-
var value = fieldObj.value;
-
if (!isAlphaNumericSpecial(value, false)) {
-
// alert("The URL can only contain letters, digits, periods, colons,
-
// slashes, question marks, pound signs, ampersands, hyphens,
-
// underscores, at signs, plus signs, equal signs, percentage signs,
-
// semi-colons, brackets, tilters, or commas.");
-
alert(msg112);
-
return false;
-
}
-
else {
-
return true;
-
}
-
}
-
-
function isAlphaNumericSpecial (s,defaultEmptyOK)
-
{
-
if (isEmpty(s)) {
-
// if the user set Empty is okay, return
-
if (defaultEmptyOK == true)
-
return true;
-
// Otherwise, false
-
else
-
return false;
-
}
-
-
// Search through string's characters one by one
-
// until we find a non-alphanumeric character.
-
// When we do, return false; if we don't, return true.
-
for (var i = 0; i < s.length; i++)
-
{
-
// Check that current character is number or letter.
-
var c = s.charAt(i);
-
if (!(isLetter(c) || isDigit(c)))
-
{
-
if((c==".") || (c==":") || (c=="/") || (c=="?") || (c=="#") || (c=="&") || (c=="-") || (c=="_") || (c=="@") || (c=="+") || (c=="=") || (c=="%") || (c==";") || (c=="(") || (c==")") || (c=="~") || (c==",")) // these
-
// characters
-
// are
-
// OK
-
continue;
-
else
-
return false;
-
}
-
}
-
-
// All characters are numbers or letters.
-
return true;
-
}
-
-
-
function isEmpty(s)
-
{
-
return ((s == null) || (s.length == 0));
-
}
-
-
// Returns true if character c is an English letter (A .. Z, a..z).
-
function isLetter (c)
-
{
-
return ( ((c >= "a") && (c <= "z")) || ((c >= "A") && (c <= "Z")) );
-
}
-
-
// Returns true if character c is a digit (0 .. 9).
-
function isDigit (c)
-
{
-
return ((c >= "0") && (c <= "9"));
-
}
-
-
// find the first occurance of TD tag
-
function findTD(el) {
-
var tempElem=el;
-
while(tempElem!=null) {
-
if(tempElem.tagName=="TD") {
-
return tempElem;
-
}
-
else if (tempElem.tagName=="TH") {
-
return tempElem;
-
}
-
else {
-
// do nothing
-
}
-
-
// otherwise search the parent element
-
tempElem=tempElem.parentElement;
-
-
// return when it reaches the top of the code
-
if(tempElem.tagName=="HTML") {
-
return el;
-
}
-
-
}
-
-
-
return tempElem;
-
}
-
-
function fixTBpos()
-
{
-
-
var OCode = document.getElementById('OCode');
-
-
var ODiv = document.getElementById('ODiv');
-
-
st=document.body;
-
if(isW3Mode)
-
OCode.style.height=ODiv.style.height=st.clientHeight-119;
-
else
-
OCode.style.height=ODiv.style.height=st.clientHeight-113;
-
-
typeof(toc) == "undefined" ? '':Resizetoc();
-
}
-
-
function hasTagsInText(text)
-
{
-
-
if(text.indexOf("<TABLE") >=0 || text.indexOf("<table") >=0)
-
return 'table';
-
-
if(text.indexOf("<TD") >=0 || text.indexOf("<td") >=0)
-
return 'column';
-
-
if(text.indexOf("<IMG") >=0 || text.indexOf("<img") >=0)
-
return 'image';
-
-
if(text.indexOf("<H2") >=0 || text.indexOf("<h2") >=0)
-
return 'h2';
-
-
if(text.indexOf("<DIV") >=0 || text.indexOf("<div") >=0)
-
return 'div';
-
-
if(text.indexOf("<A") >=0 || text.indexOf("<a") >=0)
-
return 'link';
-
-
if(text.indexOf("<FORM") >=0 || text.indexOf("<form") >=0)
-
return 'form';
-
-
if(text.indexOf("<P>") >=0 || text.indexOf("<p>") >=0)
-
return 'invisible paragraph-mark';
-
-
if(text.indexOf("<BR>") >=0 || text.indexOf("<br>") >=0)
-
return 'invisible new-line-mark';
-
-
return '';
-
}
-
-
function hasFormatInText(text)
-
{
-
var format = ''
-
if(text.indexOf("id=subtitle") >=0)
-
format+= 'id=subtitle'
-
-
if(text.indexOf("class=greytext") >=0)
-
format+= 'class=greytext'
-
if(text.indexOf("class=prices") >=0)
-
format+= 'class=prices'
-
if(text.indexOf("class=small") >=0)
-
format+= 'class=small'
-
if(text.indexOf("class=bct") >=0)
-
format+= 'class=bct'
-
-
// jae added
-
if(text.indexOf("class=price") >=0)
-
format+= 'class=price'
-
-
if(text.indexOf("class=error") >=0)
-
format+= 'class=error'
-
// to here
-
-
if(text.indexOf("<BLOCKQUOTE ") >=0 || text.indexOf("<BLOCKQUOTE>") >=0)
-
format+= 'header=blockquote'
-
-
-
if(text.indexOf("formatted-text") >=0 || text.indexOf("class=")>=0)
-
format+= 'id=misctext'
-
-
if(text.indexOf("<SPAN ") >=0 || text.indexOf("<SPAN>") >=0)
-
format+= 'span'
-
-
if(text.indexOf("<H1 ") >=0 || text.indexOf("<H1>") >=0)
-
format+= 'header=h1'
-
-
if(text.indexOf("<H2 ") >=0 || text.indexOf("<H2>") >=0)
-
format+= 'header=h2'
-
-
if(text.indexOf("<H3 ") >=0 || text.indexOf("<H3>") >=0)
-
format+= 'header=h1'
-
-
if(text.indexOf("<H4 ") >=0 || text.indexOf("<H4>") >=0)
-
format+= 'header=h2'
-
-
if(text.indexOf("<EM ") >=0 || text.indexOf("<EM>") >=0)
-
format+= 'style=em'
-
-
if(text.indexOf("<B ") >=0 || text.indexOf("<B>") >=0)
-
format+= 'style=b'
-
if(text.indexOf("<STRONG ") >=0 || text.indexOf("<STRONG>") >=0)
-
format+= 'style=strong'
-
if(text.indexOf("<I ") >=0 || text.indexOf("<I>") >=0)
-
format+= 'style=i'
-
-
if(text.indexOf("<U ") >=0 || text.indexOf("<U>") >=0)
-
format+= 'style=u'
-
if(text.indexOf("<FONT ") >=0 || text.indexOf("<FONT>") >=0)
-
format+= 'style=font'
-
-
return format
-
}
-
-
Please help me in that text undefined error....Because I cannot get a better and polite expert like u
Dormilich 8,658
Recognized Expert Moderator Expert
I need to see the relevant HTML (which contains the function call) or a working link to the page.
@Dormilich
Actually When I apply that fix I am getting many errors like doUp is not defined doDown doOver doOut not defined..Its all in one line
Dormilich 8,658
Recognized Expert Moderator Expert
those may have the same reasons.
@Dormilich
I have all those errors in this single line..how 2 fix this?
Dormilich 8,658
Recognized Expert Moderator Expert
I don’t know without code.
@Dormilich
how to fire the errors using firebug in firefox?
Dormilich 8,658
Recognized Expert Moderator Expert
that question does not make sense to me. please explain.
@Dormilich
Actually I installed firebug add-on in firefox,how to work with that..Showing the same error text undefined
Dormilich 8,658
Recognized Expert Moderator Expert
that’s what Firebug does (among others). I think there’s a tutorial at the Firebug website about how to use it.
I only can help you further if I can see your page.
@Dormilich
Is that code helps to fix the error....help plz
Dormilich 8,658
Recognized Expert Moderator Expert
unfortunately I could not find the mentioned function. could you give me a link to the page?
@Dormilich
hi..this code is not working in firefox ..its just coming addCSS is not defined..Please help me
addCSS(finalURL + "/css/screen.css");
addCSS(finalURL + "/css/interior.css");
addCSS(finalURL + "/css/icons.css");
addCSS(finalURL + "/css/tables.css");
Dormilich 8,658
Recognized Expert Moderator Expert
..its just coming addCSS is not defined..Please help me
I need a link to the page, there seem to be so many cross-references, that it’s impossible to just post the code.
for now I can only say, you can only call functions you have defined earlier or which are built-in.
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Razarr69 |
last post by:
I have a ASP application that I am using for my company and it is
currently running on a Windows 2000 server box with IIS 5. The code
works perfectly there (except for handling large files - due...
|
by: lawrence |
last post by:
Can anyone tell me why this code works in Netscape 7.1 but not in
IE???
<SCRIPT type='text/javascript'>
function makeVisible(nameOfDiv) {...
|
by: Avi |
last post by:
Hi All.
This code works very fine in Firefox but not in I.E.
Can anybody help me out?
it gives ... "Unknown Runtime Error" in I.E.
This code ... Stores N*2 Matrix at Client Side & provide the...
|
by: Crash |
last post by:
C#
VS 2003
..Net Framework V1.1 SP1
SQL Server 2000 SP3
Enterprise Library June 2005
I'm working with some code {not of my creation} that performs the
following sequence of actions:
- Open...
|
by: tweety |
last post by:
wat does "native code" in firefox dom inspector mean?
function hasAttribute() {
}
can anyone help me with this?
Thanks in advance,
|
by: smartic |
last post by:
I'm having problem with this code in firefox but in the Internet Explorer Browser works fine on it what is the wrong in my code ?
<html>
<head>
<title>Like_mail</title>
<script...
|
by: reemamg |
last post by:
I've two frames in a page. On the left Frame i've buttons , if we click on button the particular pages will be loaded in the middle Frame.
This code works perfectly in Firefox but not in IE ... ...
|
by: reemamg |
last post by:
Have a piece of code which works in Firefox however doesnt work in IE
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<TITLE> New Document </TITLE>
<meta...
|
by: Anz |
last post by:
I used the javascript functions as shown below.
<a href="javascript:;;;"
onclick="this.style.behavior='url(#default#homepage)';
this.setHomePage(location.href);">
But this code works for IE,...
|
by: PrabodhanP |
last post by:
I hv following javascript form validation code works in IE but not in Mozilla-Firefox ...please suggest
<script type="text/javascript">
function IsNumeric(strString)
// check for valid...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The...
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
| |