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

jQuery UI Css Link incorrect in the view source example code #205

Open
WarriorofZarona opened this issue Dec 12, 2023 · 7 comments
Open

Comments

@WarriorofZarona
Copy link

Currently the code is like so:

<link rel="stylesheet" href="//code.jquery.com/ui/1.13.2/themes/base/jquery-ui.css">

It is missing https: so it is screwing up with anyone trying to copy and paste the code, the resource isn't loading properly.

@dmethvin
Copy link
Member

When the protocol is missing, it should take the protocol of whatever page it's used in. Do you have a link to a page where it isn't working? What does devtools show you on the network panel?

@WarriorofZarona
Copy link
Author

WarriorofZarona commented Dec 15, 2023

It's just part of the view source example code. Note that this is the only place where it is missing, the cdn's for the other links and scripts are written correctly.

In draggable:

<!doctype html>
<html lang="en">
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <title>jQuery UI Draggable - Default functionality</title>
  <link rel="stylesheet" href="//code.jquery.com/ui/1.13.2/themes/base/jquery-ui.css">
  <link rel="stylesheet" href="/resources/demos/style.css">
  <style>
  #draggable { width: 150px; height: 150px; padding: 0.5em; }
  </style>
  <script src="https://code.jquery.com/jquery-3.6.0.js"></script>
  <script src="https://code.jquery.com/ui/1.13.2/jquery-ui.js"></script>
  <script>
  $( function() {
    $( "#draggable" ).draggable();
  } );
  </script>
</head>
<body>
 
<div id="draggable" class="ui-widget-content">
  <p>Drag me around</p>
</div>
 
 
</body>
</html>

@markvantilburg
Copy link

If you open the file locally it will put file:// there and as such will not load the css file.

@dmethvin
Copy link
Member

Where is the "view source example code"? Do you have a link to it? There are a lot of pages and I'm still not sure which page it is based on the description above.

@mgol
Copy link
Member

mgol commented Dec 18, 2023

I think it's about the demos. E.g. the page https://jqueryui.com/draggable/ loads the URL https://jqueryui.com/resources/demos/draggable/default.html in an iframe and that one uses protocol-relative URLs as mentioned above.

While those URLs are valid, in 2023 it makes sense to just use HTTPS everywhere.

I'm not sure where exactly this is defined, though.

@mgol
Copy link
Member

mgol commented Dec 18, 2023

It looks like it may be defined here:

jqueryui.com/Gruntfile.js

Lines 221 to 223 in 1d19439

source = source.replace(
/<link rel="stylesheet" href="\.\.\/\.\.\/themes[^>]+>/,
"<link rel=\"stylesheet\" href=\"//code.jquery.com/ui/" + pkg.version + "/themes/base/jquery-ui.css\">" );
. PRs welcome.

@mgol mgol transferred this issue from jquery/jquery-ui Dec 20, 2023
@mgol
Copy link
Member

mgol commented Dec 20, 2023

I transferred the issue to the correct repository.

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

No branches or pull requests

4 participants