/[suikacvs]/webroot/www/js/jste/test.html
Suika

Contents of /webroot/www/js/jste/test.html

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.13 - (hide annotations) (download) (as text)
Tue Jan 20 13:57:02 2009 UTC (16 years, 7 months ago) by wakaba
Branch: MAIN
Changes since 1.12: +71 -67 lines
File MIME type: text/html
Implemented VML version of border and pointer

1 wakaba 1.1 <!DOCTYPE HTML>
2     <html lang=en class=account-user-misc>
3     <meta charset=utf-8>
4     <title>新しい利用者アカウントの作成</title>
5     <link rel=stylesheet href="/admin/style/common">
6 wakaba 1.12 <body>
7 wakaba 1.1 <h1>新しい利用者アカウントの作成</h1>
8    
9     <form action=new-user accept-charset=utf-8 method=post>
10    
11     <p><strong>利用者識別子</strong>: <input type=text name=user-id
12     maxlength=20 size=10 required pattern="[0-9a-z-]{4,20}"> (文字「a」〜「z」、「0」〜「9」、「-」を使って 4〜10 文字の文字列を指定してください。)<p><strong>合言葉</strong>: <input type=password name=user-pass
13     size=10 required pattern=".{4,}"> (最低4文字入力してください。)<p><strong>合言葉</strong> (もう一度): <input type=password
14     name=user-pass2 size=10 required pattern=".{4,}">
15    
16 wakaba 1.12 <p><input type=submit value="作成" class=create></p></form>
17 wakaba 1.1
18     <section>
19     <html lang=en class=account-user-info>
20     <title>さん</title>
21 wakaba 1.12
22     <h1>さん</h1><section id=groups><h2>グループ</h2><section id="groups-joined"><h3>参加中のグループ</h3><ul><li><form action="group.admin-groups" accept-charset=utf-8 method=post><a href="../../groups/admin-groups/">admin-groups</a> <input type=hidden name=action value=leave><input type=submit value="このグループから抜ける"></form><li><form action="group.admin-users" accept-charset=utf-8 method=post><a href="../../groups/admin-users/">admin-users</a> <input type=hidden name=action value=leave><input type=submit value="このグループから抜ける"></form><li><form action="group.helo" accept-charset=utf-8 method=post><a href="../../groups/helo/">helo</a> <input type=hidden name=action value=leave><input type=submit value="このグループから抜ける"></form><li><form action="group.helo-admin" accept-charset=utf-8 method=post><a href="../../groups/helo-admin/">helo-admin</a> <input type=hidden name=action value=leave><input type=submit value="このグループから抜ける"></form><li><form action="group.schema-db" accept-charset=utf-8 method=post><a href="../../groups/schema-db/">schema-db</a> <input type=hidden name=action value=leave><input type=submit value="このグループから抜ける"></form><li><form action="group.spec-ja" accept-charset=utf-8 method=post><a href="../../groups/spec-ja/">spec-ja</a> <input type=hidden name=action value=leave><input type=submit value="このグループから抜ける"></form><li><form action="group.spec-ja-admin" accept-charset=utf-8 method=post><a href="../../groups/spec-ja-admin/">spec-ja-admin</a> <input type=hidden name=action value=leave><input type=submit value="このグループから抜ける"></form><li><form action="group.suikawiki" accept-charset=utf-8 method=post><a href="../../groups/suikawiki/">suikawiki</a> <input type=hidden name=action value=leave><input type=submit value="このグループから抜ける"></form><li><form action="group.test-results" accept-charset=utf-8 method=post><a href="../../groups/test-results/">test-results</a> <input type=hidden name=action value=leave><input type=submit value="このグループから抜ける"></form></ul></section><section id="groups-requested"><h3>参加申請中 (未許可) のグループ</h3><ul><li><form action="" accept-charset=utf-8 method=post><a href="../../groups//"></a> <input type=hidden name=action value=leave><input type=submit value="申請取消"></form></ul></section></section><section id=props><h2>特性</h2><p><em>これらの特性は管理者のみが見ることができますが、秘密の情報は記述しないことをお勧めします。</em></p>
23    
24     <form action="prop" accept-charset=utf-8 method=post><input type=hidden name=name value="full_name"><p><label><strong>名前</strong>: <input type="text" name="value" value=""></label> <input type=submit value="保存">
25    
26     </p></form>
27    
28 wakaba 1.13
29    
30 wakaba 1.12 <form action="prop" accept-charset=utf-8 method=post><input type=hidden name=name value="mail_addr"><p><label><strong>メイル・アドレス</strong>: <input type="email" name="value" value=""></label> <input type=submit value="保存">
31     </p></form>
32    
33     <form action="prop" accept-charset=utf-8 method=post><input type=hidden name=name value="home_url"><p><label><strong>Web サイト URL</strong>: <input type="url" name="value" value=""></label> <input type=submit value="保存">
34     </p>
35    
36     </form></section><section id=password><h2>合言葉</h2>
37 wakaba 1.1
38     <form action=password method=post accept-charset=utf-8>
39    
40     <p>合言葉を変更できます。<p><strong>新しい合言葉</strong>: <input type=password name=user-pass
41     size=10 required pattern=".{4,}"> (最低4文字入力してください。) <p><strong>新しい合言葉</strong> (もう一度): <input type=password
42     name=user-pass2 size=10 required pattern=".{4,}">
43    
44 wakaba 1.12 <p><input type=submit value="変更"></p>
45 wakaba 1.1
46     </form>
47     </section>
48    
49     <section id=disable-account><h2>アカウントの無効化</h2>
50    
51    
52     <p><label><input type=checkbox name=action value=enable checked> このアカウントを有効にする</label>
53    
54     <p><strong>警告!</strong> 自分のアカウントを無効にすると、自分で再度有効にすることはできません。<p><input type=submit value="変更"></form></section></section>
55    
56     <style>
57    
58 wakaba 1.4 section, article, menu {
59     display: block;
60 wakaba 1.5 margin: 0;
61     padding: 0;
62 wakaba 1.4 }
63    
64     .sbs-container {
65 wakaba 1.1 display: block;
66     position: absolute;
67     }
68 wakaba 1.4
69     .sbs-container.sbs-without-refelement {
70     position: fixed;
71     bottom: 1em;
72     right: 1em;
73     }
74    
75 wakaba 1.10 .sbs-selected {
76     outline: 2px blue dotted !important;
77     }
78    
79 wakaba 1.11 .mm-container {
80 wakaba 1.1 display: block;
81 wakaba 1.5 padding-bottom: 2em;
82 wakaba 1.4 background-color: white;
83 wakaba 1.5 width: 20em;
84     min-height: 5em;
85     }
86    
87 wakaba 1.11 .mm-container menu {
88 wakaba 1.5 position: absolute;
89     bottom: 0;
90     left: 0;
91     right: 0;
92     text-align: center;
93 wakaba 1.4 }
94 wakaba 1.1 </style>
95    
96 wakaba 1.12 </p>
97    
98 wakaba 1.1 <script type="text/javascript" src="uupaa-detect.mini.js"></script>
99     <script type="text/javascript" src="uupaa-selector.js"></script>
100     <script type="text/javascript" src="uupaa-selector+.js"></script>
101    
102 wakaba 1.4 <script src="../../css/noderect/NodeRect.js"></script>
103    
104 wakaba 1.1 <script id="uupaa.js" type="text/javascript" src="uupaa/uupaa.js"></script>
105    
106     <script src=tutorial.js></script>
107    
108     <script>
109    
110     window.onload = function () {
111     window.loaded = true;
112     };
113    
114     function showElement (elements) {
115     if (!window.loaded) {
116     new JSTE.Observer ('load', window, function () {
117     showElement (elements);
118     });
119     return;
120     }
121    
122     var top = Infinity;
123     var left = Infinity;
124     var topEl;
125     var leftEl;
126     elements.forEach (function (el) {
127     var rect = uu.element.rect (el);
128     if (rect.y < top) {
129     top = rect.y;
130     topEl = el;
131     }
132     if (rect.x < left) {
133     left = rect.x;
134     leftEl = el;
135     }
136     });
137    
138     var rect = uu.viewport.rect ();
139     if (rect.sh <= top && top <= rect.sh + rect.h) {
140     top = rect.sh;
141     }
142     if (rect.sw <= left && left <= rect.sw + rect.w) {
143     left = rect.sw;
144     }
145    
146     if (leftEl || topEl) {
147     var od = (leftEl || topEl).ownerDocument;
148     var point = od.createElement ('span');
149     point.style.display = 'block';
150     point.style.position = 'absolute';
151     point.style.top = top + 'px';
152     point.style.left = left + 'px';
153     point.style.width = 0;
154     point.style.height = 0;
155     od.documentElement.appendChild (point);
156     point.scrollIntoView (true);
157     point.parentNode.removeChild (point);
158     }
159     }
160    
161 wakaba 1.12 var SimpleBalloon = new JSTE.Class (function (messageContainer, refElement) {
162     if (!messageContainer) return;
163    
164 wakaba 1.5 this.element = document.createElement ('article');
165 wakaba 1.4 this.element.className = 'sbs-container';
166     document.body.appendChild (this.element);
167    
168 wakaba 1.11 this.contentElement = messageContainer;
169     this.element.appendChild (messageContainer);
170    
171 wakaba 1.10 this._renderBorder ();
172 wakaba 1.4
173 wakaba 1.10 this.refElement = refElement;
174     if (refElement) {
175     JSTE.Element.addClassName (refElement, 'sbs-selected');
176     this._renderPointer ();
177 wakaba 1.4
178 wakaba 1.10 JSTE.Element.addClassName (this.element, 'sbs-with-refelement');
179     } else {
180     JSTE.Element.addClassName (this.element, 'sbs-without-refelement');
181     }
182    
183     var self = this;
184     //setTimeout (function () {
185     showElement (new JSTE.List ([refElement]).onlyNonNull ());
186     //}, 2000);
187     }, {
188     SVGNS: 'http://www.w3.org/2000/svg',
189 wakaba 1.4
190 wakaba 1.10 remove: function () {
191     if (this.refElement) {
192     JSTE.Element.deleteClassName (this.refElement, 'sbs-selected');
193     }
194     }, // remove
195 wakaba 1.9
196 wakaba 1.10 _renderBorder: function () {
197     var msgRects = NR.Element.getRects (this.contentElement, window);
198     var msgRect = msgRects.borderBox;
199    
200     var bb = this.getComputedStyle ();
201    
202     var bwDelta = bb.marginLeft + bb.borderLeftWidth + bb.paddingLeft;
203     var bhDelta = bb.marginTop + bb.borderTopWidth + bb.paddingTop;
204     var boxMBWidth = msgRect.width + bwDelta
205     + bb.marginRight + bb.borderRightWidth + bb.paddingRight;
206     var boxMBHeight = msgRect.height + bhDelta
207     + bb.marginBottom + bb.borderBottomWidth + bb.paddingBottom;
208    
209     var box = document.createElementNS (this.SVGNS, 'svg');
210     box.style.display = 'block';
211     box.style.position = 'absolute';
212     box.style.top = -bhDelta + 'px';
213     box.style.left = -bwDelta + 'px';
214    
215     /* This is necessary to render the content element over the border SVG
216     element. */
217     this.contentElement.style.position = 'relative';
218    
219     box.setAttribute ('width', boxMBWidth);
220     box.setAttribute ('height', boxMBHeight);
221    
222     var bbTop = bb.marginTop + bb.borderTopWidth / 2;
223     var bbRight = boxMBWidth - bb.marginLeft - bb.borderLeftWidth / 2
224     - bb.marginRight - bb.borderRightWidth / 2;
225     var bbLeft = bb.marginLeft + bb.borderLeftWidth / 2;
226     var bbBottom = boxMBHeight - bb.marginTop - bb.marginBottom
227     - bb.borderTopWidth / 2 - bb.borderBottomWidth / 2;
228    
229     var boxBorder = document.createElementNS (this.SVGNS, 'path');
230     boxBorder.setAttribute ('d', [
231     'M', bbLeft + bb.manakaiBorderTopLeftRadiusHorizontal, bbTop,
232    
233     'L', bbRight - bb.manakaiBorderTopRightRadiusHorizontal, bbTop,
234    
235     'a',
236     bb.manakaiBorderTopRightRadiusHorizontal,
237     bb.manakaiBorderTopRightRadiusVertical, 0, 0, 1,
238     bb.manakaiBorderTopRightRadiusHorizontal,
239     bb.manakaiBorderTopRightRadiusVertical,
240 wakaba 1.4
241 wakaba 1.10 'L', bbRight, bbBottom - bb.manakaiBorderBottomRightRadiusVertical,
242    
243     'a',
244     bb.manakaiBorderBottomRightRadiusHorizontal,
245     bb.manakaiBorderBottomRightRadiusVertical, 0, 0, 1,
246     -bb.manakaiBorderBottomRightRadiusHorizontal,
247     bb.manakaiBorderBottomRightRadiusVertical,
248    
249     'L', bbLeft + bb.manakaiBorderBottomLeftRadiusHorizontal, bbBottom,
250    
251     'a',
252     bb.manakaiBorderBottomLeftRadiusHorizontal,
253     bb.manakaiBorderBottomLeftRadiusVertical, 0, 0, 1,
254     -bb.manakaiBorderBottomLeftRadiusHorizontal,
255     -bb.manakaiBorderBottomLeftRadiusVertical,
256    
257     'L', bbLeft, bbTop + bb.manakaiBorderTopLeftRadiusVertical,
258    
259     'a',
260     bb.manakaiBorderTopLeftRadiusHorizontal,
261     bb.manakaiBorderTopLeftRadiusVertical, 0, 0, 1,
262     bb.manakaiBorderTopLeftRadiusHorizontal,
263     -bb.manakaiBorderTopLeftRadiusVertical
264     ].join (' '));
265     boxBorder.setAttribute ('stroke', bb.borderColor);
266     boxBorder.setAttribute ('stroke-width', bb.borderWidth);
267     boxBorder.setAttribute ('fill', bb.backgroundColor);
268    
269     box.appendChild (boxBorder);
270    
271     this.element.insertBefore (box, this.element.firstChild);
272     }, // _renderBorder
273     _renderPointer: function () {
274     var rects = NR.Element.getRects (this.refElement, window);
275     var rbb = rects.borderBox;
276 wakaba 1.4
277 wakaba 1.10 var bb = this.getComputedStyle ();
278 wakaba 1.1
279 wakaba 1.9 var left = rbb.left + rbb.width * 3 / 4 - bb.manakaiPointerSource;
280     if (left < 0) left = bb.borderLeftWidth + bb.paddingLeft;
281     var top = rbb.bottom + bb.manakaiPointerOffset + bb.manakaiPointerHeight + bb.paddingTop;
282 wakaba 1.4
283 wakaba 1.1 this.element.style.top = top + 'px';
284     this.element.style.left = left + 'px';
285 wakaba 1.5
286 wakaba 1.10 var pointerSVGElement = document.createElementNS (this.SVGNS, 'svg');
287 wakaba 1.9 pointerSVGElement.setAttribute ('width', bb.manakaiPointerWidth);
288     pointerSVGElement.setAttribute ('height', bb.manakaiPointerHeight);
289 wakaba 1.5 pointerSVGElement.style.display = 'block';
290     pointerSVGElement.style.position = 'absolute';
291 wakaba 1.9 pointerSVGElement.style.top = -(bb.manakaiPointerHeight + bb.paddingTop) + 'px';
292     pointerSVGElement.style.left = (bb.manakaiPointerSource - bb.manakaiPointerWidth / 2) + 'px';
293 wakaba 1.5
294 wakaba 1.10 var pointerElement = document.createElementNS (this.SVGNS, 'path');
295 wakaba 1.9 pointerElement.setAttribute ('d', [
296     'M', bb.manakaiPointerWidth, bb.manakaiPointerHeight,
297     'Q', bb.manakaiPointerWidth * 3 / 4, bb.manakaiPointerHeight,
298     bb.manakaiPointerWidth / 2, 0,
299     'Q', bb.manakaiPointerWidth / 4, bb.manakaiPointerHeight,
300     0, bb.manakaiPointerHeight].join (' '));
301     pointerElement.setAttribute ('stroke', bb.borderColor);
302     pointerElement.setAttribute ('stroke-width', bb.borderWidth);
303     pointerElement.setAttribute ('fill', bb.backgroundColor);
304 wakaba 1.5
305     pointerSVGElement.appendChild (pointerElement);
306    
307     this.element.appendChild (pointerSVGElement);
308 wakaba 1.10 }, // _renderPointer
309 wakaba 1.9
310     getComputedStyle: function (pseudoEl) {
311     if (pseudoEl == null) {
312     var boxMargin = 1;
313     var boxBorderWidth = 5;
314     var boxBorderColor = 'green';
315     var boxBorderRadiusHorizontal = 10;
316     var boxBorderRadiusVertical = 10;
317     var boxPadding = 10;
318     var pointerBoxMargin = 5;
319     var pointerBoxWidth = 20;
320     var pointerBoxHeight = 40;
321     var pointerBoxLeft = 20;
322    
323     return {
324     marginTop: boxMargin, marginRight: boxMargin, marginBottom: boxMargin,
325     marginLeft: boxMargin,
326     borderColor: boxBorderColor,
327     borderTopColor: boxBorderColor, borderRightColor: boxBorderColor,
328     borderBottomColor: boxBorderColor, borderLeftColor: boxBorderColor,
329     borderWidth: boxBorderWidth,
330     borderTopWidth: boxBorderWidth, borderRightWidth: boxBorderWidth,
331     borderBottomWidth: boxBorderWidth, borderLeftWidth: boxBorderWidth,
332     manakaiBorderTopLeftRadiusHorizontal: boxBorderRadiusHorizontal,
333     manakaiBorderTopLeftRadiusVertical: boxBorderRadiusVertical,
334     manakaiBorderTopRightRadiusHorizontal: boxBorderRadiusHorizontal,
335     manakaiBorderTopRightRadiusVertical: boxBorderRadiusVertical,
336     manakaiBorderBottomLeftRadiusHorizontal: boxBorderRadiusHorizontal,
337     manakaiBorderBottomLeftRadiusVertical: boxBorderRadiusVertical,
338     manakaiBorderBottomRightRadiusHorizontal: boxBorderRadiusHorizontal,
339     manakaiBorderBottomRightRadiusVertical: boxBorderRadiusVertical,
340     paddingTop: boxPadding, paddingRight: boxPadding,
341     paddingBottom: boxPadding, paddingLeft: boxPadding,
342     backgroundColor: this.getBackgroundColor (),
343     manakaiPointerWidth: pointerBoxWidth,
344     manakaiPointerHeight: pointerBoxHeight,
345     manakaiPointerOffset: pointerBoxMargin,
346     manakaiPointerSource: pointerBoxLeft
347     };
348     } else {
349     return {};
350     }
351     }, // getComputedStyle
352 wakaba 1.4
353     getBackgroundColor: function () {
354     var el = this.contentElement;
355     if (window.getComputedStyle) {
356     return getComputedStyle (el, null).backgroundColor;
357     } else if (el.currentStyle) {
358     return el.currentStyle.backgroundColor;
359     } else {
360     return 'white';
361     }
362     } // getBackgroundColor
363 wakaba 1.12 }); // SimpleBalloon
364    
365     var SimpleBalloonVML = new JSTE.Subclass (function () {
366 wakaba 1.13 if (!document.namespaces._vml_) {
367 wakaba 1.12 document.namespaces.add ('_vml_', 'urn:schemas-microsoft-com:vml');
368     }
369    
370     var ss = document.createStyleSheet ();
371     ss.cssText = '_vml_\\:* { behavior: url(#default#VML) }';
372    
373     this._super.apply (this, arguments);
374     }, SimpleBalloon, {
375     _renderBorder: function () {
376     var msgRects = NR.Element.getRects (this.contentElement, window);
377     var msgRect = msgRects.borderBox;
378    
379     var bb = this.getComputedStyle ();
380    
381     var bwDelta = bb.marginLeft + bb.borderLeftWidth + bb.paddingLeft;
382     var bhDelta = bb.marginTop + bb.borderTopWidth + bb.paddingTop;
383     var boxMBWidth = msgRect.width + bwDelta
384     + bb.marginRight + bb.borderRightWidth + bb.paddingRight;
385     var boxMBHeight = msgRect.height + bhDelta
386     + bb.marginBottom + bb.borderBottomWidth + bb.paddingBottom;
387    
388 wakaba 1.13 var vShape = document.createElement ('_vml_:shape');
389     vShape.style.display = 'block';
390     vShape.style.position = 'absolute';
391     vShape.style.top = -bhDelta + 'px';
392     vShape.style.left = -bwDelta + 'px';
393 wakaba 1.12
394     /* This is necessary to render the content element over the border SVG
395     element. */
396     this.contentElement.style.position = 'relative';
397    
398 wakaba 1.13 vShape.style.width = boxMBWidth + 'px';
399     vShape.style.height = boxMBHeight + 'px';
400 wakaba 1.12
401     var bbTop = bb.marginTop + bb.borderTopWidth / 2;
402     var bbRight = boxMBWidth - bb.marginLeft - bb.borderLeftWidth / 2
403     - bb.marginRight - bb.borderRightWidth / 2;
404     var bbLeft = bb.marginLeft + bb.borderLeftWidth / 2;
405     var bbBottom = boxMBHeight - bb.marginTop - bb.marginBottom
406     - bb.borderTopWidth / 2 - bb.borderBottomWidth / 2;
407    
408 wakaba 1.13 var vPath = document.createElement ('_vml_:path');
409     vPath.setAttribute ('v', new JSTE.List ([
410 wakaba 1.12 'm', bbLeft + bb.manakaiBorderTopLeftRadiusHorizontal, bbTop,
411    
412     'l', bbRight - bb.manakaiBorderTopRightRadiusHorizontal, bbTop,
413 wakaba 1.13
414     'qx',
415     bbRight,
416     bbTop + bb.manakaiBorderTopRightRadiusVertical,
417    
418 wakaba 1.12 'l', bbRight, bbBottom - bb.manakaiBorderBottomRightRadiusVertical,
419 wakaba 1.13
420     'qy',
421     bbRight - bb.manakaiBorderBottomRightRadiusHorizontal,
422     bbBottom,
423    
424 wakaba 1.12 'l', bbLeft + bb.manakaiBorderBottomLeftRadiusHorizontal, bbBottom,
425 wakaba 1.13
426     'qx',
427     bbLeft,
428     bbBottom - bb.manakaiBorderBottomLeftRadiusVertical,
429    
430 wakaba 1.12 'l', bbLeft, bbTop + bb.manakaiBorderTopLeftRadiusVertical,
431 wakaba 1.13
432     'qy',
433     bbLeft + bb.manakaiBorderTopLeftRadiusHorizontal,
434     bbTop,
435    
436 wakaba 1.12 'e'
437 wakaba 1.13 ]).numberToInteger ().list.join (' '));
438     vShape.setAttribute ('stroke', 'true');
439     vShape.setAttribute ('strokecolor', bb.borderColor);
440     vShape.setAttribute ('strokeweight', bb.borderWidth);
441     vShape.setAttribute ('fill', 'true');
442     vShape.setAttribute ('fillcolor', bb.backgroundColor);
443     vShape.setAttribute ('coordorigin', '0 0');
444     vShape.setAttribute ('coordsize', boxMBWidth + ' ' + boxMBHeight);
445 wakaba 1.12
446 wakaba 1.13 vShape.appendChild (vPath);
447 wakaba 1.12
448 wakaba 1.13 this.element.insertBefore (vShape, this.element.firstChild);
449 wakaba 1.12 }, // _renderBorder
450     _renderPointer: function () {
451     var rects = NR.Element.getRects (this.refElement, window);
452     var rbb = rects.borderBox;
453    
454     var bb = this.getComputedStyle ();
455    
456     var left = rbb.left + rbb.width * 3 / 4 - bb.manakaiPointerSource;
457     if (left < 0) left = bb.borderLeftWidth + bb.paddingLeft;
458 wakaba 1.13 var top = rbb.bottom + bb.manakaiPointerOffset + bb.manakaiPointerHeight + bb.borderTopWidth + bb.paddingTop;
459 wakaba 1.12
460     this.element.style.top = top + 'px';
461     this.element.style.left = left + 'px';
462    
463 wakaba 1.13 var vShape = document.createElement ('_vml_:shape');
464     vShape.style.width = bb.manakaiPointerWidth + 'px';
465     vShape.style.height = bb.manakaiPointerHeight + 'px';
466     vShape.style.display = 'block';
467     vShape.style.position = 'absolute';
468     vShape.style.top = -(bb.manakaiPointerHeight + bb.paddingTop + bb.borderTopWidth) + 'px';
469     vShape.style.left = (bb.manakaiPointerSource - bb.manakaiPointerWidth / 2) + 'px';
470 wakaba 1.12
471 wakaba 1.13 var vPath = document.createElement ('_vml_:path');
472     vPath.setAttribute ('v', new JSTE.List ([
473     'm 0 0 ',
474     'm', bb.manakaiPointerWidth, bb.manakaiPointerHeight,
475     'c',
476     bb.manakaiPointerWidth * 3 / 4, bb.manakaiPointerHeight,
477     bb.manakaiPointerWidth * 3 / 4, bb.manakaiPointerHeight,
478 wakaba 1.12 bb.manakaiPointerWidth / 2, 0,
479 wakaba 1.13 'c',
480     bb.manakaiPointerWidth / 4, bb.manakaiPointerHeight,
481     bb.manakaiPointerWidth / 4, bb.manakaiPointerHeight,
482     0, bb.manakaiPointerHeight,
483     'e']).numberToInteger ().list.join (' '));
484     vShape.setAttribute ('stroke', 'true');
485     vShape.setAttribute ('strokecolor', bb.borderColor);
486     vShape.setAttribute ('strokeweight', bb.borderWidth);
487     vShape.setAttribute ('fill', 'true');
488     vShape.setAttribute ('fillcolor', bb.backgroundColor);
489     vShape.setAttribute ('coordorigin', '0 0');
490     vShape.setAttribute ('coordsize', bb.manakaiPointerWidth + ' ' + bb.manakaiPointerHeight);
491 wakaba 1.12
492 wakaba 1.13 vShape.appendChild (vPath);
493 wakaba 1.12
494 wakaba 1.13 this.element.appendChild (vShape);
495 wakaba 1.12 } // _renderPointer
496    
497     }); // SimpleBalloonVML
498 wakaba 1.1
499     var MyMessage = new JSTE.Subclass (function () {
500     return this._super.apply (this, arguments);
501     }, JSTE.Message, {
502     _render: function (msgContainer, buttonContainer) {
503     var doc = this._targetDocument;
504    
505     var container = doc.createElement ('section');
506 wakaba 1.11 container.className = 'mm-container';
507 wakaba 1.1
508     container.appendChild (msgContainer);
509     container.appendChild (buttonContainer);
510    
511     var refElement = JSTE.Node.querySelector (document, this.select);
512 wakaba 1.12 if (document.all) {
513     this._simpleBalloon = new SimpleBalloonVML (container, refElement);
514     } else {
515     this._simpleBalloon = new SimpleBalloon (container, refElement);
516     }
517 wakaba 1.1
518     return this._simpleBalloon.element;
519     }, // _render
520     _remove: function () {
521     this._simpleBalloon.remove ();
522     } // _remove
523     });
524    
525     var xhr = new XMLHttpRequest ();
526     xhr.open ('GET', 'test.xml', false);
527     xhr.send (null);
528    
529    
530     document.a =
531     JSTE.Course.createFromDocument (xhr.responseXML, document);
532    
533     document.b =
534     new JSTE.Tutorial (document, document.a, {messageClass: MyMessage});
535    
536     </script>
537    
538 wakaba 1.3 <!--
539     /* ***** BEGIN LICENSE BLOCK *****
540     * Copyright 2008-2009 Wakaba <w@suika.fam.cx>. All rights reserved.
541     *
542     * This program is free software; you can redistribute it and/or
543     * modify it under the same terms as Perl itself.
544     *
545     * Alternatively, the contents of this file may be used
546     * under the following terms (the "MPL/GPL/LGPL"),
547     * in which case the provisions of the MPL/GPL/LGPL are applicable instead
548     * of those above. If you wish to allow use of your version of this file only
549     * under the terms of the MPL/GPL/LGPL, and not to allow others to
550     * use your version of this file under the terms of the Perl, indicate your
551     * decision by deleting the provisions above and replace them with the notice
552     * and other provisions required by the MPL/GPL/LGPL. If you do not delete
553     * the provisions above, a recipient may use your version of this file under
554     * the terms of any one of the Perl or the MPL/GPL/LGPL.
555     *
556     * "MPL/GPL/LGPL":
557     *
558     * Version: MPL 1.1/GPL 2.0/LGPL 2.1
559     *
560     * The contents of this file are subject to the Mozilla Public License Version
561     * 1.1 (the "License"); you may not use this file except in compliance with
562     * the License. You may obtain a copy of the License at
563     * <http://www.mozilla.org/MPL/>
564     *
565     * Software distributed under the License is distributed on an "AS IS" basis,
566     * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
567     * for the specific language governing rights and limitations under the
568     * License.
569     *
570     * The Original Code is JSTE code.
571     *
572     * The Initial Developer of the Original Code is Wakaba.
573     * Portions created by the Initial Developer are Copyright (C) 2008
574     * the Initial Developer. All Rights Reserved.
575     *
576     * Contributor(s):
577     * Wakaba <w@suika.fam.cx>
578     *
579     * Alternatively, the contents of this file may be used under the terms of
580     * either the GNU General Public License Version 2 or later (the "GPL"), or
581     * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
582     * in which case the provisions of the GPL or the LGPL are applicable instead
583     * of those above. If you wish to allow use of your version of this file only
584     * under the terms of either the GPL or the LGPL, and not to allow others to
585     * use your version of this file under the terms of the MPL, indicate your
586     * decision by deleting the provisions above and replace them with the notice
587     * and other provisions required by the LGPL or the GPL. If you do not delete
588     * the provisions above, a recipient may use your version of this file under
589     * the terms of any one of the MPL, the GPL or the LGPL.
590     *
591     * ***** END LICENSE BLOCK ***** */
592     -->

admin@suikawiki.org
ViewVC Help
Powered by ViewVC 1.1.24