')
.css({'float':e.css('float')});
e.wrap(caption).parent()
.append($('
')
.append($('
')
.attr('download', info.filename)
.attr('title', __('Download'))
)
);
e.data('wrapped', true);
}
});
};
getConfig = (function() {
var dfd = $.Deferred(),
requested = false;
return function() {
return dfd;
};
})();
$.sysAlert = function (title, msg, cb) {
var $dialog = $('.dialog#alert');
if ($dialog.length) {
$('#title', $dialog).html(title);
$('#body', $dialog).html(msg);
$dialog.show();
} else {
msg = msg.replace(/
/, "\n").replace(/<\/?\w+[^>]*>/g, '');
alert(title+':\n'+msg);
}
};
function __(s) {
if ($.oststrings && $.oststrings[s])
return $.oststrings[s];
return s;
}
$.clientPortal = true;
$(document).on('submit', 'form', function() {
// Reformat dates
$('.dp', $(this)).each(function(i, e) {
var $e = $(e),
d = $e.datepicker('getDate');
if (d)
$e.val(d.toISOString());
});
});
$(document).on('click', '.link:not(a):not(.button)', function(event) {
var $e = $(event.currentTarget);
$('
').prop({href: $e.attr('href'), 'class': $e.attr('class')})
.hide()
.insertBefore($e)
.get(0).click(event);
});