re-assign a button in the editor
#3
(2024-05-18, 10:35 PM)effone Wrote: Example js:
// Add SCEditor Command
$.sceditor.command.set('custom_insert_code', {
	exec: custom_insert_code_sce,
	txtExec: custom_insert_code_sce,
	tooltip: "Insert Code"
});

// SCEditor Driver
function custom_insert_code_sce() {
	var code = custom_insert_code();
	if (false !== code) {
		this.insert('[php]' + code + '[/php]');
	}
}

// Custom Function
function custom_insert_code() {
	return "console.log('Success!)";
}

Use CSS to insert the icon in the custom button.

Thank you!
Reply


Messages In This Thread
re-assign a button in the editor - by rozbud - 2024-05-18, 03:17 PM
RE: re-assign a button in the editor - by effone - 2024-05-18, 10:35 PM
RE: re-assign a button in the editor - by rozbud - 2024-05-19, 09:00 AM

Forum Jump:


Users browsing this thread: 3 Guest(s)