App-Dochazka-WWW

 view release on metacpan or  search on metacpan

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

// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
// POSSIBILITY OF SUCH DAMAGE.
// *************************************************************************
//
// app/target-init.js
//
// Initialization of targets (round one)
//
"use strict";

define ([
    'app/act-lib',
    'app/caches',
    'app/emp-lib',
    'app/daction-init',
    'app/dcallback-init',
    'app/dform-init',
    'app/dmenu-init',
    'app/dbrowser-init',
    'app/dnotice-init',
    'app/dtable-init',
    'app/drowselect-init',
    'init2',
    'populate',
    'stack',
], function (
    actLib,
    appCaches,
    empLib,
    dactionInitRoundOne,
    dcallbackInitRoundOne,
    dformInitRoundOne,
    dmenuInitRoundOne,
    dbrowserInitRoundOne,
    dnoticeInitRoundOne,
    dtableInitRoundOne,
    drowselectInitRoundOne,
    initRoundTwo,
    populate,
    stack,
) {

    var populateTargetsAndStart = function (populateArray) {
            var populateContinue;
            console.log("Entering populateTargetsAndStart()");
            populateContinue = populate.shift(populateArray);
            console.log("populateContinue", populateContinue);

            // populate target objects
            initRoundTwo('dform');
            initRoundTwo('dmenu');
            initRoundTwo('dcallback');
            initRoundTwo('dbrowser');
            initRoundTwo('dnotice');
            initRoundTwo('dtable');
            initRoundTwo('drowselect');

            stack.push('mainMenu');
            populateContinue(populateArray);
        };

    return function () {

        // round one - set up the targets
        console.log("dochazka-www/target-init.js: round one");
        dactionInitRoundOne();
        dcallbackInitRoundOne();
        dformInitRoundOne();
        dmenuInitRoundOne();
        dbrowserInitRoundOne();
        dnoticeInitRoundOne();
        dtableInitRoundOne();
        drowselectInitRoundOne();

        // use "populate" pattern to populate caches
        // (activities, full employee profile)
        populate.bootstrap([
            appCaches.populateFullEmployeeProfileCache,
            appCaches.populateScheduleBySID,
            appCaches.populateActivityCache,
            populateTargetsAndStart,
        ]);

    };

});



( run in 0.873 second using v1.01-cache-2.11-cpan-99c4e6809bf )