HEX
Server: nginx/1.22.1
System: Linux VM-16-9-centos 3.10.0-1160.99.1.el7.x86_64 #1 SMP Wed Sep 13 14:19:20 UTC 2023 x86_64
User: www (1001)
PHP: 7.3.31
Disabled: passthru,exec,system,putenv,chroot,chgrp,chown,shell_exec,popen,proc_open,pcntl_exec,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,imap_open,apache_setenv
Upload Files
File: /www/wwwroot/oa.sanjiangapp.com/app/sys/index/js/index.js
$(function()
{
    /* start ips */
    $.ipsStart(entries, $.extend({onDeleteEntry: deleteEntry, onUpdateEntryMenu: updateEntryMenu, onSortEntries: sortEntries}, config, ipsLang));
    if(v.attend)
    {
        $('.sign').parent('li').show();
    }
    else
    {
        $('.sign').parent('li').hide();
    }
    initAttendButton();

    $(document).on('mouseover', '.categoryButton', function()
    {
        $('.categoryButton').not('.open').removeClass('active');
        $(this).addClass('active');
        var id    = $(this).data('id');
        var menu  = $('#categoryMenu' + id);
        var lis   = menu.find('li');
        var color = $('body').css('background-color');
        menu.css({'background-color' : color, 'top' : $(this).offset().top - 3, 'width' : 40 * lis.size() + 20});
        $('.categoryMenu').not(menu).hide();
        menu.show();
    });

    $(document).on('mouseover', '.categoryMenu li .app-btn', function()
    {
        $('.categoryMenu li .app-btn').removeClass('active');
        $(this).addClass('active');
    });

    $(document).on('mouseout', '.categoryMenu li .app-btn', function()
    {
        $('.categoryMenu li .app-btn').removeClass('active');
        var id = $(this).parents('.categoryMenu').data('id');
        if(!$('#category' + id).hasClass('open')) $('#category' + id).removeClass('active');
    });

    $(document).on('click', '.categoryMenu li .app-btn', function()
    {
        $('.categoryMenu').hide();
        $('.categoryButton').removeClass('active');

        var id = $(this).parents('.categoryMenu').data('id');
        $('#category' + id).addClass('open active');
    });

    $(document).on('mouseover', '#leftBar #apps-menu .bar-menu li .app-btn', function()
    {
        $('.categoryButton').not(this).not('.open').removeClass('active');
        if(!$(this).hasClass('categoryButton')) $('.categoryMenu').hide();
    });

    $(document).on('click', '#leftBar #apps-menu .bar-menu li .app-btn', function()
    {
        $('.categoryButton').removeClass('active');
        $('.categoryMenu').hide();
    });

    $(document).on('click', '#bottomBar #taskbar .bar-menu li .app-btn', function()
    {
        $('.categoryButton').removeClass('active');
        var dataid = $(this).data('id');
        $('.categoryMenu li .app-btn').each(function()
        {
            if($(this).data('id') == dataid)
            {
                var id = $(this).parents('.categoryMenu').data('id');
                $('#category' + id).addClass('active');
                return;
            }
        });
    });

    $(document).mouseover(function(e)
    {
        $('.categoryMenu').each(function()
        {
            if($(this).is(':visible'))
            {
                var dataid  = $(this).data('id');
                var button  = $('#category' + dataid);
                var top     = button.offset().top;
                var left    = button.offset().left;
                var right   = left + button.width() + $(this).width();
                var bottom  = top + button.height() + $(this).height();
                if(e.pageX < left || e.pageX > right || e.pageY < top || e.pageY > bottom)
                {
                    $(this).hide();
                }
            }
        });
    });

    if(v.attendNotice) showNotice($.extend({id: 'attend-notice'}, v.attendNotice));
});

/**
 * Update orders of entries
 *
 * @param  object      orders
 * @param  function    callback after success
 * @access public
 * @return void
 */
function sortEntries(orders, callback)
{
    $.post(createLink('entry', 'customSort'), orders, function(data)
    {
        callback && callback(data.result == 'success');
    }, 'json');
}

/**
 * Update menu attribute of entry
 *
 * @param  int         entry id
 * @param  function    callback after success
 * @access public
 * @return void
 */
function updateEntryMenu(et, callback)
{
    $.post(createLink('entry', 'updateEntryMenu'), et, function(data)
    {
        callback && callback(data.result == 'success');
    }, 'json');
}

/**
 * Delete entry.
 *
 * @param  object      entry
 * @param  function    callback after delete success
 * @access public7
 * @return void
 */
function deleteEntry(et, callback)
{
    $.getJSON(createLink('entry', 'delete', 'code=' + et.code), function(data)
    {
        callback && callback(data.result == 'success');
    });
}

/**
 * init sign in and sign out button.
 *
 * @access public
 * @return void
 */
function initAttendButton()
{
    $('.signin').click(function()
    {
        $.getJSON(createLink('oa.attend', 'signin'), function(data)
        {
            if(data.result == 'success') $.zui.messager.success(data.message);
            if(data.result == 'fail') $.zui.messager.info(data.message);
        });
    });
    $('.signout').click(function()
    {
        $.getJSON(createLink('oa.attend', 'signout'), function(data)
        {
            if(data.result == 'success') window.location.href = createLink('user', 'logout');
            if(data.result == 'fail') $.zui.messager.info(data.message);
        });
    });
}