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
/** | |
* Return a new object from an array of key/value pairs. | |
* Inspired by the "dict" constructor in python. | |
* | |
* @method dict | |
* @param {Array} arr An array of key/value pairs. | |
* @return {Object} A new object | |
* @static | |
*/ | |
Y.namespace('Object').dict = function(arr) { |
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
/* global YUI=true */ | |
/* Note: the "png" prefix you're seeing through this file is just my own | |
namespace. No reference to the Portable Network Graphic intended. */ | |
YUI.add('png-entity', function(Y) { | |
/** | |
The ContainmentUnit's purposes are: creating Entity extensions, store them and handle | |
the relations between them. | |
@class ContainmentUnit | |
@constructor |
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 CONAN(cls) { | |
/* Arbitrary Number of Arguments Object Constructor, | |
ANAOC | |
but everyone calls him | |
CONAN | |
CONAN takes a Object Constructor and adds a static method named "build", whose only | |
argument is an array that get passed to the Constructor with an apply. | |
*/ | |
var _helper = function(s) { | |
cls.apply(this, s); |
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
/* Python(ish) string formatting: | |
* >>> format('{0}', ['zzz']) | |
* "zzz" | |
* >>> format('{x}', {x: 1}) | |
* "1" | |
*/ | |
var format = (function() { | |
var re = /\{([^}]+)\}/g; | |
return function(s, args) { | |
return s.replace(re, function(_, match){ return args[match]; }); |
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 PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" | |
"http://www.w3.org/TR/1999/REC-html401-19991224/loose.dtd"> | |
<html> | |
<head> | |
<title>Checkbox personalizzate</title> | |
<style> | |
#custom_checkbox input[type=checkbox] { display: none; } | |
#custom_checkbox label { padding-left: 20px; background-position: 0px center; | |
background-repeat: no-repeat; cursor: pointer; } |
NewerOlder