Timeline

Forums: 

Hi, made a H5P version of the TimelineJS script from http://timeline.knightlab.com/ .
Known error: 'Uncaught ReferenceError: callback_timeout is not defined' when viewing node.

H5P file: 

I had a brief look at this H5P. The script you are using creates a great timeline. It looks good and works well :)

A couple of things that needs to be fixed(I might find more when I do a more thorough review on the next version):

1. In the editor - Body text should use wysiwyg?
2. In the editor - Dates lack validation (type text should support regexp validation)
3. In the editor - Era - end date and start date misses a Y. Description should probably be "YYYY,MM,DD (Minimum YYYY required)"
4. library.json in TimelineJS library probably isn't correct? Author and license must be correct here. We will add support for MPL and MPL2
5. The so far undocumented indentation rule for H5P is 2 spaces. You are using 4 some places.
6. If you want to hide some parts of the json content try widget: none.

I didn't dig deep into the Uncaught ReferenceError, but I couldn't find that it had any consequences. Does only appear in the H5P version of the script?

Hi, thanks for your reply.
1. Yes.
2. I am using this regular expression now:
"pattern": "^-?\\d{1,}(,(1[012]|[0]?[1-9])(,([12][0-9]|3[01]|[0]?[1-9]))?)?$"

The pattern itself is alright, but h5p has problems with it due to the pipe symbols. You use these as delimiters in line 1345 of h5p/library/h5p.classes.php. This causes the pipe to be useless in the pattern. Changing that line to:
$pattern = '/' . $semantics->regexp->pattern . '/';
fixes the problem. If that is not an option, I may need some help to make an expression that does what I need without using pipe.

3. Description fixed.
4. Fixed besides licence becasue h5p does not support MPL2 yet.
5. Indentations should be good now.

Also removed a field from semantics and rather added the "'type" as a default in the main javascript.

TODO:
implement config options - timelineJS has some config options that currently are on their default values, in the future i want to implement these.
support for local media - users should be able to upload their own images (and/or videos) from the editor and use these in the timeline.

NOTE: If u upload this on a site you previously had the old version, you will have to either change or delete the database entries for the libraries used because I have changed the version numbers to 1.0.0.

H5P file: 

Everything looks good! You have now been given developer access. Congratulations! I do recommend that you add more exciting example content. It is a really cool H5P content type!