-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
FIX Bug page_y url #32119
Merged
Merged
FIX Bug page_y url #32119
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -242,38 +242,34 @@ | |
// Code to manage reposition | ||
print "\n/* JS CODE TO ENABLE reposition management (does not work if a redirect is done after action of submission) */\n"; | ||
print ' | ||
jQuery(document).ready(function() { | ||
/* If page_y set, we set scrollbar with it */ | ||
page_y=getParameterByName(\'page_y\', 0); /* search in GET parameter */ | ||
if (page_y == 0) page_y = jQuery("#page_y").text(); /* search in POST parameter that is filed at bottom of page */ | ||
if (page_y > 0) | ||
{ | ||
console.log("page_y found is "+page_y); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same question for console.logthat are necessary to debug. |
||
$(\'html, body\').scrollTop(page_y); | ||
} | ||
|
||
/* Set handler to add page_y param on output (click on href links or submit button) */ | ||
jQuery(".reposition").click(function() { | ||
var page_y = $(document).scrollTop(); | ||
|
||
if (page_y > 0) | ||
{ | ||
if (this.href) | ||
{ | ||
console.log("We click on tag with .reposition class. this.ref was "+this.href); | ||
var hrefarray = this.href.split("#", 2); | ||
hrefarray[0]=hrefarray[0].replace(/&page_y=(\d+)/, \'\'); /* remove page_y param if already present */ | ||
this.href=hrefarray[0]+\'&page_y=\'+page_y; | ||
console.log("We click on tag with .reposition class. this.ref is now "+this.href); | ||
} | ||
else | ||
{ | ||
console.log("We click on tag with .reposition class but element is not an <a> html tag, so we try to update input form field with name=page_y with value "+page_y); | ||
jQuery("input[type=hidden][name=page_y]").val(page_y); | ||
} | ||
} | ||
}); | ||
});'."\n"; | ||
jQuery(document).ready(function() { | ||
/* If page_y set, we set scrollbar with it */ | ||
page_y = getParameterByName("page_y", 0); /* search in GET parameter */ | ||
if (page_y == 0) page_y = jQuery("#page_y").text(); /* search in POST parameter that is filed at bottom of page */ | ||
if (page_y > 0) { | ||
console.log("page_y found is "+page_y); | ||
jQuery("html, body").scrollTop(page_y); | ||
} | ||
|
||
/* Set handler to add page_y param on output (click on href links or submit button) */ | ||
jQuery(".reposition").click(function(event) { | ||
var page_y = jQuery(document).scrollTop(); | ||
if (page_y > 0) { | ||
if (this.href) { | ||
console.log("We click on tag with .reposition class. this.ref was "+this.href); | ||
var url = new URL(this.href, window.location.origin); | ||
url.searchParams.delete("page_y"); /* remove page_y param if already present */ | ||
url.searchParams.set("page_y", page_y); | ||
this.href = url.toString(); | ||
console.log("We click on tag with .reposition class. this.ref is now "+this.href); | ||
} else { | ||
console.log("We click on tag with .reposition class but element is not an <a> html tag, so we try to update input form field with name=page_y with value "+page_y); | ||
jQuery("input[type=hidden][name=page_y]").val(page_y); | ||
} | ||
} | ||
}); | ||
}); | ||
' . "\n"; | ||
|
||
// Code to manage Copy To Clipboard click | ||
print "\n/* JS CODE TO ENABLE ClipBoard copy paste */\n"; | ||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why removing all the comments that help to understand the code ?