/[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.16 - (hide annotations) (download) (as text)
Sat Jan 24 08:43:13 2009 UTC (16 years, 7 months ago) by wakaba
Branch: MAIN
Changes since 1.15: +23 -26 lines
File MIME type: text/html
Use NR.js instead of uuppaa.js to obtain scroll position.  Use scroll* attributes instead of terrible scrollIntoView solution which does not work in ie7

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

admin@suikawiki.org
ViewVC Help
Powered by ViewVC 1.1.24