GithubHelp home page GithubHelp logo

myme / elvis Goto Github PK

View Code? Open in Web Editor NEW
2.0 2.0 1.0 162 KB

Generate HTML DOM programmatically

Home Page: http://github.com/myme/elvis

License: ISC License

CoffeeScript 60.94% JavaScript 39.06%

elvis's Introduction

  • ๐Ÿ‘‹ Hi, Iโ€™m Martin!
  • ๐Ÿ‘€ Iโ€™m interested in nix ecosystem and functional programming in Haskell, but I mostly do professional work in Python and TypeScript.
  • ๐ŸŒฑ Iโ€™ve been currently learning a bit of rust and go.
  • ๐Ÿ“ซ Reach out to me through the footer links on my home page: https://myme.no.

elvis's People

Contributors

jodal avatar myme avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

Forkers

torkildr

elvis's Issues

Fix `elvis.on`

elvis.on is currently only using addEventListener, which is not cross-browser compatible.

Add Backbone.Collection bindings

Add ways to bind to properties on Collections as well.

Bind to length:

var collection = new Backbone.Collection();
elvis('div', collection.bindTo('length'));

Bind to collection elements:

var collection = new Backbone.Collection();
elvis('ul', collection.bindTo('[]').get(function (elements) {
    return elements.map(function (element) {
        return elvis('li', element.get('attribute'));
    });
}));

Fix IE8 issues

There are several early IE issues:

  • document.ELEMENT_NODE and document.TEXT_NODE are not defined constants on early IE version.
  • Emptying out a table element using innerHTML = "" causes a runtime error.
  • textContent is not supported on all IE versions. Use innerText instead.
  • Text nodes do not support neither of textContent nor innerText and should be set using nodeValue.

Support nested tag specifiers

When an element only has one child, it could perhaps be nice to support a syntax like the following:

el('thead tr td ', ...)

Support properties

Currently, setting properties does not work:

elvis('button', { disabled: false });
elvis('button', { disabled: true });

Should of course also work with bindings.

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.