The spec has moved to a repo: https://github.com/defunctzombie/package-browser-field-spec to facilitate collaboration.
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
module.exports = function(file, api) { | |
var j = api.jscodeshift; | |
var root = j(file.source); | |
root.find(j.Identifier).forEach(function(p) { | |
if(p.value.name === 'Class') { | |
if(p.parentPath.name === 'init'){ | |
var classDefinition = p.parentPath.value.arguments[0]; | |
var varname = p.parentPath.parentPath; | |
var name = varname.value.id; | |
var target = varname.parentPath.parentPath |
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
" TESTING: Entity Escaper | |
command Entities :call Entities() | |
function Entities() | |
silent %s/&/\&/eg | |
silent %s/"/\"/eg | |
silent %s/'/\'/eg | |
silent %s/</\</eg | |
silent %s/>/\>/eg | |
silent %s/¡/\¡/eg | |
silent %s/¢/\¢/eg |
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
var template = function(html){ | |
var root = document.createElement('root'); | |
root.innerHTML = html; | |
var nodes = root.getElementsByTagName('*'), ids = {}; | |
for (var i = 0, l = nodes.length; i < l; i++){ | |
var id = nodes[i].getAttribute('id'); | |
if (id){ | |
nodes[i].removeAttribute('id'); | |
ids[id] = i; | |
} |
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
define({ | |
/* | |
* Simplified prototypal inheritance, see http://javascript.crockford.com/prototypal.html | |
*/ | |
create: function (obj){ | |
function F() {} | |
F.prototype = obj; | |
return new F(); | |
}, |
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
//******************************************* | |
// Level 1, basic API, minimum support | |
//******************************************* | |
/* | |
Modules IDs are strings that follow CommonJS | |
module names. | |
*/ | |
//To load code at the top level JS file, | |
//or inside a module to dynamically fetch |
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
/* XML Methods for MooTools */ | |
/* Requires MooTools v1.3 */ | |
var XML = { | |
rootFromFile: function(file){ | |
var root = null; | |
switch (Browser.name){ | |
case 'safari': | |
case 'chrome': |
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(){ | |
// thanks @astolwijk | |
var key = (function(){ | |
var list = ['', 'webkit', 'Moz', 'O', 'ms'], | |
element = document.html; | |
for (var i = 0; i < list.length; i++){ | |
var prefix = list[i]; | |
if (element.style[prefix ? prefix + 'TransitionProperty' : 'transitionProperty'] != null) |
Language / Prior Art | ‘Valid’ HTML | HTML Mapping | Example | Example with Args |
---|---|---|---|---|
‘Valid’ | CSS Selectable | CSS Mapping | CSS Select | CSS Selector w Args |
JavaScript MooTools | Multiple instance Separate Args | new Foo(element); new Bar(element) |
new Foo(element, {a:"a", bB:"b B", c:{c:1}}); new Bar(element, {d:"d"}) |
|
— | — | — | — | — |
HTML attr Dojo <1.6 | NO |