When you download epiceditor, the extracted content has the following structure:

epiceditor/
epiceditor/js

It would be preferable to just have to unpack the zip file rather than having to restructure the unpacked files. This is especially useful when you are working with drush make, since you don't have any way of restructuring the download after it is unpacked. I suggest that we change the library path from js/* to epiceditor/js/*.

Comments

fabsor’s picture

Status: Active » Needs review
StatusFileSize
new479 bytes

Here is a patch.

fabsor’s picture

Missed a few paths there. Here is an updated version.

sun’s picture

ok, indeed, the tarball contains: ./EpicEditor-v0.1.1.1/epiceditor/js/*

So this change proposal is in line with how we're dealing with other editors.

The only problem I see is that the current path has been released already... what about people who installed it already?

fabsor’s picture

Good question, I don't think it's possible to support both paths with the same definition for the editor, so the only thing I can come up with to support that is to create two definitions, one for the old one and one for the new one, and share the rest of the implementation between them. Definitely not an ideal solution, but it would work.

One problem with this would be that there would be two listings for epic editor available in the UI, one epic editor and one "legacy epic editor". Maybe we could hide it somehow?

sun’s picture

Assigned: Unassigned » twod

Note that I'd also be fine with doing this change... since EpicEditor was introduced only recently, I doubt that there are actually many users.

Let's see what @TwoD thinks.

jonhattan’s picture

StatusFileSize
new1.91 KB

Also note the download link for epic editor is wrong. Rerolled #2

pd.
@fabstor FYI you can tell drush make (5.x) to pick a subdir:

libraries[epiceditor][download][type] = get
libraries[epiceditor][download][url] = http://oscargodson.github.com/EpicEditor/docs/downloads/EpicEditor-v0.1.1.1.zip
libraries[epiceditor][download][subtree] = EpicEditor-v0.1.1.1/epiceditor/js
thedavidmeister’s picture

Title: Look for epic editor in epicededitor/js » Look for epic editor in epiceditor/js

fixing a typo

thedavidmeister’s picture

Status: Needs review » Reviewed & tested by the community

Patch works for me using Drush 4.6. I did a manual code review and the changes seem fair enough.

I wouldn't be surprised if the maintainer of epiceditor changes the structure of the zip file sometime in the future, but for now this simple change helps a lot :)

twod’s picture

Status: Reviewed & tested by the community » Needs work

I've already committed an URL update so we can skip that from the patch. (Set both to point to epiceditor.com to avoid directly linking to the package and having it break on every release.)

The version number does not need updating since it specifies the lowest library version the JS integration file is compatible with.

I think I would actually prefer if people used the libraries[epiceditor][download][subtree] = EpicEditor-v0.1.1.1/epiceditor/js method described in #6 for Drush Make. That's only available in 5.x though so I think I'm OK with this change too.

The file structure is at least the same for EpicEditor version 0.2.0, but it became quite apparent the developer is on a Mac. Pretty much every zip file I get from Mac users also include a __MACOSX folder in the root and .DS_Store files here and there (a pain in the ass to remove every time). I can't understand why developers don't care more about packaging their releases consistently.

Wysiwyg's currently not designed to look for libraries or variants of them with different path prefixes. If we in a future version merged together all the callbacks which gather information about the package that would be a lot easier to handle (and cache).
Until then, I suppose the best we can do is make these path changes.

UPDATE: It is possible to override the 'library path' and 'editor path' editor metadata keys using the 'versions' key. I plan to use this to support TinyMCE 4 which also has a new folder structure. The kludge is a bit more complex logic in the version callback since it has to take all the possible path prefixes into consideration when looking for files.

twod’s picture

Component: Code » Editor - EpicEditor
Assigned: twod » Unassigned
Issue summary: View changes
Status: Needs work » Closed (won't fix)

EpicEditor switched back to using the EpicEditor-v0.2.2/js/epiceditor.js structure after unpacking. I think the other structure may have been a mistake in the release packaging.
We'll still have to rename the main folder because of the version number in the name for now. Maybe we can fix that later, but Wysiwyg isn't designed to scan through all folders in sites/[all|default|sitename]/libraries/* and its likes because it would currently have to do this on every page request where an editor will be loaded.

Closing this for now.