Permalink
Browse files

turned into a component

  • Loading branch information...
1 parent 6898608 commit e4e4b2492a46252ae16af9a0001dc8540a874cea @juliangruber committed Oct 3, 2012
Showing with 58 additions and 0 deletions.
  1. +2 −0 .gitignore
  2. +11 −0 Makefile
  3. +17 −0 component.json
  4. +28 −0 example/component/index.html
View
@@ -0,0 +1,2 @@
+components
+build
View
@@ -0,0 +1,11 @@
+
+build: components index.js
+ @component build --dev
+
+components:
+ @component install --dev
+
+clean:
+ rm -fr build components template.js
+
+.PHONY: clean
View
@@ -0,0 +1,17 @@
+{
+ "name": "sorta",
+ "repo": "juliangruber/sorta",
+ "description": "preserve the ordering of html elements in the browser as updates stream in",
+ "version": "0.0.1",
+ "keywords": [],
+ "dependencies": {
+ "juliangruber/stream": "*",
+ "juliangruber/events": "*"
+ },
+ "development": {
+ "component/jquery": "*"
+ },
+ "scripts": [
+ "index.js"
+ ]
+}
@@ -0,0 +1,28 @@
+<!DOCTYPE html>
+<html>
+ <head>
+ <script src="../../build/build.js"></script>
+ <script>
+ var sorta = require('sorta');
+ var $ = require('component-jquery');
+
+ var s = sorta(function(row) {
+ return $('<p>')
+ .html(row.key)
+ .click(function() { console.log(row.key, 'clicked') })
+ [0]
+ ;
+ });
+
+ $(function() {
+ s.appendTo(document.body);
+ });
+
+ s.write({ key: 'foo', value: 0 });
+ s.write({ key: 'bar', value: 1 })
+ </script>
+ </head>
+ <body>
+
+ </body>
+</html>

0 comments on commit e4e4b24

Please sign in to comment.