register.template 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. <form id="form" class="table outline ui-corner-all">
  2. <div class="row">
  3. <span class="cell align-right">
  4. Email:
  5. </span>
  6. <span class="cell">
  7. <input name="email" type="text"/>
  8. </span>
  9. </div>
  10. <div class="row">
  11. <span class="cell align-right">
  12. Username:
  13. </span>
  14. <span id="cell">
  15. <input name="username" type="text"/>
  16. </span>
  17. </div>
  18. <div class="row">
  19. <span class="cell align-right">
  20. Password:
  21. </span>
  22. <span class="cell">
  23. <input name="password" type="password"/>
  24. </span>
  25. </div>
  26. <div class="row">
  27. <span class="cell align-right">
  28. Verify Password:
  29. </span>
  30. <span class="cell">
  31. <input name="password1" type="password"/>
  32. </span>
  33. </div>
  34. <div class="align-right">
  35. <image id="captcha" src="index.php?get=captcha"/>
  36. </div>
  37. <div class="row">
  38. <span class="cell align-right">
  39. Captcha:
  40. </span>
  41. <span class="cell">
  42. <input name="captcha" type="text"/>
  43. </span>
  44. </div>
  45. <div class="row">
  46. <div class="cell align-right">
  47. <input type="submit" value="register"/>
  48. </div>
  49. <div class="cell">
  50. <input type="button" value="cancel" class="cancel"/>
  51. </div>
  52. </div>
  53. </form>
  54. <script>
  55. {{#if key}}
  56. History.back();
  57. {{else}}
  58. $('form#form').submit(function(){
  59. var data = $(this).serializeObject(),
  60. State = History.getState();
  61. for(var i in State.data){
  62. data[i] = State.data;
  63. }
  64. data.type = 'action';
  65. data.id = 'register';
  66. apiCall(data,function(d){
  67. if(!d.error){
  68. setKey(d.key);
  69. loadState('page-index');
  70. }else{
  71. setKey(null);
  72. $('#captcha').attr('src','index.php?get=captcha&timestamp='+new Date);
  73. $('#loading').hide();
  74. }
  75. });
  76. return false;
  77. }).children('.cancel').click(function(){
  78. History.back();
  79. return false;
  80. });
  81. {{/if}}
  82. </script>