Home Reference Source
import StackExchangeImporterViewController from '~/controllers/StackExchangeImportViewController.js'
public class | source

StackExchangeImporterViewController

Extends:

ViewController → StackExchangeImporterViewController

Imports from Stack Exchange

Constructor Summary

Public Constructor
public

constructor(container: HTMLElement, stackExchange: StackExchange)

The instance container.

Member Summary

Public Members
public
public
public set

importing(value: boolean)

Sets if importing or not

public
public

questionList: HTMLElement

public
public
public

stackExchange: StackExchange

Method Summary

Public Methods
public

Clears all questions

public

createOptionFor(question: Object)

Creates an <option> from an SE API Question object

public

async import()

Runs the import

public

async initialize()

public

normalize(sourceMarkdown: string): string

Normalized the body to support Axtell Markdown

public

Clears all elements

public

Sets this to the loading state

public

Sets the filter on the search to a value

public

showQuestions(posts: Object[])

Shows the questions

Inherited Summary

From class ViewController
public static

forClass(className: string, predicate: Function, root: HTMLElement)

Creates a view controller directly for all members of a class.

public static

of(elem: string | Element): ViewController

Returns a canolical VC of an element if it exists

Public Constructors

public constructor(container: HTMLElement, stackExchange: StackExchange) source

The instance container. Also takes in a Stack Exchange instance

Override:

ViewController#constructor

Params:

NameTypeAttributeDescription
container HTMLElement
stackExchange StackExchange

Must be auth'd

Public Members

public container source

public importButton: ProgressButtonController source

public set importing(value: boolean) source

Sets if importing or not

public query: Query source

public questionList: HTMLElement source

public questions: Object source

public selectedQuestion: Object source

public stackExchange: StackExchange source

Public Methods

public clearQuestions() source

Clears all questions

public createOptionFor(question: Object) source

Creates an <option> from an SE API Question object

Params:

NameTypeAttributeDescription
question Object

from SE API

public async import() source

Runs the import

public async initialize() source

public normalize(sourceMarkdown: string): string source

Normalized the body to support Axtell Markdown

Params:

NameTypeAttributeDescription
sourceMarkdown string

Return:

string

public setClear() source

Clears all elements

public setLoading() source

Sets this to the loading state

public setSearchFilter(value: string) source

Sets the filter on the search to a value

Params:

NameTypeAttributeDescription
value string

Empty value means all

public showQuestions(posts: Object[]) source

Shows the questions

Params:

NameTypeAttributeDescription
posts Object[]

The questinos to show