after create a folder timestamp from the root site to "\_Samples\ckeditor\plugins\" and insert plugin.js and a folder images with an image... , my code for insert this plugin (downloaded from the ckeditor site..named timestamp) in config.js (in \_Samples\ckeditor\config.js) is:
CKEDITOR.editorConfig = function( config )
{
config.toolbar = 'MyToolbarSet'
config.toolbar_MyToolbarSet =
[
['Cut','Copy','Paste','PasteFromWord','-','SpellChecker'],
['Undo','Redo','-','Find','Replace'],
['NumberedList','BulletedList','Outdent','Indent','Blockquote','RemoveFormat','Source'],
['Link','Unlink'],
['Table','HorizontalRule','SpecialChar'],
'/',
['Bold','Italic','StrikeThrough','-','Subscript','Superscript'],
['JustifyLeft','JustifyCenter','JustifyRight','JustifyBlock'],
['Format','FontSize'],
['FitWindow','ShowBlocks'],
['Maximize', 'ShowBlocks','-','About','Paste','Paste','Paste','timestamp']
]
// Define changes to default configuration here. For example:
config.language = 'it';
// config.uiColor = '#AADC6E';
config.uiColor = '#FFFAAA';
config.filebrowserBrowseUrl='../../ckfinder/ckfinder.html';
config.filebrowserImageBrowseUrl ='../../ckfinder/ckfinder.html?type=Images';
config.filebrowserFlashBrowseUrl ='../../ckfinder/ckfinder.html?type=Flash';
config.filebrowserUploadUrl ='../../ckfinder/core/connector/aspx/connector.aspx?command=QuickUpload&type=Files';
config.filebrowserImageUploadUrl ='../../ckfinder/core/connector/aspx/connector.aspx?command=QuickUpload&type=Images';
config.filebrowserFlashUploadUrl ='../../ckfinder/core/connector/aspx/connector.aspx?command=QuickUpload&type=Flash;
};
the plugin.js file is:
/**
* Basic sample plugin inserting current date and time into CKEditor editing area.
*/
// Register the plugin with the editor.
// http://docs.cksource.com/ckeditor_api/symbols/CKEDITOR.plugins.html
CKEDITOR.plugins.add( 'timestamp',
{
// The plugin initialization logic goes inside this method.
// http://docs.cksource.com/ckeditor_api/symbols/CKEDITOR.pluginDefinition.html#init
init: function( editor )
{
// Define an editor command that inserts a timestamp.
// http://docs.cksource.com/ckeditor_api/symbols/CKEDITOR.editor.html#addCommand
editor.addCommand( 'insertTimestamp',
{
// Define a function that will be fired when the command is executed.
// http://docs.cksource.com/ckeditor_api/symbols/CKEDITOR.commandDefinition.html#exec
exec : function( editor )
{
var timestamp = new Date();
// Insert the timestamp into the document.
// http://docs.cksource.com/ckeditor_api/symbols/CKEDITOR.editor.html#insertHtml
editor.insertHtml( 'The current date and time is: <em>' + timestamp.toString() + '</em>' );
}
});
// Create a toolbar button that executes the plugin command.
// http://docs.cksource.com/ckeditor_api/symbols/CKEDITOR.ui.html#addButton
editor.ui.addButton( 'Timestamp',
{
// Toolbar button tooltip.
label: 'Insert Timestamp',
// Reference to the plugin command name.
command: 'insertTimestamp',
// Button's icon file path.
icon: this.path + 'images/timestamp.png'
} );
}
} );
in aspx page the code for the editor is:
<CKEditor:CKEditorControl ID="CKEditor1" BasePath="../../_Samples/ckeditor/" runat="server">
</CKEditor:CKEditorControl>
there are no errors in javascript or aspx page, but the editor is without this new plugin inserted...
AFTER this i ve tried to only configurate the editor from the aspx.cs page, with this code in PageLoad function:
CKEditor1.config.extraPlugins = "timestamp";
CKEditor1.config.toolbar = new object[]
{
new object[] { "Source", "-","timestamp", "Save", "NewPage", "Preview", "-", "Templates" },
new object[] { "Cut", "Copy", "Paste", "PasteText", "PasteFromWord", "-", "Print", "SpellChecker", "Scayt" },
new object[] { "Undo", "Redo", "-", "Find", "Replace", "-", "SelectAll", "RemoveFormat" },
new object[] { "Form", "Checkbox", "Radio", "TextField", "Textarea", "Select", "Button", "ImageButton", "HiddenField" },
"/",
new object[] { "Bold", "Italic", "Underline", "Strike", "-", "Subscript", "Superscript" },
new object[] { "NumberedList", "BulletedList", "-", "Outdent", "Indent", "Blockquote", "CreateDiv" },
new object[] { "JustifyLeft", "JustifyCenter", "JustifyRight", "JustifyBlock" },
new object[] { "BidiLtr", "BidiRtl" },
new object[] { "Image", "Flash", "Table", "HorizontalRule", "Smiley", "SpecialChar", "PageBreak", "Iframe" },
"/",
new object[] { "Styles", "Format", "Font", "FontSize" },
new object[] { "TextColor", "BGColor" },
new object[] { "Maximize", "ShowBlocks", "-", "timestamp" }
};
the editor is visible , but the plugin timestamp and its relative button, there isn t...
HELP!! I LL WANT TO BUY THIS EDITOR BUT NOT WITHOUT PLUGIN .
THANKS, A LOT. BEST REGARDS.