Worked on image save as a file in Moodle.
[moodle/mihaisucan.git] / lib / paintweb / build / config-example.json
blob7d50a2c3e379f01d240b6a0a0f04da8abe6e9902
2   // $Date: 2009-07-28 20:04:15 +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    * Viewport width.
77    *
78    * <p>Note: the GUI implementation might ignore this value.
79    *
80    * @type Number
81    * @default -1
82    */
83   "viewportWidth": -1,
85   /**
86    * Viewport height.
87    *
88    * <p>Note: the GUI implementation might ignore this value.
89    *
90    * @type Number
91    * @default 400
92    */
93   "viewportHeight": 400,
95   /**
96    * Image save quality for the JPEG format.
97    *
98    * @type Number
99    * @default 0.9
100    */
101   "jpegSaveQuality": 0.9,
103   /**
104    * The default image width.
105    *
106    * @type Number
107    * @default 400
108    */
109   "imageWidth": 400,
111   /**
112    * The default image width.
113    *
114    * @type Number
115    * @default 300
116    */
117   "imageHeight": 300,
119   /**
120    * Image preload. The image you want to display when PaintWeb loads. This must 
121    * be a reference to an HTML Image element.
122    *
123    * @type HTMLImageElement
124    * @default null
125    */
126   "imagePreload": null,
128   /**
129    * Default background color.
130    *
131    * @type CSS3Color
132    * @default "#fff"
133    */
134   "backgroundColor": "#fff",
136   /**
137    * Default fill style.
138    *
139    * @type CSS3Color-rgba functional notation
140    * @default "rgba(0,0,0,1)"
141    */
142   "fillStyle": "rgba(0,0,0,1)",
144   /**
145    * Default stroke style.
146    *
147    * @type CSS3Color-rgba functional notation
148    * @default "rgba(0,0,255,1)"
149    */
150   "strokeStyle": "rgba(0,0,255,1)",
152   /**
153    * GUI placeholder element. This element will hold all the PaintWeb interface 
154    * elements.
155    *
156    * <p>For a successful initialization of PaintWeb, you must define this 
157    * configuration value programatically from your scripts.
158    *
159    * @type Element
160    * @default null
161    */
162   "guiPlaceholder": null,
164   /**
165    * Shape drawing "type": filled, only stroke, or both. Possible values: 
166    * "filled", "stroke" or "both".
167    *
168    * @type String
169    * @default "both"
170    */
171   "shapeType": "both",
173   /**
174    * Number of available history steps.
175    *
176    * @type Number
177    * @default 10
178    */
179   "historyLimit": 10,
181   /**
182    * Zoom factor when the user increases/decreases the image zoom level.
183    *
184    * @type Number
185    * @default 0.05
186    */
187   // 0.05 means 5% zoom.
188   "imageZoomStep": 0.05,
190   /**
191    * The maximum allowed image zoom level.
192    *
193    * @type Number
194    * @default 4
195    */
196   // 4 means 400% zoom.
197   "imageZoomMax": 4,
199   /**
200    * The minimum allowed image zoom level.
201    *
202    * @type Number
203    * @default 0.2
204    */
205   // 0.2 means 20% zoom.
206   "imageZoomMin": 0.2,
208   /**
209    * The image zoom control keys, for zoom in, zoom out and zoom reset.
210    * @type Object
211    */
212   "imageZoomKeys": {
213     "in":    "+",
214     "out":   "-",
215     "reset": "*"
216   },
218   /**
219    * Holds the list of drawing tools you want to load.
220    * @type Array
221    */
222   "tools": ["selection", "hand", "rectangle", "ellipse", "polygon", "line", "text", "bcurve", "insertimg", "pencil", "cpicker", "eraser"],
224   /**
225    * Tools folder.
226    * @type String
227    * @default "tools"
228    */
229   "toolsFolder": "tools",
231   /**
232    * The default tool ID.
233    *
234    * @type String
235    * @default "line"
236    * @see this.tools The array holding the list of drawing tools you want 
237    * loaded.
238    */
239   "toolDefault": "line",
241   /**
242    * Tool drawing delay. Some tools delay their drawing operations for 
243    * performance reasons.
244    *
245    * @type Number
246    * @default 80
247    */
248   "toolDrawDelay": 80,
250   /**
251    * Holds the list of extensions you want to load.
252    * @type Array
253    */
254   "extensions": ["colormixer", "mousekeys"],
256   /**
257    * Extensions folder.
258    *
259    * @type String
260    * @default "extensions"
261    */
262   "extensionsFolder": "extensions",
264   /**
265    * @namespace Line tool options.
266    */
267   "line": {
268     /**
269      * Line cap. Possible values: "butt", "round", "square".
270      *
271      * @type String
272      * @default "round"
273      */
274     "lineCap": "round",
276     /**
277      * Line join. Possible values: "round", "bevel", "miter".
278      *
279      * @type String
280      * @default "round"
281      */
282     "lineJoin": "round",
284     /**
285      * Line width.
286      *
287      * @type Number
288      * @default 1
289      */
290     "lineWidth": 1,
292     /**
293      * Miter limit.
294      *
295      * @type Number
296      * @default 10
297      */
298     "miterLimit": 10
299   },
301   /**
302    * @namespace Shadow options.
303    */
304   "shadow": {
305     /**
306      * Tells if a shadow should render or not.
307      *
308      * @type Boolean
309      * @default false
310      */
311     "enable": false,
313     /**
314      * Shadow color
315      *
316      * @type CSS3Color-rgba() functional notation
317      * @default "rgba(0,0,0,1)"
318      */
319     "shadowColor": "rgba(0,0,0,1)",
321     /**
322      * Shadow blur.
323      *
324      * @type Number
325      * @default 5
326      */
327     "shadowBlur": 5,
329     /**
330      * Shadow offset X.
331      *
332      * @type Number
333      * @default 5
334      */
335     "shadowOffsetX": 5,
337     /**
338      * Shadow offset %.
339      *
340      * @type Number
341      * @default 5
342      */
343     "shadowOffsetY": 5
344   },
346   /**
347    * @namespace Selection tool options.
348    */
349   "selection": {
350     /**
351      * Selection transformation mode. This tells if any drag/resize would also 
352      * affect the selected pixels or not.
353      *
354      * @type Boolean
355      * @default false
356      */
357     "transform": false,
359     /**
360      * Transparent selection.
361      *
362      * @type Boolean
363      * @default true
364      */
365     "transparent": true,
367     /**
368      * Selection marquee border width.
369      *
370      * @type Number
371      * @default 3
372      */
373     "borderWidth": 3,
375     /**
376      * Keyboard shortcuts for several selection-related commands.
377      * @type Object
378      */
379     "keys": {
380       "selectionCrop": "Control K",
381       "selectionDelete": "Delete",
382       "selectionDrop": "Escape",
383       "selectionFill": "Alt Backspace",
384       "transformToggle": "Enter"
385     }
386   },
388   /**
389    * Text tool options.
390    * @type Object
391    */
392   "text": {
393     "bold": false,
394     "italic": false,
396     /**
397      * The default list of font families available in font family drop-down.
398      * @type Array
399      */
400     "fontFamilies": ["sans-serif", "serif", "cursive", "fantasy", "monospace"],
402     /**
403      * The font family used for rendering the text.
404      * @type String
405      * @default "sans-serif"
406      */
407     "fontFamily": "sans-serif",
409     "fontSize": 36,
411     /**
412      * Horizontal text alignment. Possible values: "left", "center", "right".
413      *
414      * <p>Note that the Canvas Text API also defines the "start" and "end" 
415      * values, which are not "supported" by PaintWeb.
416      *
417      * @type String
418      * @default "left"
419      */
420     "textAlign": "left",
422     /**
423      * Vertical text alignment. Possible values: "top", "hanging", "middle", 
424      * "alphabetic", "ideographic", or "bottom".
425      *
426      * @type String
427      * @default "alphabetic"
428      */
429     "textBaseline": "top"
430   },
432   /**
433    * @namespace Color Mixer extension configuration.
434    */
435   "colormixer": {
436     /**
437      * Holds the minimum and maximum value for each color channel input field.  
438      * The value incrementation step is also included - this is used the user 
439      * presses the up/down arrow keys in the input of the color channel.
440      *
441      * @type Object
442      */
443     "inputValues": {
444       // RGB
445       // order: minimum, maximum, step
446       "red":   [0, 255, 1],
447       "green": [0, 255, 1],
448       "blue":  [0, 255, 1],
450       // HSV
451       // Hue - degrees
452       "hue": [0, 360, 1],
453       "sat": [0, 255, 1],
454       "val": [0, 255, 1],
456       // CMYK - all are percentages
457       "cyan":    [0, 100, 1],
458       "magenta": [0, 100, 1],
459       "yellow":  [0, 100, 1],
460       "black":   [0, 100, 1],
462       // CIE Lab
463       // cie_l = Lightness, it's a percentage value
464       // cie_a and cie_b are the color-opponent dimensions
465       "cie_l": [   0,   100, 1],
466       "cie_a": [ -86,    98, 1],
467       "cie_b": [-107,    94, 1],
469       "alpha": [0, 100, 1]
470     },
472     /**
473      * CIE Lab configuration.
474      * @type Object
475      */
476     "lab": {
477       // The RGB working space is sRGB which has the reference white point of 
478       // D65.
479       // These are the chromaticity coordinates for the red, green and blue 
480       // primaries.
481       "x_r": 0.64,
482       "y_r": 0.33,
483       "x_g": 0.3,
484       "y_g": 0.6,
485       "x_b": 0.13,
486       "y_b": 0.06,
488       // Standard observer: D65 (daylight), 2° (CIE 1931).
489       // Chromaticity coordinates.
490       "ref_x": 0.31271,
491       "ref_y": 0.32902,
493       // This is the calculated reference white point (xyY to XYZ) for D65, also 
494       // known as the reference illuminant tristimulus.
495       // These values are updated based on chromaticity coordinates, during 
496       // initialization.
497       "w_x": 0.95047,
498       "w_y": 1,
499       "w_z": 1.08883,
501       // The 3x3 matrix used for multiplying the RGB values when converting RGB 
502       // to XYZ.
503       // These values are updated based on the chromaticity coordinates, during 
504       // initialization.
505       "m": [ 0.412424,  0.212656, 0.0193324,
506              0.357579,  0.715158, 0.119193,
507              0.180464, 0.0721856, 0.950444],
509       // The same matrix, but inverted. This is used for the XYZ to RGB conversion.
510       "m_i": [ 3.24071,  -0.969258,   0.0556352,
511               -1.53726,   1.87599,   -0.203996,
512               -0.498571,  0.0415557,  1.05707]
513     },
515     /**
516      * Slider width. This value must be relative to the color space 
517      * visualisation canvas element: 1 means full width, 0.5 means half width, 
518      * etc.
519      *
520      * @type Number
521      * @default 0.10 (which is 10% of the canvas element width)
522      */
523     "sliderWidth": 0.10,
525     /**
526      * Spacing between the slider and the color chart.
527      *
528      * @type Number
529      * @default 0.03 (which is 3% of the canvas element width)
530      */
531     "sliderSpacing": 0.03,
533     /**
534      * Holds the list of color palettes.
535      * @type Object
536      */
537     "colorPalettes": {
538       "_saved" : {
539         // Color values are: red, green, blue. All three channels have values 
540         // ranging between 0 and 1.
541         "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]]
542       },
543       "windows" : {
544         "file" : "colors/windows.json"
545       },
546       "macos" : {
547         "file" : "colors/macos.json"
548       },
549       "web" : {
550         "file" : "colors/web.json"
551       }
552     },
554     "paletteDefault": "windows"
555   },
557   /**
558    * @namespace Holds the MouseKeys extension options.
559    */
560   "mousekeys": {
561     /**
562      * The mouse keys movement acceleration.
563      *
564      * @type Number
565      * @default 0.1
566      * @see PaintMouseKeys The MouseKeys extension.
567      */
568     "accel": 0.1,
570     /**
571      * Holds the list of actions, associated to keyboard shortcuts.
572      *
573      * @type Object
574      */
575     // We make sure the number keys on the NumPad also work when the Shift key 
576     // is down.
577     "actions": {
578       "ButtonToggle": [0],
579       "SouthWest":    [1],
580       "South":        [2],
581       "SouthEast":    [3],
582       "West":         [4],
583       "ButtonClick":  [5],
584       "East":         [6],
585       "NorthWest":    [7],
586       "North":        [8],
587       "NorthEast":    [9]
589       /*
590       You might want Shift+NumPad keys as well ...
591       Shift+Arrows breaks spatial navigation in Opera.
592       "ButtonToggle": [0, "Shift Insert"],
593       "SouthWest":    [1, "Shift End"],
594       "South":        [2, "Shift Down"],
595       "SouthEast":    [3, "Shift PageDown"],
596       "West":         [4, "Shift Left"],
597       "ButtonClick":  [5, "Shift Clear"],
598       "East":         [6, "Shift Right"],
599       "NorthWest":    [7, "Shift Home"],
600       "North":        [8, "Shift Up"],
601       "NorthEast":    [9, "Shift PageUp"]
602       */
603     }
604   },
606   /**
607    * Keyboard shortcuts associated to drawing tools and other actions.
608    *
609    * @type Object
610    * @see PaintTools The object holding all the drawing tools.
611    */
612   "keys": {
613     // Use "command": "id" to execute some command.
614     "Control Z": { "command": "historyUndo" },
615     "Control Y": { "command": "historyRedo" },
617     "Control N": { "command": "imageClear" },
618     "Control S": { "command": "imageSave" },
620     "Control A":    { "command": "selectAll" },
621     "Control X":    { "command": "selectionCut" },
622     "Shift Delete": { "command": "selectionCut" },
623     "Control C":    { "command": "selectionCopy" },
624     "Control V":    { "command": "clipboardPaste" },
626     // Use "toolActivate": "id" to activate the tool with the given ID.
627     "C": { "toolActivate": "cpicker" },
628     "E": { "toolActivate": "ellipse" },
629     "G": { "toolActivate": "polygon" },
630     "H": { "toolActivate": "hand" },
631     "I": { "toolActivate": "insertimg" },
632     "L": { "toolActivate": "line" },
633     "O": { "toolActivate": "eraser" },
634     "P": { "toolActivate": "pencil" },
635     "R": { "toolActivate": "rectangle" },
636     "S": { "toolActivate": "selection" },
637     "T": { "toolActivate": "text" },
638     "V": { "toolActivate": "bcurve" },
640     // Miscellaneous commands.
641     "X":  { "command": "swapFillStroke" },
642     "F1": { "command": "about" },
643   }
645   // 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: