Welcome Guest! You need to login or register to make posts.

Notification

Icon
Error

Options
Go to last post Go to first unread
jgibbs  
#1 Posted : Tuesday, July 6, 2010 12:28:18 AM(UTC)
jgibbs

Rank: Advanced Member

Groups: Member
Joined: 9/22/2008(UTC)
Posts: 39

Using Image Uploader 5.5.6.0

I'm trying to figure out how to add a checkbox to each preview image in the lower portion of the ThreePanes upload form. The checkbox would basically be "[] Apply Logo" and, if clicked for that image, a specific watermark would be added to the image. If it's not checked during the upload, then it would not have the watermark applied.

I have the watermark portion completed and tested. However, I can't figure out how to allow for a checkbox on each image prior to upload.

How would one go about doing that?

Thank you.

Dmitry.Obukhov  
#2 Posted : Wednesday, July 7, 2010 9:51:11 PM(UTC)
Dmitry.Obukhov

Rank: Advanced Member

Groups: Member
Joined: 5/29/2010(UTC)
Posts: 1,310

Thanks: 8 times
Was thanked: 111 time(s) in 111 post(s)
Hello,

Sorry for the delay.

Our developer has created the application. This application allows adding a watermark to image thumbnail if the checkbox is selected before upload. If checkbox is empty no watermark will be added.

I have attached the complete sample to the post.

If you have any questions on the given sample, please feel free to let me know.

Edited by user Monday, July 12, 2010 12:01:09 PM(UTC)  | Reason: Not specified

Best regards,

Dmitry Obukhov

Technical Support. Aurigma, Inc.

Dmitry.Obukhov  
#3 Posted : Monday, July 12, 2010 10:56:50 AM(UTC)
Dmitry.Obukhov

Rank: Advanced Member

Groups: Member
Joined: 5/29/2010(UTC)
Posts: 1,310

Thanks: 8 times
Was thanked: 111 time(s) in 111 post(s)
Hello,

Here is the sample.

Edited by user Monday, July 12, 2010 12:01:28 PM(UTC)  | Reason: Not specified

File Attachment(s):
Checkbox_watermark_Sample.zip (7kb) downloaded 8 time(s).
Best regards,

Dmitry Obukhov

Technical Support. Aurigma, Inc.

jgibbs  
#4 Posted : Tuesday, July 13, 2010 8:29:14 PM(UTC)
jgibbs

Rank: Advanced Member

Groups: Member
Joined: 9/22/2008(UTC)
Posts: 39

Perfect! Thank you! This worked great.
jgibbs  
#5 Posted : Sunday, July 18, 2010 9:44:48 PM(UTC)
jgibbs

Rank: Advanced Member

Groups: Member
Joined: 9/22/2008(UTC)
Posts: 39

Well, it was working and now it's not. Here's the modified script that I placed in my script.js file. Unfortunately, even when I "uncheck" the box it still gets applied. I believe the problem is because when I insert the checkbox, I modified the code to automatically add "checked" to the <input> field so that, by default, every box is checked and the logo will be applied. However, unchecking the checkbox in the upload pane does not turn off that "checked" option as one would assume.

So, how do I have every image sent, by default, with the checkbox set with "checked", but then have "checked" turned off if someone unchecks the checkbox in the upload pane?

Code:

h += "<input id=\"checkbox" + guid.replace(/[^0-9abcdefABCDEF]/g, '') + "\" class=\"checkbox\" value=\"a1\" type=\"checkbox\" align=\"middle\" checked /> <label for=\"checkbox" + guid.replace(/[^0-9abcdefABCDEF]/g, '') + "\">Watermark</label><br />";

//This function adds the watermark to the images which are checked off in the upload pane.

function ImageUploader1_PackageBeforeUpload(packageIndex){

var guid = imageUploader1.getUploadFileGuid(1) + '';

var cb = document.getElementById("checkbox" + guid.replace(/[^0-9abcdefABCDEF]/g, ''));

if (cb.checked) {

imageUploader1.setUploadThumbnail1Watermark("ImageURL=http://domain/images/logos/watermarks/73x20.png;ImageWidth=73;ImageHeight=20;Position=BottomRight;OffsetX=5;OffsetY=5");

imageUploader1.setUploadThumbnail3Watermark("ImageURL=http://domain/images/logos/watermarks/100x28.png;ImageWidth=100;ImageHeight=28;Position=BottomRight;OffsetX=5;OffsetY=5");

}

}

Dmitry.Obukhov  
#6 Posted : Monday, July 19, 2010 7:21:57 PM(UTC)
Dmitry.Obukhov

Rank: Advanced Member

Groups: Member
Joined: 5/29/2010(UTC)
Posts: 1,310

Thanks: 8 times
Was thanked: 111 time(s) in 111 post(s)
Hello Jessica,

In the case if you don’t need to add the watermark (the box is unchecked) you should add these strings to your function:

Code:

……
    else
        //If it does not need to add the watermark (when the box is unchecked)
        imageUploader1.setUploadThumbnail1Watermark("Position=TopLeft;");

Here is your corrected code snippet:

Code:

function ImageUploader1_PackageBeforeUpload(packageIndex) {
    var guid = imageUploader1.getUploadFileGuid(1) + '';
    var cb = document.getElementById("checkbox" + guid.replace(/[^0-9abcdefABCDEF]/g, ''));
    if (cb.checked) {
imageUploader1.setUploadThumbnail1Watermark("ImageURL=http://domain/images/logos/watermarks/73x20.png;ImageWidth=73;ImageHeight=20;Position=BottomRight;OffsetX=5;OffsetY=5");
        imageUploader1.setUploadThumbnail3Watermark("ImageURL=http://domain/images/logos/watermarks/100x28.png;ImageWidth=100;ImageHeight=28;Position=BottomRight;OffsetX=5;OffsetY=5");
    }
    else
        //If it does not need to add the watermark
        imageUploader1.setUploadThumbnail1Watermark("Position=TopLeft;");

Please let me know if you have any questions or problems.

Best regards,

Dmitry Obukhov

Technical Support. Aurigma, Inc.

jgibbs  
#7 Posted : Monday, July 19, 2010 10:55:01 PM(UTC)
jgibbs

Rank: Advanced Member

Groups: Member
Joined: 9/22/2008(UTC)
Posts: 39

That's it!
Users browsing this topic
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.