Problems with IE7 when using latest version as Image Selector

Last post 08-20-2008, 8:32 AM by Domainscanners. 4 replies.
Sort Posts: Previous Next
  •  08-19-2008, 11:39 AM 43051

    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.
  •  08-19-2008, 1:09 PM 43052 in reply to 43051

    Re: Problems with IE7 when using latest version as Image Selector

    Paul,
     
    >>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.
    use  window.top.close()
     
    For the first question, please use the following code:
     
    <Script Language="javascript">
        function callInsertImage() 
        { 
       var editor1 = document.getElementById('<%=Editor1.ClientID%>');
                editor1.FocusDocument(); 
                var editdoc = editor1.GetDocument(); 
                editor1.ExecCommand('new');
                editor1.ExecCommand('ImageGalleryByBrowsing');
                InputURL();
        }   
       
        function InputURL()
        {
      var editor1 = document.getElementById('<%=Editor1.ClientID%>');
            var editdoc = editor1.GetDocument(); 
            var imgs = editdoc.images;
            if(imgs.length>0) 
            { document.getElementById("imageFld").value = imgs[imgs.length-1].src;
                editor1.ExecCommand('new');
                document.getElementById("imageFld").focus();
            } 
            else
            {
       setTimeout(InputURL,500);
            } 
        }      
    </script>
     
    Demo:
     
    How to use CuteEditor as an image selector?

    How to use CuteEditor as an image selector?( Demo1 |  Demo2 )

    This example demonstrates how to use CuteEditor as an image selector.


    asp.net Chat http://cutesoft.net/ASP.NET+Chat/default.aspx
    Web Messenger: http://cutesoft.net/Web-Messenger/default.aspx
    asp.net wysiwyg editor: http://cutesoft.net/ASP.NET+WYSIWYG+Editor/default.aspx
    asp wysiwyg html editor: http://cutesoft.net/ASP
    asp.net Image Gallery: http://cutesoft.net/ASP.NET+Image+Gallery/default.aspx
    Live Support: http://cutesoft.net/live-support/default.aspx

  •  08-19-2008, 4:41 PM 43064 in reply to 43052

    Re: Problems with IE7 when using latest version as Image Selector

    Thanks for your quick response Adam.
     
    window.top.close() worked fine so thanks for that.
     
    I cant use the exact code you provided for my 1st problem as my project has many CE controls that are dynamically rendered to the screen hence my modifed version which uses a hidden CE as an image selector and provided the image to the correct calling CE. Something somewhere has changed so I will take a closer look tonight.
     
    Is there a way I can set the property SetSecurityImageGalleryPath from Javascript? This would make life a lot easier and my code a lot simpler :)
     
    Paul.
     
     
     
     
     
  •  08-19-2008, 7:19 PM 43066 in reply to 43064

    Re: Problems with IE7 when using latest version as Image Selector

    Hello again,
     
    Im still scratching my head on this one. My old code (posted above) used to work fine (and still does - I just rolled back to my prev version of CE). Something with the Cuteeditor dll's has changed which is causing my error. Could you please spend a few mins examining the code above and then perhaps provide me with a clue as to why my code wont work with the new DLL's? 

    I have also noticed a bug in your first demo (that you posted above). To recreate the bug please do the following...
     
    Launch IE7 and run DEMO 1
    Navigate to the second page of images
    Try and select an image.
     
    The URL does not display in the box provided. This is similar to the problem I am having.
  •  08-20-2008, 8:32 AM 43097 in reply to 43066

    Re: Problems with IE7 when using latest version as Image Selector

    I have finally solved my problem.

    Burried in my masterpage I had a call to an external stylesheet that had the following...

    .imageselector
    {
         visibility: hidden;
         height:0px;
         width: 0px;
    }
     
    I removed this and now everything works as it should in IE7.
View as RSS news feed in XML