diff --git a/documentation/css/docs.css b/documentation/css/docs.css index 2faa0d80..1ef9ad53 100644 --- a/documentation/css/docs.css +++ b/documentation/css/docs.css @@ -155,22 +155,6 @@ div.code { #logo img { margin: 5px 0 0 3px; } - #error { - position: absolute; - -webkit-border-radius: 2px; -moz-border-radius: 2px; border-radius: 2px; - -webkit-border-top-left-radius: 0; -moz-border-radius-topleft: 0; border-top-left-radius: 0; - -webkit-border-bottom-left-radius: 0; -moz-border-radius-bottomleft: 0; border-bottom-left-radius: 0; - right: 0px; top: 0px; left: 726px; bottom: 0; - padding: 0 0 0 15px; - background: #fdcdcc; - background: -webkit-gradient(linear, left top, left bottom, from(#ffedec), to(#ff9a95)); - background: -moz-linear-gradient(top, #f8f8f8, #dadada); - color: #862322; - font-size: 10px; - line-height: 50px; - overflow: hidden; - text-transform: uppercase; - } .navigation { height: 50px; font-size: 11px; @@ -322,6 +306,9 @@ div.code { margin-bottom: 0; top: 10px; left: 10px; right: 10px; bottom: 15px; } + #repl_results.error { + color: red + } #repl_source_wrap { margin-left: 5px; width: 47%; right: 50%; @@ -384,3 +371,9 @@ div.code { background-image: url(../images/button_bg_dark.gif); text-shadow: none; } + .minibutton.error { + opacity: 0.5; + color: #600; + cursor: not-allowed; + } + diff --git a/documentation/index.html.js b/documentation/index.html.js index d765dbb0..b2a6eb0b 100644 --- a/documentation/index.html.js +++ b/documentation/index.html.js @@ -87,7 +87,6 @@ Source Maps — src/sourcemap -
@@ -1926,19 +1925,22 @@ Expressions # Set up the compilation function, to run when you stop typing. compileSource = -> source = $('#repl_source').val() + results = $('#repl_results') window.compiledJS = '' try window.compiledJS = CoffeeScript.compile source, bare: on - el = $('#repl_results')[0] + el = results[0] if el.innerText el.innerText = window.compiledJS else - $(el).text window.compiledJS - $('#error').hide() + results.text(window.compiledJS) + results.removeClass 'error' + $('.minibutton.run').removeClass 'error' catch {location, message} if location? message = "Error on line #{location.first_line + 1}: #{message}" - $('#error').text(message).show() + results.text(message).addClass 'error' + $('.minibutton.run').addClass 'error' # Update permalink $('#repl_permalink').attr 'href', "##{sourceFragment}#{encodeURIComponent source}"