From 5856098f2f71dc443cf6412443d6b3efbcb8efb8 Mon Sep 17 00:00:00 2001 From: hallgren Date: Wed, 2 Nov 2011 16:13:30 +0000 Subject: [PATCH] gfse: example-based: remove target language from the example language menu --- src/example-based/todo.txt | 2 +- src/www/gfse/example_based.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/example-based/todo.txt b/src/example-based/todo.txt index db248c7a8..ebecba435 100644 --- a/src/example-based/todo.txt +++ b/src/example-based/todo.txt @@ -1,6 +1,6 @@ Editor improvements for example-based grammar writing: -- Remove the same language from the example language menu ++ Remove the same language from the example language menu - Send the other language environment to getNext - Compile a new .pgf automatically when needed - Update buttons automatically when functions are added or removed diff --git a/src/www/gfse/example_based.js b/src/www/gfse/example_based.js index adb9fb7e6..1bbf17bd4 100644 --- a/src/www/gfse/example_based.js +++ b/src/www/gfse/example_based.js @@ -68,8 +68,8 @@ function exb_extra(g,ci) { function exblangmenu() { function opt(conc) { return option(conc.langcode,conc.langcode); } - // skip target language - var m =node("select",{},map(opt,g.concretes)); + function skip_target(c) { return c.langcode!=conc.langcode; } + var m =node("select",{},map(opt,filter(skip_target,g.concretes))); if(conc.example_lang) m.value=conc.example_lang; m.onchange=function() { conc.example_lang=m.value; save_grammar(g); } return m