Skip to content
This repository has been archived by the owner on Jun 23, 2018. It is now read-only.

Commit

Permalink
Update jQconsole to 2.10.0. Had to remove all conflicting styles and …
Browse files Browse the repository at this point in the history
…unnecessary JS resizing
  • Loading branch information
amasad committed Feb 9, 2014
1 parent 7dfff36 commit 7cb124e
Show file tree
Hide file tree
Showing 7 changed files with 40 additions and 32 deletions.
40 changes: 35 additions & 5 deletions browser-check.coffee
@@ -1,13 +1,43 @@
# Adapted from jQuery migrate.
uaMatch = (ua) ->
ua = ua.toLowerCase();

match = /(chrome)[ \/]([\w.]+)/.exec(ua) or
/(webkit)[ \/]([\w.]+)/.exec(ua) or
/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(ua) or
/(msie) ([\w.]+)/.exec(ua) or
ua.indexOf('compatible') < 0 and /(mozilla)(?:.*? rv:([\w.]+)|)/.exec(ua) or
[]

return {
browser: match[ 1 ] || ''
version: match[ 2 ] || '0'
}


matched = uaMatch navigator.userAgent
browser = {};

if matched.browser
browser[ matched.browser ] = true
browser.version = matched.version
if browser.chrome
browser.webkit = true
else if browser.webkit
browser.safari = true

jQuery.browser = browser

ISMOBILE = Boolean navigator.userAgent.match /iPhone|iPad|iPod|Android/i

if not ISMOBILE
chromeVersion = navigator.userAgent.match /Chrome\/(\d+)/i
safariVersion = navigator.userAgent.match /Version\/(\d+)/i
if (($.browser.msie and $.browser.version < 10.0) or
($.browser.mozilla and $.browser.version < 4) or
($.browser.opera and $.browser.version < 11.51) or
($.browser.safari and chromeVersion and chromeVersion[1] < 13) or
($.browser.safari and safariVersion and safariVersion[1] < 5))
if ((browser.msie and browser.version < 10.0) or
(browser.mozilla and browser.version < 4) or
(browser.opera and browser.version < 11.51) or
(browser.safari and chromeVersion and chromeVersion[1] < 13) or
(browser.safari and safariVersion and safariVersion[1] < 5))
$ ->
$('#content-fallback').show()
$('#fallback-ignore').click -> $('#content-fallback').hide()
Expand Down
10 changes: 1 addition & 9 deletions css/mobile.css
Expand Up @@ -348,18 +348,12 @@ html, body {
}

.jqconsole {
width: 100%;
height: 642px;
padding: 15px;
padding-top: 17px;
position: absolute;
bottom: 0;
right: 0;
color: #F4FFFF;
display: block;
font-family: monospace;
font-size: 14px;
overflow: auto;
/* Force word wrap on all browsers. */
white-space: -moz-pre-wrap; /* Mozilla, supported since 1999 */
white-space: -o-pre-wrap; /* Opera */
Expand All @@ -376,8 +370,7 @@ html, body {
font-weight: bold;
color: #FC0;
background: url(../images/sprite.png) -13px -583px no-repeat;
position: relative;
left: -8px;
margin-left: -8px;
}

.jqconsole-blurred .jqconsole-prompt {
Expand All @@ -401,7 +394,6 @@ html, body {
.jqconsole-cursor {
background: #666;
line-height: 115%;
position: relative !important;
margin-right: -8px;
}

Expand Down
10 changes: 1 addition & 9 deletions css/style.css
Expand Up @@ -346,18 +346,12 @@ html, body {
}

.jqconsole {
width: 561px;
height: 642px;
padding: 15px;
padding-top: 17px;
position: absolute;
bottom: 0;
right: 0;
color: #F4FFFF;
display: block;
font-family: monospace;
font-size: 14px;
overflow: auto;
/* Force word wrap on all browsers. */
white-space: -moz-pre-wrap; /* Mozilla, supported since 1999 */
white-space: -o-pre-wrap; /* Opera */
Expand All @@ -374,8 +368,7 @@ html, body {
font-weight: bold;
color: #FC0;
background: url(../images/sprite.png) -13px -583px no-repeat;
position: relative;
left: -8px;
margin-left: -8px;
}

.jqconsole-blurred .jqconsole-prompt {
Expand All @@ -399,7 +392,6 @@ html, body {
.jqconsole-cursor {
background: #666;
line-height: 115%;
position: relative !important;
margin-right: -8px;
}

Expand Down
2 changes: 0 additions & 2 deletions dom.coffee
Expand Up @@ -312,8 +312,6 @@ $.extend REPLIT,
editor_hpadding = @$editor.innerWidth() - @$editor.width()
editor_vpadding = @$editor.innerHeight() - @$editor.height()
# Resize the console/editor widgets.
@$console.css 'width', @$consoleContainer.width() - console_hpadding
@$console.css 'height', @$consoleContainer.height() - console_vpadding
@$editor.css 'width', @$editorContainer.innerWidth() - editor_hpadding
@$editor.css 'height', @$editorContainer.innerHeight() - editor_vpadding

Expand Down
4 changes: 2 additions & 2 deletions index.html
Expand Up @@ -28,7 +28,7 @@
<link type="text/css" rel="stylesheet" href="/css/ansi.css?{{CACHE_BUSTER}}" />

<!-- Application -->
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7/jquery.min.js"></script>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/2.1.0/jquery.min.js"></script>
<!--BAKED
<script src="/jsrepl/jsrepl.js?{{CACHE_BUSTER}}" id="jsrepl-script"></script>
<script src="/repl.it.js?{{CACHE_BUSTER}}"></script>
Expand All @@ -37,7 +37,7 @@
<script src="/jsrepl/repl.js?{{CACHE_BUSTER}}" id="jsrepl-script"></script>
<script src="/jsrepl/languages.js?{{CACHE_BUSTER}}"></script>
<!-- repl.it -->
<script src="/lib/jqconsole-2.7.4.min.js"></script>
<script src="/lib/jqconsole-2.10.0.min.js"></script>
<script src="/lib/bootstrap-tooltip.js"></script>
<script src="/lib/page.js"></script>
<script src="/base.js?{{CACHE_BUSTER}}"></script>
Expand Down
1 change: 1 addition & 0 deletions lib/jqconsole-2.10.0.min.js

Large diffs are not rendered by default.

5 changes: 0 additions & 5 deletions lib/jqconsole-2.7.4.min.js

This file was deleted.

0 comments on commit 7cb124e

Please sign in to comment.