'+dir+deflist[i][1]+'
\n';
}
} else {
bodyhtml+='Aucune définition
\n';
}
bodyhtml+='
Référencé '+constdata[3]+' fois
\n';
body.innerHTML=bodyhtml;
gwPopup(e, 'const-popup');
}
/**
* Display the hover-over-function-require (or include) popup
*/
function reqPopup(e, name, baseurl) {
gwCloseActive();
var title=document.getElementById('req-title');
var body=document.getElementById('req-body');
title.innerHTML=name;
body.innerHTML='Source | '
+'Résumé';
gwPopup(e, 'req-popup');
}
/**
* Handle setting up the navigation frame, if the user
* has the option turned on in a cookie
*/
function handleNavFrame(relbase, subdir, filename) {
var line = '';
var navstatus=gwGetCookie('xrefnav');
if (navstatus!='off' && (parent.name!='phpxref' || parent==self)) {
if (subdir!='') { subdir+='/'; }
var x=parent.location.toString().indexOf('#');
if (x != -1) { /* Preserve the line number referenced in the parent */
line = parent.location.toString().substr(x);
}
parent.location=relbase+'nav'+ext+'?'+subdir+filename+line;
} else if (parent.nav && parent.nav.open_branch) {
parent.nav.open_branch(subdir);
}
}
/**
* Fetch a cookie by name
*/
function gwGetCookie(name) {
var cookies=document.cookie;
var offset; var endpoint;
name = cookiekey + '-' + name;
if ((offset=cookies.indexOf(name))==-1)
return null;
if ((endpoint=cookies.indexOf(';', offset))==-1)
endpoint=cookies.length;
var value=unescape(cookies.substring(offset+name.length+1, endpoint));
return value;
}
/**
* Set an individual cookie by name and value
*/
function gwSetCookie(name, value) {
var expire = new Date();
expire.setTime( expire.getTime() + 86400*365*1000 );
name = cookiekey + '-' + name;
document.cookie=name+'='+escape(value)+';path=/;expires='+expire.toGMTString();
}
/**
* Switch on the navigation frame
*/
function navOn() {
gwSetCookie('xrefnav','on');
self.location.reload();
}
/**
* Turn off the navigation frame
*/
function navOff() {
gwSetCookie('xrefnav','off');
parent.location.href=self.location.href;
}
/**
* Escape search strings
*/
function pesc(str) {
str=str.replace(/^(con|prn|aux|clock\\$|nul|lpt\\d|com\\d)\$/i, "-\$1");
str=str.replace(/^(con|prn|aux|clock\\$|nul|lpt\\d|com\\d)\\./i, "-\$1.");
return str;
}
/**
* Run a 'search'
*/
function jump() {
if (document.search.classname.value.length) {
jumpClass(document.search.classname.value);
}
if (document.search.funcname.value.length) {
jumpFunction(document.search.funcname.value);
}
if (document.search.varname.value.length) {
jumpVariable(document.search.varname.value);
}
if (document.search.constname.value.length) {
jumpConstant(document.search.constname.value);
}
if (document.search.tablename.value.length) {
jumpTable(document.search.tablename.value);
}
return false;
}
/**
* Jump to a function reference page, and log in the history log
*/
function jumpFunction(target) {
var target=target.replace(/[()]/g,'');
target=target.toLowerCase();
logFunction(target);
window.location=relbase+'_functions/'+escape(escape(pesc(target)))+ext;
}
/**
* Jump to a class reference page, and log in the history log
*/
function jumpClass(target) {
var target=target.replace(/[()]/g,'');
target=target.toLowerCase();
logClass(target);
window.location=relbase+'_classes/'+escape(escape(pesc(target)))+ext;
}
/**
* Jump to a variable reference page, and log in the history log
*/
function jumpVariable(target) {
var target=target.replace(/[\$]/g,'');
logVariable(target);
window.location=relbase+'_variables/'+escape(escape(pesc(target)))+ext;
}
/**
* Jump to a constant reference page, and log in the history log
*/
function jumpConstant(target) {
var target=target.toUpperCase();
logConstant(target);
window.location=relbase+'_constants/'+escape(escape(pesc(target)))+ext;
}
/**
* Jump to a table reference page, and log in the history log
*/
function jumpTable(target) {
var target=toLowerCase();
logTable(target);
window.location=relbase+'_tables/'+escape(escape(pesc(target)))+ext;
}
/**
* Log a function access in the history log
* If urltarget is supplied, then the specific URL where
* that function is defined is logged with the function name
*/
function logFunction(target, urltarget) {
var uritarget = '';
if (urltarget)
uritarget = ';' + escape(urltarget)
addToSearchList('F' + escape(target) + uritarget);
return true;
}
/**
* Log a class access in the history log
*/
function logClass(target, urltarget) {
var uritarget = '';
if (urltarget)
uritarget = ';' + escape(urltarget)
addToSearchList('C' + escape(target) + uritarget);
return true;
}
/**
* Log a variable access in the history log
*/
function logVariable(target, urltarget) {
var uritarget = '';
if (urltarget)
uritarget = ';' + escape(urltarget)
addToSearchList('V' + escape(target) + uritarget);
return true;
}
/**
* Log a constant access in the history log
*/
function logConstant(target, urltarget) {
var uritarget = '';
if (urltarget)
uritarget = ';' + escape(urltarget)
addToSearchList('A' + escape(target) + uritarget);
return true;
}
/**
* Log a table access in the history log
*/
function logTable(target) {
addToSearchList('T' + escape(target));
return true;
}
/**
* Get an array of previous searches/lookups
*/
function getSearchList() {
var searchlist=gwGetCookie('xrefsearch');
if (!searchlist) {
return false;
}
return searchlist.split(',');
}
/**
* Add a new entry to the search history log
*/
function addToSearchList(item) {
if (typeof Array.prototype.unshift == 'undefined') {
return false;
}
item.replace(/[^\w_]+/gi, '');
if (!item.length)
return false; // no point adding an empty string
var searchlist=getSearchList();
if (!searchlist) {
searchlist = Array();
}
// Remove duplicate entries
for (var i=searchlist.length-1; i>=0; i--) {
if (searchlist[i] == item) {
searchlist.splice(i,1);
}
}
searchlist.unshift(item); // push newest onto the beginning of the list
if (searchlist.length > MAX_SEARCH_ITEMS) {
searchlist.splice(MAX_SEARCH_ITEMS);
}
gwSetCookie('xrefsearch', searchlist.join(','));
return true;
}
/**
* Calculate the absolute X offset of an html element
*/
function elementX(el) {
var x = el.offsetLeft;
var parent = el.offsetParent;
while (parent) {
x += parent.offsetLeft;
parent = parent.offsetParent;
}
return x;
}
/**
* Calculate the absolute Y offset of an html element
*/
function elementY(el) {
var y = el.offsetTop;
var parent = el.offsetParent;
while (parent != null) {
y += parent.offsetTop;
parent = parent.offsetParent;
}
return y;
}
/**
* Display a popup containing the user's most recent searches
*/
function showSearchPopup() {
gwCloseActive();
var title=document.getElementById('searchpopup-title');
var body=document.getElementById('searchpopup-body');
var searchlist=getSearchList();
title.innerHTML='accès à l\'historique';
if (!searchlist) {
body.innerHTML='(Aucune entrée enregistrée)
';
} else {
var content = '';
for (var i=0; i1 ? unescape(parse[1]) : '';
var type = item.charAt(0);
var ref = item.substr(1);
switch (type) {
case 'F':
var href = "javascript:jumpFunction('" + ref + "')"
var name = ref + "()";
var styleclass = 'function';
break;
case 'C':
var href = "javascript:jumpClass('" + ref + "')"
var name = ref;
var styleclass = "class";
break;
case 'V':
var href = "javascript:jumpVariable('" + ref + "')"
var name = '$' + ref;
var styleclass = "var";
break;
case 'A':
var href = "javascript:jumpConstant('" + ref + "')"
var name = ref;
var styleclass = "const";
break;
case 'T':
var href = "javascript:jumpTable('" + ref + "')"
var name = 'SQL: ' + ref;
var styleclass = '';
break;
default:
continue; // unknown type
}
content += '';
if (itemsource) {
content += '» | ';
} else {
content += '» | ';
}
content += '' + name + ' |
';
}
content += '
';
body.innerHTML = content;
}
position=document.getElementById('funcsearchlink');
gwPopup(null, 'search-popup', true);
}
function hilite(itemid) {
/* only mozilla and IE are really supported here atm. */
try {
var agt=navigator.userAgent.toLowerCase();
if (agt.indexOf('gecko') != -1) {
document.getElementById('hilight').sheet.insertRule('.it'+itemid+' { background-color: #0f0; }', 0);
} else {
document.styleSheets["hilight"].addRule('.it'+itemid, 'background-color: #0f0', 0);
}
} catch(e) { } /* swallow any browser incompatibility errors */
}
function lolite() {
try {
var agt=navigator.userAgent.toLowerCase();
if (agt.indexOf('gecko') != -1) {
document.getElementById('hilight').sheet.deleteRule(0);
} else {
document.styleSheets["hilight"].removeRule(0);
}
} catch(e) { }
}