This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Demo usage of http://github.com/krawaller/PubSubHotTub | |
var func = function(){ console.log(Array.prototype.slice.call(arguments).join(" ")); }; | |
pb.sub('/root/leaf/meatloaf', func, 'i', 'like', 'curry'); | |
pb.pub('/root/leaf/meatloaf', 'and', 'cheese'); // => i like curry and cheese | |
pb.sub('/*/leaf/*', func); | |
pb.pub('/root/leaf/*', 'cheese'); // => cheese, i like curry cheese ^^ (curry cheese sounds rad) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var Test = { | |
name: 'test', | |
init: function(){ | |
this.proxiedHandleEvents = $.proxy(this.handleEvents, this); | |
Ti.App.addEventListener('app', this.proxiedHandleEvents); | |
}, | |
// Event cannon with callback fix. | |
fire: function(opts){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$('<div/>').attachAndReturn(Letter, this, letter, specialLetter); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// CSS-like styling | |
// test.css | |
tableView { | |
background-color: #f00; | |
color: #fff; | |
} | |
row { background-color: #0f0; } | |
.info { right: 0; } | |
// HTML-like templates combined with micro-templates or mustasche |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"plr-gate":{ | |
conds: [{ // array of condition objects | |
'if': { // all properties here are conditions to be evaluated | |
"hasflag": "haskey" // tests for global flag of the given name | |
}, | |
then: { // effects to take place if all conditions were true | |
on: true, // collision takes place on the square | |
stop: "b", // stops the marble motion, with animation "b" (bounce) | |
setwalltype: "none" // makes the gate disappear | |
}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function(){ | |
var hash = decodeURIComponent((location.href.match(/#(.*)$/) || [])[1]); | |
if(hash){ | |
var el = document.querySelector(hash), t = 0; | |
do { t += el.offsetTop; } | |
while (el.offsetParent && (el = el.offsetParent)); | |
window.scrollTo(0, t); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
K.createKraWebView = function(o){ | |
var webview = K.create(K.merge({url: "../views/"+ (o.masterPageFile || "_masterpage.html")} o), | |
template = Ti.Filesystem.getFile(Ti.Filesystem.resourcesDirectory+"/views/"+o.templateFile).read().text, | |
opts = { template: template, data: {data: o.data} }; | |
webview.addEventListener("load",function(){ webview.evalJS("render("+JSON.stringify(opts)+")"); }); | |
return webview; | |
}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
win.add(createKraWebView({template: "templateexamaple.html",data:{name:"ole",role:"bass",presentation:"<p>Nice guy!</p>"}})); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function map(doc){ | |
if(doc.username && doc.presentation){ | |
emit(doc._id, doc); | |
} | |
} |
OlderNewer