Announcement

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

#1 2005-12-20 21:53:16

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

new plugin: SaveSubmit or The Advanced Save Button

At first I just wanted to have a plugin so that I don´t have to register a save button  in my config file that submited the form via onsubmit()/submit(). But then i had the idea to post the data asynchronously which turned out to be a much cooler thing because this way the whole editor has not to be constructed again. Then added some feedback message for user confidence and a keyboard shortcut, and now I think it´s gotten a handy one.

http://xinha.python-hosting.com/ticket/628

Offline

#2 2006-03-12 12:24:51

wijnand
Xinha Community Member
Registered: 2005-07-13
Posts: 17

Re: new plugin: SaveSubmit or The Advanced Save Button

Hello Ray. I like this plugin because its fits exactly to my wishes (see your reaction on my post). I installed it, but it dosn't work. The icon appears and changes to red when I change the area, but when I want to save (submit) it, nothing happens. Can you tell me how to embed this in HTML? Now I use:

<FORM NAME="editform" ACTION="/cgi-bin/edit/edit_2.pl">
<TEXTAREA id="PageText" name="PageText" style="width:90%;height:800px" wrap="off">

<input type="submit" value="Opslaan">
</FORM>

What to do with the input tag?

Last edited by wijnand (2006-03-12 12:25:35)

Offline

#3 2006-03-12 17:09:41

wijnand
Xinha Community Member
Registered: 2005-07-13
Posts: 17

Re: new plugin: SaveSubmit or The Advanced Save Button

I changed the first row in:

<FORM METHOD="POST" NAME="editform" ACTION="/cgi-bin/edit/edit_2.pl">

because of the lenght of the data. Its still not working.

Offline

#4 2006-03-13 18:14:27

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

Re: new plugin: SaveSubmit or The Advanced Save Button

Hi,
you don't need the submit button, because the data is submitted without an actual submit, in the background. It takes the url from the action attribute of the form, so you are OK there.  You have to set up your (php/perl-)script that it listens for a POST with the name of the textarea for saving, and it has to print out something when it has received the data. In the moment the plugin waits only to get anything back(it does not account errors), but you could change line 121 to

self.setMessage(getback);

to show what the server says.
Hope you get it to work!

Last edited by ray (2006-03-14 05:16:16)

Offline

#5 2006-03-17 13:40:13

Ecco
Xinha Community Member
From: Netherlands
Registered: 2005-03-08
Posts: 48
Website

Re: new plugin: SaveSubmit or The Advanced Save Button

I can't get this beautiful plugin to work properly either...

Offline

#6 2006-03-19 06:29:39

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

Re: new plugin: SaveSubmit or The Advanced Save Button

I'm sorry. What exactly does not work, maybe we can work it out

Offline

#7 2006-03-19 16:42:26

Ecco
Xinha Community Member
From: Netherlands
Registered: 2005-03-08
Posts: 48
Website

Re: new plugin: SaveSubmit or The Advanced Save Button

My complaint is almost the same. "The icon appears and changes to red when I change the area, but when I want to save (submit) it" I get an error.

Perhaps you could show us an example ?

Offline

#8 2006-03-19 20:14:00

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

Re: new plugin: SaveSubmit or The Advanced Save Button

I'm so sorry! It was really my fault. There was a suffix to the URL that was a remainder of how I use it with serveral GET parameters, but it broke a simple URL. So, please try it again, I have attached an updated version to the ticket: http://xinha.python-hosting.com/ticket/628

Once again a note on the usage:
This should be more or less a drop-in replace for a normal submit button. It takes the action URL from the
HTML form and sends the data from the textarea in a HTTP post with the name of the textarea.

Last edited by ray (2007-01-18 08:54:58)

Offline

#9 2006-03-20 11:04:52

Ecco
Xinha Community Member
From: Netherlands
Registered: 2005-03-08
Posts: 48
Website

Re: new plugin: SaveSubmit or The Advanced Save Button

Unfortunately, I get the same results, with version 2 as well as version 3. The "light" of your button changes from green to red as soon as I type something, but I get an error when I press it.

This is my form. BTW I get the same results when I use method=get.

<FORM name="FORM1" id="FORM1" method="post" action="savesubmit.php">

<textarea id="myTextArea" name="myTextArea" rows="5" cols="55" style="border:1px #cccccc solid;width:800px;height:350px;"></textarea>

</form>

Offline

#10 2006-03-20 11:43:25

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

Re: new plugin: SaveSubmit or The Advanced Save Button

Have a look at this:http://raimundmeyer.de/xinha/examples/testbed.html

In this example the savesubmit.php is located in the same folder like the testbed.html and it's simply
<?php
print_r($_POST);
?>
for demonstration purposes.

The problem is not your form I have tested this.
What kind of error do you get? Does it work with a "real" submit button? Is the URL of the action right?

Last edited by ray (2006-03-20 12:00:41)

Offline

#11 2006-03-20 12:22:21

Ecco
Xinha Community Member
From: Netherlands
Registered: 2005-03-08
Posts: 48
Website

Re: new plugin: SaveSubmit or The Advanced Save Button

Hi Ray,

your example works fine for me. My page works fine when I press the submit-button.

Translated, with Internet Explorer I get

Line: 165
Character: 7
This method is not supported by this object.
Code: 0

In Mozilla, I get "transferring data..." and that's it. But Xinha still works.

Offline

#12 2006-03-20 14:09:45

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

Re: new plugin: SaveSubmit or The Advanced Save Button

Well, I have to admit I'm a little clueless what this is supposed to mean. there is nothing in line 165 that looks like it could break it.
Maybe I can have a look at your page?
I'm very unhappy that this is causing such trouble, and also curious what's going on.

Offline

#13 2006-03-20 15:00:12

Ecco
Xinha Community Member
From: Netherlands
Registered: 2005-03-08
Posts: 48
Website

Re: new plugin: SaveSubmit or The Advanced Save Button

I appreciate the attention you give this, Ray. Many thanks.

To make it more curious: I have copied your source to
http://www.400bis.nl/savesubmit.html

Still won't work sad

The contents of my savesubmit.php is

<?php
print_r($_POST);
echo "done";
?>

Offline

#14 2006-03-20 16:01:47

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

Re: new plugin: SaveSubmit or The Advanced Save Button

OK, got it!
I knew it had to have something to do with a differing htmlarea.js. The thing I didn't have in mind is that I'm using the code of the loading message which existed already some time as a patch. And this patch has introduced some new functions, that weren't there in your version!
So it meets well that the patch has just become official. You jast can update your version, rev  421 is abit datet anyway

Offline

#15 2006-03-21 03:10:27

Ecco
Xinha Community Member
From: Netherlands
Registered: 2005-03-08
Posts: 48
Website

Re: new plugin: SaveSubmit or The Advanced Save Button

Hey, I upgraded Xinha and it works ! Thanks Ray. I really like this plugin.

Offline

#16 2006-05-14 04:25:10

Ecco
Xinha Community Member
From: Netherlands
Registered: 2005-03-08
Posts: 48
Website

Re: new plugin: SaveSubmit or The Advanced Save Button

The plugin works fine with multiple Xinha-textareas, but there's one small flaw. The "saving..."-message appears above the first textarea when you press the savesubmit-button on one of the others.

Offline

#17 2006-06-05 00:45:28

gorillapop
New member
Registered: 2006-06-05
Posts: 1

Re: new plugin: SaveSubmit or The Advanced Save Button

I just downloaded Xinha and SaveSubmit a few hours ago.

I am getting "An error has occurred: Not Found" when I click on the "Save" icon.

Does this mean it can't find the page I am submitting to? (I am supplying the full url) Or is there something else it isn't finding?

Thanks,

L

Offline

#18 2006-06-13 03:39:45

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

Re: new plugin: SaveSubmit or The Advanced Save Button

Yes, you are right. If you submit a link to the installation I can have a look at it

Offline

#19 2006-11-21 16:30:29

alexkir
New member
Registered: 2006-11-21
Posts: 4

Re: new plugin: SaveSubmit or The Advanced Save Button

Please, take a look at this ticket:
http://xinha.python-hosting.com/ticket/882

Offline

#20 2006-11-22 13:48:42

alexkir
New member
Registered: 2006-11-21
Posts: 4

Re: new plugin: SaveSubmit or The Advanced Save Button

OK, with some server-side decodings it works perfectly well.
The plugin is beautiful, so here is my little contribution:

http://pro.kiwistudio.ru/xinha/plugins/ … lang/ru.js

It's the Russian translation, as you can see.

Thanks again for the plugin.

Offline

#21 2006-11-23 06:38:03

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

Re: new plugin: SaveSubmit or The Advanced Save Button

Alexey, thank you for your contribution big_smile

Offline

#22 2007-01-18 07:29:09

Kezern
New member
Registered: 2007-01-18
Posts: 3

Re: new plugin: SaveSubmit or The Advanced Save Button

I'm not sure what does this plugin do. Does it saves the content into a file? In that case... In which file does it save?
I have the button got red when I write something and when I press the button, it says "saving" but nothing else happends.

Offline

#23 2007-01-18 09:58:50

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

Re: new plugin: SaveSubmit or The Advanced Save Button

It's really simple: It does not more than what  would happen with an HTML submit button. The data of the form is sent to the URL defined in the action attribute of the form. Any further action is up to the server-side script.

Offline

#24 2007-10-17 15:01:56

kroesss
Xinha Community Member
Registered: 2007-10-15
Posts: 16

Re: new plugin: SaveSubmit or The Advanced Save Button

Sorry to rake up an old post...

I've used FCKEditor up till now, and therefore I'm used to the save-button doing nothing more than submitting the form. Ive replaced fck with xinha to test it now, and it does show me the page I'm supposed to be redirected to very shortly, and it does process the form, but then it remains on the editor-page.

Is there anything I can do to change this behaviour? I would like it to submit the form to the action-url, nothing more. Of couse I could put in a submit-button, but that kinda kills the "MS Word-feeling"...

Offline

#25 2007-10-17 19:19:12

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

Re: new plugin: SaveSubmit or The Advanced Save Button

I could add a switch to the plugin, if you really ask me for, though  I'd rather suggest you to simply add a button to the toolbar using the code below

// create the button
// parameters: id, tooltip ,image url, whether button should be enabled in text mode, the function to call on button click
xinha_config.registerButton("save", "Save", _editor_url + "images/ed_save.gif", true, function(editor) {editor._textArea.form.submit()});

// add the button to the toolbar
// parameters: id (the one given above), next to which button, before|replace|after (-1,0,1)
xinha_config.addToolbarElement("save", "popupeditor", -1);

Offline

Board footer

Powered by FluxBB