- Only paritial pagination, first X, then showAll - Default is 40 for subDirs and sibling albums each - showAll parameter causes page refresh with entirely new list TODO/Future improvements include: - Finer grain pagination - Pagination done at the database level - Seamless refresh with JS - Unify all pagination uses across the site Signed-off-by: Andrew DeMaria <lostonamountain@gmail.com>master
parent
c309eb79de
commit
a1698861d4
@ -0,0 +1,17 @@ |
||||
<databaseChangeLog |
||||
xmlns="http://www.liquibase.org/xml/ns/dbchangelog" |
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
||||
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.1.xsd"> |
||||
<changeSet id="add-user-pagination_001" author="muff1nman"> |
||||
<preConditions onFail="MARK_RAN"> |
||||
<not> |
||||
<columnExists tableName="user_settings" columnName="pagination_size" /> |
||||
</not> |
||||
</preConditions> |
||||
<addColumn tableName="user_settings"> |
||||
<column name="pagination_size" type="int" defaultValueNumeric="40"> |
||||
<constraints nullable="false" /> |
||||
</column> |
||||
</addColumn> |
||||
</changeSet> |
||||
</databaseChangeLog> |
@ -0,0 +1,10 @@ |
||||
function updateQueryStringParameter(uri, key, value) { |
||||
var re = new RegExp("([?&])" + key + "=.*?(&|$)", "i"); |
||||
var separator = uri.indexOf('?') !== -1 ? "&" : "?"; |
||||
if (uri.match(re)) { |
||||
return uri.replace(re, '$1' + key + "=" + value + '$2'); |
||||
} |
||||
else { |
||||
return uri + separator + key + "=" + value; |
||||
} |
||||
} |
Loading…
Reference in new issue