Skip to content

Commit

Permalink
Merge pull request #30 from vikingco/MVP-16063/syntax-error
Browse files Browse the repository at this point in the history
Mvp 16063/syntax error
  • Loading branch information
nielsvanoch authored Jan 4, 2018
2 parents 3a59d20 + 12bf140 commit 63884b6
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
22 changes: 11 additions & 11 deletions django_ajax/static/ajax-utilities/js/pagination.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
var Pagination = new function() {

this.init = function(processHash, document_containers, setHash) {
// For each pagination node
// For each pagination node
var containers = new Array();

// Create new containers Array after each initialisation
Expand All @@ -26,7 +26,7 @@ var Pagination = new function() {
}
});

// Make setHash = true the default
// Make setHash = true the default
if (setHash == undefined)
setHash = true;

Expand All @@ -52,9 +52,9 @@ var Pagination = new function() {

function ajax(url, handler) {
// URL should start with a slash, but cannot start with two slashes.
// we cannot start with "/\". Modern browsers handle backslashes as normal slashes.
// we cannot start with "/\". Modern browsers handle backslashes as normal slashes.
// (Otherwise we have an XSS vulnerability.)
if (url[0] != '/' || url[1] == '/' || url.startsWith("/\\")
if (url[0] != '/' || url[1] == '/' || url.startsWith("/\\"))
url = (''+location).replace( /[#\?].*/, '') + url;

// Append 'xhr' to make sure all content is loaded.
Expand Down Expand Up @@ -95,13 +95,13 @@ var Pagination = new function() {

// Replace page AJAX handler
function replacePage(url, receivedHtml) {
// Set location hash
if (setHash)
location.hash = 'page:' + url;
// Set location hash
if (setHash)
location.hash = 'page:' + url;


for (var i in containers) {
// Empty the paginate nodes
// Empty the paginate nodes
containers[i].empty();
containers[i].css('height', '');

Expand Down Expand Up @@ -148,7 +148,7 @@ var Pagination = new function() {
var preload = $('.pagination_preload').size() > 0;

if (preload) {
if (prev_url)
if (prev_url)
ajax(prev_url, function(html) {
previousPageHtml = html;
if (clickedPrevious) replacePage(prev_url, html);
Expand Down Expand Up @@ -184,7 +184,7 @@ var Pagination = new function() {
container.find('.pagination a, .pagination-helper a, a.pagination-helper').each(function() {

$(this).click(function (){
var url = $(this).attr('href');
var url = $(this).attr('href');
showLoader();

if (url[0] == '#') {
Expand All @@ -193,7 +193,7 @@ var Pagination = new function() {
}
else
ajax(url, function(html) {
replacePage(url, html);
replacePage(url, html);
});
return false;
});
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

setup(
name='django-ajax-utilities',
version='1.2.9',
version='1.2.10',
url='https://github.com/vikingco/django-ajax-utilities',
license='BSD',
description='Pagination, xhr and tabbing utilities for the Django framework.',
Expand Down

0 comments on commit 63884b6

Please sign in to comment.