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
YUI().use('autocomplete', 'jsonp', function (Y) { | |
var ac = new Y.AutoComplete({ | |
source: function (query, callback) { | |
Y.jsonp('http://example.com/api/autocomplete?query=' + encodeURIComponent(query) + '&callback={callback}', { | |
timeout: 10000 // 10 seconds, | |
on: { | |
success: callback, | |
failure: function () { /* ... */ }, |
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
// Super fast read-only fake Model. | |
var GlobalEnv = YUI.namespace('Env.Model'); | |
function LazyModel(config) { | |
this.data = Y.merge(config); | |
this.data.clientId || (this.data.clientId = this.generateClientId()); | |
this.lists = []; | |
} |
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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8"> | |
<title>pie is good</title> | |
<style> | |
html { background: #fff; } | |
body { |
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 re = /a/g, | |
str ='foo bar biz quux'; | |
console.log(re.exec(str)); // => ["a"] | |
re.lastIndex = 0; | |
console.log(re.exec(str)); // => ["a"] (would be null if lastIndex weren't reset) |
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 () { | |
// -- Constructor -------------------------------------------------------------- | |
function Stache(template) { | |
this.parsed = false; | |
this._template = template; | |
} | |
// -- Static Functions --------------------------------------------------------- | |
Stache.render = function (template, view, partials) { |
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 Property() {} | |
Property.prototype = { | |
// -- Public Prototype Methods --------------------------------------------- | |
defineProperties: function (properties) { | |
return Property.defineProperties(this, properties); | |
}, | |
defineProperty: function (name, descriptor) { | |
return Property.defineProperty(this, name, descriptor); |
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
{ | |
// enforcing options (true means potentially more warnings) | |
"bitwise": true, // true if bitwise operators should not be allowed | |
"curly": true, // true if curly braces should be required around blocks in loops and conditionals | |
"eqeqeq": true, // true if === should be required (for ALL equality comparisons) | |
"forin": false, // true if unfiltered 'for in' statements should be forbidden | |
"immed": true, // true if immediate function invocations must be wrapped in parens | |
"newcap": true, // true if Initial Caps must be used with constructor functions | |
"noarg": true, // true if arguments.caller and arguments.callee should be forbidden |
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 (Handlebars,depth0,helpers,partials,data) { | |
helpers = helpers || Handlebars.helpers; | |
var buffer = "", stack1, foundHelper, functionType="function", escapeExpression=this.escapeExpression, self=this, blockHelperMissing=helpers.blockHelperMissing; | |
function program1(depth0,data) { | |
var buffer = "", stack1, foundHelper; | |
buffer += "\n <li>"; | |
foundHelper = helpers.item; | |
if (foundHelper) { stack1 = foundHelper.call(depth0, {hash:{}}); } |
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 (data) { | |
var $t=''; | |
with(data){ | |
$t+='<ul class="'+ | |
Y.Escape.html( classNames.list )+ | |
'">\ | |
'; | |
Y.Array.each(items, function (item) { | |
;$t+='\ | |
<li>'+ |
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
YUI.add('multi', function (Y) { | |
/** | |
Loads different versions of YUI in sandboxed iframes and makes them available | |
for use in the parent frame by exposing them as properties on a `Y.Multi` | |
instance. | |
This is primarily intended to be used for testing. You probably shouldn't use it | |
for anything real. |