Please take our Survey
logo       

Choosing A Webhost:
A web hosting service is a type of Internet hosting service that allows individuals and organizations to provide their own website accessible via the World Wide Web. Web hosts are companies that provide space on a server they own for use by their clients as well as providing Internet connectivity, typically in a data center. Web hosts can also provide data center space and connectivity to the Internet for servers they do not own to be located in their data center, called colocation. more...

CMFBoard/skins/cmfboard arrowDownAlternative.gif,NONE,1.1 forum_change_view: msg#00092

web.zope.plone.collective.cvs

Subject: CMFBoard/skins/cmfboard arrowDownAlternative.gif,NONE,1.1 forum_change_view_mode.py,NONE,1.1 forum_get_view_mode.py,NONE,1.1 forum_message_flat.pt,NONE,1.1 forum_message_icons.pt,NONE,1.1 forum_topic_flat.pt,NONE,1.1 forum_topic_full_thread.pt,NONE,1.1 forum_topic_thread.pt,NONE,1.1 plone_menu.js.dtml,NONE,1.1 discussion_reply_form.pt,1.2,1.3 forum_add_reply.py,1.2,1.3 forum_add_topic.py,1.2,1.3 forum_add_topic_form.pt,1.2,1.3 forum_blog_widget.pt,1.2,1.3 forum_message_view.pt,1.1,1.2 forum_styles.css.dtml,1.1,1.2 forum_topic.pt,1.3,1.4 forum_topic_widget.pt,1.4,1.5 forum_view.pt,1.4,1.5 viewThreadsAtBottom.pt,1.6,1.7

Update of /cvsroot/collective/CMFBoard/skins/cmfboard
In directory sc8-pr-cvs1:/tmp/cvs-serv26544/skins/cmfboard

Modified Files:
discussion_reply_form.pt forum_add_reply.py forum_add_topic.py
forum_add_topic_form.pt forum_blog_widget.pt
forum_message_view.pt forum_styles.css.dtml forum_topic.pt
forum_topic_widget.pt forum_view.pt viewThreadsAtBottom.pt
Added Files:
arrowDownAlternative.gif forum_change_view_mode.py
forum_get_view_mode.py forum_message_flat.pt
forum_message_icons.pt forum_topic_flat.pt
forum_topic_full_thread.pt forum_topic_thread.pt
plone_menu.js.dtml
Log Message:
* added Message icon
prepare for thread forums



Index: forum_topic_widget.pt
===================================================================
RCS file: /cvsroot/collective/CMFBoard/skins/cmfboard/forum_topic_widget.pt,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- forum_topic_widget.pt 28 Oct 2003 09:50:17 -0000 1.4
+++ forum_topic_widget.pt 31 Oct 2003 11:41:29 -0000 1.5
@@ -4,8 +4,9 @@
</head>
<body>

- <table metal:define-macro="message" tal:omit-tag="">
- <tr class="shadedarker" tal:define="creator msg/Creator"
+ <div metal:define-macro="message">
+ <table width="100%" class="ftable">
+ <tr class="shadedarker" tal:define="creator msg/Creator"
tal:attributes="class
python:test(idx.next()%2,'shadedark','shadelight')">
<td class="cell3d" style="font-size:smaller;" valign="top">
<span i18n:translate="" tal:omit-tag="">By</span>:
@@ -72,6 +73,20 @@
</td>
</tr>
</table>
+
+ <ul tal:on-error="nothing"
+ tal:define="children python:msg.getRefs('children')">
+ <li tal:repeat="child children">
+ <tal:block tal:define="msg nocall:child" tal:omit-tag="">
+ <tal:block metal:use-macro="here/forum_topic_widget/macros/message">
+ <a tal:content="child/title_or_id" tal:attributes="href
child/absolute_url"></a>
+ by <tal:block tal:content="child/Creator"></tal:block> on
<tal:block tal:content="python:toPortalTime(child.modified(), 1)"></tal:block>
+ </tal:block>
+ </tal:block>
+ </li>
+ </ul>
+ </div>
+

<table metal:define-macro="topic" tal:omit-tag="">


Index: forum_message_view.pt
===================================================================
RCS file: /cvsroot/collective/CMFBoard/skins/cmfboard/forum_message_view.pt,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- forum_message_view.pt 24 Oct 2003 09:12:14 -0000 1.1
+++ forum_message_view.pt 31 Oct 2003 11:41:29 -0000 1.2
@@ -8,6 +8,7 @@
<body>
<div metal:fill-slot="main" i18n:domain="CMFBoard"
tal:define="mtool nocall:here/portal_membership;topic nocall:here;
+ toPortalTime nocall:here/toPortalTime;
replyable nothing;">

<h2 tal:content="here/Title"></h2>

Index: forum_add_reply.py
===================================================================
RCS file: /cvsroot/collective/CMFBoard/skins/cmfboard/forum_add_reply.py,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- forum_add_reply.py 24 Oct 2003 09:12:14 -0000 1.2
+++ forum_add_reply.py 31 Oct 2003 11:41:29 -0000 1.3
@@ -4,7 +4,7 @@
##bind namespace=
##bind script=script
##bind subpath=traverse_subpath
-##parameters=content, image=None, file=None
+##parameters=content, title='', reply_to='', image=None, file=None,
message_icon=''
##title=Add new topic
##

@@ -15,13 +15,12 @@
file = ''

try:
- context.manage_addReply(content=content,image=image,file=file)
+ context.manage_addReply(title=title, content=content,
+ reply_to=reply_to,image=image, file=file,
+ message_icon=message_icon)
msg = 'Reply added'
except Exception, e:
msg = str(e)


return ( 'success', context, { 'portal_status_message': msg } )
-
-
-

Index: forum_topic.pt
===================================================================
RCS file: /cvsroot/collective/CMFBoard/skins/cmfboard/forum_topic.pt,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- forum_topic.pt 28 Oct 2003 09:50:17 -0000 1.3
+++ forum_topic.pt 31 Oct 2003 11:41:29 -0000 1.4
@@ -4,6 +4,8 @@
<metal:block metal:fill-slot="head_slot"
tal:define="dummy python:request.set('disable_border',1)">
<link rel="Stylesheet" type="text/css" tal:attributes="href
string:$portal_url/forum_styles.css">
+ <script type="text/javascript" tal:attributes="src
string:$portal_url/plone_menu.js">
+ </script>
</metal:block>
</head>
<body>
@@ -11,17 +13,20 @@
tal:define="mtool nocall:here/portal_membership;topic nocall:here;
replyable python:mtool.checkPermission('Add forum topic reply', here);
review_state python:here.portal_workflow.getInfoFor(here,
'review_state', '');
- toPortalTime nocall:here/toPortalTime;">
+ toPortalTime nocall:here/toPortalTime;
+ topic here/Topic;view_mode here/forum_get_view_mode;">

