source: BMXNET_RPMS_dotNET_UTILITIES-BMX/branch/BMX41000/IHS BMX Framework/IndianHealthService.BMXNet.GeneratedDocumentation/Help/Scripts/script_manifold.js

Last change on this file was 1146, checked in by Sam Habiel, 14 years ago

Initial Import of BMX4

File size: 30.9 KB
Line 
1window.onload=LoadPage;
2window.onunload=Window_Unload;
3//window.onresize=ResizeWindow;
4window.onbeforeprint = set_to_print;
5window.onafterprint = reset_form;
6
7var scrollPos = 0;
8
9var inheritedMembers;
10var protectedMembers;
11var netcfMembersOnly;
12var netXnaMembersOnly;
13
14// Initialize array of section states
15
16var sectionStates = new Array();
17var sectionStatesInitialized = false;
18
19//Hide sample source in select element
20function HideSelect()
21{
22 var selectTags = document.getElementsByTagName("SELECT");
23 var spanEles = document.getElementsByTagName("span");
24 var i = 10;
25 var m;
26
27 if (selectTags.length != null || selectTags.length >0)
28 {
29 for (n=0; n<selectTags.length; n++)
30 {
31 var lan = selectTags(n).getAttribute("id").substr("10");
32 //hide the first select that is on
33 switch (lan.toLowerCase())
34 {
35 case "visualbasic":
36 //alert(lan);
37 for (m=0; m<spanEles.length; m++)
38 {
39 if (spanEles[m].getAttribute("codeLanguage") == "VisualBasic" && spanEles[m].style.display != "none" && n <i)
40 i = n;
41 }
42 break;
43 case "visualbasicdeclaration":
44 for (m=0; m<spanEles.length; m++)
45 {
46 if (spanEles[m].getAttribute("codeLanguage") == "VisualBasicDeclaration" && spanEles[m].style.display != "none" && n < i)
47 i = n;
48 }
49 break;
50 case "visualbasicusage":
51 //alert(lan);
52 for (m=0; m<spanEles.length; m++)
53 {
54 if (spanEles[m].getAttribute("codeLanguage") == "VisualBasicUsage" && spanEles[m].style.display != "none" && n <i)
55 i = n;
56 }
57 break;
58 case "csharp":
59 for (m=0; m<spanEles.length; m++)
60 {
61 if (spanEles[m].getAttribute("codeLanguage") == "CSharp" && spanEles[m].style.display != "none" && n < i)
62 i = n;
63 }
64 break;
65 case "managedcplusplus":
66 for (m=0; m<spanEles.length; m++)
67 {
68 if (spanEles[m].getAttribute("codeLanguage") == "ManagedCPlusPlus" && spanEles[m].style.display != "none" && n < i)
69 i = n;
70 }
71 break;
72 case "jsharp":
73 for (m=0; m<spanEles.length; m++)
74 {
75 if (spanEles[m].getAttribute("codeLanguage") == "JSharp" && spanEles[m].style.display != "none" && n < i)
76 i = n;
77 }
78 break;
79 case "jscript":
80 for (m=0; m<spanEles.length; m++)
81 {
82 if (spanEles[m].getAttribute("codeLanguage") == "JScript" && spanEles[m].style.display != "none" && n < i)
83 i = n;
84 }
85 break;
86 case "xaml":
87 //alert(lan);
88 for (m=0; m<spanEles.length; m++)
89 {
90 if (spanEles[m].getAttribute("codeLanguage") == "XAML" && spanEles[m].style.display != "none" && n <i)
91 i = n;
92 }
93 break;
94 case "javascript":
95 //alert(lan);
96 for (m=0; m<spanEles.length; m++)
97 {
98 if (spanEles[m].getAttribute("codeLanguage") == "JavaScript" && spanEles[m].style.display != "none" && n <i)
99 i = n;
100 }
101 break;
102 }
103 }
104 if (i != 10)
105 selectTags(i).style.visibility = "hidden";
106 }
107 else{ alert("Not found!");}
108}
109
110function UnHideSelect()
111{
112 var selectTags = document.getElementsByTagName("SELECT");
113 var n;
114
115 //un-hide all the select sections
116 if (selectTags.length != null || selectTags.length >0)
117 {
118 for (n=0; n<selectTags.length; n++)
119 selectTags(n).style.visibility = "visible";
120 }
121}
122
123function InitSectionStates()
124{
125 sectionStatesInitialized = true;
126 if (globals == null) globals = GetGlobals();
127 // SectionStates has the format:
128 //
129 // firstSectionId:state;secondSectionId:state;thirdSectionId:state; ... ;lastSectionId:state
130 //
131 // where state is either "e" (expanded) or "c" (collapsed)
132
133 // get the SectionStates from the previous topics
134 var states = Load("SectionStates");
135
136 var start = 0;
137 var end;
138 var section;
139 var state;
140 var allCollapsed = false;
141 // copy the previous section states to the sectionStates array for the current page
142 if (states != null && states != "")
143 {
144 allCollapsed = true;
145 while (start < states.length)
146 {
147 end = states.indexOf(":", start);
148
149 section = states.substring(start, end);
150
151 start = end + 1;
152 end = states.indexOf(";", start);
153 if (end == -1) end = states.length;
154 state = states.substring(start, end);
155 sectionStates[section] = state;
156 allCollapsed = allCollapsed && (state == "c");
157 start = end + 1;
158 }
159 }
160
161 // now set the state for any section ids in the current document that weren't in previous
162 var imgElements = document.getElementsByName("toggleSwitch");
163 var i;
164 for (i = 0; i < imgElements.length; ++i)
165 sectionStates[imgElements[i].id] = GetInitialSectionState(imgElements[i].id, allCollapsed);
166}
167
168function GetInitialSectionState(itemId, allCollapsed)
169{
170 // if the global state is "allCollapsed", set all section states to collapsed
171 if (allCollapsed) return "c";
172
173 // generic <section> node ids begin with "sectionToggle", so the same id can refer to different sections in different topics
174 // we don't want to persist their state; set it to expanded
175 if (itemId.indexOf("sectionToggle", 0) == 0) return "e";
176
177 // the default state for new section ids is expanded
178 if (sectionStates[itemId] == null) return "e";
179
180 // otherwise, persist the passed in state
181 return sectionStates[itemId];
182}
183
184var noReentry = false;
185
186function OnLoadImage(eventObj)
187{
188 if (noReentry) return;
189
190 if (!sectionStatesInitialized)
191 InitSectionStates();
192
193 var elem;
194 if(document.all) elem = eventObj.srcElement;
195 else elem = eventObj.target;
196
197 if ((sectionStates[elem.id] == "e"))
198 ExpandSection(elem);
199 else
200 CollapseSection(elem);
201}
202
203/*
204**********
205********** Begin
206**********
207*/
208
209var docSettings;
210
211function LoadPage()
212{
213 // If not initialized, grab the DTE.Globals object
214 if (globals == null)
215 globals = GetGlobals();
216
217 // docSettings has settings for the current document,
218 // which include persistent and non-persistent keys for checkbox filters and expand/collapse section states
219 // persistKeys is an array of the checkbox ids to persist
220 if (docSettings == null)
221 {
222 docSettings = new Array();
223 persistKeys = new Array();
224 }
225
226 if (!sectionStatesInitialized)
227 InitSectionStates();
228
229 var imgElements = document.getElementsByName("toggleSwitch");
230
231 for (i = 0; i < imgElements.length; i++)
232 {
233 if ((sectionStates[imgElements[i].id] == "e"))
234 ExpandSection(imgElements[i]);
235 else
236 CollapseSection(imgElements[i]);
237 }
238
239 SetCollapseAll();
240
241 // split screen
242 var screen = new SplitScreen('header', 'mainSection');
243
244 // init devlang filter checkboxes
245 SetupDevlangsFilter();
246
247 // init memberlist filter checkboxes for protected, inherited, etc
248 SetupMemberOptionsFilter();
249
250 // init memberlist platforms filter checkboxes, e.g. .Net Framework, CompactFramework, XNA, Silverlight, etc.
251 SetupMemberFrameworksFilter();
252
253 var mainSection = document.getElementById("mainSection");
254
255 // vs70.js did this to allow up/down arrow scrolling, I think
256 try { mainSection.setActive(); } catch(e) { }
257
258 //set the scroll position
259 try{mainSection.scrollTop = scrollPos;}
260 catch(e){}
261}
262
263function Window_Unload()
264{
265 // for each key in persistArray, write the key/value pair to globals
266 for (var i = 0; i < persistKeys.length; i++)
267 Save(persistKeys[i],docSettings[persistKeys[i]]);
268
269 // save the expand/collapse section states
270 SaveSections();
271}
272
273function set_to_print()
274{
275 //breaks out of divs to print
276 var i;
277
278 if (window.text)document.all.text.style.height = "auto";
279
280 for (i=0; i < document.all.length; i++)
281 {
282 if (document.all[i].tagName == "body")
283 {
284 document.all[i].scroll = "yes";
285 }
286 if (document.all[i].id == "header")
287 {
288 document.all[i].style.margin = "0px 0px 0px 0px";
289 document.all[i].style.width = "100%";
290 }
291 if (document.all[i].id == "mainSection")
292 {
293 document.all[i].style.overflow = "visible";
294 document.all[i].style.top = "5px";
295 document.all[i].style.width = "100%";
296 document.all[i].style.padding = "0px 10px 0px 30px";
297 }
298 }
299}
300
301function reset_form()
302{
303 //returns to the div nonscrolling region after print
304 document.location.reload();
305}
306
307/*
308**********
309********** End
310**********
311*/
312
313
314/*
315**********
316********** Begin Language Filtering
317**********
318*/
319
320var devlangsMenu;
321var devlangsDropdown;
322var memberOptionsMenu;
323var memberOptionsDropdown;
324var memberFrameworksMenu;
325var memberFrameworksDropdown;
326var dropdowns = new Array();
327
328// initialize the devlang filter dropdown menu
329function SetupDevlangsFilter()
330{
331 var divNode = document.getElementById('devlangsMenu');
332 if (divNode == null)
333 return;
334
335 var checkboxNodes = divNode.getElementsByTagName("input");
336
337 if (checkboxNodes.length == 1)
338 {
339 // only one checkbox, so we don't need a menu
340 // get the devlang and use it to display the correct devlang spans
341 // a one-checkbox setting like this is NOT persisted, nor is it set from the persisted globals
342 var checkboxData = checkboxNodes[0].getAttribute('data');
343 var dataSplits = checkboxData.split(',');
344 var devlang = "";
345 if (dataSplits.length > 1)
346 devlang = dataSplits[1];
347 styleSheetHandler(devlang);
348 }
349 else
350 {
351 // setup the dropdown menu
352 devlangsMenu = new CheckboxMenu("devlangsMenu", docSettings, persistKeys, globals);
353 devlangsDropdown = new Dropdown('devlangsDropdown', 'devlangsMenu');
354 dropdowns.push(devlangsDropdown);
355
356 // update the label of the dropdown menu
357 SetDropdownMenuLabel(devlangsMenu, devlangsDropdown);
358
359 // toggle the document's display docSettings
360 codeBlockHandler();
361 styleSheetHandler("");
362 }
363}
364
365
366// called onclick in a devlang filter checkbox
367// tasks to perform at this event are:
368// toggle the check state of the checkbox that was clicked
369// update the user's devlang preference, based on devlang checkbox states
370// update stylesheet based on user's devlang preference
371// show/hide snippets/syntax based on user's devlang preference
372//
373function SetLanguage(checkbox)
374{
375 // toggle the check state of the checkbox that was clicked
376 devlangsMenu.ToggleCheckState(checkbox.id);
377
378 // update the label of the dropdown menu
379 SetDropdownMenuLabel(devlangsMenu, devlangsDropdown);
380
381 // update the display of the document's items that are dependent on the devlang setting
382 codeBlockHandler();
383 styleSheetHandler("");
384
385}
386/*
387**********
388********** End Language Filtering
389**********
390*/
391
392
393/*
394**********
395********** Begin Members Options Filtering
396**********
397*/
398
399// initialize the memberlist dropdown menu for protected, inherited, etc
400function SetupMemberOptionsFilter()
401{
402 if (document.getElementById('memberOptionsMenu') != null) {
403 memberOptionsMenu = new CheckboxMenu("memberOptionsMenu", docSettings, persistKeys, globals);
404 memberOptionsDropdown = new Dropdown('memberOptionsDropdown', 'memberOptionsMenu');
405 dropdowns.push(memberOptionsDropdown);
406
407 // update the label of the dropdown menu
408 SetDropdownMenuLabel(memberOptionsMenu, memberOptionsDropdown);
409
410 // show/hide memberlist rows based on the current docSettings
411 memberlistHandler();
412 }
413}
414
415function SetupMemberFrameworksFilter()
416{
417 if (document.getElementById('memberFrameworksMenu') != null)
418 {
419 memberFrameworksMenu = new CheckboxMenu("memberFrameworksMenu", docSettings, persistKeys, globals);
420 memberFrameworksDropdown = new Dropdown('memberFrameworksDropdown', 'memberFrameworksMenu');
421 dropdowns.push(memberFrameworksDropdown);
422
423 // update the label of the dropdown menu
424 SetDropdownMenuLabel(memberFrameworksMenu, memberFrameworksDropdown);
425
426 // show/hide memberlist rows based on the current docSettings
427 memberlistHandler();
428 }
429}
430
431function SetMemberOptions(checkbox, groupName)
432{
433 var checkboxGroup = new Array();
434 if (groupName == "vis")
435 {
436 if (document.getElementById('PublicCheckbox') != null)
437 checkboxGroup.push('PublicCheckbox');
438 if (document.getElementById('ProtectedCheckbox') != null)
439 checkboxGroup.push('ProtectedCheckbox');
440 }
441 else if (groupName == "decl")
442 {
443 if (document.getElementById('DeclaredCheckbox') != null)
444 checkboxGroup.push('DeclaredCheckbox');
445 if (document.getElementById('InheritedCheckbox') != null)
446 checkboxGroup.push('InheritedCheckbox');
447 }
448
449 // toggle the check state of the checkbox that was clicked
450 memberOptionsMenu.ToggleGroupCheckState(checkbox.id, checkboxGroup);
451
452 // update the label of the dropdown menu
453 SetDropdownMenuLabel(memberOptionsMenu, memberOptionsDropdown);
454
455 // update the display of the document's items that are dependent on the member options settings
456 memberlistHandler();
457}
458
459function SetMemberFrameworks(checkbox)
460{
461 // toggle the check state of the checkbox that was clicked
462 memberFrameworksMenu.ToggleCheckState(checkbox.id);
463
464 // update the label of the dropdown menu
465 SetDropdownMenuLabel(memberFrameworksMenu, memberFrameworksDropdown);
466
467 // update the display of the document's items that are dependent on the member platforms settings
468 memberlistHandler();
469}
470
471function DisplayFilteredMembers()
472{
473 var iAllMembers = document.getElementsByTagName("tr");
474 var i;
475
476 for(i = 0; i < iAllMembers.length; ++i)
477 {
478 if (((iAllMembers[i].notSupportedOnXna == "true") && (netXnaMembersOnly == "on")) ||
479 ((iAllMembers[i].getAttribute("name") == "inheritedMember") && (inheritedMembers == "off")) ||
480 ((iAllMembers[i].getAttribute("notSupportedOn") == "netcf") && (netcfMembersOnly == "on")))
481 iAllMembers[i].style.display = "none";
482 else
483 iAllMembers[i].style.display = "";
484 }
485
486 // protected members are in separate collapseable sections in vs2005, so expand or collapse the sections
487 ExpandCollapseProtectedMemberSections();
488}
489
490function ExpandCollapseProtectedMemberSections()
491{
492 var imgElements = document.getElementsByName("toggleSwitch");
493 var i;
494 // Family
495 for(i = 0; i < imgElements.length; ++i)
496 {
497 if(imgElements[i].id.indexOf("protected", 0) == 0)
498 {
499 if ((sectionStates[imgElements[i].id] == "e" && protectedMembers == "off") ||
500 (sectionStates[imgElements[i].id] == "c" && protectedMembers == "on"))
501 {
502 ExpandCollapse(imgElements[i]);
503 }
504 }
505 }
506}
507
508/*
509**********
510********** End Members Options Filtering
511**********
512*/
513
514
515/*
516**********
517********** Begin Expand/Collapse
518**********
519*/
520
521// expand or collapse a section
522function ExpandCollapse(imageItem)
523{
524 if (sectionStates[imageItem.id] == "e")
525 CollapseSection(imageItem);
526 else
527 ExpandSection(imageItem);
528
529 SetCollapseAll();
530}
531
532// expand or collapse all sections
533function ExpandCollapseAll(imageItem)
534{
535 var collapseAllImage = document.getElementById("collapseAllImage");
536 var expandAllImage = document.getElementById("expandAllImage");
537 if (imageItem == null || collapseAllImage == null || expandAllImage == null) return;
538 noReentry = true; // Prevent entry to OnLoadImage
539
540 var imgElements = document.getElementsByName("toggleSwitch");
541 var i;
542 var collapseAll = (imageItem.src == collapseAllImage.src);
543 if (collapseAll)
544 {
545 imageItem.src = expandAllImage.src;
546 imageItem.alt = expandAllImage.alt;
547
548 for (i = 0; i < imgElements.length; ++i)
549 {
550 CollapseSection(imgElements[i]);
551 }
552 }
553 else
554 {
555 imageItem.src = collapseAllImage.src;
556 imageItem.alt = collapseAllImage.alt;
557
558 for (i = 0; i < imgElements.length; ++i)
559 {
560 ExpandSection(imgElements[i]);
561 }
562 }
563 SetAllSectionStates(collapseAll);
564 SetToggleAllLabel(collapseAll);
565
566 noReentry = false;
567}
568
569function ExpandCollapse_CheckKey(imageItem, eventObj)
570{
571 if(eventObj.keyCode == 13)
572 ExpandCollapse(imageItem);
573}
574
575function ExpandCollapseAll_CheckKey(imageItem, eventObj)
576{
577 if(eventObj.keyCode == 13)
578 ExpandCollapseAll(imageItem);
579}
580
581function SetAllSectionStates(collapsed)
582{
583 for (var sectionId in sectionStates)
584 sectionStates[sectionId] = (collapsed) ? "c" : "e";
585}
586
587function ExpandSection(imageItem)
588{
589 noReentry = true; // Prevent re-entry to OnLoadImage
590 try
591 {
592 var collapseImage = document.getElementById("collapseImage");
593 imageItem.src = collapseImage.src;
594 imageItem.alt = collapseImage.alt;
595
596 imageItem.parentNode.parentNode.nextSibling.style.display = "";
597 sectionStates[imageItem.id] = "e";
598 }
599 catch (e)
600 {
601 }
602 noReentry = false;
603}
604
605function CollapseSection(imageItem)
606{
607 noReentry = true; // Prevent re-entry to OnLoadImage
608 var expandImage = document.getElementById("expandImage");
609 imageItem.src = expandImage.src;
610 imageItem.alt = expandImage.alt;
611 imageItem.parentNode.parentNode.nextSibling.style.display = "none";
612 sectionStates[imageItem.id] = "c";
613 noReentry = false;
614}
615
616function AllCollapsed()
617{
618 var imgElements = document.getElementsByName("toggleSwitch");
619 var allCollapsed = true;
620 var i;
621
622 for (i = 0; i < imgElements.length; i++) allCollapsed = allCollapsed && (sectionStates[imgElements[i].id] == "c");
623
624 return allCollapsed;
625}
626
627function SetCollapseAll()
628{
629 var imageElement = document.getElementById("toggleAllImage");
630 if (imageElement == null) return;
631
632 var allCollapsed = AllCollapsed();
633 if (allCollapsed)
634 {
635 var expandAllImage = document.getElementById("expandAllImage");
636 if (expandAllImage == null) return;
637 imageElement.src = expandAllImage.src;
638 imageElement.alt = expandAllImage.alt;
639 }
640 else
641 {
642 var collapseAllImage = document.getElementById("collapseAllImage");
643 if (collapseAllImage == null) return;
644 imageElement.src = collapseAllImage.src;
645 imageElement.alt = collapseAllImage.alt;
646 }
647
648 SetToggleAllLabel(allCollapsed);
649}
650
651function SetToggleAllLabel(allCollapsed)
652{
653 var collapseLabelElement = document.getElementById("collapseAllLabel");
654 var expandLabelElement = document.getElementById("expandAllLabel");
655
656 if (collapseLabelElement == null || expandLabelElement == null) return;
657
658 if (allCollapsed)
659 {
660 collapseLabelElement.style.display = "none";
661 expandLabelElement.style.display = "inline";
662 }
663 else
664 {
665 collapseLabelElement.style.display = "inline";
666 expandLabelElement.style.display = "none";
667 }
668}
669
670function SaveSections()
671{
672 try
673 {
674 var states = "";
675
676 for (var sectionId in sectionStates) states += sectionId + ":" + sectionStates[sectionId] + ";";
677
678 Save("SectionStates", states.substring(0, states.length - 1));
679 }
680 catch (e)
681 {
682 }
683
684}
685
686function OpenSection(imageItem)
687{
688 if (sectionStates[imageItem.id] == "c") ExpandCollapse(imageItem);
689}
690
691/*
692**********
693********** End Expand/Collapse
694**********
695*/
696
697
698
699/*
700**********
701********** Begin Copy Code
702**********
703*/
704
705function CopyCode(key)
706{
707 var trElements = document.getElementsByTagName("tr");
708 var i;
709 for(i = 0; i < trElements.length; ++i)
710 {
711 if(key.parentNode.parentNode.parentNode == trElements[i].parentNode)
712 {
713 if (window.clipboardData)
714 {
715 // the IE-manner
716 window.clipboardData.setData("Text", trElements[i].innerText);
717 }
718 else if (window.netscape)
719 {
720 // Gives unrestricted access to browser APIs using XPConnect
721 try
722 {
723 netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
724 }
725 catch(e)
726 {
727 alert("Universal Connect was refused, cannot copy to " +
728 "clipboard. Go to about:config and set " +
729 "signed.applets.codebase_principal_support to true to " +
730 "enable clipboard support.");
731 return;
732 }
733
734 // Creates an instance of nsIClipboard
735 var clip = Components.classes['@mozilla.org/widget/clipboard;1'].createInstance(Components.interfaces.nsIClipboard);
736 if (!clip) return;
737
738 // Creates an instance of nsITransferable
739 var trans = Components.classes['@mozilla.org/widget/transferable;1'].createInstance(Components.interfaces.nsITransferable);
740 if (!trans) return;
741
742 // register the data flavor
743 trans.addDataFlavor('text/unicode');
744
745 // Create object to hold the data
746 var str = new Object();
747
748 // Creates an instance of nsISupportsString
749 var str = Components.classes["@mozilla.org/supports-string;1"].createInstance(Components.interfaces.nsISupportsString);
750
751 //Assigns the data to be copied
752 var copytext = trElements[i].textContent;
753 str.data = copytext;
754
755 // Add data objects to transferable
756 trans.setTransferData("text/unicode",str,copytext.length*2);
757 var clipid = Components.interfaces.nsIClipboard;
758 if (!clip) return false;
759
760 // Transfer the data to clipboard
761 clip.setData(trans,null,clipid.kGlobalClipboard);
762 }
763 }
764 }
765}
766
767function ChangeCopyCodeIcon(key)
768{
769 var i;
770 var imageElements = document.getElementsByName("ccImage")
771 for(i=0; i<imageElements.length; ++i)
772 {
773 if(imageElements[i].parentNode == key)
774 {
775 if(imageElements[i].src == copyImage.src)
776 {
777 imageElements[i].src = copyHoverImage.src;
778 imageElements[i].alt = copyHoverImage.alt;
779 key.className = 'copyCodeOnHover';
780 }
781 else
782 {
783 imageElements[i].src = copyImage.src;
784 imageElements[i].alt = copyImage.alt;
785 key.className = 'copyCode';
786 }
787 }
788 }
789}
790
791function CopyCode_CheckKey(key, eventObj)
792{
793 if(eventObj.keyCode == 13)
794 CopyCode(key);
795}
796
797/*
798**********
799********** End Copy Code
800**********
801*/
802
803
804/*
805**********
806********** Begin Maintain Scroll Position
807**********
808*/
809
810function loadAll(){
811 try
812 {
813 scrollPos = allHistory.getAttribute("Scroll");
814 }
815 catch(e){}
816}
817
818function saveAll(){
819 try
820 {
821 allHistory.setAttribute("Scroll", mainSection.scrollTop);
822 }
823 catch(e){}
824}
825
826/*
827**********
828********** End Maintain Scroll Position
829**********
830*/
831
832
833/*
834**********
835********** Begin Send Mail
836**********
837*/
838
839function formatMailToLink(anchor)
840{
841 var release = "Release: " + anchor.doc_Release;
842 var topicId = "Topic ID: " + anchor.doc_TopicID;
843 var topicTitle = "Topic Title: " + anchor.doc_TopicTitle;
844 var url = "URL: " + document.URL;
845 var browser = "Browser: " + window.navigator.userAgent;
846
847 var crlf = "%0d%0a";
848 var body = release + crlf + topicId + crlf + topicTitle + crlf + url + crlf + browser + crlf + crlf + "Comments:" + crlf + crlf;
849
850 anchor.href = anchor.href + "&body=" + body;
851}
852
853/*
854**********
855********** End Send Mail
856**********
857*/
858
859
860/*
861**********
862********** Begin Persistence
863**********
864*/
865
866var globals;
867
868// get global vars from persistent store
869function GetGlobals()
870{
871 var tmp;
872
873 // Try to get VS implementation
874 try { tmp = window.external.Globals; }
875 catch (e) { tmp = null; }
876
877 // Try to get DExplore implementation
878 try { if (tmp == null) tmp = window.external.GetObject("DTE", "").Globals; }
879 catch (e) { tmp = null; }
880
881 return tmp;
882}
883
884function Load(key)
885{
886 try
887 {
888 return globals.VariableExists(key) ? globals.VariableValue(key) : null;
889 }
890 catch (e)
891 {
892 return null;
893 }
894}
895
896function Save(key, value)
897{
898 try
899 {
900 globals.VariableValue(key) = value;
901 globals.VariablePersists(key) = true;
902 }
903 catch (e)
904 {
905 }
906}
907
908/*
909**********
910********** End Persistence
911**********
912*/
913
914/* This is the part for Glossary popups */
915// The method is called when the user positions the mouse cursor over a glossary term in a document.
916// Current implementation assumes the existence of an associative array (g_glossary).
917// The keys of the array correspond to the argument passed to this function.
918
919var bGlossary=true;
920var oDialog;
921var oTimeout="";
922var oTimein="";
923var iTimein=.5;
924var iTimeout=30;
925var oLastNode;
926var oNode;
927var bInit=false;
928var aTerms=new Array();
929
930// Called from mouseover and when the contextmenu behavior fires oncontextopen.
931function clearDef(eventObj){
932 if(eventObj){
933 var elem;
934 if(document.all) elem = eventObj.toElement;
935 else elem = eventObj.relatedTarget;
936 if(elem!=null || elem!="undefined"){
937 if(typeof(oTimein)=="number"){
938 window.clearTimeout(oTimein);
939 }
940 if(oDialog.dlg_status==true){
941 hideDef();
942 }
943 }
944 }
945}
946function hideDef(eventObj){
947 window.clearTimeout(oTimeout);
948 oTimeout="";
949 oDialog.style.display="none";
950 oDialog.dlg_status=false;
951}
952function showDef(oSource){
953 if(bInit==false){
954 glossaryInit();
955 bInit=true;
956 }
957 if(bGlossary==true){
958 if(typeof(arguments[0])=="object"){
959 oNode=oSource;
960 }
961 else{
962 if(document.all) oNode = eventObj.srcElement;
963 else oNode = eventObj.target;
964 }
965 var bStatus=oDialog.dlg_status; // BUGBUG: oDialog is null.
966 if((oLastNode!=oNode)||(bStatus==false)){
967 if((typeof(oTimein)=="number")&& eventObj){
968
969 var elem;
970 if(document.all) elem = eventObj.fromElement;
971 else elem = eventObj.relatedTarget;
972
973 if( elem != null || elem != "undefined")
974 window.clearTimeout(oTimein);
975 }
976 oTimein=window.setTimeout("openDialog(oNode)",iTimein*1000);
977 }
978 }
979}
980
981
982
983function glossaryInit(){
984 oDialog=fnCreateDialog(150,50);
985}
986
987function navigateTerm(eventObj){
988 var oNode;
989 if(document.all) oNode = eventObj.srcElement;
990 else oNode = eventObj.target;
991
992 var iTermID=oNode.termID;
993 if(oNode!=aTerms[iTermID]){
994 var iAbsTop=getAbsoluteTop(aTerms[iTermID]);
995 if(iAbsTop<document.body.scrollTop){
996 window.scrollTo(document.body.scrollLeft,getAbsoluteTop(aTerms[iTermID]));
997 }
998 openDialog(aTerms[iTermID]);
999 }
1000}
1001function disableGlossary(eventObj){
1002 if(bGlossary==true){
1003 if(document.all) eventObj.srcElement.innerText="Enable Automatic Glossary";
1004 else eventObj.target.innerText="Enable Automatic Glossary";
1005 bGlossary=false;
1006 hideDef();
1007 }
1008 else{
1009 if(document.all) eventObj.srcElement.innerText="Disable Automatic Glossary";
1010 else eventObj.target.innerText="Disable Automatic Glossary";
1011 bGlossary=true;
1012 }
1013}
1014function openGlossary(){
1015
1016}
1017function fnSetMenus(eventObj){
1018 var oNode;
1019 if(document.all) oNode = eventObj.srcElement;
1020 else oNode = eventObj.target;
1021
1022 var oMenu=oNode.createMenu("SPAN","G_RID");
1023 var oSubItem1=oNode.createMenuItem("Glossary",fnStub,oMenu,true);
1024 document.body.createMenuItem("Open External Glossary",openGlossary,oSubItem1.subMenu);
1025 document.body.createMenuItem("Disable Automatic Glossary",disableGlossary,oSubItem1.subMenu);
1026 for(var i=0;i<aTerms.length;i++){
1027 var oItem=document.body.createMenuItem(aTerms[i].innerText,navigateTerm,oMenu);
1028 oItem.termID=i;
1029 }
1030}
1031// This is a bogus stub. It should be sniffed out rather than added in.
1032function fnStub(){
1033
1034}
1035function fnAttachMenus(aTips){
1036 // This walk is only necessary for the context menu.
1037 var aTips=document.getElementsByTagName("SPAN");
1038 for(var i=0;i<aTips.length;i++){
1039 var oNode=aTips[i];
1040 if(oNode.getAttribute("G_RID")){
1041 var sTerm=oNode.getAttribute("G_RID");
1042 if(typeof(g_glossary[sTerm])=="string"){
1043 // Removed client-side scripting to add events. This entire process should be singled out for IE 5 and later .. and, its only for the context menu.
1044 aTerms[aTerms.length]=oNode;
1045 }
1046 }
1047 }
1048 if(oBD.majorVer>=5){
1049 document.body.addBehavior(gsContextMenuPath);
1050 document.body.onbehaviorready="fnSetMenus()";
1051 document.body.oncontextopen="clearDef()";
1052 }
1053
1054}
1055// Called by showDef. The showDef function sniffs for initialization.
1056function openDialog(oNode,x,y){
1057 var bStatus=oDialog.dlg_status; // BUGBUG: This code assumes that oDialog has been initialized
1058 if(bStatus==false){
1059 oDialog.dlg_status=true;
1060 oDialog.style.display="block";
1061 }
1062 else{
1063 if(typeof(oTimeout)=="number"){
1064 window.clearTimeout(oTimeout);
1065 }
1066 }
1067
1068 var sTerm=oNode.getAttribute("G_RID");
1069 var oDef=oNode.children(0);
1070 var sDef=oDef.text;
1071 sDef=sDef.substr(4,sDef.length-7); //Strips the html comment markers from the definition.
1072 oDialog.innerHTML=sDef
1073
1074
1075 //oDialog.innerHTML=g_glossary[sTerm];
1076
1077 var iScrollLeft=document.body.scrollLeft;
1078 var iScrollTop=document.body.scrollTop;
1079 var iOffsetLeft=getAbsoluteLeft(oNode)// - iScrollLeft;
1080 var iOffsetWidth=oNode.offsetWidth;
1081 var oParent=oNode.parentNode;
1082 var iOffsetParentLeft=getAbsoluteLeft(oParent);
1083 var iOffsetTop=getAbsoluteTop(oNode); //- iScrollTop;
1084 var iOffsetDialogWidth=oDialog.offsetWidth;
1085
1086
1087 if((iOffsetLeft + iOffsetWidth) > (iOffsetParentLeft + oParent.offsetWidth)){
1088 iOffsetLeft=iOffsetParentLeft;
1089 if(iOffsetLeft - iOffsetDialogWidth>0){
1090 iOffsetTop+=oNode.offsetHeight;
1091 }
1092 }
1093 var iLeft=0;
1094 var iTop=0;
1095 if((iOffsetLeft + iOffsetWidth - iScrollLeft + iOffsetDialogWidth) < document.body.offsetWidth ){
1096 iLeft=iOffsetLeft + iOffsetWidth;
1097 }
1098 else{
1099 if(iOffsetLeft - iOffsetDialogWidth>0){
1100 iLeft=iOffsetLeft - iOffsetDialogWidth;
1101 }
1102 else{
1103 iLeft=iOffsetParentLeft;
1104 }
1105 }
1106 if(iOffsetTop - iScrollTop<oDialog.offsetHeight){
1107 iTop=iOffsetTop + oNode.offsetHeight;
1108 }
1109 else{
1110 iTop=iOffsetTop - oDialog.offsetHeight;
1111 }
1112 oDialog.style.top=iTop;
1113 oDialog.style.left=iLeft;
1114 oTimeout=window.setTimeout("hideDef()",iTimeout*1000);
1115}
1116function getAbsoluteTop(oNode){
1117 var oCurrentNode=oNode;
1118 var iTop=0;
1119 while(oCurrentNode.tagName!="BODY"){
1120 iTop+=oCurrentNode.offsetTop;
1121 oCurrentNode=oCurrentNode.offsetParent;
1122 }
1123 return iTop;
1124}
1125function getAbsoluteLeft(oNode){
1126 var oCurrentNode=oNode;
1127 var iLeft=0;
1128 while(oCurrentNode.tagName!="BODY"){
1129 iLeft+=oCurrentNode.offsetLeft;
1130 oCurrentNode=oCurrentNode.offsetParent;
1131 }
1132 return iLeft;
1133}
1134function fnCreateDialog(iWidth,iHeight){
1135 document.body.insertAdjacentHTML("BeforeEnd","<DIV></DIV>");
1136 oNewDialog=document.body.children(document.body.children.length-1);
1137 oNewDialog.className="clsTooltip";
1138 oNewDialog.style.width=iWidth;
1139 oNewDialog.dlg_status=false;
1140 return oNewDialog;
1141}
1142
1143function sendfeedback(subject, id,alias){
1144 var rExp = /\"/gi;
1145 var url = location.href;
1146 // Need to replace the double quotes with single quotes for the mailto to work.
1147 var rExpSingleQuotes = /\'\'"/gi;
1148 var title = document.getElementsByTagName("TITLE")[0].innerText.replace(rExp, "''");
1149 location.href = "mailto:" + alias + "?subject=" + subject + title + "&body=Topic%20ID:%20" + id + "%0d%0aURL:%20" + url + "%0d%0a%0d%0aComments:%20";
1150}
Note: See TracBrowser for help on using the repository browser.