-
-
Notifications
You must be signed in to change notification settings - Fork 598
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
[WIP] Zeitline component #3631
[WIP] Zeitline component #3631
Conversation
We do not have the time, but maybe someone from the community can jump in? |
}), | ||
}, | ||
async mounted() { | ||
this.line = new Zeitline.Timeline(this.conf); |
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.
seems like you're not importing the zeitline.min.bundle.js anywhere so i'd assume this is undefined?
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.
Isn't the resource already added with self.add_resource(Path(__file__).parent / 'lib' / 'zeitline')
?
I tried anyway, but the problem remains the same ; i got a Uncaught SyntaxError: unexpected token: identifier
for the line async mounted() {
in the javascript console log.
I will look into that and get back to you
Thank you :)
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.
The syntax error is caused by a missing }
in the data()
definition above.
Regarding the resource: You also have to load it on the client side. See the fullcalendar example for a very similar case:
await loadResource(window.path_prefix + `${this.resource_path}/index.global.min.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.
Okay, it was the syntax problem and the missing imports. I copied from codemirror.js and now i've got a problem : the zeitline.bundle.min.js
import is failing because of an undefined statement.
The source code of zeitline starts with : (deminimization and debugging with firefox)
!function (t, n) {
'object' == typeof exports &&
'object' == typeof module ? module.exports = n() : 'function' == typeof define &&
define.amd ? define([], n) : 'object' == typeof exports ? exports.Zeitline = n() : t.Zeitline = n()
}(
And the TypeError: t is undefined
is raised at the 4th line, so i guess somehow n() : t.Zeitline = n()
does not know about the function parameter t
. Looks magic to me, but i guess either it's because my zeitline.bundle.min.js is malformed, either i'm using it wrong.
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.
The syntax error is caused by a missing
}
in thedata()
definition above.Regarding the resource: You also have to load it on the client side. See the fullcalendar example for a very similar case:
await loadResource(window.path_prefix + `${this.resource_path}/index.global.min.js`);
Hi ! Thank you very much for looking into that !
Yeah, i just found that too :)
However, i copied the client-side import from codemirror.js. Can you verify it's valid too ?
@xaptronic You mean moving |
WIP here: https://github.com/xaptronic/nicegui-zeitline I am going to try and get event handlers working before pushing to pypi. |
Following #3620 , i tried something. Does not work (got an empty page), which is visible through the test.
I don't know anything about vue.js, so i guess my zeitline.js file has several problems.
Can someone help me ?