From 550a3a8abc0f892746bb960379401744c3eb2834 Mon Sep 17 00:00:00 2001 From: Franck VILLAUME Date: Thu, 28 Jul 2011 15:16:55 +0000 Subject: [PATCH] * first landing of projects_hierarchy in docman * jscook dies today. fusionforge is using jquery only --- .gitattributes | 21 +- src/common/docman/DocumentGroup.class.php | 14 +- src/common/docman/DocumentManager.class.php | 82 +- src/common/docman/actions/addsubdocgroup.php | 7 + src/common/docman/actions/editdocgroup.php | 23 +- src/common/docman/views/editdocgroup.php | 9 +- src/common/docman/views/listfile.php | 21 +- src/common/docman/views/tree.php | 42 +- src/www/docman/index.php | 15 +- src/www/jscook/JSCookMenu.js | 1146 ----------------- src/www/jscook/JSCookTree.js | 897 ------------- src/www/jscook/ThemePanel/arrow.gif | Bin 65 -> 0 bytes src/www/jscook/ThemePanel/arrowdown.gif | Bin 63 -> 0 bytes src/www/jscook/ThemePanel/blank.gif | Bin 807 -> 0 bytes src/www/jscook/ThemePanel/theme.css | 356 ----- src/www/jscook/ThemePanel/theme.js | 60 - src/www/jscook/ThemeXP/folder1.gif | Bin 163 -> 0 bytes src/www/jscook/ThemeXP/folder2.gif | Bin 242 -> 0 bytes src/www/jscook/ThemeXP/folderopen1.gif | Bin 139 -> 0 bytes src/www/jscook/ThemeXP/folderopen2.gif | Bin 349 -> 0 bytes src/www/jscook/ThemeXP/home.gif | Bin 229 -> 0 bytes src/www/jscook/ThemeXP/join.gif | Bin 73 -> 0 bytes src/www/jscook/ThemeXP/joinbottom.gif | Bin 70 -> 0 bytes src/www/jscook/ThemeXP/line.gif | Bin 70 -> 0 bytes src/www/jscook/ThemeXP/minus.gif | Bin 85 -> 0 bytes src/www/jscook/ThemeXP/minusbottom.gif | Bin 85 -> 0 bytes src/www/jscook/ThemeXP/page.gif | Bin 220 -> 0 bytes src/www/jscook/ThemeXP/plus.gif | Bin 131 -> 0 bytes src/www/jscook/ThemeXP/plusbottom.gif | Bin 89 -> 0 bytes src/www/jscook/ThemeXP/spacer.gif | Bin 62 -> 0 bytes src/www/jscook/ThemeXP/theme.css | 120 -- src/www/jscook/ThemeXP/theme.js | 87 -- src/www/themes/funky/css/theme-pages.css | 10 + .../docman/directory-with-documents.png | Bin 0 -> 782 bytes .../docman/directory-with-documents.png | Bin 0 -> 782 bytes 35 files changed, 103 insertions(+), 2807 deletions(-) delete mode 100644 src/www/jscook/JSCookMenu.js delete mode 100644 src/www/jscook/JSCookTree.js delete mode 100644 src/www/jscook/ThemePanel/arrow.gif delete mode 100644 src/www/jscook/ThemePanel/arrowdown.gif delete mode 100644 src/www/jscook/ThemePanel/blank.gif delete mode 100644 src/www/jscook/ThemePanel/theme.css delete mode 100644 src/www/jscook/ThemePanel/theme.js delete mode 100644 src/www/jscook/ThemeXP/folder1.gif delete mode 100644 src/www/jscook/ThemeXP/folder2.gif delete mode 100644 src/www/jscook/ThemeXP/folderopen1.gif delete mode 100644 src/www/jscook/ThemeXP/folderopen2.gif delete mode 100644 src/www/jscook/ThemeXP/home.gif delete mode 100644 src/www/jscook/ThemeXP/join.gif delete mode 100644 src/www/jscook/ThemeXP/joinbottom.gif delete mode 100644 src/www/jscook/ThemeXP/line.gif delete mode 100644 src/www/jscook/ThemeXP/minus.gif delete mode 100644 src/www/jscook/ThemeXP/minusbottom.gif delete mode 100644 src/www/jscook/ThemeXP/page.gif delete mode 100644 src/www/jscook/ThemeXP/plus.gif delete mode 100644 src/www/jscook/ThemeXP/plusbottom.gif delete mode 100644 src/www/jscook/ThemeXP/spacer.gif delete mode 100644 src/www/jscook/ThemeXP/theme.css delete mode 100644 src/www/jscook/ThemeXP/theme.js create mode 100644 src/www/themes/funky/images/docman/directory-with-documents.png create mode 100644 src/www/themes/gforge/images/docman/directory-with-documents.png diff --git a/.gitattributes b/.gitattributes index 7c0b460dbb..507ff410f2 100644 --- a/.gitattributes +++ b/.gitattributes @@ -4745,25 +4745,6 @@ src/www/include/unicode.php -text src/www/js/common.js -text src/www/js/sortable.js -text src/www/js/tooltips.js -text -src/www/jscook/ThemePanel/arrow.gif -text svneol=native#image/gif -src/www/jscook/ThemePanel/arrowdown.gif -text svneol=native#image/gif -src/www/jscook/ThemePanel/blank.gif -text svneol=native#image/gif -src/www/jscook/ThemePanel/theme.css svneol=native#text/css -src/www/jscook/ThemeXP/folder1.gif -text svneol=native#image/gif -src/www/jscook/ThemeXP/folder2.gif -text svneol=native#image/gif -src/www/jscook/ThemeXP/folderopen1.gif -text svneol=native#image/gif -src/www/jscook/ThemeXP/folderopen2.gif -text svneol=native#image/gif -src/www/jscook/ThemeXP/home.gif -text svneol=native#image/gif -src/www/jscook/ThemeXP/join.gif -text svneol=native#image/gif -src/www/jscook/ThemeXP/joinbottom.gif -text svneol=native#image/gif -src/www/jscook/ThemeXP/line.gif -text svneol=native#image/gif -src/www/jscook/ThemeXP/minus.gif -text svneol=native#image/gif -src/www/jscook/ThemeXP/minusbottom.gif -text svneol=native#image/gif -src/www/jscook/ThemeXP/page.gif -text svneol=native#image/gif -src/www/jscook/ThemeXP/plus.gif -text svneol=native#image/gif -src/www/jscook/ThemeXP/plusbottom.gif -text svneol=native#image/gif -src/www/jscook/ThemeXP/spacer.gif -text svneol=native#image/gif -src/www/jscook/ThemeXP/theme.css svneol=native#text/css src/www/my/dashboard.php -text src/www/pm/csv.php -text src/www/pm/format_csv.php -text @@ -4839,6 +4820,7 @@ src/www/themes/funky/images/category.png -text svneol=unset#image/png src/www/themes/funky/images/clear.png -text svneol=unset#image/png src/www/themes/funky/images/docman/configure-directory.png -text svneol=unset#image/png src/www/themes/funky/images/docman/delete-directory.png -text svneol=unset#image/png +src/www/themes/funky/images/docman/directory-with-documents.png -text svneol=unset#image/png src/www/themes/funky/images/docman/directory.png -text svneol=unset#image/png src/www/themes/funky/images/docman/document-reserved.png -text svneol=unset#image/png src/www/themes/funky/images/docman/download-directory-zip.png -text svneol=unset#image/png @@ -4972,6 +4954,7 @@ src/www/themes/gforge/images/category.png -text svneol=unset#image/png src/www/themes/gforge/images/clear.png -text svneol=unset#image/png src/www/themes/gforge/images/docman/configure-directory.png -text svneol=unset#image/png src/www/themes/gforge/images/docman/delete-directory.png -text svneol=unset#image/png +src/www/themes/gforge/images/docman/directory-with-documents.png -text svneol=unset#image/png src/www/themes/gforge/images/docman/directory.png -text svneol=unset#image/png src/www/themes/gforge/images/docman/document-reserved.png -text svneol=unset#image/png src/www/themes/gforge/images/docman/download-directory-zip.png -text svneol=unset#image/png diff --git a/src/common/docman/DocumentGroup.class.php b/src/common/docman/DocumentGroup.class.php index 961e6ee1e8..e0480d3b7a 100644 --- a/src/common/docman/DocumentGroup.class.php +++ b/src/common/docman/DocumentGroup.class.php @@ -50,7 +50,7 @@ class DocumentGroup extends Error { * * @param object Group object. * @param array (all fields from doc_groups) OR doc_group id from database. - * @return boolean success. + * @return boolean True on success. * @access public */ function DocumentGroup(&$Group, $data = false) { @@ -71,9 +71,11 @@ class DocumentGroup extends Error { if ($data) { if (is_array($data)) { $this->data_array =& $data; -// -// should verify group_id -// + if ($this->data_array['group_id'] != $this->Group->getID()) { + $this->setError('DocumentGroup:: '. _('Group_id in db result does not match Group Object')); + $this->data_array = null; + return false; + } return true; } else { if (!$this->fetchData($data)) { @@ -237,8 +239,8 @@ class DocumentGroup extends Error { * @access public */ function fetchData($id) { - $res = db_query_params('SELECT * FROM doc_groups WHERE doc_group = $1', - array($id)); + $res = db_query_params('SELECT * FROM doc_groups WHERE doc_group = $1 and group_id = $2', + array($id, $this->Group->getID())); if (!$res || db_numrows($res) < 1) { $this->setError(_('Invalid Document Folder ID')); return false; diff --git a/src/common/docman/DocumentManager.class.php b/src/common/docman/DocumentManager.class.php index 25f817e7ca..67a028b6b9 100644 --- a/src/common/docman/DocumentManager.class.php +++ b/src/common/docman/DocumentManager.class.php @@ -126,10 +126,12 @@ class DocumentManager extends Error { /** * getTree - display recursively the content of the doc_group. Only doc_groups within doc_groups. * + * @param integer the selected directory * @param string the type of link in the menu - * @param int the doc_group to start: default 0 + * @param integer the doc_group to start: default 0 */ - function getTree($linkmenu, $docGroupId = 0) { + function getTree($selecteddir, $linkmenu, $docGroupId = 0) { + global $g; // the master group of all the groups .... anyway. $dg = new DocumentGroup($this->Group); switch ($linkmenu) { case "listtrashfile": { @@ -142,67 +144,23 @@ class DocumentManager extends Error { } } $subGroupIdArr = $dg->getSubgroup($docGroupId, $stateId); - echo ''; - } - - function getJSTree($linkmenu, $displayProjectName) { - global $idExposeTreeIndex; - $label = '/'; - if ($displayProjectName) - $label = $this->Group->getPublicName() - ?> - - - - - - - - getID()) - $idExposeTreeIndex = $idhtml; - - echo " - ['".''."', '".addslashes($dg->getName())."', '?group_id=".$this->Group->getID()."&view=".$linkmenu."&dirid=".$dg->getID()."', '', '',"; - $this->getJSTreeEntry($dg->getID(), $linkmenu); - echo ", - ],"; + if (sizeof($subGroupIdArr)) { + echo ''; } } } diff --git a/src/common/docman/actions/addsubdocgroup.php b/src/common/docman/actions/addsubdocgroup.php index d182e4da64..6879d8ab8b 100644 --- a/src/common/docman/actions/addsubdocgroup.php +++ b/src/common/docman/actions/addsubdocgroup.php @@ -31,6 +31,13 @@ global $g; // group object global $dirid; // id of doc_group global $group_id; // id of group +$childgroup_id = getIntFromRequest('childgroup_id'); +if ($childgroup_id) { + $origin_group_id = $group_id; + $group_id = $childgroup_id; + $g = group_get_object($group_id); +} + if (!forge_check_perm('docman', $group_id, 'approve')) { $return_msg = _('Document Manager Action Denied.'); if ($dirid) { diff --git a/src/common/docman/actions/editdocgroup.php b/src/common/docman/actions/editdocgroup.php index 113944828e..bb2df5bcc3 100644 --- a/src/common/docman/actions/editdocgroup.php +++ b/src/common/docman/actions/editdocgroup.php @@ -28,20 +28,30 @@ global $g; //group object global $dirid; //id of doc_group global $group_id; // id of group +global $childgroup_id; // plugin projects hierarchy handler + if (!forge_check_perm('docman', $group_id, 'approve')) { $return_msg = _('Document Manager Action Denied.'); session_redirect('/docman/?group_id='.$group_id.'&view=listfile&dirid='.$dirid.'&warning_msg='.urlencode($return_msg)); } +$urlredirect = '/docman/?group_id='.$group_id.'&view=listfile&dirid='.$dirid; + +// plugin projects_hierarchy handler +if ($childgroup_id) { + $g = group_get_object($childgroup_id); + $urlredirect = '/docman/?group_id='.$group_id.'&view=listfile&dirid='.$dirid.'&childgroup_id='.$childgroup_id; +} + $groupname = getStringFromRequest('groupname'); $parent_dirid = getIntFromRequest('parent_dirid'); $dg = new DocumentGroup($g, $dirid); if ($dg->isError()) - session_redirect('/docman/?group_id='.$group_id.'&view=listfile&dirid='.$dirid.'&error_msg='.urlencode($dg->getErrorMessage())); + session_redirect($urlredirect.'&error_msg='.urlencode($dg->getErrorMessage())); if (!$dg->update($groupname, $parent_dirid)) - session_redirect('/docman/?group_id='.$group_id.'&view=listfile&dirid='.$dirid.'&error_msg='.urlencode($dg->getErrorMessage())); + session_redirect($urlredirect.'&error_msg='.urlencode($dg->getErrorMessage())); if ($dg->getState() == 2) { /** @@ -72,8 +82,11 @@ if ($dg->getState() == 2) { } if (!$dg->setStateID('1')) - session_redirect('/docman/?group_id='.$group_id.'&view=listfile&dirid='.$dirid.'&error_msg='.urlencode($dg->getErrorMessage())); + session_redirect($urlredirect.'&error_msg='.urlencode($dg->getErrorMessage())); + +$return_msg = sprintf(_('Documents folder %s updated successfully'), $dg->getName()); +if ($childgroup_id) + $return_msg .= ' '.sprintf(_('on project %s'), $g->getPublicName()); -$return_msg = sprintf(_('Documents folder %s updated successfully.', $dg->getName())); -session_redirect('/docman/?group_id='.$group_id.'&view=listfile&dirid='.$dirid.'&feedback='.urlencode($return_msg)); +session_redirect($urlredirect.'&feedback='.urlencode($return_msg)); ?> diff --git a/src/common/docman/views/editdocgroup.php b/src/common/docman/views/editdocgroup.php index a0e2512c60..6e7ba56ebf 100644 --- a/src/common/docman/views/editdocgroup.php +++ b/src/common/docman/views/editdocgroup.php @@ -38,13 +38,20 @@ if (!forge_check_perm('docman', $group_id, 'approve')) { session_redirect('/docman/?group_id='.$group_id.'&warning_msg='.urlencode($return_msg)); } +// plugin projects_hierarchy +$actionurl = '?group_id='.$group_id.'&action=editdocgroup'; +if ($childgroup_id) { + $g = group_get_object($childgroup_id); + $actionurl = '?group_id='.$group_id.'&action=editdocgroup&childgroup_id='.$childgroup_id; +} + $dg = new DocumentGroup($g, $dirid); if ($dg->isError()) session_redirect('/docman/?group_id='.$group_id.'&error_msg='.urlencode($dg->getErrorMessage())); ?>
-
+ diff --git a/src/common/docman/views/listfile.php b/src/common/docman/views/listfile.php index 9576583d54..b4dfd06c98 100644 --- a/src/common/docman/views/listfile.php +++ b/src/common/docman/views/listfile.php @@ -36,11 +36,30 @@ global $u; // User object global $g; // the Group object global $df; +$childgroup_id = getIntFromRequest('childgroup_id'); + if (!forge_check_perm('docman', $group_id, 'read')) { $return_msg= _('Document Manager Access Denied'); session_redirect('/docman/?group_id='.$group_id.'&warning_msg='.urlencode($return_msg)); } +// plugin projects_hierarchy +if ($childgroup_id) { + $g = group_get_object($childgroup_id); +} + +$df = new DocumentFactory($g); +if ($df->isError()) + exit_error($df->getErrorMessage(), 'docman'); + +$dgf = new DocumentGroupFactory($g); +if ($dgf->isError()) + exit_error($dgf->getErrorMessage(), 'docman'); + +$dgh = new DocumentGroupHTML($g); +if ($dgh->isError()) + exit_error($dgh->getErrorMessage(), 'docman'); + $df->setDocGroupID($dirid); /** @@ -115,7 +134,7 @@ jQuery(document).ready(function() { /* ]]> */'; +echo '
'; include ($gfcommon.'docman/views/tree.php'); echo '
'; echo '
'; diff --git a/src/common/docman/views/tree.php b/src/common/docman/views/tree.php index 468e13aab2..0c6dbf03de 100644 --- a/src/common/docman/views/tree.php +++ b/src/common/docman/views/tree.php @@ -27,62 +27,36 @@ /* please do not add require here : use www/docman/index.php to add require */ /* global variables used */ global $group_id; // id of the group -global $nested_docs; global $linkmenu; global $g; // the group object +global $dirid; // the selected directory if (!forge_check_perm('docman', $group_id, 'read')) { $return_msg= _('Document Manager Access Denied'); session_redirect('/docman/?group_id='.$group_id.'&warning_msg='.urlencode($return_msg)); } -/** - * needed for docman_recursive_display function call - * see utils.php for more information - */ -$idExposeTreeIndex = 0; -$idhtml = 0; -$displayProjectName = 0; +// plugin hierarchy : since tree is loaded from listfile.php, you need to be sure that +if ($childgroup_id) { + $g = group_get_object($group_id); +} echo '
'; $dm = new DocumentManager($g); -$dm->getJSTree($linkmenu, $displayProjectName); -echo ''; - +$dm->getTree($dirid, $linkmenu); if ($g->usesPlugin('projects_hierarchy')) { $projectsHierarchy = plugin_get_object('projects_hierarchy'); $projectIDsArray = $projectsHierarchy->getFamilyID($group_id, 'child', false, 'validated'); - if (sizeof($projectIDsArray)) - $displayProjectName = 1; } if (isset($projectIDsArray) && is_array($projectIDsArray)) { - if (sizeof($projectIDsArray)) - echo '
'._('Child projects').'
'; foreach ($projectIDsArray as $key=>$projectID) { $groupObject = group_get_object($projectID); if ($groupObject->usesDocman() && $projectsHierarchy->getDocmanStatus($groupObject->getID()) && forge_check_perm('docman', $groupObject->getID(), 'read')) { - echo '
'; - if ($displayProjectName) - $label = $g->getPublicName(); + echo '
'._('Child project:').$groupObject->getPublicName().'
'; $dm = new DocumentManager($groupObject); - $dm->getJSTree($linkmenu, $displayProjectName); - echo ''; + $dm->getTree($dirid, $linkmenu); } } } diff --git a/src/www/docman/index.php b/src/www/docman/index.php index 0a18e3cd4b..473365fac5 100644 --- a/src/www/docman/index.php +++ b/src/www/docman/index.php @@ -63,6 +63,8 @@ $dirid = getIntFromRequest('dirid'); if (empty($dirid)) $dirid = 0; +$childgroup_id = getIntFromRequest('childgroup_id'); + /* everything sounds ok, now let do the job */ $action = getStringFromRequest('action'); switch ($action) { @@ -100,22 +102,9 @@ if (session_loggedin()) { } } -$df = new DocumentFactory($g); -if ($df->isError()) - exit_error($df->getErrorMessage(), 'docman'); - -$dgf = new DocumentGroupFactory($g); -if ($dgf->isError()) - exit_error($dgf->getErrorMessage(), 'docman'); - -$dgh = new DocumentGroupHTML($g); -if ($dgh->isError()) - exit_error($dgh->getErrorMessage(), 'docman'); - html_use_storage(); use_javascript('scripts/DocManController.js'); use_javascript('/js/sortable.js'); -use_stylesheet('/jscook/ThemeXP/theme.css'); $title = _('Documents for ').$g->getPublicName(); diff --git a/src/www/jscook/JSCookMenu.js b/src/www/jscook/JSCookMenu.js deleted file mode 100644 index 90dca14366..0000000000 --- a/src/www/jscook/JSCookMenu.js +++ /dev/null @@ -1,1146 +0,0 @@ -/* - JSCookMenu v1.4.4. (c) Copyright 2002-2005 by Heng Yuan - - Permission is hereby granted, free of charge, to any person obtaining a - copy of this software and associated documentation files (the "Software"), - to deal in the Software without restriction, including without limitation - the rights to use, copy, modify, merge, publish, distribute, sublicense, - and/or sell copies of the Software, and to permit persons to whom the - Software is furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included - in all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - ITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - DEALINGS IN THE SOFTWARE. -*/ - -// Globals -var _cmIDCount = 0; -var _cmIDName = 'cmSubMenuID'; // for creating submenu id - -var _cmTimeOut = null; // how long the menu would stay -var _cmCurrentItem = null; // the current menu item being selected; - -var _cmNoAction = new Object (); // indicate that the item cannot be hovered. -var _cmNoClick = new Object (); // similar to _cmNoAction but does not respond to mouseup/mousedown events -var _cmSplit = new Object (); // indicate that the item is a menu split - -var _cmItemList = new Array (); // a simple list of items - -// default node properties -var _cmNodeProperties = -{ - // main menu display attributes - // - // Note. When the menu bar is horizontal, - // mainFolderLeft and mainFolderRight are - // put in . When the menu - // bar is vertical, they would be put in - // a separate TD cell. - - // HTML code to the left of the folder item - mainFolderLeft: '', - // HTML code to the right of the folder item - mainFolderRight: '', - // HTML code to the left of the regular item - mainItemLeft: '', - // HTML code to the right of the regular item - mainItemRight: '', - - // sub menu display attributes - - // HTML code to the left of the folder item - folderLeft: '', - // HTML code to the right of the folder item - folderRight: '', - // HTML code to the left of the regular item - itemLeft: '', - // HTML code to the right of the regular item - itemRight: '', - // cell spacing for main menu - mainSpacing: 0, - // cell spacing for sub menus - subSpacing: 0, - // auto disappear time for submenus in milli-seconds - delay: 500, - - // act on click to open sub menu - // not yet implemented - // 0 : use default behavior - // 1 : hover open in all cases - // 2 : click on main, hover on sub - // 3 : click open in all cases - clickOpen: 1 -}; - -////////////////////////////////////////////////////////////////////// -// -// Drawing Functions and Utility Functions -// -////////////////////////////////////////////////////////////////////// - -// -// produce a new unique id -// -function cmNewID () -{ - return _cmIDName + (++_cmIDCount); -} - -// -// return the property string for the menu item -// -function cmActionItem (item, prefix, isMain, idSub, orient, nodeProperties) -{ - var clickOpen = _cmNodeProperties.clickOpen; - if (nodeProperties.clickOpen) - clickOpen = nodeProperties.clickOpen; - - // var index = _cmItemList.push (item) - 1; - _cmItemList[_cmItemList.length] = item; - var index = _cmItemList.length - 1; - idSub = (!idSub) ? 'null' : ('\'' + idSub + '\''); - orient = '\'' + orient + '\''; - prefix = '\'' + prefix + '\''; - var onClick = (clickOpen == 3) || (clickOpen == 2 && isMain); - var returnStr; - if (onClick) - returnStr = ' onmouseover="cmItemMouseOver (this,' + prefix + ',' + isMain + ',' + idSub + ',' + index + ')" onmousedown="cmItemMouseDownOpenSub (this,' + index + ',' + prefix + ',' + orient + ',' + idSub + ')"'; - else - returnStr = ' onmouseover="cmItemMouseOverOpenSub (this,' + prefix + ',' + isMain + ',' + idSub + ',' + orient + ',' + index + ')" onmousedown="cmItemMouseDown (this,' + index + ')"'; - return returnStr + ' onmouseout="cmItemMouseOut (this,' + nodeProperties.delay + ')" onmouseup="cmItemMouseUp (this,' + index + ')"'; -} - -// -// this one is used by _cmNoClick to only take care of onmouseover and onmouseout -// events which are associated with menu but not actions associated with menu clicking/closing -// -function cmNoClickItem (item, prefix, isMain, idSub, orient, nodeProperties) -{ - // var index = _cmItemList.push (item) - 1; - _cmItemList[_cmItemList.length] = item; - var index = _cmItemList.length - 1; - idSub = (!idSub) ? 'null' : ('\'' + idSub + '\''); - orient = '\'' + orient + '\''; - prefix = '\'' + prefix + '\''; - return ' onmouseover="cmItemMouseOver (this,' + prefix + ',' + isMain + ',' + idSub + ',' + index + ')" onmouseout="cmItemMouseOut (this,' + nodeProperties.delay + ')"'; -} - -function cmNoActionItem (item, prefix) -{ - return item[1]; -} - -function cmSplitItem (prefix, isMain, vertical) -{ - var classStr = 'cm' + prefix; - if (isMain) - { - classStr += 'Main'; - if (vertical) - classStr += 'HSplit'; - else - classStr += 'VSplit'; - } - else - classStr += 'HSplit'; - return eval (classStr); -} - -// -// draw the sub menu recursively -// -function cmDrawSubMenu (subMenu, prefix, id, orient, nodeProperties) -{ - var str = '
'; - var strSub = ''; - - var item; - var idSub; - var hasChild; - - var i; - - var classStr; - - for (i = 5; i < subMenu.length; ++i) - { - item = subMenu[i]; - if (!item) - continue; - - if (item == _cmSplit) - item = cmSplitItem (prefix, 0, true); - - hasChild = (item.length > 5); - idSub = hasChild ? cmNewID () : null; - - str += ''; - - if (item[0] != null) - str += item[0]; - else - str += hasChild ? nodeProperties.folderLeft : nodeProperties.itemLeft; - - str += ''; - } - - str += '
' + item[1]; - - str += ''; - - if (hasChild) - { - str += nodeProperties.folderRight; - strSub += cmDrawSubMenu (item, prefix, idSub, orient, nodeProperties); - } - else - str += nodeProperties.itemRight; - str += '
' + strSub; - return str; -} - -// -// The function that builds the menu inside the specified element id. -// -// @param id id of the element -// orient orientation of the menu in [hv][ab][lr] format -// menu the menu object to be drawn -// nodeProperties properties for each menu node -// -function cmDraw (id, menu, orient, nodeProperties, prefix) -{ - var obj = cmGetObject (id); - - if (!nodeProperties) - nodeProperties = _cmNodeProperties; - if (!prefix) - prefix = ''; - - var str = ''; - var strSub = ''; - - if (!orient) - orient = 'hbr'; - - var orientStr = String (orient); - var orientSub; - var vertical; - - // draw the main menu items - if (orientStr.charAt (0) == 'h') - { - // horizontal menu - orientSub = 'v' + orientStr.substr (1, 2); - str += ''; - vertical = false; - } - else - { - // vertical menu - orientSub = 'v' + orientStr.substr (1, 2); - vertical = true; - } - - var i; - var item; - var idSub; - var hasChild; - - var classStr; - - for (i = 0; i < menu.length; ++i) - { - item = menu[i]; - - if (!item) - continue; - - str += vertical ? ' 5); - idSub = hasChild ? cmNewID () : null; - - str += cmActionItem (item, prefix, 1, idSub, orient, nodeProperties) + '>'; - - if (item == _cmSplit) - item = cmSplitItem (prefix, 1, vertical); - - if (item[0] == _cmNoAction || item[0] == _cmNoClick) - { - str += cmNoActionItem (item, prefix); - str += vertical? '' : ''; - continue; - } - - classStr = prefix + 'Main' + (hasChild ? 'Folder' : 'Item'); - - str += vertical ? ''; - - str += (item[0] == null) ? (hasChild ? nodeProperties.mainFolderLeft : nodeProperties.mainItemLeft) - : item[0]; - str += vertical ? '' : ''; - - str += vertical ? ''; - str += item[1]; - - str += vertical ? '' : ''; - - str += vertical ? ''; - - str += hasChild ? nodeProperties.mainFolderRight : nodeProperties.mainItemRight; - - str += vertical ? '' : ''; - - str += vertical ? '' : ''; - - if (hasChild) - strSub += cmDrawSubMenu (item, prefix, idSub, orientSub, nodeProperties); - } - if (!vertical) - str += ''; - str += '
' + strSub; - obj.innerHTML = str; - //document.write ("" + str + ""); -} - -// -// The function builds the menu inside the specified element id. -// -// This function is similar to cmDraw except that menu is taken from HTML node -// rather a javascript tree. This feature allows links to be scanned by search -// bots. -// -// This function basically converts HTML node to a javascript tree, and then calls -// cmDraw to draw the actual menu, replacing the hidden menu tree. -// -// Format: -// -// -function cmDrawFromText (id, orient, nodeProperties, prefix) -{ - var domMenu = cmGetObject (id); - var menu = null; - for (var currentDomItem = domMenu.firstChild; currentDomItem; currentDomItem = currentDomItem.nextSibling) - { - if (!currentDomItem.tagName || currentDomItem.tagName.toLowerCase () != 'ul') - continue; - menu = cmDrawFromTextSubMenu (currentDomItem); - break; - } - if (menu) - cmDraw (id, menu, orient, nodeProperties, prefix); -} - -// -// a recursive function that build menu tree structure -// -function cmDrawFromTextSubMenu (domMenu) -{ - var items = new Array (); - for (var currentDomItem = domMenu.firstChild; currentDomItem; currentDomItem = currentDomItem.nextSibling) - { - if (!currentDomItem.tagName || currentDomItem.tagName.toLowerCase () != 'li') - continue; - if (currentDomItem.firstChild == null) - { - items[items.length] = _cmSplit; - continue; - } - var item = new Array (); - var currentItem = currentDomItem.firstChild; - for (; currentItem; currentItem = currentItem.nextSibling) - { - // scan for span tag - if (!currentItem.tagName || currentItem.tagName.toLowerCase () != 'span') - continue; - if (!currentItem.firstChild) - item[0] = null; - else - item[0] = currentItem.innerHTML; - break; - } - if (!currentItem) - continue; - for (; currentItem; currentItem = currentItem.nextSibling) - { - // scan for span tag - if (!currentItem.tagName || currentItem.tagName.toLowerCase () != 'a') - continue; - item[1] = currentItem.innerHTML; - item[2] = currentItem.href; - item[3] = currentItem.target; - item[4] = currentItem.title; - if (item[4] == '') - item[4] = null; - break; - } - - for (; currentItem; currentItem = currentItem.nextSibling) - { - // scan for span tag - if (!currentItem.tagName || currentItem.tagName.toLowerCase () != 'ul') - continue; - var subMenuItems = cmDrawFromTextSubMenu (currentItem); - for (i = 0; i < subMenuItems.length; ++i) - item[i + 5] = subMenuItems[i]; - break; - } - items[items.length] = item; - } - return items; -} - -////////////////////////////////////////////////////////////////////// -// -// Mouse Event Handling Functions -// -////////////////////////////////////////////////////////////////////// - -// -// action should be taken for mouse moving in to the menu item -// -// Here we just do things concerning this menu item, w/o opening sub menus. -// -function cmItemMouseOver (obj, prefix, isMain, idSub, index) -{ - clearTimeout (_cmTimeOut); - - if (!obj.cmPrefix) - { - obj.cmPrefix = prefix; - obj.cmIsMain = isMain; - } - - var thisMenu = cmGetThisMenu (obj, prefix); - - // insert obj into cmItems if cmItems doesn't have obj - if (!thisMenu.cmItems) - thisMenu.cmItems = new Array (); - var i; - for (i = 0; i < thisMenu.cmItems.length; ++i) - { - if (thisMenu.cmItems[i] == obj) - break; - } - if (i == thisMenu.cmItems.length) - { - //thisMenu.cmItems.push (obj); - thisMenu.cmItems[i] = obj; - } - - // hide the previous submenu that is not this branch - if (_cmCurrentItem) - { - // occationally, we get this case when user - // move the mouse slowly to the border - if (_cmCurrentItem == obj || _cmCurrentItem == thisMenu) - { - var item = _cmItemList[index]; - cmSetStatus (item); - return; - } - - var thatPrefix = _cmCurrentItem.cmPrefix; - var thatMenu = cmGetThisMenu (_cmCurrentItem, thatPrefix); - - if (thatMenu != thisMenu.cmParentMenu) - { - if (_cmCurrentItem.cmIsMain) - _cmCurrentItem.className = thatPrefix + 'MainItem'; - else - _cmCurrentItem.className = thatPrefix + 'MenuItem'; - if (thatMenu.id != idSub) - cmHideMenu (thatMenu, thisMenu, thatPrefix); - } - } - - // okay, set the current menu to this obj - _cmCurrentItem = obj; - - // just in case, reset all items in this menu to MenuItem - cmResetMenu (thisMenu, prefix); - - var item = _cmItemList[index]; - var isDefaultItem = cmIsDefaultItem (item); - - if (isDefaultItem) - { - if (isMain) - obj.className = prefix + 'MainItemHover'; - else - obj.className = prefix + 'MenuItemHover'; - } - - cmSetStatus (item); -} - -// -// action should be taken for mouse moving in to the menu item -// -// This function also opens sub menu -// -function cmItemMouseOverOpenSub (obj, prefix, isMain, idSub, orient, index) -{ - cmItemMouseOver (obj, prefix, isMain, idSub, index); - - if (idSub) - { - var subMenu = cmGetObject (idSub); - cmShowSubMenu (obj, prefix, subMenu, orient); - } -} - -// -// action should be taken for mouse moving out of the menu item -// -function cmItemMouseOut (obj, delayTime) -{ - if (!delayTime) - delayTime = _cmNodeProperties.delay; - _cmTimeOut = window.setTimeout ('cmHideMenuTime ()', delayTime); - window.defaultStatus = ''; -} - -// -// action should be taken for mouse button down at a menu item -// -function cmItemMouseDown (obj, index) -{ - if (cmIsDefaultItem (_cmItemList[index])) - { - if (obj.cmIsMain) - obj.className = obj.cmPrefix + 'MainItemActive'; - else - obj.className = obj.cmPrefix + 'MenuItemActive'; - } -} - -// -// action should be taken for mouse button down at a menu item -// this is one also opens submenu if needed -// -function cmItemMouseDownOpenSub (obj, index, prefix, orient, idSub) -{ - cmItemMouseDown (obj, index); - - if (idSub) - { - var subMenu = cmGetObject (idSub); - cmShowSubMenu (obj, prefix, subMenu, orient); - } -} - -// -// action should be taken for mouse button up at a menu item -// -function cmItemMouseUp (obj, index) -{ - var item = _cmItemList[index]; - - var link = null, target = '_self'; - - if (item.length > 2) - link = item[2]; - if (item.length > 3 && item[3]) - target = item[3]; - - if (link != null) - { - window.open (link, target); - } - - var prefix = obj.cmPrefix; - var thisMenu = cmGetThisMenu (obj, prefix); - - var hasChild = (item.length > 5); - if (!hasChild) - { - if (cmIsDefaultItem (item)) - { - if (obj.cmIsMain) - obj.className = prefix + 'MainItem'; - else - obj.className = prefix + 'MenuItem'; - } - cmHideMenu (thisMenu, null, prefix); - } - else - { - if (cmIsDefaultItem (item)) - { - if (obj.cmIsMain) - obj.className = prefix + 'MainItemHover'; - else - obj.className = prefix + 'MenuItemHover'; - } - } -} - -////////////////////////////////////////////////////////////////////// -// -// Mouse Event Support Utility Functions -// -////////////////////////////////////////////////////////////////////// - -// -// move submenu to the appropriate location -// -// @param obj the menu item that opens up the subMenu -// subMenu the sub menu to be shown -// orient the orientation of the subMenu -// -function cmMoveSubMenu (obj, subMenu, orient) -{ - var mode = String (orient); - var p = subMenu.offsetParent; - var subMenuWidth = cmGetWidth (subMenu); - var horiz = cmGetHorizontalAlign (obj, mode, p, subMenuWidth); - if (mode.charAt (0) == 'h') - { - if (mode.charAt (1) == 'b') - subMenu.style.top = (cmGetYAt (obj, p) + cmGetHeight (obj)) + 'px'; - else - subMenu.style.top = (cmGetYAt (obj, p) - cmGetHeight (subMenu)) + 'px'; - if (horiz == 'r') - subMenu.style.left = (cmGetXAt (obj, p)) + 'px'; - else - subMenu.style.left = (cmGetXAt (obj, p) + cmGetWidth (obj) - subMenuWidth) + 'px'; - } - else - { - if (horiz == 'r') - subMenu.style.left = (cmGetXAt (obj, p) + cmGetWidth (obj)) + 'px'; - else - subMenu.style.left = (cmGetXAt (obj, p) - subMenuWidth) + 'px'; - if (mode.charAt (1) == 'b') - subMenu.style.top = (cmGetYAt (obj, p)) + 'px'; - else - subMenu.style.top = (cmGetYAt (obj, p) + cmGetHeight (obj) - cmGetHeight (subMenu)) + 'px'; - } -} - -// -// automatically re-adjust the menu position based on available screen size. -// -function cmGetHorizontalAlign (obj, mode, p, subMenuWidth) -{ - var horiz = mode.charAt (2); - if (!(document.body)) - return horiz; - var body = document.body; - var browserLeft; - var browserRight; - if (window.innerWidth) - { - // DOM window attributes - browserLeft = window.pageXOffset; - browserRight = window.innerWidth + browserLeft; - } - else if (body.clientWidth) - { - // IE attributes - browserLeft = body.clientLeft; - browserRight = body.clientWidth + browserLeft; - } - else - return horiz; - if (mode.charAt (0) == 'h') - { - if (horiz == 'r' && (cmGetXAt (obj) + subMenuWidth) > browserRight) - horiz = 'l'; - if (horiz == 'l' && (cmGetXAt (obj) + cmGetWidth (obj) - subMenuWidth) < browserLeft) - horiz = 'r'; - return horiz; - } - else - { - if (horiz == 'r' && (cmGetXAt (obj, p) + cmGetWidth (obj) + subMenuWidth) > browserRight) - horiz = 'l'; - if (horiz == 'l' && (cmGetXAt (obj, p) - subMenuWidth) < browserLeft) - horiz = 'r'; - return horiz; - } -} - -// -// show the subMenu w/ specified orientation -// also move it to the correct coordinates -// -// @param obj the menu item that opens up the subMenu -// subMenu the sub menu to be shown -// orient the orientation of the subMenu -// -function cmShowSubMenu (obj, prefix, subMenu, orient) -{ - if (!subMenu.cmParentMenu) - { - // establish the tree w/ back edge - var thisMenu = cmGetThisMenu (obj, prefix); - subMenu.cmParentMenu = thisMenu; - if (!thisMenu.cmSubMenu) - thisMenu.cmSubMenu = new Array (); - //thisMenu.cmSubMenu.push (subMenu); - thisMenu.cmSubMenu[thisMenu.cmSubMenu.length] = subMenu; - } - - // position the sub menu - cmMoveSubMenu (obj, subMenu, orient); - subMenu.style.visibility = 'visible'; - - // - // On IE, controls such as SELECT, OBJECT, IFRAME (before 5.5) - // are window based controls. So, if the sub menu and these - // controls overlap, sub menu would be hidden behind them. Thus - // one needs to turn the visibility of these controls off when the - // sub menu is showing, and turn their visibility back on - // when the sub menu is hiding. - // - if (document.all) // it is IE - { - /* part of Felix Zaslavskiy's fix on hiding controls - not really sure if this part is necessary, but shouldn't - hurt. */ - if (!subMenu.cmOverlap) - subMenu.cmOverlap = new Array (); -/*@cc_on @*/ -/*@if (@_jscript_version >= 5.5) -@else @*/ - cmHideControl ("IFRAME", subMenu); -/*@end @*/ - cmHideControl ("SELECT", subMenu); - cmHideControl ("OBJECT", subMenu); - } -} - -// -// reset all the menu items to class MenuItem in thisMenu -// -function cmResetMenu (thisMenu, prefix) -{ - if (thisMenu.cmItems) - { - var i; - var str; - var items = thisMenu.cmItems; - for (i = 0; i < items.length; ++i) - { - if (items[i].cmIsMain) - str = prefix + 'MainItem'; - else - str = prefix + 'MenuItem'; - if (items[i].className != str) - items[i].className = str; - } - } -} - -// -// called by the timer to hide the menu -// -function cmHideMenuTime () -{ - if (_cmCurrentItem) - { - var prefix = _cmCurrentItem.cmPrefix; - cmHideMenu (cmGetThisMenu (_cmCurrentItem, prefix), null, prefix); - _cmCurrentItem = null; - } -} - -// -// hide thisMenu, children of thisMenu, as well as the ancestor -// of thisMenu until currentMenu is encountered. currentMenu -// will not be hidden -// -function cmHideMenu (thisMenu, currentMenu, prefix) -{ - var str = prefix + 'SubMenu'; - - // hide the down stream menus - if (thisMenu.cmSubMenu) - { - var i; - for (i = 0; i < thisMenu.cmSubMenu.length; ++i) - { - cmHideSubMenu (thisMenu.cmSubMenu[i], prefix); - } - } - - // hide the upstream menus - while (thisMenu && thisMenu != currentMenu) - { - cmResetMenu (thisMenu, prefix); - if (thisMenu.className == str) - { - thisMenu.style.visibility = 'hidden'; - cmShowControl (thisMenu); - } - else - break; - thisMenu = cmGetThisMenu (thisMenu.cmParentMenu, prefix); - } -} - -// -// hide thisMenu as well as its sub menus if thisMenu is not -// already hidden -// -function cmHideSubMenu (thisMenu, prefix) -{ - if (thisMenu.style.visibility == 'hidden') - return; - if (thisMenu.cmSubMenu) - { - var i; - for (i = 0; i < thisMenu.cmSubMenu.length; ++i) - { - cmHideSubMenu (thisMenu.cmSubMenu[i], prefix); - } - } - cmResetMenu (thisMenu, prefix); - thisMenu.style.visibility = 'hidden'; - cmShowControl (thisMenu); -} - -// -// hide a control such as IFRAME -// -function cmHideControl (tagName, subMenu) -{ - var x = cmGetX (subMenu); - var y = cmGetY (subMenu); - var w = subMenu.offsetWidth; - var h = subMenu.offsetHeight; - - var i; - for (i = 0; i < document.all.tags(tagName).length; ++i) - { - var obj = document.all.tags(tagName)[i]; - if (!obj || !obj.offsetParent) - continue; - - // check if the object and the subMenu overlap - - var ox = cmGetX (obj); - var oy = cmGetY (obj); - var ow = obj.offsetWidth; - var oh = obj.offsetHeight; - - if (ox > (x + w) || (ox + ow) < x) - continue; - if (oy > (y + h) || (oy + oh) < y) - continue; - - // if object is already made hidden by a different - // submenu then we dont want to put it on overlap list of - // of a submenu a second time. - // - bug fixed by Felix Zaslavskiy - if(obj.style.visibility == "hidden") - continue; - - //subMenu.cmOverlap.push (obj); - subMenu.cmOverlap[subMenu.cmOverlap.length] = obj; - obj.style.visibility = "hidden"; - } -} - -// -// show the control hidden by the subMenu -// -function cmShowControl (subMenu) -{ - if (subMenu.cmOverlap) - { - var i; - for (i = 0; i < subMenu.cmOverlap.length; ++i) - subMenu.cmOverlap[i].style.visibility = ""; - } - subMenu.cmOverlap = null; -} - -// -// returns the main menu or the submenu table where this obj (menu item) -// is in -// -function cmGetThisMenu (obj, prefix) -{ - var str1 = prefix + 'SubMenu'; - var str2 = prefix + 'Menu'; - while (obj) - { - if (obj.className == str1 || obj.className == str2) - return obj; - obj = obj.parentNode; - } - return null; -} - -// -// return true if this item is handled using default handlers -// -function cmIsDefaultItem (item) -{ - if (item == _cmSplit || item[0] == _cmNoAction || item[0] == _cmNoClick) - return false; - return true; -} - -// -// returns the object baring the id -// -function cmGetObject (id) -{ - if (document.all) - return document.all[id]; - return document.getElementById (id); -} - -// -// functions that obtain the width of an HTML element. -// -function cmGetWidth (obj) -{ - var width = obj.offsetWidth; - if (width > 0 || !cmIsTRNode (obj)) - return width; - if (!obj.firstChild) - return 0; - // use TABLE's length can cause an extra pixel gap - //return obj.parentNode.parentNode.offsetWidth; - - // use the left and right child instead - return obj.lastChild.offsetLeft - obj.firstChild.offsetLeft + cmGetWidth (obj.lastChild); -} - -// -// functions that obtain the height of an HTML element. -// -function cmGetHeight (obj) -{ - var height = obj.offsetHeight; - if (height > 0 || !cmIsTRNode (obj)) - return height; - if (!obj.firstChild) - return 0; - // use the first child's height - return obj.firstChild.offsetHeight; -} - -// -// functions that obtain the coordinates of an HTML element -// -function cmGetX (obj) -{ - var x = 0; - - do - { - x += obj.offsetLeft; - obj = obj.offsetParent; - } - while (obj); - return x; -} - -function cmGetXAt (obj, elm) -{ - var x = 0; - - while (obj && obj != elm) - { - x += obj.offsetLeft; - obj = obj.offsetParent; - } - if (obj == elm) - return x; - return x - cmGetX (elm); -} - -function cmGetY (obj) -{ - var y = 0; - do - { - y += obj.offsetTop; - obj = obj.offsetParent; - } - while (obj); - return y; -} - -function cmIsTRNode (obj) -{ - var tagName = obj.tagName; - return tagName == "TR" || tagName == "tr" || tagName == "Tr" || tagName == "tR"; -} - -// -// get the Y position of the object. In case of TR element though, -// we attempt to adjust the value. -// -function cmGetYAt (obj, elm) -{ - var y = 0; - - if (!obj.offsetHeight && cmIsTRNode (obj)) - { - var firstTR = obj.parentNode.firstChild; - obj = obj.firstChild; - y -= firstTR.firstChild.offsetTop; - } - - while (obj && obj != elm) - { - y += obj.offsetTop; - obj = obj.offsetParent; - } - - if (obj == elm) - return y; - return y - cmGetY (elm); -} - -// -// extract description from the menu item and set the status text -// @param item the menu item -// -function cmSetStatus (item) -{ - var descript = ''; - if (item.length > 4) - descript = (item[4] != null) ? item[4] : (item[2] ? item[2] : descript); - else if (item.length > 2) - descript = (item[2] ? item[2] : descript); - - window.defaultStatus = descript; -} - -// -// debug function, ignore :) -// -function cmGetProperties (obj) -{ - if (obj == undefined) - return 'undefined'; - if (obj == null) - return 'null'; - - var msg = obj + ':\n'; - var i; - for (i in obj) - msg += i + ' = ' + obj[i] + '; '; - return msg; -} - -/* v1.4.4 1. a quick fix for a bug for _cmSplit checking. reported by - Son Nguyen. -*/ -/* v1.4.3 1. changed how _cmSplit is handled a bit so that _cmNoClick can work - properly. All splits in predefined themes are changed to use - _cmNoClick instead of _cmNoAction. -*/ -/* v1.4.2 1. fixed _cmNoClick mouse hoover bug. - 2. fixed a statusbar text problem that cause text to disappear when - hoovering mouse within the same menu item. - 3. changed the behavior of cmDrawFromText s.t. if the title of the - of a link is empty, the actual url is used as text. To clear - this link information, title needs to be ' '. -*/ -/* v1.4.1 1. fixed a problem introduced in 1.4 where re-entering a main menu - item which doesn't have a child can disable its hover setting. - Apparently I deleted an extra line of code when I was doing - cleaning up. Reported by David Maliachi and a few others. -*/ -/* JSCookMenu v1.4 1. fixed a minor td cell closure problem. Thanks to Georg Lorenz - for discovering that. - 2. added clickOpen to nodeProperties. See _cmNodeProperties for - description. Basically menus can be opened on click only. - 3. added an ability to draw menu from an html node instead of a javascript - tree, making this script search bot friendly (I hope?). -*/ -/* JSCookMenu v1.31 1. fix a bug on IE with causes submenus to display at the top - left corner due to doctype. The fix was provided by - Burton Strauss . -*/ -/* JSCookMenu v1.3 1. automatically realign (left and right) the submenu when - client space is not enough. - 2. add _cmNoClick to get rid of menu closing behavior - on the particular menu item, to make it possible for things - such as search box to be inside the menu. -*/ -/* JSCookMenu v1.25 1. fix Safari positioning issue. The problem is that all TR elements are located - at the top left corner. Thus, need to obtain the "virtual" - position of these element could be at. -*/ -/* JSCookMenu v1.24 1. fix window based control hiding bug - thanks to Felix Zaslavskiy for the fix. -*/ -/* JSCookMenu v1.23 1. correct a position bug when the container is positioned. - thanks to Andre for narrowing down - the problem. -*/ -/* JSCookMenu v1.22 1. change Array.push (obj) call to Array[length] = obj. - Suggestion from Dick van der Kaaden to - make the script compatible with IE 5.0 - 2. Changed theme files a little to add z-index: 100 for sub - menus. This change is necessary for Netscape to avoid - a display problem. - 3. some changes to the DOM structure to make this menu working - on Netscape 6.0 (tested). The main reason is that NN6 does - not do absolute positioning with tables. Therefore an extra - div layer must be put around the table. -*/ -/* JSCookMenu v1.21 1. fixed a bug that didn't add 'px' as part of coordinates. - JSCookMenu should be XHTML validator friendly now. - 2. removed unnecessary display attribute and corresponding - theme entry to fix a problem that Netscape sometimes - render Office theme incorrectly -*/ -/* JSCookMenu v1.2. 1. fix the problem of showing status in Netscape - 2. changed the handler parameters a bit to allow - string literals to be passed to javascript based - links - 3. having null in target field would cause the link - to be opened in the current window, but this behavior - could change in the future releases -*/ -/* JSCookMenu v1.1. added ability to hide controls in IE to show submenus properly */ -/* JSCookMenu v1.01. cmDraw generates XHTML code */ -/* JSCookMenu v1.0. (c) Copyright 2002 by Heng Yuan */ diff --git a/src/www/jscook/JSCookTree.js b/src/www/jscook/JSCookTree.js deleted file mode 100644 index 8f3487525e..0000000000 --- a/src/www/jscook/JSCookTree.js +++ /dev/null @@ -1,897 +0,0 @@ -/* - JSCookTree v2.01. (c) Copyright 2002 by Heng Yuan - - Permission is hereby granted, free of charge, to any person obtaining a - copy of this software and associated documentation files (the "Software"), - to deal in the Software without restriction, including without limitation - the rights to use, copy, modify, merge, publish, distribute, sublicense, - and/or sell copies of the Software, and to permit persons to whom the - Software is furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included - in all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - ITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - DEALINGS IN THE SOFTWARE. -*/ - -// data structures - -// -// ctTreeInfo stores information about the current tree -// -function ctTreeInfo (nodeProperties, prefix, hideType, expandLevel) -{ - // default node properties - this.nodeProperties = nodeProperties; - // current selected item in this tree - this.currentItem = null; - // theme prefix - this.prefix = prefix; - // open tree type - // 0: just open the current tree - // 1: close other branches in the same tree - // 2: close other branches in other trees as well - this.hideType = hideType; - // the deepest level of the tree is the always expaned - this.expandLevel = expandLevel; - // beginIndex is the first index of the tree item - this.beginIndex = 0; - // endIndex is same as beginIndex + # of items in the tree - this.endIndex = 0; -} - -function ctMenuInfo (id, idSub) -{ - // id of the menu item that owns the sub menu - this.id = id; - // the id of the sub menu - this.idSub = idSub; -} - -// Globals - -var _ctSelected = null; -var _ctSelectedId = null; - -var _ctIDSubMenuCount = 0; -var _ctIDSubMenu = 'ctSubTreeID'; // for creating submenu id - -var _ctCurrentItem = null; // the current menu item being selected; - -var _ctNoAction = new Object (); // indicate that the item cannot be hovered. - -var _ctItemList = new Array (); // a simple list of items -var _ctTreeList = new Array (); // a list of ctTreeInfo. -var _ctMenuList = new Array (); // a list of ctMenuInfo - -var _ctMenuInitStr = ''; // initiation command that initiate menu items - -// default node properties -var _ctNodeProperties = -{ - // tree attributes - // - // except themeLevel, all other attributes can be specified - // for each level of depth of the tree. - - // HTML code to the left of a folder item - // first one is for folder closed, second one is for folder opened - folderLeft: [['', '']], - // HTML code to the right of a folder item - // first one is for folder closed, second one is for folder opened - folderRight: [['', '']], - // HTML code to the left of a regular item - itemLeft: [''], - // HTML code to the right of a regular item - itemRight: [''], - // HTML code for the connector - // first one is for w/ having next sibling, second one is for no next sibling - folderConnect: [[['',''],['','']]], - itemConnect: [['',''],['','']], - // HTML code for spacers - // first one connects next, second one doesn"t - spacer: [['     ', '     ']], - // deepest level of theme specified - themeLevel: 1 - // tells JSCookTree to use ancher tag to open links - // if this field is set to false, then JSCookTree would hand it. -}; - -////////////////////////////////////////////////////////////////////// -// -// Drawing Functions and Utility Functions -// -////////////////////////////////////////////////////////////////////// - -// -// produce a new unique submenu id -// -function ctNewSubMenuID () -{ - return _ctIDSubMenu + (++_ctIDSubMenuCount); -} - -// -// return the property string for the menu item -// -function ctActionItem () -{ - return ' onmouseover="ctItemMouseOver (this.parentNode)" onmouseout="ctItemMouseOut (this.parentNode)" onmousedown="ctItemMouseDown (this.parentNode)" onmouseup="ctItemMouseUp (this.parentNode)"'; -} - -function ctActionTitle () -{ - return ' onmouseup="ctSetSelectedItem(this.parentNode)" onmousedown="ctItemMouseDown (this.parentNode)"'; -} - -// -// return the property string for the menu item -// -function ctNoActionItem (item) -{ - return item[1]; -} - -// -// used to determine the property string -// -function ctGetPropertyLevel (level, property) -{ - return (level >= property.length) ? (property.length - 1) : level; -} - - -function ctCollapseTree (id) -{ - var menu = ctGetObject (id).firstChild; - var i; - for (i = 0; i < menu.ctItems.length; ++i) - ctCloseFolder (menu.ctItems[i]); -} - -// -// expand a tree such that upto level is exposed -// -function ctExpandTree (id, expandLevel) -{ - if (expandLevel <= 0) - return; - - var obj = ctGetObject (id); - if (!obj) - return; - - var thisMenu = obj.firstChild; - if (!thisMenu) - return; - - ctExpandTreeSub (thisMenu, expandLevel) -} - -function ctExpandTreeSub (subMenu, expandLevel) -{ - if (subMenu.ctLevel >= expandLevel) - return; - var i; - var item; - for (i = 0; subMenu.ctItems && i < subMenu.ctItems.length; ++i) - { - item = subMenu.ctItems[i]; - if (item.ctIdSub) - { - ctOpenFolder (item); - ctExpandTreeSub (ctGetObject (item.ctIdSub), expandLevel); - } - } -} - -// -// expose a particular menu item use its link as the search value -// -function ctExposeItem (treeIndex, link) -{ - if (treeIndex < 0 || treeIndex >= _ctTreeList.length) - return; - var tree = _ctTreeList[treeIndex]; - var endIndex = tree.endIndex; - var i; - for (i = tree.beginIndex; i < endIndex; ++i) - { - if (_ctItemList[i].length > 2 && - _ctItemList[i][2] == link) - { - return ctExposeTreeIndex (treeIndex, i); - } - } -} - -// -// expose a particular menu item using its index -// -function ctExposeTreeIndex (treeIndex, index) -{ - var item = ctGetObject ('ctItemID' + (_ctTreeList[treeIndex].beginIndex + index)).parentNode; - if (!item) - return null; - - var parentItem = ctGetThisMenu (item).ctParent; - if (parentItem) - ctExposeTreeIndexSub (parentItem); - - ctSetSelectedItem (item); - return item; -} - -function ctExposeTreeIndexSub (item) -{ - var parentItem = ctGetThisMenu (item).ctParent; - if (parentItem) - ctExposeTreeIndexSub (parentItem); - ctOpenFolder (item); -} - -// -// mark a particular menu item with id using its link -// -function ctMarkItem (treeIndex, link) -{ - if (treeIndex < 0 || treeIndex >= _ctTreeList.length) - return; - var tree = _ctTreeList[treeIndex]; - var endIndex = tree.endIndex; - var i; - for (i = tree.beginIndex; i < endIndex; ++i) - { - if (_ctItemList[i].length > 2 && - _ctItemList[i][2] == link) - { - var item = ctGetObject ('ctItemID' + (_ctTreeList[treeIndex].beginIndex + i)).parentNode; - if (!item) - return null; - if (item.id == "JSCookTreeItem") - item.id = 'JSCookTreeMarked'; - return item; - } - } -} - -// -// mark a particular menu item with id using index -// -function ctMarkTreeIndex (treeIndex, index) -{ - var item = ctGetObject ('ctItemID' + (_ctTreeList[treeIndex].beginIndex + index)).parentNode; - if (!item) - return null; - if (item.id == "JSCookTreeItem") - item.id = 'JSCookTreeMarked'; - return item; -} - -// -// return the current selected node for the current tree -// -// treeItem treeItem is the table row of where the tree item is located -// -function ctGetSelectedItem (treeIndex) -{ - if (_ctTreeList[treeIndex].hideType <= 1) - return _ctTreeList[treeIndex].currentItem; - else - return _ctCurrentItem; -} - -// -// The function that builds the menu inside the specified element id. -// -function ctDraw (id, tree, nodeProperties, prefix, hideType, expandLevel) -{ - var obj = ctGetObject (id); - - if (!nodeProperties) - nodeProperties = _ctNodeProperties; - if (!prefix) - prefix = ''; - if (!hideType) - hideType = 0; - if (!expandLevel) - expandLevel = 0; - - //var treeIndex = _ctTreeList.push (new ctTreeInfo (nodeProperties, prefix, hideType, expandLevel)) - 1; - _ctTreeList[_ctTreeList.length] = new ctTreeInfo (nodeProperties, prefix, hideType, expandLevel); - var treeIndex = _ctTreeList.length - 1; - - var beginIndex = _ctItemList.length; - - _ctMenuInitStr = ''; - var str = ctDrawSub (tree, true, null, treeIndex, 0, nodeProperties, prefix, ''); - obj.innerHTML = str; - eval (_ctMenuInitStr); - //alert(_ctMenuInitStr); - _ctMenuInitStr = ''; - - var endIndex = _ctItemList.length; - - _ctTreeList[treeIndex].beginIndex = beginIndex; - _ctTreeList[treeIndex].endIndex = endIndex; - - if (_ctSelectedId != null) - { - ctExpandTree (id, endIndex); - ctSelectSelected (); - } - else - if (expandLevel) - ctExpandTree (id, expandLevel); - - //document.write ('
'); - - return treeIndex; -} - -// -// draw the sub menu recursively -// -function ctDrawSub (subMenu, isMain, id, treeIndex, level, nodeProperties, prefix, indent) -{ - var lvl = level; - if (lvl > nodeProperties.themeLevel) - lvl = nodeProperties.themeLevel; - - var str = '
5); - idSub = hasChild ? ctNewSubMenuID () : null; - - str += ''; - - // - // #JSCookTreeFolderClose & #JSCookTreeFolderOpen - // are used in style sheet to control the animation of folder open/close - // Also, it tells status of the submenu - // - str += ' tag) - // could be tracked in an alternative way - // _ctMenuInitStr is used to initate the menu item - // - itemID = 'ctItemID' + index; - markerStr = ' id="' + itemID + '"'; - _ctMenuInitStr += 'ctSetupItem (ctGetObject ("' + itemID + '").parentNode,' + index + ',' + treeIndex + ',' + level + ',' + (idSub ? ('"' + idSub + '"') : 'null') + ');'; - - str += ''; - - if (item[0] == _ctNoAction) - { - str += ctNoActionItem (item, prefix); - str += '
' + indent; - - str += '
'; - continue; - } - - actionStr = ctActionItem (); - actionStr2 = ctActionTitle (); - - str += ''; - - // add connect part - if (hasChild) - { - connectSelect = ctHasNextItem (i, subMenu) ? 0 : 1; - lvl = ctGetPropertyLevel (level, nodeProperties.folderConnect); - str += '' + nodeProperties.folderConnect[lvl][connectSelect][0] + '' + - '' + nodeProperties.folderConnect[lvl][connectSelect][1] + ''; - } - else - { - connectSelect = ctHasNextItem (i, subMenu) ? 0 : 1; - lvl = ctGetPropertyLevel (level, nodeProperties.itemConnect); - str += nodeProperties.itemConnect[lvl][connectSelect]; - } - - if (item[0] != null && item[0] != _ctNoAction) - { - str += item[0]; - } - else if (hasChild) - { - lvl = ctGetPropertyLevel (level, nodeProperties.folderLeft); - str += '' + nodeProperties.folderLeft[lvl][0] + '' + - '' + nodeProperties.folderLeft[lvl][1] + ''; - } - else - { - lvl = ctGetPropertyLevel (level, nodeProperties.itemLeft); - str += nodeProperties.itemLeft[lvl]; - } - str += ''; - - str += ''; - - str += ''; - - if (item[1] == _ctSelected) - { - _ctSelectedId = itemID; - } - - str += ''; - - if (hasChild) - { - lvl = ctGetPropertyLevel (level, nodeProperties.folderRight); - str += '' + nodeProperties.folderRight[lvl][0] + '' + - '' + nodeProperties.folderRight[lvl][1] + ''; - } - else - { - lvl = ctGetPropertyLevel (level, nodeProperties.itemRight); - str += nodeProperties.itemRight[lvl]; - } - str += '' - str += ''; - - if (hasChild) - { - childIndent = indent; - lvl = ctGetPropertyLevel (level, nodeProperties.spacer); - childIndent += nodeProperties.spacer[lvl][connectSelect]; - - str += ctDrawSub (item, false, idSub, treeIndex, level + 1, nodeProperties, prefix, childIndent); - } - } - - str += '
'; - - return str; -} - -////////////////////////////////////////////////////////////////////// -// -// Mouse Event Handling Functions -// -////////////////////////////////////////////////////////////////////// - -// -// action should be taken for mouse moving in to the menu item -// -function ctItemMouseOver (item) -{ - var treeItem = _ctItemList[item.ctIndex]; - var isDefaultItem = ctIsDefaultItem (treeItem); - - if (isDefaultItem) - { - var className = ctGetDefaultClassName (item); - - if (item.className == className) - item.className = className + 'Hover'; - } -} - -// -// action should be taken for mouse moving out of the menu item -// -function ctItemMouseOut (item) -{ - if (ctIsDefaultItem (_ctItemList[item.ctIndex])) - { - var className = ctGetDefaultClassName (item); - - if (item.className == (className + 'Hover') || - item.className == (className + 'Active')) - { - var tree = _ctTreeList[item.ctTreeIndex]; - var currentItem = (tree.hideType <= 1) ? tree.currentItem : _ctCurrentItem; - - if (item == currentItem) - item.className = className + 'Selected'; - else - item.className = className; - } - } -} - -// -// action should be taken for mouse button down at a menu item -// -function ctItemMouseDown (item) -{ - if (ctIsDefaultItem (_ctItemList[item.ctIndex])) - { - var className = ctGetDefaultClassName (item); - - if (item.className == (className + 'Hover')) - item.className = className + 'Active'; - } -} - -// -// action should be taken for mouse button up at a menu item -// -function ctItemMouseUp (item) -{ - if (item.ctIdSub) - { - // toggle the submenu - var subMenu = ctGetObject (item.ctIdSub); - if (subMenu.style.display == 'block') - { - ctCloseFolder (item); - } - else - { - ctOpenFolder (item); - } - } - ctSetSelectedItem (item); -} - -function ctSelectSelected () -{ - if (_ctSelectedId != null) - { - var item = ctGetObject (_ctSelectedId).parentNode; - ctOpenFolder (item); - ctSetSelectedItem (item); - ctItemMouseDown (item); - } -} - -// -// set the item as the selected item -// -function ctSetSelectedItem (item) -{ - var tree = _ctTreeList[item.ctTreeIndex]; - var hideType = tree.hideType; - - var otherItem; - - if (hideType <= 1) - otherItem = tree.currentItem; - else - otherItem = _ctCurrentItem; - - if (otherItem != item) - { - ctLabelMenu (item); - - // set otherItem to normal - if (otherItem) - { - if (ctIsDefaultItem (_ctItemList[otherItem.ctIndex])) - { - var className = ctGetDefaultClassName (otherItem); - if (otherItem.className == (className + 'Selected')) - otherItem.className = className; - } - - // hide otherItem if required - if (hideType > 0 && otherItem) - ctHideMenu (otherItem, item); - } - - // finally, set this item as selected - if (hideType <= 1) - tree.currentItem = item; - else - _ctCurrentItem = item; - - if (ctIsDefaultItem (_ctItemList[item.ctIndex])) - { - var className = ctGetDefaultClassName (item); - item.className = className + 'Selected'; - } - } -} - -////////////////////////////////////////////////////////////////////// -// -// Mouse Event Support Utility Functions -// -////////////////////////////////////////////////////////////////////// - -// -// check if an item is in open form -// -function ctIsFolderOpen (item) -{ - if (item.id == 'JSCookTreeFolderOpen') - return true; - return false; -} - -// -// change an item into the open form -// -function ctOpenFolder (item) -{ - if (ctIsFolderOpen (item)) - return; - if (item.ctIdSub) - { - var subMenu = ctGetObject (item.ctIdSub); - subMenu.style.display = 'block'; - - item.id = 'JSCookTreeFolderOpen'; - } -} - -// -// change an item into the closed form -// -function ctCloseFolder (item) -{ - if (!ctIsFolderOpen (item)) - return; - - // hide the downstream menus - if (item.ctIdSub) - { - var subMenu = ctGetObject (item.ctIdSub); - var i; - for (i = 0; i < subMenu.ctSubMenu.length; ++i) - ctCloseFolder (subMenu.ctSubMenu[i].ctParent); - - var expandLevel = _ctTreeList[item.ctTreeIndex].expandLevel; - if (item.ctLevel < expandLevel) - return; - subMenu.style.display = 'none'; - - item.id = 'JSCookTreeFolderClosed'; - } -} - -// -// setup an menu item -// -function ctSetupItem (item, index, treeIndex, level, idSub) -{ - if (!item.ctIndex) - { - item.ctIndex = index; - item.ctTreeIndex = treeIndex; - item.ctLevel = level; - item.ctIdSub = idSub; - } - - var thisMenu = ctGetThisMenu (item); - ctSetupMenu (thisMenu, item, null, null); - - if (idSub) - { - var subMenu = ctGetObject (idSub); - ctSetupMenu (subMenu, null, thisMenu, item); - } -} - -// -// setup the relationship between a node and its sub menu -// -function ctSetupMenu (thisMenu, thisItem, parentMenu, parentItem) -{ - if (!thisMenu.ctSubMenu) - thisMenu.ctSubMenu = new Array (); - - if (parentItem) - { - if (!thisMenu.ctParent) - { - // establish the tree w/ back edge - thisMenu.ctParent = parentItem; - thisMenu.ctLevel = parentItem.ctLevel + 1; - - //parentMenu.ctSubMenu.push (thisMenu); - parentMenu.ctSubMenu[parentMenu.ctSubMenu.length] = thisMenu; - } - } - - if (thisItem) - { - if (!thisItem.ctMenu) - { - thisItem.ctMenu = thisMenu; - - thisMenu.ctLevel = thisItem.ctLevel; - - if (!thisMenu.ctItems) - thisMenu.ctItems = new Array (); - - //thisMenu.ctItems.push (thisItem); - thisMenu.ctItems[thisMenu.ctItems.length] = thisItem; - } - } -} - -// -// label the path from the menu root to the item -// -function ctLabelMenu (item) -{ - var thisMenu = ctGetThisMenu (item); - while (thisMenu && thisMenu.ctLevel != 0) - { - thisMenu.ctCurrentItem = item; - thisMenu = ctGetThisMenu (thisMenu.ctParent); - } -} - -// -// hide an item up to the parent menu of activeItem -// -function ctHideMenu (item, activeItem) -{ - var subMenu; - while (item) - { - if (item.ctIdSub && - (subMenu = ctGetObject (item.ctIdSub)).ctLevel && - (subMenu.ctCurrentItem != activeItem)) - { - ctCloseFolder (item); - } - item = ctGetThisMenu (item).ctParent; - } -} - -// -// returns the menu div where this obj (menu item) is in -// -function ctGetThisMenu (item) -{ - var str = _ctTreeList[item.ctTreeIndex].prefix; - if (item.ctLevel == 0) - str += 'TreeLevel0'; - else - { - var themeLevel = _ctTreeList[item.ctTreeIndex].nodeProperties.themeLevel; - var lvl = (item.ctLevel < themeLevel) ? item.ctLevel : themeLevel; - str += 'TreeLevel' + lvl; - } - while (item) - { - if (item.className == str) - return item; - item = item.parentNode; - } - return null; -} - -// -// return true if there is next item -// -// used to determine connectors -// -function ctHasNextItem (index, tree) -{ - if (index < (tree.length - 2) || - (index == (tree.length - 2) && tree[index + 1])) - return true; - else - return false; -} - -function ctGetDefaultClassName (item) -{ - var tree = _ctTreeList[item.ctTreeIndex]; - return tree.prefix + 'Row'; -} - -// -// return true if this item is handled using default handlers -// -function ctIsDefaultItem (item) -{ - if (item[0] == _ctNoAction) - return false; - return true; -} - -// -// returns the object baring the id -// -function ctGetObject (id) -{ - if (document.all) - return document.all[id]; - return document.getElementById (id); -} - -function ctSetSelected (item) -{ - _ctSelected = item; -} - -// -// debug function, ignore :) -// -function ctGetProperties (obj) -{ - var msg = obj + ':\n'; - var i; - for (i in obj) - msg += i + ' = ' + obj[i] + '; '; - return msg; -} - -/* JSCookTree v2.01 1. change Array.push (obj) call to Array[length] = obj. - Suggestion from Dick van der Kaaden to - make the script compatible with IE 5.0 - 2. added ctGetSelectedItem (treeIndex) function due to demand -*/ -/* JSCookTree v2.0 1. added controls over tree branches opening/closing - 2. added the ability to mark a specific tree item - 3. added an extra description field to make the tree - format the same as JSCookMenu - 4. more control over themes. allow multiple trees - w/ different themes co-exist in the same page - 5. tooltips. -*/ -/* JSCookTree v1.01. made more tolerant to extra commas */ -/* JSCookTree v1.0. (c) Copyright 2002 by Heng Yuan */ diff --git a/src/www/jscook/ThemePanel/arrow.gif b/src/www/jscook/ThemePanel/arrow.gif deleted file mode 100644 index 75d7216c6ed34964248248a04eedb2d7497dd1d0..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 65 zcmZ?wbhEHb6lM@$XkY+=|Ns9h{$ycfU|?j>0r5dH3``O|{VPwu0r5dH3`}A@{VPwupgCPLHLl4*ao1g*vde*yr7EnmF(e1P-A_3}`61 z3I~JHMjEYba@(fncqSVp{uoPTk3+85g@We96LKVJ0)UI_1dUswBo8ooO&l;`7>7_J z1~f0hf`h?mBb{B*-lk2>2^%9w{4tiw$u97$e<{vJcb{iT3w3he^`0n~@uaicK86?h tc-ZA1taWfEA -*/ - -.ThemePanelMenuItem img.seq1 -{ - display: inline; -} - -.ThemePanelMenuItemHover seq2, -.ThemePanelMenuItemActive seq2 -{ - display: inline; -} - -.ThemePanelMenuItem .seq2, -.ThemePanelMenuItemHover .seq1, -.ThemePanelMenuItemActive .seq1 -{ - display: none; -} diff --git a/src/www/jscook/ThemePanel/theme.js b/src/www/jscook/ThemePanel/theme.js deleted file mode 100644 index 94ff683233..0000000000 --- a/src/www/jscook/ThemePanel/theme.js +++ /dev/null @@ -1,60 +0,0 @@ - -// directory of where all the images are -var cmThemePanelBase = '/jscook/ThemePanel/'; - -// the follow block allows user to re-define theme base directory -// before it is loaded. -try -{ - if (myThemePanelBase) - { - cmThemePanelBase = myThemePanelBase; - } -} -catch (e) -{ -} - -var cmThemePanel = -{ - // main menu display attributes - // - // Note. When the menu bar is horizontal, - // mainFolderLeft and mainFolderRight are - // put in . When the menu - // bar is vertical, they would be put in - // a separate TD cell. - - // HTML code to the left of the folder item - mainFolderLeft: '', - // HTML code to the right of the folder item - mainFolderRight: '', - // HTML code to the left of the regular item - mainItemLeft: '', - // HTML code to the right of the regular item - mainItemRight: '', - - // sub menu display attributes - - // HTML code to the left of the folder item - folderLeft: '', - // HTML code to the right of the folder item - folderRight: '', - // HTML code to the left of the regular item - itemLeft: '', - // HTML code to the right of the regular item - itemRight: '', - // cell spacing for main menu - mainSpacing: 0, - // cell spacing for sub menus - subSpacing: 0, - // auto dispear time for submenus in milli-seconds - delay: 500 -}; - -// for sub menu horizontal split -var cmThemePanelHSplit = [_cmNoClick, '
']; -// for vertical main menu horizontal split -var cmThemePanelMainHSplit = [_cmNoClick, '
']; -// for horizontal main menu vertical split -var cmThemePanelMainVSplit = [_cmNoClick, '|']; diff --git a/src/www/jscook/ThemeXP/folder1.gif b/src/www/jscook/ThemeXP/folder1.gif deleted file mode 100644 index 7b41370476053cfbb4498750f0ccf3b4a63f9bbb..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 163 zcmZ?wbhEHb6lM@$*vtR||NsA=Gl${axnv;y|NpuF=jMF>{v9X?mP98Mf3h$#FmN#F zfFwX>Ft7v&ob+7ns+3-^+QQXQfa!Xo^D4es&sqy)gqk%uAFX)r=KIikZll2$--d%1 tH>4ka(sE?Q$8Rlq%l)#i9QY$TEm}!jJ7Q+IFH6GNyzTxUDr}e-tO2*LJ;VS2 diff --git a/src/www/jscook/ThemeXP/folder2.gif b/src/www/jscook/ThemeXP/folder2.gif deleted file mode 100644 index da9e5398764f22d85762b9baa2113665ce084c2f..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 242 zcmZ?wbhEHb6lM@$IKsg29|RbH@IM2H17rayFmuZP|8xHT|Nj4b&;Rdp{(oQk|9#8a zRdfD7um1nMW$!%0t$h;rwpsqaUp=Q1$Z)#1&Fla5?4^|g&-Vp=zuxlyd@{&f1_s5S zEQ|~catt~^HUr2`2G;xq>U}AhRSiqL4n!_MwzwWXz{ zv9Pd!RFeV}f3h$#0IkviX#&~Fz?!6>(wCAs>#VZbOHZ>Ci_AJ-IeqwiVoU8ao@4I< ziy0Xi7M}U;WFz6h;&d{`av_7JlB4d@4Yyh%B96L7YHnPVbIyz*+w}L|T#c4b@(ymYc?Kq_Ir&Ye->#iEN9U5Z W?mh3HA2Vf4rgcVkX#_DaSOWk~*BEI4 diff --git a/src/www/jscook/ThemeXP/joinbottom.gif b/src/www/jscook/ThemeXP/joinbottom.gif deleted file mode 100644 index 18b95690cc4a9350a9321d99ff7ddb075bea5966..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 70 zcmZ?wbhEHb6lM@$n8*ME|NsAQXlMYEia%Kx85o!ubU>mYc?Kr&Ir&Ye->#iEN9U5Z T?mh3HA2aWGOnc@j#$XKq3?3Mn diff --git a/src/www/jscook/ThemeXP/line.gif b/src/www/jscook/ThemeXP/line.gif deleted file mode 100644 index efe7e676597895c2a6863bf1ac870af22086b64a..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 70 zcmZ?wbhEHb6lM@$n8*ME|NsAQXlMYEia%Kx85o!ubU>mYc?Kr&Ir&Ye->#iEN9U5Z S?mh3%?`xwq;!-L_7_0#VbQgF4 diff --git a/src/www/jscook/ThemeXP/minus.gif b/src/www/jscook/ThemeXP/minus.gif deleted file mode 100644 index c6b53e1fc314129563d1494fb3400b21b7d3988d..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 85 zcmZ?wbhEHb6lM@$n8*ME|NsAQXlMYEia%Kx85o!ubU>mYc?Kr6Ir&Ye->#iE$MZ&Z iYK-)+>#~aG49hGvvbuV7eps&4PLgOn{WFe%!5RRQksV_I diff --git a/src/www/jscook/ThemeXP/minusbottom.gif b/src/www/jscook/ThemeXP/minusbottom.gif deleted file mode 100644 index d4222dab2dee2fc0222e232956ef15b535752a31..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 85 zcmZ?wbhEHb6lM@$n8*ME|NsAQXlMYEia%Kx85o!ubU>mYc?Kr6Ir&Ye->#iE$MZ&Z iYK-)+>#~aG49hGvvbuV7eps&4PLgPS{wtV)!5RRR5*>8_ diff --git a/src/www/jscook/ThemeXP/page.gif b/src/www/jscook/ThemeXP/page.gif deleted file mode 100644 index d77b16dfc33295b9fe6f66ef477830f3367b25d4..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 220 zcmZ?wbhEHb6lM@$IKsg29|RbH@IM2H17rayAb$S*+W-IGf#Ci7_vg-?n=@xlOG`^} zadA*kkfEU=NDpy9@h1x-1A`EQ4oEr3P6pP<1uA_hnN}IIW-VdfV{pM?%?q`PdkiMk z&n-MsUNAqC=yhNJ#6U}k`^hHO8Z9x7Vi8Wt~4F7x6C@v Xihp$;eE<6{pFmS{OP*=FB7-#ml=V*t diff --git a/src/www/jscook/ThemeXP/plus.gif b/src/www/jscook/ThemeXP/plus.gif deleted file mode 100644 index 10e214e0062594e9a3d05da36fc767c9cb790f28..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 131 zcmZ?wbhEHb6lM@$*vtR||NsAQXlMYEU>*TN@h1x-0|PUI4oDry3NUkSaoy8;I6qjseBHx{9%2;1=ijh?;cZ?p5(D$N!yA$E({FT030JA>i_@% diff --git a/src/www/jscook/ThemeXP/plusbottom.gif b/src/www/jscook/ThemeXP/plusbottom.gif deleted file mode 100644 index b8bcb3dff06070cfcebf088c8ade33711c3ae2f8..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 89 zcmZ?wbhEHb6lM@$n8*ME|NsAQXlMYEia%Kx85o!ubU>mYc?Kq}Ir&Ye->#iE$MZ&Z nYK*j8LCG05wOb5JUM|?8mYc?Kr_IsGe7zvW*%XUnbb K&G%$P8LR would work, but IE - doesn't support it :( */ - -.ThemeXPFolderText a, -.ThemeXPItemText a -{ - text-decoration: none; - border: 0; - padding: 1px; - background-color: inherit; -} - -.ThemeXPRowHover .ThemeXPItemText a, -.ThemeXPRowHover .ThemeXPFolderText a -{ - color: #000084; - text-decoration: underline; -} - -.ThemeXPRowActive .ThemeXPItemText a, -.ThemeXPRowActive .ThemeXPFolderText a, -.ThemeXPRowSelected .ThemeXPItemText a, -.ThemeXPRowSelected .ThemeXPFolderText a -{ - color: white; - background-color: #3169C6; - text-decoration: none; -} - -/* in strict mode of XHTML, this is a fix for image connections */ - -.ThemeXPFolderSpacer img, -.ThemeXPItemSpacer img, -.ThemeXPFolderLeft img, -.ThemeXPItemLeft img, -.ThemeXPFolderRight img, -.ThemeXPItemRight img -{ - vertical-align: bottom; -} - -/* no need to modify these two since they are generic. */ -/* they are used to coordinate the folder open/closing animation */ - -.JSCookTreeFolderClosed -{ -} - -.JSCookTreeFolderOpen -{ -} - -#JSCookTreeFolderClosed .JSCookTreeFolderOpen -{ - display: none; -} - -#JSCookTreeFolderOpen .JSCookTreeFolderClosed -{ - display: none; -} diff --git a/src/www/jscook/ThemeXP/theme.js b/src/www/jscook/ThemeXP/theme.js deleted file mode 100644 index 0c083a8ff3..0000000000 --- a/src/www/jscook/ThemeXP/theme.js +++ /dev/null @@ -1,87 +0,0 @@ -// change this variable to update the theme directory -var ctThemeXPBase = '/jscook/ThemeXP/'; - -// the follow block allows user to re-define theme base directory -// before it is loaded. -try -{ - if (myThemeXPBase) - { - ctThemeXPBase = myThemeXPBase; - } -} -catch (e) -{ -} - -// theme node properties -var ctThemeXP1 = -{ - // tree attributes - // - // except themeLevel, all other attributes can be specified - // for each level of depth of the tree. - - // HTML code to the left of a folder item - // first one is for folder closed, second one is for folder opened - folderLeft: [['', '']], - // HTML code to the right of a folder item - // first one is for folder closed, second one is for folder opened - folderRight: [['', '']], - // HTML code for the connector - // first one is for w/ having next sibling, second one is for no next sibling - // then inside each, the first field is for closed folder form, and the second field is for open form - folderConnect: [[['',''], - ['','']]], - - // HTML code to the left of a regular item - itemLeft: [''], - // HTML code to the right of a regular item - itemRight: [''], - // HTML code for the connector - // first one is for w/ having next sibling, second one is for no next sibling - itemConnect: [['', '']], - - // HTML code for spacers - // first one connects next, second one doesn"t - spacer: [['', '']], - - // deepest level of theme style sheet specified - themeLevel: 1 -}; - -// theme node properties -var ctThemeXP2 = -{ - // tree attributes - // - // except themeLevel, all other attributes can be specified - // for each level of depth of the tree. - - // HTML code to the left of a folder item - // first one is for folder closed, second one is for folder opened - folderLeft: [['', '']], - // HTML code to the right of a folder item - // first one is for folder closed, second one is for folder opened - folderRight: [['', '']], - // HTML code for the connector - // first one is for w/ having next sibling, second one is for no next sibling - // then inside each, the first field is for closed folder form, and the second field is for open form - folderConnect: [[['',''],['','']],[['',''], - ['','']]], - - // HTML code to the left of a regular item - itemLeft: [''], - // HTML code to the right of a regular item - itemRight: [''], - // HTML code for the connector - // first one is for w/ having next sibling, second one is for no next sibling - itemConnect: [['',''],['', '']], - - // HTML code for spacers - // first one connects next, second one doesn"t - spacer: [['',''],['', '']], - - // deepest level of theme style sheet specified - themeLevel: 1 -}; diff --git a/src/www/themes/funky/css/theme-pages.css b/src/www/themes/funky/css/theme-pages.css index 085bc2a6c7..b74914b2bc 100644 --- a/src/www/themes/funky/css/theme-pages.css +++ b/src/www/themes/funky/css/theme-pages.css @@ -227,6 +227,16 @@ padding: 3px; } +.docman_li_treecontent { + list-style-image: url('/themes/funky/images/docman/directory.png'); + margin: 2px; +} + +.docman_li_treecontent_selected { + list-style-image: url('/themes/funky/images/docman/directory-with-documents.png'); + margin: 2px; +} + /* tracker */ diff --git a/src/www/themes/funky/images/docman/directory-with-documents.png b/src/www/themes/funky/images/docman/directory-with-documents.png new file mode 100644 index 0000000000000000000000000000000000000000..9443cbf9f53d06aaa9262beb174b372f0560ba3c GIT binary patch literal 782 zcmV+p1M&QcP)Px#24YJ`L;(K){{a7>y{D4^000SaNLh0L01ejw01ejxLMWSf00007bV*G`2iXG( z5gaz<(R^?K00NFlL_t(|+U=4(YZOrwhTn7Uy|dpDOoTwh2r9us0)AjR8!fB^e}R=) zh>eB+z`vk{g$VutYe7pzHt7UoK8Ptc29+e6Y_hvE_Z$z)Mw8hT#*fZt=H<>|=02Qz z82sm-L+Eqs@!W@YH=978;Ap83`1;GwE3;$kMasGknRsLs4{0|c6cJ1I+;MQks1zKC zS?doc6^2KjEQ{ker;foh1IB!#b#i)P%izfF`H18e|&jn ztO^U`7m1>H@$SnAjD6xH1WGf(+nE_`wRR3Q%Sxq;OOxjjLcoC7v7=Ty;@f%)PaoU> z5uhRvQA>oXB3f;0FGg>bsJQp&6}D`zXMcd$C$!ZOw7Uv|B2A+SWnWA*5CX81DmG2* z`~hO`7~7pLI+^r3g&q`><-4}4ldA2F2rj`cbngC}rYP4``x{`W-G}*K33gkEEDR>u z@Kz+ZubpZhttCUE+B8`qfE;6eGp59}=!17FfQ(g(4l$BNQL*RUnP^U?17@{mJe+eD z6F0>t-mm&3_+=uwTrD|tQ<#`hE^vP{<&LfgjDpa~xF=15gSpsyH*a>gq^ho5WH=T` z1j#mMYT9VU;yAZDU8I@f_c3uKfQZ7z z>>8cEaCPL$ohM5dCyrM@_#;#l(;pknXLrwz5dgMKSx(^Zuwbcw2beKyq726iO#lD@ M07*qoM6N<$f^*YZE&u=k literal 0 HcmV?d00001 diff --git a/src/www/themes/gforge/images/docman/directory-with-documents.png b/src/www/themes/gforge/images/docman/directory-with-documents.png new file mode 100644 index 0000000000000000000000000000000000000000..9443cbf9f53d06aaa9262beb174b372f0560ba3c GIT binary patch literal 782 zcmV+p1M&QcP)Px#24YJ`L;(K){{a7>y{D4^000SaNLh0L01ejw01ejxLMWSf00007bV*G`2iXG( z5gaz<(R^?K00NFlL_t(|+U=4(YZOrwhTn7Uy|dpDOoTwh2r9us0)AjR8!fB^e}R=) zh>eB+z`vk{g$VutYe7pzHt7UoK8Ptc29+e6Y_hvE_Z$z)Mw8hT#*fZt=H<>|=02Qz z82sm-L+Eqs@!W@YH=978;Ap83`1;GwE3;$kMasGknRsLs4{0|c6cJ1I+;MQks1zKC zS?doc6^2KjEQ{ker;foh1IB!#b#i)P%izfF`H18e|&jn ztO^U`7m1>H@$SnAjD6xH1WGf(+nE_`wRR3Q%Sxq;OOxjjLcoC7v7=Ty;@f%)PaoU> z5uhRvQA>oXB3f;0FGg>bsJQp&6}D`zXMcd$C$!ZOw7Uv|B2A+SWnWA*5CX81DmG2* z`~hO`7~7pLI+^r3g&q`><-4}4ldA2F2rj`cbngC}rYP4``x{`W-G}*K33gkEEDR>u z@Kz+ZubpZhttCUE+B8`qfE;6eGp59}=!17FfQ(g(4l$BNQL*RUnP^U?17@{mJe+eD z6F0>t-mm&3_+=uwTrD|tQ<#`hE^vP{<&LfgjDpa~xF=15gSpsyH*a>gq^ho5WH=T` z1j#mMYT9VU;yAZDU8I@f_c3uKfQZ7z z>>8cEaCPL$ohM5dCyrM@_#;#l(;pknXLrwz5dgMKSx(^Zuwbcw2beKyq726iO#lD@ M07*qoM6N<$f^*YZE&u=k literal 0 HcmV?d00001 -- 2.30.2