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
// DOM API | |
var content = document.getElementById('content'), | |
p = document.createElement('p'), | |
a = document.createElement('a'); | |
p.id = 'markout'; | |
a.href = 'http://oddnut.com/markout/'; | |
p.appendChild(a) | |
content.appendChild(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
// Markout | |
var docFrag = Y.Markout(), | |
p, ul; | |
p = docFrag.p(); | |
p.strong().text('MarkoutJS'); | |
p.text(' - '); | |
p.a({ href: 'http://oddnut.com' }).text('Oddnut Software'); | |
ul = docFrag.ul(); |
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({ | |
"base": "http://local.oddnut.com:8080/yui3/_v_3.1.0.pr2/", | |
"comboBase": "http://local.oddnut.com:8080/yui3/_v_3.1.0.pr2/_combo?", | |
"root": "", | |
"combine": true, | |
"groups": { | |
"utils": { | |
"base": "http://local.oddnut.com:8080/utils/", | |
"comboBase": "http://local.oddnut.com:8080/utils/_combo?", | |
"root": "", |
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.extend(MyPage, Y.Base, { | |
components : { | |
myComponent : { | |
requires : ['overlay'], | |
initializer : '_initMyComponent' | |
} | |
}, | |
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 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> | |
<html> | |
<head> | |
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> | |
<title>Insert title here</title> | |
<script src="http://yui.yahooapis.com/3.1.0/build/yui/yui-min.js"></script> | |
<script> | |
YUI().use('io',function(Y){ | |
var ioConfig = { |
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
Button = Y.Base.create('toolbar-button',Y.Widget,[Y.WidgetChild],{ | |
BOUNDING_TEMPLATE : '<li/>', | |
CONTENT_TEMPLATE : '<button/>', | |
_clickHandle : null, | |
className : '', | |
initializer : function(config) { | |
this.className = this.getClassName(); | |
}, | |
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.datauri('http://example.com/foo.png', function(fooDataURI){ | |
Y.one('body').append(Y.Node.create('<img/>').set('src', fooDataURI)); | |
}); | |
Y.datauri('http://example.com/foo.png', 'http://example.com/bar.png', function(foo, bar){ | |
}); | |
Y.datauri(['http://example.com/foo.png', 'http://example.com/bar.png'], function(datauris){ | |
// datauris is an array because array was passed in |
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>Fancy Overlay</title> | |
<style type="text/css"> | |
.yui3-overlay {} | |
.yui3-overlay-content { | |
-webkit-border-radius: 3px; |
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('base', 'gallery-resource', function(Y){ | |
var MyClass, myClass, resource; | |
// MyClass Def | |
MyClass = function (config) { | |
MyClass.superclass.constructor.apply(this, arguments); | |
}; | |
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', function(Y){ | |
var widget = new Y.Widget(); | |
widget.addAttr('type'); | |
widget.after('typeChange', function(e){ | |
this.get('boundingBox').replaceClass(this.getClassName(e.prevVal), this.getClassName(e.newVal); | |
}); | |
widget.set('type', 'alert'); |