diff --git a/examples/unfinished/shark/client/shark.js b/examples/unfinished/shark/client/shark.js index 59fb7aff98..1449a5fd48 100644 --- a/examples/unfinished/shark/client/shark.js +++ b/examples/unfinished/shark/client/shark.js @@ -13,197 +13,7 @@ Body = RootComponent.extend({ }); Meteor.startup(function () { - /* - RC = RootComponent.create({ - bodyClass: Component.extend({ - render: function (buf) { - buf.text(Session.get('foo') || ''); - } - }) - }); - */ - /*RC = RootComponent.create({ - bodyClass: Component.extend({ - render: function (buf) { - buf.openTag('span', {style: function () { - return 'background-color:' + - Session.get('bgcolor'); - }}); - buf.text(function () { - return Session.get('foo') || ''; - }); - buf.closeTag('span'); - } - }) - });*/ - - /* - RC = RootComponent.create({ - bodyClass: Component.extend({ - render: function (buf) { - buf.component(Each.create({ - bodyClass: Component.extend({ - render: function (buf) { - buf.openTag('div'); - buf.text(this.getArg('data').text || ''); - buf.closeTag('div'); - } - }), - list: Items.find({}, { sort: { text: 1 }}) - }), { key: 'body' }); - } - }) - }); - - RC.attach(document.body);*/ - Items.insert({ text: 'Qux' }); Items.remove({ text: 'Foo' }); Items.update({ text: 'Bar' }, { text: 'Car' }); }); - - - -/*var debug = function (method, component) { - console.log(method, component.nameInParent); -}; - -// Utility to HTML-escape a string. -var escapeForHtml = (function() { - var escape_map = { - "<": "<", - ">": ">", - '"': """, - "'": "'", - "`": "`", // IE allows backtick-delimited attributes?? - "&": "&" - }; - var escape_one = function(c) { - return escape_map[c]; - }; - - return function (x) { - return x.replace(/[&<>"'`]/g, escape_one); - }; -})(); - -DebugComponent = Component.extend({ - init: function () { debug('init', this); }, - build: function (frag) { debug('build', this); }, - built: function () { debug('built', this); }, - attached: function () { debug('attached', this); }, - detached: function () { debug('detached', this); }, - destroyed: function () { debug('destroyed', this); }, - updated: function (args, oldArgs) { debug('updated', this); } -}); - -LI = DebugComponent.extend({ - build: function (frag) { - var li = document.createElement('LI'); - li.appendChild(document.createTextNode(this.getArg('text'))); - frag.appendChild(li); - this.setBounds(li); - this.textNode = li.firstChild; - }, - updated: function (args, oldArgs) { - if (this.isBuilt) - this.textNode.nodeValue = args.text; - }, - toHtml: function () { - return "