qwik2md 1.0.1 → 1.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (196) hide show
  1. checksums.yaml +4 -4
  2. data/lib/qwik2md/version.rb +1 -1
  3. data/vendor/qwik/lib/qwik/act-christel.rb +1 -1
  4. data/vendor/qwik/lib/qwik/page-get.rb +4 -4
  5. data/vendor/qwik/lib/qwik/util-filename.rb +2 -5
  6. data/vendor/qwik/lib/qwik/util-string.rb +7 -7
  7. data/vendor/qwik/share/super/FrontPage.txt +17 -0
  8. data/vendor/qwik/share/super/QwikWebPlugin.txt +0 -0
  9. data/vendor/qwik/share/super/QwikWebStructure.txt +0 -0
  10. data/vendor/qwik/share/super/RecentList.txt +2 -0
  11. data/vendor/qwik/share/super/SandBox.txt +3 -0
  12. data/vendor/qwik/share/super/TextFormat.txt +186 -0
  13. data/vendor/qwik/share/super/TextFormatSimple.txt +23 -0
  14. data/vendor/qwik/share/super/TitleList.txt +2 -0
  15. data/vendor/qwik/share/super/_AdminMenu.txt +11 -0
  16. data/vendor/qwik/share/super/_BookSearch.txt +3 -0
  17. data/vendor/qwik/share/super/_EditorFooter.txt +9 -0
  18. data/vendor/qwik/share/super/_EditorHelp.txt +9 -0
  19. data/vendor/qwik/share/super/_InterWikiName.txt +17 -0
  20. data/vendor/qwik/share/super/_IsbnLink.txt +8 -0
  21. data/vendor/qwik/share/super/_MemberAdd.txt +4 -0
  22. data/vendor/qwik/share/super/_MemberList.txt +2 -0
  23. data/vendor/qwik/share/super/_MemberListCSV.txt +2 -0
  24. data/vendor/qwik/share/super/_PageAttribute.txt +7 -0
  25. data/vendor/qwik/share/super/_SideMenu.txt +15 -0
  26. data/vendor/qwik/share/super/_SiteConfig.txt +30 -0
  27. data/vendor/qwik/share/super/_SiteFooter.txt +3 -0
  28. data/vendor/qwik/share/super/_SiteLog.txt +0 -0
  29. data/vendor/qwik/share/super/_SiteLogView.txt +2 -0
  30. data/vendor/qwik/share/super/_SiteMember.txt +0 -0
  31. data/vendor/qwik/share/super/_SiteMenu.txt +2 -0
  32. data/vendor/qwik/share/super/_SiteSearch.txt +3 -0
  33. data/vendor/qwik/share/super/_SiteTheme.txt +9 -0
  34. data/vendor/qwik/share/super/_textformat.txt +2 -0
  35. data/vendor/qwik/share/template/Makefile +10 -0
  36. data/vendor/qwik/share/template/edit.html +22 -0
  37. data/vendor/qwik/share/template/edit.rb +40 -0
  38. data/vendor/qwik/share/template/editor.html +23 -0
  39. data/vendor/qwik/share/template/editor.rb +47 -0
  40. data/vendor/qwik/share/template/notice.html +21 -0
  41. data/vendor/qwik/share/template/notice.rb +43 -0
  42. data/vendor/qwik/share/template/plain.html +19 -0
  43. data/vendor/qwik/share/template/plain.rb +43 -0
  44. data/vendor/qwik/share/template/surface.html +22 -0
  45. data/vendor/qwik/share/template/surface.rb +50 -0
  46. data/vendor/qwik/share/template/system.html +30 -0
  47. data/vendor/qwik/share/template/system.rb +46 -0
  48. data/vendor/qwik/share/template/view.html +20 -0
  49. data/vendor/qwik/share/template/view.rb +40 -0
  50. data/vendor/qwik/share/theme/css/Makefile +10 -0
  51. data/vendor/qwik/share/theme/css/base.css +779 -0
  52. data/vendor/qwik/share/theme/css/delete.png +0 -0
  53. data/vendor/qwik/share/theme/css/menu.css +77 -0
  54. data/vendor/qwik/share/theme/css/wema.css +141 -0
  55. data/vendor/qwik/share/theme/i/a.gif +0 -0
  56. data/vendor/qwik/share/theme/i/binary.gif +0 -0
  57. data/vendor/qwik/share/theme/i/broken.gif +0 -0
  58. data/vendor/qwik/share/theme/i/compressed.gif +0 -0
  59. data/vendor/qwik/share/theme/i/external.png +0 -0
  60. data/vendor/qwik/share/theme/i/external_hover.png +0 -0
  61. data/vendor/qwik/share/theme/i/favicon.ico +0 -0
  62. data/vendor/qwik/share/theme/i/favicon.png +0 -0
  63. data/vendor/qwik/share/theme/i/generic.gif +0 -0
  64. data/vendor/qwik/share/theme/i/image2.gif +0 -0
  65. data/vendor/qwik/share/theme/i/login_bg.gif +0 -0
  66. data/vendor/qwik/share/theme/i/login_inputform_bg.gif +0 -0
  67. data/vendor/qwik/share/theme/i/login_inputform_bg_footer.gif +0 -0
  68. data/vendor/qwik/share/theme/i/login_inputform_bg_header.gif +0 -0
  69. data/vendor/qwik/share/theme/i/login_li.gif +0 -0
  70. data/vendor/qwik/share/theme/i/login_qwik_logo.gif +0 -0
  71. data/vendor/qwik/share/theme/i/movie.gif +0 -0
  72. data/vendor/qwik/share/theme/i/new.png +0 -0
  73. data/vendor/qwik/share/theme/i/pdf.gif +0 -0
  74. data/vendor/qwik/share/theme/i/ps.gif +0 -0
  75. data/vendor/qwik/share/theme/i/sound2.gif +0 -0
  76. data/vendor/qwik/share/theme/i/sphere2.gif +0 -0
  77. data/vendor/qwik/share/theme/i/tar.gif +0 -0
  78. data/vendor/qwik/share/theme/i/text.gif +0 -0
  79. data/vendor/qwik/share/theme/js/Makefile +23 -0
  80. data/vendor/qwik/share/theme/js/base.js +176 -0
  81. data/vendor/qwik/share/theme/js/builder.js +101 -0
  82. data/vendor/qwik/share/theme/js/controls.js +750 -0
  83. data/vendor/qwik/share/theme/js/debugwindow-test.html +60 -0
  84. data/vendor/qwik/share/theme/js/debugwindow.html +24 -0
  85. data/vendor/qwik/share/theme/js/debugwindow.js +476 -0
  86. data/vendor/qwik/share/theme/js/dragdrop.js +559 -0
  87. data/vendor/qwik/share/theme/js/effects.js +904 -0
  88. data/vendor/qwik/share/theme/js/event.js +98 -0
  89. data/vendor/qwik/share/theme/js/history.js +110 -0
  90. data/vendor/qwik/share/theme/js/menu.js +27 -0
  91. data/vendor/qwik/share/theme/js/monitor.js +96 -0
  92. data/vendor/qwik/share/theme/js/niftypp.js +272 -0
  93. data/vendor/qwik/share/theme/js/prototype.js +1758 -0
  94. data/vendor/qwik/share/theme/js/scriptaculous.js +48 -0
  95. data/vendor/qwik/share/theme/js/se_hilite_jp.js +234 -0
  96. data/vendor/qwik/share/theme/js/slider.js +275 -0
  97. data/vendor/qwik/share/theme/js/test-all.html +24 -0
  98. data/vendor/qwik/share/theme/js/test-debug.html +56 -0
  99. data/vendor/qwik/share/theme/js/test-wema.html +304 -0
  100. data/vendor/qwik/share/theme/js/test-xp.html +99 -0
  101. data/vendor/qwik/share/theme/js/unittest.js +363 -0
  102. data/vendor/qwik/share/theme/js/watch.js +109 -0
  103. data/vendor/qwik/share/theme/js/wema.js +580 -0
  104. data/vendor/qwik/share/theme/js/wysiwyg.js +143 -0
  105. data/vendor/qwik/share/theme/qwikborder/qwikborder.css +277 -0
  106. data/vendor/qwik/share/theme/qwikborder/qwikborder_ball.png +0 -0
  107. data/vendor/qwik/share/theme/qwikborder/qwikborder_h2.png +0 -0
  108. data/vendor/qwik/share/theme/qwikborder/qwikborder_li.png +0 -0
  109. data/vendor/qwik/share/theme/qwikcyan/qwikcyan.css +216 -0
  110. data/vendor/qwik/share/theme/qwikcyan/qwikcyan_li.png +0 -0
  111. data/vendor/qwik/share/theme/qwikeditor/command.gif +0 -0
  112. data/vendor/qwik/share/theme/qwikeditor/edit_form_bg.jpg +0 -0
  113. data/vendor/qwik/share/theme/qwikeditor/edit_qwik_logo.gif +0 -0
  114. data/vendor/qwik/share/theme/qwikeditor/edit_title_bg.jpg +0 -0
  115. data/vendor/qwik/share/theme/qwikeditor/login_bg.gif +0 -0
  116. data/vendor/qwik/share/theme/qwikeditor/login_qwik_logo.gif +0 -0
  117. data/vendor/qwik/share/theme/qwikeditor/qwikeditor.css +336 -0
  118. data/vendor/qwik/share/theme/qwikeditor/sidebar_bg.gif +0 -0
  119. data/vendor/qwik/share/theme/qwikgreen/qwikgreen.css +306 -0
  120. data/vendor/qwik/share/theme/qwiknotice/qwiknotice.css +246 -0
  121. data/vendor/qwik/share/theme/qwiknotice/qwiknotice_body_bg.gif +0 -0
  122. data/vendor/qwik/share/theme/qwiknotice/qwiknotice_inputform_bg.gif +0 -0
  123. data/vendor/qwik/share/theme/qwiknotice/qwiknotice_inputform_bg_footer.gif +0 -0
  124. data/vendor/qwik/share/theme/qwiknotice/qwiknotice_inputform_bg_header.gif +0 -0
  125. data/vendor/qwik/share/theme/qwiknotice/qwiknotice_li.gif +0 -0
  126. data/vendor/qwik/share/theme/qwiknotice/qwiknotice_qwik_logo.gif +0 -0
  127. data/vendor/qwik/share/theme/qwikplain/command.gif +0 -0
  128. data/vendor/qwik/share/theme/qwikplain/edit_form_bg.jpg +0 -0
  129. data/vendor/qwik/share/theme/qwikplain/edit_qwik_logo.gif +0 -0
  130. data/vendor/qwik/share/theme/qwikplain/edit_title_bg.jpg +0 -0
  131. data/vendor/qwik/share/theme/qwikplain/login_bg.gif +0 -0
  132. data/vendor/qwik/share/theme/qwikplain/login_qwik_logo.gif +0 -0
  133. data/vendor/qwik/share/theme/qwikplain/qwikplain.css +223 -0
  134. data/vendor/qwik/share/theme/qwikplain/sidebar_bg.gif +0 -0
  135. data/vendor/qwik/share/theme/qwikskelton/qwikskelton.css +224 -0
  136. data/vendor/qwik/share/theme/qwiksystem/qwiksystem.css +323 -0
  137. data/vendor/qwik/share/theme/qwiksystem/qwiksystem_bg.png +0 -0
  138. data/vendor/qwik/share/theme/qwiksystem/qwiksystem_header.png +0 -0
  139. data/vendor/qwik/share/theme/qwiksystem/qwiksystem_headerbar.png +0 -0
  140. data/vendor/qwik/share/theme/qwiksystem/qwiksystem_qwikweb.png +0 -0
  141. data/vendor/qwik/share/theme/qwikviridian/qwikviridian.css +413 -0
  142. data/vendor/qwik/share/theme/qwikviridian/qwikviridian_adminmenu_bg.gif +0 -0
  143. data/vendor/qwik/share/theme/qwikviridian/qwikviridian_bg.gif +0 -0
  144. data/vendor/qwik/share/theme/qwikviridian/qwikviridian_bg_shade.gif +0 -0
  145. data/vendor/qwik/share/theme/qwikviridian/qwikviridian_sidebar_a_bg.gif +0 -0
  146. data/vendor/qwik/share/theme/qwikviridian/qwikviridian_siderbar_li_a.gif +0 -0
  147. data/vendor/qwik/share/theme/s5/blue/bluebg.gif +0 -0
  148. data/vendor/qwik/share/theme/s5/blue/bluebottom.gif +0 -0
  149. data/vendor/qwik/share/theme/s5/blue/bluefooter.gif +0 -0
  150. data/vendor/qwik/share/theme/s5/blue/framing.css +25 -0
  151. data/vendor/qwik/share/theme/s5/blue/pretty.css +91 -0
  152. data/vendor/qwik/share/theme/s5/blue/s5-core.css +11 -0
  153. data/vendor/qwik/share/theme/s5/blue/slides.css +3 -0
  154. data/vendor/qwik/share/theme/s5/default/iepngfix.htc +42 -0
  155. data/vendor/qwik/share/theme/s5/default/opera.css +7 -0
  156. data/vendor/qwik/share/theme/s5/default/outline.css +15 -0
  157. data/vendor/qwik/share/theme/s5/default/print.css +24 -0
  158. data/vendor/qwik/share/theme/s5/default/slides.js +558 -0
  159. data/vendor/qwik/share/theme/s5/flower/blume.jpg +0 -0
  160. data/vendor/qwik/share/theme/s5/flower/blumerechts.jpg +0 -0
  161. data/vendor/qwik/share/theme/s5/flower/framing.css +25 -0
  162. data/vendor/qwik/share/theme/s5/flower/pretty.css +83 -0
  163. data/vendor/qwik/share/theme/s5/flower/s5-core.css +11 -0
  164. data/vendor/qwik/share/theme/s5/flower/slides.css +3 -0
  165. data/vendor/qwik/share/theme/s5/i18n/00_head.txt +8 -0
  166. data/vendor/qwik/share/theme/s5/i18n/bg-shade.png +0 -0
  167. data/vendor/qwik/share/theme/s5/i18n/bg-slide.jpg +0 -0
  168. data/vendor/qwik/share/theme/s5/i18n/framing.css +23 -0
  169. data/vendor/qwik/share/theme/s5/i18n/pretty.css +44 -0
  170. data/vendor/qwik/share/theme/s5/i18n/s5-core.css +9 -0
  171. data/vendor/qwik/share/theme/s5/i18n/slides.css +3 -0
  172. data/vendor/qwik/share/theme/s5/pixel/framing.css +25 -0
  173. data/vendor/qwik/share/theme/s5/pixel/pixelbg.gif +0 -0
  174. data/vendor/qwik/share/theme/s5/pixel/pixelheader.jpg +0 -0
  175. data/vendor/qwik/share/theme/s5/pixel/pixelslide0bg.gif +0 -0
  176. data/vendor/qwik/share/theme/s5/pixel/pretty.css +80 -0
  177. data/vendor/qwik/share/theme/s5/pixel/s5-core.css +11 -0
  178. data/vendor/qwik/share/theme/s5/pixel/slides.css +3 -0
  179. data/vendor/qwik/share/theme/s5/qwikblack/framing.css +23 -0
  180. data/vendor/qwik/share/theme/s5/qwikblack/pretty.css +245 -0
  181. data/vendor/qwik/share/theme/s5/qwikblack/s5-core.css +9 -0
  182. data/vendor/qwik/share/theme/s5/qwikblack/slides.css +3 -0
  183. data/vendor/qwik/share/theme/s5/qwikworld/bg-shade.png +0 -0
  184. data/vendor/qwik/share/theme/s5/qwikworld/bg-slide.jpg +0 -0
  185. data/vendor/qwik/share/theme/s5/qwikworld/framing.css +61 -0
  186. data/vendor/qwik/share/theme/s5/qwikworld/pretty.css +250 -0
  187. data/vendor/qwik/share/theme/s5/qwikworld/qwikcyan_li.png +0 -0
  188. data/vendor/qwik/share/theme/s5/qwikworld/s5-core.css +28 -0
  189. data/vendor/qwik/share/theme/s5/qwikworld/slides.css +3 -0
  190. data/vendor/qwik/share/theme/s5/shell/blank.gif +0 -0
  191. data/vendor/qwik/share/theme/s5/shell/bodybg.gif +0 -0
  192. data/vendor/qwik/share/theme/s5/shell/framing.css +23 -0
  193. data/vendor/qwik/share/theme/s5/shell/pretty.css +86 -0
  194. data/vendor/qwik/share/theme/s5/shell/s5-core.css +9 -0
  195. data/vendor/qwik/share/theme/s5/shell/slides.css +3 -0
  196. metadata +190 -1
