App-Dochazka-WWW

 view release on metacpan or  search on metacpan

share/js/dochazka-www/lib.js  view on Meta::CPAN

                cunick,
                cupriv,
                cumasq;

            if (cu) {
                cunick = cu.obj.nick || null;
                cupriv = cu.priv || 'passerby';
                cumasq = cu.flag1; // use flag1 as masquerade state
            } else {
                cunick = null;
                cupriv = 'passerby';
                cumasq = undefined;
            }

            if (cumasq) {
                r += '<b>!!! ';
            }

            r += 'Employee: ';
            r += cunick ? cu.obj.nick : '&lt;NONE&gt;';
            if (cumasq) {
                r += ' (MASQUERADE)';
            } else {
                if (cupriv === 'admin') {
                    r += ' ADMIN'; // used to be '&nbsp;ADMIN' but this caused
                                   // unnecessary trouble with tests
                }
            }

            if (cumasq) {
                r += ' !!!</b>';
            }

            return r;
        };

    return {

        displayIntervals: function (intervals, formField) {
            var i;
            if (intervals.length === 1) {
                formField.html(
                    datetime.tsrangeToTimeRange(intervals[0].intvl)
                );
            } else {
                formField.html('');
                for (i = 0; i < intervals.length - 1; i += 1) {
                    formField.append(
                        datetime.tsrangeToTimeRange(intervals[i].intvl)
                    );
                    formField.append('; ');
                }
                formField.append(
                    datetime.tsrangeToTimeRange(intervals[i].intvl)
                );
            }
        },

        //
        // function returns string that will be displayed at the very
        // bottom of the screen (directly under the frame)
        //
        fillNoticesLine: function () {
            var r = '';
            r += 'Copyright \u00A9 SUSE LLC, 2014-2016. All rights reserved. ';
            r += 'Report bugs at ';
            r += '<a href="https://github.com/smithfarm/dochazka/issues">';
            r += 'https://github.com/smithfarm/dochazka/issues</a>';
            return r;
        },

        fillUserBox: function () {
            $('#userbox').html(userBoxContent());
        },

        userBoxContent: userBoxContent,

    };

});



( run in 1.749 second using v1.01-cache-2.11-cpan-e1769b4cff6 )