Based Insert module.
What you think?
| Comment | File | Size | Author |
|---|---|---|---|
| #4 | itweak_upload.insert20100222.patch | 10.09 KB | iva2k |
| Screenshot | 91.54 KB | Loac | |
| insert_link.patch | 2.65 KB | Loac |
Based Insert module.
What you think?
| Comment | File | Size | Author |
|---|---|---|---|
| #4 | itweak_upload.insert20100222.patch | 10.09 KB | iva2k |
| Screenshot | 91.54 KB | Loac | |
| insert_link.patch | 2.65 KB | Loac |
Comments
Comment #1
iva2k commentedI like the idea. Should make life easier for many end users. Couple of notes:
1. People may want to see that as a configurable option (especially in case they already use some other picker of attachments).
2. I personally think "Insert" link should be inlined with other links, maybe it also should be configurable where to add it to?
3. "Insert" text for the link is too ambiguous. It can be confused with "Insert new file here" or "Add more files" or the like. Maybe use "Insert into editor" or "Insert at cursor"? Or something similar. I dislike long wordings though. Maybe "Insert" with a descriptive tooltip?
4. How will it work with multiple editors on the page (CCK fields come to mind, comments section)?
Let's address/discuss those, and I'll move forward on including it into next release.
Comment #2
Babalu commented"Insert" with a descriptive tooltip :)
Comment #3
iva2k commentedGoing to take a look at including this into 6.x-2.x-dev.
Comment #4
iva2k commented@Loac
I re-rolled your patch against latest itweak_upload 6.x-2.x-dev and using js from latest insert.module.
I changed insert link to be after "Remove" link, so all links are nicely grouped.
Few remaining concerns:
1. Insertion of non-image files is performed in <img> tag. I think it should be a simple <a> tag, with some class for styling.
2. I chopped off settings passed from insert.module, to kill an error in case there is no insert.module.
3. I did not try how it interoperates with insert.module - maybe there is a simpler way (patch insert.module to work with iTweak Upload, so we can keep functions separate).
I'm still on the fence on committing it to CVS towards new release. I'd like to see iTweak Upload be focused on what it is supposed to be doing - styling / theming upload files view, not sucking in more and more functions from other modules. Insert.module should be taking care of inserts, and it will be easier to maintain both modules separately.
Comment #5
iva2k commentedAsked in the Insert queue... #722736: Make Insert work with non-cck fields in D6 - core upload, upload_comment
Comment #6
Babalu commentedworks :)
Comment #7
iva2k commentedThe code I have does not pass my standards for release - to many edge cases, not working with all attachment types properly, etc. At the same time Insert module's maintainer concluded he is not willing to add any interop features for upload functionality (since it is going away in D7). I can't afford to reimplement insert module here, and without interoperability my experimental code is not going to go anywhere. Marking "won't fix".
Comment #8
iva2k commentedI looked at the recent changes in the insert.module, and found that there is way more flexibility now to call into this module. This changes my take on the situation.
Comment #9
iva2k commentedI committed the new code into 6.x-2.x-dev.
First, it relies on insert.module a lot. Instead of providing a whole CCK field+widget, iTU implements a compact worker code (copy-paste from insert.m) and borrows a pageful of JS from it as well. The rest of the infrastructure is insert.module's, so revisions may disconnect... I used insert.module 6.x-1.0-beta4. The dependency is soft (no insert module - no functionality).
Second, there is quite a mess in the insert.module formatters provided by various modules (some presets are straight out broken). Also, by design a preset can insert <img> tag for a non-image file. Nothing there that I can fix. Direct those complaints to insert.module.
Beyond that, People, please review and post your reports here.
Comment #10
Andrey Zakharov commentedInstalled
First glitch - right just after uploading, there is no "insert" link near item. But this link is hidden by "display:none;"
After "preview", link shown but when pressing it
Comment #11
iva2k commented@Andrey
Thanks for reporting!
> But this link is hidden by "display:none;"
Can you specify in what css file the offending "display:none;" is? It is most certainly not in the itweak_upload.css, so it must be in your theme or some other module. You may need to disable CSS aggregation on performance page to see file details in Firebug or other inspector.
>Uncaught TypeError: Cannot call method 'insertIntoActiveEditor' of undefined
This tells me that insert.js was not loaded. Can you confirm that? I just reviewed insert.module code - loading js is conditional, so it looks like a real problem that needs some clever solution.
Comment #12
Andrey Zakharov commented@iva2k
This is what I'm talking about. Looks like pure scheme "ITweak_upload + Insert" doesn't work.
Comment #13
Andrey Zakharov commentedInsert module provides hook
hook_insert_widgets
which should return array of own widgets.
will try to figure out how to make this works
found this inside "itweak_upload.insert.js", in ~52 line:
jQuery selector should be
a.itu-inserti think, due .itu-insert is TD also, and I see that click event comes from TD now.
and for comments form support, I added just a above 52 line such
(added
, #edit-commentto selector).Will dig code for better support and prepare patch later.
Comment #14
iva2k commentedComment #15
iva2k commented@Andrey Zakharov
Thanks for the reports - these were very helpful, and sorry for the delay.
I fixed both JS errors in 6.x-2.x-dev, tested with both filefield enabled and disabled - that verified dependency on inser/insert.js file (there is a long non-obvious dependency path from filefield to insert.module).
This issue is fixed now. Please open new issues if there are any other problems. I will let this feature stabilize and roll a release.