├── Help.exe ├── content ├── reactor │ ├── preface.htm │ ├── lists-keys.htm │ ├── helloworld.htm │ ├── mounting-point.htm │ └── rendering.htm ├── css │ ├── images │ │ ├── back.png │ │ ├── final.png │ │ ├── legos.jpg │ │ ├── schema.png │ │ ├── back-stretch.png │ │ └── final-stretch.png │ ├── css-variables-support.htm │ ├── css-@mixin-feature.htm │ ├── popup-position.htm │ ├── Components_React.js_style.htm │ ├── css-extensions.htm │ └── expandable-images.htm ├── sciter │ ├── images │ │ ├── scroll.gif │ │ └── scroll.vsd │ ├── Sciter.htm │ ├── Attributes.htm │ ├── Node.htm │ └── Request.htm ├── script │ ├── Error.htm │ ├── VM.htm │ ├── language │ │ └── for-screen.css │ ├── Storage.htm │ ├── Angle.htm │ ├── System.Process.htm │ ├── Net.WebSocket.htm │ ├── Float.htm │ ├── Integer.htm │ ├── Index.htm │ ├── Net.DataSocket.htm │ ├── Bytes.htm │ ├── Net.Socket.htm │ ├── Task.htm │ └── Function.htm ├── behaviors │ ├── label.htm │ ├── progress.htm │ ├── scrollbar.htm │ ├── calendar.htm │ ├── clickable.htm │ ├── date.htm │ ├── radio.htm │ ├── hyperlink.htm │ ├── time.htm │ ├── check.htm │ ├── button.htm │ ├── history.htm │ ├── frame-set.htm │ ├── slider.htm │ ├── output.htm │ ├── select-multiple.htm │ ├── menu-bar.htm │ ├── pager-behavior.htm │ ├── select-checkmarks.htm │ ├── frame.htm │ ├── video.htm │ ├── decimal.htm │ ├── integer.htm │ ├── number.htm │ └── tree-view.htm └── preface.htm ├── sciter3.ppt ├── snapshot.png ├── other ├── UI编程的思考.doc ├── CSSS!脚本入门.doc ├── CSS选择器语法详解.doc ├── Data URL用法.doc ├── HTML常用标签说明.doc ├── Sciter是什么.doc ├── Sciter简介.doc ├── Sciter绑定事件.doc ├── 从实现的角度看闭包.doc ├── MSAA │ ├── MSAA简介.doc │ ├── MS Active Accessibility 接口技术编程尝试.doc │ └── Microsoft Active Accessibility体系结构.doc ├── Sciter的10年之路.doc ├── Stock URL用法.doc ├── CSS背景颜色半透明、渐变效果.doc ├── HTMLayout九宫格助手.exe ├── HTMLayout界面贴图技术.doc ├── 什么是原型(Prototype).doc ├── HTMLayout事件捕获与冒泡过程.doc ├── 如何在工作线程中执行GUI线程的代码.doc ├── MX3的皮肤引擎(HTMLayout)特性.doc ├── CSS3圆角样式(border-radius).doc ├── HTMLayout 使用 popup 弹出节点.doc ├── Sciter中的INPUT、WIDGET以及其他自定义元素.doc ├── HTMLayout非标准HTML标记include、widget、popup.doc └── CSS属性background-position ,foreground-position用法.doc ├── Modules ├── Sciter4D.dll └── sciter32.dll ├── core ├── images │ ├── wth.png │ ├── images.jpg │ ├── schema.png │ ├── formation.png │ ├── css-sprites.png │ ├── flat-window.png │ ├── icon_smile.gif │ ├── plus-part-0.png │ ├── sciter.w81.gif │ ├── dom-inspector.png │ ├── external-menu.png │ ├── frame-extended.png │ ├── sciter-video.jpg │ ├── window-layered.png │ ├── standard-window.png │ ├── transparent-window.png │ ├── yield-sign-640x425.jpg │ ├── sciter-directx-schema.jpg │ └── window-frame-extended-2.png ├── sciter_script_hidden_treasures.htm ├── window-frame=extended.htm ├── Sciter-video-support.htm ├── event_handler_assignment.htm ├── pager-template-format.htm ├── Use-of-CSS-constants-in-script.htm ├── Generators-and-yield.htm ├── standalone_Sciter_executable.htm ├── Sciter-HTML-parsing-flavour.htm ├── new-TIScript-features.htm ├── Sciter-3.htm ├── task-await-feature.htm ├── IAccessible and UI automation testing.htm ├── DOM-Inspector-how-remove-border-from-input.htm ├── Sciter-on-multihead-system.htm ├── ccs-map.html ├── construction-mean-TIScript.htm ├── collapsed-and-expanded-state.htm ├── Object-match-feature.htm ├── js-dart-tis_files │ └── shBrushJScript.js ├── frame-content-style.htm ├── Theory-of-URL.htm ├── path-images-doc.htm ├── Sciter-UI-basic-principles.htm ├── 'this'-and-'this super'-function-arguments.htm ├── Sciter-and-DirectX.htm ├── TIScript-syntax-compatible-with-CSS.htm ├── sciter_for_AngularJS_practitioners.htm ├── csss!-calc-function.htm ├── Caret-positions-in-HTML.htm ├── behavior-prototype-aspect.htm ├── Drag-and-Drop.htm ├── upcomming-changes-in-4.1.html ├── visibility-none-article.htm ├── Formation.htm └── Localization.htm ├── README.md ├── sciter4d └── behaviors │ ├── menutab.txt │ ├── draggable.txt │ ├── RouteManager.txt │ └── windowCommand.txt ├── flex-flow ├── images │ ├── flex-springs.png │ ├── relative-flexes.png │ ├── sample-template.png │ ├── sample-vertical.png │ ├── sample-inline-block-1.png │ ├── sample-inline-block-2.png │ ├── sample-position-fixed.png │ ├── sample-vertical-flow.png │ ├── sample-horizontal-bottom.png │ ├── sample-horizontal-fill.png │ └── sample-horizontal-flow.png └── flex-layout.css ├── articles └── images │ ├── behavior-mechanics.png │ └── behavior-mechanics.xar ├── the.scapp ├── .gitattributes ├── webdoc.css ├── scripts ├── indexer.tis └── toc.tis ├── .gitignore ├── styles ├── autozoom.tis ├── lib_search.css └── content.css └── main.htm /Help.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gxlmyacc/sciter-doc-zh/HEAD/Help.exe -------------------------------------------------------------------------------- /content/reactor/preface.htm: -------------------------------------------------------------------------------- 1 |

2 |

