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 Test(cfg) { | |
Test.superclass.constructor.apply(this, arguments); | |
this.initializer(cfg); | |
}; | |
Y.extend(Test, Y.Base, { | |
initializer: function(config) { | |
this.addAttrs({ | |
items: { | |
value: [] |
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
YUI({ debug: true, | |
filter: 'debug', | |
logInclude: { event: true, attribute: true }, | |
timeout: 10000 }).use("node", "attribute", "dd-drag", "dd-drop", "dd-constrain", function(Y) { | |
Y.Node.prototype.toString = function() { … } // This works | |
Y.DOM.hasClass = function(node, className) { … } // This doesn't | |
// Here goes my own code |
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
/** | |
* Converts relative UTF8 characters (C-style) to | |
* JavaScript friendly utf chars | |
**/ | |
var str = ""; | |
var relativeTo = 0x300; | |
[0x90,0x99,0xaa,0xaf,0xb9,0xca,0x7e,0x87, | |
0x84,0xc4,0xbe,0xad,0xb6,0x85,0xb5,0x8a, | |
0xc2,0xb8,0xbb,0xb3,0xbd,0xba,0xc7,0xcb, |
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
exports.example = function(a, b) { | |
['This is a function foo which is supposed to do something.\n\ | |
But the best thing is that it has nice documentation in it.\ | |
@param {String} a first argument\ | |
@param {String} b second argument\ | |
@returns {String} Concatinated string literal'] | |
return [a, b].join(" "); | |
}; |
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
- simple | |
- public over private | |
- personal vanity | |
- internet is global | |
- permalinks | |
- one important item per page | |
- don't break the browser | |
- don't wanker in technology | |
- a medium is not a grande | |
- break convention for your users |
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
insertNodeAtSelection : function(win, insertNode, _container, _pos) | |
{ | |
// get current selection | |
var sel = this._getSelection(); var doc = this._getDoc(); | |
// get the first range of the selection (there's almost always only | |
// one range) | |
var range = sel.getRangeAt(0); | |
// deselect everything |
NewerOlder