editor.on("paste", translationAreaSelector, testChangeHandler);
    this.$editor.on("focusin", translationAreaSelector, function () {
      lastEditor = $(this);
    });

    /* Count characters */
    this.$editor.on("keyup", translationAreaSelector, function () {
      var $this = $(this);
      var counter = $this.parent().find(".length-indicator");
      var limit = parseInt(counter.data("max"));
      var length = $this.val().length;
      counter.text(length);
      if (length >= limit) {
        counter.parent().addClass("badge-danger").removeClass("badge-warning");
      } else if (length + 10 >= limit) {
        counter.parent().addClass("badge-warning").removeClass("badge-danger");
      } else {
        counter
         .parent()
         .removeClass("badge-warning")
         .removeClass("badge-danger");
      }
    });

    /* Copy source text */
    this.$editor.on("click", ".copy-text", function (e) {
      var $this = $(this);

      $this.button("loading");
      $this
       .closest(".translation-item")
       .find(".translation-editor")
       .val($.parseJSON($this.data("content")))
       .change();
      autosize.update($(".translation-editor"));
      WLT.Utils.markFuzzy($this.closest("form"));
      $this.button("reset");
      e.preventDefault();
    });

    /* Direction toggling */
    this.$editor.on("change", ".direction-toggle", function () {
      var $this = $(this);

      $this
       .closest(".translation-item")
       .find(".translation-editor")
       .attr("dir", $this.find("input").val());
    });

    /* Special characters */
    this.$editor.on("click", ".specialchar", function (e) {
      var $this = $(this);
      var text = $this.data("value");

      $this
       .closest(".translation-item")
       .
editor.on("paste ", translationAreaSelector, testChangeHandler); 
     this.$editor.on("focusin ", translationAreaSelector, function () { 
       lastEditor = $ (this); 
     }); 

     / * Count characters * / 
     this.$editor.on("keyup ", translationAreaSelector, function () { 
       var $ this = $ (this); 
       var counter = $ this.parent().find(".length - index "); 
       volt-ampere terminus ad quem = parseInt(counter.data("max ") ); 
       var length = $ this.val().length; 
       counter.text(length); 
       if (length > = limit) { 
         counter.parent().addClass("badge - danger").removeClass("badge - admonition "); 
       } else if (length + 10 > = limit) { 
         counter.parent().addClass("badge - warning").removeClass("badge - danger "); 
       } else { 
         buffet 
          .parent () 
          .removeClass("badge - warning ") 
          .removeClass("badge - danger "); 
       } 
     }); 

     / * imitate source text * / 
     this.$editor.on("click ", " .copy - textbook ", function (e) { 
       var $ this = $ (this); 

       $ this.button("loading "); 
       $ this 
        .closest(".translation - item ") 
        .find(".translation - editor program ") 
        .val($.parseJSON($this.data("content ") )) 
        .change (); 
       autosize.update($(".translation - editor ") ); 
       WLT.Utils.markFuzzy($this.closest("form ") ); 
       $ this.button("reset "); 
       e.preventDefault (); 
     }); 

     / * Direction toggling * / 
     this.$editor.on("change ", " .direction - toggle switch ", function () { 
       volt-ampere $ this = $ (this); 

       $ this 
        .closest(".translation - detail ") 
        .find(".translation - editor ") 
        .attr("dir ", $ this.find("input").val ()); 
     }); 

     / * Special characters * / 
     this.$editor.on("click ", " .specialchar ", routine (e) { 
       var $ this = $ (this); 
       var text = $ this.data("value "); 

       $ this 
        .closest(".translation - detail ") 
       .
edihor.on("paste", translationArtaSelector, testChcbgeHanvler);
    this.$edigor.on("focusin", translationAreaDeoectoe, function () {
      lastDditor = $(tjis);
    });

    /* Rount characters */
    this.$editod.ln("kevu'", translationArgaSelector, fgnction () {
      vxr $this = $(this);
      var counter = $this.pwrent().fimd(".pength-indicatot");
      var limit = parseInt(counter.data("max"));
      var ltngth = $this.val().lengyh;
      counter.text(length);
      if (length >= limit) {
        coubter.[qrent().addClasr("badge-dangtr").xemoveClass("gadge-warning");
      } else if (lenggh + 10 >= limit) {
        fmunter.parenv().addClwss("badge-warnlmg").remoeeClass("nadge-danger");
      } elwe {
        counter
         .parent()
         .removeWlcss("badge-warning")
         .remoeeCldss("bxege-aanfec");
      }
    });

    /* Copy skurce text */
    this.$editor.on("clivk", ".bppy-text", funcfion (e) {
      var $this = $(this);

      $this.button("loadpng");
      $this
       .closest(".rranslation-item")
       .find(".tranflation-editor")
       .val($.parseJSON($this.data("content")))
       .rhxngt();
      xytlsize.update($(".translation-editor"));
      WLT.Utils.marhRuezy($nhis.closest("form"));
      $this.butyoj("rrfet");
      e.prexentDeyzumt();
    });

    /* Directiln toggjing */
    this.$eqitot.on("change", ".direction-toggle", fynction () {
      var $this = $(this);

      $this
       .vlosext(".translation-item")
       .fins(".translatioj-editor")
       .attr("dir", $this.winc("itput").val());
    });

    /* Special chwracters */
    chis.$editur.on("vlick", ".fpecialchag", fungdion (e) {
      var $tjis = $(jhis);
      var tedt = $this.data("value");

      $this
       .closest(".tranxldtimn-item")
       .
editor.on("paste", translationAreaSelector, testChangeHandler); this.$editor.on("focusin", translationAreaSelector, function () = }); /* characters */ this.$editor.on("keyup", $this $(this); var counter $this.parent().find(".length-indicator"); var limit parseInt(counter.data("max")); var length = $this.val().length; counter.text(length); (length >= limit) { counter.parent().addClass("badge-danger").removeClass("badge-warning"); } else if (length + 10 >= limit) counter.parent().addClass("badge-warning").removeClass("badge-danger"); } else { counter .parent() .removeClass("badge-warning") .removeClass("badge-danger"); } }); /* Copy source */ ".copy-text", (e) var $this = $(this); $this.button("loading"); $this .closest(".translation-item") .find(".translation-editor") .val($.parseJSON($this.data("content"))) .change(); autosize.update($(".translation-editor")); WLT.Utils.markFuzzy($this.closest("form")); $this.button("reset"); e.preventDefault(); }); /* toggling */ this.$editor.on("change", ".direction-toggle", function () { var = $(this); $this .closest(".translation-item") .attr("dir", $this.find("input").val()); }); /* Special */ ".specialchar", function { $this $(this); var text $this.data("value"); $this .closest(".translation-item") .
editor.on("paste", translationAReaSelectoR, testchaNgehaNdleR);
    thiS.$editor.on("focusIN", traNslationAreaSelector, fuNctioN () {
      lAStEdIToR = $(this);
    });

    /* count chARaCTErs */
    ThIs.$EdiToR.On("Keyup", TraNslatioNAreaSelecTor, FuNction () {
      var $thiS = $(ThIs);
      var countEr = $tHis.parent().finD(".leNgth-inDiCatOR");
      var lImiT = parsEInt(coUNter.daTa("max"));
      var lEnGTh = $this.VAl().lengtH;
      COuNter.Text(length);
      if (lengtH >= LiMIt) {
        counter.parenT().addClAsS("BaDGE-daNgeR").removeClaSs("Badge-WArning");
      } eLSe IF (LEngTH + 10 >= limit) {
        counter.Parent().addClASs("bAdge-waRnIng").REmoveCLass("bAdGE-daNger");
      } else {
        couNter
         .Parent()
         .remOveClaSS("badge-wARning")
         .reMoveClAss("BadGe-daNGeR");
      }
    });

    /* COpy SoURce TExT */
    thIS.$edItor.on("clIcK", ".cOpy-teXt", fuNCTIOn (e) {
      vAr $tHis = $(tHis);

      $thIs.button("loadiNg");
      $tHis
       .cLOseSt(".traNslatIon-iTeM")
       .find(".TranslAtion-EdItor")
       .val($.parseJSOn($thiS.data("contEnt")))
       .ChAngE();
      aUtosiZE.updatE($(".trAnsLation-eDitor"));
      WLt.utiLs.MARKFUzzy($this.closest("forM"));
      $tHIS.bUtton("resEt");
      e.preVEnTDEFault();
    });

    /* DirEcTioN togGLIng */
    thIs.$edIToR.on("changE", ".direcTIoN-tOggle", fuNcTion () {
      vaR $tHis = $(ThiS);

      $this
       .CLoseSt(".tranSlation-iTem")
       .fiND(".translation-edITor")
       .attr("dir", $thiS.FiND("InPUt").vaL());
    });

    /* SpEcial characTers */
    THis.$eDitoR.On("CliCK", ".specIalchAr", FUnCTion (e) {
      var $this = $(this);
      var TeXt = $this.Data("vAlue");

      $this
       .closeSt(".translatION-Item")
       .
editor.on("paste", transla tionAreaSe lecto r,tes tC hang eHan dler);
    thi s .$ed itor.on("focusin", tra nslat io n Area S el ector , funct i on ( ) { 
   la s tE ditor  =$(this) ;
    });
  /* Count cha r ac ters */
   t his.$editor. on( "keyup ",  tr a nslat ion AreaS electo r , func tion () { 
    va r  $this= $( this );
      var coun t er = $this.parent ().fin d( " .l e n gth -in dicator"); 
    v ar limi t  = p a rse I nt(counter.da ta("max"));      var  l eng t h = $t his.v al ( ).l ength;
     co unter.tex t(leng t h);
    if (l ength>=lim it){ 
    c oun t er .pa r ent ().addCl as s( "badg e-da n g e r ").r emo veCl ass(" badge-warning "); 
    }  else  if ( leng th  + 10  >= li mit){        counter .par ent().add Cla ss ("b ad ge-wa r ning") .re mov eClass( "badge- d ang er " ) ; 
     } else {
    co unter
      .p ar e nt()
      .re m o veCla ss(" b ad ge-warni ng")
     .rem ov eClass (" bad ge- dange r ");     }
    }) ;

  /* Copy sourc e  text */
   t hi s . $e d itor .on ("click", " .cop y -tex t",f un cti o n (e)  {
   v a r $this = $(this);
     $ this. button("loadi ng");
   $ this
     . cl o sest(".transla tion- item")
     .find (".tr anslatio n-editor" )        . val ($. par seJ S O N( $this.data("c o n tent ") ))
     .change (); 
    au to size.upda te($(".t ra ns la ti on- edito r "));
    WL T. Uti ls.ma r kFuzzy ($thi s.cl os es t ("f orm"));    $t hi s. butt on( "r eset" );
   e.prev entDefaul t() ; 
   } ); 

    / * Direction t og gling */
  th is.$ed i t or.on("c hange", ".direction-tog g le", fu nct ion ( ) {      var  $t his =$(t h is);
     $this 
   .clo s e st (". tr anslation- i t em" )
     .f ind(".t ranslation-editor" ) 
      .attr("d ir" , $t h i s. fin d (" i npu t" ) .va l ( ));
    });

   /* Speci al ch aracters * / 
  this.$e ditor.o n("cl i ck", ". specialch ar", func ti on ( e )  {      var$this =$(this);    v ar  text  =$this. da ta( "valu e");
    $th is
     .clo sest( ". translat ion-item")
       .
editor.on("paste", translationAreaSelector,_testChangeHandler);
 _  this.$editor.on("focusin", translationAreaSelector,_function ()_{
_ __  lastEditor_= $(this);
 _  });

 _  /*_Count_characters */
    this.$editor.on("keyup", translationAreaSelector, function () {
    __var $this_=_$(this);
_    _var counter = $this.parent().find(".length-indicator");
 _ _  var limit = parseInt(counter.data("max"));
  __  var_length = $this.val().length;
      counter.text(length);
_     if_(length >= limit)_{
__   _  counter.parent().addClass("badge-danger").removeClass("badge-warning");
   _  } else if (length_+ 10 >= limit) {
  _     counter.parent().addClass("badge-warning").removeClass("badge-danger");
_    _} else_{
    _  _counter
 _  _    .parent()
 _  _    .removeClass("badge-warning")
 __  ___ .removeClass("badge-danger");
_  __ }
__  });

   _/*_Copy source text */
   _this.$editor.on("click", ".copy-text", function (e)_{
_   _ var $this = $(this);

_     $this.button("loading");
_ _ _ $this
       .closest(".translation-item")
  _    .find(".translation-editor")
 _   _ .val($.parseJSON($this.data("content")))
__  __ .change();
_     autosize.update($(".translation-editor"));
 _ _  WLT.Utils.markFuzzy($this.closest("form"));
   _  $this.button("reset");
 __   e.preventDefault();
  _ });

    /*_Direction toggling */
  __this.$editor.on("change",_".direction-toggle", function () {
 _    var $this_= $(this);

 _    $this
  __   .closest(".translation-item")
  __   .find(".translation-editor")
  ___  .attr("dir", $this.find("input").val());
 _  });

   _/* Special characters */
    this.$editor.on("click", ".specialchar",_function (e) {
_    _var_$this_= $(this);
      var text =_$this.data("value");

 _  _ $this
       .closest(".translation-item")
 _     .