This file contains 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); | |
} | |
// 1A: | |
bar[foo ? 'doSomething' : 'doSomethingElse'](el); |
This file contains 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
/* | |
NOTE: This wrapper "works", but is sorta incomplete... | |
* It does not explicitly support deterministic ordering/rearrangement of children. | |
* For that matter, the way Tree currently achieves this seems sort of obtuse. | |
Tree makes a blatant assumption on the existence of a children attribute | |
(since there is no dedicated method to set them), and reconstructs the array | |
every time children are reordered... |
This file contains 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>Test Issue #59</title> | |
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> | |
<meta name="viewport" content="width=570"/> | |
<style type="text/css"> | |
@import "../../dijit/themes/claro/document.css"; | |
@import "../../dijit/themes/claro/claro.css"; | |
@import "../css/dgrid.css"; |
This file contains 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> | |
#hierarchyTree { | |
height: 200px; | |
} | |
#hierarchyTree .dgrid-cell { | |
width: 100px; |
This file contains 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 findDep(depid) { | |
return Object.keys(require.modules).map(function(mid) { | |
return require.modules[mid]; | |
}).filter(function(m) { | |
return m.deps && m.deps.map(function(dep) { | |
return dep.mid; | |
}).indexOf(depid) > -1; | |
}).map(function(m) { | |
return m.mid; | |
}); |
This file contains 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 enterUp(node, listener) { | |
return on(node, "keyup", function(evt) { | |
if (evt.keyCode === 13) { | |
listener.call(this, evt); | |
} | |
}); | |
} | |
// Usage with dojo/on: on(element, enterUp, ...) | |
// Usage with dgrid editor: editor({ editOn: enterUp, ... }) |
This file contains 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> | |
<meta charset="utf-8"> | |
<link rel="stylesheet" href="../../dojo/resources/dojo.css"> | |
<link rel="stylesheet" href="../../dgrid/css/skins/claro.css"> | |
<style> | |
#list { | |
border: none; | |
height: auto; |
This file contains 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
[ | |
'ss-cursor', | |
'ss-crosshair', | |
'ss-search', | |
'ss-zoomin', | |
'ss-zoomout', | |
'ss-view', | |
'ss-attach', | |
'ss-link', | |
'ss-unlink', |
This file contains 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
javascript:window.spot=function(){function a(a,b){for(var d,c=document.styleSheets,e=0,f=c.length;f>e;e++)if((!b||c[e].href&&-1!==c[e].href.indexOf(b))&&(d=c[e].cssRules,d&&d.length))for(var g=d.length;g--;)d[g].selectorText&&a(d[g].selectorText)}function b(a,c){c||a(document.documentElement);for(var d=(c||document.documentElement).children,e=0,f=d.length;f>e;e++)a(d[e]),b(a,d[e])}function c(a){var b={},c=getComputedStyle(a);for(var d in c)isNaN(d)&&"function"!=typeof c[d]&&(b[d]=c[d]);return b}function d(a,b){var c=Object.keys(a);if(c.length!==Object.keys(b).length)return!1;for(var d=c.length;d--;)if(a[c[d]]!==b[c[d]])return!1;return!0}return{unusedClasses:function(){var a=Array.prototype.slice,e={},f=[];b(function(b){if(b.className){var g,h,f=a.call(b.classList);g=c(b);for(var i=f.length;i--;)h=f[i],e[h]||(b.classList.remove(h),e[h]=!d(g,c(b)),b.classList.add(h))}});for(var g in e)e[g]===!1&&f.push(g);return f},unusedSelectors:function(b){var c={};return a(function(a){document.querySelector(a)||(c[a]=!0)},b |
OlderNewer