diff --git a/src/CKEditorForMendix/widget/lib/plugins/mendixlink/dialogs/mendixlink.js b/src/CKEditorForMendix/widget/lib/plugins/mendixlink/dialogs/mendixlink.js index 9e5f2cb..648095b 100644 --- a/src/CKEditorForMendix/widget/lib/plugins/mendixlink/dialogs/mendixlink.js +++ b/src/CKEditorForMendix/widget/lib/plugins/mendixlink/dialogs/mendixlink.js @@ -3,7 +3,7 @@ /*mendix */ CKEDITOR.dialog.add( 'mendixlinkDialog', function( editor ) { 'use strict'; - + return { title: 'Mendix Link Properties', minWidth: 400, @@ -18,7 +18,8 @@ CKEDITOR.dialog.add( 'mendixlinkDialog', function( editor ) { type: 'text', id: 'mxlinklabel', label: 'Label of link', - + className: 'mx-ckeditor-mxlink-labelText', + setup: function (element) { this.setValue(element.getText()); }, @@ -30,28 +31,29 @@ CKEDITOR.dialog.add( 'mendixlinkDialog', function( editor ) { type: 'select', id: 'mxlink', label: 'Microflow with name to execute', + className: 'mx-ckeditor-mxlink-microflowSelect', items: (function () { var data = [], i = null; - + // Create an array that contains all the values a person can pick. if ( typeof editor.mendixWidgetConfig !== 'undefined' && typeof editor.mendixWidgetConfig.microflowLinks !== 'undefined' ){ //console.log(editor); - + for (i = 0; i < editor.mendixWidgetConfig.microflowLinks.length; i++){ data.push( [ editor.mendixWidgetConfig.microflowLinks[i].functionNames ] ); } - + } - + return data; - + }()), 'default': '', - + setup: function(element) { // Get the value set on the link. - + if (typeof element.$ !== 'undefined'){ var onclickValue = element.$.attributes['data-cke-pa-onclick'].value; this.setValue(onclickValue.split('CKEditorViewer.mf.exec(\'').join('').split('\', \'__ID__\', \'__GUID__\');').join('')); @@ -61,7 +63,7 @@ CKEDITOR.dialog.add( 'mendixlinkDialog', function( editor ) { }, commit: function(element) { - // Set the value on the link + // Set the value on the link element.setAttribute('href', '__LINK__'); element.setAttribute('onclick', 'CKEditorViewer.mf.exec(\'' + this.getValue() + '\', \'__ID__\', \'__GUID__\');'); } @@ -70,8 +72,9 @@ CKEDITOR.dialog.add( 'mendixlinkDialog', function( editor ) { type: 'text', id: 'mxclass', label: 'CSS Classes on link', + className: 'mx-ckeditor-mxlink-cssText', 'default': 'btn btn-default mx-button', - + setup: function (element) { // Get the value of the class attribute of the link. this.setValue(element.getAttribute('class').split('mx-microflow-link').join('')); @@ -86,7 +89,8 @@ CKEDITOR.dialog.add( 'mendixlinkDialog', function( editor ) { type: 'text', id: 'mxtitle', label: 'Title text on link', - + className: 'mx-ckeditor-mxlink-titleText', + setup: function (element) { // Get the value of the title attribute of the link. this.setValue(element.getAttribute('title')); diff --git a/test/widgets/CKEditorForMendix.mpk b/test/widgets/CKEditorForMendix.mpk index f75fafc..9bf1a48 100644 Binary files a/test/widgets/CKEditorForMendix.mpk and b/test/widgets/CKEditorForMendix.mpk differ