Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

nant

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

nant - npm Package Compare versions

Comparing version 0.0.4 to 0.1.0

.c9/metadata/tab31

2

.c9/metadata/workspace/nant.js

@@ -1,1 +0,1 @@

{"filter":false,"title":"nant.js","tooltip":"/nant.js","undoManager":{"mark":100,"position":100,"stack":[[{"group":"doc","deltas":[{"action":"removeText","range":{"start":{"row":52,"column":16},"end":{"row":52,"column":17}},"text":"v"}]}],[{"group":"doc","deltas":[{"action":"removeText","range":{"start":{"row":52,"column":16},"end":{"row":52,"column":17}},"text":"a"}]}],[{"group":"doc","deltas":[{"action":"removeText","range":{"start":{"row":52,"column":16},"end":{"row":52,"column":17}},"text":"l"}]}],[{"group":"doc","deltas":[{"action":"removeText","range":{"start":{"row":52,"column":16},"end":{"row":52,"column":17}},"text":" "}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":52,"column":16},"end":{"row":52,"column":17}},"text":"v"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":52,"column":17},"end":{"row":52,"column":18}},"text":"a"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":52,"column":18},"end":{"row":52,"column":19}},"text":"l"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":52,"column":19},"end":{"row":52,"column":20}},"text":" "}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":52,"column":47},"end":{"row":53,"column":0}},"text":"\n"},{"action":"insertText","range":{"start":{"row":53,"column":0},"end":{"row":53,"column":16}},"text":" "}]}],[{"group":"doc","deltas":[{"action":"removeText","range":{"start":{"row":53,"column":12},"end":{"row":53,"column":16}},"text":" "}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":53,"column":12},"end":{"row":53,"column":13}},"text":"}"}]}],[{"group":"doc","deltas":[{"action":"removeText","range":{"start":{"row":62,"column":12},"end":{"row":62,"column":13}},"text":"}"}]}],[{"group":"doc","deltas":[{"action":"removeText","range":{"start":{"row":54,"column":0},"end":{"row":54,"column":4}},"text":" "},{"action":"removeText","range":{"start":{"row":55,"column":0},"end":{"row":55,"column":4}},"text":" "},{"action":"removeText","range":{"start":{"row":56,"column":0},"end":{"row":56,"column":4}},"text":" "},{"action":"removeText","range":{"start":{"row":57,"column":0},"end":{"row":57,"column":4}},"text":" "},{"action":"removeText","range":{"start":{"row":58,"column":0},"end":{"row":58,"column":4}},"text":" "},{"action":"removeText","range":{"start":{"row":59,"column":0},"end":{"row":59,"column":4}},"text":" "},{"action":"removeText","range":{"start":{"row":60,"column":0},"end":{"row":60,"column":4}},"text":" "},{"action":"removeText","range":{"start":{"row":61,"column":0},"end":{"row":61,"column":4}},"text":" "}]}],[{"group":"doc","deltas":[{"action":"removeText","range":{"start":{"row":82,"column":0},"end":{"row":82,"column":13}},"text":" }"},{"action":"removeLines","range":{"start":{"row":81,"column":0},"end":{"row":82,"column":0}},"nl":"\n","lines":[" return false;"]},{"action":"removeText","range":{"start":{"row":80,"column":14},"end":{"row":80,"column":20}},"text":"else {"},{"action":"removeText","range":{"start":{"row":80,"column":14},"end":{"row":81,"column":0}},"text":"\n"}]}],[{"group":"doc","deltas":[{"action":"removeText","range":{"start":{"row":80,"column":13},"end":{"row":80,"column":14}},"text":" "}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":80,"column":13},"end":{"row":81,"column":0}},"text":"\n"},{"action":"insertText","range":{"start":{"row":81,"column":0},"end":{"row":81,"column":12}},"text":" "}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":81,"column":12},"end":{"row":81,"column":13}},"text":"r"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":81,"column":13},"end":{"row":81,"column":14}},"text":"e"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":81,"column":14},"end":{"row":81,"column":15}},"text":"t"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":81,"column":15},"end":{"row":81,"column":16}},"text":"u"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":81,"column":16},"end":{"row":81,"column":17}},"text":"r"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":81,"column":17},"end":{"row":81,"column":18}},"text":"n"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":81,"column":18},"end":{"row":81,"column":19}},"text":" "}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":81,"column":19},"end":{"row":81,"column":20}},"text":"f"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":81,"column":20},"end":{"row":81,"column":21}},"text":"a"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":81,"column":21},"end":{"row":81,"column":22}},"text":"l"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":81,"column":22},"end":{"row":81,"column":23}},"text":"s"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":81,"column":23},"end":{"row":81,"column":24}},"text":"e"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":81,"column":24},"end":{"row":81,"column":25}},"text":";"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":67,"column":37},"end":{"row":68,"column":0}},"text":"\n"},{"action":"insertText","range":{"start":{"row":68,"column":0},"end":{"row":68,"column":12}},"text":" "}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":68,"column":12},"end":{"row":68,"column":13}},"text":"v"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":68,"column":13},"end":{"row":68,"column":14}},"text":"a"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":68,"column":14},"end":{"row":68,"column":15}},"text":"r"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":68,"column":15},"end":{"row":68,"column":16}},"text":" "}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":68,"column":16},"end":{"row":68,"column":17}},"text":"r"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":68,"column":17},"end":{"row":68,"column":18}},"text":"e"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":68,"column":18},"end":{"row":68,"column":19}},"text":"t"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":68,"column":19},"end":{"row":68,"column":20}},"text":" "}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":68,"column":20},"end":{"row":68,"column":21}},"text":"="}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":68,"column":21},"end":{"row":68,"column":22}},"text":" "}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":68,"column":22},"end":{"row":68,"column":23}},"text":"f"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":68,"column":23},"end":{"row":68,"column":24}},"text":"a"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":68,"column":24},"end":{"row":68,"column":25}},"text":"l"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":68,"column":25},"end":{"row":68,"column":26}},"text":"s"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":68,"column":26},"end":{"row":68,"column":27}},"text":"e"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":68,"column":27},"end":{"row":68,"column":28}},"text":";"}]}],[{"group":"doc","deltas":[{"action":"removeText","range":{"start":{"row":71,"column":20},"end":{"row":71,"column":26}},"text":"return"},{"action":"insertText","range":{"start":{"row":71,"column":20},"end":{"row":71,"column":21}},"text":"r"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":71,"column":21},"end":{"row":71,"column":22}},"text":"e"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":71,"column":22},"end":{"row":71,"column":23}},"text":"t"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":71,"column":23},"end":{"row":71,"column":24}},"text":" "}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":71,"column":24},"end":{"row":71,"column":25}},"text":"="}]}],[{"group":"doc","deltas":[{"action":"removeText","range":{"start":{"row":79,"column":20},"end":{"row":79,"column":26}},"text":"return"},{"action":"insertText","range":{"start":{"row":79,"column":20},"end":{"row":79,"column":21}},"text":"r"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":79,"column":21},"end":{"row":79,"column":22}},"text":"e"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":79,"column":22},"end":{"row":79,"column":23}},"text":"t"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":79,"column":23},"end":{"row":79,"column":24}},"text":" "}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":79,"column":24},"end":{"row":79,"column":25}},"text":"="}]}],[{"group":"doc","deltas":[{"action":"removeText","range":{"start":{"row":82,"column":19},"end":{"row":82,"column":24}},"text":"false"},{"action":"insertText","range":{"start":{"row":82,"column":19},"end":{"row":82,"column":20}},"text":"r"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":82,"column":20},"end":{"row":82,"column":21}},"text":"e"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":82,"column":21},"end":{"row":82,"column":22}},"text":"t"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":82,"column":22},"end":{"row":82,"column":23}},"text":" "}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":82,"column":23},"end":{"row":82,"column":24}},"text":"|"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":82,"column":24},"end":{"row":82,"column":25}},"text":"|"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":82,"column":25},"end":{"row":82,"column":26}},"text":" "}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":82,"column":26},"end":{"row":82,"column":27}},"text":"f"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":82,"column":27},"end":{"row":82,"column":28}},"text":"a"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":82,"column":28},"end":{"row":82,"column":29}},"text":"l"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":82,"column":29},"end":{"row":82,"column":30}},"text":"s"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":82,"column":30},"end":{"row":82,"column":31}},"text":"e"}]}],[{"group":"doc","deltas":[{"action":"removeText","range":{"start":{"row":68,"column":22},"end":{"row":68,"column":27}},"text":"false"},{"action":"insertText","range":{"start":{"row":68,"column":22},"end":{"row":68,"column":23}},"text":"a"}]}],[{"group":"doc","deltas":[{"action":"removeText","range":{"start":{"row":68,"column":22},"end":{"row":68,"column":23}},"text":"a"},{"action":"insertText","range":{"start":{"row":68,"column":22},"end":{"row":68,"column":26}},"text":"aCls"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":70,"column":41},"end":{"row":71,"column":0}},"text":"\n"},{"action":"insertText","range":{"start":{"row":71,"column":0},"end":{"row":71,"column":20}},"text":" "}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":71,"column":20},"end":{"row":71,"column":36}},"text":"var strArr = [];"},{"action":"insertText","range":{"start":{"row":71,"column":36},"end":{"row":72,"column":0}},"text":"\n"},{"action":"insertLines","range":{"start":{"row":72,"column":0},"end":{"row":75,"column":0}},"lines":[" for (var i = 0; i < val.length; i++) {"," strArr.push( getAttr(val[i], true) );"," }"]},{"action":"insertText","range":{"start":{"row":75,"column":0},"end":{"row":75,"column":53}},"text":" return '[' + strArr.join(', ') + ']';"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":72,"column":0},"end":{"row":72,"column":4}},"text":" "},{"action":"insertText","range":{"start":{"row":73,"column":0},"end":{"row":73,"column":4}},"text":" "},{"action":"insertText","range":{"start":{"row":74,"column":0},"end":{"row":74,"column":4}},"text":" "},{"action":"insertText","range":{"start":{"row":75,"column":0},"end":{"row":75,"column":4}},"text":" "}]}],[{"group":"doc","deltas":[{"action":"removeText","range":{"start":{"row":72,"column":40},"end":{"row":72,"column":43}},"text":"val"},{"action":"insertText","range":{"start":{"row":72,"column":40},"end":{"row":72,"column":41}},"text":"a"}]}],[{"group":"doc","deltas":[{"action":"removeText","range":{"start":{"row":72,"column":40},"end":{"row":72,"column":41}},"text":"a"},{"action":"insertText","range":{"start":{"row":72,"column":40},"end":{"row":72,"column":44}},"text":"aCls"}]}],[{"group":"doc","deltas":[{"action":"removeText","range":{"start":{"row":73,"column":37},"end":{"row":73,"column":44}},"text":"getAttr"},{"action":"insertText","range":{"start":{"row":73,"column":37},"end":{"row":73,"column":38}},"text":"g"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":73,"column":38},"end":{"row":73,"column":39}},"text":"e"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":73,"column":39},"end":{"row":73,"column":40}},"text":"t"}]}],[{"group":"doc","deltas":[{"action":"removeText","range":{"start":{"row":73,"column":37},"end":{"row":73,"column":40}},"text":"get"},{"action":"insertText","range":{"start":{"row":73,"column":37},"end":{"row":73,"column":49}},"text":"getClassAttr"}]}],[{"group":"doc","deltas":[{"action":"removeText","range":{"start":{"row":73,"column":50},"end":{"row":73,"column":53}},"text":"val"},{"action":"insertText","range":{"start":{"row":73,"column":50},"end":{"row":73,"column":51}},"text":"a"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":73,"column":51},"end":{"row":73,"column":52}},"text":"C"}]}],[{"group":"doc","deltas":[{"action":"removeText","range":{"start":{"row":73,"column":50},"end":{"row":73,"column":52}},"text":"aC"},{"action":"insertText","range":{"start":{"row":73,"column":50},"end":{"row":73,"column":54}},"text":"aCls"}]}],[{"group":"doc","deltas":[{"action":"removeText","range":{"start":{"row":75,"column":19},"end":{"row":75,"column":32}},"text":" return '[' +"},{"action":"insertText","range":{"start":{"row":75,"column":19},"end":{"row":75,"column":20}},"text":"r"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":75,"column":20},"end":{"row":75,"column":21}},"text":"e"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":75,"column":21},"end":{"row":75,"column":22}},"text":"t"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":75,"column":22},"end":{"row":75,"column":23}},"text":"="}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":75,"column":22},"end":{"row":75,"column":23}},"text":" "}]}],[{"group":"doc","deltas":[{"action":"removeText","range":{"start":{"row":75,"column":47},"end":{"row":75,"column":48}},"text":"'"}]}],[{"group":"doc","deltas":[{"action":"removeText","range":{"start":{"row":75,"column":46},"end":{"row":75,"column":47}},"text":"]"}]}],[{"group":"doc","deltas":[{"action":"removeText","range":{"start":{"row":75,"column":45},"end":{"row":75,"column":46}},"text":"'"}]}],[{"group":"doc","deltas":[{"action":"removeText","range":{"start":{"row":75,"column":44},"end":{"row":75,"column":45}},"text":" "}]}],[{"group":"doc","deltas":[{"action":"removeText","range":{"start":{"row":75,"column":43},"end":{"row":75,"column":44}},"text":"+"}]}],[{"group":"doc","deltas":[{"action":"removeText","range":{"start":{"row":75,"column":42},"end":{"row":75,"column":43}},"text":" "}]}],[{"group":"doc","deltas":[{"action":"removeText","range":{"start":{"row":76,"column":20},"end":{"row":76,"column":42}},"text":"ret = aCls.join(' ') ;"}]}],[{"group":"doc","deltas":[{"action":"removeText","range":{"start":{"row":76,"column":16},"end":{"row":76,"column":20}},"text":" "}]}],[{"group":"doc","deltas":[{"action":"removeText","range":{"start":{"row":76,"column":12},"end":{"row":76,"column":16}},"text":" "}]}],[{"group":"doc","deltas":[{"action":"removeText","range":{"start":{"row":76,"column":8},"end":{"row":76,"column":12}},"text":" "}]}],[{"group":"doc","deltas":[{"action":"removeText","range":{"start":{"row":76,"column":4},"end":{"row":76,"column":8}},"text":" "}]}],[{"group":"doc","deltas":[{"action":"removeText","range":{"start":{"row":76,"column":0},"end":{"row":76,"column":4}},"text":" "}]}],[{"group":"doc","deltas":[{"action":"removeText","range":{"start":{"row":76,"column":0},"end":{"row":76,"column":4}},"text":" "},{"action":"removeText","range":{"start":{"row":75,"column":43},"end":{"row":76,"column":0}},"text":"\n"}]}],[{"group":"doc","deltas":[{"action":"removeText","range":{"start":{"row":75,"column":38},"end":{"row":75,"column":39}},"text":","}]}]]},"ace":{"folds":[],"scrolltop":840,"scrollleft":0,"selection":{"start":{"row":75,"column":38},"end":{"row":75,"column":38},"isBackwards":false},"options":{"guessTabSize":true,"useWrapMode":false,"wrapToView":true},"firstLineState":{"row":59,"state":"start","mode":"ace/mode/javascript"}},"timestamp":1411661873730,"hash":"dd5f27b080b781d8f403a839dca86b5239a72fc7"}
{"filter":false,"title":"nant.js","tooltip":"/nant.js","undoManager":{"mark":100,"position":100,"stack":[[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":68,"column":71},"end":{"row":68,"column":72}},"text":" "}]}],[{"group":"doc","deltas":[{"action":"removeText","range":{"start":{"row":68,"column":71},"end":{"row":68,"column":72}},"text":" "}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":68,"column":71},"end":{"row":68,"column":72}},"text":","}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":68,"column":72},"end":{"row":68,"column":73}},"text":" "}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":68,"column":73},"end":{"row":68,"column":74}},"text":"t"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":68,"column":74},"end":{"row":68,"column":75}},"text":"."}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":68,"column":75},"end":{"row":68,"column":76}},"text":"n"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":68,"column":76},"end":{"row":68,"column":77}},"text":"a"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":68,"column":77},"end":{"row":68,"column":78}},"text":"m"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":68,"column":78},"end":{"row":68,"column":79}},"text":"e"}]}],[{"group":"doc","deltas":[{"action":"removeText","range":{"start":{"row":68,"column":75},"end":{"row":68,"column":79}},"text":"name"}]}],[{"group":"doc","deltas":[{"action":"removeText","range":{"start":{"row":68,"column":74},"end":{"row":68,"column":75}},"text":"."}]}],[{"group":"doc","deltas":[{"action":"removeText","range":{"start":{"row":68,"column":73},"end":{"row":68,"column":74}},"text":"t"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":68,"column":73},"end":{"row":68,"column":74}},"text":"j"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":68,"column":74},"end":{"row":68,"column":75}},"text":"s"}]}],[{"group":"doc","deltas":[{"action":"removeText","range":{"start":{"row":68,"column":74},"end":{"row":68,"column":75}},"text":"s"}]}],[{"group":"doc","deltas":[{"action":"removeText","range":{"start":{"row":68,"column":73},"end":{"row":68,"column":74}},"text":"j"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":68,"column":73},"end":{"row":68,"column":74}},"text":"J"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":68,"column":74},"end":{"row":68,"column":75}},"text":"S"}]}],[{"group":"doc","deltas":[{"action":"removeText","range":{"start":{"row":68,"column":73},"end":{"row":68,"column":75}},"text":"JS"},{"action":"insertText","range":{"start":{"row":68,"column":73},"end":{"row":68,"column":77}},"text":"JSON"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":68,"column":77},"end":{"row":68,"column":78}},"text":"."}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":68,"column":78},"end":{"row":68,"column":79}},"text":"s"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":68,"column":79},"end":{"row":68,"column":80}},"text":"t"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":68,"column":80},"end":{"row":68,"column":81}},"text":"r"}]}],[{"group":"doc","deltas":[{"action":"removeText","range":{"start":{"row":68,"column":78},"end":{"row":68,"column":81}},"text":"str"},{"action":"insertText","range":{"start":{"row":68,"column":78},"end":{"row":68,"column":89}},"text":"stringify()"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":68,"column":88},"end":{"row":68,"column":89}},"text":"t"}]}],[{"group":"doc","deltas":[{"action":"removeText","range":{"start":{"row":68,"column":20},"end":{"row":68,"column":91}},"text":"if( t.attrs === undefined ) console.log('undefined', JSON.stringify(t))"}]}],[{"group":"doc","deltas":[{"action":"removeText","range":{"start":{"row":68,"column":16},"end":{"row":68,"column":20}},"text":" "}]}],[{"group":"doc","deltas":[{"action":"removeText","range":{"start":{"row":68,"column":12},"end":{"row":68,"column":16}},"text":" "}]}],[{"group":"doc","deltas":[{"action":"removeText","range":{"start":{"row":68,"column":8},"end":{"row":68,"column":12}},"text":" "}]}],[{"group":"doc","deltas":[{"action":"removeText","range":{"start":{"row":68,"column":4},"end":{"row":68,"column":8}},"text":" "}]}],[{"group":"doc","deltas":[{"action":"removeText","range":{"start":{"row":68,"column":0},"end":{"row":68,"column":4}},"text":" "}]}],[{"group":"doc","deltas":[{"action":"removeText","range":{"start":{"row":67,"column":50},"end":{"row":68,"column":0}},"text":"\n"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":45,"column":12},"end":{"row":45,"column":13}},"text":" "}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":44,"column":42},"end":{"row":45,"column":0}},"text":"\n"},{"action":"insertText","range":{"start":{"row":45,"column":0},"end":{"row":45,"column":8}},"text":" "}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":45,"column":8},"end":{"row":45,"column":79}},"text":"if( t.attrs === undefined ) console.log('undefined', JSON.stringify(t))"}]}],[{"group":"doc","deltas":[{"action":"removeText","range":{"start":{"row":45,"column":8},"end":{"row":45,"column":36}},"text":"if( t.attrs === undefined ) "}]}],[{"group":"doc","deltas":[{"action":"removeText","range":{"start":{"row":45,"column":21},"end":{"row":45,"column":30}},"text":"undefined"},{"action":"insertText","range":{"start":{"row":45,"column":21},"end":{"row":45,"column":22}},"text":"m"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":45,"column":22},"end":{"row":45,"column":23}},"text":"a"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":45,"column":23},"end":{"row":45,"column":24}},"text":"t"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":45,"column":24},"end":{"row":45,"column":25}},"text":"c"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":45,"column":25},"end":{"row":45,"column":26}},"text":"h"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":45,"column":26},"end":{"row":45,"column":27}},"text":" "}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":45,"column":47},"end":{"row":45,"column":48}},"text":","}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":45,"column":48},"end":{"row":45,"column":49}},"text":" "}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":45,"column":49},"end":{"row":45,"column":51}},"text":"''"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":45,"column":50},"end":{"row":45,"column":51}},"text":" "}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":45,"column":51},"end":{"row":45,"column":52}},"text":"w"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":45,"column":52},"end":{"row":45,"column":53}},"text":"i"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":45,"column":53},"end":{"row":45,"column":54}},"text":"t"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":45,"column":54},"end":{"row":45,"column":55}},"text":"h"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":45,"column":55},"end":{"row":45,"column":56}},"text":" "}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":45,"column":57},"end":{"row":45,"column":58}},"text":","}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":45,"column":58},"end":{"row":45,"column":59}},"text":" "}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":45,"column":59},"end":{"row":45,"column":60}},"text":"s"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":45,"column":60},"end":{"row":45,"column":61}},"text":"e"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":45,"column":61},"end":{"row":45,"column":62}},"text":"l"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":45,"column":62},"end":{"row":45,"column":63}},"text":"e"}]}],[{"group":"doc","deltas":[{"action":"removeText","range":{"start":{"row":45,"column":59},"end":{"row":45,"column":63}},"text":"sele"},{"action":"insertText","range":{"start":{"row":45,"column":59},"end":{"row":45,"column":67}},"text":"selector"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":45,"column":46},"end":{"row":45,"column":47}},"text":"a"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":45,"column":47},"end":{"row":45,"column":48}},"text":"g"}]}],[{"group":"doc","deltas":[{"action":"removeText","range":{"start":{"row":45,"column":30},"end":{"row":45,"column":45}},"text":"JSON.stringify("}]}],[{"group":"doc","deltas":[{"action":"removeText","range":{"start":{"row":45,"column":33},"end":{"row":45,"column":34}},"text":")"}]}],[{"group":"doc","deltas":[{"action":"removeText","range":{"start":{"row":45,"column":21},"end":{"row":45,"column":26}},"text":"match"},{"action":"insertText","range":{"start":{"row":45,"column":21},"end":{"row":45,"column":22}},"text":"t"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":45,"column":22},"end":{"row":45,"column":23}},"text":"a"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":45,"column":23},"end":{"row":45,"column":24}},"text":"g"}]}],[{"group":"doc","deltas":[{"action":"removeText","range":{"start":{"row":45,"column":35},"end":{"row":45,"column":39}},"text":"with"},{"action":"insertText","range":{"start":{"row":45,"column":35},"end":{"row":45,"column":36}},"text":"i"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":45,"column":36},"end":{"row":45,"column":37}},"text":"n"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":45,"column":37},"end":{"row":45,"column":38}},"text":"s"}]}],[{"group":"doc","deltas":[{"action":"removeText","range":{"start":{"row":45,"column":35},"end":{"row":45,"column":38}},"text":"ins"},{"action":"insertText","range":{"start":{"row":45,"column":35},"end":{"row":45,"column":45}},"text":"instanceof"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":45,"column":45},"end":{"row":45,"column":46}},"text":" "}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":45,"column":46},"end":{"row":45,"column":47}},"text":"T"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":45,"column":47},"end":{"row":45,"column":48}},"text":"a"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":45,"column":48},"end":{"row":45,"column":49}},"text":"g"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":45,"column":49},"end":{"row":45,"column":50}},"text":" "}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":45,"column":50},"end":{"row":45,"column":51}},"text":":"}]}],[{"group":"doc","deltas":[{"action":"removeText","range":{"start":{"row":45,"column":55},"end":{"row":45,"column":63}},"text":"selector"},{"action":"insertText","range":{"start":{"row":45,"column":55},"end":{"row":45,"column":56}},"text":"!"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":45,"column":56},"end":{"row":45,"column":57}},"text":"!"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":45,"column":57},"end":{"row":45,"column":58}},"text":"t"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":45,"column":58},"end":{"row":45,"column":59}},"text":"a"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":45,"column":59},"end":{"row":45,"column":60}},"text":"g"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":45,"column":60},"end":{"row":45,"column":61}},"text":"."}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":45,"column":61},"end":{"row":45,"column":62}},"text":"i"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":45,"column":62},"end":{"row":45,"column":63}},"text":"n"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":45,"column":63},"end":{"row":45,"column":64}},"text":"s"}]}],[{"group":"doc","deltas":[{"action":"removeText","range":{"start":{"row":45,"column":61},"end":{"row":45,"column":64}},"text":"ins"},{"action":"insertText","range":{"start":{"row":45,"column":61},"end":{"row":45,"column":71}},"text":"instanceof"}]}],[{"group":"doc","deltas":[{"action":"removeText","range":{"start":{"row":45,"column":60},"end":{"row":45,"column":61}},"text":"."}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":45,"column":60},"end":{"row":45,"column":61}},"text":" "}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":45,"column":71},"end":{"row":45,"column":72}},"text":" "}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":45,"column":72},"end":{"row":45,"column":73}},"text":"T"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":45,"column":73},"end":{"row":45,"column":74}},"text":"a"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":45,"column":74},"end":{"row":45,"column":75}},"text":"g"}]}],[{"group":"doc","deltas":[{"action":"removeText","range":{"start":{"row":45,"column":56},"end":{"row":45,"column":57}},"text":"!"}]}],[{"group":"doc","deltas":[{"action":"removeText","range":{"start":{"row":45,"column":55},"end":{"row":45,"column":56}},"text":"!"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":46,"column":13},"end":{"row":46,"column":14}},"text":"("}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":46,"column":32},"end":{"row":46,"column":33}},"text":")"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":46,"column":33},"end":{"row":46,"column":34}},"text":" "}]}],[{"group":"doc","deltas":[{"action":"removeText","range":{"start":{"row":45,"column":8},"end":{"row":45,"column":74}},"text":"console.log('tag ', tag, ' instanceof Tag : ', tag instanceof Tag)"}]}],[{"group":"doc","deltas":[{"action":"removeText","range":{"start":{"row":45,"column":4},"end":{"row":45,"column":8}},"text":" "}]}],[{"group":"doc","deltas":[{"action":"removeText","range":{"start":{"row":45,"column":0},"end":{"row":45,"column":4}},"text":" "}]}],[{"group":"doc","deltas":[{"action":"removeText","range":{"start":{"row":44,"column":42},"end":{"row":45,"column":0}},"text":"\n"}]}]]},"ace":{"folds":[{"start":{"row":2,"column":27},"end":{"row":6,"column":4},"placeholder":"..."},{"start":{"row":7,"column":29},"end":{"row":30,"column":4},"placeholder":"..."},{"start":{"row":83,"column":45},"end":{"row":97,"column":4},"placeholder":"..."},{"start":{"row":99,"column":22},"end":{"row":101,"column":4},"placeholder":"..."},{"start":{"row":102,"column":29},"end":{"row":104,"column":4},"placeholder":"..."},{"start":{"row":114,"column":46},"end":{"row":136,"column":4},"placeholder":"..."},{"start":{"row":137,"column":50},"end":{"row":147,"column":4},"placeholder":"..."},{"start":{"row":168,"column":46},"end":{"row":170,"column":4},"placeholder":"..."},{"start":{"row":215,"column":39},"end":{"row":243,"column":8},"placeholder":"..."},{"start":{"row":248,"column":41},"end":{"row":262,"column":4},"placeholder":"..."},{"start":{"row":263,"column":47},"end":{"row":276,"column":4},"placeholder":"..."},{"start":{"row":277,"column":43},"end":{"row":291,"column":4},"placeholder":"..."}],"scrolltop":145,"scrollleft":0,"selection":{"start":{"row":44,"column":42},"end":{"row":44,"column":42},"isBackwards":false},"options":{"guessTabSize":true,"useWrapMode":false,"wrapToView":true},"firstLineState":{"row":36,"state":"start","mode":"ace/mode/javascript"}},"timestamp":1412080462315,"hash":"672590ddc1ecc5b732c48e60a29a584b5a2e563b"}

@@ -1,1 +0,1 @@

{"filter":false,"title":"package.json","tooltip":"/package.json","undoManager":{"mark":1,"position":1,"stack":[[{"group":"doc","deltas":[{"action":"removeText","range":{"start":{"row":2,"column":18},"end":{"row":2,"column":19}},"text":"2"},{"action":"insertText","range":{"start":{"row":2,"column":18},"end":{"row":2,"column":19}},"text":"3"}]}],[{"group":"doc","deltas":[{"action":"removeText","range":{"start":{"row":2,"column":18},"end":{"row":2,"column":19}},"text":"3"},{"action":"insertText","range":{"start":{"row":2,"column":18},"end":{"row":2,"column":19}},"text":"4"}]}]]},"ace":{"folds":[],"scrolltop":0,"scrollleft":0,"selection":{"start":{"row":2,"column":19},"end":{"row":2,"column":19},"isBackwards":false},"options":{"guessTabSize":true,"useWrapMode":false,"wrapToView":true},"firstLineState":0},"timestamp":1411662405755,"hash":"636b07439bdd540d2844d6097021f00784c8f05a"}
{"filter":false,"title":"package.json","tooltip":"/package.json","undoManager":{"mark":2,"position":2,"stack":[[{"group":"doc","deltas":[{"action":"removeText","range":{"start":{"row":2,"column":16},"end":{"row":2,"column":17}},"text":"0"},{"action":"insertText","range":{"start":{"row":2,"column":16},"end":{"row":2,"column":17}},"text":"1"}]}],[{"group":"doc","deltas":[{"action":"removeText","range":{"start":{"row":2,"column":18},"end":{"row":2,"column":19}},"text":"4"},{"action":"insertText","range":{"start":{"row":2,"column":18},"end":{"row":2,"column":19}},"text":"0"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":2,"column":16},"end":{"row":2,"column":17}},"text":"0"},{"action":"removeText","range":{"start":{"row":2,"column":17},"end":{"row":2,"column":18}},"text":"1"},{"action":"insertText","range":{"start":{"row":2,"column":18},"end":{"row":2,"column":19}},"text":"4"},{"action":"removeText","range":{"start":{"row":2,"column":19},"end":{"row":2,"column":20}},"text":"0"},{"action":"removeText","range":{"start":{"row":2,"column":16},"end":{"row":2,"column":19}},"text":"0.4"},{"action":"insertText","range":{"start":{"row":2,"column":16},"end":{"row":2,"column":19}},"text":"1.0"}]}]]},"ace":{"folds":[],"scrolltop":0,"scrollleft":0,"selection":{"start":{"row":2,"column":16},"end":{"row":2,"column":16},"isBackwards":false},"options":{"guessTabSize":true,"useWrapMode":false,"wrapToView":true},"firstLineState":0},"timestamp":1412081139226,"hash":"d7299f665cddd9620aa47b232ebe94b83961e4d6"}

@@ -1,1 +0,1 @@

{"filter":false,"title":"README.md","tooltip":"/README.md","undoManager":{"mark":100,"position":100,"stack":[[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":0,"column":74},"end":{"row":0,"column":75}},"text":"r"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":0,"column":75},"end":{"row":0,"column":76}},"text":" "}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":0,"column":76},"end":{"row":0,"column":77}},"text":"a"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":0,"column":77},"end":{"row":0,"column":78}},"text":"n"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":0,"column":78},"end":{"row":0,"column":79}},"text":"d"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":0,"column":79},"end":{"row":0,"column":80}},"text":" "}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":0,"column":80},"end":{"row":0,"column":81}},"text":"s"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":0,"column":81},"end":{"row":0,"column":82}},"text":"e"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":0,"column":82},"end":{"row":0,"column":83}},"text":"r"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":0,"column":83},"end":{"row":0,"column":84}},"text":"v"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":0,"column":84},"end":{"row":0,"column":85}},"text":"e"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":0,"column":85},"end":{"row":0,"column":86}},"text":"r"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":0,"column":86},"end":{"row":0,"column":87}},"text":")"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":0,"column":87},"end":{"row":0,"column":88}},"text":"."}]}],[{"group":"doc","deltas":[{"action":"removeText","range":{"start":{"row":215,"column":0},"end":{"row":215,"column":8}},"text":" "},{"action":"removeText","range":{"start":{"row":214,"column":8},"end":{"row":214,"column":108}},"text":"// css classes can also be passed as conditional object { class1: condition, class2: condition, ...}"},{"action":"removeText","range":{"start":{"row":214,"column":8},"end":{"row":215,"column":0}},"text":"\n"}]}],[{"group":"doc","deltas":[{"action":"removeText","range":{"start":{"row":127,"column":0},"end":{"row":127,"column":17}},"text":"class can also be"},{"action":"insertText","range":{"start":{"row":127,"column":0},"end":{"row":127,"column":1}},"text":"p"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":127,"column":1},"end":{"row":127,"column":2}},"text":"r"}]}],[{"group":"doc","deltas":[{"action":"removeText","range":{"start":{"row":127,"column":1},"end":{"row":127,"column":2}},"text":"r"}]}],[{"group":"doc","deltas":[{"action":"removeText","range":{"start":{"row":127,"column":0},"end":{"row":127,"column":1}},"text":"p"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":127,"column":0},"end":{"row":127,"column":1}},"text":"o"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":127,"column":1},"end":{"row":127,"column":2}},"text":"r"}]}],[{"group":"doc","deltas":[{"action":"removeLines","range":{"start":{"row":125,"column":0},"end":{"row":126,"column":0}},"nl":"\n","lines":[""]}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":133,"column":3},"end":{"row":134,"column":0}},"text":"\n"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":134,"column":0},"end":{"row":135,"column":0}},"text":"\n"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":135,"column":0},"end":{"row":136,"column":0}},"text":"\n"},{"action":"insertLines","range":{"start":{"row":136,"column":0},"end":{"row":143,"column":0}},"lines":["or a conditional object, only members with a truthy value will be picked","","```javascript","ht.input({ class: { class1: true, class2: 1 > 2 })","```","```html","<input class=\"class1\">"]},{"action":"insertText","range":{"start":{"row":143,"column":0},"end":{"row":143,"column":3}},"text":"```"}]}],[{"group":"doc","deltas":[{"action":"removeText","range":{"start":{"row":136,"column":0},"end":{"row":136,"column":4}},"text":"or a"},{"action":"insertText","range":{"start":{"row":136,"column":0},"end":{"row":136,"column":1}},"text":"y"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":136,"column":1},"end":{"row":136,"column":2}},"text":"o"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":136,"column":2},"end":{"row":136,"column":3}},"text":"u"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":136,"column":3},"end":{"row":136,"column":4}},"text":" "}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":136,"column":4},"end":{"row":136,"column":5}},"text":"m"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":136,"column":5},"end":{"row":136,"column":6}},"text":"a"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":136,"column":6},"end":{"row":136,"column":7}},"text":"y"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":136,"column":7},"end":{"row":136,"column":8}},"text":" "}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":136,"column":8},"end":{"row":136,"column":9}},"text":"a"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":136,"column":9},"end":{"row":136,"column":10}},"text":"l"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":136,"column":10},"end":{"row":136,"column":11}},"text":"s"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":136,"column":11},"end":{"row":136,"column":12}},"text":"o"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":136,"column":12},"end":{"row":136,"column":13}},"text":" "}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":136,"column":13},"end":{"row":136,"column":14}},"text":"u"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":136,"column":14},"end":{"row":136,"column":15}},"text":"s"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":136,"column":15},"end":{"row":136,"column":16}},"text":"e"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":136,"column":16},"end":{"row":136,"column":17}},"text":" "}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":136,"column":17},"end":{"row":136,"column":18}},"text":"a"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":136,"column":18},"end":{"row":136,"column":19}},"text":"r"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":136,"column":19},"end":{"row":136,"column":20}},"text":"r"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":136,"column":20},"end":{"row":136,"column":21}},"text":"a"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":136,"column":21},"end":{"row":136,"column":22}},"text":"y"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":136,"column":22},"end":{"row":136,"column":23}},"text":" "}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":136,"column":23},"end":{"row":136,"column":24}},"text":"o"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":136,"column":24},"end":{"row":136,"column":25}},"text":"f"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":136,"column":25},"end":{"row":136,"column":26}},"text":" "}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":136,"column":26},"end":{"row":136,"column":27}},"text":"b"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":136,"column":27},"end":{"row":136,"column":28}},"text":"o"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":136,"column":28},"end":{"row":136,"column":29}},"text":"t"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":136,"column":29},"end":{"row":136,"column":30}},"text":"h"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":136,"column":31},"end":{"row":136,"column":32}},"text":"s"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":136,"column":32},"end":{"row":136,"column":33}},"text":"t"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":136,"column":33},"end":{"row":136,"column":34}},"text":"r"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":136,"column":34},"end":{"row":136,"column":35}},"text":"i"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":136,"column":35},"end":{"row":136,"column":36}},"text":"n"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":136,"column":36},"end":{"row":136,"column":37}},"text":"g"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":136,"column":37},"end":{"row":136,"column":38}},"text":"/"}]}],[{"group":"doc","deltas":[{"action":"removeText","range":{"start":{"row":136,"column":57},"end":{"row":136,"column":105}},"text":" only members with a truthy value will be picked"}]}],[{"group":"doc","deltas":[{"action":"removeText","range":{"start":{"row":136,"column":56},"end":{"row":136,"column":57}},"text":","}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":139,"column":9},"end":{"row":139,"column":10}},"text":"["}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":139,"column":10},"end":{"row":139,"column":11}},"text":" "}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":139,"column":11},"end":{"row":139,"column":12}},"text":"'"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":139,"column":12},"end":{"row":139,"column":13}},"text":"m"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":139,"column":13},"end":{"row":139,"column":14}},"text":"y"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":139,"column":14},"end":{"row":139,"column":15}},"text":"c"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":139,"column":15},"end":{"row":139,"column":16}},"text":"l"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":139,"column":16},"end":{"row":139,"column":17}},"text":"a"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":139,"column":17},"end":{"row":139,"column":18}},"text":"s"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":139,"column":18},"end":{"row":139,"column":19}},"text":"s"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":139,"column":19},"end":{"row":139,"column":20}},"text":"'"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":139,"column":20},"end":{"row":139,"column":21}},"text":","}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":139,"column":21},"end":{"row":139,"column":22}},"text":" "}]}],[{"group":"doc","deltas":[{"action":"removeText","range":{"start":{"row":129,"column":28},"end":{"row":129,"column":32}},"text":"true"},{"action":"insertText","range":{"start":{"row":129,"column":28},"end":{"row":129,"column":29}},"text":"1"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":129,"column":29},"end":{"row":129,"column":30}},"text":" "}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":129,"column":30},"end":{"row":129,"column":31}},"text":"<"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":129,"column":31},"end":{"row":129,"column":32}},"text":"2"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":129,"column":31},"end":{"row":129,"column":32}},"text":" "}]}],[{"group":"doc","deltas":[{"action":"removeText","range":{"start":{"row":139,"column":41},"end":{"row":139,"column":45}},"text":"true"},{"action":"insertText","range":{"start":{"row":139,"column":41},"end":{"row":139,"column":42}},"text":"1"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":139,"column":42},"end":{"row":139,"column":43}},"text":" "}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":139,"column":43},"end":{"row":139,"column":44}},"text":"<"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":139,"column":44},"end":{"row":139,"column":45}},"text":" "}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":139,"column":45},"end":{"row":139,"column":46}},"text":"2"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":142,"column":14},"end":{"row":142,"column":15}},"text":"m"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":142,"column":15},"end":{"row":142,"column":16}},"text":"y"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":142,"column":16},"end":{"row":142,"column":17}},"text":"c"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":142,"column":17},"end":{"row":142,"column":18}},"text":"l"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":142,"column":18},"end":{"row":142,"column":19}},"text":"a"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":142,"column":19},"end":{"row":142,"column":20}},"text":"s"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":142,"column":20},"end":{"row":142,"column":21}},"text":"s"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":142,"column":21},"end":{"row":142,"column":22}},"text":" "}]}],[{"group":"doc","deltas":[{"action":"removeLines","range":{"start":{"row":134,"column":0},"end":{"row":135,"column":0}},"nl":"\n","lines":[""]}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":138,"column":63},"end":{"row":138,"column":64}},"text":"]"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":138,"column":63},"end":{"row":138,"column":64}},"text":" "}]}],[{"group":"doc","deltas":[{"action":"removeText","range":{"start":{"row":138,"column":9},"end":{"row":138,"column":22}},"text":"[ 'myclass', "}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":138,"column":17},"end":{"row":138,"column":30}},"text":"[ 'myclass', "}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":138,"column":17},"end":{"row":138,"column":18}},"text":" "}]}]]},"ace":{"folds":[],"scrolltop":1543,"scrollleft":0,"selection":{"start":{"row":138,"column":66},"end":{"row":138,"column":66},"isBackwards":false},"options":{"guessTabSize":true,"useWrapMode":false,"wrapToView":true},"firstLineState":{"row":109,"state":"jscode-start","mode":"ace/mode/markdown"}},"timestamp":1411662306639,"hash":"865a80194c1e796ef36216250b06d96431fc72cd"}
{"filter":false,"title":"README.md","tooltip":"/README.md","undoManager":{"mark":100,"position":100,"stack":[[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":8,"column":15},"end":{"row":8,"column":16}},"text":"w"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":8,"column":16},"end":{"row":8,"column":17}},"text":"n"}]}],[{"group":"doc","deltas":[{"action":"removeText","range":{"start":{"row":8,"column":26},"end":{"row":8,"column":37}},"text":"in selected"},{"action":"insertText","range":{"start":{"row":8,"column":26},"end":{"row":8,"column":27}},"text":"t"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":8,"column":27},"end":{"row":8,"column":28}},"text":"o"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":8,"column":28},"end":{"row":8,"column":29}},"text":" "}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":8,"column":29},"end":{"row":8,"column":30}},"text":"s"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":8,"column":30},"end":{"row":8,"column":31}},"text":"p"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":8,"column":31},"end":{"row":8,"column":32}},"text":"e"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":8,"column":32},"end":{"row":8,"column":33}},"text":"c"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":8,"column":33},"end":{"row":8,"column":34}},"text":"i"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":8,"column":34},"end":{"row":8,"column":35}},"text":"f"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":8,"column":35},"end":{"row":8,"column":36}},"text":"i"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":8,"column":36},"end":{"row":8,"column":37}},"text":"c"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":8,"column":42},"end":{"row":8,"column":43}},"text":" "}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":8,"column":43},"end":{"row":8,"column":44}},"text":"u"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":8,"column":44},"end":{"row":8,"column":45}},"text":"s"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":8,"column":45},"end":{"row":8,"column":46}},"text":"i"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":8,"column":46},"end":{"row":8,"column":47}},"text":"n"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":8,"column":47},"end":{"row":8,"column":48}},"text":"g"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":8,"column":48},"end":{"row":8,"column":49}},"text":" "}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":8,"column":49},"end":{"row":8,"column":50}},"text":"M"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":8,"column":50},"end":{"row":8,"column":51}},"text":"i"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":8,"column":51},"end":{"row":8,"column":52}},"text":"s"}]}],[{"group":"doc","deltas":[{"action":"removeText","range":{"start":{"row":8,"column":51},"end":{"row":8,"column":52}},"text":"s"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":8,"column":51},"end":{"row":8,"column":52}},"text":"x"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":8,"column":52},"end":{"row":8,"column":53}},"text":"i"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":8,"column":53},"end":{"row":8,"column":54}},"text":"n"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":8,"column":54},"end":{"row":8,"column":55}},"text":"x"}]}],[{"group":"doc","deltas":[{"action":"removeText","range":{"start":{"row":8,"column":54},"end":{"row":8,"column":55}},"text":"x"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":8,"column":54},"end":{"row":8,"column":55}},"text":"s"}]}],[{"group":"doc","deltas":[{"action":"removeText","range":{"start":{"row":48,"column":0},"end":{"row":48,"column":3}},"text":"```"},{"action":"removeLines","range":{"start":{"row":29,"column":0},"end":{"row":48,"column":0}},"nl":"\n","lines":["###On the Browser :","","Just add `nant.js` to your includes.","","","```html","<html>","\t<head>","\t <script src=\"nant.js\"></script>","\t</head>","\t<body>","\t\t<div id=\"placeholder\">...</div>","\t\t<script>","\t\t\tvar el = document.getElementById('placeholder');","\t\t\tvar ht = nant.ht;","\t\t\tel.innerHTML = ht.p('this is as easy as writing javascript code').toString(); ","\t\t</script>","\t</body>","</html>"]}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":12,"column":0},"end":{"row":13,"column":0}},"text":"\n"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":13,"column":0},"end":{"row":14,"column":0}},"text":"\n"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":13,"column":0},"end":{"row":13,"column":19}},"text":"###On the Browser :"},{"action":"insertText","range":{"start":{"row":13,"column":19},"end":{"row":14,"column":0}},"text":"\n"},{"action":"insertLines","range":{"start":{"row":14,"column":0},"end":{"row":32,"column":0}},"lines":["","Just add `nant.js` to your includes.","","","```html","<html>","\t<head>","\t <script src=\"nant.js\"></script>","\t</head>","\t<body>","\t\t<div id=\"placeholder\">...</div>","\t\t<script>","\t\t\tvar el = document.getElementById('placeholder');","\t\t\tvar ht = nant.ht;","\t\t\tel.innerHTML = ht.p('this is as easy as writing javascript code').toString(); ","\t\t</script>","\t</body>","</html>"]},{"action":"insertText","range":{"start":{"row":32,"column":0},"end":{"row":32,"column":3}},"text":"```"}]}],[{"group":"doc","deltas":[{"action":"removeText","range":{"start":{"row":36,"column":0},"end":{"row":36,"column":10}},"text":"Install it"}]}],[{"group":"doc","deltas":[{"action":"removeLines","range":{"start":{"row":35,"column":0},"end":{"row":36,"column":0}},"nl":"\n","lines":[""]}]}],[{"group":"doc","deltas":[{"action":"removeText","range":{"start":{"row":34,"column":16},"end":{"row":35,"column":0}},"text":"\n"}]}],[{"group":"doc","deltas":[{"action":"removeText","range":{"start":{"row":40,"column":5},"end":{"row":40,"column":11}},"text":"use it"}]}],[{"group":"doc","deltas":[{"action":"removeText","range":{"start":{"row":40,"column":4},"end":{"row":40,"column":5}},"text":" "}]}],[{"group":"doc","deltas":[{"action":"removeText","range":{"start":{"row":15,"column":0},"end":{"row":15,"column":6}},"text":"Just a"},{"action":"insertText","range":{"start":{"row":15,"column":0},"end":{"row":15,"column":1}},"text":"a"}]}],[{"group":"doc","deltas":[{"action":"removeText","range":{"start":{"row":15,"column":0},"end":{"row":15,"column":1}},"text":"a"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":15,"column":0},"end":{"row":15,"column":1}},"text":"A"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":15,"column":0},"end":{"row":15,"column":1}},"text":"I"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":15,"column":1},"end":{"row":15,"column":2}},"text":"t"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":15,"column":2},"end":{"row":15,"column":3}},"text":"s"}]}],[{"group":"doc","deltas":[{"action":"removeText","range":{"start":{"row":15,"column":2},"end":{"row":15,"column":3}},"text":"s"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":15,"column":2},"end":{"row":15,"column":3}},"text":"'"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":15,"column":3},"end":{"row":15,"column":4}},"text":"s"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":15,"column":4},"end":{"row":15,"column":5}},"text":" "}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":15,"column":5},"end":{"row":15,"column":6}},"text":"j"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":15,"column":6},"end":{"row":15,"column":7}},"text":"u"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":15,"column":7},"end":{"row":15,"column":8}},"text":"s"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":15,"column":8},"end":{"row":15,"column":9}},"text":"t"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":15,"column":9},"end":{"row":15,"column":10}},"text":" "}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":15,"column":10},"end":{"row":15,"column":11}},"text":"o"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":15,"column":11},"end":{"row":15,"column":12}},"text":"n"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":15,"column":12},"end":{"row":15,"column":13}},"text":"e"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":15,"column":13},"end":{"row":15,"column":14}},"text":" "}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":15,"column":14},"end":{"row":15,"column":15}},"text":"f"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":15,"column":15},"end":{"row":15,"column":16}},"text":"l"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":15,"column":16},"end":{"row":15,"column":17}},"text":"e"}]}],[{"group":"doc","deltas":[{"action":"removeText","range":{"start":{"row":15,"column":16},"end":{"row":15,"column":17}},"text":"e"}]}],[{"group":"doc","deltas":[{"action":"removeText","range":{"start":{"row":15,"column":15},"end":{"row":15,"column":16}},"text":"l"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":15,"column":15},"end":{"row":15,"column":16}},"text":"i"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":15,"column":16},"end":{"row":15,"column":17}},"text":"l"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":15,"column":17},"end":{"row":15,"column":18}},"text":"e"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":15,"column":18},"end":{"row":15,"column":19}},"text":";"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":15,"column":19},"end":{"row":15,"column":20}},"text":" "}]}],[{"group":"doc","deltas":[{"action":"removeText","range":{"start":{"row":15,"column":20},"end":{"row":15,"column":21}},"text":"A"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":15,"column":20},"end":{"row":15,"column":21}},"text":"a"}]}],[{"group":"doc","deltas":[{"action":"removeText","range":{"start":{"row":15,"column":18},"end":{"row":15,"column":23}},"text":"; add"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":15,"column":18},"end":{"row":15,"column":19}},"text":" "}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":15,"column":19},"end":{"row":15,"column":20}},"text":"-"}]}],[{"group":"doc","deltas":[{"action":"removeText","range":{"start":{"row":15,"column":20},"end":{"row":15,"column":21}},"text":" "}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":15,"column":20},"end":{"row":15,"column":21}},"text":" "}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":15,"column":30},"end":{"row":15,"column":31}},"text":" "}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":15,"column":31},"end":{"row":15,"column":32}},"text":"-"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":15,"column":36},"end":{"row":15,"column":37}},"text":"i"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":15,"column":37},"end":{"row":15,"column":38}},"text":"m"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":15,"column":38},"end":{"row":15,"column":39}},"text":"p"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":15,"column":39},"end":{"row":15,"column":40}},"text":"o"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":15,"column":40},"end":{"row":15,"column":41}},"text":"r"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":15,"column":41},"end":{"row":15,"column":42}},"text":"t"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":15,"column":42},"end":{"row":15,"column":43}},"text":" "}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":15,"column":43},"end":{"row":15,"column":44}},"text":"i"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":15,"column":44},"end":{"row":15,"column":45}},"text":"n"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":15,"column":45},"end":{"row":15,"column":46}},"text":" "}]}],[{"group":"doc","deltas":[{"action":"removeText","range":{"start":{"row":15,"column":58},"end":{"row":15,"column":59}},"text":"s"}]}],[{"group":"doc","deltas":[{"action":"removeText","range":{"start":{"row":15,"column":57},"end":{"row":15,"column":58}},"text":"e"}]}],[{"group":"doc","deltas":[{"action":"removeText","range":{"start":{"row":15,"column":56},"end":{"row":15,"column":57}},"text":"d"}]}],[{"group":"doc","deltas":[{"action":"removeText","range":{"start":{"row":15,"column":55},"end":{"row":15,"column":56}},"text":"u"}]}],[{"group":"doc","deltas":[{"action":"removeText","range":{"start":{"row":15,"column":54},"end":{"row":15,"column":55}},"text":"l"}]}],[{"group":"doc","deltas":[{"action":"removeText","range":{"start":{"row":15,"column":53},"end":{"row":15,"column":54}},"text":"c"}]}],[{"group":"doc","deltas":[{"action":"removeText","range":{"start":{"row":15,"column":52},"end":{"row":15,"column":53}},"text":"n"}]}],[{"group":"doc","deltas":[{"action":"removeText","range":{"start":{"row":15,"column":51},"end":{"row":15,"column":52}},"text":"i"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":15,"column":51},"end":{"row":15,"column":52}},"text":"p"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":15,"column":52},"end":{"row":15,"column":53}},"text":"a"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":15,"column":53},"end":{"row":15,"column":54}},"text":"g"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":15,"column":54},"end":{"row":15,"column":55}},"text":"e"}]}],[{"group":"doc","deltas":[{"action":"removeText","range":{"start":{"row":0,"column":0},"end":{"row":0,"column":2}},"text":"**"},{"action":"insertText","range":{"start":{"row":0,"column":0},"end":{"row":0,"column":1}},"text":"`"},{"action":"removeText","range":{"start":{"row":0,"column":5},"end":{"row":0,"column":7}},"text":"**"},{"action":"insertText","range":{"start":{"row":0,"column":5},"end":{"row":0,"column":6}},"text":"`"},{"action":"removeText","range":{"start":{"row":6,"column":0},"end":{"row":6,"column":111}},"text":"- Tags are simple POJOs (Plain Old *Javascript* Object) and can be manipulated with ease before stringification"},{"action":"removeText","range":{"start":{"row":5,"column":37},"end":{"row":5,"column":61}},"text":"just old good javascript"},{"action":"removeText","range":{"start":{"row":5,"column":37},"end":{"row":6,"column":0}},"text":"\n"},{"action":"insertText","range":{"start":{"row":5,"column":37},"end":{"row":5,"column":58}},"text":"it's plain javascript"},{"action":"removeText","range":{"start":{"row":6,"column":31},"end":{"row":6,"column":58}},"text":"and programming techniques "},{"action":"removeText","range":{"start":{"row":14,"column":0},"end":{"row":14,"column":55}},"text":"It's just one file - `nant.js` - to import in your page"},{"action":"removeLines","range":{"start":{"row":8,"column":0},"end":{"row":14,"column":0}},"nl":"\n","lines":["","Get started","===========","","###On the Browser :",""]},{"action":"removeText","range":{"start":{"row":7,"column":2},"end":{"row":7,"column":55}},"text":"Attach your own methods to specific Tags using Mixins"},{"action":"removeText","range":{"start":{"row":7,"column":2},"end":{"row":8,"column":0}},"text":"\n"},{"action":"insertText","range":{"start":{"row":7,"column":2},"end":{"row":7,"column":52}},"text":"Mixins to separate UI concernes (styles, layout..)"},{"action":"insertText","range":{"start":{"row":7,"column":52},"end":{"row":8,"column":0}},"text":"\n"},{"action":"insertLines","range":{"start":{"row":8,"column":0},"end":{"row":29,"column":0}},"lines":["","Get started","===========","","###On the server","","Install it","","```","npm install nant","```","","Then use it","","```javascript","var ht = require('nant').ht;","var html = ht.p('this is as easy as writing javascript code');","```","","###On the Browser :",""]},{"action":"insertText","range":{"start":{"row":29,"column":0},"end":{"row":29,"column":35}},"text":"Just add `nant.js` to your includes"},{"action":"removeText","range":{"start":{"row":42,"column":68},"end":{"row":42,"column":79}},"text":".toString()"},{"action":"removeLines","range":{"start":{"row":47,"column":0},"end":{"row":63,"column":0}},"nl":"\n","lines":["","###On the server","","```","npm install nant","```","","Then","","```javascript","// get the Html Templates namespace","var ht = require('nant').ht;","var html = ht.p('this is as easy as writing javascript code').toString();","```","",""]},{"action":"removeText","range":{"start":{"row":46,"column":3},"end":{"row":47,"column":0}},"text":"\n"},{"action":"removeLines","range":{"start":{"row":48,"column":0},"end":{"row":49,"column":0}},"nl":"\n","lines":[""]},{"action":"removeText","range":{"start":{"row":49,"column":0},"end":{"row":49,"column":29}},"text":"============================="},{"action":"removeText","range":{"start":{"row":48,"column":16},"end":{"row":48,"column":44}},"text":" A new Templating Language ?"},{"action":"removeText","range":{"start":{"row":48,"column":16},"end":{"row":49,"column":0}},"text":"\n"},{"action":"insertText","range":{"start":{"row":48,"column":16},"end":{"row":49,"column":0}},"text":"\n"},{"action":"removeText","range":{"start":{"row":51,"column":4},"end":{"row":51,"column":5}},"text":"o"},{"action":"insertText","range":{"start":{"row":51,"column":5},"end":{"row":51,"column":6}},"text":"o"},{"action":"removeText","range":{"start":{"row":51,"column":9},"end":{"row":51,"column":21}},"text":" no; Instead"},{"action":"insertText","range":{"start":{"row":51,"column":9},"end":{"row":51,"column":64}},"text":", this is not a new templating language for javascript;"},{"action":"removeText","range":{"start":{"row":53,"column":34},"end":{"row":53,"column":62}},"text":" in the `ht` namespace and t"},{"action":"insertText","range":{"start":{"row":53,"column":34},"end":{"row":53,"column":100}},"text":". you simply use the appropriate tag name to build your template. "},{"action":"insertText","range":{"start":{"row":53,"column":100},"end":{"row":54,"column":0}},"text":"\n"},{"action":"insertLines","range":{"start":{"row":54,"column":0},"end":{"row":55,"column":0}},"lines":[""]},{"action":"insertText","range":{"start":{"row":55,"column":0},"end":{"row":55,"column":1}},"text":"T"},{"action":"removeText","range":{"start":{"row":58,"column":0},"end":{"row":58,"column":11}},"text":"var html = "},{"action":"removeText","range":{"start":{"row":60,"column":0},"end":{"row":60,"column":3}},"text":"```"},{"action":"removeLines","range":{"start":{"row":59,"column":0},"end":{"row":60,"column":0}},"nl":"\n","lines":["console.log( html );"]},{"action":"removeText","range":{"start":{"row":58,"column":60},"end":{"row":58,"column":72}},"text":".toString();"},{"action":"removeText","range":{"start":{"row":58,"column":60},"end":{"row":59,"column":0}},"text":"\n"},{"action":"insertText","range":{"start":{"row":58,"column":60},"end":{"row":58,"column":61}},"text":";"},{"action":"insertText","range":{"start":{"row":58,"column":61},"end":{"row":59,"column":0}},"text":"\n"},{"action":"insertLines","range":{"start":{"row":59,"column":0},"end":{"row":62,"column":0}},"lines":["```","","this will become"]},{"action":"removeText","range":{"start":{"row":70,"column":0},"end":{"row":70,"column":11}},"text":"var html = "},{"action":"removeText","range":{"start":{"row":87,"column":0},"end":{"row":87,"column":11}},"text":").toString("},{"action":"removeLines","range":{"start":{"row":71,"column":0},"end":{"row":87,"column":0}},"nl":"\n","lines":["console.log( html );","```","```html","<div class=\"myclass\" id=\"myid\" required>"," String body","</div>","```","","You can pass nested tags as body (note you don'need to call `toString()` on nested tags**)","","```javascript","ht.form({ id: 'myform', class: 'myclass' },"," ht.div("," ht.label('My Input'),"," ht.input({ name: 'myinput', placeholder: 'My Input' })"," )"]},{"action":"removeText","range":{"start":{"row":70,"column":55},"end":{"row":70,"column":67}},"text":".toString();"},{"action":"removeText","range":{"start":{"row":70,"column":55},"end":{"row":71,"column":0}},"text":"\n"},{"action":"insertText","range":{"start":{"row":70,"column":55},"end":{"row":70,"column":56}},"text":";"},{"action":"insertText","range":{"start":{"row":70,"column":56},"end":{"row":71,"column":0}},"text":"\n"},{"action":"insertLines","range":{"start":{"row":71,"column":0},"end":{"row":78,"column":0}},"lines":["```","","You can pass nested tags as body","","```javascript","ht.form({ id: 'myform', class: 'myclass' }, "," ht.input({ name: 'myinput' })"]},{"action":"removeText","range":{"start":{"row":81,"column":75},"end":{"row":81,"column":82}},"text":"parent "},{"action":"removeLines","range":{"start":{"row":82,"column":0},"end":{"row":83,"column":0}},"nl":"\n","lines":[""]},{"action":"removeText","range":{"start":{"row":89,"column":1},"end":{"row":89,"column":12}},"text":".toString()"},{"action":"removeText","range":{"start":{"row":100,"column":1},"end":{"row":100,"column":12}},"text":".toString()"},{"action":"removeText","range":{"start":{"row":113,"column":1},"end":{"row":113,"column":12}},"text":".toString()"},{"action":"removeLines","range":{"start":{"row":143,"column":0},"end":{"row":318,"column":0}},"nl":"\n","lines":["","------------------------------------------------------------------------------------------","","##Tag manipulation","","all methods of the `ht` namespace returns an objet of type `Tag`; ","","the `Tag`'s prototype exposes a few methods; this is useful if you want to manipulate the tag object before calling `.toString()`","","###.attr( attrName [, attrValue ] )","","get/set current attribute value","","```javascript","var div = ht.input({ name: 'myinput', class: 'myclass' });","","div.attr('name'); // 'myinput'","div.attr('class'); // ['myclass']","div.attr('name', 'newName'); // div.attr('name') === 'newName'","```","","note how class attribute was converted to an Array; internally all tags maintains an `Array` instance for `class` attribute","","","###.attr( [ attrName1, attrName2, ...] )","","When passed an array, returns an object with given attributes","","```javascript","var div = ht.input({ id:'myid', name: 'myname', placeholder: 'My Input' });","div.attr(['id', 'name']); // { id:'myid', name: 'myname' }","```","","###.attr( object )","","if you pass it an object, tag's attributes will be extended with object's members","","```javascript","var div = ht.input({ name: 'myinput', class: 'myclass' });","","div.attr({ id: 'myid', class: 'class1' });","div.attr('id'); // 'myid'","div.attr('class'); // ['myclass', 'class1']","```","","###.hasClass()","","used to check if tag instance references a css class","","```javascript","var div = ht.input({ name: 'myinput', class: ['myclass', { class1: 1 === 1, class2: 1 !== 1} ] });","","div.hasClass('myclass'); // true","div.hasClass('class1'); // true","div.hasClass('class2'); // false","div.hasClass('myclass class1'); // true","div.hasClass(['myclass', 'class2']); // false","```","","###.toggleClass()","","is another familiar method to to toggle on/off css class references","","```javascript","var div = ht.input({ name: 'myinput', class: ['myclass', { class1: 1 === 1, class2: 1 !== 1} ] });","","div.toggleClass('myclass'); ","// div.hasClass('myclass') == false","","div.toggleClass('class2', true); ","// div.hasClass('class2') == true","","div.toggleClass('class1', true); ","// nothing changes as class1 is already enabled","","div.toggleClass(['myclass', 'class2']); ","// div.hasClass('myclass') == true && div.hasClass('class2') == false","```","","###.match( selector )","","Another useful method to check weather a tag matches the given selector; note only a small subset of css selectors is supported at the moment","You can also supply a function (see example below) to perform tag matching","","exemple","```javascript","var divTag = ht.div({ id: 'mydiv', class: ['form', 'group', 'col'] });","var inputTag = ht.input({ id: 'myinput', class: ['control', 'col'] });","","// tag name selectors","divTag.match('div'); // true","inputTag.match('input'); // true","divTag.match('div, input'); // true","inputTag.match(['div', 'input']); // true","","// class names, ids","divTag.match('div.form'); // true","divTag.match('div.form.group'); // true","divTag.match('#mydiv'); // true","divTag.match('div#mydiv.form.col'); // true","divTag.match('*.col'); // true","inputTag.match('*.col'); // true","","// uses custom matching method","divTag.match( function(t) { return t.name === 'div' } );","```","","###.children( [ selector ] )","","returns all direct children of the current tag; if provided, selector will be used to filter out the result","","###.find( selector )","","returns all descendents (including non-direct children) matching the given selector","","","------------------------------------------------------------------------------------------------------------------------","","###Mixins","","Mixins allows attaching custom methods to selected tags","","for example, suppose you have a `data-model` attribute you want to apply to all input tags","","```javascript","//First you define you mixin function","function dataModel(model) {"," return this.attr({ dataModel: model });","}","","// Then you attach it to all <input/> tags","nant.mixin( 'input', dataModel );","```","","therefore you can call `input` tags with the `dataModel` method","```javascript","ht.input({ name: 'myinput' }).dataModel('mymodel');","```","```html","<input name=\"myinput\" data-model=\"mymodel\">","```","","the exact signature of the `nant.mixin()` method is","","`nant.mixin( selector, mixinFn, [mixinName] )`","","examples ","","```javascript","function dataModel() { ... }","","// define 'dataModel' methods on all <input/> and <select/> tags","nant.mixin( ['input', 'select'], dataModel );","```","","```javascript","function tagName(name) { "," this.attr('name', name);","}","","// define 'name' method on all tags","nant.mixin( '*', tagName, 'name' );","```","","```javascript","function cols(cols) { "," this.attr({ class: 'col-sm-'+cols);","}","","// define 'cols' method on all div tags with class 'form-group'","nant.mixin( function(tag) {"," return tag.name === 'div' && tag.hasClass('form-group');","}, cols );","```",""]},{"action":"removeText","range":{"start":{"row":142,"column":3},"end":{"row":143,"column":0}},"text":"\n"},{"action":"removeLines","range":{"start":{"row":186,"column":0},"end":{"row":208,"column":0}},"nl":"\n","lines":["-----------------------------------------------------------------------------------------------","","###Defining Custom Tags","=======================","","Simply, use `nant.makeTag` to make a tag builder function","","```javascript","// It's better to define custom tags in their own namespace","var ns = nant.ns = {};","// define your custom element inside the namespace","ns.myElement = nant.makeTag('MyElement', isVoid)","","//Later you can use your tag function","var myHtml = ht.div("," ns.myElement({ ...}, body )",")","```","","If `isVoid` parameter is true, then any body provided to the tag function will be ignored and closing tag (`</myelement>`) will not be generated upon tag stringification","",""]},{"action":"insertText","range":{"start":{"row":237,"column":0},"end":{"row":237,"column":86}},"text":"--------------------------------------------------------------------------------------"},{"action":"insertText","range":{"start":{"row":237,"column":86},"end":{"row":238,"column":0}},"text":"\n"},{"action":"insertLines","range":{"start":{"row":238,"column":0},"end":{"row":241,"column":0}},"lines":["","Mixins","======"]},{"action":"insertText","range":{"start":{"row":248,"column":0},"end":{"row":248,"column":83}},"text":"Response is `Mixins`. a mixin allows us to apply transformations to a prebuilt Tag."},{"action":"insertText","range":{"start":{"row":248,"column":83},"end":{"row":249,"column":0}},"text":"\n"},{"action":"insertLines","range":{"start":{"row":249,"column":0},"end":{"row":251,"column":0}},"lines":["","So we can rewrite the bootstrap form example as follow"]},{"action":"removeText","range":{"start":{"row":262,"column":26},"end":{"row":262,"column":30}},"text":"attr"},{"action":"insertText","range":{"start":{"row":262,"column":26},"end":{"row":262,"column":31}},"text":"mixin"},{"action":"removeText","range":{"start":{"row":264,"column":22},"end":{"row":264,"column":26}},"text":"attr"},{"action":"insertText","range":{"start":{"row":264,"column":22},"end":{"row":264,"column":27}},"text":"mixin"},{"action":"removeText","range":{"start":{"row":266,"column":22},"end":{"row":266,"column":26}},"text":"attr"},{"action":"insertText","range":{"start":{"row":266,"column":22},"end":{"row":266,"column":27}},"text":"mixin"},{"action":"removeText","range":{"start":{"row":304,"column":22},"end":{"row":304,"column":26}},"text":"attr"},{"action":"insertText","range":{"start":{"row":304,"column":22},"end":{"row":304,"column":27}},"text":"mixin"},{"action":"removeText","range":{"start":{"row":306,"column":22},"end":{"row":306,"column":26}},"text":"attr"},{"action":"insertText","range":{"start":{"row":306,"column":22},"end":{"row":306,"column":27}},"text":"mixin"},{"action":"insertText","range":{"start":{"row":324,"column":139},"end":{"row":325,"column":0}},"text":"\n"},{"action":"insertLines","range":{"start":{"row":325,"column":0},"end":{"row":375,"column":0}},"lines":["","Above w've seen **attribute mixins**. They are quite simple to use, you pass in an attribute definition; the `mixin` function extendsthe tag's attributes with the new ones.","","Well there is also **function mixins**: you can provide the `mixin` method with your own function; it will be called then with tag object as parameter.","","","```javascript","function myMixin(tag) {"," // do something cool ..."," // don't forget to return"," return tag;","}","","ht.div(/* ... */).mixin( myMixin );","```","","so basically, the mixin function take a tag parameter, applies whatever transformations to it and then return :","","- either the same tag (generally when transformations are limited to attributes manipulation)","- or even another new constructed tag (for example wrap an `input` tag with a `div`)","","There is no limit of what you can do with function mixins just beware to always return a meaningful value (generally this will be a `Tag` object)","","---------------------------------------------------------------------------------","","Custom Tags","===========","","All exemples above simply define custom functions that return well known html tags; but you can also define your own custom tags that follows the html syntax rules. This maybe even necessary if you're working with some third party lib that requires custom tags (like `angularjs`).","","Use `nant.makeTag` to make a tag builder function","","```javascript","// define your namespace","var ns = nant.ns = {};","// define your custom element inside the namespace","ns.myElement = nant.makeTag('MyElement', isVoid)","","//Later you can use your tag function","var myHtml = ht.div("," ns.myElement({ ...}, body )",")","```","If `isVoid` parameter is true, then any body provided to the tag function will be ignored and closing tag (`</myelement>`) will not be generated upon tag stringification","","","","","",""]}]}],[{"group":"doc","deltas":[{"action":"removeText","range":{"start":{"row":0,"column":0},"end":{"row":0,"column":1}},"text":"`"},{"action":"insertText","range":{"start":{"row":0,"column":0},"end":{"row":0,"column":2}},"text":"**"},{"action":"removeText","range":{"start":{"row":0,"column":6},"end":{"row":0,"column":7}},"text":"`"},{"action":"insertText","range":{"start":{"row":0,"column":6},"end":{"row":0,"column":8}},"text":"**"},{"action":"removeText","range":{"start":{"row":5,"column":37},"end":{"row":5,"column":58}},"text":"it's plain javascript"},{"action":"insertText","range":{"start":{"row":5,"column":37},"end":{"row":5,"column":61}},"text":"just old good javascript"},{"action":"insertText","range":{"start":{"row":5,"column":61},"end":{"row":6,"column":0}},"text":"\n"},{"action":"insertText","range":{"start":{"row":6,"column":0},"end":{"row":6,"column":111}},"text":"- Tags are simple POJOs (Plain Old *Javascript* Object) and can be manipulated with ease before stringification"},{"action":"insertText","range":{"start":{"row":7,"column":31},"end":{"row":7,"column":58}},"text":"and programming techniques "},{"action":"removeText","range":{"start":{"row":30,"column":0},"end":{"row":30,"column":8}},"text":"Just add"},{"action":"removeLines","range":{"start":{"row":9,"column":0},"end":{"row":30,"column":0}},"nl":"\n","lines":["","Get started","===========","","###On the server","","Install it","","```","npm install nant","```","","Then use it","","```javascript","var ht = require('nant').ht;","var html = ht.p('this is as easy as writing javascript code');","```","","###On the Browser :",""]},{"action":"removeText","range":{"start":{"row":8,"column":2},"end":{"row":8,"column":52}},"text":"Mixins to separate UI concernes (styles, layout..)"},{"action":"removeText","range":{"start":{"row":8,"column":2},"end":{"row":9,"column":0}},"text":"\n"},{"action":"insertText","range":{"start":{"row":8,"column":2},"end":{"row":8,"column":55}},"text":"Attach your own methods to specific Tags using Mixins"},{"action":"insertText","range":{"start":{"row":8,"column":55},"end":{"row":9,"column":0}},"text":"\n"},{"action":"insertLines","range":{"start":{"row":9,"column":0},"end":{"row":15,"column":0}},"lines":["","Get started","===========","","###On the Browser :",""]},{"action":"insertText","range":{"start":{"row":15,"column":0},"end":{"row":15,"column":20}},"text":"It's just one file -"},{"action":"insertText","range":{"start":{"row":15,"column":30},"end":{"row":15,"column":32}},"text":" -"},{"action":"removeText","range":{"start":{"row":15,"column":36},"end":{"row":15,"column":49}},"text":"your includes"},{"action":"insertText","range":{"start":{"row":15,"column":36},"end":{"row":15,"column":55}},"text":"import in your page"},{"action":"insertText","range":{"start":{"row":28,"column":68},"end":{"row":28,"column":79}},"text":".toString()"},{"action":"insertText","range":{"start":{"row":32,"column":3},"end":{"row":33,"column":0}},"text":"\n"},{"action":"insertLines","range":{"start":{"row":33,"column":0},"end":{"row":49,"column":0}},"lines":["","###On the server","","```","npm install nant","```","","Then","","```javascript","// get the Html Templates namespace","var ht = require('nant').ht;","var html = ht.p('this is as easy as writing javascript code').toString();","```","",""]},{"action":"insertText","range":{"start":{"row":51,"column":0},"end":{"row":52,"column":0}},"text":"\n"},{"action":"removeText","range":{"start":{"row":52,"column":16},"end":{"row":53,"column":0}},"text":"\n"},{"action":"insertText","range":{"start":{"row":52,"column":16},"end":{"row":52,"column":44}},"text":" A new Templating Language ?"},{"action":"insertText","range":{"start":{"row":52,"column":44},"end":{"row":53,"column":0}},"text":"\n"},{"action":"insertText","range":{"start":{"row":53,"column":0},"end":{"row":53,"column":29}},"text":"============================="},{"action":"removeText","range":{"start":{"row":55,"column":4},"end":{"row":55,"column":5}},"text":"u"},{"action":"insertText","range":{"start":{"row":55,"column":5},"end":{"row":55,"column":6}},"text":"u"},{"action":"removeText","range":{"start":{"row":55,"column":9},"end":{"row":55,"column":64}},"text":", this is not a new templating language for javascript;"},{"action":"insertText","range":{"start":{"row":55,"column":9},"end":{"row":55,"column":21}},"text":" no; Instead"},{"action":"removeText","range":{"start":{"row":59,"column":0},"end":{"row":59,"column":1}},"text":"T"},{"action":"removeLines","range":{"start":{"row":58,"column":0},"end":{"row":59,"column":0}},"nl":"\n","lines":[""]},{"action":"removeText","range":{"start":{"row":57,"column":34},"end":{"row":57,"column":100}},"text":". you simply use the appropriate tag name to build your template. "},{"action":"removeText","range":{"start":{"row":57,"column":34},"end":{"row":58,"column":0}},"text":"\n"},{"action":"insertText","range":{"start":{"row":57,"column":34},"end":{"row":57,"column":62}},"text":" in the `ht` namespace and t"},{"action":"insertText","range":{"start":{"row":60,"column":0},"end":{"row":60,"column":11}},"text":"var html = "},{"action":"removeLines","range":{"start":{"row":61,"column":0},"end":{"row":64,"column":0}},"nl":"\n","lines":["```","","this will become"]},{"action":"removeText","range":{"start":{"row":60,"column":71},"end":{"row":60,"column":72}},"text":";"},{"action":"removeText","range":{"start":{"row":60,"column":71},"end":{"row":61,"column":0}},"text":"\n"},{"action":"insertText","range":{"start":{"row":60,"column":71},"end":{"row":60,"column":83}},"text":".toString();"},{"action":"insertText","range":{"start":{"row":60,"column":83},"end":{"row":61,"column":0}},"text":"\n"},{"action":"insertLines","range":{"start":{"row":61,"column":0},"end":{"row":62,"column":0}},"lines":["console.log( html );"]},{"action":"insertText","range":{"start":{"row":62,"column":0},"end":{"row":62,"column":3}},"text":"```"},{"action":"insertText","range":{"start":{"row":70,"column":0},"end":{"row":70,"column":11}},"text":"var html = "},{"action":"removeLines","range":{"start":{"row":71,"column":0},"end":{"row":78,"column":0}},"nl":"\n","lines":["```","","You can pass nested tags as body","","```javascript","ht.form({ id: 'myform', class: 'myclass' }, "," ht.input({ name: 'myinput' })"]},{"action":"removeText","range":{"start":{"row":70,"column":66},"end":{"row":70,"column":67}},"text":";"},{"action":"removeText","range":{"start":{"row":70,"column":66},"end":{"row":71,"column":0}},"text":"\n"},{"action":"insertText","range":{"start":{"row":70,"column":66},"end":{"row":70,"column":78}},"text":".toString();"},{"action":"insertText","range":{"start":{"row":70,"column":78},"end":{"row":71,"column":0}},"text":"\n"},{"action":"insertLines","range":{"start":{"row":71,"column":0},"end":{"row":87,"column":0}},"lines":["console.log( html );","```","```html","<div class=\"myclass\" id=\"myid\" required>"," String body","</div>","```","","You can pass nested tags as body (note you don'need to call `toString()` on nested tags**)","","```javascript","ht.form({ id: 'myform', class: 'myclass' },"," ht.div("," ht.label('My Input'),"," ht.input({ name: 'myinput', placeholder: 'My Input' })"," )"]},{"action":"insertText","range":{"start":{"row":87,"column":0},"end":{"row":87,"column":11}},"text":").toString("},{"action":"insertText","range":{"start":{"row":90,"column":75},"end":{"row":90,"column":82}},"text":"parent "},{"action":"insertText","range":{"start":{"row":91,"column":0},"end":{"row":92,"column":0}},"text":"\n"},{"action":"insertText","range":{"start":{"row":99,"column":1},"end":{"row":99,"column":12}},"text":".toString()"},{"action":"insertText","range":{"start":{"row":110,"column":1},"end":{"row":110,"column":12}},"text":".toString()"},{"action":"insertText","range":{"start":{"row":123,"column":1},"end":{"row":123,"column":12}},"text":".toString()"},{"action":"insertText","range":{"start":{"row":152,"column":3},"end":{"row":153,"column":0}},"text":"\n"},{"action":"insertLines","range":{"start":{"row":153,"column":0},"end":{"row":328,"column":0}},"lines":["","------------------------------------------------------------------------------------------","","##Tag manipulation","","all methods of the `ht` namespace returns an objet of type `Tag`; ","","the `Tag`'s prototype exposes a few methods; this is useful if you want to manipulate the tag object before calling `.toString()`","","###.attr( attrName [, attrValue ] )","","get/set current attribute value","","```javascript","var div = ht.input({ name: 'myinput', class: 'myclass' });","","div.attr('name'); // 'myinput'","div.attr('class'); // ['myclass']","div.attr('name', 'newName'); // div.attr('name') === 'newName'","```","","note how class attribute was converted to an Array; internally all tags maintains an `Array` instance for `class` attribute","","","###.attr( [ attrName1, attrName2, ...] )","","When passed an array, returns an object with given attributes","","```javascript","var div = ht.input({ id:'myid', name: 'myname', placeholder: 'My Input' });","div.attr(['id', 'name']); // { id:'myid', name: 'myname' }","```","","###.attr( object )","","if you pass it an object, tag's attributes will be extended with object's members","","```javascript","var div = ht.input({ name: 'myinput', class: 'myclass' });","","div.attr({ id: 'myid', class: 'class1' });","div.attr('id'); // 'myid'","div.attr('class'); // ['myclass', 'class1']","```","","###.hasClass()","","used to check if tag instance references a css class","","```javascript","var div = ht.input({ name: 'myinput', class: ['myclass', { class1: 1 === 1, class2: 1 !== 1} ] });","","div.hasClass('myclass'); // true","div.hasClass('class1'); // true","div.hasClass('class2'); // false","div.hasClass('myclass class1'); // true","div.hasClass(['myclass', 'class2']); // false","```","","###.toggleClass()","","is another familiar method to to toggle on/off css class references","","```javascript","var div = ht.input({ name: 'myinput', class: ['myclass', { class1: 1 === 1, class2: 1 !== 1} ] });","","div.toggleClass('myclass'); ","// div.hasClass('myclass') == false","","div.toggleClass('class2', true); ","// div.hasClass('class2') == true","","div.toggleClass('class1', true); ","// nothing changes as class1 is already enabled","","div.toggleClass(['myclass', 'class2']); ","// div.hasClass('myclass') == true && div.hasClass('class2') == false","```","","###.match( selector )","","Another useful method to check weather a tag matches the given selector; note only a small subset of css selectors is supported at the moment","You can also supply a function (see example below) to perform tag matching","","exemple","```javascript","var divTag = ht.div({ id: 'mydiv', class: ['form', 'group', 'col'] });","var inputTag = ht.input({ id: 'myinput', class: ['control', 'col'] });","","// tag name selectors","divTag.match('div'); // true","inputTag.match('input'); // true","divTag.match('div, input'); // true","inputTag.match(['div', 'input']); // true","","// class names, ids","divTag.match('div.form'); // true","divTag.match('div.form.group'); // true","divTag.match('#mydiv'); // true","divTag.match('div#mydiv.form.col'); // true","divTag.match('*.col'); // true","inputTag.match('*.col'); // true","","// uses custom matching method","divTag.match( function(t) { return t.name === 'div' } );","```","","###.children( [ selector ] )","","returns all direct children of the current tag; if provided, selector will be used to filter out the result","","###.find( selector )","","returns all descendents (including non-direct children) matching the given selector","","","------------------------------------------------------------------------------------------------------------------------","","###Mixins","","Mixins allows attaching custom methods to selected tags","","for example, suppose you have a `data-model` attribute you want to apply to all input tags","","```javascript","//First you define you mixin function","function dataModel(model) {"," return this.attr({ dataModel: model });","}","","// Then you attach it to all <input/> tags","nant.mixin( 'input', dataModel );","```","","therefore you can call `input` tags with the `dataModel` method","```javascript","ht.input({ name: 'myinput' }).dataModel('mymodel');","```","```html","<input name=\"myinput\" data-model=\"mymodel\">","```","","the exact signature of the `nant.mixin()` method is","","`nant.mixin( selector, mixinFn, [mixinName] )`","","examples ","","```javascript","function dataModel() { ... }","","// define 'dataModel' methods on all <input/> and <select/> tags","nant.mixin( ['input', 'select'], dataModel );","```","","```javascript","function tagName(name) { "," this.attr('name', name);","}","","// define 'name' method on all tags","nant.mixin( '*', tagName, 'name' );","```","","```javascript","function cols(cols) { "," this.attr({ class: 'col-sm-'+cols);","}","","// define 'cols' method on all div tags with class 'form-group'","nant.mixin( function(tag) {"," return tag.name === 'div' && tag.hasClass('form-group');","}, cols );","```",""]},{"action":"insertText","range":{"start":{"row":372,"column":0},"end":{"row":372,"column":95}},"text":"-----------------------------------------------------------------------------------------------"},{"action":"insertText","range":{"start":{"row":372,"column":95},"end":{"row":373,"column":0}},"text":"\n"},{"action":"insertLines","range":{"start":{"row":373,"column":0},"end":{"row":394,"column":0}},"lines":["","###Defining Custom Tags","=======================","","Simply, use `nant.makeTag` to make a tag builder function","","```javascript","// It's better to define custom tags in their own namespace","var ns = nant.ns = {};","// define your custom element inside the namespace","ns.myElement = nant.makeTag('MyElement', isVoid)","","//Later you can use your tag function","var myHtml = ht.div("," ns.myElement({ ...}, body )",")","```","","If `isVoid` parameter is true, then any body provided to the tag function will be ignored and closing tag (`</myelement>`) will not be generated upon tag stringification","",""]},{"action":"removeLines","range":{"start":{"row":445,"column":0},"end":{"row":449,"column":0}},"nl":"\n","lines":["--------------------------------------------------------------------------------------","","Mixins","======"]},{"action":"removeLines","range":{"start":{"row":452,"column":0},"end":{"row":455,"column":0}},"nl":"\n","lines":["Response is `Mixins`. a mixin allows us to apply transformations to a prebuilt Tag.","","So we can rewrite the bootstrap form example as follow"]},{"action":"removeText","range":{"start":{"row":463,"column":26},"end":{"row":463,"column":31}},"text":"mixin"},{"action":"insertText","range":{"start":{"row":463,"column":26},"end":{"row":463,"column":30}},"text":"attr"},{"action":"removeText","range":{"start":{"row":465,"column":22},"end":{"row":465,"column":27}},"text":"mixin"},{"action":"insertText","range":{"start":{"row":465,"column":22},"end":{"row":465,"column":26}},"text":"attr"},{"action":"removeText","range":{"start":{"row":467,"column":22},"end":{"row":467,"column":27}},"text":"mixin"},{"action":"insertText","range":{"start":{"row":467,"column":22},"end":{"row":467,"column":26}},"text":"attr"},{"action":"removeText","range":{"start":{"row":505,"column":22},"end":{"row":505,"column":27}},"text":"mixin"},{"action":"insertText","range":{"start":{"row":505,"column":22},"end":{"row":505,"column":26}},"text":"attr"},{"action":"removeText","range":{"start":{"row":507,"column":22},"end":{"row":507,"column":27}},"text":"mixin"},{"action":"insertText","range":{"start":{"row":507,"column":22},"end":{"row":507,"column":26}},"text":"attr"},{"action":"removeLines","range":{"start":{"row":526,"column":0},"end":{"row":576,"column":0}},"nl":"\n","lines":["","Above w've seen **attribute mixins**. They are quite simple to use, you pass in an attribute definition; the `mixin` function extendsthe tag's attributes with the new ones.","","Well there is also **function mixins**: you can provide the `mixin` method with your own function; it will be called then with tag object as parameter.","","","```javascript","function myMixin(tag) {"," // do something cool ..."," // don't forget to return"," return tag;","}","","ht.div(/* ... */).mixin( myMixin );","```","","so basically, the mixin function take a tag parameter, applies whatever transformations to it and then return :","","- either the same tag (generally when transformations are limited to attributes manipulation)","- or even another new constructed tag (for example wrap an `input` tag with a `div`)","","There is no limit of what you can do with function mixins just beware to always return a meaningful value (generally this will be a `Tag` object)","","---------------------------------------------------------------------------------","","Custom Tags","===========","","All exemples above simply define custom functions that return well known html tags; but you can also define your own custom tags that follows the html syntax rules. This maybe even necessary if you're working with some third party lib that requires custom tags (like `angularjs`).","","Use `nant.makeTag` to make a tag builder function","","```javascript","// define your namespace","var ns = nant.ns = {};","// define your custom element inside the namespace","ns.myElement = nant.makeTag('MyElement', isVoid)","","//Later you can use your tag function","var myHtml = ht.div("," ns.myElement({ ...}, body )",")","```","If `isVoid` parameter is true, then any body provided to the tag function will be ignored and closing tag (`</myelement>`) will not be generated upon tag stringification","","","","","",""]},{"action":"removeText","range":{"start":{"row":525,"column":139},"end":{"row":526,"column":0}},"text":"\n"}]}]]},"ace":{"folds":[],"scrolltop":420,"scrollleft":0,"selection":{"start":{"row":8,"column":2},"end":{"row":8,"column":2},"isBackwards":false},"options":{"guessTabSize":true,"useWrapMode":false,"wrapToView":true},"firstLineState":{"row":29,"state":"htmlcode-start","mode":"ace/mode/markdown"}},"timestamp":1412080931240,"hash":"eb90a0c811d2b03c0dab1e4115448477aca004b4"}

