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
dojo.provide("plugd.layout"); | |
(function(d){ | |
var clsCache = {}, | |
doit = function(part){ | |
// do some mangling: | |
var dtype = part.type, kids = part.children; | |
if(!clsCache[dtype]){ clsCache[dtype] = d.getObject(dtype); } | |
if(part.id){ part.props.id = part.id; } |
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
(function(bug){ | |
buggyfunction = function(msg){ | |
// summary: Alert some message. | |
// msg: String|Object | |
// If string, just show this message. If object, | |
// use obj.message for display, and hide | |
// obj.delay ms | |
var delay; | |
if(typeof msg == "string"){ |
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
(function(d){ | |
// change to fit needs: | |
var acct = "UA-843203-1", page = "someIdentifier", delay = 300; | |
// won't need to change much (if any) below here: | |
var h = d.getElementsByTagName("head")[0], s = d.createElement("script"); | |
s.src = ("https:" == d.location.protocol ? "https://ssl." : "http://www.") | |
+ "google-analytics.com/ga.js"; |
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
(function(d){ | |
d.Timer = function(args){ | |
// summary: The constructor function. Anytime we `new` up a Timer, | |
// this function is called, passing anything passed. | |
// | |
// example: | |
// | var x = new dojo.Timer({ a:b }); | |
// | x.a == b // true | |
d.mixin(this, args); |
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> | |
<head> | |
<style type="text/css"> | |
#baz { | |
border:8px solid #ededed; | |
padding:20px; | |
background:#ccc; | |
width:600px; | |
position:absolute; |
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
(function(){ | |
// normal ass object: | |
var obj = { | |
me:37 | |
}; | |
function mangler(arg, num){ | |
// `arg` is literally `obj` | |
arg.me = num; |
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
dojo.provide("dojotype._base.Number"); | |
(function(d){ | |
/*===== | |
dojo.Number = function(){ | |
// summary: A series of prototype-extending Number functions. | |
// description: | |
// All the Math.* functions available in stock JavaScript | |
// applied to the Number prototype. Unfortunately, the | |
// syntax would be weird/bad/confusing: |
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> | |
<head> | |
<title>SuperBasic Dojo Page with `plugd`</title> | |
<!-- load dojo from a CDN --> | |
<script src="http://o.aolcdn.com/dojo/1.4/dojo/dojo.xd.js"></script> | |
<!-- load plugd from google SVN server --> | |
<script src="http://plugd.googlecode.com/svn/trunk/base.js"></script> |
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> | |
<head> | |
<title>SuperBasic Dojo Page</title> | |
<!-- load dojo from a CDN --> | |
<script src="http://o.aolcdn.com/dojo/1.4/dojo/dojo.xd.js"></script> | |
<script> | |
// document is ready for DOM action | |
dojo.ready(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
<html> | |
<head> | |
<script> | |
var d = document, load = function(){ | |
// sigh. IE && Opera fire case insensitive events. (ran == 2) | |
// FF && Safari are case sensitive. (ran == 1) | |
var ran = 0, runner = function(){ | |
ran++; | |
} | |