Git Product home page Git Product logo

parser's Introduction

dojo-parser

Build Status codecov.io

parser

parser.register(tagName, options)

Register a tag name

Registering an Custom Tag

require('parser', function (parser) {
    parser.register('test-tag', {
        proto: {
            foo: 'bar'
        }
    });
});

Registering a constructor

require('parser', function (parser) {
    var MyObject = function (node, options) {
        // node: HTMLElement
        // options: Any parsed JSON data put into data-options
    };
    MyObject.prototype = {
        foo: 'bar'
    };

    parser.register('test-tag', { Ctor: MyObject });
});

De-registeration

require('parser', function (parser) {
    var handle = parser.register('test-tag', {
        proto: {
            foo: 'bar'
        }
    });

    handle.destroy(); // Will no longer parse tags of "test-tag"
});

watch(options?)

Starts watching a document for any nodes being inserted or removed. If some of the nodes being inserted match a registered tag name, or contain the attribute of is with a value of a registered tag name, the corresponding object will be created and registered with the parser.

If a node is being removed and there was an object created by the parser, it will be dereferenced in the parser's registry.

parse(options?)

byId(id)

byNode(node)

removeObject(obj)

ยฉ 2004โ€“2015 Dojo Foundation & contributors. New BSD license.

parser's People

Contributors

kitsonk avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.