Issue with modalDialog in Firefox

Last post 03-09-2009, 10:06 AM by Gib. 2 replies.
Sort Posts: Previous Next
  •  03-09-2009, 4:37 AM 49613

    Issue with modalDialog in Firefox

    I have a custom button on the CuteEditor that opens a modalDialog which I use to add images to the editor. As I have several hundred images these are split into directories, managed by a tree view. The problem i'm having with Firefox is the dialogArguments, this being what I use to send the image back to the editor, being set to null when I navigate from the root directory.
     
    Any help would be greatly appreciated.
     
    Many thanks,
    Gib

  •  03-09-2009, 9:08 AM 49622 in reply to 49613

    Re: Issue with modalDialog in Firefox

    Gib,
     
    How did you open this modaldialog?
     
    Are you using the example code of this example?
     
     
    Add a Cross Browser Modal Dialog Box to Cute Editor

    How to create a custom button(client side) which displays a dialog?( C# | VB )

    This example demonstrates how easy it can be to add your own client side buttons to the CuteEditor by creating a Cross Browser Modal Dialog Box.


    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

  •  03-09-2009, 10:06 AM 49631 in reply to 49622

    Re: Issue with modalDialog in Firefox

    Hi Adam,

    I'm opening the dialog with:

    WebControl ctrl = Editor1.CreateCommandButton("MyButton2", "Insert.gif", "Insert pic");
    ctrl.Attributes["onclick"] = "ShowMyDialog(this)";

    string picDialogScript = "function ShowMyDialog(button){\n\t//use CuteEditor_GetEditor(elementinsidetheEditor) to get the cute editor instance\n";
    picDialogScript += "\tvar editor = CuteEditor_GetEditor(button);\n";
    picDialogScript += "\t//show the dialog page , and pass the editor as newwin.dialogArguments\n";
    picDialogScript += "\tvar newwin = showModalDialog(\"" + domain.ThisDomain + "/admin/MyPics.aspx?iseditor=true&_rand=\"+new Date().getTime(),editor,\"dialogWidth:760px;dialogHeight:500px\");\n}\n\n";

    ...

    function ShowMyDialog(button){
        var editor = CuteEditor_GetEditor(button);
        //show the dialog page , and pass the editor as newwin.dialogArguments
        var newwin = showModalDialog("/admin/MyPics.aspx?iseditor=true&_rand=\"+new  Date().getTime()",editor,"dialogWidth:790px;dialogHeight:500px;help:no;");
    }


    Then to send the image to the editor:

    function PasteHTML( picID )
    {
        var sCode = "<iframe style=\"border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px; width:10px; height:10px;\" src=\"/admin/PicOutput.aspx?picid=|" + picID + "|\" frameborder=\"0\" scrolling=\"no\"></iframe>";
        var editor = window.dialogArguments;
        editor.ExecCommand( "PasteHTML", false, sCode );
        window.close();
    }
     

    Thanks
View as RSS news feed in XML