Sha256: dc1824d6331794d9785273b469d3ebe0d1ed72ea440f08dbf7c9897f4e054424

Contents?: true

Size: 1.08 KB

Versions: 6

Compression:

Stored size: 1.08 KB

Contents

/**
 * @license Copyright (c) 2003-2013, CKSource - Frederico Knabben. All rights reserved.
 * For licensing, see LICENSE.html or http://ckeditor.com/license
 */

/**
 * @fileOverview Save plugin.
 */

(function() {
	var saveCmd = {
		exec: function( editor ) {
          if ( editor.element.getAttribute('data-id') != null ) {
              $.ajax({
                  url: '/admin/sections/' + editor.element.getAttribute('data-id') + '.js',
                  type: 'PUT',
                  data: {
                      'section': {
                          'body': editor.getData()
                      }
                  }
              });
          } else {
              alert('Section id not specified!');
          }
		}
	};

	var pluginName = 'inlinesave';

	// Register a plugin named "save".
	CKEDITOR.plugins.add( pluginName, {
		icons: 'save', // %REMOVE_LINE_CORE%
		init: function( editor ) {

			editor.addCommand( pluginName, saveCmd );

			editor.ui.addButton && editor.ui.addButton( 'Save', {
				label: 'Save',
				command: pluginName,
				toolbar: 'document'
			});
		}
	});
})();

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
activeadmin-selleo-cms-0.0.47 app/assets/javascripts/ckeditor/plugins/inlinesave/plugin.js
activeadmin-selleo-cms-0.0.46 app/assets/javascripts/ckeditor/plugins/inlinesave/plugin.js
activeadmin-selleo-cms-0.0.45 app/assets/javascripts/ckeditor/plugins/inlinesave/plugin.js
activeadmin-selleo-cms-0.0.44 app/assets/javascripts/ckeditor/plugins/inlinesave/plugin.js
activeadmin-selleo-cms-0.0.43 app/assets/javascripts/ckeditor/plugins/inlinesave/plugin.js
activeadmin-selleo-cms-0.0.42 app/assets/javascripts/ckeditor/plugins/inlinesave/plugin.js