/
functions.js
35 lines (32 loc) · 1.13 KB
/
functions.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
$(document).ready(function()
{
$('.content-area')
.on('click', 'a[href]', function(event) {
event.preventDefault();
var url = $(this).attr('href'),
title = '';
if ($(this).parent('td').length > 0) {
title = $(this).parent('td').next().find('input').val();
}
parent.tinymce.activeEditor.windowManager.getParams().oninsert(url, {alt: title});
parent.tinymce.activeEditor.windowManager.close();
})
.on('hover', 'a[href]', function() {
$(this).prop('title', 'Click to insert');
});
if ($('#links').length > 0)
{
$('#links').fancytree({
click: function(event, data) {
if (data.targetType === 'title') {
parent.tinymce.activeEditor.windowManager.getParams().oninsert(data.node.data.href, {title: data.node.title});
parent.tinymce.activeEditor.windowManager.close();
}
},
extensions: ['glyph'],
glyph: {
preset: "awesome4",
}
});
}
});