8. XUIJS
• a stop gap solution
• super tiny jquery work-alike
• Good enough and shipping nao.
9.
10. // basic matches by selector
x$('div.foo');
x$('ul#global-nav li.selected');
// element literals
x$(window);
x$(document);
// lists of elements
x$('li', 'div');
// arrays even
x$(['div#foo', 'div.bar']);
18. Ghetto, Actually
• DOM Storage is key/value only; Slightly nicer
than cookies but way lamer name
• SQLite seems like a bad idea: schemas,
migrations, impedance mismatch, oh my
20. wtflawnchair
• JSON document store (not key/value)
• Designed for mobile; very light
• Clean and simple async oo API
• Adaptor pattern for store customization
22. // Saving a document
var me = {name:'brian'};
people.save(me);
// Saving a document async
people.save({name:'frank'}, function(r) {
console.log(r);
});
// Specifying your own key
people.save({key:'whatever', name:'dracula'});
23. // Get that document
people.get(me.key, function(r){
console.log(r);
});
// Returns all documents as an array to a
callback
people.all(function(r){
console.log(r);
});
// List all with shortcut syntax
people.all('console.log(r)');
24. // Remove a document directly
people.get(me.key, function(r){
people.remove(me);
});
// Remove a document by key
people.save({key:'die', name:'duder'});
people.remove('die');
// Destroy all documents
people.nuke();
26. // Iterate documents conditionally!
// The first function is a conditional.
// The second is a callback exec on records returned by the first
people.find(
function(r) {return r.name == brian},
function(r) {console.log(r)}
);
// Iterate conditionally via shorthand
people.find('r.name == "brian"', 'console.log(r)');
// You can mix and match shorthand btw
people.find('r.name == "brian"', function(r){
console.log(r)
});
27.
28.
29. The purpose of PhoneGap is for
PhoneGap to cease to exist.
30. PhoneGap Actually
• Build native apps to mobile devices with
web technology.
• Implementation while we wait for the
browser to give us a first class dev
platform.
31. Mind the Gaps
Apple iPhone OS Objective C
Google Android Dalvik Java
RIM Blackberry J2ME Java
Nokia Symbian / MeeGo *
Palm webOS web
Windows Mobile/Phone C,C++,C# (.NET)