How to use the ariatemplates/utils/Type.isString function in ariatemplates

To help you get started, we’ve selected a few ariatemplates examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github ariatemplates / ariatemplates / test / EnhancedRobotBase.js View on Github external
ariaUtilsArray.forEach(commonKeys, function (keySpec) {
    // ---------------------------------------------- input arguments processing

    if (ariaUtilsType.isString(keySpec)) {
        keySpec = {name: keySpec};
    }

    var name = keySpec.name;

    var shift = keySpec.shift;
    if (shift == null) {
        shift = false;
    }

    var granular = keySpec.granular;
    if (granular == null) {
        granular = false;
    }

    // -------------------------------------------------------------- processing
github ariatemplates / ariatemplates / test / aria / widgets / form / multiautocomplete / navigation / Sequence.js View on Github external
$constructor : function (input) {
        // ------------------------------------------ input arguments processing

        var spec;

        if (ariaUtilsType.isString(input)) {
            spec = {
                name : input
            };
        } else {
            spec = input;
        }

        // ---------------------------------------------------------- properties

        this.parent = spec.parent;
        this.name = spec.name;
        this.trace = spec.trace;

        // ------------------------------------------------- internal attributes

        this.__tasks = [];
github ariatemplates / ariatemplates / test / aria / widgets / form / multiautocomplete / navigation / Sequencer.js View on Github external
ariaUtilsArray.forEach(specs, function (spec) {
                if (spec.children == null) {
                // task --------------------------------------------------------

                    sequence.addTask(this.task(spec));
                } else {
                // sequence ----------------------------------------------------

                    var children = spec.children;

                    if (ariaUtilsType.isString(children)) {
                        children = this.scope[children];
                    }

                    if (ariaUtilsType.isFunction(children)) {
                        children = children.apply(this.scope, spec.args || []);
                    }

                    sequence.addSequence(this.sequence(spec.name, children));
                }
            }, this);
github ariatemplates / ariatemplates / test / aria / widgets / form / multiautocomplete / navigation / Sequencer.js View on Github external
resolveMethod : function (spec) {
            // ------------------------------------------------------ processing

            if (ariaUtilsType.isString(spec)) {
                spec = {
                    fn : spec
                };
            }

            // args ------------------------------------------------------------

            var args = spec.args;

            // fn (registered properties) --------------------------------------

            var fn = spec.fn;

            if (fn == null) {
                fn = spec.method;
            }
github ariatemplates / ariatemplates / test / aria / widgets / form / multiautocomplete / navigation / Sequencer.js View on Github external
}

            // scope -----------------------------------------------------------

            var scope = spec.scope;

            if (scope == null) {
                scope = registeredProperties.scope;
            }
            if (scope == null) {
                scope = this.scope;
            }

            // fn (actual callback) --------------------------------------------

            if (ariaUtilsType.isString(fn)) {
                fn = scope[fn];
            }

            if (!ariaUtilsType.isFunction(fn)) {
                throw new Error('Wrong function definition, got: ' + fn);
            }

            // asynchronous ----------------------------------------------------

            var asynchronous = spec.asynchronous;

            if (asynchronous == null) {
                asynchronous = registeredProperties.asynchronous;
            }

            if (asynchronous == null) {
github ariatemplates / ariatemplates / test / aria / widgets / form / multiautocomplete / navigation / RobotBase.js View on Github external
typeSequence : function (task, textSequence, delay) {
            // -------------------------------------- input arguments processing

            // textSequence ----------------------------------------------------

            if (ariaUtilsType.isString(textSequence)) {
                textSequence = [textSequence];
            } else if (!ariaUtilsType.isArray(textSequence)) {
                throw new Error('Invalid given textSequence. Should be an array or a string, got: ' + textSequence);
            }

            // delay -----------------------------------------------------------

            if (delay == null) {
                delay = this.defaultDelay;
            }

            // ------------------------------------------------------ processing

            var tasks = [];
            ariaUtilsArray.forEach(textSequence, function (text) {
                tasks.push({
github ariatemplates / ariatemplates / test / aria / widgets / container / dialog / container / DialogContainerRobotBase.js View on Github external
getGeometry : function (domElt) {
            if (TypeUtils.isString(domElt)) {
                domElt = this.getElementById(domElt);
            }
            return this.testWindow.aria.utils.Dom.getGeometry(domElt);
        },
github ariatemplates / ariatemplates / test / EnhancedRobotBase.js View on Github external
creator.call(this, function add(fnOrName) {
            var fn;
            if (ariaUtilsType.isString(fnOrName)) {
                fn = self[fnOrName];
            } else {
                fn = fnOrName;
            }

            if (fn == null) {
                throw new Error('The given value is not defined, cannot add any function.');
            }

            if (ariaUtilsType.isFunction(fn.async)) {
                fn = fn.async;
            }

            if (arguments.length > 1) {
                var boundArguments = Array.prototype.slice.call(arguments, 1);
                fn = self._partializeAsynchronousFunction(fn, boundArguments);