Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2015-11-09 18:33:12

philwareham
Core designer
From: Haslemere, Surrey, UK
Registered: 2009-06-11
Posts: 3,564
Website GitHub Mastodon

The do_spellcheck JavaScript

There is some JavaScript that I think enables some sort of spellcheck facility on certain fields of the admin panels. Shouldn’t we actually be using HTML5 spellcheck attributes for this task nowadays – it is supported in all browsers we target and lets the OS/browser do that work natively.

It would mean an extra attribute parameter on function fInput and function text_area that gives us the option of turning it on for specified fields, but that is better IMHO.

One day we will move these functions to a better system such as Classes with arrays of attributes, but short-term I’m OK with adding yet another parameter.

Thoughts?

Offline

#2 2015-11-10 05:00:39

wet
Developer Emeritus
From: Schoerfling, Austria
Registered: 2005-06-06
Posts: 3,323
Website Mastodon

Re: The do_spellcheck JavaScript

philwareham wrote #296517:

There is some JavaScript that I think enables some sort of spellcheck facility

It enables the browser’s native spell-check facility.

Shouldn’t we actually be using HTML5 spellcheck attributes

We do so by setting this attribute on some input and textarea elements.

A hidden preference is used to determine which fields require spellchecks. Plugins may add their own by amending the selectors in the do_spellcheck preference (Default: #page-article #body, #page-article #title, #page-image #alt-text, #page-image #caption, #page-file #description, #page-link #link-title, #page-link #link-description).

Thoughts?

I think it would require quite a bit of effort to refactor this functionality into fInput and text_area.

Offline

#3 2015-11-10 07:13:40

philwareham
Core designer
From: Haslemere, Surrey, UK
Registered: 2009-06-11
Posts: 3,564
Website GitHub Mastodon

Re: The do_spellcheck JavaScript

Ok, thanks for the explanation Robert. Will leave as-is.

Will take it into consideration when hopefully in future we are refactoring of the HTML element functions into something more maintainable/extendable.

Offline

Board footer

Powered by FluxBB