@@ -1,1 +0,1 @@

{"filter":false,"title":"test.js","tooltip":"/test/test.js","undoManager":{"mark":100,"position":100,"stack":[[{"group":"doc","deltas":[{"action":"removeText","range":{"start":{"row":32,"column":47},"end":{"row":32,"column":48}},"text":"'"}]}],[{"group":"doc","deltas":[{"action":"removeText","range":{"start":{"row":32,"column":55},"end":{"row":32,"column":56}},"text":"'"}]}],[{"group":"doc","deltas":[{"action":"removeText","range":{"start":{"row":32,"column":55},"end":{"row":32,"column":56}},"text":"]"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":32,"column":55},"end":{"row":32,"column":56}},"text":":"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":32,"column":56},"end":{"row":32,"column":57}},"text":" "}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":32,"column":57},"end":{"row":32,"column":58}},"text":"1"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":32,"column":58},"end":{"row":32,"column":59}},"text":" "}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":32,"column":59},"end":{"row":32,"column":60}},"text":"<"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":32,"column":60},"end":{"row":32,"column":61}},"text":">"}]}],[{"group":"doc","deltas":[{"action":"removeText","range":{"start":{"row":32,"column":60},"end":{"row":32,"column":61}},"text":">"}]}],[{"group":"doc","deltas":[{"action":"removeText","range":{"start":{"row":32,"column":59},"end":{"row":32,"column":60}},"text":"<"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":32,"column":59},"end":{"row":32,"column":60}},"text":">"}]}],[{"group":"doc","deltas":[{"action":"removeText","range":{"start":{"row":32,"column":59},"end":{"row":32,"column":60}},"text":">"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":32,"column":59},"end":{"row":32,"column":60}},"text":"!"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":32,"column":60},"end":{"row":32,"column":61}},"text":"="}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":32,"column":61},"end":{"row":32,"column":62}},"text":"="}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":32,"column":62},"end":{"row":32,"column":63}},"text":"1"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":32,"column":62},"end":{"row":32,"column":63}},"text":" "}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":32,"column":64},"end":{"row":32,"column":65}},"text":" "}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":32,"column":65},"end":{"row":32,"column":66}},"text":"}"}]}],[{"group":"doc","deltas":[{"action":"removeText","range":{"start":{"row":32,"column":40},"end":{"row":32,"column":43}},"text":"2 >"},{"action":"insertText","range":{"start":{"row":32,"column":40},"end":{"row":32,"column":41}},"text":"1"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":32,"column":41},"end":{"row":32,"column":42}},"text":" "}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":32,"column":42},"end":{"row":32,"column":43}},"text":"="}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":32,"column":43},"end":{"row":32,"column":44}},"text":"="}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":32,"column":44},"end":{"row":32,"column":45}},"text":"="}]}],[{"group":"doc","deltas":[{"action":"removeText","range":{"start":{"row":33,"column":34},"end":{"row":33,"column":42}},"text":"myclass2"}]}],[{"group":"doc","deltas":[{"action":"removeText","range":{"start":{"row":33,"column":33},"end":{"row":33,"column":34}},"text":" "}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":29,"column":42},"end":{"row":29,"column":43}},"text":"c"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":29,"column":43},"end":{"row":29,"column":44}},"text":"o"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":29,"column":44},"end":{"row":29,"column":45}},"text":"n"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":29,"column":45},"end":{"row":29,"column":46}},"text":"d"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":29,"column":46},"end":{"row":29,"column":47}},"text":"i"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":29,"column":47},"end":{"row":29,"column":48}},"text":"t"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":29,"column":48},"end":{"row":29,"column":49}},"text":"i"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":29,"column":49},"end":{"row":29,"column":50}},"text":"o"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":29,"column":50},"end":{"row":29,"column":51}},"text":"n"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":29,"column":51},"end":{"row":29,"column":52}},"text":"a"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":29,"column":52},"end":{"row":29,"column":53}},"text":"l"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":29,"column":53},"end":{"row":29,"column":54}},"text":" "}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":35,"column":7},"end":{"row":36,"column":0}},"text":"\n"},{"action":"insertText","range":{"start":{"row":36,"column":0},"end":{"row":36,"column":4}},"text":" "}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":36,"column":4},"end":{"row":37,"column":0}},"text":"\n"},{"action":"insertText","range":{"start":{"row":37,"column":0},"end":{"row":37,"column":4}},"text":" "}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":37,"column":4},"end":{"row":37,"column":75}},"text":"it('should build class attribute from conditional objects', function(){"},{"action":"insertText","range":{"start":{"row":37,"column":75},"end":{"row":38,"column":0}},"text":"\n"},{"action":"insertLines","range":{"start":{"row":38,"column":0},"end":{"row":43,"column":0}},"lines":[" "," assert.equal("," ht.div({ class: { myclass1: 1 === 1, myclass2: 1 !== 1 } }).toString(),"," '<div class=\"myclass1\"></div>'"," );"]},{"action":"insertText","range":{"start":{"row":43,"column":0},"end":{"row":43,"column":7}},"text":" });"}]}],[{"group":"doc","deltas":[{"action":"removeText","range":{"start":{"row":37,"column":42},"end":{"row":37,"column":53}},"text":"conditional"},{"action":"insertText","range":{"start":{"row":37,"column":42},"end":{"row":37,"column":43}},"text":"a"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":37,"column":43},"end":{"row":37,"column":44}},"text":"r"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":37,"column":44},"end":{"row":37,"column":45}},"text":"r"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":37,"column":45},"end":{"row":37,"column":46}},"text":"a"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":37,"column":46},"end":{"row":37,"column":47}},"text":"y"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":37,"column":47},"end":{"row":37,"column":48}},"text":" "}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":37,"column":48},"end":{"row":37,"column":49}},"text":"o"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":37,"column":49},"end":{"row":37,"column":50}},"text":"f"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":37,"column":50},"end":{"row":37,"column":51}},"text":" "}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":37,"column":51},"end":{"row":37,"column":52}},"text":"s"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":37,"column":52},"end":{"row":37,"column":53}},"text":"t"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":37,"column":53},"end":{"row":37,"column":54}},"text":"r"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":37,"column":54},"end":{"row":37,"column":55}},"text":"i"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":37,"column":55},"end":{"row":37,"column":56}},"text":"n"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":37,"column":56},"end":{"row":37,"column":57}},"text":"g"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":37,"column":57},"end":{"row":37,"column":58}},"text":" "}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":37,"column":58},"end":{"row":37,"column":59}},"text":"a"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":37,"column":59},"end":{"row":37,"column":60}},"text":"n"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":37,"column":60},"end":{"row":37,"column":61}},"text":"d"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":37,"column":61},"end":{"row":37,"column":62}},"text":"/"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":37,"column":62},"end":{"row":37,"column":63}},"text":"o"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":37,"column":63},"end":{"row":37,"column":64}},"text":"r"}]}],[{"group":"doc","deltas":[{"action":"removeText","range":{"start":{"row":40,"column":28},"end":{"row":40,"column":29}},"text":"{"}]}],[{"group":"doc","deltas":[{"action":"removeText","range":{"start":{"row":40,"column":28},"end":{"row":40,"column":29}},"text":" "}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":40,"column":28},"end":{"row":40,"column":29}},"text":"["}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":40,"column":29},"end":{"row":40,"column":30}},"text":" "}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":40,"column":30},"end":{"row":40,"column":31}},"text":"'"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":40,"column":39},"end":{"row":40,"column":40}},"text":"'"}]}],[{"group":"doc","deltas":[{"action":"removeText","range":{"start":{"row":40,"column":40},"end":{"row":40,"column":41}},"text":":"}]}],[{"group":"doc","deltas":[{"action":"removeText","range":{"start":{"row":40,"column":40},"end":{"row":40,"column":41}},"text":" "}]}],[{"group":"doc","deltas":[{"action":"removeText","range":{"start":{"row":40,"column":40},"end":{"row":40,"column":41}},"text":"1"}]}],[{"group":"doc","deltas":[{"action":"removeText","range":{"start":{"row":40,"column":40},"end":{"row":40,"column":41}},"text":" "}]}],[{"group":"doc","deltas":[{"action":"removeText","range":{"start":{"row":40,"column":40},"end":{"row":40,"column":41}},"text":"="}]}],[{"group":"doc","deltas":[{"action":"removeText","range":{"start":{"row":40,"column":40},"end":{"row":40,"column":41}},"text":"="}]}],[{"group":"doc","deltas":[{"action":"removeText","range":{"start":{"row":40,"column":40},"end":{"row":40,"column":41}},"text":"="}]}],[{"group":"doc","deltas":[{"action":"removeText","range":{"start":{"row":40,"column":40},"end":{"row":40,"column":41}},"text":" "}]}],[{"group":"doc","deltas":[{"action":"removeText","range":{"start":{"row":40,"column":40},"end":{"row":40,"column":41}},"text":"1"}]}],[{"group":"doc","deltas":[{"action":"removeText","range":{"start":{"row":40,"column":40},"end":{"row":40,"column":41}},"text":","}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":40,"column":40},"end":{"row":40,"column":41}},"text":","}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":40,"column":41},"end":{"row":40,"column":42}},"text":" "}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":40,"column":42},"end":{"row":40,"column":43}},"text":"'"}]}],[{"group":"doc","deltas":[{"action":"removeText","range":{"start":{"row":40,"column":42},"end":{"row":40,"column":43}},"text":"'"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":40,"column":42},"end":{"row":40,"column":43}},"text":"["}]}],[{"group":"doc","deltas":[{"action":"removeText","range":{"start":{"row":40,"column":42},"end":{"row":40,"column":43}},"text":"["}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":40,"column":42},"end":{"row":40,"column":43}},"text":"{"}]}],[{"group":"doc","deltas":[{"action":"removeText","range":{"start":{"row":40,"column":56},"end":{"row":40,"column":57}},"text":"!"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":40,"column":56},"end":{"row":40,"column":57}},"text":"="}]}],[{"group":"doc","deltas":[{"action":"removeText","range":{"start":{"row":40,"column":38},"end":{"row":40,"column":39}},"text":"1"}]}],[{"group":"doc","deltas":[{"action":"removeText","range":{"start":{"row":40,"column":41},"end":{"row":40,"column":62}},"text":"{ myclass2: 1 === 1 }"},{"action":"insertText","range":{"start":{"row":40,"column":41},"end":{"row":40,"column":81}},"text":"{ myclass1: 1 === 1, myclass2: 1 !== 1 }"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":40,"column":81},"end":{"row":40,"column":82}},"text":" "}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":40,"column":82},"end":{"row":40,"column":83}},"text":"]"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":41,"column":25},"end":{"row":41,"column":26}},"text":"m"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":41,"column":26},"end":{"row":41,"column":27}},"text":"y"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":41,"column":27},"end":{"row":41,"column":28}},"text":"c"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":41,"column":28},"end":{"row":41,"column":29}},"text":"l"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":41,"column":29},"end":{"row":41,"column":30}},"text":"a"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":41,"column":30},"end":{"row":41,"column":31}},"text":"s"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":41,"column":31},"end":{"row":41,"column":32}},"text":"s"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":41,"column":32},"end":{"row":41,"column":33}},"text":" "}]}]]},"ace":{"folds":[],"scrolltop":240,"scrollleft":0,"selection":{"start":{"row":41,"column":33},"end":{"row":41,"column":33},"isBackwards":false},"options":{"guessTabSize":true,"useWrapMode":false,"wrapToView":true},"firstLineState":{"row":16,"state":"start","mode":"ace/mode/javascript"}},"timestamp":1411662024557,"hash":"bdcaaf2b48fa5ea15b1ce7b7e093ed32b15c8ef6"}
{"filter":false,"title":"test.js","tooltip":"/test/test.js","undoManager":{"mark":100,"position":100,"stack":[[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":153,"column":40},"end":{"row":153,"column":41}},"text":"h"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":153,"column":41},"end":{"row":153,"column":42}},"text":"t"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":153,"column":42},"end":{"row":153,"column":43}},"text":"."}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":153,"column":43},"end":{"row":153,"column":44}},"text":"i"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":153,"column":44},"end":{"row":153,"column":45}},"text":"n"}]}],[{"group":"doc","deltas":[{"action":"removeText","range":{"start":{"row":153,"column":43},"end":{"row":153,"column":45}},"text":"in"},{"action":"insertText","range":{"start":{"row":153,"column":43},"end":{"row":153,"column":50}},"text":"input()"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":153,"column":49},"end":{"row":153,"column":51}},"text":"{}"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":153,"column":50},"end":{"row":153,"column":51}},"text":" "}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":153,"column":51},"end":{"row":153,"column":52}},"text":"c"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":153,"column":52},"end":{"row":153,"column":53}},"text":"a"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":153,"column":53},"end":{"row":153,"column":54}},"text":"s"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":153,"column":54},"end":{"row":153,"column":55}},"text":"s"}]}],[{"group":"doc","deltas":[{"action":"removeText","range":{"start":{"row":153,"column":54},"end":{"row":153,"column":55}},"text":"s"}]}],[{"group":"doc","deltas":[{"action":"removeText","range":{"start":{"row":153,"column":53},"end":{"row":153,"column":54}},"text":"s"}]}],[{"group":"doc","deltas":[{"action":"removeText","range":{"start":{"row":153,"column":52},"end":{"row":153,"column":53}},"text":"a"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":153,"column":52},"end":{"row":153,"column":53}},"text":"l"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":153,"column":53},"end":{"row":153,"column":54}},"text":"a"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":153,"column":54},"end":{"row":153,"column":55}},"text":"s"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":153,"column":55},"end":{"row":153,"column":56}},"text":"s"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":153,"column":56},"end":{"row":153,"column":57}},"text":":"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":153,"column":57},"end":{"row":153,"column":58}},"text":" "}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":153,"column":58},"end":{"row":153,"column":60}},"text":"''"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":153,"column":59},"end":{"row":153,"column":60}},"text":"c"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":153,"column":60},"end":{"row":153,"column":61}},"text":"o"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":153,"column":61},"end":{"row":153,"column":62}},"text":"l"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":153,"column":65},"end":{"row":153,"column":66}},"text":","}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":153,"column":66},"end":{"row":153,"column":67}},"text":" "}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":153,"column":67},"end":{"row":153,"column":68}},"text":"h"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":153,"column":68},"end":{"row":153,"column":69}},"text":"t"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":153,"column":69},"end":{"row":153,"column":70}},"text":"."}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":153,"column":70},"end":{"row":153,"column":71}},"text":"s"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":153,"column":71},"end":{"row":153,"column":72}},"text":"p"}]}],[{"group":"doc","deltas":[{"action":"removeText","range":{"start":{"row":153,"column":71},"end":{"row":153,"column":72}},"text":"p"}]}],[{"group":"doc","deltas":[{"action":"removeText","range":{"start":{"row":153,"column":70},"end":{"row":153,"column":71}},"text":"s"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":153,"column":70},"end":{"row":153,"column":71}},"text":"i"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":153,"column":71},"end":{"row":153,"column":72}},"text":"n"}]}],[{"group":"doc","deltas":[{"action":"removeText","range":{"start":{"row":153,"column":70},"end":{"row":153,"column":72}},"text":"in"},{"action":"insertText","range":{"start":{"row":153,"column":70},"end":{"row":153,"column":77}},"text":"input()"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":153,"column":76},"end":{"row":153,"column":78}},"text":"{}"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":153,"column":77},"end":{"row":153,"column":78}},"text":" "}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":153,"column":78},"end":{"row":153,"column":79}},"text":"c"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":153,"column":79},"end":{"row":153,"column":80}},"text":"l"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":153,"column":80},"end":{"row":153,"column":81}},"text":"a"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":153,"column":81},"end":{"row":153,"column":82}},"text":"s"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":153,"column":82},"end":{"row":153,"column":83}},"text":"s"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":153,"column":83},"end":{"row":153,"column":84}},"text":":"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":153,"column":84},"end":{"row":153,"column":85}},"text":" "}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":153,"column":85},"end":{"row":153,"column":86}},"text":"r"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":153,"column":86},"end":{"row":153,"column":87}},"text":"o"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":153,"column":87},"end":{"row":153,"column":88}},"text":"w"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":153,"column":85},"end":{"row":153,"column":86}},"text":"'"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":153,"column":89},"end":{"row":153,"column":90}},"text":"'"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":153,"column":90},"end":{"row":153,"column":91}},"text":" "}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":158,"column":12},"end":{"row":158,"column":73}},"text":"formGroup('fg1-2', [ ht.label(), ht.input({ class: 'row' })])"}]}],[{"group":"doc","deltas":[{"action":"removeText","range":{"start":{"row":158,"column":25},"end":{"row":158,"column":28}},"text":"1-2"},{"action":"insertText","range":{"start":{"row":158,"column":25},"end":{"row":158,"column":26}},"text":"2"}]}],[{"group":"doc","deltas":[{"action":"removeText","range":{"start":{"row":158,"column":62},"end":{"row":158,"column":65}},"text":"row"},{"action":"insertText","range":{"start":{"row":158,"column":62},"end":{"row":158,"column":63}},"text":"c"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":158,"column":63},"end":{"row":158,"column":64}},"text":"o"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":158,"column":64},"end":{"row":158,"column":65}},"text":"l"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":158,"column":71},"end":{"row":158,"column":72}},"text":" "}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":158,"column":71},"end":{"row":158,"column":72}},"text":","}]}],[{"group":"doc","deltas":[{"action":"removeText","range":{"start":{"row":163,"column":16},"end":{"row":163,"column":24}},"text":"children"},{"action":"insertText","range":{"start":{"row":163,"column":16},"end":{"row":163,"column":17}},"text":"f"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":163,"column":17},"end":{"row":163,"column":18}},"text":"i"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":163,"column":18},"end":{"row":163,"column":19}},"text":"n"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":163,"column":19},"end":{"row":163,"column":20}},"text":"d"}]}],[{"group":"doc","deltas":[{"action":"removeText","range":{"start":{"row":163,"column":31},"end":{"row":163,"column":32}},"text":"3"},{"action":"insertText","range":{"start":{"row":163,"column":31},"end":{"row":163,"column":32}},"text":"0"}]}],[{"group":"doc","deltas":[{"action":"removeText","range":{"start":{"row":167,"column":16},"end":{"row":167,"column":24}},"text":"children"},{"action":"insertText","range":{"start":{"row":167,"column":16},"end":{"row":167,"column":17}},"text":"f"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":167,"column":17},"end":{"row":167,"column":18}},"text":"i"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":167,"column":18},"end":{"row":167,"column":19}},"text":"n"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":167,"column":19},"end":{"row":167,"column":20}},"text":"d"}]}],[{"group":"doc","deltas":[{"action":"removeText","range":{"start":{"row":171,"column":44},"end":{"row":171,"column":45}},"text":"1"},{"action":"insertText","range":{"start":{"row":171,"column":44},"end":{"row":171,"column":45}},"text":"5"}]}],[{"group":"doc","deltas":[{"action":"removeText","range":{"start":{"row":167,"column":44},"end":{"row":167,"column":45}},"text":"2"},{"action":"insertText","range":{"start":{"row":167,"column":44},"end":{"row":167,"column":45}},"text":"5"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":167,"column":22},"end":{"row":167,"column":23}},"text":"d"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":167,"column":23},"end":{"row":167,"column":24}},"text":"i"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":167,"column":24},"end":{"row":167,"column":25}},"text":"v"}]}],[{"group":"doc","deltas":[{"action":"removeText","range":{"start":{"row":171,"column":26},"end":{"row":171,"column":33}},"text":"div#fg1"},{"action":"insertText","range":{"start":{"row":171,"column":26},"end":{"row":171,"column":27}},"text":"."}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":171,"column":27},"end":{"row":171,"column":28}},"text":"r"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":171,"column":28},"end":{"row":171,"column":29}},"text":"o"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":171,"column":29},"end":{"row":171,"column":30}},"text":"w"}]}],[{"group":"doc","deltas":[{"action":"removeText","range":{"start":{"row":171,"column":41},"end":{"row":171,"column":42}},"text":"5"},{"action":"insertText","range":{"start":{"row":171,"column":41},"end":{"row":171,"column":42}},"text":"7"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":172,"column":9},"end":{"row":173,"column":0}},"text":"\n"},{"action":"insertText","range":{"start":{"row":173,"column":0},"end":{"row":173,"column":8}},"text":" "}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":173,"column":8},"end":{"row":174,"column":0}},"text":"\n"},{"action":"insertText","range":{"start":{"row":174,"column":0},"end":{"row":174,"column":8}},"text":" "}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":174,"column":8},"end":{"row":174,"column":21}},"text":"assert.equal("},{"action":"insertText","range":{"start":{"row":174,"column":21},"end":{"row":175,"column":0}},"text":"\n"},{"action":"insertLines","range":{"start":{"row":175,"column":0},"end":{"row":176,"column":0}},"lines":[" tag.children('.row').length, 7 "]},{"action":"insertText","range":{"start":{"row":176,"column":0},"end":{"row":176,"column":9}},"text":" )"}]}],[{"group":"doc","deltas":[{"action":"removeText","range":{"start":{"row":175,"column":27},"end":{"row":175,"column":30}},"text":"row"},{"action":"insertText","range":{"start":{"row":175,"column":27},"end":{"row":175,"column":28}},"text":"c"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":175,"column":28},"end":{"row":175,"column":29}},"text":"o"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":175,"column":29},"end":{"row":175,"column":30}},"text":"l"}]}],[{"group":"doc","deltas":[{"action":"removeText","range":{"start":{"row":175,"column":41},"end":{"row":175,"column":42}},"text":"7"},{"action":"insertText","range":{"start":{"row":175,"column":41},"end":{"row":175,"column":42}},"text":"2"}]}],[{"group":"doc","deltas":[{"action":"removeText","range":{"start":{"row":167,"column":16},"end":{"row":167,"column":20}},"text":"find"},{"action":"insertText","range":{"start":{"row":167,"column":16},"end":{"row":167,"column":17}},"text":"c"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":167,"column":17},"end":{"row":167,"column":18}},"text":"h"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":167,"column":18},"end":{"row":167,"column":19}},"text":"i"}]}],[{"group":"doc","deltas":[{"action":"removeText","range":{"start":{"row":167,"column":16},"end":{"row":167,"column":19}},"text":"chi"},{"action":"insertText","range":{"start":{"row":167,"column":16},"end":{"row":167,"column":24}},"text":"children"}]}],[{"group":"doc","deltas":[{"action":"removeText","range":{"start":{"row":167,"column":16},"end":{"row":167,"column":24}},"text":"children"},{"action":"insertText","range":{"start":{"row":167,"column":16},"end":{"row":167,"column":17}},"text":"f"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":167,"column":17},"end":{"row":167,"column":18}},"text":"i"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":167,"column":18},"end":{"row":167,"column":19}},"text":"n"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":167,"column":19},"end":{"row":167,"column":20}},"text":"d"}]}],[{"group":"doc","deltas":[{"action":"removeText","range":{"start":{"row":171,"column":16},"end":{"row":171,"column":24}},"text":"children"},{"action":"insertText","range":{"start":{"row":171,"column":16},"end":{"row":171,"column":17}},"text":"f"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":171,"column":17},"end":{"row":171,"column":18}},"text":"i"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":171,"column":18},"end":{"row":171,"column":19}},"text":"n"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":171,"column":19},"end":{"row":171,"column":20}},"text":"d"}]}],[{"group":"doc","deltas":[{"action":"removeText","range":{"start":{"row":175,"column":16},"end":{"row":175,"column":24}},"text":"children"},{"action":"insertText","range":{"start":{"row":175,"column":16},"end":{"row":175,"column":17}},"text":"f"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":175,"column":17},"end":{"row":175,"column":18}},"text":"i"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":175,"column":18},"end":{"row":175,"column":19}},"text":"n"}]}],[{"group":"doc","deltas":[{"action":"insertText","range":{"start":{"row":175,"column":19},"end":{"row":175,"column":20}},"text":"d"}]}]]},"ace":{"folds":[],"scrolltop":1959,"scrollleft":0,"selection":{"start":{"row":157,"column":13},"end":{"row":157,"column":13},"isBackwards":false},"options":{"guessTabSize":true,"useWrapMode":false,"wrapToView":true},"firstLineState":{"row":225,"state":"start","mode":"ace/mode/javascript"}},"timestamp":1412079478906,"hash":"999808814e0da8b2e68fd65aac0a4cde477a279b"}

