mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-04-15 15:59:32 -06:00
simple translator: make it usable on iOS devices
To make the popup menus accessible, use a simple trick to activate the simulate-hovering-by-tapping behaviour.
This commit is contained in:
@@ -12,7 +12,7 @@
|
||||
<h1>Simple Translation Tool</h1>
|
||||
<form name=options>
|
||||
<table class=menubar>
|
||||
<tr><td>File
|
||||
<tr><td><span onclick="">File</span>
|
||||
<dl>
|
||||
<dt onclick="translator.new(this)">New
|
||||
<dt onclick="translator.browse(this)">Open...
|
||||
@@ -21,22 +21,22 @@
|
||||
<dt onclick="translator.saveAs(this)">Save As...
|
||||
<dt onclick="translator.close(this)">Close
|
||||
</dl>
|
||||
<td>Edit
|
||||
<td><span onclick="">Edit</span>
|
||||
<dl>
|
||||
<dt id="edit_import" onclick="translator.import(this)">Import text...
|
||||
<dt id="edit_add_segment" onclick="translator.add_segment(this)">Add a segment...
|
||||
<dt id="edit_remove_segment" onclick="translator.remove(this)">Remove the last segment
|
||||
</dl>
|
||||
<td>View
|
||||
<td><span onclick="">View</span>
|
||||
<dl>
|
||||
<dt><label><input name=view value=segmentbysegment type=radio checked onchange="translator.change(this)">Segment by segment</label>
|
||||
<dt><label><input name=view value=paralleltexts type=radio onchange="translator.change(this)">Parallel texts</label>
|
||||
</dl>
|
||||
<td>Options
|
||||
<td><span onclick="">Options</span>
|
||||
<dl>
|
||||
<dt>
|
||||
<table class=submenu>
|
||||
<tr><td>Source Language
|
||||
<tr><td><span onclick="">Source Language</span>
|
||||
<dl id=source>
|
||||
<dt><label><input name=source value=Eng type=radio onchange="translator.change(this)">English</label>
|
||||
<dt><label><input name=source value=Swe type=radio onchange="translator.change(this)">Swedish</label>
|
||||
@@ -45,7 +45,7 @@
|
||||
</table>
|
||||
<dt>
|
||||
<table class=submenu>
|
||||
<tr><td>Target Language
|
||||
<tr><td><span onclick="">Target Language</span>
|
||||
<dl id=target>
|
||||
<dt><label><input name=target value=Eng type=radio onchange="translator.change(this)">English</label>
|
||||
<dt><label><input name=target value=Swe type=radio onchange="translator.change(this)">Swedish</label>
|
||||
@@ -54,7 +54,7 @@
|
||||
</table>
|
||||
<dt>
|
||||
<table class=submenu>
|
||||
<tr><td>Default translation method
|
||||
<tr><td><span onclick="">Default translation method</span>
|
||||
<dl id=methods>
|
||||
<dt><label><input name=method value=Manual type=radio onchange="translator.change(this)">Manual</label>
|
||||
</dl>
|
||||
@@ -72,7 +72,7 @@
|
||||
</div>
|
||||
<hr>
|
||||
<div class=modtime><small>HMTL
|
||||
<!-- hhmts start -->Last modified: Fri Sep 21 10:12:52 CEST 2012 <!-- hhmts end -->
|
||||
<!-- hhmts start -->Last modified: Fri Oct 5 00:29:39 CEST 2012 <!-- hhmts end -->
|
||||
</small></div>
|
||||
<a href="about.html">About</a>
|
||||
|
||||
|
||||
@@ -833,7 +833,7 @@ Translator.prototype.draw_segment_given_target=function(s,target,i) {
|
||||
return form
|
||||
}
|
||||
function draw_options() {
|
||||
return wrap("div",[span_class("arrow",text(" ⇒ ")),draw_options2()])
|
||||
return wrap("div",[span_class("arrow",hovertext(" ⇒ ")),draw_options2()])
|
||||
}
|
||||
if(t.document.globalsight)
|
||||
var actions=empty_class("td","actions")
|
||||
@@ -843,7 +843,7 @@ Translator.prototype.draw_segment_given_target=function(s,target,i) {
|
||||
var removeB=dt(text("Remove this segment"))
|
||||
removeB.onclick=function() { t.remove_segment(i) }
|
||||
var actions=wrap_class("td","actions",
|
||||
wrap("div",[span_class("actions",text("◊")),
|
||||
wrap("div",[span_class("actions",hovertext("◊")),
|
||||
wrap_class("dl","popupmenu",
|
||||
[insertB,removeB])]))
|
||||
}
|
||||
@@ -1114,3 +1114,7 @@ function delete_button(action,hint) {
|
||||
b.onclick=action;
|
||||
return b;
|
||||
}
|
||||
|
||||
function hovertext(txt) {
|
||||
return node("span",{onclick:""},[text(txt)])
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user