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,60 @@
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="debugwindow.js"></script>
8
+ <script language="javascript">
9
+
10
+ //
11
+ // Copyright (C) 2003-2005 Kouichirou Eto
12
+ // All rights reserved.
13
+ // This is free software with ABSOLUTELY NO WARRANTY.
14
+ //
15
+ // You can redistribute it and/or modify it under the terms of
16
+ // the GNU General Public License version 2.
17
+ //
18
+
19
+ function testShowHide() {
20
+ var obj = document.getElementById("debugwindow");
21
+
22
+ g_debug.hide();
23
+ assertEquals("none", obj.style.display);
24
+
25
+ g_debug.show();
26
+ assertEquals("block", obj.style.display);
27
+
28
+ var button = document.getElementById("debugwindowclosebutton");
29
+ button.onmousedown(); // clicked
30
+
31
+ assertEquals("none", obj.style.display);
32
+
33
+ g_debug.show();
34
+ }
35
+
36
+ function testPrint() {
37
+ var obj = document.getElementById("debugwindow");
38
+ assertEquals("object", typeof obj);
39
+
40
+ var obj = document.getElementById("debugwindowconsole");
41
+ assertEquals("object", typeof obj);
42
+ assertEquals("debugwindowconsole", obj.id);
43
+ assertEquals("", obj.innerHTML);
44
+
45
+ // test_print
46
+ g_debug.print("t");
47
+ var str = obj.innerHTML;
48
+ /*
49
+ var re = /<tt>t<\/tt>/i;
50
+ var ar = str.match(re);
51
+ assertEquals(true, re.test(str));
52
+ */
53
+ }
54
+
55
+ </script>
56
+ </head>
57
+ <body>
58
+ <p>test</p>
59
+ </body>
60
+ </html>
@@ -0,0 +1,24 @@
1
+ <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
2
+ <html>
3
+ <head>
4
+ <title>test DebugWindow</title>
5
+ <script type="text/javascript" src="debugwindow.js"></script>
6
+ <script language="javascript">
7
+ </script>
8
+ <style>
9
+ body {
10
+ background: #eff;
11
+ }
12
+ </style>
13
+ </head>
14
+ <body>
15
+ <h1>test DebugWindow</h1>
16
+ <p>
17
+
18
+ <a href="javascript:g_debug.p('clicked')">click here</a>
19
+
20
+ <a href="javascript:g_debug.p(g_debug.console)">click here</a>
21
+
22
+ </p>
23
+ </body>
24
+ </html>
@@ -0,0 +1,476 @@
1
+ // -*- c++ -*-
2
+ //
3
+ // debugwindow.js - Show debug information using small debug window.
4
+ //
5
+ // Copyright (C) 2005 Kouichirou Eto,
6
+ // All rights reserved.
7
+ // This is free software with ABSOLUTELY NO WARRANTY.
8
+ //
9
+ // You can redistribute it and/or modify it under the terms of
10
+ // the GNU General Public License version 2.
11
+ //
12
+
13
+ //
14
+ // * Usage
15
+ // init() : called from onload.
16
+ // open() : open window.
17
+ // print(str) : print message.
18
+ // puts(str) : print message with new line.
19
+ // clear() : clear window.
20
+ // p(obj) : print the result of inspecting the object.
21
+ // inspect(obj) : inspect object.
22
+ //
23
+
24
+ //
25
+ // * Interface for the debug window
26
+ // [x] - close window.
27
+ // [v] - make console bigger.
28
+ // [-] - close console.
29
+ // [+] - open console.
30
+ //
31
+
32
+ //
33
+ // * History
34
+ //
35
+ // ** 2005-04-05 DebugWindow 0.5
36
+ // - Do not open window by default.
37
+ //
38
+ // ** 2005-03-31 DebugWindow 0.4
39
+ // - Set default position to right top corner.
40
+ // - Set default to close console.
41
+ //
42
+ // ** 2005-03-30 DebugWindow 0.3
43
+ // - Add a lines button and a close button.
44
+ // - Add a test case.
45
+ //
46
+ // ** 2005-03-30 DebugWindow 0.2
47
+ // - Now works in IE same as Firefox.
48
+ //
49
+ // ** 2005-03-29 DebugWindow 0.1
50
+ // - The initial release.
51
+ //
52
+
53
+ //
54
+ // * Special Thanks to
55
+ //
56
+ // - debug.js
57
+ // -- http://homepage1.nifty.com/kuraman/js/debug.html
58
+ //
59
+ // - wema
60
+ // -- http://wema.sourceforge.jp/
61
+ //
62
+ // - ArekorePopup.js
63
+ // -- http://www.remus.dti.ne.jp/~a-satomi/bunsyorou/ArekorePopup.html
64
+ //
65
+ // - bobchin
66
+ // -- http://d.hatena.ne.jp/bobchin/20050304
67
+ //
68
+
69
+ function DebugWindow() {
70
+ // setting.
71
+ this.showConsole = true;
72
+ //this.showConsole = false;
73
+ this.width = "320px";
74
+ this.height = "240px"; // height unit must be "px".
75
+
76
+ // variables.
77
+ this.win = null;
78
+ this.toggleButton = null;
79
+ this.console = null;
80
+ this.buffer = "";
81
+ this.dragging = false;
82
+ }
83
+
84
+ DebugWindow.prototype = {
85
+ init : function() {
86
+ this.open();
87
+ },
88
+
89
+ open : function() {
90
+ var obj = document.getElementById("debugwindow");
91
+ if (obj) return; // already opened.
92
+
93
+ // create window
94
+ var w = document.createElement("div");
95
+ w.setAttribute("id", "debugwindow");
96
+ with(w.style) {
97
+ zIndex = "1";
98
+ position = "absolute";
99
+ right = "0px";
100
+ top = "0px";
101
+ width = this.width;
102
+ margin = "0";
103
+ padding = "0";
104
+ border = "2px outset";
105
+ fontFamily = "Verdana,Arial,sans-serif";
106
+ fontSize = "small";
107
+ }
108
+ w.show = function() {
109
+ this.style.display = "block";
110
+ };
111
+ w.hide = function() {
112
+ this.style.display = "none";
113
+ };
114
+ document.body.appendChild(w);
115
+ this.win = w;
116
+
117
+ // titlebar
118
+ var titlebar = document.createElement("div");
119
+ titlebar.setAttribute("id", "debugwindowtitlebar");
120
+ with(titlebar.style) {
121
+ margin = "0";
122
+ padding = "0";
123
+ borderBottom = "1px solid #ccc";
124
+ background = "#999";
125
+ color = "#fff";
126
+ }
127
+ w.appendChild(titlebar);
128
+
129
+ // console
130
+ var console = document.createElement("div");
131
+ console.setAttribute("id", "debugwindowconsole");
132
+ console.contentEditable = "true"; // contentEditable only works in IE.
133
+ with(console.style) {
134
+ height = this.height;
135
+ overflow = "scroll";
136
+ margin = "0";
137
+ padding = "0";
138
+ border = "1px inset";
139
+ background = "#eee";
140
+ color = "#000";
141
+ fontFamily = "Verdana,Arial,sans-serif";
142
+ fontSize = "small";
143
+ }
144
+ console.makeBigger = function() {
145
+ var s = this.style;
146
+ var h = parseInt(s.height.replace("px", ""));
147
+ h += 24;
148
+ s.height = h+"px";
149
+ };
150
+ console.show = function() {
151
+ this.style.display = "block";
152
+ };
153
+ console.hide = function() {
154
+ this.style.display = "none";
155
+ };
156
+ console.visible = function() {
157
+ return this.style.display == "block";
158
+ };
159
+ console.show(); // console is visible.
160
+ w.appendChild(console);
161
+ this.console = console;
162
+
163
+ // title
164
+ var span = document.createElement("span");
165
+ with(span.style) {
166
+ display = "block";
167
+ margin = "0";
168
+ padding = "0 0 0 10px";
169
+ fontSize = "xx-small";
170
+ }
171
+ span.innerHTML = "debug window";
172
+ span.onmousedown = function(e) { // onmousedown
173
+ g_debug.startDragging(e);
174
+ };
175
+ span.ondblclick = function() {
176
+ g_debug.consoleToggle();
177
+ };
178
+ titlebar.appendChild(span);
179
+
180
+ // close button
181
+ var span = this.createButton("debugwindowclosebutton");
182
+ span.setPos(0, 0);
183
+ span.innerHTML = "x";
184
+ span.onmousedown = function() {
185
+ g_debug.win.hide();
186
+ };
187
+ titlebar.appendChild(span);
188
+
189
+ // make bigger button
190
+ var span = this.createButton("debugwindowbiggerbutton");
191
+ span.setPos(18, 0);
192
+ span.innerHTML = "v";
193
+ var proc = function() {
194
+ g_debug.console.makeBigger();
195
+ };
196
+ span.onclick = proc;
197
+ span.ondblclick = proc;
198
+ titlebar.appendChild(span);
199
+
200
+ // console toggle button
201
+ var span = this.createButton("debugwindowtogglebutton");
202
+ span.setPos(32, 0);
203
+ var proc = function() {
204
+ g_debug.consoleToggle();
205
+ };
206
+ span.onclick = proc;
207
+ span.ondblclick = proc;
208
+ titlebar.appendChild(span);
209
+ this.toggleButton = span;
210
+
211
+ // set document event
212
+ document.onmousemove = function(e) {
213
+ g_debug.nowDragging(e);
214
+ };
215
+ document.onmouseup = function(e) {
216
+ g_debug.endDragging();
217
+ }
218
+
219
+ if (! this.showConsole) {
220
+ this.consoleToggle(); // hide at the first.
221
+ }
222
+ },
223
+
224
+ createButton : function(id) { // private
225
+ var span = document.createElement("span");
226
+ span.setAttribute("id", id);
227
+ with(span.style) {
228
+ width = "12px";
229
+ height = "10px";
230
+ margin = "0";
231
+ padding = "0";
232
+ background = "#ccc";
233
+ color = "#000";
234
+ fontSize = "xx-small";
235
+ fontWeight = "bold";
236
+ textAlign = "center";
237
+ display = "block";
238
+ border = "1px outset";
239
+ }
240
+ span.setPos = function(x, y) {
241
+ with(this.style) {
242
+ position = "absolute";
243
+ right = x+"px";
244
+ top = y+"px";
245
+ }
246
+ }
247
+ return span;
248
+ },
249
+
250
+ consoleToggle : function(e) {
251
+ var con = this.console;
252
+ var but = this.toggleButton;
253
+ if (con.visible()) {
254
+ con.hide();
255
+ but.innerHTML = "+";
256
+ } else {
257
+ con.show();
258
+ but.innerHTML = "-";
259
+ }
260
+ },
261
+
262
+ startDragging : function(e) {
263
+ if (typeof e == "undefined") {
264
+ e = window.event;
265
+ }
266
+ var w = this.win;
267
+ if (!w) return;
268
+ var pos = this.getMousePos(e);
269
+ var divpos = this.getDivPos(w);
270
+ var x = pos.mouseX - divpos.x;
271
+ var y = pos.mouseY - divpos.y
272
+ this.offset = {
273
+ x : x,
274
+ y : y
275
+ };
276
+ this.dragging = true;
277
+ },
278
+
279
+ nowDragging : function(e) {
280
+ if (typeof e == "undefined") {
281
+ e = window.event;
282
+ }
283
+ if (!this.alerted) {
284
+ //g_debug.p(e);
285
+ this.alerted = true;
286
+ }
287
+ var w = this.win;
288
+ if (!w) return;
289
+ if (!this.dragging) return;
290
+ var pos = this.getMousePos(e);
291
+ var offset = this.offset;
292
+ var x = pos.mouseX - offset.x;
293
+ var y = pos.mouseY - offset.y;
294
+ w.style.left = x+"px";
295
+ w.style.top = y+"px";
296
+ },
297
+
298
+ endDragging : function() {
299
+ g_debug.dragging = false;
300
+ },
301
+
302
+ // ref. ArekorePopup.js
303
+ getMousePos : function(e) {
304
+ var d = document.documentElement;
305
+ var body = document.body;
306
+ var isSafari = navigator.userAgent.match('AppleWebKit');
307
+ var scrollX = (window.scrollX) ? window.scrollX : (d.scrollLeft) ? d.scrollLeft : body.scrollLeft;
308
+ var scrollY = (window.scrollY) ? window.scrollY : (d.scrollTop) ? d.scrollTop : body.scrollTop;
309
+ var windowW = (window.innerWidth) ? window.innerWidth : d.offsetWidth;
310
+ var windowH = (window.innerHeight) ? window.innerHeight : d.offsetHeight;
311
+ var windowX = e.clientX - (( isSafari) ? scrollX : 0);
312
+ var windowY = e.clientY - (( isSafari) ? scrollY : 0);
313
+ var mouseX = e.clientX + ((!isSafari) ? scrollX : 0);
314
+ var mouseY = e.clientY + ((!isSafari) ? scrollY : 0);
315
+
316
+ var pos = {
317
+ scrollX : scrollX,
318
+ scrollY : scrollY,
319
+ windowW : windowW,
320
+ windowH : windowH,
321
+ windowX : windowX,
322
+ windowY : windowY,
323
+ mouseX : mouseX,
324
+ mouseY : mouseY
325
+ };
326
+ return pos;
327
+ },
328
+
329
+ getDivPos : function(o) {
330
+ var s = o.style;
331
+ var x = (s.left) ? s.left : (s.posLeft) ? s.posLeft : o.offsetLeft+"px";
332
+ var y = (s.top) ? s.top : (s.posTop) ? s.posTop : o.offsetTop+"px";
333
+ divx = parseInt(x.replace("px", ""));
334
+ divy = parseInt(y.replace("px", ""));
335
+ if (divx == 0) divx = 1; // IE BUGFIX.
336
+ if (divy == 0) divy = 1;
337
+ var pos = {
338
+ x : divx,
339
+ y : divy
340
+ };
341
+ return pos;
342
+ },
343
+
344
+ // ref. ArekorePopup.js
345
+ addEventListener : function(obj, type, listener) {
346
+ if (obj.addEventListener) { // Std DOM Events
347
+ obj.addEventListener(type, listener, false);
348
+ } else if (obj.attachEvent) { // IE
349
+ //g_debug.pa("addEvent hi");
350
+ var e = {
351
+ //type : window.event.type,
352
+ //target : window.event.srcElement,
353
+ //currentTarget : obj,
354
+ //clientX : window.event.clientX,
355
+ //clientY : window.event.clientY,
356
+ //pageY : document.body.scrollTop + window.event.clientY,
357
+ //shiftKey : window.event.shiftKey,
358
+ //stopPropagation : function() { window.event.cancelBubble = true }
359
+ };
360
+ //g_debug.pa(e);
361
+ obj.attachEvent('on' + type,
362
+ function() { listener( e ) } );
363
+ }
364
+ },
365
+
366
+ destroy : function() { // private
367
+ var div = this.win;
368
+ if (!div) return;
369
+ document.body.removeChild(div);
370
+ this.win = null;
371
+ },
372
+
373
+ bufferPrint : function(str) {
374
+ str = this.escapeHTML(str);
375
+ this.buffer += str;
376
+ },
377
+
378
+ bufferPrintTag : function(str) {
379
+ this.buffer += str;
380
+ },
381
+
382
+ print : function(str) {
383
+ this.bufferPrintTag("<tt>");
384
+ this.bufferPrint(str)
385
+ this.bufferPrintTag("</tt>");
386
+ },
387
+
388
+ puts : function(str) {
389
+ this.print(str);
390
+ this.bufferPrintTag("<br\n/>");
391
+ this.flush();
392
+ },
393
+
394
+ clear : function() {
395
+ this.buffer = "";
396
+ this.flush();
397
+ },
398
+
399
+ p : function(obj) {
400
+ var str = this.inspect(obj)
401
+ this.puts(str);
402
+ },
403
+
404
+ flush : function() {
405
+ if (!this.win) this.open();
406
+ if (this.win.style.display == "none") {
407
+ this.win.style.display = "block";
408
+ }
409
+ var div = this.console;
410
+ if (!div) return; // error
411
+ div.innerHTML = this.buffer;
412
+ },
413
+
414
+ pa : function(obj) { // to test DebugWindow.
415
+ var str = this.inspect(obj)
416
+ alert(str);
417
+ },
418
+
419
+ inspect : function(obj) {
420
+ if (typeof obj == "number") {
421
+ return ""+obj;
422
+ } else if (typeof obj == "string") {
423
+ return "\""+obj+"\"";
424
+ } else if (typeof obj == "function") {
425
+ return ""+obj;
426
+ } else if (typeof obj == "object") {
427
+ //var delimiter = ", <br>";
428
+ var delimiter = ",\n";
429
+ var str = "{";
430
+ var added = false;
431
+ for (key in obj) {
432
+ var value = obj[key];
433
+ if (value) {
434
+ if (added) str += delimiter;
435
+ added = true;
436
+ if (typeof value == "number") {
437
+ str += ""+key+"=>"+value+"";
438
+ } else if (typeof value == "string") {
439
+ str += ""+key+"=>\""+value+"\"";
440
+ } else if (typeof value == "function") {
441
+ str += ""+key+"()";
442
+ } else if (typeof value == "object") {
443
+ str += ""+key+"=>"+value+"";
444
+ } else {
445
+ str += ""+key+"=><"+(typeof value)+":"+value+">";
446
+ }
447
+ }
448
+ }
449
+ return str+"}";
450
+ } else {
451
+ return "<"+(typeof obj)+":"+obj+">";
452
+ }
453
+ },
454
+
455
+ escapeHTML : function(str) {
456
+ str = str.replace(/&/g, "&amp;");
457
+ str = str.replace(/</g, "&lt;");
458
+ str = str.replace(/>/g, "&gt;");
459
+ str = str.replace(/\"/g, "&quot;"); // "
460
+ //str = str.replace(/\n/g, "<br\n/>");
461
+ return str;
462
+ },
463
+
464
+ dummy : function() {
465
+ } // no "," here
466
+ };
467
+
468
+ if (typeof g_debug == 'undefined') {
469
+ var g_debug = new DebugWindow();
470
+
471
+ //var proc = function() {
472
+ // g_debug.init();
473
+ //}
474
+ //window.onload = proc;
475
+ //g_debug.addEventListener(window, "load", proc);
476
+ }