Update
This commit is contained in:
77
public/admin/plugins/tmce/cpRelatedLinks/plugin.min.js
vendored
Normal file
77
public/admin/plugins/tmce/cpRelatedLinks/plugin.min.js
vendored
Normal file
@@ -0,0 +1,77 @@
|
||||
jQuery(document).ready(function($) {
|
||||
|
||||
var dom = tinymce.DOM;
|
||||
var util = tinymce.util;
|
||||
var undoManager = tinymce.UndoManager;
|
||||
|
||||
tinymce.PluginManager.add('cpRelatedLinks', function(editor, url) {
|
||||
|
||||
|
||||
editor.addButton('cpRelatedLinks', {
|
||||
image: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAAAdgAAAHYBTnsmCAAAABl0RVh0U29mdHdhcmUAd3d3Lmlua3NjYXBlLm9yZ5vuPBoAAADuSURBVDiNrdKxSkNBEAXQQ3xRUIMIUVIHbaxsA7baiiBWFlb+hI12/kUqwUKxE1OlCiIIfoCC1mJrk4ha7IYs4fHiUy8su3vZuTtzZ/gjpkq8reAQfbz+5rMWvnCTktkPg3ewFs8z42kVYRXnuEQt4Rs4wVwm+FBHNWY0wBb2sCnfp13c4R2u0MWLUONp3MfXkO+mShnWY3AZVLGPt0keTESGByyWjBugTTDoAtf4xH2832IaTaNO9bAhlDuPJTymqs/4wELCreAsiqcmNnCM2VTgSWhNHrZxJKcLKZYVezEc5U7Bm0JUcGA00v+Db96IMBKttlI2AAAAAElFTkSuQmCC',
|
||||
tooltip: 'Related Links',
|
||||
onclick: onAction
|
||||
});
|
||||
|
||||
function onAction() {
|
||||
|
||||
editor.windowManager.open({
|
||||
title: 'Create Related Links',
|
||||
width: 410,
|
||||
height: 155,
|
||||
body: [
|
||||
{type: 'textbox', name: 'title', label: 'Title', value: 'Related'},
|
||||
{type: 'textbox', name: 'link', label: 'Link'},
|
||||
{type: 'textbox', name: 'linkTitle', label: 'Link text'}
|
||||
],
|
||||
onsubmit: function(e) {
|
||||
let html = '<p><span class="related-single">' + e.data.title + ': <a href="' + e.data.link + '">' + e.data.linkTitle + '</a></span></p>';
|
||||
editor.insertContent(html);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
/*
|
||||
|
||||
tinymce.PluginManager.add('example', function(editor, url) {
|
||||
// Add a button that opens a window
|
||||
editor.addButton('example', {
|
||||
text: 'My button',
|
||||
icon: false,
|
||||
onclick: function() {
|
||||
// Open window
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
// Adds a menu item to the tools menu
|
||||
editor.addMenuItem('example', {
|
||||
text: 'Example plugin',
|
||||
context: 'tools',
|
||||
onclick: function() {
|
||||
// Open window with a specific url
|
||||
editor.windowManager.open({
|
||||
title: 'TinyMCE site',
|
||||
url: 'https://www.tiny.cloud/',
|
||||
width: 800,
|
||||
height: 600,
|
||||
buttons: [{
|
||||
text: 'Close',
|
||||
onclick: 'close'
|
||||
}]
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
return {
|
||||
getMetadata: function () {
|
||||
return {
|
||||
name: "Example plugin",
|
||||
url: "http://exampleplugindocsurl.com"
|
||||
};
|
||||
}
|
||||
};
|
||||
});
|
||||
*/
|
||||
Reference in New Issue
Block a user