twingle/twingle/content twingle.xul,1.1.1.1,1.2 twingle.js,1.2,1.3
[email protected] Thu, 6 Mar 2003 11:09:51 -0700 (MST)
| Newsgroups | gmane.comp.cms.oscom.twingle.cvs |
|---|---|
| Message-ID | <[email protected]> |
Update of /cvs/root/twingle/twingle/content
In directory alpha.oscom.org:/tmp/cvs-serv13371
Modified Files:
twingle.xul twingle.js
Log Message:
sites database init now works
Index: twingle.xul
===================================================================
RCS file: /cvs/root/twingle/twingle/content/twingle.xul,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -d -r1.1.1.1 -r1.2
*** twingle.xul 5 Mar 2003 19:30:31 -0000 1.1.1.1
--- twingle.xul 6 Mar 2003 18:09:49 -0000 1.2
***************
*** 16,22 ****
--- 16,24 ----
height = "480"
orient = "vertical"
+ onload = "initTwingle();"
persist = "screenX screenY width height sizemode">
<script type="application/x-javascript" src="twingle.js"/>
+ <script type="application/x-javascript" src="rdfds.js"/>
<script src="chrome://global/content/nsDragAndDrop.js"/>
<script src="chrome://global/content/nsTransferable.js"/>
***************
*** 24,27 ****
--- 26,30 ----
<commandset id="maincommands">
<command id="menu-file-close:command" oncommand="closeWindow();"/>
+ <command id="menu-help-about:command" oncommand="showAboutTwingle();"/>
</commandset>
Index: twingle.js
===================================================================
RCS file: /cvs/root/twingle/twingle/content/twingle.js,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** twingle.js 6 Mar 2003 17:51:09 -0000 1.2
--- twingle.js 6 Mar 2003 18:09:49 -0000 1.3
***************
*** 1,5 ****
! /* Declare, but don't initialize, some global variables */
var sitesds = null;
--- 1,8 ----
! /* Some globals */
! var ncns ="http://home.netscape.com/NC-rdf#";
! var subitemsprop = ncns + "subitems";
+ /* Declare, but don't initialize, some global variables */
var sitesds = null;
***************
*** 11,15 ****
initializeProfileDatabases();
-
}
--- 14,17 ----
***************
*** 34,62 ****
{
! // First get the directory service and query interface it to
! // nsIProperties
! var dirService = Components.
! classes['@mozilla.org/file/directory_service;1'].
! getService(Components.interfaces.nsIProperties);
! // Next get the "ProfD" property of type nsIFile from the directory
! // service, FYI this constant is defined in
! // mozilla/xpcom/io/nsAppDirectoryServiceDefs.h
! const NS_APP_USER_PROFILE_50_DIR = "ProfD";
! profileDir = dirService.get(NS_APP_USER_PROFILE_50_DIR,
! Components.interfaces.nsIFile);
! // Now that we have it we can show it's path. See nsIFile for the
! // other things you that can be done with profileDir
! var io_service =
Components.classes["@mozilla.org/network/io-service;1"].
getService(Components.interfaces.nsIIOService);
! var url = io_service.newFileURI(profileDir)
! .QueryInterface(Components.interfaces.nsIFileURL);
! return url.spec;
}
--- 36,64 ----
{
! // First get the directory service and query interface it to
! // nsIProperties
! var dirService = Components.
! classes['@mozilla.org/file/directory_service;1'].
! getService(Components.interfaces.nsIProperties);
! // Next get the "ProfD" property of type nsIFile from the directory
! // service, FYI this constant is defined in
! // mozilla/xpcom/io/nsAppDirectoryServiceDefs.h
! const NS_APP_USER_PROFILE_50_DIR = "ProfD";
! profileDir = dirService.get(NS_APP_USER_PROFILE_50_DIR,
! Components.interfaces.nsIFile);
! // Now that we have it we can show it's path. See nsIFile for the
! // other things you that can be done with profileDir
! var io_service =
Components.classes["@mozilla.org/network/io-service;1"].
getService(Components.interfaces.nsIIOService);
! var url = io_service.newFileURI(profileDir)
! .QueryInterface(Components.interfaces.nsIFileURL);
! return url.spec;
}
***************
*** 65,88 ****
{
! /* Are there databases in profile dir? If so, log a message and return */
! var allres = this.ds.getAllResources();
! if (allres.hasMoreElements()) {
! logmanager.addMessage('Found existing moztop databases',
! 'Explorer.js, initExplorer',
! this.ds.serializeToString());
! return;
! }
! /* If we make it here, it means we need to create moztop databases */
! var rootnode = this.ds.getNode("urn:moztop:sites");
! var subitems = this.ds.getNode("urn:moztop:sites:subitems");
! subitems.makeSeq();
! rootnode.addTarget(this.subitemsprop,subitems);
! this.ds.save();
! logmanager.addMessage("Initialized moztop.rdf","Explorer.js, initExplorer",
! this.ds.serializeToString());
! return;
}
--- 67,90 ----
{
! /* Are there databases in profile dir? If so, log a message and return */
! var allres = sitesds.getAllResources();
! if (allres.hasMoreElements()) {
! dump("\nFound existing twingle databases");
! dump("\n" + sitesds.serializeToString());
! return;
! }
! /* If we make it here, it means we need to create twingle databases */
! var rootnode = sitesds.getNode("urn:twingle:sites");
! var subitems = sitesds.getNode("urn:twingle:sites:subitems");
! subitems.makeSeq();
! rootnode.addTarget(this.subitemsprop,subitems);
! sitesds.save();
! dump("\nCreated new twingle databases");
! dump("\n" + sitesds.serializeToString());
!
! return;
}