JavaScript Tutorial/Dojo toolkit/Toaster — различия между версиями

Материал из Web эксперт
Перейти к: навигация, поиск
 
м (1 версия)
 
(нет различий)

Текущая версия на 08:24, 26 мая 2010

Error toaster

<html>
  <head>
    <link rel="StyleSheet" type="text/css" href="js/dojo/dojox/widget/Toaster/Toaster.css">
    <script type="text/javascript">
      var djConfig = {
        baseScriptUri : "js/dojo/",
        parseOnLoad : true
      };
    </script>
    <script type="text/javascript" src="js/dojo/dojo/dojo.js"></script>
    <script>
      dojo.require("dojo.parser");
      dojo.require("dojox.widget.Toaster");
      function showMsg(inMsg, inType, inDuration) {
        dojo.publish("toasterTopic", [{
          message : inMsg, type : inType, duration : inDuration
        }]);
      }
    </script>
  </head>
  <body class="tundra">
     <div dojoType="dojox.widget.Toaster" separator="&lt;Br&gt;" positionDirection="bl-up" messageTopic="toasterTopic"></div>
     <button type="submit" onClick="showMsg("Your text", "error", 1000);">Show</button>
  </body>
</html>


Message toaster

<html>
  <head>
    <link rel="StyleSheet" type="text/css" href="js/dojo/dojox/widget/Toaster/Toaster.css">
    <script type="text/javascript">
      var djConfig = {
        baseScriptUri : "js/dojo/",
        parseOnLoad : true
      };
    </script>
    <script type="text/javascript" src="js/dojo/dojo/dojo.js"></script>
    <script>
      dojo.require("dojo.parser");
      dojo.require("dojox.widget.Toaster");
      function showMsg(inMsg, inType, inDuration) {
        dojo.publish("toasterTopic", [{
          message : inMsg, type : inType, duration : inDuration
        }]);
      }
    </script>
  </head>
  <body class="tundra">
     <div dojoType="dojox.widget.Toaster" separator="&lt;Br&gt;" positionDirection="bl-up" messageTopic="toasterTopic"></div>
     <button type="submit" onClick="showMsg("Your text", "message", 1000);">Show message</button>
  </body>
</html>


Warning toaster

<html>
  <head>
    <link rel="StyleSheet" type="text/css" href="js/dojo/dojox/widget/Toaster/Toaster.css">
    <script type="text/javascript">
      var djConfig = {
        baseScriptUri : "js/dojo/",
        parseOnLoad : true
      };
    </script>
    <script type="text/javascript" src="js/dojo/dojo/dojo.js"></script>
    <script>
      dojo.require("dojo.parser");
      dojo.require("dojox.widget.Toaster");
      function showMsg(inMsg, inType, inDuration) {
        dojo.publish("toasterTopic", [{
          message : inMsg, type : inType, duration : inDuration
        }]);
      }
    </script>
  </head>
  <body class="tundra">
     <div dojoType="dojox.widget.Toaster" separator="&lt;Br&gt;" positionDirection="bl-up" messageTopic="toasterTopic"></div>
     <button type="submit" onClick="showMsg("Your text", "warning", 1000);">Show</button>
  </body>
</html>