Professional Documents
Culture Documents
// Fake console in case it's not available for the current browser
if (typeof(console) === 'undefined') {
var functionNames = ['info', 'error', 'warn', 'dir', 'trace', 'log',
'assert'];
console = {};
for (var i = 0; i < functionNames.length; i++) {
console[functionNames[i]] = function(){}
}
}
$(document).ready(function(){
sendspace = new sendspaceClass();
sendspace.init();
if (document.domain.indexOf('sendspace.com') != -1)
document.domain = 'sendspace.com';
});
function ga_pageView(page) {
if (typeof ga !== 'function') {
console.warn('Could not track page view (ga not defined): ' + page);
return false;
}
try {
ga('send', 'pageview', page);
} catch(e) {
console.warn('Could not track page view: ' + e.message);
return false;
}
return true;
}
function toggle_parent_sons(a) {
$(a).parent().parent().find("div").each(function(){
$(this).toggle();
});
}
this.init = function () {
self.assign_page_events();
};
this.assign_page_events = function () {
function hideTooltip(element) {
$(element).find('.tooltipContainer').fadeOut(100);
$(element).children().remove();
element.title = element.tip;
$(element).data('tooltipVisible', false);
}
$('.tooltip').hover(
function(e) {
var element = e.currentTarget;
clearTimeout($(element).data('hideTimeoutId'));
if ($(element).data('tooltipVisible')) return;
$(element).data('tooltipVisible', true);
element.tip = element.title;
var content = null;
var arr = element.tip.split('*');
if (arr.length > 1) {
content = '<ul>';
for (var i = 0; i<arr.length; i++) {
content = content + '<li>' + arr[i] + '</li>';
}
content = content + '</ul>';
} else content = element.tip;
}, function(e) {
var element = e.currentTarget;
if (!$(element).data('tooltipVisible')) return;
clearTimeout($(element).data('hideTimeoutId'));
$(element).data('hideTimeoutId', timeoutId);
}
);
// tooltip event
$(".tooltip_holder").hover(function(){
$("#content .tooltip").hide();
$(this).find(".tooltip").fadeIn("normal");
}, function(){
$(this).find(".tooltip").fadeOut("normal");
});
this.hide = function() {
if ($.browser.msie)
$("div.overlay").hide();
else $("div.overlay").fadeOut("fast");
if (!is_ie7) $glass.hide();
if ($('.openid-popup').length)
$('.openid-popup').hide();
};
$glass.click(function(){
self.hide();
});
}
// Define uploader UI
if ($("#progress_bar").length > 0)
{
this.progress = new function ()
{
//focus
var $progress = $("#progress_bar");
var w = $progress.find(".bar").width();
var $stats = $progress.find(".stats");
this.restoreTitle = function() {
parent.document.title = backupTitle;
};
$progress
.find(".fill")
.animate({width: to_bar+"%"}, 100);
var w = $("#progress_bar").find(".bar").width();
var val = w*to_bar/100;
if (val > 0)
{
$progress
.find(".tag")
.text(to_bar+"%")
.animate({left: (val-19)+"px"} , 100);
}