Editor1_Init problem

Last post 07-30-2007, 4:43 PM by DesktopGuy. 0 replies.
Sort Posts: Previous Next
  •  07-30-2007, 4:43 PM 32017

    Editor1_Init problem

    I have penetrated the deepest levels of this controls API and I am stumped.

    What I want to work, works on a local server but not one on the net.

    In short, I want the Absolute path.

    I am not using the Editor for a website but for a database.  Content gets created and stuffed in a database.

    Client applications on the net open a browser popup and the html is fetched and inserted for rendering.

    All works well if I manually edit the html for images by typing the domain, but I want to use the Popup Gallery tool naturally which works fine below when inserting except for images.  All resources are in the default "/uploads" folder.

    So, I decided to force CuteEditor to accept my domain appendage with some coding and it works, but ONLY for insertions of .wav files, .swf files and .mpegs and NOT jpegs or gifs.  Bizarre.  Here is the code:


    =========================================================
    CODE BLOCK - Editor1_Init(object sender, System.EventArgs e)
    =========================================================
    public void Editor1_Init(object sender, System.EventArgs e)
            {   
                if (Editor1.Text == "")
                {
                    return;
                }
               
                string body = Editor1.Text;

                int idx = body.IndexOf("mydomain");
               
                if (idx == -1)
                {
                    NewAlert.writeEventLog("Editor1_Render IDX",idx.ToString(), EventLogEntryType.Information);
                    NewAlert.writeEventLog("Editor1_Render Start",body, EventLogEntryType.Information);
                    body = body.Replace( "/uploads/", "http://www.mydomain.com/uploads/");
               
                   
                    this.Editor1.Text = body;
                   
                    NewAlert.writeEventLog("Editor1_Render Complete",body, EventLogEntryType.Information);
               
                }
            }
    =========================================================
    CODE BLOCK END - Editor1_Init(object sender, System.EventArgs e)
    =========================================================



    So here is the code before it enters INIT:


    <p><img height="159" alt="" src="http://cutesoft.net/uploads/FreeTrial.jpg" width="222" border="0" /></p>

    and here it is afterwards in my event log: (CuteEditor however returns from the post as if nothing was ever edited)

     <p><img height="159" alt="" src="http://www.mydomain.com/uploads/FreeTrial.jpg" width="222" border="0" /></p>

    Now here is where it gets down right spooky.

    If above was say, a .wav file like:

    <object codebase="http://activex.microsoft.com/activex/ controls/mplayer/en/nsmp2inf.cab#Version=6,0,02,902" type="application/x-oleobject" height="200" standby="Loading Microsoft Windows Media Player components..." width="240" classid="CLSID:22D6F312-B0F6-11D0-94AB-0080C74C7E95">
    <param name="FileName" value="http://www.mydomain.com/uploads/alert.wav"   /><param name="autoStart" value="1"   /><param name="showControls" value="1"   /><embed name="MediaPlayer1" src="http://cutesoft.net/uploads/alert.wav" autostart="1" showcontrols="1" width="240" height="200" type="application/x-mplayer2" pluginspage="http://www.microsoft.com/Windows/MediaPlayer"   ></embed>
    </object>



    The change is made and when my client applications open, the sound file is played and the above green text is stored in the DB fine.


    BUT


    If I passed


    (^spaces after src= here on purpose because Cute thinks its actually)
    (Cute Editor  and adds its domain to this post!  lol)


    <p><img height="159" alt="" src="space_here_not_actual/uploads/FreeTrial.jpg" width="222" border="0" /></p>

    to the event, and even though my custom event procedure captures:

    Event Source: Editor1_Render Complete
    Event Error: <p><img height="159" alt="" src="http://www.mydomain.com/uploads/FreeTrial.jpg" width="222" border="0" /></p>

    which proves the change was made, CuteEditor





                                                                         

    returns





    (^spaces after src= below on purpose because Cute thinks its actually)
     (Cute Editor  and adds its domain to this post!  lol)



    <p><img height="159" alt="" src="
    space_here_not_actual/uploads/FreeTrial.jpg" width="222" border="0" /></p>

    This behavior only occurs with images.  HELLLLLLLLLLLLLLLLLLLLLLLLLLLPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPP

    Of course, if I could get an absolute rendering of a full domain url using Cutes Absolute setting (which I can actually on a local test server) none of this would be necessary.

    Yes I have the July 27th build.
    Yes I have flipped about a million booleans in the property settings
    I have about 10 hours on this.

    The major stump is that the anomile only seems to happen with images.  Yikes.












































View as RSS news feed in XML