/[suikacvs]/webroot/www/js/jste/tutorial.js
Suika

Contents of /webroot/www/js/jste/tutorial.js

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.18 - (hide annotations) (download) (as text)
Mon Jan 26 14:24:49 2009 UTC (16 years, 7 months ago) by wakaba
Branch: MAIN
Changes since 1.17: +54 -10 lines
File MIME type: application/javascript
Take margin-right into account; Added support for <button> element

1 wakaba 1.1
2     if (typeof (JSTE) === "undefined") var JSTE = {};
3    
4     JSTE.WATNS = 'http://suika.fam.cx/ns/wat';
5     JSTE.SpaceChars = /[\x09\x0A\x0C\x0D\x20]+/;
6    
7     JSTE.Class = function (constructor, prototype) {
8     return JSTE.Subclass (constructor, JSTE.EventTarget, prototype);
9     }; // Class
10    
11     JSTE.Class.addClassMethods = function (classObject, methods) {
12     new JSTE.Hash (methods).forEach (function (n, v) {
13     if (!classObject[n]) {
14     classObject[n] = v;
15     }
16     });
17     }; // addClassMethods
18    
19     JSTE.Subclass = function (constructor, superclass, prototype) {
20     constructor.prototype = new superclass;
21     for (var n in prototype) {
22     constructor.prototype[n] = prototype[n];
23     }
24     constructor.prototype.constructor = constructor;
25     constructor.prototype._super = superclass;
26     return constructor;
27     }; // Subclass
28    
29     JSTE.EventTarget = new JSTE.Subclass (function () {
30    
31     }, function () {}, {
32     addEventListener: function (eventType, handler, useCapture) {
33     if (useCapture) return;
34     if (!this.eventListeners) this.eventListeners = {};
35     if (!this.eventListeners[eventType]) {
36     this.eventListeners[eventType] = new JSTE.List;
37     }
38     this.eventListeners[eventType].push (handler);
39     }, // addEventListener
40     removeEventListener: function (eventType, handler, useCapture) {
41     if (useCapture) return;
42     if (!this.eventListeners) return;
43     if (!this.eventListeners[eventType]) return;
44     this.eventListeners[eventType].remove (handler);
45     }, // removeEventListener
46     dispatchEvent: function (e) {
47     if (!this.eventListeners) return;
48     var handlers = this.eventListeners[e.type];
49     if (!handlers) return;
50     e.currentTarget = this;
51     e.target = this;
52     var preventDefault;
53     handlers.forEach (function (handler) {
54     if (handler.apply (this, [e])) {
55     preventDefault = true;
56     }
57     });
58     return preventDefault || e.isDefaultPrevented ();
59     } // dispatchEvent
60     }); // EventTarget
61    
62     JSTE.Event = new JSTE.Class (function (eventType, canBubble, cancelable) {
63     this.type = eventType;
64     this.bubbles = canBubble;
65     this.cancelable = cancelable;
66     }, {
67     preventDefault: function () {
68     this.defaultPrevented = true;
69     }, // preventDefault
70     isDefaultPrevented: function () {
71     return this.defaultPrevented;
72     } // isDefaultPrevented
73     });
74    
75     JSTE.Observer = new JSTE.Class (function (eventType, target, onevent) {
76     this.eventType = eventType;
77 wakaba 1.10 this.target = target;
78 wakaba 1.1 if (target.addEventListener) {
79     this.code = onevent;
80     } else if (target.attachEvent) {
81     this.code = function () {
82     onevent (event);
83     };
84 wakaba 1.10 } else {
85     this.code = onevent;
86 wakaba 1.1 }
87 wakaba 1.10 this.disabled = true;
88     this.start ();
89 wakaba 1.1 }, {
90 wakaba 1.10 start: function () {
91     if (!this.disabled) return;
92     if (this.target.addEventListener) {
93     this.target.addEventListener (this.eventType, this.code, false);
94     this.disabled = false;
95     } else if (this.target.attachEvent) {
96     this.target.attachEvent ("on" + this.eventType, this.code);
97     this.disabled = false;
98     }
99     }, // start
100 wakaba 1.1 stop: function () {
101 wakaba 1.10 if (this.disabled) return;
102 wakaba 1.1 if (this.target.removeEventListener) {
103     this.target.removeEventListener (this.eventType, this.code, false);
104 wakaba 1.10 this.disabled = true;
105 wakaba 1.11 } else if (this.target.detachEvent) {
106 wakaba 1.1 this.target.detachEvent ("on" + this.eventType, this.code);
107 wakaba 1.10 this.disabled = true;
108 wakaba 1.1 }
109     } // stop
110     }); // Observer
111    
112 wakaba 1.5 new JSTE.Observer ('load', window, function () {
113     JSTE.windowLoaded = true;
114     });
115    
116 wakaba 1.10
117     JSTE.Hash = new JSTE.Class (function (hash) {
118     this.hash = hash || {};
119     }, {
120     forEach: function (code) {
121     for (var n in this.hash) {
122     var r = code (n, this.hash[n]);
123     if (r && r.stop) break;
124     }
125     }, // forEach
126     clone: function (code) {
127     var newHash = {};
128     this.forEach (function (n, v) {
129     newHash[n] = v;
130     });
131     return new this.constructor (newHash);
132     }, // clone
133    
134     getNamedItem: function (n) {
135     return this.hash[n];
136     }, // getNamedItem
137     setNamedItem: function (n, v) {
138     return this.hash[n] = v;
139     } // setNamedItem
140     });
141    
142    
143 wakaba 1.1 JSTE.List = new JSTE.Class (function (arrayLike) {
144     this.list = arrayLike || [];
145     }, {
146     getLast: function () {
147     if (this.list.length) {
148     return this.list[this.list.length - 1];
149     } else {
150     return null;
151     }
152     }, // getLast
153    
154     forEach: function (code) {
155     var length = this.list.length;
156     for (var i = 0; i < length; i++) {
157     var r = code (this.list[i]);
158     if (r && r.stop) return r.returnValue;
159     }
160     return null;
161     }, // forEach
162 wakaba 1.4
163     numberToInteger: function () {
164     var newList = [];
165     this.forEach (function (item) {
166     if (typeof item === "number") {
167     newList.push (Math.floor (item));
168     } else {
169     newList.push (item);
170     }
171     });
172     return new this.constructor (newList);
173     }, // numberToInteger
174 wakaba 1.1
175     clone: function () {
176     var newList = [];
177     this.forEach (function (item) {
178     newList.push (item);
179     });
180     return new this.constructor (newList);
181     }, // clone
182    
183     grep: function (code) {
184     var newList = [];
185     this.forEach (function (item) {
186     if (code (item)) {
187     newList.push (item);
188     }
189     });
190     return new this.constructor (newList);
191     }, // grep
192     onlyNonNull: function () {
193     return this.grep (function (item) {
194     return item != null; /* Intentionally "!=" */
195     });
196     }, // onlyNonNull
197 wakaba 1.11
198     uniq: function (eq) {
199     if (!eq) eq = function (i1, i2) { return i1 === i2 };
200     var prevItems = [];
201     return this.grep (function (item) {
202     for (var i = 0; i < prevItems.length; i++) {
203     if (eq (item, prevItems[i])) {
204     return false;
205     }
206     }
207     prevItems.push (item);
208     return true;
209     });
210     }, // uniq
211 wakaba 1.1
212     getFirstMatch: function (code) {
213     return this.forEach (function (item) {
214     if (code (item)) {
215     return new JSTE.List.Return (item);
216     }
217     });
218     }, // getFirstMatch
219    
220     switchByElementType: function () {
221     var cases = new JSTE.List (arguments);
222     this.forEach (function (n) {
223     cases.forEach (function (c) {
224     if (c.namespaceURI == n.namespaceURI) {
225     return new JSTE.List.Return (c.execute (n));
226     }
227     });
228     });
229     }, // switchByElementType
230    
231 wakaba 1.10 // destructive
232 wakaba 1.1 push: function (item) {
233     this.list.push (item);
234     }, // push
235 wakaba 1.10
236     // destructive
237 wakaba 1.1 pushCloneOfLast: function () {
238     this.list.push (this.getLast ().clone ());
239     }, // pushCloneOfLast
240 wakaba 1.10
241     // destructive
242 wakaba 1.1 append: function (list) {
243     var self = this;
244     list.forEach (function (n) {
245     self.list.push (n);
246     });
247 wakaba 1.10 return this;
248 wakaba 1.1 }, // append
249    
250 wakaba 1.10 // destructive
251 wakaba 1.1 pop: function () {
252     return this.list.pop ();
253     }, // pop
254 wakaba 1.10
255     // destructive
256 wakaba 1.1 remove: function (removedItem) {
257     var length = this.list.length;
258     for (var i = length - 1; i >= 0; --i) {
259     var item = this.list[i];
260     if (item == removedItem) { // Intentionally "=="
261     this.list.splice (i, 1);
262     }
263     }
264     }, // remove
265 wakaba 1.10
266     // destructive
267 wakaba 1.1 clear: function () {
268     this.list.splice (0, this.list.length);
269     } // clear
270    
271     }); // List
272    
273 wakaba 1.10 JSTE.Class.addClassMethods (JSTE.List, {
274     spaceSeparated: function (v) {
275     return new JSTE.List ((v || '').split (JSTE.SpaceChars)).grep (function (v) {
276     return v.length;
277     });
278     }, // spaceSeparated
279    
280     getCommonItems: function (l1, l2, cb, eq) {
281 wakaba 1.11 if (!eq) eq = function (i1, i2) { return i1 === i2 };
282 wakaba 1.10
283     var common = new JSTE.List;
284    
285     l1 = l1.grep (function (i1) {
286     var hasI1;
287     l2 = l2.grep (function (i2) {
288     if (eq (i1, i2)) {
289     common.push (i1);
290     hasI1 = true;
291     return false;
292     } else {
293     return true;
294     }
295     });
296     return !hasI1;
297     });
298    
299     cb (common, l1, l2);
300     } // getCommonItems
301     }); // List class methods
302    
303 wakaba 1.1 JSTE.List.Return = new JSTE.Class (function (rv) {
304     this.stop = true;
305     this.returnValue = rv;
306     }, {
307    
308     }); // Return
309    
310     JSTE.List.SwitchByLocalName = new JSTE.Class (function (ns, cases, ow) {
311     this.namespaceURI = ns;
312     this.cases = cases;
313     this.otherwise = ow || function (n) { };
314     }, {
315     execute: function (n) {
316     for (var ln in this.cases) {
317     if (JSTE.Element.matchLocalName (n, ln)) {
318     return this.cases[ln] (n);
319     }
320     }
321     return this.otherwise (n);
322     }
323     });
324    
325    
326     if (!JSTE.Node) JSTE.Node = {};
327    
328     JSTE.Class.addClassMethods (JSTE.Node, {
329     querySelector: function (node, selectors) {
330     if (node.querySelector) {
331     var el;
332     try {
333     el = node.querySelector (selectors);
334     } catch (e) {
335     el = null;
336     }
337     return el;
338     } else if (window.uu && uu.css) {
339     if (selectors != "") {
340     /* NOTE: uu.css return all elements for "" or ",xxx" */
341     return uu.css (selectors, node)[0];
342     } else {
343     return null;
344     }
345     } else if (window.Ten && Ten.DOM && Ten.DOM.getElementsBySelector) {
346     return Ten.DOM.getElementsBySelector (selectors)[0];
347     } else {
348     return null;
349     }
350     }, // querySelector
351     querySelectorAll: function (node, selectors) {
352     if (node.querySelectorAll) {
353     var nl;
354     try {
355     nl = node.querySelectorAll (selectors);
356     } catch (e) {
357     nl = null;
358     }
359     return new JSTE.List (nl);
360     } else if (window.uu && uu.css) {
361     if (selectors != "") {
362 wakaba 1.11 /* NOTE: uu.css return all elements for "" or ",xxx". */
363 wakaba 1.1 return new JSTE.List (uu.css (selectors, node));
364     } else {
365     return new JSTE.List;
366     }
367     } else if (window.Ten && Ten.DOM && Ten.DOM.getElementsBySelector) {
368     return new JSTE.List (Ten.DOM.getElementsBySelector (selectors));
369     } else {
370     return new JSTE.List;
371     }
372     } // querySelectorAll
373     });
374    
375     if (!JSTE.Element) JSTE.Element = {};
376    
377     JSTE.Class.addClassMethods (JSTE.Element, {
378     getLocalName: function (el) {
379     var localName = el.localName;
380     if (!localName) {
381     localName = el.nodeName;
382     if (el.prefix) {
383     localName = localName.substring (el.prefix.length + 1);
384     }
385     }
386     return localName;
387     }, // getLocalName
388    
389     match: function (el, ns, ln) {
390     if (el.nodeType !== 1) return false;
391     if (el.namespaceURI !== ns) return false;
392     return JSTE.Element.matchLocalName (el, ln);
393     }, // match
394     matchLocalName: function (el, ln) {
395     var localName = JSTE.Element.getLocalName (el);
396     if (ln instanceof RegExp) {
397     if (!localName.match (ln)) return false;
398     } else {
399     if (localName !== ln) return false;
400     }
401     return true;
402     }, // matchLocalName
403    
404     getChildElement: function (el, ns, ln) {
405     return new JSTE.List (el.childNodes).getFirstMatch (function (item) {
406     return JSTE.Element.match (item, ns, ln);
407     });
408     }, // getChildElement
409     getChildElements: function (el, ns, ln) {
410     return new JSTE.List (el.childNodes).grep (function (item) {
411     return JSTE.Element.match (item, ns, ln);
412     });
413     }, // getChildElements
414 wakaba 1.17 getChildrenClassifiedByType: function (el) {
415     var r = new JSTE.ElementHash;
416     new JSTE.List (el.childNodes).forEach (function (n) {
417     if (n.nodeType == 1) {
418     r.getOrCreate (n.namespaceURI, JSTE.Element.getLocalName (n)).push (n);
419     } else {
420     r.getOrCreate (null, n.nodeType).push (n);
421     }
422     });
423     return r;
424     }, // getChildrenClassifiedByType
425 wakaba 1.18
426     isEmpty: function (el) {
427     // HTML5 definition of "empty"
428     return !new JSTE.List (el.childNodes).forEach (function (n) {
429     var nt = n.nodeType;
430     if (nt == 1) {
431     return new JSTE.List.Return (true /* not empty */);
432     } else if (nt == 3 || nt == 4) {
433     if (/[^\u0009\u000A\u000C\u000D\u0020]/.test (n.data)) {
434     return new JSTE.List.Return (true /* not empty */);
435     }
436     } else if (nt == 7 || nt == 8) { // comment/pi
437     // does not affect emptyness
438     } else {
439     // We don't support EntityReference.
440     return new JSTE.List.Return (true /* not empty */);
441     }
442     });
443     }, // isEmpty
444 wakaba 1.1
445     appendText: function (el, s) {
446     return el.appendChild (el.ownerDocument.createTextNode (s));
447     }, // appendText
448    
449     createTemplate: function (doc, node) {
450     var df = doc.createDocumentFragment ();
451     new JSTE.List (node.childNodes).forEach (function (n) {
452     if (n.nodeType == 1) {
453     var c = doc.createElement (JSTE.Element.getLocalName (n));
454 wakaba 1.15 new JSTE.List (n.attributes).forEach (function (n) {
455 wakaba 1.1 c.setAttribute (n.name, n.value);
456     });
457     c.appendChild (JSTE.Element.createTemplate (doc, n));
458     df.appendChild (c);
459     } else if (n.nodeType == 3 || n.nodeType == 4) {
460     df.appendChild (doc.createTextNode (n.data));
461     }
462     });
463     return df;
464     }, // createTemplate
465    
466     hasAttribute: function (el, localName) {
467     if (el.hasAttribute) {
468     return el.hasAttribute (localName);
469     } else {
470     return el.getAttribute (localName) != null;
471     }
472     }, // hasAttribute
473    
474     getClassNames: function (el) {
475     return new JSTE.List (el.className.split (JSTE.SpaceChars));
476     }, // getClassNames
477     addClassName: function (el, newClassName) {
478     el.className = el.className + ' ' + newClassName;
479     }, // deleteClassName
480     deleteClassName: function (el, oldClassName) {
481     var classNames = el.className.split (JSTE.SpaceChars);
482     var newClasses = [];
483     for (var n in classNames) {
484     if (classNames[n] != oldClassName) {
485     newClasses.push (classNames[n]);
486     }
487     }
488     el.className = newClasses.join (' ');
489     }, // deleteClassName
490     replaceClassName: function (el, oldClassName, newClassName) {
491     var classNames = el.className.split (JSTE.SpaceChars);
492     var newClasses = [newClassName];
493     for (var n in classNames) {
494     if (classNames[n] != oldClassName) {
495     newClasses.push (classNames[n]);
496     }
497     }
498     el.className = newClasses.join (' ');
499     }, // replaceClassName
500    
501     getIds: function (el) {
502     return new JSTE.List (el.id != "" ? [el.id] : []);
503 wakaba 1.5 }, // getIds
504    
505     /*
506     NR.js <http://suika.fam.cx/www/css/noderect/NodeRect.js> must be loaded
507     before the invocation.
508     */
509     scroll: function (elements) {
510     if (!JSTE.windowLoaded) {
511     new JSTE.Observer ('load', window, function () {
512     JSTE.Element.scroll (elements);
513     });
514     return;
515     }
516    
517     var top = Infinity;
518     var left = Infinity;
519     var topEl;
520     var leftEl;
521     elements.forEach (function (el) {
522     var rect = NR.Element.getRects (el, window).borderBox;
523     if (rect.top < top) {
524     top = rect.top;
525     topEl = el;
526     }
527     if (rect.left < left) {
528     left = rect.left;
529     leftEl = el;
530     }
531     });
532    
533     if (!leftEl && !topEl) {
534     return;
535     }
536    
537     var doc = (leftEl || topEl).ownerDocument;
538 wakaba 1.1
539 wakaba 1.5 var rect = NR.View.getViewportRects (window, doc).contentBox;
540     if (rect.top <= top && top <= rect.bottom) {
541     top = rect.top;
542     }
543     if (rect.left <= left && left <= rect.right) {
544     left = rect.left;
545     }
546    
547     /*
548     Set scroll* of both <html> and <body> elements, to support all of
549     four browsers and two (or three) rendering modes. This might result
550     in confusing the user if both <html> and <body> elements have their
551     'overflow' properties specified to 'scroll'.
552    
553     Note that this code does not do a good job if the |el| is within an
554     |overflow: scroll| element.
555     */
556     doc.body.scrollTop = top;
557     doc.body.scrollLeft = left;
558     doc.documentElement.scrollTop = top;
559     doc.documentElement.scrollLeft = left;
560     } // scroll
561 wakaba 1.18 }); // Element
562 wakaba 1.1
563 wakaba 1.17 JSTE.ElementHash = new JSTE.Class (function () {
564     this.items = [];
565     }, {
566     get: function (ns, ln) {
567     ns = ns || '';
568     if (this.items[ns]) {
569     return this.items[ns].getNamedItem (ln) || new JSTE.List;
570     } else {
571     return new JSTE.List;
572     }
573     }, // get
574     getOrCreate: function (ns, ln) {
575     ns = ns || '';
576     if (this.items[ns]) {
577     var l = this.items[ns].getNamedItem (ln);
578     if (!l) this.items[ns].setNamedItem (ln, l = new JSTE.List);
579     return l;
580     } else {
581     var l;
582     this.items[ns] = new JSTE.Hash;
583     this.items[ns].setNamedItem (ln, l = new JSTE.List);
584     return l;
585     }
586     } // getOrCreate
587     }); // ElementHash
588    
589 wakaba 1.9 JSTE.XHR = new JSTE.Class (function (url, onsuccess, onerror) {
590     try {
591     this._xhr = new XMLHttpRequest ();
592     } catch (e) {
593     try {
594     this._xhr = new ActiveXObject ('Msxml2.XMLHTTP');
595     } catch (e) {
596     try {
597     this._xhr = new ActiveXObject ('Microsoft.XMLHTTP');
598     } catch (e) {
599     try {
600     this._xhr = new ActiveXObject ('Msxml2.XMLHTTP.4.0');
601     } catch (e) {
602     this._xhr = null;
603     }
604     }
605     }
606     }
607    
608     this._url = url;
609     this._onsuccess = onsuccess || function () { };
610     this._onerror = onerror || function () { };
611     }, {
612     get: function () {
613     if (!this._xhr) return;
614    
615     var self = this;
616     this._xhr.open ('GET', this._url, true);
617     this._xhr.onreadystatechange = function () {
618     self._onreadystatechange ();
619     }; // onreadystatechange
620     this._xhr.send (null);
621     }, // get
622    
623     _onreadystatechange: function () {
624     if (this._xhr.readyState == 4) {
625     if (this.succeeded ()) {
626     this._onsuccess ();
627     } else {
628     this._onerror ();
629     }
630     }
631     }, // _onreadystatechange
632    
633     succeeded: function () {
634     return (this._xhr.status < 400);
635     }, // succeeded
636    
637     getDocument: function () {
638     return this._xhr.responseXML;
639     } // getDocument
640     }); // XHR
641    
642    
643 wakaba 1.1 /* Events: load, close, shown, hidden */
644 wakaba 1.18 JSTE.Message = new JSTE.Class (function (doc, template, commandTarget, availCommands) {
645 wakaba 1.1 if (!doc) return;
646     this._targetDocument = doc;
647     this._template = template || doc.createDocumentFragment ();
648 wakaba 1.8
649 wakaba 1.1 this._commandTarget = commandTarget;
650 wakaba 1.18 this._availCommands = availCommands || new JSTE.List;
651 wakaba 1.8
652 wakaba 1.1 this.hidden = true;
653     this.select = "";
654    
655     var e = new JSTE.Event ('load');
656     this.dispatchEvent (e);
657     }, {
658     render: function () {
659     var self = this;
660     var doc = this._targetDocument;
661    
662     var msgContainer = doc.createElement ('section');
663     msgContainer.appendChild (this._template);
664    
665 wakaba 1.7 if (this._commandTarget.canBack ()) {
666 wakaba 1.8 this._availCommands.push ({name: 'back'});
667 wakaba 1.7 }
668    
669     if (this._commandTarget.canNext ()) {
670 wakaba 1.8 this._availCommands.push ({name: 'next'});
671 wakaba 1.7 }
672 wakaba 1.1
673 wakaba 1.8 this._outermostElement = this._render (msgContainer);
674 wakaba 1.1
675     this.show ();
676     }, // render
677     _render: function (msgContainer, buttonContainer) {
678     var doc = this._targetDocument;
679    
680     var container = doc.createElement ('article');
681    
682     container.appendChild (msgContainer);
683 wakaba 1.8
684     var buttonContainer = this.createCommandButtons ();
685 wakaba 1.1 container.appendChild (buttonContainer);
686 wakaba 1.8
687 wakaba 1.1 doc.documentElement.appendChild (container);
688    
689     return container;
690     }, // _render
691 wakaba 1.8 createCommandButtons: function () {
692     var self = this;
693 wakaba 1.18 var doc = this._targetDocument;
694     var buttonContainer = doc.createElement ('menu');
695 wakaba 1.8 this._availCommands.forEach (function (cmd) {
696 wakaba 1.18 var label = cmd.name;
697     if (cmd.labelTemplate) {
698     label = JSTE.Element.createTemplate (doc, cmd.labelTemplate);
699     }
700    
701 wakaba 1.8 var button = new JSTE.Message.Button
702 wakaba 1.18 (label, self._commandTarget, cmd.name, cmd.args);
703 wakaba 1.8 buttonContainer.appendChild (button.element);
704     });
705     return buttonContainer;
706     }, // createCommandButtons
707    
708 wakaba 1.1 remove: function () {
709     this.hide ();
710    
711     this._remove ();
712    
713     if (this._outermostElement && this._outermostElement.parentNode) {
714     this._outermostElement.parentNode.removeChild (this._outermostElement);
715     }
716    
717     var e = new JSTE.Event ("close");
718     this.dispatchEvent (e);
719     }, // remove
720     _remove: function () {
721    
722     }, // remove
723    
724     show: function () {
725     if (!this.hidden) return;
726     this.hidden = false;
727     if (this._outermostElement) {
728     JSTE.Element.replaceClassName
729     (this._outermostElement, "jste-hidden", "jste-shown");
730     }
731    
732     var e = new JSTE.Event ("shown");
733     this.dispatchEvent (e);
734     }, // show
735     hide: function () {
736     if (this.hidden) return;
737     this.hidden = true;
738     if (this._outermostElement) {
739     JSTE.Element.replaceClassName
740     (this._outermostElement, "jste-shown", "jste-hidden");
741     }
742    
743     var e = new JSTE.Event ("hidden");
744     this.dispatchEvent (e);
745     }, // hide
746    
747     setTimeout: function () {
748     /* TODO: ... */
749    
750     }
751    
752     }); // Message
753    
754 wakaba 1.7 /* TODO: button label text should refer message catalog */
755    
756 wakaba 1.1 JSTE.Message.Button =
757 wakaba 1.18 new JSTE.Class (function (label, commandTarget, commandName, commandArgs) {
758     this._label = label != null ? label : "";
759 wakaba 1.6
760 wakaba 1.1 if (commandTarget && commandTarget instanceof Function) {
761     this._command = commandTarget;
762 wakaba 1.6 this._classNames = new JSTE.List;
763 wakaba 1.1 } else if (commandTarget) {
764     this._command = function () {
765     return commandTarget.executeCommand.apply
766     (commandTarget, [commandName, commandArgs]);
767     };
768 wakaba 1.6 this._classNames = new JSTE.List (['jste-command-' + commandName]);
769 wakaba 1.1 } else {
770     this._command = function () { };
771 wakaba 1.6 this._classNames = new JSTE.List;
772 wakaba 1.1 }
773    
774 wakaba 1.6 this._createElement ();
775 wakaba 1.1 }, {
776 wakaba 1.6 _createElement: function () {
777     try {
778     this.element = document.createElement ('button');
779     this.element.setAttribute ('type', 'button');
780     } catch (e) {
781     this.element = document.createElement ('<button type=button>');
782     }
783 wakaba 1.18 if (this._label.nodeType) {
784     this.element.appendChild (this._label);
785     } else {
786     JSTE.Element.appendText (this.element, this._label);
787     }
788 wakaba 1.6 this.element.className = this._classNames.list.join (' ');
789 wakaba 1.1
790 wakaba 1.6 var self = this;
791     new JSTE.Observer ("click", this.element, function (e) {
792     self._command (e);
793     });
794     } // _createElement
795 wakaba 1.1 }); // Button
796    
797     JSTE.Course = new JSTE.Class (function (doc) {
798     this._targetDocument = doc;
799    
800     this._entryPointsByURL = {};
801     this._entryPointsById = {};
802     this._entryPointsByClassName = {};
803    
804     this._stepsState = new JSTE.List ([new JSTE.Hash]);
805     this._steps = new JSTE.Hash;
806    
807     var nullState = new JSTE.Step;
808     nullState.uid = "";
809     this._steps.setNamedItem (nullState.uid, nullState);
810     this._initialStepUid = nullState.uid;
811     }, {
812 wakaba 1.10 _processStepsContent: function (el, parentSteps) {
813 wakaba 1.1 var self = this;
814     new JSTE.List (el.childNodes).switchByElementType (
815     new JSTE.List.SwitchByLocalName (JSTE.WATNS, {
816 wakaba 1.10 steps: function (n) { self._processStepsElement (n, parentSteps) },
817     step: function (n) { self._processStepElement (n, parentSteps) },
818     jump: function (n) { self._processJumpElement (n, parentSteps) },
819 wakaba 1.14 entryPoint: function (n) { self._processEntryPointElement (n, parentSteps) }
820 wakaba 1.1 })
821     );
822     }, // _processStepsContent
823 wakaba 1.10 _processStepsElement: function (e, parentSteps) {
824     var steps = new JSTE.Steps ();
825     steps.parentSteps = parentSteps;
826 wakaba 1.1 this._stepsState.pushCloneOfLast ();
827     this._stepsState.getLast ().prevStep = null;
828 wakaba 1.10 this._processStepsContent (e, steps);
829 wakaba 1.1 this._stepsState.pop ();
830     }, // _processStepsElement
831    
832 wakaba 1.14 _processEntryPointElement: function (e, parentSteps) {
833 wakaba 1.1 if (JSTE.Element.hasAttribute (e, 'url')) {
834     this.setEntryPointByURL
835     (e.getAttribute ('url'), e.getAttribute ('step'));
836     } else if (JSTE.Element.hasAttribute (e, 'root-id')) {
837     this.setEntryPointById
838     (e.getAttribute ('root-id'), e.getAttribute ('step'));
839     } else if (JSTE.Element.hasAttribute (e, 'root-class')) {
840     this.setEntryPointByClassName
841     (e.getAttribute ('root-class'), e.getAttribute ('step'));
842     }
843 wakaba 1.14 }, // _processEntryPointElement
844 wakaba 1.1 setEntryPointByURL: function (url, stepName) {
845     this._entryPointsByURL[url] = stepName || '';
846     }, // setEntryPointByURL
847     setEntryPointById: function (id, stepName) {
848     this._entryPointsById[id] = stepName || '';
849     }, // setEntryPointById
850     setEntryPointByClassName: function (className, stepName) {
851     this._entryPointsByClassName[className] = stepName || '';
852     }, // setEntryPointByClassName
853     findEntryPoint: function (doc) {
854     var self = this;
855     var td = this._targetDocument;
856     var stepName;
857    
858     var url = doc.URL;
859     if (url) {
860     stepName = self._entryPointsByURL[url];
861     if (stepName) return 'id-' + stepName;
862     }
863    
864     var docEl = td.documentElement;
865     if (docEl) {
866     var docElId = JSTE.Element.getIds (docEl).forEach (function (i) {
867     stepName = self._entryPointsById[i];
868     if (stepName) return new JSTE.List.Return (stepName);
869     });
870     if (stepName) return 'id-' + stepName;
871    
872     stepName = JSTE.Element.getClassNames (docEl).forEach (function (c) {
873     stepName = self._entryPointsByClassName[c];
874     if (stepName) return new JSTE.List.Return (stepName);
875     });
876     if (stepName) return 'id-' + stepName;
877     }
878    
879     var bodyEl = td.body;
880     if (bodyEl) {
881     var bodyElId = JSTE.Element.getIds (bodyEl).forEach (function (i) {
882     stepName = self._entryPointsById[i];
883     if (stepName) return new JSTE.List.Return (stepName);
884     });
885     if (stepName) return 'id-' + stepName;
886    
887     stepName = JSTE.Element.getClassNames (bodyEl).forEach (function (c) {
888     stepName = self._entryPointsByClassName[c];
889     if (stepName) return new JSTE.List.Return (stepName);
890     });
891     if (stepName) return 'id-' + stepName;
892     }
893    
894     return this._initialStepUid;
895     }, // findEntryPoint
896    
897 wakaba 1.10 _processStepElement: function (e, parentSteps) {
898 wakaba 1.18 var self = this;
899    
900 wakaba 1.1 var step = new JSTE.Step (e.getAttribute ('id'));
901 wakaba 1.10 step.parentSteps = parentSteps;
902 wakaba 1.1 step.setPreviousStep (this._stepsState.getLast ().prevStep);
903     step.select = e.getAttribute ('select') || "";
904     step.nextEvents.append
905 wakaba 1.10 (JSTE.List.spaceSeparated (e.getAttribute ('next-event')));
906 wakaba 1.17
907     var cs = JSTE.Element.getChildrenClassifiedByType (e);
908    
909     var msgEl = cs.get (JSTE.WATNS, 'message').list[0];
910 wakaba 1.1 if (msgEl) {
911     var msg = JSTE.Element.createTemplate (this._targetDocument, msgEl);
912     step.setMessageTemplate (msg);
913     }
914 wakaba 1.17
915     var nextEls = cs.get (JSTE.WATNS, 'next-step');
916 wakaba 1.16 if (nextEls.list.length) {
917 wakaba 1.1 nextEls.forEach (function (nextEl) {
918     step.addNextStep
919     (nextEl.getAttribute ('if'), nextEl.getAttribute ('step'));
920     });
921     this._stepsState.getLast ().prevStep = null;
922     } else {
923     this._stepsState.getLast ().prevStep = step;
924     }
925 wakaba 1.17
926 wakaba 1.18 cs.get (JSTE.WATNS, 'button').forEach (function (bEl) {
927     var cmd = {
928     name: bEl.getAttribute ('command') || 'gotoStep'
929     };
930     if (cmd.name == 'gotoStep') {
931     cmd.args = ['id-' + bEl.getAttribute ('step')];
932     }
933     if (!JSTE.Element.isEmpty (bEl)) {
934     cmd.labelTemplate = JSTE.Element.createTemplate (self._targetDocument, bEl);
935     }
936     step.availCommands.push (cmd);
937     });
938    
939 wakaba 1.1 /* TODO: @save */
940 wakaba 1.13
941     var evs = JSTE.List.spaceSeparated (e.getAttribute ('entry-event'));
942     if (evs.list.length) {
943     var jump = new JSTE.Jump (step.select, evs, step.uid);
944     if (parentSteps) parentSteps._jumps.push (jump);
945     }
946 wakaba 1.1
947     this._steps.setNamedItem (step.uid, step);
948     if (!this._initialStepUid) {
949     this._initialStepUid = step.uid;
950     }
951     }, // _processStepElement
952    
953 wakaba 1.10 _processJumpElement: function (e, parentSteps) {
954     var target = e.getAttribute ('target') || '';
955     var evs = JSTE.List.spaceSeparated (e.getAttribute ('event'));
956     var stepName = e.getAttribute ('step') || '';
957    
958     var jump = new JSTE.Jump (target, evs, 'id-' + stepName);
959     if (parentSteps) parentSteps._jumps.push (jump);
960 wakaba 1.1 }, // _processJumpElement
961    
962     getStep: function (uid) {
963     return this._steps.getNamedItem (uid);
964     } // getStep
965     }); // Course
966    
967 wakaba 1.9 JSTE.Class.addClassMethods (JSTE.Course, {
968     createFromDocument: function (doc, targetDoc) {
969     var course = new JSTE.Course (targetDoc);
970     var docEl = doc.documentElement;
971     if (!docEl) return course;
972     if (!JSTE.Element.match (docEl, JSTE.WATNS, 'course')) return course;
973 wakaba 1.10 course._processStepsContent (docEl, null);
974 wakaba 1.9 return course;
975     }, // createFromDocument
976     createFromURL: function (url, targetDoc, onload, onerror) {
977     new JSTE.XHR (url, function () {
978     var course = JSTE.Course.createFromDocument
979     (this.getDocument (), targetDoc);
980     if (onload) onload (course);
981     }, onerror).get ();
982     } // creatFromURL
983     }); // Course class methods
984 wakaba 1.1
985 wakaba 1.10 JSTE.Jump = new JSTE.Class (function (selectors, eventNames, stepUid) {
986     this.selectors = selectors;
987     this.eventNames = eventNames;
988     this.stepUid = stepUid;
989     // this.parentSteps
990     }, {
991     startObserver: function (doc, commandTarget) {
992     var self = this;
993     var observers = new JSTE.List;
994    
995     var onev = function () {
996     commandTarget.gotoStep (self.stepUid);
997     };
998    
999     JSTE.Node.querySelectorAll (doc, this.selectors).forEach
1000     (function (el) {
1001     self.eventNames.forEach (function (evName) {
1002     var ob = new JSTE.Observer (evName, el, onev);
1003     ob._stepUid = self.stepUid;
1004     observers.push (ob);
1005     });
1006     });
1007    
1008     return observers;
1009     } // startObserver
1010     }); // Jump
1011    
1012     JSTE.Steps = new JSTE.Class (function () {
1013     this._jumps = new JSTE.List;
1014     this._jumpHandlers = new JSTE.List;
1015     }, {
1016     setCurrentStepByUid: function (uid) {
1017     this._jumpHandlers.forEach (function (jh) {
1018     if (jh._stepUid != uid && jh.disabled) {
1019     jh.start ();
1020     } else if (jh._stepUid == uid && !jh.disabled) {
1021     jh.stop ();
1022     }
1023     });
1024     }, // setCurrentStepByUid
1025    
1026     installJumps: function (doc, commandTarget) {
1027     if (this._jumpHandlers.list.length) return;
1028     var self = this;
1029     this._jumps.forEach (function (j) {
1030     self._jumpHandlers.append (j.startObserver (doc, commandTarget));
1031     });
1032     }, // installJumps
1033    
1034     uninstallJumps: function () {
1035     this._jumpHandlers.forEach (function (jh) {
1036     jh.stop ();
1037     });
1038     this._jumpHandlers.clear ();
1039     } // uninstallJumps
1040     }); // Steps
1041    
1042 wakaba 1.1 JSTE.Step = new JSTE.Class (function (id) {
1043     if (id != null && id != '') {
1044     this.uid = 'id-' + id;
1045     } else {
1046     this.uid = 'rand-' + Math.random ();
1047     }
1048     this._nextSteps = new JSTE.List;
1049     this.nextEvents = new JSTE.List;
1050 wakaba 1.18 this.availCommands = new JSTE.List;
1051 wakaba 1.1 this.select = "";
1052     }, {
1053     setMessageTemplate: function (msg) {
1054     this._messageTemplate = msg;
1055     }, // setMessageTemplate
1056     hasMessage: function () {
1057     return this._messageTemplate ? true : false;
1058     }, // hasMessage
1059     createMessage: function (msg, doc, commandTarget) {
1060     var msg;
1061     if (this._messageTemplate) {
1062     var clone = JSTE.Element.createTemplate (doc, this._messageTemplate);
1063 wakaba 1.18 msg = new msg (doc, clone, commandTarget, this.availCommands.clone ());
1064 wakaba 1.1 } else {
1065     msg = new msg (doc, null, commandTarget);
1066     }
1067     msg.select = this.select;
1068     return msg;
1069     }, // createMessage
1070    
1071     addNextStep: function (condition, stepId) {
1072 wakaba 1.16 if (stepId != null) this._nextSteps.push ([condition, stepId]);
1073 wakaba 1.1 }, // addNextStep
1074     setPreviousStep: function (prevStep) {
1075     if (!prevStep) return;
1076     if (prevStep._defaultNextStepUid) return;
1077     prevStep._defaultNextStepUid = this.uid;
1078     }, // setPreviousStep
1079    
1080     getNextStepUid: function (doc) {
1081     var m = this._nextSteps.getFirstMatch (function (item) {
1082     var condition = item[0];
1083     if (condition) {
1084     return JSTE.Node.querySelector (doc, condition) != null;
1085     } else {
1086     return true;
1087     }
1088     });
1089     if (m) {
1090     return 'id-' + m[1];
1091     } else if (this._defaultNextStepUid) {
1092     return this._defaultNextStepUid;
1093     } else {
1094     return null;
1095     }
1096 wakaba 1.10 }, // getNextStepUid
1097    
1098     getAncestorStepsObjects: function () {
1099     var steps = new JSTE.List;
1100     var s = this.parentSteps;
1101     while (s != null) {
1102     steps.push (s);
1103     s = s.parentSteps;
1104     }
1105     return steps;
1106     } // getAncestorStepsObjects
1107 wakaba 1.1 }); // Step
1108    
1109 wakaba 1.3 /* Events: load, error, cssomready */
1110 wakaba 1.9 JSTE.Tutorial = new JSTE.Class (function (course, doc, args) {
1111 wakaba 1.1 this._course = course;
1112     this._targetDocument = doc;
1113     this._messageClass = JSTE.Message;
1114     if (args) {
1115     if (args.messageClass) this._messageClass = args.messageClass;
1116     }
1117    
1118     this._currentMessages = new JSTE.List;
1119     this._currentObservers = new JSTE.List;
1120     this._prevStepUids = new JSTE.List;
1121 wakaba 1.10 this._currentStepsObjects = new JSTE.List;
1122 wakaba 1.1
1123     var stepUid = this._course.findEntryPoint (document);
1124     this._currentStep = this._getStepOrError (stepUid);
1125     if (this._currentStep) {
1126     var e = new JSTE.Event ('load');
1127     this.dispatchEvent (e);
1128    
1129 wakaba 1.3 var self = this;
1130     new JSTE.Observer ('cssomready', this, function () {
1131     self._renderCurrentStep ();
1132     });
1133     this._dispatchCSSOMReadyEvent ();
1134 wakaba 1.1 return this;
1135     } else {
1136     return {};
1137     }
1138     }, {
1139     _getStepOrError: function (stepUid) {
1140     var step = this._course.getStep (stepUid);
1141     if (step) {
1142     return step;
1143     } else {
1144     var e = new JSTE.Event ('error');
1145     e.errorMessage = 'Step not found';
1146     e.errorArguments = [this._currentStepUid];
1147     this.dispatchEvent (e);
1148     return null;
1149     }
1150     }, // _getStepOrError
1151    
1152     _renderCurrentStep: function () {
1153     var self = this;
1154     var step = this._currentStep;
1155    
1156     /* Message */
1157     var msg = step.createMessage
1158     (this._messageClass, this._targetDocument, this);
1159     msg.render ();
1160     this._currentMessages.push (msg);
1161    
1162     /* Next-events */
1163     var selectedNodes = JSTE.Node.querySelectorAll
1164     (this._targetDocument, step.select);
1165     var handler = function () {
1166     self.executeCommand ("next");
1167     };
1168     selectedNodes.forEach (function (node) {
1169     step.nextEvents.forEach (function (eventType) {
1170     self._currentObservers.push
1171     (new JSTE.Observer (eventType, node, handler));
1172     });
1173     });
1174 wakaba 1.10
1175     JSTE.List.getCommonItems (this._currentStepsObjects,
1176     step.getAncestorStepsObjects (),
1177     function (common, onlyInOld, onlyInNew) {
1178     common.forEach (function (item) {
1179     item.setCurrentStepByUid (step.uid);
1180     });
1181     onlyInOld.forEach (function (item) {
1182     item.uninstallJumps ();
1183     });
1184     onlyInNew.forEach (function (item) {
1185     item.installJumps (self._targetDocument, self);
1186     });
1187     self._currentStepsObjects = common.append (onlyInNew);
1188     });
1189 wakaba 1.1 }, // _renderCurrentStep
1190     clearMessages: function () {
1191     this._currentMessages.forEach (function (msg) {
1192     msg.remove ();
1193     });
1194     this._currentMessages.clear ();
1195    
1196     this._currentObservers.forEach (function (ob) {
1197     ob.stop ();
1198     });
1199     this._currentObservers.clear ();
1200     }, // clearMessages
1201 wakaba 1.10 clearStepsHandlers: function () {
1202     this._currentStepsObjects.forEach (function (item) {
1203     item.uninstallJumps ();
1204     });
1205     this._currentStepsObjects.clear ();
1206     }, // clearStepsHandlers
1207 wakaba 1.1
1208     executeCommand: function (commandName, commandArgs) {
1209     if (this[commandName]) {
1210     return this[commandName].apply (this, commandArgs || []);
1211     } else {
1212     var e = new JSTE.Event ('error');
1213     e.errorMessage = 'Command not found';
1214     e.errorArguments = [commandName];
1215     return null;
1216     }
1217     }, // executeCommand
1218 wakaba 1.7 canExecuteCommand: function (commandName, commandArgs) {
1219     if (this[commandName]) {
1220     var can = this['can' + commandName.substring (0, 1).toUpperCase ()
1221     + commandName.substring (1)];
1222     if (can) {
1223     return can.apply (this, arguments);
1224     } else {
1225     return true;
1226     }
1227     } else {
1228     return false;
1229     }
1230     }, // canExecuteCommand
1231 wakaba 1.1
1232     startTutorial: function () {
1233     this.resetVisited ();
1234    
1235     }, // startTutorial
1236     continueTutorial: function () {
1237    
1238     }, // continueTutorial
1239    
1240     saveVisited: function () {
1241    
1242     }, // saveVisited
1243     resetVisited: function () {
1244    
1245     }, // resetVisited
1246    
1247     back: function () {
1248     var prevStepUid = this._prevStepUids.pop ();
1249     var prevStep = this._getStepOrError (prevStepUid);
1250     if (prevStep) {
1251     this.clearMessages ();
1252     this._currentStep = prevStep;
1253     this._renderCurrentStep ();
1254     }
1255     }, // back
1256 wakaba 1.7 canBack: function () {
1257     return this._prevStepUids.list.length > 0;
1258     }, // canBack
1259 wakaba 1.1 next: function () {
1260     var nextStepUid = this._currentStep.getNextStepUid (this._targetDocument);
1261     var nextStep = this._getStepOrError (nextStepUid);
1262     if (nextStep) {
1263     this._prevStepUids.push (this._currentStep.uid);
1264     this.clearMessages ();
1265     this._currentStep = nextStep;
1266     this._renderCurrentStep ();
1267     }
1268 wakaba 1.3 }, // next
1269 wakaba 1.7 canNext: function () {
1270     return this._currentStep.getNextStepUid (this._targetDocument) != null;
1271     }, // canNext
1272 wakaba 1.10 gotoStep: function (uid) {
1273     var nextStep = this._getStepOrError (uid);
1274     if (nextStep) {
1275     this._prevStepUids.push (this._currentStep.uid);
1276     this.clearMessages ();
1277     this._currentStep = nextStep;
1278     this._renderCurrentStep ();
1279     }
1280     }, // gotoStep
1281 wakaba 1.3
1282     // <http://twitter.com/waka/status/1129513097>
1283     _dispatchCSSOMReadyEvent: function () {
1284     var self = this;
1285     var e = new JSTE.Event ('cssomready');
1286     if (window.opera && document.readyState != 'complete') {
1287     new JSTE.Observer ('readystatechange', document, function () {
1288     if (document.readyState == 'complete') {
1289     self.dispatchEvent (e);
1290     }
1291     });
1292     } else {
1293     this.dispatchEvent (e);
1294     }
1295     } // dispatchCSSOMReadyEvent
1296    
1297 wakaba 1.1 }); // Tutorial
1298 wakaba 1.9
1299     JSTE.Class.addClassMethods (JSTE.Tutorial, {
1300 wakaba 1.12 createFromURL: function (url, doc, args, onload) {
1301 wakaba 1.9 JSTE.Course.createFromURL (url, doc, function (course) {
1302 wakaba 1.12 var tutorial = new JSTE.Tutorial (course, doc, args);
1303     if (onload) onload (tutorial);
1304 wakaba 1.9 });
1305     } // createFromURL
1306     }); // Tutorial class methods
1307    
1308    
1309 wakaba 1.5
1310     if (JSTE.onLoadFunctions) {
1311     new JSTE.List (JSTE.onLoadFunctions).forEach (function (code) {
1312     code ();
1313     });
1314     }
1315    
1316     if (JSTE.isDynamicallyLoaded) {
1317     JSTE.windowLoaded = true;
1318     }
1319 wakaba 1.2
1320     /* ***** BEGIN LICENSE BLOCK *****
1321     * Copyright 2008-2009 Wakaba <w@suika.fam.cx>. All rights reserved.
1322     *
1323     * This program is free software; you can redistribute it and/or
1324     * modify it under the same terms as Perl itself.
1325     *
1326     * Alternatively, the contents of this file may be used
1327     * under the following terms (the "MPL/GPL/LGPL"),
1328     * in which case the provisions of the MPL/GPL/LGPL are applicable instead
1329     * of those above. If you wish to allow use of your version of this file only
1330     * under the terms of the MPL/GPL/LGPL, and not to allow others to
1331     * use your version of this file under the terms of the Perl, indicate your
1332     * decision by deleting the provisions above and replace them with the notice
1333     * and other provisions required by the MPL/GPL/LGPL. If you do not delete
1334     * the provisions above, a recipient may use your version of this file under
1335     * the terms of any one of the Perl or the MPL/GPL/LGPL.
1336     *
1337     * "MPL/GPL/LGPL":
1338     *
1339     * Version: MPL 1.1/GPL 2.0/LGPL 2.1
1340     *
1341     * The contents of this file are subject to the Mozilla Public License Version
1342     * 1.1 (the "License"); you may not use this file except in compliance with
1343     * the License. You may obtain a copy of the License at
1344     * <http://www.mozilla.org/MPL/>
1345     *
1346     * Software distributed under the License is distributed on an "AS IS" basis,
1347     * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
1348     * for the specific language governing rights and limitations under the
1349     * License.
1350     *
1351     * The Original Code is JSTE code.
1352     *
1353     * The Initial Developer of the Original Code is Wakaba.
1354     * Portions created by the Initial Developer are Copyright (C) 2008
1355     * the Initial Developer. All Rights Reserved.
1356     *
1357     * Contributor(s):
1358     * Wakaba <w@suika.fam.cx>
1359     *
1360     * Alternatively, the contents of this file may be used under the terms of
1361     * either the GNU General Public License Version 2 or later (the "GPL"), or
1362     * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
1363     * in which case the provisions of the GPL or the LGPL are applicable instead
1364     * of those above. If you wish to allow use of your version of this file only
1365     * under the terms of either the GPL or the LGPL, and not to allow others to
1366     * use your version of this file under the terms of the MPL, indicate your
1367     * decision by deleting the provisions above and replace them with the notice
1368     * and other provisions required by the LGPL or the GPL. If you do not delete
1369     * the provisions above, a recipient may use your version of this file under
1370     * the terms of any one of the MPL, the GPL or the LGPL.
1371     *
1372     * ***** END LICENSE BLOCK ***** */

admin@suikawiki.org
ViewVC Help
Powered by ViewVC 1.1.24