mirror of
https://github.com/ankitects/anki.git
synced 2025-09-19 06:22:22 -04:00
add missing copyright headers to *.ts
This commit is contained in:
parent
948fc5f777
commit
e520e8df02
29 changed files with 104 additions and 34 deletions
|
@ -1,3 +1,6 @@
|
||||||
|
// Copyright: Ankitects Pty Ltd and contributors
|
||||||
|
// License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
||||||
|
|
||||||
enum SyncState {
|
enum SyncState {
|
||||||
NoChanges = 0,
|
NoChanges = 0,
|
||||||
Normal,
|
Normal,
|
||||||
|
|
|
@ -14,6 +14,12 @@ nonstandard_header = {
|
||||||
"qt/aqt/winpaths.py",
|
"qt/aqt/winpaths.py",
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ignored_folders = [
|
||||||
|
"bazel-",
|
||||||
|
"qt/forms",
|
||||||
|
"ts/node_modules",
|
||||||
|
]
|
||||||
|
|
||||||
if not os.path.exists("WORKSPACE"):
|
if not os.path.exists("WORKSPACE"):
|
||||||
print("run from workspace root")
|
print("run from workspace root")
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
@ -21,12 +27,18 @@ if not os.path.exists("WORKSPACE"):
|
||||||
found = False
|
found = False
|
||||||
for dirpath, dirnames, fnames in os.walk("."):
|
for dirpath, dirnames, fnames in os.walk("."):
|
||||||
dir = Path(dirpath)
|
dir = Path(dirpath)
|
||||||
if "bazel-" in dirpath:
|
|
||||||
continue
|
ignore = False
|
||||||
if "qt/forms" in dirpath:
|
for folder in ignored_folders:
|
||||||
|
if folder in dirpath:
|
||||||
|
ignore = True
|
||||||
|
break
|
||||||
|
if ignore:
|
||||||
continue
|
continue
|
||||||
|
|
||||||
for fname in fnames:
|
for fname in fnames:
|
||||||
if fname.endswith(".py"):
|
for ext in ".py", ".ts":
|
||||||
|
if fname.endswith(ext):
|
||||||
path = dir / fname
|
path = dir / fname
|
||||||
with open(path) as f:
|
with open(path) as f:
|
||||||
top = f.read(256)
|
top = f.read(256)
|
||||||
|
@ -34,6 +46,8 @@ for dirpath, dirnames, fnames in os.walk("."):
|
||||||
continue
|
continue
|
||||||
if str(path) in nonstandard_header:
|
if str(path) in nonstandard_header:
|
||||||
continue
|
continue
|
||||||
|
if fname.endswith(".d.ts"):
|
||||||
|
continue
|
||||||
if "Ankitects Pty Ltd and contributors" not in top:
|
if "Ankitects Pty Ltd and contributors" not in top:
|
||||||
print("missing standard copyright header:", path)
|
print("missing standard copyright header:", path)
|
||||||
found = True
|
found = True
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/* Copyright: Ankitects Pty Ltd and contributors
|
// Copyright: Ankitects Pty Ltd and contributors
|
||||||
* License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html */
|
// License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
||||||
|
|
||||||
import type { EditingArea } from "./editingArea";
|
import type { EditingArea } from "./editingArea";
|
||||||
|
|
||||||
|
|
|
@ -1,3 +1,6 @@
|
||||||
|
// Copyright: Ankitects Pty Ltd and contributors
|
||||||
|
// License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
||||||
|
|
||||||
import { nodeIsInline } from "./helpers";
|
import { nodeIsInline } from "./helpers";
|
||||||
|
|
||||||
function containsInlineContent(field: Element): boolean {
|
function containsInlineContent(field: Element): boolean {
|
||||||
|
|
|
@ -1,3 +1,6 @@
|
||||||
|
// Copyright: Ankitects Pty Ltd and contributors
|
||||||
|
// License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
||||||
|
|
||||||
import type { Editable } from "./editable";
|
import type { Editable } from "./editable";
|
||||||
|
|
||||||
import { bridgeCommand } from "./lib";
|
import { bridgeCommand } from "./lib";
|
||||||
|
|
|
@ -1,3 +1,6 @@
|
||||||
|
// Copyright: Ankitects Pty Ltd and contributors
|
||||||
|
// License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
||||||
|
|
||||||
import type { EditingArea } from "./editingArea";
|
import type { EditingArea } from "./editingArea";
|
||||||
import type { LabelContainer } from "./labelContainer";
|
import type { LabelContainer } from "./labelContainer";
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/* Copyright: Ankitects Pty Ltd and contributors
|
// Copyright: Ankitects Pty Ltd and contributors
|
||||||
* License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html */
|
// License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
||||||
|
|
||||||
import type { EditingArea } from "./editingArea";
|
import type { EditingArea } from "./editingArea";
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/* Copyright: Ankitects Pty Ltd and contributors
|
// Copyright: Ankitects Pty Ltd and contributors
|
||||||
* License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html */
|
// License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
||||||
|
|
||||||
import type { EditingArea } from "./editingArea";
|
import type { EditingArea } from "./editingArea";
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/* Copyright: Ankitects Pty Ltd and contributors
|
// Copyright: Ankitects Pty Ltd and contributors
|
||||||
* License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html */
|
// License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
||||||
|
|
||||||
import { filterHTML } from "html-filter";
|
import { filterHTML } from "html-filter";
|
||||||
|
|
||||||
|
|
|
@ -1,3 +1,6 @@
|
||||||
|
// Copyright: Ankitects Pty Ltd and contributors
|
||||||
|
// License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
||||||
|
|
||||||
// extend the global namespace with our exports - not sure if there's a better way with esbuild
|
// extend the global namespace with our exports - not sure if there's a better way with esbuild
|
||||||
import * as globals from "./index";
|
import * as globals from "./index";
|
||||||
for (const key in globals) {
|
for (const key in globals) {
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/* Copyright: Ankitects Pty Ltd and contributors
|
// Copyright: Ankitects Pty Ltd and contributors
|
||||||
* License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html */
|
// License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
||||||
|
|
||||||
import { EditingArea } from "./editingArea";
|
import { EditingArea } from "./editingArea";
|
||||||
import { caretToEnd, nodeIsElement } from "./helpers";
|
import { caretToEnd, nodeIsElement } from "./helpers";
|
||||||
|
|
|
@ -1,3 +1,6 @@
|
||||||
|
// Copyright: Ankitects Pty Ltd and contributors
|
||||||
|
// License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
||||||
|
|
||||||
import { bridgeCommand } from "./lib";
|
import { bridgeCommand } from "./lib";
|
||||||
import pinIcon from "./pin-angle.svg";
|
import pinIcon from "./pin-angle.svg";
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/* Copyright: Ankitects Pty Ltd and contributors
|
// Copyright: Ankitects Pty Ltd and contributors
|
||||||
* License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html */
|
// License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
||||||
|
|
||||||
declare global {
|
declare global {
|
||||||
interface Window {
|
interface Window {
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/* Copyright: Ankitects Pty Ltd and contributors
|
// Copyright: Ankitects Pty Ltd and contributors
|
||||||
* License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html */
|
// License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
||||||
|
|
||||||
let currentNoteId: number | null = null;
|
let currentNoteId: number | null = null;
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/* Copyright: Ankitects Pty Ltd and contributors
|
// Copyright: Ankitects Pty Ltd and contributors
|
||||||
* License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html */
|
// License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
||||||
|
|
||||||
const highlightButtons = ["bold", "italic", "underline", "superscript", "subscript"];
|
const highlightButtons = ["bold", "italic", "underline", "superscript", "subscript"];
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/* Copyright: Ankitects Pty Ltd and contributors
|
// Copyright: Ankitects Pty Ltd and contributors
|
||||||
* License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html */
|
// License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
||||||
|
|
||||||
import { getCurrentField, setFormat } from ".";
|
import { getCurrentField, setFormat } from ".";
|
||||||
|
|
||||||
|
|
|
@ -1,3 +1,7 @@
|
||||||
|
// Copyright: Ankitects Pty Ltd and contributors
|
||||||
|
// License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
||||||
|
// languageServerHost taken from MIT sources - see below.
|
||||||
|
|
||||||
import pb from "anki/backend_proto";
|
import pb from "anki/backend_proto";
|
||||||
import { getGraphPreferences, setGraphPreferences } from "./graph-helpers";
|
import { getGraphPreferences, setGraphPreferences } from "./graph-helpers";
|
||||||
import { Writable, writable, get } from "svelte/store";
|
import { Writable, writable, get } from "svelte/store";
|
||||||
|
|
|
@ -1,3 +1,6 @@
|
||||||
|
// Copyright: Ankitects Pty Ltd and contributors
|
||||||
|
// License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
||||||
|
|
||||||
import { isHTMLElement, isNightMode } from "./helpers";
|
import { isHTMLElement, isNightMode } from "./helpers";
|
||||||
import { removeNode as removeElement } from "./node";
|
import { removeNode as removeElement } from "./node";
|
||||||
import {
|
import {
|
||||||
|
|
|
@ -1,3 +1,6 @@
|
||||||
|
// Copyright: Ankitects Pty Ltd and contributors
|
||||||
|
// License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
||||||
|
|
||||||
export function isHTMLElement(elem: Element): elem is HTMLElement {
|
export function isHTMLElement(elem: Element): elem is HTMLElement {
|
||||||
return elem instanceof HTMLElement;
|
return elem instanceof HTMLElement;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,3 +1,6 @@
|
||||||
|
// Copyright: Ankitects Pty Ltd and contributors
|
||||||
|
// License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
||||||
|
|
||||||
test("it should work", () => {
|
test("it should work", () => {
|
||||||
expect("test").toBe("test");
|
expect("test").toBe("test");
|
||||||
});
|
});
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/* Copyright: Ankitects Pty Ltd and contributors
|
// Copyright: Ankitects Pty Ltd and contributors
|
||||||
* License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html */
|
// License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
||||||
|
|
||||||
import {
|
import {
|
||||||
filterElementBasic,
|
filterElementBasic,
|
||||||
|
|
|
@ -1,3 +1,6 @@
|
||||||
|
// Copyright: Ankitects Pty Ltd and contributors
|
||||||
|
// License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
||||||
|
|
||||||
export function removeNode(element: Node): void {
|
export function removeNode(element: Node): void {
|
||||||
element.parentNode?.removeChild(element);
|
element.parentNode?.removeChild(element);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,3 +1,6 @@
|
||||||
|
// Copyright: Ankitects Pty Ltd and contributors
|
||||||
|
// License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
||||||
|
|
||||||
interface AllowPropertiesBlockValues {
|
interface AllowPropertiesBlockValues {
|
||||||
[property: string]: string[];
|
[property: string]: string[];
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,3 +1,6 @@
|
||||||
|
// Copyright: Ankitects Pty Ltd and contributors
|
||||||
|
// License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
||||||
|
|
||||||
import { naturalUnit, naturalWholeUnit, TimespanUnit } from "./time";
|
import { naturalUnit, naturalWholeUnit, TimespanUnit } from "./time";
|
||||||
|
|
||||||
test("natural unit", () => {
|
test("natural unit", () => {
|
||||||
|
|
|
@ -1,3 +1,6 @@
|
||||||
|
// Copyright: Ankitects Pty Ltd and contributors
|
||||||
|
// License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
||||||
|
|
||||||
export function assertUnreachable(x: never): never {
|
export function assertUnreachable(x: never): never {
|
||||||
throw new Error(`unreachable: ${x}`);
|
throw new Error(`unreachable: ${x}`);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,3 +1,6 @@
|
||||||
|
// Copyright: Ankitects Pty Ltd and contributors
|
||||||
|
// License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
||||||
|
|
||||||
import sqlFormatter from "@sqltools/formatter";
|
import sqlFormatter from "@sqltools/formatter";
|
||||||
import * as Diff from "diff";
|
import * as Diff from "diff";
|
||||||
import process from "process";
|
import process from "process";
|
||||||
|
|
|
@ -1,3 +1,7 @@
|
||||||
|
// Copyright: Ankitects Pty Ltd and contributors
|
||||||
|
// License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
||||||
|
// languageServerHost taken from MIT sources - see below.
|
||||||
|
|
||||||
const fs = require("fs");
|
const fs = require("fs");
|
||||||
const worker = require("@bazel/worker");
|
const worker = require("@bazel/worker");
|
||||||
const svelte2tsx = require("svelte2tsx");
|
const svelte2tsx = require("svelte2tsx");
|
||||||
|
|
|
@ -1,3 +1,6 @@
|
||||||
|
// Copyright: Ankitects Pty Ltd and contributors
|
||||||
|
// License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
||||||
|
|
||||||
import { Readable, readable } from "svelte/store";
|
import { Readable, readable } from "svelte/store";
|
||||||
|
|
||||||
interface AsyncData<T, E> {
|
interface AsyncData<T, E> {
|
||||||
|
|
|
@ -1,3 +1,6 @@
|
||||||
|
// Copyright: Ankitects Pty Ltd and contributors
|
||||||
|
// License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
||||||
|
|
||||||
import { Readable, derived } from "svelte/store";
|
import { Readable, derived } from "svelte/store";
|
||||||
|
|
||||||
interface AsyncReativeData<T, E> {
|
interface AsyncReativeData<T, E> {
|
||||||
|
|
Loading…
Reference in a new issue