Skip to content

Instantly share code, notes, and snippets.

<!DOCTYPE html>
<html>
<head>
<title>Dojo x-domain Skeleton</title>
<script src="http://ajax.googleapis.com/ajax/libs/dojo/1.5/dojo/dojo.xd.js" djConfig="isDebug:true"></script>
<script>
dojo.ready(function(){
var dojoUrl = "http://ajax.googleapis.com/ajax/libs/dojo/1.5/"
dojo.NodeList.prototype.grab = function(url, extraArgs, method){
// summary: Grab some remote HTML and inject into these nodes.
//
// url: String
// A url to fetch. Uses `dojo.xhr`, so must be same domain
//
// extraArgs: dojo._ioArgs?
// An Optional parameter to mix in other standard dojo._ioArgs
// into this request. (such as sync, timeout, error callbacks,
// and so on.)
<div class='edujiniAddFeed' dojoAttachPoint='domNode'>
<button>Add a subscriptions</button><br>
<div></div>
<div dojoAttachPoint="containerNode"></div>
</div>
@phiggins42
phiggins42 / kwargs.py
Created February 4, 2011 23:25
i was confused.
#!/usr/bin/env python
# encoding: utf-8
"""
test.py
"""
class Foo(object):
def kwargdefaults(self, **kwargs):
return {
dojo.provide("plugd.magicArray");
(function(d){
/*=====
plugd.magicArray = {
// summary: A module that overwrites various Base Dojo Array APIs
// with a version that branches for Objects.
//
// description:
//
<!DOCTYPE html>
<html>
<head>
<title>Dojo x-domain Skeleton</title>
<script src="http://ajax.googleapis.com/ajax/libs/dojo/1.5/dojo/dojo.xd.js"></script>
<script>
// the superclass
dojo.declare("Foo", null, {
bar:function(){
define("can", ["has"], function(has){
return {
has: function(test, callback){
// summary: doublepluscool has.js intergration
// example:
// can.has("array-forEach", function(ihas){
// if(ihas){
// // There is a native Array.prototype.forEach
// }
Index: lib/parser2/dojo2.inc
===================================================================
--- lib/parser2/dojo2.inc (revision 23594)
+++ lib/parser2/dojo2.inc (working copy)
@@ -143,6 +143,61 @@
return $files;
}
+function _slashtoname($thing){
+ return str_replace("/", ".", $thing);
function throttled(t){
var d = new doh.Deferred();
var x = 0;
var fn = dojo.throttle(function(a){
x = a;
}, 100);
fn(1); fn(2); fn(3); fn(4);
(function(d){
window.noteval = function(/* String */code){
// summary: Execute some javascript.
if(!code) return;
var e = d.createElement("script"),
// jump through the cross-browser hoops:
how = "text" in e ? "text" :