From ba92febfa94154936cd09ed139733a44c8719959 Mon Sep 17 00:00:00 2001 From: Alon Levy Date: Tue, 11 Nov 2014 13:20:39 +0200 Subject: textanalysis: reduce API textanalysis exposes the current selected type plus functions to increment or decrement it, hides the typeindex and nodetypes. --- scripts/textanalysis.js | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'scripts/textanalysis.js') diff --git a/scripts/textanalysis.js b/scripts/textanalysis.js index 99286e00..cc1f2602 100644 --- a/scripts/textanalysis.js +++ b/scripts/textanalysis.js @@ -445,15 +445,13 @@ return { //for the external arrow-type changer lastnode: function() { return lastnode; }, - typeindex: function() { return typeindex; }, - typeindex_next: function() { + selected_type_next: function() { typeindex = (typeindex + 1) % 5; - return typeindex; + return selectedType(); }, - typeindex_prev: function() { + selected_type_prev: function() { typeindex = (typeindex + 4) % 5; - return typeindex; - }, - nodetypes: function() { return nodetypes; } // XXX should be readonly, but returning a copy? + return selectedType(); + } }; }); -- cgit v1.3.1