<script type="text/javascript" language="javascript">
<!--
- function quote(blockquote) {
+ function quote(blockquote, uid) {
var blockquote;
var blog_form = document.forms['blog_form'];
+ var reply_to = blog_form['reply_to'];
var current_content = blog_form['content'];
var new_content = current_content.value + blockquote;
current_content.value = new_content;
current_content.focus();
+ reply_to.value = uid;
return false;
}
//-->
@@ -48,32 +53,52 @@
onclick="document.forms['blog_form'].content.focus();;return
false;;">Add Reply</a> |
</tal:block>
<a href="../" title="Go Back" i18n:translate="">Back</a>
- </div>

+ <ul class="menuBar">
+ <li class="menuButton">
+ <a href="#" onclick="return buttonClick(event,'viewModeMenu')"
+ onmouseover="buttonMouseover(event,'viewModeMenu')"
i18n:translate=""
+ tal:content="view_mode">
+ </a>
+
+ <ul class="menu" id="viewModeMenu"
onmouseover="menuMouseover(event)">
+ <li class="menuItem">
+ <a i18n:translate="flat" tal:attributes="href
+
string:forum_change_view_mode?mode=flat&redirect=${request/URL}">Flat</a>
+ </li>
+ <li class="menuItem">
+ <a i18n:translate="nested" tal:attributes="href
+
string:forum_change_view_mode?mode=nested&redirect=${request/URL}">Nested</a>
+ </li>
+ <li class="menuItem">
+ <a i18n:translate="thread" tal:attributes="href
+
string:forum_change_view_mode?mode=thread&redirect=${request/URL}">Thread</a>
+ </li>
+ <li class="menuItem">
+ <a i18n:translate="full_thread" tal:attributes="href
+
string:forum_change_view_mode?mode=full_thread&redirect=${request/URL}">Full
thread</a>
+ </li>
+ </ul>
+ </li>
+ </ul>
+ </div>
<br />

- <table cellspacing="0" cellpadding="0" width="100%" class="ftable"
- tal:define="hits here/Hits;idx Iterator;">
- <tr class="shadedarker">
- <th class="cell3d" width="10%" i18n:translate="">Author</th>
- <th class="cell3d" width="90%" i18n:translate="">Topic</th>
- </tr>
- <tr tal:define="msg nocall:here" tal:omit-tag="">
- <td metal:use-macro="here/forum_topic_widget/macros/message"></td>
- </tr>
+ <tal:block tal:condition="python:view_mode=='flat'">
+ <metal:block metal:use-macro="here/forum_topic_flat/macros/topic_view"
/>
+ </tal:block>

- <tal:block tal:define="children here/getChildren">
- <tr tal:condition="children" tal:omit-tag=""
- tal:repeat="msg children">
- <td metal:use-macro="here/forum_topic_widget/macros/message"></td>
- </tr>
+ <tal:block tal:condition="python:view_mode=='nested'">
+ <metal:block metal:use-macro="here/forum_topic_flat/macros/topic_view"
/>
+ </tal:block>

- <tr tal:condition="not:children">
- <td class="cell3d" colspan="2" style="text-align:center;"
i18n:translate="">
- This topic contains no replies</td>
- </tr>
- </tal:block>
- </table>
+ <tal:block tal:condition="python:view_mode=='thread'">
+ <metal:block
metal:use-macro="here/forum_topic_thread/macros/topic_view" />
+ </tal:block>
+
+ <tal:block tal:condition="python:view_mode=='full_thread'">
+ <metal:block
metal:use-macro="here/forum_topic_full_thread/macros/topic_view" />
+ </tal:block>

<br />

@@ -88,7 +113,7 @@

<br />&nbsp;

- <tal:block tal:condition="replyable"
+ <tal:block tal:condition="replyable"
tal:define="action python:here.portal_form_url(template.id)">
<h3 style="text-align:center;"
tal:condition="python:review_state=='locked'"
i18n:translate="">

--- NEW FILE: forum_topic_flat.pt ---
<html>
<body>

<metal:block metal:define-macro="topic_view">
<table cellspacing="0" cellpadding="0" width="100%" class="ftable"
tal:define="hits here/Hits;idx Iterator;">
<tr class="shadedarker">
<th class="cell3d" width="10%" i18n:translate="">Author</th>
<th class="cell3d" width="90%" i18n:translate="">Topic</th>
</tr>
<tr tal:define="msg nocall:topic" tal:omit-tag="">
<td metal:use-macro="here/forum_message_flat/macros/message"></td>
</tr>

<tr tal:condition="not:python:topic.getRefs('children')">
<td class="cell3d" colspan="2" style="text-align:center;"
i18n:translate="">
This topic contains no replies</td>
</tr>
</table>

</metal:block>
</body>
</html>

Index: forum_blog_widget.pt
===================================================================
RCS file: /cvsroot/collective/CMFBoard/skins/cmfboard/forum_blog_widget.pt,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- forum_blog_widget.pt 24 Oct 2003 09:12:14 -0000 1.2
+++ forum_blog_widget.pt 31 Oct 2003 11:41:29 -0000 1.3
@@ -6,7 +6,7 @@

<div metal:define-macro="blog_form"
tal:define="content python:request.get('content','')">
-
+
<tal:block tal:content="structure here/emoticons.js">
Insert JavaScript Code Here That renders
namespace values embedded in its code, that is
@@ -18,6 +18,8 @@
tal:attributes="action action">
<a name="add_comment">&nbsp;</a>

+ <input type="hidden" name="reply_to" tal:attributes="value here/UID" />
+
<tal:block tal:define="preview python:request.get('preview_text','')"
tal:condition="preview">
<div class="preview">
@@ -57,11 +59,12 @@
</td>
</tr>
<tr>
- <td i18n:translate="">Name</td>
- <td tal:content="python:'%s, %s' % (member,
toPortalTime(long_format=1))">
- User, Date
+ <td i18n:translate="label_title">Title</td>
+ <td>
+ <input type="text" name="title" value="" style="width: 100%"
+ tal:attributes="value python:request.get('title', here.Title())"/>
</td>
- </tr>
+ </tr>
<tr>
<td style="width:10%;">
<label for="content" i18n:translate="">Comments</label>
@@ -94,7 +97,18 @@
<code><a href="#emoticon" onclick="javascript:wizard('code',
'blog_form');return false;">code</a></code>
</td>
</tr>
-
+ <tr>
+ <td valign="top" align="right" colspan="2">
+ <span i18n:translate="select_message_icon" tal:omit-tag="">Select
message icon</span>
+ <select name="message_icon">
+ <option value="">No icon</option>
+ <option class="opt" tal:repeat="icon
here/fcImages/icons/objectValues"
+ tal:content="icon/title_or_id"
+ tal:attributes="value icon/getId;
+ style string:background-image:
url(${icon/absolute_url})">test</option>
+ </select>
+ </td>
+ </tr>
<tr>
<td align="right" colspan="2" tal:define="error errors/image|nothing">
<table width="10%">

