home *** CD-ROM | disk | FTP | other *** search
/ PC World 2001 August / PCWorld_2001-08_cd.bin / Komunikace / sambar / _setup.1 / iecreate.stm < prev    next >
Text File  |  2000-10-17  |  8KB  |  271 lines

  1. <HTML>
  2. <HEAD><TITLE>Sambar Server Document Manager</TITLE>
  3. <STYLE>
  4.     SELECT {
  5.         font:8pt verdana,arial,sans-serif;background:#EEEEFF
  6.     }
  7.     INPUT {
  8.         font:8pt verdana,arial,sans-serif;background:lightgrey
  9.     }
  10.     .toolbar {
  11.         margin-bottom:3pt;height:28;overflow:hidden;background:lightgrey;border:1px black solid
  12.     }
  13.     .mode LABEL {
  14.         font:bold 10pt verdana,geneva,arial,sans-serif
  15.     }
  16.     .mode .current {
  17.         color:darkgreen
  18.     }
  19.     .heading {
  20.         color:navy;background:lightgrey
  21.     }
  22. </STYLE>
  23.  
  24. <script language="JavaScript">
  25.  
  26.     function makeWindow(url) 
  27.     {
  28.         agent = navigator.userAgent;
  29.         windowName = "Help";
  30.         params  = "toolbar=0,location=0,directories=0,status=0,";
  31.         params += "menubar=0,scrollbars=1,resizable=1,width=675,";
  32.         params += "height=400";
  33.         win = window.open(url, windowName , params);
  34.         if (agent.indexOf("Mozilla/2") != -1 && 
  35.             agent.indexOf("Win") == -1) 
  36.         {
  37.             win = window.open(url, windowName , params);
  38.         }
  39.  
  40.         if (!win.opener) 
  41.             win.opener = window;
  42.     }
  43.  
  44.     function insertCode(what) 
  45.     {
  46.         var sel = ieCreate.document.selection;
  47.         if (what == "Line")
  48.         {
  49.             what = "<HR>";
  50.         }
  51.         else if (what == "Return")
  52.         {
  53.             what = "<BR>";
  54.         }
  55.         else
  56.         {
  57.             opt = prompt("Enter the image source.", "");
  58.             what = "<IMG SRC=\"" + opt + "\">";
  59.         }
  60.  
  61.         if (sel != null) 
  62.         {
  63.             var rng = sel.createRange();
  64.             if (rng != null)
  65.             {
  66.                 rng.pasteHTML(what);
  67.                 document.forms[0].save.disabled=false;
  68.             }
  69.         }
  70.     }
  71.                     
  72.     function formatCode(cmd, opt) 
  73.     {
  74.         if (opt == 'removeFormat') 
  75.         {
  76.             cmd = opt;
  77.             opt = null;
  78.         }
  79.  
  80.         if (opt=="CustomFont")
  81.             opt = prompt("Enter the font face:", "Geneva, Arial");
  82.  
  83.         if ((opt=="") && (cmd=="forecolor"))
  84.             opt = prompt("Color to format text?", "Black");
  85.  
  86.         if (opt == null)
  87.             ieCreate.document.execCommand(cmd);
  88.         else
  89.             ieCreate.document.execCommand(cmd,'',opt);
  90.  
  91.         document.forms[0].save.disabled=false;
  92.         ieCreate.focus();
  93.     }
  94.  
  95.     function createLink() 
  96.     {
  97.         var str = prompt("Where do you wish to link to?", 
  98.                 "http:\/\/www.sambar.com");
  99.  
  100.         if ((str != null) && (str != "http://")) 
  101.         {
  102.             if (ieCreate.document.selection.type=="None")
  103.             {
  104.                 var sel=ieCreate.document.selection.createRange();
  105.                 sel.pasteHTML("<A HREF=\"" + str +
  106.                     "\">" + str + "</A> ");
  107.                 sel.select();
  108.                 document.forms[0].save.disabled=false;
  109.             }
  110.             else
  111.             {
  112.                      formatCode("CreateLink",str);
  113.             }
  114.         }
  115.         else
  116.         {
  117.                ieCreate.focus();
  118.         }
  119.     }
  120.                     
  121.  
  122. </script>
  123. </HEAD>
  124.  
  125. <BODY ONLOAD="ieCreate.document.designMode='On';" STYLE="CURSOR: default; MARGIN:0pt; PADDING:2pt">
  126. <center><FONT SIZE=6>Sambar Server Document Manager</FONT>
  127. <P>
  128. <TABLE border=0 cellspacing=8>
  129. <TR><TD>
  130. <br>
  131. <B><FONT SIZE=+2 COLOR=#000088>IE New File</FONT></B><BR>
  132. <BR>
  133. <TABLE WIDTH="100%" CELLPADDING=0 CELLSPACING=0>
  134. <TR>
  135. <TD>
  136. <TABLE border=0 cellpadding=0 cellspacing=4>
  137. <TR><TD><B>Directory</B></TD><TD><FONT SIZE=+1><I><RC$path></I></FONT></TD></TR>
  138. </TABLE>
  139. </TD>
  140. </TR>
  141. <TR>
  142. <TD NOWRAP>
  143. <TABLE ID=tb1 class=toolbar CELLSPACING=2 CELLPADDING=0 STYLE="padding-top: 1pt;margin-bottom: 2pt">
  144. <TR><TD VALIGN="MIDDLE" NOWRAP>
  145.  
  146.     <SELECT ONCHANGE="insertCode(this[this.selectedIndex].text);this.selectedIndex=0">
  147.     <OPTION CLASS=heading>Insert
  148.     <OPTION>Line
  149.     <OPTION>Return
  150.     <OPTION>Image
  151.     </SELECT>
  152.  
  153.     <SELECT ONCHANGE="formatCode('formatBlock',this[this.selectedIndex].value);this.selectedIndex=0">
  154.     <OPTION CLASS=heading SELECTED>Paragraph
  155.     <OPTION VALUE="<P>">Normal <P>
  156.     <OPTION VALUE="<H1>">Heading 1 <H1>
  157.     <OPTION VALUE="<H2>">Heading 2 <H2>
  158.     <OPTION VALUE="<H3>">Heading 3 <H3>
  159.     <OPTION VALUE="<H4>">Heading 4 <H4>
  160.     <OPTION VALUE="<H5>">Heading 5 <H5>
  161.     <OPTION VALUE="<H6>">Heading 6 <H6>
  162.     <OPTION VALUE="<PRE>">Pre <PRE>
  163.     <OPTION VALUE="removeFormat" STYLE="color: navy">Clear Formatting
  164.     </SELECT>
  165.     
  166.     <SELECT ONCHANGE="formatCode('fontname',this[this.selectedIndex].value);this.selectedIndex=0">
  167.     <OPTION CLASS=heading SELECTED>Font
  168.     <OPTION VALUE="geneva,arial,sans-serif">Arial
  169.     <OPTION VALUE="verdana,geneva,arial,sans-serif">Verdana
  170.     <OPTION VALUE="times,serif">Times
  171.     <OPTION VALUE="courier, monospace">Courier
  172.     <OPTION STYLE="color: navy" VALUE="CustomFont">Custom...
  173.     </SELECT>
  174.     
  175.     <SELECT ONCHANGE="formatCode('fontSize',this[this.selectedIndex].text);this.selectedIndex=0">
  176.     <OPTION CLASS=heading>Size
  177.     <OPTION>1
  178.     <OPTION>2
  179.     <OPTION>3
  180.     <OPTION>4
  181.     <OPTION>5
  182.     <OPTION>6
  183.     <OPTION>7
  184.     </SELECT>
  185.     
  186.     <SELECT ONCHANGE="formatCode('forecolor',this[this.selectedIndex].style.color);this.selectedIndex=0">
  187.     <OPTION CLASS=heading SELECTED>Color
  188.     <OPTION STYLE="color: Aqua">Aqua
  189.     <OPTION STYLE="color: Black">Black
  190.     <OPTION STYLE="color: Blue">Blue
  191.     <OPTION STYLE="color: DarkRed">Dark Red
  192.     <OPTION STYLE="color: darkgreen">Dark Green
  193.     <OPTION STYLE="color: Fuchsia">Fuchsia
  194.     <OPTION STYLE="color: Gray">Gray
  195.     <OPTION STYLE="color: Green">Green
  196.     <OPTION STYLE="color: Lime">Lime
  197.     <OPTION STYLE="color: Maroon">Maroon
  198.     <OPTION STYLE="color: navy">Navy
  199.     <OPTION STYLE="color: Olive">Olive
  200.     <OPTION STYLE="color: Purple">Purple
  201.     <OPTION STYLE="color: Red">Red
  202.     <OPTION STYLE="color: Silver">Silver
  203.     <OPTION STYLE="color: Teal">Teal
  204.     <OPTION STYLE="color: White">White
  205.     <OPTION STYLE="color: Yellow">Yellow
  206.     <OPTION>Custom...
  207.     </SELECT>
  208. </TD>
  209. <TD VALIGN="MIDDLE" NOWRAP>
  210.     <DIV class=toolbar STYLE="width:270;border:0;top:0;height:26" ONSELECTSTART="return false" ONDRAGSTART="return false">
  211.     <SCRIPT FOR="EditCtrl" EVENT="ShowContextMenu(xPos, yPos)">//important</SCRIPT>
  212.     <script language="JavaScript">
  213.         var buttons=new Array(24,23,23,4,23,23,23,4,23,23,23,23,4,24);
  214.         var action=new Array("bold","italic","underline","","justifyleft","justifycenter","justifyright","","insertorderedlist","insertunorderedlist","outdent","indent","","createLink");
  215.         var tooltip=new Array("Bold Text","Italic Text","Underline Text","","Left Justify","Center Justify","Right Justify","","Ordered List","Unordered List","Remove Indent","Indent","","Create Hyperlink");
  216.         var left=0;
  217.         var s="";
  218.  
  219.         for (var i=0;i<buttons.length;i++) 
  220.         {
  221.             s+="<SPAN STYLE='position:relative;height:26;width: " + buttons[i] + "'><SPAN STYLE='position:absolute;margin:0px;padding:0;height:26;top:0;left:0;width:" + (buttons[i]) + ";clip:rect(0 "+buttons[i]+" 25 "+0+");overflow:hidden'><IMG BORDER=0 SRC='/sysimage/system/toolbar.gif' STYLE='position:absolute;top:0;left:-" + left + "' WIDTH=267 HEIGHT=50";
  222.     
  223.             if (buttons[i]!=4) 
  224.             {
  225.                 s+=" onmouseover='this.style.top=-25' onmouseout='this.style.top=0' ONCLICK=\"";
  226.                 if (action[i]!="createLink") {
  227.                     s+="formatCode('" + action[i] + "');this.style.top=0\" ";
  228.                 } else {
  229.                     s+="createLink();this.style.top=0\" ";
  230.                 }
  231.  
  232.                 s+="TITLE=\"" + tooltip[i] + "\"";
  233.             }
  234.             s+="></SPAN></SPAN>";
  235.             left+=buttons[i];
  236.         }
  237.     
  238.         document.write(s + "</DIV>")
  239.     </script>
  240. </TD>
  241. </TR>
  242. </TABLE>
  243. </TD></TR>
  244. <TR><TD NOWRAP>
  245.     <IFRAME ID="ieCreate" SRC="/sysuser/docmgr/template/<RC$template>" WIDTH=705 HEIGHT=380></IFRAME>
  246. </TD></TR>
  247. <TR><TD NOWRAP>
  248.     <BR>
  249.     <FORM NAME="formSave" ONSUBMIT="document.formSave.upfile.value=ieCreate.document.all[0].outerHTML; document.forms[0].save.disabled=true;" METHOD="post" ACTION="/session/dm-create">
  250.     <BR>
  251.  
  252.         <B>File</B> <input type=text name="name" value="new.htm" size=40><BR>
  253.         <I>(Note: File name may not contain spaces!)</I><BR>
  254.  
  255.     <INPUT TYPE="submit" NAME="save" VALUE="Create" ONCLICK="document.forms[0].save.value='Creating... Please Wait';">
  256.     <SCRIPT LANGUAGE="JavaScript"> document.forms[0].save.disabled=true; </SCRIPT>
  257.     <INPUT TYPE="hidden" name="home" value="<RCSbrowse>">
  258.     <INPUT TYPE="hidden" name="root" value="<RCPdir>">
  259.     <INPUT TYPE="hidden" NAME="path" VALUE="<RC@txt2html(RC$path)>">
  260.     <INPUT TYPE="hidden" NAME="upfile">
  261.     </FORM>
  262.     <BR>
  263.     Return to browsing:
  264.     <A HREF="<RCSbrowse>/browse.stm?path=<RC@urlescape(RC$path)>"><RC$path></A>
  265. </TD></TR>
  266. </TABLE>
  267. </TD></TR>
  268. </TABLE>
  269. </BODY>
  270. </HTML>
  271.