')
.appendTo($('body'))
.click(themerToggle);
$('#themer-popup')
.draggable({
opacity: .6,
handle: $('#themer-popup .topper')
})
//.prepend(strs.toggle_throbber)
;
// close box
$('#themer-popup .topper .close').click(function() {
themerToggle();
});
});
}
/**
* Known issue: IE does NOT support outline css property.
* Solution: use another browser
*/
function themerHilight(obj) {
// hilight the current object (and un-highlight the last)
if (lastObj != false) {
$(lastObj).css('outline', 'none').attr('thmr_curr', 0);
}
$(obj).css('outline', '#999 solid 3px').attr('thmr_curr', 1);
lastObj = obj;
}
function themerDoIt(obj) {
if (thmrInPop(obj)) {
return true;
}
// start throbber
//$('#themer-popup img.throbber').show();
var objs = thmrFindParents(obj);
if (objs.length) {
themerHilight(objs[0]);
thmrRebuildPopup(objs);
}
return false;
}
function spanify() {
$('span.thmr_call')
.each(function () {
// make spans around block elements into block elements themselves
var kids = $(this).children();
for(i=0;i 0) {
do {
if (blocks[i] === obj.tagName) {
return true;
}
} while (i--);
}
}
return false;
}
function thmrRefreshCollapse() {
$('#themer-popup .devel-obj-output dt').each(function() {
$(this).toggle(function() {
$(this).parent().children('dd').show();
}, function() {
$(this).parent().children('dd').hide();
});
});
}
/**
* Rebuild the popup
*
* @param objs
* The array of the current object and its parents. Current object is first element of the array
*/
function thmrRebuildPopup(objs) {
// rebuild the popup box
var id = objs[0].id;
// vars is the settings array element for this theme item
var vars = Drupal.settings[id];
// strs is the translatable strings
var strs = Drupal.settings.thmrStrings;
var type = vars.type;
var key = vars.name;
// clear out the initial "click on any element" starter text
$('#themer-popup div.starter').empty();
if (type == 'func') {
// populate the function name
$('#themer-popup dd.key').empty().prepend(''+ key +'()');
$('#themer-popup dt.key-type').empty().prepend(strs.function_called);
}
else {
// populate the template name
$('#themer-popup dd.key').empty().prepend(key);
$('#themer-popup dt.key-type').empty().prepend(strs.template_called);
}
// parents
var parents = '';
parents = strs.parents +' ';
for(i=1;i'+ pvars.name +' ';
}
parents += '';
// stick the parents spans in the #parents div
$('#themer-popup #parents').empty().prepend(parents);
$('#themer-popup span.parent').click(function() {
// make them clickable
$('#'+ $(this).attr('trig')).each(function() { themerDoIt(this) });
})
.hover(function() {
// make them highlight their element on mouseover
$('#'+ $(this).attr('trig')).trigger('mouseover');
},
function() {
// and unhilight on mouseout
$('#'+ $(this).attr('trig')).trigger('mouseout');
});
if (vars == undefined) {
// if there's no item in the settings array for this element
$('#themer-popup dd.candidates').empty();
$('#themer-popup dd.preprocessors').empty();
$('#themer-popup div.attributes').empty();
$('#themer-popup div.used').empty();
$('#themer-popup div.duration').empty();
}
else {
$('#themer-popup div.duration').empty().prepend('' + strs.duration + '' + vars.duration + ' ms');
$('#themer-popup dd.candidates').empty().prepend(vars.candidates.join(' < '));
var uri = Drupal.settings.devel_themer_uri + '/' + id;
if (type == 'func') {
if (vars.candidates != undefined && vars.candidates.length != 0) {
// populate the candidates
$('#themer-popup dt.candidates-type').empty().prepend(strs.candidate_functions);
// empty the preprocessors - functions don't have them :(
$('#themer-popup dd.preprocessors').empty();
$('#themer-popup dt.preprocessors-type').empty();
}
$('#themer-popup div.attributes').empty().load(uri, {}, function() {
$(this).prepend('