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 PUBLIC "-//W3C//DTD HTML 4.01//EN" | |
"http://www.w3.org/TR/html4/strict.dtd"> | |
<html> | |
<head> | |
<title>untitled</title> | |
<script type="text/javascript" src="http://yui.yahooapis.com/combo?3.1.1/build/yui/yui-min.js"></script> | |
</head> | |
<body> | |
<div id="widget1">Widget 1</div> |
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
Y.mix(Y.NodeList.prototype, { | |
slice : function (start, end) { | |
return Y.all(this._nodes.slice(start, end)); | |
} | |
}); |
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('widget-base', 'widget-stdmod', 'base-build', function (Y) { | |
var headerContent = '<a href="#" id="someButton">Click me</a>'; | |
var myWidget = Y.Base.create('my-widget', Y.Widget, [Y.WidgetStdMod], { | |
_headerButton : null, // ref to btn | |
renderUI : function () { | |
this.setStdModContent(Y.WidgetStdMod.HEADER, headerContent, Y.WidgetStdMod.REPLACE); | |
var header = this.getStdModNode(Y.WidgetStdMod.HEADER); | |
this._headerButton = header.one('#someButton'); // Returns null |
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
""" | |
Copyright (c) 2010, Greg Hinch | |
All rights reserved. | |
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: | |
Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. | |
Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. | |
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFIT |
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 Book = Y.Base.create('book', Y.Model, [], {}, { | |
ATTRS : { // use the normal attribute config here, including the validation & parsing (setter) | |
author : {}, | |
title : {}, | |
publisher : {} | |
}, | |
EDITORS : { // define editors for each key here | |
author : {fn : Y.Model.EDIT.Choice, cfg : {choices : [...]}, | |
title : Y.Model.EDIT.Text | |
} |
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 data = [ | |
{author : {surname : 'Roberts', firstname : 'Gregory David'}, title : 'Shantaram', published : (new Date('09/25/2005'))}, | |
{author : {surname : 'Gibson', firstname : 'William'}, title : 'Neuromancer', published : (new Date('07/01/1984'))}, | |
{author : {surname : 'Rowling', firstname : 'J.K.'}, title : 'Harry Potter', published : (new Date('06/30/1997'))}, | |
{author : {surname : 'Simon', firstname : 'Ted'}, title : 'Jupiter\'s Travels', published : (new Date('01/01/1979'))}, | |
{author : {surname : 'Tolkien', firstname : 'J.R.R.'}, title : 'The Hobbit', published : (new Date('09/21/1937'))} | |
]; | |
var ds = new Y.DataSource.Local({ | |
source : data, |
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 Book = Y.Base.create('book', Y.Model, [], {}, { | |
PRIMARY_KEY : 'id', | |
ATTRS : { | |
author : {}, | |
id : {}, | |
title : {}, | |
published : {}, | |
format : {} | |
} | |
}); |
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 WidgetParentStdMod () { | |
Y.before(this._initParentStdMod, this, 'renderUI'); | |
Y.before(function () { | |
console.log('halt?'); | |
return new Y.Do.Halt('ParentStdMod halted this'); | |
}, this, '_renderChildren'); | |
Y.after(this._renderChildrenAfterSync, this, 'syncUI'); | |
} |
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> | |
<head> | |
<title>test</title> | |
<script type="text/javascript" src="js/yui/yui-min.js"></script> | |
</head> | |
<body class="yui3-skin-sam"> | |
<select id="typeChoice"> | |
<option>Select one</option> | |
<option value="fruits">Fruits</option> |
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> | |
<head> | |
<title>AC Test</title> | |
<script src="http://yui.yahooapis.com/3.3.0pr3/build/yui/yui-min.js"></script> | |
</head> | |
<body> | |
<input type="text" id="n" value="foo"> | |
<script type="text/javascript"> |