reader.js 1.49 KB
/* global, layout, slickgrid, Cookies, common */

layout.content_height = function() {
    "use strict";
    return $(window).height() - $('#header').height() - 5;
};

layout.grid_height = function() {
    "use strict";
    return $('#left').innerHeight() - parseInt($('#content').css('padding-top'), 10) + 5;
};

layout.adjust_tabs = function() {
    "use strict";
    var right = $('#right'), content = $('#content');
    right.height(content.height() + 5);
    right.outerWidth(
        content.width() - $('#left').outerWidth() - $('.vsplitbar').width());
};

layout.left_width = 340;

$(function() {
    "use strict";
    var splash_hidden;
    var storage_present = common.storage_present();
    if (storage_present) {
        splash_hidden = localStorage.getItem('splash');
    } else {
        splash_hidden = Cookies.get('splash');
    }
    var splash_overlay = $('#splash-overlay');
    if (splash_hidden) {
        // przedłużamy
        if (!storage_present)
            Cookies.set('splash', 'hidden', {expires: 365});
    } else {
        splash_overlay.show();
    }
    splash_overlay.add('#splash-button').click(function() {
        splash_overlay.hide();
        if (storage_present) {
            localStorage.setItem('splash', 'hidden');
        } else {
            Cookies.set('splash', 'hidden', {expires: 365});
        }
    });
    $('#splash').click(function(event) {
        event.stopPropagation();
    });
    $('.show-splash').click(function() {
        splash_overlay.show();
    });
});