Sponsored Content
Top Forums Web Development TODO: Add Javascript for Reply and New Post Autosave Post 303028908 by Neo on Friday 18th of January 2019 12:21:53 AM
Old 01-18-2019
TODO: Add Javascript for Reply and New Post Autosave

TODO:

Add a some javascript to:
  • Autosave to browser localstorage when a member is creating a new post or replying to a thread (rewriting any prior text in autosave).
  • Create a button on the editor to load the text stored in the autosave function.

Difficulty:
  • Easy.

Estimated Time to Complete and Test:
  • 30 minutes to one hour, including testing.
 

7 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

if this post is easy to read so is to reply !!!

i have a html file with uploads a file and sends the username to a .cgi file using post method. the part of code in the cgi file is as below. i am able to get the filename but not able to get the username thats getting posted to the file how to know the value of username. i am trying to store... (2 Replies)
Discussion started by: sasidhdv
2 Replies

2. Forum Support Area for Unregistered Users & Account Problems

Cann't post reply or create new threads

Hi Admin I got the error message as follows when I reply or create new thread. To reply to threads in this forum your post count must be 10 or greater. You currently have 9 posts. Is there any problems with my account? How I can reach the 10 replies? I cann't post any replies now. ... (1 Reply)
Discussion started by: ambious
1 Replies

3. Forum Support Area for Unregistered Users & Account Problems

I cannot post new thread and reply after register

Hi, Admin, I have met a problem that I cannot post new thread and reply after register. It reminds some information as shown in the below: case 1: To create new threads in this forum your post count must be 10 or greater. You currently have 0 posts. case 2: To reply to threads in this forum... (1 Reply)
Discussion started by: Unregistered
1 Replies

4. Forum Support Area for Unregistered Users & Account Problems

Not able to post thread/reply to thread

Dear Moderator I am not able to post any new thread or post reply to mine old thread. Kindly help as i am stuck on one problem and needed suggestion. Regards Jaydeep (1 Reply)
Discussion started by: jaydeep_sadaria
1 Replies

5. Forum Support Area for Unregistered Users & Account Problems

Unable to post or reply thread after login

I am unable to post reply to a thread. Whenever I will reply to any post I get the message every time : The message you have entered is too short. Please lengthen your message to at least 5 characters. Even though length of the message is more than required. for example I tried to post ... (3 Replies)
Discussion started by: Unregistered
3 Replies

6. How to Post in the The UNIX and Linux Forums

Not able to reply to a post

I have a trouble here. I posted couple of questions and got some reply but when i go ahead and do a reply/quick reply to the question asked it doesn't goes. it simply keep on displaying the message "Posting quick reply please wait" and that wait never ends. I am not able to do a reply :(... (3 Replies)
Discussion started by: Sharma331
3 Replies

7. What is on Your Mind?

Simple Autosave and Recovery for Forum WYSIWYG Editors

Well, after causing Don Cragun to lose some replies when working on a few feature, I decided to create a simple autosave / recovery program that will autosave locally on key (key stroke) changes (and mouse clicks as well). NOTE. Works well in Chrome Works OK in Safari, but is not reliable... (8 Replies)
Discussion started by: Neo
8 Replies
Padre::Autosave(3pm)					User Contributed Perl Documentation				      Padre::Autosave(3pm)

NAME
Padre::Autosave - auto-save and recovery mechanism for Padre SYNOPSIS
my $autosave = Padre:Autosave->new( db => 'path/to/database' ); $autosave->save_file( $path, $type, $data, $timestamp ) = @_; DESCRIPTION
The longer auto-save plan The following is just a plan that is currently shelved as some people on the Padre development list think this is not necessary and one should use a real version control for this anyway. So I leave it here for now, for future exploration. I'd like to provide auto-save with some history and recovery service. While I am writing this for Padre I'll make the code separate so others can use it. An SQLite database will be used for this but theoretically any database could be used. Event plain file system. Basically this will provide a versioned file system with metadata and automatic cleanup. Besides the content of the file we need to save some meta data: path to the file will be the unique identifier timestamp type of save (initial, auto-save, user initiated save, external) When opening a file for the first time it is saved in the database.(initial) Every N seconds files that are not currently in "saved" situation are auto-saved in the database making sure that they are only saved if they differ from the previous state. (auto-save) Evey time a file is saved it is also saved to the database. (user initiated save) Before reloading a file we auto-save it. (auto-save) Every time we notice that a file was changed on the disk if the user decides to overwrite it we also save the (external) changed file. Before auto-saving a file we make sure it has not changed since the last auto-save. In order to make sure the database does not get too big we setup a cleaning mechanism that is executed once in a while. There might be several options but for now: 1) Every entry older than N days will be deleted. Based on the database we'll be able to provide the user recovery in case of crash or accidental overwrite. When opening padre we should check if there are files in the database that the last save was not a user initiated save and offer recovery. When opening a file we should also check how is it related to the last save in the database. For buffers that were never saved and so have no file names we should have some internal identifier in Padre and use that for the auto-save till the first user initiated save. The same mechanism will be really useful when we start providing remote editing. Then a file is identified by its URI ( ftp://machine/path/to/file or scp://machine/path/to/file ) my @types = qw(initial, autosave, usersave, external); sub save_data { my ($path, $timestamp, $type, $data) = @_; } perl v5.14.2 2012-06-27 Padre::Autosave(3pm)
All times are GMT -4. The time now is 03:54 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy