Annotation of loncom/publisher/publisher.html, revision 1.30
1.1 www 1: <html>
2: <head>
3: <title>LON-CAPA Publishing Frame</title>
1.29 www 4: <script language="JavaScript">
5:
6: function frameloc() {
7: if (parent.LONCAPAToBePublished.location.href.indexOf("/~")!=-1) {
8: parent.lastknownpriv=parent.LONCAPAToBePublished.location.href;
9: }
10: return unescape(parent.lastknownpriv);
11: }
1.1 www 12:
13: function getfilename() {
1.29 www 14: document.publisher.filename.value=frameloc();
1.7 www 15: if ((document.publisher.filename.value.charAt(
16: document.publisher.filename.value.length-1)!='/') &&
17: (document.publisher.filename.value.indexOf('/adm/pubdir')==-1)) {
18: document.publisher.submit();
19: } else {
20: alert('Cannot publish directory');
21: }
1.1 www 22: }
23:
1.4 www 24: function getdfilename() {
1.29 www 25: document.dpublisher.filename.value=frameloc();
1.6 www 26: if (document.dpublisher.filename.value.indexOf('/adm/pubdir')==-1) {
27: document.dpublisher.submit();
28: }
1.4 www 29: }
30:
1.9 www 31: function getufilename() {
1.29 www 32: document.upublisher.filename.value=frameloc();
1.14 www 33: if (document.upublisher.filename.value.indexOf('/adm/pubdir')!=-1) {
34: document.upublisher.filename.value=document.dpublisher.filename.value;
1.9 www 35: }
1.14 www 36: document.upublisher.submit();
1.9 www 37: }
38:
1.4 www 39: function getrfilename() {
1.29 www 40: document.rpublisher.filename.value=frameloc();
1.8 www 41: if ((document.rpublisher.filename.value.charAt(
42: document.rpublisher.filename.value.length-1)!='/') &&
43: (document.rpublisher.filename.value.indexOf('/adm/pubdir')==-1)) {
44: document.rpublisher.submit();
45: } else {
46: alert('Cannot retrieve directory');
47: }
1.4 www 48: }
49:
1.24 albertel 50: function getactionfilename() {
1.29 www 51: document.fileaction.filename.value=frameloc();
1.24 albertel 52: var test=document.fileaction.action.selectedIndex;
53: if (test == 4) { // trying to create a directory
54: if (document.fileaction.filename.value.indexOf('/adm/pubdir')!=-1) {
55: document.fileaction.filename.value=document.dpublisher.filename.value;
56: }
57: if ((document.fileaction.filename.value.charAt(
58: document.fileaction.filename.value.length-1)!='/') &&
59: (document.fileaction.filename.value.indexOf('/adm/pubdir')==-1)) {
60: alert('Must create new subdirectory inside a directory');
61: return;
62: }
1.11 www 63: }
1.24 albertel 64: document.fileaction.submit();
1.11 www 65: }
1.20 www 66:
1.25 albertel 67: function getdelfilename() {
1.29 www 68: document.del.filename.value=frameloc();
1.25 albertel 69: document.del.submit();
70: }
71:
1.20 www 72: function getpostdata() {
1.29 www 73: document.printout.postdata.value=frameloc();
1.20 www 74: document.printout.submit();
75: }
1.1 www 76: </script>
1.24 albertel 77: </head>
78: <body bgcolor="#ccffdd" text='#002200' link='#003333' vlink='#006666'>
79: <font size="-2">
80: <table border="0" align="center"><tr><th bgcolor="#004400" height="20">
81: <table border="0" cellspacing="4"><tr valign="middle">
82: <form name="publisher" action="/adm/publish" target="_parent" method="post">
83: <td bgcolor="#ccddaa" align="center">
84: <input type="hidden" name="filename" value="" />
85: <input type="button" value="Publish this Resource" onClick="getfilename();" />
86: </td>
87: </form>
88: <form name="dpublisher" action="/adm/pubdir" target="LONCAPAToBePublished" method="post">
89: <td bgcolor="#ccddaa" align="center">
90: <input type="hidden" name="filename" value="" />
91: <input type="button" value="List Directory" onClick="getdfilename();" />
92: </td>
93: </form>
94: <form name="upublisher" action="/adm/upload" target="_parent"
95: method="post" enctype="multipart/form-data">
96: <td bgcolor="#ccddaa" valign="top" align="center">
97: <input type="hidden" name="filename" value="" />
98: <input type="file" name="upfile" size="20" />
99: <input type="button" value="Upload file" onClick="getufilename();" />
100: </td>
101: </form>
1.25 albertel 102: <form name="printout" target="_parent" action="/adm/printout" target="LONCAPAToBePublished" method="post" onSubmit="getpostdata();">
103: <td rowspan="2" bgcolor="#ccddaa" align="center">
104: <input type="hidden" name="postdata" value="" />
105: <input type="button" value="Print" onClick="getpostdata();" />
106: </td>
107: </form>
108:
1.24 albertel 109: </tr>
110: <tr valign="middle">
111: <form name="rpublisher" action="/adm/retrieve" target="_parent" method="post">
112: <td bgcolor="#ccddaa" align="center">
113: <input type="hidden" name="filename" value="" />
114: <input type="button" value="Retrieve Old Version" onClick="getrfilename();" />
115: </td>
116: </form>
1.25 albertel 117: <form name="del" action="/adm/cfile" target="_parent" method="post">
118: <td bgcolor="#ccddaa">
119: <input type="hidden" name="filename" value="" />
120: <input type="hidden" name="action" value="delete" />
121: <input type="button" value="Delete" onClick="getdelfilename();" />
1.24 albertel 122: </td>
123: </form>
1.26 albertel 124: <form name="fileaction" action="/adm/cfile" target="_parent" method="post" onSubmit="getactionfilename();">
1.24 albertel 125: <td bgcolor="#ccddaa" align="center">
126: <nobr>
127: <input type="hidden" name="filename" value="" />
128: <select name="action">
129: <option>Select Action</option>
130: <option value="newfile">New file:</option>
131: <option value="newhtmlfile">New HTML file:</option>
132: <option value="newproblemfile">New problem:</option>
1.27 www 133: <option value="newpagefile">New assembled page:</option>
134: <option value="newsequencefile">New assembled sequence:</option>
1.30 ! www 135: <option value="newrightsfile">New custom rights file:</option>
! 136: <option value="newstyfile">New style file:</option>
1.25 albertel 137: <option value="newdir">New subdirectory:</option>
1.24 albertel 138: <option value="rename">Rename current file to:</option>
139: <option value="copy">Copy current file to:</option>
1.25 albertel 140: </select> <input type="text" name="newfilename" value="Type Name Here" onFocus="if (this.value == 'Type Name Here') this.value=''" /> <input type="button" value="Go" onClick="getactionfilename();" />
1.24 albertel 141: </nobr>
142: </td>
143: </form>
144: </td>
145: </form>
146: </tr>
147: </table>
148: </th>
149: </tr>
150: </table>
151: </font>
152: </body>
153: </html>
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>