Skip to content
This repository has been archived by the owner on Jun 29, 2018. It is now read-only.

Added the possibility to specify the id of the document element that the subtitles are appended to. #383

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

aldatsa
Copy link
Contributor

@aldatsa aldatsa commented Feb 20, 2014

I think that this fixes the issue #382

@@ -39,12 +39,18 @@
parseFn,
parser = {};

parseFn = function( filename, callback ) {
parseFn = function( filename, callback, target ) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like the idea, and I appreciate the patch :)

Only comment is what if we made target an options object, with keys and values.

Example:

pop.parseSRT( "my-video.srt", {
target: "my-div"
});

It works well for optional parameters because order doesn't matter. It also means in the future it is going to be easy to add other properties.

Also means custom parsers and plugins could use it for properties other than just target.

Thoughts?

@aldatsa
Copy link
Contributor Author

aldatsa commented Feb 20, 2014

No problem. Consistency is a good thing.


if ( options && options[ "target" ] ) {
sub.target = options[ "target" ];
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And do you mind moving these tabs to two spaces?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you don't mind I can do it when I merge this in.

@ScottDowne
Copy link
Contributor

I landed this just now. Doesn't seem to be closing the pull request because I did a rebase with current master.

You can see the commit on master: 5835bbf

I appreciate the contribution :)

The next step is to add a test and write some docs :) I'm willing to do all that if you don't mind, but you're welcome to give it go.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants