Problems with IE7 when using latest version as Image Selector

  •  08-19-2008, 11:39 AM

    Problems with IE7 when using latest version as Image Selector

    I haven’t upgraded my Cute Editor version since the end of December 2007. I have just done so and now have a few issues \ question in getting the latest version working within my project.

           
    First problem is I use a CE control as an image selector. This code used to work in IE7 but now it doesnt... (Worth noting that it still works fine in FireFox 3)
     
    // PRIVATE Icon Image Gallery
        function callInsertPrivateDZIconImage(str_tbDropZoneIconhiddenUrl_ClientID, str_imgDropZoneIcon_ClientID, str_DropZoneNumber)  
        {  
                // Assign to public variable
                pub_str_tbDropZoneIconhiddenUrl_ClientID = str_tbDropZoneIconhiddenUrl_ClientID;
                pub_str_imgDropZoneIcon_ClientID = str_imgDropZoneIcon_ClientID;
        
                var editor1 = document.getElementById('<%=cePrivateDZIconImageSelector.ClientID%>');
                editor1.FocusDocument();  
                var editdoc = editor1.GetDocument();  
                editor1.ExecCommand('new');
                try{
                editor1.ExecCommand('ImageGalleryByBrowsing'); // ImageGalleryByBrowsing
                }
                catch(err)
                {// try catch required for Safari as imagewindow returns null value
                }
                InputPrivateIconImageURL();
        }    

        function InputPrivateIconImageURL()
        {
            
            var editor1 = document.getElementById('<%=cePrivateDZIconImageSelector.ClientID%>');
            var editdoc = editor1.GetDocument();  
            var imgs = editdoc.getElementsByTagName("img");
            
            if(imgs.length>0)  
            {    
            // Strip everything up to the third "/" -1 character to make development environment friendly. lastIndexOf() works its way backwords through string
             var imgurl = imgs[imgs.length-1].src;
             var strImageGallery = imgurl.lastIndexOf("/ImageGallery/");
             var urllength = imgurl.length;
             var newurl = imgurl.substring(strImageGallery, urllength);
            
             document.getElementById(pub_str_tbDropZoneIconhiddenUrl_ClientID).value = newurl;
             document.getElementById(pub_str_imgDropZoneIcon_ClientID).removeAttribute("src");
             document.getElementById(pub_str_imgDropZoneIcon_ClientID).setAttribute("src", newurl);
               
            }  
            else
            {
                setTimeout(InputPrivateIconImageURL,500);
            }  
            

        }
     
     
    Second problem is I used to launch a window from CE and be able to close the window with a simple javascript call "window.close();". This also no longer works.
     
    Please advise when you can Adam,
     
    Thanks,
     
    Paul.
View Complete Thread