-------------------------------------------------------------------------------- /sciter3.ppt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gxlmyacc/sciter-doc-zh/HEAD/sciter3.ppt -------------------------------------------------------------------------------- /snapshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gxlmyacc/sciter-doc-zh/HEAD/snapshot.png -------------------------------------------------------------------------------- /other/UI编程的思考.doc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gxlmyacc/sciter-doc-zh/HEAD/other/UI编程的思考.doc -------------------------------------------------------------------------------- /Modules/Sciter4D.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gxlmyacc/sciter-doc-zh/HEAD/Modules/Sciter4D.dll -------------------------------------------------------------------------------- /Modules/sciter32.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gxlmyacc/sciter-doc-zh/HEAD/Modules/sciter32.dll -------------------------------------------------------------------------------- /core/images/wth.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gxlmyacc/sciter-doc-zh/HEAD/core/images/wth.png -------------------------------------------------------------------------------- /other/CSSS!脚本入门.doc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gxlmyacc/sciter-doc-zh/HEAD/other/CSSS!脚本入门.doc -------------------------------------------------------------------------------- /other/CSS选择器语法详解.doc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gxlmyacc/sciter-doc-zh/HEAD/other/CSS选择器语法详解.doc -------------------------------------------------------------------------------- /other/Data URL用法.doc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gxlmyacc/sciter-doc-zh/HEAD/other/Data URL用法.doc -------------------------------------------------------------------------------- /other/HTML常用标签说明.doc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gxlmyacc/sciter-doc-zh/HEAD/other/HTML常用标签说明.doc -------------------------------------------------------------------------------- /other/Sciter是什么.doc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gxlmyacc/sciter-doc-zh/HEAD/other/Sciter是什么.doc -------------------------------------------------------------------------------- /other/Sciter简介.doc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gxlmyacc/sciter-doc-zh/HEAD/other/Sciter简介.doc -------------------------------------------------------------------------------- /other/Sciter绑定事件.doc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gxlmyacc/sciter-doc-zh/HEAD/other/Sciter绑定事件.doc -------------------------------------------------------------------------------- /other/从实现的角度看闭包.doc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gxlmyacc/sciter-doc-zh/HEAD/other/从实现的角度看闭包.doc -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # sciter的中文帮助 2 | sciter渲染引擎的帮助的中文版 3 | 4 | ![sciter帮助首页](snapshot.png) 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /core/images/images.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gxlmyacc/sciter-doc-zh/HEAD/core/images/images.jpg -------------------------------------------------------------------------------- /core/images/schema.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gxlmyacc/sciter-doc-zh/HEAD/core/images/schema.png -------------------------------------------------------------------------------- /other/MSAA/MSAA简介.doc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gxlmyacc/sciter-doc-zh/HEAD/other/MSAA/MSAA简介.doc -------------------------------------------------------------------------------- /other/Sciter的10年之路.doc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gxlmyacc/sciter-doc-zh/HEAD/other/Sciter的10年之路.doc -------------------------------------------------------------------------------- /other/Stock URL用法.doc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gxlmyacc/sciter-doc-zh/HEAD/other/Stock URL用法.doc -------------------------------------------------------------------------------- /core/images/formation.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gxlmyacc/sciter-doc-zh/HEAD/core/images/formation.png -------------------------------------------------------------------------------- /other/CSS背景颜色半透明、渐变效果.doc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gxlmyacc/sciter-doc-zh/HEAD/other/CSS背景颜色半透明、渐变效果.doc -------------------------------------------------------------------------------- /other/HTMLayout九宫格助手.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gxlmyacc/sciter-doc-zh/HEAD/other/HTMLayout九宫格助手.exe -------------------------------------------------------------------------------- /other/HTMLayout界面贴图技术.doc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gxlmyacc/sciter-doc-zh/HEAD/other/HTMLayout界面贴图技术.doc -------------------------------------------------------------------------------- /content/css/images/back.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gxlmyacc/sciter-doc-zh/HEAD/content/css/images/back.png -------------------------------------------------------------------------------- /core/images/css-sprites.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gxlmyacc/sciter-doc-zh/HEAD/core/images/css-sprites.png -------------------------------------------------------------------------------- /core/images/flat-window.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gxlmyacc/sciter-doc-zh/HEAD/core/images/flat-window.png -------------------------------------------------------------------------------- /core/images/icon_smile.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gxlmyacc/sciter-doc-zh/HEAD/core/images/icon_smile.gif -------------------------------------------------------------------------------- /core/images/plus-part-0.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gxlmyacc/sciter-doc-zh/HEAD/core/images/plus-part-0.png -------------------------------------------------------------------------------- /core/images/sciter.w81.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gxlmyacc/sciter-doc-zh/HEAD/core/images/sciter.w81.gif -------------------------------------------------------------------------------- /other/什么是原型(Prototype).doc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gxlmyacc/sciter-doc-zh/HEAD/other/什么是原型(Prototype).doc -------------------------------------------------------------------------------- /content/css/images/final.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gxlmyacc/sciter-doc-zh/HEAD/content/css/images/final.png -------------------------------------------------------------------------------- /content/css/images/legos.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gxlmyacc/sciter-doc-zh/HEAD/content/css/images/legos.jpg -------------------------------------------------------------------------------- /content/css/images/schema.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gxlmyacc/sciter-doc-zh/HEAD/content/css/images/schema.png -------------------------------------------------------------------------------- /core/images/dom-inspector.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gxlmyacc/sciter-doc-zh/HEAD/core/images/dom-inspector.png -------------------------------------------------------------------------------- /core/images/external-menu.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gxlmyacc/sciter-doc-zh/HEAD/core/images/external-menu.png -------------------------------------------------------------------------------- /core/images/frame-extended.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gxlmyacc/sciter-doc-zh/HEAD/core/images/frame-extended.png -------------------------------------------------------------------------------- /core/images/sciter-video.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gxlmyacc/sciter-doc-zh/HEAD/core/images/sciter-video.jpg -------------------------------------------------------------------------------- /core/images/window-layered.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gxlmyacc/sciter-doc-zh/HEAD/core/images/window-layered.png -------------------------------------------------------------------------------- /other/HTMLayout事件捕获与冒泡过程.doc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gxlmyacc/sciter-doc-zh/HEAD/other/HTMLayout事件捕获与冒泡过程.doc -------------------------------------------------------------------------------- /other/如何在工作线程中执行GUI线程的代码.doc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gxlmyacc/sciter-doc-zh/HEAD/other/如何在工作线程中执行GUI线程的代码.doc -------------------------------------------------------------------------------- /sciter4d/behaviors/menutab.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gxlmyacc/sciter-doc-zh/HEAD/sciter4d/behaviors/menutab.txt -------------------------------------------------------------------------------- /content/sciter/images/scroll.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gxlmyacc/sciter-doc-zh/HEAD/content/sciter/images/scroll.gif -------------------------------------------------------------------------------- /content/sciter/images/scroll.vsd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gxlmyacc/sciter-doc-zh/HEAD/content/sciter/images/scroll.vsd -------------------------------------------------------------------------------- /core/images/standard-window.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gxlmyacc/sciter-doc-zh/HEAD/core/images/standard-window.png -------------------------------------------------------------------------------- /other/MX3的皮肤引擎(HTMLayout)特性.doc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gxlmyacc/sciter-doc-zh/HEAD/other/MX3的皮肤引擎(HTMLayout)特性.doc -------------------------------------------------------------------------------- /sciter4d/behaviors/draggable.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gxlmyacc/sciter-doc-zh/HEAD/sciter4d/behaviors/draggable.txt -------------------------------------------------------------------------------- /content/css/images/back-stretch.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gxlmyacc/sciter-doc-zh/HEAD/content/css/images/back-stretch.png -------------------------------------------------------------------------------- /core/images/transparent-window.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gxlmyacc/sciter-doc-zh/HEAD/core/images/transparent-window.png -------------------------------------------------------------------------------- /core/images/yield-sign-640x425.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gxlmyacc/sciter-doc-zh/HEAD/core/images/yield-sign-640x425.jpg -------------------------------------------------------------------------------- /flex-flow/images/flex-springs.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gxlmyacc/sciter-doc-zh/HEAD/flex-flow/images/flex-springs.png -------------------------------------------------------------------------------- /other/CSS3圆角样式(border-radius).doc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gxlmyacc/sciter-doc-zh/HEAD/other/CSS3圆角样式(border-radius).doc -------------------------------------------------------------------------------- /other/HTMLayout 使用 popup 弹出节点.doc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gxlmyacc/sciter-doc-zh/HEAD/other/HTMLayout 使用 popup 弹出节点.doc -------------------------------------------------------------------------------- /sciter4d/behaviors/RouteManager.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gxlmyacc/sciter-doc-zh/HEAD/sciter4d/behaviors/RouteManager.txt -------------------------------------------------------------------------------- /content/css/images/final-stretch.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gxlmyacc/sciter-doc-zh/HEAD/content/css/images/final-stretch.png -------------------------------------------------------------------------------- /core/images/sciter-directx-schema.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gxlmyacc/sciter-doc-zh/HEAD/core/images/sciter-directx-schema.jpg -------------------------------------------------------------------------------- /flex-flow/images/relative-flexes.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gxlmyacc/sciter-doc-zh/HEAD/flex-flow/images/relative-flexes.png -------------------------------------------------------------------------------- /flex-flow/images/sample-template.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gxlmyacc/sciter-doc-zh/HEAD/flex-flow/images/sample-template.png -------------------------------------------------------------------------------- /flex-flow/images/sample-vertical.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gxlmyacc/sciter-doc-zh/HEAD/flex-flow/images/sample-vertical.png -------------------------------------------------------------------------------- /sciter4d/behaviors/windowCommand.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gxlmyacc/sciter-doc-zh/HEAD/sciter4d/behaviors/windowCommand.txt -------------------------------------------------------------------------------- /articles/images/behavior-mechanics.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gxlmyacc/sciter-doc-zh/HEAD/articles/images/behavior-mechanics.png -------------------------------------------------------------------------------- /articles/images/behavior-mechanics.xar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gxlmyacc/sciter-doc-zh/HEAD/articles/images/behavior-mechanics.xar -------------------------------------------------------------------------------- /core/images/window-frame-extended-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gxlmyacc/sciter-doc-zh/HEAD/core/images/window-frame-extended-2.png -------------------------------------------------------------------------------- /other/Sciter中的INPUT、WIDGET以及其他自定义元素.doc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gxlmyacc/sciter-doc-zh/HEAD/other/Sciter中的INPUT、WIDGET以及其他自定义元素.doc -------------------------------------------------------------------------------- /flex-flow/images/sample-inline-block-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gxlmyacc/sciter-doc-zh/HEAD/flex-flow/images/sample-inline-block-1.png -------------------------------------------------------------------------------- /flex-flow/images/sample-inline-block-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gxlmyacc/sciter-doc-zh/HEAD/flex-flow/images/sample-inline-block-2.png -------------------------------------------------------------------------------- /flex-flow/images/sample-position-fixed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gxlmyacc/sciter-doc-zh/HEAD/flex-flow/images/sample-position-fixed.png -------------------------------------------------------------------------------- /flex-flow/images/sample-vertical-flow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gxlmyacc/sciter-doc-zh/HEAD/flex-flow/images/sample-vertical-flow.png -------------------------------------------------------------------------------- /flex-flow/images/sample-horizontal-bottom.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gxlmyacc/sciter-doc-zh/HEAD/flex-flow/images/sample-horizontal-bottom.png -------------------------------------------------------------------------------- /flex-flow/images/sample-horizontal-fill.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gxlmyacc/sciter-doc-zh/HEAD/flex-flow/images/sample-horizontal-fill.png -------------------------------------------------------------------------------- /flex-flow/images/sample-horizontal-flow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gxlmyacc/sciter-doc-zh/HEAD/flex-flow/images/sample-horizontal-flow.png -------------------------------------------------------------------------------- /other/MSAA/MS Active Accessibility 接口技术编程尝试.doc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gxlmyacc/sciter-doc-zh/HEAD/other/MSAA/MS Active Accessibility 接口技术编程尝试.doc -------------------------------------------------------------------------------- /other/HTMLayout非标准HTML标记include、widget、popup.doc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gxlmyacc/sciter-doc-zh/HEAD/other/HTMLayout非标准HTML标记include、widget、popup.doc -------------------------------------------------------------------------------- /other/MSAA/Microsoft Active Accessibility体系结构.doc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gxlmyacc/sciter-doc-zh/HEAD/other/MSAA/Microsoft Active Accessibility体系结构.doc -------------------------------------------------------------------------------- /other/CSS属性background-position ,foreground-position用法.doc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gxlmyacc/sciter-doc-zh/HEAD/other/CSS属性background-position ,foreground-position用法.doc -------------------------------------------------------------------------------- /the.scapp: -------------------------------------------------------------------------------- 1 | // Sciter Application Manifest 2 | { 3 | name :"scidoc", 4 | definition :"Sciter Help System", 5 | version :1, 6 | revision :0, 7 | icon :"icon.png", 8 | author :"Andrew Fedoniouk" 9 | } -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | 4 | # Custom for Visual Studio 5 | *.cs diff=csharp 6 | 7 | # Standard to msysgit 8 | *.doc diff=astextplain 9 | *.DOC diff=astextplain 10 | *.docx diff=astextplain 11 | *.DOCX diff=astextplain 12 | *.dot diff=astextplain 13 | *.DOT diff=astextplain 14 | *.pdf diff=astextplain 15 | *.PDF diff=astextplain 16 | *.rtf diff=astextplain 17 | *.RTF diff=astextplain 18 | -------------------------------------------------------------------------------- /core/sciter_script_hidden_treasures.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Sciter脚本隐藏特性 5 | 6 | 7 |

Sciter脚本隐藏特性

8 |

在脚本中,有一个otherwise关键字,它用在循环语句中,比如:

9 |
var emptyArr = [];
10 | for(var el in emptyArr)
11 |   stdout.println(el);
12 | otherwise
13 |   stdout.println("nothing seen, array is empty!");
14 |

上面的代码执行后将输出:nothing seen, array is empty!

15 |

当循环体未执行时,循环语句(块)之后的otherwise语句将被执行。

16 | 17 | -------------------------------------------------------------------------------- /core/window-frame=extended.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Adding window-frame=”extended” / sciter 7 | 8 | 9 | 10 |

我为Sciter添加支持了<html window-frame=”extended”>特性,用于想在窗口标题区域添加工具条:

11 |

12 | frame-extended 13 |

14 |

15 | window-frame-extended-2 16 |

17 | 18 | 19 | -------------------------------------------------------------------------------- /content/script/Error.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 |

Error(错误)对象

7 |

错误对象, 当脚本运行时检测到错误抛出的对象。

8 |
9 |

常量

10 |

N/A

11 |

属性

12 |
name
13 |
- string, 只读, 目前等同于"Error"。
14 |
message
15 |
- string, 只读, 错误消息。
16 |
stackTrace
17 |
- string, 只读, 错误的堆栈轨迹。
18 |
data
19 |
- any, 读写, 可选. 额外的错误数据。比如在view.request()中,error包含{ status: ..., response: ... }对象。
20 |

方法

21 |

N/A

