5 <title>List Picker test
</title>
8 background-color: #eeffff;
21 <p>This is a testbed for list picker.
</p>
25 <option value=
"0">foo
</option>
26 <option value=
"1">bar
</option>
27 <option value=
"2">bar
</option>
29 <option value=
"4">bar
</option>
30 <option value=
"5">bar
</option>
32 <option value=
"6">bar
</option>
34 <iframe srcdoc=
"<!DOCTYPE html>"></iframe>
36 <ol id=
"console" style=
"font-family:monospace;">
40 var pickerArguments
= {
51 backgroundColor
: "transparent",
54 fontFamily
: ["sans-serif"],
55 visibility
: "visible",
69 backgroundColor
: "transparent",
72 fontFamily
: ["sans-serif"],
73 visibility
: "visible",
87 backgroundColor
: "transparent",
90 fontFamily
: ["sans-serif"],
91 visibility
: "visible",
105 backgroundColor
: "transparent",
108 fontFamily
: ["sans-serif"],
109 visibility
: "visible",
112 unicodeBidi
: "normal"
129 backgroundColor
: "transparent",
132 fontFamily
: ["sans-serif"],
133 visibility
: "visible",
136 unicodeBidi
: "normal"
148 backgroundColor
: "transparent",
151 fontFamily
: ["sans-serif"],
152 visibility
: "visible",
155 unicodeBidi
: "normal"
160 backgroundColor
: "transparent",
163 fontFamily
: ["sans-serif"],
164 visibility
: "visible",
167 unicodeBidi
: "normal"
178 backgroundColor
: "transparent",
181 fontFamily
: ["sans-serif"],
182 visibility
: "visible",
185 unicodeBidi
: "normal"
188 anchorRectInScreen
: {
196 function openListPicker(args
) {
197 var frame
= document
.getElementsByTagName('iframe')[0];
198 var doc
= frame
.contentDocument
;
199 doc
.documentElement
.innerHTML
= '<!DOCTYPE html><head></head><body><div id=main>Loading...</div></body>';
200 var commonCssLink
= doc
.createElement('link');
201 commonCssLink
.rel
= 'stylesheet';
202 commonCssLink
.href
= '../../Source/web/resources/pickerCommon.css?' + (new Date()).getTime();
203 doc
.head
.appendChild(commonCssLink
);
204 var listPickerCssLink
= doc
.createElement('link');
205 listPickerCssLink
.rel
= 'stylesheet';
206 listPickerCssLink
.href
= '../../Source/web/resources/listPicker.css?' + (new Date()).getTime();
207 doc
.head
.appendChild(listPickerCssLink
);
208 var commonJsScript
= doc
.createElement('script');
209 commonJsScript
.src
= '../../Source/web/resources/pickerCommon.js?' + (new Date()).getTime();
210 doc
.body
.appendChild(commonJsScript
);
211 var listPickerJsScript
= doc
.createElement('script');
212 listPickerJsScript
.src
= '../../Source/web/resources/listPicker.js?' + (new Date()).getTime();
213 doc
.body
.appendChild(listPickerJsScript
);
215 var pagePopupController
= {
216 setValue: function(stringValue
) {
217 window
.log('string="' + stringValue
+ '"');
219 window
.document
.getElementById('menu').value
= stringValue
;
221 setValueAndClosePopup: function(numValue
, stringValue
) {
222 window
.log('number=' + numValue
+ ', string="' + stringValue
+ '"');
224 window
.document
.getElementById('menu').value
= stringValue
;
228 setTimeout(function() {
229 frame
.contentWindow
.postMessage(JSON
.stringify(args
), "*");
230 frame
.contentWindow
.pagePopupController
= pagePopupController
;
235 var entry
= document
.createElement('li');
236 entry
.innerText
= str
;
237 document
.getElementById('console').appendChild(entry
);
240 document
.getElementsByTagName('iframe')[0].onload = function () {
241 openListPicker(pickerArguments
);