Guest User

Untitled

a guest
Mar 13th, 2018
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.52 KB | None | 0 0
  1. Only in share/www/: .svn
  2. Only in share/www/browse: .svn
  3. diff -C 3 -r share/www/browse/database.html /usr/local/share/couchdb/www/browse/database.html
  4. *** share/www/browse/database.html Sat Mar 1 13:15:28 2008
  5. --- /usr/local/share/couchdb/www/browse/database.html Fri Mar 7 13:36:27 2008
  6. ***************
  7. *** 52,57 ****
  8. --- 52,69 ----
  9. page.populateViewEditor();
  10. page.updateDocumentListing();
  11.  
  12. + $("#paging a.paging-opts").click(function() {
  13. + $("#paging-opts").show();
  14. + });
  15. +
  16. + $('#custom-paging').submit(function(e) {
  17. + e.preventDefault();
  18. + var startkey = $('#custom-paging input#startkey').val();
  19. + var count = $('#custom-paging select#count').val();
  20. + page.updateDocumentListing({startkey:startkey, count:count});
  21. + return false;
  22. + });
  23. +
  24. $("#switch select").change(function() {
  25. var viewName = $(this).val();
  26. if (!viewName) $.cookies.remove(page.dbName + ".view");
  27. ***************
  28. *** 112,124 ****
  29. <tr>
  30. <td colspan="4">
  31. <div id="paging">
  32. ! <a class="prev">← Previous Page</a> | <a class="next">Next Page →</a>
  33. </div>
  34. <span></span>
  35. </td>
  36. </tr>
  37. </tbody>
  38. </table>
  39. -
  40. </body>
  41. </html>
  42. --- 124,150 ----
  43. <tr>
  44. <td colspan="4">
  45. <div id="paging">
  46. ! <a class="prev">← Previous Page</a> | <a class="next">Next Page →</a> | <a class="paging-opts" href="#paging-opts">Options</a>
  47. </div>
  48. <span></span>
  49. + <div id="paging-opts" style="display:none;">
  50. + <form id="custom-paging" action="#custom-paging">
  51. + <label for="startkey">Start Key:</label>
  52. + <input type="text" name="startkey" value="" id="startkey">
  53. +
  54. + <label for="count">Per Page:</label>
  55. + <select name="count" id="count">
  56. + <option value="20" selected>20</option>
  57. + <option value="50">50</option>
  58. + <option value="100">100</option>
  59. + </select>
  60. +
  61. + <input type="submit" name="refresh" value="Jump" id="refresh">
  62. + </form>
  63. + </div>
  64. </td>
  65. </tr>
  66. </tbody>
  67. </table>
  68. </body>
  69. </html>
  70. Only in share/www/image: .svn
  71. Only in share/www/script: .svn
  72. diff -C 3 -r share/www/script/browse.js /usr/local/share/couchdb/www/script/browse.js
  73. *** share/www/script/browse.js Sat Mar 1 13:15:33 2008
  74. --- /usr/local/share/couchdb/www/script/browse.js Fri Mar 7 13:14:30 2008
  75. ***************
  76. *** 162,172 ****
  77. $("#viewcode button.revert, #viewcode button.save").attr("disabled", "disabled");
  78. }
  79.  
  80. this.updateDocumentListing = function(options) {
  81. if (options === undefined) {
  82. options = {};
  83. }
  84. ! if (options.count === undefined) options.count = rowsPerPage;
  85. if ($("#documents thead th.key").is(".desc")) {
  86. options.descending = true;
  87. } else if (options.descending !== undefined) {
  88. --- 162,177 ----
  89. $("#viewcode button.revert, #viewcode button.save").attr("disabled", "disabled");
  90. }
  91.  
  92. + function currentRowsPerPage() {
  93. + var customCount = $('#custom-paging select#count').val();
  94. + return customCount || rowsPerPage;
  95. + };
  96. +
  97. this.updateDocumentListing = function(options) {
  98. if (options === undefined) {
  99. options = {};
  100. }
  101. ! if (options.count === undefined) options.count = currentRowsPerPage();
  102. if ($("#documents thead th.key").is(".desc")) {
  103. options.descending = true;
  104. } else if (options.descending !== undefined) {
  105. ***************
  106. *** 224,230 ****
  107. startkey: firstDoc.key !== undefined ? firstDoc.key : null,
  108. startkey_docid: firstDoc.id,
  109. skip: 1,
  110. ! count: -rowsPerPage
  111. });
  112. return false;
  113. });
  114. --- 229,235 ----
  115. startkey: firstDoc.key !== undefined ? firstDoc.key : null,
  116. startkey_docid: firstDoc.id,
  117. skip: 1,
  118. ! count: -currentRowsPerPage()
  119. });
  120. return false;
  121. });
  122. ***************
  123. *** 238,244 ****
  124. startkey: lastDoc.key !== undefined ? lastDoc.key : null,
  125. startkey_docid: lastDoc.id,
  126. skip: 1,
  127. ! count: rowsPerPage
  128. });
  129. return false;
  130. });
  131. --- 243,249 ----
  132. startkey: lastDoc.key !== undefined ? lastDoc.key : null,
  133. startkey_docid: lastDoc.id,
  134. skip: 1,
  135. ! count: currentRowsPerPage()
  136. });
  137. return false;
  138. });
  139. Only in share/www/style: .svn
  140. diff -C 3 -r share/www/style/layout.css /usr/local/share/couchdb/www/style/layout.css
  141. *** share/www/style/layout.css Sat Mar 1 13:15:28 2008
  142. --- /usr/local/share/couchdb/www/style/layout.css Fri Mar 7 15:38:21 2008
  143. ***************
  144. *** 97,102 ****
  145. --- 97,117 ----
  146. }
  147. table.listing tbody.footer #paging { float: right; }
  148.  
  149. + /* Custom Pagination */
  150. +
  151. + #paging-opts {
  152. + margin:2px 0;
  153. + width:40%;
  154. + clear:right;
  155. + float:right;
  156. + }
  157. +
  158. + #paging-opts form {
  159. + border-top: 1px solid #a7a7a7;
  160. + float:right;
  161. + padding-top:4px;
  162. + }
  163. +
  164. /* Logo & Navigation */
  165.  
  166. #logo { position: absolute; top: 20px; right: 20px; }
Add Comment
Please, Sign In to add comment