/[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.14 - (hide annotations) (download) (as text)
Sat Jan 24 06:08:53 2009 UTC (16 years, 7 months ago) by wakaba
Branch: MAIN
Changes since 1.13: +66 -44 lines
File MIME type: text/html
Remove a segment of border that is overlapped with the 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 wakaba 1.14 this._renderPointer ();
175 wakaba 1.10 if (refElement) {
176     JSTE.Element.addClassName (refElement, 'sbs-selected');
177     JSTE.Element.addClassName (this.element, 'sbs-with-refelement');
178     } else {
179     JSTE.Element.addClassName (this.element, 'sbs-without-refelement');
180     }
181    
182     var self = this;
183     //setTimeout (function () {
184     showElement (new JSTE.List ([refElement]).onlyNonNull ());
185     //}, 2000);
186     }, {
187     SVGNS: 'http://www.w3.org/2000/svg',
188 wakaba 1.4
189 wakaba 1.10 remove: function () {
190     if (this.refElement) {
191     JSTE.Element.deleteClassName (this.refElement, 'sbs-selected');
192     }
193     }, // remove
194 wakaba 1.9
195 wakaba 1.10 _renderBorder: function () {
196     var msgRects = NR.Element.getRects (this.contentElement, window);
197     var msgRect = msgRects.borderBox;
198    
199     var bb = this.getComputedStyle ();
200    
201     var bwDelta = bb.marginLeft + bb.borderLeftWidth + bb.paddingLeft;
202     var bhDelta = bb.marginTop + bb.borderTopWidth + bb.paddingTop;
203     var boxMBWidth = msgRect.width + bwDelta
204     + bb.marginRight + bb.borderRightWidth + bb.paddingRight;
205     var boxMBHeight = msgRect.height + bhDelta
206     + bb.marginBottom + bb.borderBottomWidth + bb.paddingBottom;
207    
208     var box = document.createElementNS (this.SVGNS, 'svg');
209     box.style.display = 'block';
210     box.style.position = 'absolute';
211     box.style.top = -bhDelta + 'px';
212     box.style.left = -bwDelta + 'px';
213    
214     /* This is necessary to render the content element over the border SVG
215     element. */
216     this.contentElement.style.position = 'relative';
217    
218     box.setAttribute ('width', boxMBWidth);
219     box.setAttribute ('height', boxMBHeight);
220    
221     var bbTop = bb.marginTop + bb.borderTopWidth / 2;
222     var bbRight = boxMBWidth - bb.marginLeft - bb.borderLeftWidth / 2
223     - bb.marginRight - bb.borderRightWidth / 2;
224     var bbLeft = bb.marginLeft + bb.borderLeftWidth / 2;
225     var bbBottom = boxMBHeight - bb.marginTop - bb.marginBottom
226     - bb.borderTopWidth / 2 - bb.borderBottomWidth / 2;
227    
228     var boxBorder = document.createElementNS (this.SVGNS, 'path');
229     boxBorder.setAttribute ('d', [
230     'M', bbLeft + bb.manakaiBorderTopLeftRadiusHorizontal, bbTop,
231    
232     'L', bbRight - bb.manakaiBorderTopRightRadiusHorizontal, bbTop,
233    
234     'a',
235     bb.manakaiBorderTopRightRadiusHorizontal,
236     bb.manakaiBorderTopRightRadiusVertical, 0, 0, 1,
237     bb.manakaiBorderTopRightRadiusHorizontal,
238     bb.manakaiBorderTopRightRadiusVertical,
239 wakaba 1.4
240 wakaba 1.10 'L', bbRight, bbBottom - bb.manakaiBorderBottomRightRadiusVertical,
241    
242     'a',
243     bb.manakaiBorderBottomRightRadiusHorizontal,
244     bb.manakaiBorderBottomRightRadiusVertical, 0, 0, 1,
245     -bb.manakaiBorderBottomRightRadiusHorizontal,
246     bb.manakaiBorderBottomRightRadiusVertical,
247    
248     'L', bbLeft + bb.manakaiBorderBottomLeftRadiusHorizontal, bbBottom,
249    
250     'a',
251     bb.manakaiBorderBottomLeftRadiusHorizontal,
252     bb.manakaiBorderBottomLeftRadiusVertical, 0, 0, 1,
253     -bb.manakaiBorderBottomLeftRadiusHorizontal,
254     -bb.manakaiBorderBottomLeftRadiusVertical,
255    
256     'L', bbLeft, bbTop + bb.manakaiBorderTopLeftRadiusVertical,
257    
258     'a',
259     bb.manakaiBorderTopLeftRadiusHorizontal,
260     bb.manakaiBorderTopLeftRadiusVertical, 0, 0, 1,
261     bb.manakaiBorderTopLeftRadiusHorizontal,
262     -bb.manakaiBorderTopLeftRadiusVertical
263     ].join (' '));
264     boxBorder.setAttribute ('stroke', bb.borderColor);
265     boxBorder.setAttribute ('stroke-width', bb.borderWidth);
266     boxBorder.setAttribute ('fill', bb.backgroundColor);
267    
268     box.appendChild (boxBorder);
269    
270     this.element.insertBefore (box, this.element.firstChild);
271     }, // _renderBorder
272     _renderPointer: function () {
273 wakaba 1.14 var bb = this.getComputedStyle ();
274 wakaba 1.4
275 wakaba 1.14 if (this.refElement) {
276     var rects = NR.Element.getRects (this.refElement, window);
277     var rbb = rects.borderBox;
278    
279     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
282     + bb.manakaiPointerHeight + bb.paddingTop;
283 wakaba 1.4
284 wakaba 1.14 this.element.style.top = top + 'px';
285     this.element.style.left = left + 'px';
286     }
287 wakaba 1.5
288 wakaba 1.10 var pointerSVGElement = document.createElementNS (this.SVGNS, 'svg');
289 wakaba 1.9 pointerSVGElement.setAttribute ('width', bb.manakaiPointerWidth);
290     pointerSVGElement.setAttribute ('height', bb.manakaiPointerHeight);
291 wakaba 1.5 pointerSVGElement.style.display = 'block';
292     pointerSVGElement.style.position = 'absolute';
293 wakaba 1.9 pointerSVGElement.style.top = -(bb.manakaiPointerHeight + bb.paddingTop) + 'px';
294     pointerSVGElement.style.left = (bb.manakaiPointerSource - bb.manakaiPointerWidth / 2) + 'px';
295 wakaba 1.5
296 wakaba 1.10 var pointerElement = document.createElementNS (this.SVGNS, 'path');
297 wakaba 1.14 if (this.refElement) {
298     pointerElement.setAttribute ('d', [
299     'M', bb.manakaiPointerWidth, bb.manakaiPointerHeight,
300     'Q', bb.manakaiPointerWidth * 3 / 4, bb.manakaiPointerHeight,
301     bb.manakaiPointerWidth / 2, 0,
302     'Q', bb.manakaiPointerWidth / 4, bb.manakaiPointerHeight,
303     0, bb.manakaiPointerHeight].join (' '));
304     } else {
305     pointerElement.setAttribute ('d', [
306     'M', 0, bb.manakaiPointerHeight,
307     'L', bb.manakaiPointerWidth, bb.manakaiPointerHeight
308     ].join (' '));
309     }
310    
311 wakaba 1.9 pointerElement.setAttribute ('stroke', bb.borderColor);
312     pointerElement.setAttribute ('stroke-width', bb.borderWidth);
313     pointerElement.setAttribute ('fill', bb.backgroundColor);
314 wakaba 1.5
315     pointerSVGElement.appendChild (pointerElement);
316    
317     this.element.appendChild (pointerSVGElement);
318 wakaba 1.10 }, // _renderPointer
319 wakaba 1.9
320     getComputedStyle: function (pseudoEl) {
321     if (pseudoEl == null) {
322     var boxMargin = 1;
323 wakaba 1.14 var boxBorderWidth = 4; // use even number to avoid use of non-integer pixels not supported by VML
324 wakaba 1.9 var boxBorderColor = 'green';
325     var boxBorderRadiusHorizontal = 10;
326     var boxBorderRadiusVertical = 10;
327     var boxPadding = 10;
328 wakaba 1.14 var pointerBoxMargin = 6;
329 wakaba 1.9 var pointerBoxWidth = 20;
330     var pointerBoxHeight = 40;
331     var pointerBoxLeft = 20;
332    
333     return {
334     marginTop: boxMargin, marginRight: boxMargin, marginBottom: boxMargin,
335     marginLeft: boxMargin,
336     borderColor: boxBorderColor,
337     borderTopColor: boxBorderColor, borderRightColor: boxBorderColor,
338     borderBottomColor: boxBorderColor, borderLeftColor: boxBorderColor,
339     borderWidth: boxBorderWidth,
340     borderTopWidth: boxBorderWidth, borderRightWidth: boxBorderWidth,
341     borderBottomWidth: boxBorderWidth, borderLeftWidth: boxBorderWidth,
342     manakaiBorderTopLeftRadiusHorizontal: boxBorderRadiusHorizontal,
343     manakaiBorderTopLeftRadiusVertical: boxBorderRadiusVertical,
344     manakaiBorderTopRightRadiusHorizontal: boxBorderRadiusHorizontal,
345     manakaiBorderTopRightRadiusVertical: boxBorderRadiusVertical,
346     manakaiBorderBottomLeftRadiusHorizontal: boxBorderRadiusHorizontal,
347     manakaiBorderBottomLeftRadiusVertical: boxBorderRadiusVertical,
348     manakaiBorderBottomRightRadiusHorizontal: boxBorderRadiusHorizontal,
349     manakaiBorderBottomRightRadiusVertical: boxBorderRadiusVertical,
350     paddingTop: boxPadding, paddingRight: boxPadding,
351     paddingBottom: boxPadding, paddingLeft: boxPadding,
352     backgroundColor: this.getBackgroundColor (),
353     manakaiPointerWidth: pointerBoxWidth,
354     manakaiPointerHeight: pointerBoxHeight,
355     manakaiPointerOffset: pointerBoxMargin,
356     manakaiPointerSource: pointerBoxLeft
357     };
358     } else {
359     return {};
360     }
361     }, // getComputedStyle
362 wakaba 1.4
363     getBackgroundColor: function () {
364     var el = this.contentElement;
365     if (window.getComputedStyle) {
366     return getComputedStyle (el, null).backgroundColor;
367     } else if (el.currentStyle) {
368     return el.currentStyle.backgroundColor;
369     } else {
370     return 'white';
371     }
372     } // getBackgroundColor
373 wakaba 1.12 }); // SimpleBalloon
374    
375     var SimpleBalloonVML = new JSTE.Subclass (function () {
376 wakaba 1.13 if (!document.namespaces._vml_) {
377 wakaba 1.12 document.namespaces.add ('_vml_', 'urn:schemas-microsoft-com:vml');
378     }
379    
380     var ss = document.createStyleSheet ();
381     ss.cssText = '_vml_\\:* { behavior: url(#default#VML) }';
382    
383     this._super.apply (this, arguments);
384     }, SimpleBalloon, {
385     _renderBorder: function () {
386     var msgRects = NR.Element.getRects (this.contentElement, window);
387     var msgRect = msgRects.borderBox;
388    
389     var bb = this.getComputedStyle ();
390    
391     var bwDelta = bb.marginLeft + bb.borderLeftWidth + bb.paddingLeft;
392     var bhDelta = bb.marginTop + bb.borderTopWidth + bb.paddingTop;
393     var boxMBWidth = msgRect.width + bwDelta
394     + bb.marginRight + bb.borderRightWidth + bb.paddingRight;
395     var boxMBHeight = msgRect.height + bhDelta
396     + bb.marginBottom + bb.borderBottomWidth + bb.paddingBottom;
397    
398 wakaba 1.13 var vShape = document.createElement ('_vml_:shape');
399     vShape.style.display = 'block';
400     vShape.style.position = 'absolute';
401     vShape.style.top = -bhDelta + 'px';
402     vShape.style.left = -bwDelta + 'px';
403 wakaba 1.12
404     /* This is necessary to render the content element over the border SVG
405     element. */
406     this.contentElement.style.position = 'relative';
407    
408 wakaba 1.13 vShape.style.width = boxMBWidth + 'px';
409     vShape.style.height = boxMBHeight + 'px';
410 wakaba 1.12
411     var bbTop = bb.marginTop + bb.borderTopWidth / 2;
412     var bbRight = boxMBWidth - bb.marginLeft - bb.borderLeftWidth / 2
413     - bb.marginRight - bb.borderRightWidth / 2;
414     var bbLeft = bb.marginLeft + bb.borderLeftWidth / 2;
415     var bbBottom = boxMBHeight - bb.marginTop - bb.marginBottom
416     - bb.borderTopWidth / 2 - bb.borderBottomWidth / 2;
417    
418 wakaba 1.13 var vPath = document.createElement ('_vml_:path');
419     vPath.setAttribute ('v', new JSTE.List ([
420 wakaba 1.14 'm', bb.marginLeft + bb.borderLeftWidth + bb.paddingLeft + bb.manakaiPointerSource + bb.manakaiPointerWidth / 2, bbTop,
421 wakaba 1.12
422     'l', bbRight - bb.manakaiBorderTopRightRadiusHorizontal, bbTop,
423 wakaba 1.13
424     'qx',
425     bbRight,
426     bbTop + bb.manakaiBorderTopRightRadiusVertical,
427    
428 wakaba 1.12 'l', bbRight, bbBottom - bb.manakaiBorderBottomRightRadiusVertical,
429 wakaba 1.13
430     'qy',
431     bbRight - bb.manakaiBorderBottomRightRadiusHorizontal,
432     bbBottom,
433    
434 wakaba 1.12 'l', bbLeft + bb.manakaiBorderBottomLeftRadiusHorizontal, bbBottom,
435 wakaba 1.13
436     'qx',
437     bbLeft,
438     bbBottom - bb.manakaiBorderBottomLeftRadiusVertical,
439    
440 wakaba 1.12 'l', bbLeft, bbTop + bb.manakaiBorderTopLeftRadiusVertical,
441 wakaba 1.13
442     'qy',
443     bbLeft + bb.manakaiBorderTopLeftRadiusHorizontal,
444     bbTop,
445    
446 wakaba 1.14 'l', bb.marginLeft + bb.borderLeftWidth + bb.paddingLeft + bb.manakaiPointerSource - bb.manakaiPointerWidth / 2, bbTop,
447    
448 wakaba 1.12 'e'
449 wakaba 1.13 ]).numberToInteger ().list.join (' '));
450     vShape.setAttribute ('stroke', 'true');
451     vShape.setAttribute ('strokecolor', bb.borderColor);
452     vShape.setAttribute ('strokeweight', bb.borderWidth);
453 wakaba 1.14 vShape.setAttribute ('filled', 'true');
454 wakaba 1.13 vShape.setAttribute ('fillcolor', bb.backgroundColor);
455     vShape.setAttribute ('coordorigin', '0 0');
456     vShape.setAttribute ('coordsize', boxMBWidth + ' ' + boxMBHeight);
457 wakaba 1.12
458 wakaba 1.13 vShape.appendChild (vPath);
459 wakaba 1.12
460 wakaba 1.13 this.element.insertBefore (vShape, this.element.firstChild);
461 wakaba 1.12 }, // _renderBorder
462     _renderPointer: function () {
463 wakaba 1.14 var bb = this.getComputedStyle ();
464    
465     if (this.refElement) {
466     var rects = NR.Element.getRects (this.refElement, window);
467     var rbb = rects.borderBox;
468 wakaba 1.12
469 wakaba 1.14 var left = rbb.left + rbb.width * 3 / 4 - bb.manakaiPointerSource;
470     if (left < 0) left = bb.borderLeftWidth + bb.paddingLeft;
471     var top = rbb.bottom + bb.manakaiPointerOffset
472     + bb.manakaiPointerHeight + bb.borderTopWidth + bb.paddingTop;
473 wakaba 1.12
474 wakaba 1.14 this.element.style.top = top + 'px';
475     this.element.style.left = left + 'px';
476     }
477 wakaba 1.12
478 wakaba 1.13 var vShape = document.createElement ('_vml_:shape');
479     vShape.style.width = bb.manakaiPointerWidth + 'px';
480     vShape.style.height = bb.manakaiPointerHeight + 'px';
481     vShape.style.display = 'block';
482     vShape.style.position = 'absolute';
483 wakaba 1.14 vShape.style.top = -(bb.manakaiPointerHeight + bb.paddingTop + bb.borderTopWidth / 2) + 'px';
484 wakaba 1.13 vShape.style.left = (bb.manakaiPointerSource - bb.manakaiPointerWidth / 2) + 'px';
485 wakaba 1.12
486 wakaba 1.13 var vPath = document.createElement ('_vml_:path');
487 wakaba 1.14 if (this.refElement) {
488     vPath.setAttribute ('v', new JSTE.List ([
489     'm', bb.manakaiPointerWidth, bb.manakaiPointerHeight,
490     'c',
491     bb.manakaiPointerWidth * 3 / 4, bb.manakaiPointerHeight,
492     bb.manakaiPointerWidth * 3 / 4, bb.manakaiPointerHeight,
493     bb.manakaiPointerWidth / 2, 0,
494     'c',
495     bb.manakaiPointerWidth / 4, bb.manakaiPointerHeight,
496     bb.manakaiPointerWidth / 4, bb.manakaiPointerHeight,
497     0, bb.manakaiPointerHeight,
498     'e']).numberToInteger ().list.join (' '));
499     } else {
500     vPath.setAttribute ('v', new JSTE.List ([
501     'm', 0, bb.manakaiPointerHeight,
502     'l', bb.manakaiPointerWidth, bb.manakaiPointerHeight,
503     'e']).numberToInteger ().list.join (' '));
504     }
505    
506 wakaba 1.13 vShape.setAttribute ('stroke', 'true');
507     vShape.setAttribute ('strokecolor', bb.borderColor);
508     vShape.setAttribute ('strokeweight', bb.borderWidth);
509 wakaba 1.14 vShape.setAttribute ('filled', 'true');
510 wakaba 1.13 vShape.setAttribute ('fillcolor', bb.backgroundColor);
511     vShape.setAttribute ('coordorigin', '0 0');
512     vShape.setAttribute ('coordsize', bb.manakaiPointerWidth + ' ' + bb.manakaiPointerHeight);
513 wakaba 1.12
514 wakaba 1.13 vShape.appendChild (vPath);
515 wakaba 1.12
516 wakaba 1.13 this.element.appendChild (vShape);
517 wakaba 1.12 } // _renderPointer
518    
519     }); // SimpleBalloonVML
520 wakaba 1.1
521     var MyMessage = new JSTE.Subclass (function () {
522     return this._super.apply (this, arguments);
523     }, JSTE.Message, {
524     _render: function (msgContainer, buttonContainer) {
525     var doc = this._targetDocument;
526    
527     var container = doc.createElement ('section');
528 wakaba 1.11 container.className = 'mm-container';
529 wakaba 1.1
530     container.appendChild (msgContainer);
531     container.appendChild (buttonContainer);
532    
533     var refElement = JSTE.Node.querySelector (document, this.select);
534 wakaba 1.12 if (document.all) {
535     this._simpleBalloon = new SimpleBalloonVML (container, refElement);
536     } else {
537     this._simpleBalloon = new SimpleBalloon (container, refElement);
538     }
539 wakaba 1.1
540     return this._simpleBalloon.element;
541     }, // _render
542     _remove: function () {
543     this._simpleBalloon.remove ();
544     } // _remove
545     });
546    
547     var xhr = new XMLHttpRequest ();
548     xhr.open ('GET', 'test.xml', false);
549     xhr.send (null);
550    
551    
552     document.a =
553     JSTE.Course.createFromDocument (xhr.responseXML, document);
554    
555     document.b =
556     new JSTE.Tutorial (document, document.a, {messageClass: MyMessage});
557    
558     </script>
559    
560 wakaba 1.3 <!--
561     /* ***** BEGIN LICENSE BLOCK *****
562     * Copyright 2008-2009 Wakaba <w@suika.fam.cx>. All rights reserved.
563     *
564     * This program is free software; you can redistribute it and/or
565     * modify it under the same terms as Perl itself.
566     *
567     * Alternatively, the contents of this file may be used
568     * under the following terms (the "MPL/GPL/LGPL"),
569     * in which case the provisions of the MPL/GPL/LGPL are applicable instead
570     * of those above. If you wish to allow use of your version of this file only
571     * under the terms of the MPL/GPL/LGPL, and not to allow others to
572     * use your version of this file under the terms of the Perl, indicate your
573     * decision by deleting the provisions above and replace them with the notice
574     * and other provisions required by the MPL/GPL/LGPL. If you do not delete
575     * the provisions above, a recipient may use your version of this file under
576     * the terms of any one of the Perl or the MPL/GPL/LGPL.
577     *
578     * "MPL/GPL/LGPL":
579     *
580     * Version: MPL 1.1/GPL 2.0/LGPL 2.1
581     *
582     * The contents of this file are subject to the Mozilla Public License Version
583     * 1.1 (the "License"); you may not use this file except in compliance with
584     * the License. You may obtain a copy of the License at
585     * <http://www.mozilla.org/MPL/>
586     *
587     * Software distributed under the License is distributed on an "AS IS" basis,
588     * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
589     * for the specific language governing rights and limitations under the
590     * License.
591     *
592     * The Original Code is JSTE code.
593     *
594     * The Initial Developer of the Original Code is Wakaba.
595     * Portions created by the Initial Developer are Copyright (C) 2008
596     * the Initial Developer. All Rights Reserved.
597     *
598     * Contributor(s):
599     * Wakaba <w@suika.fam.cx>
600     *
601     * Alternatively, the contents of this file may be used under the terms of
602     * either the GNU General Public License Version 2 or later (the "GPL"), or
603     * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
604     * in which case the provisions of the GPL or the LGPL are applicable instead
605     * of those above. If you wish to allow use of your version of this file only
606     * under the terms of either the GPL or the LGPL, and not to allow others to
607     * use your version of this file under the terms of the MPL, indicate your
608     * decision by deleting the provisions above and replace them with the notice
609     * and other provisions required by the LGPL or the GPL. If you do not delete
610     * the provisions above, a recipient may use your version of this file under
611     * the terms of any one of the MPL, the GPL or the LGPL.
612     *
613     * ***** END LICENSE BLOCK ***** */
614     -->

admin@suikawiki.org
ViewVC Help
Powered by ViewVC 1.1.24