Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • project/varbase
  • issue/varbase-3087001
  • issue/varbase-3215888
  • issue/varbase-3245763
  • issue/varbase-3253354
  • issue/varbase-3256661
  • issue/varbase-3258740
  • issue/varbase-3259665
  • issue/varbase-3260809
  • issue/varbase-3263378
  • issue/varbase-3266504
  • issue/varbase-3269421
  • issue/varbase-3269809
  • issue/varbase-3270457
  • issue/varbase-3276911
  • issue/varbase-3277590
  • issue/varbase-3285082
  • issue/varbase-3292847
  • issue/varbase-3293400
  • issue/varbase-3293696
  • issue/varbase-3298632
  • issue/varbase-3301451
  • issue/varbase-3318323
  • issue/varbase-3318847
  • issue/varbase-3346247
  • issue/varbase-3391550
  • issue/varbase-3443948
  • issue/varbase-3471788
  • issue/varbase-3479338
  • issue/varbase-3484640
30 results
Show changes
Showing
with 0 additions and 572 deletions
/*
Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or http://ckeditor.com/license
*/
CKEDITOR.plugins.setLang( 'autoembed', 'nb', {
embeddingInProgress: 'Prøver å bygge inn innlimt URL...',
embeddingFailed: 'URL-en kunne ikke bli automatisk bygget inn.'
} );
/*
Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or http://ckeditor.com/license
*/
CKEDITOR.plugins.setLang( 'autoembed', 'nl', {
embeddingInProgress: 'De geplakte URL wordt ingesloten...',
embeddingFailed: 'Deze URL kon niet automatisch ingesloten worden.'
} );
/*
Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or http://ckeditor.com/license
*/
CKEDITOR.plugins.setLang( 'autoembed', 'oc', {
embeddingInProgress: 'Incorporacion de l\'URL pegada...',
embeddingFailed: 'Aquesta URL a pas pogut èsser incorporada automaticament.'
} );
/*
Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or http://ckeditor.com/license
*/
CKEDITOR.plugins.setLang( 'autoembed', 'pl', {
embeddingInProgress: 'Osadzanie wklejonego adresu URL...',
embeddingFailed: 'Ten adres URL multimediów nie może być automatycznie osadzony.'
} );
/*
Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or http://ckeditor.com/license
*/
CKEDITOR.plugins.setLang( 'autoembed', 'pt-br', {
embeddingInProgress: 'Tentando embutir a URL colada...',
embeddingFailed: 'Esta URL não pode ser embutida automaticamente.'
} );
/*
Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or http://ckeditor.com/license
*/
CKEDITOR.plugins.setLang( 'autoembed', 'pt', {
embeddingInProgress: 'Trying to embed pasted URL...', // MISSING
embeddingFailed: 'Não foi possível embeber diretamente este URL.'
} );
/*
Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or http://ckeditor.com/license
*/
CKEDITOR.plugins.setLang( 'autoembed', 'ru', {
embeddingInProgress: 'Пытаемся встроить вставленный URL...',
embeddingFailed: 'Данный URL не может быть встроен автоматически.'
} );
/*
Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or http://ckeditor.com/license
*/
CKEDITOR.plugins.setLang( 'autoembed', 'sk', {
embeddingInProgress: 'Snažím sa vložiť skopírovanú URL...',
embeddingFailed: 'Túto URL nebolo možné automaticky vložiť.'
} );
/*
Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or http://ckeditor.com/license
*/
CKEDITOR.plugins.setLang( 'autoembed', 'sv', {
embeddingInProgress: 'Försöker bädda in inklistrad URL...',
embeddingFailed: 'Denna URL kunde inte automatiskt bäddas in.'
} );
/*
Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or http://ckeditor.com/license
*/
CKEDITOR.plugins.setLang( 'autoembed', 'tr', {
embeddingInProgress: 'Yapıştırdığınız URL gömülmeye çalışılıyor...',
embeddingFailed: 'Bu URL otomatik olarak gömülemedi.'
} );
/*
Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or http://ckeditor.com/license
*/
CKEDITOR.plugins.setLang( 'autoembed', 'ug', {
embeddingInProgress: 'سىڭدۈرۈلگەن چاپلانغان URL نى سىناۋاتىدۇ…',
embeddingFailed: 'بۇ URL نى ئۆزلۈكىدىن سىڭدۈرەلمەيدۇ.'
} );
/*
Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or http://ckeditor.com/license
*/
CKEDITOR.plugins.setLang( 'autoembed', 'uk', {
embeddingInProgress: 'Намагаюсь вбудувати вставлене URL посилання...',
embeddingFailed: 'Це URl посилання не може бути автоматично вбудовано.'
} );
/*
Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or http://ckeditor.com/license
*/
CKEDITOR.plugins.setLang( 'autoembed', 'zh-cn', {
embeddingInProgress: '正在尝试嵌入粘贴的 URL 里的媒体内容...',
embeddingFailed: '此 URL 无法自动嵌入媒体内容'
} );
/*
Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or http://ckeditor.com/license
*/
CKEDITOR.plugins.setLang( 'autoembed', 'zh', {
embeddingInProgress: '正在嘗試嵌入已貼上的 URL...',
embeddingFailed: '這個 URL 無法被自動嵌入。'
} );
/**
* @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
* For licensing, see LICENSE.md or http://ckeditor.com/license
*/
'use strict';
( function() {
var validLinkRegExp = /^<a[^>]+href="([^"]+)"[^>]*>([^<]+)<\/a>$/i;
CKEDITOR.plugins.add( 'autoembed', {
requires: 'autolink,undo',
lang: 'az,ca,cs,de,de-ch,en,eo,es,es-mx,eu,fr,gl,hr,hu,it,ja,km,ko,ku,mk,nb,nl,oc,pl,pt,pt-br,ru,sk,sv,tr,ug,uk,zh,zh-cn', // %REMOVE_LINE_CORE%
init: function( editor ) {
var currentId = 1,
embedCandidatePasted;
editor.on( 'paste', function( evt ) {
if ( evt.data.dataTransfer.getTransferType( editor ) == CKEDITOR.DATA_TRANSFER_INTERNAL ) {
embedCandidatePasted = 0;
return;
}
var match = evt.data.dataValue.match( validLinkRegExp );
embedCandidatePasted = match != null && decodeURI( match[ 1 ] ) == decodeURI( match[ 2 ] );
// Expecting exactly one <a> tag spanning the whole pasted content.
// The tag has to have same href as content.
if ( embedCandidatePasted ) {
evt.data.dataValue = '<a data-cke-autoembed="' + ( ++currentId ) + '"' + evt.data.dataValue.substr( 2 );
}
}, null, null, 20 ); // Execute after autolink.
editor.on( 'afterPaste', function() {
// If one pasted an embeddable link and then undone the action, the link in the content holds the
// data-cke-autoembed attribute and may be embedded on *any* successive paste.
// This check ensures that autoEmbedLink is called only if afterPaste is fired *right after*
// embeddable link got into the content. (http://dev.ckeditor.com/ticket/13532)
if ( embedCandidatePasted ) {
autoEmbedLink( editor, currentId );
}
} );
}
} );
function autoEmbedLink( editor, id ) {
var anchor = editor.editable().findOne( 'a[data-cke-autoembed="' + id + '"]' ),
lang = editor.lang.autoembed,
notification;
if ( !anchor || !anchor.data( 'cke-saved-href' ) ) {
return;
}
var href = anchor.data( 'cke-saved-href' ),
widgetDef = CKEDITOR.plugins.autoEmbed.getWidgetDefinition( editor, href );
if ( !widgetDef ) {
CKEDITOR.warn( 'autoembed-no-widget-def' );
return;
}
// TODO Move this to a method in the widget plugin. http://dev.ckeditor.com/ticket/13408
var defaults = typeof widgetDef.defaults == 'function' ? widgetDef.defaults() : widgetDef.defaults,
element = CKEDITOR.dom.element.createFromHtml( widgetDef.template.output( defaults ) ),
instance,
wrapper = editor.widgets.wrapElement( element, widgetDef.name ),
temp = new CKEDITOR.dom.documentFragment( wrapper.getDocument() );
temp.append( wrapper );
instance = editor.widgets.initOn( element, widgetDef );
if ( !instance ) {
finalizeCreation();
return;
}
notification = editor.showNotification( lang.embeddingInProgress, 'info' );
instance.loadContent( href, {
noNotifications: true,
callback: function() {
// DOM might be invalidated in the meantime, so find the anchor again.
var anchor = editor.editable().findOne( 'a[data-cke-autoembed="' + id + '"]' );
// Anchor might be removed in the meantime.
if ( anchor ) {
var selection = editor.getSelection(),
insertRange = editor.createRange(),
editable = editor.editable();
// Save the changes in editor contents that happened *after* the link was pasted
// but before it gets embedded (i.e. user pasted and typed).
editor.fire( 'saveSnapshot' );
// Lock snapshot so we don't make unnecessary undo steps in
// editable.insertElement() below, which would include bookmarks. (http://dev.ckeditor.com/ticket/13429)
editor.fire( 'lockSnapshot', { dontUpdate: true } );
// Bookmark current selection. (http://dev.ckeditor.com/ticket/13429)
var bookmark = selection.createBookmarks( false )[ 0 ],
startNode = bookmark.startNode,
endNode = bookmark.endNode || startNode;
// When url is pasted, IE8 sets the caret after <a> element instead of inside it.
// So, if user hasn't changed selection, bookmark is inserted right after <a>.
// Then, after pasting embedded content, bookmark is still in DOM but it is
// inside the original element. After selection recreation it would end up before widget:
// <p>A <a /><bm /></p><p>B</p> --> <p>A <bm /></p><widget /><p>B</p> --> <p>A ^</p><widget /><p>B</p>
// We have to fix this IE8 behavior so it is the same as on other browsers.
if ( CKEDITOR.env.ie && CKEDITOR.env.version < 9 && !bookmark.endNode && startNode.equals( anchor.getNext() ) ) {
anchor.append( startNode );
}
insertRange.setStartBefore( anchor );
insertRange.setEndAfter( anchor );
editable.insertElement( wrapper, insertRange );
// If both bookmarks are still in DOM, it means that selection was not inside
// an anchor that got substituted. We can safely recreate that selection. (http://dev.ckeditor.com/ticket/13429)
if ( editable.contains( startNode ) && editable.contains( endNode ) ) {
selection.selectBookmarks( [ bookmark ] );
} else {
// If one of bookmarks is not in DOM, clean up leftovers.
startNode.remove();
endNode.remove();
}
editor.fire( 'unlockSnapshot' );
}
notification.hide();
finalizeCreation();
},
errorCallback: function() {
notification.hide();
editor.widgets.destroy( instance, true );
editor.showNotification( lang.embeddingFailed, 'info' );
}
} );
function finalizeCreation() {
editor.widgets.finalizeCreation( temp );
}
}
CKEDITOR.plugins.autoEmbed = {
/**
* Gets the definition of the widget that should be used to automatically embed the specified link.
*
* This method uses the value of the {@link CKEDITOR.config#autoEmbed_widget} option.
*
* @since 4.5
* @member CKEDITOR.plugins.autoEmbed
* @param {CKEDITOR.editor} editor
* @param {String} url The URL to be embedded.
* @returns {CKEDITOR.plugins.widget.definition/null} The definition of the widget to be used to embed the link.
*/
getWidgetDefinition: function( editor, url ) {
var opt = editor.config.autoEmbed_widget || 'embed,embedSemantic',
name,
widgets = editor.widgets.registered;
if ( typeof opt == 'string' ) {
opt = opt.split( ',' );
while ( ( name = opt.shift() ) ) {
if ( widgets[ name ] ) {
return widgets[ name ];
}
}
} else if ( typeof opt == 'function' ) {
return widgets[ opt( url ) ];
}
return null;
}
};
/**
* Specifies the widget to use to automatically embed a link. The default value
* of this option defines that either the [Media Embed](ckeditor.com/addon/embed) or
* [Semantic Media Embed](ckeditor.com/addon/embedsemantic) widgets will be used, depending on which is enabled.
*
* The general behavior:
*
* * If a string (widget names separated by commas) is provided, then the first of the listed widgets which is registered
* will be used. For example, if `'foo,bar,bom'` is set and widgets `'bar'` and `'bom'` are registered, then `'bar'`
* will be used.
* * If a callback is specified, then it will be executed with the URL to be embedded and it should return the
* name of the widget to be used. It allows to use different embed widgets for different URLs.
*
* Example:
*
* // Defines that embedSemantic should be used (regardless of whether embed is defined).
* config.autoEmbed_widget = 'embedSemantic';
*
* Using with custom embed widgets:
*
* config.autoEmbed_widget = 'customEmbed';
*
* **Note:** Plugin names are always lower case, while widget names are not, so widget names do not have to equal plugin names.
* For example, there is the `embedsemantic` plugin and the `embedSemantic` widget.
*
* Read more in the [documentation](#!/guide/dev_media_embed-section-automatic-embedding-on-paste)
* and see the [SDK sample](http://sdk.ckeditor.com/samples/mediaembed.html).
*
* @since 4.5
* @cfg {String/Function} [autoEmbed_widget='embed,embedSemantic']
* @member CKEDITOR.config
*/
} )();
/**
* @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
* For licensing, see LICENSE.md or http://ckeditor.com/license
*/
( function() {
'use strict';
// Regex by Imme Emosol.
var validUrlRegex = /^(https?|ftp):\/\/(-\.)?([^\s\/?\.#]+\.?)+(\/[^\s]*)?[^\s\.,]$/ig,
doubleQuoteRegex = /"/g;
CKEDITOR.plugins.add( 'autolink', {
requires: 'clipboard',
init: function( editor ) {
editor.on( 'paste', function( evt ) {
var data = evt.data.dataValue;
if ( evt.data.dataTransfer.getTransferType( editor ) == CKEDITOR.DATA_TRANSFER_INTERNAL ) {
return;
}
// If we found "<" it means that most likely there's some tag and we don't want to touch it.
if ( data.indexOf( '<' ) > -1 ) {
return;
}
// http://dev.ckeditor.com/ticket/13419
data = data.replace( validUrlRegex , '<a href="' + data.replace( doubleQuoteRegex, '%22' ) + '">$&</a>' );
// If link was discovered, change the type to 'html'. This is important e.g. when pasting plain text in Chrome
// where real type is correctly recognized.
if ( data != evt.data.dataValue ) {
evt.data.type = 'html';
}
evt.data.dataValue = data;
} );
}
} );
} )();
libraries/ckeditor/plugins/embed/icons/embed.png

389 B

libraries/ckeditor/plugins/embed/icons/hidpi/embed.png

728 B

/**
* @license Copyright (c) 2003-2017, CKSource - Frederico Knabben. All rights reserved.
* For licensing, see LICENSE.md or http://ckeditor.com/license
*/
( function() {
'use strict';
CKEDITOR.plugins.add( 'embed', {
icons: 'embed', // %REMOVE_LINE_CORE%
hidpi: true, // %REMOVE_LINE_CORE%
requires: 'embedbase',
init: function( editor ) {
var widgetDefinition = CKEDITOR.plugins.embedBase.createWidgetBaseDefinition( editor );
if ( !editor.config.embed_provider ) {
CKEDITOR.error( 'embed-no-provider-url' );
}
// Extend the base definition with additional properties.
CKEDITOR.tools.extend( widgetDefinition, {
// Use a dialog exposed by the embedbase plugin.
dialog: 'embedBase',
button: editor.lang.embedbase.button,
allowedContent: 'div[!data-oembed-url]',
requiredContent: 'div[data-oembed-url]',
providerUrl: new CKEDITOR.template( editor.config.embed_provider || '' ),
// The filter element callback actually allows all divs with data-oembed-url,
// so registering styles to the filter is virtually unnecessary because
// classes won't be filtered out. However, registering them will make filter.check() work
// which may be important in some cases.
styleToAllowedContentRules: function( style ) {
// Retrieve classes defined in the style.
var classes = style.getClassesArray();
return {
div: {
propertiesOnly: true,
classes: classes,
attributes: '!data-oembed-url'
}
};
},
upcast: function( el, data ) {
if ( el.name == 'div' && el.attributes[ 'data-oembed-url' ] ) {
data.url = el.attributes[ 'data-oembed-url' ];
return true;
}
},
downcast: function( el ) {
el.attributes[ 'data-oembed-url' ] = this.data.url;
}
}, true );
// Register the definition as 'embed' widget.
editor.widgets.add( 'embed', widgetDefinition );
// Do not filter contents of the div[data-oembed-url] at all.
editor.filter.addElementCallback( function( el ) {
if ( 'data-oembed-url' in el.attributes ) {
return CKEDITOR.FILTER_SKIP_TREE;
}
} );
}
} );
} )();
/**
* A template for the URL of the provider endpoint. This URL will be queried for each resource to be embedded.
*
* It uses the following parameters:
*
* * `url` &ndash; The URL of the requested media, e.g. `https://twitter.com/ckeditor/status/401373919157821441`.
* * `callback` &ndash; The name of the globally available callback used for JSONP requests.
*
* For example:
*
* config.embed_provider = '//example.com/api/oembed-proxy?resource-url={url}&callback={callback}';
*
* By default CKEditor does not use any provider, although there is a ready-to-use URL available via Iframely:
*
* config.embed_provider = '//ckeditor.iframe.ly/api/oembed?url={url}&callback={callback}'
*
* However, this endpoint contains certain limitations, e.g. it cannot embed Google Maps content.
* It is recommended to set up an account on the [Iframely](https://iframely.com/) service for
* better control over embedded content.
*
* Read more in the [documentation](#!/guide/dev_media_embed)
* and see the [SDK sample](http://sdk.ckeditor.com/samples/mediaembed.html).
*
* Refer to {@link CKEDITOR.plugins.embedBase.baseDefinition#providerUrl} for more information about content providers.
*
* **Important note:** Prior to version 4.7 this configuration option defaulted to the
* `//ckeditor.iframe.ly/api/oembed?url={url}&callback={callback}` string.
*
* @since 4.5
* @cfg {String} [embed_provider='']
* @member CKEDITOR.config
*/