Avatar billede talk Nybegynder
26. februar 2001 - 15:16 Der er 43 kommentarer og
4 løsninger

Scripting op mod Microsoft DHTML Editing Control

Halløj

Jeg har fået fingrene i dette script.

Jeg kan dog ikke rigtigt fylde input(?) feltet ud. Hvordan fylder jeg text i. Altså som f.eks. <textarea><%= text %></textarea>

Se scriptet her:

<%
Response.Expires = 0

dim arr(1,1), count, sessionId

count = 1 + application(\"webedit_count\")
if count>1000 then  count = 0
application(\"webedit_count\") = count
sessionId = \"webedit_session\" & count

arr(0,0) = \"webedit_id\"
arr(0,1) = session(\"webedit_id\")
arr(1,0) = \"webedit_pictPath\"
arr(1,1) = session(\"webedit_pictPath\")
application(sessionid) = arr
%>
<html>
<head>
<meta NAME=\"GENERATOR\" CONTENT=\"Microsoft Visual Studio 6.0\">
<title>WebEdit</title>

<script LANGUAGE=\"vbscript\">
function setOpt
  Set f=CreateObject(\"DEGetBlockFmtNamesParam.DEGetBlockFmtNamesParam\")
  on error resume next
  tbContentElement.ExecCommand DECMD_GETBLOCKFMTNAMES, OLECMDEXECOPT_DODEFAULT,f
  setOpt = false
  For Each fmtName in f.Names
    if fmtName = \"Almindeligt\" then  setOpt = true
  exit for
  Next
end function
</script>

<script LANGUAGE=\"JavaScript\">
<!-- Hide script
var picts = new Array();
documentHasBeenParsed = true;
menuHasBeenChecked = false;

function getText(){
    var appVersion;

    appVersion=navigator.appVersion;   

    tstr = tbContentElement.DOM.body.innerHTML
    for(i in picts) {
    var searchStr = \"\", searchArr = new Array()
    searchArr = i.split(\"\\\\\")
    for(j in searchArr) {
      searchStr += \"\\x5c\" + searchArr[j]
    }

    // replace local img file links with server links based on browser
    //ie50
    if (appVersion.search(/MSIE 5./i)>0) {

    searchStr = \"src=\\\"\" + searchStr.substr(1)
    tstr = tstr.replace(searchStr, \"src=\\\"\" + picts[i])
    tstr = tstr.replace(\"\\?>\",\">\")
    } else {
    //ie40
    searchStr = \"src=\\\"file://\" + searchStr.substr(1)
    tstr = tstr.replace(searchStr, \"src=\\\"\" + picts[i])
    tstr = tstr.replace(\"\\?>\",\">\")
    }

    // if the img links are non-relative make them relative
    searchStr = \"src=\\\"http://<%=request.servervariables(\"server_name\")%>\";
    tstr = tstr.replace(searchStr, \"src=\\\"\");
    }
    return tstr
}

<!-- Unhide script -->
</script>

<!-- Styles -->
<link REL=\"stylesheet\" TYPE=\"text/css\" HREF=\"Toolbars/toolbars.css\">


<!-- Script Functions and Event Handlers -->
<script LANGUAGE=\"JavaScript\" SRC=\"Inc/dhtmled.js\">
</script>


<script ID=\"clientEventHandlersJS\" LANGUAGE=\"javascript\">
<!--

//
// Constants
//
var MENU_SEPARATOR = \"\"; // Context menu separator

//
// Globals
//
var docComplete = false;
var initialDocComplete = false;

var QueryStatusToolbarButtons = new Array();
var QueryStatusEditMenu = new Array();
var QueryStatusFormatMenu = new Array();
var QueryStatusHTMLMenu = new Array();
var QueryStatusTableMenu = new Array();
var QueryStatusZOrderMenu = new Array();
var ContextMenu = new Array();
var GeneralContextMenu = new Array();
var TableContextMenu = new Array();
var AbsPosContextMenu = new Array();
var bTextMode = false;

//
// Utility functions
//

// Constructor for custom object that represents an item on the context menu
function ContextMenuItem(string, cmdId) {
  this.string = string;
  this.cmdId = cmdId;
}

// Constructor for custom object that represents a QueryStatus command and
// corresponding toolbar element.
function QueryStatusItem(command, element) {
  this.command = command;
  this.element = element;
}

//
// Event handlers
//
function window_onload() {

  // Initialze QueryStatus tables. These tables associate a command id with the
  // corresponding button object. Must be done on window load, \'cause the buttons must exist.
  QueryStatusToolbarButtons[0] = new QueryStatusItem(DECMD_BOLD, document.body.all[\"DECMD_BOLD\"]);
  QueryStatusToolbarButtons[1] = new QueryStatusItem(DECMD_COPY, document.body.all[\"DECMD_COPY\"]);
  QueryStatusToolbarButtons[2] = new QueryStatusItem(DECMD_CUT, document.body.all[\"DECMD_CUT\"]);
  QueryStatusToolbarButtons[3] = new QueryStatusItem(DECMD_HYPERLINK, document.body.all[\"DECMD_HYPERLINK\"]);
  QueryStatusToolbarButtons[4] = new QueryStatusItem(DECMD_INDENT, document.body.all[\"DECMD_INDENT\"]);
  QueryStatusToolbarButtons[5] = new QueryStatusItem(DECMD_ITALIC, document.body.all[\"DECMD_ITALIC\"]);
  QueryStatusToolbarButtons[6] = new QueryStatusItem(DECMD_JUSTIFYLEFT, document.body.all[\"DECMD_JUSTIFYLEFT\"]);
  QueryStatusToolbarButtons[7] = new QueryStatusItem(DECMD_JUSTIFYCENTER, document.body.all[\"DECMD_JUSTIFYCENTER\"]);
  QueryStatusToolbarButtons[8] = new QueryStatusItem(DECMD_JUSTIFYRIGHT, document.body.all[\"DECMD_JUSTIFYRIGHT\"]);
  QueryStatusToolbarButtons[9] = new QueryStatusItem(DECMD_LOCK_ELEMENT, document.body.all[\"DECMD_LOCK_ELEMENT\"]);
  QueryStatusToolbarButtons[10] = new QueryStatusItem(DECMD_MAKE_ABSOLUTE, document.body.all[\"DECMD_MAKE_ABSOLUTE\"]);
  QueryStatusToolbarButtons[11] = new QueryStatusItem(DECMD_ORDERLIST, document.body.all[\"DECMD_ORDERLIST\"]);
  QueryStatusToolbarButtons[12] = new QueryStatusItem(DECMD_OUTDENT, document.body.all[\"DECMD_OUTDENT\"]);
  QueryStatusToolbarButtons[13] = new QueryStatusItem(DECMD_PASTE, document.body.all[\"DECMD_PASTE\"]);
  QueryStatusToolbarButtons[14] = new QueryStatusItem(DECMD_REDO, document.body.all[\"DECMD_REDO\"]);
  QueryStatusToolbarButtons[15] = new QueryStatusItem(DECMD_UNDERLINE, document.body.all[\"DECMD_UNDERLINE\"]);
  QueryStatusToolbarButtons[16] = new QueryStatusItem(DECMD_UNDO, document.body.all[\"DECMD_UNDO\"]);
  QueryStatusToolbarButtons[17] = new QueryStatusItem(DECMD_UNORDERLIST, document.body.all[\"DECMD_UNORDERLIST\"]);
  QueryStatusToolbarButtons[18] = new QueryStatusItem(DECMD_INSERTTABLE, document.body.all[\"DECMD_INSERTTABLE\"]);
  QueryStatusToolbarButtons[19] = new QueryStatusItem(DECMD_INSERTROW, document.body.all[\"DECMD_INSERTROW\"]);
  QueryStatusToolbarButtons[20] = new QueryStatusItem(DECMD_DELETEROWS, document.body.all[\"DECMD_DELETEROWS\"]);
  QueryStatusToolbarButtons[21] = new QueryStatusItem(DECMD_INSERTCOL, document.body.all[\"DECMD_INSERTCOL\"]);
  QueryStatusToolbarButtons[22] = new QueryStatusItem(DECMD_DELETECOLS, document.body.all[\"DECMD_DELETECOLS\"]);
  QueryStatusToolbarButtons[23] = new QueryStatusItem(DECMD_INSERTCELL, document.body.all[\"DECMD_INSERTCELL\"]);
  QueryStatusToolbarButtons[24] = new QueryStatusItem(DECMD_DELETECELLS, document.body.all[\"DECMD_DELETECELLS\"]);
  QueryStatusToolbarButtons[25] = new QueryStatusItem(DECMD_MERGECELLS, document.body.all[\"DECMD_MERGECELLS\"]);
  QueryStatusToolbarButtons[26] = new QueryStatusItem(DECMD_SPLITCELL, document.body.all[\"DECMD_SPLITCELL\"]);
  QueryStatusToolbarButtons[27] = new QueryStatusItem(DECMD_SETFORECOLOR, document.body.all[\"DECMD_SETFORECOLOR\"]);
  QueryStatusToolbarButtons[28] = new QueryStatusItem(DECMD_SETBACKCOLOR, document.body.all[\"DECMD_SETBACKCOLOR\"]);

  // Initialize the context menu arrays.
  GeneralContextMenu[0] = new ContextMenuItem(\"Klip\", DECMD_CUT);
  GeneralContextMenu[1] = new ContextMenuItem(\"Kopier\", DECMD_COPY);
  GeneralContextMenu[2] = new ContextMenuItem(\"Indsæt\", DECMD_PASTE);
  TableContextMenu[0] = new ContextMenuItem(MENU_SEPARATOR, 0);
  TableContextMenu[1] = new ContextMenuItem(\"Indsæt række\", DECMD_INSERTROW);
  TableContextMenu[2] = new ContextMenuItem(\"Slet række\", DECMD_DELETEROWS);
  TableContextMenu[3] = new ContextMenuItem(MENU_SEPARATOR, 0);
  TableContextMenu[4] = new ContextMenuItem(\"Indsæt kolonne\", DECMD_INSERTCOL);
  TableContextMenu[5] = new ContextMenuItem(\"Slet kolonne\", DECMD_DELETECOLS);
  TableContextMenu[6] = new ContextMenuItem(MENU_SEPARATOR, 0);
  TableContextMenu[7] = new ContextMenuItem(\"Indsæt felt\", DECMD_INSERTCELL);
  TableContextMenu[8] = new ContextMenuItem(\"Slet felt\", DECMD_DELETECELLS);
  TableContextMenu[9] = new ContextMenuItem(\"Slå felter sammen\", DECMD_MERGECELLS);
  TableContextMenu[10] = new ContextMenuItem(\"Opdel felter\", DECMD_SPLITCELL);
  AbsPosContextMenu[0] = new ContextMenuItem(MENU_SEPARATOR, 0);
  AbsPosContextMenu[1] = new ContextMenuItem(\"Bagerst\", DECMD_SEND_TO_BACK);
  AbsPosContextMenu[2] = new ContextMenuItem(\"Forrest\", DECMD_BRING_TO_FRONT);
  AbsPosContextMenu[3] = new ContextMenuItem(MENU_SEPARATOR, 0);
  AbsPosContextMenu[4] = new ContextMenuItem(\"Flyt bagud\", DECMD_SEND_BACKWARD);
  AbsPosContextMenu[5] = new ContextMenuItem(\"Flyt fremad\", DECMD_BRING_FORWARD);
  AbsPosContextMenu[6] = new ContextMenuItem(MENU_SEPARATOR, 0);
  AbsPosContextMenu[7] = new ContextMenuItem(\"Send under tekst\", DECMD_SEND_BELOW_TEXT);
  AbsPosContextMenu[8] = new ContextMenuItem(\"Bring over tekst\", DECMD_BRING_ABOVE_TEXT);
   
  //Pau
  if (\"<%=session(\"webedit_inputURL\")%>\"!=\"\") {
        documentHasBeenParsed = false
    tbContentElement.LoadURL(\"<%=session(\"webedit_inputURL\")%>\")
  }else {
        if (\"<%=request(\"inputURL\")%>\"!=\"\") {
            documentHasBeenParsed = false
            tbContentElement.LoadURL(\"<%=request(\"inputURL\")%>\")
        }
  }
   
}

function InsertTable() {
  var pVar = ObjTableInfo;
  var args = new Array();
  var arr = null;
   
  // Display table information dialog
  args[\"NumRows\"] = ObjTableInfo.NumRows;
  args[\"NumCols\"] = ObjTableInfo.NumCols;
  args[\"TableAttrs\"] = ObjTableInfo.TableAttrs;
  args[\"CellAttrs\"] = ObjTableInfo.CellAttrs;
  args[\"Caption\"] = ObjTableInfo.Caption;
 
  arr = null;
       
  arr = showModalDialog( \"instable.asp\",
                            args,
                            \"font-family:MS Sans Serif; font-size:12; dialogWidth:34em; dialogHeight:25em\");
  if (arr != null) {
 
    // Initialize table object
    for ( elem in arr ) {
      if (\"NumRows\" == elem && arr[\"NumRows\"] != null) {
        ObjTableInfo.NumRows = arr[\"NumRows\"];
      } else if (\"NumCols\" == elem && arr[\"NumCols\"] != null) {
        ObjTableInfo.NumCols = arr[\"NumCols\"];
      } else if (\"TableAttrs\" == elem) {
        ObjTableInfo.TableAttrs = arr[\"TableAttrs\"];
      } else if (\"CellAttrs\" == elem) {
        ObjTableInfo.CellAttrs = arr[\"CellAttrs\"];
      } else if (\"Caption\" == elem) {
        ObjTableInfo.Caption = arr[\"Caption\"];
      }
    }
   
    tbContentElement.ExecCommand(DECMD_INSERTTABLE,OLECMDEXECOPT_DODEFAULT, pVar); 
  }
}

function tbContentElement_ShowContextMenu() {
  var menuStrings = new Array();
  var menuStates = new Array();
  var state;
  var i
  var idx = 0;

  // Rebuild the context menu.
  ContextMenu.length = 0;

  // Always show general menu
  for (i=0; i<GeneralContextMenu.length; i++) {
    ContextMenu[idx++] = GeneralContextMenu[i];
  }

  // Is the selection inside a table? Add table menu if so
  if (tbContentElement.QueryStatus(DECMD_INSERTROW) != DECMDF_DISABLED) {
    for (i=0; i<TableContextMenu.length; i++) {
      ContextMenu[idx++] = TableContextMenu[i];
    }
  }

  // Is the selection on an absolutely positioned element? Add z-index commands if so
  if (tbContentElement.QueryStatus(DECMD_LOCK_ELEMENT) != DECMDF_DISABLED) {
    for (i=0; i<AbsPosContextMenu.length; i++) {
      ContextMenu[idx++] = AbsPosContextMenu[i];
    }
  }

  // Set up the actual arrays that get passed to SetContextMenu
  for (i=0; i<ContextMenu.length; i++) {
    menuStrings[i] = ContextMenu[i].string;
    if (menuStrings[i] != MENU_SEPARATOR) {
      state = tbContentElement.QueryStatus(ContextMenu[i].cmdId);
    } else {
      state = DECMDF_ENABLED;
    }
    if (state == DECMDF_DISABLED || state == DECMDF_NOTSUPPORTED) {
      menuStates[i] = OLE_TRISTATE_GRAY;
    } else if (state == DECMDF_ENABLED || state == DECMDF_NINCHED) {
      menuStates[i] = OLE_TRISTATE_UNCHECKED;
    } else { // DECMDF_LATCHED
      menuStates[i] = OLE_TRISTATE_CHECKED;
    }
  }
 
  // Set the context menu
  tbContentElement.SetContextMenu(menuStrings, menuStates);
}

function tbContentElement_ContextMenuAction(itemIndex) {
 
  if (ContextMenu[itemIndex].cmdId == DECMD_INSERTTABLE) {
    InsertTable();
  } else {
    tbContentElement.ExecCommand(ContextMenu[itemIndex].cmdId, OLECMDEXECOPT_DODEFAULT);
  }
}

// DisplayChanged handler. Very time-critical routine; this is called
// every time a character is typed. QueryStatus those toolbar buttons that need
// to be in synch with the current state of the document and update.
function tbContentElement_DisplayChanged() {
//Pau
  var i, s;
  for (i=0; i<QueryStatusToolbarButtons.length; i++) {
    s = tbContentElement.QueryStatus(QueryStatusToolbarButtons[i].command);
    if (s == DECMDF_DISABLED || s == DECMDF_NOTSUPPORTED || bTextMode == true) {
      TBSetState(QueryStatusToolbarButtons[i].element, \"gray\");
    } else if (s == DECMDF_ENABLED  || s == DECMDF_NINCHED) {
      TBSetState(QueryStatusToolbarButtons[i].element, \"unchecked\");
    } else { // DECMDF_LATCHED
      TBSetState(QueryStatusToolbarButtons[i].element, \"checked\");
    }
  }

  s = tbContentElement.QueryStatus(DECMD_GETBLOCKFMT);
  if (s == DECMDF_DISABLED || s == DECMDF_NOTSUPPORTED || bTextMode == true) {
    ParagraphStyle.disabled = true;
  } else {
    ParagraphStyle.disabled = false;
    ParagraphStyle.value = tbContentElement.ExecCommand(DECMD_GETBLOCKFMT, OLECMDEXECOPT_DODEFAULT);
  }
  s = tbContentElement.QueryStatus(DECMD_GETFONTNAME);
  if (s == DECMDF_DISABLED || s == DECMDF_NOTSUPPORTED || bTextMode == true) {
    FontName.disabled = true;
  } else {
    FontName.disabled = false;
    FontName.value = tbContentElement.ExecCommand(DECMD_GETFONTNAME, OLECMDEXECOPT_DODEFAULT);
  }
  if (s == DECMDF_DISABLED || s == DECMDF_NOTSUPPORTED || bTextMode == true) {
    FontSize.disabled = true;
  } else {
    FontSize.disabled = false;
    FontSize.value = tbContentElement.ExecCommand(DECMD_GETFONTSIZE, OLECMDEXECOPT_DODEFAULT);
  }
}

function tbContentElement_DocumentComplete() {
    var retval

    initialDocComplete = true;

    docComplete = true;

    if (!documentHasBeenParsed ) {
        documentHasBeenParsed = true;
       
        allHtml = tbContentElement.DocumentHTML;
       
        if (\"<%=session(\"webedit_stylesheetTag\")%>\".length>0) {
            if (allHtml.search(/<head>/i)==-1) {
                alert(\"På grund af manglende <head> tag er stylesheet ikke indlæst\")
            }else {
                allHtml = allHtml.replace(/<head>/i, \"<head>\" + \"\\n<%=session(\"webedit_stylesheetTag\")%>\");
                tbContentElement.DocumentHTML = allHtml;
            }
        }

        // if we have relative img links replace them with non-relative url\'s
        var searchStr = \"src=\\\"/\";
        allHtml = allHtml.replace(searchStr, \"src=\\\"http://<%=request.servervariables(\"server_name\")%>/\");
        //alert(allHtml);
        tbContentElement.DocumentHTML = allHtml;
       
    }
//  f = new ActiveXObject(\"DEGetBlockFmtNamesParam.DEGetBlockFmtNamesParam\")
//  tbContentElement.ExecCommand(DECMD_GETBLOCKFMTNAMES, OLECMDEXECOPT_DODEFAULT, f);
//  for(fmtName in f.Names) {
//    alert(fmtName)
//  }
//  alert(f.Names)
}

/*
function MENU_FILE_OPEN_onclick() {
  docComplete = false;
  tbContentElement.LoadDocument(\"\", true);
  tbContentElement.focus();
}

function MENU_FILE_SAVE_onclick() {
  if (tbContentElement.IsDirty) {
    if (tbContentElement.CurrentDocumentPath != \"\") {
      var path;
     
      path = tbContentElement.CurrentDocumentPath;
      if (path.substring(0, 7) == \"http://\")
        tbContentElement.SaveDocument(\"\", true);
      else
        tbContentElement.SaveDocument(tbContentElement.CurrentDocumentPath, false);
    } else {
      tbContentElement.SaveDocument(\"\", true);
    }
  } 
  tbContentElement.focus();
}

function MENU_FILE_SAVEAS_onclick() {
  tbContentElement.SaveDocument(\"\", true);
  tbContentElement.focus();
}
*/
function DECMD_VISIBLEBORDERS_onclick() {
    if (! validateMode()) return false;
  tbContentElement.ShowBorders = !tbContentElement.ShowBorders;
  tbContentElement.focus();
}

function DECMD_UNORDERLIST_onclick() {
    if (! validateMode()) return false;
  tbContentElement.ExecCommand(DECMD_UNORDERLIST,OLECMDEXECOPT_DODEFAULT);
  tbContentElement.focus();
}

function DECMD_UNDO_onclick() {
  tbContentElement.ExecCommand(DECMD_UNDO,OLECMDEXECOPT_DODEFAULT);
  tbContentElement.focus();
}

function DECMD_UNDERLINE_onclick() {
    if (! validateMode()) return false;
  tbContentElement.ExecCommand(DECMD_UNDERLINE,OLECMDEXECOPT_DODEFAULT);
  tbContentElement.focus();
}

function DECMD_SNAPTOGRID_onclick() {
    if (! validateMode()) return false;
  tbContentElement.SnapToGrid = !tbContentElement.SnapToGrid;
  tbContentElement.focus();
}

function DECMD_SHOWDETAILS_onclick() {
    if (! validateMode()) return false;
  tbContentElement.ShowDetails = !tbContentElement.ShowDetails;
  tbContentElement.focus();
}

function DECMD_SETFORECOLOR_onclick() {
    if (! validateMode()) return false;
  var arr = showModalDialog( \"selcolor.asp\",
                            \"\",
                            \"font-family:Verdana; font-size:12; dialogWidth:30em; dialogHeight:30em\" );

  if (arr != null) {
    tbContentElement.ExecCommand(DECMD_SETFORECOLOR,OLECMDEXECOPT_DODEFAULT, arr);
  }
}

function DECMD_SETBACKCOLOR_onclick() {
    if (! validateMode()) return false;
  var arr = showModalDialog( \"selcolor.asp\",
                            \"\",
                            \"font-family:MS Sans Serif; font-size:12; dialogWidth:30em; dialogHeight:30em\" );

  if (arr != null) {
    tbContentElement.ExecCommand(DECMD_SETBACKCOLOR,OLECMDEXECOPT_DODEFAULT, arr);
  }
  tbContentElement.focus();
}

function DECMD_SELECTALL_onclick() {
  tbContentElement.ExecCommand(DECMD_SELECTALL,OLECMDEXECOPT_DODEFAULT);
  tbContentElement.focus();
}

function DECMD_REDO_onclick() {
  tbContentElement.ExecCommand(DECMD_REDO,OLECMDEXECOPT_DODEFAULT);
  tbContentElement.focus();
}

function DECMD_PASTE_onclick() {
  tbContentElement.ExecCommand(DECMD_PASTE,OLECMDEXECOPT_DODEFAULT);
  tbContentElement.focus();
}

function DECMD_OUTDENT_onclick() {
    if (! validateMode()) return false;
  tbContentElement.ExecCommand(DECMD_OUTDENT,OLECMDEXECOPT_DODEFAULT);
  tbContentElement.focus();
}

function DECMD_ORDERLIST_onclick() {
    if (! validateMode()) return false;
  tbContentElement.ExecCommand(DECMD_ORDERLIST,OLECMDEXECOPT_DODEFAULT);
  tbContentElement.focus();
}

function DECMD_MAKE_ABSOLUTE_onclick() {
    if (! validateMode()) return false;
  tbContentElement.ExecCommand(DECMD_MAKE_ABSOLUTE,OLECMDEXECOPT_DODEFAULT);
  tbContentElement.focus();
}

function DECMD_LOCK_ELEMENT_onclick() {
    if (! validateMode()) return false;
  tbContentElement.ExecCommand(DECMD_LOCK_ELEMENT,OLECMDEXECOPT_DODEFAULT);
  tbContentElement.focus();
}

function DECMD_JUSTIFYRIGHT_onclick() {
    if (! validateMode()) return false;
  tbContentElement.ExecCommand(DECMD_JUSTIFYRIGHT,OLECMDEXECOPT_DODEFAULT);
  tbContentElement.focus();
}

function DECMD_JUSTIFYLEFT_onclick() {
    if (! validateMode()) return false;
  tbContentElement.ExecCommand(DECMD_JUSTIFYLEFT,OLECMDEXECOPT_DODEFAULT);
  tbContentElement.focus();
}

function DECMD_JUSTIFYCENTER_onclick() {
    if (! validateMode()) return false;
  tbContentElement.ExecCommand(DECMD_JUSTIFYCENTER,OLECMDEXECOPT_DODEFAULT);
  tbContentElement.focus();
}

function DECMD_ITALIC_onclick() {
    if (! validateMode()) return false;
  tbContentElement.ExecCommand(DECMD_ITALIC,OLECMDEXECOPT_DODEFAULT);
  tbContentElement.focus();
}

function DECMD_INDENT_onclick() {
    if (! validateMode()) return false;
  tbContentElement.ExecCommand(DECMD_INDENT,OLECMDEXECOPT_DODEFAULT);
  tbContentElement.focus();
}

var win = null
var args = new Array();

function sendFocus() {
  alert(\"Luk først billedvinduet.\")
  win.focus()
}

function stopFocus() {
  window.onfocus = null
}

function DECMD_IMAGE_onclick() {
    if (! validateMode()) return false;
  tbContentElement.refresh();
  window.onfocus = sendFocus
  win = open(\"inspict.asp?sessionId=<%=sessionId%>\", \"pictWin\", \"width=440; height=210\");
}

function DECMD_IMAGE_onclick2(arr) {
  window.onfocus = null
  win = null
  var str, argStr
  str = \"<%=session(\"webedit_pictURL\")%>\" + \"<%=session(\"webedit_id\")%>\" + \"/\" + arr[\"sourcefilename\"]
  picts[arr[\"sourcefile\"]] = str
  tbContentElement.ExecCommand(DECMD_IMAGE, OLECMDEXECOPT_DONTPROMPTUSER, arr[\"sourcefile\"]);
  str = tbContentElement.DOM.body.innerHTML
  argStr = \"\\\"\"
  argStr += \" alt=\\\"\" + arr[\"alttxt\"] + \"\\\"\"
  argStr += \" align=\\\"\" + arr[\"alignment\"] + \"\\\"\"
  argStr += \" hspace=\\\"\" + arr[\"horSpace\"] + \"\\\"\"
  argStr += \" border=\\\"\" + arr[\"borderhickness\"] + \"\\\"\"
  argStr += \" vspace=\\\"\" + arr[\"verSpace\"] + \"\\\"\"
  str = str.replace(arr[\"sourcefile\"]+\"\\\">\", arr[\"sourcefile\"] + \"\\\"\" + argStr + \">\")
  tbContentElement.DOM.body.innerHTML = str
  tbContentElement.focus();
}

function DECMD_HYPERLINK_onclick() {
    if (! validateMode()) return false;
  tbContentElement.ExecCommand(DECMD_HYPERLINK,OLECMDEXECOPT_PROMPTUSER);
  tbContentElement.focus();
}

function DECMD_ANCHOR_onclick() {
    if (! validateMode()) return false;
  var arr = showModalDialog( \"insanch.asp\",
                            \"\",
                            \"font-family:Verdana; font-size:12; dialogWidth:30em; dialogHeight:10em\" );

  if (arr != null) {
    var aTag,selection;
    aTag=\"<a name=\\\"\" + arr + \"\\\"></a>\";
    selection = tbContentElement.DOM.selection.createRange();
    selection.collapse();
    selection.pasteHTML(aTag);
  }
}


function DECMD_FINDTEXT_onclick() {
  tbContentElement.ExecCommand(DECMD_FINDTEXT,OLECMDEXECOPT_PROMPTUSER);
  tbContentElement.focus();
}

function DECMD_DELETE_onclick() {
  tbContentElement.ExecCommand(DECMD_DELETE,OLECMDEXECOPT_DODEFAULT);
  tbContentElement.focus();
}

function DECMD_CUT_onclick() { 
  tbContentElement.ExecCommand(DECMD_CUT,OLECMDEXECOPT_DODEFAULT);
  tbContentElement.focus();
}

function DECMD_COPY_onclick() {
  tbContentElement.ExecCommand(DECMD_COPY,OLECMDEXECOPT_DODEFAULT);
  tbContentElement.focus();
}

function DECMD_BOLD_onclick() {
    if (! validateMode()) return false;
  tbContentElement.ExecCommand(DECMD_BOLD,OLECMDEXECOPT_DODEFAULT);
  tbContentElement.focus();
}

function OnMenuShow(QueryStatusArray) {
  var i, s;

  for (i=0; i<QueryStatusArray.length; i++) {
    s = tbContentElement.QueryStatus(QueryStatusArray[i].command);
    if (s == DECMDF_DISABLED || s == DECMDF_NOTSUPPORTED) {
      TBSetState(QueryStatusArray[i].element, \"gray\");
    } else if (s == DECMDF_ENABLED  || s == DECMDF_NINCHED) {
      TBSetState(QueryStatusArray[i].element, \"unchecked\");
    } else { // DECMDF_LATCHED
      TBSetState(QueryStatusArray[i].element, \"checked\");
    }
  }
  tbContentElement.focus();
}

function DECMD_PAGEBREAK_onclick() {
    if (! validateMode()) return false;
  var selection;
  selection = tbContentElement.DOM.selection.createRange();
  selection.pasteHTML(\"<DIV class=pagebreak style=\\\"PAGE-BREAK-AFTER: always\\\"><BR></DIV>\");
  tbContentElement.focus();
}


function INTRINSICS_onclick(html) {
  var selection;
 
  selection = tbContentElement.DOM.selection.createRange();
  selection.pasteHTML(html);
  tbContentElement.focus();
}

function TABLE_DELETECELL_onclick() {
    if (! validateMode()) return false;
  tbContentElement.ExecCommand(DECMD_DELETECELLS,OLECMDEXECOPT_DODEFAULT);
  tbContentElement.focus();
}

function TABLE_DELETECOL_onclick() {
    if (! validateMode()) return false;
  tbContentElement.ExecCommand(DECMD_DELETECOLS,OLECMDEXECOPT_DODEFAULT);
  tbContentElement.focus();
}

function TABLE_DELETEROW_onclick() {
    if (! validateMode()) return false;
  tbContentElement.ExecCommand(DECMD_DELETEROWS,OLECMDEXECOPT_DODEFAULT);
  tbContentElement.focus();
}

function TABLE_INSERTCELL_onclick() {
    if (! validateMode()) return false;
  tbContentElement.ExecCommand(DECMD_INSERTCELL,OLECMDEXECOPT_DODEFAULT);
  tbContentElement.focus();
}

function TABLE_INSERTCOL_onclick() {
    if (! validateMode()) return false;
  tbContentElement.ExecCommand(DECMD_INSERTCOL,OLECMDEXECOPT_DODEFAULT);
  tbContentElement.focus();
}

function TABLE_INSERTROW_onclick() {
    if (! validateMode()) return false;
  tbContentElement.ExecCommand(DECMD_INSERTROW,OLECMDEXECOPT_DODEFAULT);
  tbContentElement.focus();
}

function TABLE_INSERTTABLE_onclick() {
    if (! validateMode()) return false;
  InsertTable();
  tbContentElement.focus();
}

function TABLE_MERGECELL_onclick() {
    if (! validateMode()) return false;
  tbContentElement.ExecCommand(DECMD_MERGECELLS,OLECMDEXECOPT_DODEFAULT);
  tbContentElement.focus();
}

function TABLE_SPLITCELL_onclick() {
    if (! validateMode()) return false;
  tbContentElement.ExecCommand(DECMD_SPLITCELL,OLECMDEXECOPT_DODEFAULT);
  tbContentElement.focus();
}

function FORMAT_FONT_onclick() {
    if (! validateMode()) return false;
  tbContentElement.ExecCommand(DECMD_FONT,OLECMDEXECOPT_DODEFAULT);
  tbContentElement.focus();
}

function MENU_FILE_NEW_onclick() {
  if (tbContentElement.IsDirty) {
    if (confirm(\"Save changes?\")) {
      MENU_FILE_SAVE_onclick();
    }
  }
  tbContentElement.NewDocument();
  tbContentElement.focus();
}

function ZORDER_ABOVETEXT_onclick() {
    if (! validateMode()) return false;
  tbContentElement.ExecCommand(DECMD_BRING_ABOVE_TEXT, OLECMDEXECOPT_DODEFAULT);
  tbContentElement.focus();
}

function ZORDER_BELOWTEXT_onclick() {
    if (! validateMode()) return false;
  tbContentElement.ExecCommand(DECMD_SEND_BELOW_TEXT, OLECMDEXECOPT_DODEFAULT);
  tbContentElement.focus();
}

function ZORDER_BRINGFORWARD_onclick() {
    if (! validateMode()) return false;
  tbContentElement.ExecCommand(DECMD_BRING_FORWARD, OLECMDEXECOPT_DODEFAULT);
  tbContentElement.focus();
}

function ZORDER_BRINGFRONT_onclick() {
    if (! validateMode()) return false;
  tbContentElement.ExecCommand(DECMD_BRING_TO_FRONT, OLECMDEXECOPT_DODEFAULT);
  tbContentElement.focus();
}

function ZORDER_SENDBACK_onclick() {
    if (! validateMode()) return false;
  tbContentElement.ExecCommand(DECMD_SEND_TO_BACK, OLECMDEXECOPT_DODEFAULT);
  tbContentElement.focus();
}

function ZORDER_SENDBACKWARD_onclick() {
    if (! validateMode()) return false;
  tbContentElement.ExecCommand(DECMD_SEND_BACKWARD, OLECMDEXECOPT_DODEFAULT);
  tbContentElement.focus();
}

function TOOLBARS_onclick(toolbar) {
    if (! validateMode()) return false;
  if (toolbar.TBSTATE == \"hidden\") {
    TBSetState(toolbar, \"dockedTop\");
  } else {
    TBSetState(toolbar, \"hidden\");
  }
  tbContentElement.focus();
}

function ParagraphStyle_onclick() {   
    if (! validateMode()) return false;
  if(!menuHasBeenChecked) {
    if(setOpt()) {
      var el = document.all.ParagraphStyle
      el.options(0).value = \"Brødtekst\"
      el.options(1).value = \"Overskrift 1 <h1>\"
      el.options(2).value = \"Overskrift 2 <h2>\"
      el.options(3).value = \"Starttekst <h3>\"
      el.options(4).value = \"Forfatter <h4>\"
      el.options(5).value = \"Overskrift 5 <h5>\"
      el.options(6).value = \"Overskrift 6 <h6>\"
    }
    menuHasBeenChecked = true
  }
}

function ParagraphStyle_onchange() {   
    if (! validateMode()) return false;
  tbContentElement.ExecCommand(DECMD_SETBLOCKFMT, OLECMDEXECOPT_DODEFAULT, ParagraphStyle.value);
  tbContentElement.focus();
}

function FontName_onchange() {
    if (! validateMode()) return false;
  tbContentElement.ExecCommand(DECMD_SETFONTNAME, OLECMDEXECOPT_DODEFAULT, FontName.value);
  tbContentElement.focus();
}

function FontSize_onchange() {
    if (! validateMode()) return false;
  tbContentElement.ExecCommand(DECMD_SETFONTSIZE, OLECMDEXECOPT_DODEFAULT, parseInt(FontSize.value));
  tbContentElement.focus();
}

// Check if toolbar is being used when in text mode
function validateMode() {
  if (! bTextMode) return true;
  alert(\"Fjern markeringen fra \\\"Se HTML\\\"-feltet for at bruge denne funktion.\");
  tbContentElement.focus();
  return false;
}
//Switches between text and html mode.
function setMode(newMode) {
  bTextMode = newMode;
  var cont;
  if (bTextMode) {
    cleanHtml();
    cleanHtml();

    cont=tbContentElement.DOM.body.innerHTML;
    tbContentElement.DOM.body.innerText=cont;
  } else {
    cont=tbContentElement.DOM.body.innerText;
    tbContentElement.DOM.body.innerHTML=cont;
  }
 
  tbContentElement.focus();
}
function cleanHtml() {
  var fonts = tbContentElement.DOM.body.all.tags(\"FONT\");
  var curr;
  for (var i = fonts.length - 1; i >= 0; i--) {
    curr = fonts[i];
    if (curr.style.backgroundColor == \"#ffffff\") curr.outerHTML = curr.innerHTML;
  }
}
function getPureHtml() {
  var str = \"\";
  var paras = tbContentElement.DOM.body.all.tags(\"P\");
  if (paras.length > 0) {
    for (var i=paras.length-1; i >= 0; i--) str = paras[i].innerHTML + \"\\n\" + str;
  } else {
    str = tbContentElement.DOM.body.innerHTML;
  }
  return str;
}

//-->
</script>

<script LANGUAGE=\"javascript\" FOR=\"tbContentElement\" EVENT=\"DisplayChanged\">
<!--
return tbContentElement_DisplayChanged()
//-->
</script>

<script LANGUAGE=\"javascript\" FOR=\"tbContentElement\" EVENT=\"DocumentComplete\">
<!--
return tbContentElement_DocumentComplete()
//-->
</script>

<script LANGUAGE=\"javascript\" FOR=\"tbContentElement\" EVENT=\"ShowContextMenu\">
<!--
return tbContentElement_ShowContextMenu()
//-->
</script>

<script LANGUAGE=\"javascript\" FOR=\"tbContentElement\" EVENT=\"ContextMenuAction(itemIndex)\">
<!--
return tbContentElement_ContextMenuAction(itemIndex)
//-->
</script>

</head>
<body LANGUAGE=\"javascript\" onload=\"return window_onload()\">
<!-- Toolbars -->
<div class=\"tbToolbar\" ID=\"FormatToolbar\">
  <select ID=\"ParagraphStyle\" class=\"tbGeneral\" style=\"width:90\" TITLE=\"Paragraph Format\" LANGUAGE=\"javascript\" onclick=\"return ParagraphStyle_onclick()\" onchange=\"return ParagraphStyle_onchange()\">
    <option value=\"Normal\">Brødtekst
    <option value=\"Heading 1\">Overskrift 1
    <option value=\"Heading 2\">Overskrift 2
    <option value=\"Heading 3\">Starttekst
    <option value=\"Heading 4\">Forfatter
    <option value=\"Heading 5\">Overskrift 5
    <option value=\"Heading 6\">Overskrift 6
  </select>
  <select ID=\"FontName\" class=\"tbGeneral\" style=\"width:140\" TITLE=\"Font Name\" LANGUAGE=\"javascript\" onchange=\"return FontName_onchange()\">
    <option value=\"Arial\">Arial
    <option value=\"Arial Narrow\">Arial Narrow
    <option value=\"System\">System
    <option value=\"Times New Roman\">Times New Roman
    <option value=\"Verdana\">Verdana
  </select>
  <select ID=\"FontSize\" class=\"tbGeneral\" style=\"width:40\" TITLE=\"Font Size\" LANGUAGE=\"javascript\" onchange=\"return FontSize_onchange()\">
    <option value=\"1\">1
    <option value=\"2\">2
    <option value=\"3\">3
    <option value=\"4\">4
    <option value=\"5\">5
    <option value=\"6\">6
    <option value=\"7\">7
  </select>
 
  <div class=\"tbSeparator\"></div>

  <div class=\"tbButton\" ID=\"DECMD_BOLD\" TITLE=\"Bold\" TBTYPE=\"toggle\" LANGUAGE=\"javascript\" onclick=\"return DECMD_BOLD_onclick()\">
    <img class=\"tbIcon\" src=\"images/bold.gif\" WIDTH=\"23\" HEIGHT=\"22\" alt=\"Fed\">
  </div>
  <div class=\"tbButton\" ID=\"DECMD_ITALIC\" TITLE=\"Italic\" TBTYPE=\"toggle\" LANGUAGE=\"javascript\" onclick=\"return DECMD_ITALIC_onclick()\">
    <img class=\"tbIcon\" src=\"images/italic.gif\" WIDTH=\"23\" HEIGHT=\"22\" alt=\"Kursiv\">
  </div>
  <div class=\"tbButton\" ID=\"DECMD_UNDERLINE\" TITLE=\"Underline\" TBTYPE=\"toggle\" LANGUAGE=\"javascript\" onclick=\"return DECMD_UNDERLINE_onclick()\">
    <img class=\"tbIcon\" src=\"images/under.gif\" WIDTH=\"23\" HEIGHT=\"22\" alt=\"Understreget\">
  </div>
 
  <div class=\"tbSeparator\"></div>

  <div class=\"tbButton\" ID=\"DECMD_SETFORECOLOR\" TITLE=\"Foreground Color\" LANGUAGE=\"javascript\" onclick=\"return DECMD_SETFORECOLOR_onclick()\">
    <img class=\"tbIcon\" src=\"images/fgcolor.GIF\" WIDTH=\"23\" HEIGHT=\"22\" alt=\"Forgrundsfarve\">
  </div>
  <div class=\"tbButton\" ID=\"DECMD_SETBACKCOLOR\" TITLE=\"Background Color\" LANGUAGE=\"javascript\" onclick=\"return DECMD_SETBACKCOLOR_onclick()\">
    <img class=\"tbIcon\" src=\"images/bgcolor.gif\" WIDTH=\"23\" HEIGHT=\"22\" alt=\"Baggrundsfarve\">
  </div>
 
  <div class=\"tbSeparator\"></div>

  <div class=\"tbButton\" ID=\"DECMD_JUSTIFYLEFT\" TITLE=\"Align Left\" TBTYPE=\"toggle\" NAME=\"Justify\" LANGUAGE=\"javascript\" onclick=\"return DECMD_JUSTIFYLEFT_onclick()\">
    <img class=\"tbIcon\" src=\"images/left.gif\" WIDTH=\"23\" HEIGHT=\"22\" alt=\"Venstrejustér\">
  </div>
  <div class=\"tbButton\" ID=\"DECMD_JUSTIFYCENTER\" TITLE=\"Center\" TBTYPE=\"toggle\" NAME=\"Justify\" LANGUAGE=\"javascript\" onclick=\"return DECMD_JUSTIFYCENTER_onclick()\">
    <img class=\"tbIcon\" src=\"images/center.gif\" WIDTH=\"23\" HEIGHT=\"22\" alt=\"Centrer\">
  </div>
  <div class=\"tbButton\" ID=\"DECMD_JUSTIFYRIGHT\" TITLE=\"Align Right\" TBTYPE=\"toggle\" NAME=\"Justify\" LANGUAGE=\"javascript\" onclick=\"return DECMD_JUSTIFYRIGHT_onclick()\">
    <img class=\"tbIcon\" src=\"images/right.gif\" WIDTH=\"23\" HEIGHT=\"22\" alt=\"Højrejustér\">
  </div>

  <div class=\"tbSeparator\"></div>

  <div class=\"tbButton\" ID=\"DECMD_ORDERLIST\" TITLE=\"Numbered List\" TBTYPE=\"toggle\" LANGUAGE=\"javascript\" onclick=\"return DECMD_ORDERLIST_onclick()\">
    <img class=\"tbIcon\" src=\"images/numlist.gif\" WIDTH=\"23\" HEIGHT=\"22\" alt=\"Opstilling med tal\">
  </div>
  <div class=\"tbButton\" ID=\"DECMD_UNORDERLIST\" TITLE=\"Bulletted List\" TBTYPE=\"toggle\" LANGUAGE=\"javascript\" onclick=\"return DECMD_UNORDERLIST_onclick()\">
    <img class=\"tbIcon\" src=\"images/bullist.gif\" WIDTH=\"23\" HEIGHT=\"22\" alt=\"Opstilling med punkttegn\">
  </div>
 
  <div class=\"tbSeparator\"></div>

  <div class=\"tbButton\" ID=\"DECMD_OUTDENT\" TITLE=\"Decrease Indent\" LANGUAGE=\"javascript\" onclick=\"return DECMD_OUTDENT_onclick()\">
    <img class=\"tbIcon\" src=\"images/deindent.gif\" WIDTH=\"23\" HEIGHT=\"22\" alt=\"Formindsk indrykning\">
  </div>
  <div class=\"tbButton\" ID=\"DECMD_INDENT\" TITLE=\"Increase Indent\" LANGUAGE=\"javascript\" onclick=\"return DECMD_INDENT_onclick()\">
    <img class=\"tbIcon\" src=\"images/inindent.GIF\" WIDTH=\"23\" HEIGHT=\"22\" alt=\"Forøg indrykning\">
  </div>

  <div class=\"tbSeparator\"></div>

  <div class=\"tbButton\" ID=\"DECMD_HYPERLINK\" TITLE=\"Link\" LANGUAGE=\"javascript\" onclick=\"return DECMD_HYPERLINK_onclick()\">
    <img class=\"tbIcon\" src=\"images/link.gif\" WIDTH=\"23\" HEIGHT=\"22\" alt=\"Indsæt hyperlink\">
  </div>
  <!--<div class=\"tbButton\" ID=\"DECMD_ANCHOR\" TITLE=\"iLink\" LANGUAGE=\"javascript\" onclick=\"return DECMD_ANCHOR_onclick()\">    <img class=\"tbIcon\" src=\"images/anker.gif\" WIDTH=\"23\" HEIGHT=\"22\" alt=\"Indsæt anker\">  </div>-->

  <div class=\"tbButton\" ID=\"DECMD_IMAGE\" TITLE=\"Insert Image\" LANGUAGE=\"javascript\" onclick=\"return DECMD_IMAGE_onclick()\">
    <img class=\"tbIcon\" src=\"images/image.gif\" WIDTH=\"23\" HEIGHT=\"22\" alt=\"Indsæt billede\">
  </div>
</div>

<div class=\"tbToolbar\" ID=\"StandardToolbar\">
  <div class=\"tbButton\" ID=\"DECMD_CUT\" TITLE=\"Cut\" LANGUAGE=\"javascript\" onclick=\"return DECMD_CUT_onclick()\">
    <img class=\"tbIcon\" src=\"images/cut.gif\" WIDTH=\"23\" HEIGHT=\"22\" alt=\"Klip\">
  </div>
  <div class=\"tbButton\" ID=\"DECMD_COPY\" TITLE=\"Copy\" LANGUAGE=\"javascript\" onclick=\"return DECMD_COPY_onclick()\">
    <img class=\"tbIcon\" src=\"images/copy.gif\" WIDTH=\"23\" HEIGHT=\"22\" alt=\"Kopier\">
  </div>
  <div class=\"tbButton\" ID=\"DECMD_PASTE\" TITLE=\"Paste\" LANGUAGE=\"javascript\" onclick=\"return DECMD_PASTE_onclick()\">
    <img class=\"tbIcon\" src=\"images/paste.gif\" WIDTH=\"23\" HEIGHT=\"22\" alt=\"Indsæt\">
  </div>

  <div class=\"tbSeparator\"></div>

  <div class=\"tbButton\" ID=\"DECMD_UNDO\" TITLE=\"Undo\" LANGUAGE=\"javascript\" onclick=\"return DECMD_UNDO_onclick()\">
    <img class=\"tbIcon\" src=\"images/undo.gif\" WIDTH=\"23\" HEIGHT=\"22\" alt=\"Annullér\">
  </div>
  <div class=\"tbButton\" ID=\"DECMD_REDO\" TITLE=\"Redo\" LANGUAGE=\"javascript\" onclick=\"return DECMD_REDO_onclick()\">
    <img class=\"tbIcon\" src=\"images/redo.gif\" WIDTH=\"23\" HEIGHT=\"22\" alt=\"Gentag\">
  </div>

  <div class=\"tbSeparator\"></div>

  <div class=\"tbButton\" ID=\"DECMD_FINDTEXT\" TITLE=\"Find\" LANGUAGE=\"javascript\" onclick=\"return DECMD_FINDTEXT_onclick()\">
    <img class=\"tbIcon\" src=\"images/find.gif\" WIDTH=\"23\" HEIGHT=\"22\" alt=\"Søg\">
  </div>
</div>

<div class=\"tbToolbar\" ID=\"AbsolutePositioningToolbar\">
  <div class=\"tbButton\" ID=\"DECMD_VISIBLEBORDERS\" TITLE=\"Visible Borders\" TBTYPE=\"toggle\" LANGUAGE=\"javascript\" onclick=\"return DECMD_VISIBLEBORDERS_onclick()\">
    <img class=\"tbIcon\" src=\"images/borders.gif\" WIDTH=\"23\" HEIGHT=\"22\" alt=\"Synlige kanter\">
  </div>
  <div class=\"tbButton\" ID=\"DECMD_SHOWDETAILS\" TITLE=\"Show Details\" TBTYPE=\"toggle\" LANGUAGE=\"javascript\" onclick=\"return DECMD_SHOWDETAILS_onclick()\">
    <img class=\"tbIcon\" src=\"images/details.gif\" WIDTH=\"23\" HEIGHT=\"22\" alt=\"Vis detaljer\">
  </div>
 
  <div class=\"tbSeparator\"></div>

  <div class=\"tbButton\" ID=\"DECMD_MAKE_ABSOLUTE\" TBTYPE=\"toggle\" LANGUAGE=\"javascript\" TITLE=\"Make Absolute\" onclick=\"return DECMD_MAKE_ABSOLUTE_onclick()\">
    <img class=\"tbIcon\" src=\"images/abspos.gif\" WIDTH=\"23\" HEIGHT=\"22\" alt=\"Fast placering\">
  </div>
  <div class=\"tbButton\" ID=\"DECMD_LOCK_ELEMENT\" TBTYPE=\"toggle\" LANGUAGE=\"javascript\" TITLE=\"Lock\" onclick=\"return DECMD_LOCK_ELEMENT_onclick()\">
    <img class=\"tbIcon\" src=\"images/lock.gif\" WIDTH=\"23\" HEIGHT=\"22\" alt=\"Lås fast\">
  </div>
 
  <div class=\"tbSeparator\"></div>
 
  <div class=\"tbButton\" ID=\"DECMD_SNAPTOGRID\" TITLE=\"Snap to Grid\" TBTYPE=\"toggle\" LANGUAGE=\"javascript\" onclick=\"return DECMD_SNAPTOGRID_onclick()\">
    <img class=\"tbIcon\" src=\"images/snapgrid.gif\" WIDTH=\"23\" HEIGHT=\"22\" alt=\"Tilpas til gitter\">
  </div>
</div>

<div class=\"tbToolbar\" ID=\"TableToolbar\">
  <div class=\"tbButton\" ID=\"DECMD_INSERTTABLE\" TITLE=\"Insert Table\" LANGUAGE=\"javascript\" onclick=\"return TABLE_INSERTTABLE_onclick()\">
    <img class=\"tbIcon\" src=\"images/instable.gif\" WIDTH=\"23\" HEIGHT=\"22\" alt=\"Indsæt tabel\">
  </div>

  <div class=\"tbSeparator\"></div>

  <div class=\"tbButton\" ID=\"DECMD_INSERTROW\" TITLE=\"Insert Row\" LANGUAGE=\"javascript\" onclick=\"return TABLE_INSERTROW_onclick()\">
    <img class=\"tbIcon\" src=\"images/insrow.gif\" WIDTH=\"23\" HEIGHT=\"22\" alt=\"Indsæt række\">
  </div>
  <div class=\"tbButton\" ID=\"DECMD_DELETEROWS\" TITLE=\"Delete Rows\" LANGUAGE=\"javascript\" onclick=\"return TABLE_DELETEROW_onclick()\">
    <img class=\"tbIcon\" src=\"images/delrow.gif\" WIDTH=\"23\" HEIGHT=\"22\" alt=\"Slet række\">
  </div>

  <div class=\"tbSeparator\"></div>

  <div class=\"tbButton\" ID=\"DECMD_INSERTCOL\" TITLE=\"Insert Column\" LANGUAGE=\"javascript\" onclick=\"return TABLE_INSERTCOL_onclick()\">
    <img class=\"tbIcon\" src=\"images/inscol.gif\" WIDTH=\"23\" HEIGHT=\"22\" alt=\"Indsæt kolonne\">
  </div>
  <div class=\"tbButton\" ID=\"DECMD_DELETECOLS\" TITLE=\"Delete Columns\" LANGUAGE=\"javascript\" onclick=\"return TABLE_DELETECOL_onclick()\">
    <img class=\"tbIcon\" src=\"images/delcol.gif\" WIDTH=\"23\" HEIGHT=\"22\" alt=\"Slet kolonne\">
  </div>
 
  <div class=\"tbSeparator\"></div>

  <div class=\"tbButton\" ID=\"DECMD_INSERTCELL\" TITLE=\"Insert Cell\" LANGUAGE=\"javascript\" onclick=\"return TABLE_INSERTCELL_onclick()\">
    <img class=\"tbIcon\" src=\"images/inscell.gif\" WIDTH=\"23\" HEIGHT=\"22\" alt=\"Indsæt felt\">
  </div>
  <div class=\"tbButton\" ID=\"DECMD_DELETECELLS\" TITLE=\"Delete Cells\" LANGUAGE=\"javascript\" onclick=\"return TABLE_DELETECELL_onclick()\">
    <img class=\"tbIcon\" src=\"images/delcell.gif\" WIDTH=\"23\" HEIGHT=\"22\" alt=\"Slet felt\">
  </div>
  <div class=\"tbButton\" ID=\"DECMD_MERGECELLS\" TITLE=\"Merge Cells\" LANGUAGE=\"javascript\" onclick=\"return TABLE_MERGECELL_onclick()\">
    <img class=\"tbIcon\" src=\"images/mrgcell.gif\" WIDTH=\"23\" HEIGHT=\"22\" alt=\"Slå felter sammen\">
  </div>
  <div class=\"tbButton\" ID=\"DECMD_SPLITCELL\" TITLE=\"Split Cells\" LANGUAGE=\"javascript\" onclick=\"return TABLE_SPLITCELL_onclick()\">
    <img class=\"tbIcon\" src=\"images/spltcell.gif\" WIDTH=\"23\" HEIGHT=\"22\" alt=\"Opdel felt\">
  </div>
  <div class=\"tbSeparator\"></div>
  <div class=\"tbButton\" ID=\"DECMD_PAGEBREAK\" TITLE=\"Insert Pagebreak\" LANGUAGE=\"javascript\" onclick=\"return DECMD_PAGEBREAK_onclick()\">
    <img class=\"tbIcon\" src=\"images/newdoc.gif\" WIDTH=\"23\" HEIGHT=\"22\" alt=\"Sideskift\">
  </div>
    <div class=\"tbSeparator\"></div>
  <div ID=\"DECMD_EDIT\" class=\"tbGeneral\" style=\"width:85\" TITLE=\"Editing Mode\">
    <input type=\"checkbox\" name=\"switchMode\" LANGUAGE=\"javascript\" onclick=\"setMode(switchMode.checked)\"><font face=\"verdana,\" arial size=\"1\">Se HTML</font>
  </div>

</div>

<!-- DHTML Editing control Object. This will be the body object for the toolbars. -->
<object ID=\"tbContentElement\" CLASS=\"tbContentElement\" CLASSID=\"clsid:2D360201-FFF5-11D1-8D03-00A0C959BC0A\" codebase=\"<%=cBase%>\" style=\"zIndex=-1\" VIEWASTEXT>
    <param name=\"Scrollbars\" value=\"true\">
</object>

<!-- DEInsertTableParam Object -->
<object ID=\"ObjTableInfo\" CLASSID=\"clsid:47B0DFC7-B7A3-11D1-ADC5-006008A5848C\" codebase=\"<%=cBase%>\" VIEWASTEXT>
</object>

<!-- DEGetBlockFmtNamesParam Object -->
<object ID=\"ObjBlockFormatInfo\" CLASSID=\"clsid:8D91090E-B955-11D1-ADC5-006008A5848C\" codebase=\"<%=cBase%>\" VIEWASTEXT>
</object>

<!-- Toolbar Code File. Note: This must always be the last thing on the page -->
<script LANGUAGE=\"Javascript\" SRC=\"Toolbars/toolbars.js\">
</script>
</body>
</html>
Avatar billede olebole Juniormester
26. februar 2001 - 15:26 #1
<ole>
Lav en funktion, der kan sætte teksten ind. Lad så din asp skrive din tekst i stedet for \"noget\" i eksemplet nedenfor. Så kan du fyre funktionen af på onload.

function paste() {
  frames.myEditor.focus();
  var tr = frames.myEditor.document.selection.createRange();
  tr.text = \"noget\";
}

/mvh
</bole>
Avatar billede kasseper Nybegynder
26. februar 2001 - 15:29 #2
Kan du ikke lave denne :

<input type=\"text\" value= <%= \"\'\" & minvariabel & \"\'\" %> name=\"myField\">

Eller har jeg helt misforstået noget..?
Avatar billede olebole Juniormester
26. februar 2001 - 15:39 #3
kasseper >> Ja, du kan ikke skrive noget direkte i feltet. Det skal sættes dynamisk ind - med scripting.
/mvh
Avatar billede olebole Juniormester
26. februar 2001 - 16:14 #4
Du kan også, hvis du bruger en <iframe> til editor-felt skrive en src-fil, der indeholder den tekst, du gerne vil editere i.
/mvh
Avatar billede talk Nybegynder
26. februar 2001 - 16:41 #5
olebole>Dit eksempel virker ikke rigtigt. Kan du ikke lave det konkret?

<iframe> metoden bruger jeg. Således:

<iframe height=\"400\" width=\"700\" name=\"editor\" src=\"edit.asp\">
  </iframe>
Avatar billede talk Nybegynder
26. februar 2001 - 16:41 #6
Vil du have sendt de relevante filer?
Avatar billede olebole Juniormester
26. februar 2001 - 17:08 #7
Prøv denne igen:

function paste() {
  frames.myEditor.focus();
  var tr = frames.editor.document.selection.createRange();
  tr.text = \"noget\";
}

...og kald så med:
    <body onload=\"return window_onload();paste();\">
Det burde skrive \"noget\" i dit editor-felt. Du vil naturligvis ikke skrive \"noget\", men lav din tekst til en streng, som du sætter tr.text lig med, så skulle det funke. Prøv dog med \"noget\" først.

Jeg har ændret i paste(), så navnet på <iframe>\'en nu passer med din egen <iframe> :)
/mvh
Avatar billede olebole Juniormester
26. februar 2001 - 17:11 #8
Min præst, psykiater, mullah, guru, spejderfører, løjtnant og mor har alle forbudt mig at rode med ASP af hensyn til mit mentale helbred og frelse efter døden, så det må være nok, jeg sidder og ser på skærmen iført svejsebriller! Jeg tør slet ikke komme i nærheden af selve filerne =8-O
/mvh
Avatar billede olebole Juniormester
26. februar 2001 - 17:13 #9
FEJL........

function paste() {
  frames.editor.focus();
  var tr = frames.editor.document.selection.createRange();
  tr.text = \"noget\";
}

...Sådan :)
Avatar billede talk Nybegynder
26. februar 2001 - 17:17 #10
Desværre uden resultat. Vil du have filerne så du selv kan rode med det?
Avatar billede olebole Juniormester
26. februar 2001 - 17:27 #11
Kan du ikke lige ringe on 5 minutter på: 39 16 29 55?
/mvh
Avatar billede talk Nybegynder
26. februar 2001 - 18:38 #12
Jeg har ingen telefon. Hvorfor?
Avatar billede olebole Juniormester
26. februar 2001 - 18:54 #13
ICQ #83576206
Så er det lidt lettere at snakke om det :)
Avatar billede talk Nybegynder
26. februar 2001 - 18:56 #14
Jeg installerer lige icq øjeblik ;-)
Avatar billede talk Nybegynder
26. februar 2001 - 19:05 #15
Så er jeg klar.
Avatar billede talk Nybegynder
26. februar 2001 - 19:24 #16
<%@ Language=VBScript %>
<%
\'Bruges når tekst skal html-encodes
function htmlenc(str)
    dim htmlstr
   
    if str<>\"\" then
        htmlstr = server.HTMLEncode(str)
    else
        htmlstr = \"\"
    end if
   
    htmlenc = htmlstr
end function

if Request.QueryString(\"edit\") <> \"\" then
doc_text = \"Kim\"
else
    \'OPRET ny artikel
    page_titel = \"Opret artikel\"
    page_intro = \"Her kan du oprette en artikel og tilknytte den et antal emneord, der vil blive brugt til at identificere artiklen ved søgninger.<br>\" & _
        \"<br>\" & _
        \"Du kan yderligere tilknytte en begivenhedsdato, der vil blive prioriteret over oprettelsesdatoen i en søgning.<br>\" & _
        \"<br>\" & _
        \"Lige over \"\"Opret\"\"-knappen kan du vælge om artiken skal vises som nyhed på hjemmesiden.<br>\" & _
        \"<br>\"
    doc_public = \"checked\"
end if

%>

<html>
<head>
<title></title>
<script language=\"javascript\">
<!--
chunksize = 100000
function chopTag(tag, theForm, spanName) {
    var theText, theName, i
    theText = tag.value
    if (theText.length > chunksize) {
        theName = tag.name
        tag.value = theText.substring(0, chunksize)
        theText = theText.substring(chunksize, theText.length)
        i = 1
        while(theText.length>0) {
            spanName.innerHTML = spanName.innerHTML + \'<input type=\"hidden\" name=\"\' + theName + \'\">\'
            if(theText.length>chunksize) {
                theForm(theName)[i].value = theText.substring(0, chunksize)
                theText = theText.substring(chunksize, theText.length)
            }else {
                theForm(theName)[i].value = theText.substring(0, theText.length)
                theText = \"\"
            }
            i += 1
        }
    }
}

function checkform(){
   
    strConfirm = true
   
    //Hvis HTML er slået til, skal den slåes fra
    if (document.dhtml_editor.switchMode.checked == true) {
        document.dhtml_editor.switchMode.click();
    }
       
    //Gemmer den aktive tekst fra DHTML-editoren
    saveactivetext(document.artikel.text_in_editor.value);
   
    //Tjekker titel
    if (document.artikel.doc_subject.value == \"\"){
        alert(\"Titlen skal udfyldes!\");
        document.artikel.doc_subject.focus();
        return false;
    }
   
    //Tjekker kategori
    if (document.artikel.cat_guid.value == \"0;Ingen\" && strConfirm == true){
        alert(\"Der skal vælges en kategori!\");
        return false;
    }
   
    //Tjekker artikeltekst
    if (document.artikel.doc_text.value == \"\"){
        alert(\"Artikelteksten skal udfyldes!\");
        if (document.artikel.text_in_editor.value == \"doc_text\"){
            document.dhtml_editor.tbContentElement.focus();
        }
        else {
            document.artikel.text_in_editor.value = \"doc_text\";
            changetext(\"doc_text\");
            document.dhtml_editor.tbContentElement.focus();
        }
        return false;
    }
   

    if (strConfirm == true && document.artikel.disableBox3.checked == false){
        document.artikel.doc_day2.value = document.artikel.doc_day.value;
        document.artikel.doc_month2.value = document.artikel.doc_month.value;
        document.artikel.doc_year2.value = document.artikel.doc_year.value;

        document.artikel.doc_day2.disabled = false;
        document.artikel.doc_month2.disabled = false;
        document.artikel.doc_year2.disabled = false;
    }

   
    //Sætter Artikel elementet til \"Artikel\", så den står rigtigt, hvis tilbage knappen på article.create.verify.asp bruges
    document.artikel.text_in_editor.selectedIndex = 0;
   
    //Opdeler lange tekster
    chopTag(document.artikel.doc_text,artikel,hiddenFields);
    chopTag(document.artikel.doc_short_text,artikel,hiddenFields);

    /* revisionsdato skal overføres lige meget om den er enablet */
    document.artikel.doc_day_rev.disabled = false;
    document.artikel.doc_month_rev.disabled = false;
    document.artikel.doc_year_rev.disabled = false;
   
    return true
}

function disableRev(){
    if (document.artikel.disableBox2.checked == false){
        document.artikel.doc_day_rev.disabled = true;
        document.artikel.doc_month_rev.disabled = true;
        document.artikel.doc_year_rev.disabled = true;
        document.all.strRev.style.color = \'gray\';
    }
    else {
        document.artikel.doc_day_rev.value == 1
        document.artikel.doc_day_rev.disabled = false;
        document.artikel.doc_month_rev.disabled = false;
        document.artikel.doc_year_rev.disabled = false;
        document.all.strRev.style.color = \'black\';
    }
}

function disableDate2(){
    if (document.artikel.disableBox3.checked == false){
        document.artikel.doc_day2.disabled = true;
        document.artikel.doc_month2.disabled = true;
        document.artikel.doc_year2.disabled = true;
        document.all.strNews.style.color = \'gray\';
        resetdoc_date2();
    }
    else {
        document.artikel.doc_day_rev.value == 1
        document.artikel.doc_day2.disabled = false;
        document.artikel.doc_month2.disabled = false;
        document.artikel.doc_year2.disabled = false;
        document.all.strNews.style.color = \'black\';
    }
}

function resetdoc_date2(){
    if (document.artikel.disableBox3.checked == false){
        document.artikel.doc_day2.value = document.artikel.doc_day.value;
        document.artikel.doc_month2.value = document.artikel.doc_month.value;
        document.artikel.doc_year2.value = document.artikel.doc_year.value;
    }
}

function changetext(optVal) {
    switch (optVal) {
        case \"doc_short_text\":
            saveactivetext(\"doc_text\");
            break;
        case \"doc_text\":
            saveactivetext(\"doc_short_text\");
            break;
        default:
            alert(\"changetext: intern fejl!!!!\");
    }
    setactivetext(optVal);    // skift tekst
}

function saveactivetext(activetext) {
    switch (activetext) {
        case \"doc_text\":
            artikel.doc_text.value = document.dhtml_editor.getText();
            break;
        case \"doc_short_text\":
            artikel.doc_short_text.value = document.dhtml_editor.getText();
            break;
        default:
            alert(\"changetext: intern fejl!!!!\");
    }
}

function setactivetext(optVal) {
    switch (optVal) {
        case \"doc_short_text\":
            document.dhtml_editor.tbContentElement.DOM.body.innerHTML = artikel.doc_short_text.value;
            break;
        case \"doc_text\":
            document.dhtml_editor.tbContentElement.DOM.body.innerHTML = artikel.doc_text.value;
            break;
        default:
            alert(\"changetext: intern fejl!!!!\");
    }
    document.dhtml_editor.tbContentElement.focus();
}

function ghost() {

        //Disabler kategorivalg
        document.artikel.cat_guid.disabled = true;
       
        //Disabler datovalg
        document.artikel.doc_day.disabled = true;
        document.artikel.doc_month.disabled = true;
        document.artikel.doc_year.disabled = true;
       
        document.artikel.disableBox2.disabled = true;
        document.artikel.doc_day_rev.disabled = true;
        document.artikel.doc_month_rev.disabled = true;
        document.artikel.doc_year_rev.disabled = true;
       
        document.artikel.disableBox3.disabled = true;
        document.artikel.doc_day2.disabled = true;
        document.artikel.doc_month2.disabled = true;
        document.artikel.doc_year2.disabled = true;
               
}

//-->
</script>
</head>
<body onLoad=\"disableRev();disableDate2();document.artikel.doc_subject.focus();<%if masterStatus <> 0 then%> ghost();<%end if%\">
<form name=\"artikel\" method=\"post\" action=\"kim.asp\" onSubmit=\"return checkform();\">
<table cellspacing=\"0\" cellpadding=\"0\" border=\"0\">
<tr>
  <td class=\"linie1\" width=\"100%\" valign=top>
  <iframe height=\"400\" width=\"700\" name=\"dhtml_editor\" src=\"dhtml_editor/editor.asp?inputUrl=text.asp\">
  </iframe>
  </td>                                           
</tr>
<tr>
  <td valign=top>
  <input type=\"submit\" class=\"button\" OnClick=\"document.artikel.doc_keyword.value = document.doc_keyword_get.form.static_keyword.value\" value=\"Opret\">
  </td>
</tr>
</table>
<span id=\"hiddenFields\">
    <input type=hidden name=\"text_in_editor\" onChange=\"changetext(value)\" value=\"doc_text\">
    <input type=\"hidden\" name=\"doc_text\" value=\"<%=htmlenc(doc_text)%>\">
</span>
<%if masterStatus <> 0 then%>
    <input type=\"hidden\" name=\"cat_guid\" value=\"<%=mother & \";\" & cat_title_dict(mother)%>\">
<%end if%>
<input type=\"hidden\" name=\"doc_keyword\">
<input type=\"hidden\" name=\"masterStatus\" value=\"<%=masterStatus%>\">
<input type=\"hidden\" name=\"db_table\" value=\"<%=db_table%>\">
<input type=\"hidden\" name=\"verify\" value=\"<%=verify%>\">
<%if doc_verified=empty then
    doc_verified=false
end if%>
<input type=\"hidden\" name=\"doc_verified\" value=\"<%=doc_verified%>\">       
</form>
</body>
</html>
Avatar billede jakoba Nybegynder
27. februar 2001 - 07:49 #17
Hvad med:
<input type=\'text\' name=\"tekstfelt0\">

<script language=\'javascript\'>
document.forms.artikel.tekstfelt0.value = <%= \"\'\" & minvariabel & \"\'\" %>
</script>

Det skulle også virke på felter med type=\"hidden\".

Det er muligt at scriptstumpen først må stå i filen efter </form>, ikke sikker.

mvh JakobA
Avatar billede talk Nybegynder
27. februar 2001 - 09:16 #18
jacoba>Det virker ikke. Du indsætter blot et input felt med en værdi. Jeg vil have værdien placeret i editoren i mit <iframe>
Avatar billede talk Nybegynder
27. februar 2001 - 09:19 #19
Avatar billede talk Nybegynder
27. februar 2001 - 09:43 #20
olebole>>Har du fået set på det?
Avatar billede talk Nybegynder
27. februar 2001 - 10:07 #21
jacoba>>Vil du have filerne tilsendt? Jeg har lidt problemer med den webserver jeg skrev før.
Avatar billede olebole Juniormester
27. februar 2001 - 10:11 #22
Nej, jeg ventede det meste af en time på dig igår - på arbejdet(!) - og gik hjem.
Siden ligger der åbenbart ikke nu, så deeeeeeet..........
Avatar billede talk Nybegynder
27. februar 2001 - 10:17 #23
Vil du have filerne tilsendt nu. Eller kan du heller ikke teste på jobbet?
Avatar billede talk Nybegynder
27. februar 2001 - 10:20 #24
Avatar billede talk Nybegynder
27. februar 2001 - 12:29 #25
Tænker i eller har i opgivet. Har i set editoren?
Avatar billede talk Nybegynder
27. februar 2001 - 14:51 #26
Har det ikke noget med dette stykke kode at gøre?

  if (\"<%=session(\"webedit_inputURL\")%>\"!=\"\") {
        documentHasBeenParsed = false
    tbContentElement.LoadURL(\"<%=session(\"webedit_inputURL\")%>\")
  }else {
        if (\"<%=request(\"inputURL\")%>\"!=\"\") {
            documentHasBeenParsed = false
            tbContentElement.LoadURL(\"<%=request(\"inputURL\")%>\")
        }
  }
   
}
Avatar billede talk Nybegynder
27. februar 2001 - 14:51 #27
Det er fra editoren
Avatar billede slash Nybegynder
01. marts 2001 - 20:35 #28
bare lige til orientering, så virker denne smarte DHTML komponent ikke i Internet Explorer 5.5! Tro mig.... har set et komplet editeringssytem integeret med databaser etc. som er ubrugeligt når man anvender IE 5.5

Hvorfor anvender du ikke bare XML og XSL istedet?
Avatar billede slash Nybegynder
01. marts 2001 - 20:41 #29
det kinkie ved at anvende XML, er for det første at man kan smide ren data ned i en db/fil, dvs. uden nogen som helst form for formattering af nogen art.... man kan dernæst trække det ud på sin givne side og anvende XSL til at formattere det!

Alt andet lige er dette mere skalerbart end at bruge DHTML komponenten, og bare det fakta at man har ren data gør at man i sidste ende \"tjener\" tid, hvis man beslutter sig for at droppe anvendelse af komponenten - data ligger rent i db og indeholde ej en masse html-tags!

Ovenstående er naturligvis skrevet udfra den antagelse at du smider html-tags og data samlet ned i db\'en ;-)
Avatar billede olebole Juniormester
01. marts 2001 - 21:35 #30
Så skal du prøve at installere IE5.5 på en PC, der virker den - men det er rigtigt, den ikke kører på Commodore 64 :)))
Tro mig - jeg har set et halvt dusin af slagsen...de virker alle i IE5.5. Jeg har selv lavet noget, der fungerer upåklageligt! At du har set et, der ikke fungerer, må bero på, det er dårligt - eller ligefrem forkert - kodet.
Den virker fint med ASP og PHP - både med alm SQL og mySQL. Men det er da rigtigt, det er en fordel ikke at spilde plads på HTML-tags i DB\'en.
/mvh
Avatar billede olebole Juniormester
03. marts 2001 - 02:00 #31
talk >> Hvad med denne her:

str = \"noget <b>fed</b> tekst\";
tbContentElement.DOM.body.innerHTML = str;
tbContentElement.focus();

/mvh
Avatar billede olebole Juniormester
03. marts 2001 - 02:05 #32
Skal selvfølgelig skrives i \'editor.asp\'. Værdien af \'str\' skriver du så ud med ASP fra et database-udtræk.
Avatar billede olebole Juniormester
03. marts 2001 - 03:04 #33
Måske, du også skulle prøve at lægge dit databaseudtræk i \'text.asp\' og så se, om ikke den bliver loaded

Eller lave denne funktion (husk at slette den \'paste()\', du allerede har liggende):

function paste() {
  str = \"noget <b>fed</b> tekst\";
  INTRINSICS_onclick(str);
}

...og så fyre den af sådan - i slutningen af din \'function window_onload()\':

  //Pau
  if (\"\"!=\"\") {
        documentHasBeenParsed = false
    tbContentElement.LoadURL(\"\")
  }else {
        if (\"text.asp\"!=\"\") {
            documentHasBeenParsed = false
            tbContentElement.LoadURL(\"text.asp\")
        }
  }
  paste(); 
}
Avatar billede olebole Juniormester
03. marts 2001 - 03:16 #34
Nu burde du kunne få noget til at fungere :)
/mvh
Avatar billede talk Nybegynder
05. marts 2001 - 09:39 #35
Hvordan går del Ole. Er der et script på vej ;-)
Avatar billede talk Nybegynder
06. marts 2001 - 14:54 #36
Jeg har nu prøvet dine forslag Ole, uden fejlmeddelelser, men editoren er stadig tom...
13. marts 2001 - 23:00 #37
Talk>> Den er gal med din sti ref. text.asp findes jo ikke

Hvis du fodere editoren med en side der findes, ja, så:
http://www.ludo98.dk/intrasuite_dk2/backend/dhtml_editor/editor.asp?inputUrl=http://www.ludo98.dk/

Er jeg hel gal på den her?? LOL
Avatar billede olebole Juniormester
14. marts 2001 - 10:14 #38
Jeg har nævnt det for talk flere gange, men han har ikke skrevet en linie af det selv - og forstår ikke, hvad der sker, så det er en tuuuung omgang. Jeg har ikke haft tid til at hjælpe videre under de forhold :)
/mvh
Avatar billede brock Nybegynder
10. april 2001 - 15:04 #39


hej talk du siger, at din iframe hedder

<iframe height=\"400\" width=\"700\" name=\"editor\" src=\"edit.asp\"></iframe>

lige efter den indsætter du:

<div id=\"intext\" STYLE=\"display: none\">her skal den tekst står du gerne vil have</div>


i javascriptet sætter du denne kald ind

Function loadtext();{
editor.document.designMode=\"On\"
editor.document.open()
editor.document.write(\"\")
editor.document.close()
editor.document.write (document.all.intext.innerHTML)
editor.focus()
editor.document.designMode=\"On\"}

og kalder den bagefter med

loadtext();

håber det virker
Avatar billede brock Nybegynder
10. april 2001 - 15:49 #40
det gør det hos mig ;)
Avatar billede olebole Juniormester
15. april 2001 - 02:32 #41
Hvorfor gå over åen efter vand? Han skal bare sørge for \'text.asp\' eksisterer :)
Avatar billede olebole Juniormester
15. april 2001 - 20:12 #42
Iøvrigt har han jo fået det til at virke ved at sørge for, der var noget at loade ind - som jeg nævnte for ham den 3/3-2001...både her og på ICQ. Der fortalte jeg ham, det var fordi, han ikke havde noget \'text.asp\'.
Han har så senere prøvet at loade ludo98.dk ind som def foreslog den 13/3-2001 - og det fungerer selvfølgelig, ligesom \'text.asp\' ville have gjort. \'text.asp\' var blot det dokument, der stod i hans kode, han ville bruge. Se evt. hans link...det virker fint:
  http://www.ludo98.dk/intrasuite_dk2/backend/article.create.asp

Men én ting er at få hjælp til at få skidtet til at virke - en hel anden ting er åbenbart at slippe nogle points og en tak for, man har gidet og bruge timer på ham :(
/mvh
Avatar billede brock Nybegynder
16. april 2001 - 12:33 #43
Okidoki - der er selvsagt ikke megen fidus i at gå over åen for at hente vand - det kan jeg selvfølgelig kun give dig ret i. Jeg havde bare ikke forstået, at talk havde fået \"skidtet\" til at virke, så jeg tog den simple måde, hvis han ønskede at pille scriptet fra hinanden...

At han ikke hoster op med pointene, når der er blevet brugt så megen tid på at løse hans problem må vel være en misforståelse eller forglemmelse fra talks side.

(kan du så tage dig sammen - talk !!!)

;)
mvh
brock
Avatar billede olebole Juniormester
16. april 2001 - 17:21 #44
;)
Avatar billede talk Nybegynder
18. april 2001 - 13:35 #45
Def gjorde det forståligt. Derfor bliver fordelingen således.

Tusind tak for hjælpen.
Avatar billede talk Nybegynder
18. april 2001 - 13:37 #46
Beklager forsinkelsen
18. april 2001 - 13:37 #47
Jeg sagde det jo ;-))
Avatar billede Ny bruger Nybegynder

Din løsning...

Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.

Loading billede Opret Preview
Kategori
Vi tilbyder markedets bedste kurser inden for webudvikling

Log ind eller opret profil

Hov!

For at kunne deltage på Computerworld Eksperten skal du være logget ind.

Det er heldigvis nemt at oprette en bruger: Det tager to minutter og du kan vælge at bruge enten e-mail, Facebook eller Google som login.

Du kan også logge ind via nedenstående tjenester