You are not logged in.
I'd imagine the Iranian address might do that too ![]()
Strange target for an attack though.
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.
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.
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.
Good point, hadn't noticed the bit about adding it in htmlarea.css ![]()
Not sure it does affect it, but you've got a space before the : for background and not on any others.
I think you'll need to play with the width of the iframe in htmlarea.js making it smaller than the editor width.
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(""e;", "\"", $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.
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.
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 ![]()
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
Looks good again ![]()
Not so sure on using it in that context, but editor.insertHTML() should work (presuming you've declared editor as an HTMLArea somewhere)
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 ![]()
No problem, though it's not me that writes Xinha - you have gogo to thank for that ![]()
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.
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.
Cheers, guess I'll have to play with scan.php earlier than planned then ![]()
Hmm, there's no reference to full_example.js anywhere in my code.
Cheers ![]()
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?
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).
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.
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.
It might just be that it's in Italian, but that has me confused ![]()
I can't find a page using Xinha and it's printing a lot of strange code at the top.