first commit

This commit is contained in:
2024-11-11 18:46:54 +01:00
commit a630d17338
25634 changed files with 4923715 additions and 0 deletions

View File

@@ -0,0 +1,7 @@
// Exports the "lineheight" plugin for usage with module loaders
// Usage:
// CommonJS:
// require('tinymce/plugins/lineheight')
// ES2015:
// import 'tinymce/plugins/lineheight'
require('./plugin.js');

View File

@@ -0,0 +1,3 @@
tinymce.addI18n('de', {
"Line Height": "Zeilen Höhe"
});

View File

@@ -0,0 +1,55 @@
!(function() {
'use strict';
/* eslint-disable no-undef */
const global = tinymce.util.Tools.resolve('tinymce.PluginManager');
global.add('lineheight', function(editor) {
editor.on('init', function() {
editor.formatter.register({
lineheight: {
selector: 'p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li,table',
styles: { 'line-height': '%value' }
}
});
editor.ui.registry.addIcon(
'line-height',
`
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24">
<path d="M9.984 12.984v-1.969h12v1.969h-12zM9.984 18.984v-1.969h12v1.969h-12zM9.984 5.016h12v1.969h-12v-1.969zM6 6.984v10.031h2.484l-3.469 3.469-3.516-3.469h2.484v-10.031h-2.484l3.516-3.469 3.469 3.469h-2.484z"></path>
</svg>
`
);
});
editor.ui.registry.addMenuButton('lineheightselect', {
tooltip: 'Line height',
icon: 'line-height',
fetch: function(callback) {
const defaultLineHeightFormats = '1 1.5 1.75 2 3 4 5';
const userSettings = editor.settings.lineheight_formats;
const lineheightFormats = typeof userSettings === 'string' ? userSettings : defaultLineHeightFormats;
const items = lineheightFormats.split(' ').map(item => {
let text = item,
value = item;
const values = item.split('=');
if (values.length > 1) {
[text, value] = values;
}
return {
type: 'menuitem',
text: text,
onAction: function() {
editor.formatter.apply('lineheight', { value: value });
editor.fire('change', {});
}
};
});
callback(items);
}
});
});
})();

View File

@@ -0,0 +1,55 @@
!(function() {
'use strict';
/* eslint-disable no-undef */
const global = tinymce.util.Tools.resolve('tinymce.PluginManager');
global.add('lineheight', function(editor) {
editor.on('init', function() {
editor.formatter.register({
lineheight: {
selector: 'p,h1,h2,h3,h4,h5,h6,td,th,div,ul,ol,li,table',
styles: { 'line-height': '%value' }
}
});
editor.ui.registry.addIcon(
'line-height',
`
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24">
<path d="M9.984 12.984v-1.969h12v1.969h-12zM9.984 18.984v-1.969h12v1.969h-12zM9.984 5.016h12v1.969h-12v-1.969zM6 6.984v10.031h2.484l-3.469 3.469-3.516-3.469h2.484v-10.031h-2.484l3.516-3.469 3.469 3.469h-2.484z"></path>
</svg>
`
);
});
editor.ui.registry.addMenuButton('lineheightselect', {
tooltip: 'Line height',
icon: 'line-height',
fetch: function(callback) {
const defaultLineHeightFormats = '1 1.5 1.75 2 3 4 5';
const userSettings = editor.settings.lineheight_formats;
const lineheightFormats = typeof userSettings === 'string' ? userSettings : defaultLineHeightFormats;
const items = lineheightFormats.split(' ').map(item => {
let text = item,
value = item;
const values = item.split('=');
if (values.length > 1) {
[text, value] = values;
}
return {
type: 'menuitem',
text: text,
onAction: function() {
editor.formatter.apply('lineheight', { value: value });
editor.fire('change', {});
}
};
});
callback(items);
}
});
});
})();

View File

@@ -0,0 +1 @@
(function(e){e.PluginManager.add("lineheight",function(t,n,r){t.on("init",function(){t.formatter.register({lineheight:{inline:"span",styles:{"line-height":"%value"}}})});t.addButton("lineheightselect",function(){var n=[],r="8pt 10pt 12pt 14pt 18pt 24pt 36pt";var i=t.settings.lineheight_formats||r;i.split(" ").forEach(function(e){var t=e,r=e;var i=e.split("=");if(i.length>1){t=i[0];r=i[1]}n.push({text:t,value:r})});return{type:"listbox",text:"Line Height",tooltip:"Line Height",values:n,fixedWidth:true,onPostRender:function(){var e=this;t.on("nodeChange",function(r){var i="lineheight";var s=t.formatter;var o=null;r.parents.forEach(function(e){n.forEach(function(t){if(i){if(s.matchNode(e,i,{value:t.value})){o=t.value}}else{if(s.matchNode(e,t.value)){o=t.value}}if(o){return false}});if(o){return false}});e.value(o)})},onselect:function(t){e.activeEditor.formatter.apply("lineheight",{value:this.value()})}}})});e.PluginManager.requireLangPack("lineheight","de")})(tinymce)