From f28093dd52d21d534a65a8a214a7e8c7c800a6bc Mon Sep 17 00:00:00 2001 From: inureyes Date: Wed, 26 Mar 2008 08:03:25 +0000 Subject: [PATCH] =?UTF-8?q?=20#896=20=20*=20fx=20effect=EB=A5=BC=20?= =?UTF-8?q?=EC=9C=84=ED=95=9C=20=EB=A3=A8=ED=8B=B4=20=EC=B6=94=EA=B0=80=20?= =?UTF-8?q?=20*=20=EA=B7=B8=EB=9F=AC=EB=82=98=20=EB=AA=87=EA=B0=80?= =?UTF-8?q?=EC=A7=80=20=EC=9D=B4=EC=9C=A0=EB=A1=9C=20=EC=BC=9C=EB=86=93?= =?UTF-8?q?=EC=A7=80=EB=8A=94=20=EC=95=8A=EC=8A=B5=EB=8B=88=EB=8B=A4.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/config.php | 1 + lib/model/blog.fx.php | 2 +- lib/piece/owner/footer.php | 7 ++++ lib/piece/owner/header.php | 5 ++- script/mootools.js | 66 ++++++++++++++++++++++++++++++++++++-- script/owner.fx.js | 39 ++++++++++++++++++++++ 6 files changed, 114 insertions(+), 6 deletions(-) create mode 100644 script/owner.fx.js diff --git a/lib/config.php b/lib/config.php index 9af74da69..9c0e37c0e 100644 --- a/lib/config.php +++ b/lib/config.php @@ -41,6 +41,7 @@ $service['reader'] = true; $service['flashclipboardpoter'] = true; $service['allowBlogVisibilitySetting'] = true; +$service['effect'] = false; //$service['flashuploader'] = false; // Map port setting. diff --git a/lib/model/blog.fx.php b/lib/model/blog.fx.php index d3b5dbbf2..1fbad201e 100644 --- a/lib/model/blog.fx.php +++ b/lib/model/blog.fx.php @@ -26,7 +26,7 @@ function setDetailPanel($id,$type = 'section') { } function activateDetailPanelJS() { - global $fxList; + global $fxList, $service; $jsVal = ''; if(!empty($fxList)) { foreach($fxList as $fxItem) { diff --git a/lib/piece/owner/footer.php b/lib/piece/owner/footer.php index e20323b3e..fff4e5602 100644 --- a/lib/piece/owner/footer.php +++ b/lib/piece/owner/footer.php @@ -100,5 +100,12 @@ ?> //]]> + + + diff --git a/lib/piece/owner/header.php b/lib/piece/owner/header.php index 23f838c6d..62b06b6fb 100755 --- a/lib/piece/owner/header.php +++ b/lib/piece/owner/header.php @@ -210,10 +210,9 @@ - 1);for(var I=0;I~\s])[a-zA-Z#.*\s]/g)}; +Selectors.parse=function(A){var B={tag:"*",id:null,classes:[],attributes:[],pseudos:[]};A=A.replace(Selectors.regExp,function(E){switch(E.charAt(0)){case".":B.classes.push(E.slice(1)); +break;case"#":B.id=E.slice(1);break;case"[":B.attributes.push([arguments[4],arguments[5],arguments[7]]);break;case":":var D=Selectors.Pseudo.get(arguments[1]); +if(!D){B.attributes.push([arguments[1],arguments[3]?"=":"",arguments[3]]);break;}var C={name:arguments[1],parser:D,argument:(D.parser)?D.parser(arguments[3]):arguments[3]}; +B.pseudos.push(C);break;default:B.tag=E;}return"";});return B;};Selectors.Pseudo=new Hash;Selectors.XPath={getParam:function(B,G,D,H){var A="";switch(G){case" ":A+="//"; +break;case">":A+="/";break;case"+":A+="/following-sibling::*[1]/self::";break;case"~":A+="/following-sibling::";break;}A+=(D.namespaceURI)?"xhtml:"+H.tag:H.tag; +var C;for(C=H.pseudos.length;C--;C){var F=H.pseudos[C];if(F.parser&&F.parser.xpath){A+=F.parser.xpath(F.argument);}else{A+=($chk(F.argument))?"[@"+F.name+'="'+F.argument+'"]':"[@"+F.name+"]"; +}}if(H.id){A+='[@id="'+H.id+'"]';}for(C=H.classes.length;C--;C){A+='[contains(concat(" ", @class, " "), " '+H.classes[C]+' ")]';}for(C=H.attributes.length; +C--;C){var E=H.attributes[C];switch(E[1]){case"=":A+="[@"+E[0]+'="'+E[2]+'"]';break;case"*=":A+="[contains(@"+E[0]+', "'+E[2]+'")]';break;case"^=":A+="[starts-with(@"+E[0]+', "'+E[2]+'")]'; +break;case"$=":A+="[substring(@"+E[0]+", string-length(@"+E[0]+") - "+E[2].length+' + 1) = "'+E[2]+'"]';break;case"!=":A+="[@"+E[0]+'!="'+E[2]+'"]';break; +case"~=":A+='[contains(concat(" ", @'+E[0]+', " "), " '+E[2]+' ")]';break;case"|=":A+='[contains(concat("-", @'+E[0]+', "-"), "-'+E[2]+'-")]';break;default:A+="[@"+E[0]+"]"; +}}B.push(A);return B;},getItems:function(B,E){var F=[];var G=E.getDocument();var A=G.evaluate(".//"+B.join(""),E,Selectors.XPath.resolver,XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE,null); +for(var D=0,C=A.snapshotLength;D":D=O.childNodes;for(L=0,K=D.length;L=B){A-=B;}switch(C){case"n":return{a:B,b:A,special:"n"};case"odd":return{a:2,b:0,special:"n"}; +case"even":return{a:2,b:1,special:"n"};case"first":return{a:0,special:"index"};case"last":return{special:"last"};case"only":return{special:"only"};default:return{a:(B-1),special:"index"}; +}},xpath:function(A){switch(A.special){case"n":return"[count(preceding-sibling::*) mod "+A.a+" = "+A.b+"]";case"last":return"[count(following-sibling::*) = 0]"; +case"only":return"[not(preceding-sibling::* or following-sibling::*)]";default:return"[count(preceding-sibling::*) = "+A.a+"]";}},filter:function(A,I){var J=0,C=this; +switch(A.special){case"n":I.Positions=I.Positions||{};if(!I.Positions[this.uid]){var D=this.parentNode.childNodes;for(var G=0,F=D.length;GA.a){return false;}}return true;}return false;}};Selectors.Pseudo.extend({even:{parser:function(){return{a:2,b:1,special:"n"}; +},xpath:Selectors.Pseudo.nth.xpath,filter:Selectors.Pseudo.nth.filter},odd:{parser:function(){return{a:2,b:0,special:"n"};},xpath:Selectors.Pseudo.nth.xpath,filter:Selectors.Pseudo.nth.filter},first:{parser:function(){return{a:0,special:"index"}; +},xpath:Selectors.Pseudo.nth.xpath,filter:Selectors.Pseudo.nth.filter},last:{parser:function(){return{special:"last"};},xpath:Selectors.Pseudo.nth.xpath,filter:Selectors.Pseudo.nth.filter},only:{parser:function(){return{special:"only"}; +},xpath:Selectors.Pseudo.nth.xpath,filter:Selectors.Pseudo.nth.filter}});var Fx=new Class({Implements:[Chain,Events,Options],options:{fps:50,unit:false,duration:500,link:"ignore",transition:function(A){return -(Math.cos(Math.PI*A)-1)/2; }},initialize:function(A){this.pass=this.pass||this;this.setOptions(A);this.options.duration=Fx.Durations[this.options.duration]||this.options.duration.toInt(); var B=this.options.wait;if(B===false){this.options.link="cancel";}},step:function(){var A=$time();if(A=(7-4*B)/11){C=-Math.pow((11-6*B-11*D)/4,2)+A*A;break;}}return C;},Elastic:function(B,A){return Math.pow(2,10*--B)*Math.cos(20*B*Math.PI*(A[0]||1)/3); -}});["Quad","Cubic","Quart","Quint"].each(function(B,A){Fx.Transitions[B]=new Fx.Transition(function(C){return Math.pow(C,[A+2]);});}); \ No newline at end of file +}});["Quad","Cubic","Quart","Quint"].each(function(B,A){Fx.Transitions[B]=new Fx.Transition(function(C){return Math.pow(C,[A+2]);});});var Tips=new Class({Implements:[Events,Options],options:{onShow:function(A){A.setStyle("visibility","visible"); +},onHide:function(A){A.setStyle("visibility","hidden");},maxTitleChars:30,showDelay:100,hideDelay:100,className:"tool",offsets:{x:16,y:16},fixed:false},initialize:function(B,A){this.setOptions(A); +B=$$(B);this.document=(B.length)?B[0].ownerDocument:document;this.toolTip=new Element("div",{"class":this.options.className+"-tip",styles:{position:"absolute",top:"0",left:"0",visibility:"hidden"}},this.document).inject(this.document.body); +this.wrapper=new Element("div").inject(this.toolTip);B.each(this.build,this);},build:function(B){B.$attributes.myTitle=(B.href&&B.get("tag")=="a")?B.href.replace("http://",""):(B.rel||false); +if(B.title){var C=B.title.split("::");if(C.length>1){B.$attributes.myTitle=C[0].trim();B.$attributes.myText=C[1].trim();}else{B.$attributes.myText=B.title; +}B.removeProperty("title");}else{B.$attributes.myText=false;}if(B.$attributes.myTitle&&B.$attributes.myTitle.length>this.options.maxTitleChars){B.$attributes.myTitle=B.$attributes.myTitle.substr(0,this.options.maxTitleChars-1)+"…"; +}B.addEvent("mouseenter",function(D){this.start(B);if(!this.options.fixed){this.locate(D);}else{this.position(B);}}.bind(this));if(!this.options.fixed){B.addEvent("mousemove",this.locate.bind(this)); +}var A=this.end.bind(this);B.addEvent("mouseleave",A);},start:function(A){this.wrapper.empty();if(A.$attributes.myTitle){this.title=new Element("span").inject(new Element("div",{"class":this.options.className+"-title"}).inject(this.wrapper)).set("html",A.$attributes.myTitle); +}if(A.$attributes.myText){this.text=new Element("span").inject(new Element("div",{"class":this.options.className+"-text"}).inject(this.wrapper)).set("html",A.$attributes.myText); +}$clear(this.timer);this.timer=this.show.delay(this.options.showDelay,this);},end:function(A){$clear(this.timer);this.timer=this.hide.delay(this.options.hideDelay,this); +},position:function(A){var B=A.getPosition();this.toolTip.setStyles({left:B.x+this.options.offsets.x,top:B.y+this.options.offsets.y});},locate:function(B){var D=this.document.getSize(); +var A=this.document.getScroll();var C={x:this.toolTip.offsetWidth,y:this.toolTip.offsetHeight};var G={x:"left",y:"top"};for(var E in G){var F=B.page[E]+this.options.offsets[E]; +if((F+C[E]-A[E])>D[E]){F=B.page[E]-this.options.offsets[E]-C[E];}this.toolTip.setStyle(G[E],F);}},show:function(){if(this.options.timeout){this.timer=this.hide.delay(this.options.timeout,this); +}this.fireEvent("onShow",[this.toolTip]);},hide:function(){this.fireEvent("onHide",[this.toolTip]);}});var SmoothScroll=new Class({Extends:Fx.Scroll,initialize:function(B,C){C=$(C); +var E=C.getDocument(),D=C.getWindow();arguments.callee.parent(E,B);this.links=(this.options.links)?$$(this.options.links):$$(E.links);var A=D.location.href.match(/^[^#]*/)[0]+"#"; +this.links.each(function(G){if(G.href.indexOf(A)!=0){return ;}var F=G.href.substr(A.length);if(F&&$(F)){this.useLink(G,F);}},this);if(!Browser.Engine.webkit419){this.addEvent("onComplete",function(){D.location.hash=this.anchor; +},true);}},useLink:function(B,A){B.addEvent("click",function(C){this.anchor=A;this.toElement(A);C.stop();}.bind(this));}});Fx.Elements=new Class({Extends:Fx.CSS,initialize:function(B,A){this.elements=this.pass=$$(B); +arguments.callee.parent(A);},compute:function(G,H,I){var C={};for(var D in G){var A=G[D],E=H[D],F=C[D]={};for(var B in A){F[B]=arguments.callee.parent(A[B],E[B],I); +}}return C;},set:function(B){for(var C in B){var A=B[C];for(var D in A){this.render(this.elements[C],D,A[D]);}}return this;},start:function(C){if(!this.check(C)){return this; +}var H={},I={};for(var D in C){var F=C[D],A=H[D]={},G=I[D]={};for(var B in F){var E=this.prepare(this.elements[D],B,F[B]);A[B]=E.from;G[B]=E.to;}}return arguments.callee.parent(H,I); +}}); \ No newline at end of file diff --git a/script/owner.fx.js b/script/owner.fx.js new file mode 100644 index 000000000..e904f63e3 --- /dev/null +++ b/script/owner.fx.js @@ -0,0 +1,39 @@ +/// Copyright (c) 2004-2008, Tatter & Company / Tatter & Friends. +/// All rights reserved. Licensed under the GPL. +/// See the GNU General Public License for more details. (/doc/LICENSE, /doc/COPYRIGHT) + +var szFull = 100; +var origMenuSize = {}; + +var mainMenuItems = $$("#main-menu li"); +var mainMenuFx = new Fx.Elements(mainMenuItems, {wait: false, duration: 200, transition: Fx.Transitions.quadOut}); + +mainMenuItems.each(function(menus, i) { + origMenuSize[i] = menus.getStyle("width").toInt(); +}); + +mainMenuItems.each(function(kwick, i) { + kwick.addEvent("mouseenter", function(event) { + var obj = {}; + if(i != 0) { + obj[i] = {'width': [origMenuSize[i], origMenuSize[i]+30]}; + } else { + obj[i] = origMenuSize[i]; + } + mainMenuItems.each(function(other, j) { + if(i != j) { + var w = other.getStyle("width").toInt(); + obj[j] = {'width': [w, origMenuSize[j]]}; + } + }); + mainMenuFx.start(obj); + }); +}); + +$("mainMenuItems").addEvent("mouseleave", function(event) { + var obj = {}; + mainMenuItems.each(function(kwick, i) { + obj[i] = {'width': [kwick.getStyle("width").toInt(), origMenuSize[i]]}; + }); + mainMenuFx.start(obj); +});