22 | 23 | -------------------------------------------------------------------------------- /webdoc.css: -------------------------------------------------------------------------------- 1 | 2 | /*dl { position: relative; } 3 | 4 | dl > dt { 5 | text-align:right; 6 | font-weight:bold; 7 | position:absolute; 8 | left:0; 9 | width:11.5em; 10 | overflow-x:hidden; 11 | } 12 | dl > dd { 13 | margin-left: 12em; 14 | margin-bottom: 0.5em; 15 | }*/ 16 | 17 | dl { font-size:10pt; 18 | font-family:Verdana,Helvetica,sans-serif; } 19 | 20 | dl:before, 21 | dl:after { 22 | display: table; 23 | content: ""; 24 | line-height: 0; 25 | } 26 | dl > dt { 27 | float: left; 28 | width: 11.5em; 29 | clear: left; 30 | text-align: right; 31 | overflow: hidden; 32 | text-overflow: ellipsis; 33 | white-space: nowrap; 34 | font-weight:bold; 35 | } 36 | dl > dd { 37 | margin-left: 12em; 38 | margin-bottom: 1em; 39 | } 40 | -------------------------------------------------------------------------------- /core/Sciter-video-support.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 现在,Sciter支持<video>了 6 | 7 | 8 | 9 |
10 |

现在,Sciter支持<video>了

11 |
12 | 13 |
14 |

已经为Sciter添加了基本的<video>支持。

15 |

<video>元素(实际上是behavior:video)作为一个无窗口的普通DOM元素,可以在它上做动画、变换,已经将其他DOM元素在它之上渲染。

16 |

下面是Sciter中播放视频(标准的30 fps)的一个截图,并且这个视频在semi-transparent背景上做了动画和变换。

17 |

sciter video demo

