hello
first sorry for my english :)
When implemented in an existing system , I have two problems . I hope to get the crucial tip to solve here .
So far, the plugin "link" and " image2 " have been adjusted accordingly in the source code . Now I want to make the changes within CKEDITOR.on( 'dialogDefinition', function (ev )
problems :
1. The language files from the plugin embed - I 've tried using
var commonlang = ev.lang.common,
linklang = ev.lang.link;
but does not work . How to call here the necessary data ?
2. The cms itself calls defined function-names to take over url 's . The functions of this I wrote previously in the dialog.js by the plugin.
But if I write the functions now within CKEDITOR.on ('dialogDefinition', function (ev ) , they are not global. In the global scope but I can not write because two different functions have the same name. Names change I can not , because it is so in the system.
How can I solve that?
example in dialog.js (works):
.....
});// end dialog.js
//my Functions
function insertFileLink(link) {
jQuery('.rex-url input').val("/" + link);
}
function getParam(variable){
var query = window.location.search.substring(1);
var vars = query.split("&");
for (var i=0;i<vars.length;i++) {
var pair = vars[i].split("=");
if(pair[0] == variable){return pair[1];}
} return(false);
}
example in dialogDefinition (does not work):
jQuery(document).ready(function($) {
CKEDITOR.on('dialogDefinition', function(ev) {
var dialogName = ev.data.name;
var dialogTabs = ev.data.definition;
if (dialogName == 'image2') {
imagefunc = true;
var infoTab = dialogTabs.getContents('info');
var src = infoTab.get('src');
src['className'] = 'rex-url';
infoTab.add({
type: 'button',
id: 'medialink',
label: 'Medienpool Link',
align: 'center',
style: 'display:inline-block;margin-top:14px;',
onClick: function() {
openMediaPool('TINY');
}
});
function insertFileLink(link) {
jQuery('.rex-url input').val("/" + link);
}
function getParam(variable) {
var query = window.location.search.substring(1);
var vars = query.split("&");
for (var i = 0; i < vars.length; i++) {
var pair = vars[i].split("=");
if (pair[0] == variable) {
return pair[1];
}
}
return(false);
}
}//endif
});
});
I hope you understand what I mean :)
