Code Monkey home page Code Monkey logo

clientjade's People

Contributors

brianblocker avatar cgc avatar jgallen23 avatar shripadk avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

clientjade's Issues

Higher Performance Render

Hey, I love this library; wish it was more popular. Anyway, I thought I'd let you know that there's a higher-performance tweak to innerHTML that only requires a few line changes. Credit goes to this old article: http://blog.stevenlevithan.com/archives/faster-than-innerhtml

lib/browser/render.js

jade.templates = {};
jade.render = function(node, template, data) {
  var newEl = node.cloneNode(false), //False means non-deep clone
      parent = node.parentNode,
      tmp = jade.templates[template](data);

  newEl.innerHTML = tmp(data);
  if (parent) parent.replaceChild(newEl, node);

  return newEl;
};

Jade upgrading

Can you upgrade Jade. By now you are using 1.5.0, and current release version is 1.9.2.

License

Is this released under the MIT license? If so, please include the license in the repo and mark the files and documentation. Thanks!

Reserved word "class" causing JS errors in some browsers

Hey there,

First off, great library! Lightweight and exactly what I needed. However, there's a bug in your exports.merge function. In the current form it's written as:

exports.merge = function merge(a, b) {
var ac = a.class;
var bc = b.class;

if (ac || bc) {
ac = ac || [];
bc = bc || [];
if (!Array.isArray(ac)) ac = [ac];
if (!Array.isArray(bc)) bc = [bc];
ac = ac.filter(nulls);
bc = bc.filter(nulls);
a.class = ac.concat(bc).join(' ');
}

for (var key in b) {
if ('class' == key) continue;
a[key] = b[key];
}

return a;
};

You cannot use the .class notation because "class" is a reserved word in javascript. Some web browsers have no problem parsing this, but others do (confirmed on Mobile Safari). If you fix the notation to read:

var ac = a["class"];
var bc = b["class"];
....
a["class"] = ac.concat(bc).join(' ');

It'll compile correctly. Would definitely try to help myself, but I don't have access to the source. Right now, my only fix is to manually edit the code after each time I compile.

About jade version

I really like the nice module, but it seems that the jade engine defined in package.json is fixed at version 0.26.3.
As I know, the jade has been updated to 0.35.0,
So would you please update the package.json to get work with new jade version?

Thanks.

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.