!import
(0 calls, 0 incl. v-uS, 0 excl. v-uS)
1 /* -*- Mode: Java; 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
4 *
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/
9 *
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
13 * License.
14 *
15 * The Original Code is TransforMiiX XSLT processor code.
16 *
17 * The Initial Developer of the Original Code is
18 * Axel Hecht.
19 * Portions created by the Initial Developer are Copyright (C) 2001
20 * the Initial Developer. All Rights Reserved.
21 *
22 * Contributor(s):
23 * Axel Hecht <axel@pike.org>
24 * Peter Van der Beken <peterv@propagandism.org>
25 *
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.
37 *
38 * ***** END LICENSE BLOCK ***** */
39
onNewResultView
(0 calls, 0 incl. v-uS, 0 excl. v-uS)
40 function onNewResultView(event)
41 {
42 dump("onNewResultView\n");
43 const db = runItem.prototype.kDatabase;
44 const kXalan = runItem.prototype.kXalan;
45 var index = view.boxObject.view.selection.currentIndex;
46 var res = view.builder.getResourceAtIndex(index);
47 var name = db.GetTarget(res, krTypeName, true);
48 if (!name) {
49 return false;
50 }
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);
66 return true;
67 }
68
69 var refInspector;
70 var resInspector;
71
onResultViewLoad
(0 calls, 0 incl. v-uS, 0 excl. v-uS)
72 function onResultViewLoad(event)
73 {
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);
82
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);
89 }
90 else {
91 document.getElementById("inspectorBox").setAttribute("class", "hidden");
92 document.getElementById('ref').webNavigation.loadURI('view-source:'+
93 aResultItem.refpath+'.out', loadFlags, null, null, null);
94 }
95 return true;
96 }
97
onResultViewUnload
(0 calls, 0 incl. v-uS, 0 excl. v-uS)
98 function onResultViewUnload(event)
99 {
100 dump("onResultUnload\n");
101 }
102
ObjectApp
(0 calls, 0 incl. v-uS, 0 excl. v-uS)
103 function ObjectApp()
104 {
105 }
106
107 ObjectApp.prototype =
108 {
109 mDoc: null,
110 mPanelSet: null,
111
initialize
(0 calls, 0 incl. v-uS, 0 excl. v-uS)
112 initialize: function(aId, aDoc)
113 {
114 this.mDoc = aDoc;
115 this.mPanelSet = document.getElementById(aId).contentDocument.getElementById("bxPanelSet");
116 this.mPanelSet.addObserver("panelsetready", this, false);
117 this.mPanelSet.initialize();
118 },
119
doViewerCommand
(0 calls, 0 incl. v-uS, 0 excl. v-uS)
120 doViewerCommand: function(aCommand)
121 {
122 this.mPanelSet.execCommand(aCommand);
123 },
124
getViewer
(0 calls, 0 incl. v-uS, 0 excl. v-uS)
125 getViewer: function(aUID)
126 {
127 return this.mPanelSet.registry.getViewerByUID(aUID);
128 },
129
onEvent
(0 calls, 0 incl. v-uS, 0 excl. v-uS)
130 onEvent: function(aEvent)
131 {
132 switch (aEvent.type) {
133 case "panelsetready":
134 {
135 this.mPanelSet.getPanel(0).subject = this.mDoc;
136 }
137 }
138 }
139 };