darkspotinthecorner / DarkTip

The DarkTip plugin is a javascript based tooltip framework that enables quick and easy development of modules that hook into specific aspects of a webpage and display context sensitive tooltips.
http://darkspotinthecorner.github.io/DarkTip/
MIT License
31 stars 3 forks source link

Ability to load modules, qtip & JQ manually #5

Open raldred opened 12 years ago

raldred commented 12 years ago

At the moment, darktip loads all its dependencies automatically. The problem with this approach is..

I would prefer a much simpler approach where you just manually include the modules that you need into your page. Then also there'd be no need for the settings hash if it's only telling the plugin what modules to load. eg.

<script src="jquery.1.7.1.js"></script>
<script src="qtip2.js"></script>
<script src="darktip.js"></script>
<script src="darktip/wow.item.js"></script>
<script src="darktip/wow.character.js"></script>

This way all js can be run through an asset pipeline.

What do you think?

--Rob

BinaryMuse commented 12 years ago

+1; this would be particularly nice for things like the Rails asset pipeline, Snockets/connect-assets in Node, etc.

darkspotinthecorner commented 12 years ago

Yeah, totally makes sense. I started bundling yepnope because I only wanted to include jQuery when needed. However I think it got a bit out of hand. ;)

Will have a shot at this in the next major update. :)

raldred commented 12 years ago

Cool, cheers, I don't mind chipping in, looking at your code, it's nicely separated so should be pretty easy to switch this around.

exochron commented 12 years ago

Actually... every browser stops execution on every script within your <body> for a short time to (download and) handle it. So... with the number of modules in DarkTip you might use (or not) your website performance would go down as hell (and with it your PageRank btw.). Of course you can place all the scritpts in the head, but that doesn't actually help very much. I guess, a main reason of using yepnope instead is, that it can load all modules asynchronously.

But, to be honest I'm also not happy with the jQuery approach. Probably the best way would be setting up some kind of package builder (like http://jqueryui.com/download). So with it every webmaster could build his own All-in-One-scriptfile. (... and with that you could ship minified versions! ;D)

darkspotinthecorner commented 12 years ago

@exochron : that's what I'm aiming for, yes. Will take some time to get there though. Right now I don't have much time to push the project forward. But updates will be coming, sooner or later. :)

raldred commented 12 years ago

Personally I would prefer this to be kept very simple, it makes it much more flexible for individual needs if the libarary doesn't automate too much of it's dependencies. unless of course you switch to AMD

darkspotinthecorner commented 12 years ago

@raldred : I will try to make any dependency toggleable. You should be able to tailor the package to anything you might need. Hopefully... ;)

Clausi commented 9 years ago

This would be a really cool feature. Currently developing a guild site base on bootstrap, so I want to use its features (tooltips, popovers etc). It would be good to choose which libaries are loaded and an easy way to control the output of darktip to create tooltips.