Skip to content
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

#362 update jQuery to 3.6.0 #364

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Conversation

hedsnz
Copy link

@hedsnz hedsnz commented Mar 1, 2023

Obviously there is no jquery.min.js in the Rapporter CDN currently, so the only way to reference the updated jQuery is, for example, by setting portable.html = FALSE in Pandoc.brew. This is some example code from the README that I used to check:

library(pander)

text <- paste('# Header',
              '',
              'What a lovely list:\n<%= as.list(runif(10)) %>',
              'A wide table:\n<%= mtcars[1:3, ] %>',
              'And a nice chart:\n\n<%= plot(1:10) %>',
              sep = '\n')
Pandoc.brew(text = text, output = tempfile(), convert = 'html', portable.html = FALSE)

Note that the relevant code from convert.R is this, which uses local JavaScript source files instead of from the CDN:

if (portable.html) {
    ch <- ho
} else {
    ch <- gsub('http://cdn.rapporter.net/pander', system.file('includes/', package = 'pander'), ho)
}

When portable.html = TRUE (default), the example gives several errors in the browser console (unable to access the CDN). When it's set to FALSE, there are fewer errors because it uses local versions, but there is one that may be related to the update of jQuery:

Uncaught TypeError: e.indexOf is not a function

This error points to line 84 in custom.js, which is this:

$(window).load(function() {
# ...

The other side effect of this is that the page items load horizontally, instead of vertically. I'm guessing this is to do with the removal of slimbox but I'm not sure.

Sorry that I can't provide a fully functional patch, but hopefully this is a good start!

Thanks.

@daroczig
Copy link
Member

daroczig commented Mar 3, 2023

Thanks a ton, this is indeed a great start!!

I think I can update the CDN (the rapporter.net service has been shut down a long time ago), but probably better to remove that functionality altogether.

I can take this from here, thanks again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants