ginebra/chrome/demochrome/snippets/TopSnippet.html
author Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
Tue, 04 May 2010 12:39:35 +0300
changeset 0 1450b09d0cfd
permissions -rw-r--r--
Revision: 201015 Kit: 201018

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">

  <head>
    <link rel="stylesheet" id = "CSSLink" type="text/css" href="../css/chromeStyleBlack.css" />
  </head>
  <script type="text/javascript">

      function loadToMainWindow(url){
         window.parent.pageController.currentLoad(url);
      }
      window.parent.pageController.loadStarted.connect(
        function() {
        document.getElementById("PBar").style.width = "0%";
        }
      );
      window.parent.pageController.loadProgress.connect(
        function(percent) {
         var parentWidth = document.getElementById("PBarWrapper").offsetWidth;
         document.getElementById("PBar").style.width = (parentWidth * percent)/100 + "px";
        }
      );
      window.parent.pageController.loadFinished.connect(
        function(ok) {
        document.getElementById("PBar").style.width = "0%";
        }
      );
  </script>
  <body>
    <form name = "gotoUrlForm">
      <span id="PBarWrapper" class="ProgressBarWrapper" style="width: 260px; position: absolute; top: 3px; left:4px; height:20px">
        <span id="PBar" class="ProgressBar" style="position:absolute; left: 1px; height: 18px;">
        </span>
        <input type ="text"
               class = "Text"
               id = "urlBox"
               name = "textBox"
               style = "position: absolute; width: 260px; height: 18px"
               value="http://www.google.com/webhp?hl=en&output=html"/>
      </span>
      <span style="position: absolute; left: 270px; display: inline">
        <input type = "button" class="Button" value="Go" style="display: inline"
               onclick="loadToMainWindow(document.gotoUrlForm.textBox.value)"/>
        <input type = "button" class="Button" value="Min" style="display: inline"
               onclick = "window.parent.chrome.topToggle();window.parent.chrome.bottomToggle()"/>
      </span>
    </form>
  </body>
</html>