Announcement

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

#26 Re: User Discussion & Help » Skript Kiddie at work » 2005-04-04 04:14:12

I'd imagine the Iranian address might do that too tongue

Strange target for an attack though.

#27 Re: User Discussion & Help » Limiting content width? » 2005-04-01 11:35:38

The reason I didn't suggest CSS is that anything within the body of the editor window is editable, so users could have deleted the box. The next 'block' up from that is the iframe, which is really what needed re-sizing, though it might need some CSS on the body to stop scrolling.

#28 Re: User Discussion & Help » template toolkit + xinha= problem? » 2005-04-01 11:19:49

In which case what you're trying to do is not feasible as standard. Xinha is a WYSIWYG, so it has to display any code you give it, but it of course doesn't have the functionality of the template engine.

You could try writing a 'code shielding' function as has been suggested for hiding PHP code, but there's no ready-made solution.

Basically what you would do is have some kind of image that is shown when in WYSIWYG view, where the alt tag of the image has the code being hidden. This wouldn't necessarily work for you however, as putting an image inside an input value causes even more problems.

As long as you don't want to edit the template codes (the [% ... %] bits), you could write a script to pull them all out (using a similar regex to the code I gave before) and hide them in a set of hidden inputs which are then put back in when you save the template.

e.g. say you had this code:

<form action="[% component.formpath %]" method="post">
<input type=hidden name=component_id value=[% component.component_id %]>
<input type="submit" />

You would write some code where each template tag is pulled out into an array that gets passed separately from the WYSIWYG contents, so the first tag becomes something like [tag_1], the second becomes [tag_2] and so on and you then have an array where $array[1] has the value "[% component.formpath %]" and $array[2] has the value "[% component.component_id %]"

You can then pass the array either with the form or as a session value and put them back in before saving the template (i.e. you swap bacl [tag_1] for $array[1] etc.)

In other words, there's no easy solution from the info you've given.

#29 Re: User Discussion & Help » template toolkit + xinha= problem? » 2005-04-01 10:54:25

glebushka wrote:

adamp, your offer doesn't solve problem. I can't correctly process on the server side changes like following:
when string

<input type=hidden name=component_id value=[% component.component_id %]>

transformes into

<input type="hidden" value="[%" name="component_id" />

This example is a different problem to your original question though.

If you don't put quotes around values, then browsers will split them off wherever a space occurs. It should be simple enough for your users to put quotes around values and at least that way they're writing correct HTML.

#30 Re: User Discussion & Help » Using a button to assign a class to the editor? » 2005-04-01 09:34:03

Good point, hadn't noticed the bit about adding it in htmlarea.css smile

#31 Re: User Discussion & Help » Using a button to assign a class to the editor? » 2005-04-01 07:42:01

Not sure it does affect it, but you've got a space before the : for background and not on any others.

#32 Re: User Discussion & Help » Limiting content width? » 2005-04-01 04:02:59

I think you'll need to play with the width of the iframe in htmlarea.js making it smaller than the editor width.

#33 Re: User Discussion & Help » template toolkit + xinha= problem? » 2005-04-01 04:00:08

It can't really not process them as it causes problems having HTML 'special' characters as input values. What you'd have to do is change the values within the [% %] tags back again before you save.

I don't know if you use PHP or not, but if you do you could do something like this before saving:

<?php
$text = $_POST['text'];

function addquotes ($matches) {
    
    $fixed_tag = str_replace("&quote;", "\"", $matches[1]);
    
    return $fixed_tag;
    
}

$text = preg_replace_callback("/\[%(.*?)%\]/si", "addquotes", $text);
?>

I haven't tested the above, but it should at the least give you an idea of what to do.

#34 Re: User Discussion & Help » How do I turn off EnterParagraphs plugin » 2005-03-31 16:08:57

I don't handle it at the moment as I haven't used Xinha on any client sites yet. A quick and dirty solution is to style p tags in both your editor and your site to remove the spacing (margin:0) though you then lose the ability to have paragraphs when you do want them.

#35 Re: User Discussion & Help » How do I turn off EnterParagraphs plugin » 2005-03-31 06:42:37

This has been discussed elsewhere, but basically the EnterParagraphs plugin is there to get Firefox working the same way as theIE default - to use paragraphs. In order to stop paragraphs being the default on all browsers, you'd have to write some new RemoveParagraphs plugin that overrides IE's default instead of Firefox's.

There's been discussion however, on how best to handle it for standards and it looks like a solution will be implemented whereby it still uses <p> tags, but adds a css class to remove the line spacing.

None of which is much help to you at the moment sad

#36 Re: User Discussion & Help » some customizing look questions » 2005-03-31 05:17:40

1. You wouldn't change htmlarea.js, you just re-define the toolbar in your my_config.js (if you followed the newbie guide), or other external file by using something along these lines:

