-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
T/135: Implement a creator with sticky toolbar #152
Merged
Changes from 16 commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
cef7171
Updated package.json with dependencies for the feature.
oleq bdca23a
Updated package.json with dependencies for the feature.
oleq dfe55c2
Updated existing mock creator tests to the new API. Renamed ClassicCr…
oleq a487243
Merge branch 'master' into t/135
Reinmar df21dff
Fixed: Error thrown when building themes because package is compiled …
oleq 39343c4
Moved theme entry point sorting fix to gulp–level in compileThemes.
oleq 4b918c1
Tests: Added test for builder compileThemes util to ensure the order …
oleq 9fa1827
Tests: Updated FramedEditableUIView so it is a child of FramedEditabl…
oleq 2cc73c2
Tests: Updated dependencies in LegacyCreator to include FramedEditabl…
oleq cf57571
Extended documentation of FramedEditableUIIframe and FramedEditableUI…
oleq 16cb8df
Moved width/height bindings from IframeView to FramedEditableUIView.
oleq 119ea0c
Merge branch 'master' into t/135
Reinmar 4322e1a
Updated node-sass in package.json. Removed unused gulp-sass dependency.
oleq 4918153
Updated theme-lark dependency in package.json as t/8 branch joined ck…
oleq 7a29eee
Merge branch 'master' into t/135
Reinmar 1eb795a
Ignored also creator tests – no way to run them in Node.js.
Reinmar 9f5077a
Removed unnecessary console.log in tests.
Reinmar e1626c2
File paths fixes.
Reinmar da920d8
Removed branches from package.json.
Reinmar File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
28 changes: 28 additions & 0 deletions
28
tests/_utils/ui/editableui/framed/framededitableuiiframe.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
/** | ||
* @license Copyright (c) 2003-2016, CKSource - Frederico Knabben. All rights reserved. | ||
* For licensing, see LICENSE.md. | ||
*/ | ||
|
||
'use strict'; | ||
|
||
import EditableUI from '/ckeditor5/ui/editableui/editableui.js'; | ||
|
||
/** | ||
* The basic implementation of an iframe-based {@link ui.editableUI.EditableUI}. | ||
* | ||
* @memberOf ui.editableUI.iframe | ||
* @extends ui.editableUI.EditableUI | ||
*/ | ||
export default class FramedEditableUIIframe extends EditableUI { | ||
/** | ||
* Creates a new instance of the iframe–based {@link ui.editableUI.EditableUI EditableUI}. | ||
* | ||
* @param {ckeditor5.Editor} editor The editor instance. | ||
* @param {utils.Observable} editableModel The model for the editable. | ||
*/ | ||
constructor( editor, editableModel ) { | ||
super( editor, editableModel ); | ||
|
||
this.viewModel.bind( 'width', 'height' ).to( editor.ui ); | ||
} | ||
} |
104 changes: 104 additions & 0 deletions
104
tests/_utils/ui/editableui/framed/framededitableuiiframeview.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,104 @@ | ||
/** | ||
* @license Copyright (c) 2003-2016, CKSource - Frederico Knabben. All rights reserved. | ||
* For licensing, see LICENSE.md. | ||
*/ | ||
|
||
'use strict'; | ||
|
||
import IframeView from '/ckeditor5/ui/iframe/iframeview.js'; | ||
import FramedEditableUIView from './framededitableuiview.js'; | ||
|
||
/** | ||
* The basic implementation of an {@link ui.iframe.IframeView IframeView}-based | ||
* {@link ui.editableUI.EditableUIView}. | ||
* | ||
* @memberOf ui.editableUI.iframe | ||
* @extends ui.iframe.IframeView | ||
*/ | ||
export default class FramedEditableUIIframeView extends IframeView { | ||
/** | ||
* Creates a new instance of the {@link ui.iframe.IframeView IframeView}–based | ||
* {@link ui.editableUI.EditableUIView EditableUIView}. | ||
* | ||
* @param {utils.Observable} [model] (View)Model of this View. | ||
* @param {utils.Locale} [locale] The {@link ckeditor5.Editor#locale editor's locale} instance. | ||
*/ | ||
constructor( model, locale ) { | ||
super( model, locale ); | ||
|
||
const bind = this.attributeBinder; | ||
|
||
this.template.attributes.class.push( 'ck-editor__editable-iframe' ); | ||
this.template.attributes.style = [ | ||
'width:', | ||
bind.to( 'width', ( w ) => `${w}px` ), | ||
';', | ||
'height:', | ||
bind.to( 'height', ( h ) => `${h}px` ) | ||
]; | ||
|
||
this.on( 'loaded', this._iframeLoaded, this ); | ||
|
||
/** | ||
* A view which represents the editable `<body>` element within the iframe. | ||
* | ||
* @private | ||
* @member {FramedEditableUIView} ui.editableUI.iframe#_innerView | ||
*/ | ||
} | ||
|
||
/** | ||
* This getter exposes the {@link ui.editable.EditableUIView#editableElement}. It points to the | ||
* `<body>` inside the `<iframe>` document, which is provided by `FramedEditableUIView`. | ||
*/ | ||
get editableElement() { | ||
return this._innerView.editableElement; | ||
} | ||
|
||
/** | ||
* Destroys the View instance and child {@link _innerView}. | ||
*/ | ||
destroy() { | ||
super.destroy(); | ||
|
||
return this._innerView.destroy(); | ||
} | ||
|
||
/** | ||
* When the iframe is loaded, it creates a child view out of <body> element | ||
* and initializes it. Element of this view is exposed through {@link editableElement}. | ||
* | ||
* @protected | ||
*/ | ||
_iframeLoaded() { | ||
this._innerView = new FramedEditableUIView( | ||
this.model, | ||
this.locale, | ||
this.element.contentDocument.body | ||
); | ||
|
||
this._innerView.init(); | ||
|
||
this._iframeDeferred.resolve(); | ||
} | ||
} | ||
|
||
/** | ||
* The view model interface for FramedEditableUIView. | ||
* | ||
* @memberOf ui.editableUI.iframe | ||
* @interface FramedEditableUIViewModel | ||
* @mixes utils.ObservableMixin | ||
*/ | ||
|
||
/** | ||
* The width of the iframe. | ||
* | ||
* @member {Number} ui.editableUI.iframe.FramedEditableUIViewModel#width | ||
*/ | ||
|
||
/** | ||
* The height of the iframe. | ||
* | ||
* @member {Number} ui.editableUI.iframe.FramedEditableUIViewModel#height | ||
*/ |
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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is bad... We need to find a better solution, which would be an object format for styles. We can't rewrite all styles every time. I'll create a followup for this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Beside, it doesn't do anything with the editor – it only resizes the iframe while the container stays at 100%. But this will need to be addressed once we'll be working on real support for resizing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As for the followup: https://github.com/ckeditor/ckeditor5-ui/issues/27