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*/ | |
/** | |
* Loads the google IMA library exactly once. | |
* | |
* https://developers.google.com/interactive-media-ads/docs/sdks/googlehtml5 | |
* | |
* @module google-ima | |
* @requires event-custom | |
*/ |
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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8"> | |
<title>HTML Element Sampler</title> | |
</head> | |
<body> | |
<h1>HTML Element Sampler</h1> | |
<p>This is a paragraph. It's just something I threw together. |
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*/ | |
/** | |
* Adds HTML5 Media Element support to Y.Node | |
* | |
* @module node | |
* @submodule node-media | |
* @main node | |
* @requires node-base | |
*/ | |
YUI.add("node-media", function (Y) { |
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().use("event-custom", function (Y) { | |
var et = new Y.EventTarget(), | |
ce = et.publish("frob", { | |
defaultFn: function (event) { | |
et.frobs += 1; | |
}, | |
emitFacade: true | |
}); | |
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("widget", function (Y) { | |
var eventName = "frob", | |
widg = new Y.Widget(), | |
ce = widg.publish(eventName); | |
ce.monitor("attach", function (handler) { | |
var subs = ce.getSubs(); | |
console.log("handler attached!", subs); | |
if (!ce.hasSubs()) { | |
console.log("enabling performance-intensive event"); | |
} |
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("datasource-io", function (Y) { | |
// Described in YUI 3.3.0's patch notes | |
// http://yuilibrary.com/projects/yui3/wiki/ReadMe/RollUp_3.3.0?version=3 | |
// | |
var ds = new Y.DataSource.IO({ | |
source: "http://www.example.com/", | |
ioConfig: { | |
headers: { | |
"X-Requested-With": "disable" |
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
/** | |
Writes a sandboxed block of HTML to the supplied node. | |
<p>Based on an example from <a href="https://github.com/RCanine/embed-code">Meebo</a>.</p> | |
@method writeSandboxedHTML | |
@namespace RC | |
@param {String} width a valid CSS width | |
@param {String} height a valid CSS height | |
@param {String} html a block of HTML code |
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 loader:Loader = new Loader(); | |
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, function (event:Event):void { | |
// although these two values are the same, accessing the later doesn't | |
// work unless your image is on the same server as the HTML page, or | |
// you tell the loader to check a policy file first. | |
trace("loader width: " + loader.width); // Works | |
trace("bitmap width: " + loader.content.width); // Exception | |
}); | |
loader.load(new URLRequest("http://www.example.com/image.png")); |
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*/ | |
/** | |
A simple wrapper around datasource that allows multiple | |
instances to be created, but only a single request be | |
made. | |
@module singleton-datasource | |
@requires base-build, base-base, datasource-local | |
**/ | |
YUI.add("singleton-datasource", function (Y) { |
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
/* Note: this method disables user font scaling via browser preferences. | |
It's up to you whether this is a good thing. In this case, browsers | |
that don't support rem get the default (pixel) value, and don't get | |
the fancy scaling. | |
*/ | |
$rem_size: 10; | |
$rem_px: #{$rem_size}px; | |
@mixin rem($property, $value) { | |
#{$property}: $value * $rem_size; | |
#{$property}: #{$value}rem; |