Add a true color picker (jscolor from jscolor.com)

This commit is contained in:
Ophir LOJKINE 2013-11-20 22:51:32 +01:00
parent f744c91142
commit c34c141b8e
3 changed files with 4 additions and 8 deletions

View file

@ -8,6 +8,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link rel="stylesheet" type="text/css" href="board.css" />
<script type="text/javascript" src="/socket.io/socket.io.js"></script>
<script type="text/javascript" src="/js/jscolor/jscolor.js"></script>
</head>
<body>
@ -32,7 +33,7 @@
<h3>Configuration</h3>
<label for="chooseColor">Color:</label>
<input type="color" id="chooseColor" value="black" />
<input type="color" class="color {hash:true}" id="chooseColor" value="black" />
<br/>
<label for="chooseSize">Size:</label>
<input type="range" id="chooseSize" value="10" min="1" max="50" step="1" />

View file

@ -252,14 +252,9 @@ Tools.positionElement = function (elem, x, y) {
(function color (){
var chooser = document.getElementById("chooseColor");
function update (){
chooser.style.backgroundColor = chooser.value;
}
update();
chooser.onkeyup = chooser.onchange = update;
Tools.getColor = function(){
return chooser.style.backgroundColor;
return chooser.value;
};
})();

View file

@ -3,7 +3,7 @@
"collaborative",
"whiteboard"
],
"version": "0.1.0-20",
"version": "0.1.0-28",
"dependencies": {
"node-static": "0.7.x",
"socket.io": "0.9.x"