@@ -8,10 +8,84 @@ function exports() {

}
function getClass(aCls) {
var clsArr = [];
if(Array.isArray(aCls)) {
for (var i = 0; i < aCls.length; i++) {
var cls = getClass(aCls[i]);
if(cls) {
clsArr = clsArr.concat(cls);
}
}
} else if( typeof aCls === 'object') {
for(var clsName in aCls) {
if(aCls[clsName]) {
clsArr.push(clsName);
}
}
return clsArr;
} else if(aCls && typeof aCls === 'string') {
clsArr = aCls.match(/\S+/g);
}
for (var i = 0; i < clsArr.length; i++) {
clsArr[i] = clsArr[i].trim().toLowerCase();
}
return clsArr.length ? clsArr : null;
}
function getBody(tag, bodyConf) {
var body = [];
if( typeof bodyConf === 'string' || bodyConf instanceof Tag ) {
body.push( bodyConf );
} else if( Array.isArray(bodyConf) ) {
for (var i = 0; i < bodyConf.length; i++) {
body = body.concat( getBody(tag, bodyConf[i]) );
}
} else if(typeof bodyConf === 'function') {
body = body.concat( bodyConf(tag) );
}
return body;
}
nant.match = function(selector, tag) {
if(! (tag instanceof Tag) ) return false;
if( typeof selector === 'string' ) {
selector = selector.trim();
if(selector.indexOf(',') < 0) {
return matchStr(selector, tag);
} else {
return matchArr(selector.split(','), tag);
}
} else if( typeof selector === 'function' ) {
return selector(tag)
} else if(Array.isArray(selector) ) {
return matchArr(selector, tag);
}
return false;
function matchStr(sel, t) {
var sl = sel.split(/(?=\.)|(?=#)/);
for(var i=0; i<sl.length; i++) {
var si = sl[i];
if(si.indexOf('#') === 0) {
if(si.length > 1 && t.attrs.id !== si.substr(1) ) return false;
} else if(si.indexOf('.') === 0) {
if(si.length > 1 && t.attrs.class.indexOf(si.substr(1)) < 0 ) return false;
} else {
if(si !== '*' && t.name !== si) return false;
}
}
return true
}
function matchArr(arr, t) {
for (var i = 0; i < arr.length; i++) {
var sel = arr[i];
if(nant.match(sel, t)) return true;
}
return false;
}
}
nant.extend = function (base, extended) {
base = base || {}; extended = extended || {};
var eCls = extended.class;
var eCls = getClass(extended.class);
if(eCls) {
eCls = Array.isArray(extended.class) ? extended.class: [extended.class];
base.class = base.class || [];
var bCls = Array.isArray(base.class) ? base.class : [base.class];
base.class = bCls.concat(eCls);
base.class = base.class.concat(eCls);
}

@@ -26,2 +100,3 @@

}
function Uq(str) {

@@ -33,16 +108,88 @@ this.str = str;

}
function Tag(tag) {
this.name = tag.name;
this.attrs = tag.attrs;
this.body = tag.body;
this.attrs = { class: []};
this.bodyConf = tag.body;
this.isVoid = tag.isVoid;
nant.extend(this.attrs, tag.attrs);
this.body = getBody(this, tag.body);
}
Tag.prototype.mixin = function(mixin) {
if(typeof mixin === 'function') {
return mixin(this);
} else {
nant.extend(this.attrs, mixin);
Tag.prototype.attr = function(attr, val) {
if(val === undefined) {
if(typeof attr === 'string') {
return this.attrs[attr];
} else if(Array.isArray(attr) ) {
var ret = {};
for (var i = 0; i < attr.length; i++) {
var attrName = attr[i];
ret[attrName] = this.attrs[attrName];
}
return ret;
} else if( typeof attr === 'object') {
nant.extend(this.attrs, attr);
return this;
}
} else if(typeof attr === 'string') {
var obj = {};
obj[attr] = val;
nant.extend(this.attrs, obj);
return this;
}
}
Tag.prototype.hasClass = function(className) {
var classes = Array.isArray(className) ?
className : ( typeof className === 'string' ? className.match(/\S+/g) : [] )
for (var i = 0; i < classes.length; i++) {
if( this.attrs.class.indexOf( classes[i].toLowerCase() ) < 0 ) {
return false;
}
}
return true;
}
Tag.prototype.toggleClass = function(className, toggle) {
var classes = Array.isArray(className) ?
className : ( typeof className === 'string' ? className.match(/\S+/g) : [] )
for (var i = 0; i < classes.length; i++) {
var cn = classes[i];
var ind = this.attrs.class.indexOf(cn);
var on = toggle !== undefined ? toggle : (ind < 0);
if(on) {
if(ind < 0) {
this.attrs.class.push(cn);
}
} else {
if(ind >= 0) {
this.attrs.class.splice(ind, 1);
}
}
}
return true;
}
Tag.prototype.match = function(selector) {
return nant.match(this, selector);
}
Tag.prototype.children = function(selector) {
var res = [];
var noSel = selector === undefined;
for (var i = 0; i < this.body.length; i++) {
var child = this.body[i];
if(noSel || nant.match(selector, child) ) res.push(child);
}
return res;
};
Tag.prototype.find = function(selector) {
var res = [];
if ( !selector ) return res;
res = res.concat( this.children(selector) )
for (var i = 0; i < this.body.length; i++) {
var child = this.body[i];
if( child instanceof Tag ) res = res.concat( child.find(selector) );
}
return res;
};
Tag.prototype.toString = function() {

@@ -54,3 +201,4 @@ var self = this;

if( k === 'class' ) {
val = getClassAttr(self.attrs.class);
var ca = self.attrs.class.join(' ');
val = ca ? ca : false;
} else {

@@ -70,26 +218,4 @@ val = getAttr( self.attrs[k] );

return '<' + self.name + attrArr.join(' ') + '>' + ( !self.isVoid ? getBody(self.body) + '</' + self.name + '>' : '') ;
return '<' + self.name + attrArr.join(' ') + '>' + ( !self.isVoid ? self.body.join('') + '</' + self.name + '>' : '') ;
function getClassAttr(aCls) {
var ret = aCls;
if (aCls) {
if(Array.isArray(aCls)) {
var strArr = [];
for (var i = 0; i < aCls.length; i++) {
strArr.push( getClassAttr(aCls[i], true) );
}
ret = strArr.join(' ');
} else if( typeof aCls === 'object') {
var clsArr = [];
for(var clsName in aCls) {
if(aCls[clsName]) {
clsArr.push(clsName);
}
}
ret = clsArr.join(' ') ;
}
}
return ret || false;
}
function getAttr(val, nested) {

@@ -124,20 +250,6 @@ if( val === null || val === undefined || val === false ) {

}
function getBody(bodyConf) {
var body = '';
if( Array.isArray(bodyConf) ) {
for (var i = 0; i < bodyConf.length; i++) {
body = body + getBody(bodyConf[i]);
}
} else if(typeof bodyConf === 'function') {
body = bodyConf(self);
} else if(bodyConf !== null && bodyConf !== undefined) {
body = body + bodyConf;
}
return body;
}
}
nant.Tag = Tag;
nant.Tag = Tag;
var ht = nant.ht = {};
var ht = nant.ht = {}, mixins = [];;
nant.getTagMembers = function(args) {

@@ -158,2 +270,16 @@ var attrs, body;

}
nant.mixin = function(selector, fn, name) {
function getFnName(fn) {
var f = typeof fn == 'function';
var s = f && ((fn.name && ['', fn.name]) || fn.toString().match(/function ([^\(]+)/));
return (!f && null) || (s && s[1] || null);
}
name = name || getFnName(fn);
if(!name) {
throw Error('nant.mixin: either `fn` param must be a non anonymous function or provide a name in 3rd param');
}
mixins.push({
name: name, selector: selector, fn: fn
});
}
nant.makeTag = function(name, isVoid) {

@@ -164,10 +290,15 @@ return function () {

config.isVoid = isVoid;
return new Tag( config );
var tag = new Tag( config );
for (var i = 0; i < mixins.length; i++) {
var mx = mixins[i];
if( nant.match(mx.selector, tag) ) {
tag[mx.name] = mx.fn.bind(tag);
}
}
return tag;
}
}
var voidTags = ['area', 'base', 'br', 'col', 'command', 'embed', 'hr', 'img', 'input', 'keygen', 'link', 'meta', 'param', 'source', 'track', 'wbr'];
var nvTags = ['a', 'abbr', 'address', 'article', 'aside', 'audio', 'b', 'bdi', 'bdo', 'blockquote', 'body', 'button', 'canvas', 'caption', 'cite', 'code', 'colgroup', 'datalist', 'dd', 'del', 'details', 'dfn', 'div', 'dl', 'dt', 'em', 'fieldset', 'figcaption', 'figure', 'footer', 'form', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'head', 'header', 'hgroup', 'html', 'i', 'iframe', 'ins', 'kbd', 'label', 'legend', 'li', 'map', 'mark', 'menu', 'meter', 'nav', 'noscript', 'object', 'ol', 'optgroup', 'option', 'output', 'p', 'pre', 'progress', 'q', 'rp', 'rt', 'ruby', 's', 'samp', 'script', 'section', 'select', 'small', 'span', 'strong', 'style', 'sub', 'summary', 'sup', 'table', 'tbody', 'td', 'textarea', 'tfoot', 'th', 'thead', 'time', 'title', 'tr', 'u', 'ul', 'var', 'video'];
var nonVoidTags = ['a', 'abbr', 'address', 'article', 'aside', 'audio', 'b', 'bdi', 'bdo', 'blockquote', 'body', 'button', 'canvas', 'caption', 'cite', 'code', 'colgroup', 'datalist', 'dd', 'del', 'details', 'dfn', 'div', 'dl', 'dt', 'em', 'fieldset', 'figcaption', 'figure', 'footer', 'form', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'head', 'header', 'hgroup', 'html', 'i', 'iframe', 'ins', 'kbd', 'label', 'legend', 'li', 'map', 'mark', 'menu', 'meter', 'nav', 'noscript', 'object', 'ol', 'optgroup', 'option', 'output', 'p', 'pre', 'progress', 'q', 'rp', 'rt', 'ruby', 's', 'samp', 'script', 'section', 'select', 'small', 'span', 'strong', 'style', 'sub', 'summary', 'sup', 'table', 'tbody', 'td', 'textarea', 'tfoot', 'th', 'thead', 'time', 'title', 'tr', 'u', 'ul', 'var', 'video'];
for (var i = 0; i < voidTags.length; i++) {

@@ -177,4 +308,4 @@ var vtag = voidTags[i];

}
for (var ii = 0; ii < nvTags.length; ii++) {
var nvtag = nvTags[ii];
for (var ii = 0; ii < nonVoidTags.length; ii++) {
var nvtag = nonVoidTags[ii];
ht[nvtag] = nant.makeTag(nvtag, false);

@@ -181,0 +312,0 @@ }

{
"name": "nant",
"version": "0.0.4",
"version": "0.1.0",
"description": "A 'not-another-templating-language' for javascripters",

@@ -5,0 +5,0 @@ "main": "nant.js",

@@ -1,2 +0,2 @@

`nant` lets you generate your html templates with plain javascript (browser and server).
**nant** lets you generate your html templates with plain javascript (browser and server).

@@ -6,5 +6,6 @@ Features

- No need to learn another language, it's plain javascript
- Uses all language constructs to define your reusable building blocks
- Mixins to separate UI concernes (styles, layout..)
- No need to learn another language, just old good javascript
- Tags are simple POJOs (Plain Old *Javascript* Object) and can be manipulated with ease before stringification
- Uses all language constructs and programming techniques to define your reusable building blocks
- Attach your own methods to specific Tags using Mixins

@@ -14,20 +15,5 @@ Get started

###On the server
Install it
```
npm install nant
```
Then use it
```javascript
var ht = require('nant').ht;
var html = ht.p('this is as easy as writing javascript code');
```
###On the Browser :
Just add `nant.js` to your includes.
It's just one file - `nant.js` - to import in your page.

@@ -45,3 +31,3 @@

var ht = nant.ht;
el.innerHTML = ht.p('this is as easy as writing javascript code');
el.innerHTML = ht.p('this is as easy as writing javascript code').toString();
</script>

@@ -51,18 +37,32 @@ </body>

```
-------------------------------------------------------------------------------------------
So what's this ?
================
Obviuosly, this is not a new templating language for javascript; **javascript is the templating language**.
###On the server
Html tags are exposed as functions. you simply use the appropriate tag name to build your template.
```
npm install nant
```
Tag attributes are passed as arguments.
Then
```javascript
ht.input({ type: 'text', name: 'myinput', required: 'true'});
// get the Html Templates namespace
var ht = require('nant').ht;
var html = ht.p('this is as easy as writing javascript code').toString();
```
this will become
-------------------------------------------------------------------------------------------
So what's this ? A new Templating Language ?
=============================================
Obviously no; Instead **javascript is the templating language**.
Html tags are exposed as functions in the `ht` namespace and tag attributes are passed as arguments.
```javascript
var html = ht.input({ type: 'text', name: 'myinput', required: 'true'}).toString();
console.log( html );
```
```html

@@ -75,14 +75,24 @@ <input type="text" name="myinput" required>

```javascript
ht.div({ id: 'myid', class: 'myclass' }, 'String body');
var html = ht.div({ id: 'myid', class: 'myclass' }, 'String body').toString();
console.log( html );
```
```html
<div class="myclass" id="myid" required>
String body
</div>
```
You can pass nested tags as body
You can pass nested tags as body (note you don'need to call `toString()` on nested tags**)
```javascript
ht.form({ id: 'myform', class: 'myclass' },
ht.input({ name: 'myinput' })
);
ht.form({ id: 'myform', class: 'myclass' },
ht.div(
ht.label('My Input'),
ht.input({ name: 'myinput', placeholder: 'My Input' })
)
).toString();
```
If you pass a function as body, it will be called upon rendering (with the tag as parameter)
If you pass a function as body, it will be called upon rendering (with the parent tag as parameter)
```javascript

@@ -95,3 +105,3 @@ function myBody(tag) {

myBody
);
).toString();
```

@@ -107,3 +117,3 @@

someFunction
);
).toString();
```

@@ -121,3 +131,3 @@

ht.button('Submit')
);
).toString();
```

@@ -152,3 +162,179 @@

```
------------------------------------------------------------------------------------------
##Tag manipulation
all methods of the `ht` namespace returns an objet of type `Tag`;
the `Tag`'s prototype exposes a few methods; this is useful if you want to manipulate the tag object before calling `.toString()`
###.attr( attrName [, attrValue ] )
get/set current attribute value
```javascript
var div = ht.input({ name: 'myinput', class: 'myclass' });
div.attr('name'); // 'myinput'
div.attr('class'); // ['myclass']
div.attr('name', 'newName'); // div.attr('name') === 'newName'
```
note how class attribute was converted to an Array; internally all tags maintains an `Array` instance for `class` attribute
###.attr( [ attrName1, attrName2, ...] )
When passed an array, returns an object with given attributes
```javascript
var div = ht.input({ id:'myid', name: 'myname', placeholder: 'My Input' });
div.attr(['id', 'name']); // { id:'myid', name: 'myname' }
```
###.attr( object )
if you pass it an object, tag's attributes will be extended with object's members
```javascript
var div = ht.input({ name: 'myinput', class: 'myclass' });
div.attr({ id: 'myid', class: 'class1' });
div.attr('id'); // 'myid'
div.attr('class'); // ['myclass', 'class1']
```
###.hasClass()
used to check if tag instance references a css class
```javascript
var div = ht.input({ name: 'myinput', class: ['myclass', { class1: 1 === 1, class2: 1 !== 1} ] });
div.hasClass('myclass'); // true
div.hasClass('class1'); // true
div.hasClass('class2'); // false
div.hasClass('myclass class1'); // true
div.hasClass(['myclass', 'class2']); // false
```
###.toggleClass()
is another familiar method to to toggle on/off css class references
```javascript
var div = ht.input({ name: 'myinput', class: ['myclass', { class1: 1 === 1, class2: 1 !== 1} ] });
div.toggleClass('myclass');
// div.hasClass('myclass') == false
div.toggleClass('class2', true);
// div.hasClass('class2') == true
div.toggleClass('class1', true);
// nothing changes as class1 is already enabled
div.toggleClass(['myclass', 'class2']);
// div.hasClass('myclass') == true && div.hasClass('class2') == false
```
###.match( selector )
Another useful method to check weather a tag matches the given selector; note only a small subset of css selectors is supported at the moment
You can also supply a function (see example below) to perform tag matching
exemple
```javascript
var divTag = ht.div({ id: 'mydiv', class: ['form', 'group', 'col'] });
var inputTag = ht.input({ id: 'myinput', class: ['control', 'col'] });
// tag name selectors
divTag.match('div'); // true
inputTag.match('input'); // true
divTag.match('div, input'); // true
inputTag.match(['div', 'input']); // true
// class names, ids
divTag.match('div.form'); // true
divTag.match('div.form.group'); // true
divTag.match('#mydiv'); // true
divTag.match('div#mydiv.form.col'); // true
divTag.match('*.col'); // true
inputTag.match('*.col'); // true
// uses custom matching method
divTag.match( function(t) { return t.name === 'div' } );
```
###.children( [ selector ] )
returns all direct children of the current tag; if provided, selector will be used to filter out the result
###.find( selector )
returns all descendents (including non-direct children) matching the given selector
------------------------------------------------------------------------------------------------------------------------
###Mixins
Mixins allows attaching custom methods to selected tags
for example, suppose you have a `data-model` attribute you want to apply to all input tags
```javascript
//First you define you mixin function
function dataModel(model) {
return this.attr({ dataModel: model });
}
// Then you attach it to all <input/> tags
nant.mixin( 'input', dataModel );
```
therefore you can call `input` tags with the `dataModel` method
```javascript
ht.input({ name: 'myinput' }).dataModel('mymodel');
```
```html
<input name="myinput" data-model="mymodel">
```
the exact signature of the `nant.mixin()` method is
`nant.mixin( selector, mixinFn, [mixinName] )`
examples
```javascript
function dataModel() { ... }
// define 'dataModel' methods on all <input/> and <select/> tags
nant.mixin( ['input', 'select'], dataModel );
```
```javascript
function tagName(name) {
this.attr('name', name);
}
// define 'name' method on all tags
nant.mixin( '*', tagName, 'name' );
```
```javascript
function cols(cols) {
this.attr({ class: 'col-sm-'+cols);
}
// define 'cols' method on all div tags with class 'form-group'
nant.mixin( function(tag) {
return tag.name === 'div' && tag.hasClass('form-group');
}, cols );
```
------------------------------------------------------------------------------------------
###Object attributes (aka angular/knockout/... users)

@@ -196,2 +382,24 @@

-----------------------------------------------------------------------------------------------
###Defining Custom Tags
=======================
Simply, use `nant.makeTag` to make a tag builder function
```javascript
// It's better to define custom tags in their own namespace
var ns = nant.ns = {};
// define your custom element inside the namespace
ns.myElement = nant.makeTag('MyElement', isVoid)
//Later you can use your tag function
var myHtml = ht.div(
ns.myElement({ ...}, body )
)
```
If `isVoid` parameter is true, then any body provided to the tag function will be ignored and closing tag (`</myelement>`) will not be generated upon tag stringification
---------------------------------------------------------------------------------------------

@@ -248,7 +456,3 @@

--------------------------------------------------------------------------------------
Mixins
======
Lets review the last example, w've reusable bootstrap tags to build form elements.

@@ -260,6 +464,3 @@

Response is `Mixins`. a mixin allows us to apply transformations to a prebuilt Tag.
So we can rewrite the bootstrap form example as follow
```javascript

@@ -275,7 +476,7 @@ // Form layout definition

bt.formGroup = function formGroup(input, label) {
input = ht.div(input).mixin(layout.input);
input = ht.div(input).attr(layout.input);
if(label) {
label = label.mixin(layout.label);
label = label.attr(layout.label);
} else {
input = input.mixin(layout.offset);
input = input.attr(layout.offset);
}

@@ -318,5 +519,5 @@ return ht.div({ class: 'form-group' },

if(label) {
label = label.mixin(layout.label);
label = label.attr(layout.label);
} else {
input = input.mixin(layout.offset);
input = input.attr(layout.offset);
}

@@ -339,52 +540,2 @@ return ht.div({ class: 'form-group' },

You can go ever further to acheive better reusability; Because you're in the javascript land, you can apply your favourite desgin patterns.
Above w've seen **attribute mixins**. They are quite simple to use, you pass in an attribute definition; the `mixin` function extendsthe tag's attributes with the new ones.
Well there is also **function mixins**: you can provide the `mixin` method with your own function; it will be called then with tag object as parameter.
```javascript
function myMixin(tag) {
// do something cool ...
// don't forget to return
return tag;
}
ht.div(/* ... */).mixin( myMixin );
```
so basically, the mixin function take a tag parameter, applies whatever transformations to it and then return :
- either the same tag (generally when transformations are limited to attributes manipulation)
- or even another new constructed tag (for example wrap an `input` tag with a `div`)
There is no limit of what you can do with function mixins just beware to always return a meaningful value (generally this will be a `Tag` object)
---------------------------------------------------------------------------------
Custom Tags
===========
All exemples above simply define custom functions that return well known html tags; but you can also define your own custom tags that follows the html syntax rules. This maybe even necessary if you're working with some third party lib that requires custom tags (like `angularjs`).
Use `nant.makeTag` to make a tag builder function
```javascript
// define your namespace
var ns = nant.ns = {};
// define your custom element inside the namespace
ns.myElement = nant.makeTag('MyElement', isVoid)
//Later you can use your tag function
var myHtml = ht.div(
ns.myElement({ ...}, body )
)
```
If `isVoid` parameter is true, then any body provided to the tag function will be ignored and closing tag (`</myelement>`) will not be generated upon tag stringification
You can go ever further to acheive better reusability; Because you're in the javascript land, you can apply your favourite desgin patterns.
var assert = require("assert")
var nant = require("../nant"), ht = nant.ht;
describe('attributes', function(){
describe('nant', function() {
it('should build attributes from primitives (number, string, null, undefined, true, false)', function(){
it('should match by tag name', function () {
var tag = ht.div({ id: 'mydiv', class: ['form', 'group', 'col'] });
var tag2 = ht.input({ id: 'myinput', class: ['control', 'col'] });
assert.ok( nant.match('div', tag) );
assert.ok( nant.match('div.form', tag) );
assert.ok( nant.match('div.form.group', tag) );
assert.ok( nant.match('#mydiv', tag) );
assert.ok( nant.match('div#mydiv.form.col', tag) );
assert.ok( nant.match('*.col', tag) );
assert.ok( !nant.match('*.sd1s21', tag) );
assert.ok( !nant.match('*#sd1s2', tag) );
assert.ok( nant.match('div, input', tag) );
assert.ok( nant.match(['div', 'input'], tag2) );
assert.ok( nant.match('*.col', tag) );
assert.ok( nant.match('*.col', tag2) );
assert.ok( nant.match( function(t) { return t.name === 'div' } , tag) );
});
});
describe('tag', function(){
it('should return scalar attribute value', function () {
var tag = ht.div({ id: 'mydiv' })
assert.equal(
ht.div({ strAttr: 'strAttr', numAttr: 1, trueAttr: true, falseAttr: false, nullAttr: null, undefAttr: undefined }).toString(),
'<div str-attr="strAttr" num-attr="1" true-attr></div>'
tag.attr('id'),
'mydiv'
);
});
it('should build class attribute from strings', function(){
assert.equal(
ht.div({ class: 'myclass' }).toString(),
'<div class="myclass"></div>'
it('should return array of attributes values', function(){
var tag = ht.input({ id: 'myid', name: 'myname' })
assert.deepEqual(
tag.attr(['id', 'name']),
{ id: 'myid', name: 'myname' }
);
});
it('should build class attribute from arrays', function(){
it('should build array class attribute from strings', function(){
var div = ht.div({ class: 'myclass' });
assert.deepEqual(
div.attrs.class,
['myclass']
);
div = ht.div({ class: 'myclass1 myclass2 ' });
assert.deepEqual(
div.attrs.class,
['myclass1', 'myclass2']
);
});
it('should build array class attribute from arrays', function(){
var div = ht.div({ class: ['myclass1', 'myclass2'] });
assert.deepEqual(
div.attrs.class,
['myclass1', 'myclass2']
);
});
it('should build array class attribute from arrays/objects', function(){
var div = ht.div({ class: [ 'myclass', { myclass1: 1 === 1, myclass2: 1 !== 1 } ] })
assert.deepEqual(
div.attrs.class,
['myclass', 'myclass1']
);
});
it('should build array class attribute from arrays/objects', function(){
var div = ht.div({ class: [ 'myclass', { myclass1: 1 === 1, myclass2: 1 !== 1 } ] })
assert.ok( div.hasClass('myclass1') );
assert.ok( div.hasClass('myclass myclass1') );
assert.ok( !div.hasClass('myclass2') );
});
it('should be able to tell if a tag references a css class', function(){
var div = ht.input({ name: 'myinput', class: ['myclass', { class1: 1 === 1, class2: 1 !== 1} ] });
assert.ok( div.hasClass('myclass') ); // true
assert.ok( div.hasClass('class1') ); // true
assert.ok( !div.hasClass('class2') ); // false
assert.ok( div.hasClass('myclass class1') ); // true
assert.ok( !div.hasClass(['myclass', 'class2']) ); // false
});
it('should be able to toggle on/off css classes', function(){
var div = ht.input({ name: 'myinput', class: ['myclass', { class1: 1 === 1, class2: 1 !== 1} ] });
div.toggleClass('myclass');
assert.ok( !div.hasClass('myclass') );
div.toggleClass('class2', true);
assert.ok( div.hasClass('class2') );
div.toggleClass('class1', true);
assert.ok( div.hasClass('class1') );
div.toggleClass(['myclass', 'class2']);
assert.ok( div.hasClass('myclass') );
assert.ok( !div.hasClass('class2') );
});
it('should return matching children', function() {
function formGroup(id, body) {
return ht.div({ class: 'form-group row', id: id }, body);
}
var tag = ht.form(
formGroup('fg1',
[ ht.label(), ht.input() ]
),
formGroup('fg2',
[ ht.label(), ht.input() ]
),
ht.button('submit')
)
assert.equal(
tag.children().length, 3
)
assert.equal(
tag.children('.form-group').length, 2
)
assert.equal(
tag.children('div#fg1').length, 1
)
});
it('should return matching descendents at any level', function() {
function formGroup(id, body) {
return ht.div({ class: 'form-group row', id: id }, body);
}
var tag = ht.form(
formGroup('fg1', [
ht.label(),
formGroup('fg1-1', [
ht.label(), formGroup('fg1-1-1', [
ht.label(), ht.input({ class: 'col'}), ht.input({ class: 'row' })
])
]),
formGroup('fg1-2', [ ht.label(), ht.input({ class: 'row' })])
]),
formGroup('fg2', [ ht.label(), ht.input({ class: 'col' })]),
ht.button('submit')
)
assert.equal(
tag.find().length, 0
)
assert.equal(
tag.find('div.form-group').length, 5
)
assert.equal(
tag.find('.row').length, 7
)
assert.equal(
tag.find('.col').length, 2
)
});
});
describe('html', function(){
it('should build html with class attribute from arrays', function(){

@@ -30,3 +193,3 @@ assert.equal(

it('should build class attribute from conditional objects', function(){
it('should build html with class attribute from conditional objects', function(){

@@ -39,3 +202,3 @@ assert.equal(

it('should build class attribute from array of string and/or objects', function(){
it('should build html with class attribute from array of string and/or objects', function(){

@@ -47,5 +210,12 @@ assert.equal(

});
it('should build html with attributes from primitives (number, string, null, undefined, true, false)', function(){
assert.equal(
ht.div({ strAttr: 'strAttr', numAttr: 1, trueAttr: true, falseAttr: false, nullAttr: null, undefAttr: undefined }).toString(),
'<div str-attr="strAttr" num-attr="1" true-attr></div>'
);
});
it('should build attributes from objects', function(){
it('should build html with attributes from objects', function(){

@@ -60,3 +230,3 @@ assert.equal(

it('should let nested props of object attributes unquoted', function(){
it('should build html and let nested props of object attributes unquoted', function(){

@@ -68,5 +238,3 @@ assert.equal(

});
});
describe('html', function(){
it('should build html tag with body', function(){

@@ -93,3 +261,3 @@

'<form id="myform" class="myclass">' +
'<form class="myclass" id="myform">' +
'<label for="myinput">My input</label>' +

@@ -110,3 +278,3 @@ '<input id="myinput" name="myinput">' +

'<form id="myform" class="myclass">' +
'<form class="myclass" id="myform">' +
'<label for="myinput">My input</label>' +

@@ -127,3 +295,3 @@ '<input id="myinput" name="myinput">' +

'<form id="myform" class="myclass">' +
'<form class="myclass" id="myform">' +
'<label for="myinput">My input</label>' +

@@ -147,3 +315,3 @@ '<input id="myinput" name="myinput">' +

'<form id="myform" class="myclass">' +
'<form class="myclass" id="myform">' +
'<label for="myinput">My input</label>' +

@@ -159,38 +327,66 @@ '<input id="myinput" name="myinput">' +

it('should not do anything if given an empty mixin', function () {
assert.doesNotThrow(
function() {
ht.div().mixin();
}
it('should apply attribute mixin', function(){
assert.equal(
ht.input({ id:'myinput' })
.attr({ name: 'myinput', class: 'myclass' })
.toString(),
'<input class="myclass" id="myinput" name="myinput">'
);
});
it('should apply attributes mixin when passed an attributes param', function(){
it('should apply global mixin to matching tag name', function(){
function myattr(val) {
assert(this instanceof nant.Tag)
return this.attr({ myattr: val });
}
nant.mixin( 'input', myattr )
assert.equal(
ht.input({ name: 'myinput' }).myattr('val').toString(),
'<input name="myinput" myattr="val">'
);
});
it('should apply global mixin to matching tag names array', function(){
function myattr() {
assert(this instanceof nant.Tag)
return this.attr({ myattr: this.name + '-attr'});
}
nant.mixin( ['div', 'input'], myattr )
assert.equal(
ht.input({ id:'myinput', name: 'myinput' })
.mixin({ class: 'my-input-class'})
.toString(),
ht.div( ht.input().myattr() ).myattr(),
'<input id="myinput" name="myinput" class="my-input-class">'
'<div myattr="div-attr"><input myattr="input-attr"></div>'
);
});
it('should apply function mixin when passed a function param', function(){
it('should apply global mixin to matching tag function', function(){
function applyClass(tag) {
nant.extend(tag.attrs, { class: 'my-input-class'});
return tag;
function myattr() {
assert(this instanceof nant.Tag)
return this.attr({ myattr: this.name + '-attr'});
}
nant.mixin(function(tag) {
return tag.name === 'input';
}, myattr, 'newAttr' )
assert.equal(
ht.input({ id:'myinput', name: 'myinput' })
.mixin( applyClass )
.toString(),
ht.input({ name: 'myinput' }).newAttr().toString(),
'<input id="myinput" name="myinput" class="my-input-class">'
'<input name="myinput" myattr="input-attr">'
);
});
});

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc