summaryrefslogtreecommitdiff
path: root/framework/Web/Javascripts/tests/Insertion.html
blob: 1aefd3aa45b4a8c1249af8869b9a33f3979b0738 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
<html>
<head>
  <script type="text/javascript" src="../../base.js"></script>
  <script type="text/javascript" src="../../dom.js"></script>
  <script type="text/javascript" src="../../form.js"></script>
  <script type="text/javascript">
    function test() {
      var type = Form.Element.getValue('type');
      var html = '<div>' + Form.Element.getValue('content') + '</div>';
      new Insertion[type]($('a'), html);
      return false;
    }
  </script>
  
  <style type="text/css">
    div#a {
      border: 2px solid blue;
      padding: 10px;
      margin-bottom: 10px;
    }
    
    div#a div {
      border: 1px solid red;
      padding: 5px;
    }
    
    textarea {
      display: block;
    }
  </style>
</head>
<body>
  <div id="a">
    content
  </div>
  <fieldset>
    <textarea id="content" rows="10" cols="60"></textarea>
    <select id="type">
      <option value="Before">Before</option>
      <option value="Top">Top</option>
      <option value="Bottom">Bottom</option>
      <option value="After">After</option>
    </select>
    <button onclick="return test()">Create Insertion</button>
  </fieldset>
</body>
</html>