NativeScript

LoremLoremLorem.

当前为 2018-05-26 提交的版本,查看 最新版本

  1. // ==UserScript==
  2. // @name NativeScript
  3. // @author Lp
  4. // @version 0.0.2
  5. // @description LoremLoremLorem.
  6. // @license MIT License.
  7. // @namespace https://greasyfork.org/users/164367
  8. // ==/UserScript==
  9. //***********************************
  10.  
  11. /**
  12. * Getnative jQuery Auto Add Translation
  13. * @param {number} addInterval Add Translation button click interval in seconds
  14. * @param {number} nextInterval Next button click interval in seconds
  15. * @param {number} newTranslateInterval Machine Translation button click interval in seconds
  16. */
  17.  
  18. let no = parseInt(($($('.project-source-text')[0]).attr('id')).replace('ember', ''));
  19. // get numberId in source text
  20. // change ember1802 => 1802
  21. function auto(addInterval, nextInterval, newTranslateInterval) {
  22. // click translate
  23. $('.translate-mode-icon').click();
  24.  
  25. setTimeout(function() {
  26. $('.right button').click();
  27. }, addInterval * 1000);
  28.  
  29. setTimeout(function() {
  30. $('.next-sentence-translate-view').click();
  31. }, nextInterval * 1000);
  32.  
  33. setTimeout(function() {
  34. $('#ember' + no).click();
  35. //click id ember with number
  36. no++
  37. //loop
  38. auto(addInterval, nextInterval, newTranslateInterval);
  39. }, newTranslateInterval * 1000);
  40. };
  41.  
  42. auto(1, 1.5, 3);