X-Git-Url: http://mop.ddnsfree.com/gitweb/?a=blobdiff_plain;f=web%2Fcommons.js;h=3021613698b926a68c64f26668b4c9c94faba812;hb=c5b2fd40459b3ef6e7993a5048d4445e84b219c0;hp=f522ad538f85aa6325f28a342598947c3c23bfff;hpb=2dafd9b1a8edbf64595bee1e669be6c95921bf61;p=brisk.git diff --git a/web/commons.js b/web/commons.js index f522ad5..3021613 100644 --- a/web/commons.js +++ b/web/commons.js @@ -49,6 +49,18 @@ var mlang_commons = { 'imgload_a' : { 'it' : 'Immagine caricate ', function $(id) { return document.getElementById(id); } +function dec2hex(d, padding) +{ + var hex = Number(d).toString(16); + padding = typeof (padding) === "undefined" || padding === null ? padding = 2 : padding; + + while (hex.length < padding) { + hex = "0" + hex; + } + + return hex; +} + function getStyle(x,IEstyleProp, MozStyleProp) { if (x.currentStyle) { @@ -835,7 +847,7 @@ function user_dec_and_state(el) var val_el; content = user_decorator(el); - content += state_add(el[0]); + content += state_add(el[0],(typeof(el[2]) != 'undefined' ? el[2] : null)); return (content); } @@ -1183,7 +1195,7 @@ function url_complete(parent, url) } // alert("host: ["+host+"] path: ["+path+"]"); - if (url.substring(0,6) == 'http:/' || url.substring(0,7) == 'https:/') { + if (url.substring(0,6) == 'http:/' || url.substring(0,7) == 'https:/' || url.substring(0,4) == 'ws:/') { return (url); } else if (url.substring(0,1) == '/') {