Sciter uses JavaScript from now and on

Without too much fanfares Sciter has officially transitioned from TIScript to JavaScript this week. To be precise, there are two Sciter’s at the moment: Sciter.TIS and Sciter.JS. It is just from now and on Sciter is a synonym of Sciter.JS. And so Sciter.JS is the official, mainstream version. But Sciter.TIS is still supported and maintained…

QuickJS + DyBase = JavaScript persistence

module storage unifies QuickJS of Fabrice the Magnificent with DyBase engine of Konstantin the Great. The module provides built-in data persistence – transparent data storage and retrieval using standard JavaScript means. Think about it as of MongoDB built into the language without need of special clients, etc. Finally we can work with objects stored in…

QuickJS for Visual Studio

I’ve ported QuickJS engine by Fabrice Bellard and Charlie Gordon to standard C (without GCC extensions) and Windows. Yet added premake5 to generate MS VS solution. See it on GitHub.

Splitting strings

Have read Splitting Strings by Chris Zetter mini saga… What this expression: “”.split(“,”) shall produce?

Tokenizer + ::mark() = syntax colorizer

Here is selfie of syntax (tiscript) colorizer – the text below is a full source code of syntax highlighting routine. The code has colorized itself: Can your browser do that in 40 lines of code? And here are styles that define style of tokens: plaintext > text::mark(number) { color: brown; } plaintext > text::mark(number-unit) {…

Object match feature in Sciter 3.2.0.3

In Sciter 3.2.0.3 I’ve added so called object match feature to built-in like operator and switch/like statement. Let’s imagine that we have some sequence of objects/data like: var shoppingCartData = [ { product:"Apple", price: 0.95, calories:52 }, { product:"Orange", price: 0.75, calories:47 }, { product:"Toothbrush", price: 1.75 }, "deleted", { product:"Pear", price: 1.25, calories:57 },…

display:none is considered harmful

Quite often in HTML/CSS based UIs we need to hide/show some elements in runtime. Probably the most widespread (and the worst) solution is to set display:none CSS property programmatically. That sounds quite easy at the first glance but solves only half of the problem – it hides – removes the element from rendering tree. But…

Sciter. Declarative behavior assignment by CSS: ‘prototype’ and ‘aspect’ properties

From the very beginning Sciter supported declarative scripting class assignment to DOM elements. If you want all div.some-widget elements in your document to behave in some special way (be subclassed) then you will need: 1. in script to declare class SomeWidget : Behavior { function attached() { … } // called with ‘this’ set to…

[tiscript] ‘this’ and ‘this super’ function arguments

Each function in JavaScript and TIScript gets implicit argument named this. So when you call method of some object as foo.bar(1) then foo object is passed to the bar(param) function as a value of this argument. And the param will get value of 1. All of us who are practicing JS, Python, Ruby, etc. know…