How to use the st/globals.setTitle function in st

To help you get started, we’ve selected a few st examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github leafo / sightreading.training / static / js / components / pages / guide_pages.es6 View on Github external
loadPage() {
    if (this.request) {
      this.request.abort()
      delete this.request
    }

    setTitle(this.props.title)

    const request = new XMLHttpRequest()
    const url = `/static/guides/${this.props.pageSource}.json`
    request.open("GET", url)
    request.send()

    request.onload = (e) => {
      if (request.status != 200) {
        console.error("Failed to load guide page", url)
        this.setState({
          contents: "Failed to load guide page. Check console."
        })
        return
      }

      let res = JSON.parse(request.responseText)
github leafo / sightreading.training / static / js / components / pages / play_along_page.es6 View on Github external
componentDidMount() {
    setTitle("Play along")
    this.updateBeat(0)
    if (!this.props.newSong) {
      this.loadSong()
    }

    dispatch(this, {
      setMinChordSpacing: (e, value) => {
        this.setState({
          chordMinSpacing: value
        }, () => this.refreshSong())
      },
      setAutochordsRate: (e, value) => {
        this.setState(
          {autochordsRate: value},
          () => this.refreshSong()
        )
github leafo / sightreading.training / static / js / components / pages / stats.es6 View on Github external
componentDidMount() {
    setTitle("Stats")

    if (!N.session.currentUser) {
      this.props.router.push("/")
    } else {
      this.loadStats()
    }
  }
github leafo / sightreading.training / static / js / components / ear_training / melody_recognition_exercise.es6 View on Github external
componentDidMount() {
    let loadingCount = 0

    setTitle("Learn Intervals Ear Training Exercise")

    this.setState({
      loading: true
    })

    let melodySongs = {}
    let enabled = {}

    MelodyRecognitionExercise.melodies.forEach((m) => {
      loadingCount += 1
      MelodyRecognitionExercise.fetchMelody(m.song).then(song => {
        loadingCount -= 1
        melodySongs[m.song] = song
        enabled[`${m.interval}-${m.direction}`] = true

        if (loadingCount == 0) {
github leafo / sightreading.training / static / js / components / pages / sight_reading_page.es6 View on Github external
componentDidMount() {
    setTitle()

    this.setStaff(STAVES[0], () => {
      this.enterWaitMode()
    })

    dispatch(this, {
      saveGeneratorPreset: (e, form) => {
        if (this.state.savingPreset) {
          return;
        }

        let preset = JSON.stringify({
          type: "notes",
          name: this.state.currentGenerator.name,
          settings: this.state.currentGeneratorSettings,
        })