--- NEW FILE: forum_get_view_mode.py ---
## Script (Python) "forum_get_view_mode"
##bind container=container
##bind context=context
##bind namespace=
##bind script=script
##bind subpath=traverse_subpath
##parameters=
##title=
##

request = context.REQUEST

try:
mode = request.cookies.get(context.Topic().UID(), getattr(context,
'view_mode', 'flat'))
except:
mode = 'flat'

if mode not in ('flat','nested','thread','full_thread'):
mode = 'flat'

return mode

Index: discussion_reply_form.pt
===================================================================
RCS file: /cvsroot/collective/CMFBoard/skins/cmfboard/discussion_reply_form.pt,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- discussion_reply_form.pt 24 Oct 2003 09:12:13 -0000 1.2
+++ discussion_reply_form.pt 31 Oct 2003 11:41:29 -0000 1.3
@@ -1,8 +1,7 @@
<html metal:use-macro="here/main_template/macros/master">
<head>
<title tal:content="template/title">The title Yeah</title>
- <metal:block metal:fill-slot="head_slot"
- tal:define="dummy python:request.set('disable_border',1)">
+ <metal:block metal:fill-slot="head_slot">
<link rel="Stylesheet" type="text/css" tal:attributes="href
string:$portal_url/forum_styles.css">
</metal:block>
</head>
@@ -13,8 +12,6 @@
errors python:request.get('errors', {});
">

- <br />
-
<span tal:content="structure here/emoticons.js" tal:omit-tag="">
Insert JavaScript Code Here That renders
namespace values embedded in its code, that is
@@ -25,90 +22,11 @@
<h1 i18n:translate="heading_add_comment">Add Comment</h1>
<p i18n:translate="description_add_comment">
You can add a comment by filling out the form below. To see how the
posting
- will look before submitting it, click 'Preview Comment'.
+ will look before submitting it, click 'Preview Comment'.
</p>

- <form id="add_entry" name="add_entry_form" method="post" class="group"
- tal:attributes="action python:here.portal_form_url(template.id)">
-
- <span class="legend" i18n:translate="legend_comment_details">Comment
Details</span>
-
- <table cellspacing="1" cellpadding="2" width="100%">
- <tr>
- <td valign="top">
- <b i18n:translate="">Emoticons</b>
- </td>
- <td>
- <span tal:repeat="image
python:here.fcImages.emoticons.objectValues()" tal:omit-tag="">
- <a href="#emoticon"
- onclick="javascript:alert('get title')"
- title="Emoticon Title"
- tal:attributes="onclick python:'javascript:emoticon(\'%s\',
\'add_entry_form\');;return false;;' % (image.title);
- title image/title"
- tal:content="structure image">Image Here</a>
- </span>
- </td>
- </tr>
- <tr>
- <td>
- <b i18n:translate="">Wizards</b>
- </td>
- <td>
- <a href="#emoticon"
- onclick="javascript:wizard('link', 'add_entry_form');return
false;">Link</a> |
- <a href="#emoticon"
- onclick="javascript:wizard('image', 'add_entry_form');return
false;">Image</a> |
- <i><a href="#emoticon"
- onclick="javascript:wizard('italic', 'add_entry_form');return
false;">Italic</a></i> |
- <b><a href="#emoticon"
- onclick="javascript:wizard('bold', 'add_entry_form');return
false;">Bold</a></b> |
- <span style="font-size:large;"><a href="#emoticon"
- onclick="javascript:wizard('big', 'add_entry_form');return
false;">Big</a></span> |
- <code><a href="#emoticon"
- onclick="javascript:wizard('code', 'add_entry_form');return
false;">code</a></code>
- </td>
- </tr>
- <tr>
- <td><label>Title</label></td>
- <td>
- <input type="text" name="title" value="" style="width: 350px"
- tal:attributes="value python:request.get('title', '')"/>
- </td>
- </tr>
-
- <tr>
- <td class="required"><label
i18n:translate="label_content">Content</label></td>
- <td tal:define="error errors/content|nothing">
- <div class="field" tal:attributes="class python:test(error, 'field
error', 'field')">
- <textarea name="content" cols="25" rows="7"
- style="width: 350px"
- tal:content="python:request.get('content', '')" />
- <div tal:condition="error" i18n:translate="" tal:content="error">
- </div>
- </div>
- </td>
- </tr>
- </table>
-
- <br />
-
- <tal:block tal:define="preview python:request.get('preview_text','')"
- tal:condition="preview">
- <div class="preview">
- <b i18n:translate="">Message Preview:</b>
- <hr noshade="noshade" style="border:2px solid black;" />
- <span tal:replace="structure preview"></span>
- </div>
- <br />
- </tal:block>
+ <metal:block
metal:use-macro="here/forum_add_topic_form/macros/add_form"></metal:block>

- <input class="context" type="submit" i18n:attributes="value"
name="preview" value="Preview" />
- <input class="context" type="submit" name="add" onclick="return
confirm_submission('add_entry_form');"
- value="Add" i18n:attributes="value" />
- <input class="context" type="submit" name="cancel"
- value="Cancel" i18n:attributes="value" onclick="return
confirm('Cancel?');" />
- <input type="hidden" name="form_submitted" value="1"
tal:attributes="value template/id" />
- </form>
</div>
</body>
</html>

Index: forum_add_topic.py
===================================================================
RCS file: /cvsroot/collective/CMFBoard/skins/cmfboard/forum_add_topic.py,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- forum_add_topic.py 24 Oct 2003 09:12:14 -0000 1.2
+++ forum_add_topic.py 31 Oct 2003 11:41:29 -0000 1.3
@@ -4,7 +4,7 @@
##bind namespace=
##bind script=script
##bind subpath=traverse_subpath
-##parameters=title, content, sticky_flag=0, image=None, file=None
+##parameters=title, content, sticky_flag=0, image=None, file=None,
message_icon=''
##title=Add new topic
##

@@ -15,7 +15,8 @@
file = ''

ob = context.manage_addTopic(title=title, content=content,
- sticky_flag=sticky_flag,image=image,file=file)
+ sticky_flag=sticky_flag,image=image,file=file,
+ message_icon=message_icon)

