Annotation of loncom/html/res/adm/pages/bookmarkmenu/bookmarkpal.html, revision 1.3
1.1 tyszkabe 1: <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
2: <html>
3: <head>
1.2 tyszkabe 4: <title>
5: My Framed Annotations
6: </title>
7:
8: <script LANGUAGE="JavaScript">
9:
1.3 ! tyszkabe 10: // This stuff is supplied by the perl mod. It contains all of the user
! 11: // defined bookmarks
1.2 tyszkabe 12: // The builds the object of the users bookmarks.
13:
1.3 ! tyszkabe 14: function buildUserTree() {
! 15: this.dropCache = "";
! 16: this.dragCache = "";
1.2 tyszkabe 17: this.bookmarks = new addFolder("Stuff", 6, "none");
18: this.bookmarks.p[1] = new addLink("MSU Engine3ering", "http://www.egr.msu.edu", "bookmarks.p[1]");
19: this.bookmarks.p[2] = new addLink("MSU Engine2ering", "http://www.egr.msu.edu/~tyszkabe", "bookmarks.p[2]");
20: this.bookmarks.p[3] = new addFolder("more crap", 5, "bookmarks.p[3]");
21: this.bookmarks.p[3].p[1] = new addLink("more of a test actually", "http://www.transam.com", "bookmarks.p[3].p[1]");
22: this.bookmarks.p[3].p[2] = new addLink("ALL CAPS PLEASE!", "http://www.bullwinkle.com", "bookmarks.p[3].p[2]");
23: this.bookmarks.p[3].p[3] = new addFolder("double nested", 2, "bookmarks.p[3].p[3]");
24: this.bookmarks.p[3].p[3].p[1] = new addLink("Test 12alphbravotango", "http://www.jealousy.com", "bookmarks.p[3].p[3].p[1]");
25: this.bookmarks.p[3].p[3].p[2] = new addFolder("empty folder", 1, "bookmarks.p[3].p[3].p[2]");
26: this.bookmarks.p[3].p[3].p[2].p[1] = new addLink("buried deeply", "http://www.cooldudze.com", "bookmarks.p[3].p[3].p[2].p[1]");
27: this.bookmarks.p[3].p[4] = new addLink("simon and Garfunkle", "www.inneptitude.com", "bookmarks.p[3].p[4]");
28: this.bookmarks.p[3].p[5] = new addLink("garbage in garbage out", "www.holy.com", "bookmarks.p[3].p[5]");
29: this.bookmarks.p[4] = new addLink("MSU Engin4eering", "st4uffcom", "bookmarks.p[4]");
30: this.bookmarks.p[5] = new addFolder("more x2", 3, "bookmarks.p[5]");
31: this.bookmarks.p[5].p[1] = new addLink("Whack a holy mole", "www.whackamole.com", "bookmarks.p[5].p[1]");
32: this.bookmarks.p[5].p[2] = new addLink("molly moldy mole", "http://www.molemolemole.com", "bookmarks.p[5].p[2]");
33: this.bookmarks.p[5].p[3] = new addLink("Thou art even more holy", "www.holymoly.com", "bookmarks.p[5].p[3]");
34: this.bookmarks.p[6] = new addLink("Google", "http://www.google.com/", "bookmarks.p[6]");
35: }
36:
37:
1.3 ! tyszkabe 38:
1.2 tyszkabe 39: // Adds a link to an object.
40: function addLink(name, link, address) {
41: this.name = name;
42: this.link = link;
43: this.address = address;
44: this.state = "link";
45: }
46:
47:
48: // Adds a folder to an object.
49: function addFolder(name, size, address) {
50: this.p = new Array(size);
51: this.name = name;
52: this.address = address;
53: this.state = "opened";
1.3 ! tyszkabe 54: this.swapState = swapState;
1.2 tyszkabe 55: }
56:
57:
58: // Swaps folder state from open to closed.
59: // There's probably a better way to do this.
60: function clickOnFolder(folder) {
61: if (folder.state == "closed") {
62: folder.state = "opened";
63: } else {
64: folder.state = "closed";
65: }
66: redrawTree(1, bookmarkpal.bookmarks.p);
67: }
68:
69:
70:
71: // Recursive function to generate the Tree HTML code
72: function drawTree(depth, folder) {
73: for ( var i = 1; i < folder.length; i++) {
74: if ( i == folder.length - 1) {
75: var shape = "L";
76: } else {
77: var shape = "T";
78: }
79: if ( folder[i].state == "link") {
80: drawLink(depth, folder[i], shape);
81: } else {
82: drawFolder(depth, folder[i], shape);
83: if ( folder[i].state == "opened" && folder[i].p.length >= 0 ) {
84: drawTree( depth+1, folder[i].p);
85: }
86: }
87: }
88: }
89:
90:
91:
92: // Writes HTML code for individual folder.
93: function drawFolder(depth, folder, shape) {
94: parent.frames[4].document.write("<TABLE border=0 cellspacing=0 cellpadding=0><TR><TD valign = middle nowrap>");
95: while ( depth > 1 ) {
96: parent.frames[4].document.write("<IMG src='line_vertical.gif' width=15 height=25>");
97: depth--;
98: }
99: if (shape == "L") {
100: parent.frames[4].document.write("<IMG src='line_l_shape.gif' width=15 height=25>");
101: } else {
102: parent.frames[4].document.write("<IMG src='line_side_T.gif' width=15 height=25>");
103: }
1.3 ! tyszkabe 104: parent.frames[4].document.write("<A href=\"javascript:top.clickOnFolder(top.bookmarkpal."+folder.address+")\" onmouseover=\"top.hoverFolder(top.bookmarkpal."+folder.address+")\" onMouseDown=\"top.mouseDown(top.bookmarkpal."+folder.address+")\" ><IMG src='folder_"+folder.state+".gif' width=25 height=25 border=noborder name='"+folder.address+"'></A>");
1.2 tyszkabe 105: parent.frames[4].document.write("<TD valign=middle align=left nowrap><FONT size=-1 face='Arial, Helvetica'>"+folder.name+"</FONT></TABLE>");
106: }
107:
108:
109: // Writes HTML code for individual link
110: function drawLink(depth, folder, shape) {
111: parent.frames[4].document.write("<TABLE border=0 cellspacing=0 cellpadding=0><TR><TD valign = middle nowrap>");
112: while ( depth > 1 ) {
113: parent.frames[4].document.write("<IMG src='line_vertical.gif' width=15 height=25>");
114: depth--;
115: }
116: if (shape == "L") {
117: parent.frames[4].document.write("<IMG src='line_l_shape.gif' width=15 height=25>");
118: } else {
119: parent.frames[4].document.write("<IMG src='line_side_T.gif' width=15 height=25>");
120: }
1.3 ! tyszkabe 121: parent.frames[4].document.write("<A href=\"javascript:top.clickOnBookmark\( '"+folder.link+"\' );\"><IMG src='link.gif' width=25 height=25 border=noborder name='"+folder.address+"' ></A>");
1.2 tyszkabe 122: parent.frames[4].document.write("<TD valign=middle align=left nowrap><FONT size=-1 face='Arial, Helvetica'><A href=\"javascript:top.clickOnBookmark\( '"+folder.link+"\' );\">"+folder.name+"</a></FONT></TABLE>");
123: }
124:
125:
1.3 ! tyszkabe 126: function hoverFolder( object ) {
! 127: bookmarkpal.dropCache = object;
! 128: }
! 129:
! 130:
! 131: function mouseDown( object ) {
! 132: bookmarkpal.dragCache = object;
! 133: }
! 134:
! 135: function mouseUp() {
! 136: bookmarkpal.dropCache = bookmarkpal.dragCache;
! 137: }
! 138:
1.2 tyszkabe 139: // function dragObject() {
140: // }
141:
142: // Opens a bookmark to the main window
143: function clickOnBookmark(url) {
1.3 ! tyszkabe 144: opener.opener.location.href=url;
1.2 tyszkabe 145: }
146:
147: // function saveToLonCapa() {
148: // }
149:
150:
151: // Calls Build and draws functions. This function also takes
152: // care of housekeeping
153: function initializeTree() {
154: // The following is Javascript 1.2 stuff. I'm not supposed to
155: // use it and it doesn't seem to work anyways!
156: // top.captureEvents(events.RESIZE);
157: // top.onresize=redrawTree();
1.3 ! tyszkabe 158:
1.2 tyszkabe 159: bookmarkpal = new buildUserTree();
1.3 ! tyszkabe 160: frames[4].document.write("<BODY>");
1.2 tyszkabe 161: drawTree(1, bookmarkpal.bookmarks.p);
1.3 ! tyszkabe 162: frames[4].document.write("</BODY>");
! 163:
! 164: // Captures mouse clicks for the sake of ben's-verycompatible-psuedo-dragdrop
! 165: frames[4].document.captureEvents(Event.MOUSEUP);
! 166: document.onmouseup = mouseUp;
! 167:
1.2 tyszkabe 168: }
169:
170: function redrawTree() {
171: parent.frames[4].document.clear();
172: parent.frames[4].document.write("<BODY>");
173: drawTree(1, bookmarkpal.bookmarks.p);
174: parent.frames[4].document.write("</BODY>");
175: }
176:
177:
178:
179: //var current_mode="preview"
180: //var available_mode="edit"
181: //var dumb_swap='change_this';
182:
183: //function swap_mode() {
184: // dumb_swap = available_mode;
185: // available_mode = current_mode;
186: // current_mode = dumb_swap;
187:
188: // update_button();
189: // update_content();
190:
191: //}
192:
193: //function update_button() {
194: // this.document['previewedit'].src = "button_" + available_mode + ".gif";
195: //}
196:
197: //function update_content() {
198: // parent.frames[4].location.href = "annotator_content_" + current_mode + ".html"
199: //}
200:
201: </script>
202:
203:
204:
1.1 tyszkabe 205: </head>
206:
207: <FRAMESET rows="25, *, 30, 25" topmargin=0 leftmargin=0 marginheight=0 marginwidth=0 frameborder="0" border="0" framespacing="0" >
208:
209: <FRAMESET cols="25, *, 25" frameborder="0" borders="0" framespacing="0">
210: <FRAME src="annotator_ul.html" marginwidth="0" marginheight="0" scrolling="no">
211: <FRAME src="annotator_uu.html" marginwidth="0" marginheight="0" scrolling="no">
212: <FRAME src="annotator_ur.html" marginwidth="0" marginheight="0" scrolling="no">
213: </FRAMESET>
214:
215:
216: <FRAMESET name="contentb" cols="25, *, 25" frameborder="0" borders="0" framespacing="0">
217: <FRAME src="annotator_left.html" marginwidth="0" marginheight="0" scrolling="no">
1.3 ! tyszkabe 218: <FRAME name="content" src="loading_bookmarks.html" marginwidth="0" marginheight="0" scrolling="yes">
1.1 tyszkabe 219: <FRAME src="annotator_right.html" marginwidth="0" marginheight="0" scrolling="no">
220: </FRAMESET>
221:
222:
223: <FRAMESET cols="25, *, 25" frameborder="0" borders="0" framespacing="0">
224: <FRAME src="annotator_left.html" marginwidth="0" marginheight="0" scrolling="no">
225: <FRAME name="toolbar" src="annotator_toolbar.html" marginwidth="0" marginheight="0" scrolling="no">
226: <FRAME src="annotator_right.html" marginwidth="0" marginheight="0" scrolling="no">
227: </FRAMESET>
228:
229:
230: <FRAMESET cols="25, *, 25" frameborder="0" borders="0" framespacing="0">
231: <FRAME src="annotator_ll.html" marginwidth="0" marginheight="0" scrolling="no">
232: <FRAME src="annotator_bb.html" marginwidth="0" marginheight="0" scrolling="no">
233: <FRAME src="annotator_lr.html" marginwidth="0" marginheight="0" scrolling="no">
234: </FRAMESET>
235:
236:
237: </FRAMESET>
238:
239: </html>
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>