mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-04-23 11:42:49 -06:00
gfse: browser compatibility fixes
This commit is contained in:
@@ -33,7 +33,7 @@ div.template:hover
|
|||||||
{ background: #def;}
|
{ background: #def;}
|
||||||
|
|
||||||
.lin input[type=button],
|
.lin input[type=button],
|
||||||
.template input[type=button] { float: right; clear: right; }
|
.template input[type=button] { float: right; clear: right; margin: 0; }
|
||||||
.exb_output { background: #dfd; float: right; margin: 0 10px; }
|
.exb_output { background: #dfd; float: right; margin: 0 10px; }
|
||||||
|
|
||||||
.more, .delete { font-weight: bold; font-family: sans-serif; }
|
.more, .delete { font-weight: bold; font-family: sans-serif; }
|
||||||
|
|||||||
@@ -150,7 +150,7 @@ function exb_linbuttons(g,ci,f) {
|
|||||||
var b=button("Test it",test_it);
|
var b=button("Test it",test_it);
|
||||||
buttons.push(b)
|
buttons.push(b)
|
||||||
}
|
}
|
||||||
var exb_output=node("span",{class:"exb_output"},[]);
|
var exb_output=node("span",{"class":"exb_output"},[]);
|
||||||
buttons.push(exb_output)
|
buttons.push(exb_output)
|
||||||
}
|
}
|
||||||
return buttons
|
return buttons
|
||||||
|
|||||||
@@ -67,9 +67,11 @@ provideExample env myfunc parsePGF pgfFile lang =
|
|||||||
giveExample e_ =
|
giveExample e_ =
|
||||||
let newexpr = head $ generateFromDepth pgfFile e_ (Just 5) -- change here with the new random generator
|
let newexpr = head $ generateFromDepth pgfFile e_ (Just 5) -- change here with the new random generator
|
||||||
ty = getType $ head $ filter (\x -> getName x == myfunc) $ getAll env
|
ty = getType $ head $ filter (\x -> getName x == myfunc) $ getAll env
|
||||||
embeddedExpr = maybe "" (\x -> "\nas in :" ++ linearize pgfFile lang x) (embedInStart (getAll env) (Map.fromList [(ty,e_)]))
|
embeddedExpr = maybe "" (\x -> ", as in: " ++ q (linearize pgfFile lang x)) (embedInStart (getAll env) (Map.fromList [(ty,e_)]))
|
||||||
lexpr = linearize pgfFile lang newexpr
|
lexpr = linearize pgfFile lang newexpr
|
||||||
in (newexpr,"\n" ++ lexpr ++ embeddedExpr)
|
q s = sq++s++sq
|
||||||
|
sq = "\""
|
||||||
|
in (newexpr,q lexpr ++ embeddedExpr)
|
||||||
-- question, you need the IO monad for the random generator, how to do otherwise ??
|
-- question, you need the IO monad for the random generator, how to do otherwise ??
|
||||||
-- question can you make the expression bold/italic - somehow distinguishable from the rest ?
|
-- question can you make the expression bold/italic - somehow distinguishable from the rest ?
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user