return ( 'success', ob,
{ 'portal_status_message':
context.REQUEST.get('portal_status_message',

--- NEW FILE: forum_message_flat.pt ---
<html i18n:domain="CMFBoard">
<head>
<title tal:content="template/title">The title</title>
</head>
<body>

<table metal:define-macro="message" tal:omit-tag="">
<tr class="shadedarker" tal:define="creator msg/Creator"
tal:attributes="class
python:test(idx.next()%2,'shadedark','shadelight')">
<td class="cell3d" style="font-size:smaller;" valign="top">
<span i18n:translate="" tal:omit-tag="">By</span>:
<span tal:replace="creator">Creation User</span><br />
<span tal:replace="python:here.get_user_role(creator,
'Unavailable')">User Role</span><br />
<span i18n:translate="" tal:omit-tag="">Postings</span>:
<span tal:replace="python:here.get_user_property(creator, 'fc_posts',
'n/a')">0</span><br />
</td>
<td valign="top" class="cell3d">
<img src="fcImages/topic.gif" height="10" width="17" border="0"
alt="Regular Topic" i18n:attributes="alt"
tal:attributes="src here/fcImages/topic.gif/absolute_url" />
<span i18n:translate="" tal:omit-tag="">Posted</span>:
<span
tal:replace="python:toPortalTime(msg.CreationDate(),1)">Creation
Date/Time</span>
<i>
<tal:block tal:condition="python:mtool.checkPermission('Manage forum
topic', here)">
[<a class="fcMenu" href="portal_form/base_edit" title="Edit Topic"
i18n:translate="" i18n:attributes="title"
tal:attributes="href python:'%s/%s'%(msg.absolute_url(),
msg.getTypeInfo().getActionById('edit'))">Edit</a>]
[<a class="fcMenu" title="Delete Topic"
tal:attributes="title python:
test(msg.Type()=='Forum Message', 'Delete Reply', 'Delete Topic');
href
string:${topic/absolute_url}/manage_deleteReply?ids=${msg/getId}"
i18n:translate="" i18n:attributes="title">Delete</a>]
</tal:block>

<tal:block tal:condition="replyable">[
<a href="#add_comment" class="fcMenu"
tal:attributes="onclick python:'quote(\'%s\',\'%s\');;return
false;;'%(here.forum_quote_format(msg.content, creator),msg.UID())"
title="Reply w/Quote" i18n:translate=""
i18n:attributes="title">Reply w/Quote</a> ]
</tal:block>
</i>

<hr style="width:98%;height:1px;" noshade="noshade" />
<table border="0" width="100%" cellspacing="0" cellpadding="0">
<tr valign="top">
<td>
<p id="id" tal:attributes="id msg/getId"
tal:content="structure msg/Content">Parsed Topic Content
Here</p>

<div>
<a target="_blank" tal:attributes="href
msg/image/absolute_url"
tal:condition="python:hasattr(msg, 'image') and
msg.image.getSize() and not hasattr(msg,'image_thumbnail')">
<img tal:replace="structure here/fcImages/mime_img.gif"
src="mime_img.gif" />
<small i18n:translate="label_view_attached_image">view
attached image</small>
&nbsp;&nbsp;</a>
<a tal:attributes="href msg/file/absolute_url"
tal:condition="msg/file/getSize">
<img tal:replace="structure here/fcImages/mime_text.gif"
src="mime_text.gif" />
<small i18n:translate="label_view_attached_image">view
attached file</small></a>
</div>
</td>
<td align="right" tal:condition="python:msg.hasImage()">
<a target="_blank" tal:attributes="href msg/image/absolute_url"
tal:condition="msg/image/getSize">
<img tal:replace="structure
python:msg.image_thumbnail.tag(title='view attached image')"
src="mime_img.gif" />
</a>
</td>
</tr>
</table>
</td>
</tr>

<tr tal:repeat="msg python:msg.getChildren()" tal:omit-tag=""
tal:condition="python:not(exists('one_msg') and one_msg)">
<td metal:use-macro="here/forum_message_flat/macros/message"></td>
</tr>

</table>

</body>
</html>

Index: viewThreadsAtBottom.pt
===================================================================
RCS file: /cvsroot/collective/CMFBoard/skins/cmfboard/viewThreadsAtBottom.pt,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- viewThreadsAtBottom.pt 29 Oct 2003 05:34:58 -0000 1.6
+++ viewThreadsAtBottom.pt 31 Oct 2003 11:41:29 -0000 1.7
@@ -15,10 +15,14 @@
isViewTemplate python:test(template.getId()==view_action, 1, 0);
mtool nocall:here/portal_membership;">

- <tal:block tal:define="discussion
python:here.portal_discussion.getDiscussionFor(here)"
+ <tal:block tal:define="discussion
+ python:here.portal_discussion.getDiscussionFor(here);
+ msg nocall:discussion"
tal:condition="python:mtool.checkPermission('View', discussion)">
- <span style="float: right" tal:condition="python:discussion is not
None">
- <a name="comments"> </a>
+ <a name="comments"> </a>
+ <metal:block
metal:use-macro="here/forum_topic_threaded/macros/tree"></metal:block>
+
+ <span style="float:right">
<img tal:replace="structure here/discussionitem_icon.gif" />
<a href="" tal:attributes="href discussion/absolute_url">
<span tal:replace="discussion/replies"></span>

--- NEW FILE: forum_topic_full_thread.pt ---
<html>
<body>
<metal:block metal:define-macro="topic_view">
<table cellspacing="0" cellpadding="0" width="100%" class="ftable"
tal:define="hits here/Hits;idx Iterator;">
<tr class="shadedarker">
<th class="cell3d" width="10%" i18n:translate="">Author</th>
<th class="cell3d" width="90%" i18n:translate="">Topic</th>
</tr>
<tr tal:define="msg nocall:here; one_msg python:1;" tal:omit-tag="">
<td metal:use-macro="here/forum_message_flat/macros/message"></td>
</tr>

<tr tal:condition="not:python:topic.getBRefs('parent')">
<td class="cell3d" colspan="2" style="text-align:center;"
i18n:translate="">
This topic contains no replies</td>
</tr>
</table>

<ul tal:define="msg nocall:topic">
<tal:block tal:content="structure
python:getattr(here.fcImages.icons, msg.message_icon)"
tal:on-error="structure string:&nbsp;&nbsp;&#149;&nbsp;">
</tal:block>&nbsp;
<b tal:omit-tag="python:msg is not here">
<a tal:omit-tag="python:msg.getId() == here.getId()"
tal:content="msg/Title" tal:attributes="href
msg/absolute_url"></a>
</b>- <span tal:replace="msg/Creator"></span>
<ul metal:use-macro="here/forum_topic_thread/macros/tree"></ul>
</ul>

</metal:block>

<metal:block metal:define-macro="tree"
tal:define="toPortalTime nocall:here/toPortalTime">
<ul>
<tal:block tal:repeat="msg msg/getChildren">
<tal:block tal:content="structure
python:getattr(here.fcImages.icons, msg.message_icon)"
tal:on-error="structure string:&nbsp;&nbsp;&#149;&nbsp;">
</tal:block>&nbsp;
<b tal:omit-tag="python:msg.getId() != here.getId()">
<a tal:omit-tag="python:msg.getId() == here.getId()"
tal:content="msg/Title"
tal:attributes="href string:${msg/absolute_url}/forum_topic"></a>
</b> - <span tal:replace="msg/Creator"></span>
- <span tal:replace="python:toPortalTime(msg.modified(),1)"></span>
<ul metal:use-macro="here/forum_topic_thread/macros/tree"></ul>
</tal:block>
</ul>
</metal:block>
</body>
</html>

--- NEW FILE: arrowDownAlternative.gif ---
(This appears to be a binary file; contents omitted.)

Index: forum_add_topic_form.pt
===================================================================
RCS file: /cvsroot/collective/CMFBoard/skins/cmfboard/forum_add_topic_form.pt,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- forum_add_topic_form.pt 24 Oct 2003 09:12:14 -0000 1.2
+++ forum_add_topic_form.pt 31 Oct 2003 11:41:29 -0000 1.3
@@ -10,7 +10,7 @@
<div metal:fill-slot="main" i18n:domain="CMFBoard"
tal:define="mtool nocall:here/portal_membership;
review_state python:here.portal_workflow.getInfoFor(here,
'review_state', '');
- errors python:request.get('errors', {});
+ errors python:request.get('errors', {}); add_topic python:1;
">

<metal:block
metal:use-macro="here/forum_widgets/macros/forum_links"></metal:block>
@@ -27,12 +27,12 @@
<h1 i18n:translate="">Add new topic</h1>
<p i18n:translate="add_topic_desciption">
Fill in the following form and click the Add button when ready</p>
-
- <form id="add_entry" name="add_entry_form" method="post"
+
+ <form id="add_entry" name="add_entry_form" method="post"
metal:define-macro="add_form"
class="group" enctype="multipart/form-data"
tal:attributes="action python:here.portal_form_url(template.id)">

- <span class="legend" i18n:translate="">Topic details</span>
+ <span class="legend" i18n:translate="">Details</span>

<table cellspacing="1" cellpadding="2" width="100%">
<tr>
@@ -93,7 +93,18 @@
</div>
</td>
</tr>
-
+ <tr>
+ <td i18n:translate="label_message_icon">Message icon</td>
+ <td>
+ <select name="message_icon">
+ <option value="">No icon</option>
+ <option class="opt" tal:repeat="icon
here/fcImages/icons/objectValues"
+ tal:content="icon/title_or_id"
+ tal:attributes="value icon/getId;
+ style string:background-image:
url(${icon/absolute_url})">test</option>
+ </select>
+ </td>
+ </tr>
<tr>
<td><label i18n:translate="label_image">Image</label></td>
<td tal:define="error errors/image|nothing">
@@ -122,7 +133,8 @@
</td>
</tr>

- <tal:block tal:condition="python:mtool.checkPermission('Manage forum
topic', here)">
+ <tal:block
+ tal:condition="python:exists('add_topic') and
mtool.checkPermission('Manage forum topic', here)">
<tr>
<td><label for="sticky_flag" i18n:translate="">Sticky
Flag</label></td>
<td><input id="sticky_flag" type="checkbox"
name="sticky_flag:boolean" /></td>

--- NEW FILE: forum_message_icons.pt ---
<html tal:define="portal_path here/portal_url/getPortalPath;">
<head>
<title>CMFBoard</title>

<script type="text/javascript">

function Init() {
if (document.getElementsByTagName)
var x = document.getElementsByTagName('TD');
else if (document.all)
var x = document.all.tags('TD');
for (var i=0;i<x.length;i++) {
x[i].onmouseover = over;
x[i].onmouseout = out;
x[i].onclick = click;
}
}

function over() {
this.style.border='1px dotted white';
}

function out() {
this.style.border='1px solid gray';
}

function click() {
window.opener.SetMessageIcon(this.id);
window.close();
}
</script>
</head>

<body bgcolor="white" onLoad="Init(); this.focus();">
<table border="1" cellpadding="1" cellspacing="1">
<tr>
<td id="icon1.gif" width="15" height="15"><img tal:attributes="src
string:$portal_path/fcImages/icons/icon1.gif"></td>
<td id="icon2.gif" width="15" height="15"><img tal:attributes="src
string:$portal_path/fcImages/icons/icon2.gif"></td>
<td id="icon3.gif" width="15" height="15"><img tal:attributes="src
string:$portal_path/fcImages/icons/icon3.gif"></td>
<td id="icon4.gif" width="15" height="15"><img tal:attributes="src
string:$portal_path/fcImages/icons/icon4.gif"></td>
</tr>
<tr>
<td id="icon5.gif" width="15" height="15"><img tal:attributes="src
string:$portal_path/fcImages/icons/icon5.gif"></td>
<td id="icon6.gif" width="15" height="15"><img tal:attributes="src
string:$portal_path/fcImages/icons/icon6.gif"></td>
<td id="icon7.gif" width="15" height="15"><img tal:attributes="src
string:$portal_path/fcImages/icons/icon7.gif"></td>
<td id="icon8.gif" width="15" height="15"><img tal:attributes="src
string:$portal_path/fcImages/icons/icon8.gif"></td>
</tr>
<tr>
<td id="icon9.gif" width="15" height="15"><img tal:attributes="src
string:$portal_path/fcImages/icons/icon9.gif"></td>
<td id="icon10.gif" width="15" height="15"><img tal:attributes="src
string:$portal_path/fcImages/icons/icon10.gif"></td>
<td id="icon11.gif" width="15" height="15"><img tal:attributes="src
string:$portal_path/fcImages/icons/icon11.gif"></td>
<td id="icon12.gif" width="15" height="15"><img tal:attributes="src
string:$portal_path/fcImages/icons/icon12.gif"></td>
</tr>
<tr>
<td id="icon13.gif" width="15" height="15"><img tal:attributes="src
string:$portal_path/fcImages/icons/icon13.gif"></td>
<td id="icon14.gif" width="15" height="15"><img tal:attributes="src
string:$portal_path/fcImages/icons/icon14.gif"></td>
<td id="icon15.gif" width="15" height="15"><img tal:attributes="src
string:$portal_path/fcImages/icons/icon15.gif"></td>
<td id="icon16.gif" width="15" height="15"><img tal:attributes="src
string:$portal_path/fcImages/icons/icon16.gif"></td>
</tr>
<tr>
<td id="icon17.gif" width="15" height="15"><img tal:attributes="src
string:$portal_path/fcImages/icons/icon17.gif"></td>
<td id="icon18.gif" width="15" height="15"><img tal:attributes="src
string:$portal_path/fcImages/icons/icon18.gif"></td>
<td id="icon19.gif" width="15" height="15"><img tal:attributes="src
string:$portal_path/fcImages/icons/icon19.gif"></td>
<td id="icon20.gif" width="15" height="15"><img tal:attributes="src
string:$portal_path/fcImages/icons/icon20.gif"></td>
</tr>
<tr>
<td id="icon21.gif" width="15" height="15"><img tal:attributes="src
string:$portal_path/fcImages/icons/icon21.gif"></td>
<td id="icon22.gif" width="15" height="15"><img tal:attributes="src
string:$portal_path/fcImages/icons/icon22.gif"></td>
<td id="icon23.gif" width="15" height="15"><img tal:attributes="src
string:$portal_path/fcImages/icons/icon23.gif"></td>
<td id="none" width="15" height="15">x</td>
</tr>
</table>
</body>
</html>

--- NEW FILE: forum_topic_thread.pt ---
<html>
<body>
<metal:block metal:define-macro="topic_view">
<table cellspacing="0" cellpadding="0" width="100%" class="ftable"
tal:define="hits here/Hits;idx Iterator;">
<tr class="shadedarker">
<th class="cell3d" width="10%" i18n:translate="">Author</th>
<th class="cell3d" width="90%" i18n:translate="">Topic</th>
</tr>
<tr tal:define="msg nocall:here; one_msg python:1;" tal:omit-tag="">
<td metal:use-macro="here/forum_message_flat/macros/message"></td>
</tr>

<tr tal:condition="not:python:topic.getBRefs('parent')">
<td class="cell3d" colspan="2" style="text-align:center;"
i18n:translate="">
This topic contains no replies</td>
</tr>
</table>

<ul tal:define="msg nocall:topic">
<tal:block tal:content="structure
python:getattr(here.fcImages.icons, msg.message_icon)"
tal:on-error="structure string:&nbsp;&nbsp;&#149;&nbsp;">
</tal:block>&nbsp;
<b tal:omit-tag="python:msg is not here">
<a tal:omit-tag="python:msg.getId() == here.getId()"
tal:content="msg/Title" tal:attributes="href
msg/absolute_url"></a>
</b>- <span tal:replace="msg/Creator"></span>
<ul metal:use-macro="here/forum_topic_thread/macros/tree"></ul>
</ul>

</metal:block>

<metal:block metal:define-macro="tree"
tal:define="toPortalTime nocall:here/toPortalTime">
<ul>
<tal:block tal:repeat="msg msg/getChildren">
<tal:block tal:content="structure
python:getattr(here.fcImages.icons, msg.message_icon)"
tal:on-error="structure string:&nbsp;&nbsp;&#149;&nbsp;">
</tal:block>&nbsp;
<b tal:omit-tag="python:msg.getId() != here.getId()">
<a tal:omit-tag="python:msg.getId() == here.getId()"
tal:content="msg/Title"
tal:attributes="href string:${msg/absolute_url}/forum_topic"></a>
</b> - <span tal:replace="msg/Creator"></span>
- <span tal:replace="python:toPortalTime(msg.modified(),1)"></span>
<ul metal:use-macro="here/forum_topic_thread/macros/tree"></ul>
</tal:block>
</ul>
</metal:block>
</body>
</html>

Index: forum_view.pt
===================================================================
RCS file: /cvsroot/collective/CMFBoard/skins/cmfboard/forum_view.pt,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -d -r1.4 -r1.5
--- forum_view.pt 28 Oct 2003 09:50:17 -0000 1.4
+++ forum_view.pt 31 Oct 2003 11:41:29 -0000 1.5
@@ -44,11 +44,12 @@

<!-- Main Table Constructor for forum expansion: Begin //-->
<tal:block tal:repeat="topic topics">
- <tr tal:define="ob topic/getObject;hits ob/hits;
+ <tr valign="middle"
+ tal:define="ob topic/getObject;hits ob/hits;msg ob/LastReply;
review_state topic/review_state;
locked python:review_state == 'locked';"
tal:attributes="class
python:test(repeat['topic'].odd(),'shadedark','shadelight')">
- <td class="cell3d" valign="middle">
+ <td class="cell3d" width="20px">
<img tal:condition="locked"
tal:attributes="src
string:${here/fcImages/absolute_url}/locked_topic.gif"
height="10" width="17" border="0" alt="Locked Topic"
@@ -63,11 +64,17 @@
tal:condition="python:not(locked) and hits < 500" />
</td>

- <td class="cell3d" valign="middle">&nbsp;
- <!-- subscribed_user_topics -->
- <img tal:condition="python:topic in []" i18n:translate="alt"
- tal:attributes="src
string:${here/fcImages/bullet-green-tiny.gif/absolute_url}"
- height="10" width="10" border="0" alt="Subscribed to this Topic"
/>
+ <td class="cell3d" width="15px">
+ <tal:block
+ tal:condition="python:hasattr(here.fcImages.icons,
msg.message_icon)"
+ tal:content="structure python:getattr(here.fcImages.icons,
msg.message_icon)"
+ tal:on-error="structure string:&nbsp;&#149;&nbsp;">
+ </tal:block>
+ <tal:block
+ tal:condition="python:not hasattr(here.fcImages.icons,
msg.message_icon)"
+ tal:content="structure python:getattr(here.fcImages.icons,
ob.message_icon)"
+ tal:on-error="structure string:&nbsp;&#149;&nbsp;">
+ </tal:block>
</td>

