src/pyams_content/skin/resources/js/tinymce/onflinks/plugin.js
changeset 1070 ea0c7ac589c4
parent 1069 abd11be23718
child 1071 e202798d3732
equal deleted inserted replaced
1069:abd11be23718 1070:ea0c7ac589c4
     1 tinymce.PluginManager.add('internal_links', function(editor, url) {
       
     2 
       
     3 	editor.addButton('internal_links', {
       
     4 		icon: 'cloud-check',
       
     5 		tooltip: "Insert internal link",
       
     6 		image: '/--static--/pyams_content/img/external.png',
       
     7 		onclick: function() {
       
     8 			editor.windowManager.open({
       
     9 				title: "Insert internal link",
       
    10 				body: [
       
    11 					{type: 'textbox', name: 'title', label: 'Link title', value: editor.selection.getContent()},
       
    12 					{type: 'textbox', name: 'oid', label:'Internal number'}
       
    13 				],
       
    14 				onsubmit: function(e) {
       
    15 					editor.insertContent('<a href="oid://' + e.data.oid + '">' + e.data.title + '</a>');
       
    16 				}
       
    17 			});
       
    18 		}
       
    19 	})
       
    20 });