-- NOT PART OF THE BUILD --

clean out some bitrot in cview, add an install.js file.
xpi will be located at www.hacksrus.com/~ginda/cview shortly.
This commit is contained in:
rginda%netscape.com 2001-02-17 05:55:01 +00:00
parent ccff1e5d10
commit af814a3484
5 changed files with 116 additions and 29 deletions

View File

@ -162,8 +162,30 @@ function onChangeDisplayMode (e)
dd ("** UNKNOWN ID '" + id + "' in onChangeDisplayMode **");
return;
}
var typeDesc = (ary[1] == "cmp") ? "Components" : "Interfaces";
var typeDesc;
var el;
if (ary[1] == "cmp") {
typeDesc = "Components";
el = document.getElementById("menu-cmp-show-all");
el.setAttribute("checked", false);
el = document.getElementById("menu-cmp-show-contains");
el.setAttribute("checked", false);
el = document.getElementById("menu-cmp-show-starts-with");
el.setAttribute("checked", false);
} else {
typeDesc = "Interfaces";
el = document.getElementById("menu-ifc-show-all");
el.setAttribute("checked", false);
el = document.getElementById("menu-ifc-show-contains");
el.setAttribute("checked", false);
el = document.getElementById("menu-ifc-show-starts-with");
el.setAttribute("checked", false);
el = document.getElementById("menu-ifc-show-implemented-by");
el.setAttribute("checked", false);
}
e.target.setAttribute ("checked", true);
var filter = "";
if (ary[2] == "contains")

View File

@ -83,6 +83,14 @@ function rdf_getr (s)
RDFHelper.prototype.GetLiteral =
function rdf_getl (s)
{
if (!s)
{
dd ("rdf_getl: no argument provided!");
dd (getStackTrace());
return "";
}
return this.svc.GetLiteral(s);
}
@ -92,7 +100,7 @@ function rdf_assert (n1, a, n2, f)
if (typeof f == "undefined")
f = true;
/*return this.dAssert (n1, a, n2, f);*/
// return this.dAssert (n1, a, n2, f);
return this.ds.Assert (n1, a, n2, f);
}
@ -111,7 +119,10 @@ function rdf_dassert (n1, a, n2, f)
var n2v = n2 ? n2.Value : "!!!";
if (!n1 || !a || !n2)
{
dd ("n1 " + n1v + " a " + av + " n2 " + n2v);
dd(getStackTrace());
}
this.ds.Assert (n1, a, n2, f)
}

View File

@ -31,10 +31,7 @@
var cview = new Object();
/*
* instead of creating a slew of global variables, all app-wide values are
* stored on this cview object. Doing this instead of global variable is
* somewhat religious; it avoids any "m" prefix for module vars, makes
* it trivial to track down all globals, and in theory makes it possible
* to embed the code in another app without colliding globals.
* stored on this cview object.
*/
/* number of items to process per refresh step */
@ -77,7 +74,7 @@ function refreshComponentsStep()
cview.rdf.Assert (res, cview.rdf.resContractID,
cview.rdf.GetLiteral(cls.name));
cview.rdf.Assert (res, cview.rdf.resCLSID,
cview.rdf.GetLiteral(cls.id));
cview.rdf.GetLiteral(cls.number));
cview.rdf.Assert (res, cview.rdf.resShow,
cview.rdf.litTrue);
cview.rdf.Assert (cview.rdf.resRoot, cview.rdf.resCmp, res);
@ -142,12 +139,12 @@ function refreshInterfacesStep()
if (!ifc)
break;
var res = cview.rdf.GetResource ("interface:" + (++cview.interfaceID));
cview.rdf.Assert (res, cview.rdf.resIName,
cview.rdf.GetLiteral(ifc.name));
cview.rdf.Assert (res, cview.rdf.resIID,
cview.rdf.GetLiteral(ifc.id));
cview.rdf.GetLiteral(ifc.number));
cview.rdf.Assert (res, cview.rdf.resShow,
cview.rdf.litTrue);
cview.rdf.Assert (cview.rdf.resRoot, cview.rdf.resIfc, res);

View File

