While the second edition of Dojo: The Definitive Guide would be ideal, it hasn't been written. In the meantime I've decided to grab the raw text from docs.dojocampus.org to read on my kindle. In order to do that I needed to get the names of what I was interested in:
Evaluate this code in a dojo environment:
var p, l = [];
for (p in dojo) {
if (dojo.isFunction(dojo[p])) {
l.push(p);
console.log(p);
}
};
dojo.filter(l, function(a) {
if ("_" == a[0]) return false;
if (a[0].toUpperCase() == a[0]) return false;
return true;
}).sort().join("\n");
With this result I went to LinqPad and came up with this C# script:
void Main()
{
// http://docs.dojocampus.org/dojo/subscribe?action=raw
var urlTemplate = "http://docs.dojocampus.org/dojo/{0}?action=raw";
var mods = new string[] {
"addClass","addOnLoad","addOnUnload","addOnWindowUnload","anim",
"animateProperty","attr",
"blendColors","body","byId","cache","clone",
"colorFromArray","colorFromHex","colorFromRgb","colorFromString",
"connect","connectPublisher","contentBox","cookie","coords","create"
,"declare","delegate",
"deprecated","destroy","disconnect","empty","eval","every","exists",
"experimental","extend","fadeIn","fadeOut","fieldToObject","filter",
"fixEvent",
"forEach","formToJson","formToObject","formToQuery","fromJson",
"getComputedStyle",
"getNodeProp","getObject","hasAttr","hasClass","hitch","indexOf",
"isAlien","isArray","isArrayLike",
"isCopyKey","isDescendant",
"isFunction","isObject","isString","lastIndexOf",
"loadInit","loaded",
"map","marginBox","mixin","moduleUrl","objectToQuery","partial","place",
"platformRequire",
"position","provide","publish","query","queryToObject","rawXhrPost",
"rawXhrPut","ready",
"registerModulePath","removeAttr","removeClass","replace","require",
"requireAfterIf","requireIf",
"requireLocalization","safeMixin","setContext","setObject",
"setSelectable","some","stopEvent",
"style","subscribe","toJson","toggleClass","trim","unloaded",
"unsubscribe","when","windowUnloaded",
"withDoc","withGlobal","xdRequireLocalization","xhr","xhrDelete",
"xhrGet","xhrPost","xhrPut"
};
var outputDir = new System.IO.DirectoryInfo(@"g:\docs\dojo\");
var maxGets = 50;
var sb = new System.Text.StringBuilder();
for (var i = 0; i= --maxGets) break;
} catch (WebException ex) {
ex.Dump(mods[i]);
if (ex.Message.Contains("(503)")) {
System.Threading.Thread.Sleep(60 * 60 * 1000);
}
}
System.Threading.Thread.Sleep(5000);
}
}
System.IO.File.WriteAllText(System.IO.Path.Combine(outputDir.FullName, "dojo.methods.txt"), sb.ToString());
}
And finally I compressed "dojo.methods.txt" into a zip file and emailed it to myself@kindle.com. Now I have something to read tonight.
This *should* be a link to the generated text document which you can send to your reader:
ReplyDeletehttps://docs.google.com/uc?id=0BxoAH6foaELNY2FhYzk4MzktNjdkOS00ODY3LWFlYmMtNGI4NTI2ODgxOGEx&export=download&hl=en_US&authkey=CK7Mnd8D