mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-04-13 23:09:31 -06:00
minibar: use SVG instead of PNG for trees and alignment diagrams if supported by the browser
This commit is contained in:
@@ -10,7 +10,7 @@ var online_options={
|
||||
var minibar_options= {
|
||||
show_abstract: true,
|
||||
show_trees: true,
|
||||
tree_img_format: "png", // or "svg"
|
||||
// tree_img_format: "png", // or "svg"
|
||||
show_grouped_translations: false,
|
||||
show_brackets: true,
|
||||
word_replacements: true,
|
||||
|
||||
@@ -12,8 +12,9 @@ function Translations(server,opts) {
|
||||
abstract_action: null, // action when selecting the abstracy syntax tree
|
||||
show_trees: false, // add buttons to show abstract syntax trees,
|
||||
// parse trees & word alignment
|
||||
tree_img_format: "png", // format for trees & alignment images,
|
||||
// can be "gif", "png" or "svg"
|
||||
tree_img_format: supportsSVG() ? "svg" : "png",
|
||||
// format for trees & alignment images,
|
||||
// can be "gif", "png" or "svg"
|
||||
show_grouped_translations: true,
|
||||
to_multiple: true, // allow selection of multiple target languages
|
||||
show_brackets: false, // show bracketed string
|
||||
@@ -297,3 +298,7 @@ function draw_bracketss(bs) {
|
||||
? bs.map(draw_brackets) //with gf>3.5, in some cases
|
||||
: draw_brackets(bs) // with gf<=3.5
|
||||
}
|
||||
|
||||
function supportsSVG() {
|
||||
return document.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure", "1.1")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user