I was playing with the MSword filtering that tinyMCE does so well and got inspired!

I'm looking to tinyMCE for a foolproof way for computer illiterates to post articles to my site. Cut and Paste from a Wordprocessor - or even another webpage - is extremely useful and brilliantly realised in tinyMCE.

The only bit that will give users a hard time is image integration. It seems to me that the TinMCE-inline-upload module trinity offers the simplest user interface. Image module is great, but it's clunky because it does so many other things aswell.

I noticed that TinyMCE 'cleans' all the MS crap from the code of a word document, but leaves the URL for the img src - in my case my desktop or wherever word had stashed it. If there was a way for
1. TinMCE to pass these URLs to the upload.module,
2. which would pop-up displaying a checkbox list of file attachments, asking 'do you want to include these files?' or something.
3. Then the user checks all the boxes (usually), clicks submit and upload does its attachement business.
4. Then, TinyMCE does it's inline bit, replacing the old URLs with the relevant [inline...] tag.

I suppose it's kind of similar to the 'save as webpage complete' thingamy, creates the html and the attachment folder and automaticcaly links the two together ...

How easy would that be ? (for the user anyways :)

Comments

JohnG-1’s picture

Title: inline & upload module integration ? » tinyMCE & inline & upload module integration ?

I'm suprised there's been no replies to this suggestion.

I thought it was a really useful idea and seemed relatively simple to implement (to a non-coder).

Any thoughts, anyone?

richardb’s picture

Hi,
I think the problem is that most developers around here don't use IE, or MSword (working on Mac or Linux), so haven't really found the need for this enhancement.
I agree a on-step import would be nice, but if I was to make it from scratch I wouldn't do it from tinyMCE, but from a separate module.
Simply have an 'Import word document' feature where you upload your whole word document, and the module converts it to HTML - images and all...
This could then be enhance to do spreadsheets and PDFs as well...
I have done this already for a mnogosearch project i worked on, but it would only run on Linux servers, and require some installation of separate programs, so not for general consumption I think.

Anyway, if you do put something together feel free to send us a patch.

JohnG-1’s picture

thanks richard - I'd love to be able cobble something together to share with everyone but I've no idea how ... I'll get there one day!

I submitted this as a feature request for TinyMCE user interface, because it seems consistent with the purpose of TinyMCE which is to make life as easy as possible for 'the general public'. I realise that TinyMCE is not only a drupal thing, and that's why the TinyMCE.module is a separate entity from the TinyMCE javascripts. These modifications would apply to the TinyMCE.module for Drupal.

Personally I don't use MS word at all, but alot of people do. My suggestion is not specific to MS word. It would apply when copy&pasting html pages too, and any DTP editor that works with 'inline' images. It seems a good idea to allow people to use what ever obscure editor they feel comfortable with, and make the conversion process as easy as possible.

To incorporate the [inline:xx] tag into TinyMCE should be very easy. Of course the inline.module script would also be necessary, and ideally bundled in with TinyMCE.module.

The integration with upload.module would be a little more complex - I guess - as you have to have TinyMCE open a dialogue with the upload.module.
1 open a user window containing :
i/ a list (form items) of the 'attachments' derived from URLs in the 'master' page.
ii/ a checkbox for each file referenced
2 on submit :
i/ passes the list of checked files to the upload.module
ii/ triggers the upload/attachement process,
iii/ and inserts the [inline:xx] tags into the master document.

so basically the proposed TinyMCE.module feature creates an interface window to the upload.module ...

the theory seems straight forward enough!

I bet you could do the code with your eyes closed, Richard ;)

matt westgate’s picture

Title: tinyMCE & inline & upload module integration ? » MS Word image insert integration
JohnG-1’s picture

Title: MS Word image insert integration » tinyMCE, inline & upload module integration ?

?

sorry mathias but this is not about MS word! it is about inline URLs for external files eg images.

The MSword filter already in tinyMCE was the inspiration for a more streamlined use of the TinyMCE-Inline-Upload module trilogy.

I believe this trio is justifiably popular because it makes web-document creation very easy for users.

My idea was to simplify the user cut&paste process even further by integrating all 3 modules so the user can cut&paste a complete document (including inline files) in a single process rather than 3 separate processes.

For example:

I cut & paste a simple html page which looks something like this:

 This is a picture of me:
<img src="http://www.longlostpics.com/mypic5.jpg">
and this
<img src="http://www.longlostpics.com/mypic2.jpg">
nice huh?

Now, the codefilter (based on the MScodefilter) will read the references to the jpg files and think, aha! may be the user wants to include this file in the new document too? so it pops-up a little window asking me:
"please select which of the following files you want to include in your new document:
1: mypic5.jpg
2: mypic2.jpg"
with a checkbox next to each one.
I like mypic5 but not mypic2 so I check mypic5 and Submit.

Next, behind the scenes, TinyMCE.module says to upload module: " just go and copy this file "http://www.longlostpics.com/mypic5.jpg" to the users files/ folder and call it 123456789.jpg - ta" Upload does all its filtype, filesize, etc checks, says "ok" and performs the upload.

And then TinyMCE replaces the reference Only local images are allowed. with Only local images are allowed.inline.

and hey presto!

surely much easier the user invoking each module in turn by hand ... ?

I don't know how to explain this any more simply!

robertdouglass’s picture

One problem with taking a URL to a file on your desktop and returning a form to upload that file is, well, it's impossible. There is no way that you can coax the <input type="file"> element to come with a pre-filled value. The best you could do is give the user a message "hey, there's a file here that I can't get to... you want to upload it?" and then offer them a blank upload box. This seems like a lot of bending over backwards to support computer dummies.

robertdouglass’s picture

Your example where the images are web-accessible would work -- Drupal could download them and save them, but the code would 'work' without having to to that too. If you paste that into TinyMCE and those images are web accessible, they'll show up in the post.

liquidcms’s picture

just my $0.02 worth... I had this thought a couple weeks ago when i was looking at taking an existing site and converting it to drupal..

as a test to the client i simply copy/pasted a page from their existing site into my demo drupal site:

you can see that page here: http://drupal.liquidcms.ca/node/121

the copy and paste was flawless.. incredibly impressive to my client.. everything moved over formatting, urls, etc... very cool

only thing was i needed to pull the image out of his page and insert that manually.. was pretty simple to do with img_assist and tiny but i thought.. hmmm.. this cant be too hard to do programattically

anyway.. not sure what the neysayers here are thinking; there is no reason this couldnt technically work - exactly as you suggested..

i have too many things on my plate right now or i might look at this further.. and i still might get around to it... for the task of importing my clients site though.. it would end up being esier to just copy over his image files and then write a script to convert his db to drupal nodes - but there would certianly be times when there wasnt enough content to bother doing this with and a smiple cut/paste would be easier... especially for newbies trying to import existing content

peter....

kreynen’s picture

Status: Active » Closed (fixed)

Closing all 4.6 issues