<td class="cell3d">
@@ -82,7 +89,7 @@
<tal:block tal:condition="python:topic.review_state!='normal'">
(<span tal:content="topic/review_state"
style="color:red;"></span>)
</tal:block>
- <br /><span class="small"
tal:content="python:ob.Content(add_breaks=0, preview=1)[:150]+' ..'"></span>
+ <br /><span class="small" tal:content="string:${ob/description}
.."></span>
</td>

<td class="cell3d" align="center" tal:define="creator
topic/Creator">
@@ -97,7 +104,7 @@
<td class="cell3d" align="center" tal:content="hits"></td>
<td class="cell3d" style="white-space:nowrap;text-align:center;">
<span tal:replace="python:toPortalTime(topic.modified, 1)" />
- <br />By: <b tal:content="ob/last_reply_user"></b>
+ <br />By: <b tal:content="topic/last_reply_user"></b>
</td>
</tr>
</tal:block>

Index: forum_styles.css.dtml
===================================================================
RCS file: /cvsroot/collective/CMFBoard/skins/cmfboard/forum_styles.css.dtml,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- forum_styles.css.dtml 16 Oct 2003 11:16:27 -0000 1.1
+++ forum_styles.css.dtml 31 Oct 2003 11:41:29 -0000 1.2
@@ -186,4 +186,93 @@
font-size: smaller;
}

