Please make it possible to store swfobject.js in a custom place outside of the module directory. A lot of people use sites/all/libraries, eg WYSIWYG api.

Just have a new setting where you can put the path to swfobject.js.

Comments

arthurf’s picture

Status: Active » Needs review

Committed fix to 6.1.x

armyofda12mnkeys’s picture

is this it latest release?
My drupal claims it cannot find it on status page:
"SWFObject API Copy swfobject.js
Please download the swfobject package from http://code.google.com/p/swfobject/ and place the required files in the swfobject module directory. See README.txt for more info."

But seems like everything depending on swfobject is working.
My swfobject.js file(s) are unzipped to: sites/all/libraries/swfobject

jantoine’s picture

StatusFileSize
new4.97 KB

Rather than allow a user to specify the location via settings, I think it's good to try to help site administrators follow Drupal best practices, in this case using the Libraries API module. This will allow users to share the swfobject code across multiple modules. I have attached a patch that does just this. It also fixes the issue in #2.

Cheers,

Antoine

jantoine’s picture

Title: swfobject.js in different location » Use Libraries API for best practice of handling external libraries
Version: 6.x-1.0-beta1 » 6.x-1.0-beta2
StatusFileSize
new6.94 KB

Updated the title, version and attached a new patch that includes an updated README.txt file. I should note that the patch was actually created against CVS, but there is no 6.x-1.x-dev snapshot to set as the version.

Cheers,

Antoine

arthurf’s picture

Title: Use Libraries API for best practice of handling external libraries » swfobject.js file location

Thanks for the patch. I don't think depending on libraries is a good idea as this module has been out there for some time and would suddenly require existing installs to add more modules to their setups. I also don't think this method is being used that much anymore... with jquery and html5 it seems like people are taking other approaches. I would definitely accept a patch that conditionally used libraries, I just don't want to break any existing installs that are out there.

jantoine’s picture

Hey arthurf,

I don't think depending on libraries is a good idea as this module has been out there for some time and would suddenly require existing installs to add more modules to their setups.

Considering Drupal is meant to be modular, I don't think it is too much to ask users to download and install a module that appears to me is becoming standard. I have also implemented hook_update_N() that informs the user if Libraries does not exist and secondly, if the swfobject library could not be found. I do understand that this kind of a change after the module is already in beta may seem a bit progressive, so perhaps adding it to a 6.x-1.1 release after the 6.x-1.0 release is created would be more appropriate.

I also don't think this method is being used that much anymore... with jquery and html5 it seems like people are taking other approaches.

I was under the impression that this was just beginning to become the standard. Could you please point me to examples of these other approaches you mention that modules are using. I am happy to rewrite the patch for whatever is considered to be Drupal best practice.

Cheers,

Antoine