plugin.js 870 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. system.plugin = {
  2. exec: function(key)
  3. {
  4. switch (key)
  5. {
  6. // Replace Tracker
  7. case "replace-tracker":
  8. system.openDialogFromTemplate({
  9. id: "dialog-system-replaceTracker",
  10. options: {
  11. title: system.lang.dialog["system-replaceTracker"].title,
  12. width: 600,
  13. height: 220
  14. }
  15. });
  16. break;
  17. // Automatically match the data directory
  18. case "auto-match-data-folder":
  19. var rows = system.control.torrentlist.datagrid("getChecked");
  20. var ids = new Array();
  21. for (var i in rows)
  22. {
  23. ids.push(rows[i].id);
  24. }
  25. if (ids.length==0) return;
  26. system.openDialogFromTemplate({
  27. id: "dialog-auto-match-data-folder",
  28. options: {
  29. title: system.lang.dialog["auto-match-data-folder"].title,
  30. width: 530,
  31. height: 280
  32. },
  33. datas: {
  34. "ids": ids
  35. }
  36. });
  37. break;
  38. }
  39. }
  40. };