#582 ✓ staged
David Humphrey

Provide a user-level API for setting plugin defaults

Reported by David Humphrey | June 16th, 2011 @ 02:25 PM | in 0.7

I'm building a plugin where I want to specify a value from user-level code that gets used in every track instance. I think it might be nice to provide a way to do this for any property of a plugin, so you have to write less code. Here's a potential API:

var pop = Popcorn(...);

pop.gist.defaults({ target: "div1",
                    gistURL: "https://gist.github.com/1029514" });

pop.gist({ start: 4,
           end: 8,
           lines: 1-5 });

pop.gist({ start: 9,
           end: 11,
           lines: 6-9 });


pop.gist({ start: 13,
           end: 18,
           lines: 1-5,
           target: "div2" /* overwriting default */ });

Here you can see that none of the gist instances specify the gistURL--they use the default. However, in the final track the target div has been overwritten.

Comments and changes to this ticket

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

Popcorn.js is an HTML5 video framework that lets you bring elements of the web into your videos.

Popcorn.js is a project of Web Made Movies, Mozilla's Open Video Lab.

Shared Ticket Bins

Referenced by

Pages