Replaced the FCKeditor with the new CKeditor v4. Implemented a plugin that allows dragging and dropping one or more files into the CKeditor - plugin name is dndfiles. Modified the save toolbar button on the CKeditor so that it behaves like a submit button. Implemented a timestamp plugin that behaves the same way as the old timestamp button on FCKeditor. Added a plugin to the CKeditor that allows typing LaTeX syntax.
This commit is contained in:
Executable
+41
@@ -0,0 +1,41 @@
|
||||
/**
|
||||
* Basic sample plugin inserting current date and time into CKEditor editing area.
|
||||
*
|
||||
* Created out of the CKEditor Plugin SDK:
|
||||
* http://docs.ckeditor.com/#!/guide/plugin_sdk_intro
|
||||
*/
|
||||
|
||||
// Register the plugin within the editor.
|
||||
CKEDITOR.plugins.add( 'timestamp', {
|
||||
|
||||
// Register the icons. They must match command names.
|
||||
icons: 'timestamp',
|
||||
|
||||
// The plugin initialization logic goes inside this method.
|
||||
init: function( editor ) {
|
||||
|
||||
// Define an editor command that inserts a timestamp.
|
||||
editor.addCommand( 'insertTimestamp', {
|
||||
|
||||
// Define the function that will be fired when the command is executed.
|
||||
exec: function( editor ) {
|
||||
var URL = "../../?cmd=gettimedate";
|
||||
|
||||
$.ajax({
|
||||
url: URL,
|
||||
context: document.body,
|
||||
success: function(data) {
|
||||
editor.insertHtml(data);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
// Create the toolbar button that executes the above command.
|
||||
editor.ui.addButton( 'Timestamp', {
|
||||
label: 'Insert Timestamp',
|
||||
command: 'insertTimestamp',
|
||||
toolbar: 'insert'
|
||||
});
|
||||
}
|
||||
});
|
||||
Reference in New Issue
Block a user