Menu

[d6b61f]: / Help / main.js  Maximize  Restore  History

Download this file

165 lines (146 with data), 5.5 kB

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
var ShowButton = "► ";
var HideButton = "▼ ";
var TableOfContents = [
"Functional Help",[
{text:"Editing",href:"./Subjects/Editing.htm"},
{text:"Compiling",href:"./Subjects/Compiling.htm"},
{text:"Debugging",href:"./Subjects/Debugging.htm"},
{text:"Profiling",href:"./Subjects/Profiling.htm"},
],
"Interface Help",[
"Dialog Windows",[
{text:"Compiler Options",href:"./Interface/Dialog Windows/Compiler Options/index.htm"},[
{text:"General",href:"./Interface/Dialog Windows/Compiler Options/General.htm"},
{text:"Settings",href:"./Interface/Dialog Windows/Compiler Options/Settings.htm"},
{text:"Directories",href:"./Interface/Dialog Windows/Compiler Options/Directories.htm"},
{text:"Programs",href:"./Interface/Dialog Windows/Compiler Options/Programs.htm"},
{text:"Makefile",href:"./Interface/Dialog Windows/Compiler Options/Makefile.htm"},
],
{text:"Profile Analysis",href:"./Interface/Dialog Windows/Profile Analysis/index.htm"},[
{text:"Flat Output",href:"./Interface/Dialog Windows/Profile Analysis/Flat Output.htm"},
{text:"Call Graph",href:"./Interface/Dialog Windows/Profile Analysis/Call Graph.htm"},
{text:"Profiling Options",href:"./Interface/Dialog Windows/Profile Analysis/Profiling Options.htm"},
],
"Project Options",[
{text:"General",href:"./Interface/Dialog Windows/Project Options/General.htm"},
{text:"Files",href:"./Interface/Dialog Windows/Project Options/Files.htm"},
{text:"Compiler",href:"./Interface/Dialog Windows/Project Options/Compiler.htm"},
{text:"Parameters",href:"./Interface/Dialog Windows/Project Options/Parameters.htm"},
{text:"Directories",href:"./Interface/Dialog Windows/Project Options/Directories.htm"},
{text:"Build Options",href:"./Interface/Dialog Windows/Project Options/Build Options.htm"},
{text:"Makefile",href:"./Interface/Dialog Windows/Project Options/Makefile.htm"},
{text:"Version Info",href:"./Interface/Dialog Windows/Project Options/Version Info.htm"},
],
],
"Menus",[
{text:"File",href:"./Interface/Menus/File.htm"},
{text:"Edit",href:"./Interface/Menus/Edit.htm"},
{text:"Search",href:"./Interface/Menus/Search.htm"},
{text:"View",href:"./Interface/Menus/View.htm"},
{text:"Project",href:"./Interface/Menus/Project.htm"},
]
],
"Frequenty Asked Questions",[
{text:"Compiler",href:"./FAQ/Compiler.htm"},
{text:"Editor",href:"./FAQ/Editor.htm"},
{text:"Environment",href:"./FAQ/Environment.htm"},
{text:"Versions",href:"./FAQ/Versions.htm"},
]
];
function OnTableOfContentsLinkClick(e) {
var event = GetEvent(e); // cross browser meuk
// Don't follow link
event.preventDefault();
// Load iframe
$("#Content").attr("src",event.target.href);
// Set caption
document.title = event.target.text;
}
function OnHiderClick(e) {
var event = GetEvent(e); // cross browser meuk
var target = GetTarget(event); // idem
var parent = target.parentElement;
var parentsublist = parent.nextElementSibling;
if(target.innerHTML == ShowButton) {
target.innerHTML = HideButton;
parentsublist.style.display = "";
} else {
target.innerHTML = ShowButton;
parentsublist.style.display = "none";
}
}
function CreateTableOfContentsRecurse(array) {
var result = "<ul>";
for(var i = 0;i < array.length;i++) {
if(array[i] instanceof Array) {
// add folding mark inside <li>Caption</li>
var index = result.lastIndexOf("<li>");
// this li will not have a CSS based bullet point
result = result.substr(0,index+3) + " class='ChildLi'" + result.substr(index+3);
// repeat search for last "<li "
var newopeningtag = "<li class='ChildLi'>";
index = result.lastIndexOf(newopeningtag);
// Add folder before caption
result = result.substr(0,index + newopeningtag.length) + "<span class='Hider' onclick='OnHiderClick(event)'>" + HideButton + "</span>" + result.substr(index + newopeningtag.length);
// Insert children elements
result += CreateTableOfContentsRecurse(array[i]);
} else if(array[i] instanceof Object) { // assume a link
result += "<li><a class='TableOfContentsLink' href='" + array[i].href + "'>" + array[i].text + "</a></li>";
} else {
result += "<li>" + array[i] + "</li>"; // assume string
}
}
result += "</ul>";
return result;
}
window.onload = function() {
// Fill table of contents
var html = CreateTableOfContentsRecurse(TableOfContents);
$("#TableOfContents").html(html);
// Redirect table of contents links
$('.TableOfContentsLink').click(OnTableOfContentsLinkClick);
// Redirect content links
if(window.attachEvent) {
window.attachEvent("onmessage",OnMessage); // Internet Explorer
} else {
window.addEventListener("message", OnMessage, false); // Opera/Mozilla/Webkit
}
}
// handy function for end users
function OpenPage(caption,path) {
PostParentMessage(caption + '||' + path);
}
function PostParentMessage(text) {
window.parent.postMessage(text,'*');
}
// Handle content links here
function OnMessage(e) {
var parts = e.data.split('||');
if(parts.length == 2) {
// Set caption
document.title = parts[0];
// Load iframe
$("#Content").attr("src",parts[1]);
}
}
function GetEvent(e) {
if(e !== undefined) {
return e;
} else if(window.event !== undefined) {
return window.event;
} else {
return null;
}
}
function GetTarget(e) {
if(e.target !== undefined) {
return e.target;
} else if(e.srcElement !== undefined) {
return e.srcElement;
} else {
return null;
}
}
function GetEventTarget(e) {
return GetTarget(GetEvent(e));
}
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.