@ -24,7 +24,8 @@
<!DOCTYPE window>
<?xml-stylesheet href="chrome://cview/skin" type="text/css"?>
<!-- ?xml-stylesheet href="chrome://cview/skin" type="text/css"? -->
<?xml-stylesheet href="chrome://communicator/skin/" type="text/css"?>
<?xul-overlay href="chrome://global/content/globalOverlay.xul"?>
<?xul-overlay href="chrome://communicator/content/utilityOverlay.xul"?>
@ -120,8 +121,9 @@
</toolbox>
<box id="outer-box" flex="1">
<box id="component-box" align="vertical" flex="1">
<text id="component-label" value="Components..."/>
<box id="component-box" align="vertical" flex="1" width="50%">
<text id="component-label" value="Components..." crop="right"
autostretch="never"/>
<!--
datasources="rdf:null" makes the tree able to get it's contents from an
rdf datasource, but delays saying which one until runtime.
@ -144,8 +146,8 @@
-->
<rule xpcom:show="true">
<treechildren flex="1">
<treeitem uri="...">
<treerow onclick="onComponentClick(event);"
<treeitem uri="..." flex="1">
<treerow onclick="onComponentClick(event);" flex="1" crop="right"
contractid="rdf:http://www.mozilla.org/NC-xpcom#contractid">
<!--
Even though we specified the onClick handler as an attribute of the
@ -154,10 +156,12 @@
cview-handlers.js:onComponentClick().
-->
<treecell>
<text value="rdf:http://www.mozilla.org/NC-xpcom#contractid"/>
<text value="rdf:http://www.mozilla.org/NC-xpcom#contractid"
crop="right" flex="1" autostretch="never"/>
</treecell>
<treecell>
<text value="rdf:http://www.mozilla.org/NC-xpcom#clsid"/>
<text value="rdf:http://www.mozilla.org/NC-xpcom#clsid"
crop="right" flex="1" autostretch="never"/>
</treecell>
</treerow>
</treeitem>
@ -166,19 +170,20 @@
</template>
<treecolgroup>
<treecol flex="1"
<treecol flex="1" width="75%"
resource="http://www.mozilla.org/NC-xpcom#contractid"/>
<treecol flex="1"
<splitter class="tree-splitter"/>
<treecol flex="1" width="25%"
resource="http://www.mozilla.org/NC-xpcom#clsid"/>
</treecolgroup>
<treehead>
<treerow>
<treecell id="componentcol-contractid"
<treecell id="componentcol-contractid" flex="1"
resource="http://www.mozilla.org/NC-xpcom#contractid"
class="treecell-header sortDirectionIndicator" value="ContractID"
onclick="return onSortCol('componentcol-contractid');"/>
<treecell id="componentcol-clsid"
<treecell id="componentcol-clsid" flex="1"
resource="http://www.mozilla.org/NC-xpcom#clsid"
class="treecell-header sortDirectionIndicator" value="CLSID"
onclick="return onSortCol('componentcol-clsid');"/>
@ -187,10 +192,13 @@
</tree>
</box>
<splitter id="main-splitter" align="vertical" collapse="before"/>
<splitter id="main-splitter" align="vertical" collapse="before">
<grippy/>
</splitter>
<box id="interface-box" align="vertical" flex="1">
<text id="interface-label" value="Interfaces..."/>
<box id="interface-box" align="vertical" flex="1" width="50%">
<text id="interface-label" value="Interfaces..." crop="right"
autostretch="never"/>
<tree id="interface-list" container="true" datasources="rdf:null" flex="1"
containment="http://www.mozilla.org/NC-xpcom#interface">
@ -199,14 +207,16 @@
<rule xpcom:show="true">
<treechildren flex="1">
<treeitem uri="...">
<treerow onclick="onInterfaceClick(event);"
<treerow onclick="onInterfaceClick(event);" crop="right"
iname="rdf:http://www.mozilla.org/NC-xpcom#iname"
context="interfacePopup">
<treecell>
<text value="rdf:http://www.mozilla.org/NC-xpcom#iname"/>
<text value="rdf:http://www.mozilla.org/NC-xpcom#iname"
crop="right" flex="1" autostretch="never"/>
</treecell>
<treecell>
<text value="rdf:http://www.mozilla.org/NC-xpcom#iid"/>
<text value="rdf:http://www.mozilla.org/NC-xpcom#iid"
crop="right" flex="1" autostretch="never"/>
</treecell>
</treerow>
</treeitem>
@ -215,9 +225,10 @@
</template>
<treecolgroup>
<treecol flex="1"
<treecol flex="1" width="75%"
resource="http://www.mozilla.org/NC-xpcom#iname"/>
<treecol flex="1"
<splitter class="tree-splitter"/>
<treecol flex="1" width="25%"
resource="http://www.mozilla.org/NC-xpcom#iid"/>
</treecolgroup>

View File

@ -0,0 +1,46 @@
// this function verifies disk space in kilobytes
function verifyDiskSpace(dirPath, spaceRequired)
{
var spaceAvailable;
// Get the available disk space on the given path
spaceAvailable = fileGetDiskSpaceAvailable(dirPath);
// Convert the available disk space into kilobytes
spaceAvailable = parseInt(spaceAvailable / 1024);
// do the verification
if(spaceAvailable < spaceRequired)
{
logComment("Insufficient disk space: " + dirPath);
logComment(" required : " + spaceRequired + " K");
logComment(" available: " + spaceAvailable + " K");
return(false);
}
return(true);
}
var srDest = 111;
var err = initInstall("Component Viewer v0.5", "CView", "5.0.0.2001021601");
logComment("initInstall: " + err);
if (verifyDiskSpace(getFolder("Program"), srDest))
{
addFile("CView Chrome",
"bin/chrome/cview.jar", // jar source folder
getFolder("Chrome"), // target folder
""); // target subdir
registerChrome(PACKAGE | DELAYED_CHROME, getFolder("Chrome","cview.jar"),
"content/cview/");
registerChrome(LOCALE | DELAYED_CHROME, getFolder("Chrome","cview.jar"),
"locale/en-US/cview/");
if (err==SUCCESS)
performInstall();
else
cancelInstall(err);
}
else
cancelInstall(INSUFFICIENT_DISK_SPACE);