Closed (fixed)
Project:
CKEditor 4 - WYSIWYG HTML editor
Version:
7.x-1.x-dev
Component:
User interface
Priority:
Major
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
2 Aug 2011 at 13:58 UTC
Updated:
28 Apr 2016 at 07:50 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
dczepierga commentedHi,
It was written few times here: https://bitbucket.org/SimplyCast/imagemap-for-ckeditor/
I don't test it, but no one report does it not works...
Greetings
Comment #2
ZAIM commentedHi,
Sorry, but I'm just a beginner in drupal, so I could not understand what is written in the article, I wonder if you can explain step by step.
and thank you
Comment #3
SharonD214@aol.com commentedI've tried the image map plugin but have not been able to get it to work yet. I see the button, but clicking on it does nothing. Has anyone got it to work?
Sharon
Comment #4
romainduval commentedHi Sharon, I have the same issue ; firebug says "$ is undefined" on :
$.modal("<div style='width: 640px; height:400px; border: 1px solid black; background: white;' id='imageMapModalDiv'>\I assume we have to load the modal plugin for jquery.
Comment #5
SharonD214@aol.com commentedDo you know where we should put the plugin. I see now in the Installation info for the plugin,(https://bitbucket.org/SimplyCast/imagemap-for-ckeditor/)
that we should:
"Include the jQuery SimpleModal plugin on your page from here"
I wasn't sure if I should put it in the Library folder, the plugin folder for ckeditor, or possibly in the jquery_plugin folder. I've tried all of these without any luck, maybe it needs to be in a folder?
Sharon
Comment #6
jurveen commentedHi all,
I made some progress on this issue...
1. '$ is undefined' is because $ doesn't work in D7. Use' jQuery' instead. See http://stackoverflow.com/questions/4681309/using-jquery-in-drupal-7
2. SimpleModal has to be loaded by the imagemap plugin, or by Drupal somehow. I added
CKEDITOR.scriptLoader.load(CKEDITOR.getUrl('../plugins/imagemap/jquery.simplemodal.1.4.2.min.js'));to plugin.js to load it when imagemap plugin is loaded.
I attached the modified imagemap plugin, which includes simplemodal (put the entire folder in modules/ckeditor/plugins, and activate it in the CKEditor settings in D7).
This setup shows the imagemap editor, but after you select a circle, box or polygon, all controls disappear, and I have no idea how to save the modified imagemap. :((
Any suggestions?
Comment #7
jurveen commentedOk, just figured out where the control buttons went... When you select a circle, box or polygon, they move below the imagemap div, so just expand your browser window (a lot) to get them back into view.
Comment #8
SharonD214@aol.com commentedJurveen
I've already changed all the $ to jQuery and tried adding the simplemodal script as you suggest, clicked the button to enable the imagemap plugin and still when I click the imagemap button after selecting an image, nothing happens.
Thanks
Sharon
Comment #9
jurveen commentedHi Sharon,
Did you put the entire folder from post #6 in /sites/all/modules/ckeditor/plugins ?
Do you see any javascript errors in your browser?
Comment #10
SharonD214@aol.com commentedYes, It's all there. Where would I look for the javascript errors? I don't see anything. I selected the image I want to map, clicked the imagemap button and nothing happens.
Thanks for any insight.
Sharon
Comment #11
jurveen commentedWhich browser do you use?
In Firefox 10, the error console can be found here: menu Tools > Web Developer > Error console.
For IE, I have no idea if there is a built-in error console. However, if you're using IE 7/8, you also need the Excanvas plugin. See Enabling IE7/8 Support on the imagemap homepage.
Jurien
Comment #12
SharonD214@aol.com commentedok, mine seems to be looking here:
/public_html/sites/all/libraries/plugins/imagemap
So after I've got it in the right place I select an image and click the image map editor and something shows up, but I'm not entirely sure how to use it. I selected circle but how do I change the text from "New" to something useful? Also half the time when I click the imagemap box, I get a new window with a gray background - no image with the circle, box, polygon buttons.
Thanks
Sharon
Comment #13
jurveen commentedHi Sharon,
Ok, so you got the plugin to work. More or less...
I looked at the code again, and the gray area seems to appear when you try to edit an existing imagemap.
Error console: imagemap.js, line 191.
maps = editor.document.jQuery.getElementsByTagName("map");My guess is that this should be replaced by
maps = jQuery("maps");The error disappears, but the imagemap areas I had previously added don't show up.
So, I guess these are the limits of imagemap plugin at the moment. I posted an issue on the author's page at bitbucket.
Comment #14
SharonD214@aol.com commentedJurveen - I tried your change but still gray unless I remove the map and can't figure out how to actually label the map. Also It doesn't seem to work at all on my mac running firefox - bizarre.
Sharon
Comment #15
tjk925 commentedI have this working for new and existing image maps. I did a lot of hackery on the code. I also made a WSIWYG module for Drupal 7... unofficial.
If anyone is interested, message me for it. Here's a shot of it:
Plugin/Editor Overlay: ImageMap CkEditor Plugin
Edit: Fixed the screenshot link.
Comment #16
SharonD214@aol.com commentedyes, please.
Thanks
Sharon
Comment #17
alex030 commentedIf anyone want to edit an existing imagemap change line 191 in imagemap.js
from
maps = editor.document.jQuery.getElementsByTagName("map");to
maps = image.getDocument().getElementsByTag("map").$;This works for me.
Comment #18
Anonymous (not verified) commentedHi tjk925,
Your screen shot is very interesting. It's possible to send the sources like Sharon. We followed the previous posts but the area map does not appear on the D7 frontoffice.
Thank's a lot !
sebiad
Comment #19
knalstaaf commentedTo simply allow image map tags in CKeditor:
img[*];map[*];area[*]You should be good to go.
Comment #20
mlhyyl commentedHi,
The easiest way for me was using fckeditor in wysiwyg. A step-by-step guide can be found below.
Modules needed:
Libraries needed (use attached files):
What I did in addition is I also created I term reference field. Whenever I hover my mouse on a term reference, the matching hotspot area lights up on the image, kind of Facebook tagging. Buts that's another story.
Have fun!