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
glow.events.addListener("#twit", "mouseover", function () { | |
clearTimeout(myTimeout); | |
myInfoPanel.show(); | |
}); | |
glow.events.addListener("#twit", "mouseout", closeAfterDelay); | |
var myTimeout = 0; | |
function closeAfterDelay() { | |
myTimeout = setTimeout(function() { |
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
// here are the month names how we want to display them... | |
var fullMonthNames = [ | |
"Janurary", | |
"Feburary", | |
"March", | |
"April", | |
"May", | |
"June", | |
"July", |
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 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'> |
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
// 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" | |
}] |
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 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, ""); | |
} | |
}]; | |
} |
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
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 | |
} |
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 functions = [], | |
functionsLen = 0; | |
function buildMassiveString() { | |
return new Array(1024*1024).join('#'); | |
} | |
function addFunction() { | |
var massiveString = buildMassiveString(); | |
functions[ functionsLen++ ] = function() {}; |
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 functions = [], | |
functionsLen = 0; | |
function buildMassiveString() { | |
// build a ~1mb string | |
return new Array(1024*1024).join('#'); | |
} | |
function addListener() { | |
var massiveString = buildMassiveString(); |
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 MyClass; | |
(function() { | |
MyClass = function() { | |
this.val = 2; | |
} | |
MyClass.prototype.publicFunction = function() { | |
return privateFunction.call(this); |
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
glow.ready(function() { | |
var myPanel = new glow.widgets.Panel("#formPanel"); | |
//display panel | |
myPanel.show(); | |
}) |
OlderNewer