



CKEDITOR.plugins.add( 'SFInlineButtons', {
	
	init: function(editor) {

		editor.addCommand('SFSaveCommand', {
			exec: function(_editor) {
				$(_editor.config.group || _editor.config.selector).each(function(){
					if (_editor.config.group || _editor === $(this).sfCkeditor('getEditor')) {
						$(this).sfCkeditor('save');
					}
				});
			}
		});
		
		editor.addCommand('SFCancelCommand', {
			exec: function(_editor) {
				$(_editor.config.group || _editor.config.selector).each(function(){
					if (_editor.config.group || _editor === $(this).sfCkeditor('getEditor')) {
						$(this).sfCkeditor('cancel');
					}
				});
			}
		});
		
		editor.ui.addButton('SFSave', {
			label:   'Save',
			command: 'SFSaveCommand',
			icon:    '/global_files/icons/fugue/disk.png'
		});
		
		editor.ui.addButton('SFCancel', {
			label:   'Cancel',
			command: 'SFCancelCommand',
			icon:    '/global_files/icons/fugue/cross-script.png'
		});
	}
});


