You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
potato-launcher/src/js/app.js

42 lines
1.3 KiB

2 years ago
import * as riot from 'riot'
import TinyLoading from '@tiny-components/loading/src/loading.riot'
import TinySidebarFormHeader from './forms/header.riot'
import TinySidebarFormFooter from './forms/footer.riot'
import FieldError from '@tiny-components/validator/src/fieldError.riot'
import potatoAppsView from './views/apps.riot'
import potatoFieldTags from './components/fields/tags.riot'
import potatoCloseButton from './components/closeButton.riot'
2 years ago
// register & mount riot component
riot.register('field-error', FieldError)
riot.register('tiny-loading', TinyLoading)
riot.register('tiny-sidebar-form-header', TinySidebarFormHeader)
riot.register('tiny-sidebar-form-footer', TinySidebarFormFooter)
riot.register('potato-field-tags', potatoFieldTags)
riot.register('potato-apps-view', potatoAppsView)
riot.register('potato-close-button', potatoCloseButton)
2 years ago
// adding events for Neutralino
Neutralino.events.on('ready', () => {
riot.mount('potato-apps-view')
2 years ago
})
// let it rain
Neutralino.init()
window._arrayBufferToBase64 = function _arrayBufferToBase64(buffer) {
var binary = '';
var bytes = new Uint8Array(buffer);
var len = bytes.byteLength;
for (var i = 0; i < len; i++) {
binary += String.fromCharCode(bytes[i]);
}
return window.btoa(binary);
}