Quantcast
Channel: Script – sciter
Browsing all 47 articles
Browse latest View live

[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...

View Article


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

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)...

View Article


Image may be NSFW.
Clik here to view.

10 years road to Sciter

Last year it was a jubilee of my BlockNote editor – it is 10 years old now. Quite a serious age for software product I think. BlockNote, in particular its HTML WYSIWYG editing engine, was the very...

View Article

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...

View Article

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 = [...

View Article


Image may be NSFW.
Clik here to view.

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: syntax colorizer Can your browser do that in 40 lines...

View Article

Using native child windows in Sciter.

Sometimes there is a need of using child windows in Sciter. For example you would like to use Scintilla editor that is implemented on Windows as a child window component. You can do that but with the...

View Article

Image may be NSFW.
Clik here to view.

task/await feature in TIScript

At the moment I am working on await feature in TIScript. Await is a way to solve callback / promise “hell” in languages like JavaScript and so Sciter Script: Consider the following code that uses...

View Article


Image may be NSFW.
Clik here to view.

Generators and yield feature in Sciter Script

In Sciter any function that contains yield keyword is treated as a generator function. Main purpose of the generator is to produce sequence of values – on each generator invocation it returns next...

View Article


Adding inline C functions to Sciter :)

As a response to WebAssembly initiative I am thinking about adding native inline C functions to Sciter. // that is inline C function declared directly in script: function getAverageColor( image ) C {...

View Article

Question about script optimizations in Sciter

Code in question is this: $(div#sidebarHeader).first.onClick = function() { // Toggle collapse/expand icon $(div#sidebarHeader).first.attributes.toggleClass("icon-horizontal-collapse");...

View Article

At the mean time, event handler assignment…

Sciter supports event handler assignment in jQuery style: element.on("event", "selector", function(evt) {...}); That looks mostly OK but for some reason I feel it as “aesthetically non pleasant” so...

View Article

scapp.exe – standalone Sciter executable.

Adding scapp.exe to the SDK. The ScApp is an executable that contains Sciter engine linked statically – has no external dependencies. scapp.exe can be started without parameters or with a file name...

View Article


Behaviors, 10 years anniversary.

Just discovered that this article about architecture of behaviors was written 10 years ago and still actual. It is just that instead of artificial Behavior class you should use Element now: class...

View Article

Image may be NSFW.
Clik here to view.

Sciter assistant for Visual Studio Code

Early BETA of Sciter Assistant for Microsoft Visual Code by ConrLab. Microsoft Visual Code, Sciter assistant in actions  Supports syntax and editing of Sciter HTML and CSS flavours and TIScript. Code...

View Article


Optimising ‘+=’ and ‘+’ operators for strings.

This simple code: var s = ""; for(var i = 0; i < 50000; ++i) { s += "*"; } code used to run in Sciter in 874ms. After implementing simple and obvious optimization it runs now in just 4ms. String...

View Article

Image may be NSFW.
Clik here to view.

+plus and +formation, what’s the difference?

+plus +plus is the way to define and support mapping between DOM tree and data tree rooted at some object or namespace. So if you have these two declarations, markup: <style>@import...

View Article


Sciter Script, hidden treasures

There is otherwise keyword in script that is used in loop statements so this: var emptyArr = []; for(var el in emptyArr) stdout.println(el); otherwise stdout.println("nothing seen, array is empty!");...

View Article

Sciter for AngularJS practitioners. Directives.

Directives in AngularJS From AngularJS documentation : At a high level, directives are markers on a DOM element (such as an attribute, element name, comment or CSS class) that tell AngularJS’s HTML...

View Article

Image may be NSFW.
Clik here to view.

Tetris in 300 lines of code

New demo: famous Tetris game (by Алексей Пажитнов) in 300 lines of script code + a bit of markup and CSS:

View Article
Browsing all 47 articles
Browse latest View live