This file contains hidden or 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', 'substitute', function(Y) { | |
| function Example(config) { | |
| Example.superclass.constructor.apply(this, arguments); | |
| } | |
| Example.NAME = 'Example'; | |
| Example.ATTRS = { | |
| foo: { | |
| value: 'bar' | |
| } |
This file contains hidden or 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
| /** | |
| * Sugar method to generate classes | |
| * | |
| * @param {su Function} Superclass to the generated class | |
| * @param {st Object} An Object dictionary of static properties for the class | |
| * @param {im Object} An Object dictionary of instance methods for the class | |
| */ | |
| YUI.add('base-generate', function (Y) { | |
| Y.Base.generate = function (su, st, im) { | |
| function BuiltClass() { |
This file contains hidden or 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
| // c.f. http://twitter.com/trek/status/19360844819 | |
| Object.prototype.toString = function() { | |
| return "Fuck you, bitches"; | |
| }; | |
| alert({ foo: 'bar' }); |
This file contains hidden or 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 GRUBERS_URL_RE = /\b((?:[a-z][\w-]+:(?:\/{1,3}|[a-z0-9%])|www\d{0,3}[.]|[a-z0-9.\-]+[.][a-z]{2,4}\/)(?:[^\s()<>]+|\(([^\s()<>]+|(\([^\s()<>]+\)))*\))+(?:\(([^\s()<>]+|(\([^\s()<>]+\)))*\)|[^\s`!()\[\]{};:'".,<>?«»“”‘’]))/i; |
This file contains hidden or 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
| // this request will be cached by the browser | |
| YUI.use('datasource-io', 'datasource-polling', function (Y) { | |
| var request, datasource; | |
| request = { | |
| callback: { | |
| success: function (e) { | |
| // handle success | |
| }, |
This file contains hidden or 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
| package { | |
| import flash.display.MovieClip; | |
| import flash.events.Event; | |
| /** | |
| * Sometimes, when the SWF is pulled from cache, the first frame is | |
| * is played before the Flash player is actually initialized. Many | |
| * functions do not yet exist at this point. In addition, stage.stageWidth |
This file contains hidden or 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
| Modernizr.addTest('textoverflow', function () { | |
| var s = document.documentElement.style; | |
| return 'textOverflow' in s || 'OTextOverflow' in s; | |
| }); |
This file contains hidden or 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
| /* global YUI */ | |
| YUI.add("my-module", function (Y) { | |
| "use strict"; | |
| Y.MyWidget = Y.Base.create("my-module", Y.Widget, [], { | |
| initializer: function () { | |
| // publish any events | |
| // do any instantiation that doesn't require DOM | |
| }, | |
| renderUI: function () { |
This file contains hidden or 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
| public function functionName():void | |
| { | |
| } |
This file contains hidden or 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
| window.onload = function () { | |
| var s = document.body.style; | |
| s.height = window.screen.availHeight + 'px'; | |
| setTimeout(function () { | |
| window.scrollTo(0, 0); | |
| s.height = window.innerHeight + 'px'; | |
| }, 50); | |
| }; |