[Zope-CVS] CVS: Packages/Moztop/moztop/content/ContentObjects/Folder - Preview.js:1.1 Preview.xul:1.2

Stephan Richter srichter@cbu.edu
Thu, 16 Jan 2003 00:36:16 -0500


Update of /cvs-repository/Packages/Moztop/moztop/content/ContentObjects/Folder
In directory cvs.zope.org:/tmp/cvs-serv22824/moztop/content/ContentObjects/Folder

Modified Files:
	Preview.xul 
Added Files:
	Preview.js 
Log Message:
Preview of Folders works now.


=== Added File Packages/Moztop/moztop/content/ContentObjects/Folder/Preview.js ===
/*****************************************************************************
*
* Copyright (c) 2002, 2003 Zope Corporation and Contributors.
* All Rights Reserved.
*
* This software is subject to the provisions of the Zope Public License,
* Version 2.0 (ZPL).  A copy of the ZPL should accompany this distribution.
* THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
* WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
* FOR A PARTICULAR PURPOSE.
*
******************************************************************************
Preview Tab specific Javascript functions. 

$Id: Preview.js,v 1.1 2003/01/16 05:36:13 srichter Exp $

******************************************************************************/

/* Retrieve path of active content object. */
function getActiveContentObjectPath() {
    doc = getDocumentOfWindowWithId("moztop-main-window");
    var tabs = doc.getElementById("active-contents-tabs");
    return tabs.selectedItem.getAttribute('label')
}

/* Load preview in IFrame */
function loadPreview() {
    iframe = document.getElementById('preview-frame');
    iframe.setAttribute('src', HTML_BASE + getActiveContentObjectPath());
}


=== Packages/Moztop/moztop/content/ContentObjects/Folder/Preview.xul 1.1 => 1.2 ===
--- Packages/Moztop/moztop/content/ContentObjects/Folder/Preview.xul:1.1	Wed Jan 15 08:53:04 2003
+++ Packages/Moztop/moztop/content/ContentObjects/Folder/Preview.xul	Thu Jan 16 00:36:13 2003
@@ -4,9 +4,20 @@
 <?xml-stylesheet href="chrome://moztop/skin" type="text/css"?>
 
 <window
+   orient = "vertical"
+   onload = "loadPreview();"
    xmlns = "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
 
-    <label value="Preview" />
-    <image src="chrome://moztop/content/moztop.png" />
+  <script type="application/x-javascript" 
+          src="chrome://moztop/content/setup.js"/>
+  <script type="application/x-javascript" 
+          src="chrome://moztop/content/global.js"/>
+  <script type="application/x-javascript" src="Preview.js"/>
+
+   <iframe id="preview-frame" flex="1"/>
+   <box orient="horizontal">
+     <button onclick="loadPreview();" label="Reload Content" />
+     <spring flex="100%" />
+   </box>
 
 </window>