+.opt {
+ background-repeat: no-repeat;
+ padding-left: 17px;
+}
+
+ul.menuBar {
+ padding: 0;
+ margin: 0;
+ margin-bottom: 1px;
+ color: &dtml-mainFontColor;;
+}
+ul.menuBar, ul.menuBar li.menuButton {
+ margin: 0;
+ padding: 0;
+ display: inline;
+ list-style: none;
+}
+
+ul.menuBar li.menuButton {
+ border: &dtml-contentTabBorder;;
+ border-style: none none none solid;
+}
+/* border-style: solid none solid solid; */
+ul.menuBar li.menuButton .menuIndicator {
+ color: &dtml-mainFontColor;;
+}
+
+ul.menuBar li.menuButton a {
+ background-image: url(<dtml-var portal_url>/arrowDownAlternative.gif);
+ background-repeat: no-repeat;
+ background-position: center right;
+ color: &dtml-contentTabFontColorSelected;;
+ cursor: pointer;
+ text-decoration: none;
+ z-index: 4;
+ margin: 0;
+ padding: 0 1em;
+ text-transform: &dtml-textTransform;;
+}
+
+ul.menu {
+ background: &dtml-contentTabBackground;;
+ border: &dtml-contentTabBorder;;
+ color: &dtml-contentTabFontColor;;
+ text-transform: &dtml-textTransform;;
+ position: absolute;
+ top: 0px;
+ left: 0px;
+ visibility: hidden;
+ text-align: left;
+ z-index: 5;
+ white-space: nowrap;
+ width: auto;
+ margin: 0;
+ padding: 0;
+ border-top: &dtml-contentTabBackground; 1px solid;
+}
+ul.menu, ul.menu li {
+ background: &dtml-contentTabBackground;;
+ list-style: none;
+ margin: 0;
+ padding: 0;
+ border-collapse: collapse;
+}
+ul.menu li {
+ margin: 0;
+ padding: 0;
+ border: none;
+}
+ul.menu li.menuItem a {
+ color: &dtml-contentTabFontColorSelected;;
+ background-image: none ! important;
+ display: block;
+ margin: 0;
+ padding: 0;
+ text-transform: none ! important;
+ text-decoration: none;
+ border: &dtml-contentTabBorder;;
+ border-color: &dtml-contentTabBackground;
+}
+ul.menu li.menuItem a:hover {
+ background-color: &dtml-contentTabFontColor;;
+ color: White;
+}
+ul.menu li.menuSep {
+ border-top: 1px solid &dtml-contentTabFontColor;;
+}
+
+
/* </dtml-with> */