@@ -0,0 +1,304 @@
1
+ <!-- -*- c++ -*- -->
2
+ <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
3
+ <html>
4
+ <head>
5
+ <title>test</title>
6
+ <script type="text/javascript" src="../../jsUnit/app/jsUnitCore.js"></script>
7
+ <script type="text/javascript" src="debug.js"></script>
8
+ <script type="text/javascript" src="wema.js"></script>
9
+ </head>
10
+ <body onload="wema_init();">
11
+
12
+ <p>test case for wema</p>
13
+
14
+ <div>wema:
15
+ <a href="javascript:wema_editor_show()" title="�V�����tⳂ����">new</a>
16
+ <a href="javascript:wema_help_show()" title="�g����">help</a>
17
+ </div>
18
+
19
+ <div class="wema" id="id1" style="left:1px;top:2px;color:#000;background:#fff;" wema_tc="#000" wema_bg="#fff" wema_ln="" wema_d="This is a test.">
20
+ <div class="menubar">
21
+ <span class="handle">id1</span>
22
+ <span class="cmd">
23
+ <a href="javascript:wema_setpos('id1')">set</a>
24
+ <a href="javascript:wema_edit('id1')">edit</a>
25
+ <a href="javascript:wema_link('id1')">link</a>
26
+ </span>
27
+ </div>
28
+ <div class="cont">
29
+ <p>This is a test.</p>
30
+ </div>
31
+ </div>
32
+
33
+ <div class="wema" id="id2" style="left:8px;top:9px;color:#600;background:#cfc;" wema_tc="#600" wema_bg="#cfc" wema_ln="id2" wema_d="This is a test2.">
34
+ <div class="menubar">
35
+ <span class="handle">id2</span>
36
+ <span class="cmd">
37
+ <a href="javascript:wema_setpos('id2')">set</a>
38
+ <a href="javascript:wema_edit('id2')">edit</a>
39
+ <a href="javascript:wema_link('id2')">link</a>
40
+ </span>
41
+ </div>
42
+ <div class="cont">
43
+ <p>This is a test2.</p>
44
+ </div>
45
+ </div>
46
+
47
+ <div class="wema" id="editor">
48
+ <div class="menubar">
49
+ <span class="handle">editor</span>
50
+ <span class="close">
51
+ <a href="javascript:wema_editor_hide()" title="�‚���">�~</a>
52
+ </span>
53
+ </div>
54
+
55
+ <form action="ActWema.wema" id="frm" method="POST">
56
+ <div class="save">
57
+ <input type="submit" value="�� ��������"/>
58
+ </div>
59
+ <textarea name="body"></textarea>
60
+
61
+ <p>�����F�F
62
+ <input id="tc" name="tc"/>
63
+ <a class="color" href="javascript:wema_set_color('tc', '#000')" style="color:#000;background:#000;">��</a>
64
+ </p>
65
+
66
+ <p>�w�i�F�F
67
+ <input id="bg" name="bg"/>
68
+ <a class="color" href="javascript:wema_set_color('bg', '#fff')" style="color:#fff;background:#fff;">��</a>
69
+ </p>
70
+
71
+ <p>���������F
72
+ <input name="ln"/>
73
+ </p>
74
+
75
+ <p>
76
+ x: <input name="l" value=""/>
77
+ y: <input name="t" value=""/>
78
+ </p>
79
+
80
+ <input name="id" type="hidden" value=""/>
81
+ <input name="mode" type="hidden" value="edit"/>
82
+ </form>
83
+
84
+ </div>
85
+
86
+ <div class="wema" id="help">
87
+ <div class="menubar"><span class="handle">help</span>
88
+ <span class="close">
89
+ <a href="javascript:wema_help_hide()" title="�‚���">�~</a></span>
90
+ </div>
91
+ <div class="cont">
92
+ <h3>�tⳋ@�\�w���v</h3>
93
+ </div>
94
+ </div>
95
+
96
+ <style>@import '../all.css';</style>
97
+
98
+ <script language="javascript">
99
+
100
+ ////////////////////////////////////////////////////////////
101
+ function testPoint() {
102
+ p = new Point(1, 2);
103
+ assertEquals(1, p.x);
104
+ assertEquals(2, p.y);
105
+ assertEquals("Point(1, 2)", p.toString());
106
+ }
107
+ function testPointStr() {
108
+ p = new Point("3px", "4px");
109
+ assertEquals(3, p.x);
110
+ assertEquals(4, p.y);
111
+ }
112
+ function testPointPlusMinus() {
113
+ var a = new Point(1, 2);
114
+ var b = new Point(3, 4);
115
+ assertEquals("Point(4, 6)", a.plus(b).toString());
116
+ assertEquals("Point(2, 2)", b.minus(a).toString());
117
+ }
118
+
119
+ ////////////////////////////////////////////////////////////
120
+ function testWemaEditor() {
121
+ assertEquals("hidden", g_env.editor.getMode());
122
+ assertNotNull(g_env.editor.form);
123
+ }
124
+ function testWemaEditorShow() {
125
+ assertEquals("hidden", g_env.editor.getMode());
126
+ g_env.editor._show();
127
+ assertEquals("visible", g_env.editor.getMode());
128
+ g_env.editor.hide();
129
+ assertEquals("hidden", g_env.editor.getMode());
130
+ }
131
+ function testWemaEditorCreateNewWema() {
132
+ assertEquals("hidden", g_env.editor.getMode());
133
+ g_env.mouse = new Point(1, 2);
134
+ g_env.editor.createNewWema();
135
+ assertEquals("visible", g_env.editor.getMode());
136
+ assertEquals("1px", g_env.editor.form.l.value);
137
+ assertEquals("2px", g_env.editor.form.t.value);
138
+ g_env.editor.hide();
139
+ }
140
+ function testWemaEditorSetWemaPosition() {
141
+ g_env.editor._setWemaPosition("id1");
142
+ assertEquals("1px", g_env.editor.form.l.value);
143
+ assertEquals("2px", g_env.editor.form.t.value);
144
+ }
145
+ // Do not test setPos, because setPos calls form.submit().
146
+ function testWemaEditorEditWema() {
147
+ g_env.editor.editWema("id1");
148
+ assertEquals("id1", g_env.editor.form.id.value);
149
+ assertEquals("edit", g_env.editor.form.mode.value);
150
+ assertEquals("", g_env.editor.form.ln.value);
151
+ assertEquals("This is a test.", g_env.editor.form.body.value);
152
+ assertEquals("#000", g_env.editor.form.tc.value);
153
+ assertEquals("#fff", g_env.editor.form.bg.value);
154
+ g_env.editor.editWema("id2");
155
+ assertEquals("id2", g_env.editor.form.ln.value);
156
+ assertEquals("This is a test2.", g_env.editor.form.body.value);
157
+ assertEquals("#600", g_env.editor.form.tc.value);
158
+ assertEquals("#cfc", g_env.editor.form.bg.value);
159
+ }
160
+ function testWemaEditorCreateNewLinkedWema() {
161
+ g_env.editor.createNewLinkedWema("id1");
162
+ assertEquals("id1", g_env.editor.form.ln.value);
163
+ }
164
+ function testWemaEditorSetColor() {
165
+ g_env.editor.setColor("tc", "#000");
166
+ assertEquals("#000", g_env.editor.form.tc.value);
167
+ g_env.editor.setColor("bg", "#fff");
168
+ assertEquals("#fff", g_env.editor.form.bg.value);
169
+ }
170
+
171
+ ////////////////////////////////////////////////////////////
172
+ function nutestWemaLineFillRect() {
173
+ var o = xp.fillRect(1, 2, 3, 4, "#000");
174
+ var s = o.style;
175
+ if (xp.IE) assertEquals("#000", s.backgroundColor);
176
+ if (xp.GK) assertEquals("rgb(0, 0, 0)", s.backgroundColor);
177
+ assertEquals("absolute", s.position);
178
+ assertEquals("hidden", s.overflow);
179
+ assertEquals("1px", s.left);
180
+ assertEquals("2px", s.top);
181
+ assertEquals("3px", s.width);
182
+ assertEquals("3px", s.height);
183
+ }
184
+
185
+ function nutestWemaLineDrawLine() {
186
+ var o = xp.drawLine(1, 2, 3, 4, "#000", "lineid");
187
+ assertEquals("lineid", o.id);
188
+ var s = o.firstChild.style;
189
+ assertEquals("1px", s.left);
190
+ assertEquals("2px", s.top);
191
+ assertEquals("1px", s.width);
192
+ assertEquals("3px", s.height);
193
+ var s = o.lastChild.style;
194
+ assertEquals("1px", s.left);
195
+ assertEquals("4px", s.top);
196
+ assertEquals("3px", s.width);
197
+ assertEquals("1px", s.height);
198
+ }
199
+
200
+ ////////////////////////////////////////////////////////////
201
+ function testWemaLine() {
202
+ /*
203
+ var line = g_env.wemas.get("id1").line;
204
+ assertEquals("<WemaLine(id1)>", line.toString());
205
+ assertEquals("wema_line", line.obj.className);
206
+ assertEquals("hidden", line.line1.style.visibility);
207
+
208
+ var line = g_env.wemas.get("id2").line;
209
+ assertEquals("<WemaLine(id2)>", line.toString());
210
+ var s = line.line1.style
211
+ assertEquals("visible", s.visibility);
212
+ assertEquals("1px", s.width);
213
+ assertEquals("1px", s.height);
214
+ */
215
+ }
216
+
217
+ ////////////////////////////////////////////////////////////
218
+ function testWema() {
219
+ /*
220
+ var w = g_env.wemas.get("id1");
221
+ assertEquals("id1", w.id);
222
+ assertEquals("This is a test.", w.text);
223
+ assertEquals("", w.lineid);
224
+ assertEquals("<WemaLine(id1)>", w.line.toString());
225
+ assertEquals("#000", w.color);
226
+ assertEquals("#fff", w.background);
227
+ assertEquals("<Wema(id1)>", w.toString());
228
+ */
229
+ }
230
+ function testWemaPos() {
231
+ var w = g_env.wemas.get("id1");
232
+ assertEquals("Point(1, 2)", w.getPos().toString());
233
+ w.setPos(new Point(3, 4));
234
+ assertEquals("Point(3, 4)", w.getPos().toString());
235
+ }
236
+ function testWemaZIndex() {
237
+ var w = g_env.wemas.get("id1");
238
+ w.setZIndex(6);
239
+ assertEquals(6, w.getZIndex());
240
+ }
241
+
242
+ ////////////////////////////////////////////////////////////
243
+ function testWemaSet() {
244
+ var wl = g_env.wemas.wlist; // length is 4. 2 wemas + editor + help
245
+ assertEquals("id1", wl["id1"].id);
246
+ }
247
+ function testWemaSetGet() {
248
+ var w = g_env.wemas.get("id1");
249
+ assertEquals("id1", w.obj.id);
250
+ }
251
+ function testWemaSetDragging() {
252
+ g_env.wemas.clearDragging();
253
+ assertNull(g_env.wemas.getCurDragging());
254
+ g_env.wemas.startDragging("id1");
255
+ assertEquals("<Wema(id1)>", g_env.wemas.getCurDragging().toString());
256
+ }
257
+ function testWemaSetZIndex() {
258
+ g_env.wemas.setZIndex(7);
259
+ var w = g_env.wemas.get("id1");
260
+ assertEquals(7, g_env.xp.getZIndex(w.obj));
261
+ }
262
+
263
+ function testWemaSetSetMouseEvent() {
264
+ g_env.wemas.setMouseEvent();
265
+ var ar = g_env.xp.getDivListByClass("menubar");
266
+ for(var i=0; i < ar.length; i++){
267
+ var o = ar[i]; //showAllProperty(o);
268
+ assertEquals("menubar", o.className);
269
+ assertEquals("function", typeof(o.onmousedown));
270
+ }
271
+ assertEquals("function", typeof(document.onmouseup));
272
+ assertEquals("function", typeof(document.onmousemove));
273
+ }
274
+
275
+ ////////////////////////////////////////////////////////////
276
+ function testWemaEnvironment() {
277
+ //assertEquals(0, g_env.offset.x);
278
+ //assertEquals(0, g_env.mouse.x);
279
+ }
280
+
281
+ function testWemaEnvironmentHelp() {
282
+ g_env.showHelp();
283
+ var o = g_env.xp.getById("help");
284
+ assertEquals("visible", o.style.visibility);
285
+ g_env.hideHelp();
286
+ assertEquals("hidden", o.style.visibility);
287
+ }
288
+
289
+ function testWemaEnvironmentShowWindow() {
290
+ var o = g_env.xp.createDiv("testid");
291
+ assertEquals("testid", o.id);
292
+ assertEquals("", o.style.visibility);
293
+ g_env.showWindow("testid");
294
+ assertEquals("visible", o.style.visibility);
295
+ assertEquals(2, g_env.xp.getZIndex(o));
296
+ g_env.hideWindow("testid");
297
+ assertEquals("hidden", o.style.visibility);
298
+ assertEquals(0, g_env.xp.getZIndex(o));
299
+ g_env.xp.removeElement(o);
300
+ }
301
+
302
+ </script>
303
+ </body>
304
+ </html>
@@ -0,0 +1,99 @@
1
+ <!-- -*- c++ -*- -->
2
+ <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
3
+ <html>
4
+ <head>
5
+ <title>test</title>
6
+ <script type="text/javascript" src="../../jsUnit/app/jsUnitCore.js"></script>
7
+ <script type="text/javascript" src="wema.js"></script>
8
+ <script language="javascript">
9
+
10
+ //var xp = new XP();
11
+ var xp = g_xp;
12
+
13
+ function testCheckBrowser() {
14
+ assertEquals(0, xp.N4); // adhoc
15
+ }
16
+
17
+ function testCreateElement() {
18
+ var o = xp.createElement("div");
19
+ o.id = "testid1";
20
+ assertEquals("testid1", o.id);
21
+ }
22
+
23
+ function testCreateDiv() {
24
+ var o = xp.createDiv("testid2");
25
+ assertEquals("testid2", o.id);
26
+ xp.removeElement(o);
27
+ assertEquals("testid2", o.id); // object is not erased.
28
+ }
29
+
30
+ function testAttr() {
31
+ var o = xp.createElement("div");
32
+ xp.setAttr(o, "testattr", "testvalue");
33
+ assertEquals("testvalue", xp.getAttr(o, "testattr"));
34
+ }
35
+
36
+ function testGetDivList() {
37
+ var first_length = xp.getDivList().length
38
+ //assertEquals(0, xp.getDivList().length);
39
+ xp.createElement("div");
40
+ //assertEquals(0, xp.getDivList().length); // no effect
41
+ assertEquals(first_length, xp.getDivList().length); // no effect
42
+ xp.createDiv("testid2"); // add one
43
+ //assertEquals(1, xp.getDivList().length);
44
+ assertEquals(first_length+1, xp.getDivList().length);
45
+ }
46
+
47
+ function testGetDivListByClass() {
48
+ assertEquals(0, xp.getDivListByClass("testclass").length);
49
+ var o = xp.createDiv("testid2");
50
+ o.className = "testclass";
51
+ assertEquals("testclass", o.className);
52
+ assertEquals(1, xp.getDivListByClass("testclass").length);
53
+ }
54
+
55
+ function testGetById() {
56
+ xp.createDiv("testid3");
57
+ assertEquals("testid3", xp.getById("testid3").id);
58
+ }
59
+
60
+ function testZIndex() {
61
+ var o = xp.createElement("div");
62
+ assertEquals(0, xp.getZIndex(o));
63
+ xp.setZIndex(o, 1);
64
+ assertEquals(1, xp.getZIndex(o));
65
+ }
66
+
67
+ function testPos() {
68
+ var o = xp.createElement("div");
69
+ var p = xp.getPos(o);
70
+ assertEquals(0, p.x);
71
+ assertEquals(0, p.y);
72
+ xp.setPos(o, new Point(1, 2));
73
+ var p = xp.getPos(o);
74
+ assertEquals(1, p.x);
75
+ assertEquals(2, p.y);
76
+ }
77
+
78
+ function testGetSize() {
79
+ var o = xp.createElement("div");
80
+ var p = xp.getSize(o);
81
+ assertEquals("number", typeof(p.x));
82
+ assertEquals("number", typeof(p.y));
83
+ }
84
+
85
+ function testGetCenter() {
86
+ var o = xp.createElement("div");
87
+ var p = xp.getCenter(o);
88
+ assertEquals("number", typeof(p.x));
89
+ assertEquals("number", typeof(p.y));
90
+ }
91
+
92
+ // test for event capture is not yet finished.
93
+
94
+ </script>
95
+ </head>
96
+ <body>
97
+ <p>test case for xp</p>
98
+ </body>
99
+ </html>