Hi there, I have replaced the Preview option on the toolbar with a serverPreview option, to allow me to show a customised preview page. I want to retain the preview icon on the toolbar but I can't seem to do this, or find the code specifying the background images for the toolbar options. Does anyone know how to do this?
      Mon, 03/10/2008 - 10:37
                
  
    
        
    #1
  
Re: Toolbar background-images
the serverPreview plugin already uses the default preview icon.
Re: Toolbar background-images
Re: Toolbar background-images
I'll try to check exactly what where the changes done, verify that it works with the current release and I'll update the download one of these days.
meanwhile, this is the code:
//This is the function that creates a temporary form, gets the data and sends it to the server FCKPreviewCommand.prototype.Execute = function() { //get the form to submit the data (a custom one, not the real) var theForm = document.getElementById('serverPreviewForm') ; if (!theForm) { //it doesn't exist still, we create it here theForm = document.createElement('FORM') ; theForm.method = 'POST' ; theForm.name = 'serverPreviewForm' ; theForm.id=theForm.name ; theForm.style.display = 'none' ; //this sets the default page where the data will be posted. //change as needed --> //path is relative to the editor, so append for this example the current path theForm.action = FCKPlugins.Items['serverPreview'].Path + 'preview.asp' ; //we can override that path for each user with a custom setting in FCKConfig // example: FCKConfig.ServerPreviewPath = 'customPreview.asp?Id=3' ; if (typeof(FCKConfig.ServerPreviewPath) == 'string') theForm.action = FCKConfig.ServerPreviewPath; //new window please theForm.target='_blank'; document.body.appendChild( theForm ); } //clear previous data theForm.innerHTML = '' ; //set the new content var input = document.createElement('INPUT') ; input.type = 'hidden'; //change the name as needed --> input.name = 'htmlData' ; //set the data input.value = FCK.GetXHTML() ; //append the new input to the form theForm.appendChild( input ); //that's all, append additional fields as needed, or set the variables in the previewPath //send the data to the server theForm.submit(); }