Commit 4466f4c8 authored by Gabriel Monnerat's avatar Gabriel Monnerat

2010-11-02 gabriel

* The initial commit

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@39795 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 1d846b5d
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Folder" module="OFS.Folder"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_objects</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>mbmenu</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="File" module="OFS.Image"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_Cacheable__manager_id</string> </key>
<value> <string>http_cache</string> </value>
</item>
<item>
<key> <string>_EtagSupport__etag</string> </key>
<value> <string>ts79962421.52</string> </value>
</item>
<item>
<key> <string>__name__</string> </key>
<value> <string>mbMenu.min.js</string> </value>
</item>
<item>
<key> <string>content_type</string> </key>
<value> <string>application/x-javascript</string> </value>
</item>
<item>
<key> <string>data</string> </key>
<value> <string encoding="cdata"><![CDATA[
/*******************************************************************************\n
jquery.mb.components\n
Copyright (c) 2001-2010. Matteo Bicocchi (Pupunzi); Open lab srl, Firenze - Italy\n
email: info@pupunzi.com\n
site: http://pupunzi.com\n
\n
Licences: MIT, GPL\n
http://www.opensource.org/licenses/mit-license.php\n
http://www.gnu.org/licenses/gpl.html\n
******************************************************************************/\n
\n
(function($){$.mbMenu={actualMenuOpener:false,options:{template:"yourMenuVoiceTemplate",additionalData:"",menuSelector:".menuContainer",menuWidth:150,openOnRight:false,containment:"window",iconPath:"ico/",hasImages:true,fadeInTime:100,fadeOutTime:200,menuTop:0,menuLeft:0,submenuTop:0,submenuLeft:4,opacity:1,shadow:false,shadowColor:"transparent",shadowOpacity:.2,openOnClick:true,closeOnMouseOut:false,closeAfter:500,minZindex:"auto",hoverIntent:0,submenuHoverIntent:200,onContextualMenu:function(){}},buildMenu:function(g){return this.each(function(){var c=this;c.id=!this.id?"menu_"+Math.floor(Math.random()*1000):this.id;this.options={};$.extend(this.options,$.mbMenu.options);$.extend(this.options,g);$(".mbmenu").hide();c.clicked=false;c.rootMenu=false;c.clearClicked=false;c.actualOpenedMenu=false;c.menuvoice=false;var d=$(this);var e=this.options.openOnClick;var f=this.options.closeOnMouseOut;$(d).each(function(){if($.metadata){$.metadata.setType("class");c.menuvoice=$(this).find(".rootVoice");$(c.menuvoice).each(function(){if($(this).metadata().menu)$(this).attr("menu",$(this).metadata().menu)})}c.menuvoice=$(this).find("[menu]").add($(this).filter("[menu]"));$(c.menuvoice).each(function(){$(this).addClass("rootVoice");$(this).attr("nowrap","nowrap")});if(e){$(c.menuvoice).bind("click",function(){if(!$(this).attr("isOpen")){$(this).buildMbMenu(c,$(this).attr("menu"));$(this).attr("isOpen","true")}else{$(this).removeMbMenu(c,true);$(this).addClass("selected")}if($(this).attr("menu")=="empty"){if(c.actualOpenedMenu){$(c.actualOpenedMenu).removeClass("selected");c.clicked=true;$(this).removeAttr("isOpen");clearTimeout(c.clearClicked)}}return false})}var a=$.browser.msie?"mouseenter":"mouseover";var b=$.browser.msie?"mouseleave":"mouseout";if(this.options.hoverIntent==0){$(c.menuvoice).bind(a,function(){if(f)clearTimeout($.mbMenu.deleteOnMouseOut);if(!e)$(c).find(".selected").removeClass("selected");if(c.actualOpenedMenu){$(c.actualOpenedMenu).removeClass("selected")}$(this).addClass("selected");if((c.clicked||!e)&&!$(this).attr("isOpen")){clearTimeout(c.clearClicked);$(this).buildMbMenu(c,$(this).attr("menu"));if($(this).attr("menu")=="empty"){$(this).removeAttr("isOpen")}}});$(c.menuvoice).bind(b,function(){if(f)$.mbMenu.deleteOnMouseOut=setTimeout(function(){$(this).removeMbMenu(c,true)},$(d)[0].options.closeAfter);if($(this).attr("menu")=="empty"){$(this).removeClass("selected");c.clearClicked=setTimeout(function(){c.rootMenu=false;c.clicked=false},$(d)[0].options.closeAfter)}if(!c.clicked)$(this).removeClass("selected");$(document).one("click",function(){if($(this).attr("menu")=="empty"){clearTimeout(c.clearClicked);return}$(this).removeClass("selected");$(this).removeMbMenu(c,true)})})}else{$(c.menuvoice).hoverIntent({over:function(){if(f)clearTimeout($.mbMenu.deleteOnMouseOut);if(!e)$(c).find(".selected").removeClass("selected");if(c.actualOpenedMenu){$(c.actualOpenedMenu).removeClass("selected")}$(this).addClass("selected");if((c.clicked||!e)&&!$(this).attr("isOpen")){clearTimeout(c.clearClicked);$(this).buildMbMenu(c,$(this).attr("menu"));if($(this).attr("menu")=="empty"){$(this).removeMbMenu(c);$(this).removeAttr("isOpen")}}},sensitivity:30,interval:this.options.hoverIntent,timeout:0,out:function(){if(f)$.mbMenu.deleteOnMouseOut=setTimeout(function(){$(this).removeMbMenu(c,true)},$(d)[0].options.closeAfter);if($(this).attr("menu")=="empty"){$(this).removeClass("selected");c.clearClicked=setTimeout(function(){c.rootMenu=false;c.clicked=false},$(d)[0].options.closeAfter)}if(!c.clicked)$(this).removeClass("selected");$(document).one("click",function(){if($(this).attr("menu")=="empty"){clearTimeout(c.clearClicked);return}$(this).removeClass("selected");$(this).removeMbMenu(c,true)})}})}})})},buildContextualMenu:function(e){return this.each(function(){var c=this;c.options={};$.extend(c.options,$.mbMenu.options);$.extend(c.options,e);$(".mbmenu").hide();c.clicked=false;c.rootMenu=false;c.clearClicked=false;c.actualOpenedMenu=false;c.menuvoice=false;var d;if($.metadata){$.metadata.setType("class");d=$(this).find(".cmVoice");$(d).each(function(){if($(this).metadata().cMenu)$(this).attr("cMenu",$(this).metadata().cMenu)})}d=$(this).find("[cMenu]").add($(this).filter("[cMenu]"));$(d).each(function(){$(this).css("-khtml-user-select","none");var b=this;b.id=!b.id?"menu_"+Math.floor(Math.random()*100):b.id;$(b).css({cursor:"default"});$(b).bind("contextmenu","mousedown",function(a){a.preventDefault();a.stopPropagation();a.cancelBubble=true;$.mbMenu.lastContextMenuEl=b;if($.mbMenu.options.actualMenuOpener){$(c).removeMbMenu($.mbMenu.options.actualMenuOpener)}c.options.onContextualMenu(this,a);$(this).buildMbMenu(c,$(this).attr("cMenu"),"cm",a);$(this).attr("isOpen","true")})})})}};$.fn.extend({buildMbMenu:function(n,m,o,e){var p=$.browser.msie&&$.browser.version=="6.0";var q=$.browser.msie?"mouseenter":"mouseover";var r=$.browser.msie?"mouseleave":"mouseout";if(e){this.mouseX=$(this).getMouseX(e);this.mouseY=$(this).getMouseY(e)}if($.mbMenu.options.actualMenuOpener&&$.mbMenu.options.actualMenuOpener!=n)$(n).removeMbMenu($.mbMenu.options.actualMenuOpener);$.mbMenu.options.actualMenuOpener=n;if(!o||o=="cm"){if(n.rootMenu){$(n.rootMenu).removeMbMenu(n);$(n.actualOpenedMenu).removeAttr("isOpen")}n.clicked=true;n.actualOpenedMenu=this;$(n.actualOpenedMenu).attr("isOpen","true");$(n.actualOpenedMenu).addClass("selected")}var s=this;var u=(!o||o=="cm")?$(document.body):$(this).parent().parent();if($(this).attr("menu")=="empty"){return}var v=n.options.menuSelector.replace(".","");u.append("<div class=\'menuDiv\'><div class=\'"+v+"\' style=\'display:table\'></div></div>");this.menu=u.find(".menuDiv");$(this.menu).css({width:0,height:0});if(n.options.minZindex!="auto"){$(this.menu).css({zIndex:n.options.minZindex++})}else{$(this.menu).mb_BringToFront()}this.menuContainer=$(this.menu).find(n.options.menuSelector);$(this.menuContainer).bind(q,function(){$(s).addClass("selected")});$(this.menuContainer).css({position:"absolute",opacity:n.options.opacity});if(!$("#"+m).html()){$.ajax({type:"POST",url:n.options.template,cache:false,async:false,data:"menuId="+m+(n.options.additionalData!=""?"&"+n.options.additionalData:""),success:function(a){$("body").append(a);$("#"+m).hide()}})}$(this.menuContainer).hide();this.voices=$("#"+m).find("a").clone();if(n.options.shadow){var w=$("<div class=\'menuShadow\'></div>").hide();if(p)w=$("<iframe class=\'menuShadow\'></iframe>").hide()}if($.metadata){$.metadata.setType("class");$(this.voices).each(function(){if($(this).metadata().disabled)$(this).attr("disabled",$(this).metadata().disabled);if($(this).metadata().img)$(this).attr("img",$(this).metadata().img);if($(this).metadata().menu)$(this).attr("menu",$(this).metadata().menu);if($(this).metadata().action)$(this).attr("action",$(this).metadata().action);if($(this).metadata().disabled)$(this).attr("disabled",$(this).metadata().disabled)})}$(this.voices).each(function(i){var c=this;var d="";var e=$(c).attr("rel")=="text";var f=$(c).attr("rel")=="title";var g=$(c).is("[disabled]");var h=$(c).attr("rel")=="separator";if(n.options.hasImages&&!e){var j=$(c).attr("img")?$(c).attr("img"):"blank.gif";j=(j.length>3&&j.indexOf(".")>-1)?"<img class=\'imgLine\' src=\'"+n.options.iconPath+j+"\'>":j;d="<td class=\'img\'>"+j+"</td>"}var k="<table id=\'"+m+"_"+i+"\' class=\'line"+(f?" title":"")+"\' cellspacing=\'0\' cellpadding=\'0\' border=\'0\' style=\'width:100%;\' width=\'100%\'><tr>"+d+"<td class=\'voice\' nowrap></td></tr></table>";if(h)k="<div class=\'separator\' style=\'width:100%; display:inline-block\'><img src=\'"+n.options.iconPath+"blank.gif\' width=\'1\' height=\'1\'></div>";if(e)k="<div style=\'width:100%; display:table\' class=\'line\' id=\'"+m+"_"+i+"\'><div class=\'voice\'></div></div>";$(s.menuContainer).append(k);var l=$(s.menuContainer).find("#"+m+"_"+i);if(!h){l.find(".voice").append(this);if($(this).attr("menu")){l.find(".voice a").wrap("<div class=\'menuArrow\'></div>");l.find(".menuArrow").addClass("subMenuOpener");l.css({cursor:"default"});this.isOpener=true}if(e){l.find(".voice").addClass("textBox");this.isOpener=true}if(g){l.addClass("disabled").css({cursor:"default"})}if(!(e||f||g)){l.css({cursor:"pointer"});if(n.options.submenuHoverIntent==0){l.bind("mouseover",function(a){clearTimeout($.mbMenu.deleteOnMouseOut);$(this).addClass("selected");if(s.menuContainer.actualSubmenu&&!$(c).attr("menu")){$(s.menu).find(".menuDiv").remove();$(s.menuContainer.actualSubmenu).removeClass("selected");s.menuContainer.actualSubmenu=false}if($(c).attr("menu")){if(s.menuContainer.actualSubmenu&&s.menuContainer.actualSubmenu!=this){$(s.menu).find(".menuDiv").remove();$(s.menuContainer.actualSubmenu).removeClass("selected");s.menuContainer.actualSubmenu=false}if(!$(c).attr("action"))$(s.menuContainer).find("#"+m+"_"+i).css("cursor","default");if(!s.menuContainer.actualSubmenu||s.menuContainer.actualSubmenu!=this){$(s.menu).find(".menuDiv").remove();s.menuContainer.actualSubmenu=false;$(this).buildMbMenu(n,$(c).attr("menu"),"sm",a);s.menuContainer.actualSubmenu=this}$(this).attr("isOpen","true");return false}})}else{l.bind("mouseover",function(){clearTimeout($.mbMenu.deleteOnMouseOut);$(this).addClass("selected")});l.hoverIntent({over:function(a){if(s.menuContainer.actualSubmenu&&!$(c).attr("menu")){$(s.menu).find(".menuDiv").remove();$(s.menuContainer.actualSubmenu).removeClass("selected");s.menuContainer.actualSubmenu=false}if($(c).attr("menu")){if(s.menuContainer.actualSubmenu&&s.menuContainer.actualSubmenu!=this){$(s.menu).find(".menuDiv").remove();$(s.menuContainer.actualSubmenu).removeClass("selected");s.menuContainer.actualSubmenu=false}if(!$(c).attr("action"))$(s.menuContainer).find("#"+m+"_"+i).css("cursor","default");if(!s.menuContainer.actualSubmenu||s.menuContainer.actualSubmenu!=this){$(s.menu).find(".menuDiv").remove();s.menuContainer.actualSubmenu=false;$(this).buildMbMenu(n,$(c).attr("menu"),"sm",a);s.menuContainer.actualSubmenu=this}$(this).attr("isOpen","true");return false}},out:function(){},sensitivity:30,interval:n.options.submenuHoverIntent,timeout:0})}l.bind(r,function(){$(this).removeClass("selected")})}if(g||f||e){$(this).removeAttr("href");l.bind(q,function(){$(document).unbind("click");if(x)clearTimeout($.mbMenu.deleteOnMouseOut);if(s.menuContainer.actualSubmenu){$(s.menu).find(".menuDiv").remove();s.menuContainer.actualSubmenu=false}}).css("cursor","default")}l.bind("click",function(){if(($(c).attr("action")||$(c).attr("href"))&&!g){var a=$(c).attr("target")?$(c).attr("target"):"_self";if($(c).attr("href")&&$(c).attr("href").indexOf("javascript:")>-1){$(c).attr("action",$(c).attr("href").replace("javascript:",""))}var b=$(c).attr("action")?$(c).attr("action"):"window.open(\'"+$(c).attr("href")+"\', \'"+a+"\')";if(!$(c).attr("href")||($(c).attr("href")&&$(c).attr("href").indexOf("javascript:")>-1)){$(c).removeAttr("href");eval(b)}$(this).removeMbMenu(n,true)}else if($(c).attr("menu"))return false})}});var x=$(n)[0].options.closeOnMouseOut;if(x){$(s.menuContainer).bind("mouseenter",function(){clearTimeout($.mbMenu.deleteOnMouseOut)});$(s.menuContainer).bind("mouseleave",function(){var a=$.mbMenu.options.actualMenuOpener;$.mbMenu.deleteOnMouseOut=setTimeout(function(){$(this).removeMbMenu(a,true)},$(n)[0].options.closeAfter)})}var t=0,l=0;$(this.menuContainer).css({width:n.options.menuWidth});if($.browser.msie)$(this.menuContainer).css("width",$(this.menuContainer).width()+2);switch(o){case"sm":t=$(this).position().top+n.options.submenuTop;l=$(this).position().left+$(this).width()-n.options.submenuLeft;break;case"cm":t=this.mouseY-5;l=this.mouseX-5;break;default:if(n.options.openOnRight){t=$(this).offset().top-($.browser.msie?2:0)+n.options.menuTop;l=$(this).offset().left+$(this).outerWidth()-n.options.menuLeft-($.browser.msie?2:0)}else{t=$(this).offset().top+$(this).outerHeight()-(!$.browser.mozilla?2:0)+n.options.menuTop;l=$(this).offset().left+n.options.menuLeft}break}$(this.menu).css({position:"absolute",top:t,left:l});if(!o||o=="cm")n.rootMenu=this.menu;$(this.menuContainer).bind(r,function(){$(document).one("click",function(){$(document).removeMbMenu(n,true)})});if(n.options.fadeInTime>0)$(this.menuContainer).fadeIn(n.options.fadeInTime);else $(this.menuContainer).show();if(n.options.shadow){$(this.menu).prepend(w);w.css({width:$(this.menuContainer).outerWidth(),height:$(this.menuContainer).outerHeight()-1,position:\'absolute\',backgroundColor:n.options.shadowColor,border:0,opacity:n.options.shadowOpacity}).show()}var y=(n.options.containment=="window")?$(window).height():$("#"+n.options.containment).offset().top+$("#"+n.options.containment).outerHeight();var z=(n.options.containment=="window")?$(window).width():$("#"+n.options.containment).offset().left+$("#"+n.options.containment).outerWidth();var A=$(this.menuContainer).outerHeight();var B=w?w.outerWidth():$(this.menuContainer).outerWidth();var C=$(u.find(".menuDiv:first")).offset().left-$(window).scrollLeft();var D=$(u.find(".menuDiv:first")).offset().top-$(window).scrollTop();switch(o){case"sm":if((C+B)>=z&&B<z){l-=((n.options.menuWidth*2)-(n.options.submenuLeft*2))}break;case"cm":if((C+(n.options.menuWidth*1.5))>=z&&B<z){l-=((n.options.menuWidth)-(n.options.submenuLeft))}break;default:if((C+B)>=z&&B<z){l-=($(this.menuContainer).offset().left+B)-z+1}break}if((D+A)>=y-10&&A<y){t-=((D+A)-y)+10}$(this.menu).css({top:t,left:l})},removeMbMenu:function(a,b){if(!a)a=$.mbMenu.options.actualMenuOpener;if(a.rootMenu){$(a.actualOpenedMenu).removeAttr("isOpen").removeClass("selected");$(a.rootMenu).css({width:1,height:1});if(b)$(a.rootMenu).fadeOut(a.options.fadeOutTime,function(){$(this).remove()});else $(a.rootMenu).remove();a.rootMenu=false;a.clicked=false;$(document).unbind("click")}},getMouseX:function(e){var a;if($.browser.msie)a=e.clientX+document.documentElement.scrollLeft;else a=e.pageX;if(a<0)a=0;return a},getMouseY:function(e){var a;if($.browser.msie)a=e.clientY+document.documentElement.scrollTop;else a=e.pageY;if(a<0)a=0;return a},mb_BringToFront:function(){var b=10;$(\'*\').each(function(){if($(this).css("position")=="absolute"){var a=parseInt($(this).css(\'zIndex\'));b=a>b?parseInt($(this).css(\'zIndex\')):b}});$(this).css(\'zIndex\',b+=10)}});$.fn.buildMenu=$.mbMenu.buildMenu;$.fn.buildContextualMenu=$.mbMenu.buildContextualMenu})(jQuery);
]]></string> </value>
</item>
<item>
<key> <string>precondition</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>size</string> </key>
<value> <int>14726</int> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
2010-11-02 gabriel
* The initial commit
\ No newline at end of file
2010 (c) Nexedi SA
\ No newline at end of file
erp5_jquery
\ No newline at end of file
This Business Template contains only static files of jQuery Mb.Menu Plugin.
\ No newline at end of file
GPL
\ No newline at end of file
gabriel
\ No newline at end of file
2
\ No newline at end of file
portal_skins/erp5_jquery/plugin/mbmenu
portal_skins/erp5_jquery/plugin/mbmenu/**
\ No newline at end of file
erp5_jquery_plugin_mbmenu
\ No newline at end of file
5.4.7
\ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment