$gp.editor=function(o){return{current:null,orginal_translations:null,init:function(t){$gp.init(),$gp.editor.table=t,$gp.editor.install_hooks(),1===(t=$gp.editor.table.find("tr.preview")).length&&$gp.editor.show(t.eq(0))},original_id_from_row_id:function(t){return t.split("-")[0]},translation_id_from_row_id:function(t){return t.split("-")[1]},show:function(t){var e=t.closest("tr").attr("row"),r=o("#editor-"+e),i=o("#gmt-date-added-"+e),n=o("#local-date-added-"+e),t=(new Date).getTimezoneOffset(),i=new Date(i.text()),t=new Date(i-60*t*1e3);r.length&&($gp.editor.current&&$gp.editor.hide(),r.preview=o("#preview-"+e),r.row_id=e,r.original_id=$gp.editor.original_id_from_row_id(e),r.translation_id=$gp.editor.translation_id_from_row_id(e),r.orginal_translations=o('textarea[name="translation['+r.original_id+'][]"]',r).map(function(){return this.value}).get(),$gp.editor.current=r,n.text(t.toLocaleDateString()+" "+t.toLocaleTimeString()),r.show(),r.preview.hide(),o("textarea:first",r).focus())},prev:function(){var t;$gp.editor.current&&((t=$gp.editor.current.prevAll("tr.editor")).length?$gp.editor.show(t.eq(0)):$gp.editor.hide())},next:function(){var t;$gp.editor.current&&((t=$gp.editor.current.nextAll("tr.editor")).length?$gp.editor.show(t.eq(0)):$gp.editor.hide())},hide:function(t){(t=t||$gp.editor.current)&&(t.hide(),t.preview.show(),$gp.editor.current=null)},install_hooks:function(){o($gp.editor.table).on("click","a.edit",$gp.editor.hooks.show).on("dblclick","tr.preview td",$gp.editor.hooks.show).on("change","select.priority",$gp.editor.hooks.set_priority).on("click","button.close",$gp.editor.hooks.cancel).on("click","a.discard-warning",$gp.editor.hooks.discard_warning).on("click","button.copy",$gp.editor.hooks.copy).on("click","button.inserttab",$gp.editor.hooks.tab).on("click","button.insertnl",$gp.editor.hooks.newline).on("click","button.approve",$gp.editor.hooks.set_status_current).on("click","button.reject",$gp.editor.hooks.set_status_rejected).on("click","button.fuzzy",$gp.editor.hooks.set_status_fuzzy).on("click","button.ok",$gp.editor.hooks.ok).on("keydown","tr.editor textarea",$gp.editor.hooks.keydown),o("#translations").tooltip({items:".glossary-word",content:function(){var i=o("