-
-
Notifications
You must be signed in to change notification settings - Fork 243
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
Chat State Notifications (XEP-0085) #431
Conversation
Fine work. Much more better than my own work ;-) |
Great. Can you report your results? Because if you find no issues, I will merge this.
I don't think so, because it also revert the revert of your pr. On the command line I see your commit and there should be also the plugin entry. We will see how this will work 😉 |
It will not work 😆. I manually have to add your changes. |
if (usersComposing.length === 0) { | ||
var duration = parseFloat(el.css('transition-duration')); | ||
|
||
if (el.css('transition-duration').match(/s$/)) { |
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.
el.css('transition-duration') returns sometimes undefined in the browser (both Chrome and Firefox) which throws an error when calling the match method on it. (This error then broke the composition notification.)
It is possible this error occurs when the .jsxc_composing div isn't more rendering (after a pausing and a timeout triggering the div removing)
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.
Just for information, I detected also a bug with the translations: the $t.() function doesn't take into account the variables and then we can see the name of the variable (_name_ for example) when a translated text is displayed (like in the desktop notifications)
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 have a look into the duration issue. Could you open another issue for the translation problem?
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.
done. I just submitted an issue about the translation problem
@@ -26,7 +26,7 @@ module.exports = function(grunt) { | |||
main: { | |||
files: [{ | |||
expand: true, | |||
src: ['lib/i18next/i18next.min.js', 'lib/jquery-i18next/jquery-i18next.min.js', 'lib/magnific-popup/dist/*.js', 'lib/favico.js/favico.js', 'lib/emojione/lib/js/*.js', 'lib/emojione/assets/svg/*.svg', 'lib/strophe.js/strophe.js', 'lib/strophe.x/*.js', 'lib/strophe.bookmarks/*.js', 'lib/strophe.vcard/*.js', 'lib/strophe.jinglejs/*-bundle.js', 'lib/otr/build/**', 'lib/otr/lib/dsa-webworker.js', 'lib/otr/lib/sm-webworker.js', 'lib/otr/lib/const.js', 'lib/otr/lib/helpers.js', 'lib/otr/lib/dsa.js', 'lib/otr/vendor/*.js', 'lib/*.js', 'LICENSE', 'img/**', 'sound/**'], | |||
src: ['lib/i18next/i18next.min.js', 'lib/jquery-i18next/jquery-i18next.min.js', 'lib/magnific-popup/dist/*.js', 'lib/favico.js/favico.js', 'lib/emojione/lib/js/*.js', 'lib/emojione/assets/svg/*.svg', 'lib/strophe.js/strophe.js', 'lib/strophe.x/*.js', 'lib/strophe.bookmarks/*.js', 'lib/strophe.chatstates/*.js', 'lib/strophe.vcard/*.js', 'lib/strophe.jinglejs/*-bundle.js', 'lib/otr/build/**', 'lib/otr/lib/dsa-webworker.js', 'lib/otr/lib/sm-webworker.js', 'lib/otr/lib/const.js', 'lib/otr/lib/helpers.js', 'lib/otr/lib/dsa.js', 'lib/otr/vendor/*.js', 'lib/*.js', 'LICENSE', 'img/**', 'sound/**'], |
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.
Hi,
could you consider wrapping this over multiple lines? This would improve readability of the diff/patch in the future.
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.
Good point. I will try if this is possible with grunt-jsbeautifier
.
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 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.
That looks already a lot better.
</div> | ||
</div> | ||
</fieldset> | ||
</form> |
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 haven't yet seen, how this will look like, but the current (old) settings window is already taking the whole screen on a 1024x1024 browser window. Are jquery ui tabs an option here?
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.
We definitely have to improve the settings dialog, but I think this is worthy a second pr 😉
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.
Should I file an issue requesting that?
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.
Yes, that would be nice.
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.
done: #434
@@ -130,9 +130,10 @@ jsxc.xmpp.chatState.onPaused = function(ev, jid) { | |||
} | |||
|
|||
if (usersComposing.length === 0) { | |||
var duration = parseFloat(el.css('transition-duration')); | |||
var durationValue = el.css('transition-duration') || '0'; |
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.
Why not || '0s'
? I think that's the more or less offiecial default, according to https://developer.mozilla.org/en-US/docs/Web/CSS/transition-duration#Summary
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 think it doesn't matter. 0s
would be maybe cleaner, but the result is the same 😄
|
||
if (el.css('transition-duration').match(/s$/)) { | ||
if (durationValue.match(/s$/)) { |
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 don't know, what values you expect anyway, but as I understand the above mentioned spec, there's also the option of "ms". So maybe: .match(/[^m]s$/)
?
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.
Great catch. Will fix it asap.
Thanks to everyone you reviewed or contributed to this pr. It is really fun to work with you guys. |
Thanks! Yes it's cool to work with all of you! |
Improve #424
@mmoqui Do you want to test this?
TODO