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
define(["dojo/domReady!"], function(domReady){ | |
function init(){ | |
// do something on domReady | |
} | |
(domReady||init)(init); | |
}); |
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
// Implemented as a monkey-patch for dijit/_OnDijitClickMixin | |
define([ | |
"dijit/_OnDijitClickMixin", | |
"dojo/on", | |
"dojo/_base/window", | |
"dojo/dom-geometry", | |
"dijit/registry", | |
"dojo/domReady!" | |
], function(_OnDijitClickMixin, on, win, domGeometry, registry){ |
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
define(['../Evented', '../_base/lang', './util'], function(Evented, lang, util){ | |
// module: | |
// dojo/request/notify | |
// summary: | |
// Global notification API for dojo/request | |
// | |
// | require('dojo/request', 'dojo/request/notify', | |
// | function(request, notify){ | |
// | notify('load', function(response){ | |
// | if(response.url === 'someUrl.html'){ |
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
define([ | |
"dojo/Deferred", | |
"dojo/promise/all", | |
"dojo/node!fs", | |
"dojo/node!path" | |
], function(Deferred, all, fs, path){ | |
var slice = Array.prototype.slice; | |
function adapt(func){ | |
var args = slice.call(arguments, 1), | |
def = new Deferred; |
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
define([ | |
"dojo/Deferred" | |
], function(Deferred){ | |
var slice = Array.prototype.slice; | |
return function adapt(func){ | |
var args = slice.call(arguments, 1), | |
def = new Deferred; | |
args.push(function(err, value){ | |
if(err){ |
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>Test</title> | |
<script> | |
var dojoConfig = { | |
async: 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
function makeError(name, ctor, base, props){ | |
base = base || Error; | |
var ErrorCtor = function(message){ | |
if(base === Error){ | |
Error.captureStackTrace && Error.captureStackTrace(this, ErrorCtor); | |
base.call(this, message); | |
}else{ | |
base.apply(this, arguments); | |
} | |
ctor && ctor.apply(this, arguments); |
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
// Confirmed on Chrome 17 on Windows | |
// Once the first TypeError occurs, no further Dates can be created and manipulated | |
var i = 0, d; | |
while(true){ | |
++i; | |
try{ | |
d = new Date(); | |
d.setHours(0,0,0,0); | |
}catch(e){ | |
console.log(i); |
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.date.compare = function(/*Date*/date1, /*Date?*/date2, /*String?*/portion){ | |
// summary: | |
// Compare two date objects by date, time, or both. | |
// description: | |
// Returns 0 if equal, positive if a > b, else negative. | |
// date1: | |
// Date object | |
// date2: | |
// Date object. If not specified, the current Date is used. | |
// portion: |
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
define({ | |
plugins: [ | |
{ | |
module: "my/wire/authentication", | |
providers: [ | |
["/foo", { module: "my/tests/wire/testProvider" }], | |
["/bar", { module: "my/tests/wire/testProvider" }] | |
] | |
} | |
], |