<commit_before>﻿/* ASSETS/JS/APP/CLASSES/Abstract.class.js */

'use strict';

define([
        'jquery'
      , 'underscore'
      , 'functions'
    ]
  , function (
        $
      , _
  ) {

    //  CONSTRUCTOR
    var Abstract    =   function () {
        var self            =   this
          , dfdClass        =   $.Deferred()
          , dfdPrototype    =   $.Deferred()
        ;
        console.groupCollapsed('Abstract.class Constructor');

        // INIT
        dfdPrototype =  self._init();

        // Show a "working..." message every half-second
        setTimeout ( function working() {
            if ( "pending" === dfdPrototype.state() ) {
                console.timeStamp('\tWorking ... ', i++);
                if (i <= 20) {
                    setTimeout ( working, 500);
                }
            }
        }, 1);

        $.when( dfdPrototype )
         .done( function (oClass) {
            console.timeStamp('Instance of ' + oClass._entity + ' created:');
            console.log('\t', oClass);
            dfdClass.resolve(oClass);
         })
         .always( function (oResult) {
            console.groupEnd('Abstract.class Constructor');
         })
        ;

        return dfdClass.promise();
    };

    //  PROTOTYPE
    Abstract.prototype  =   {

        '_defaults': {
            '_entity': 'Abstract'
        }

      , '_config': {}
      , '_data': {}


        //  INIT
      , '_init': function () {
            var self = this;
            return self.Init();
        }


        //  INITIALIZATION
      , 'Init': function () {
            var self    =   this
              , dfdInit =   $.Deferred()
            ;

            //  Apply DEFAULT class OPTIONS
            var loaded  =   $.when( _.extend(self, self._defaults) )
                             .then( function (objSelf) {
                                return objSelf.Load();
                            });

            $.when( loaded )
             .then( function (objSelf) {
                dfdInit.resolve(objSelf);
            });

            setTimeout ( function workingInit () {
                if ( 'pending' === loaded.state() ) {
                    console.timeStamp('\tLoading ... ', i++);
                    if (i <= 20) {
                        setTimeout ( workingInit, 500);
                    }
                }
            }, 1);

            return dfdInit.promise();
        }


        // Load Default Data and Modules
      , 'Load': function () {
            var self        =   this
              , dfdMethod   =   $.Deferred()
              , dfdModules  =   $.Deferred()
            ;

            dfdModules.resolve(self);
            dfdModules
                .done( function (loSelf) {
                    var tStamp  =   {'timestamp': (new Date()).getTime()}
                      , UUID    =   {'UID': genUUID()}
                    ;
                    _.extend(loSelf._config, tStamp, UUID);
                    dfdMethod.resolve(loSelf);
                });<commit_msg>Removed extra quotes for keys in objects<commit_after>/* ASSETS/JS/APP/CLASSES/Abstract.class.js */

'use strict';

define([
        'jquery'
      , 'underscore'
      , 'functions'
    ]
  , function (
        $
      , _
  ) {

    //  CONSTRUCTOR
    var Abstract    =   function () {
        var self            =   this
          , dfdClass        =   $.Deferred()
          , dfdPrototype    =   $.Deferred()
        ;
        console.groupCollapsed('Abstract.class Constructor');

        // INIT
        dfdPrototype =  self._init();

        // Show a "working..." message every half-second
        setTimeout ( function working() {
            if ('pending' === dfdPrototype.state()) {
                console.timeStamp('\tWorking ... ', i++);
                if (i <= 20) {
                    setTimeout ( working, 500);
                }
            }
        }, 1);

        $.when( dfdPrototype )
         .done( function (oClass) {
            console.timeStamp('Instance of ' + oClass._entity + ' created');
            console.log('Class Object:', oClass);
            dfdClass.resolve(oClass);
         })
         .always( function (oResult) {
            console.groupEnd('Abstract.class Constructor');
         })
        ;

        return dfdClass.promise();
    };

    //  PROTOTYPE
    Abstract.prototype  =   {

        _defaults: {
            _entity: 'Abstract'
        }

      , _config: {}
      , _data: {}


        //  INIT
      , _init: function () {
            var self = this;
            return self.Init();
        }


        //  INITIALIZATION
      , Init: function () {
            var self    =   this
              , dfdInit =   $.Deferred();

            //  Apply DEFAULT class OPTIONS
            var loaded  =   $.when( _.extend(self, self._defaults) )
                             .then( function (objSelf) {
                                return objSelf.Load();
                            });

            $.when( loaded )
             .then( function (objSelf) {
                dfdInit.resolve(objSelf);
            });

            setTimeout ( function workingInit () {
                if ('pending' === loaded.state()) {
                    console.timeStamp('\tLoading ... ', i++);
                    if (i <= 20) {
                        setTimeout ( workingInit, 500);
                    }
                }
            }, 1);

            return dfdInit.promise();
        }


        // Load Default Data and Modules
      , Load: function () {
            var self        =   this
              , dfdMethod   =   $.Deferred()
              , dfdModules  =   $.Deferred();

            dfdModules.resolve(self);
            dfdModules
                .done( function (loSelf) {
                    var tStamp  =   {timestamp: (new Date()).getTime()}
                      , UUID    =   {UID: genUUID()}
                    ;
                    _.extend(loSelf._config, tStamp, UUID);
                    dfdMethod.resolve(loSelf);
                });
{'fraction_non_alphanumeric': 0.1261558784676354, 'fraction_numerical': 0.003963011889035667, 'mean_word_length': 1.0721861101607937, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6982834', 'n_tokens_mistral': 1670, 'n_tokens_neox': 1584, 'n_words': 319}