Annotation of loncom/publisher/publisher.html, revision 1.41

1.1       www         1: <html>
                      2: <head>
                      3: <title>LON-CAPA Publishing Frame</title>
1.38      albertel    4: <script type="text/javascript">
                      5: //<!--
1.29      www         6: function frameloc() {
1.31      www         7:     if (parent.LONCAPAToBePublished.location.pathname.indexOf("/~")!=-1) {
                      8:        parent.lastknownpriv=parent.LONCAPAToBePublished.location.pathname;
1.29      www         9:     }
1.31      www        10: // alert ('We are at '+parent.lastknownpriv);
1.29      www        11:     return unescape(parent.lastknownpriv);
                     12: }
1.1       www        13: 
                     14: function getfilename() {
1.29      www        15:    document.publisher.filename.value=frameloc();
1.7       www        16:    if ((document.publisher.filename.value.charAt(
                     17:         document.publisher.filename.value.length-1)!='/') &&
                     18:        (document.publisher.filename.value.indexOf('/adm/pubdir')==-1)) {
                     19:         document.publisher.submit();
                     20:    } else {
1.35      www        21:       alert('MT{Cannot publish directory}');
1.7       www        22:    }
1.1       www        23: }
                     24: 
1.4       www        25: function getdfilename() {
1.29      www        26:   document.dpublisher.filename.value=frameloc();
1.6       www        27:   if (document.dpublisher.filename.value.indexOf('/adm/pubdir')==-1) {
                     28:       document.dpublisher.submit();
                     29:   }
1.4       www        30: }
                     31: 
1.9       www        32: function getufilename() {
1.29      www        33:   document.upublisher.filename.value=frameloc();
1.14      www        34:   if (document.upublisher.filename.value.indexOf('/adm/pubdir')!=-1) {
                     35:       document.upublisher.filename.value=document.dpublisher.filename.value;
1.9       www        36:   }
1.14      www        37:   document.upublisher.submit();
1.9       www        38: }
                     39: 
1.4       www        40: function getrfilename() {
1.29      www        41:   document.rpublisher.filename.value=frameloc();
1.8       www        42:    if ((document.rpublisher.filename.value.charAt(
                     43:         document.rpublisher.filename.value.length-1)!='/') &&
                     44:        (document.rpublisher.filename.value.indexOf('/adm/pubdir')==-1)) {
                     45:         document.rpublisher.submit();
                     46:    } else {
1.35      www        47:       alert('MT{Cannot retrieve directory}');
1.8       www        48:    }
1.4       www        49: }
                     50: 
1.24      albertel   51: function getactionfilename() {
1.29      www        52:   document.fileaction.filename.value=frameloc();
1.24      albertel   53:   var test=document.fileaction.action.selectedIndex;
1.34      albertel   54:   if (test == 8) { // trying to create a directory
1.24      albertel   55:       if (document.fileaction.filename.value.indexOf('/adm/pubdir')!=-1) {
                     56:           document.fileaction.filename.value=document.dpublisher.filename.value;
                     57:       }
                     58:       if ((document.fileaction.filename.value.charAt(
                     59:            document.fileaction.filename.value.length-1)!='/') &&
                     60:            (document.fileaction.filename.value.indexOf('/adm/pubdir')==-1)) {
1.35      www        61:           alert('MT{Must create new subdirectory inside a directory}');
1.24      albertel   62:           return;
                     63:       }
1.11      www        64:    }
1.24      albertel   65:    document.fileaction.submit();
1.11      www        66: }
1.20      www        67: 
1.25      albertel   68: function getdelfilename() {
1.29      www        69:   document.del.filename.value=frameloc();
1.25      albertel   70:   document.del.submit();
                     71: }
                     72: 
1.32      albertel   73: function getcurseed() {
                     74:   if (parent.LONCAPAToBePublished.document.lonhomework
                     75:        &&
                     76:       parent.LONCAPAToBePublished.document.lonhomework.rndseed
                     77:        &&
                     78:       parent.LONCAPAToBePublished.document.lonhomework.rndseed.value) {
                     79:     return parent.LONCAPAToBePublished.document.lonhomework.rndseed.value;
                     80:   }
                     81:   return 0;
                     82: }
                     83: 
1.37      sakharuk   84: function getproblemtype() {
1.39      albertel   85:   if (parent.LONCAPAToBePublished.document.lonhomework
                     86:        &&
                     87:       parent.LONCAPAToBePublished.document.lonhomework.problemtype) {
                     88:     if (parent.LONCAPAToBePublished.document.lonhomework.problemtype.value) {
                     89:       return parent.LONCAPAToBePublished.document.lonhomework.problemtype.value;
                     90:     }
                     91:     if (parent.LONCAPAToBePublished.document.lonhomework.problemtype.options) {
                     92:        var optionelement;
                     93:        var valueIndex=0;
                     94:        for (var optionIndex=0;
                     95:             optionIndex < parent.LONCAPAToBePublished.document.lonhomework.problemtype.options.length;
                     96: 	    optionIndex++)
                     97:        {
                     98:            optionElement=parent.LONCAPAToBePublished.document.lonhomework.problemtype.options[optionIndex];
                     99: 	   if (optionElement.selected) {
                    100: 	      return optionElement.value;
                    101:            }	  
                    102:        } 	  
                    103:     }
1.37      sakharuk  104:   }
                    105:   return 0;
                    106: }
                    107: 
