[ Index ]

PHP Cross Reference of WordPress




/wp-includes/js/ -> autosave.js (summary)

(no description)

File Size: 903 lines (22 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 30 functions


Functions that are not part of a class:

autosave()   X-Ref
Auto saves the post.

return: {Object}
since: 3.9.0

setInitialCompare()   X-Ref
Sets the initial compare data.

since: 5.6.1

getPostData( type )   X-Ref
Returns the data saved in both local and remote autosave.

return: {Object} Object containing the post data.
param: {string} type The type of autosave either local or remote.
since: 3.9.0

getCompareString( postData )   X-Ref
Concatenates the title, content and excerpt. This is used to track changes
when auto-saving.

return: {string} A concatenated string with title, content and excerpt.
param: {Object} postData The object containing the post data.
since: 3.9.0

disableButtons()   X-Ref
Disables save buttons.

return: {void}
since: 3.9.0

enableButtons()   X-Ref
Enables save buttons.

return: {void}
since: 3.9.0

getEditor()   X-Ref
Gets the content editor.

return: {boolean|*} Returns either false if the editor is undefined,
since: 4.6.0

autosaveLocal()   X-Ref
Autosave in localStorage.

return: {
since: 3.9.0

checkStorage()   X-Ref
Checks if the browser supports sessionStorage and it's not disabled.

return: {boolean} True if the sessionStorage is supported and enabled.
since: 3.9.0

getStorage()   X-Ref
Initializes the local storage.

return: {boolean|Object} False if no sessionStorage in the browser or an Object
since: 3.9.0

setStorage( stored_obj )   X-Ref
Sets the storage for this blog. Confirms that the data was saved

return: {boolean} True if the data was saved successfully, false if it wasn't saved.
since: 3.9.0

getSavedPostData()   X-Ref
Gets the saved post data for the current post.

return: {boolean|Object} False if no storage or no data or the postData as an Object.
since: 3.9.0

setData( stored_data )   X-Ref
Sets (save or delete) post data in the storage.

If stored_data evaluates to 'false' the storage key for the current post will be removed.

return: {boolean} True if data is stored, false if data was removed.
param: {Object|boolean|null} stored_data The post data to store or null/false/empty to delete the key.
since: 3.9.0

suspend()   X-Ref
Sets isSuspended to true.

return: {void}
since: 3.9.0

resume()   X-Ref
Sets isSuspended to false.

return: {void}
since: 3.9.0

save( data )   X-Ref
Saves post data for the current post.

Runs on a 15 seconds interval, saves when there are differences in the post title or content.
When the optional data is provided, updates the last saved post data.

return: {boolean} Returns true when data has been saved, otherwise it returns false.
param: {Object} data The post data for saving, minimum 'post_title' and 'content'.
since: 3.9.0

run()   X-Ref
Initializes the auto save function.

Checks whether the editor is active or not to use the editor events
to autosave, or uses the values from the elements to autosave.

Runs on DOM ready.

return: {void}
since: 3.9.0

compare( str1, str2 )   X-Ref
Compares 2 strings. Removes whitespaces in the strings before comparing them.

return: {boolean} True if the strings are the same.
param: {string} str1 The first string.
param: {string} str2 The second string.
since: 3.9.0

removeSpaces( string )   X-Ref
No description

checkPost()   X-Ref
Checks if the saved data for the current post (if any) is different than the
loaded post data on the screen.

Shows a standard message letting the user restore the post data if different.

return: {void}
since: 3.9.0

restorePost( postData )   X-Ref
Restores the current title, content and excerpt from postData.

return: {boolean} True if the post is restored.
param: {Object} postData The object containing all post data.
since: 3.9.0

autosaveServer()   X-Ref
Auto saves the post on the server.

return: {Object} {
since: 3.9.0

tempBlockSave()   X-Ref
Blocks saving for the next 10 seconds.

return: {void}
since: 3.9.0

suspend()   X-Ref
Sets isSuspended to true.

return: {void}
since: 3.9.0

resume()   X-Ref
Sets isSuspended to false.

return: {void}
since: 3.9.0

response( data )   X-Ref
Triggers the autosave with the post data.

return: {void}
param: {Object} data The post data.
since: 3.9.0

triggerSave()   X-Ref
Saves immediately.

Resets the timing and tells heartbeat to connect now.

return: {void}
since: 3.9.0

postChanged()   X-Ref
Checks if the post content in the textarea has changed since page load.

This also happens when TinyMCE is active and editor.save() is triggered by

return: {boolean} True if the post has been changed.
since: 3.9.0

save()   X-Ref
Checks if the post can be saved or not.

If the post hasn't changed or it cannot be updated,
because the autosave is blocked or suspended, the function returns false.

return: {Object} Returns the post data.
since: 3.9.0

_schedule()   X-Ref
Sets the next run, based on the autosave interval.

return: {void}
since: 3.9.0

Generated: Sun Apr 14 01:00:02 2024 Cross-referenced by PHPXref 0.7.1