Revision: 8933
http://languagetool.svn.sourceforge.net/languagetool/?rev=8933&view=rev
Author: dnaber
Date: 2013-01-09 21:33:40 +0000 (Wed, 09 Jan 2013)
Log Message:
-----------
online check: cleanup, remove more unused code
Modified Paths:
--------------
trunk/website/www/online-check/tiny_mce/plugins/atd-tinymce/editor_plugin.js
trunk/website/www/online-check/tiny_mce/plugins/atd-tinymce/src/atd.core.js
trunk/website/www/online-check/tiny_mce/plugins/atd-tinymce/src/editor_plugin.js
Modified:
trunk/website/www/online-check/tiny_mce/plugins/atd-tinymce/editor_plugin.js
===================================================================
---
trunk/website/www/online-check/tiny_mce/plugins/atd-tinymce/editor_plugin.js
2013-01-09 21:00:49 UTC (rev 8932)
+++
trunk/website/www/online-check/tiny_mce/plugins/atd-tinymce/editor_plugin.js
2013-01-09 21:33:40 UTC (rev 8933)
@@ -92,21 +92,6 @@
this.ignore_types = ignore_types;
};
-/*
- * Error Parsing Code
- */
-
-AtDCore.prototype._getSeparators = function() {
- var re = '', i;
- var str = '"s!#$%&()*+,./:;<=>?@[\]^_{|}';
-
- // Build word separator regexp
- for (i=0; i<str.length; i++)
- re += '\\' + str.charAt(i);
-
- return "(?:(?:[\xa0" + re + "])|(?:\\-\\-))+";
-};
-
// source: http://simonwillison.net/2006/Jan/20/escape/ (modified to not
escape \s)
RegExp.escape = function(text) {
return text.replace(/[-[\]{}()*+?.,\\^$|#]/g, "\\$&");
@@ -115,12 +100,6 @@
AtDCore.prototype.processXML = function(responseXML) {
this.suggestions = [];
-
- /* words to mark */
- var grammarErrors = [];
- var spellingErrors = [];
- var enrichment = [];
-
var errors = responseXML.getElementsByTagName('error');
for (var i = 0; i < errors.length; i++) {
var suggestion = {};
@@ -131,22 +110,12 @@
if (suggestionsStr) {
suggestion["suggestions"] = suggestionsStr;
}
- var context = errors[i].getAttribute("context");
var errorOffset = parseInt(errors[i].getAttribute("offset"));
var errorLength = parseInt(errors[i].getAttribute("errorlength"));
- var startInContext = errors[i].getAttribute("contextoffset");
- var errorString = context.substr(startInContext, errorLength);
- var errorContext = "";
-
- var replaceString = errorString.replace(/\s+/, this._getSeparators());
// TODO: delete???
- replaceString = RegExp.escape(replaceString);
- suggestion["matcher"] = new RegExp('^' + replaceString + '$');
- suggestion["string"] = errorString;
suggestion["offset"] = errorOffset;
suggestion["errorlength"] = errorLength;
- suggestion["context"] = "";
suggestion["type"] = errors[i].getAttribute("category");
- suggestion["ruleid"] = errors[i].getAttribute("ruleId");
+ suggestion["ruleid"] = errors[i].getAttribute("ruleId");
var url = errors[i].getAttribute("url");
if (url) {
suggestion["moreinfo"] = url;
@@ -242,6 +211,8 @@
// 1. "ignore all" doesn't work
// 2. text with markup (even bold) messes up everything
// 3. cursor position gets lost on check
+ // 4. "ignore" only works until the next check
+ //
// fixed:. current cursor position is ignored when incorrect (it has its
own node)
//
};
@@ -354,7 +325,7 @@
{
return
({
- longname : 'After The Deadline',
+ longname : 'After The Deadline / LanguageTool',
author : 'Raphael Mudge, Daniel Naber',
authorurl : 'http://blog.afterthedeadline.com',
infourl : 'http://www.afterthedeadline.com',
@@ -473,7 +444,7 @@
/* if the server is not accepting requests, let the user know */
if (request.status != 200 || request.responseText.substr(1, 4)
== 'html' || request.responseText == '')
{
- ed.windowManager.alert(
plugin.editor.getLang('AtD.message_server_error', 'There was a problem
communicating with the After the Deadline service. Try again in one minute.') );
+ ed.windowManager.alert(
plugin.editor.getLang('AtD.message_server_error', 'There was a problem
communicating with the service. Try again in one minute.') );
return;
}
Modified:
trunk/website/www/online-check/tiny_mce/plugins/atd-tinymce/src/atd.core.js
===================================================================
--- trunk/website/www/online-check/tiny_mce/plugins/atd-tinymce/src/atd.core.js
2013-01-09 21:00:49 UTC (rev 8932)
+++ trunk/website/www/online-check/tiny_mce/plugins/atd-tinymce/src/atd.core.js
2013-01-09 21:33:40 UTC (rev 8933)
@@ -92,21 +92,6 @@
this.ignore_types = ignore_types;
};
-/*
- * Error Parsing Code
- */
-
-AtDCore.prototype._getSeparators = function() {
- var re = '', i;
- var str = '"s!#$%&()*+,./:;<=>?@[\]^_{|}';
-
- // Build word separator regexp
- for (i=0; i<str.length; i++)
- re += '\\' + str.charAt(i);
-
- return "(?:(?:[\xa0" + re + "])|(?:\\-\\-))+";
-};
-
// source: http://simonwillison.net/2006/Jan/20/escape/ (modified to not
escape \s)
RegExp.escape = function(text) {
return text.replace(/[-[\]{}()*+?.,\\^$|#]/g, "\\$&");
@@ -115,12 +100,6 @@
AtDCore.prototype.processXML = function(responseXML) {
this.suggestions = [];
-
- /* words to mark */
- var grammarErrors = [];
- var spellingErrors = [];
- var enrichment = [];
-
var errors = responseXML.getElementsByTagName('error');
for (var i = 0; i < errors.length; i++) {
var suggestion = {};
@@ -131,22 +110,12 @@
if (suggestionsStr) {
suggestion["suggestions"] = suggestionsStr;
}
- var context = errors[i].getAttribute("context");
var errorOffset = parseInt(errors[i].getAttribute("offset"));
var errorLength = parseInt(errors[i].getAttribute("errorlength"));
- var startInContext = errors[i].getAttribute("contextoffset");
- var errorString = context.substr(startInContext, errorLength);
- var errorContext = "";
-
- var replaceString = errorString.replace(/\s+/, this._getSeparators());
// TODO: delete???
- replaceString = RegExp.escape(replaceString);
- suggestion["matcher"] = new RegExp('^' + replaceString + '$');
- suggestion["string"] = errorString;
suggestion["offset"] = errorOffset;
suggestion["errorlength"] = errorLength;
- suggestion["context"] = "";
suggestion["type"] = errors[i].getAttribute("category");
- suggestion["ruleid"] = errors[i].getAttribute("ruleId");
+ suggestion["ruleid"] = errors[i].getAttribute("ruleId");
var url = errors[i].getAttribute("url");
if (url) {
suggestion["moreinfo"] = url;
@@ -177,7 +146,7 @@
AtDCore.prototype.findSuggestion = function(element) {
var text = element.innerHTML;
var metaInfo = element.getAttribute(this.surrogateAttribute);
- var metaInfoElements = metaInfo.split(this.surrogateAttributeDelimiter)
+ var metaInfoElements = metaInfo.split(this.surrogateAttributeDelimiter);
var errorDescription = {};
errorDescription["description"] = metaInfoElements[0];
var suggestions = metaInfoElements[1];
@@ -242,6 +211,8 @@
// 1. "ignore all" doesn't work
// 2. text with markup (even bold) messes up everything
// 3. cursor position gets lost on check
+ // 4. "ignore" only works until the next check
+ //
// fixed:. current cursor position is ignored when incorrect (it has its
own node)
//
};
Modified:
trunk/website/www/online-check/tiny_mce/plugins/atd-tinymce/src/editor_plugin.js
===================================================================
---
trunk/website/www/online-check/tiny_mce/plugins/atd-tinymce/src/editor_plugin.js
2013-01-09 21:00:49 UTC (rev 8932)
+++
trunk/website/www/online-check/tiny_mce/plugins/atd-tinymce/src/editor_plugin.js
2013-01-09 21:33:40 UTC (rev 8933)
@@ -26,7 +26,7 @@
{
return
({
- longname : 'After The Deadline',
+ longname : 'After The Deadline / LanguageTool',
author : 'Raphael Mudge, Daniel Naber',
authorurl : 'http://blog.afterthedeadline.com',
infourl : 'http://www.afterthedeadline.com',
@@ -145,7 +145,7 @@
/* if the server is not accepting requests, let the user know */
if (request.status != 200 || request.responseText.substr(1, 4)
== 'html' || request.responseText == '')
{
- ed.windowManager.alert(
plugin.editor.getLang('AtD.message_server_error', 'There was a problem
communicating with the After the Deadline service. Try again in one minute.') );
+ ed.windowManager.alert(
plugin.editor.getLang('AtD.message_server_error', 'There was a problem
communicating with the service. Try again in one minute.') );
return;
}
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
------------------------------------------------------------------------------
Master Java SE, Java EE, Eclipse, Spring, Hibernate, JavaScript, jQuery
and much more. Keep your Java skills current with LearnJavaNow -
200+ hours of step-by-step video tutorials by Java experts.
SALE $49.99 this month only -- learn more at:
http://p.sf.net/sfu/learnmore_122612
_______________________________________________
Languagetool-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/languagetool-commits