Compare commits
3 Commits
00ab5b4cbf
...
0c500bd8e2
Author | SHA1 | Date |
---|---|---|
~lucidiot | 0c500bd8e2 | |
~lucidiot | 65f0ad49c8 | |
~lucidiot | 549d8619a8 |
50
console.js
|
@ -10,6 +10,17 @@ function supportsVB () {
|
|||
return typeof window.VBSEval === 'unknown' && typeof window.VBSExecute === 'unknown'
|
||||
}
|
||||
|
||||
function hasWebWizardExtensions () {
|
||||
if (typeof window.external !== 'unknown') return false
|
||||
return supportsVB() ? InWebWizard() : typeof window.external.SetWizardButtons === 'unknown'
|
||||
}
|
||||
|
||||
function inSketchUp () {
|
||||
return /\bSketchUp\//.test(navigator.userAgent)
|
||||
}
|
||||
|
||||
var originalConsole = window.console;
|
||||
|
||||
window.onload = function () {
|
||||
var output = document.getElementById("output");
|
||||
var input = document.getElementById("input");
|
||||
|
@ -69,7 +80,6 @@ window.onload = function () {
|
|||
}
|
||||
}
|
||||
|
||||
var originalConsole = window.console;
|
||||
window.console = {};
|
||||
|
||||
function makeLogger (name, color) {
|
||||
|
@ -188,18 +198,6 @@ window.onload = function () {
|
|||
runButton.onclick = run;
|
||||
clearButton.onclick = console.clear;
|
||||
|
||||
if (/MSIE 7.0/.test(navigator.userAgent)) {
|
||||
/*
|
||||
* For some reason, IE 7 messes up the textarea's width and height
|
||||
* pretty badly. We hardcode the height, removing a little margin,
|
||||
* and add some margin to the output.
|
||||
* Setting the input's width causes it to somehow divide itself by 2
|
||||
* on every keystroke.
|
||||
*/
|
||||
input.style.height = document.documentElement.clientHeight - 7 + 'px';
|
||||
output.style.marginLeft = '7px';
|
||||
}
|
||||
|
||||
if (!supportsVB()) {
|
||||
for (var i = 0; i < languageSelect.children.length; i++) {
|
||||
if (languageSelect.children[i].value.slice(0, 3) === 'vbs') {
|
||||
|
@ -211,11 +209,25 @@ window.onload = function () {
|
|||
}
|
||||
|
||||
// Try to detect the wizard extensions.
|
||||
if (supportsVB() && InWebWizard()) {
|
||||
window.external.SetHeaderText('Windows Scripting Console', "Explore this wizard's scripting environment.");
|
||||
window.external.SetWizardButtons(1, 0, 0);
|
||||
// An onback function is required by the web wizard specification
|
||||
window.onback = function () {
|
||||
window.external.FinalBack();
|
||||
try {
|
||||
if (hasWebWizardExtensions()) {
|
||||
window.external.SetHeaderText('Windows Scripting Console', "Explore this wizard's scripting environment.");
|
||||
window.external.SetWizardButtons(1, 0, 0);
|
||||
// An onback function is required by the web wizard specification
|
||||
window.onback = function () {
|
||||
window.external.FinalBack();
|
||||
}
|
||||
}
|
||||
} catch (err) {
|
||||
/*
|
||||
* In some browser contexts, such as IE7 embedded in the Compiled HTML viewer,
|
||||
* interactions with window.external can cause "Not implemented" errors;
|
||||
* if any of those occur, we ignore them.
|
||||
* We cannot filter the errors to specifically ignore "Not implemented",
|
||||
* because the error text gets translated to other languages
|
||||
* ("Non implémenté" in French) and there are no other attributes to compare on.
|
||||
*/
|
||||
if (originalConsole && originalConsole.error) {
|
||||
originalConsole.error('Could not setup Web Wizard extensions:', err)
|
||||
}
|
||||
}
|
||||
|
|
After Width: | Height: | Size: 373 KiB |
After Width: | Height: | Size: 61 KiB |
After Width: | Height: | Size: 30 KiB |
After Width: | Height: | Size: 96 KiB |
After Width: | Height: | Size: 50 KiB |
After Width: | Height: | Size: 61 KiB |
After Width: | Height: | Size: 40 KiB |
After Width: | Height: | Size: 35 KiB |
After Width: | Height: | Size: 55 KiB |