Skip to content

Commit

Permalink
Change default font in output panel to non-monospace and use monospac…
Browse files Browse the repository at this point in the history
…e explicitly in println.
  • Loading branch information
ochrons committed Apr 2, 2018
1 parent fd5ae23 commit 61d4719
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 6 deletions.
4 changes: 2 additions & 2 deletions page/src/main/scala/fiddle/Fiddle.scala
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,11 @@ object Fiddle {
def println(ss: Any) = {
ss match {
case null =>
print(div(cls := "", "null"))
print(div(cls := "monospace", "null"))
case m: Modifier @unchecked =>
print(div(m))
case _ =>
print(div(ss.toString))
print(div(cls := "monospace", ss.toString))
}
}

Expand Down
9 changes: 9 additions & 0 deletions router/src/main/resources/common.css
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,9 @@ select {
padding-top: 0.2em;
box-sizing: border-box;
font-size: 14px;
}

.monospace {
font-family: Monaco, Menlo, 'Ubuntu Mono', Consolas, source-code-pro, monospace;
text-rendering: optimizeLegibility;
white-space: pre;
Expand All @@ -213,6 +216,12 @@ body, pre {
color: #878787;
}

pre {
font-family: Monaco, Menlo, 'Ubuntu Mono', Consolas, source-code-pro, monospace;
text-rendering: optimizeLegibility;
white-space: pre;
}

pre.error {
color: #822;
}
Expand Down
25 changes: 22 additions & 3 deletions router/src/main/resources/libraries.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,12 @@
{
"version": "1.2.0",
"scalaVersions": ["2.11", "2.12"],
"extraDeps": [
"com.github.japgolly.scalajs-react %%% extra % 1.2.0"
],
"jsDeps": [
"react % 16.2.0 % https://unpkg.com/react@16/umd/react.development.js",
"react-dom % 16.2.0 % https://unpkg.com/react-dom@16/umd/react-dom.development.js"
"react % 16.3.0 % https://cdnjs.cloudflare.com/ajax/libs/react/16.3.0/umd/react.development.js",
"react-dom % 16.3.0 % https://cdnjs.cloudflare.com/ajax/libs/react-dom/16.3.0/umd/react-dom.development.js"
]
},
{
Expand All @@ -31,7 +34,7 @@
"compileTimeOnly": false
},
{
"name": "Scala.js React Components",
"name": "React Components",
"organization": "com.olvind",
"artifact": "scalajs-react-components",
"doc": "chandu0101/scalajs-react-components",
Expand All @@ -52,6 +55,22 @@
],
"compileTimeOnly": false
},
{
"name": "D3",
"organization": "org.singlespaced",
"artifact": "scalajs-d3",
"doc": "spaced/scala-js-d3",
"versions": [
{
"version": "0.3.4",
"scalaVersions": ["2.11", "2.12"],
"jsDeps": [
"d3js % 3.5.17 % https://cdnjs.cloudflare.com/ajax/libs/d3/3.5.17/d3.min.js"
]
}
],
"compileTimeOnly": false
},
{
"name": "Diode",
"organization": "io.suzaku",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ object Static {
| loads.then(function() {
| try {
| eval(code);
| eval("var sf = ScalaFiddle;if(typeof sf === 'function' && typeof sf().main === 'function') sf().main();");
| eval("var sf = ScalaFiddle;if(typeof sf === 'function') { if(typeof sf().main === 'function') sf().main() } else if(typeof sf.main === 'function') sf.main()");
| } catch(ex) {
| panel.insertAdjacentHTML('beforeend', '<pre class="error">ERROR: ' + ex.message + '\n' + ex.stack + '</pre>')
| } finally {
Expand Down

0 comments on commit 61d4719

Please sign in to comment.