• R/O
  • SSH
  • HTTPS

opensourcelms: Commit


Commit MetaInfo

Revision12 (tree)
Time2011-09-09 22:19:23
Authortaku-harada

Log Message

デバック用にieerbugを導入しました。
TestSuiteのAPI,DMI,DMBまでテストに通るように修正しました。

Change Summary

Incremental Difference

--- trunk/SCORM2004_Engine/sce/scripts/ieerbug/ieerbug.html (nonexistent)
+++ trunk/SCORM2004_Engine/sce/scripts/ieerbug/ieerbug.html (revision 12)
@@ -0,0 +1,17 @@
1+<html>
2+<head>
3+<link rel="stylesheet" type="text/css" href="console.css" />
4+</head>
5+<body scroll="no">
6+ <div id="IEerBug">
7+ <div id="title">
8+ <div style="float:left"><span class="tab selected" id="fbTab-console">Console</span><span class="tab" id="fbTab-inspector">DOM</span></div>
9+ <div style="float:right"><span id="cmd_clearConsole">Clear</span> | <span>Fold</span> | <span>Close</span></div>
10+ </div>
11+
12+ <div id="body"></div>
13+
14+ <div id="status"><div id="resize"></div></div>
15+ </div>
16+</body>
17+</html>
\ No newline at end of file
--- trunk/SCORM2004_Engine/sce/scripts/ieerbug/console.css (nonexistent)
+++ trunk/SCORM2004_Engine/sce/scripts/ieerbug/console.css (revision 12)
@@ -0,0 +1,483 @@
1+body{
2+ margin: 0;
3+ padding: 0;
4+ overflow: hidden;
5+ font-size: 12px;
6+}
7+
8+td{
9+ font-size: 12px;
10+}
11+
12+#IEerBug {
13+ border : 1px solid #999;
14+}
15+
16+#title span{
17+ cursor: pointer;
18+}
19+#title span.disabled{
20+ cursor: move;
21+ color: #999;
22+}
23+
24+
25+#title{
26+ background : #ccc;
27+ width : 100%;
28+ top: 0px;
29+ left: 0px;
30+ height: 18px;
31+ border-top: 1px solid white;
32+ border-bottom: 1px solid #666;
33+ cursor: move;
34+}
35+
36+#title .tab{
37+ display: block;
38+ float: left;
39+ border: 1px solid #999;
40+ border-bottom: 0;
41+ margin: 2px 3px 0;
42+ padding: 0 2px;
43+ background: #ccc;
44+}
45+
46+#title .selected{
47+ background: white;
48+}
49+
50+#title .IEerBug_control{
51+ color: #666;
52+}
53+
54+#body{
55+ clear : both;
56+ overflow-y : scroll;
57+ background: white;
58+}
59+
60+#status{
61+ background: #ccc;
62+}
63+
64+#resize{
65+ width: 14px;
66+ height: 14px;
67+ cursor: nw-resize;
68+ float: right;
69+ background: url('resizehandle.gif');
70+}
71+
72+/* ieerbug */
73+.contextNode{
74+ width: 100%;
75+}
76+
77+/*****************************************************************************************/
78+.logRow {
79+ position: relative;
80+ margin: 0;
81+ border-bottom: 1px solid #BEBEBE;
82+ padding: 4px 4px 2px 6px;
83+ background-color: #FFFFFF;
84+}
85+
86+.logExtra {
87+ margin: 0;
88+ padding: 4px 8px;
89+ overflow-x: auto;
90+}
91+
92+.objectLink {
93+ text-decoration: none;
94+}
95+
96+.objectLink:hover {
97+ cursor: pointer;
98+ text-decoration: underline;
99+}
100+
101+/*****************************************************************************************/
102+
103+.logRow-info,
104+.logRow-warn,
105+.logRow-error,
106+.logRow-assert,
107+.logRow-consoleWarning,
108+.logRow-consoleError {
109+ padding: 4px 0 2px 24px;
110+ background-repeat: no-repeat;
111+ background-position: 4px 4px;
112+}
113+
114+.logRow-info,
115+.logRow-info .objectLink-sourceLink {
116+ background-color: #FFFFFF;
117+}
118+
119+.logRow-warn,
120+.logRow-consoleWarning,
121+.logRow-warn .objectLink-sourceLink,
122+.logRow-consoleWarning .objectLink-sourceLink {
123+ background-color: cyan;
124+}
125+
126+.logRow-error,
127+.logRow-assert,
128+.logRow-consoleError,
129+.logRow-error .objectLink-sourceLink,
130+.logRow-consoleError .objectLink-sourceLink {
131+ background-color: LightYellow;
132+}
133+
134+.logRow-error,
135+.logRow-assert,
136+.logRow-consoleError {
137+ color: #FF0000;
138+}
139+
140+.logRow-info {
141+ background-image: url(infoIcon.gif);
142+}
143+
144+.logRow-warn,
145+.logRow-consoleWarning {
146+ background-image: url(warningIcon.gif);
147+}
148+
149+.logRow-error,
150+.logRow-assert,
151+.logRow-consoleError {
152+ background-image: url(errorIcon.gif);
153+}
154+
155+.stackFrame .objectLink-sourceLink,
156+.logRow-sourceLink .objectLink-sourceLink {
157+ position: absolute;
158+ right: 4px;
159+ top: 4px;
160+}
161+
162+.logRow-assert > .row2 {
163+ margin: 4px 0 0 20px;
164+}
165+
166+.errorSource {
167+ margin: 4px 0 0 20px;
168+ font-family: Monaco, monospace;
169+ color: DarkGreen;
170+}
171+
172+.logRow-command {
173+ color: #0000FF;
174+}
175+
176+/*****************************************************************************************/
177+
178+.logRow-stackTrace {
179+ padding-top: 0;
180+ background: #F5F5F5;
181+}
182+
183+.errorStack {
184+ margin-bottom: 2px;
185+}
186+
187+.stackFrame {
188+ position: relative;
189+ padding-top: 4px;
190+}
191+
192+.stackFunctionName {
193+ font-weight: bold;
194+ margin-right: 10px;
195+}
196+
197+/*****************************************************************************************/
198+
199+.objectBox-text,
200+.objectBox-string,
201+.objectBox-number,
202+.objectLink-element,
203+.objectLink-textNode,
204+.objectBox-function {
205+ font-family: Monaco, monospace;
206+}
207+
208+.objectBox-text,
209+.objectBox-string,
210+.objectLink-textNode {
211+ white-space: pre;
212+}
213+
214+.objectBox-number,
215+.objectBox-element,
216+.objectLink-styleRule,
217+.objectLink-element {
218+ color: #000088;
219+}
220+
221+.objectBox-string,
222+.objectLink-textNode {
223+ color: #FF0000;
224+}
225+
226+.objectLink-object,
227+.objectLink-event,
228+.objectLink-document {
229+ font-family: Lucida Grande, sans-serif;
230+ font-weight: bold;
231+}
232+
233+.objectLink-object,
234+.objectLink-document,
235+.objectLink-event,
236+.objectBox-function {
237+ color: DarkGreen;
238+}
239+
240+.objectBox-null,
241+.objectBox-undefined {
242+ padding: 1px 2px;
243+ border: 1px solid #666666;
244+ background-color: #888888;
245+ color: #FFFFFF;
246+}
247+
248+.objectLink-sourceLink {
249+ color: #0000FF;
250+ font-weight: bold;
251+}
252+
253+/*****************************************************************************************/
254+
255+.contextNode.searching .logRow {
256+ display: none;
257+}
258+
259+.logRow.matched {
260+ display: block !important;
261+}
262+
263+.logRow.matching {
264+ position: absolute;
265+ left: -1000px;
266+ top: -1000px;
267+ max-width: 0;
268+ max-height: 0;
269+ overflow: hidden;
270+}
271+
272+/*****************************************************************************************/
273+
274+.arrayItem {
275+ position: relative;
276+ padding-left: 4px;
277+}
278+
279+.arrayLeftBracket,
280+.arrayRightBracket,
281+.arrayComma {
282+ font-family: Monaco, monospace;
283+}
284+
285+.arrayLeftBracket,
286+.arrayRightBracket {
287+ font-weight: bold;
288+}
289+
290+.arrayRightBracket {
291+ margin-left: 4px;
292+}
293+
294+/*****************************************************************************************/
295+
296+.eventInfo {
297+ margin-left: 10px;
298+ font-family: Lucida Grande, sans-serif;
299+}
300+
301+/*****************************************************************************************/
302+
303+.logRow-xhr {
304+ padding-left: 20px;
305+ background: #F5F5F5 no-repeat 4px 3px;
306+}
307+
308+.objectLink-xhr {
309+ color: #444444;
310+}
311+
312+.objectLink-xhr:hover {
313+ color: #0000FF;
314+}
315+
316+.XHRSpyLinks {
317+ position: relative;
318+ margin-top: 10px;
319+}
320+
321+.XHRSpyTitle {
322+ position: relative;
323+ padding: 4px 4px 1px 4px;
324+ border: 1px solid transparent;
325+ border-bottom: none;
326+ font-weight: bold;
327+ color: #666666;
328+}
329+
330+.XHRSpyTitle:hover {
331+ cursor: pointer;
332+}
333+
334+.XHRSpyTitle[selected="true"] {
335+ cursor: default !important;
336+ border-color: #BEBEBE;
337+ -moz-border-radius: 4px 4px 0 0;
338+ background-color: #FFFFFF;
339+}
340+
341+.logRow-xhr.loading .XHRSpyResponseText,
342+.logRow-xhr.loading .XHRSpyHeadersText {
343+ font-style: italic;
344+ color: #888888;
345+}
346+
347+.logRow-xhr.loading {
348+ background-image: url(chrome://global/skin/icons/loading_16.gif);
349+}
350+
351+.logRow-xhr.loaded .objectLink-xhr {
352+ padding-left: 0;
353+}
354+
355+.logRow-xhr.error .objectLink-xhr {
356+ padding-left: 0;
357+ color: red;
358+}
359+
360+.XHRSpyText {
361+ display: none;
362+ margin: 0;
363+ border: 1px solid #BEBEBE;
364+ padding: 8px;
365+ background-color: #FFFFFF;
366+ font-family: Monaco, monospace;
367+ overflow-x: auto;
368+}
369+
370+.XHRSpyText[selected="true"] {
371+ display: block;
372+}
373+
374+/*****************************************************************************************/
375+
376+.propertyLabel {
377+ padding-left: 20px;
378+ font-weight: bold;
379+ width: 200px;
380+ -moz-user-select: none;
381+ /* ieerbug */
382+ overflow: hidden;
383+}
384+
385+.propertyContainerLabel {
386+ padding-left: 0;
387+}
388+
389+.propertyContainerName:hover {
390+ cursor: pointer;
391+ color: #0000FF;
392+ text-decoration: underline;
393+}
394+
395+.propertyValue {
396+ vertical-align: top;
397+ font-family: Monaco, monospace;
398+ /* ieerbug */
399+ white-space: nowrap;
400+}
401+
402+.propertyChildBox {
403+ padding-left: 20px;
404+}
405+
406+.contextNode[showFunctions="false"] .propertyRow-function {
407+ display: none;
408+}
409+
410+.contextNode[showConstants="false"] .propertyRow-constant {
411+ display: none;
412+}
413+
414+/*****************************************************************************************/
415+
416+.editor {
417+ outline: none !important;
418+ border: 1px solid red !important;
419+ padding: 0;
420+ margin: 0;
421+ min-width: 220px;
422+ background: LightYellow;
423+}
424+
425+.twisty{
426+ float: left;
427+ margin: 2px 4px 2px 4px;
428+ width: 12px;
429+ height: 14px;
430+ background: url(twistyClosed.gif);
431+}
432+
433+.twisty.open {
434+ background: url(twistyOpen.gif);
435+}
436+
437+.disclosure {
438+ display: none;
439+ margin-left: 20px;
440+}
441+
442+/*.disclosure.open {
443+ display: block;
444+}*/
445+
446+/*****************************************************************************************/
447+.nodeTag {
448+ -moz-user-select:none;
449+ color: blue;
450+}
451+
452+.nodeAttr {
453+ color: red;
454+ font-weight: normal;
455+}
456+
457+
458+/*****************************************************************************************/
459+
460+.sourceRow {
461+ font-family: Monaco, monospace;
462+ font-size: 11px;
463+}
464+
465+.sourceLine {
466+ cursor: pointer;
467+ -moz-user-select: none;
468+ margin-right: 10px;
469+ border-bottom: 1px solid #EEEEEE;
470+ border-right: 1px solid #CCCCCC;
471+ padding: 0px 4px 0 20px;
472+ background-color: #EEEEEE;
473+ color: #888888;
474+ white-space: pre;
475+}
476+
477+.sourceLine:hover {
478+ color: #0000FF;
479+}
480+
481+.sourceRowText {
482+ white-space: pre;
483+}
--- trunk/SCORM2004_Engine/sce/scripts/ieerbug/nilbug.js (nonexistent)
+++ trunk/SCORM2004_Engine/sce/scripts/ieerbug/nilbug.js (revision 12)
@@ -0,0 +1,144 @@
1+function IEerBug(init){
2+
3+window.console = new NilBugConsole();
4+
5+function NilBugConsole()
6+{
7+ this.firebug = "0.4";
8+
9+ this.logRelay = function()
10+ }
11+
12+ this.log = function()
13+ {
14+ }
15+
16+ this.logMessage = function()
17+ {
18+ }
19+
20+ this.logAssert = function()
21+ {
22+ }
23+
24+ this.debug = function()
25+ {
26+ }
27+
28+ this.info = function()
29+ {
30+ }
31+
32+ this.warn = function()
33+ {
34+ }
35+
36+ this.error = function()
37+ {
38+ }
39+
40+ this.fail = function()
41+ {
42+ }
43+
44+ this.assert = function()
45+ {
46+ }
47+
48+ this.assertEquals = function()
49+ {
50+ }
51+
52+ this.assertNotEquals = function()
53+ {
54+ }
55+
56+ this.assertGreater = function()
57+ {
58+ }
59+
60+ this.assertNotGreater = function()
61+ {
62+ }
63+
64+ this.assertLess = function()
65+ {
66+ }
67+
68+ this.assertNotLess = function()
69+ {
70+ }
71+
72+ this.assertContains = function()
73+ {
74+ }
75+
76+ this.assertNotContains = function()
77+ {
78+ }
79+
80+ this.assertTrue = function()
81+ {
82+ }
83+
84+ this.assertFalse = function()
85+ {
86+ }
87+
88+ this.assertNull = function()
89+ {
90+ }
91+
92+ this.assertNotNull = function()
93+ {
94+ }
95+
96+ this.assertUndefined = function()
97+ {
98+ }
99+
100+ this.assertNotUndefined = function()
101+ {
102+ }
103+
104+ this.assertInstanceOf = function()
105+ {
106+ }
107+
108+ this.assertNotInstanceOf = function()
109+ {
110+ }
111+
112+ this.assertTypeOf = function()
113+ {
114+ }
115+
116+ this.assertNotTypeOf = function()
117+ {
118+ }
119+
120+ this.group = function()
121+ {
122+ }
123+
124+ this.groupEnd = function()
125+ {
126+ }
127+
128+ this.time = function()
129+ {
130+ }
131+
132+ this.timeEnd = function()
133+ {
134+ }
135+
136+ this.count = function()
137+ {
138+ }
139+
140+ this.trace = function()
141+ {
142+ }
143+}
144+}
\ No newline at end of file
--- trunk/SCORM2004_Engine/sce/scripts/ieerbug/ieerbug.js (nonexistent)
+++ trunk/SCORM2004_Engine/sce/scripts/ieerbug/ieerbug.js (revision 12)
@@ -0,0 +1,1886 @@
1+/* ***** BEGIN LICENSE BLOCK *****
2+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
3+ *
4+ * The contents of this file are subject to the Mozilla Public License Version
5+ * 1.1 (the "License"); you may not use this file except in compliance with
6+ * the License. You may obtain a copy of the License at
7+ * http://www.mozilla.org/MPL/
8+ *
9+ * Software distributed under the License is distributed on an "AS IS" basis,
10+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
11+ * for the specific language governing rights and limitations under the
12+ * License.
13+ *
14+ * Portions created by the Initial Developer are Copyright (C) 2005
15+ * the Initial Developer. All Rights Reserved.
16+ *
17+ * Contributor(s):
18+ *
19+ * Alternatively, the contents of this file may be used under the terms of
20+ * either the GNU General Public License Version 2 or later (the "GPL"), or
21+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
22+ * in which case the provisions of the GPL or the LGPL are applicable instead
23+ * of those above. If you wish to allow use of your version of this file only
24+ * under the terms of either the GPL or the LGPL, and not to allow others to
25+ * use your version of this file under the terms of the MPL, indicate your
26+ * decision by deleting the provisions above and replace them with the notice
27+ * and other provisions required by the GPL or the LGPL. If you do not delete
28+ * the provisions above, a recipient may use your version of this file under
29+ * the terms of any one of the MPL, the GPL or the LGPL.
30+ *
31+ * ***** END LICENSE BLOCK ***** */
32+
33+
34+function IEerBug(){
35+if(typeof window.console==="object"){
36+ console.debug("no use ieerbug");
37+ return;
38+}
39+
40+//////////////////////////////////////////////////////////////////////////////////////////////////
41+// setting
42+var pathToScript = "";
43+var scriptParams = {
44+ debug: false,
45+ showJSErrors : true,
46+ stopJSErrors : true,
47+ x : 50, y : 200,
48+ width : 500, height : 250
49+};
50+{
51+ var matches;
52+ var scripts = document.getElementsByTagName("SCRIPT");
53+ for(var i = 0; i < scripts.length; i++){
54+ if(typeof scripts[i].src == "string"){
55+ if(matches = scripts[i].src.match(/^(.*)ieerbug.js(\?.*)?$/)){
56+ pathToScript = matches[1];
57+ if(matches[2] == null) break;
58+
59+ var params = matches[2].substr(1).split("&");
60+ for(var k in params){
61+ if(typeof params[k] != "string" || params[k] == "") continue;
62+ var param = params[k].split("=", 2);
63+
64+ if(param[0] in scriptParams){
65+ switch(typeof scriptParams[param[0]]){
66+ case "number":
67+ scriptParams[param[0]] = parseInt(param[1], 10);
68+ break;
69+
70+ case "boolean":
71+ scriptParams[param[0]] = (param[1].toLowerCase() == "true");
72+ break;
73+ }
74+ }
75+ }
76+ break;
77+ }
78+ }
79+ }
80+}
81+
82+//////////////////////////////////////////////////////////////////////////////////////////////////
83+// set window.console
84+if(window.console && !scriptParams.debug)
85+{
86+ return;
87+}
88+window.console = new FireBugConsole();
89+
90+// set error handler
91+function ScriptError(msg, src, num)
92+{
93+ this.errorMessage = msg;
94+ this.sourceName = src;
95+ this.lineNumber = num;
96+}
97+
98+if(scriptParams.showJSErrors){
99+ window.onerror = function(message, file, num){
100+ var caller = arguments.callee.caller;
101+ //if(caller) caller = caller.caller;
102+
103+ var s = new ScriptError(message, file, num);
104+ s.errorStackTrace = new StackTrace(caller);
105+ console.logRelay(s, "consoleError");
106+ return scriptParams.stopJSErrors;
107+ }
108+}
109+
110+
111+//////////////////////////////////////////////////////////////////////////////////////////////////
112+// console creation
113+function createPopupConsole(){
114+ var win = window.open("", "IEerBug_popup", "width=400, height=350, resizable=yes, scrollbars=yes");
115+ if(win == null){
116+ return null;
117+ }
118+
119+ win.document.open();
120+ win.document.write('<html><head><link rel="stylesheet" type="text/css" href="console.css" /></head><body></body></html>');
121+ win.document.close();
122+ return win.document.body;
123+}
124+
125+function createIframeConsole(){
126+ // library
127+ function copyStyle(elm, css){
128+ if(typeof elm != "object" || !elm.style || typeof css != "object"){
129+ return;
130+ }
131+
132+ for(var name in css){
133+ if(typeof css[name] == "string"){
134+ if(name == "float"){
135+ elm.style[document.all ? "styleFloat" : "cssFloat"] = css[name];
136+ }
137+ else{
138+ elm.style[name] = css[name];
139+ }
140+ }
141+ }
142+ }
143+
144+ function createElm(tagName, css, context){
145+ var e = document.createElement(tagName);
146+ copyStyle(e, css);
147+ if(typeof context == "string" && context != ""){
148+ e.innerHTML = context;
149+ }
150+ return e;
151+ }
152+
153+ function px(p){return p + "px";}
154+
155+ Event_observe = function(element, name, observer, useCapture) {
156+ useCapture = useCapture || false;
157+ if (element.addEventListener) {
158+ element.addEventListener(name, observer, useCapture);
159+ } else if (element.attachEvent) {
160+ element.attachEvent('on' + name, observer);
161+ }
162+ }
163+
164+ Event_stopObserving = function(element, name, observer, useCapture) {
165+ useCapture = useCapture || false;
166+
167+ if (element.removeEventListener) {
168+ element.removeEventListener(name, observer, useCapture);
169+ } else if (element.detachEvent) {
170+ element.detachEvent('on' + name, observer);
171+ }
172+ }
173+
174+ /*** create ***/
175+ // try to append iframe until document.body becomes available
176+ function appendElement(){
177+ if(document && document.body){
178+ document.body.appendChild(iframe);
179+ return;
180+ }
181+ setTimeout(function(){appendElement()}, 100);
182+ }
183+
184+ // register or unregister iframe onload event
185+ function setIframeOnload(elm, onload){
186+ if(!onload) return;
187+
188+ if(elm.addEventListener) {
189+ //elm.addEventListener('load', onload); // Firefox error
190+ elm.onload = function(){
191+ elm.onload = null;
192+ onload();
193+ }
194+ }
195+ else if(elm.attachEvent){ // IE doesn't call onload event
196+ elm.onreadystatechange = function(){
197+ if(elm.readyState == "loaded" || elm.readyState == "complete"){
198+ elm.onreadystatechange = null;
199+ onload();
200+ }
201+ };
202+ }
203+ }
204+
205+ /*** UI ***/
206+ function setPosition(force){
207+ if(!force){
208+ width = width < min_width ? min_width : width;
209+ height = height < min_height ? min_height : height;
210+ }
211+
212+ copyStyle(iframe, {
213+ left: px(x), top: px(y),
214+ width: px(width), height: folded ? px(title_height) : px(height)
215+ });
216+
217+ if(divBody && divStatus){
218+ divBody.style.height = px(height - title_height - status_height);
219+ divBody.style.display = folded ? "none" : "";
220+ divStatus.style.display = folded ? "none" : "";
221+ divStatus.style.height = px(status_height);
222+ }
223+ }
224+
225+ /*** Event ***/
226+ // init iframe event
227+ function setIframeEvent(){
228+ if(doc == null) return;
229+ doc.getElementById("title").onmousedown = mousedownHandler;
230+ doc.getElementById("resize").onmousedown = mousedownHandler;
231+ }
232+
233+ var drag_start_x, drag_start_y;
234+ var param_start_x, param_start_y;
235+ function mousedownHandler(event){
236+ if(!doc || !win) return;
237+
238+ var event = event || win.event
239+ var element = event.target || event.srcElement;
240+
241+ if(element.tagName == "SPAN" && !FireBugUtils.hasClass(element, "disabled")){
242+ switch(element.innerHTML){
243+ case "Clear": FireBug.clearConsole(); break;
244+ case "Fold": folded = !folded; setPosition(); break;
245+ case "Close": iframe.style.display = "none"; break;
246+ case "Console": FireBug.switchMainView("console"); break;
247+ case "DOM": FireBug.switchMainView("inspector"); break;
248+ }
249+ return;
250+ }
251+
252+ drag_start_x = event.pageX || (event.clientX + (doc.documentElement.scrollLeft || doc.body.scrollLeft));
253+ drag_start_y = event.pageY || (event.clientY + (doc.documentElement.scrollTop || doc.body.scrollTop));
254+ drag_start_x += x;
255+ drag_start_y += y;
256+ Event_observe(document, "mousemove", mousemoveHandler);
257+ Event_observe(document, "mouseup", mouseupHandler);
258+ Event_observe(doc, "mousemove", mousemoveHandler);
259+ Event_observe(doc, "mouseup", mouseupHandler);
260+
261+ isHandle = (element == divResize || element.parentNode == divResize);
262+ if(isHandle){
263+ param_start_x = width;
264+ param_start_y = height;
265+ }else{
266+ param_start_x = x;
267+ param_start_y = y;
268+ }
269+ }
270+
271+ function mousemoveHandler(event){
272+ var event = event || window.event
273+ var element = event.target || event.srcElement;
274+
275+ var cur_x = (event.pageX || (event.clientX + (document.documentElement.scrollLeft || document.body.scrollLeft)));
276+ var cur_y = (event.pageY || (event.clientY + (document.documentElement.scrollTop || document.body.scrollTop)));
277+ if(element.ownerDocument == doc){
278+ cur_x += x;
279+ cur_y += y;
280+ }
281+ cur_x -= window.pageXOffset
282+ || document.documentElement.scrollLeft
283+ || document.body.scrollLeft
284+ || 0;
285+ cur_y -= window.pageYOffset
286+ || document.documentElement.scrollTop
287+ || document.body.scrollTop
288+ || 0;
289+
290+ if(isHandle){
291+ width = cur_x - drag_start_x + param_start_x;
292+ height = cur_y - drag_start_y + param_start_y;
293+ }
294+ else{
295+ x = cur_x - drag_start_x + param_start_x;
296+ y = cur_y - drag_start_y + param_start_y;
297+ }
298+ setPosition();
299+ }
300+
301+ function mouseupHandler(event){
302+ var event = event || window.event
303+ var element = event.target || event.srcElement;
304+
305+ Event_stopObserving(document, "mousemove", mousemoveHandler);
306+ Event_stopObserving(document, "mouseup", mouseupHandler);
307+ Event_stopObserving(doc, "mousemove", mousemoveHandler);
308+ Event_stopObserving(doc, "mouseup", mouseupHandler);
309+ }
310+
311+ // param
312+ var doc = null, win = null;
313+ var divBody, divTitle, divStatus, divResize;
314+ var folded = false;
315+ var x = parseInt(scriptParams.x, 10), y = parseInt(scriptParams.y, 10);
316+ var width = parseInt(scriptParams.width, 10), height = parseInt(scriptParams.height, 10);
317+ var title_height = 22, status_height = 14;
318+ var min_width = 250, min_height = 50;
319+
320+ // main routine
321+ var iframe = createElm("IFRAME", {
322+ position: "absolute",
323+ border: "0px",
324+ left: px(x), top: px(y),
325+ width: px(width), height: px(height)}
326+ );
327+ iframe.frameBorder = "0";
328+
329+ setIframeOnload(iframe, function(){
330+ doc = iframe.contentDocument || iframe.Document;
331+ win = iframe.contentWindow;
332+
333+ divBody = doc.getElementById("body");
334+ divTitle = doc.getElementById("title");
335+ divStatus = doc.getElementById("status");
336+ divResize = doc.getElementById("resize");
337+ if(!divBody || !divTitle || !divStatus || !divResize) return;
338+ Event_observe(window, "unload", function(){
339+ doc = win = divBody = divTitle = divStatus = divResize = null;
340+ });
341+
342+ setPosition();
343+ FireBug.initialize(iframe);
344+ setIframeEvent();
345+ });
346+
347+ iframe.src = pathToScript +"ieerbug.html";
348+ appendElement();
349+}
350+
351+//var div = createPopupConsole();
352+createIframeConsole();
353+
354+
355+//////////////////////////////////////////////////////////////////////////////////////////////////
356+// firebug.js
357+var FireBug =
358+{
359+ contexts: [],
360+
361+ views: {},
362+ viewTypes: {
363+ "console": FireBugConsoleView,
364+ "dom": FireBugDOMView
365+ },
366+
367+ stringCropLength: 100
368+}
369+
370+FireBug.initialize = function(frame)
371+{
372+ this.browser = frame;
373+
374+ this.attach();
375+}
376+
377+FireBug.attach = function()
378+{
379+ for (var viewName in this.viewTypes)
380+ {
381+ var viewType = this.viewTypes[viewName];
382+
383+ var newView = new viewType();
384+ this.views[viewName] = newView;
385+
386+ //newView.optionsMenu = document.getElementById("fbOptionsMenu_" + viewName);
387+ newView.viewName = viewName;
388+
389+ var doc = this.browser.contentDocument || this.browser.Document;
390+ var node = doc.createElement("div");
391+ node.className = "contextNode contextNode-" + viewName;
392+ doc.getElementById("body").appendChild(node);
393+
394+ newView.initialize(this.browser);
395+ newView.contextNode = node;
396+
397+ //for (var i in this.contexts)
398+ // newView.attachContext(this.contexts[i]);
399+ }
400+
401+ this.console = this.views["console"];
402+ this.currentView = this.console;
403+ window.console.flushQueue();
404+}
405+
406+FireBug.showContext = function(view, context)
407+{
408+ view.context = context;
409+ view.contextNode = this.ensureContextNode(view, context);
410+
411+ view.contextNode.style.display = "block";
412+
413+ view.showContext(context);
414+}
415+
416+/**
417+ * Selects an object and displays it in the most appropriate view.
418+ */
419+FireBug.selectObject = function(object, viewName, switchView, keepHistory)
420+{
421+ if (!object)
422+ object = window;
423+
424+ this.selectedObject = object;
425+
426+ // Just update the current view to show the selected object
427+ var view = this.views[viewName];
428+ this.showContext(this.currentView, this.selectedObject);
429+}
430+
431+FireBug.selectView = function(viewName, object, keepHistory)
432+{
433+ // Once you switch to an inspector view, it becomes the default from then on
434+ if (this.isMainViewName(viewName))
435+ this.switchMainView(viewName);
436+
437+ else
438+ {
439+ if (this.currentContext)
440+ this.currentContext.lastInspector = viewName;
441+
442+ this.switchMainView("dom"); // currently, "inspector"->"dom"
443+
444+ this.defaultViewName = viewName;
445+ }
446+
447+ var view = this.views[viewName];
448+ if (!view)
449+ return;
450+
451+ if (this.currentContext)
452+ {
453+ if (this.currentView && this.currentView != view)
454+ {
455+ this.hideContext(this.currentView, this.currentContext);
456+
457+ var viewButton = document.getElementById("fbTab-" + this.currentView.viewName);
458+ if (viewButton)
459+ viewButton.removeAttribute("selected");
460+ }
461+
462+ this.currentContext.view = view;
463+ this.currentView = view;
464+
465+ if (!object)
466+ object = this.currentContext.selectedObject;
467+
468+ if (!keepHistory)
469+ this.updateHistory(object, view.viewName);
470+
471+ this.validateHistory();
472+
473+ this.showContext(view, this.currentContext);
474+
475+ this.updateObjectPath(object);
476+
477+ var viewButton = document.getElementById("fbTab-" + viewName);
478+ viewButton.setAttribute("selected", "true");
479+
480+ var contextNode = this.currentContext.contextNodes[view.viewName];
481+ this.searchBox.value = contextNode && contextNode.searchText ? contextNode.searchText : "";
482+ this.searchBox.disabled = !view.searchable;
483+
484+ this.setOptionsMenu(view.optionsMenu);
485+
486+ this.clearCommand.setAttribute("disabled", !view.clearable);
487+ }
488+}
489+
490+FireBug.switchMainView = function(viewName)
491+{
492+ var doc = this.browser.contentDocument || this.browser.Document;
493+
494+ var tabConsole = doc.getElementById("fbTab-console");
495+ var tabInspector = doc.getElementById("fbTab-inspector");
496+
497+ if (viewName == "console")
498+ {
499+ FireBugUtils.setClass(tabConsole, "selected");
500+ FireBugUtils.removeClass(tabInspector, "selected");
501+
502+ this.views["console"].contextNode.style.display = "block";
503+ this.views["dom"].contextNode.style.display = "none";
504+
505+ this.currentView = this.views["console"];
506+ FireBugUtils.removeClass(doc.getElementById("cmd_clearConsole"), "disabled");
507+ }
508+ else if (viewName == "inspector")
509+ {
510+ FireBugUtils.removeClass(tabConsole, "selected");
511+ FireBugUtils.setClass(tabInspector, "selected");
512+
513+ this.views["console"].contextNode.style.display = "none";
514+ this.views["dom"].contextNode.style.display = "block";
515+
516+ this.currentView = this.views["dom"];
517+ FireBugUtils.setClass(doc.getElementById("cmd_clearConsole"), "disabled");
518+ }
519+}
520+
521+FireBug.isMainViewName = function(viewName)
522+{
523+ return viewName == "console" || viewName == "js";
524+}
525+
526+FireBug.clearConsole = function()
527+{
528+ this.currentView.clear();
529+}
530+
531+
532+/**
533+ * Called when an object link is clicked.
534+ */
535+FireBug.browseObject = function(object)
536+{
537+ var view = this.views["dom"];
538+ this.switchMainView("inspector");
539+ view.inspect(object);
540+}
541+
542+//
543+function SourceLink(href, line)
544+{
545+ this.href = href;
546+ this.line = line;
547+}
548+
549+function StackTrace(frame)
550+{
551+ this.frames = [];
552+
553+ // IEerBug:
554+ function getFuncName(f){
555+ if(!f){
556+ return "null";
557+ }
558+
559+ var s;
560+ try{
561+ s = ("" + f).match(/function (\w*)/)[1];
562+ }
563+ catch(e){}
564+ return (s == null || s.length == 0) ? "[anonymous]" : s;
565+ }
566+
567+ // IEerBug: get stack trace using arguments.callee
568+ var i = 0;
569+ for (; frame; frame = frame.caller)
570+ {
571+ this.frames.push({
572+ functionName: getFuncName(frame),
573+ fileName: null,
574+ line: null
575+ });
576+ i++;
577+
578+ if(i > 50) break;
579+ }
580+
581+ // IEerBug: toplevel null function must be added
582+ if(this.frames.length == 0){
583+ this.frames.push({functionName: "null", fileName : null, line : null});
584+ }
585+}
586+
587+
588+//////////////////////////////////////////////////////////////////////////////////////////////////
589+// consoleAPI.js
590+function FireBugConsole()
591+{
592+ this.firebug = "0.4";
593+ var context = null; // context is not implemented in IEerBug... by nitoyon
594+ var queue = [];
595+ var timeCounters;
596+ var frameCounters;
597+
598+ // ieerbug : Until FireBug.console is defined, stock the arguments to queue.
599+ this.flushQueue = function(){
600+ if(queue){
601+ for(var i = 0; i < queue.length; i++){
602+ var q = queue[i];
603+ FireBug.console.log(q[0], q[1], q[2], q[3]);
604+ }
605+ queue = null;
606+ }
607+ }
608+
609+ this.logRelay = function(args, rowClass, rowFunc, context){
610+ if(typeof FireBug == "object" && FireBug.console){
611+ if(queue){
612+ this.flushQueue();
613+ }
614+
615+ FireBug.console.log(args, rowClass, rowFunc, context);
616+ }
617+ else{
618+ queue.push(arguments);
619+ }
620+ }
621+
622+ this.log = function()
623+ {
624+ this.logRelay(arguments, "log", FireBug_logFormattedRow);
625+ }
626+
627+ this.logMessage = function(messages, rowClass, showLine)
628+ {
629+ this.logRelay(messages, rowClass, FireBug_logFormattedRows, context, showLine);
630+ }
631+
632+ this.logAssert = function(messages, caption)
633+ {
634+ //FireBug.increaseErrorCount(context);
635+
636+ if (!messages || !messages.length)
637+ messages = ["Assertion Failure"];
638+
639+ this.logRelay([messages, caption], "assert", FireBug_logFormattedRows, context, true);
640+
641+ /* ieerbug : comment out
642+ if (win && typeof(win.onassert) == "function")
643+ {
644+ // XXXjoe Convert args to a string
645+ win.onassert(message, caption);
646+ }*/
647+ }
648+
649+ this.debug = function()
650+ {
651+ this.logRelay(arguments, "debug", FireBug_logFormattedRow, context, true);
652+ }
653+
654+ this.info = function()
655+ {
656+ this.logRelay(arguments, "info", FireBug_logFormattedRow, context, true);
657+ }
658+
659+ this.warn = function()
660+ {
661+ this.logRelay(arguments, "warn", FireBug_logFormattedRow, context, true);
662+ }
663+
664+ this.error = function()
665+ {
666+ //FireBug.increaseErrorCount(context);
667+ this.logRelay(arguments, "error", FireBug_logFormattedRow, context, true);
668+ }
669+
670+ this.fail = function()
671+ {
672+ this.logAssert(arguments, null);
673+ }
674+
675+ this.assert = function(x)
676+ {
677+ if (!x)
678+ this.logAssert(sliceArray(arguments, 1), ["%o", x]);
679+ }
680+
681+ this.assertEquals = function(x, y)
682+ {
683+ if (x != y)
684+ this.logAssert(sliceArray(arguments, 2), ["%o != %o", x, y]);
685+ }
686+
687+ this.assertNotEquals = function(x, y)
688+ {
689+ if (x == y)
690+ this.logAssert(sliceArray(arguments, 2), ["%o == %o", x, y]);
691+ }
692+
693+ this.assertGreater = function(x, y)
694+ {
695+ if (x <= y)
696+ this.logAssert(sliceArray(arguments, 2), ["%o <= %o", x, y]);
697+ }
698+
699+ this.assertNotGreater = function(x, y)
700+ {
701+ if (!(x > y))
702+ this.logAssert(sliceArray(arguments, 2), ["!(%o > %o)", x, y]);
703+ }
704+
705+ this.assertLess = function(x, y)
706+ {
707+ if (x >= y)
708+ this.logAssert(sliceArray(arguments, 2), ["%o >= %o", x, y]);
709+ }
710+
711+ this.assertNotLess = function(x, y)
712+ {
713+ if (!(x < y))
714+ this.logAssert(sliceArray(arguments, 2), ["!(%o < %o)", x, y]);
715+ }
716+
717+ this.assertContains = function(x, y)
718+ {
719+ if (!(x in y))
720+ this.logAssert(sliceArray(arguments, 2), ["!(%o in %o)", x, y]);
721+ }
722+
723+ this.assertNotContains = function(x, y)
724+ {
725+ if (x in y)
726+ this.logAssert(sliceArray(arguments, 2), ["%o in %o", x, y]);
727+ }
728+
729+ this.assertTrue = function(x)
730+ {
731+ this.assertEquals(x, true);
732+ }
733+
734+ this.assertFalse = function(x)
735+ {
736+ this.assertEquals(x, false);
737+ }
738+
739+ this.assertNull = function(x)
740+ {
741+ this.assertEquals(x, null);
742+ }
743+
744+ this.assertNotNull = function(x)
745+ {
746+ this.assertNotEquals(x, null);
747+ }
748+
749+ this.assertUndefined = function(x)
750+ {
751+ this.assertEquals(x, undefined);
752+ }
753+
754+ this.assertNotUndefined = function(x)
755+ {
756+ this.assertNotEquals(x, undefined);
757+ }
758+
759+ this.assertInstanceOf = function(x, y)
760+ {
761+ if (!(x instanceof y))
762+ this.logAssert(sliceArray(arguments, 2), ["!(%o instanceof %o)", x, y]);
763+ }
764+
765+ this.assertNotInstanceOf = function(x, y)
766+ {
767+ if (x instanceof y)
768+ this.logAssert(sliceArray(arguments, 2), ["%o instanceof %o", x, y]);
769+ }
770+
771+ this.assertTypeOf = function(x, y)
772+ {
773+ if (typeof(x) != y)
774+ this.logAssert(sliceArray(arguments, 2), ["typeof(%o) != %o", x, y]);
775+ }
776+
777+ this.assertNotTypeOf = function(x)
778+ {
779+ if (typeof(x) == y)
780+ this.logAssert(sliceArray(arguments, 2), ["typeof(%o) == %o", x, y]);
781+ }
782+
783+ this.group = function(name)
784+ {
785+ }
786+
787+ this.groupEnd = function(name)
788+ {
789+ }
790+
791+ this.time = function(name, reset)
792+ {
793+ if (!name)
794+ return;
795+
796+ var time = new Date().getTime();
797+
798+ if (!timeCounters)
799+ timeCounters = {};
800+
801+ if (!reset && name in timeCounters)
802+ return;
803+
804+ timeCounters[name] = time;
805+ }
806+
807+ this.timeEnd = function(name)
808+ {
809+ var time = new Date().getTime();
810+
811+ if (!timeCounters)
812+ return;
813+
814+ var timeCounter = timeCounters[name];
815+ if (timeCounter)
816+ {
817+ var diff = time - timeCounter;
818+ var label = name + ": " + diff + "ms";
819+ FireBug.console.log(label, "log", FireBug_logTextRow, context, true, true);
820+
821+ delete timeCounters[name];
822+ }
823+ }
824+
825+ this.count = function(key)
826+ {
827+ var frameId = ""; // ieerbug
828+ //var frameId = FireBugUtils.getStackFrameId();
829+ //if (frameId)
830+ {
831+ if (!frameCounters)
832+ frameCounters = {};
833+
834+ if (key != undefined)
835+ frameId += key;
836+
837+ var frameCounter = frameCounters[frameId];
838+ if (!frameCounter)
839+ {
840+ var logRow = FireBug.console.log("", "count", FireBug_logTextRow, context,
841+ true, true);
842+
843+ frameCounter = {logRow: logRow, count: 1};
844+ frameCounters[frameId] = frameCounter;
845+ }
846+ else
847+ ++frameCounter.count;
848+
849+ var label = key == undefined
850+ ? frameCounter.count
851+ : key + " " + frameCounter.count;
852+
853+ frameCounter.logRow.firstChild.firstChild.nodeValue = label;
854+ }
855+ }
856+
857+ this.trace = function()
858+ {
859+ var trace = new StackTrace(arguments.callee.caller);
860+ FireBug.console.log(trace, "stackTrace", FireBug_logObjectRow, context);
861+ }
862+}
863+
864+//////////////////////////////////////////////////////////////////////////////////////////////////
865+// console.js
866+function FireBugConsoleView()
867+{
868+}
869+
870+FireBugConsoleView.prototype.initialize = function(browser)
871+{
872+ this.browser = browser
873+}
874+
875+FireBugConsoleView.prototype.log = function(args, rowClass, rowFunc, context){
876+ var logRow = this.createLogRow(rowClass);
877+
878+ if (!rowFunc)
879+ rowFunc = FireBug_logObjectRow;
880+
881+ var canceled = rowFunc.apply(this, [args, logRow, context]);
882+ if(canceled) return null;
883+
884+ this.appendLogRow(logRow);
885+ return logRow;
886+}
887+
888+FireBugConsoleView.prototype.clearable = true;
889+
890+FireBugConsoleView.prototype.clear = function()
891+{
892+ if (this.contextNode)
893+ FireBugUtils.clearNode(this.contextNode);
894+}
895+
896+FireBugConsoleView.prototype.createLogRow = function(rowClass){
897+ var logDocument = this.browser.contentDocument || this.browser.Document;
898+
899+ var div = logDocument.createElement("div");
900+ div.className = "logRow logRow-" + rowClass;
901+ return div;
902+}
903+
904+FireBugConsoleView.prototype.appendLogRow = function(logRow){
905+ this.contextNode.appendChild(logRow);
906+ logRow.scrollIntoView();
907+}
908+
909+//////////////////////////////////////////////////////////////////////////////////////////////////
910+// dom.js
911+function FireBugDOMView() {}
912+
913+FireBugDOMView.prototype.initialize = function(browser)
914+{
915+ this.browser = browser
916+}
917+
918+FireBugDOMView.prototype.inspect = function(object)
919+{
920+ if (object == this.contextNode.latestObject)
921+ return;
922+
923+ FireBugUtils.clearNode(this.contextNode);
924+
925+ this.contextNode.latestObject = object;
926+
927+ FireBug_logDOM(object, this.contextNode);
928+}
929+
930+
931+//////////////////////////////////////////////////////////////////////////////////////////////////
932+// loggers.js
933+FireBug_objectFormatMap =
934+{
935+ "text": FireBug_logText,
936+ "undefined": FireBug_logUndefined,
937+ "null": FireBug_logNull,
938+ "number": FireBug_logPrimitive,
939+ "string": FireBug_logString,
940+ "element": FireBug_logElement,
941+ "document": FireBug_logDocument,
942+ "textNode": FireBug_logTextNode,
943+ "object": FireBug_logObject,
944+ "array": FireBug_logArray,
945+ "consoleError": FireBug_logConsoleError,
946+ "function": FireBug_logFunction,
947+ "sourceLink": FireBug_logSourceLink,
948+ "stackTrace": FireBug_logStackTrace
949+};
950+
951+FireBug_appendObject = function(object, logRow, precision, partial)
952+{
953+ var format;
954+ try
955+ {
956+ format = FireBug_getFormatForObject(object);
957+ }
958+ catch (exc)
959+ {
960+ format = FireBug_defaultObjectFormat;
961+ }
962+
963+ var formatter = FireBug_objectFormatMap[format];
964+ formatter.apply(this, [object, logRow, precision, partial]);
965+}
966+
967+FireBug_getFormatForObject = function(object)
968+{
969+ var type = typeof(object);
970+
971+ if (type == "undefined")
972+ return "undefined";
973+
974+ else if (object == null)
975+ return "null";
976+
977+ else if (type == "object")
978+ {
979+ // Cross-browser class check (IE doesn't support "object instanceof Window") by nitoyon
980+ if(object instanceof ScriptError){
981+ return "consoleError";
982+ }
983+
984+ if ("innerHTML" in object && typeof(object.innerHTML) == "string"
985+ && "tagName" in object && typeof(object.tagName) == "string"
986+ && "attributes" in object && typeof(object.attributes) == "object"
987+ && "length" in object.attributes && typeof(object.attributes.length) == "number")
988+ return "element";
989+ else if ("location" in object && typeof(object.location) == "object"
990+ && "write" in object && "writeln" in object && "open" in object && "close" in object)
991+ return "document";
992+ else if ("setTimeout" in object && "setInterval" in object && "history" in object)
993+ return "object";
994+ else if ("nodeType" in object && typeof(object.nodeType) == "number"
995+ && object.nodeType == 3) // TEXT_NODE
996+ return "textNode";
997+ else if ("length" in object && typeof(object.length) == "number")
998+ return "array";
999+ else if (object instanceof SourceLink)
1000+ return "sourceLink";
1001+ else if (object instanceof StackTrace)
1002+ return "stackTrace";
1003+ return "object";
1004+ }
1005+ else if (type == "function")
1006+ return "function";
1007+
1008+ else if (type == "number" || type == "boolean")
1009+ return "number";
1010+
1011+ else if (type == "string")
1012+ return "string";
1013+
1014+ else
1015+ return "object";
1016+}
1017+
1018+// Row Loggers
1019+function FireBug_logFormattedRow(objects, logRow, context){
1020+ FireBug_appendFormatted(objects, logRow);
1021+}
1022+
1023+function FireBug_logFormattedRows(objects, logRow, context)
1024+{
1025+ for (var i = 0; i < objects.length; ++i)
1026+ {
1027+ if (objects[i])
1028+ {
1029+ var objectRow = logRow.ownerDocument.createElement("div");
1030+ objectRow.className = "row" + (i+1);
1031+ FireBug_appendFormatted(objects[i], objectRow);
1032+ logRow.appendChild(objectRow);
1033+ }
1034+ }
1035+}
1036+
1037+FireBug_appendFormatted = function(objects, logRow)
1038+{
1039+ if (!objects || !objects.length)
1040+ return;
1041+
1042+ var format = objects[0];
1043+ var objIndex = 0;
1044+ if (typeof(format) != "string"){
1045+ format = "";
1046+ objIndex = -1;
1047+ }
1048+
1049+ var formatParts = FireBug_parseFormat(format);
1050+ for (var i = 0; i < formatParts.length; ++i){
1051+ var formatPart = formatParts[i];
1052+ if (formatPart && typeof(formatPart) == "object"){
1053+ var object = objects[++objIndex];
1054+ formatPart.func.apply(this, [object, logRow, formatPart.precision]);
1055+ }
1056+ else
1057+ FireBug_logText(formatPart, logRow);
1058+ }
1059+
1060+ for (var i = objIndex+1; i < objects.length; ++i)
1061+ {
1062+ FireBug_logText(" ", logRow);
1063+ FireBug_appendObject(objects[i], logRow, 0, false);
1064+ }
1065+}
1066+
1067+// Object Loggers
1068+function FireBug_logAnything(object, logRow, precision, partial)
1069+{
1070+ if (!precision || partial)
1071+ FireBug_appendObject(object, logRow, precision, partial);
1072+ else if (precision == -1)
1073+ FireBug_logKeys(object, logRow);
1074+ else
1075+ FireBug_logDOM(object, logRow, precision, partial);
1076+}
1077+
1078+function FireBug_logNull(value, logRow, precision, partial)
1079+{
1080+ var doc = logRow.ownerDocument;
1081+
1082+ var objectBox = FireBugUtils.createObjectSpan(doc, value, "null");
1083+ logRow.appendChild(objectBox);
1084+}
1085+
1086+function FireBug_logUndefined(value, logRow, precision, partial)
1087+{
1088+ var doc = logRow.ownerDocument;
1089+
1090+ var objectBox = FireBugUtils.createObjectSpan(doc, value, "undefined");
1091+ logRow.appendChild(objectBox);
1092+}
1093+
1094+FireBug_parseFormat = function(format)
1095+{
1096+ var formatParts = [];
1097+
1098+ var reg = /((^%|[^\\]%)(\d+)?(\.)([a-zA-Z]))|((^%|[^\\]%)([a-zA-Z]))/;
1099+ var index = 0;
1100+
1101+ for (var m = reg.exec(format); m; m = reg.exec(format))
1102+ {
1103+ var type = m[8] ? m[8] : m[5];
1104+ var precision = m[3] ? parseInt(m[3]) : (m[4] == "." ? -1 : 0);
1105+
1106+ var func = null;
1107+ switch (type)
1108+ {
1109+ case "s":
1110+ func = FireBug_logText;
1111+ break;
1112+ case "f":
1113+ case "i":
1114+ case "d":
1115+ func = FireBug_logPrimitive;
1116+ break;
1117+ case "o":
1118+ func = FireBug_logAnything;
1119+ break;
1120+ //case "x":
1121+ // func = FireBug_logElementFull;
1122+ break;
1123+ }
1124+ // fixed: escape unicode character.
1125+ if (func) {
1126+ formatParts.push(format.substr(0, m[0].charAt(0) == "%" ? m.index : m.index+1)); // m[0][0] -> m[0].charAt(0) by nitoyon
1127+ formatParts.push({func: func, precision: precision});
1128+ }
1129+ format = format.substr(m.index+m[0].length);
1130+ }
1131+
1132+ formatParts.push(format);
1133+
1134+ return formatParts;
1135+}
1136+
1137+function FireBug_logText(value, logRow, precision, partial){
1138+ var doc = logRow.ownerDocument;
1139+
1140+ var objectBox = FireBugUtils.createObjectSpan(doc, value, value, "text");
1141+ logRow.appendChild(objectBox);
1142+}
1143+
1144+function FireBug_logPrimitive(value, logRow, precision, partial){
1145+ var doc = logRow.ownerDocument;
1146+
1147+ var objectBox = FireBugUtils.createObjectSpan(doc, value, value);
1148+ logRow.appendChild(objectBox);
1149+}
1150+
1151+function FireBug_logString(value, logRow, precision, partial)
1152+{
1153+ var doc = logRow.ownerDocument;
1154+
1155+ if (partial)
1156+ {
1157+ if (value.length >= FireBug.stringCropLength)
1158+ value = value.substr(0, FireBug.stringCropLength) + "...";
1159+
1160+ value = FireBugUtils.escapeNewLines(value);
1161+ }
1162+
1163+ value = '"' + value + '"';
1164+
1165+ var objectBox = FireBugUtils.createObjectSpan(doc, value, value);
1166+ logRow.appendChild(objectBox);
1167+}
1168+
1169+// Row Loggers
1170+function FireBug_logTextRow(object, logRow, context)
1171+{
1172+ FireBug_logText(object, logRow);
1173+}
1174+
1175+function FireBug_logObjectRow(object, logRow, context)
1176+{
1177+ FireBug_appendObject(object, logRow, 0, false);
1178+}
1179+
1180+// Object Loggers
1181+function FireBug_logObject(object, logRow, precision, partial)
1182+{
1183+ if (!precision || partial)
1184+ {
1185+ var caption = FireBug.getObjectTitle(object);
1186+
1187+ var logLink = withDocument(logRow.ownerDocument, function() {
1188+ return FireBugUtils.createObjectLink(object, caption);
1189+ });
1190+ logRow.appendChild(logLink);
1191+ }
1192+ else if (precision == -1)
1193+ FireBug_logKeys(object, logRow);
1194+ else
1195+ FireBug_logDOM(object, logRow, precision, partial);
1196+}
1197+
1198+function FireBug_logKeys(object, logRow)
1199+{
1200+ var names = [];
1201+ for (var name in object)
1202+ names.push(name);
1203+
1204+ FireBug_logArray(names, logRow);
1205+}
1206+
1207+function FireBug_logFunction(fn, logRow, precision, partial)
1208+{
1209+ var doc = logRow.ownerDocument;
1210+
1211+ // ieerbug : regex IE support
1212+ //var fnRegex = /(function [^(]*\([^)]*\) )\{(.*?)\}$/;
1213+ var fnRegex = /(function[^(]*\([^)]*\))/;
1214+
1215+ var fnText = new String(fn).replace("\n", " ", "g");
1216+
1217+ var m = fnRegex.exec(fnText);
1218+ if (m)
1219+ fnText = m[1] + " {...}";
1220+
1221+ var objectBox = FireBugUtils.createObjectSpan(doc, fnText);
1222+ logRow.appendChild(objectBox);
1223+}
1224+
1225+function FireBug_logArray(array, logRow, precision, partial)
1226+{
1227+ var doc = logRow.ownerDocument;
1228+
1229+ withDocument(doc, function()
1230+ {
1231+ logRow.appendChild(SPAN({"class": "arrayLeftBracket"}, "["));
1232+
1233+ if (partial)
1234+ logRow.appendChild(SPAN({"class": "arrayItem"}, array.length));
1235+
1236+ else
1237+ {
1238+ for (var i = 0; i < array.length; ++i)
1239+ {
1240+ if (i > 0)
1241+ logRow.appendChild(SPAN({"class": "arrayComma"}, ","));
1242+
1243+ var itemNode = SPAN({"class": "arrayItem"});
1244+ logRow.appendChild(itemNode);
1245+
1246+ FireBug_appendObject(array[i], itemNode, 0, false);
1247+ }
1248+ }
1249+
1250+ logRow.appendChild(SPAN({"class": "arrayRightBracket"}, "]"));
1251+ });
1252+}
1253+
1254+function FireBug_logElement(element, logRow, precision, partial)
1255+{
1256+ if (!isElement(element))
1257+ return;
1258+
1259+ //logRow.title = FireBugUtils.getElementXPath(element);
1260+
1261+ var html = FireBugUtils.getElementLineLabel(element, partial);
1262+ var logLink = withDocument(logRow.ownerDocument, function() {
1263+ return FireBugUtils.createObjectLink(element, html);
1264+ });
1265+
1266+ logRow.appendChild(logLink);
1267+}
1268+
1269+function FireBug_logDocument(doc, logRow, precision, partial)
1270+{
1271+ var caption = "[Document] " + doc.location;
1272+ var logLink = withDocument(logRow.ownerDocument, function() {
1273+ return FireBugUtils.createObjectLink(doc, caption);
1274+ });
1275+ logRow.appendChild(logLink);
1276+}
1277+
1278+function FireBug_logTextNode(textNode, logRow, precision, partial)
1279+{
1280+ var nodeValue = FireBugUtils.escapeNewLines(textNode.nodeValue);
1281+
1282+ var caption = "[Text] \"" + nodeValue + "\"";
1283+ var logLink = withDocument(logRow.ownerDocument, function() {
1284+ return FireBugUtils.createObjectLink(textNode, caption);
1285+ });
1286+ logRow.appendChild(logLink);
1287+}
1288+
1289+function FireBug_logConsoleError(scriptError, logRow, precision, partial)
1290+{
1291+ var sourceName = scriptError.sourceName;
1292+ var fromCommandLine = false;
1293+ //var showStackTrace = false;
1294+ //var fromCommandLine = sourceName.indexOf(FireBugCommandLine.evalScript) != -1;
1295+ var showStackTrace = !fromCommandLine && scriptError.errorStackTrace;
1296+ var titleBox = withDocument(logRow.ownerDocument, function() {
1297+ return DIV({"class": "errorTitle"}, [
1298+ showStackTrace ? TWISTY({onclick: onDiscloseError}) : null,
1299+ TEXT(scriptError.errorMessage)
1300+ ]);
1301+ });
1302+ logRow.appendChild(titleBox);
1303+
1304+ if (showStackTrace)
1305+ logRow.errorStackTrace = scriptError.errorStackTrace;
1306+
1307+ scriptError.errorStackTrace = null;
1308+
1309+ if (scriptError.lineNumber && !fromCommandLine)
1310+ {
1311+ FireBugUtils.setClass(logRow, "logRow-sourceLink");
1312+ var sourceLink = new SourceLink(sourceName, scriptError.lineNumber);
1313+ FireBug_appendObject(sourceLink, logRow);
1314+ }
1315+
1316+ if (scriptError.sourceLine)
1317+ {
1318+ var sourceBox = withDocument(logRow.ownerDocument, function() {
1319+ return DIV({"class": "errorSource"}, [TEXT(scriptError.sourceLine)]);
1320+ });
1321+ logRow.appendChild(sourceBox);
1322+ }
1323+}
1324+
1325+function onDiscloseError()
1326+{
1327+ var titleBox = this.parentNode;
1328+ var logRow = titleBox.parentNode;
1329+
1330+ //var twisty = FireBugUtils.getChildByClassName(titleBox, "twisty");
1331+ var twisty = titleBox.getElementsByTagName("img")[0];
1332+ var body = FireBugUtils.getChildByClassName(logRow, "errorStack");
1333+
1334+ if (!body)
1335+ {
1336+ body = withDocument(this.ownerDocument, function() {
1337+ return DIV();
1338+ });
1339+ body.className = "disclosure errorStack";
1340+ logRow.appendChild(body);
1341+
1342+ FireBug_logStackTrace(logRow.errorStackTrace, body);
1343+ }
1344+
1345+ var closed = body.style.display != "block";
1346+ twisty.src = pathToScript + (closed ? "twistyOpen.gif" : "twistyClosed.gif");
1347+ body.style.display = closed ? "block" : "none";
1348+}
1349+
1350+function FireBug_logSourceLink(sourceLink, logRow, precision, partial)
1351+{
1352+ var fileName = FireBugUtils.parseFileNameFromURL(sourceLink.href);
1353+ var linkTitle = fileName + " (line " + sourceLink.line + ")";
1354+
1355+ var logLink = withDocument(logRow.ownerDocument, function() {
1356+ return FireBugUtils.createObjectLink(sourceLink, linkTitle);
1357+ });
1358+
1359+ logLink.title = sourceLink.href;
1360+
1361+ logRow.appendChild(logLink);
1362+}
1363+
1364+function FireBug_logStackTrace(stackTrace, logRow, precision, partial)
1365+{
1366+ for (var i = 0; i < stackTrace.frames.length; ++i)
1367+ {
1368+ var frame = stackTrace.frames[i];
1369+
1370+ var functionName = frame.functionName ? frame.functionName : "null";
1371+
1372+ var itemRow = withDocument(logRow.ownerDocument, function() {
1373+ return DIV({"class": "stackFrame"}, [
1374+ SPAN({"class": "stackFunctionName"}, functionName),
1375+ ]);
1376+ });
1377+
1378+ // IEerBug: arguments.callee callstack cannot support fileName & line...
1379+ //var sourceLink = new SourceLink(frame.fileName, frame.line);
1380+ //FireBug_logSourceLink(sourceLink, itemRow);
1381+
1382+ logRow.appendChild(itemRow);
1383+ }
1384+}
1385+
1386+function FireBug_logSourceString(sourceString, logRow, precision, partial)
1387+{
1388+ sourceString = FireBugUtils.escapeHTML(sourceString);
1389+
1390+ // Split the source by line breaks
1391+ var lines = sourceString.split(/\r\n|\r|\n/);
1392+
1393+ var maxLines = (lines.length + "").length;
1394+ var html = [];
1395+
1396+ withDocument(logRow.ownerDocument, function() {
1397+ for (var i = 0; i < lines.length; ++i)
1398+ {
1399+ // Make sure all line numbers are the same width (with a fixed-width font)
1400+ var lineNo = (i+1) + "";
1401+ while (lineNo.length < maxLines)
1402+ lineNo = " " + lineNo;
1403+
1404+ html.push('<div class="sourceRow"><a class="sourceLine">');
1405+ html.push(lineNo);
1406+ html.push('</a><span class="sourceRowText">');
1407+ html.push(lines[i]);
1408+ html.push('</span></div>');
1409+ }
1410+ });
1411+
1412+ // Believe it or not, using innerHTML is 10x faster (no exaggeration) than constructing
1413+ // DOM elements and inserting them one by one
1414+ logRow.innerHTML = html.join("");
1415+}
1416+
1417+function FireBug_logDOM(object, logRow, precision, partial)
1418+{
1419+ var doc = logRow.ownerDocument;
1420+
1421+ function isFunction(value) { return (typeof value) == "function"; }
1422+ function isNotFunction(value) { return (typeof value) != "function"; }
1423+
1424+ precision = precision > 0 ? precision-1 : 0;
1425+
1426+ var objectType = typeof(object);
1427+ if (objectType == "function")
1428+ {
1429+ FireBug_logSourceString(object+"", logRow);
1430+ }
1431+ else if (objectType == "string")
1432+ {
1433+ FireBug_logSourceString(object, logRow);
1434+ }
1435+ else if (objectType == "object")
1436+ {
1437+ var table = doc.createElement("table");
1438+
1439+ /* ieerbug */
1440+ table.style.width = "100%";
1441+ table.style.tableLayout = "fixed";
1442+
1443+ var col = doc.createElement("col");
1444+ col.style.width = "200px";
1445+ table.appendChild(col);
1446+ var col = doc.createElement("col");
1447+ table.appendChild(col);
1448+
1449+ var tbody = doc.createElement("tbody"); // IE needs tbody tag.
1450+ table.appendChild(tbody);
1451+ /* ieerbug end */
1452+
1453+ for (var name in object)
1454+ {
1455+ try
1456+ {
1457+ FireBug_createObjectRow(name, object[name], isNotFunction, tbody, precision);
1458+ }
1459+ catch (exc) {}
1460+ }
1461+
1462+ for (var name in object)
1463+ {
1464+ try
1465+ {
1466+ FireBug_createObjectRow(name, object[name], isFunction, tbody, precision);
1467+ }
1468+ catch (exc) {}
1469+ }
1470+
1471+ logRow.appendChild(table);
1472+ }
1473+}
1474+
1475+function FireBug_createObjectRow(name, value, filter, table, precision)
1476+{
1477+ if ((filter && !filter(value)))
1478+ return;
1479+
1480+ var isFunction = typeof(value) == "function";
1481+ var isConstant = FireBugUtils.isAllUpperCase(name);
1482+
1483+ var doc = table.ownerDocument;
1484+ var tr = doc.createElement("tr");
1485+ tr.className = "propertyRow" +
1486+ (isFunction ? " propertyRow-function" : "") +
1487+ (isConstant ? " propertyRow-constant" : "");
1488+
1489+ var td = doc.createElement("td");
1490+ td.setAttribute("vAlign", "top");
1491+ td.className = "propertyLabel";
1492+
1493+ // Create the property name
1494+ var labelElt = doc.createElement("span");
1495+ labelElt.className = "propertyName";
1496+ var labelText = doc.createTextNode(name);
1497+ labelElt.appendChild(labelText);
1498+ tr.appendChild(td);
1499+
1500+ // Create the twisty if the value is an object
1501+ var valueType = typeof(value);
1502+ if (valueType == "function" || (valueType == "object" && value != null)
1503+ || (valueType == "string" && value.length > FireBug.stringCropLength))
1504+ {
1505+ td.className += " propertyContainerLabel"
1506+ labelElt.className += " propertyContainerName"
1507+
1508+ var twisty = doc.createElement("img");
1509+ twisty.src = "blank.gif";
1510+ twisty.className = "twisty propertyTwisty";
1511+ td.appendChild(twisty);
1512+
1513+ var self = this;
1514+ labelElt.onclick = function() { FireBug_toggleObjectRow(value, tr); }
1515+ twisty.onclick = function() { FireBug_toggleObjectRow(value, tr); }
1516+ }
1517+
1518+ td.appendChild(labelElt);
1519+
1520+ // Create the property value
1521+ td = doc.createElement("td");
1522+ td.className = "propertyValue";
1523+ td.setAttribute("valign", "top");
1524+
1525+ FireBug_appendObject(value, td, 0, true);
1526+
1527+ tr.appendChild(td);
1528+ table.appendChild(tr);
1529+
1530+ if (valueType == "object" && value != null && precision > 0)
1531+ FireBug_toggleObjectRow(value, tr, precision);
1532+}
1533+
1534+function FireBug_toggleObjectRow(object, tr, precision)
1535+{
1536+ var doc = tr.ownerDocument;
1537+
1538+ var twisty = tr.firstChild.firstChild;
1539+
1540+ if (tr.nextSibling && tr.nextSibling.className == "propertyChildRow")
1541+ {
1542+ FireBugUtils.removeClass(twisty, "open");
1543+
1544+ tr.parentNode.removeChild(tr.nextSibling);
1545+ }
1546+ else
1547+ {
1548+ FireBugUtils.setClass(twisty, "open");
1549+
1550+ var td = doc.createElement("td");
1551+ td.className = "propertyChildBox";
1552+ td.setAttribute("colSpan", 2); // colspan -> colSpan
1553+
1554+ FireBug_logDOM(object, td, precision);
1555+
1556+ var newRow = doc.createElement("tr");
1557+ newRow.className = "propertyChildRow";
1558+ newRow.appendChild(td);
1559+
1560+ if (tr.nextSibling)
1561+ tr.parentNode.insertBefore(newRow, tr.nextSibling);
1562+ else
1563+ tr.parentNode.appendChild(newRow);
1564+ }
1565+}
1566+
1567+
1568+//////////////////////////////////////////////////////////////////////////////////////////////////
1569+// util.js
1570+var FireBugUtils = {};
1571+
1572+FireBugUtils.isAllUpperCase = function(str)
1573+{
1574+ return str.search(/[A-Z]/) >= 0 && str.search(/[a-z]/) == -1;
1575+}
1576+
1577+FireBugUtils.getElementLineLabel = function(element, partial)
1578+{
1579+ var tagName = element.tagName.toLowerCase();
1580+
1581+ var html = "&lt;<span class=\"nodeTag\">" + tagName + "</span>";
1582+
1583+ if (partial)
1584+ html += this.getElementPartialAttributes(element);
1585+ else
1586+ html += this.getElementFullAttributes(element);
1587+
1588+ html += "&gt;";
1589+
1590+ return html;
1591+}
1592+
1593+FireBugUtils.getElementFullAttributes = function(element)
1594+{
1595+ var html = "";
1596+
1597+ for (var i = 0; i < element.attributes.length; ++i)
1598+ {
1599+ var attr = element.attributes[i];
1600+
1601+ // Hide attributes set by FireBug
1602+ if ((attr.localName || attr.nodeName).indexOf("firebug-") == 0)
1603+ continue;
1604+
1605+ // filter for IE by nitoyon
1606+ if(attr.nodeValue == null || attr.nodeValue == "")
1607+ continue;
1608+
1609+ html += " " + (attr.localName || attr.nodeName)
1610+ + '="<span class="nodeAttr" targetAttr="' + attr.localName + '">'
1611+ + attr.nodeValue + '</span>"';
1612+ }
1613+
1614+ return html;
1615+}
1616+
1617+FireBugUtils.getElementPartialAttributes = function(element)
1618+{
1619+ var html = "";
1620+
1621+ if (element.id)
1622+ html += ' id="<span class="nodeAttr" targetAttr="id">' + element.id + '</span>"';
1623+ if (element.className)
1624+ html += ' class="<span class="nodeAttr" targetAttr="class">'
1625+ + element.className + '</span>"';
1626+
1627+ return html;
1628+}
1629+
1630+FireBugUtils.parseFileNameFromURL = function(url)
1631+{
1632+ if (!url)
1633+ return "";
1634+
1635+ var lastSlash = Math.max(url.lastIndexOf("/"), url.lastIndexOf("\\"));
1636+ var fileName = url.substr(lastSlash+1);
1637+ if (fileName.length == 0)
1638+ fileName = url;
1639+ if (fileName.length > 17)
1640+ fileName = fileName.substr(0, 17) + "...";
1641+
1642+ return fileName;
1643+}
1644+
1645+FireBugUtils.createObjectSpan = function(doc, object, title, format)
1646+{
1647+ if (!format)
1648+ format = FireBug_getFormatForObject(object);
1649+
1650+ var span = doc.createElement("span");
1651+ span.className = "objectBox objectBox-"+format;
1652+
1653+ var text = doc.createTextNode(title ? title : object);
1654+ span.appendChild(text);
1655+
1656+ return span;
1657+}
1658+
1659+FireBug.getObjectTitle = function(object)
1660+{
1661+ if (typeof(object) == "undefined")
1662+ {
1663+ return "undefined";
1664+ }
1665+ else if (object == null)
1666+ {
1667+ return "null";
1668+ }
1669+ // deleted (i.e. "if(object instanceof Window)") by nitoyon
1670+ else
1671+ return object;
1672+}
1673+
1674+FireBugUtils.createObjectLink = function(object, title, className, onClick)
1675+{
1676+ var link = contextDocument.createElement("a");
1677+ if (className)
1678+ link.className = className;
1679+
1680+ this.makeObjectLink(object, title, link, onClick);
1681+
1682+ return link;
1683+}
1684+
1685+FireBugUtils.makeObjectLink = function(object, title, linkElt, onClick)
1686+{
1687+ var format = FireBug_getFormatForObject(object);
1688+ FireBugUtils.setClass(linkElt, "objectLink objectLink-"+format);
1689+
1690+ linkElt.linkObject = object;
1691+
1692+ if (!linkElt.firstChild)
1693+ linkElt.innerHTML = title;
1694+ else
1695+ linkElt.firstChild.nodeValue = title;
1696+
1697+ linkElt.href = "#";
1698+/* linkElt.onmouseover = function(event)
1699+ {
1700+ FireBug.highlightObject(object);
1701+ }
1702+
1703+ linkElt.onmouseout = function(event)
1704+ {
1705+ FireBug.highlightObject(null);
1706+ }*/
1707+
1708+ linkElt.onclick = function(event)
1709+ {
1710+ var event = event || window.event
1711+
1712+// if (event.button == 0 && !event.ctrlKey && !event.shiftKey &&
1713+// !event.altKey && !event.metaKey)
1714+// {
1715+ if (onClick)
1716+ onClick.apply(linkElt);
1717+ else
1718+ FireBug.browseObject(object);
1719+// }
1720+// else if (event.metaKey || event.ctrlKey)
1721+// FireBug.visitObject(object);
1722+ }
1723+}
1724+
1725+FireBugUtils.escapeNewLines = function(value)
1726+{
1727+ return value.replace(/\r/g, "\\r").replace(/\n/g, "\\n");
1728+}
1729+
1730+FireBugUtils.escapeHTML = function(value)
1731+{
1732+ return value.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;");
1733+}
1734+
1735+FireBugUtils.clearNode = function(node)
1736+{
1737+ while (node.lastChild)
1738+ node.removeChild(node.lastChild);
1739+}
1740+
1741+FireBugUtils.hasClass = function(node, name)
1742+{
1743+ return node && node.className && node.className.indexOf(name) != -1;
1744+}
1745+
1746+FireBugUtils.setClass = function(node, name)
1747+{
1748+ if (node && !this.hasClass(node, name))
1749+ node.className += " " + name;
1750+}
1751+
1752+FireBugUtils.removeClass = function(node, name)
1753+{
1754+ if (node && node.className)
1755+ {
1756+ var index = node.className.indexOf(name);
1757+ if (index >= 0)
1758+ {
1759+ var size = name.length;
1760+ node.className = node.className.substr(0,index-1) + node.className.substr(index+size);
1761+ }
1762+ }
1763+}
1764+
1765+FireBugUtils.toggleClass = function(elt, name)
1766+{
1767+ if (this.hasClass(elt, name))
1768+ this.removeClass(elt, name);
1769+ else
1770+ this.setClass(elt, name);
1771+}
1772+
1773+FireBugUtils.getChildByClassName = function(node, className)
1774+{
1775+ for (var child = node.firstChild; child; child = child.nextSibling)
1776+ {
1777+ if (this.hasClass(child, className))
1778+ return child;
1779+ }
1780+
1781+ return null;
1782+}
1783+
1784+//
1785+var contextDocument = document;
1786+
1787+FireBugUtils.createElement = function(name, attrs, content)
1788+{
1789+ var node = contextDocument.createElement(name);
1790+
1791+ if (attrs)
1792+ {
1793+ for (var name in attrs)
1794+ {
1795+ var value = attrs[name];
1796+ if (typeof(value) == "function")
1797+ node[name] = value;
1798+ else
1799+ node.setAttribute(name, value);
1800+ }
1801+ }
1802+
1803+ if (content != null && content != undefined)
1804+ {
1805+ // IEerBug: commented out
1806+ //if (content instanceof Node)
1807+ // node.appendChild(content);
1808+ if(content instanceof Array)
1809+ appendNodes(node, content);
1810+ else
1811+ node.innerHTML = content;
1812+ }
1813+
1814+ return node;
1815+}
1816+
1817+function H1(attrs, text) { return FireBugUtils.createElement("h1", attrs, text); }
1818+function H2(attrs, text) { return FireBugUtils.createElement("h2", attrs, text); }
1819+function H3(attrs, text) { return FireBugUtils.createElement("h3", attrs, text); }
1820+function DIV(attrs, text) { return FireBugUtils.createElement("div", attrs, text); }
1821+function PRE(attrs, text) { return FireBugUtils.createElement("pre", attrs, text); }
1822+function SPAN(attrs, text) { return FireBugUtils.createElement("span", attrs, text); }
1823+function IMG(attrs, text) { return FireBugUtils.createElement("img", attrs, text); }
1824+function HR(attrs, text) { return FireBugUtils.createElement("hr", attrs, text); }
1825+function LI(attrs, text) { return FireBugUtils.createElement("li", attrs, text); }
1826+function A(attrs, text) { return FireBugUtils.createElement("a", attrs, text); }
1827+//function TWISTY(attrs) { attrs["class"] = "twisty"; attrs["src"] = "blank.gif"; return IMG(attrs); }
1828+function TWISTY(attrs) { var i = IMG(attrs); i.src = "twistyClosed.gif"; i.style.verticalAlign = "middle"; return i; }
1829+function TEXT(text) { return contextDocument.createTextNode(text); }
1830+
1831+function withDocument(doc, fn)
1832+{
1833+ var previousDocument = contextDocument;
1834+ contextDocument = doc;
1835+
1836+ var result = fn();
1837+
1838+ contextDocument = previousDocument;
1839+
1840+ return result;
1841+}
1842+
1843+function appendNodes(parent, nodes)
1844+{
1845+ for (var i in nodes)
1846+ {
1847+ var content = nodes[i];
1848+
1849+ // IEerBug changed.
1850+ var type = FireBug_getFormatForObject(content);
1851+ //if (content instanceof Node)
1852+ if (type == "textNode" || type == "element"){
1853+ parent.appendChild(content);}
1854+ else if (content instanceof Array)
1855+ appendNodes(parent, content);
1856+ else if (content != null && content != undefined)
1857+ parent.appendChild(parent.ownerDocument.createTextNode(content));
1858+ }
1859+
1860+ return parent;
1861+}
1862+
1863+function isElement(o)
1864+{
1865+ try{
1866+ // edited by nitoyon
1867+ if(typeof(o.innerHTML) == "string"){
1868+ return true;
1869+ }
1870+ }
1871+ catch (ex) {
1872+ return false;
1873+ }
1874+}
1875+
1876+function sliceArray(array, index)
1877+{
1878+ var slice = [];
1879+ for (var i = index; i < array.length; ++i)
1880+ slice.push(array[i]);
1881+
1882+ return slice;
1883+}
1884+}
1885+
1886+IEerBug();
--- trunk/SCORM2004_Engine/sce/scripts/SCORM1.2API.js (revision 11)
+++ trunk/SCORM2004_Engine/sce/scripts/SCORM1.2API.js (revision 12)
@@ -687,7 +687,10 @@
687687 sData += chkNull(post_GetValue(pathName + tagname + ".result")) + '","';
688688 sData += chkNull(post_GetValue(pathName + tagname + ".weighting")) + '","';
689689 sData += chkNull(TStoD(post_GetValue(pathName + tagname + ".latency"))) + '","';
690- sData += chkNull(post_GetValue(pathName + tagname + ".discription")) + '"\r\n';
690+ // 2011.09.02 taku-harada mod >>
691+ //sData += chkNull(post_GetValue(pathName + tagname + ".discription")) + '"\r\n';
692+ sData += chkNull(post_GetValue(pathName + tagname + ".description")) + '"\r\n';
693+ // 2011.09.02 taku-harada mod <<
691694 post_ResetFlag("cmi.interactions.i" + tagname);
692695 }
693696 }
@@ -1163,7 +1166,12 @@
11631166 }
11641167
11651168 var sp,ep,loc,tmp,sid,trg;
1166- loc = top.main.SCO.location.search;
1169+ // 2011.09.01 taku-harada mod >>
1170+ //loc = _getSCOLocationObject().search;
1171+ var aicc_sid = parent.frames.main.g_AICC_SID;
1172+ var aicc_url = parent.frames.main.g_AICC_URL;
1173+ loc = "AICC_SID=" + aicc_sid + "&AICC_URL=" + aicc_url;
1174+ // 2011.09.01 taku-harada mod <<
11671175
11681176 tmp = loc.toUpperCase();
11691177
--- trunk/SCORM2004_Engine/sce/scripts/SCORM1.3API.js (revision 11)
+++ trunk/SCORM2004_Engine/sce/scripts/SCORM1.3API.js (revision 12)
@@ -252,6 +252,8 @@
252252 var comments_data = "";
253253
254254 buf = s.split("\n");
255+console.log("RetSco : " + buf);
256+
255257 for(i=0;i<buf.length;i++){
256258 if(buf[i]=="[Core]"){
257259 mode = 0;
@@ -636,7 +638,10 @@
636638 xmlStr += '</exit><interactions><n><id st="rw" dt="CMIString4096I"/><type st="rw" dt="CMIVocabulary"><kw def="t">true-false</kw><kw>choice</kw><kw>fill-in</kw><kw>long-fill-in</kw>'
637639 xmlStr += '<kw>likert</kw><kw>matching</kw><kw>performance</kw><kw>sequencing</kw><kw>numeric</kw><kw>other</kw></type><objectives><n><id st="rw" dt="CMIString4096I"/></n></objectives>'
638640 xmlStr += '<timestamp st="rw" dt="CMITime"/><correct_responses><n><pattern st="rw" dt="CMIString4096R"/></n></correct_responses><weighting st="rw" dt="CMIReal7"/><learner_response st="rw" dt="CMIString4096R"/>'
639- xmlStr += '<result st="rw" dt="SCERESULT"><kw>correct</kw><kw>incorrect</kw><kw>unanticipated</kw><kw>neutral</kw></result><latency st="rw" dt="CMITimespan"/><description st="rw" dt="CMIString256"/></n></interactions>'
641+// 2011.09.02 taku-harada mod >>
642+// xmlStr += '<result st="rw" dt="SCERESULT"><kw>correct</kw><kw>incorrect</kw><kw>unanticipated</kw><kw>neutral</kw></result><latency st="rw" dt="CMITimespan"/><description st="rw" dt="CMIString256"/></n></interactions>'
643+ xmlStr += '<result st="rw" dt="SCERESULT"><kw>correct</kw><kw>incorrect</kw><kw>unanticipated</kw><kw>neutral</kw></result><latency st="rw" dt="CMITimespan"/><description st="rw" dt="CMILang"/></n></interactions>'
644+// 2011.09.02 taku-harada mod <<
640645 xmlStr += '<launch_data st="r" dt="CMIString4096"/><learner_id st="r" dt="CMIString4096I"/><learner_name st="r" dt="CMIString256"/><learner_preference><audio_level st="rw" dt="CMIPReal7"/>'
641646 xmlStr += '<language st="rw" dt="CMILang"/><delivery_speed st="rw" dt="CMIPReal7"/><audio_captioning st="rw" dt="CMIVocabulary"><kw>-1</kw><kw def="t">0</kw><kw>1</kw></audio_captioning>'
642647 xmlStr += '</learner_preference><location st="rw" dt="CMIString1000"/><max_time_allowed st="r" dt="CMITimespan"/><mode st="r" dt="CMIVocabulary"><kw>browse</kw><kw def="t">normal</kw><kw>review</kw>'
@@ -712,6 +717,10 @@
712717 if(this.flgWrite){
713718 sData = "[Core]" + "\r\n";
714719 sData += "Lesson_Location=" + chg_str2(this.sco_GetValue("cmi.location")) + "\r\n";
720+ // 2011.09.09 taku-harada add >>
721+ sData += "Progress_Measure=" + chg_str2(this.sco_GetValue("cmi.progress_measure")) + "\r\n";
722+ // 2011.09.09 taku-harada add <<
723+
715724
716725 tmp = this.sco_GetValue("cmi.exit");
717726 if(tmp==null){
@@ -721,6 +730,12 @@
721730 var bss = this.sco_GetValue("cmi.success_status");
722731 var bcs = this.sco_GetValue("cmi.completion_status");
723732
733+ // 2011.09.05 taku-harada add >>
734+ if(bcs == "not&nbsp;attempted"){
735+ bcs = "incomplete";
736+ }
737+ // 2011.09.05 taku-harada add <<
738+
724739 var tmps1,tmps2,tmps3,tmps4;
725740 tmps1 = this.sco_GetValue("cmi.score.scaled");
726741 tmps2 = this.sco_GetValue("cmi.score.raw");
@@ -733,10 +748,18 @@
733748 bss = "passed";
734749 }
735750 }
751+ // 2011.09.05 taku-harada add >>
752+ else if((mscore != null)&&(tmps1 == null)){
753+ bss = "unknown";
754+ }
755+ // 2011.09.05 taku-harada add <<
736756
737757 var mmj = this.sco_GetValue("cmi.completion_threshold");
738758 var tmpc1 = this.sco_GetValue("cmi.progress_measure");
739- if((mscore != null)&&(tmpc1 != null)){
759+ // 2011.09.05 taku-harada mod >>
760+ //if((mscore != null)&&(tmpc1 != null)){
761+ if((mmj != null)&&(tmpc1 != null)){
762+ // 2011.09.05 taku-harada mod <<
740763 if(eval(tmpc1) >= eval(mmj)){
741764 bcs = "completed";
742765 }
@@ -822,6 +845,8 @@
822845 sData += "Speed=" + chg_str2(this.sco_GetValue("cmi.learner_preference.delivery_speed")) + "\r\n";
823846 sData += "Text=" + chg_str2(this.sco_GetValue("cmi.learner_preference.audio_captioning")) + "\r\n";
824847
848+console.log("sco_Commit : " + sData);
849+
825850 eStr = Ajax.cmiPost("PutParam",sData);
826851 var AiccErr = new RetErr(eStr);
827852 if(AiccErr.error != 0){
@@ -867,7 +892,10 @@
867892 sData += chg_str2(post_GetValue(pathName + tagname + ".result")) + '","';
868893 sData += chg_str2(post_GetValue(pathName + tagname + ".weighting")) + '","';
869894 sData += chg_str2(post_GetValue(pathName + tagname + ".latency")) + '","';
870- sData += chg_str2(post_GetValue(pathName + tagname + ".discription")) + '"\r\n';
895+ // 2011.09.02 taku-harada mod >>
896+ //sData += chg_str2(post_GetValue(pathName + tagname + ".discription")) + '"\r\n';
897+ sData += chg_str2(post_GetValue(pathName + tagname + ".description")) + '"\r\n';
898+ // 2011.09.02 taku-harada mod <<
871899
872900 post_ResetFlag("cmi.interactions.i" + tagname);
873901 }
@@ -945,11 +973,29 @@
945973 function sco_GetValue(m){
946974 m = dm_RepS(m);
947975 var n = this.SCO.selectSingleNode(m);
976+
977+ // 2011.09.02 taku-harada add >>
978+ if(n==null){
979+ console.debug("IN:sco_GetValue, " + m + " , null");
980+ }else{
981+ console.debug("IN:sco_GetValue, " + m + " , " + n.text);
982+ }
983+ // 2011.09.02 taku-harada add <<
984+
948985 return (n==null)?null:n.text;
949986 }
950987
951988 function sco_GetValueM(m){
952989 var n = this.SCO.selectSingleNode(m);
990+
991+ // 2011.09.02 taku-harada add >>
992+ if(n==null){
993+ console.debug("IN:sco_GetValueM, " + m + " , null");
994+ }else{
995+ console.debug("IN:sco_GetValueM, " + m + " , " + n.text);
996+ }
997+ // 2011.09.02 taku-harada add <<
998+
953999 return (n==null)?null:n.text;
9541000 }
9551001
@@ -957,7 +1003,16 @@
9571003 m = dm_RepS(m);
9581004 m = m.replace("/_count","");
9591005 var n = this.SCO.selectSingleNode(m);
1006+
1007+ // 2011.09.02 taku-harada add >>
9601008 if(n==null){
1009+ console.debug("IN:sco_GetCount, " + m + " , null");
1010+ }else{
1011+ console.debug("IN:sco_GetCount, " + m + " , " + n.childNodes.length);
1012+ }
1013+ // 2011.09.02 taku-harada add <<
1014+
1015+ if(n==null){
9611016 return 0;
9621017 }else{
9631018 var cn = n.childNodes;
@@ -966,6 +1021,11 @@
9661021 }
9671022
9681023 function sco_SetValue(m,s,f){
1024+
1025+ // 2011.09.02 taku-harada add >>
1026+ console.debug("OUT:sco_SetValue, " + m + " , " + s + " , " + f);
1027+ // 2011.09.02 taku-harada add <<
1028+
9691029 if(!f){
9701030 if(m=="cmi.session_time"){
9711031 this.stime = 0;
@@ -1149,7 +1209,10 @@
11491209 if(s == ""){
11501210 f = true;
11511211 }else{
1152- f = chk_localLang("{lang=" + s + "}",0);
1212+ // 2011.09.02 taku-harada mod >>
1213+ //f = chk_localLang("{lang=" + s + "}",0);
1214+ f = chk_localLang(s,0);
1215+ // 2011.09.02 taku-harada mod <<
11531216 }
11541217 }else if(t=="CMIString255"){
11551218 f = Check_CMIString255(s);
@@ -1726,7 +1789,13 @@
17261789
17271790 var sp,ep,loc,tmp,sid,trg;
17281791
1729- loc = _getSCOLocationObject().search;
1792+ // 2011.09.01 taku-harada mod >>
1793+ //loc = _getSCOLocationObject().search;
1794+ var aicc_sid = parent.frames.main.g_AICC_SID;
1795+ var aicc_url = parent.frames.main.g_AICC_URL;
1796+ loc = "AICC_SID=" + aicc_sid + "&AICC_URL=" + aicc_url;
1797+ // 2011.09.01 taku-harada mod <<
1798+
17301799 tmp = loc.toUpperCase();
17311800
17321801 sp = tmp.indexOf("AICC_SID=");
@@ -1898,6 +1967,7 @@
18981967 }else if(ret){
18991968
19001969 str = ADP.sco_GetValue(m);
1970+
19011971 // 初期値ありか?
19021972 if(str==null){
19031973 // 配列型かどうかを見る
@@ -1950,6 +2020,11 @@
19502020 var navSusFlag = false;
19512021 //
19522022 function SetValue(m,s){
2023+
2024+ // 2011.09.08 taku-harada add >>
2025+ console.debug("OUT:SetValue, " + m + " , " + s);
2026+ // 2011.09.08 taku-harada add <<
2027+
19532028 _setLastError("0");
19542029 s = String(s);
19552030 if(m == "cmi.learner_preference.audio")
@@ -2201,7 +2276,35 @@
22012276 }
22022277 return "false";
22032278 }
2204- s = s.replace(/\s/g,"&nbsp;")
2279+ s = s.replace(/\s/g,"&nbsp;");
2280+ // 2011.09.08 taku-harada add >>
2281+ if(m == "cmi.success_status"){
2282+ var mscore = ADP.sco_GetValue("cmi.scaled_passing_score");
2283+ var s_score = ADP.sco_GetValue("cmi.score.scaled");
2284+ if((mscore != null) && (s_score == null)){
2285+ s = "unknown";
2286+ }else if((mscore != null) && (s_score != null)){
2287+ if(eval(s_score) >= eval(mscore)){
2288+ s = "passed";
2289+ }else{
2290+ s = "failed";
2291+ }
2292+ }
2293+ }
2294+ if(m == "cmi.completion_status"){
2295+ var cth = ADP.sco_GetValue("cmi.completion_threshold");
2296+ var pms = ADP.sco_GetValue("cmi.progress_measure");
2297+ if((cth != null) && (pms == null)){
2298+ s = "unknown";
2299+ }else if((cth != null) && (pms != null)){
2300+ if(eval(pms) >= eval(cth)){
2301+ s = "completed";
2302+ }else{
2303+ s = "incomplete";
2304+ }
2305+ }
2306+ }
2307+ // 2011.09.08 taku-harada add <<
22052308 ADP.sco_SetValue(m,s,0);
22062309
22072310 if(m == "cmi.exit"){
@@ -2209,7 +2312,36 @@
22092312 navSusFlag = true;
22102313 }
22112314 }
2212-
2315+
2316+ // 2011.09.05 taku-harada add >>
2317+ if(m == "cmi.score.scaled"){
2318+ var mscore = ADP.sco_GetValue("cmi.scaled_passing_score");
2319+ if((mscore != null)&&(s != null)){
2320+ if(eval(s) >= eval(mscore)){
2321+ ADP.sco_SetValue("cmi.success_status","passed",0);
2322+ }else{
2323+ ADP.sco_SetValue("cmi.success_status","failed",0);
2324+ }
2325+ }else if((mscore != null)&&(s == null)){
2326+ ADP.sco_SetValue("cmi.success_status","unknown",0);
2327+ }
2328+ }
2329+ // 2011.09.05 taku-harada add <<
2330+ // 2011.09.08 taku-harada add >>
2331+ if(m == "cmi.progress_measure"){
2332+ var cth = ADP.sco_GetValue("cmi.completion_threshold");
2333+ if((cth != null)&&(s != null)){
2334+ if(eval(s) >= eval(cth)){
2335+ ADP.sco_SetValue("cmi.completion_status","completed",0);
2336+ }else{
2337+ ADP.sco_SetValue("cmi.completion_status","incomplete",0);
2338+ }
2339+ }else if((cth != null)&&(s == null)){
2340+ ADP.sco_SetValue("cmi.completion_status","unknown",0);
2341+ }
2342+ }
2343+ // 2011.09.08 taku-harada add <<
2344+
22132345 ADP.flgWrite = 1;
22142346 return "true";
22152347 /*
--- trunk/SCORM2004_Engine/sce/WEB-INF/src/jp/co/ntt/lms/lo/scorm/kernel/SCORMCommunicationModule.java (revision 11)
+++ trunk/SCORM2004_Engine/sce/WEB-INF/src/jp/co/ntt/lms/lo/scorm/kernel/SCORMCommunicationModule.java (revision 12)
@@ -98,7 +98,10 @@
9898 cbtcom.setValue("cmi.entry", "ab-initio");
9999 cbtcom.setValue("cmi.launch_data", activity.getDataFromLMS());
100100 cbtcom.setValue("cmi.completion_threshold", activity.getCompletionThreshold());
101- cbtcom.setValue("cmi.progress_measure", null); // 初期値はnull
101+ // 2011.09.09 taku-harada mod >>
102+ //cbtcom.setValue("cmi.progress_measure", null); // 初期値はnull
103+ cbtcom.setValue("cmi.progress_measure", activity.getProgressMeasure());
104+ // 2011.09.09 taku-harada mod <<
102105 cbtcom.setValue("cmi.learner_id", userID);
103106 cbtcom.setValue("cmi.learner_name", userName);
104107
--- trunk/SCORM2004_Engine/sce/WEB-INF/src/jp/co/ntt/lms/lo/scorm/kernel/LocalObjective.java (revision 11)
+++ trunk/SCORM2004_Engine/sce/WEB-INF/src/jp/co/ntt/lms/lo/scorm/kernel/LocalObjective.java (revision 12)
@@ -104,9 +104,23 @@
104104 */
105105 CachedNode minNormalNode = objectiveNode.selectSimpleSingleNode("minNormalizedMeasure/text()");
106106 if (minNormalNode != null) {
107- minNormalizedMeasure =
108- new BigDecimal(minNormalNode.getNodeValue()).setScale(4, BigDecimal.ROUND_HALF_UP);
107+ // 2011.09.08 taku-harada mod >>
108+// minNormalizedMeasure =
109+// new BigDecimal(minNormalNode.getNodeValue()).setScale(4, BigDecimal.ROUND_HALF_UP);
110+ if(satisfiedByMeasure!=null && satisfiedByMeasure){
111+ minNormalizedMeasure =
112+ new BigDecimal(minNormalNode.getNodeValue()).setScale(4, BigDecimal.ROUND_HALF_UP);
113+ }
114+ // 2011.09.08 taku-harada mod <<
109115 }
116+ // 2011.09.07 taku-harada add >>
117+ else{
118+ if(satisfiedByMeasure!=null && satisfiedByMeasure){
119+ minNormalizedMeasure =
120+ new BigDecimal("1.0").setScale(4, BigDecimal.ROUND_HALF_UP);
121+ }
122+ }
123+ // 2011.09.07 taku-harada add <<
110124
111125 /*
112126 * global objective の設定
--- trunk/SCORM2004_Engine/sce/WEB-INF/src/jp/co/ntt/lms/lo/scorm/kernel/Activity.java (revision 11)
+++ trunk/SCORM2004_Engine/sce/WEB-INF/src/jp/co/ntt/lms/lo/scorm/kernel/Activity.java (revision 12)
@@ -846,26 +846,43 @@
846846 * @return CompletionThreshold
847847 */
848848 public String getCompletionThreshold() {
849+ // 2011.09.02 taku-harada mod >>
849850 // 2010.10.01 taku-harada mod >>
850-// CachedNode completionThreshold = itemNode.selectSimpleSingleNode("completionThreshold/text()");
851-//
851+ CachedNode completionThreshold = itemNode.selectSimpleSingleNode("completionThreshold/text()");
852+
853+ if (completionThreshold != null) {
854+ return completionThreshold.getNodeValue();
855+ }
856+// CachedNode completionThreshold = itemNode.selectSimpleSingleNode("completionThreshold");
852857 // if (completionThreshold != null) {
853-// return completionThreshold.getNodeValue();
858+// CachedNode minProgressMeasure = completionThreshold.selectSingleChildNode("@minProgressMeasure");
859+// if (minProgressMeasure != null) {
860+// return minProgressMeasure.getNodeValue();
861+// }
854862 // }
855- CachedNode completionThreshold = itemNode.selectSimpleSingleNode("completionThreshold");
856- if (completionThreshold != null) {
857- CachedNode minProgressMeasure = completionThreshold.selectSingleChildNode("@minProgressMeasure");
858- if (minProgressMeasure != null) {
859- return minProgressMeasure.getNodeValue();
860- }
861- }
862863 // 2010.10.01 taku-harada mod <<
864+ // 2011.09.02 taku-harada mod >>
863865
864866 return null;
865867 }
866868
869+ // 2011.09.09 taku-harada add >>
870+ /**
871+ * ProgressMeasure値の取得を行う
872+ *
873+ * @return ProgressMeasure
874+ */
875+ public String getProgressMeasure() {
876+ CachedNode progressMeasure = itemNode.selectSimpleSingleNode("progressMeasure/text()");
867877
868- // 2010.10.041 taku-harada add >>
878+ if (progressMeasure != null) {
879+ return progressMeasure.getNodeValue();
880+ }
881+
882+ return null;
883+ }
884+ // 2011.09.09 taku-harada add <<
885+
869886 /**
870887 * data値の取得を行う
871888 *
--- trunk/SCORM2004_Engine/sce/WEB-INF/src/jp/co/ntt/lms/lo/scorm/engine/NavigateBusinessBean.java (revision 11)
+++ trunk/SCORM2004_Engine/sce/WEB-INF/src/jp/co/ntt/lms/lo/scorm/engine/NavigateBusinessBean.java (revision 12)
@@ -59,6 +59,14 @@
5959 /** (次)SCOへのURL */
6060 private String SCOURL;
6161
62+ // 2011.09.01 taku-harada add >>
63+ /** AICC_SIDはSCOURLから分離させる*/
64+ private String AICC_SID;
65+
66+ /** AICC_URLはSCOURLから分離させる*/
67+ private String AICC_URL;
68+ // 2011.09.01 taku-harada add <<
69+
6270 /**
6371 * デフォルトコンストラクタ
6472 */
@@ -99,4 +107,23 @@
99107 public String getSCOURL() {
100108 return SCOURL;
101109 }
110+
111+ // 2011.09.01 taku-harada add >>
112+ public String getAICC_SID() {
113+ return AICC_SID;
114+ }
115+
116+ public void setAICC_SID(String aicc_sid) {
117+ AICC_SID = aicc_sid;
118+ }
119+
120+ public String getAICC_URL() {
121+ return AICC_URL;
122+ }
123+
124+ public void setAICC_URL(String aicc_url) {
125+ AICC_URL = aicc_url;
126+ }
127+ // 2011.09.01 taku-harada add <<
128+
102129 }
--- trunk/SCORM2004_Engine/sce/WEB-INF/src/jp/co/ntt/lms/lo/scorm/engine/NavigateBusinessAction.java (revision 11)
+++ trunk/SCORM2004_Engine/sce/WEB-INF/src/jp/co/ntt/lms/lo/scorm/engine/NavigateBusinessAction.java (revision 12)
@@ -58,7 +58,9 @@
5858 import javax.servlet.http.HttpSession;
5959 import javax.xml.transform.stream.StreamResult;
6060
61+import jp.co.ntt.lms.lo.scorm.cbtcom.CMIUtil;
6162 import jp.co.ntt.lms.lo.util.UserIDFolder;
63+import jp.co.ntt.lms.lo.scorm.kernel.SCORMCommunicationModule;
6264 import jp.co.ntt.lms.lo.scorm.kernel.Activity;
6365 import jp.co.ntt.lms.lo.scorm.kernel.exception.SequencingException;
6466 import jp.co.ntt.lms.lo.scorm.util.Debug;
@@ -324,6 +326,17 @@
324326 NavigateBusinessBean navigateBusinessBean = new NavigateBusinessBean(executeParameters);
325327
326328 navigateBusinessBean.setSCOURL((SCOURL == null) ? null : SCOURL.toString());
329+
330+ // 2011.09.01 taku-harada add >>
331+ // AICC_URLとAICC_SIDを個別に受け渡すように変更
332+ SCORMCommunicationModule comuModule = apiAdapter.getCommunicationModule();
333+ if (comuModule != null) {
334+ String aicc_url = comuModule.getValue("cmi.launch.aicc_url");
335+ navigateBusinessBean.setAICC_URL(CMIUtil.urlEncode(aicc_url));
336+ String aicc_sid = comuModule.getValue("cmi.launch.aicc_sid");
337+ navigateBusinessBean.setAICC_SID(CMIUtil.urlEncode(aicc_sid));
338+ }
339+ // 2011.09.01 taku-harada add <<
327340
328341 xmsResponse.setBusinessBean(navigateBusinessBean);
329342 }
--- trunk/SCORM2004_Engine/sce/WEB-INF/src/jp/co/ntt/lms/lo/scorm/cbtcom/CMILaunch.java (revision 11)
+++ trunk/SCORM2004_Engine/sce/WEB-INF/src/jp/co/ntt/lms/lo/scorm/cbtcom/CMILaunch.java (revision 12)
@@ -240,6 +240,9 @@
240240 // 現在日時からタイムストリングを生成し、ユニークとなるセッションIDを生成する
241241 String str = String.valueOf(System.currentTimeMillis());
242242 strSid.append(strSeed).append(str);
243+ // 2011.09.02 taku-harada add >>
244+ localSetValue("cmi.launch.aicc_sid", strSid.toString());
245+ // 2011.09.02 taku-harada add <<
243246 } else {
244247 // セッションID の値が取得できたならば、その値をそのまま用いる
245248 // cmi.launch.aicc_sid が設定済みの場合は、そのまま用いる。
@@ -251,6 +254,8 @@
251254 if (strLocalValue != null) {
252255 cbtUrl.append(strLocalValue);
253256 }
257+
258+
254259 //@20040603 MOD NTTR パラメータ付加順序の変更
255260 // manifestにparameterがあればそちらが優先
256261 strLocalValue = localGetValue("cmi.launch.launch_params", false);
@@ -270,6 +275,8 @@
270275 cbtUrl.append("?");
271276 }
272277
278+ // 2011.09.01 taku-harada mod >>
279+ /**
273280 // 生成したセッションID を、起動URLに付加する
274281 cbtUrl.append("&AICC_SID=");
275282 //セッションID をURLエンコードする
@@ -280,6 +287,9 @@
280287 if (strLocalValue != null) {
281288 cbtUrl.append(CMIUtil.urlEncode(strLocalValue));
282289 }
290+ **/
291+ // 2011.09.01 taku-harada mod <<
292+
283293 //@20040603 END
284294 // 起動URLを返す
285295 return cbtUrl.toString();
--- trunk/SCORM2004_Engine/sce/WEB-INF/src/jp/co/ntt/lms/lo/scorm/cbtcom/MaintenancePutParam.java (revision 11)
+++ trunk/SCORM2004_Engine/sce/WEB-INF/src/jp/co/ntt/lms/lo/scorm/cbtcom/MaintenancePutParam.java (revision 12)
@@ -1331,7 +1331,16 @@
13311331 child = node.getChild(strSubpath);
13321332 child.setLessonValue(strValue);
13331333 child.setLocalValue(strValue);
1334- } else {
1334+ }
1335+ // 2011.09.09 taku-harada add >>
1336+ else if ("progress_measure".equals(strKeyWord)) {
1337+ strSubpath = "progress_measure";
1338+ child = node.getChild(strSubpath);
1339+ child.setLessonValue(strValue);
1340+ child.setLocalValue(strValue);
1341+ }
1342+ // 2011.09.09 taku-harada add <<
1343+ else {
13351344 // warning
13361345 int ecode = element.getError();
13371346 if (ecode == CMIError.ERR_NO_ERROR) {
Show on old repository browser