-
Notifications
You must be signed in to change notification settings - Fork 10
Using document.write(androidContext.getForm()) in template.html #36
Comments
Thanks @kirang20 yes, we probably need to un-requirjsify androidContext.mock.js, add it as a script to template.html (and then only set this global variable if it doesn't exist) since it worked previously, we should be able to detect when the inline html has been added to the DOM, and wait for that before instantiating the new Form() in main.js. I can have a look as well, but it will be next week probably. |
I can wait till next week :). Sorry, Dristhi Training/Research is starting in March and we there are lot of things to complete by then. So thanks for the help. |
Ah, well, I'll try to look at it sooner! Otherwise, we can leave it as-is for the training/research, right? fwiw, what I'm working on this week, may very well be more significant in terms of performance.... :). Let's temper expectations though. Also, the new enketo-core includes a lot of css changes, so merging is going to take time too. |
EC_Registration is the slowest form in Dristhi right? |
Yes, it is okay for the research/training to start without this change (this is a nice to have feature not a must have).
|
@Kiran20 I think I may have nailed bringing back the inline script now... It was indeed pretty hard... I had to disable ziggy in the web view. This should happen automatically. If you have trouble using this in Drishti, these lines may not work: https://github.com/MartijnR/enketo-dristhi/blob/inline_form_injection/src/js/FormDataController.js#L3-L6 If it works, I'm curious if this speeds up loading. I kept this in a separate branch (inline_form_injection) |
@kirang20 just checking if you've seen this. Once you confirm it works, I'll merge it into master |
As I said in another comment, we did merge this. Forms are working but I On Wednesday, March 19, 2014, Martijn van de Rijdt [email protected]
Regards, |
Cool! I'll merge the branch. Thx |
Extremely sorry Martijn, I did not realise that this change was in a different branch (this is what juggling two or three tasks at the same time does!). So this was never merged onto Dristhi app, as we only updated from the master branch. We did merge it today. We are finding that the forms are much slower now (EC registration form is taking close to 8 seconds more to load)! |
No worries. It forced me to learn how to reverse a merge. Interesting it was slower! So either inline is slower after all, or I made some mistake. If the forms seemed otherwise fully functional, I think inline injection may be slower after all. |
Hi Martijn,
We tried inlining document.write(androidContext.getForm()); in template.html (as before) but we cannot get forms to work correctly after that.
Some issues we are facing:
Module name "androidContext" has not been loaded yet for context: _. Use require([]).
Is this because RequireJS is not yet loaded?
Any suggestions (if you need, we can send you an APK with these changes)?
The text was updated successfully, but these errors were encountered: