josephernest / bigpicture.js

bigpicture.js is a Javascript library that allows infinite panning and infinite zooming in HTML pages.
https://josephernest.github.io/bigpicture.js/index.html
MIT License
809 stars 58 forks source link

Change HTML API to `data-bp-*`? #6

Open tomByrer opened 9 years ago

tomByrer commented 9 years ago

Data attributes are starting to be used more & more. To help prevent conflicting with another JS script, could you please add a "namespace"? EG: data-bp-x for "BigPicture X position"? Or data-bpx or data-bp_x...

Please don't make the internet crash with data-x! (OK, I joke)

josephernest commented 9 years ago

Hi @tomByrer, thanks for your idea! :) I'm currently thinking about probably better names for the attributes. By the way, do you have any example in mind of library (that would be used together with bigpicture.js) that would conflict with data-x?

tomByrer commented 9 years ago

http://jmpressjs.github.io/docs/inline.html https://github.com/bartaz/impress.js/blob/master/index.html#L166 <- your competitor... if act the same perhaps keep open to ease switching? (uses data-x-*) https://github.com/rabbitmq/rabbitmq-perf-html

Examples where people might copy-paste into live code: http://stackoverflow.com/questions/7422580/dom-data-x-attribute-compatibility-is-this-safe https://html.spec.whatwg.org/multipage/dom.html#embedding-custom-non-visible-data-with-the-data-*-attributes http://ajaxian.com/archives/embed-your-data-in-html-5

I'm sure there is & will be more; too lazy to go deep in the google hole.