In the Trumbowyg editor, what's the difference between the built in undo/redo and the History plugin? - trumbowyg

I've read the doc and tried the demo, but I can't tell the difference between the built in undo/redo and the History plugin.
The default buttons are:
['undo', 'redo'],
The plugin buttons are:
['historyUndo','historyRedo'],

I've now noticed two differences:
With the plugin, the undo/redo buttons are greyed out and unclickable if there are no changes to undo or redo, which is a good improvement. The default undo/redo buttons are not greyed out.
With the plugin, it one undo/redo removes or re-adds whole words. The default does a single character or a few characters at a time, seemingly inconsistently.
Curiously, if both the default and plugin buttons are displayed, then clicking either of the default undo/redo buttons will make the plugin's undo button clickable as if there is a change to undo.

Related

Eclipse Scout Neon hide settings icon on table field

I would like to know how to hide settings wheel icon in header of table field.
Note: At the time of writing, Eclipse Scout Neon is not yet released.
From browsing the source code I did not see a convenient getConfigured... method to quickly hide that menu.
Fear not, you have two options to do so anyway.
The menu you wish to get rid of is the OrganizeColumnsMenu.
Override execInitTable on your table and hide the menu:
getMenuByClass(OrganizeColumnsMenu.class).setVisibleGranted(false);
Alternatively, override addHeaderMenus(OrderedCollection<IMenu> menus) and either remove the menu added by the default implementation, or not call the super implementation at all.

Ckeditor: outdent icon is disabled when none-text

In ckeditor, when textarea has notext, outdent icon is being disabled. I researched but can't find any solution (I Know that I couldn't look at right where :) ).
How can I do available this icon?
At ckeditor's web-site this icon is available. (http://ckeditor.com/addon/tweetabletext at the bottom of page-comment area)
Thanks..
As written on the Indent plugin page, the indenting functionality is split into two parts: indenting lists and indenting blocks, both handled by separate plugins.
The CKEditor package that you use apparently contains only the Indent and Indent List plugins, but does not contain the Indent Block plugin, so the buttons are disabled for text blocks. See the installation packages comparison here. Download another preset (Full) or use CKBuilder to add the missing plugin to your package and create a custom build.

Programmatically change bold, underline, italic of text selection using CKEditor API

I'm using my own UI to drive CKEditor's API. The following API works to toggle the selected text with bold and italic respectively, but does not work for underline.
editorInstance.execCommand( 'bold' );
editorInstance.execCommand( 'italic' );
editorInstance.execCommand( 'underline' ); // does not work
I've checked the source and have verified that the underline command is indeed present.
How do I programmatically underline selected text using CKEditor?
You're dealing here with the Advanced Content Filter. Precisely with its effect on commands' states. In the standard preset, which I assume you use, the Underline button is removed from toolbar and therefore the related command is disabled. When command is disabled, it cannot be executed.
You can verify this with:
editor.getCommand( 'underline' ).state == CKEDITOR.TRISTATE_DISABLED;
I anticipate that you'll try to remove the entire toolbar plugin. To save you some time - it's the toolbar plugin what registers most of the features (by registering enabled buttons). So if you remove the toolbar, then all features (commands are part of features) which are registered this way will be disabled. You should find this guide helpful - Plugins integration with the ACF.

How to Change Style of CheckBox Control

I have a Checkbox in my application, and it is meant to be checked, but also disabled. When disabled, I've noticed that the foreground of the checkbox as well as the content textbox are a darker color than when enabled. I would like to leave the checkbox disabled, but change the foreground of the content textbox to the same color as when the checkbox is disabled. How might I accomplish this?
Methed you have to learn how to edit your existing/default style of your control. I can't give you the exact which will work for your but you can use Blend or Visual Studio to edit a copy of a control's current template by right clicking on the control and then selecting Edit Style, Edit Template or Edit Additional Templates as appropriate. In the submenu, you can select Edit a Copy... which will present a window that allows you to create a copy of the default (or current template/stlye if you have already modified it) and customize it.
Here is a basic tutorial for this http://www.jeff.wilcox.name/2010/08/using-blend-to-find-default-style-xaml/

Can the editor state be sync'd with the button state for basic styles

When deleting a text block with a basic style applied, the editor remains in the active state (bold, for example) while the button for that style is deactivated. Typing a character will reactivate the button.
I have verified that this is occurs on the CKEditor demo as well, so it shouldn't be related to any changes in our installation.
Steps to reproduce:
Use standard CKEditor: http://ckeditor.com/demo#standard
Select all and delete existing contents
Type 'Hello, World'
Select 'World'
Click 'Bold' button (or Ctrl+B)
Move cursor to end of content
Remove via backspace until bold content is removed
This results in the button displaying as inactive (default state), but typing any content will enter the text in bold and reactivate the button.
I've reproduced this (with slightly different rules regarding blank content and trailing spaces) on Chrome, Firefox, and IE10.
Is there a way to pull the state at which new content would be entered into the editor and use that to update the button state so that a user can see what their entered content will input as?
I know this TC very well:
delete entire bold, bold button is inactive,
start typing again,
bold is applied :|
It occurs on Webkit (Chrome and Safari) because of a very ugly behaviour of Webkit's contenteditable behaviour.
This is reported here:
http://dev.ckeditor.com/ticket/9998 - CKEditor (ticket grouping all Webkit's backspace handling bugs)
https://code.google.com/p/chromium/issues/detail?id=226941 - Chromium
https://bugs.webkit.org/show_bug.cgi?id=114791 - Webkit
Unfortunately neither Chromium's nor Webkit's developers replied and perhaps as most of the contenteditable bugs, this one won't be fixed soon (there are critical issues that haven't been fixed for years). So perhaps, in the near future we'll fix this on the CKEditor's side by overriding entire backspace logic with our own. Then such issues should not exist.
PS. Regarding the rest of the browsers I know that there are small inconsistencies, but you won't be able to fix them. Like for the Webkit's bug, to fix these cases we need to create custom backspace handling.

Resources