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
$.fn.format = function(opts){ | |
var o = $.extend({}, defaults.format, opts), codez = formatCodes(o.locale); | |
return this.each(function(){ | |
var me = $(this), isinput = me.is(":input"), | |
n = me[(isinput ? "val" : "text")] | |
; | |
n.call(me, formatNumber(n.call(me), o, codez)); | |
}); | |
} |
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> | |
<script src="http://ajax.googleapis.com/ajax/libs/dojo/1.4/dojo/dojo.xd.js"></script> | |
<script> | |
dojo.declare("A", null, { | |
constructor:function(){}, | |
parented: function(){ | |
console.warn(arguments.length, arguments); // 3, [1,2,3] | |
return 1; |
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("dojox.mustache._Templated"); | |
dojo.require("dijit._Widget"); | |
dojo.require("dijit._Templated"); | |
// | |
// INSTALL: copy http://github.com/janl/mustache.js to this folder as _base.js | |
// Add dojox.mustache = dojo.hitch(Mustache, "to_html") in _base.js, wrapping | |
// the whole file in a self-executing-anonymous-function. eg: | |
// | |
// dojo.provide("dojox.mustache._base"); | |
// (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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Standalone Twitter widget</title> | |
</head> | |
<body> | |
<h1>A TwitterThingr</h1> | |
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
Index: dojo/parser.js | |
=================================================================== | |
--- dojo/parser.js (revision 22613) | |
+++ dojo/parser.js (working copy) | |
@@ -6,10 +6,40 @@ | |
dojo.parser = new function(){ | |
// summary: The Dom/Widget parsing package | |
- var d = dojo; | |
- this._attrName = d._scopeName + "Type"; |
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> Testing dojo.xhr HEAD </title> | |
<script src="http://ajax.googleapis.com/ajax/libs/dojo/1.5/dojo/dojo.xd.js"></script> | |
<script> | |
dojo.ready(function(){ | |
var d = dojo, handlers = d.contentHandlers; |
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("dojo.NodeList-data"); | |
(function(d){ | |
/*===== | |
dojo.NodeList.prototype.data = function(key, value){ | |
// summary: stash or get some arbitrary data on/from these nodes. | |
// | |
// description: | |
// Stash or get some arbirtrary data on/from these nodes. This private _data function is | |
// exposed publicly on `dojo.NodeList`, eg: as the result of a `dojo.query` call. |
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>Dojo x-domain Skeleton</title> | |
<link rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/dojo/1.5/dijit/themes/claro/claro.css"> | |
<script src="http://ajax.googleapis.com/ajax/libs/dojo/1.5/dojo/dojo.xd.js"></script> | |
<script> | |
dojo.require("dijit.layout.TabContainer"); | |
dojo.require("dijit.layout.ContentPane"); | |
dojo.require("dijit.form.Button"); |
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
// 1: how could you rewrite the following to make it shorter? | |
if (foo) { | |
bar.doSomething(el); | |
} else { | |
bar.doSomethingElse(el); | |
} | |
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 foo = { | |
count: 0, | |
bar: function(it){ | |
this.count++; | |
} | |
}; | |
var bar = "bar"; |