RoadFlow2.1 临时演示

roadui.init.js 2.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. ;$(window).load(function ()
  2. {
  3. var roadInit = new RoadUI.Init();
  4. roadInit.calendar();
  5. roadInit.file();
  6. roadInit.member();
  7. roadInit.dict();
  8. roadInit.select();
  9. roadInit.combox();
  10. roadInit.table();
  11. roadInit.selectIco();
  12. roadInit.editor();
  13. roadInit.text();
  14. roadInit.textarea();
  15. roadInit.button();
  16. roadInit.validate();
  17. roadInit.textFocus();
  18. });
  19. ;RoadUI.Init = function ()
  20. {
  21. this.validate = function ()
  22. {
  23. new RoadUI.Validate().bind($("[validate]"));
  24. };
  25. this.textFocus = function ()
  26. {
  27. var $txt = $('<input type="text" style="height:0; width:0;" />');
  28. try
  29. {
  30. $("body").prepend($txt);
  31. $txt.get(0).focus();
  32. $txt.remove();
  33. } catch (e) { }
  34. };
  35. this.text = function ()
  36. {
  37. new RoadUI.Text().init($(".mytext"));
  38. };
  39. this.textarea = function ()
  40. {
  41. new RoadUI.Textarea().init($(".mytextarea"));
  42. };
  43. this.editor = function ()
  44. {
  45. new RoadUI.Editor().init($(".myeditor"));
  46. };
  47. this.calendar = function ()
  48. {
  49. new RoadUI.Calendar().init($(".mycalendar"));
  50. };
  51. this.select = function ()
  52. {
  53. new RoadUI.Select().init($(".myselect"));
  54. };
  55. this.combox = function ()
  56. {
  57. new RoadUI.Combox().init($(".mycombox"));
  58. };
  59. this.button = function ()
  60. {
  61. new RoadUI.Button().init($(".mybutton"));
  62. };
  63. this.file = function ()
  64. {
  65. new RoadUI.File().init($(".myfile"));
  66. };
  67. this.member = function ()
  68. {
  69. new RoadUI.Member().init($(".mymember"));
  70. };
  71. this.dict = function ()
  72. {
  73. new RoadUI.Dict().init($(".mydict,.mylrselect"));
  74. };
  75. this.selectIco = function ()
  76. {
  77. $(".myico").each(function ()
  78. {
  79. new RoadUI.SelectIco({ obj: $(this) });
  80. });
  81. };
  82. this.table = function ()
  83. {
  84. $(".listtable tbody tr:even td").removeClass().addClass("listtabletrout");
  85. $(".listtable tbody tr:odd td").removeClass().addClass("listtabletrover");
  86. };
  87. }