Simple Translation tool: add File menu command 'Open in Wide Coverage Translation Demo'

Just as a quick way to test different documents in the Wide Coverage
Translation Demo.
This commit is contained in:
hallgren
2015-03-06 12:04:17 +00:00
parent 4e4d2a77e1
commit 4c03e2e67d
2 changed files with 15 additions and 1 deletions

View File

@@ -24,6 +24,7 @@
<!--
<dt onclick="translator.close(this)">Close
-->
<dt onclick="translator.open_in_wc(this)">Open in Wide Coverage Translation Demo
</dl>
<td><span onclick="">Edit</span>
<dl>
@@ -78,7 +79,7 @@
</div>
<hr>
<div class=modtime><small>HMTL
<!-- hhmts start -->Last modified: Fri Apr 11 14:10:02 CEST 2014 <!-- hhmts end -->
<!-- hhmts start -->Last modified: Fri Mar 6 12:46:23 CET 2015 <!-- hhmts end -->
</small></div>
<a href="about.html">About</a>

View File

@@ -733,6 +733,19 @@ Translator.prototype.import_globalsight=function(el) {
setTimeout(imp,100) // leave time to hide the menu first
}
Translator.prototype.open_in_wc=function(el) {
var t=this
hide_menu(el)
var doc=t.document
var sourcetext=doc.segments.map(function(s){return s.source}).join(" ")
var wc=appLocalStorage("gf.wc.")
wc.put("from",doc.options.from)
wc.put("to",doc.options.to)
wc.put("input",sourcetext)
var w=window.open("../wc.html","wc")
w.focus()
}
Translator.prototype.remove=function(el) {
var t=this
if(t.document.globalsight) return