OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <html> | 2 <html> |
3 <head> | 3 <head> |
4 <meta charset=utf-8> | 4 <meta charset=utf-8> |
5 <title>Calendar Picker test</title> | 5 <title>Calendar Picker test</title> |
6 <style> | 6 <style> |
7 body { | 7 body { |
8 background-color: #eeffff; | 8 background-color: #eeffff; |
9 } | 9 } |
10 iframe { | 10 iframe { |
(...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
255 }; | 255 }; |
256 | 256 |
257 function openCalendar(args) { | 257 function openCalendar(args) { |
258 var frame = document.getElementsByTagName('iframe')[0]; | 258 var frame = document.getElementsByTagName('iframe')[0]; |
259 var doc = frame.contentDocument; | 259 var doc = frame.contentDocument; |
260 doc.documentElement.innerHTML = '<head></head><body><div id=main>Loading...<
/div></body>'; | 260 doc.documentElement.innerHTML = '<head></head><body><div id=main>Loading...<
/div></body>'; |
261 var commonCssLink = doc.createElement('link'); | 261 var commonCssLink = doc.createElement('link'); |
262 commonCssLink.rel = 'stylesheet'; | 262 commonCssLink.rel = 'stylesheet'; |
263 commonCssLink.href = '../../Source/WebCore/Resources/pagepopups/pickerCommon
.css?' + (new Date()).getTime(); | 263 commonCssLink.href = '../../Source/WebCore/Resources/pagepopups/pickerCommon
.css?' + (new Date()).getTime(); |
264 doc.head.appendChild(commonCssLink); | 264 doc.head.appendChild(commonCssLink); |
| 265 var commonChromiumCssLink = doc.createElement('link'); |
| 266 commonChromiumCssLink.rel = 'stylesheet'; |
| 267 commonChromiumCssLink.href = '../../Source/WebCore/Resources/pagepopups/chro
mium/pickerCommonChromium.css?' + (new Date()).getTime(); |
| 268 doc.head.appendChild(commonChromiumCssLink); |
265 var suggestionPickerCssLink = doc.createElement('link'); | 269 var suggestionPickerCssLink = doc.createElement('link'); |
266 suggestionPickerCssLink.rel = 'stylesheet'; | 270 suggestionPickerCssLink.rel = 'stylesheet'; |
267 suggestionPickerCssLink.href = '../../Source/WebCore/Resources/pagepopups/su
ggestionPicker.css?' + (new Date()).getTime(); | 271 suggestionPickerCssLink.href = '../../Source/WebCore/Resources/pagepopups/su
ggestionPicker.css?' + (new Date()).getTime(); |
268 doc.head.appendChild(suggestionPickerCssLink); | 272 doc.head.appendChild(suggestionPickerCssLink); |
269 var link = doc.createElement('link'); | 273 var link = doc.createElement('link'); |
270 link.rel = 'stylesheet'; | 274 link.rel = 'stylesheet'; |
271 link.href = '../../Source/WebCore/Resources/pagepopups/calendarPicker.css?'
+ (new Date()).getTime(); | 275 link.href = '../../Source/WebCore/Resources/pagepopups/calendarPicker.css?'
+ (new Date()).getTime(); |
272 doc.head.appendChild(link); | 276 doc.head.appendChild(link); |
| 277 var calendarPickerChromiumCssLink = doc.createElement('link'); |
| 278 calendarPickerChromiumCssLink.rel = 'stylesheet'; |
| 279 calendarPickerChromiumCssLink.href = '../../Source/WebCore/Resources/pagepop
ups/chromium/calendarPickerChromium.css?' + (new Date()).getTime(); |
| 280 doc.head.appendChild(calendarPickerChromiumCssLink); |
273 var commonJsScript = doc.createElement('script'); | 281 var commonJsScript = doc.createElement('script'); |
274 commonJsScript.src = '../../Source/WebCore/Resources/pagepopups/pickerCommon
.js?' + (new Date()).getTime(); | 282 commonJsScript.src = '../../Source/WebCore/Resources/pagepopups/pickerCommon
.js?' + (new Date()).getTime(); |
275 doc.body.appendChild(commonJsScript); | 283 doc.body.appendChild(commonJsScript); |
276 var suggestionPickerJsScript = doc.createElement('script'); | 284 var suggestionPickerJsScript = doc.createElement('script'); |
277 suggestionPickerJsScript.src = '../../Source/WebCore/Resources/pagepopups/su
ggestionPicker.js?' + (new Date()).getTime(); | 285 suggestionPickerJsScript.src = '../../Source/WebCore/Resources/pagepopups/su
ggestionPicker.js?' + (new Date()).getTime(); |
278 doc.body.appendChild(suggestionPickerJsScript); | 286 doc.body.appendChild(suggestionPickerJsScript); |
279 var script = doc.createElement('script'); | 287 var script = doc.createElement('script'); |
280 script.src = '../../Source/WebCore/Resources/pagepopups/calendarPicker.js?'
+ (new Date()).getTime(); | 288 script.src = '../../Source/WebCore/Resources/pagepopups/calendarPicker.js?'
+ (new Date()).getTime(); |
281 doc.body.appendChild(script); | 289 doc.body.appendChild(script); |
282 | 290 |
283 var pagePopupController = { | 291 var pagePopupController = { |
284 setValueAndClosePopup: function(numValue, stringValue) { | 292 setValueAndClosePopup: function(numValue, stringValue) { |
285 window.log('number=' + numValue + ', string="' + stringValue + '"'); | 293 window.log('number=' + numValue + ', string="' + stringValue + '"'); |
286 if (numValue == 0) | 294 if (numValue == 0) |
287 window.document.getElementById('date').value = stringValue; | 295 window.document.getElementById('date').value = stringValue; |
288 }, | 296 }, |
289 localizeNumberString: function(numString) { | 297 localizeNumberString: function(numString) { |
290 if (typeof numString == "number") | 298 if (typeof numString == "number") |
291 return numString.toLocaleString(); | 299 return numString.toLocaleString(); |
292 return numString.toString(); | 300 return numString.toString(); |
293 }, | 301 }, |
| 302 histogramEnumeration: function() {}, |
294 formatMonth: function(year, zeroBaseMonth) { | 303 formatMonth: function(year, zeroBaseMonth) { |
295 var monthLabels = ['<January>', '<February>', '<March>', '<April>',
'<May>', '<June>', | 304 var monthLabels = ['<January>', '<February>', '<March>', '<April>',
'<May>', '<June>', |
296 '<July>', '<August>', '<September>', '<October>',
'<November>', '<December>']; | 305 '<July>', '<August>', '<September>', '<October>',
'<November>', '<December>']; |
297 return monthLabels[zeroBaseMonth] + " " + year; | 306 return monthLabels[zeroBaseMonth] + " " + year; |
298 } | 307 } |
299 } | 308 } |
300 | 309 |
301 setTimeout(function() { | 310 setTimeout(function() { |
302 frame.contentWindow.postMessage(JSON.stringify(args), "*"); | 311 frame.contentWindow.postMessage(JSON.stringify(args), "*"); |
303 frame.contentWindow.pagePopupController = pagePopupController; | 312 frame.contentWindow.pagePopupController = pagePopupController; |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
342 function log(str) { | 351 function log(str) { |
343 var entry = document.createElement('li'); | 352 var entry = document.createElement('li'); |
344 entry.innerText = str; | 353 entry.innerText = str; |
345 document.getElementById('console').appendChild(entry); | 354 document.getElementById('console').appendChild(entry); |
346 } | 355 } |
347 | 356 |
348 openCalendar(englishArguments); | 357 openCalendar(englishArguments); |
349 </script> | 358 </script> |
350 </body> | 359 </body> |
351 </html> | 360 </html> |
OLD | NEW |