| ||||||||||||
![]() |
| Notices |
![]() |
| | LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
(#1)
|
| Member Posts: 387 Join Date: Jan 2007 Location: Orange County, CA | Add a dropdown "Tools" menu to the top right menu in eSupport -
12-05-2007, 02:52 AM
I wanted a "Tools" menu so staff could reach commonly used web apps via a menu in eSupport. See the screen shot attached for the end result. The links in the dropdown menu are set to open in a new page. From the "total hacks out of left field department" <disclaimer>
I borrowed code from the nifty www.dynamicdrive.com website to accomplish this. If someone with developer skills or from Kayako could review how I have injected this into the .tpl file and ensure what I have done is ok, that would be nice. (If there is a better way to do this, please let us know) Backup this file before you begin! \esupport\themes\admin_default\cpheader.tpl So on with this then, In this file: \esupport\themes\admin_default\cpheader.tpl Right above the closing </head> tag I inserted: Code: <style type="text/css">
#dropmenudiv{
position:absolute;
border:1px solid black;
border-bottom-width: 0;
font:normal 12px Verdana;
line-height:18px;
z-index:100;
}
#dropmenudiv a{
width: 100%;
display: block;
text-indent: 3px;
border-bottom: 1px solid black;
padding: 1px 0;
text-decoration: none;
}
#dropmenudiv a:hover{ /*hover background color*/
background-color: white;
}
</style>
<script type="text/javascript">
/***********************************************
* AnyLink Drop Down Menu- © Dynamic Drive (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit http://www.dynamicdrive.com/ for full source code
***********************************************/
//Contents for menu 1, and so on
var menu1=new Array()
menu1[0]='<a href="http://knowledebase.ourdomain.com" target="_blank">iKB</a>'
menu1[1]='<a href="http://10.1.27.59/index.php" target="_blank">FTP Server</a>'
menu1[2]='<a href="http://base.ourdomain.com:411/Login.aspx" target="_blank">baseline</a>'
menu1[3]='<a href="http://www.webex.com" target="_blank">Webex</a>'
var menuwidth='165px' //default menu width
var menubgcolor='white' //menu bgcolor
var disappeardelay=250 //menu disappear speed onMouseout (in miliseconds)
var hidemenu_onclick="yes" //hide menu when user clicks within menu?
/////No further editting needed
var ie4=document.all
var ns6=document.getElementById&&!document.all
if (ie4||ns6)
document.write('<div id="dropmenudiv" style="visibility:hidden;width:'+menuwidth+';background-color:'+menubgcolor+'" onMouseover="clearhidemenu()" onMouseout="dynamichide(event)"></div>')
function getposOffset(what, offsettype){
var totaloffset=(offsettype=="left")? what.offsetLeft : what.offsetTop;
var parentEl=what.offsetParent;
while (parentEl!=null){
totaloffset=(offsettype=="left")? totaloffset+parentEl.offsetLeft : totaloffset+parentEl.offsetTop;
parentEl=parentEl.offsetParent;
}
return totaloffset;
}
function showhide(obj, e, visible, hidden, menuwidth){
if (ie4||ns6)
dropmenuobj.style.left=dropmenuobj.style.top="-500px"
if (menuwidth!=""){
dropmenuobj.widthobj=dropmenuobj.style
dropmenuobj.widthobj.width=menuwidth
}
if (e.type=="click" && obj.visibility==hidden || e.type=="mouseover")
obj.visibility=visible
else if (e.type=="click")
obj.visibility=hidden
}
function iecompattest(){
return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}
function clearbrowseredge(obj, whichedge){
var edgeoffset=0
if (whichedge=="rightedge"){
var windowedge=ie4 && !window.opera? iecompattest().scrollLeft+iecompattest().clientWidth-15 : window.pageXOffset+window.innerWidth-15
dropmenuobj.contentmeasure=dropmenuobj.offsetWidth
if (windowedge-dropmenuobj.x < dropmenuobj.contentmeasure)
edgeoffset=dropmenuobj.contentmeasure-obj.offsetWidth
}
else{
var topedge=ie4 && !window.opera? iecompattest().scrollTop : window.pageYOffset
var windowedge=ie4 && !window.opera? iecompattest().scrollTop+iecompattest().clientHeight-15 : window.pageYOffset+window.innerHeight-18
dropmenuobj.contentmeasure=dropmenuobj.offsetHeight
if (windowedge-dropmenuobj.y < dropmenuobj.contentmeasure){ //move up?
edgeoffset=dropmenuobj.contentmeasure+obj.offsetHeight
if ((dropmenuobj.y-topedge)<dropmenuobj.contentmeasure) //up no good either?
edgeoffset=dropmenuobj.y+obj.offsetHeight-topedge
}
}
return edgeoffset
}
function populatemenu(what){
if (ie4||ns6)
dropmenuobj.innerHTML=what.join("")
}
function dropdownmenu(obj, e, menucontents, menuwidth){
if (window.event) event.cancelBubble=true
else if (e.stopPropagation) e.stopPropagation()
clearhidemenu()
dropmenuobj=document.getElementById? document.getElementById("dropmenudiv") : dropmenudiv
populatemenu(menucontents)
if (ie4||ns6){
showhide(dropmenuobj.style, e, "visible", "hidden", menuwidth)
dropmenuobj.x=getposOffset(obj, "left")
dropmenuobj.y=getposOffset(obj, "top")
dropmenuobj.style.left=dropmenuobj.x-clearbrowseredge(obj, "rightedge")+"px"
dropmenuobj.style.top=dropmenuobj.y-clearbrowseredge(obj, "bottomedge")+obj.offsetHeight+"px"
}
return clickreturnvalue()
}
function clickreturnvalue(){
if (ie4||ns6) return false
else return true
}
function contains_ns6(a, b) {
while (b.parentNode)
if ((b = b.parentNode) == a)
return true;
return false;
}
function dynamichide(e){
if (ie4&&!dropmenuobj.contains(e.toElement))
delayhidemenu()
else if (ns6&&e.currentTarget!= e.relatedTarget&& !contains_ns6(e.currentTarget, e.relatedTarget))
delayhidemenu()
}
function hidemenu(e){
if (typeof dropmenuobj!="undefined"){
if (ie4||ns6)
dropmenuobj.style.visibility="hidden"
}
}
function delayhidemenu(){
if (ie4||ns6)
delayhide=setTimeout("hidemenu()",disappeardelay)
}
function clearhidemenu(){
if (typeof delayhide!="undefined")
clearTimeout(delayhide)
}
if (hidemenu_onclick=="yes")
document.onclick=hidemenu
</script>
Quote:
Further down in the .tpl file, in this section: Code: <tr>
<td align="right" valign="bottom"><span class="smalltext"><font color="#333333"><{$language[loggedinas]}><{$staffname}> | <a href="<{$swiftpath}>index.php" title="<{$language[clientarea]}>" target="_blank"><{$language[clientarea]}></a><{if $area eq "admin"}> | <a href="<{$swiftpath}>staff/index.php" title="<{$language[staffcp]}>" target="_blank"><{$language[staffcp]}></a><{elseif $area eq "staff"}> |
<a href="default2.htm" onClick="return dropdownmenu(this, event, menu1, '200px')" onMouseout="delayhidemenu()">Tools</a> <{/if}></font> | <a href="<{if $area eq "admin"}><{$swiftpath}>admin/index.php?_ca=logout<{else}><{$swiftpath}>staff/index.php?_ca=logout<{/if}>" id="blue" title="<{$language[logout]}>"><strong><{$language[logout]}></strong></a> </span></td>
</tr>
| <a href="default2.htm" onClick="return dropdownmenu(this, event, menu1, '200px')" onMouseout="delayhidemenu()">Tools</a> Regards, Rich Features I need asap: 1) Ticket search in the client portal! 2) Column display in client portal showing clients email address or name 3) Downloads by client (i.e. - each client has their own download area and can't see/touch downloads for any other client.) This would be on top of a "public" download area. 4) Integrated KB image uploads The ability for staff to upload images with a KB articles. Cheers! | |
| | |
(#2)
|
(#3)
|
(#4)
|
(#5)
|
(#6)
|
(#7)
|
| Senior Member Posts: 5,920 Join Date: Jun 2005 Location: Cumbria, UK |
08-02-2008, 02:20 PM
Did you try holding down Control and pressing F5 to do a hard refresh? Icon Headquarters - Its Elixir - Web2Messenger |
| | |
(#8)
|
(#9)
|
(#10)
|
(#11)
|
(#12)
|
(#13)
|
(#14)
|
(#15)
|
![]() |
| Tags |
| dropdown, esupport, menu, tools |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
| |