var modules_list = new Array();
var hooks_list = new Array();
var hookable_list = new Array();
var timer;
$(document).ready(function() {
// do some place for submit button
$('body').css('margin-bottom', '45px');
// this is the result box, which will "pop up" the succeed or fail result
$('#fancy').fancybox({
autoDimensions: true,
autoScale: true,
width: 300,
height: 300,
padding: 0,
hideOnOverlayClick: false,
hideOnContentClick: false,
showCloseButton: false
});
$('#live_edit_feedback_str').html('');
// add liveToken in each link to navigate into the shop and keeping the liveedit mode
$('a').each(function() {
var href = $(this).attr('href');
var search = $(this).attr('search');
var hrefAdd = 'live_edit&liveToken=' + get('liveToken') + '&ad=' + get('ad') + '&id_shop=' + get('id_shop');
if (href != undefined && href != '#' && href.substr(0, baseDir.length) == baseDir) {
if (search.length == 0)
{
$(this).attr('search', hrefAdd);
}
else
{
$(this).attr('search', search + '&' + hrefAdd);
}
}
});
// populate
getHookableList();
$('.unregisterHook').unbind('click').click(function() {
id = $(this).attr('id');
$(this).parent().parent().parent().fadeOut('slow', function() {
$(this).remove();
});
return false;
});
$('#cancelMove').unbind('click').click(function() {
$('#' + cancelMove + '').sortable('cancel');
return false;
});
$('#saveLiveEdit').unbind('click').click(function() {
saveModulePosition();
return false;
});
$('#closeLiveEdit').unbind('click').click(function() {
$("#live_edit_feedback_str").html('