18 |
19 | 20 | 21 | -------------------------------------------------------------------------------- /scripts/indexer.tis: -------------------------------------------------------------------------------- 1 | 2 | function SetupIndexer() 3 | { 4 | var storage = null; 5 | 6 | function buildIndex() { 7 | 8 | var indexRoot = $(#index); 9 | 10 | var docList = indexRoot.$$(a[href][target=content]).map(:el: el.attributes["href"]); 11 | 12 | for( var doc in docList ) 13 | stdout.println(doc); 14 | 15 | } 16 | 17 | function getStorage() 18 | { 19 | if( storage ) 20 | return storage; 21 | var dbpath = self.url("index.db"); 22 | var storage = Storage.open(dbpath); 23 | if( !storage.root ) { 24 | storage.root = { 25 | keywords: storage.createIndex(#string,false); 26 | }; // brand new, initialize schema. 27 | buildIndex(); 28 | } 29 | return storage; 30 | } 31 | 32 | //buildIndex(); 33 | 34 | } 35 | 36 | SetupIndexer(); -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Windows image file caches 2 | Thumbs.db 3 | ehthumbs.db 4 | 5 | # Folder config file 6 | Desktop.ini 7 | 8 | # Recycle Bin used on file shares 9 | $RECYCLE.BIN/ 10 | 11 | # Windows Installer files 12 | *.cab 13 | *.msi 14 | *.msm 15 | *.msp 16 | 17 | # Windows shortcuts 18 | *.lnk 19 | 20 | # ========================= 21 | # Operating System Files 22 | # ========================= 23 | 24 | # OSX 25 | # ========================= 26 | 27 | .DS_Store 28 | .AppleDouble 29 | .LSOverride 30 | 31 | # Thumbnails 32 | ._* 33 | 34 | # Files that might appear in the root of a volume 35 | .DocumentRevisions-V100 36 | .fseventsd 37 | .Spotlight-V100 38 | .TemporaryItems 39 | .Trashes 40 | .VolumeIcon.icns 41 | 42 | # Directories potentially created on remote AFP share 43 | .AppleDB 44 | .AppleDesktop 45 | Network Trash Folder 46 | Temporary Items 47 | .apdisk 48 | -------------------------------------------------------------------------------- /content/css/css-variables-support.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CSS variables support / sciter 6 | 7 | 8 | 9 |

我正在添加支持CSS变量。对于Sciter,这是一个非常不错的功能,它与CSS Variables Working Draft中的变量定义相似但语法有点不同:

10 |

变量的声明:

11 |
body {
12 |    var(foo): #f00;       /* 声明一个名为"foo"的变量,并定义了它的默认值 */
13 |    color: var(foo,#000); /* 使用这个变量var(变量名, 变量不存在时的默认值) */
14 | }
15 |

变量是可以继承的,所以<body>中的所有子元素都可以使用这个变量:

16 |
div {
17 |    background-color: var(foo,#00f);
18 |    size:200dip;
19 | }
20 |

注意,变量包含两部分内容: 变量的名称,已经等变量未定义时的默认值

21 |

在运行期,脚本也可可以调用DOM API来获取/设置这些CSS变量:

22 |
$(body).style.setVariable("foo", color(0,255,0));
23 |

在脚本中设置后,所有在样式中使用这个变量的元素都会采用新的颜色。

24 | 25 | 26 | -------------------------------------------------------------------------------- /content/behaviors/label.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 |

behavior:label

7 |

该行为将绑定了该行为的元素上的鼠标事件重定向到它标签指定的元素。因此,当鼠标在标签上点击时,会导致标签指定的元素获取焦点或生成点击事件。

8 |

元素

9 |

默认情况下,应用了该行为的元素有:

10 | 13 |

属性

14 |

该行为需要知道的属性:

15 | 17 |

事件

18 |

N/A - 该行为没有引入任何特有的事件。

19 |

方法

20 |

N/A - 该行为没有引入任何特有的方法。

21 |

value

22 |

N/A

23 |

示例

24 |

下面的标记:

25 |
<label>点我<input|text></label>
26 | <label for="buddy">也点我</label> <input|text id="buddy">
27 | 
28 |

将会生成两个绑定了标签的input元素。

29 | 30 | -------------------------------------------------------------------------------- /styles/autozoom.tis: -------------------------------------------------------------------------------- 1 | function AutoScrollX() { 2 | 3 | function showOver() { 4 | var (left,top,right,bottom) = this.scroll(#rect); 5 | this.attributes.toggleClass("over-left", left > 0); 6 | this.attributes.toggleClass("over-right", right > 0); 7 | } 8 | 9 | this.on("mousemove", function(evt) { 10 | var (left,top,right,bottom) = this.scroll(#rect); 11 | var width = this.scroll(#width); 12 | var over = left + right; 13 | if(over > 0 ) { // overflows 14 | var w3 = width / 3; 15 | var scrollx; 16 | if( evt.x < w3 ) scrollx = 0; 17 | else if( evt.x > 2* w3 ) scrollx = over; 18 | else scrollx = (evt.x - w3).toFloat() / width * over * 3; 19 | this.scrollTo(scrollx.toInteger(),0,true); 20 | } 21 | showOver.call(this); 22 | }); 23 | 24 | this.on("mouseleave", :: this.scrollTo(0,0,true) ); 25 | 26 | this.on("animationend", showOver); 27 | this.onSize = showOver; 28 | 29 | } 30 | -------------------------------------------------------------------------------- /flex-flow/flex-layout.css: -------------------------------------------------------------------------------- 1 | html 2 | { 3 | font: 10pt verdana, arial, sans-serif; 4 | background: gray; 5 | } 6 | 7 | body 8 | { 9 | width:700px; 10 | margin:10px auto; 11 | background: white; 12 | padding:1em; 13 | } 14 | 15 | td 16 | { 17 | font: 10pt verdana, arial, sans-serif; 18 | } 19 | 20 | tt, code, samp, kbd 21 | { 22 | font-family: monospace; 23 | } 24 | 25 | pre 26 | { 27 | font-family : monospace; 28 | display : block; 29 | display : table-cell; 30 | margin : 10px 0; 31 | padding : 4px; 32 | background-color: ghostwhite; 33 | border : 1px dotted #ccc; 34 | } 35 | 36 | pre code { color:blue; } 37 | 38 | p 39 | { 40 | margin : 10px 0; 41 | } 42 | 43 | blockquote 44 | { 45 | margin : 10px 0 10px 10px; 46 | border-left : 2px solid #ccc; 47 | padding-left : 8px; 48 | } 49 | -------------------------------------------------------------------------------- /core/event_handler_assignment.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 事件处理器的赋值 6 | 7 | 8 | 9 |
10 |

事件处理器的赋值

11 |
12 |
13 |

Sciter支持jQuery风格的事件处理器赋值方式:

14 |
element.on("event", "selector", function(evt) {...});
15 |

这种方式大部分情况下已经足够了,不过因为某些元素,我觉得它“不够美观” 所以我正在想它的替代方法。

16 |

目前,有一个比较灵活的选项/主意,类似下面这样:

17 |
// subscribe function for "click" event on element
18 | element << event click (evt) {...};
19 |

上面的语句等同于

20 |
element.on("click", function (evt) {...});
21 |

以及它的完整格式(带选择器):

22 |
// subscribe function for "click" event on <button id=first> element
23 | self << event click $(button#first) (evt) {...};
24 |

目前主要的挑战是JS syntax/grammar…

25 |
26 | 27 | 28 | -------------------------------------------------------------------------------- /content/behaviors/progress.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 |

behavior:progress

8 |

进度条行为。

9 |

元素

10 |

默认情况下,应用了该行为的元素有:

11 | 14 |

示例

15 |
16 | progress: 17 |
18 | meter: 19 |
20 |

属性

21 |

该行为需要知道的属性:

22 | 26 |

事件

27 |

N/A - 没有特有方法.

28 |

value

29 |

float, 进度值,该值在0.0 ... max范围间。

30 |

方法

31 |

N/A - 没引入特有方法。

32 | 33 | -------------------------------------------------------------------------------- /content/behaviors/scrollbar.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 |

行为方法

7 |

scrollbar

8 |
9 |
element.setValues(position:int, minValue:int, maxValue:int, page:int, step:int):void
10 |
set values of scrollbar element - position, minValue, maxValue, page - reflects to size of the slider, step - increment value of arrow buttons.
11 |
element.position():int
12 |
returns current position.
13 |
element.minValue():int
14 |
returns current minValue.
15 |
element.maxValue():int
16 |
returns current maxValue.
17 |
element.page():int
18 |
returns current page value.
19 |
element.step():int
20 |
returns current minValue.
21 | 23 | 24 | -------------------------------------------------------------------------------- /content/css/css-@mixin-feature.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | Sciter中CSS的@mixin特性 4 | 9 | 10 | 11 |

Sciter中CSS的@mixin特性

12 |
13 |

我正在为Sciter的CSS添加@mixin功能。

14 |

mixin是一个命名的CSS属性定义集合,这个集合可以被直接应用到CSS规则中。这个特性类似于SASS’s mixins

15 |

参考下面的声明:

16 |
    @mixin LIKE-BUTTON 
17 |     {
18 |       behavior:button;
19 |       background: linear-gradient(top, #3498db, #2980b9);
20 |       border-radius: 28dip;
21 |       color: #ffffff;
22 |       font-size: 20dip;
23 |       padding: 10dip 20dip 10dip 20dip;
24 |       text-decoration: none;
25 |     }
26 |

它声明了一个LIKE-BUTTON属性块,这个属性块可以使用LIKE-BUTTON名称(以@为前缀)被应用到样式中:

27 |
    div { 
28 |       @LIKE-BUTTON; 
29 |       margin:1em; 
30 |     }
31 | 
32 |     a { 
33 |       @LIKE-BUTTON; 
34 |       display:inline-block; 
35 |     }
36 |
37 | 38 | -------------------------------------------------------------------------------- /content/sciter/Sciter.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 |

Sciter对象

7 |

代表当前Sciter应用程序的实例。

8 |
9 |

常量

10 |
VERSION
11 |
Sciter的版本,整数。高位的wrod值时版本号,低位的word是子版本号。
12 |
REVISION
13 |
Sciter的修订号,整数。高位的wrod值时修订号,低位的word是连续的构建号。
14 |
LICENSEE
15 |
string, Sciter的组织/个人证书名称。
16 |

方法

17 |
this
18 |
N/A, 目前不可用。
19 |
userName
20 |
21 |
() returns: string
22 |

返回字符串 - 这个运行的Sciter实例的操作系统登录用户名。

23 |
machineName
24 |
25 |
([full]) returns: string
26 |

返回这个运行的Sciter实例的机器名。如果提供了full参数且为true,则这个函数返回这个机器的完全限定的网络域名。

27 |
launch
28 |
29 |
( filename: string ) returns: true/false
30 |

启动这个机器上另一个应用程序。Filename是应用程序的文件名,或要打开的文档。

31 | 32 | -------------------------------------------------------------------------------- /core/pager-template-format.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 打印页面(Pager)模板格式 4 | 5 | 6 | 7 | 打印页面(Pager)模板是一个普通的HTML文档,它必须包含一个元素 - <pageframe>。其他元素都是可选的。 8 |

下面是和behavior:pager相关的所有元素列表:

9 | 15 |

模板文档中<html>元素的属性:

16 | 19 |

上面的这些属性可以应用在模板文档中设置CSS样式,如下面的CSS规则:

20 |
html[page-parity=odd] footer  { text-align:left; }
21 | html[page-parity=even] footer { text-align:right; }
22 | 
23 |

将会使模板中<footer>元素在奇偶页面有不同的对齐方式。

24 | 25 | -------------------------------------------------------------------------------- /core/Use-of-CSS-constants-in-script.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 在脚本中使用CSS常量 5 | 6 | 7 |
8 |

在脚本中使用CSS常量

9 |
10 |
11 |

在Sciter中,你可以使用@const来定义CSS常量,比如:

12 |
13 | <style>
14 |   @const TEST_STR:"test";
15 |   @const TEST_COLOR: rgb(128,0,0);
16 |   @const TEST_NUMBER: 128;
17 | </style>
18 | 
19 |

这些常量不仅可以在CSS中使用(比如@TEST_COLOR),也可以在脚本中使用:

20 |
21 | var test_str = self.style.constant("TEST_STR");
22 | 
23 |

如果你觉得self.style.constant太繁琐,你可以为它定义一个"字符串器"函数:

24 |
25 |   function $const( name ) { return self.style.constant(name) || ""; }
26 | 
27 |

这样你就可以这样使用了:

28 |
29 | var t1 = $const(TEST_STR);    // 字符串, "test" 
30 | var t2 = $const(TEST_COLOR);  // 颜色类型, color(128,0,0)
31 | var t3 = $const(TEST_NUMBER); // 整数, 128
32 | 
33 |
34 | 35 | -------------------------------------------------------------------------------- /content/script/VM.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 |

VM 名称空间

11 |

虚拟机(VM)相关方法和属性。

12 |

这个名称空间中的方法在脚本中不总是有效的 - 它们依赖于VM创建时的特征参数。

13 |
14 |

常量

15 |

方法

16 |
17 |
getProperty
18 |
(obj:any, name:string | symbol): any | undefined 19 |

根据name获取obj的属性。

20 |

等同于const name = ... var val = obj.(name);

21 |
setProperty
22 |
(obj:any, name:string | symbol, val: any): any | undefined 23 |

根据name设置obj的属性。

24 |

等同于const name = ... obj.(name) = val;

25 |

属性

26 |
unhandledExceptionHandler
27 |
r/w, function - 全局未处理异常处理器。 接受一个函数签名为function(err) : true | false的函数,该函数将会接收到错误(error)对象。 如果该函数返回true,则异常被认为已经处理了,并且将不会再向stderr输出错误信息。
28 | 29 | -------------------------------------------------------------------------------- /core/Generators-and-yield.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | Sciter脚本中的Generator与yield 4 | 5 | 6 |

Sciter脚本中的Generator与yield

7 |
8 |

yield-sign

9 |

在Sciter中,任何函数体内包含yield关键字的函数都可以认为是一个生成器(generator)函数。

10 |

生成器的主要目标是产生一系列的值 – 每次调用生成器返回它的下一个值。
11 | 每当生成器执行到yield <表达式>时,生成器就返回下一个值。

12 |

考虑下面这个生成器函数:

13 |
function  ordinals() {
14 |    yield "first";
15 |    yield "second";
16 |    yield "third";
17 | }
18 |

使用下面的代码来执行这个函数:

19 |
for(var ordinal in ordinals()) 
20 |   stdout.println(ordinal);
21 | 
22 |

这个循环体将会被执行三次,并且在生成器的每次调用中,yield将依次返回它的值。
23 | 这时,你会看到下面的输出内容:

24 |
> first
25 | > second
26 | > third
27 | 
28 |

(生成器中的)yield和(异步任务中的)await同一种机制(协同式多线程)的不同体现。

29 |
30 | 31 | -------------------------------------------------------------------------------- /content/css/popup-position.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | popup-position属性 4 | 5 | 6 | 7 | popup-position属性允许显示定义弹出元素在其锚定元素(弹出元素的拥有者)的弹出位置。

8 | popup-position属性接受以下值:

9 | 13 |

其中:

14 |

<popup-reference-point><anchor-reference-point>可以使用以下枚举值:

15 | 25 |

示例,下面的声明:

26 |
select > popup {
popup-position: top-right bottom-right;
27 | } 28 |
29 |

将弹出元素的右上角放置在锚点元素(这是是select元素本身)的右下角。

30 | 31 | -------------------------------------------------------------------------------- /core/standalone_Sciter_executable.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | scapp.exe – 一个Sciter单文件可执行程序 7 | 8 | 9 | 10 |
11 |

scapp.exe – 一个Sciter单文件可执行程序

12 |
13 |
14 |

SDK中添加了一个scapp.exe。

15 |

这个ScApp是一个静态链接了Sciter,不依赖额外模块的可执行程序。

16 |

scapp.exe可以不指定参数运行,也可以指定一个扩展名为.htm.tis.scapp的文件名参数:

17 |
> scapp.exe
18 |

19 |
> scapp.exe tetris.scapp
20 |

如果启动时未指定参数,则它会尝试在当前目录下寻找main.htmmain.tismain.scapp文件。

21 |

如果指定了.htm[l]文件,则将创建Sciter窗口,并加载这个htm[l]文件。

22 |

.scapp文件是一个在根目录下包含/main.tis的zip文件。这个main.tis文件中需要有创建窗口和调用Sciter.run();的代码 – GUI消息泵循环:

23 |
  // create first window, it may call Sciter.requestQuit(0) to exit from the loop below
24 |   var window = View.window { ... };
25 |   // run message pump loop of the application
26 |   return Sciter.run(); 
27 | 
28 |

本质上,它和tiscript.exe使用同样的方式运行脚本。

29 |
30 | 31 | 32 | -------------------------------------------------------------------------------- /styles/lib_search.css: -------------------------------------------------------------------------------- 1 | ::mark(hilite) { background-color: #FFFF00; } 2 | ::mark(hiactual) { background-color: #FF9632; } 3 | 4 | #search-box 5 | { 6 | position: fixed; 7 | right: 40px; 8 | height: 24px; 9 | background-color: white; 10 | border-radius: 3px; 11 | padding: 9px; 12 | border: solid 1px gray; 13 | flow: horizontal; 14 | vertical-align: middle; 15 | 16 | bottom: 1px; 17 | transition: bottom(linear, 200ms); 18 | } 19 | #search-box > .search-input { height: 18px; margin-right: 3px; } 20 | #search-box > .search-input[reddish] { background: #ff6666; color: white; } 21 | #search-box:disabled { bottom: -50px; } 22 | 23 | #search-box > .btn-seek-prev { font-family:webdings; font-size: 14px; border: 1px solid white; } 24 | #search-box > .btn-seek-next { font-family:webdings; font-size: 14px; border: 1px solid white;} 25 | #search-box > .btn-close { font-family:webdings; font-size: 14px; border: 1px solid white; border-radius: 3px;} 26 | #search-box > .btn-seek-prev:hover { border-color: #3298FE; background-color: #E8F3FE; } 27 | #search-box > .btn-seek-next:hover { border-color: #3298FE; background-color: #E8F3FE; } 28 | #search-box > .btn-close:hover { background-color: #D24545; color: white; } 29 | #search-box > .btn-close:active { background-color: #A72C2C; color: white; } -------------------------------------------------------------------------------- /content/script/language/for-screen.css: -------------------------------------------------------------------------------- 1 | 2 | input#show-defintions 3 | { 4 | value-changed!: $1(body).hide-defintions = self:value ? null # true; 5 | } 6 | 7 | body 8 | { 9 | font-family: verdana, arial, sans-serif; 10 | font-size: 10pt; 11 | } 12 | 13 | tt, code, samp, kbd 14 | { 15 | font-family: monospace; 16 | } 17 | 18 | pre 19 | { 20 | font-family : monospace; 21 | margin : 10px 0; 22 | padding : 4px; 23 | background-color: #f0faff; 24 | border : 1px dotted #ccc; 25 | white-space : pre; 26 | } 27 | 28 | pre code { color:blue; } 29 | 30 | p 31 | { 32 | margin : 10px 0; 33 | } 34 | 35 | blockquote 36 | { 37 | margin : 10px 0 10px 10px; 38 | border-left : 2px solid #ccc; 39 | padding-left : 8px; 40 | } 41 | 42 | dt 43 | { 44 | margin-top: 10px; 45 | margin-bottom: 10px; 46 | } 47 | 48 | dd 49 | { 50 | margin-top: 10px; 51 | margin-left: 10px; 52 | margin-bottom: 20px; 53 | /*background-color: infobackground; 54 | border-left: 1px solid #ccc;*/ 55 | 56 | } 57 | 58 | body[hide-defintions] dd 59 | { 60 | display:none; 61 | } 62 | body[hide-defintions] dt 63 | { 64 | margin-top: 0; 65 | margin-bottom: 0; 66 | } 67 | 68 | -------------------------------------------------------------------------------- /core/Sciter-HTML-parsing-flavour.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Sciter中HTML的属性短格式写法 6 | 7 | 8 | 9 |
10 |

Sciter中HTML的属性短格式写法

11 |
12 | 13 |
14 |

Sciter v.3中的HTML解析器支持属性短格式写法,比较下面两种等同的声明格式:

15 |

紧凑型:

16 |
 
17 |   <input|currency(itemPrice) value=1000> 
18 | 
19 |

标准型:

20 |
 
21 |   <input type="currency" name="itemPrice" value=1000> 
22 | 
23 |

正如你所看到的,第一种格式更简短,且可读性更好(当然是主观上啦)。

24 |

这里是所有支持的属性短格式写法列表:

25 | 31 |
32 | 33 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /content/behaviors/calendar.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 |

behavior: calendar

8 |

calendar是一个日期输入元素,它允许用户选择一个特定的日期。

9 |

元素

10 |

默认情况下,应用了该行为的元素有:

11 | 13 |

示例

14 |
15 | 16 |
17 |

模型

18 |

calendar有以下4种不同的视图模式:

19 | 24 |

每种模式使用一个<table>来渲染视图的内容。如果使用DOM捡拾器(inspector)就会发现每个视图的DOM结构。如果你需要重定义calandar的内容样式时,可以在CSS中直接使用这些DOM元素。

25 |

属性

26 |

该行为需要知道的属性:

27 | 29 |

事件

30 |

除了标准事件集(鼠标、按键、聚焦)外,该行为还生成:

31 | 34 |

value

35 |

Date值 或 undefined, 反应当前的选择内容。

36 |

方法

37 |

N/A - 该行为没有引入任何特有的方法。

38 | 39 | -------------------------------------------------------------------------------- /core/new-TIScript-features.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Sciter 2.0.2.0 发布了TIScript的一些新特性 6 | 7 | 8 | 9 |
10 | 11 |

Sciter 2.0.2.0 发布了TIScript的一些新特性

12 | 13 |
14 | 15 | 16 |
17 | 18 |

2.0.2.0添加的特性之一是支持在类中声明成员变量。

19 | 20 |

通过使用this var name = value构造器,你可以定义成员(实例)变量:

21 | 22 |

这段代码:

23 | 24 |
class Foo {
25 |   this var one = 1, // 成员变量
26 |            two = 2; // 成员变量
27 | 
28 |   function sum() { return this.one + this.two; }
29 | }
30 | 
31 | var foo = new Foo();
32 | stdout << foo.sum() << "\n";
33 | 
34 | 35 |

即使该类没有定义构造器,上面这段代码也会输出‘3’。
36 | 每个Foo类的实例都会拥有this.onethis.two变量,并且拥有它们的初始值。

37 | 38 |

如果有其他类继承了这个Foo类,它也将拥有父类声明的成员变量。

39 | 40 |

这段代码:

41 | 42 |
class Bar: Foo {
43 |   this var three = 3; // 成员变量
44 | 
45 |   function sum() { return this.three + super.sum(); }
46 | }
47 | 
48 | var bar = new Bar();
49 | stdout << bar.sum() << "\n";
50 | 
51 | 52 |

将会输出‘6’。bar实例将会拥有this.one、this.two、this.three成员变量。

53 |
54 | 55 | 56 | 57 | 58 | 59 | 60 | -------------------------------------------------------------------------------- /content/behaviors/clickable.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 |

behavior:clickable

7 |

可点击但不聚焦的行为。一个轻量的按钮行为(在发生MOUSE_DOWN/UP事件时生成BUTTON_CLICK事件)。

8 |

元素

9 |

默认情况下,应用了behavior:clickable行为的元素有:

10 | 12 |

示例

13 |
14 | 15 |
16 |

属性

17 |

N/A

18 |

事件

19 |

除了标准事件集(鼠标、按键、聚焦)外,behavior:clickable行为还生成:

20 | 23 |

方法

24 |

N/A - behavior:clickable没有引入任何特有的方法。

25 |

value

26 |

N/A

27 |

脚本中的按钮点击事件处理

28 |

onClick事件

29 |
var btn = $(button#some);
30 | btn.onClick = function() { ... 事件处理代码 ... }
31 | 
32 |

on()订阅

33 |
var btn = $(button#some);
34 | btn.on("click", function() { ... 事件处理代码 ... });
35 | self.on("click", "button#some", function() { ... 事件处理代码 ... });
36 | 
37 |

decorators.tis 装饰器

38 |
include "decorators.tis";
39 | @click @on "button#some" :: ... 事件处理代码 ...;
40 | 
41 | 42 | -------------------------------------------------------------------------------- /content/behaviors/date.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 |

behavior: date

8 |

日期输入元素,它包含一个下拉日历。

9 |

元素

10 |

默认情况下,应用了该行为的元素有:

11 | 13 |

示例

14 |
15 | 16 | 17 |
18 |

模型

19 |

初始化该行为时会创建下面的DOM结构:

20 |
<input>
21 |   <caption>
22 |     <span.year>
23 |     <span.month>
24 |     <span.day>
25 |   </caption>
26 |   <button>
27 | </input>
28 | 
29 |

其中,<caption>拥有behavior:masked行为。<button>按钮触发弹出下拉日历。

30 |

属性

31 |

该行为需要知道的属性:

32 | 34 |

事件

35 |

除了标准事件集(鼠标、按键、聚焦)外,该行为还生成:

36 | 38 |

value

39 |

Date 或 undefined, 反应内部编辑缓存区的当前状态。

40 |

方法

41 |
42 |
showPopup()
43 |
- 显示日历弹窗。
44 |
today()
45 |
- 设置为当前日期。
46 |
47 | 48 | -------------------------------------------------------------------------------- /core/Sciter-3.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Sciter 3 6 | 7 | 8 | 9 |
10 | 11 |

Sciter 3

12 | 13 |
14 | 15 | 16 |
17 | 18 |

Sciter 3已经正式发布

19 | 20 |

参见日志文件

21 | 22 | 29 | 30 |

Windows XP上的已知问题: GDI+的线性和辐射渐变不同于Direct2D,它没有“open gradients”的概念,稍后我会尝试修复它。

31 | 32 |

你应该想到,GDI+渲染的效率不能与Direct2D相比,所以应该尽量避免大范围使用动画。下面的两种媒体规则允许定义不同的绘制模式:

33 | 34 |
 
35 |   @media graphics-layer == 1 {
36 |     /* GDI+ 规则 尽量少用动画 */
37 |   }
38 |   @media graphics-layer == 2 {
39 |     /* Direct2D WARP 模式 (软件加速)        
40 |      */
41 |   }
42 |   @media graphics-layer >= 3 {
43 |     /* Direct2D 硬件加速模式,最大性能 */
44 |   }
45 | 
46 | 47 |

当然,大多少情况下,下面两个规则也是足够的:

48 | 49 |
 
50 |   @media graphics-layer == 1 {
51 |     /* GDI+ 规则 尽量少用动画 */
52 |   }
53 |   @media graphics-layer > 1 {
54 |     /* Direct2D, 高性能模式 */
55 |   }
56 | 
57 | 58 |

在脚本中,你可以通过读取view.backend (:integer)属性来检查gfx绘制模式。

59 | 60 |
61 | 62 | 63 | 64 | 65 | 66 | 67 | -------------------------------------------------------------------------------- /core/task-await-feature.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | TIScript中的task/await特性 5 | 6 | 7 |

TIScript中的task/await特性

8 |
9 |

现在我正在给TIScript添加await特性。

10 |

Await是一种类似JavaScript语言中的“回调/诺言”式代码的解决方案,考虑下面这样的代码:

11 |

Callback hell

12 |

上面的代码如果使用Await的话,可以简化成:

13 |
function setupUsersMottoTask(userName)
14 | {
15 |   try {
16 |      var user = await request(#get, "http://example.com/user/" + userName);
17 |      var userMotto = await request(#get, "http://example.com/user/" + userName + "/avatar");
18 |      self.$(#user > .motto).text = userMotto;
19 |   } catch (e) {
20 |      self.$(#user > .motto).text = "motto unavailable";
21 |   }
22 | }
23 | setupUsersMottoTask("monster"); // runs asynchronously as it is a Task function.
24 |

如果没有await,则上面的代码就会变成上面那样的梯形调用方式。

25 |

基本上,await使异步代码线性化成正常顺序的代码执行。

26 |

在Sciter的脚本中,任何内部使用了`await`的换上都会自动声明成一个task函数。调用这样的函数将会立即启动一个task并且立即返回。这个函数返回一个诺言(promise),所以它的调用也可以用在其他的await中。

27 |
28 | 29 | -------------------------------------------------------------------------------- /content/reactor/lists-keys.htm: -------------------------------------------------------------------------------- 1 |

列表和键

2 |

我们可以构建元素集合并使用花括号将它们包含在 SSX {} 当中.

下面,我们使用 map() 函数循环遍历 numbers 数组. 为每个项目返回一个 <li> 元素. 最后,我们将生成的元素数组分配给 listItems:

3 |
const numbers = [1, 2, 3, 4, 5];
 4 | const listItems = numbers.map((number) =>
 5 |   <li>{number}</li>
 6 | );

然后我们将整个 listItems 数组包含在一个 <ul> 元素中, 并将其渲染到 DOM:

$(body).content(<ul>{listItems}</ul>);
7 |

上面的代码, 我们用 Element.content(vnodes) 将有效地用于函数呈现的静态 list.

8 |

但是,如果我们计划使用 Element.merge() 更新 list, 我们需要为 list 元素添加 keys. 在这种情况下 merge() 可以有效地执行 DOM and its virtual representation.

9 |

使用 key 最佳方法是使用于字符串, 该字符串在其 item 中是唯一标识, 大多数情况下 key.:

const todoItems = todos.map((todo) =>
10 |   <li key={todo.id} status={todo.status}>
11 |     {todo.text}
12 |   </li>);
13 |

注意:如果项目的顺序可能发生变化,不建议使用 key 做为索引. 这会对性能产生负面影响, 并可能导致组件状态出现问题.  

14 |

key 只能在兄弟 item 中唯一

数组中使用的 key 需要在它们的兄弟中应该是唯一的. 但是, 它们不需要是全局唯一的. 

15 |

map() 嵌入到 SSX 表达式中

16 |

SSX 允许在花括号中嵌入任何表达式, 以便我们也可以内联 map()

function NumberList(props) {
17 |   const numbers = props.numbers;
18 |   return
19 |     <ul>
20 |      { numbers.map((number) => <li key={number.toString()} />) }
21 |     </ul>;
22 | }
23 |

-------------------------------------------------------------------------------- /core/IAccessible and UI automation testing.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | IAccessible和UI自动测试 4 | 5 | 9 | 10 | 11 |

IAccessible和UI自动测试

12 |

Sciter3实现了与传统浏览器兼容的IAccessible接口,所以基于IAccessible的UI自动化工具对Sciter也是有效的。

13 |

为了简化UI测试脚本,进行了下面这些扩展:

14 |
15 |
HRESULT IAccessible::get_accChild(VARIANT varChild, IDispatch **ppdispChild);
16 |
varChild参数可以通过VARIANT(VT_BSTR,str)接受字符串。这个字符串被解释层一个选择器,如果找到了匹配的元素,则ppdispChild参数将返回该元素的IAccessible的封装对象。这个方法等价于脚本中的Element.select(selector)方法。
17 |
HRESULT IAccessible::get_accValue(VARIANT varChild, BSTR *pszValue);
18 |
如果varChild参数时一个负数值(VT_I4),则它被解释成一个属性的索引,这个方法返回对应属性的值。-1-第一个属性、-2-第二个属性等等。如果varChild参数是一个字符串(VT_BSTR),则它被解释成一个属性的名称,该方法返回对应属性的值。
19 |
HRESULT IAccessible::get_accName(VARIANT varChild, BSTR *pszValue);
20 |
如果varChild参数时一个负数值(VT_I4),则它被解释成一个属性的索引,这个方法返回对应属性的名称。-1-第一个属性、-2-第二个属性等等。
21 |
HRESULT IAccessible::get_accState( VARIANT varChild, VARIANT *pvarState);
22 |
如果varChild参数时-1(VT_I4),则该方法返回元素上定义的属性数量,值为VARIANT(VT_I4,nAttributes)
23 |

标准参数值和其他IAccessible方法如何工作请阅读定义的IAccessible文档。

24 |

25 | 26 | -------------------------------------------------------------------------------- /core/DOM-Inspector-how-remove-border-from-input.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | DOM检视器(Inspector), 如果移除输入元素的边框 6 | 7 | 8 | 9 |
10 |

DOM检视器(Inspector), 如果移除输入元素的边框

11 |
12 | 13 |
14 |

经常有新的用户问我“怎么移除输入元素的边框”
15 | 也有问“下拉选择按钮”“日历单元格”“上下文菜单”的“边框”相关问题的。

16 |

在这篇文章中,我想解释解决这类问题的同样方法,而不是回答“定义以下……”等语句。

17 |

Sciter中的输入元素要么是一个纯DOM元素,要么是多个纯DOM元素组成的复合元素。

18 |

输入元素(不支持输入元素)可以从Sciter内部的“master.css”样式表中获取它们的“原始”样式模型。要查找某个组成元素的样式,可以在Sciter.exe中启动DOM检视器,然后在该元素的图标上点击。

19 |

要使某元素高亮显示,只需在该元素上按住CTRL+SHIFT按键的同时点击鼠标,或者在检视器窗口中从DOM树中选择该元素:

20 |

dom inspector

21 |

检视器可以显示应用到该元素上的样式规则,已经它的最终(使用)样式。

22 |

正如你所看到的,<input>元素是没有边框的,而是通过
23 | background-image: url(theme:edit-normal); background-repeat:stretch;背景图像拉伸铺满元素区域来实现边框效果。

24 |

theme:....是一种虚拟图像 – 它们的渲染委托给了宿主操作系统的UI主题服务。因此<input>元素的边框是由宿主操作系统绘制的。

25 |

最后,这里给出“怎么移除输入元素的边框”的答案。

26 |

要抑制边框和任何背景的绘制,可以声明以下内容:

27 |
 
28 | input#my {
29 |   border: none;  /* 移除任何边框 */
30 |   background: none; /* 移除任何(默认)背景 */
31 | }
32 | 
33 |
34 | 35 | 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /content/script/Storage.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | Storage(存储)对象 4 | 5 | 6 | 7 |

Storage(存储)对象

8 |

代表持久性存储。

9 | 10 |
11 | 12 | 13 |

属性

14 | 15 |
root
16 |
- object, 读写属性。Storage中的根对象。
17 | 18 |
autocommit
19 |
- boolean, 只读属性。表示Storage自动提交所有关联对象到存储器中。
20 | 21 | 22 |

方法

23 | 24 |
open
25 |
26 |

( file-name  [, autocommit] ) returns: storage | null

27 |

静态方法。打开file-name文件存储对象,并返回该存储对象的实例。
28 | autocommit指定storage关联的对象是否自动提交到存储器中。默认为true

29 | 30 |
close
31 |
32 |
()
33 |

关闭底层的存储对象。如果autocommit为true,则将提交所有数据。

34 | 35 |
commit
36 |
37 |

()

38 |

提交所有关联对象到存储器器中。

39 | 40 |
createIndex
41 |
42 |
(type [, unique]) returns: Index | null
43 |

创建一个类型为type的index对象,并返回该Index对象。Index是唯一还是可重复的依赖于unique参数。unique默认为true。支持的类型: #integer、#float、#date、#string

44 | 45 | -------------------------------------------------------------------------------- /core/Sciter-on-multihead-system.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Sciter运行在不同监视器DPI设置的Windows 8.1系统的多屏系统上 6 | 7 | 8 | 9 |
10 |

Sciter运行在不同监视器DPI设置的Windows 8.1系统的多屏系统上

11 |
12 |
13 |

高分辨率的显示器终于来了。也许在不久的未来,你会添加一个台式机或笔记本。如果是这样的话,你就会有多个不同显示器,它们有着不同的分辨率。一个是标准的96 dpi,另一个是也许是250 dpi。

14 |

现在, Windows(v 8.1 及以上) 运行设置不同的监视器有不同的DPI设置

15 |

如果你的台式机共享多个显示器,你将有可能将某个应用程序窗口从一个屏幕移动到另一个屏幕。但是如果这两个屏幕拥有不同的DIP设置,则你的应用程序在两个屏幕间移动时需要支持动态DPI改变。

16 |

Sciter引擎从V3.0.2.0版本开始已经支持这种动态DIP设置了。在sdk/samples/basics/test-system-font-and-dip.htm这里可以看到这个示例,当将该Sciter示例窗口在不同DPI监视器间移动时,你将看到:

17 |

Sciter on Windows 8.1, per monitor DPI

18 |

为了使你的HTML/CSS UI能漂亮地演示这个特性,你需要在你的设计中使用逻辑长度单位: dip (设备独立像素, 1/96 每英尺), pt, mm, in, cm等等。注意,在Sciter中,1px是一个物理单位 – 它总是指一个物理像素。在某些情况中(例如,边框宽度),你如果将尺寸/大小依然设置为物理像素,这有可能会产生一个异常。当你需要动态调整窗口尺寸时,你需要布局动态调整,使用弹力单位总是最好的选择。

19 |

注意,上面的动画中,Sciter加载的文档有三个方框: 100px, 100dip and 100dip。最后一个方框的边框也定义为dip – 当窗口移动到左边的监视器(使用125%缩放比例),这些具有变成了不同的大小。所以后面两个也自动适应了的窗口尺寸。

20 |
21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /content/behaviors/radio.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 |

behavior: radio

8 |

标准的单选框按钮行为。 可以应用到任何一组具有相同的名称来实现一组选择(checked)功能的元素。

9 |

元素

10 |

默认情况下,应用了该行为的元素有:

11 | 14 |

示例

15 |
16 | 17 | 18 |
19 |

属性

20 |

该行为需要知道的属性:

21 | 25 |

事件

26 |

除了标准事件集(鼠标、按键、聚焦)外,该行为还生成:

27 | 30 |

value

31 |

true/false, 反映按钮的当前状态是否包含:checked标志。

32 |

注意: behavior:form行为将一组中的所有单选框元素认为是一个值。

33 | 34 | -------------------------------------------------------------------------------- /core/ccs-map.html: -------------------------------------------------------------------------------- 1 |

CSS 属性

2 | 3 |

字体和段落属性

4 |
5 | 6 |

font-family

7 | 8 |

值为以逗号分隔的列表值,列表中每项为以下值之一:

9 | 10 |
11 |
family-name
12 |
系统中已安装的任何可用的字体家族名。比如: Times, Helvetica, Zapf-Chancery, Western, 或 Courier。
13 | 14 |
generic-name
15 |
对应字体家族中的任何值: serif, sans-serif, cursive, fantasy, 或 monospace。
16 |
17 | 18 |

示例:

19 | 20 |
body {
21 |   font-family: "Gill Sans Extrabold", Helvetica, sans-serif;
22 | }
23 | 
24 |
25 |
26 | 27 |

font-size

28 | 29 |

字体的大小, 可以指定以下值之一:

30 | 31 |
32 |
named-font-size
33 |
一系列预定义的字体尺寸关键字集合。缩放根据用户的字体设置选项。 34 | 可能的值有: xx-small, x-small, small, medium, large, x-large, xx-large;
35 | 36 |
relative-size
37 |
一系列代表相对于父对象字体尺寸的关键字集合。 38 | 可能的值有: larger, smaller;
39 | 40 |
length
41 |
长度单位值;
42 | 43 |
percentage
44 |
一个整数, 后面跟着一个百分号(%)。值代表父对象字体尺寸的百分比;
45 |
46 | 47 |

示例:

48 | 49 |
/* <length> values */
50 | font-size: 12px;
51 | font-size: 0.8em;
52 | 
53 | /* <percentage> values */
54 | font-size: 80%;
55 | 
56 |
57 | 58 |

长度单位

59 | 60 |

一个浮点数, 后面跟着一个绝对单位(cm, mm, in, pt, pc, px) 或相对单位 (em, ex)。关于支持的长度单位的更多信息, 参见CSS长度单位。

61 | -------------------------------------------------------------------------------- /content/behaviors/hyperlink.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 |

behavior:hyperlink

7 |

标准的超链接行为。它可以应用到任何有href属性的DOM元素上。

8 |

元素

9 |

默认情况下,应用了behavior:hyperlink行为的元素有:

10 | 12 |

示例

13 |
14 | 百度 15 |
16 |

属性

17 |

该行为需要知道的属性:

18 | 21 |

事件

22 |

除了标准事件集(鼠标、按键、聚焦)外,behavior:hyperlink行为还生成:

23 | 25 |

如果这个事件用户没有处理掉,则最接近该链接的文档将会处理加载该URL。

26 |

方法

27 |

N/A - behavior:hyperlink没有引入任何特有的方法。

28 |

value

29 |

N/A.

30 |

脚本中的超链接点击事件处理

31 |

onClick 事件

32 |
var btn = $(a#some);
33 | btn.onClick = function() { 事件处理代码 ...; 
34 |                            return true; /*标明事件以被处理*/ }
35 | 
36 |

on() 订阅

37 |
var btn = $(a#some);
38 | btn.on("click", function() { ... 事件处理代码 ... });
39 | self.on("click", "button#some", function() { ... 事件处理代码 ... });
40 | 
41 |

decorators.tis 装饰器

42 |
include "decorators.tis";
43 | @click @on "a#some" :: ... 事件处理代码 ...;
44 | 
45 | 46 | -------------------------------------------------------------------------------- /content/behaviors/time.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 |

behavior: time

8 |

时间输入元素。

9 |

元素

10 |

默认情况下,应用了该行为的元素有:

11 | 13 |

示例

14 |
15 | 16 | 17 |
18 |

模型

19 |

初始化该行为时会创建下面的DOM结构:

20 |
<input>
21 |   <caption>
22 |     <span.hour>
23 |     <span.minute>
24 |     <span.second>
25 |     <span.ampm>
26 |   </caption>
27 |   <button.plus>
28 |   <button.minus>
29 | </input>
30 | 
31 |

<span.ampm>是可选的 - 它只出现在当前区域(语言)需要它时。

32 |

<caption>拥有behavior:masked行为。 33 | <button.plus><button.minus>触发对当前的子字段的递增/减。

34 |

属性

35 |

该行为需要知道的属性:

36 | 38 |

事件

39 |

除了标准事件集(鼠标、按键、聚焦)外,该行为还生成:

40 | 42 |

value

43 |

Date 或 undefined, 反应内部编辑缓存区的当前状态。Date只有时间部分是有效的。

44 |

方法

45 |

N/A - 该行为没有引入任何特有的方法,不过<caption>子元素有behavior:masked行为的特有方法。

46 |
47 | 48 | -------------------------------------------------------------------------------- /content/reactor/helloworld.htm: -------------------------------------------------------------------------------- 1 | 2 |

什么是 Reactor

3 |

Reactor 只有这三个特性:

4 | 9 |

Reactor 不是什么

10 |

Hello World

11 |

最小的 Sciter's Reactor 示例:

12 |
$(body).content( <h1>Hello, world!</h1> );
13 |

如您所料,执行此行将生成以下 DOM 结构:

14 | 15 | 16 | 17 |
<body>
18 |   <h1>Hello, world!</h1>
19 | </body>
20 | 21 |

脚本表达式  <h1>Hello, world!</h1> 是一个 SSX 原语.

22 |

注意:您不需要任何外部预编译器来运行此代码 - SSX  是 Sciter 脚本的一个组成部分,从 sciter4.4.0.0 开始支持。解析、DOM 更新和协调也是原生实现的,不需要任何额外的库。

23 |

这意味着, 就象上面的例子一样, 你在不引用 ReactJS 的时候, 就能使用这些特性.

24 |

例如,JSX 可用于需要填充现有 DOM 的情况, 你可以使用Element.create() or Element.append()

25 |

并且你可以使用 Element.merge() 来从虚拟 dom 定义中来更新真实 DOM , 你可以使用这个例子用于需要比例和合并二个真实 dom 树的时候.

26 |

Sciter::Reactor 与 Facebook::ReactJS

27 |

Sciter's Reactor 使用了大体上类似 ReactJS 的语法与想法.

28 |

Facebook::ReactJS 是一个 JavaScript 库, Sciter::Reactor 是原生实现了这二个事情 : SSXElement.merge().

29 |

-------------------------------------------------------------------------------- /core/construction-mean-TIScript.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | TIScript中的“::”构造器的含义是什么? 6 | 7 | 8 | 9 |
10 |

TIScript中的“::”构造器的含义是什么?

11 |
12 | 13 |
14 |

在一个邮件中曾提到这个问题…

15 |

它是TIScript中声明匿名函数的格式之一,称为单语句lambda(希腊字母的第11个字)函数:

16 |
':' [参数-列表] ':' <语句>;
17 |

比如说,我们有这样的JavaScript代码:

18 |
var counter = 0;
19 | var inc = function() { counter++; }
20 |

当我们每次调用inc(), 计数器counter就会加1。

21 |

在TIScript中除了这种写法,可有一种声明匿名函数的轻量级语法:

22 |
var counter = 0;
23 | var inc = :: counter++; 
24 |

其中,第一个“:”等同于JS声明中的“function(”,而第二个“:”等同于JS声明中的“)”。

25 |

当然,你也可以在TIScript中使用JS的标准方式来声明匿名函数, 我只是认为有时更短的格式使用更方便。像这里:

26 |
var accounts = [...]; // 账户列表
27 | accounts.sort( :a,b: a.balance - b.balance );
28 |

声明的这种写法是不是比下面这种写法更简洁:

29 |
accounts.sort( function(a,b){ return a.balance - b.balance });
30 |

Ruby也有一种类似的轻量级声明方式:

31 |
[1,2,3,4,5].each {|i| print "#{i} "}
32 |

对应的JS如下:

33 |
[1,2,3,4,5].each(function(i){ println("#",i);});
34 |
35 | 36 | 37 | 38 | 39 | 40 | -------------------------------------------------------------------------------- /content/behaviors/check.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 |

behavior:check

8 |

标准的复选框行为。它可以应用到任何需要切换:checked状态的DOM元素上。

9 |

元素

10 |

默认情况下,应用了该行为的元素有:

11 | 14 |

示例

15 |
16 | 17 | 18 | 19 |
20 |

属性

21 |

该行为需要知道的属性:

22 | 27 |

事件

28 |

除了标准事件集(鼠标、按键、聚焦)外,该行为还生成:

29 | 32 |

value

33 |

true/false, 反映按钮的当前状态是否包含:checked标志。

34 |

方法

35 |

N/A - 该行为没有引入任何特有的方法。

36 |

37 | 38 | -------------------------------------------------------------------------------- /content/script/Angle.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | TIScript - Angle(角度)对象 4 | 5 | 6 | 7 |

Angle(角度)对象

8 |

表示一个角度值。

9 |
10 |

角度值使用全局的rad(float)deg(integer)函数构建一个角度值。

11 |

Angle字面值是数字和角度单位的组合。下面的表达式将为true:

12 |
360deg instanceof Angle;
13 | 360deg == Math.PI * 2 * 1rad;
14 | 360deg == 400grad;
15 | 360deg == 1turn;
16 | 1turn / 2 == 180deg;
17 | 
18 |

TIScript支持CSS定义的所有单位值:

19 |
  • deg - 度, 在一个完整圆中有360度;
  • 20 |
  • rad - 弧度, 在一个完整圆中有2*π弧度;
  • 21 |
  • grad - 梯度(Gradians)。一个圆共400梯度。90deg = 100grad = 0.25turn ≈ 1.570796326794897rad;
  • 22 |
  • turn - 转、圈(Turns)。1圈等同于360度 - 一个完整的圆;
  • 23 |

    常量

    24 |
    N/A
    25 |

    属性

    26 |
    degrees
    27 |
    只读, float, 角度值
    28 |
    radians
    29 |
    只读, float, 弧度值。
    30 |

    方法

    31 |
    parse
    32 |
    33 |

    (s: string) : angle

    34 |

    静态方法, 根据CSS规则解析字符串为角度对象。

    35 |
    toFloat
    36 |
    37 |

    () : float

    38 |

    将角度转换为弧度值。

    39 |
    toInteger()
    40 |
    41 |

    () : integer

    42 |

    将角度转换成角度值。

    43 |
    toString()
    44 |
    45 |

    () : string

    46 |

    返回"NNNrad"格式的字符串,其中NNN是一个弧度值。

    47 |
    morph
    48 |
    49 |

    ( from : angle, to:angle, ratio: float ) : angle

    50 |

    根据后面的公式计算平均值: (to - from) * ratio + from

    51 | 52 | -------------------------------------------------------------------------------- /core/collapsed-and-expanded-state.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Sciter中的“collapsed”和“expanded”状态 7 | 8 | 9 | 10 |

    Sciter中的“collapsed”和“expanded”状态

    11 |
    12 |

    collapsed(折叠)/expanded(展开)概念在UI中使用的是非常广泛的, 所以我解决的将他们添加到Sciter的内核中。

    13 |

    所以在脚本中可以读写这两个通用的UI状态标识:

    14 |
    element.state.collapsed = true /*or false*/;
    15 | element.state.expanded = true /*or false*/;
    16 |

    这两状态是相互关联的 – 元素可以是collapsed或expanded状态, 但不可能同时处于这两种状态,即当element.state.expanded = true;时,则element.state.collapsed将被设置为false, 反之亦然。默认情况下,元素的这两种状态都为false – 非collapsed也非expanded。

    17 |

    在CSS中,有两个伪类反应这两种状态:

    18 |
    element:collapsed { ... }
    19 | element:expanded { ... }
    20 |

    在不同的场景中,collapsed和expanded状态表示不同的含义。在某些场景中,折叠的元素意味着元素是隐藏/不可见的,它的CSS定义如下:

    21 |
    element:collapsed { visibility:none; }
    22 |

    而在另外一些场景中, 比如有标题区和内容区的section, 折叠状态意味着“隐藏内容区,但总是显示标题区”

    23 |
    <section.collapsible>
    24 |  <header>标题</header>
    25 |  <div>
    26 |  ... 内容 ...
    27 |  </div>
    28 | </section>
    29 |

    在这种场景中,CSS可能包含这样的visibility规则:

    30 |
    section.collapsible:collapsed > div { visibility:none; }
    31 |

    所以当section处于折叠状态时,它的内容div是完全隐藏的。并且它可能在标题区定义了可见的折叠状态, 比如 +/-图标等。

    32 |

    在脚本中,你可以很容易触发它的expands/collapse的状态:

    33 |
    self.on("click", "section.collapsible > header", function(evt) {
    34 |   // 在标题区上点击
    35 |   var section = this.parent;
    36 |   // 切换collapsed状态:
    37 |   section.state.collapsed = !section.state.collapsed; 
    38 | });
    39 |
    40 | 41 | 42 | -------------------------------------------------------------------------------- /core/Object-match-feature.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Sciter 3.2.0.3新增的对象匹配特性 5 | 6 | 7 |
    8 |

    Sciter 3.2.0.3新增的对象匹配特性

    9 |
    10 |

    在Sciter 3.2.0.3中,我为内建的like操作符和switch/like语句添加了所谓的'对象匹配'特性。

    11 |

    设想我们有一个类似下面的对象/数据列表:

    12 |
          var shoppingCartData = [
    13 |         { product:"苹果", price: 0.95, calories:52 },
    14 |         { product:"橘子", price: 0.75, calories:47 },
    15 |         { product:"牙刷", price: 1.75 },
    16 |         "deleted",
    17 |         { product:"Pear", price: 1.25, calories:57 },      
    18 |         { product:"肥皂", price: 2.75 },
    19 |       ];
    20 | 
    21 |

    我们要将其中的事务于其他物品分离开,若使用新的switch/like特性,语句如下:

    22 |
    for( var item in shoppingCartData ) 
    23 |   switch(item) 
    24 |   {
    25 |      like { price: Float, calories: Integer } :  
    26 |            // 一个食物项
    27 |            ...
    28 |            break; 
    29 |      like { price: Float } : 
    30 |            // 不是食物项
    31 |            ...
    32 |            break;            
    33 |      case "deleted" :
    34 |            // 被删除项,跳过它 
    35 |            break;
    36 |      default:
    37 |            // 未知项,这是一个彩蛋? 
    38 |            break; 
    39 |   }
    40 | 
    41 | 
    42 |

    like添加的模式匹配表达式:

    43 |
    if( item like { product: String, price: Float } )
    44 |     stdout.println( item, "is a pricey product" );
    45 | 
    46 |

    希望这个新特性会为你们的工作带来便利。

    47 |
    48 |
    49 | 50 | 51 | -------------------------------------------------------------------------------- /content/behaviors/button.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 |

    behavior:button

    7 |

    标准按钮行为。它可以应用到任何DOM元素上,并使该元素可聚焦和可点击(clickable,即可以接收到BUTTON_CLICK事件)。

    8 |

    元素

    9 |

    默认情况下,应用了behavior:button行为的元素有:

    10 | 15 |

    示例

    16 |
    17 | 18 |
    19 |

    属性

    20 |

    该行为需要知道的属性:

    21 | 24 |

    事件

    25 |

    除了标准事件集(鼠标、按键、聚焦)外,behavior:button行为还生成:

    26 | 29 |

    方法

    30 |

    N/A - behavior:button没有引入任何特有的方法。

    31 |

    value

    32 |

    true/false - 只读, 反映按钮是否按下的状态值。

    33 |

    脚本中的按钮点击事件处理

    34 |

    onClick事件

    35 |
    var btn = $(button#some);
    36 | btn.onClick = function() { ... 事件处理代码 ... }
    37 | 
    38 |

    on()订阅

    39 |
    var btn = $(button#some);
    40 | btn.on("click", function() { ... 事件处理代码 ... });
    41 | self.on("click", "button#some", function() { ... 事件处理代码 ... });
    42 | 
    43 |

    decorators.tis 装饰器

    44 |
    include "decorators.tis";
    45 | @click @on "button#some" :: ... 事件处理代码 ...;
    46 | 
    47 | 48 | -------------------------------------------------------------------------------- /core/js-dart-tis_files/shBrushJScript.js: -------------------------------------------------------------------------------- 1 | /** 2 | * SyntaxHighlighter 3 | * http://alexgorbatchev.com/SyntaxHighlighter 4 | * 5 | * SyntaxHighlighter is donationware. If you are using it, please donate. 6 | * http://alexgorbatchev.com/SyntaxHighlighter/donate.html 7 | * 8 | * @version 9 | * 3.0.83 (July 02 2010) 10 | * 11 | * @copyright 12 | * Copyright (C) 2004-2010 Alex Gorbatchev. 13 | * 14 | * @license 15 | * Dual licensed under the MIT and GPL licenses. 16 | */ 17 | ;(function() 18 | { 19 | // CommonJS 20 | typeof(require) != 'undefined' ? SyntaxHighlighter = require('shCore').SyntaxHighlighter : null; 21 | 22 | function Brush() 23 | { 24 | var keywords = 'break case catch continue ' + 25 | 'default delete do else false ' + 26 | 'for function if in instanceof ' + 27 | 'new null return super switch ' + 28 | 'this throw true try typeof var while with finally class namespace' 29 | ; 30 | 31 | var r = SyntaxHighlighter.regexLib; 32 | 33 | this.regexList = [ 34 | { regex: r.multiLineDoubleQuotedString, css: 'string' }, // double quoted strings 35 | { regex: r.multiLineSingleQuotedString, css: 'string' }, // single quoted strings 36 | { regex: r.singleLineCComments, css: 'comments' }, // one line comments 37 | { regex: r.multiLineCComments, css: 'comments' }, // multiline comments 38 | { regex: /\s*#.*/gm, css: 'preprocessor' }, // preprocessor tags like #region and #endregion 39 | { regex: new RegExp(this.getKeywords(keywords), 'gm'), css: 'keyword' } // keywords 40 | ]; 41 | 42 | this.forHtmlScript(r.scriptScriptTags); 43 | }; 44 | 45 | Brush.prototype = new SyntaxHighlighter.Highlighter(); 46 | Brush.aliases = ['js', 'jscript', 'javascript']; 47 | 48 | SyntaxHighlighter.brushes.JScript = Brush; 49 | 50 | // CommonJS 51 | typeof(exports) != 'undefined' ? exports.Brush = Brush : null; 52 | })(); 53 | -------------------------------------------------------------------------------- /content/css/Components_React.js_style.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 类React.js的组件样式 7 | 8 | 9 | 10 |
    11 |

    类React.js的组件样式

    12 |
    13 |
    14 |

    legos

    15 |

    我正在考虑添加一种类似React.js的@component特性。

    16 |

    参考下面这样的结构:

    17 |
    @component Toggler {
    18 | 
    19 |   :root { flow: stack; }
    20 |   
    21 |   :root > option:nth-child(1) { ... }
    22 |   :root > option:nth-child(2) { ... }
    23 |   
    24 |   :root[on][off] :
    25 |   
    26 |     <option>{ attributes.on }</option> 
    27 |     <option>{ attributes.off }</option> 
    28 | 
    29 |   :root[on][off][mixed] :
    30 |   
    31 |     <option>{ attributes.on }</option> 
    32 |     <option>{ attributes.off }</option> 
    33 |     <option.mixed>{ attributes.mixed }</option> 
    34 | 
    35 |   // event handler 
    36 |   on :root click(evt) {
    37 |     ...
    38 |   }  
    39 |   // event handler on child element
    40 |   on option mousedown(evt) {
    41 |     ...
    42 |   }  
    43 | 
    44 |   // method  
    45 |   function foo() { ... }
    46 | 
    47 |   // property  
    48 |   property bar(v) { ... }
    49 | 
    50 | }
    51 | 
    52 |

    @component本质上和@set很类似,不过它不仅包含样式声明,还包含可选的组件HTML标记代码,等价于:

    53 |
    class Toggler:Behavior { 
    54 | 
    55 |    function attached() {
    56 |       this.$content(...); 
    57 |    }
    58 | 
    59 |    function foo() {  ... }
    60 |    property bar(v) { ... }
    61 | }
    62 |

    因此,如果你将得到这样的标记:

    63 |
    <html> 
    64 |   <head>
    65 |     <link rel="components" href="components/">
    66 |   </head>
    67 |   <body>
    68 |     <toggler on="yey" off="ney">
    69 |   </body>
    70 | </html>
    71 |

    将将看到组件的实例化和DOM的初始化。

    72 |
    73 | 74 | 75 | -------------------------------------------------------------------------------- /content/script/System.Process.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | System.Process对象 4 | 5 | 6 | 7 |

    System.Process对象

    8 |

    通过使用Process类, 你的程序可以允许另外一个程序作为子进程, 并且可以接收来自该子进程的stdoutstderr的输出,以及通过stdin流向它传递数据。

    9 |
    10 |

    属性

    11 |
    running
    12 |
    - boolean, 进程运行状态, true - 进程正在运行。
    13 |

    方法

    14 |
    exec
    15 |
    16 |
    ( exepath: string [, arg1: string, arg2: string, ...] [,#detached] ) : Process
    17 |

    静态方法, 创建一个新的子进程代理对象,并根据指定的进程路径和命令行参数(可选)启动进程。

    18 |

    默认情况下,启动的新进场属于相同的进程组 - 它将会在本进程关闭时结束。但是如果设置了#detached参数,则子进程4父进程结束。

    19 |
    on
    20 |
    21 |
    ( event: string, callback: function ) : this
    22 |

    订阅以下进程事件的回调函数:

    23 | 27 |

    这些事件名称可以包含".namespace"部分,它可以被用在.off()调用中。

    28 |
    off
    29 |
    30 |
    ( event: string | callback: function ) : this
    31 |

    通过事件名或回调函数取消该事件的订阅。

    32 |

    这些事件名称可以包含名称空间(namespace)部分。因此: socket.off(".namespace") 将取消该名称空间的所有事件处理器。

    33 |
    send
    34 |
    35 |
    ( data: string )
    36 |

    该方法向子进程的stdin流中发送数据。

    37 |
    terminate
    38 |
    39 |
    ( )
    40 |

    尝试终止子进程的运行。

    41 | 42 | -------------------------------------------------------------------------------- /content/behaviors/history.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 |

    behavior:history

    7 |

    这个行为提供了对历史页面导航的支持, 类似于点击浏览器中的"前进"和"后退"按钮。

    8 |

    元素

    9 |

    <frame history> - 标准的frame元素,只是多了一个history属性。

    10 |

    模型

    11 |

    这个行为可以被应用到任何包含frame的元素上。比如,如果需要可以应用到<frameset>。

    12 |

    属性

    13 |

    behavior:history没有使用任何特别的属性。

    14 |

    方法

    15 |
    16 |
    canGoBack
    17 |
    ( ) : true | false,  如果存在"历史页面",并且goBack()方法将可以成功时,则返回true。
    18 |
    canGoForward
    19 |
    ( ) : true | false,  如果"向前"状态可用,并且goForward()方法将可以成功时,则返回true。
    20 |
    goBack
    21 |
    ( ) : true | false,  "向后/回退"导航栈,当导航成功时返回true
    22 |
    goForward
    23 |
    ( ) : true | false,  "向前"导航栈,当导航成功时返回true
    24 |

    状态

    25 |

    N/A

    26 |

    事件

    27 |

    这个行为会生成以下事件:

    28 |
    29 |
    HISTORY_STATE_CHANGED
    30 |
    - 当内部的导航栈状态被改变时触发。
    31 |

    这个行为反应了以下事件:

    32 |
    33 |
    HISTORY_PUSH
    34 |
    - 发生了超链接导航,并且behavior:frame元素加载了新的内容。
    35 |
    HISTORY_PRIOR
    36 |
    - 该行为将会调用goBack()方法来处理该事件。
    37 |
    HISTORY_NEXT
    38 |
    - 该行为将会调用goForward()方法来处理该事件。
    39 |

    40 |

    N/A

    41 |

    在脚本中历史状态改变的处理

    42 | onControlEvent处理器: 43 |
    var edit = $(input#some);
    44 | edit.onControlEvent = function(evt)
    45 | {
    46 |   switch(evt.type) {
    47 |     case Event.HISTORY_STATE_CHANGED: 
    48 |        /* evt.target为该元素 */ 
    49 |        break;
    50 |   }
    51 | }
    52 | 
    53 |

    decorators.tis处理器

    54 |
    include "decorators.tis";
    55 | 
    56 | @when Event.HISTORY_STATE_CHANGED @on "frame#content" 
    57 |    function() {
    58 |      ... 事件处理代码 ...;
    59 |    }
    60 | 
    61 | 62 | -------------------------------------------------------------------------------- /content/behaviors/frame-set.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 |

    behavior:frame-set

    7 |

    该行为处理<frameset>元素的扩展功能 - 由所谓的"分隔线(splitters)"分隔的"块面板"容器,它允许调整容器中面板的尺寸。

    8 |

    该行为可以应用到任何块级容器上,如<div>、<section>等。

    9 |

    元素

    10 |

    默认情况下,应用了该行为的元素有:

    11 | 13 |

    示例

    14 |
    15 | 16 |
    17 | 主题1 18 |
    19 | 20 | 主题1的内容 21 | 22 |
    23 |

    模型

    24 |

    在Sciter中,<frameset>元素可以包含<frame>元素,也可以包含其他块级元素(如 <div>、<section>等)来作为一个面板。

    25 |

    面板可以被<splitter>元素(可以指定splitter的特有样式)分隔。

    26 |

    示例, 一个典型的帮助窗口布局:

    27 |
    <frameset cols="120px,*">
    28 |    <div id="help-index">
    29 |       <a href="first-topic.htm" target="help-content">主题1</a> 
    30 |    </div>
    31 |    <splitter/>
    32 |    <frame id="help-content">主题1的内容</frame>
    33 | </frameset>
    34 | 
    35 |

    第一个面板是一个<div>元素,它用于静态的内容。<frame>是选择的主题元素的容器。<splitter>用于交互式的调整面板的尺寸。

    36 |

    属性

    37 |

    该行为需要知道的属性:

    38 | 41 |

    cols或rows属性必须定义其中一个,宽度/高度列表是一个以逗号分隔的Sciter长度单位: dips、px、mm等, 包括弹力单位(*)。

    42 |

    事件

    43 |

    N/A - 该行为没有特有事件。

    44 |