1.20      www       108: function getpostdata() {
1.29      www       109:   document.printout.postdata.value=frameloc();
1.32      albertel  110:   document.printout.curseed.value=getcurseed();
1.37      sakharuk  111:   document.printout.problemtype.value=getproblemtype();
1.20      www       112:   document.printout.submit();
                    113: }
1.38      albertel  114: //-->
1.1       www       115: </script>
1.41    ! bisitz    116: <style>
        !           117: table.LC_publisher {
        !           118:   border-collapse:collapse;
        !           119: }
        !           120: .LC_publisher td {
        !           121:   border: 1px solid #C0C0C0;
        !           122:   padding: 2px;
        !           123: }
        !           124: </style>
1.24      albertel  125:     </head>
1.41    ! bisitz    126:     <body>
        !           127:           <table class="LC_publisher">
        !           128:               <tr valign="middle">
        !           129: 		  <td align="center">
1.38      albertel  130: 		    <form name="publisher" action="/adm/publish" target="_parent" method="post">
1.24      albertel  131: 		      <input type="hidden" name="filename" value="" />
1.38      albertel  132: 	              <input type="button" value="MT{Publish this Resource}" onclick="getfilename();" />
                    133: 		    </form>
                    134: 		  </td>
1.41    ! bisitz    135: 		  <td align="center">
1.38      albertel  136: 		    <form name="dpublisher" action="/adm/pubdir" target="LONCAPAToBePublished" method="post">
1.24      albertel  137: 		      <input type="hidden" name="filename" value="" />
1.38      albertel  138: 		      <input type="button" value="MT{List Directory}" onclick="getdfilename();" />
                    139: 		    </form>
                    140: 		  </td>
1.41    ! bisitz    141: 		  <td valign="top" align="center">
1.38      albertel  142: 		    <form name="upublisher" action="/adm/upload" target="_parent"
1.24      albertel  143: 			method="post" enctype="multipart/form-data">
                    144: 		      <input type="hidden" name="filename" value="" />
                    145: 		      <input type="file" name="upfile" size="20" />
1.38      albertel  146: 		      <input type="button" value="MT{Upload file}"  onclick="getufilename();" />
                    147: 		    </form>
                    148: 		  </td>
1.41    ! bisitz    149: 		  <td rowspan="2" align="center">
1.38      albertel  150: 		    <form name="printout" target="_parent" action="/adm/printout" method="post" onsubmit="getpostdata();">
1.25      albertel  151: 		      <input type="hidden" name="postdata" value="" />
1.32      albertel  152: 		      <input type="hidden" name="curseed" value="" />
1.37      sakharuk  153: 		      <input type="hidden" name="problemtype" value="" />
1.38      albertel  154: 		      <input type="button" value="MT{Print}" onclick="getpostdata();" />
                    155: 		    </form>
                    156: 		  </td>
1.25      albertel  157: 
1.24      albertel  158: 		</tr>
                    159: 		<tr valign="middle">
1.41    ! bisitz    160: 		  <td align="center">
1.38      albertel  161: 		    <form name="rpublisher" action="/adm/retrieve" target="_parent" method="post">
1.24      albertel  162: 		      <input type="hidden" name="filename" value="" />
1.38      albertel  163: 		      <input type="button" value="MT{Retrieve Old Version}" onclick="getrfilename();" />
                    164: 		    </form>
                    165: 		  </td>
1.41    ! bisitz    166: 		  <td>
1.38      albertel  167: 		    <form name="del" action="/adm/cfile" target="_parent" method="post">
1.25      albertel  168: 		      <input type="hidden" name="filename" value="" />
                    169: 		      <input type="hidden" name="action" value="delete" />
1.38      albertel  170: 	              <input type="button" value="MT{Delete}" onclick="getdelfilename();" />
                    171: 		    </form>
                    172: 		  </td>
1.41    ! bisitz    173: 		  <td align="center">
1.38      albertel  174: 		    <form name="fileaction" action="/adm/cfile" target="_parent" method="post" onsubmit="getactionfilename();">
1.24      albertel  175: 		      <nobr>
                    176: 			<input type="hidden" name="filename" value="" />
                    177: 			  <select name="action">
1.35      www       178: 			    <option>MT{Select Action}</option>
                    179: 			    <option value="newfile">MT{New file}:</option>
                    180: 			    <option value="newhtmlfile">MT{New HTML file}:</option>
                    181: 			    <option value="newproblemfile">MT{New problem}:</option>
                    182:                             <option value="newpagefile">MT{New assembled page}:</option>
                    183:                             <option value="newsequencefile">MT{New assembled sequence}:</option>
                    184:                             <option value="newrightsfile">MT{New custom rights file}:</option>
                    185:                             <option value="newstyfile">MT{New style file}:</option>
1.40      www       186:                             <option value="newlibraryfile">MT{New library file}:</option>
1.35      www       187: 			    <option value="newdir">MT{New subdirectory}:</option>
                    188: 			    <option value="rename">MT{Rename current file to}:</option>
1.36      albertel  189: 			    <option value="move">MT{Move current file to}:</option>
1.35      www       190: 			    <option value="copy">MT{Copy current file to}:</option>
1.38      albertel  191: 			  </select>&nbsp;<input type="text" name="newfilename" value="MT{Type Name Here}" onfocus="if (this.value == 'MT{Type Name Here}') this.value=''" />&nbsp;<input type="button" value="MT{Go}" onclick="getactionfilename();" />
1.24      albertel  192: 		      </nobr>
1.38      albertel  193: 		    </form>
                    194: 		   </td>
1.24      albertel  195: 		</tr>
1.41    ! bisitz    196:       </table>
1.24      albertel  197:     </body>
                    198:   </html>

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>