2150 |
mathias |
1 |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
|
|
|
2 |
"http://www.w3.org/TR/html4/strict.dtd">
|
|
|
3 |
<html>
|
|
|
4 |
<head>
|
|
|
5 |
<title>Inline Edit Box Test</title>
|
|
|
6 |
|
|
|
7 |
<script type="text/javascript" src="../../../dojo/dojo.js"
|
|
|
8 |
djConfig="isDebug: true, parseOnLoad: true"></script>
|
|
|
9 |
<script type="text/javascript" src="../_testCommon.js"></script>
|
|
|
10 |
|
|
|
11 |
<script type="text/javascript">
|
|
|
12 |
dojo.require("dojo.data.ItemFileReadStore");
|
|
|
13 |
dojo.require("dijit.form.InlineEditBox");
|
|
|
14 |
dojo.require("dijit.form.Textarea");
|
|
|
15 |
dojo.require("dijit.form.TextBox");
|
|
|
16 |
dojo.require("dijit.form.DateTextBox");
|
|
|
17 |
dojo.require("dijit.form.FilteringSelect");
|
|
|
18 |
dojo.require("dijit.form.NumberSpinner");
|
|
|
19 |
dojo.require("dijit.form.Slider");
|
|
|
20 |
dojo.require("dojo.parser"); // scan page for widgets and instantiate them
|
|
|
21 |
|
|
|
22 |
function myHandler(id,newValue){
|
|
|
23 |
console.debug("onChange for id = " + id + ", value: " + newValue);
|
|
|
24 |
};
|
|
|
25 |
dojo.addOnLoad(function(){
|
|
|
26 |
dojo.subscribe("widgetFocus", function(widget){
|
|
|
27 |
console.log("focused on widget " + (widget?widget:"nothing"));
|
|
|
28 |
});
|
|
|
29 |
dojo.subscribe("widgetBlur", function(widget){
|
|
|
30 |
console.log("blurred widget " + (widget?widget:"nothing"));
|
|
|
31 |
});
|
|
|
32 |
dojo.subscribe("focusNode", function(node){ console.log("focused on node " + (node?(node.id||node.tagName):"nothing"));});
|
|
|
33 |
});
|
|
|
34 |
</script>
|
|
|
35 |
<style type="text/css">
|
|
|
36 |
@import "../../../dojo/resources/dojo.css";
|
|
|
37 |
@import "../css/dijitTests.css";
|
|
|
38 |
|
|
|
39 |
.inlineEdit { background-color: #CCC76A; }
|
|
|
40 |
|
|
|
41 |
/* some style rules on nodes just to test that style gets copied to the edit widget */
|
|
|
42 |
p { font-family: cursive; }
|
|
|
43 |
h3 { font-family: helvetica; font-style: italic; }
|
|
|
44 |
</style>
|
|
|
45 |
</head>
|
|
|
46 |
<body>
|
|
|
47 |
<h1 style="color: red; margin-bottom: 5em;">dijit.form.InlineEditBox is deprecated, use <a href="../test_InlineEditBox.html">dijit.InlineEditBox</a> instead</h1>
|
|
|
48 |
<div>
|
|
|
49 |
The following tests each show a plain element followed by an editable element.
|
|
|
50 |
The plain element and editable element should look the same (font, font-size, block vs. inline) etc.,
|
|
|
51 |
and clicking an editable element should bring up an editor with the same attributes
|
|
|
52 |
(font, font-size, block vs. inline) as the editable element.
|
|
|
53 |
</div>
|
|
|
54 |
<hr>
|
|
|
55 |
|
|
|
56 |
<h2>H3</h2>
|
|
|
57 |
<div>
|
|
|
58 |
The following two h3 tags should be look the same. They are display:block, and the editor should take up the entire
|
|
|
59 |
width of the screen.
|
|
|
60 |
</div>
|
|
|
61 |
|
|
|
62 |
(before plain h3)
|
|
|
63 |
<h3>this is a plain h3, cannot be edited</h3>
|
|
|
64 |
(between plain and editable h3)
|
|
|
65 |
<h3 id="editable" dojoType="dijit.form.InlineEditBox" onChange="myHandler(this.id,arguments[0])">
|
|
|
66 |
<input dojoType="dijit.form.TextBox" value="this is an editable h3 - I trigger the onChange callback on save">
|
|
|
67 |
</h3>
|
|
|
68 |
(after editable h3)
|
|
|
69 |
<hr style="width:100%;">
|
|
|
70 |
|
|
|
71 |
<h2>Inline-block Text (of 400px width)</h2>
|
|
|
72 |
<div>
|
|
|
73 |
The following section uses inline block text of 400px.
|
|
|
74 |
When clicking the editable text it should bring up an editor which is also 400px wide.
|
|
|
75 |
</div>
|
|
|
76 |
(before plain inline) <fieldset class="dijitInline"><div style="width: 400px;">hello ladies and gentlemen, now is the time for all good men to come to the aid of their country</div></fieldset> (after plain inline)
|
|
|
77 |
<br>
|
|
|
78 |
(before editable inline)
|
|
|
79 |
<fieldset class="dijitInline"><div dojoType="dijit.form.InlineEditBox" onChange="myHandler(this.id,arguments[0])" style="width: 400px;">
|
|
|
80 |
<span dojoType="dijit.form.TextBox" value="hello ladies and gentlemen, now is the time for all good men to come to aid of their country"></span>
|
|
|
81 |
</div></fieldset>
|
|
|
82 |
(after editable inline)
|
|
|
83 |
|
|
|
84 |
<hr style="width:100%;">
|
|
|
85 |
<h2>Pararagraph</h2>
|
|
|
86 |
(before plain paragraph)
|
|
|
87 |
<p>
|
|
|
88 |
Aliquam vitae enim. Duis scelerisque metus auctor est venenatis
|
|
|
89 |
imperdiet. Fusce dignissim porta augue. Nulla vestibulum. Integer lorem
|
|
|
90 |
nunc, ullamcorper a, commodo ac, malesuada sed, dolor. Aenean id mi in
|
|
|
91 |
massa bibendum suscipit. Integer eros. Nullam suscipit mauris. In
|
|
|
92 |
pellentesque. Mauris ipsum est, pharetra semper, pharetra in, viverra
|
|
|
93 |
quis, tellus. Etiam purus. Quisque egestas, tortor ac cursus lacinia,
|
|
|
94 |
felis leo adipiscing nisi, et rhoncus elit dolor eget eros. Fusce ut
|
|
|
95 |
quam. Suspendisse eleifend leo vitae ligula. Nulla facilisi. Nulla
|
|
|
96 |
rutrum, erat vitae lacinia dictum, pede purus imperdiet lacus, ut
|
|
|
97 |
semper velit ante id metus. Praesent massa dolor, porttitor sed,
|
|
|
98 |
pulvinar in, consequat ut, leo. Nullam nec est. Aenean id risus blandit
|
|
|
99 |
tortor pharetra congue. Suspendisse pulvinar.
|
|
|
100 |
</p>
|
|
|
101 |
(before editable paragraph. the editable paragraph has Save/Cancel buttons when open.)
|
|
|
102 |
<p id="areaEditable" dojoType="dijit.form.InlineEditBox" autoSave="false">
|
|
|
103 |
<textarea dojoType="dijit.form.Textarea">Aliquam vitae enim. Duis scelerisque metus auctor est venenatis
|
|
|
104 |
imperdiet. Fusce dignissim porta augue. Nulla vestibulum. Integer lorem
|
|
|
105 |
nunc, ullamcorper a, commodo ac, malesuada sed, dolor. Aenean id mi in
|
|
|
106 |
massa bibendum suscipit. Integer eros. Nullam suscipit mauris. In
|
|
|
107 |
pellentesque. Mauris ipsum est, pharetra semper, pharetra in, viverra
|
|
|
108 |
quis, tellus. Etiam purus. Quisque egestas, tortor ac cursus lacinia,
|
|
|
109 |
felis leo adipiscing nisi, et rhoncus elit dolor eget eros. Fusce ut
|
|
|
110 |
quam. Suspendisse eleifend leo vitae ligula. Nulla facilisi. Nulla
|
|
|
111 |
rutrum, erat vitae lacinia dictum, pede purus imperdiet lacus, ut
|
|
|
112 |
semper velit ante id metus. Praesent massa dolor, porttitor sed,
|
|
|
113 |
pulvinar in, consequat ut, leo. Nullam nec est. Aenean id risus blandit
|
|
|
114 |
tortor pharetra congue. Suspendisse pulvinar.</textarea>
|
|
|
115 |
</p>
|
|
|
116 |
These links will
|
|
|
117 |
<a href="#" onClick="dijit.byId('areaEditable').setDisabled(true)">disable</a> /
|
|
|
118 |
<a href="#" onClick="dijit.byId('areaEditable').setDisabled(false)">enable</a>
|
|
|
119 |
the InlineEditBox above.
|
|
|
120 |
<br>
|
|
|
121 |
(The following editable paragraph does not have Save/Cancel buttons when open)
|
|
|
122 |
<p id="areaEditable_autosave" dojoType="dijit.form.InlineEditBox" autoSave="true">
|
|
|
123 |
<textarea dojoType="dijit.form.Textarea">Aliquam vitae enim. Duis scelerisque metus auctor est venenatis
|
|
|
124 |
imperdiet. Fusce dignissim porta augue. Nulla vestibulum. Integer lorem
|
|
|
125 |
nunc, ullamcorper a, commodo ac, malesuada sed, dolor. Aenean id mi in
|
|
|
126 |
massa bibendum suscipit. Integer eros. Nullam suscipit mauris. In
|
|
|
127 |
pellentesque. Mauris ipsum est, pharetra semper, pharetra in, viverra
|
|
|
128 |
quis, tellus. Etiam purus. Quisque egestas, tortor ac cursus lacinia,
|
|
|
129 |
felis leo adipiscing nisi, et rhoncus elit dolor eget eros. Fusce ut
|
|
|
130 |
quam. Suspendisse eleifend leo vitae ligula. Nulla facilisi. Nulla
|
|
|
131 |
rutrum, erat vitae lacinia dictum, pede purus imperdiet lacus, ut
|
|
|
132 |
semper velit ante id metus. Praesent massa dolor, porttitor sed,
|
|
|
133 |
pulvinar in, consequat ut, leo. Nullam nec est. Aenean id risus blandit
|
|
|
134 |
tortor pharetra congue. Suspendisse pulvinar.</textarea>
|
|
|
135 |
</p>
|
|
|
136 |
<hr style="width:100%;">
|
|
|
137 |
|
|
|
138 |
<h2>Date text box:</h2>
|
|
|
139 |
<span id="backgroundArea" dojoType="dijit.form.InlineEditBox">
|
|
|
140 |
<input name="date" value="2005-12-30"
|
|
|
141 |
dojoType="dijit.form.DateTextBox"
|
|
|
142 |
constraints={datePattern:'MM/dd/yy'}
|
|
|
143 |
lang="en-us"
|
|
|
144 |
required="true"
|
|
|
145 |
promptMessage="mm/dd/yy"
|
|
|
146 |
invalidMessage="Invalid date. Use mm/dd/yy format.">
|
|
|
147 |
</span>
|
|
|
148 |
<hr style="width:100%;">
|
|
|
149 |
|
|
|
150 |
<h2>FilteringSelect:</h2>
|
|
|
151 |
<span dojoType="dojo.data.ItemFileReadStore" jsId="stateStore"
|
|
|
152 |
url="../_data/states.json"></span>
|
|
|
153 |
<span id="filteringSelect" dojoType="dijit.form.InlineEditBox" >
|
|
|
154 |
<input searchAttr="name" keyAttr="abbreviation" id="setvaluetest" dojoType="dijit.form.FilteringSelect" value="IA"
|
|
|
155 |
store="stateStore" name="state1" autoComplete="true" hasDownArrow="false">
|
|
|
156 |
</span>
|
|
|
157 |
<hr style="width:100%;">
|
|
|
158 |
before block<div style="display:block;" id="programmatic"></div>after
|
|
|
159 |
<script type="text/javascript">
|
|
|
160 |
// See if we can make a widget in script
|
|
|
161 |
// do it on load so Safari does not say display is none
|
|
|
162 |
dojo.addOnLoad(function(){
|
|
|
163 |
var inlineWidget = new dijit.form.InlineEditBox({renderAsHtml: true}, 'programmatic');
|
|
|
164 |
var editorWidget = new dijit.form.TextBox({
|
|
|
165 |
value:"Click here to edit a block programmatically created inline edit region"
|
|
|
166 |
});
|
|
|
167 |
editorWidget.domNode.style.width="100%";
|
|
|
168 |
inlineWidget.addChild(editorWidget);
|
|
|
169 |
inlineWidget.startup(); // scan for editWidget here, not on widget creation
|
|
|
170 |
});
|
|
|
171 |
|
|
|
172 |
</script>
|
|
|
173 |
<hr style="width:100%;">
|
|
|
174 |
<b>Spinner:</b>
|
|
|
175 |
<span dojoType="dijit.form.InlineEditBox">
|
|
|
176 |
<input dojoType="dijit.form.NumberSpinner"
|
|
|
177 |
name="spinner"
|
|
|
178 |
value="900"
|
|
|
179 |
constraints="{places:0}">
|
|
|
180 |
</span>
|
|
|
181 |
<!-- InlineEditBox/Slider doesn't work on Firefox but does on IE and Safari
|
|
|
182 |
<hr style="width:100%;">
|
|
|
183 |
<b>Slider:</b>
|
|
|
184 |
<p dojoType="dijit.form.InlineEditBox">
|
|
|
185 |
<input dojoType="dijit.form.VerticalSlider"
|
|
|
186 |
value="10"
|
|
|
187 |
maximum="100"
|
|
|
188 |
minimum="0"
|
|
|
189 |
showButtons="false"
|
|
|
190 |
style="height:100px;width:20px;">
|
|
|
191 |
</p>
|
|
|
192 |
-->
|
|
|
193 |
</body>
|
|
|
194 |
</html>
|