Announcement

Do not use the forums to submit bug reports, feature requests or patches, submit a New Ticket instead.

#1 2006-03-13 11:35:17

Fooneen
New member
Registered: 2006-03-13
Posts: 4

Problem with complete HTML page

Im currently using xinha in a website im developing and have a problem with it. Its a CMS which uses xinha to edit certain fields and then store them in a database. The problem is that on the most pages I want xinha to just use plain html with no <html><head><style><body> tags. This because the stuff thats in these fields get displayed in a page which already has a html markup. This works fine atm and isnt the problem.

The problem is with the fact that I have 1 page in which the user can create a new file which he can edit in xinha and then link via the menu to be accessible to all the viewers of the website. But now the <html> and so on tags need to be in place for the page to work correctly. I tried putting them into the code and wrapping them around the xinha html code but when the user edits the file xinha automatically deletes these tags from the file.

What I wanted to know is if theres a way to deactivate this behavior so that I can use the <html><body><head><style> tags whenever I want.

I tried to disable the functions in the code (setFullHtml and some of the cached regexps) but this didnt work, the editor still deleted the tags.

Offline

#2 2006-03-13 18:20:50

ray
Xinha Administrator
From: Germany
Registered: 2005-03-23
Posts: 521
Website

Re: Problem with complete HTML page

There´s a config variable for that (Config.fullPage=true)

Offline

#3 2006-03-13 23:09:07

mharrisonline
Xinha Administrator
From: Denver, Colorado
Registered: 2005-04-11
Posts: 110
Website

Re: Problem with complete HTML page

You can also use the full page plugin. I don't, because it gives users an easy way to change the background color, etc.. I prefer to use the config.

Offline

#4 2006-03-15 04:37:38

Fooneen
New member
Registered: 2006-03-13
Posts: 4

Re: Problem with complete HTML page

I tried the fullpage variable and it works well, the only problem is that I use xinha in multiple pages and only have one page where fullpage needs to be turned on. Now i wondered if it was possible to edit some of the code I include in the document so that fullpage gets turned on when this page is loaded, and only in this one. I think its the part where you define the names of the textareas where you want xinha to be loaded in, but I dont know what to change to make this work. Code:

<script type="text/javascript">
  xinha_editors = null;
  xinha_init    = null;
  xinha_config  = null;
  xinha_plugins = null;
   
  // This contains the names of textareas we will make into Xinha editors
  xinha_init = xinha_init ? xinha_init : function()
  {
    xinha_plugins = xinha_plugins ? xinha_plugins :
    [   
      'DynamicCSS'
    ];
 
  // THIS BIT OF JAVASCRIPT LOADS THE PLUGINS, NO TOUCHING  smile
  if(!HTMLArea.loadPlugins(xinha_plugins, xinha_init)) return;
   
  xinha_editors = xinha_editors ? xinha_editors :
  [
    'XinhaItem'
  ];
   
  xinha_config = xinha_config ? xinha_config() : new HTMLArea.Config();
  xinha_config.pageStyle = "@import url(STYLESHEETVARIABLE);";
  xinha_editors   = HTMLArea.makeEditors(xinha_editors, xinha_config, xinha_plugins);
   
  HTMLArea.startEditors(xinha_editors);
  }
 
  window.onload = xinha_init;
</script>

Offline

#5 2006-03-18 06:35:49

mharrisonline
Xinha Administrator
From: Denver, Colorado
Registered: 2005-04-11
Posts: 110
Website

Re: Problem with complete HTML page

I think you are on track to the best way to do this, but here is another way you could make this work.

On the page that needs to be full page, use the the FullPage plugin.

If you don't want to allow the FullPage plugin the appear on the toolbar, you can make that happen by commenting out lines 22 - 28 in the plugin's full-page.js file:


function FullPage(editor) {
    this.editor = editor;

    var cfg = editor.config;
    cfg.fullPage = true;
    var self = this;

//    cfg.registerButton("FP-docprop", this._lc("Document properties"), editor.imgURL("docprop.gif", "FullPage"), false,
//               function(editor, id) {
//                   self.buttonPress(editor, id);
//               });

    // add a new line in the toolbar
//    cfg.addToolbarElement(["separator","FP-docprop"],"separator",-1);
}

I just tried this, and it does exactly what you want.

Last edited by mharrisonline (2006-03-18 06:36:48)

Offline

Board footer

Powered by FluxBB