MVC or not MVC? The Formation Engine for jQuery

Various JavaScript frameworks provide data binding facilities (Knockout, AngularJS, etc.) these days. They are based on kind-of-MVC concept: you have some data (structure, model), view rendering that data in html and some code in between that commonly named as controllers. How successful/convenient those frameworks are subject of separate topic. For me they are too intrusive…

TIScript vs JavaScript.Harmony (ECMAScript 6), Part I

Variables, block scope As we know local variables in JavaScript are declared in function scope. That creates many problems and surprises for people who came to JS from other languages using the same Java/C/C++ notation. Consider sample that follows. Here we create array of 10 functions, each of them shall return idx value it was…

Promises/A+ implementation in Sciter2

The Promises, as a concept, is generalization of callback mechanism. This pattern is quite popular these days so Sciter2 SDK contains now (sdk/samples/+promise/) pretty simple (60 lines of code) implementation of the Promises. The promise is an object that: maintins list/chain of callback function pairs [onsuccess:function, onfailure:function] by providing .then(onsuccess, onfailure) method; promise object provides…

Better CSS sprites

First of all I shall admit that current way of doing CSS sprites appears as a hack. OK, what exactly is the CSS sprite? (actually sprite is a wrong name for the entity but seems like it is already wide spread, sigh ) Sprite (here) is just a fragment (slice, portion) of some base image….

Caret positions in HTML

Working on behavior:richtext again. This time for Sciter2. The behavior:richtext is the thing behind Sciter’s <richtext> element or <div contenteditable> in Web browsers. behavior:richtext in Sciter1 uses “flat” DOM model: div:element, paragraph:element, that model is similar to the RichTextBox in Windows. But in Sciter2 new behavior:richtext uses standard DOM model of HTML content: element:node, text:node,…

Sciter 2.0.0.17

The build is here: sciter2-tech-preview.zip. Sciter is capable now to render its own site without errors: In this build: Bug fixes, fixes, fixes… Element.move() functionality is back text-transform: lowercase | uppercase | capitalize is back Correct positioning of <tfoot> elements. SciterClassName() API function initializes the library in the same way as Sciter1 does.

Sciter v.2 SDK preview, build 2.0.0.9

Sciter v.2 SDK preview is available here:terrainformatica.com/sciter/sciter2-tech-preview.zip Graphics The whole Graphics subsystem was redesigned to use Direct2D backend. And so drawing principles were changed. Sciter v.1 uses <canvas> HTML5 alike model that implies bitmap buffer to be created for the element. Such bitmap model contradicts CSS transforms – when you have something rendered on the…

Sciter v.2, immediate mode drawing

While porting Graphics functionality using Direct2D primitives I’ve tried to implement immediate mode drawing in Sciter. Problem: as we know HTML5 mandates <canvas> to use off-screen bitmap buffer for drawings. Such model is not transform friendly (scale, rotation) as it involves bitmap transformation. So even when Graphics primitives (line,rectangle,etc.) are vector-ish the result is not…