OLD | NEW |
1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"> | 1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"> |
2 <!-- | 2 <!-- |
3 - Copyright (C) 2008 Google Inc. | 3 - Copyright (C) 2008 Google Inc. |
4 - | 4 - |
5 - Licensed under the Apache License, Version 2.0 (the "License"); | 5 - Licensed under the Apache License, Version 2.0 (the "License"); |
6 - you may not use this file except in compliance with the License. | 6 - you may not use this file except in compliance with the License. |
7 - You may obtain a copy of the License at | 7 - You may obtain a copy of the License at |
8 - | 8 - |
9 - http://www.apache.org/licenses/LICENSE-2.0 | 9 - http://www.apache.org/licenses/LICENSE-2.0 |
10 - | 10 - |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
115 >b<object></object>c</div> | 115 >b<object></object>c</div> |
116 </div> | 116 </div> |
117 | 117 |
118 <script type="text/javascript"> | 118 <script type="text/javascript"> |
119 function loadScript(src) { | 119 function loadScript(src) { |
120 document.write( | 120 document.write( |
121 '<script src="' + html.escapeAttrib(src) + '"' | 121 '<script src="' + html.escapeAttrib(src) + '"' |
122 + ' onerror="console.error(this.src)"><\/script>'); | 122 + ' onerror="console.error(this.src)"><\/script>'); |
123 } | 123 } |
124 | 124 |
| 125 function makeXhr() { |
| 126 if (typeof XMLHttpRequest === 'undefined') { |
| 127 var activeXClassIds = [ |
| 128 'MSXML2.XMLHTTP.5.0', 'MSXML2.XMLHTTP.4.0', 'MSXML2.XMLHTTP.3.0', |
| 129 'MSXML2.XMLHTTP', 'MICROSOFT.XMLHTTP.1.0', 'MICROSOFT.XMLHTTP.1', |
| 130 'MICROSOFT.XMLHTTP']; |
| 131 for (var i = 0, n = activeXClassIds.length; i < n; i++) { |
| 132 var candidate = activeXClassIds[i]; |
| 133 try { |
| 134 return new ActiveXObject(candidate); |
| 135 } catch (e) {} |
| 136 } |
| 137 } |
| 138 return new XMLHttpRequest; |
| 139 } |
| 140 |
| 141 function inlineHtml(href, container) { |
| 142 var xhr = makeXhr(); |
| 143 xhr.open('GET', href, false); |
| 144 xhr.send(null); |
| 145 if (xhr.status !== 200 && xhr.status !== 0) { |
| 146 throw new Error('Failed to load ' + href + ' : ' + xhr.status); |
| 147 } |
| 148 var htmlAndScript = xhr.responseText.match( |
| 149 /^([\s\S]*?)<script[^>]*>([\s\S]*?)<\/script>$/); |
| 150 var div = container.ownerDocument.createElement('DIV'); |
| 151 div.innerHTML = htmlAndScript[1]; |
| 152 while (div.firstChild) { container.appendChild(div.firstChild); } |
| 153 (new Function(htmlAndScript[2]))(); |
| 154 } |
| 155 |
125 var isValija = /[&?]valija([=&]|$)/.test(location.search); | 156 var isValija = /[&?]valija([=&]|$)/.test(location.search); |
126 </script> | 157 </script> |
127 | 158 |
128 <script type="text/javascript"> | 159 <script type="text/javascript"> |
129 var valijaMaker; | 160 var valijaMaker; |
130 (function () { | 161 (function () { |
131 if (isValija) { | 162 if (isValija) { |
132 var testImports = ___.copy(___.sharedImports); | 163 var testImports = ___.copy(___.sharedImports); |
133 testImports.loader = ___.freeze({ | 164 testImports.loader = ___.freeze({ |
134 provide: ___.func(function (v) { valijaMaker = v; }) | 165 provide: ___.func(function (v) { valijaMaker = v; }) |
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
340 var documentHolder = valijaMaker ? testImports.outers : testImports; | 371 var documentHolder = valijaMaker ? testImports.outers : testImports; |
341 documentHolder.documentRO = new documentHolder.document.constructor( | 372 documentHolder.documentRO = new documentHolder.document.constructor( |
342 document, testDomContainer, false); | 373 document, testDomContainer, false); |
343 | 374 |
344 testImports.htmlEmitter___ = new HtmlEmitter( | 375 testImports.htmlEmitter___ = new HtmlEmitter( |
345 testDomContainer, testImports.document); | 376 testDomContainer, testImports.document); |
346 if (valijaMaker) { | 377 if (valijaMaker) { |
347 testImports.$v = valijaMaker.CALL___(testImports.outers); | 378 testImports.$v = valijaMaker.CALL___(testImports.outers); |
348 } | 379 } |
349 window.toString = function () { return '[WINDOW]'; }; | 380 window.toString = function () { return '[WINDOW]'; }; |
350 })();</script> | |
351 | 381 |
352 <script type="text/javascript"> | 382 inlineHtml(isValija ? 'domita_test.vo.html' : 'domita_test.co.html', |
353 loadScript(isValija ? 'domita_test.vo.js' : 'domita_test.co.js'); | 383 testDomContainer); |
354 </script> | 384 })(); </script> |
355 | 385 |
356 </body> | 386 </body> |
357 </html> | 387 </html> |
OLD | NEW |