Skip to content
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

Fully Modularised Toolbar #42

Closed
SimeonC opened this issue Dec 3, 2013 · 7 comments
Closed

Fully Modularised Toolbar #42

SimeonC opened this issue Dec 3, 2013 · 7 comments
Milestone

Comments

@SimeonC
Copy link
Collaborator

SimeonC commented Dec 3, 2013

This is a light spec for the feature requested in #40 and #41.

textAngular as it stands has all the buttons in the toolbar as customisable plugins that the user can change at will. The core issue raised in #40 and #41 is that the toolbar itself cannot be customised so easily.

In short there were 2 requests:

To solve these I think the following needs to be done:

  • Allow init of toolbar and editors independently.
  • Editor toolbar target option, if not set it will init a new toolbar specifically for the editor. This allows for Toolbar A to be used for editor 1, 2 and 3, then toolbar B for editor 4.
  • Add additional events to the editor, to start with onSelectRange, onFocusIn and onFocusOut. (mostly these will be convenience functions as you should be able to do those three already with custom code outside of textAngular).

Potential Issues:

  • Active buttons logic (i.e. setting the B button as depressed when caret/cursor is in Bold text).
  • Detecting which editor is focussed when applying styles.
  • Disabling editors when NOT in focus.
  • This can have some UX issues when you have multiple text areas for one toolbar.

Anyone else have any thoughts?

@bastienJS
Copy link

Hello Simeon,

Thank you for accepting my feature request. Some years ago I have made the same feature request for the free WPF RichTextBox from Microsoft which is used by the WPF toolkit on codeplex. It got also implemented and the people liked it so they will like your control when you have implemented it :)

I really vote for the convenience functions ;-) about the rest I agree.

About what UX issues do you speak?
like
"should all other text areas be disabled" when the user has clicked in one certain text area" ? or
"should a "Bold" button have a pressed state when in multiple text areas is selected text and to which text selection does the active Bold button refer" ?

@SimeonC
Copy link
Collaborator Author

SimeonC commented Dec 3, 2013

No I was thinking more around if you use multiple toolbars, say if you wanted editor instances 1 and 2 to have ability to toggle HTML then editors 3 and 4 to only have bold/italics then there is the possibility for user confusion on which toolbar is active for my current editor.
I think the best way to deal with this is to make sure that for every state change there is a corresponding class change in all relevant places.

As to your second point, as we use contenteditable areas I don't think you can select text in more than one editor at a time (I haven't tested this thou).

@bastienJS
Copy link

"I don't think you can select text in more than one editor at a time "

True just checked it.

"...then there is the possibility for user confusion on which toolbar is active for my current editor...."

Well I would say I have to operate on the one toolbar placed over the text editor?

@SimeonC
Copy link
Collaborator Author

SimeonC commented Dec 3, 2013

"Well I would say I have to operate on the one toolbar placed over the text editor?"

I was getting at this change has the potential to have toolbars placed in funny places relative to editors (for whatever reason). Also even if the toolbars are sensibly placed we'd still want to make a class change to the active toolbar so that the developer can make a visual update via css/js if they want.
In thinking it through, all UX issues that could be introduced can be mitigated by the developer if we put enough transparency and clarity in events being fired.

@bastienJS
Copy link

Yes Yes Yes think it throught you can do it man. If you need free beer lemme know ;-)

@SimeonC
Copy link
Collaborator Author

SimeonC commented Dec 5, 2013

How about more time, I could do with that :). In all likely-hood it will take me until Feb 2014 to look into this as I'm on leave very soon. If anyone else does this @fraywing should be able to look into it as a pull request if he gets the time. Otherwise it'll take some time before I start.

SimeonC pushed a commit that referenced this issue Jan 10, 2014
Fixed some scoping.
Multi-Toolbar Functionality #42, #41, #40,  (Includes functionality for #56)
SimeonC pushed a commit that referenced this issue Jan 10, 2014
…uccessful, no notes in README or anything yet)

Fixes into #42
Changed .bower.json to bower.json as in #66, also included devDependancies for running the tests
SimeonC pushed a commit that referenced this issue Jan 13, 2014
Updated grunt uglifier.
Added textAngular-sanitize.js. This is a fork of angular-sanitise.js that specifically allows style attributes ONLY with the colour option, all others will be stripped out. #62
Fixing and testing of Uglified Output #60
Finished Implementation of #42 - there is a deferred promise sequence to the action of the toolbar button now, this allows us to use custom popups in theory. Still need to save and recall the selection manually atm.
@SimeonC
Copy link
Collaborator Author

SimeonC commented Jan 30, 2014

Implemented in 1.2.0 branch.

@SimeonC SimeonC closed this as completed Jan 30, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants