-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Refactor image diff #31444
Refactor image diff #31444
Conversation
0ca3d5a
to
1c73e5c
Compare
web_src/js/features/common-form.js
Outdated
@@ -1,4 +1,5 @@ | |||
import $ from 'jquery'; | |||
import '../vendor/jquery.are-you-sure.js'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Already imported in web_src/js/features/common-global.js
, so this would load it twice needlessly.
Move import to index.js?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is no common-global.js
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where is it currently loaded? Not at all?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Move import to index.js?
I would say no. Only use it where it is really used. Here is initGlobalFormDirtyLeaveConfirm
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
0678287 regressed it. I recommend moving the import to top of index.js, it's needed on so many pages, we may as well load it everywhere.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will rewrite the are-you-sure
in next PR, but not in this one.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
-> Fix are-you-sure #31446
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we do not need that many PRs, merged #31446 into this since it is simple enough
boundsInfoAfterHeight.classList.toggle('green', heightChanged); | ||
} | ||
const widthChanged = sizes.imageAfter && sizes.imageBefore && sizes.imageAfter.naturalWidth !== sizes.imageBefore.naturalWidth; | ||
const heightChanged = sizes.imageAfter && sizes.imageBefore && sizes.imageAfter.naturalHeight !== sizes.imageBefore.naturalHeight; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can these two lines be simplified to sizes.imageAfter?.naturalWidth !== sizes.imageBefore?.naturalWidth
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, the meaning is different.
* giteaofficial/main: Refactor image diff (go-gitea#31444) [skip ci] Updated translations via Crowdin Support relative paths to videos from Wiki pages (go-gitea#31061) Fix deprecated Dockerfile ENV format (go-gitea#31450) README Badge maintenance (go-gitea#31441) Improve markdown textarea for indentation and lists (go-gitea#31406) Split common-global.js into separate files (go-gitea#31438)
Regression? At https://demo.gitea.com/, maybe it is out of date. |
No, 621e1ff is a quite old commit |
a4899ff got deployed and error is gone. Which commit fixed it? |
@silverwind the binary release had an issue for a sec, so the updates didn't get pushed to demo. it's since been resolved. |
And remove some jQuery functions