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

Update static JS files #795

Closed
wants to merge 3 commits into from
Closed

Conversation

hyanwong
Copy link
Member

To test if this fixes #794

@@ -9,7 +9,7 @@
)}}
//--></script>
{{
response.files.insert(0,URL('static','js/jquery.min.js'))
response.files.insert(0,URL('static','js/jquery.js'))
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks like an unintentional commit

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It was just to test, as I hadn't minified the jquery lib, but I guess I can revert it now.

@@ -25,13 +25,24 @@
<link rel="stylesheet" href="{{=URL('static','uikit-3/css/uikit.min.css')}}" />
<script src="{{=URL('static','uikit-3/js/uikit.min.js')}}"></script>
<script src="{{=URL('static','uikit-3/js/uikit-icons.min.js')}}"></script>
<script src="{{=URL('static','js/web2py.js')}}"></script>
Copy link
Collaborator

@lentinj lentinj Apr 15, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we just include webpy_ajax.html on pages that really need it?

At best this downloads a useless copy of jquery for every page, at worst introduces web2py behaviours which then fight with our JS (the "Working..." message appearing on all buttons I've seen in the past).

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah right. I didn't realise that was the reason we had killed it. I guess we might bung it in on pages that use Ajax then?

{{
response.include_meta()
response.include_files()
}}
<!-- include 'web2py_ajax.html' could be done here, but it performs more than we want so we disect it and keep only the bits we really need -->
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems easier to remove calendar.js from views/web2py_ajax.html rather than replicating it all here. Why it was done like this I've no idea, but it was intentional: e4bf707

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree. Seems easiest to reinstate with the calendar stuff missing. But I think we probably require the include_meta() and include_files() stuff on all pages, so I'm not sure on the best way to only include web2py.js on some of the pages.

@hyanwong hyanwong marked this pull request as draft April 16, 2024 19:04
@hyanwong
Copy link
Member Author

Closed in favour of #806

@hyanwong hyanwong closed this Apr 16, 2024
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.

Back and next arrows on sponsor_node page lead to unexpected behaviour
2 participants