This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
apollo.js | |
Set WebSockets and HTTP authorization with Apollo Client after getting your token in your login. | |
I'm using a Svelte's store here to get the token but you can use Vanilla with sessionStorage or whatever you like | |
*/ | |
import { ApolloClient } from 'apollo-client' | |
import { InMemoryCache } from 'apollo-cache-inmemory' | |
import { HttpLink } from 'apollo-link-http' | |
import { WebSocketLink } from 'apollo-link-ws' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
box-element > div { | |
color: #555; | |
background: #00BCD4; | |
width: 100px; | |
height: 100px; | |
display: flex; | |
justify-content: center; | |
align-items: center; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<head> | |
<meta charset="UTF-8"> | |
</head> | |
<body> | |
<label class="T">Usuario</label> | |
<label class="T">Contraseña</label> | |
<select> | |
<option value="es">Español</option> | |
<option value="en">English</option> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[a.pop(), ...a.slice(1), a.shift()] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
Get local html files (views/widgets) to insert into your SPA | |
@param path ex: | |
path = 'file:///android_asset/www/view/page.html' | |
@param success | |
@param failure | |
*/ | |
function get_html_file(path, success, failure) { | |
const xhr = new XMLHttpRequest() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
Get local/external files without user interface (input file) | |
@param path ex: | |
path = 'file:///storage/emulated/0/Android/data/com.gengns.appname/cache/finn.jpg' | |
path = 'https://allmyimages.com/jake.jpg' | |
@param success | |
@param failure | |
*/ | |
function getFile(path, success, failure) { |