first import

This commit is contained in:
Bachir Soussi Chiadmi
2015-04-08 11:40:19 +02:00
commit 1bc61b12ad
8435 changed files with 1582817 additions and 0 deletions

View File

@@ -0,0 +1,58 @@
/*
Copyright (c) 2003-2012, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.html or http://ckeditor.com/license
*/
/**
* @file Plugin for inserting images from Drupal media module
*/
( function() {
CKEDITOR.plugins.add( 'media',
{
// Wrap Drupal plugin in a proxy plugin.
init: function(editor)
{
var pluginCommand = {
exec: function (editor) {
var data = {
format: 'html',
node: null,
content: ''
};
var selection = editor.getSelection();
if (selection) {
data.node = selection.getSelectedElement();
if (data.node) {
data.node = data.node.$;
}
if (selection.getType() == CKEDITOR.SELECTION_TEXT) {
if (CKEDITOR.env.ie) {
data.content = selection.getNative().createRange().text;
}
else {
data.content = selection.getNative().toString();
}
}
else if (data.node) {
// content is supposed to contain the "outerHTML".
data.content = data.node.parentNode.innerHTML;
}
}
Drupal.settings.ckeditor.plugins['media'].invoke(data, Drupal.settings.ckeditor.plugins['media'], editor.name);
}
};
editor.addCommand( 'media', pluginCommand );
editor.ui.addButton( 'Media',
{
label: 'Add media',
command: 'media',
icon: this.path + 'images/icon.gif'
});
}
});
} )();