Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View jakearchibald's full-sized avatar
💭
Tired

Jake Archibald jakearchibald

💭
Tired
View GitHub Profile
glow.events.addListener("#twit", "mouseover", function () {
clearTimeout(myTimeout);
myInfoPanel.show();
});
glow.events.addListener("#twit", "mouseout", closeAfterDelay);
var myTimeout = 0;
function closeAfterDelay() {
myTimeout = setTimeout(function() {
// here are the month names how we want to display them...
var fullMonthNames = [
"Janurary",
"Feburary",
"March",
"April",
"May",
"June",
"July",
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-GB" lang="en-GB">
<head profile="http://dublincore.org/documents/dcq-html/">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Glow drag tests</title>
<script src="http://www.bbc.co.uk/glow/glow/1.6.0-rc1/core/core.js" type="text/javascript"></script>
<script src="http://www.bbc.co.uk/glow/glow/1.6.0-rc1/widgets/widgets.debug.js" type="text/javascript"></script>
<link href="http://www.bbc.co.uk/glow/glow/1.6.0-rc1/widgets/widgets.css" type="text/css" rel="stylesheet" />
<style type='text/css'>
// create our form
var myForm = new glow.forms.Form("#fmcustomer")
var myForm = glow.lang.trim("txtCompany","txtForename","txtSurname2)
// add tests for First Name
.addTests(
"txtCompany",
["required", {
on: "change submit",
message: "Please tell us your company name"
}]
function trimFormField(selector, on) {
var field = glow.dom.get(selector);
return ["custom", {
on: on,
arg: function(values, opts, callback, formData) {
field.val( glow.lang.trim(values[0]) );
callback(glow.forms.PASS, "");
}
}];
}
glow.events.addListener("#yourForm", "submit", function() {
glow.net.post(
// make a request to the place the form posts to
this.action,
// get the data from the form to send to the server
glow.dom.get(this).val(),
{
onLoad: function(response) {
// response.text() is the response from the server
}
var functions = [],
functionsLen = 0;
function buildMassiveString() {
return new Array(1024*1024).join('#');
}
function addFunction() {
var massiveString = buildMassiveString();
functions[ functionsLen++ ] = function() {};
var functions = [],
functionsLen = 0;
function buildMassiveString() {
// build a ~1mb string
return new Array(1024*1024).join('#');
}
function addListener() {
var massiveString = buildMassiveString();
var MyClass;
(function() {
MyClass = function() {
this.val = 2;
}
MyClass.prototype.publicFunction = function() {
return privateFunction.call(this);
glow.ready(function() {
var myPanel = new glow.widgets.Panel("#formPanel");
//display panel
myPanel.show();
})