Skip to content

Commit

Permalink
updated elements
Browse files Browse the repository at this point in the history
  • Loading branch information
satyr committed May 2, 2011
1 parent 2cc227f commit c991ffc
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 20 deletions.
29 changes: 15 additions & 14 deletions ckup.co
Expand Up @@ -93,23 +93,24 @@ ckup import
A: (url, txt) -> @element \a [...@@] <<< [href: url, txt or url]; void

# Each tag-named method delegates to `@element`.
# ref. <http://dev.w3.org/html5/spec/Overview.html>
for tag of <[
a abbr acronym address applet area article aside audio
b base basefont bdo big blockquote body br button
canvas caption center cite code col colgroup command
datalist dd del details dfn dir div dl dt
em embed fieldset figcaption figure font footer form frame frameset
h1 h2 h3 h4 h5 h6 head header hgroup hr html
i iframe img input ins keygen kbd label legend li link
map mark menu meta meter nav noframes noscript
a abbr address area article aside audio
b base bdi bdo blockquote body br button
canvas caption cite code col colgroup command
datalist dd del details dfn div dl dt em embed
fieldset figcaption figure footer form
h1 h2 h3 h4 h5 h6 head header hgroup hr html i iframe img input ins
kbd keygen label legend li link map mark menu meta meter nav noscript
object ol optgroup option output p param pre progress q rp rt ruby
s samp script section select small source span strike strong style sub
summary sup table tbody td textarea tfoot th thead time title tr tt
u ul video xmp
]> then do ->
tailless = tag of <[ area base basefont br hr img input link meta ]>
s samp script section select small source span strong style sub summary sup
table tbody td textarea tfoot th thead time title tr track
u ul var video wbr
]> then let tailless = tag of <[ # void elements
area base br col command embed hr img input
keygen link meta param source track wbr ]>
# `@a href: url, ->` -> `@element \a, [href: url, ->]`
ckup[tag] = -> @element tag, @@, tailless; void

## Aliases
ckup{quote: $, raw: R, text: T, entity: E} = ckup
ckup{quote: $, raw: R, text: T, entity: E, var: v} = ckup
10 changes: 4 additions & 6 deletions ckup.js
Expand Up @@ -2,9 +2,7 @@
var ckup, tag, _i, _ref, _len, __clone = function(it){
function fn(){ if (this.__proto__ !== it) this.__proto__ = it }
return fn.prototype = it, new fn;
}, __importAll = function(obj, src){ for (var key in src) obj[key] = src[key]; return obj }, __slice = [].slice, _fn = function(tag){
var tailless;
tailless = tag === 'area' || tag === 'base' || tag === 'basefont' || tag === 'br' || tag === 'hr' || tag === 'img' || tag === 'input' || tag === 'link' || tag === 'meta';
}, __importAll = function(obj, src){ for (var key in src) obj[key] = src[key]; return obj }, __slice = [].slice, _fn = function(tailless, tag){
ckup[tag] = function(){
this.element(tag, arguments, tailless);
};
Expand Down Expand Up @@ -155,9 +153,9 @@
href: url
}, _ref[1] = txt || url, _ref));
};
for (_i = 0, _len = (_ref = ['a', 'abbr', 'acronym', 'address', 'applet', 'area', 'article', 'aside', 'audio', 'b', 'base', 'basefont', 'bdo', 'big', 'blockquote', 'body', 'br', 'button', 'canvas', 'caption', 'center', 'cite', 'code', 'col', 'colgroup', 'command', 'datalist', 'dd', 'del', 'details', 'dfn', 'dir', 'div', 'dl', 'dt', 'em', 'embed', 'fieldset', 'figcaption', 'figure', 'font', 'footer', 'form', 'frame', 'frameset', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'head', 'header', 'hgroup', 'hr', 'html', 'i', 'iframe', 'img', 'input', 'ins', 'keygen', 'kbd', 'label', 'legend', 'li', 'link', 'map', 'mark', 'menu', 'meta', 'meter', 'nav', 'noframes', 'noscript', 'object', 'ol', 'optgroup', 'option', 'output', 'p', 'param', 'pre', 'progress', 'q', 'rp', 'rt', 'ruby', 's', 'samp', 'script', 'section', 'select', 'small', 'source', 'span', 'strike', 'strong', 'style', 'sub', 'summary', 'sup', 'table', 'tbody', 'td', 'textarea', 'tfoot', 'th', 'thead', 'time', 'title', 'tr', 'tt', 'u', 'ul', 'video', 'xmp']).length; _i < _len; ++_i) {
for (_i = 0, _len = (_ref = ['a', 'abbr', 'address', 'area', 'article', 'aside', 'audio', 'b', 'base', 'bdi', 'bdo', 'blockquote', 'body', 'br', 'button', 'canvas', 'caption', 'cite', 'code', 'col', 'colgroup', 'command', 'datalist', 'dd', 'del', 'details', 'dfn', 'div', 'dl', 'dt', 'em', 'embed', 'fieldset', 'figcaption', 'figure', 'footer', 'form', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'head', 'header', 'hgroup', 'hr', 'html', 'i', 'iframe', 'img', 'input', 'ins', 'kbd', 'keygen', 'label', 'legend', 'li', 'link', 'map', 'mark', 'menu', 'meta', 'meter', 'nav', 'noscript', 'object', 'ol', 'optgroup', 'option', 'output', 'p', 'param', 'pre', 'progress', 'q', 'rp', 'rt', 'ruby', 's', 'samp', 'script', 'section', 'select', 'small', 'source', 'span', 'strong', 'style', 'sub', 'summary', 'sup', 'table', 'tbody', 'td', 'textarea', 'tfoot', 'th', 'thead', 'time', 'title', 'tr', 'track', 'u', 'ul', 'var', 'video', 'wbr']).length; _i < _len; ++_i) {
tag = _ref[_i];
(_fn(tag));
(_fn.call(this, tag === '#' || tag === 'void' || tag === 'elements' || tag === 'area' || tag === 'base' || tag === 'br' || tag === 'col' || tag === 'command' || tag === 'embed' || tag === 'hr' || tag === 'img' || tag === 'input' || tag === 'keygen' || tag === 'link' || tag === 'meta' || tag === 'param' || tag === 'source' || tag === 'track' || tag === 'wbr', tag));
}
ckup.$ = ckup.quote, ckup.R = ckup.raw, ckup.T = ckup.text, ckup.E = ckup.entity;
ckup.$ = ckup.quote, ckup.R = ckup.raw, ckup.T = ckup.text, ckup.E = ckup.entity, ckup.v = ckup['var'];
}).call(this);

0 comments on commit c991ffc

Please sign in to comment.