zentaomax.js 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. $(document).ready(function()
  2. {
  3. $('#estimateTab').addClass('btn-active-text');
  4. $('input[name="hourPoint"]').change(function()
  5. {
  6. $('#saveTips').text('');
  7. /* Set the title and prompt information. */
  8. if($(this).val() != unit)
  9. {
  10. if($(this).val() == 0) var hourPoint = workingHours;
  11. if($(this).val() == 1) var hourPoint = storyPoint;
  12. if($(this).val() == 2) var hourPoint = functionPoint;
  13. var convertTitle = convertRelationTitle.replace('%s', hourPoint);
  14. var convertTips = convertRelationTips.replace(/%s/g, hourPoint);
  15. var submitTips = saveTips.replace(/%s/g, hourPoint);
  16. $('#title').text(convertTitle);
  17. $('#tips').text(convertTips);
  18. $('#convertFactor + span').text(hourPoint);
  19. $('#saveTips').text(submitTips);
  20. $('#convertRelations').modal({show: true});
  21. }
  22. if($(this).val() == 0)
  23. {
  24. $('#efficiency + span').text(workingHours);
  25. $('#efficiency').val("1");
  26. $('.efficiency').addClass('hidden');
  27. }
  28. if($(this).val() == 1 || $(this).val() == 2)
  29. {
  30. $('#efficiency').val('');
  31. $('.efficiency').removeClass('hidden');
  32. if($(this).val() == 1)
  33. {
  34. $('#efficiency + span').text(efficiency + storyPoint);
  35. }
  36. if($(this).val() == 2)
  37. {
  38. $('#efficiency + span').text(efficiency + functionPoint);
  39. }
  40. }
  41. });
  42. });
  43. /**
  44. * Set scale factor.
  45. *
  46. * @access public
  47. * @return void
  48. */
  49. function setScaleFactor()
  50. {
  51. var scaleFactor = $('#convertFactor').val();
  52. /* Judgment of required items. */
  53. if(!scaleFactor)
  54. {
  55. alert(notempty);
  56. }
  57. else if(isNaN(scaleFactor))
  58. {
  59. alert(isNumber);
  60. }
  61. else
  62. {
  63. $('#scaleFactor').val(scaleFactor);
  64. $('#convertRelations').modal('hide');
  65. }
  66. }