Advertisement
Guest User

Untitled

a guest
Jul 17th, 2019
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.86 KB | None | 0 0
  1. <div id="todoList-container">
  2. <h1>Todo</h1>
  3. <div class="todoList">
  4. <div data-id="1">
  5. <input style="display: none;" type="checkbox" class="todoItemCheckbox" name="todoItem0" />
  6. <a href="#" class="todoBox"></a>
  7. <span>test 1</span>
  8. <span style="margin-left: 20px;">Development</span>
  9. <div class="todoForm" style="display: none;">
  10. <form class="todoItemCompleteForm" data-id="1">
  11. <input class="todoItemCompleteHours" type="text" placeholder="Hours">
  12. <textarea class="todoItemCompleteDescription" placeholder="description of work"></textarea>
  13. <a href="javascript:;" class="todoItemCompleteConfirm">Complete</a><a href="javascript:;" class="todoItemCompleteCancel">Cancel</a>
  14. </form>
  15. </div>
  16. </div>
  17. <div data-id="2">
  18. <input style="display: none;" type="checkbox" class="todoItemCheckbox" name="todoItem1" />
  19. <a href="#" class="todoBox"></a>
  20. <span>test 2</span>
  21. <span style="margin-left: 20px;">Research</span>
  22. <div class="todoForm" style="display: none;">
  23. <form class="todoItemCompleteForm" data-id="2">
  24. <input class="todoItemCompleteHours" type="text" placeholder="Hours">
  25. <textarea class="todoItemCompleteDescription" placeholder="description of work"></textarea>
  26. <a href="javascript:;" class="todoItemCompleteConfirm">Complete</a><a href="javascript:;" class="todoItemCompleteCancel">Cancel</a>
  27. </form>
  28. </div>
  29. </div>
  30. </div>
  31. </div>
  32.  
  33. $.ajax({
  34. url: API_URL + "todos/user/",
  35. data: {
  36. token: LOGIN_TOKEN,
  37. sortCompleted: 1
  38. //TODO: Need to send out a sessionID with every admin-based thing. Need another table that contains an expirable token that is sent back as sessionID.
  39. },
  40. type: "GET",
  41. dataType: "json"
  42. })
  43. .done(function(json) {
  44. for(var k = 0; k < json.length; k++) {
  45. //Show todoList strikethrough or with hidden form.
  46. if(json[k].status == "1") {
  47. $('.todoList').append('<div data-id="' + json[k].ID + '"><span><strike>' + json[k].name + '</strike></span><span style="margin-left: 20px;">' + groups[parseInt(json[k].groupID)] + '</span><span style="float:right; margin-right:10px;" class="date">' + json[k].completed + '</span></div>');
  48. }
  49. else {
  50. $('.todoList').append('<div data-id="' + json[k].ID + '"><input style="display: none;" type="checkbox" class="todoItemCheckbox" name="todoItem' + k + '" /><a href="#" class="todoBox"></a><span>' + json[k].name + '</span><span style="margin-left: 20px;">' + groups[parseInt(json[k].groupID)] + '</span><div class="todoForm" style="display: none;"><form class="todoItemCompleteForm" data-id="'+json[k].ID+'"><input class="todoItemCompleteHours" type="text" placeholder="Hours" /><textarea class="todoItemCompleteDescription" placeholder="description of work"></textarea><a href="javascript:;" class="todoItemCompleteConfirm">Complete</a><a href="javascript:;" class="todoItemCompleteCancel">Cancel</a></form></div></div>');
  51. }
  52.  
  53. }
  54.  
  55. $('.todoList').append('<div><input id="todoAddItemInput" type="text" placeholder="Todo Name" /><select><option>Development</option></select><a href="#" class="todoAddItem"><i class="fa fa-plus"></i></a></div>');
  56. })
  57.  
  58. #todoList-container {
  59. width: 80%;
  60. border: 1px solid #CCC;
  61. margin: 20px auto;
  62. border-radius: 10px;
  63. padding: 0 20px 40px;
  64. }
  65.  
  66. #todoList-container h1 {
  67. margin-top: 10px;
  68. }
  69.  
  70. #todoList-container .todoList {
  71. list-style-type: none;
  72. }
  73.  
  74. #todoList-container .todoList div {
  75. font-family: 'Lora', serif;
  76. font-size: 18px;
  77. padding: 2px 4px;
  78. margin: 8px 0;
  79. border-bottom: 1px solid #CCC;
  80. height: 40px;
  81. /* line-height: 40px; */
  82. }
  83.  
  84. #todoList-container span {
  85. vertical-align: -2px;
  86. margin-left: 52px;
  87. color: #333;
  88. }
  89.  
  90. #todoList-container .todoBox+span {
  91. margin-left: 0px;
  92. color: #777;
  93. }
  94.  
  95. #todoList-container .todoBox {
  96. display: inline-block;
  97. height: 30px;
  98. width: 30px;
  99. border: 1px solid #CCC;
  100. margin-right: 20px;
  101. border-radius: 4px;
  102. text-decoration: none;
  103. /* vertical-align: 3px; */
  104. }
  105.  
  106. #todoList-container .todoBox::after {
  107. font-family: "Font Awesome 5 Free";
  108. font-weight: 900;
  109. content: "f00c";
  110. color: #CCC;
  111. z-index: 999;
  112. top: 4px;
  113. left: 5px;
  114. position: relative;
  115. font-size: 20px;
  116. }
  117.  
  118. #todoList-container .todoBoxSelected::after {
  119. color: #6db235;
  120. }
  121.  
  122. #todoList-container #todoAddItemInput {
  123. margin-left: 48px;
  124. font-family: 'Lora', serif;
  125. border:0;
  126. font-size: 18px;
  127. padding: 2px 4px;
  128. color: #777;
  129. border-right: 1px solid #CCC;
  130. margin-right: 20px;
  131. vertical-align: -4px;
  132. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement