Menu

Node Tags

Developers
2003-11-13
2004-01-06
  • Dionyziz Zindros

    There should be a way to transfer information from Node to the loaded web site. For example if a web site loaded in a tab `wants' to display the current version of Node it should be able to do it, and with an easy way. I imagine something like this:
    <html><head><title>Communication between web site and program Test</title></head>
    <body>
    Your current version of Node is <$Version>
    </body>
    </html>
    The above code should be read by node, and the `node tag' which is here <$Version> should be changed to the appropriate value. There's no escape problem with that because in HTML, if someone wants to show the text <$Version>, he or she should write &lt;$Version&gt;. In addition, there aren't HTML tags with a meaning that begin with a dollar. The problem is how is it possible to parse the .html file and edit the node tags it contains with the right text. A solution is to open the file and replace node tags everytime a page is updated. But, is there a better solution for that? How about values that change in run-time?(for example there could be a node tag for the users count in a specific channel). How can these be parsed?

     
    • Rakan

      Rakan - 2003-11-18

      Dionyziz ... there is a better idea, which is Using a variable which is not delcared in html code... such as
      <b>the current Version is <? Version ?>
      you can notice that Version is not decalred and this wont print anything ..
      anywayz when Node is communicating with the HTML page we get the HTML code of that page and then Edit it..
      when we edit this file we just add a VB or J Script code to declare version variable and assigned a value to it
      after that we save the file as html and view it
      the variable declaration must be in <head> tag and u know that :)

      thats it

      hope it works i can do it :p

       
      • Dionyziz Zindros

        Well that's a nice idea.
        The basic thing is that we add the script after <head>, right? for example here:
        <head><title>Hello!</title></head>
        it should be replaced with:
        <head>
        <script language="javascript">
        //Added by Node
        node_version = "2.5"
        node_nickname = "stricker_mave"
        </script>
        <title>Hello!</title></head>

        This can be done easily to local files, but how can we do it in remote files? What method were you thinking to use to download these files?

        (nice idea, btw :P)

         
    • Rakan

      Rakan - 2003-11-18

      Inet Control or using winsock to connect to website after that we communicate with the website to get html code
      and do the rest as explained

       
    • Dionyziz Zindros

      OK, that's fine. You should start preparing some code for the download thing. Well, there's one more problem, maybe not so important. Some node_variables(values of node tags) change while node runs and they need to have different values even in the same session of a loaded html file. For example the users in a particular channel. A solution is to refresh the page each time these variables change, or just leave the previous values until the user clicks on a link/refreshes. Can you think of a better solution?

       
    • Dionyziz Zindros

      Node tags DO work now, in version 0.30. This is the feature that we use to make the webBrowser control not to refresh.
      The idea is simple:
      Every webBrowser object that contains something related with IRC, a channel, status, private, or DCC recieve window, has a related HTMLDocument object which contains the document object of the webBrowser. By changing the elements of the HTMLDocument we can change the data displayed on the webBrowser on-the-fly without having to refresh. This is done because the HTMLDocument is a reference object variable to the child-object "document" of the webBrowser control. This data can be a percent on the DCC recieve window, the hole text in a channel, the nicklist of a channel or the text in a private window; everything is updated on-the-fly. Therefore, the program runs in a lot faster and without the need of so much memory or amount of CPU.

       
    • Dionyziz Zindros

      Node tags also work for web sites :)
      The feature is called xNode and allows a web site to get information about Node(which version you are using, etc.) and act appropriately. For example if the Node web site is loaded inside node, it can use an xNode tag to determine the version of the client the user is using and display some special text if it's too old(like "Your version is older than the current release, it's recommended that you download the new one"). The hole processing is done via HTML DOM. To add an xNode tag in a web site include the following tag somewhere in the HTML document:
      <div id="xnode_tagname"></div>
      where tagname is the name of the xNode tag to get, for example "version". After the document is loaded a script can use xnode_tagname.innerText to get the value of the xNode tag and take a specific action. Note that it's useful to hide xNode tags if they are used only for scripting, like this:
      <div id="xnode_version" style="display:none">
      </div>

       
    • Dionyziz Zindros

      If you are using the release 0.30, load the program and let Node web site load. You will see a special section(which is not viewable if you use a browser) called `Node Users'. This is done using Node tags(so the web site can determine if the user is using Node or not ;).

       

Log in to post a comment.