-
Notifications
You must be signed in to change notification settings - Fork 232
/
Element.Forms.all.html
98 lines (74 loc) · 2.8 KB
/
Element.Forms.all.html
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
<h2><a name="element.gettextinrange" id="element.gettextinrange">Element.getTextInRange</a></h2>
<div class="level2">
<p>
Returns the value of the text within a given range in the input.
</p>
<p>
<style>input.example {clear: both;width: 500px;display: block;}</style>
text in range (click the input to execute):
<input class="example" value="0123456789" id="ip1" onclick="EFexample(this, 'getTextInRange(2,5)', $(this).getTextInRange(2,5))" /><input class="example" />
</p>
</div>
<h2><a name="element.getselectedtext" id="element.getselectedtext">Element.getSelectedText</a></h2>
<div class="level2">
<p>
Gets the text that is currently selected.
</p>
<p>
selected text (select some text to execute):
<input class="example" value="0123456789" id="ip2" onclick="EFexample(this, 'getSelectedText', $(this).getSelectedText())" /><input class="example" />
</p>
</div>
<h2><a name="element.getselectedrange" id="element.getselectedrange">Element.getSelectedRange</a></h2>
<div class="level2">
<p>
Gets the range that is selected.
</p>
<p>
getSelectedRange: (select some text to execute)
<textarea class="example" value="0123456789" id="ip3" onclick="EFexample(this, 'getSelectedRange', JSON.encode($(this).getSelectedRange()))">
0123456789 0123456789 0123456789
</textarea>
<input class="example" />
</p>
</div>
<h2><a name="element.selectrange" id="element.selectrange">Element.selectRange</a></h2>
<div class="level2">
<p>
Selects a range of text.
</p>
<p>
selectRange (click to execute; this example passes in an array [2,5]):
<textarea class="example" id="ip4" onclick="EFexample(this, 'selectRange(2,5)', ''); $(this).selectRange(2,5)">
0123456789 0123456789 0123456789
</textarea>
<input class="example" />
</p>
</div>
<h2><a name="element.insertatcursor" id="element.insertatcursor">Element.insertAtCursor</a></h2>
<div class="level2">
<p>
Insert text at the cursor location.
</p>
<p>
insertAtCursor (click anywhere to insert the example):
<input class="example" value="0123456789" id="ip6" onclick="EFexample(this, 'insertAtCursor(\'!!!INSERTED!!!\')', $(this).insertAtCursor('!!!INSERTED!!!'))" /><input class="example" />
</p>
</div>
<h2><a name="element.insertaroundcursor" id="element.insertaroundcursor">Element.insertAroundCursor</a></h2>
<div class="level2">
<p>
Wraps text with the given strings.
</p>
<p>
insertAroundCursor (select some text or click anywhere to insert "<" and ">" around the text, test multiple lines):
<textarea class="example" cols="20" rows="3" id="ip7" onclick="EFexample(this, 'insertAroundCursor({before: \'<\', after: \'>\'})', $(this).insertAroundCursor({before: '<', after: '>'}))">0123456789
second line
third line</textarea><input class="example" />
</p>
</div>
<script>function EFexample(input, txt, value){
try {
input.getNext().value = txt + ": " + value;
}catch(e){dbug.log(e)}
}</script>