You are not logged in.
Use absolute URLs.
As per the HTML specification, the contents of a textarea (and thus, xinha area) are Parsed Character Data. All HTML tags are forbidden to occur in a textarea. You must ENTIZE (ie convert special characters to thier relevant entities (ampersand codes)) all data you place into a textarea, including HTML which will be edited with Xinha.
you need a
xinha_editors.yourEditor.activateEditor()
I'm guessing ?
Good job hyper! Looks like it would be a really useful extention. I think the posters over at fark would really like that.
My feeling is that it is a gecko bug, or actualy it could be a side-effect of EnterParagraphs plugin (usually loaded automatically in Xinha when running on Gecko).
If you submit a bug report about this, I will look more closely and see about cleaning it up client-side.
It's the way Gecko does it. Just clean it up server side.
I see. No. Not currently, that is not possible. Patches are welcome though, seems like a good idea.
You're probably missing FullScreen and EnterParagraphs.
GetHtml provides a speedier means of taking the HTML from Xinha and putting it back into your editor before you submit the form or switch to "source" mode. The built in method works by traversing the DOM of the html being edited, which is a fairly slow operation, but easy to read/understand, maintain and modify, while GetHtml works with a bunch of regular expressions and such, which is fast, but more difficult to code.
I think it's simply people don't understand the question. Try re-explaining it.
In xinha_init, comment out the startEditors line.
Then to start the individual editors, after running xinha_init, you can do
xinha_editors.yourEditorIdHere.generate();for each one.
Plugins are welcome :-)
That said. Why are you using Xinha to edit text that cannot contain HTML, that's pretty crazy.
Cannot be done. Not without you modifying the ImageManager to do it.
activateEditor just switches on the designMode functions.
There is no reason you can't initialize your xinha editors one at a time as and when they are first displayed, you'll have to learn some Javascript to do it though. Just read through the initialization code in the newbie guide and go from there.
I don't know of any way of trapping visible/invisible events in the DOM.
Random: are you doing activateEditor and deactivateEditor at the appropriate times? You must deactivate before changing the visibility and activate after restoring (or if you just leave it deactiveated it will activate when you click in it).
The CSS directive text-transform is what you should use
http://www.w3schools.com/css/pr_text_text-transform.asp
in conjunction with Stylist/CSS/DynamicCSS plugins this should do what you want.
No, you would have to initialize it on first display. This is due to a bug in either gecko or IE, I forget which, which means that getting sizes and such is not possible when elements are set to display:none (well, not strictly a bug, because if it's display:none then it has no size!).
No reason you can't initialize your editor(s) on first display instead of onload though - but it's left as an excercise in javascript for you :-)
Your URL works fine for me in Firefox 1.0.6.
should the xinha directory be w/in your httpdocs folder
Inside, the browser loads files from it.
If you can post a URL to your install we can have a look.
When I am developing in PHP, I do it in my own framework. The first thing my framework does, on every request, is clean_magic_quotes(). Reason is simple, I don't want PHP silently ("magically") changing my data by adding slashes to it, or you get into situations like these where you don't know what is escaped and whats not and wether you need to strip or add or ....
This is just one of the reasons that magic_quotes_gpc is probably going to be removed for PHP 6 :-)
Did you turn off warnings?
I don't remember writing in a specific minimum (and a quick search of the code reveals nothing), but there will be a practical minimum, particularly a minimum width dictated by the toolbar, height not so much. I doubt you'd get it much smaller than 100x100, that's pretty small right there.
You could try leaving height & width to the defaults ('auto') and setting the size on the textarea
<textarea style="width:100px;height:100px"></textarea>Ok, some PHP 101, this code (incomplete of course) shows how one might handle modifying a record of a database table..
<?php
// ... connect to database etc ...
// First, get rid of magic quotes if they were added in, magic quotes are evil
if(get_magic_quotes_gpc())
{
foreach(array_keys($_REQUEST) as $k)
{
if(!is_scalar($_REQUEST[$k])) continue;
$_REQUEST[$k] = stripslashes($_REQUEST[$k]);
}
}
// Now was the form submitted?
if(isset($_REQUEST['Submit']))
{
// Yes, lets update the data
mysql_query("UPDATE Blah SET FOO = '" . mysql_real_escape_string($_REQUEST['FOO'])
. "' WHERE BlahID = " . ((int) $_REQUEST['BlahID']));
}
// We presume we were given BlahID on the request, lets get the value
$q = mysql_query("SELECT FOO From Blah where BlahID = " . ((int) $_REQUEST['BlahID']));
$r = mysql_fetch_assoc($q);
$FOO = $r['FOO'];
// Lets display a form, if FOO was submitted already, lets put that in the value for example sake
?>
<form action="<?php echo $PHP_SELF ?>" method="post">
<input type="hidden" name="BlahID" value="<?php echo htmlspecialchars($_REQUEST['BlahID']) ?>" />
<textarea name="FOO"><?php echo htmlspecialchars($FOO) ?></textarea>
<input type="submit" name="Submit" value="Submit" />
</form>See how we stripslashes from the request variables if magic quotes has been turned on (the procedure above is just a trivial example, you should use a better one because REQUEST could contain arrays of values of course), we escape the string value being put into the SQL, and we cast the BlahID to an int to be sure that we don't put in anything nasty from the user. Then when writing out the form we use htmlspecialchars to "escape" the special characters both for the value="" attribute and inside the textarea, which are both #PCDATA (see HTML specification).
Here is a better function for cleaning up after magic quotes does it's dirty business...
function clean_magic_quotes()
{
set_magic_quotes_runtime(0);
if(get_magic_quotes_gpc())
{
// trigger_error('Magic Quotes GPC is on, cleaning GPC.', E_USER_NOTICE);
$to_clean = array(&$_GET, &$_POST, &$_REQUEST, &$_COOKIE);
while(count($to_clean))
{
$cleaning =& $to_clean[array_pop($junk = array_keys($to_clean))];
unset($to_clean[array_pop($junk = array_keys($to_clean))]);
foreach(array_keys($cleaning) as $k)
{
if(is_array($cleaning[$k]))
{
$to_clean[] =& $cleaning[$k];
}
else
{
$cleaning[$k] = stripslashes($cleaning[$k]);
}
}
}
}
}Hi all, a little treat for you this week...
Opera (http://www.opera.com/) has recently (well, a month ago) released a preview of Version 9 of thier browser. In this version they now have an API for HTML editing. Mostly it works just like Gecko ("designMode" style).
I've made some preliminary modifications to Xinha to get it to "boot up" in Opera. If you're interested in playing around with it, or better, helping making it work better in Opera, you can checkout the "opera" branch from the subversion repository, and just hit examples/full_example.html like normal.
It actually works impressivly well for only a couple of modifications, there's lots of bugs for sure, but it is basically working.
Oh yea, for now I'd have Opera identify as Mozilla.
You can download the Version 9 preview of Opera with support for this at http://snapshot.opera.com/
If you are escaping, and still have magic_quotes on, then you're going to be double escaping. Sounds also like you might not be using htmlspecialchars()/htmlentities() in the appropriate places.