8000 Font size change is not permanent · Issue #2 · andrewnicols/moodle-atto_fontsize · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Font size change is not permanent #2

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

Open
hartmut1s opened this issue Aug 26, 2014 · 7 comments
Open

Font size change is not permanent #2

hartmut1s opened this issue Aug 26, 2014 · 7 comments

Comments

@hartmut1s
Copy link

Hi Andrew,

I just installed the plugin font size in Moodle 2.7+ (Build: 20140703). In the text editor I can't see any change in the code when I toggle to plain text in Google Chrome. Same result in Mozilla Firefox. There is a change of the font size, but it doesn't "stick" or it's not applied properly, meaning I can see the change in the text editor before I toggle to plain text or save the text.

With kind regards,

Hartmut

@dgmorrow
Copy link
dgmorrow commented Sep 8, 2014

Greetings,
I have the same issue as Harmut. We are on 2.7.1 (Build: 20140714). I am looking forward to any solution or update - it will be a really nice addition.
Respectfully,
David

@ndunand
Copy link
ndunand commented Sep 15, 2014

Same here, using Moodle 20140908.

@andrewnicols
Copy link
Owner

Hi all,

Sorry about the delay. I was away and then forgot to comment on this issue. Thanks for bringing it to my attention.

This is actually (and frustratingly) an issue with Atto. It's currently removing the font tag entirely. I'm going to chat to Damyon about the best approach here and then I'll update things.

Andrew

@thedannywahl
Copy link

Andrew,
I'm wondering if Atto strips the font tag because it's deprecated: Alignment, font styles, and horizontal rules

I think if you changed moodle-atto_fontsize-button.js#L66 to the following:

text: '<span style="'font-size: + size.name + ;'">' + size.name + '</span>'

Unfortunately I'm not sure off-hand if a span is a semantically appropriate replacement. Notice the dual use of 'size.name' as CSS uses the name value, not the integer value.

@ndunand
Copy link
ndunand commented Oct 16, 2014

As stated in #4 (comment), this part of the code only affects the drop-down menu itself (at button.js#L76), whereas the actual command sent to the editor is button.js#L89.

@thedannywahl
Copy link

Like I said, untested 😛
anyways, looking at the document.execCommand() method specification we should probably be setting useCSS() or styleWithCSS() to use style instead of a tag.

Unfortunately it looks like the support for this across different browsers is pretty lousy:
http://www.quirksmode.org/dom/execCommand.html#t010
http://www. 9850 quirksmode.org/dom/execCommand/

for example this http://codepen.io/thedannywahl/pen/KjnFv?editors=101
inserts a tag in firefox and a in chrome...

tl;dr- I would call this a browser problem, not a plugin problem or a moodle problem.

that said my suggestion is 1) to make sure useCSS() and styleWithCSS() are set for browsers that support it

@thedannywahl
Copy link

as always with Moodle there's a method for that: enableCssStyling, example

pauln added a commit to pauln/moodle-atto_fontsize that referenced this issue Nov 9, 2014
Switch to formatSelectionInlineStyle rather than 'fontsize' command.
Note that the sizes are smaller than in the original font-tag based
approach, but CSS font-sizes don't go up to xxx-large.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants
0