Skip to content

Commit

Permalink
Implement IE 6 support. It's not complete but it's close enough for now
Browse files Browse the repository at this point in the history
  • Loading branch information
jhs committed Sep 1, 2008
1 parent 2270614 commit 4fe7741
Show file tree
Hide file tree
Showing 2 changed files with 89 additions and 16 deletions.
47 changes: 31 additions & 16 deletions console/console/view/static/javascript/console.js
Expand Up @@ -67,13 +67,22 @@ var statementSubmit = function(event) {
var promptStr = '>>> ';
if(promptType == 'ps2')
promptStr = '... ';
$('#console_output').append($('<span>').addClass('prompt').append(promptStr));

// Due to IE 6 support, not pure jQuery anymore.
if(!is_ie)
$('#console_output').append($('<span>').addClass('prompt').append(promptStr));
else
$('#console_output').append($('<span class="prompt">' + promptStr + '</span>'));

// This is a temporary representation of the code. When the server replies,
// it will re-send the code that it processed (possibly marked up with syntax
// highlighting), and we will replace the content with the server's version.
var statementContainer = $('<span>').addClass('statement').addClass('plain').append(statement);
$('#console_output').append(statementContainer);
if(!is_ie)
$('#console_output').append(statementContainer);
else
// This doesn't support replacing the statement wiht syntax hilighting but oh well.
$('#console_output').append('<span class="statement plain">' + statement + '</span>');

// Bring the history up to date.
hist.buffer.push(statement);
Expand Down Expand Up @@ -104,7 +113,7 @@ var statementSubmit = function(event) {
}

// Replace the old temporarary code with the server's version.
statementContainer.html(response.in);
statementContainer.html(response['in']);
if(highlight)
statementContainer.addClass('pygments').removeClass('plain');

Expand Down Expand Up @@ -182,17 +191,14 @@ var fetchBanner = function() {
return;

var gotBanner = function(response, textStatus) {
// Handle the banner from the console.
var banner = $('<pre>');

// Handle the banner from the console. Because of an IE bug, there is a little bit
// of old-school string concatenation instead of pure jQuery.
if(textStatus == 'success')
banner.addClass('banner').append(response.banner);
else {
$('#console_output').append($('<pre class="banner">' + response.banner + '</pre>'));
else {
console.error('Banner error: %s; response=%s', textStatus, response);
banner.addClass('error').append('(Failed to fetch Python banner)');
$('#console_output').append($('<pre class="error">(Failed to fetch Python banner)</pre>'));
}
$('#console_output').append(banner);

showPrompt();
};

Expand All @@ -208,11 +214,12 @@ var showPrompt = function(continuing) {
}

$('#prompt').html(
$('<span>').addClass('prompt').append(promptStr)
// Again, due to IE 6, no pure jQuery.
'<span class="prompt">' + promptStr + '</span>'
);

//var promptSpace = $('#prompt span').width() + 10;
//$('#oneline').css('margin-left', promptSpace);
var promptSpace = $('#prompt span').width() + 10;
$('#oneline').css('margin-left', promptSpace);
};

var cls = function() {
Expand Down Expand Up @@ -272,15 +279,21 @@ var setTeamwork = function(event) {
var showTalkinator = function() {
var room = $('#setting_room').val();
var widgetWidth = 250;
var frameHeight = 540;
var consoleOffset = widgetWidth + 10;

if(is_ie) {
frameHeight -= 50;
consoleOffset += 10;
}

console.width(console.width() - consoleOffset);
talkinator.width(widgetWidth);
talkinator.css('display', 'block');
talkinator.html(
'<iframe width="' + widgetWidth + '" height="540" marginwidth="0" marginheight="0" scrolling="no"' +
'<iframe width="' + widgetWidth + '" height="' + frameHeight + '" marginwidth="0" marginheight="0" scrolling="no"' +
' style="border: 2px solid #93b7fa" frameborder="0"' +
' src="http://t8r4.info/$r?s=0&t=h&w=250&h=540&c=93b7fa&b=' + room + '"> ' +
' src="http://t8r4.info/$r?s=0&t=h&w=250&h=' + frameHeight + '&c=93b7fa&b=' + room + '"> ' +
'</iframe>');
};

Expand Down Expand Up @@ -349,6 +362,8 @@ var uid = (function() {
}
)();

var is_ie = (navigator.appName=='Microsoft Internet Explorer') ? true : false;

//
// __END__
//
Expand Down
58 changes: 58 additions & 0 deletions console/console/view/static/style/ie6.css
@@ -0,0 +1,58 @@
/* App Engine Console Internet Explorer 6 stylesheet overrides
*
* Copyright 2008 Proven Corporation Co., Ltd., Thailand
*
* This file is part of App Engine Console.
*
* App Engine Console is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, version 3 of the License.
*
* App Engine Console is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with App Engine Console; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/

#console_interface {
float: left;
}

#console_area {
height: 450px;
}

#talkinator {
height: 492px;
}

#console_output pre.banner {
word-wrap: break-word;
zoom: 1;
}

#console_output span.prompt,
#console_output span.statement {
font-size: 140%;
}

.helpcontent strong tt {
font-size: 90%;
}

div.mainmenu {
padding-top: 0;
}

.issue-list {
padding-bottom: 0;
}

input.textbox {
font-size: 1em;
width: 99%;
}

0 comments on commit 4fe7741

Please sign in to comment.