Skip to content

Instantly share code, notes, and snippets.

View serge-hulne's full-sized avatar

Hulne serge-hulne

  • Delft, Netherlands
View GitHub Profile
@serge-hulne
serge-hulne / app.ts
Created November 23, 2020 18:04
app.ts : Main module of the app: State and async event handling
// Axino lib importa:
import { Div } from "axino/div";
import { colors } from "axino/constants";
// Local (custom) widgets imports:
import { TaskList } from "./tasklist";
import { TaskAction } from "./task_action";
import { Channel } from "axino/channel";
import { log } from "axino/core";
import { Vector } from "axino/vector";
@serge-hulne
serge-hulne / tasklist.ts
Created November 23, 2020 17:27
Taks List Wiget
import { Button } from "axino/button";
import { Div } from "axino/div";
import { Widget } from "axino/widget";
import { Component } from "axino/core";
class TaskList extends Widget {
// Data:
list: Component[];
addButtonWrapper: Div;
addButton: Button;
@serge-hulne
serge-hulne / app-excerpt.ts
Created November 23, 2020 17:20
Create two tasks initially:
//========================
// Populate list_of_tasks:
//========================
all_tasks.append(
new TaskAction("Task 1", false, {
add: channel_add,
delete: channel_delete,
check: channel_checked,
})
);
@serge-hulne
serge-hulne / task.js
Created November 23, 2020 16:53
Task for TODO list
import { Button } from "axino/button";
import { Div } from "axino/div";
import { colors } from "axino/constants";
import { CheckBox } from "axino/checkbox";
import { Widget } from "axino/widget";
//==================
// Task Widget :
//==================
@serge-hulne
serge-hulne / main_customized.js
Created October 30, 2020 13:18
Electron-Axino : Customized main.js file:
// Modules to control application life and create native browser window
const {app, BrowserWindow} = require('electron')
const path = require('path')
function createWindow () {
// Create the browser window.
const mainWindow = new BrowserWindow({
width: 800,
height: 600,
webPreferences: {
@serge-hulne
serge-hulne / index_customized.html
Created October 30, 2020 13:03
index_customized.html
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<!-- https://developer.mozilla.org/en-US/docs/Web/HTTP/CSP -->
<meta http-equiv="Content-Security-Policy" content="default-src 'self'; script-src 'self' ">
<meta http-equiv="X-Content-Security-Policy" content="default-src 'self'; script-src 'self' ">
</head>
@serge-hulne
serge-hulne / renderer.js
Created October 30, 2020 12:47
renderer.js (original)
// This file is required by the index.html file and will
// be executed in the renderer process for that window.
// No Node.js APIs are available in this process because
// `nodeIntegration` is turned off. Use `preload.js` to
// selectively enable features needed in the rendering
// process.
@serge-hulne
serge-hulne / index.html
Last active October 30, 2020 12:43
Axino-Electron : index.html
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<!-- https://developer.mozilla.org/en-US/docs/Web/HTTP/CSP -->
<meta http-equiv="Content-Security-Policy" content="default-src 'self'; script-src 'self'">
<meta http-equiv="X-Content-Security-Policy" content="default-src 'self'; script-src 'self'">
<title>Hello World!</title>
</head>
<body>
@serge-hulne
serge-hulne / bind.ts
Last active October 28, 2020 17:33
Form element binding
import { Input } from "axino/input";
import { Label } from "axino/label";
import { Div } from "axino/div";
import { eventsKeyBoard } from "axino/constants";
// Create a basic Div:
var d = new Div(null);
d.vertical();
d.appendToApp();
@serge-hulne
serge-hulne / component.ts
Created October 28, 2020 15:30
Custom component
import { Div } from "./div";
class List extends Div {
items: string;
constructor(props) {
super(props);
let items = [];
if (props) {
if (props.items) {
items = props.items;