Commit 12795901 authored by csillag's avatar csillag

Don't set "show differences" to true on case differences.

* Updated dom-text-matcher to b253923d.
* Updated annotator to f85315e3.
* On annotations anchored with non-exact matches, don't automatically
  tick the "show differences" checkbox when there are only case differences.

Fixes #690.
parent 6f96210b
......@@ -68,7 +68,7 @@ class Annotator.Host extends Annotator
_setupXDM: ->
# Set up the bridge plugin, which bridges the main annotation methods
# between the host page and the panel widget.
whitelist = ['diffHTML', 'quote', 'ranges', 'target', 'id', 'references']
whitelist = ['diffHTML', 'diffCaseOnly', 'quote', 'ranges', 'target', 'id', 'references']
this.addPlugin 'Bridge',
origin: '*'
window: @frame[0].contentWindow
......
......@@ -145,7 +145,7 @@ class Hypothesis extends Annotator
# Set up the bridge plugin, which bridges the main annotation methods
# between the host page and the panel widget.
whitelist = ['diffHTML', 'quote', 'ranges', 'target', 'id', 'references']
whitelist = ['diffHTML', 'diffCaseOnly', 'quote', 'ranges', 'target', 'id', 'references']
this.addPlugin 'Bridge',
origin: $location.search().xdm
window: $window.parent
......
/*
** Annotator 1.2.6-dev-706391a
** Annotator 1.2.6-dev-5fafbdf
** https://github.com/okfn/annotator/
**
** Copyright 2012 Aron Carroll, Rufus Pollock, and Nick Stenning.
** Dual licensed under the MIT and GPLv3 licenses.
** https://github.com/okfn/annotator/blob/master/LICENSE
**
** Built at: 2013-08-06 14:03:23Z
** Built at: 2013-08-28 00:28:44Z
*/
......@@ -1117,7 +1117,8 @@
anchor = {
range: normalizedRange,
quote: !match.exact ? match.found : void 0,
diffHTML: !match.exact ? match.comparison.diffHTML : void 0
diffHTML: !match.exact ? match.comparison.diffHTML : void 0,
diffCaseOnly: !match.exact ? match.exactExceptCase : void 0
};
return anchor;
};
......@@ -1152,7 +1153,8 @@
anchor = {
range: normalizedRange,
quote: !match.exact ? match.found : void 0,
diffHTML: !match.exact ? match.comparison.diffHTML : void 0
diffHTML: !match.exact ? match.comparison.diffHTML : void 0,
diffCaseOnly: !match.exact ? match.exactExceptCase : void 0
};
return anchor;
};
......@@ -1216,6 +1218,7 @@
if (anchor != null) {
t.quote = anchor.quote || $.trim(anchor.range.text());
t.diffHTML = anchor.diffHTML;
t.diffCaseOnly = anchor.diffCaseOnly;
normedRanges.push(anchor.range);
annotation.quote.push(t.quote);
} else {
......
......@@ -286,6 +286,11 @@ class window.DomTextMatcher
found: found
exact: found is expected
# If the match is not exact, check whether the changes are
# only case differences
unless result.exact then result.exactExceptCase =
expected.toLowerCase() is found.toLowerCase()
# if we are interested in fuzzy comparison, calculate that, too
if not result.exact and useFuzzy
@ensureDMP()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment