Submitted by konsumer (not verified) on Sun, 16/03/2008 - 03:30.
Hi,
I really like the new UI. I'm working on a super-lightweight RTE for Drupal 6, and I'd like to add support for the new IMCE. I can't seem to figure it out. I created a function that is called on click for my image button, which looks like this:
and am trying to use the plaintext API callback method to make it work:
function imceImceFinish(path, w, h, s, imceWin) { imceWin.close(); alert('selected file path='+ path +', width='+ w +', height='+ h +', filesize='+s); }
The IMCE window pops up, but the second function isn't being called. In the IMCE popup, the click function for the image is to open a popup for the image (rather then send it to my function.) Am I doing something wrong?
That integration method will not be used for 6.x due to some browser plugins renaming popup windows.
Here is an easier way
Assuming your application name is appName and url field id is urlField
Then the browse button function should be
function () { window.open(Drupal.settings.basePath+'?q=imce&app=appName|url@urlField', '', 'width=760,height=560,resizable=1'); }
It will automatically create an operation tab named "Send to appName" that sends the file url to your url field.
Clicking the files in preview do the same thing as well.
The logic here is that, when IMCE is opened using an url that contains &app=appName|fileProperty1@FieldId1|fileProperty2@FieldId2|..., then the specified fields are filled with the specified properties of the selected file.
Avaliable file properties are: url, name, size(formatted), width, height, date(formatted), bytes(integer size in bytes), time(integer date timestamp)
There is another integration method which is more complicated and gives finer control over IMCE. See the Readme.txt of the latest pack for details.
Submitted by konsumer (not verified) on Sun, 16/03/2008 - 20:26.
Thanks for the reply. That method works great for creating a popup.
I'd like to make your dialog match my setup, which loads the image dialog using AHAH into a div. I tried loading the URL directly into my dialog container, and that didn't work (just refreshed the page to IMCE on image selection) I also tried loading it in an iframe, which gave me the error "window.opener has no properties" and made it not work. Do you have any quick recipes for using it in an iframe, or better yet, directly in an AHAH pull?
hi again,
I think there is no way to load IMCE into a div because the response code is a whole page. You should go with the iframe option. The thing is to gain control over the imce object after the iframe loads. After IMCE processes everthing in the page, it looks for the imceOnLoad function and executes it, if it is defined. So, you should define the imceOnLoad variable for your iframe.
//it will be called with the win parameter refering to IMCE window(yourIframe) yourIframe['imceOnLoad'] = function (win) { var imce = win.imce;// we can access all methods of imce now. //here is the method that sets the function to which the selected files are sent. setSendTo(title, function) imce.setSendTo('Send to yourApp', yourFinalizer); }
//And finally you define your finalizer function. It is called with two parameters //file is the file object having the properties: url, name, size, width, height, date, bytes, time //win is the reference to IMCE window which is yourIframe var yourFinalizer = function(file, win) { yourURLField.value = file.url; yourWidthField.value = file.width; ... }
Submitted by Shari (not verified) on Fri, 21/03/2008 - 06:34.
Is there any way to set up classes like you have the heading tags, I don't know how to code js, but I was wondering if I could use the code in the heading area and just replace the h1 with the class tags? Well actually I tried and it didn't work. So is this something that has to be coded somewhere else?
Submitted by stranger (not verified) on Thu, 15/05/2008 - 23:51.
Im using drupal 6.2 and newest imce release with bunch of other modules. Uploading files via imce is working like charm but when im trying to resize picture i get following error:
23:53:12 An error occurred.
/user/1/imce?jsop=thumb&dir=u1 (no information available).
Its weird error, do you have any idea from where to start looking answer for that problem/ what that error means?
Hi, I really like the new
Hi,
I really like the new UI. I'm working on a super-lightweight RTE for Drupal 6, and I'd like to add support for the new IMCE. I can't seem to figure it out. I created a function that is called on click for my image button, which looks like this:
window.open(Drupal.settings.basePath+'imce/browse', 'imce', 'width=640, height=480');and am trying to use the plaintext API callback method to make it work:
function imceImceFinish(path, w, h, s, imceWin) {imceWin.close();
alert('selected file path='+ path +', width='+ w +', height='+ h +', filesize='+s);
}
The IMCE window pops up, but the second function isn't being called. In the IMCE popup, the click function for the image is to open a popup for the image (rather then send it to my function.) Am I doing something wrong?
That integration method will
That integration method will not be used for 6.x due to some browser plugins renaming popup windows.
Here is an easier way
Assuming your application name is appName and url field id is urlField
Then the browse button function should be
function () {window.open(Drupal.settings.basePath+'?q=imce&app=appName|url@urlField', '', 'width=760,height=560,resizable=1');
}
It will automatically create an operation tab named "Send to appName" that sends the file url to your url field.
Clicking the files in preview do the same thing as well.
The logic here is that, when IMCE is opened using an url that contains &app=appName|fileProperty1@FieldId1|fileProperty2@FieldId2|..., then the specified fields are filled with the specified properties of the selected file.
Avaliable file properties are: url, name, size(formatted), width, height, date(formatted), bytes(integer size in bytes), time(integer date timestamp)
There is another integration method which is more complicated and gives finer control over IMCE. See the Readme.txt of the latest pack for details.
Thanks for the reply. That
Thanks for the reply. That method works great for creating a popup.
I'd like to make your dialog match my setup, which loads the image dialog using AHAH into a div. I tried loading the URL directly into my dialog container, and that didn't work (just refreshed the page to IMCE on image selection) I also tried loading it in an iframe, which gave me the error "window.opener has no properties" and made it not work. Do you have any quick recipes for using it in an iframe, or better yet, directly in an AHAH pull?
Thanks
hi again, I think there is
hi again,
I think there is no way to load IMCE into a div because the response code is a whole page. You should go with the iframe option. The thing is to gain control over the imce object after the iframe loads. After IMCE processes everthing in the page, it looks for the imceOnLoad function and executes it, if it is defined. So, you should define the imceOnLoad variable for your iframe.
//it will be called with the win parameter refering to IMCE window(yourIframe)
yourIframe['imceOnLoad'] = function (win) {
var imce = win.imce;// we can access all methods of imce now.
//here is the method that sets the function to which the selected files are sent. setSendTo(title, function)
imce.setSendTo('Send to yourApp', yourFinalizer);
}
//And finally you define your finalizer function. It is called with two parameters
//file is the file object having the properties: url, name, size, width, height, date, bytes, time
//win is the reference to IMCE window which is yourIframe
var yourFinalizer = function(file, win) {
yourURLField.value = file.url;
yourWidthField.value = file.width;
...
}
Using this method you don't
Using this method you don't need to set &app=appName... string in the URL.
<iframe src="/?q=imce"... will work.
Is there any way to set up
Is there any way to set up classes like you have the heading tags, I don't know how to code js, but I was wondering if I could use the code in the heading area and just replace the h1 with the class tags? Well actually I tried and it didn't work. So is this something that has to be coded somewhere else?
Im using drupal 6.2 and
Im using drupal 6.2 and newest imce release with bunch of other modules. Uploading files via imce is working like charm but when im trying to resize picture i get following error:
23:53:12 An error occurred.
/user/1/imce?jsop=thumb&dir=u1 (no information available).
Its weird error, do you have any idea from where to start looking answer for that problem/ what that error means?
I have build the site with
I have build the site with Drupal 6.2 but ... : IMCE IMAGE don't work and it's impossible see the images into the pages, into the pages with text.
Why this problem ? With Drupal 5.1 : I use module IMAGE and IMAGE_ASSIST : no Problems !!!!
ULTRASUONI INDUSTRIAL ENGINEERING
Lavatrici ad ultrasuoni
Ultrasonic cleaners made in italy
Loris Puddu