CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Nov 2006
    Posts
    15

    Question HTC File does not work in firefox

    I have a HTC file which work fine in Internet Explorer, but does not work in Firefox. Is there a way to change the HTC file so it will work in firefox?
    the HTC file is:
    <html XMLNS:NumericUpDown dir="ltr">
    <PUBLIC:COMPONENT tagname="NumericUpDown" literalcontent=true >
    <PUBLIC:PROPERTY name="valueTextBox" get="GetValueTextBox"/ >
    <PUBLIC:ATTACH EVENT="oncontentready" ONEVENT="LoadThis()" />
    <PUBLIC:PROPERTY name="textBoxValue" put="SetValue" get="GetValue"/ >
    <PUBLIC:PROPERTY name="maxValue" value="1000"/ >
    <PUBLIC:PROPERTY name="minValue" / >
    <PUBLIC:PROPERTY name="jumpSize" value="0.05"/ >
    <PUBLIC:PROPERTY name="imgUp" put="SetUp"/ >
    <PUBLIC:PROPERTY name="imgDown" put="SetDown"/ >
    <PUBLIC:PROPERTY name="imgClickedUp" put="SetClickedUp"/ >
    <PUBLIC:PROPERTY name="imgClickedDown" put="SetClickedDown"/ >
    <PUBLIC:PROPERTY name="width" put="SetWidth" get="GetWidth"/ >
    <PUBLIC:PROPERTY name="height" put="SetHeight" get="GetHeight"/ >
    <PUBLIC:EVENT ID = "valueChanged" NAME = "onValueChanged"/>
    <SCRIPT LANGUAGE="JScript">

    var clickedUpImage;
    var clickedDownImage;
    var upImage;
    var downImage;
    var prevValue;

    function GetValueTextBox()
    {
    return document.getElementById('OddsValue');
    }

    function SetClickedUp(vValue)
    {
    clickedUpImage = vValue;
    }

    function SetClickedDown(vValue)
    {
    clickedDownImage = vValue;
    }

    function SetDown(vValue)
    {
    document.getElementById('imgDown').src = vValue;
    downImage = vValue;
    }

    function SetUp(vValue)
    {
    document.getElementById('imgUp').src = vValue;
    upImage = vValue;
    }

    function SetHeight(vValue)
    {
    document.getElementById('OddsValue').style.height = vValue;
    document.getElementById('AllControl').height = vValue;
    document.getElementById('imgUp').style.height = parseFloat(vValue) / 2 - 2;
    document.getElementById('imgDown').style.height = parseFloat(vValue) / 2 - 2;

    }

    function GetHeight()
    {
    return document.getElementById('AllControl').height;
    }

    function SetWidth(vValue)
    {
    document.getElementById('AllControl').width = vValue;
    document.getElementById('OddsValue').style.width = vValue - 12;
    }

    function GetWidth()
    {
    return document.getElementById('AllControl').width;
    }

    function SetValue(vValue)
    {
    document.getElementById('OddsValue').value = vValue;
    }

    function GetValue()
    {
    return parseFloat(document.getElementById('OddsValue').value).toFixed(2);
    }

    function LoadThis()
    {
    defaults.viewLink = document;
    }

    function ClickedUp()
    {
    if (!this.disabled)
    {
    var oldVal = document.getElementById('OddsValue').value;
    if (oldVal == null ||
    oldVal == '' ||
    oldVal == ' ')
    {
    document.getElementById('OddsValue').value = 2;
    }
    else if ((parseFloat(parseFloat(oldVal) + GetIntervalSizeForUp(document.getElementById('OddsValue').value))) > parseFloat(this.maxValue))
    {
    alert('לא ניתן להעלות את הערך מעל ' + this.maxValue);
    }
    else
    {
    document.getElementById('OddsValue').value = parseFloat(parseFloat(oldVal) + GetIntervalSizeForUp(oldVal)).toFixed(2);
    TextValueChanged();
    }
    }
    }

    function ClickedDown()
    {
    if (!this.disabled)
    {
    var oldVal = document.getElementById('OddsValue').value;
    if (oldVal == null ||
    oldVal == '' ||
    oldVal == ' ')
    {
    document.getElementById('OddsValue').value = 2;
    }
    else if ((parseFloat(parseFloat(oldVal) - GetIntervalSizeForDown(document.getElementById('OddsValue').value))) < parseFloat(this.minValue))
    {

    alert('לא ניתן להוריד את הערך מתחת ל ' + this.minValue);
    }
    else
    {
    document.getElementById('OddsValue').value = parseFloat(parseFloat(oldVal) - GetIntervalSizeForDown(oldVal)).toFixed(2);
    TextValueChanged();
    }
    }
    }

    function GetIntervalSizeForDown(oldValue)
    {
    oldValue = parseFloat(oldValue);
    if (oldValue > 100)
    {
    return parseFloat("10");
    }
    else if (oldValue > 50)
    {
    return parseFloat("5");
    }
    else if (oldValue > 30)
    {
    return parseFloat("2");
    }
    else if (oldValue > 20)
    {
    return parseFloat("1");
    }
    else if (oldValue > 10)
    {
    return parseFloat("0.5");
    }
    else if (oldValue > 5)
    {
    return parseFloat("0.2");
    }
    else if (oldValue > 4)
    {
    return parseFloat("0.1");
    }
    else if (oldValue > 3)
    {
    return parseFloat("0.05");
    }
    else if (oldValue > 2)
    {
    return parseFloat("0.02");
    }
    else
    {
    return parseFloat("0.01");
    }

    }

    function GetIntervalSizeForUp(oldValue)
    {
    oldValue = parseFloat(oldValue);
    if (oldValue < 2)
    {
    return parseFloat("0.01");
    }
    else if (oldValue < 3)
    {
    return parseFloat("0.02");
    }
    else if (oldValue < 4)
    {
    return parseFloat("0.05");
    }
    else if (oldValue < 5)
    {
    return parseFloat("0.1");
    }
    else if (oldValue < 10)
    {
    return parseFloat("0.2");
    }
    else if (oldValue < 20)
    {
    return parseFloat("0.5");
    }
    else if (oldValue < 30)
    {
    return parseFloat("1");
    }
    else if (oldValue < 50)
    {
    return parseFloat("2");
    }
    else if (oldValue < 100)
    {
    return parseFloat("5");
    }
    else
    {
    return parseFloat("10");
    }
    }

    function KeyUp()
    {
    oEvent = createEventObject();
    oEvent.result = parseFloat(document.getElementById('OddsValue').value).toFixed(2);
    valueChanged.fire(oEvent);
    }

    function TextValueChanged()
    {
    if (prevValue != document.getElementById('OddsValue').value)
    {
    prevValue = document.getElementById('OddsValue').value;
    re = new RegExp('^[0-9]{0,}["."]?[0-9]{0,}');

    if (document.getElementById('OddsValue').value != '')
    {
    if (document.getElementById('OddsValue').value.match(re)[0].length != document.getElementById('OddsValue').value.length)
    {
    alert('נא להזין ערך מספרי עבור היחס');
    document.getElementById('OddsValue').value = '';
    prevValue = '';
    oEvent = createEventObject();
    oEvent.result = 0;
    valueChanged.fire(oEvent);
    }
    else
    {
    if (parseFloat(document.getElementById('OddsValue').value) > parseFloat(maxValue))
    {
    alert('לא ניתן להעלות את הערך מעל ' + this.maxValue);
    document.getElementById('OddsValue').value = maxValue;
    prevValue = maxValue;
    oEvent = createEventObject();
    oEvent.result = maxValue;
    valueChanged.fire(oEvent);
    }
    else if(parseFloat(document.getElementById('OddsValue').value) < parseFloat(minValue))
    {
    alert('לא ניתן להוריד את הערך מתחת ל ' + this.minValue);
    document.getElementById('OddsValue').value = minValue;
    prevValue = minValue;
    oEvent = createEventObject();
    oEvent.result = minValue;
    valueChanged.fire(oEvent);
    }
    else
    {
    this.value = parseFloat(document.getElementById('OddsValue').value).toFixed(2);
    prevValue = document.getElementById('OddsValue').value;
    oEvent = createEventObject();
    oEvent.result = this.value;
    valueChanged.fire(oEvent);
    }
    }
    }
    }
    }

    function SetInnerValue()
    {
    document.getElementById('OddsValue').value = document.value;
    }

    function ShowPointer()
    {
    this.style.cursor = "pointer";
    }

    function DownImageMouseDown()
    {
    document.getElementById("imgDown").src = clickedDownImage;
    }

    function UpImageMouseDown()
    {
    document.getElementById("imgUp").src = clickedUpImage;
    }

    function DownImageMouseUp()
    {
    document.getElementById("imgDown").src = downImage;
    }

    function UpImageMouseUp()
    {
    document.getElementById("imgUp").src = upImage;
    }

    function ShowArrow()
    {
    this.style.cursor = "arrow";

    if (document.getElementById("imgUp").src != upImage)
    {
    document.getElementById("imgUp").src = upImage;
    }

    if (document.getElementById("imgDown").src != downImage)
    {
    document.getElementById("imgDown").src = downImage;
    }
    }

    </SCRIPT>
    </PUBLIC:COMPONENT>
    <head>
    </head>
    <body>
    <Table id="AllControl" cellpadding="0" cellspacing="0" border="0" width="100%">
    <TR>
    <TD>
    <table cellpadding="0" cellspacing="0" border="0" width="100%" ID="Table1">
    <TR>
    <TD colspan="2"><img src="Transparent1px.gif" height="1px"></TD>
    </TR>
    <TR>
    <TD height="8px"><img id="imgUp" src="" width="11px" height="100%" onclick="ClickedUp()" onMouseOver="ShowPointer()" onmouseout="ShowArrow()" onmousedown="UpImageMouseDown()" onmouseup="UpImageMouseUp()"></TD><TD><img src="Transparent1px.gif" width="1px"></TD>
    </TR>
    <TR>
    <TD colspan="2"><img src="Transparent1px.gif" height="2px"></TD>
    </TR>
    <TR>
    <TD height="8px"><img id="imgDown" src="" width="11px" height="100%" onclick="ClickedDown()" onMouseOver="ShowPointer()" onmouseout="ShowArrow()" onmousedown="DownImageMouseDown()" onmouseup="DownImageMouseUp()"></TD><TD><img src="Transparent1px.gif" width="1px"></TD>
    </TR>
    <TR>
    <TD colspan="2"><img src="Transparent1px.gif" height="1px"></TD>
    </TR>
    </table>
    </TD>
    <TD width="100%">
    <input id="OddsValue" type="text" id="OddsValue" NAME="OddsValue" onKeyUp="KeyUp()" onChange="TextValueChanged()" style="height:20px">
    </TD>
    </TR>
    </Table>
    </body>
    </html>

  2. #2
    Join Date
    May 2002
    Posts
    10,943

    Re: HTC File does not work in firefox

    What doesn't work? What are those public calls?
    If the post was helpful...Rate it! Remember to use [code] or [php] tags.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured