Hide internal functions from help page

This commit is contained in:
Oliver Blanthorn 2017-11-03 19:10:12 +00:00
parent acf343f7b2
commit eb89756718
No known key found for this signature in database
GPG key ID: 2BB8C36BB504BFF3

View file

@ -23,16 +23,20 @@ import state from "./state"
//#background_helper //#background_helper
import * as keydown from "./keydown_background" import * as keydown from "./keydown_background"
/** @hidden */
//#background_helper //#background_helper
export const cmd_params = new Map<string, Map<string, string>>() export const cmd_params = new Map<string, Map<string, string>>()
/** @hidden */
const SEARCH_URL = "https://www.google.co.uk/search?q=" const SEARCH_URL = "https://www.google.co.uk/search?q="
/** @hidden */
function hasScheme(uri: string) { function hasScheme(uri: string) {
return uri.match(/^(\w+):/) return uri.match(/^(\w+):/)
} }
/** If maybeURI doesn't have a schema, affix http:// */ /** If maybeURI doesn't have a schema, affix http:// */
/** @hidden */
function forceURI(maybeURI: string) { function forceURI(maybeURI: string) {
if (hasScheme(maybeURI)) { if (hasScheme(maybeURI)) {
return maybeURI return maybeURI
@ -55,16 +59,19 @@ function forceURI(maybeURI: string) {
* TODO: Highlander theory: Can there ever be more than one? * TODO: Highlander theory: Can there ever be more than one?
* *
*/ */
/** @hidden */
//#background_helper //#background_helper
async function activeTab() { async function activeTab() {
return (await browser.tabs.query({active: true, currentWindow: true}))[0] return (await browser.tabs.query({active: true, currentWindow: true}))[0]
} }
/** @hidden */
//#background_helper //#background_helper
async function activeTabID() { async function activeTabID() {
return (await activeTab()).id return (await activeTab()).id
} }
/** @hidden */
//#background_helper //#background_helper
function tabSetActive(id: number) { function tabSetActive(id: number) {
browser.tabs.update(id, {active: true}) browser.tabs.update(id, {active: true})
@ -105,6 +112,7 @@ export function scrollpage(n = 1) {
window.scrollBy(0, n) window.scrollBy(0, n)
} }
/** @hidden */
//#content_helper //#content_helper
function history(n: number) { function history(n: number) {
window.history.go(n) window.history.go(n)
@ -147,6 +155,7 @@ export function help(...urlarr: string[]) {
browser.tabs.create({url: "static/docs/modules/_excmds_.html#" + url}) browser.tabs.create({url: "static/docs/modules/_excmds_.html#" + url})
} }
/** @hidden */
//#content_helper //#content_helper
function getlinks(){ function getlinks(){
return document.getElementsByTagName('a') return document.getElementsByTagName('a')
@ -402,6 +411,7 @@ export async function clipboard(excmd = "open"){
// {{{ Buffer/completion stuff // {{{ Buffer/completion stuff
// TODO: Move autocompletions out of excmds. // TODO: Move autocompletions out of excmds.
/** @hidden */
//#background_helper //#background_helper
const DEFAULT_FAVICON = browser.extension.getURL("static/defaultFavicon.svg") const DEFAULT_FAVICON = browser.extension.getURL("static/defaultFavicon.svg")
@ -432,6 +442,7 @@ export async function buffer(n?: number | string) {
} }
/** List of tabs in window and the last active tab. */ /** List of tabs in window and the last active tab. */
/** @hidden */
//#background_helper //#background_helper
async function getTabs() { async function getTabs() {
const tabs = await browser.tabs.query({currentWindow: true}) const tabs = await browser.tabs.query({currentWindow: true})
@ -446,6 +457,7 @@ async function getTabs() {
} }
/** innerHTML for a single Tab's representation in autocompletion */ /** innerHTML for a single Tab's representation in autocompletion */
/** @hidden */
//#background_helper //#background_helper
function formatTab(tab: browser.tabs.Tab, prev?: boolean) { function formatTab(tab: browser.tabs.Tab, prev?: boolean) {
let formatted = `<div> `, let formatted = `<div> `,
@ -464,6 +476,7 @@ function formatTab(tab: browser.tabs.Tab, prev?: boolean) {
} }
/** innerHTML for tab autocompletion div */ /** innerHTML for tab autocompletion div */
/** @hidden */
//#background_helper //#background_helper
async function listTabs() { async function listTabs() {
let buffers: string = "", let buffers: string = "",