Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Allow same URL to be supplied with norequest.

  • Loading branch information...
commit 15bd79ed645f993e2015ce6389b67dfd9eb9570e 1 parent 2de0fa4
@Dither authored
Showing with 19 additions and 17 deletions.
  1. +19 −17 includes/AutoPatchWork.js
View
36 includes/AutoPatchWork.js
@@ -795,20 +795,12 @@ fastCRC32.prototype = {
delete event.link;
//log('requesting ' + url);
- if (!url) {
+ if (!url || url === '') {
// we shouldn't be here
log('Invalid next link requested: ' + url);
dispatch_event('AutoPatchWork.terminated', { message: 'Invalid next link requested' });
return;
}
- // if we ever do retries should do it inside the request function
- // otherwise can be sure that requested = loaded (or failed)
- if (!requested_urls[url]) {
- requested_urls[url] = true;
- } else {
- log('Next page ' + url + ' is already requested');
- return dispatch_event('AutoPatchWork.error', { message: 'Next page is already requested' });
- }
if (typeof event.norequest !== 'undefined' && !!event.norequest) {
dispatch_event('AutoPatchWork.load', {
@@ -818,6 +810,15 @@ fastCRC32.prototype = {
return;
}
+ // if we ever do retries should do it inside the request function
+ // otherwise can be sure that requested = loaded (or failed)
+ if (!requested_urls[url]) {
+ requested_urls[url] = true;
+ } else {
+ log('Next page ' + url + ' is already requested');
+ return dispatch_event('AutoPatchWork.error', { message: 'Next page is already requested' });
+ }
+
// TODO:
// If AJAX -> 'POST' -> load -> AutoPatchWork.load
// New request_ func:
@@ -844,23 +845,18 @@ fastCRC32.prototype = {
x.overrideMimeType('text/html; charset=' + document.characterSet);
x.send(null);
}
- /* Requests next page via IFRAME load method. */
+ /* Requests next page via IFRAME-load method. */
function request_iframe(event) {
loading = true;
var url = state.nextURL = get_node_href(event.link);
delete event.link;
//log('requesting ' + url);
- if (!url) {
+ if (!url || url === '') {
// we shouldn't be here
dispatch_event('AutoPatchWork.error', { message: 'Invalid next link requested' });
return;
}
- if (!requested_urls[url]) {
- requested_urls[url] = true;
- } else {
- return dispatch_event('AutoPatchWork.error', { message: 'next page is already requested' });
- }
if (typeof event.norequest !== 'undefined' && !!event.norequest) {
dispatch_event('AutoPatchWork.load', {
@@ -869,7 +865,13 @@ fastCRC32.prototype = {
});
return;
}
-
+
+ if (!requested_urls[url]) {
+ requested_urls[url] = true;
+ } else {
+ return dispatch_event('AutoPatchWork.error', { message: 'next page is already requested' });
+ }
+
var iframe = document.createElement('iframe');
//iframe.style.display = 'none';
iframe.setAttribute('style', 'display: none !important;'); //failsafe

1 comment on commit 15bd79e

@Dither
Owner

Should I check URL with norequest at all I wonder, it's only used in page separator links in scripted pagers and they are pointless there.

Please sign in to comment.
Something went wrong with that request. Please try again.