Hi,

CKeditor www.drupal.org/project/ckeditor
is almost finished. Could you please add plugin for it?

Thank you
igor

Comments

teslegch’s picture

bump

igorik’s picture

CKeditor - drupal module is now finished, same as ckeditor 3.1
http://drupal.org/project/ckeditor
http://ckeditor.com/

would be great to see Imagebrowser support for it.
thanks

Igor

jdelaune’s picture

Sorry for the lack of responses to any issues recently. A few months ago one of my lungs collapsed so they had to put a pipe in to re-inflate it. Unfortunately it happened again just before Christmas so I had to have surgery to remove a layer of my lung to stop it collapsing again, they also found a hole in my lung which was causing the issue and cut that out. I'm still in the process of recovery with quite a bit of pain so I don't think I'll be doing much Drupal contributions for a bit. Just while I get my life and everything back on track.

Cheers

igorik’s picture

Sure Starnox, I wish to you a lot of health to new year and I hope that pain goes away and you will be better soon. The health is of course the most important thing. Good luck, man!

entr3p’s picture

Hope you get better Starnox. Thank you for all of your hard work.

Anonymous’s picture

Hope you're getting better Starnox! Maybe in the meantime another contributor could help? I would but I am still an infant concerning module building/editing. Very willing to test it out and report though...

danyalejandro’s picture

Hope you're getting better man...

btw, just in case, you guys can get imagebrowser version 1 (yeah, the old one) working with ckeditor doing the following module modification (advanced user warning):

0. Get the ckeditor module up and running.
1. in "imagebrowser.info" modify the fckeditor dependencie so it says "dependencies[] = ckeditor" instead.
2. add the following to the ckeditor configuration in "ckeditor/ckeditor/ckeditor.config.js":

	config.filebrowserBrowseUrl = 'index.php?q=imagebrowser/view/browser&app=image_ref';
	config.filebrowserWindowWidth = '695';
	config.filebrowserWindowHeight = '525';

3. in "imagebrowser/js/imagebrowser.js", modify the selectfile function so it turns out like this:

function SelectFile(url, width, height, alt, link, link_target, styles)
{
  if(window.opener) {
	var CKEditorFuncNum = getUrlVars()["CKEditorFuncNum"];
	window.opener.CKEDITOR.tools.callFunction(CKEditorFuncNum, url);
  }
  window.close();
}

and add this new fuction:


function getUrlVars() {
    var vars = [], hash;
    var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&');
    for(var i = 0; i < hashes.length; i++)
    {
        hash = hashes[i].split('=');
        vars.push(hash[0]);
        vars[hash[0]] = hash[1];
    }
    return vars;
}

4. Your brand new fork is up and running. enjoy.

that's it. at least it works 4 me...

itmanvn’s picture

@danyalejandro: thank you, it works for me :-P

scarvajal’s picture

Subscribing

lal2017’s picture

Starnox, hope your health is recovering well. Al the very best wishes from us. Get well soon mate. If health is still playing up, give me a shout. There are some very very good health diagnosis centres in India which I might have access to. Much cheaper than the US or UK and actually better too. I might be able ot put you in touch. lets hope its not needed anyway. Get well soon.

danyalejandro - I will give your workaround solution a try too.

Cheers,
Raj

lal2017’s picture

I tested this and confirm that it works with CKeditor using the above work-around. Thanks danyalejandro. Nice work!

mrbase’s picture

Here is an extended version of the SeletFile() method - this one handles target url, target, classes and alt title.

function SelectFile(url, width, height, alt, link, link_target, styles) {
  if(window.opener) {
    //url, width, height, alt
    var CKEditorFuncNum = getUrlVars()["CKEditorFuncNum"];
    window.opener.CKEDITOR.tools.callFunction(CKEditorFuncNum, url, function() {
      var element, dialog = this.getDialog();
      if (dialog.getName() == 'image') {
        // alt text - set to name of the image node
        element = dialog.getContentElement( 'info', 'txtAlt' );
        if ( element ) {
          element.setValue( alt );
        }
        // link if precent
        if ( link ) {
          element = dialog.getContentElement( 'Link', 'txtUrl' );
          if ( element ) {
            element.setValue( link );
          }
          // target of the link
          if ( link_target ) {
            element = dialog.getContentElement( 'Link', 'cmbTarget' );
            if ( element ) {
              element.setValue( link_target );
            }
          }
        }
        // style - align left or right
        if ( styles ) {
          element = dialog.getContentElement( 'info', 'cmbAlign' );
          if ( element ) {
            element.setValue( styles.replace('ibimage_', '') );
          }
        }
        // attach classes
        element = dialog.getContentElement( 'advanced', 'txtGenClass' );
        if ( element ) {
          if ( styles ) {
            element.setValue('ibimage ' + styles);
          } else {
            element.setValue('ibimage');
          }
        }
      }
    });
  }
  window.close();
}
squarecandy’s picture

I can confirm that this works against the 1.x branch.
Thanks danyalejandro and mrbase.
(mrbase version w/ left and right classes included is just what I've been looking for...)