refactor: decouple python from js and css#297
Merged
Conversation
Contributor
|
As this is such a large change I'll wait for you to resolve the conflicts, we'll get a few people to test then coordinate the sync to master because it's a big change of frontend again that will 💯% require a pull from main repo |
Contributor
|
Well nothing seems broken, tested txt2img and img2img 🤞 |
This was referenced Aug 31, 2022
altryne
reviewed
Aug 31, 2022
| input[type=number]:disabled { -moz-appearance: textfield;+ } | ||
| def js(opt): | ||
| data = readTextFile("js", "index.js") | ||
| data = "(z) => {" + data + "; return z ?? [] }" |
| def js_move_image(from_id, to_id): | ||
| return w(f"moveImageFromGallery('{from_id}', '{to_id}')") | ||
|
|
||
| def js_copy_to_clipboard(from_id): |
Contributor
There was a problem hiding this comment.
Python bindings for every JS function?
| """) | ||
| # Hack: Detect the load event on the frontend | ||
| # Won't be needed in the next version of gradio | ||
| # See the relevant PR: https://github.com/gradio-app/gradio/pull/2108 |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This is a large change that concerns
frontendfolder.In short
css_and_js.pywas refactored to be a facade for frontend files which are stored in their respective folders:cssandjs.Currently the implementation is very simple. It bundles together css files based on ops and js is just one big file that exposes SD object to the global space. At a later date it can be expanded as needed while maintaining a simple interface with python scripts via
css_and_js.py.I tested it to my ability but the changes are vast so I might have missed a few things.
IMPORTANT NOTES