Index: openacs-4/packages/xowiki/www/resources/ckeditor/_source/plugins/timestamp/plugin.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/www/resources/ckeditor/_source/plugins/timestamp/Attic/plugin.js,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/xowiki/www/resources/ckeditor/_source/plugins/timestamp/plugin.js 14 Feb 2012 08:26:56 -0000 1.1 @@ -0,0 +1,39 @@ +/** + * 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: ' + timestamp.toString() + '' ); + } + }); + // 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' + } ); + } +} ); \ No newline at end of file Index: openacs-4/packages/xowiki/www/resources/ckeditor/_source/plugins/xowikiimage/plugin.js =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/www/resources/ckeditor/_source/plugins/xowikiimage/Attic/plugin.js,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/xowiki/www/resources/ckeditor/_source/plugins/xowikiimage/plugin.js 14 Feb 2012 08:26:56 -0000 1.1 @@ -0,0 +1,51 @@ + +var xowikiimage_dialog = $("
X
"); + +xowikiimage_dialog.dialog({ + modal: true, + width: '715px', + autoOpen: false, + zIndex: 10000 +}); + +CKEDITOR.plugins.add( 'xowikiimage', { + icon: this.path + 'image.gif', + lang : [ 'en', 'de' ], + + init : function( editor ) { + var pluginName = 'xowikiimage'; + + editor.addCommand(pluginName, { + exec: function(editor) { + xowikiimage_dialog.load(editor.config.imageSelectorDialog, {parent_id: editor.config.parent_id}, function() { + xowikiimage_dialog.dialog({title:editor.lang.xowikiimage['insertImage']}); + xowikiimage_dialog.dialog("open"); + xowikiimage_dialog.find('input').keypress(function(e) { + if ((e.which && e.which == 13) || (e.keyCode && e.keyCode == 13)) { + return false; + } + }); + xowikiimage_dialog.find("#insert_form").submit(function() { + var pathname = window.location.pathname; + pathname = pathname.substr(pathname.lastIndexOf("/")+1,pathname.length) + insert_the_image(xowikiimage_dialog.find("#f_url").val().replace(/file:/g, "image:"),pathname+'/'+xowikiimage_dialog.find("#f_url").val()+'?m=download',editor); + xowikiimage_dialog.dialog("close"); + return false; + }); + }); + }}); + + // Register the toolbar button. + editor.ui.addButton( 'xowikiImage', { + label : editor.lang.xowikiimage['insertImage'], + command : pluginName + }); + } +} ); + + +var insert_the_image=function (me,src,editor) { + editor.insertHtml("\""+me+"\""); + //editor.insertHtml(me); +} +