-
Notifications
You must be signed in to change notification settings - Fork 192
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
Add actual scripting to make cssfixme working #850
Comments
Three simple steps: we need to put the two js files in https://github.com/webcompat/css-fixme/tree/master/js in a suitable location (/static/js/lib/cssfixme/ .. was proposed) and add corresponding SCRIPT tags to the page. Finally, we need a small script to hook up the UI and the rest of the JS. (We can remove the inline onclick handler from the button in the template). The body of the onclick handler on the button should be somewhat like this:
I also recommend adding something like this:
|
If we use css-fixme as a git submodule, we presumably get all the junk in the repo including the .php file. What about making the build process just fetch those two files and stick them in the right place when we build webcompat.com ? |
For example using https://github.com/mCzolko/grunt-downloadfile |
Seems OK as long as we're not trying to download the files every single grunt build (same problem as image optimization). That might get annoying if you're offline. Another option is to move the files from the submodule during the build process (if they don't exist, or are newer than what we have). |
That sounds like a good idea. I almost forgot: the "hooking it all up" JS should also include an onload handler that checks if the TEXTAREA contains code and if so triggers the style fixup. This is mostly for when the server-side processing adds CSS code inside the TEXTAREA. |
Depends on #12
The text was updated successfully, but these errors were encountered: