cryptpad/www/pad/mediatag-plugin.js

55 lines
1.4 KiB
JavaScript
Raw Normal View History

2017-09-15 11:21:37 +00:00
/**
* @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
* For licensing, see LICENSE.md or http://ckeditor.com/license
*/
/**
* @fileOverview The Image plugin.
*/
( function() {
CKEDITOR.plugins.add( 'mediatag', {
2018-04-19 15:45:08 +00:00
requires: 'dialog,widget',
2017-09-15 11:21:37 +00:00
//icons: 'image',
//hidpi: true,
onLoad: function () {
CKEDITOR.addCss(
'media-tag{' +
'display:inline-block;' +
'}' +
'media-tag.selected{' +
'border: 1px solid black;' +
'}' +
'media-tag iframe{' +
'border: 6px solid #eee;' +
'}' +
'media-tag img{' +
'vertical-align: top;' +
'}' +
2017-09-15 11:21:37 +00:00
'media-tag *{' +
'width:100%; height:100%;' +
'}');
},
init: function( editor ) {
var pluginName = 'mediatag';
// Register the dialog.
CKEDITOR.dialog.add( pluginName, this.path + 'mediatag-plugin-dialog.js' );
2018-04-19 15:45:08 +00:00
editor.widgets.add( 'mediatag', {
2017-09-15 11:21:37 +00:00
2018-04-20 13:33:14 +00:00
getLabel: function () { return " "; },
2018-04-19 15:45:08 +00:00
dialog: pluginName,
inline: true,
upcast: function( element ) {
return element.name === 'media-tag';
2017-09-15 11:21:37 +00:00
}
2018-04-19 15:45:08 +00:00
});
2017-09-15 11:21:37 +00:00
},
} );
} )();