LEAP™ is a content editor’s dream (CMS), a designer’s best option, and the perfect framework for site development.
LEAP™ is simpleLEAPLEAP™ is secureLEAPLEAP™ is SEO-centric

Executing Javascript Functions on "Save"

LEAP_submitrun

If your plugin admin code contains a Javascript function named "LEAP_submitrun_[$ContentID]" LEAP™ 5 will recognize it exists and execute it while processing the "Save" function.

An example of a submitrun script is that which is used in the text module:

function LEAP_submitrun_[$ContentID]() {
	var thisObj = new Object();
	thisObj.data = LEAP_editor[$ContentID]_[$randomid].getData();
	return thisObj
}

Element pairs in the object "newObj" are extracted and added to the object passed to your save handler for processing.

LEAP_postrun

If your edit mode code contains a Javascript function named "LEAP_postrun_[$ContentID]" then LEAP™ 5 will execute that function on successful submission of the data to the admin kernel.

A sample LEAP_postrun function is also one taken from the text plugin:

function LEAP_postrun_[$ContentID]() {
	var contentid = '[$ContentID]';
	var o=CKEDITOR.instances['[']"LEAP_editor"+contentid[']'];
	if (o) o.destroy();
}

© Copyright LEAP™ 2017 | Privacy Policy | Design by Treefrog Inc.