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
(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
<!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(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
(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(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
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Do Nothing.</title> | |
</head> | |
<body> | |
<script> | |
(function(){ | |
// some boilerplate load-a-script-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
dojo.extend(dijit._Widget, { | |
on: function(ev, cb, scp){ | |
if(scp){ cb = dojo.hitch(cb, scp) } | |
this.connect(this, ev, cb); | |
return this; // or return this.connect(...), can't decide | |
} | |
}); | |
// examples: | |
// |
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(){ | |
var wow = function(arg){ console.log(arg); }; | |
wow(bar); // bar defined later, but ready | |
wow(foo); // foo undefined just yet | |
var foo = function(){} | |
wow(foo); // foo now works |