Editor.Setting.GetHashString()

Last post 06-21-2009, 1:59 AM by maowidat. 15 replies.
Sort Posts: Previous Next
  •  05-25-2007, 3:45 AM 30098

    Editor.Setting.GetHashString()

    Hi,
     
    I am using Editor.Setting.GetHashString() from codebehind in version 5.3
    When I try to upgrade to version 6 I get an error when compiling: 'System.Collections.Specialized.NameValueCollection' does not contain a definition for 'GetHashString'
     
    I tried to find GetHashString in the online documentation but filed, how do I access the HashString programatically in version 6?
     
    / Jon  
  •  05-25-2007, 5:07 AM 30100 in reply to 30098

    Re: Editor.Setting.GetHashString()

  •  05-28-2007, 1:24 AM 30144 in reply to 30100

    Re: Editor.Setting.GetHashString()

    I use it to open an InsertFile popup. I create the javascript from code-behind and run on the page. Since it needs a valid hash I have to retrive it. I cannot do it on the clientSide in this case.
     
    / Jon
  •  05-28-2007, 1:35 PM 30162 in reply to 30144

    Re: Editor.Setting.GetHashString()

    Jon,
     
    Please check 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.

    This example uses editor.ShowDialog API to open a dialog. It automatically contains the editor setting string.
     
    For example:
     
     <script language="JavaScript" type="text/javascript" >
       function ShowMyDialog(button)
       {
        //use CuteEditor_GetEditor(elementinsidetheEditor) to get the cute editor instance
        var editor=CuteEditor_GetEditor(button);
        //show the dialog page , and pass the editor as newwin.dialogArguments
        //(handler,url,args,feature)
        var newwin=editor.ShowDialog(null,"My_Custom_Text.html,editor,"dialogWidth:400px;dialogHeight:240px");
       }
      </script>
     
    The source code of this example is included in the downloadf package.
     
     

    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

  •  05-29-2007, 8:24 AM 30183 in reply to 30162

    Re: Editor.Setting.GetHashString()

    Its not a custom dialog I want to show but the editors InsertFile dialog. But maybe it is done the same way?
    What I do in 5.3 is that I store the Hash in a variable that I use later on to open the popup. But Maybe I dont need that string in version 6?
  •  05-29-2007, 10:22 AM 30184 in reply to 30183

    Re: Editor.Setting.GetHashString()

    jon_gyllen,
     
    Have you checked the following example?
     
    asp.net file picker?

    How to use CuteEditor as a file picker?( Demo)

    This example demonstrates how to use CuteEditor as a file picker.

     
     

    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

  •  05-30-2007, 2:58 AM 30215 in reply to 30184

    Re: Editor.Setting.GetHashString()

    Yes I have.
    I know how to do this on the client side, all I want to know is: do I have to rewrite my application in the way it handles theese popups because the behaviour of the dialogs and hashsettings are changed? I guess so since the old way I did it stopped working in 6.0
     
    Sure I can use the new way but then I will have to edit my application in 20 places instead of one if I can solve it in a similar way.
     
    / Jon
  •  05-30-2007, 6:04 PM 30255 in reply to 30215

    Re: Editor.Setting.GetHashString()

    >>I guess so since the old way I did it stopped working in 6.0
     
    Yes. Try the following method to get the setting string:
    CEU.CombineEditorSetting("en-us",Editor1.SecurityPolicyFile,Editor1.Setting)
     
     

    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

  •  05-31-2007, 3:46 AM 30262 in reply to 30255

    Re: Editor.Setting.GetHashString()

    Thanks for the answer.
     
    But I now realize that since the way you open dialogs with javascript has changed (to the better) I guess I will have to modify my clientscripts instead.
     
    I will poke around in my scripts a bit :)
    / Jon
  •  11-02-2007, 1:51 AM 34781 in reply to 30162

    Re: Editor.Setting.GetHashString()

    1 i use your example already,but the alertform's status=yes.how can alertform's status=no
    2 the alertform's <title>title----网页对话框</title> .hou can like this<title>title</title>
    1我用这种方法,弹出窗口的状态栏总是出现,如何可以实现弹出窗口的状态栏隐藏
    2如何能让窗口的标题不显示“----网页对话框”
    my email:wlb.wlb@163.com

  •  11-15-2007, 8:42 AM 35099 in reply to 34781

    Re: Editor.Setting.GetHashString()

    Wlb,
     
    Open CuteSoft_Client\CuteEditor\Dialogs\InsertEmotion.htm.
     
    Change the following code:
     

      <title>[[InsertEmotion]] &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
       &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
       &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
       &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
       &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
       &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
       &nbsp; </title>
     
     
    to:
     
     

      <title>[[InsertEmotion]] </title>
     
    Do the same thing for other dialogs.

    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

  •  06-15-2009, 5:54 AM 53147 in reply to 30184

    Re: Editor.Setting.GetHashString()

    Hi Adam,
     
    I have the same problem with the "Editor.Setting.GetHashString()" and I had a look on the Demo but I cant see the .aspx design tags .....
    I tryed to copy the javascript function but I have some javascript error
    "I think its related to my previous issue ( the solution was to make UseStandardDaialog=true)"
     
    I'm using it as follow:

         <td colspan="3">
          <asp:textbox id="txtURL" runat="server" CssClass="TextBox" Width="90%"></asp:textbox>
          <input type="button" value="..." onclick="OpenAddFileDlg();" class="HButtonS">
         </td>

    .
    .
    .
    .
    .
    .

         <td colspan="4" style="VISIBILITY: hidden">
          <CE:EDITOR id="Editor1" runat="server" Height="72px" CssClass="TestEditorCSS" Width="24px"
           ShowPreviewMode="False" ShowHtmlMode="False" ShowGroupMenuImage="False" ShowBottomBar="False"
           ShowToolBar="False" RenderRichDropDown="False">
          </CE:EDITOR>
         </td>


    .
    .
    .
    .
    .
    .


      <script language="javascript">
    <!--
      function OpenAddFileDlg()
      {
       ctrl = document.getElementById("txtURL");
       var url= showModalDialog("../../CuteSoft_Client/CuteEditor/Dialogs/SelectFile.aspx?settinghash=<%=Editor1.Setting.GetHashString()%>", ctrl,"dialogWidth:560px;dialogHeight:550px");
       if(url)
       {
        ctrl.value = url;
       }
      }
      
    //-->
      </script>

  •  06-16-2009, 1:41 PM 53181 in reply to 53147

    Re: Editor.Setting.GetHashString()

    This is a very old thread.
     
    Are you using version 6.4?
     
    Can you try the following example?
     
    We offer the API to open the modal dialog in version 6.x.
     
    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

  •  06-18-2009, 6:28 AM 53255 in reply to 53181

    Re: Editor.Setting.GetHashString()

    Hi Adam,
     
    Yes I know its an old thread I'm upgreading from 5.3 to 6.4 and I want to use InsertImage dialog to retreve an Image and save the path of the image in my db.
     
    I checked example demonstrates how to use CuteEditor as an image selector, It works fine but I need to save the image path from the textbox without the server link I tryed to disable that in the editor properities but no use because in th javascript you are filling the textbox text from the image src and in the img.src the full path i written so I have to reach the url from the <img> tag dialog..
     

    <asp:TextBox id="txtURL"  CssClass="TextBox" Width="90%" runat="server" />
    <INPUT type="button" value="Change Image" onclick="callInsertImage()" id="Change" runat="server" NAME="Change">
    <CE:Editor id="Editor1" runat="server" Width="400" Height="300" AutoConfigure="None" ShowPreviewMode="False" EnableContextMenu="false" BackColor="White" BorderColor="White" UseStandardDialog="True" RemoveServerNamesFromUrl="false" UseRelativeLinks="false" URLType="Absolute"></CE:Editor><br> 
     
    .
    .
    .
    .
    .
     
    <script language="javascript">
    <!--
    if (document.getElementById("hdnSave").value == "1")
    AddNewGallery(); 
        function callInsertImage()  
        {  
    var editor1 = document.getElementById('<%=Editor1.ClientID%>');
            editor1.FocusDocument();  
            var editdoc = editor1.GetDocument();  
            editor1.ExecCommand('new');
            editor1.ExecCommand('InsertImage');
            InputURL();
        }    
        
        function InputURL()
        { 
    var editor1 = document.getElementById('<%=Editor1.ClientID%>');
            var editdoc = editor1.GetDocument(); 
             
            var imgs = editdoc.images;
            if(imgs.length>0)  
            { document.getElementById("txtURL").value = imgs[imgs.length-1].src;
    document.getElementById("txtURL").focus(); 
            }  
            else
            {
    setTimeout(InputURL,500); 
            }  
        }       
    </script> 
     
     
  •  06-18-2009, 2:03 PM 53271 in reply to 53255

    Re: Editor.Setting.GetHashString()

    Editor.URLType Property

    Specifies whether the URL should be converted to a site root relative path (/html/images/image1.gif) or an absolute path (http://www.mysite.com/images/image1.gif).

     
    For version 6.4, please use the above property.

    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

  •  06-21-2009, 1:59 AM 53325 in reply to 53271

    Re: Editor.Setting.GetHashString()

    I changed the value of the  URLType  to relative path but still I'm getting the full path in the text box,
    I used the same script in the (use-CuteEditor-as-image-selector.aspx ) from the How To file in the  documatation and I added the URLType property and also I try to add it in the .cs code (Editor1.URLType  = CuteEditor.URLType.SiteRelative;) but still I'm getting the full path.
    I think as I told you the problem is in the java script it self in the InputURL() function, I have to change the script so I can reach the URL property insted of calling the src image property :
    function InputURL()
        { 
    var editor1 = document.getElementById('<%=Editor1.ClientID%>');
            var editdoc = editor1.GetDocument(); 
             
            var imgs = editdoc.images;
            if(imgs.length>0)  
            { document.getElementById("txtURL").value = imgs[imgs.length-1].src;
    document.getElementById("txtURL").focus(); 
            }  
            else
            {
    setTimeout(InputURL,500); 
            }  
        }  
View as RSS news feed in XML