Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
najiu-admin-template
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
najiu-frontend
najiu-admin-template
Commits
8a98225c
Commit
8a98225c
authored
Oct 26, 2020
by
vben
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
chore(tinymec): remove lineHeight
parent
2be166d6
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
49 additions
and
48 deletions
+49
-48
Editor.vue
src/components/Tinymce/src/Editor.vue
+3
-3
lineHeight.js
src/components/Tinymce/src/lineHeight.js
+0
-44
lineHeight.ts
src/components/Tinymce/src/lineHeight.ts
+45
-0
plugins.ts
src/components/Tinymce/src/plugins.ts
+1
-1
No files found.
src/components/Tinymce/src/Editor.vue
View file @
8a98225c
...
...
@@ -23,7 +23,7 @@
import
{
useScript
}
from
'
/@/hooks/web/useScript
'
;
import
{
snowUuid
}
from
'
/@/utils/uuid
'
;
import
{
bindHandlers
}
from
'
./helper
'
;
import
L
ineHeight
from
'
./lineHeight
'
;
// import l
ineHeight from './lineHeight';
const
CDN_URL
=
'
https://cdn.bootcdn.net/ajax/libs/tinymce/5.5.1
'
;
...
...
@@ -71,7 +71,7 @@
advlist_number_styles
:
'
default
'
,
object_resizing
:
false
,
fontsize_formats
:
'
10px 11px 12px 14px 16px 18px 20px 24px 36px 48px
'
,
lineheight_formats
:
"
1 1.5 1.75 2.0 3.0 4.0 5.0
"
,
lineheight_formats
:
'
1 1.5 1.75 2.0 3.0 4.0 5.0
'
,
...
options
,
setup
:
(
editor
:
any
)
=>
{
editorRef
.
value
=
editor
;
...
...
@@ -120,7 +120,7 @@
}
function
initEditor
()
{
getTinymce
().
PluginManager
.
add
(
'
lineHeight
'
,
L
ineHeight
(
getTinymce
()));
// getTinymce().PluginManager.add('lineHeight', l
ineHeight(getTinymce()));
getTinymce
().
init
(
unref
(
initOptions
));
}
...
...
src/components/Tinymce/src/lineHeight.js
deleted
100644 → 0
View file @
2be166d6
const
LineHeight
=
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
.
ui
.
registry
.
addMenuButton
(
'
lineheight
'
,
{
icon
:
'
lineheight
'
,
tooltip
:
'
设置行高
'
,
fetch
:
function
(
callback
)
{
var
dom
=
t
.
dom
;
var
blocks
=
t
.
selection
.
getSelectedBlocks
();
var
lhv
=
0
;
global
$1
.
each
(
blocks
,
function
(
block
)
{
if
(
lhv
==
0
)
{
lhv
=
dom
.
getStyle
(
block
,
'
line-height
'
)
?
dom
.
getStyle
(
block
,
'
line-height
'
)
:
0
;
}
});
var
items
=
lineheight_val
.
split
(
'
'
).
map
(
function
(
item
)
{
var
text
=
item
;
var
value
=
item
;
return
{
type
:
'
togglemenuitem
'
,
text
:
text
,
active
:
lhv
==
value
?
true
:
false
,
onAction
:
function
()
{
doAct
(
value
);
},
};
});
callback
(
items
);
},
});
});
e
.
PluginManager
.
requireLangPack
(
'
lineheight
'
,
'
de
'
);
};
export
default
LineHeight
;
src/components/Tinymce/src/lineHeight.ts
0 → 100644
View file @
8a98225c
const
lineHeight
=
function
(
tinymce
:
any
)
{
tinymce
.
PluginManager
.
add
(
'
lineheight
'
,
function
(
t
:
any
)
{
t
.
on
(
'
init
'
,
function
()
{
t
.
formatter
.
register
({
lineheight
:
{
inline
:
'
span
'
,
styles
:
{
'
line-height
'
:
'
%value
'
,
},
},
});
});
t
.
ui
.
registry
.
addMenuButton
(
'
lineheight
'
,
{
icon
:
'
lineheight
'
,
tooltip
:
'
设置行高
'
,
// fetch: function (callback: Fn) {
// var dom = t.dom;
// var blocks = t.selection.getSelectedBlocks();
// var lhv = 0;
// global$1.each(blocks, function (block: any) {
// if (lhv == 0) {
// lhv = dom.getStyle(block, 'line-height') ? dom.getStyle(block, 'line-height') : 0;
// }
// });
// var items = lineheight_val.split(' ').map(function (item) {
// var text = item;
// var value = item;
// return {
// type: 'togglemenuitem',
// text: text,
// active: lhv == value ? true : false,
// onAction: function () {
// doAct(value);
// },
// };
// });
// callback(items);
// },
});
});
tinymce
.
PluginManager
.
requireLangPack
(
'
lineheight
'
,
'
de
'
);
};
export
default
lineHeight
;
src/components/Tinymce/src/plugins.ts
View file @
8a98225c
...
...
@@ -4,7 +4,7 @@
// colorpicker/contextmenu/textcolor plugin is now built in to the core editor, please remove it from your editor configuration
const
plugins
=
[
'
advlist anchor autolink autosave code codesample directionality emoticons fullscreen hr image imagetools insertdatetime link lists media nonbreaking noneditable pagebreak paste preview print save searchreplace spellchecker tabfocus table template textpattern visualblocks visualchars wordcount
'
,
'
lineheight
advlist anchor autolink autosave code codesample directionality emoticons fullscreen hr image imagetools insertdatetime link lists media nonbreaking noneditable pagebreak paste preview print save searchreplace spellchecker tabfocus table template textpattern visualblocks visualchars wordcount
'
,
];
export
default
plugins
;
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment