diff --git a/ckeditor/ckeditor-tests.ts b/ckeditor/ckeditor-tests.ts index 976b85717..326fe92c6 100644 --- a/ckeditor/ckeditor-tests.ts +++ b/ckeditor/ckeditor-tests.ts @@ -251,4 +251,40 @@ function test_dom_window() { var size = win.getViewPaneSize(); alert(size.width); alert(size.height); -} \ No newline at end of file +} + +function test_adding_dialog_by_path() { + CKEDITOR.dialog.add( 'abbrDialog', this.path + 'dialogs/abbr.js' ); +} + +function test_adding_dialog_by_definition() { + CKEDITOR.dialog.add( 'abbrDialog', function ( editor: CKEDITOR.editor ) { + return { + title: 'Abbreviation Properties', + minWidth: 400, + minHeight: 200, + + contents: [ + { + id: 'tab-basic', + label: 'Basic Settings', + elements: [] + }, + { + id: 'tab-adv', + label: 'Advanced Settings', + elements: [] + } + ] + }; + }); +} + +function test_adding_plugin() { + CKEDITOR.plugins.add( 'abbr', { + icons: 'abbr', + init: function( editor: CKEDITOR.editor ) { + // empty logic + } + }); +} diff --git a/ckeditor/ckeditor.d.ts b/ckeditor/ckeditor.d.ts index a1bb1c481..6a0ed9775 100644 --- a/ckeditor/ckeditor.d.ts +++ b/ckeditor/ckeditor.d.ts @@ -619,6 +619,24 @@ declare module CKEDITOR { } } + interface IPluginDefinition { + hidpi?: boolean; + lang?: any; // should be string | string[] + requires?: any; // should be string | string[]a + afterInit?(editor: editor): any; + beforeInit?(editor: editor): any; + init?(editor: editor): any; + onLoad?(): any; + } + + function add(name: string, definition?: IPluginDefinition): void; + function addExternal(name: string, path: string, fileName: string): void; + function get(name: string): any; + function getFilePath(name: string): string; + function getPath(name: string): string; + function load(name: string, callback: string, scope: any): void; + function setLang(pluginName: string, languageCode: string, languageEntries: any): void; + } @@ -963,4 +981,35 @@ declare module CKEDITOR { addFocusable(element: CKEDITOR.dom.element, index: number): void; } + module tools { + var callFunction: Function; + } + + module dialog { + interface IDialogDefinition { + buttons?: any[]; + contents?: any[]; + height?: number; + minHeight?: number; + minWidth?: number; + onCancel?: Function; + onLoad?: Function; + onOk?: Function; + onShow?: Function; + resizable?: number; + title?: string; + width?: number; + } + + function add(name: string, path: string): void; + function add(name: string, dialogDefinition: IDialogDefinition): void; + function addIframe(name: string, title: string, minWidth: number, + minHeight: number, onContentLoad: Function, userDefinition: any): void; + function addUIElement(typeName: string, builder: Function): void; + function cancelButton(): void; + function exists(name: string): void; + function getCurrent(): void; + function isTabEnabled(editor: editor, dialogName: string, tabName: string): boolean; + function okButton(): void; + } }