Further work on Moodle 1.9 integration.
[moodle/mihaisucan.git] / lib / paintweb / src / config-example.json
blob2266810c74688f80cd314285b215f28c1288a8dd
2   // $Date: 2009-08-26 15:11:18 +0300 $
3   // TODO: try jsdoc-toolkit on this json (!)
5   /**
6    * The list of available languages. This associated language IDs to their 
7    * language titles.
8    *
9    * @type Object
10    */
11   "languages": {
12     // Besides the language title, you may also tell the file name. The 'file' 
13     // property needs to be relative to the PaintWeb baseFolder. If no 'file' is 
14     // given, then the 'en.json' file name is used, and the file will be loaded 
15     // from the 'langFolder' you specify below.
16     "en": { "title": "English" }
17   },
19   /**
20    * The default language.
21    *
22    * @type String
23    * @default "en"
24    */
25   "lang": "en",
27   /**
28    * The folder which holds the language files.
29    *
30    * @type String
31    * @default "lang"
32    */
33   "langFolder": "lang",
35   /**
36    * The graphical user interface you want to use.
37    *
38    * @type String
39    * @default "default"
40    */
41   "gui": "default",
43   /**
44    * The folder contains all the interfaces.
45    *
46    * @type String
47    * @default "interfaces"
48    */
49   "interfacesFolder": "interfaces",
51   /**
52    * The interface markup file. The file must be an XHTML valid document.
53    *
54    * @type String
55    * @default "layout.xhtml"
56    */
57   "guiMarkup": "layout.xhtml",
59   /**
60    * The interface style file.
61    *
62    * @type String
63    * @default "style.css"
64    */
65   "guiStyle": "style.css",
67   /**
68    * The interface script file.
69    *
70    * @type String
71    * @default script.js
72    */
73   "guiScript": "script.js",
75   /**
76    * The image viewport width. Make sure the value is a CSS length, like "50%", 
77    * "450px" or "30em".
78    *
79    * <p>Note: the GUI implementation might ignore this value.
80    *
81    * @type String
82    * @default "100%"
83    */
84   "viewportWidth": "100%",
86   /**
87    * The image viewport height. Make sure the value is a CSS length, like "50%", 
88    * "450px" or "30em".
89    *
90    * <p>Note: the GUI implementation might ignore this value.
91    *
92    * @type String
93    * @default "400px"
94    */
95   "viewportHeight": "400px",
97   /**
98    * Image save quality for the JPEG format.
99    *
100    * @type Number
101    * @default 0.9
102    */
103   "jpegSaveQuality": 0.9,
105   /**
106    * The default image width.
107    *
108    * @type Number
109    * @default 400
110    */
111   "imageWidth": 400,
113   /**
114    * The default image width.
115    *
116    * @type Number
117    * @default 300
118    */
119   "imageHeight": 300,
121   /**
122    * Image preload. The image you want to display when PaintWeb loads. This must 
123    * be a reference to an HTML Image element.
124    *
125    * @type HTMLImageElement
126    * @default null
127    */
128   "imagePreload": null,
130   /**
131    * Default background color.
132    *
133    * @type CSS3Color
134    * @default "#fff"
135    */
136   "backgroundColor": "#fff",
138   /**
139    * Default fill style.
140    *
141    * @type CSS3Color-rgba functional notation
142    * @default "rgba(0,0,0,1)"
143    */
144   "fillStyle": "rgba(0,0,0,1)",
146   /**
147    * Default stroke style.
148    *
149    * @type CSS3Color-rgba functional notation
150    * @default "rgba(0,0,255,1)"
151    */
152   "strokeStyle": "rgba(0,0,255,1)",
154   /**
155    * Enable checkers background. This tells the user interface to render 
156    * checkers in the image background. These are visible only when parts of 
157    * the image being edited are transparent.
158    *
159    * <p>If the device you are running PaintWeb on has limited resources, 
160    * disabling the checkers background should improve the drawing performance.
161    *
162    * @type Boolean
163    * @default true
164    */
165   "checkersBackground": true,
167   /**
168    * GUI placeholder element. This element will hold all the PaintWeb interface 
169    * elements.
170    *
171    * <p>For a successful initialization of PaintWeb, you must define this 
172    * configuration value programatically from your scripts.
173    *
174    * @type Element
175    * @default null
176    */
177   "guiPlaceholder": null,
179   /**
180    * Shape drawing "type": filled, only stroke, or both. Possible values: 
181    * "filled", "stroke" or "both".
182    *
183    * @type String
184    * @default "both"
185    */
186   "shapeType": "both",
188   /**
189    * Number of available history steps.
190    *
191    * @type Number
192    * @default 10
193    */
194   "historyLimit": 10,
196   /**
197    * Zoom factor when the user increases/decreases the image zoom level.
198    *
199    * @type Number
200    * @default 0.05
201    */
202   // 0.05 means 5% zoom.
203   "imageZoomStep": 0.05,
205   /**
206    * The maximum allowed image zoom level.
207    *
208    * @type Number
209    * @default 4
210    */
211   // 4 means 400% zoom.
212   "imageZoomMax": 4,
214   /**
215    * The minimum allowed image zoom level.
216    *
217    * @type Number
218    * @default 0.2
219    */
220   // 0.2 means 20% zoom.
221   "imageZoomMin": 0.2,
223   /**
224    * The image zoom control keys, for zoom in, zoom out and zoom reset.
225    * @type Object
226    */
227   "imageZoomKeys": {
228     "in":    "+",
229     "out":   "-",
230     "reset": "*"
231   },
233   /**
234    * Holds the list of drawing tools you want to load.
235    * @type Array
236    */
237   "tools": ["selection", "hand", "rectangle", "ellipse", "polygon", "line", "text", "bcurve", "insertimg", "pencil", "cpicker", "eraser"],
239   /**
240    * Tools folder.
241    * @type String
242    * @default "tools"
243    */
244   "toolsFolder": "tools",
246   /**
247    * The default tool ID.
248    *
249    * @type String
250    * @default "line"
251    * @see this.tools The array holding the list of drawing tools you want 
252    * loaded.
253    */
254   "toolDefault": "line",
256   /**
257    * Tool drawing delay (milliseconds). Some tools delay their drawing 
258    * operations for performance reasons.
259    *
260    * @type Number
261    * @default 80
262    */
263   "toolDrawDelay": 80,
265   /**
266    * Holds the list of extensions you want to load.
267    * @type Array
268    */
269   "extensions": ["colormixer", "mousekeys"],
271   /**
272    * Extensions folder.
273    *
274    * @type String
275    * @default "extensions"
276    */
277   "extensionsFolder": "extensions",
279   /**
280    * @namespace Line tool options.
281    */
282   "line": {
283     /**
284      * Line cap. Possible values: "butt", "round", "square".
285      *
286      * @type String
287      * @default "round"
288      */
289     "lineCap": "round",
291     /**
292      * Line join. Possible values: "round", "bevel", "miter".
293      *
294      * @type String
295      * @default "round"
296      */
297     "lineJoin": "round",
299     /**
300      * Line width.
301      *
302      * @type Number
303      * @default 1
304      */
305     "lineWidth": 1,
307     /**
308      * Miter limit.
309      *
310      * @type Number
311      * @default 10
312      */
313     "miterLimit": 10
314   },
316   /**
317    * @namespace Shadow options.
318    */
319   "shadow": {
320     /**
321      * Tells if a shadow should render or not.
322      *
323      * @type Boolean
324      * @default false
325      */
326     "enable": false,
328     /**
329      * Shadow color
330      *
331      * @type CSS3Color-rgba() functional notation
332      * @default "rgba(0,0,0,1)"
333      */
334     "shadowColor": "rgba(0,0,0,1)",
336     /**
337      * Shadow blur.
338      *
339      * @type Number
340      * @default 5
341      */
342     "shadowBlur": 5,
344     /**
345      * Shadow offset X.
346      *
347      * @type Number
348      * @default 5
349      */
350     "shadowOffsetX": 5,
352     /**
353      * Shadow offset %.
354      *
355      * @type Number
356      * @default 5
357      */
358     "shadowOffsetY": 5
359   },
361   /**
362    * @namespace Selection tool options.
363    */
364   "selection": {
365     /**
366      * Selection transformation mode. This tells if any drag/resize would also 
367      * affect the selected pixels or not.
368      *
369      * @type Boolean
370      * @default false
371      */
372     "transform": false,
374     /**
375      * Transparent selection.
376      *
377      * @type Boolean
378      * @default true
379      */
380     "transparent": true,
382     /**
383      * Selection marquee border width.
384      *
385      * @type Number
386      * @default 3
387      */
388     "borderWidth": 3,
390     /**
391      * Keyboard shortcuts for several selection-related commands.
392      * @type Object
393      */
394     "keys": {
395       "selectionCrop": "Control K",
396       "selectionDelete": "Delete",
397       "selectionDrop": "Escape",
398       "selectionFill": "Alt Backspace",
399       "transformToggle": "Enter"
400     }
401   },
403   /**
404    * Text tool options.
405    * @type Object
406    */
407   "text": {
408     "bold": false,
409     "italic": false,
411     /**
412      * The default list of font families available in font family drop-down.
413      * @type Array
414      */
415     "fontFamilies": ["sans-serif", "serif", "cursive", "fantasy", "monospace"],
417     /**
418      * The font family used for rendering the text.
419      * @type String
420      * @default "sans-serif"
421      */
422     "fontFamily": "sans-serif",
424     "fontSize": 36,
426     /**
427      * Horizontal text alignment. Possible values: "left", "center", "right".
428      *
429      * <p>Note that the Canvas Text API also defines the "start" and "end" 
430      * values, which are not "supported" by PaintWeb.
431      *
432      * @type String
433      * @default "left"
434      */
435     "textAlign": "left",
437     /**
438      * Vertical text alignment. Possible values: "top", "hanging", "middle", 
439      * "alphabetic", "ideographic", or "bottom".
440      *
441      * @type String
442      * @default "alphabetic"
443      */
444     "textBaseline": "top"
445   },
447   /**
448    * @namespace Color Mixer extension configuration.
449    */
450   "colormixer": {
451     /**
452      * Holds the minimum and maximum value for each color channel input field.  
453      * The value incrementation step is also included - this is used the user 
454      * presses the up/down arrow keys in the input of the color channel.
455      *
456      * @type Object
457      */
458     "inputValues": {
459       // RGB
460       // order: minimum, maximum, step
461       "red":   [0, 255, 1],
462       "green": [0, 255, 1],
463       "blue":  [0, 255, 1],
465       // HSV
466       // Hue - degrees
467       "hue": [0, 360, 1],
468       "sat": [0, 255, 1],
469       "val": [0, 255, 1],
471       // CMYK - all are percentages
472       "cyan":    [0, 100, 1],
473       "magenta": [0, 100, 1],
474       "yellow":  [0, 100, 1],
475       "black":   [0, 100, 1],
477       // CIE Lab
478       // cie_l = Lightness, it's a percentage value
479       // cie_a and cie_b are the color-opponent dimensions
480       "cie_l": [   0,   100, 1],
481       "cie_a": [ -86,    98, 1],
482       "cie_b": [-107,    94, 1],
484       "alpha": [0, 100, 1]
485     },
487     /**
488      * CIE Lab configuration.
489      * @type Object
490      */
491     "lab": {
492       // The RGB working space is sRGB which has the reference white point of 
493       // D65.
494       // These are the chromaticity coordinates for the red, green and blue 
495       // primaries.
496       "x_r": 0.64,
497       "y_r": 0.33,
498       "x_g": 0.3,
499       "y_g": 0.6,
500       "x_b": 0.13,
501       "y_b": 0.06,
503       // Standard observer: D65 (daylight), 2° (CIE 1931).
504       // Chromaticity coordinates.
505       "ref_x": 0.31271,
506       "ref_y": 0.32902,
508       // This is the calculated reference white point (xyY to XYZ) for D65, also 
509       // known as the reference illuminant tristimulus.
510       // These values are updated based on chromaticity coordinates, during 
511       // initialization.
512       "w_x": 0.95047,
513       "w_y": 1,
514       "w_z": 1.08883,
516       // The 3x3 matrix used for multiplying the RGB values when converting RGB 
517       // to XYZ.
518       // These values are updated based on the chromaticity coordinates, during 
519       // initialization.
520       "m": [ 0.412424,  0.212656, 0.0193324,
521              0.357579,  0.715158, 0.119193,
522              0.180464, 0.0721856, 0.950444],
524       // The same matrix, but inverted. This is used for the XYZ to RGB conversion.
525       "m_i": [ 3.24071,  -0.969258,   0.0556352,
526               -1.53726,   1.87599,   -0.203996,
527               -0.498571,  0.0415557,  1.05707]
528     },
530     /**
531      * Slider width. This value must be relative to the color space 
532      * visualisation canvas element: 1 means full width, 0.5 means half width, 
533      * etc.
534      *
535      * @type Number
536      * @default 0.10 (which is 10% of the canvas element width)
537      */
538     "sliderWidth": 0.10,
540     /**
541      * Spacing between the slider and the color chart.
542      *
543      * @type Number
544      * @default 0.03 (which is 3% of the canvas element width)
545      */
546     "sliderSpacing": 0.03,
548     /**
549      * Holds the list of color palettes.
550      * @type Object
551      */
552     "colorPalettes": {
553       "_saved" : {
554         // Color values are: red, green, blue. All three channels have values 
555         // ranging between 0 and 1.
556         "colors" : [[1,1,1], [1,1,0], [1,0,1], [0,1,1], [1,0,0], [0,1,0], [0,0,1], [0,0,0]]
557       },
558       "windows" : {
559         "file" : "colors/windows.json"
560       },
561       "macos" : {
562         "file" : "colors/macos.json"
563       },
564       "web" : {
565         "file" : "colors/web.json"
566       }
567     },
569     "paletteDefault": "windows"
570   },
572   /**
573    * @namespace Holds the MouseKeys extension options.
574    */
575   "mousekeys": {
576     /**
577      * The mouse keys movement acceleration.
578      *
579      * @type Number
580      * @default 0.1
581      * @see PaintMouseKeys The MouseKeys extension.
582      */
583     "accel": 0.1,
585     /**
586      * Holds the list of actions, associated to keyboard shortcuts.
587      *
588      * @type Object
589      */
590     // We make sure the number keys on the NumPad also work when the Shift key 
591     // is down.
592     "actions": {
593       "ButtonToggle": [0],
594       "SouthWest":    [1],
595       "South":        [2],
596       "SouthEast":    [3],
597       "West":         [4],
598       "ButtonClick":  [5],
599       "East":         [6],
600       "NorthWest":    [7],
601       "North":        [8],
602       "NorthEast":    [9]
604       /*
605       You might want Shift+NumPad keys as well ...
606       Shift+Arrows breaks spatial navigation in Opera.
607       "ButtonToggle": [0, "Shift Insert"],
608       "SouthWest":    [1, "Shift End"],
609       "South":        [2, "Shift Down"],
610       "SouthEast":    [3, "Shift PageDown"],
611       "West":         [4, "Shift Left"],
612       "ButtonClick":  [5, "Shift Clear"],
613       "East":         [6, "Shift Right"],
614       "NorthWest":    [7, "Shift Home"],
615       "North":        [8, "Shift Up"],
616       "NorthEast":    [9, "Shift PageUp"]
617       */
618     }
619   },
621   /**
622    * Keyboard shortcuts associated to drawing tools and other actions.
623    *
624    * @type Object
625    * @see PaintTools The object holding all the drawing tools.
626    */
627   "keys": {
628     // Use "command": "id" to execute some command.
629     "Control Z": { "command": "historyUndo" },
630     "Control Y": { "command": "historyRedo" },
632     "Control N": { "command": "imageClear" },
633     "Control S": { "command": "imageSave" },
635     "Control A":    { "command": "selectAll" },
636     "Control X":    { "command": "selectionCut" },
637     "Shift Delete": { "command": "selectionCut" },
638     "Control C":    { "command": "selectionCopy" },
639     "Control V":    { "command": "clipboardPaste" },
641     // Use "toolActivate": "id" to activate the tool with the given ID.
642     "C": { "toolActivate": "cpicker" },
643     "E": { "toolActivate": "ellipse" },
644     "G": { "toolActivate": "polygon" },
645     "H": { "toolActivate": "hand" },
646     "I": { "toolActivate": "insertimg" },
647     "L": { "toolActivate": "line" },
648     "O": { "toolActivate": "eraser" },
649     "P": { "toolActivate": "pencil" },
650     "R": { "toolActivate": "rectangle" },
651     "S": { "toolActivate": "selection" },
652     "T": { "toolActivate": "text" },
653     "V": { "toolActivate": "bcurve" },
655     // Miscellaneous commands.
656     "X":  { "command": "swapFillStroke" },
657     "F1": { "command": "about" }
658   }
660   // vim:set spell spl=en fo=wan1croql tw=80 ts=2 sw=2 sts=2 sta et ai cin fenc=utf-8 ff=unix ft=javascript: