summaryrefslogtreecommitdiffstats
path: root/common/src/main/webapp/usageguide/browser/templates/textarea.html
blob: 9d885e602038baa690835f98eb3c281ae51fc2aa (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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
<!--

    Copyright 2016-2017, Huawei Technologies Co., Ltd.

    Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    You may obtain a copy of the License at

            http://www.apache.org/licenses/LICENSE-2.0

    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.

-->

<h4>Text Area</h4>
<body>
<div name="myForm"  method="post">
    <div class="form-group row">
        <label for="fname" class="col-xs-2 col-form-label labelstyle">Text</label>
        <div class="col-xs-10">
            <div id="fname"></div>

        </div>
    </div>

    <div class="form-group row">
        <label for="email" class="col-xs-2 col-form-label labelstyle">Email</label>
        <div class="col-xs-10">
            <div id="email" ></div>
        </div>
    </div>
    <div class="form-group row">
        <label for="url" class="col-xs-2 col-form-label labelstyle">URL</label>
        <div class="col-xs-10">
            <div id="url"></div>
        </div>
    </div>
    <div class="form-group row">
        <label for="password" class="col-xs-2 col-form-label labelstyle">Password</label>
        <div class="col-xs-10">
            <div id="password"></div>
        </div>
    </div>
    <div class="form-group row">
        <label for="numeric" class="col-xs-2 col-form-label labelstyle">Numeric</label>
        <div class="col-xs-10">
            <div id="numeric"></div>
        </div>
    </div>
    <div class="form-group row">
        <label for="dot" class="col-xs-2 col-form-label labelstyle">Date and time</label>
        <div class="col-xs-10">
            <div id="dot"></div>
        </div>
    </div>
    <div class="form-group row">
        <label for="dateinput" class="col-xs-2 col-form-label labelstyle">Date</label>
        <div class="col-xs-10">
            <div id="dateinput"></div>
        </div>
    </div>
    <div class="form-group row">
        <label for="monthinput" class="col-xs-2 col-form-label labelstyle">Month</label>
        <div class="col-xs-10">
            <div id="monthinput"></div>
        </div>
    </div>
    <div class="form-group row">
        <label for="weekinput" class="col-xs-2 col-form-label labelstyle">Week</label>
        <div class="col-xs-10">
            <div id="weekinput"></div>
        </div>
    </div>
    <div class="form-group row">
        <label for="timeinput" class="col-xs-2 col-form-label labelstyle">Time</label>
        <div class="col-xs-10">
            <div id="timeinput"></div>
        </div>
    </div>
    <div class="form-group row">
        <label for="ipv4" class="col-xs-2 col-form-label labelstyle">IPV4 Address</label>
        <div class="col-xs-10">
            <div id="ipv4"></div>
        </div>
    </div>
    <div class="form-group row">
        <label for="ipv6" class="col-xs-2 col-form-label labelstyle">IPV6 Address</label>
        <div class="col-xs-10">
            <div id="ipv6"></div>
        </div>
    </div>


    <div class="form-group row">
        <label for="textarea" class="col-xs-2 col-form-label labelstyle">Text Area</label>
        <div class="col-xs-10">
            <div id="textarea"></div>

        </div>
    </div>

    <div class="form-group row">
        <label for="note" class="col-xs-2 col-form-label labelstyle">Note</label>
        <div class="col-xs-10">
            <div id="note">
            </div>

        </div>
    </div>

</div>
<div class="shortnote">
    <div class="shortnoteHeader">Usage</div>
    <div class="shortnoteText">Create a div tag  in html file with specific id  for example Email and write a specific function in javascript file to perform your business logic. An sample example as shown below for Email and Note, the same logic can be followed by all remaining text fields:</div>
    <br>
    <div>HTML file:</div>
    <pre><code>&ltdiv id="textArea" ng-init="init()"&gt&lt/div&gt</code></pre>
    <pre><code>&ltdiv id="Email"&gt&lt/div&gt</code></pre>
    <pre><code>&ltdiv id="note"&gt&lt/div&gt</code></pre>
    <br>
    <div>Javascript file:</div>
    <pre><code>
        var data ={"Note" : {"message" : "Hi I am Note","placement" : "bottom"},"Email" : {"errmsg" : "The email is required.","placeholder" : "Email","modalVar":"email","errtag":"emailErr","errfunc":"validateemail"}};

        $scope.init = function() {
            loadTextArea();
        }

         function loadTextArea() {
            var note = $(modelTemplate).filter('#note').html();
            var email = $(modelTemplate).filter('#email').html();
            var html = Mustache.to_html(email, data.Email);
            $('#email').html($compile(html)($scope));
            var html = Mustache.to_html(note, {"placement":data.Note.placement});
            $('#note').html(html);
            $("#noteanchor").popover({
                template: '<div class="popover fade bottom in customPopover"><div class="arrow"></div>'+data.Note.message+'</div>'
            });

        }</code></pre>


</div>
</div>
</body>