Prev | Current Page 783 | Next

L. McColl-Sylvester and F. Ponticelli

"Professional haXe and Neko"

length > 0) {
selectColor(filtered.first());
}
}
public function selectColor(c : Color)
{
elsampler.style.backgroundColor = c.hex;
untyped
{
if(input.setSelectionRange)
{
var pos = input.selectionStart;
input.value = c.name;
input.setSelectionRange(pos, input.value.length);
} else if(input.createTextRange){
var pos = input.value.length-document.selection.createRange().text.length;
var range = input.createTextRange();
input.value = c.name;
range.moveStart(???character???, pos);
range.select();
}
}
}
(continued)
422
Part II: Server Side, JavaScript, and Flash: Oh My!
private function createTagsContainer()
{
eltags = js.Lib.document.createElement(???div???);
eltags.id = input.id + ???_tags???;
input.parentNode.appendChild(eltags);
}
private function createColorSampler()
{
elsampler = js.Lib.document.createElement(???div???);
elsampler.id = input.id + ???_sampler???;
elsampler.innerHTML = ??? < div style=???color:black??? > Text in Black < /div >
< div style=???color:white??? > Text in White < /div > ??™;
input.


Pages:
771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795