NativeScript

LoremLoremLorem.

当前为 2018-06-01 提交的版本,查看 最新版本

  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, newTranslateInterval) {
  22. setTimeout(function() {
  23. $('#ember' + no).click();
  24. //click ember id
  25. no++
  26. //loop
  27. auto(addInterval, newTranslateInterval);
  28. }, newTranslateInterval * 1000);
  29. $('.translate-mode-icon').click();
  30. // click translate
  31.  
  32. setTimeout(function() {
  33. $('.right button').click();
  34. }, addInterval * 1000);
  35.  
  36. };
  37. //save, next,
  38. auto(1, 2);
  39. //auto(1.5, 2.5);
  40.  
  41. /* fitur
  42. * save translate > 80% getAttribute
  43. * stop code debuger
  44. */