Annotation Tools: Add helper functions and fixed pep8/pylint errors

Small plugin fixes
This commit is contained in:
lduarte1991
2014-05-21 15:47:45 -04:00
parent ecb05e6b03
commit c24252001c
11 changed files with 154 additions and 33 deletions

View File

@@ -101,4 +101,4 @@ Annotator.Plugin.Flagging = (function(_super) {
return Flagging;
})(Annotator.Plugin);
})(Annotator.Plugin);

View File

@@ -82,6 +82,7 @@ Annotator.Plugin.Reply = (function(_super) {
var string;
return self;
});
field.remove();
this.annotation = annotation;
//Create the actions for the buttons
return ret;

View File

@@ -1,3 +1,27 @@
/*
HighlightTags Annotator Plugin v1.0 (https://github.com/lduarte1991/tags-annotator)
Copyright (C) 2014 Luis F Duarte
License: https://github.com/lduarte1991/tags-annotator/blob/master/LICENSE.rst
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
/*===============================================================================
===============================================================================
===============================================================================
===============================================================================
==============================================================================*/
/*
* jQuery Plugin: Tokenizing Autocomplete Text Entry
* Version 1.6.0
@@ -22,7 +46,7 @@ var DEFAULT_SETTINGS = {
// Display settings
hintText: "Type in a search term",
noResultsText: "No results",
noResultsText: "Not Found. Hit ENTER to add a personal tag.",
searchingText: "Searching...",
deleteText: "×",
animateDropdown: true,
@@ -39,7 +63,7 @@ var DEFAULT_SETTINGS = {
prePopulate: null,
processPrePopulate: false,
// Manipulation settings
// Manipulation settings
idPrefix: "token-input-",
// Formatters
@@ -271,7 +295,10 @@ $.TokenList = function (input, url_or_data, settings) {
add_token($(selected_dropdown_item).data("tokeninput"));
hidden_input.change();
return false;
}
} else{
add_token({id:$(this).val(), name:$(this).val()});
hidden_input.change();
}
break;
case KEY.ESCAPE:
@@ -886,7 +913,7 @@ Annotator.Plugin.HighlightTags = (function(_super) {
HighlightTags.prototype.field = null;
HighlightTags.prototype.input = null;
HighlightTags.prototype.colors = null;
HighlightTags.prototype.isFirstTime = true;
HighlightTags.prototype.isFirstTime = true;
//this function will initialize the plug in. Create your fields here in the editor and viewer.
HighlightTags.prototype.pluginInit = function() {