Announcement

Collapse
No announcement yet.

Test page source code

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Test page source code

    Does anybody have the source code for localhost/test page?
    In the developers webinar 21 Dec 2012 the HS developer promiced to post the source code for the page to show how to use clsJQuery controls:

    Click image for larger version  Name:	2018-11-15 (1).png Views:	3 Size:	61.0 KB ID:	1259543
    Attached Files
    Last edited by alexbk66; November 15th, 2018, 06:10 AM.

  • #2
    HTML Code:
    <%@ Page Language="VB" %>
    <script runat="server">
    
        ' Insert page code here
        '
        Dim hs As Scheduler.hsapplication
        Dim plugin As HomeSeerAPI.PluginAccess
    
        Sub Page_Load(Sender As Object, E As EventArgs)
            ' for use with the HS web server
            hs = Context.Items("Content")
    
            ' get a reference to the Z-Wave plugin
            plugin = New HomeSeerAPI.PluginAccess(hs, "Z-Wave", "")
            If plugin.Connected Then
                Label2.Text = "Connected to Z-Wave plugin, name=" & plugin.Name
            End If
            label1.text = "HomeSeer Ver: " & hs.version
    
            Dim EN As Scheduler.Classes.clsDeviceEnumeration
            Dim dv As Scheduler.Classes.DeviceClass
            EN = hs.GetDeviceEnumerator
            Do
                dv = EN.GetNext
                If dv Is Nothing Then Continue Do
            Loop Until EN.Finished
        end sub
    
        Sub ButSpeak_Click(sender As Object, e As EventArgs)
            hs.speak(txtspeak.text,false,"")
            Dim EN As Scheduler.Classes.clsDeviceEnumeration
            Dim dv As Scheduler.Classes.DeviceClass
            EN = hs.GetDeviceEnumerator
            Do
                dv = EN.GetNext
                If dv Is Nothing Then Continue Do
            '    hs.WriteLog("SAMPLE", "Found device from aspx: " & dv.Name(Nothing))
            '    If dv.Interface(Nothing) IsNot Nothing Then
             '       If dv.Interface(Nothing).Trim = "Sample Plugin" Then
             '           hs.WriteLog("SAMPLE", "Found device from aspx: " & dv.Name(Nothing))
            '        End If
            '    End If
            Loop Until EN.Finished
        End Sub
    
        Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs)
            'hs.ExecX10("q7", "on")
        End Sub
    
        Protected Sub Button2_Click(ByVal sender As Object, ByVal e As System.EventArgs)
            'hs.ExecX10("q7", "off")
        End Sub
    
        Private Function GetHeadContent() As String
            Try
                Return hs.GetPageHeader("", "Test Page", "", "", False, False, True, False, False)
            Catch ex As Exception
            End Try
            Return ""
        End Function
    
        Private Function GetBodyContent() As String
            Try
                Return hs.GetPageHeader("", "Test Page", "", "", False, True, False, True, False)
            Catch ex As Exception
            End Try
            Return ""
        End Function
    
    </script>
    <html>
    <head runat="server">
    <%response.write(GetHeadContent())%>
    </head>
    <body>
    <% response.write(GetBodyContent()) %>
        <form runat="server">
            <p>
                <asp:Label id="Label1" runat="server" width="210px">Label</asp:Label>
            </p>
            <p>
                <asp:Label id="Label2" runat="server" width="400px">Label</asp:Label>
            </p>
            <p>
            </p>
            <p>
                <asp:Button id="ButSpeak" onclick="ButSpeak_Click" runat="server" Text="Speak"></asp:Button>
                <asp:TextBox id="TxtSpeak" runat="server"></asp:TextBox>
            </p>
            <p>
                <asp:Button ID="Button1" runat="server" OnClick="Button1_Click" Text="Light On" />
            </p>
            <p>
                <asp:Button ID="Button2" runat="server" OnClick="Button2_Click" Text="Light Off" />&nbsp;</p>
    
            <!-- Insert content here -->
        </form>
    </body>
    </html>
    
    tenholde

    Comment


    • #3
      This is for test.aspx I guess? No, I 'm after localhost/test, in the developers webinar 21 Dec 2012 the HS developer promiced to post the source code for the page to show how to use clsJQuery controls
      Click image for larger version  Name:	2018-11-15 (1).png Views:	1 Size:	61.0 KB ID:	1259541
      Last edited by alexbk66; November 15th, 2018, 06:13 AM.

      Comment


      • #4
        To be honest, the sample plugin provides more jQuery info than the sample page. Once you get things loaded into Visual Studio, the IntelliSense helps as well.
        HS3Pro Running on a Raspberry Pi3
        64 Z-Wave Nodes, 168 Events, 280 Devices
        UPB modules via OMNI plugin/panel
        Plugins: Z-Wave, BLRF, OMNI, HSTouch, weatherXML, EasyTrigger
        HSTouch Clients: 3 Android, 1 Joggler

        Comment


        • #5
          Originally posted by rmasonjr View Post
          To be honest, the sample plugin provides more jQuery info than the sample page. Once you get things loaded into Visual Studio, the IntelliSense helps as well.
          'Test' page has a lot of controls - would be nice to see the source.

          Comment

          Working...
          X