var config = new HTMLArea.Config();
config.toolbar = [
  ['fontname', 'space',
   'fontsize', 'space',
   'formatblock', 'space',
   'separator', 'my-hilite', 'separator', 'space', // here's your button
   'bold', 'italic', 'underline', 'space']
];

I believe gogo is working on some sort of skinning system, but he hasn't mentioned much about what it will cover.

2. htmlareas.css in your /xinha folder

#38 Re: User Discussion & Help » insertHTML question » 2005-03-30 17:33:58

Not so sure on using it in that context, but editor.insertHTML() should work (presuming you've declared editor as an HTMLArea somewhere)

#39 Re: User Discussion & Help » Hide stylelist pane » 2005-03-30 10:25:36

The styling of stylist itself could really do with being pulled out of stylist.js and stuck in a .css file or a config.js of some sort.

EDIT: n/m just read up tongue

#40 Re: User Discussion & Help » Newbie Guide » 2005-03-30 03:51:27

No problem, though it's not me that writes Xinha - you have gogo to thank for that wink

#41 Re: User Discussion & Help » Newbie Guide » 2005-03-29 03:36:27

Ah, OK. You need to download the Xinha-nightly package instead of the Xinha-latest one. The functions for importing multuple plugins, etc. at once were added after the last 'stable' release, although the nightly is pretty stable as well.

#42 Re: User Discussion & Help » Newbie Guide » 2005-03-28 18:14:54

The newbie guide explains what the content of my_config.js should be, which includes the xinha_init function. Are you editing section 2 of the my_config.js to include the name(s) of your textarea(s)?:

xinha_editors = xinha_editors ? xinha_editors :
      [
        'myTextArea',
        'anotherOne'
      ];

In the above, each array item should be the ID of each textarea you want to use Xinha. When you then add the onload="xinha_init()" to your body tag, it'll create Xinha editors for each textarea you specified in the xinha_editors array above.

#43 Re: User Discussion & Help » A script on this page is causing Mozilla to run slowly... » 2005-03-28 16:48:54

Cheers, guess I'll have to play with scan.php earlier than planned then smile

#44 Re: User Discussion & Help » A script on this page is causing Mozilla to run slowly... » 2005-03-28 14:19:45

Hmm, there's no reference to full_example.js anywhere in my code.

#46 User Discussion & Help » A script on this page is causing Mozilla to run slowly... » 2005-03-28 13:55:46

adamp
Replies: 8

I'm having trouble with Xinha at the moment where something in the code is running away and eating up all the CPU resources, until I get the message 'A script on this page is causing Mozilla to run slowly....' and would I like to stop it running.

I can't think what's doing it, so has anyone else had this problem?

I'm using Xinha on multiple textareas, by adding this code next to each textarea:

<script language="JavaScript1.2">
xinha_editors[xinha_editors.length] = 'f3content';
</script>

For config, I have the following setup file (comments removed to keep it concise):

    xinha_editors = new Array();
    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 :
      [
       'CharacterMap',
       'FullScreen',
       'Linker',
       'SpellChecker',
       'Stylist',
       'SuperClean'
      ];

             // THIS BIT OF JAVASCRIPT LOADS THE PLUGINS, NO TOUCHING  :)
             if(!HTMLArea.loadPlugins(xinha_plugins, xinha_init)) return;

      var tas = document.getElementsByTagName("textarea");
      
       xinha_config = new HTMLArea.Config();
       xinha_config.stylistLoadStylesheet('/siteadmin/wysiwyg.css');

      xinha_editors   = HTMLArea.makeEditors(xinha_editors, xinha_config, xinha_plugins);

      HTMLArea.startEditors(xinha_editors);
    }

    window.onload = xinha_init;

Any ideas?

#47 Re: User Discussion & Help » Possible to integrate helene into xinha? » 2005-03-28 13:42:40

CyberTron: I sent you an email a while ago, but I guess you didn't get it. Would you be able to put a zip file up of your plugin somewhere? I haven't been able to get it working so far (though I'm having separate problems that may be stopping it).

#48 Re: User Discussion & Help » Newbie Guide » 2005-03-27 19:29:16

If you've followed the newbie guide then you need to change the onload="initEditor()" in the body tag for onload="xinha_init();"

You can then get rid of the old HTMLArea stuff.

#49 Re: User Discussion & Help » why working with RC1 and not RC3 ? » 2005-03-24 07:55:43

Xinha split off as a separate development path from HTMLArea quite a while ago I believe, so trying to pull in changes to HTMLArea wouldn't be feasible with Xinha having made changes of its own.

Basically Xinha has split off and a completely different development path.

#50 Re: User Discussion & Help » NEW! Plugins for xinha » 2005-03-23 09:48:01

It might just be that it's in Italian, but that has me confused smile

I can't find a page using Xinha and it's printing a lot of strange code at the top.

Board footer

Powered by FluxBB