Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add semicolons to JavaScript statements (reported by LGTM) #86

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -357,7 +357,7 @@ export function createAnnotationView(annotation, type) {
// Find annotation and make it active
if (!this.camera_move && (this.canvasIsToolActive(this.scale_move_tool) || this.canvasIsToolActive(this.join_rows_tool)) && !this.left_control_active && !this.left_alt_active)
activateAnnotation(type);
}
};

let self = this;
function activateAnnotation(type) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ export function createPolygonTool(annotator_component) {
polygon.path = new paper.Path();
polygon.path.closed = true;
polygon.path.strokeColor = 'rgb(34 43 68)';
polygon.path.fillColor = 'rgba(75,202,172, 0.1)'
polygon.path.fillColor = 'rgba(75,202,172, 0.1)';
polygon.path.strokeWidth = 1;
polygon.path.selected = true;
console.log('created');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ export function canvasMouseDownEv(event) {
let canvasMousePosition = new paper.Point(event.offsetX, event.offsetY);
let viewPosition = this.scope.view.viewToProject(canvasMousePosition);

let checks = []
let checks = [];
if (this.active_region && this.left_alt_active)
checks.push({path: this.active_region.view.path, segm_type: 'region_path'});
else if (this.active_row && this.left_control_active) {
Expand Down
6 changes: 3 additions & 3 deletions app/static/js/arabic_reshaper.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ class ArabicReshaper
this.forward_mapping['ۓ'] = ['ﮰ', '', '', 'ﮱ'];
this.forward_mapping['‍'] = ['‍', '‍', '‍', '‍'];

this.backward_mapping = {}
this.backward_mapping = {};
for (let letter in this.forward_mapping)
{
for (let letter_option of this.forward_mapping[letter])
Expand Down Expand Up @@ -227,7 +227,7 @@ class ArabicReshaper
{
if (seq['chars'].length > 0)
{
let arabic_seq = []
let arabic_seq = [];
let number_of_ending_spaces = 0;
for (let i of seq['chars'].slice().reverse())
{
Expand Down Expand Up @@ -267,7 +267,7 @@ class ArabicReshaper

if (seq['chars'].length > 0)
{
let arabic_seq = []
let arabic_seq = [];
let number_of_ending_spaces = 0;
for (let i of seq['chars'].slice().reverse())
{
Expand Down
4 changes: 2 additions & 2 deletions app/static/js/image_list.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ class ImageList
{
constructor(objects_to_change, page_name = 'show_results')
{
this.page_name = page_name
this.page_name = page_name;
this.objects_to_change = objects_to_change;
this.images = $('.scrolling-wrapper .figure');

Expand Down Expand Up @@ -73,7 +73,7 @@ class ImageList

for (let o of this.objects_to_change)
{
o.change_image(this.image_id, this.change_url.bind(this), this.line_id)
o.change_image(this.image_id, this.change_url.bind(this), this.line_id);
}
window.localStorage.setItem('last_opened_page_'+this.document_id, this.image_index);
}
Expand Down
4 changes: 2 additions & 2 deletions app/static/js/layout/layout_editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ class LayoutEditor{
this.previous_object[this.previous_object.length-1].order = object.order;
}
this.last_action = "reorder_objects";
this.redraw_order()
this.redraw_order();
}

make_append(object){
Expand Down Expand Up @@ -536,7 +536,7 @@ class LayoutEditor{
ignore: obj.ignore,
deleted: obj.deleted,
order: obj.order
}
};
}
}
console.log(obj_to_send);
Expand Down
2 changes: 1 addition & 1 deletion app/static/js/lazy_image.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ async function add_lazy(element, imageObserver){
}
}
} else {
global_lazy_list.push(element)
global_lazy_list.push(element);
}
}

Expand Down
4 changes: 2 additions & 2 deletions app/static/js/ocr/keyboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ class Keyboard{
for (let btn of this.keyboard_btn)
{
btn.addEventListener('click', this.toogle.bind(this));
btn.addEventListener('mousedown', this.prevent_focus.bind(this))
btn.addEventListener('mousedown', this.prevent_focus.bind(this));
}
this.selected_layout = "default";
this.layout_select = document.getElementById('layout-select');
Expand Down Expand Up @@ -186,4 +186,4 @@ function getCookie(cname)
function capitalize_first_letter(string)
{
return string.charAt(0).toUpperCase() + string.slice(1);
}
}
8 changes: 4 additions & 4 deletions app/static/js/ocr/text_line.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class TextLine
for(var c of this.confidences){
this.line_confidence += (1 - c) ** power_const;
}
this.line_confidence = 1 - (this.line_confidence / this.confidences.length) ** (1.0/power_const)
this.line_confidence = 1 - (this.line_confidence / this.confidences.length) ** (1.0/power_const);
} else {
this.line_confidence = 1;
}
Expand Down Expand Up @@ -186,7 +186,7 @@ class TextLine
}
*/
}
let span_text = ""
let span_text = "";
for (let letter_index of span_letter_indexes['indexes'])
{
let char = visual_text.charAt(letter_index);
Expand Down Expand Up @@ -224,7 +224,7 @@ class TextLine
rgb = rgb.substring(4, rgb.length-1).replace(/ /g, '').split(',');
color = parseInt(rgb[1]);
}
let span_letter_indexes = {'indexes':[], 'color': color}
let span_letter_indexes = {'indexes':[], 'color': color};
if ($(span).hasClass('user-input'))
{
span_letter_indexes['user_input'] = true;
Expand Down Expand Up @@ -256,7 +256,7 @@ class TextLine
let inside_ligature = false;
let caret_in_span = false;
let caret_offset = 0;
let new_span_letter_indexes = {'indexes':[], 'color': 255}
let new_span_letter_indexes = {'indexes':[], 'color': 255};
for (let span_letter_indexes of current_letter_indexes_to_spans_mapping)
{
if ('user_input' in span_letter_indexes)
Expand Down
8 changes: 4 additions & 4 deletions app/static/js/ocr/text_line_new.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class TextLine
for(var c of this.confidences){
this.line_confidence += (1 - c) ** power_const;
}
this.line_confidence = 1 - (this.line_confidence / this.confidences.length) ** (1.0/power_const)
this.line_confidence = 1 - (this.line_confidence / this.confidences.length) ** (1.0/power_const);
} else {
this.line_confidence = 1;
}
Expand Down Expand Up @@ -183,7 +183,7 @@ class TextLine
}
*/
}
let span_text = ""
let span_text = "";
for (let letter_index of span_letter_indexes['indexes'])
{
let char = visual_text.charAt(letter_index);
Expand Down Expand Up @@ -221,7 +221,7 @@ class TextLine
rgb = rgb.substring(4, rgb.length-1).replace(/ /g, '').split(',');
color = parseInt(rgb[1]);
}
let span_letter_indexes = {'indexes':[], 'color': color}
let span_letter_indexes = {'indexes':[], 'color': color};
if ($(span).hasClass('user-input'))
{
span_letter_indexes['user_input'] = true;
Expand Down Expand Up @@ -253,7 +253,7 @@ class TextLine
let inside_ligature = false;
let caret_in_span = false;
let caret_offset = 0;
let new_span_letter_indexes = {'indexes':[], 'color': 255}
let new_span_letter_indexes = {'indexes':[], 'color': 255};
for (let span_letter_indexes of current_letter_indexes_to_spans_mapping)
{
if ('user_input' in span_letter_indexes)
Expand Down
6 changes: 3 additions & 3 deletions app/static/js/ocr/text_lines_editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -531,7 +531,7 @@ class TextLinesEditor {
{animate: true, duration: 0.5});
this.active_line = line;
line.focus = true;
this.set_line_style(line)
this.set_line_style(line);

this.swap_delete_line_button_blueprint();
this.swap_ignore_line_button_blueprint();
Expand Down Expand Up @@ -574,7 +574,7 @@ class TextLinesEditor {
let container_x_pad = 25;
let view_port_x_pad = (container_x_pad / container.width()) * view_port_width;

let new_focus = current_focus
let new_focus = current_focus;
// center focus according to caret position
if ((image_caret_position > current_focus + half_view_port_width - offset) ||
(image_caret_position < current_focus - half_view_port_width + offset))
Expand Down Expand Up @@ -781,7 +781,7 @@ function get_focus_line_points(line) {
start_x -= left_pad;
end_x -= line_width - new_line_width + left_pad;
}
let view_port_container_height = (line_height * container_height) / show_line_height
let view_port_container_height = (line_height * container_height) / show_line_height;
let bottom_pad = (line_height * show_bottom_pad) / show_line_height;
let y = end_y - view_port_container_height / 2 + bottom_pad;
return [start_x, end_x, y];
Expand Down
2 changes: 1 addition & 1 deletion app/static/leaflet/Leaflet.Editable.js
Original file line number Diff line number Diff line change
Expand Up @@ -1941,6 +1941,6 @@
latlng = L.latLng(latlng);
this.lat = latlng.lat;
this.lng = latlng.lng;
}
};

}, window));