--- NEW FILE: forum_change_view_mode.py ---
## Script (Python) "forum_change_view_mode"
##bind container=container
##bind context=context
##bind namespace=
##bind script=script
##bind subpath=traverse_subpath
##parameters=mode='flat', redirect=''
##title=
##

from DateTime import DateTime

req = context.REQUEST
res = req.RESPONSE

if mode not in ('flat','nested','thread','full_thread') :
mode = 'flat'


e = (DateTime('GMT') + 365).rfc822()
res.setCookie( context.Topic().UID(), mode, path='/', expires=e)

if redirect:
res.redirect(redirect)

--- NEW FILE: plone_menu.js.dtml ---
<dtml-let last_modified="_.DateTime()-14"
expires="_.DateTime()+7" >
<dtml-call "REQUEST.RESPONSE.setHeader( 'Content-Type', 'text/javascript' )">
<dtml-call "REQUEST.RESPONSE.setHeader( 'Last-Modified',
last_modified.toZone('GMT').rfc822() )">
<dtml-call "REQUEST.RESPONSE.setHeader( 'Cache-Control', 'max-age=36000,
must-revalidate' )">
<dtml-call "REQUEST.RESPONSE.setHeader( 'Expires',
expires.toZone('GMT').rfc822() )" >
</dtml-let>

// Code to determine the browser and version.

function Browser() {

var ua, s, i;

this.isIE = false; // Internet Explorer
this.isNS = false; // Netscape
this.version = null;

ua = navigator.userAgent;

s = "MSIE";
if ((i = ua.indexOf(s)) >= 0) {
this.isIE = true;
this.version = parseFloat(ua.substr(i + s.length));
return;
}

s = "Netscape6/";
if ((i = ua.indexOf(s)) >= 0) {
this.isNS = true;
this.version = parseFloat(ua.substr(i + s.length));
return;
}

// Treat any other "Gecko" browser as NS 6.1.

s = "Gecko";
if ((i = ua.indexOf(s)) >= 0) {
this.isNS = true;
this.version = 6.1;
return;
}
}

var browser = new Browser();

// Code for handling the menu bar and active button.

var activeButton = null;

// Capture mouse clicks on the page so any active button can be
// deactivated.

if (browser.isIE)
document.onmousedown = pageMousedown;
else
document.addEventListener("mousedown", pageMousedown, true);

function pageMousedown(event) {

var el;

// If there is no active button, exit.

if (activeButton == null)
return;

// Find the element that was clicked on.

if (browser.isIE)
el = window.event.srcElement;
else
el = (event.target.tagName ? event.target : event.target.parentNode);

// If the active button was clicked on, exit.

if (el == activeButton)
return;

// If the element is not part of a menu, reset and clear the active
// button.

if (getContainerWith(el, "UL", "menu") == null) {
resetButton(activeButton);
activeButton = null;
}
}

function buttonClick(event, menuId) {

var button;

// Get the target button element.

if (browser.isIE)
button = window.event.srcElement;
else
button = event.currentTarget;

// Blur focus from the link to remove that annoying outline.

button.blur();

// Associate the named menu to this button if not already done.
// Additionally, initialize menu display.

if (button.menu == null) {
button.menu = document.getElementById(menuId);
if (button.menu.isInitialized == null)
menuInit(button.menu);
}

// Reset the currently active button, if any.

if (activeButton != null)
resetButton(activeButton);

// Activate this button, unless it was the currently active one.

if (button != activeButton) {
depressButton(button);
activeButton = button;
}
else
activeButton = null;

return false;
}

function buttonMouseover(event, menuId) {

var button;

// Find the target button element.

if (browser.isIE)
button = window.event.srcElement;
else
button = event.currentTarget;

// If any other button menu is active, make this one active instead.

if (activeButton != null && activeButton != button)
buttonClick(event, menuId);
}

function depressButton(button) {

var x, y;

// Update the button's style class to make it look like it's
// depressed.

button.className += " menuButtonActive";

// Position the associated drop down menu under the button and
// show it.

x = getPageOffsetLeft(button);
y = getPageOffsetTop(button) + button.offsetHeight;

// For IE, adjust position.

if (browser.isIE) {
x += button.offsetParent.clientLeft;
y += button.offsetParent.clientTop;
}

button.menu.style.left = x + "px";
button.menu.style.top = y + "px";
button.menu.style.visibility = "visible";
}

function resetButton(button) {

// Restore the button's style class.

removeClassName(button, "menuButtonActive");

// Hide the button's menu, first closing any sub menus.

if (button.menu != null) {
closeSubMenu(button.menu);
button.menu.style.visibility = "hidden";
}
}

// Code to handle the menus and sub menus.

function menuMouseover(event) {

var menu;

// Find the target menu element.

if (browser.isIE)
menu = getContainerWith(window.event.srcElement, "UL", "menu");
else
menu = event.currentTarget;

// Close any active sub menu.

if (menu.activeItem != null)
closeSubMenu(menu);
}

