1
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2
/* ***** BEGIN LICENSE BLOCK *****
3
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
5
* The contents of this file are subject to the Mozilla Public License Version
6
* 1.1 (the "License"); you may not use this file except in compliance with
7
* the License. You may obtain a copy of the License at
8
* http://www.mozilla.org/MPL/
10
* Software distributed under the License is distributed on an "AS IS" basis,
11
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
12
* for the specific language governing rights and limitations under the
15
* The Original Code is TransforMiiX XSLT Processor.
17
* The Initial Developer of the Original Code is
19
* Portions created by the Initial Developer are Copyright (C) 2001
20
* the Initial Developer. All Rights Reserved.
23
* Axel Hecht <axel@pike.org>
24
* Peter Van der Beken <peterv@netscape.com>
26
* Alternatively, the contents of this file may be used under the terms of
27
* either the GNU General Public License Version 2 or later (the "GPL"), or
28
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
29
* in which case the provisions of the GPL or the LGPL are applicable instead
30
* of those above. If you wish to allow use of your version of this file only
31
* under the terms of either the GPL or the LGPL, and not to allow others to
32
* use your version of this file under the terms of the MPL, indicate your
33
* decision by deleting the provisions above and replace them with the notice
34
* and other provisions required by the GPL or the LGPL. If you do not delete
35
* the provisions above, a recipient may use your version of this file under
36
* the terms of any one of the MPL, the GPL or the LGPL.
38
* ***** END LICENSE BLOCK ***** */
40
function onNewResultView(event)
42
dump("onNewResultView\n");
43
const db = runItem.prototype.kDatabase;
44
const kXalan = runItem.prototype.kXalan;
45
var index = view.boxObject.selection.currentIndex;
46
var res = view.builder.getResourceAtIndex(index);
47
var name = db.GetTarget(res, krTypeName, true);
51
var cat = db.GetTarget(res, krTypeCat, true);
52
var path = db.GetTarget(res, krTypePath, true);
53
cat = cat.QueryInterface(nsIRDFLiteral);
54
name = name.QueryInterface(nsIRDFLiteral);
55
path = path.QueryInterface(nsIRDFLiteral);
56
xalan_fl = kXalan.resolve(cat.Value+"/"+path.Value);
57
xalan_ref = kXalan.resolve(cat.Value+"-gold/"+path.Value);
58
var currentResultItem = new Object();
59
currentResultItem.testpath = xalan_fl;
60
currentResultItem.refpath = xalan_ref;
61
var currentRunItem = itemCache.getItem(res);
62
// XXX todo, keep a list of these windows, so that we can close them.
63
resultWin = window.openDialog('result-view.xul','_blank',
64
'chrome,resizable,dialog=no',
65
currentResultItem, currentRunItem);
72
function onResultViewLoad(event)
74
dump("onResultViewLoad\n");
75
aResultItem = window.arguments[0];
76
aRunItem = window.arguments[1];
77
var loadFlags = Components.interfaces.nsIWebNavigation.LOAD_FLAGS_NONE;
78
document.getElementById('src').webNavigation.loadURI('view-source:'+
79
aResultItem.testpath+'.xml', loadFlags, null, null, null);
80
document.getElementById('style').webNavigation.loadURI('view-source:'+
81
aResultItem.testpath+'.xsl', loadFlags, null, null, null);
83
if (aRunItem && aRunItem.mRefDoc && aRunItem.mResDoc) {
84
document.getElementById("refSourceBox").setAttribute("class", "hidden");
85
refInspector = new ObjectApp();
86
refInspector.initialize("refInsp", aRunItem.mRefDoc);
87
resInspector = new ObjectApp();
88
resInspector.initialize("resInsp", aRunItem.mResDoc);
91
document.getElementById("inspectorBox").setAttribute("class", "hidden");
92
document.getElementById('ref').webNavigation.loadURI('view-source:'+
93
aResultItem.refpath+'.out', loadFlags, null, null, null);
98
function onResultViewUnload(event)
100
dump("onResultUnload\n");
107
ObjectApp.prototype =
112
initialize: function(aId, aDoc)
115
this.mPanelSet = document.getElementById(aId).contentDocument.getElementById("bxPanelSet");
116
this.mPanelSet.addObserver("panelsetready", this, false);
117
this.mPanelSet.initialize();
120
doViewerCommand: function(aCommand)
122
this.mPanelSet.execCommand(aCommand);
125
getViewer: function(aUID)
127
return this.mPanelSet.registry.getViewerByUID(aUID);
130
onEvent: function(aEvent)
132
switch (aEvent.type) {
133
case "panelsetready":
135
this.mPanelSet.getPanel(0).subject = this.mDoc;