Last active
August 27, 2016 17:51
-
-
Save igotit-anything/e5edef3764c2023da48fc9893c38063d to your computer and use it in GitHub Desktop.
JavaScript. CKEditor plugin Dialog basic code. - example: Cy-GistInsert's dialogs/Cy-GistInsertDlg.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
file name : Cy-GistInsertDlg.js | |
CKEditor Plugin "Cy-GistInsert" Dialog | |
by igotit. 2016-08-28. | |
*/ | |
CKEDITOR.dialog.add('Cy-GistInsertDlg', function (editor) { | |
return { | |
title: 'Cy-GistInsert', // text shown titlebar. | |
minWidth: 400, | |
minHeight: 200, | |
contents: [ | |
{ | |
id: 'tab-basic', | |
label: 'Basic Settings', | |
elements: [ | |
// UI elements of the first tab should be defined here. | |
{ | |
type: 'text', | |
id: 'id-gisturi', | |
label: 'GitHub Gist ID', | |
validate: CKEDITOR.dialog.validate.notEmpty("GitHub Gist ID field cannot be empty.") | |
} | |
] | |
}, | |
{ | |
id: 'tab-adv', | |
label: 'Advanced Settings', | |
elements: [ | |
// UI elements of the second tab will be defined here. | |
{ | |
type: 'text', | |
id: 'id-dummy', | |
label: 'title', | |
} | |
] | |
} | |
], | |
onOk: function () { | |
var dialog = this; | |
editor.insertHtml('Test from plugin Cy-GistInsert Dialog text = ' + dialog.getValueOf('tab-basic', 'id-gisturi')); // at now just testing purpose. | |
} | |
}; | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment