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,98 @@
1
+ // -*- c++ -*-
2
+ //
3
+ // Copyright (C) 2003-2005 Kouichirou Eto
4
+ // All rights reserved.
5
+ // This is free software with ABSOLUTELY NO WARRANTY.
6
+ //
7
+ // You can redistribute it and/or modify it under the terms of
8
+ // the GNU General Public License version 2.
9
+ //
10
+
11
+ // ==================== xmlhttp
12
+ function createXmlHttp() {
13
+ var x;
14
+ try {
15
+ x = new ActiveXObject("Msxml2.XMLHTTP");
16
+ return x;
17
+ } catch (e) {
18
+ try {
19
+ x = new ActiveXObject("Microsoft.XMLHTTP");
20
+ return x;
21
+ } catch (E) {
22
+ try {
23
+ if (typeof XMLHttpRequest != 'undefined') {
24
+ x = new XMLHttpRequest();
25
+ return x;
26
+ }
27
+ } catch (E) {
28
+ return false;
29
+ }
30
+ }
31
+ }
32
+ return false;
33
+ }
34
+
35
+ // ==================== EWatcher
36
+ function EWatcher(url) {
37
+ this.url = url;
38
+ this.xmlhttp = null;
39
+ }
40
+
41
+ EWatcher.prototype = {
42
+ toString : function() {
43
+ return "EWatcher("+this.url+")";
44
+ },
45
+
46
+ getting_p : function() {
47
+ if (! this.xmlhttp) return false;
48
+ var s = this.xmlhttp.readyState;
49
+ return (s != 4);
50
+ },
51
+
52
+ get : function() {
53
+ var div = document.getElementById("event");
54
+ if (!div) return;
55
+
56
+ var url = this.url;
57
+ var xmlhttp = createXmlHttp();
58
+ this.xmlhttp = xmlhttp;
59
+ xmlhttp.open("GET", url, true);
60
+ xmlhttp.onreadystatechange = function() {
61
+ if (xmlhttp.readyState == 4) {
62
+ if (xmlhttp.status == 200) {
63
+ div.innerHTML = xmlhttp.responseText;
64
+ }
65
+ }
66
+ }
67
+ xmlhttp.send(null);
68
+ },
69
+
70
+ dummy : function() {
71
+ } // no "," here
72
+ }
73
+
74
+ // ==================== Event watcher
75
+ function EventWatcher() {
76
+ this.watchers = [];
77
+
78
+ this.add = function(pagename) {
79
+ var wat = new EWatcher(pagename);
80
+ this.watchers.push(wat);
81
+ }
82
+
83
+ this.start = function() {
84
+ for (var i=0; i < this.watchers.length; i++) {
85
+ var wat = this.watchers[i];
86
+ if (!wat.getting_p()) {
87
+ wat.get();
88
+ }
89
+ }
90
+ }
91
+ }
92
+
93
+ var g_eventwatcher;
94
+ if (typeof g_eventwatcher == 'undefined') {
95
+ g_eventwatcher = new EventWatcher();
96
+ }
97
+
98
+ // end
@@ -0,0 +1,110 @@
1
+ // -*- c++ -*-
2
+ //
3
+ // history.js - Show edit history by moving time line.
4
+ //
5
+ // Copyright (C) 2003-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
+ function History(xp) {
14
+ this.xp = xp;
15
+ this.windowWidth = this._getWidth();
16
+ this.divlist = document.getDivListByClass("era");
17
+ this.indicator = document.getElementById("indicator");
18
+ this.eraWidth = this._calcEraWidth();
19
+ this.lastdiv = null;
20
+ this.lines = null;
21
+ this.displayMode = false;
22
+ this._drawRuler();
23
+ }
24
+
25
+ History.prototype = {
26
+ _getWidth : function() {
27
+ var cursorsize = 200;
28
+ var minsize = 100;
29
+ var w = 500; // adhoc
30
+ if (document.body.clientWidth)
31
+ w = document.body.clientWidth; // IE
32
+ else if (window.innerWidth)
33
+ w = window.innerWidth; // GK
34
+ w = w - cursorsize;
35
+ if (w < minsize) w = minsize;
36
+ return w;
37
+ },
38
+
39
+ _moveDivs : function() {
40
+ var o = document.getElementById("eratable");
41
+ var left = o.style.offsetLeft;
42
+ var top = o.style.offsetTop;
43
+ for (var i=0; i < this.divlist.length; i++) {
44
+ var o = this.divlist[i];
45
+ o.style.left = left;
46
+ o.style.top = top;
47
+ }
48
+ },
49
+
50
+ _calcEraWidth : function() {
51
+ return Math.floor(this.windowWidth / this.divlist.length);
52
+ },
53
+
54
+ _drawRuler : function() {
55
+ var divlines = document.getElementById("lines");
56
+ var ar = [];
57
+ for (var i=0; i < this.divlist.length; i++) {
58
+ var x = this.eraWidth * i;
59
+ var div = this.divlist[i];
60
+ var lineid = "vl"+div.id;
61
+ var line = this._drawLine(lineid, divlines, x, 40, x, 48);
62
+ ar.push(line);
63
+ }
64
+ this.lines = ar;
65
+ },
66
+
67
+ _drawLine : function(lineid, parent, x1, y1, x2, y2) {
68
+ var o = document.createElement("v:line");
69
+ o.id = lineid;
70
+ parent.appendChild(o);
71
+ o.style.visibility = "visible";
72
+ o.setAttribute("strokeweight", "1");
73
+ o.setAttribute("strokecolor", "#009");
74
+ o.style.position = "absolute";
75
+ o.style.left = "0px";
76
+ o.style.top = "0px";
77
+ var from = ""+x1+","+y1
78
+ var to = ""+x2+","+y2
79
+ o.setAttribute("from", from);
80
+ o.setAttribute("to", to);
81
+ return o
82
+ },
83
+
84
+ onMouseMove : function(p) {
85
+ var i = Math.floor(p.x / this.eraWidth);
86
+ var div = this.divlist[i];
87
+ if (div == null) return;
88
+ if (this.lastdiv) {
89
+ if (this.lastdiv == div) return; // do nothing
90
+ if (this.displayMode) this.lastdiv.style.display = "none";
91
+ else this.lastdiv.style.visibility = "hidden";
92
+ }
93
+ this.lastdiv = div;
94
+
95
+ if (this.displayMode) this.lastdiv.style.display = "block"; // show it
96
+ else this.lastdiv.style.visibility = "visible";
97
+
98
+ var date = new Date((div.id-0)*1000);
99
+ this.indicator.innerHTML = date.toLocaleString();
100
+ }
101
+ }
102
+
103
+ function qwik_onmousemove(p) {
104
+ g_history.onMouseMove(p);
105
+ }
106
+
107
+ // global
108
+ if (typeof g_history == 'undefined') {
109
+ var g_history = new History();
110
+ }
@@ -0,0 +1,27 @@
1
+ // -*- c++ -*-
2
+ //
3
+ // Copyright (C) 2003-2005 Kouichirou Eto
4
+ // All rights reserved.
5
+ // This is free software with ABSOLUTELY NO WARRANTY.
6
+ //
7
+ // You can redistribute it and/or modify it under the terms of
8
+ // the GNU General Public License version 2.
9
+ //
10
+
11
+ // ============================== menu
12
+ var g_menu;
13
+
14
+ function Menu() {
15
+ }
16
+
17
+ Menu.prototype = {
18
+ init : function() {
19
+ this.xp = xp;
20
+ this.divlist = document.getDivListByClass("hmenu");
21
+ },
22
+
23
+ toggle : function() {
24
+ }
25
+ }
26
+
27
+ // end
@@ -0,0 +1,96 @@
1
+ // -*- c++ -*-
2
+ //
3
+ // Copyright (C) 2003-2005 Kouichirou Eto
4
+ // All rights reserved.
5
+ // This is free software with ABSOLUTELY NO WARRANTY.
6
+ //
7
+ // You can redistribute it and/or modify it under the terms of
8
+ // the GNU General Public License version 2.
9
+ //
10
+
11
+ // ============================== xmlhttp
12
+ function createXmlHttp() {
13
+ var x;
14
+ try {
15
+ x = new ActiveXObject("Msxml2.XMLHTTP");
16
+ return x;
17
+ } catch (e) {
18
+ try {
19
+ x = new ActiveXObject("Microsoft.XMLHTTP");
20
+ return x;
21
+ } catch (E) {
22
+ try {
23
+ if (typeof XMLHttpRequest != 'undefined') {
24
+ x = new XMLHttpRequest();
25
+ return x;
26
+ }
27
+ } catch (E) {
28
+ return false;
29
+ }
30
+ }
31
+ }
32
+ return false;
33
+ }
34
+
35
+ // ============================== monitor
36
+ function Monitor(pagename) {
37
+ this.pagename = pagename;
38
+ this.xmlhttp = null;
39
+
40
+ this.toString = function() {
41
+ return "Monitor("+this.pagename+")";
42
+ }
43
+
44
+ this.getting_p = function() {
45
+ if (! this.xmlhttp) return;
46
+ var s = this.xmlhttp.readyState;
47
+ return (s != 4);
48
+ }
49
+
50
+ this.get = function() {
51
+ //g_debug.p("start get "+this.pagename);
52
+ var div = getById("body");
53
+ if (!div) return;
54
+
55
+ var url = this.pagename+".monitor";
56
+ var xmlhttp = createXmlHttp();
57
+ this.xmlhttp = xmlhttp;
58
+ xmlhttp.open("GET", url, true);
59
+ xmlhttp.onreadystatechange = function() {
60
+ if (xmlhttp.readyState == 4) {
61
+ if (xmlhttp.status == 200) {
62
+ div.innerHTML = xmlhttp.responseText;
63
+ //g_debug.p("set html");
64
+ g_monitor_env.start();
65
+ }
66
+ }
67
+ }
68
+ xmlhttp.send(null);
69
+ }
70
+ }
71
+
72
+ // ==================== monitor env
73
+ function MonitorEnv() {
74
+ this.monitors = [];
75
+
76
+ this.add = function(pagename) {
77
+ var mon = new Monitor(pagename);
78
+ this.monitors.push(mon);
79
+ }
80
+
81
+ this.start = function() {
82
+ for (var i=0; i < this.monitors.length; i++) {
83
+ var mon = this.monitors[i];
84
+ if (!mon.getting_p()) {
85
+ mon.get();
86
+ }
87
+ }
88
+ }
89
+ }
90
+
91
+ var g_monitor_env;
92
+ if (typeof g_monitor_env == 'undefined') {
93
+ g_monitor_env = new MonitorEnv();
94
+ }
95
+
96
+ // end
@@ -0,0 +1,272 @@
1
+ // -*- c++ -*-
2
+ //
3
+ // Copyright (C) 2003-2005 Kouichirou Eto
4
+ // All rights reserved.
5
+ // This is free software with ABSOLUTELY NO WARRANTY.
6
+ //
7
+ // You can redistribute it and/or modify it under the terms of
8
+ // the GNU General Public License version 2.
9
+ //
10
+
11
+ // ============================== document getter
12
+ // copied from nifty.js
13
+ document.getElementsBySelector = function(selector) {
14
+ var s = [];
15
+ var selid = "";
16
+ var selclass = "";
17
+ var tag = selector;
18
+ var objlist = [];
19
+
20
+ //descendant selector like "tag#id tag"
21
+ if (selector.indexOf(" ") > 0) {
22
+ s = selector.split(" ");
23
+ var fs = s[0].split("#");
24
+ if (fs.length == 1) return (objlist);
25
+ return (document.getElementById(fs[1]).getElementsByTagName(s[1]));
26
+ }
27
+
28
+ //id selector like "tag#id"
29
+ if (selector.indexOf("#") > 0) {
30
+ s = selector.split("#");
31
+ tag = s[0];
32
+ selid = s[1];
33
+ }
34
+ if (selid != "") {
35
+ objlist.push(document.getElementById(selid));
36
+ return (objlist);
37
+ }
38
+
39
+ if (selector.indexOf(".") == 0) { // no tag
40
+ tag = "*";
41
+ selclass = selector.slice(1, selector.length);
42
+ } else if (selector.indexOf(".") > 0) {
43
+ //class selector like "tag.class"
44
+ s = selector.split(".");
45
+ tag = s[0];
46
+ selclass = s[1];
47
+ }
48
+
49
+ // tag selector like "tag"
50
+ var v = document.getElementsByTagName(tag);
51
+ if (selclass == "") return (v);
52
+ for (var i=0; i < v.length; i++) {
53
+ if (v[i].className == selclass) {
54
+ objlist.push(v[i]);
55
+ }
56
+ }
57
+ return (objlist);
58
+ };
59
+
60
+ document.getElementsByClassName = function(klass) {
61
+ var all = document.getElementsByTagName("*");
62
+ var ar = [];
63
+ for (var i = 0; i < all.length; i++) {
64
+ if (all[i].className == klass)
65
+ ar.push(all[i]);
66
+ }
67
+ return ar;
68
+ };
69
+
70
+ document.getCssRules = function() {
71
+ var ar = [];
72
+ var sheets = document.styleSheets;
73
+ for (var i=0; i < sheets.length; i++) {
74
+ var rules = document.styleSheets[i].rules;
75
+ if (!rules) rules = document.styleSheets[i].cssRules;
76
+ for (var j=0; j < rules.length; j++) {
77
+ if(rules[j].type == rules[j].STYLE_RULE) {
78
+ ar.push(rules[j]);
79
+ }
80
+ }
81
+ }
82
+ return ar;
83
+ };
84
+
85
+ // ============================== NiftyCornerRule
86
+ function NiftyCornerRule(position, selector, background, border, radius) {
87
+ this.position = position;
88
+ this.selector = selector;
89
+ this.background = background;
90
+ this.border = border;
91
+ this.radius = radius; // not used for now.
92
+
93
+ this.makeLine = function(margin, height, bg) {
94
+ var x = document.createElement("span");
95
+ x.style.display = "block";
96
+ x.style.height = ""+height+"px";
97
+ x.style.margin = "0 "+margin+"px";
98
+ x.style.overflow = "hidden";
99
+ x.style.backgroundColor = bg;
100
+ return x;
101
+ };
102
+
103
+ this.makeContainer = function(border) {
104
+ var d = document.createElement("span");
105
+ d.style.display = "block";
106
+ d.style.backgroundColor = border;
107
+ return d;
108
+ };
109
+
110
+ this.makeTop = function(bg, border) {
111
+ var d = this.makeContainer(border);
112
+ d.appendChild(this.makeLine(5, 1, bg));
113
+ d.appendChild(this.makeLine(3, 1, bg));
114
+ d.appendChild(this.makeLine(2, 1, bg));
115
+ d.appendChild(this.makeLine(1, 2, bg));
116
+ return d;
117
+ };
118
+
119
+ this.makeBottom = function(bg, border) {
120
+ var d = this.makeContainer(border);
121
+ d.appendChild(this.makeLine(1, 2, bg));
122
+ d.appendChild(this.makeLine(2, 1, bg));
123
+ d.appendChild(this.makeLine(3, 1, bg));
124
+ d.appendChild(this.makeLine(5, 1, bg));
125
+ return d;
126
+ };
127
+
128
+ this.applyToElement = function(el) {
129
+ var bg = this.background;
130
+ var border = this.border;
131
+ if (this.position == "both" || this.position == "top")
132
+ el.insertBefore(this.makeTop(bg, border), el.firstChild);
133
+ if (this.position == "both" || this.position == "bottom")
134
+ el.appendChild(this.makeBottom(bg, border), el.firstChild);
135
+ };
136
+
137
+ this.apply = function() {
138
+ var sel = this.selector;
139
+ var els = document.getElementsBySelector(sel);
140
+ if (!els) return;
141
+ for (var i=0; i < els.length; i++) {
142
+ var el = els[i];
143
+ this.applyToElement(el);
144
+ }
145
+ };
146
+ }
147
+
148
+ // ==============================
149
+ function NiftyPP() {
150
+ }
151
+
152
+ NiftyPP.prototype = {
153
+ init : function() {
154
+ this.applyAll();
155
+ },
156
+
157
+ // ref. ArekorePopup.js
158
+ addEventListener : function(obj, type, listener) {
159
+ if (obj.addEventListener) { // Std DOM Events
160
+ obj.addEventListener(type, listener, false);
161
+ } else if (obj.attachEvent) { // IE
162
+ //g_debug.pa("addEvent hi");
163
+ var e = {
164
+ //type : window.event.type,
165
+ //target : window.event.srcElement,
166
+ //currentTarget : obj,
167
+ //clientX : window.event.clientX,
168
+ //clientY : window.event.clientY,
169
+ //pageY : document.body.scrollTop + window.event.clientY,
170
+ //shiftKey : window.event.shiftKey,
171
+ //stopPropagation : function() { window.event.cancelBubble = true }
172
+ };
173
+ //g_debug.pa(e);
174
+ obj.attachEvent('on' + type,
175
+ function() { listener( e ) } );
176
+ }
177
+ },
178
+
179
+ applyAll : function() {
180
+ var ncs = this.getNiftyCornerRules();
181
+ for (var i=0; i < ncs.length; i++) {
182
+ var nc = ncs[i];
183
+ nc.apply();
184
+ }
185
+ return false;
186
+ },
187
+
188
+ check : function() { // copied from nifty.js
189
+ if (!document.getElementById || !document.createElement)
190
+ return (false);
191
+ var b = navigator.userAgent.toLowerCase();
192
+ if (b.indexOf("msie 5") > 0 && b.indexOf("opera") == -1)
193
+ return (false);
194
+ return (true);
195
+ },
196
+
197
+ getNiftyCornerRules : function() {
198
+ var ar = [];
199
+ var rules = document.getCssRules();
200
+ // if (0 < rules.length) { // Thanks to puggy
201
+ for (var i=0; i < rules.length; i++) {
202
+ var rule = rules[i];
203
+ var selt = rule.selectorText;
204
+ var sel = String(selt).toLowerCase();
205
+
206
+ var style = rule.style;
207
+ var bg = style.backgroundColor;
208
+
209
+ var nc;
210
+ var done = false;
211
+
212
+ // for IE
213
+ nc = style["moz-border-radius"];
214
+ if (nc) {
215
+ var border = style.borderColor;
216
+ var obj = new NiftyCornerRule("both", sel, bg, border, nc);
217
+ ar.push(obj);
218
+ done = true;
219
+ }
220
+
221
+ if (!done) {
222
+ nc = style["moz-border-radius-topleft"];
223
+ if (nc) {
224
+ var border = style.borderTopColor;
225
+ var obj = new NiftyCornerRule("top", sel, bg, border, nc);
226
+ ar.push(obj);
227
+ done = true;
228
+ }
229
+ }
230
+
231
+ if (!done) {
232
+ nc = style["moz-border-radius-bottomleft"];
233
+ if (nc) {
234
+ var border = style.borderBottomColor;
235
+ var obj = new NiftyCornerRule("bottom", sel, bg, border, nc);
236
+ ar.push(obj);
237
+ done = true;
238
+ }
239
+ }
240
+
241
+ // for FireFox
242
+ if (!done) {
243
+ nc = style.MozBorderRadiusTopleft;
244
+ if (nc) {
245
+ var border = style.borderTopColor;
246
+ var obj = new NiftyCornerRule("top", sel, bg, border, nc);
247
+ ar.push(obj);
248
+ }
249
+
250
+ nc = style.MozBorderRadiusBottomleft;
251
+ if (nc) {
252
+ var border = style.borderBottomColor;
253
+ var obj = new NiftyCornerRule("bottom", sel, bg, border, nc);
254
+ ar.push(obj);
255
+ }
256
+ }
257
+ }
258
+ //}
259
+ return ar;
260
+ }
261
+ }
262
+
263
+ if (typeof g_niftypp == 'undefined') {
264
+ var g_niftypp = new NiftyPP();
265
+ var proc = function() {
266
+ g_niftypp.init();
267
+ }
268
+ window.onload = proc;
269
+ //g_niftypp.addEventListener(window, 'load', proc);
270
+ }
271
+
272
+ // end.