Sha256: 220010d31edc4f1e7af429d455501a15a9e889daab95634619d834368b7096d8

Contents?: true

Size: 1.15 KB

Versions: 9

Compression:

Stored size: 1.15 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(),
                          'locale': $('html').attr('lang')
                      }
                  }
              });
          } else {
              alert('Section id not specified!');
          }
		}
	};

	var pluginName = 'inlinesave';

	// Register a plugin named "save".
	CKEDITOR.plugins.add( pluginName, {
		icons: 'formswidget', // %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

9 entries across 9 versions & 1 rubygems

Version Path
activeadmin-selleo-cms-0.0.61 app/assets/javascripts/ckeditor/plugins/inlinesave/plugin.js
activeadmin-selleo-cms-0.0.60 app/assets/javascripts/ckeditor/plugins/inlinesave/plugin.js
activeadmin-selleo-cms-0.0.59 app/assets/javascripts/ckeditor/plugins/inlinesave/plugin.js
activeadmin-selleo-cms-0.0.58 app/assets/javascripts/ckeditor/plugins/inlinesave/plugin.js
activeadmin-selleo-cms-0.0.54 app/assets/javascripts/ckeditor/plugins/inlinesave/plugin.js
activeadmin-selleo-cms-0.0.52 app/assets/javascripts/ckeditor/plugins/inlinesave/plugin.js
activeadmin-selleo-cms-0.0.51 app/assets/javascripts/ckeditor/plugins/inlinesave/plugin.js
activeadmin-selleo-cms-0.0.49 app/assets/javascripts/ckeditor/plugins/inlinesave/plugin.js
activeadmin-selleo-cms-0.0.48 app/assets/javascripts/ckeditor/plugins/inlinesave/plugin.js