node replacement for php required webservice for jquery-spellchecker
JavaScript
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
lib
node_modules
.gitignore
.npmignore
LICENSE
README.md
index.js
package.json
test.js

README.md

node-aspell-spellchecker

Node replacement for php required webservice for jquery-spellchecker

Requirements:

How to install:

npm install node-aspell-spellchecker

How to use:

Replace path in spellcheck instantiation:

var spellchecker = new $.SpellChecker('textarea', {
		lang: 'en',
		parser: 'text',
		webservice: {
			path: '../../webservices/php/SpellChecker.php',
			driver: 'pspell'
		},
		suggestBox: {
			position: 'above'
		},
		incorrectWords: {
			container: '#incorrect-word-list'
		}
	});

With:

var spellchecker = new $.SpellChecker('textarea', {
		lang: 'en',
		parser: 'text',
		webservice: {
			path: '../spellchecker',
			driver: 'pspell'
		},
		suggestBox: {
			position: 'above'
		},
		incorrectWords: {
			container: '#incorrect-word-list'
		}
	});

Add express route:

app.post('/spellchecker', spellchecker);

Add spellcheck function call:

	var spellcheck = requires('node-aspell-spellchecker);
	function spellchecker(req, res)
	{
		spellcheck(req, function(data){
			res.json(data);
		});
	};