Skip to content

Commit b709ffc

Browse files
author
Bruno Herfst
committed
Test the sky
1 parent 0bc7302 commit b709ffc

File tree

9 files changed

+254
-196
lines changed

9 files changed

+254
-196
lines changed

Diff for: README.md

-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
Here you can find some [modules](./docs/API-Registry.md) we host inside our [@extendscript](https://www.npmjs.com/org/extendscript) namespace on [npm](https://www.npmjs.com). These modules create a [DRY](https://en.wikipedia.org/wiki/Don%27t_repeat_yourself) package environment targeting the ExtendScript environment. Giving the flexibility to pick and choose implemetations and share reusable code.
44

5-
65
## Contributing
76

87
Any contribution is very welcome and much appreaciated. Please read our [Code of Conduct](https://github.com/ExtendScript/organisation-rules/blob/master/CODE_OF_CONDUCT.md) and [Contributing Guidelines](https://github.com/ExtendScript/organisation-rules/blob/master/CONTRIBUTING.md) before you get started. Thanks!

Diff for: aes/util/schema/schema.document/document.js

+137-125
Original file line numberDiff line numberDiff line change
@@ -1,145 +1,151 @@
1-
if (!myApp) { // Check if myApp is loaded
2-
var myApp = new Object();
3-
};
4-
if (!myApp.hasOwnProperty("schema")) {
5-
myApp.schema = new Object();
6-
};
7-
8-
// Now we can load the schema
9-
10-
myApp.schema.document = {
11-
"$schema": "http://coverbuilder.brunoherfst.com/schemas/document#",
12-
13-
// S T A R T D E F I N I N I T I O N S
14-
// -------------------------------------
15-
16-
"definitions": {
17-
18-
"positiveNumber": {
19-
"description" : "A positive number",
20-
"type" : "number",
21-
"minimum" : 0,
22-
"default" : 0
23-
},
1+
(function () {
2+
3+
var VERSION = 0.1;
4+
var MODULE_PATH = "schema.document";
5+
6+
var load = Sky.getUtil(MODULE_PATH);
7+
if( load && load.version >= VERSION) {
8+
return;
9+
};
10+
11+
//--------------------------
12+
// set load
13+
14+
load = {
15+
"title": "General Document",
16+
"description": "A general document description.",
17+
"version": "0.1",
18+
19+
// S T A R T D E F I N I N I T I O N S
20+
// -------------------------------------
21+
22+
"definitions": {
23+
24+
"positiveNumber": {
25+
"description" : "A positive number",
26+
"type" : "number",
27+
"minimum" : 0,
28+
"default" : 0
29+
},
2430

25-
"units": {
26-
"description" : "Measurement unit",
27-
"type" : ["string","integer"]
28-
},
31+
"units": {
32+
"description" : "Measurement unit",
33+
"type" : ["string","integer"]
34+
},
2935

30-
"measurement": {
31-
"description" : "An InDesign measurement value",
32-
"type" : "object",
33-
"properties" : {
34-
"value" : { "type" : "number" },
35-
"units" : { "$ref": "#/definitions/units" }
36+
"measurement": {
37+
"description" : "An InDesign measurement value",
38+
"type" : "object",
39+
"properties" : {
40+
"value" : { "type" : "number" },
41+
"units" : { "$ref": "#/definitions/units" }
42+
},
43+
"required" : ["value", "units"]
3644
},
37-
"required" : ["value", "units"]
38-
},
3945

40-
"positive_measurement": {
41-
"description" : "An InDesign measurement value",
42-
"type" : "object",
43-
"properties" : {
44-
"value" : { "$ref": "#/definitions/positiveNumber" },
45-
"units" : { "$ref": "#/definitions/units" }
46+
"positive_measurement": {
47+
"description" : "An InDesign measurement value",
48+
"type" : "object",
49+
"properties" : {
50+
"value" : { "$ref": "#/definitions/positiveNumber" },
51+
"units" : { "$ref": "#/definitions/units" }
52+
},
53+
"required" : ["value", "units"]
4654
},
47-
"required" : ["value", "units"]
48-
},
4955

50-
"label": {
51-
"description" : "A label object",
52-
"type": "object",
53-
"properties": {
54-
"label" : { "type": "string" },
55-
"value" : { "type": "string" }
56-
}
57-
},
56+
"label": {
57+
"description" : "A label object",
58+
"type": "object",
59+
"properties": {
60+
"label" : { "type": "string" },
61+
"value" : { "type": "string" }
62+
}
63+
},
5864

59-
"labels": {
60-
"description" : "A collection of label objects",
61-
"type" : "array",
62-
"items": { "$ref": "#/definitions/label" }
63-
},
65+
"labels": {
66+
"description" : "A collection of label objects",
67+
"type" : "array",
68+
"items": { "$ref": "#/definitions/label" }
69+
},
6470

65-
"bounds": {
66-
"description" : "Bounds in format [y1, x1, y2, x2]",
67-
"type" : "array" , "minItems": 4, "maxItems": 4,
68-
"items": { "type" : "number"}
69-
},
70-
71-
"guide": {
72-
"description" : "Guide",
73-
"type" : "object",
74-
"properties" : {
75-
"horizontal" : { "type" : "boolean" , "description" : "Is the guide horzontal, if false it is vertical" },
76-
"location" : { "$ref": "#/definitions/measurement" },
77-
"scriptLabel" : { "type" : "string" },
78-
"labels" : { "$ref": "#/definitions/labels" }
71+
"bounds": {
72+
"description" : "Bounds in format [y1, x1, y2, x2]",
73+
"type" : "array" , "minItems": 4, "maxItems": 4,
74+
"items": { "type" : "number"}
75+
},
76+
77+
"guide": {
78+
"description" : "Guide",
79+
"type" : "object",
80+
"properties" : {
81+
"horizontal" : { "type" : "boolean" , "description" : "Is the guide horzontal, if false it is vertical" },
82+
"location" : { "$ref": "#/definitions/measurement" },
83+
"scriptLabel" : { "type" : "string" },
84+
"labels" : { "$ref": "#/definitions/labels" }
85+
},
86+
"required" : ["horizontal", "location"]
7987
},
80-
"required" : ["horizontal", "location"]
81-
},
8288

83-
"page": {
84-
"description" : "Single page (child of spread)",
85-
"type" : "object",
86-
"properties" : {
87-
"name" : { "type" : "st ring" , "description" : "Name of page" },
88-
"scriptLabel" : { "type" : "string" },
89-
"labels" : { "$ref": "#/definitions/labels" },
90-
"width" : { "$ref": "#/definitions/positive_measurement" },
91-
"height" : { "$ref": "#/definitions/positive_measurement" },
92-
"bounds" : { "$ref": "#/definitions/bounds" },
93-
"margins" : {
94-
"description" : "Margins",
95-
"type" : "object",
96-
"properties" : {
97-
"top" : { "$ref": "#/definitions/positive_measurement" },
98-
"bottom" : { "$ref": "#/definitions/positive_measurement" },
99-
"left" : { "$ref": "#/definitions/positive_measurement" },
100-
"right" : { "$ref": "#/definitions/positive_measurement" }
101-
},
102-
"required" : ["top","bottom","left","right"]
103-
},
104-
"columnCount" : { "type" : "integer" , "minimum" : 1, "default" : 1},
105-
"columnGutter" : { "$ref": "#/definitions/positive_measurement" },
106-
"guides" : { "type" : "array", "items": { "$ref": "#/definitions/guide" }, "description" : "Guides relative to page" }
89+
"page": {
90+
"description" : "Single page (child of spread)",
91+
"type" : "object",
92+
"properties" : {
93+
"name" : { "type" : "st ring" , "description" : "Name of page" },
94+
"scriptLabel" : { "type" : "string" },
95+
"labels" : { "$ref": "#/definitions/labels" },
96+
"width" : { "$ref": "#/definitions/positive_measurement" },
97+
"height" : { "$ref": "#/definitions/positive_measurement" },
98+
"bounds" : { "$ref": "#/definitions/bounds" },
99+
"margins" : {
100+
"description" : "Margins",
101+
"type" : "object",
102+
"properties" : {
103+
"top" : { "$ref": "#/definitions/positive_measurement" },
104+
"bottom" : { "$ref": "#/definitions/positive_measurement" },
105+
"left" : { "$ref": "#/definitions/positive_measurement" },
106+
"right" : { "$ref": "#/definitions/positive_measurement" }
107+
},
108+
"required" : ["top","bottom","left","right"]
109+
},
110+
"columnCount" : { "type" : "integer" , "minimum" : 1, "default" : 1},
111+
"columnGutter" : { "$ref": "#/definitions/positive_measurement" },
112+
"guides" : { "type" : "array", "items": { "$ref": "#/definitions/guide" }, "description" : "Guides relative to page" }
113+
},
114+
"required" : ["width","height"]
107115
},
108-
"required" : ["width","height"]
109-
},
110116

111-
"spread": {
112-
"description" : "Spread description",
113-
"type" : "object",
114-
"properties" : {
115-
"name" : { "type" : "string" , "description" : "Name of spread" },
116-
"namePrefix" : { "type" : "string" , "description" : "namePrefix of spread" },
117-
"baseName" : { "type" : "string" , "description" : "baseName of spread" },
118-
"scriptLabel" : { "type" : "string" },
119-
"labels" : { "$ref": "#/definitions/labels" },
120-
"bounds" : { "$ref": "#/definitions/bounds" },
121-
"pages" : { "type" : "array", "items": { "$ref": "#/definitions/page" } , "description" : "All the pages in this spread" },
122-
"guides" : { "type" : "array", "items": { "$ref": "#/definitions/guide" } , "description" : "Guides relative to spread" }
117+
"spread": {
118+
"description" : "Spread description",
119+
"type" : "object",
120+
"properties" : {
121+
"name" : { "type" : "string" , "description" : "Name of spread" },
122+
"namePrefix" : { "type" : "string" , "description" : "namePrefix of spread" },
123+
"baseName" : { "type" : "string" , "description" : "baseName of spread" },
124+
"scriptLabel" : { "type" : "string" },
125+
"labels" : { "$ref": "#/definitions/labels" },
126+
"bounds" : { "$ref": "#/definitions/bounds" },
127+
"pages" : { "type" : "array", "items": { "$ref": "#/definitions/page" } , "description" : "All the pages in this spread" },
128+
"guides" : { "type" : "array", "items": { "$ref": "#/definitions/guide" } , "description" : "Guides relative to spread" }
129+
},
130+
"required" : ["name","pages"]
123131
},
124-
"required" : ["name","pages"]
125-
},
126132

127-
"layer": {
128-
"description" : "Document Layer",
129-
"type" : "object",
130-
"properties": {
131-
"name" : { "type": "string" },
132-
"scriptLabel" : { "type" : "string" },
133-
"labels" : { "$ref": "#/definitions/labels" },
134-
"locked" : { "type": "boolean", "default" : false }
133+
"layer": {
134+
"description" : "Document Layer",
135+
"type" : "object",
136+
"properties": {
137+
"name" : { "type": "string" },
138+
"scriptLabel" : { "type" : "string" },
139+
"labels" : { "$ref": "#/definitions/labels" },
140+
"locked" : { "type": "boolean", "default" : false }
141+
}
135142
}
136-
}
137143

138-
},
144+
},
139145

140146

141-
// E N D D E F I N I N I T I O N S
142-
// ---------------------------------
147+
// E N D D E F I N I N I T I O N S
148+
// ---------------------------------
143149

144150
"type": "object",
145151

@@ -181,4 +187,10 @@ myApp.schema.document = {
181187
},
182188

183189
"required" : ["name"]
184-
};
190+
};
191+
//--------------------------
192+
// End document schema
193+
194+
Sky.setUtil(schema.document, load);
195+
196+
})();

Diff for: boilerplate/module/___moduleName___/README.md

-4
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,6 @@ ___description___
1414

1515
We keep [a log of test results](./test/results_log.md)
1616

17-
## Contributers
18-
19-
* [ExtendScript.org](https://github.com/ExtendScript)
20-
2117

2218
## More info
2319

Diff for: extendscript-modules.sublime-project

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"folders":
3+
[
4+
{
5+
"path": "./",
6+
"folder_exclude_patterns":
7+
[
8+
".git",
9+
".venv",
10+
"node_modules",
11+
]
12+
}
13+
]
14+
}

Diff for: ind/util/ruler.set/README.md

+13-6
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,17 @@
1-
# AES.UTIL scope
1+
# ruler.set
22

3-
This is a collection of utilities for [ExtendScript](https://en.wikipedia.org/wiki/ExtendScript).
3+
> InDesign Utility
44
5-
* __`ruler`__
6-
* [ruler.set](./ruler.set)
5+
The `ruler.set()` method sets both rulers to the desired units. It returns the original ruler-settings which we can pass back to reset the rulers to original state.
76

8-
## More info
7+
## Install
98

10-
Read [the docs](../docs/README.md)
9+
npm install @extendscript/aes.ind.util.ruler.set
10+
11+
## Test
12+
13+
You can test the code against a range of [targets](https://github.com/nbqx/fakestk/blob/master/resources/versions.json):
14+
15+
npm run test target-1 target-2
16+
17+
We keep [a log of test results](./test/results_log.md)

Diff for: ind/util/ruler.set/ruler.set.js

-4
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
11

22
function setRuler(doc, myNewUnits){
33

4-
// This function sets the rulers to the disired measure units
5-
// and returns the original setting so that you can send these
6-
// back to this function to reset the rulers to original state
7-
84
var myOldUnits = { xruler : doc.viewPreferences.horizontalMeasurementUnits,
95
yruler : doc.viewPreferences.verticalMeasurementUnits,
106
origin : doc.viewPreferences.rulerOrigin,

0 commit comments

Comments
 (0)