ToFullPage/FromFullPage (F12) does not restore editor position?

Last post 05-09-2007, 12:48 PM by fredd. 9 replies.
Sort Posts: Previous Next
  •  05-02-2007, 1:43 PM 29084

    ToFullPage/FromFullPage (F12) does not restore editor position?

    On our ASP.NET page, we have the editor positioned at left 200px, height 300px, surrounded by our own customized content.   When the user hits the F12 button, the editor correctly then takes up the whole screen and is positioned at top left.   However, when F12 is hit again, our content reappears but the editor is still positioned at top left.   Added the postback="True" parameter to the config file, but this had no effect.   How do we restore the editor's position upon the second 'F12'?  
  •  05-02-2007, 2:16 PM 29086 in reply to 29084

    Re: ToFullPage/FromFullPage (F12) does not restore editor position?

    rpinson,
     
    Please create a simple aspx page showing the problem and send it to me.
     
     

    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-02-2007, 6:37 PM 29102 in reply to 29086

    Re: ToFullPage/FromFullPage (F12) does not restore editor position?

    Adam,
     
    I sent a test page to you at support@cutesoft.net
     
     
  •  05-07-2007, 5:32 PM 29294 in reply to 29102

    Re: ToFullPage/FromFullPage (F12) does not restore editor position?

    Any response to the test page that was sent???
  •  05-07-2007, 8:13 PM 29311 in reply to 29294

    Re: ToFullPage/FromFullPage (F12) does not restore editor position?

    I think this was working OK in V5.3, but not 6.0, so we added code to actually position the DIV container (divEditor) for the Editor, like the following:
     
        if (sCmd=="tofullpage") {
         try {
          document.getElementById("tdMenu").style.visibility="hidden";
          document.getElementById("pnlInfo").style.visibility="hidden";
          document.getElementById("pnlJSMenu").style.visibility="hidden";
          document.getElementById("divEditor").style.left="-97px";
          document.getElementById("divEditor").style.top="-2px";
         }
         catch (error) {
          alert(error.message);
         }
         cuteEditor1.FullPage=true;
         event.returnValue=true;
        }
        if (sCmd=="fromfullpage") {
         try {
          document.getElementById("tdMenu").style.visibility="visible";
          document.getElementById("pnlInfo").style.visibility="visible";
          document.getElementById("pnlJSMenu").style.visibility="visible";
          document.getElementById("divEditor").style.left="8px";
          document.getElementById("divEditor").style.top="92px";     
         }
         catch (error) {
          alert(error.message);
         }     
         cuteEditor1.FullPage=false
         event.returnValue=true;
        }
     
    HTH
    Fred
  •  05-08-2007, 12:39 PM 29363 in reply to 29311

    Re: ToFullPage/FromFullPage (F12) does not restore editor position?

    Thanks, Fred.   I understand the concept, but where exactly does this code go?
  •  05-08-2007, 1:23 PM 29370 in reply to 29363

    Re: ToFullPage/FromFullPage (F12) does not restore editor position?

    In Version 6.0, initialization and other Editor events are handled by adding script at the bottom of the page (in the example below, the code is between </form> and </body>). We've mapped the calls to and from full page into the CuteEditor_OnCommand event as you can see in the below code:
     
     
     </form>
      <script language="JavaScript" type="text/javascript">

      var editor1=document.getElementById('Editor1');
     
      if(editor1.IsReady) {
       CuteEditor_OnInitialized(editor);
      }
      
      function CuteEditor_OnChange(editor)
      { 
       document.getElementById("txtChanged").value="Y";
      }

      function CuteEditor_OnCommand(editor,command,ui,value)
      {
       //handle the command by yourself
       var cuteEditor1 = document.getElementById('Editor1');
       var sCmd = command.toLowerCase();
       try {
        if (sCmd=="tofullpage") {
         try {
          document.getElementById("tdMenu").style.visibility="hidden";
          document.getElementById("pnlInfo").style.visibility="hidden";
          document.getElementById("pnlJSMenu").style.visibility="hidden";
          document.getElementById("divEditor").style.left="-97px";
          document.getElementById("divEditor").style.top="-2px";
         }
         catch (error) {
          alert(error.message);
         }
         cuteEditor1.FullPage=true;
         event.returnValue=true;
        }
        if (sCmd=="fromfullpage") {
         try {
          document.getElementById("tdMenu").style.visibility="visible";
          document.getElementById("pnlInfo").style.visibility="visible";
          document.getElementById("pnlJSMenu").style.visibility="visible";
          document.getElementById("divEditor").style.left="8px";
          document.getElementById("divEditor").style.top="92px";     
         }
         catch (error) {
          alert(error.message);
         }     
         cuteEditor1.FullPage=false
         event.returnValue=true;
        }
       }
       catch (error) {
        alert(error.message);
       }
      }

      function CuteEditor_OnInitialized(editor)
      {
       editor1.ExecCommand=function(cmd,ui,val)
       {
       }
      }
      </script>
     </body>
    </HTML>
     
    Does that make sense to you?
     
    Regards,
    Fred
  •  05-08-2007, 8:07 PM 29393 in reply to 29370

    Re: ToFullPage/FromFullPage (F12) does not restore editor position?

    Perfect, Fredd, thanks very much!
  •  05-08-2007, 11:06 PM 29404 in reply to 29393

    Re: ToFullPage/FromFullPage (F12) does not restore editor position?

    My pleasure.
     
    Fred
  •  05-09-2007, 12:48 PM 29438 in reply to 29404

    Re: ToFullPage/FromFullPage (F12) does not restore editor position?

    Sorry, one more thing:
     
    In my paste, I neglected to include a test:
     
     if (sCmd=="fullpage") {
        if (cuteEditor1.FullPage==true) {
            sCmd="fromfullpage"
        }
            else { sCmd="tofullpage" }
    }
     
    CE returns "FullPage" as the command, so you need to test the current status of FullPage.
     
    You probably already figured that out...
     
    Fred
View as RSS news feed in XML