Skip to content
Paulo dos Santos edited this page Dec 14, 2017 · 6 revisions

Some documentation for developers

The idea is that these pages will contain useful information for developers on the Paratii player. At the moment, it is just a start.

The place to start out in any case is the README file

Modals

Usage:

    import { showModal, hideModal } from '/imports/lib/utils.js'
    showModal('showSeed') // will open the 'showSeed' modal 
    hideModal() // will hide any open modal

Options

    showModal('createNewWallet', {backdrop: 'static'}) // will open createNewWallet with the given options
    showModal('editProfileInfo', { wrapperClass: 'wide'}) // to open a more "wide" modal(e.g. edit profile)

Warnings and alerts

Usage:

    import {
        showGlobalAlert, hideGlobalAlert
        showModalAlert, hideModalAlert
    } from '/imports/lib/utils.js'


    showGlobalAlert('<strong>Your message here</strong>. Some text in here')
    hideGlobalAlert()

    showModalAlert('<strong>Your message here</strong>. Some text in here')
    hideModalAlert()

Options

Styles

showGlobalAlert('<strong>Your message here</strong>. Some text in here')
showModalAlert('<strong>Your message here</strong>. Some text in here')

image

showGlobalAlert('<strong>Your message here</strong>. Some text in here', 'success')
showModalAlert('<strong>Your message here</strong>. Some text in here', 'success')

image

showGlobalAlert('<strong>Your message here</strong>. Some text in here', 'warning')
showModalAlert('<strong>Your message here</strong>. Some text in here', 'warning')

image

showGlobalAlert('<strong>Your message here</strong>. Some text in here', 'error')
showModalAlert('<strong>Your message here</strong>. Some text in here', 'error')

image

Buttons

showGlobalAlert('<strong>globalAlert</strong> and <strong>modalAlert</strong> You can <a href="/profile">go to a page</a> or <a href="/profile" data-showmodal="confirmLogout">open a modal</a> or <a href="/profile" data-showmodal="confirmLogout" data-closealert>open a modal and close the alert</a>', 'error')
  • href="/page" works fine;
  • data-showmodal="modaltemplate" on a to open a modal;
  • data-closealert to close the current alert.

image

Main loader

Usage:

    import { showLoader, hideLoader } from '/imports/lib/utils.js'
    showLoader('Something is loading')
    hideLoader()

Options

Phrases transition if receive an array instead of a string

let arrayPhrases = ['Your phrase one', 'Your phrase two', 'Your phrase three']
showLoader(arrayPhrases)

Items list on top if receive a second array

let phrases = ['Your phrase one', 'Your phrase two', 'Your phrase three']
let items =  ['<strong>Your item</strong> here', 'Then you can add <strong>other item</strong> here', 'Another <strong>item</strong> here']

showLoader(phrases, items)

mainloader02