function menuItemMouseover(event, menuId) {

var item, menu, x, y;

// Find the target item element and its parent menu element.

if (browser.isIE)
item = getContainerWith(window.event.srcElement, "LI", "menuItem");
else
item = event.currentTarget;
menu = getContainerWith(item, "UL", "menu");

// Close any active sub menu and mark this one as active.

if (menu.activeItem != null)
closeSubMenu(menu);
menu.activeItem = item;

// Highlight the item element.

item.className += " menuItemHighlight";

// Initialize the sub menu, if not already done.

if (item.subMenu == null) {
item.subMenu = document.getElementById(menuId);
if (item.subMenu.isInitialized == null)
menuInit(item.subMenu);
}

// Get position for submenu based on the menu item.

x = getPageOffsetLeft(item) + item.offsetWidth;
y = getPageOffsetTop(item);

// Adjust position to fit in view.

var maxX, maxY;

if (browser.isNS) {
maxX = window.scrollX + window.innerWidth;
maxY = window.scrollY + window.innerHeight;
}
if (browser.isIE) {
maxX = (document.documentElement.scrollLeft != 0 ?
document.documentElement.scrollLeft : document.body.scrollLeft)
+ (document.documentElement.clientWidth != 0 ?
document.documentElement.clientWidth : document.body.clientWidth);
maxY = (document.documentElement.scrollTop != 0 ?
document.documentElement.scrollTop : document.body.scrollTop)
+ (document.documentElement.clientHeight != 0 ?
document.documentElement.clientHeight : document.body.clientHeight);
}
maxX -= item.subMenu.offsetWidth;
maxY -= item.subMenu.offsetHeight;

if (x > maxX)
x = Math.max(0, x - item.offsetWidth - item.subMenu.offsetWidth
+ (menu.offsetWidth - item.offsetWidth));
y = Math.max(0, Math.min(y, maxY));

// Position and show it.

item.subMenu.style.left = x + "px";
item.subMenu.style.top = y + "px";
item.subMenu.style.visibility = "visible";

// Stop the event from bubbling.

if (browser.isIE)
window.event.cancelBubble = true;
else
event.stopPropagation();
}

function closeSubMenu(menu) {

if (menu == null || menu.activeItem == null)
return;

// Recursively close any sub menus.

if (menu.activeItem.subMenu != null) {
closeSubMenu(menu.activeItem.subMenu);
menu.activeItem.subMenu.style.visibility = "hidden";
menu.activeItem.subMenu = null;
}
removeClassName(menu.activeItem, "menuItemHighlight");
menu.activeItem = null;
}

// Code to initialize menus.

function menuInit(menu) {

var itemList, spanList;
var textEl, arrowEl;
var itemWidth;
var w, dw;
var i, j;

// For IE, replace arrow characters.

if (browser.isIE) {
menu.style.lineHeight = "2.5ex";
spanList = menu.getElementsByTagName("SPAN");
for (i = 0; i < spanList.length; i++)
if (hasClassName(spanList[i], "menuItemArrow")) {
spanList[i].style.fontFamily = "Webdings";
spanList[i].firstChild.nodeValue = "4";
}
}

// Find the width of a menu item.

itemList = menu.getElementsByTagName("A");
if (itemList.length > 0)
itemWidth = itemList[0].offsetWidth;
else
return;

// For items with arrows, add padding to item text to make the
// arrows flush right.

for (i = 0; i < itemList.length; i++) {
spanList = itemList[i].getElementsByTagName("A");
textEl = null;
arrowEl = null;
for (j = 0; j < spanList.length; j++) {
if (hasClassName(spanList[j], "menuItemText"))
textEl = spanList[j];
if (hasClassName(spanList[j], "menuItemArrow"))
arrowEl = spanList[j];
}
if (textEl != null && arrowEl != null)
textEl.style.paddingRight = (itemWidth
- (textEl.offsetWidth + arrowEl.offsetWidth)) + "px";
}

// Fix IE hover problem by setting an explicit width on first item of
// the menu.

if (browser.isIE) {
w = itemList[0].offsetWidth;
itemList[0].style.width = w + "px";
dw = itemList[0].offsetWidth - w;
w -= dw;
itemList[0].style.width = w + "px";
}

// Mark menu as initialized.

menu.isInitialized = true;
}

// General utility functions.

function getContainerWith(node, tagName, className) {

// Starting with the given node, find the nearest containing element
// with the specified tag name and style class.

while (node != null) {
if (node.tagName != null && node.tagName == tagName &&
hasClassName(node, className))
return node;
node = node.parentNode;
}

return node;
}

function hasClassName(el, name) {

var i, list;

// Return true if the given element currently has the given class
// name.

list = el.className.split(" ");
for (i = 0; i < list.length; i++)
if (list[i] == name)
return true;

return false;
}

function removeClassName(el, name) {

var i, curList, newList;

if (el.className == null)
return;

// Remove the given class name from the element's className property.

newList = new Array();
curList = el.className.split(" ");
for (i = 0; i < curList.length; i++)
if (curList[i] != name)
newList.push(curList[i]);
el.className = newList.join(" ");
}

function getPageOffsetLeft(el) {

var x;

// Return the x coordinate of an element relative to the page.

x = el.offsetLeft;
if (el.offsetParent != null)
x += getPageOffsetLeft(el.offsetParent);

return x;
}

function getPageOffsetTop(el) {

var y;

// Return the x coordinate of an element relative to the page.

y = el.offsetTop;
if (el.offsetParent != null)
y += getPageOffsetTop(el.offsetParent);

return y;
}




-------------------------------------------------------
This SF.net email is sponsored by: SF.net Giveback Program.
Does SourceForge.net help you be more productive? Does it
help you create better code? SHARE THE LOVE, and help us help
YOU! Click Here: http://sourceforge.net/donate/


<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

Recently Viewed:
qplus.devel/200...    network.jabber....    debian.qa-packa...    encryption.gpg....    python.dabo.dev...    uclinux.devel/2...    science.mathema...    recreation.pesc...    kernel.ck/2004-...    mozilla.devel.e...    tex.latex.prosp...    ietf.multi6/200...    bbc.cvs/2002-11...    xfree86.newbie/...    jakarta.taglibs...    altlinux.hardwa...    comedi/2002-05/...    horde.bugs/2004...    games.diplomacy...    finance.e-gold....    web.dom.test-su...    lang.ruby.rails...    os.netbsd.devel...    video.gstreamer...   
Home | advertise | OSDir is an inevitable website. super tiny logo

Free Magazines

Cisco News
Receive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business.
subscribe

Systems Management News, the newspaper for IT systems administration and data center managers! Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field.
subscribe

The Enterprise Newsweekly eWeek is the essential technology information source for builders of e-business.
subscribe

Oracle Magazine Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company.
subscribe

Total Telecom Total Telecom is "The Economist of the communications industry".
subscribe

Navigation