From 6b0d6887e3449037f8e96d901be35c03f0943648 Mon Sep 17 00:00:00 2001 From: joyqi Date: Thu, 17 Oct 2013 14:30:50 +0800 Subject: [PATCH 1/4] =?UTF-8?q?=E4=BF=AE=E6=AD=A3=E4=B8=80=E4=BA=9B?= =?UTF-8?q?=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- admin/common-js.php | 20 ++++---- tools/Makefile | 2 +- tools/tabsize.php | 106 ----------------------------------------- var/Widget/Archive.php | 8 ++++ 4 files changed, 20 insertions(+), 116 deletions(-) delete mode 100644 tools/tabsize.php diff --git a/admin/common-js.php b/admin/common-js.php index cb41b53c..d4555658 100644 --- a/admin/common-js.php +++ b/admin/common-js.php @@ -32,17 +32,19 @@ } })(); - $('a').each(function () { - var t = $(this), href = t.attr('href'); + if ($('.typecho-login').length == 0) { + $('a').each(function () { + var t = $(this), href = t.attr('href'); - if ((href.length > 1 && href[0] == '#') - || /^adminUrl, '/'); ?>.*$/.exec(href) - || /^index), '/'), 0, -1); ?>action\/[_a-zA-Z0-9\/]+.*$/.exec(href)) { - return; - } + if ((href.length > 1 && href[0] == '#') + || /^adminUrl, '/'); ?>.*$/.exec(href) + || /^index), '/'), 0, -1); ?>action\/[_a-zA-Z0-9\/]+.*$/.exec(href)) { + return; + } - t.attr('target', '_blank'); - }); + t.attr('target', '_blank'); + }); + } }); })(); diff --git a/tools/Makefile b/tools/Makefile index 06e6c7fa..cedd10a9 100644 --- a/tools/Makefile +++ b/tools/Makefile @@ -12,7 +12,7 @@ update: git clone https://github.com/typecho/typecho-replica.git build rm -Rf build/.git rm -Rf build/.gitignore - for i in `find build/ -name '*.source.css'`; do echo $$i && java -Xmx32m -jar yuicompressor-2.4.2.jar $$i --charset UTF-8 -o $$i; done; + for i in `find build/ -name '*.css'`; do echo $$i && java -Xmx32m -jar yuicompressor-2.4.2.jar $$i --charset UTF-8 -o $$i; done; for i in `find build/admin/javascript/ -name '*.js'`; do echo $$i && java -Xmx32m -jar yuicompressor-2.4.2.jar $$i --charset UTF-8 -o $$i; done; for i in `find build/ -name '*.php'`; do php -l $$i; done; diff --git a/tools/tabsize.php b/tools/tabsize.php deleted file mode 100644 index 927244ba..00000000 --- a/tools/tabsize.php +++ /dev/null @@ -1,106 +0,0 @@ -isFile()) - { - $file = $file->__toString(); - $fileExt = (false === ($pos = strrpos($file,'.'))) ? NULL : substr($file,$pos + 1); - $fileName = (false === $pos) ? $file : substr($file,0,$pos); - - if(NULL !== $stamp && in_array($fileExt,$stamp)) - { - $files[] = $trim ? $file : $fileName; - } - else if(NULL === $stamp) - { - $files[] = $trim ? $file : $fileName; - } - } - } - return $files; -} - -//获取一个目录下的目录 -function mgGetDir($inpath) -{ - $dirs = array(); - - if(!is_dir($inpath)) - { - return $dirs; - } - $it = new DirectoryIterator($inpath); - - foreach($it as $dir) - { - if($dir->isDir() && !$dir->isDot()) - { - $dirs[] = $dir->__toString(); - } - } - return $dirs; -} - -function tabsize($dir = ROOT_DIR) -{ - if($files = mgGetFile($dir, true, 'php')) - { - foreach($files as $file) - { - if($contents = file_get_contents($dir . '/' . $file)) - { - $lines = preg_split("(\r\n|\r|\n)", $contents); - $result = array(); - foreach($lines as $line) - { - preg_match("/^(\s+)(.*)$/", $line, $out); - if($out && strlen($out[1]) > 0) - { - $line = str_replace("\t", ' ', $out[1]) . $out[2]; - } - - $result[] = rtrim($line, "\r\n") . "\n"; - } - - file_put_contents($dir . '/' . $file, trim(implode('', $result)) . "\n"); - } - } - } - - - if($dirs = mgGetDir($dir)) - { - foreach($dirs as $indir) - { - tabsize($dir . '/' . $indir); - } - } -} - -tabsize(); diff --git a/var/Widget/Archive.php b/var/Widget/Archive.php index 945c0692..81e6ee85 100644 --- a/var/Widget/Archive.php +++ b/var/Widget/Archive.php @@ -563,6 +563,14 @@ class Widget_Archive extends Widget_Abstract_Contents return $this->_total; } + /** + * @return the $_currentPage + */ + public function getCurrentPage() + { + return $this->_currentPage; + } + /** * @return the $_themeFile */ From ab1185e8a6874fd4287ca58bf93eb69bb7d9d2d3 Mon Sep 17 00:00:00 2001 From: joyqi Date: Thu, 17 Oct 2013 14:42:36 +0800 Subject: [PATCH 2/4] =?UTF-8?q?=E5=88=A0=E6=8E=89=E6=B2=A1=E7=94=A8?= =?UTF-8?q?=E7=9A=84=E5=9B=BE=E7=89=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- admin/css/style.css | 20 -------------------- admin/images/arrow.gif | Bin 180 -> 0 bytes admin/images/attach.gif | Bin 307 -> 0 bytes admin/images/comment.gif | Bin 1250 -> 0 bytes admin/images/notice.gif | Bin 580 -> 0 bytes admin/images/progress.gif | Bin 72 -> 0 bytes admin/images/sprite.png | Bin 2349 -> 0 bytes tools/Makefile | 33 +++------------------------------ 8 files changed, 3 insertions(+), 50 deletions(-) delete mode 100644 admin/images/arrow.gif delete mode 100644 admin/images/attach.gif delete mode 100644 admin/images/comment.gif delete mode 100644 admin/images/notice.gif delete mode 100644 admin/images/progress.gif delete mode 100644 admin/images/sprite.png diff --git a/admin/css/style.css b/admin/css/style.css index 7dafb43a..2f7dc4ac 100644 --- a/admin/css/style.css +++ b/admin/css/style.css @@ -1233,26 +1233,6 @@ ul.typecho-list-notable li { padding: 5px 0; } -ul.typecho-list-notable li span.comment, -ul.typecho-list-notable li span.pingback, -ul.typecho-list-notable li span.trackback { - background: url(../images/comment.gif) top no-repeat; - width: 16px; - height: 16px; - display: block; - float: left; - margin: 4px 3px -4px 0; - _margin-right: 0; -} - -ul.typecho-list-notable li span.pingback { - background-position: center; -} - -ul.typecho-list-notable li span.trackback { - background-position: bottom; -} - ul.typecho-list-notable li .comment-body { overflow: visible; } diff --git a/admin/images/arrow.gif b/admin/images/arrow.gif deleted file mode 100644 index 391cba04dad07b114fafdbef52413c613d0bb095..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 180 zcmZ?wbhEHb6kt$b*v!E2|Ns9#?;rene*XLQ4PVbMcsa@@scSnffjBP)4bM3t(RKi<&`Kk_rwzSX@6MTA165-S8lUqKH#vDVP`^K Tr-kjuRR@Hk)M6r91sSXX4**4A diff --git a/admin/images/attach.gif b/admin/images/attach.gif deleted file mode 100644 index b48d9925271ea3abe6609349259ed86f9ff373e8..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 307 zcmZ?wbhEHb6kt$bIKsg2{rmU#@83Ur_Uzuhd)KaAJ9qBf!Gj04Zr!?e?b@YFm(G|m zW6G2%Jv}`wEiKj6)%p4P>FMcFQBh%GVgLXCXCMM7{$ycfXAox40jUMq$-uhdfl6OW z=DZ9}l}?2v!3VTBix<3JC~%o!t~N`Px!|7=t|N`d9ZZy#I(!OXFc9MMXi%{YQ13gU zv`MyfdIF2{CnJ4<$u5r@BRqVXT`dzMGJKhMQ<-?`)w#HtSOf%fHCXutIZ_R#PMbbM zSzEVH-6+D;+=0`|#%{5bi<=rlu#aCrOmJv;VGFvk(8?y?gik-PZ?i|2=vA z<<5tj4`2Vh^Xl*O=g)6H|9Y;0&j$b>r_sYk;7aniCwd%~7Gh5GnSaV~^`ZMpAU7fe}+{&-Btfa zAFFy3=W2V?N&}-39o;+)tt?fwR3%_6FpPqM2m!^PER5_7O$<69%Rza9f#W{|E2oUd zh6M+k*;qLy8ZTdX*wR}-z{QBU;b^y5;1op*_67!K1zwem3k(OQax!sGVH7Yrc!EuU zLE++rB2|y+DvC$uSZ-K+VxpC91Vg~mLk?XM!Vv}x4$6+Le8mwe6CQWFw4@3=nQ)nD z;Q=X|2Ma!E2{_IaNV&W!_H>y8n~-73k`D$C7O;q`dA#ryZ02ZhQV2S5cjIApK_#<} zI}$S#UAd%rIP4}kJ?Z3jWKNlJBT&4BS6anja^R*mMt1QD>_0v%T+;cPQT#;3MnPp( zK}WrsBNZPK+C}7>Uf3u;R&Et?3|wSm!61EB+Oc%X6~#wRT?+bfB6|)9GWyCoR?hO- zul~q&0*j-pSx$iBi^c`!CD$507#J}0DR@p2IK!|gpC!`|bYw z?Ed@e{`&F$`t1Gs@%{Sd{rU0!`se-m?fv=Z{rKMe_SpRO)cf?}`}E`c^4k3K$NTca z`tQ~F?cVwB*ZS|Y_v*;{>z()K!};lx_vN_tQJ=Q}WhV^wv-C(ShsEs_)K) z?#y`a&2#O@dhf|-?Z|NJ%U15jTjvyLguwc<*_#1utwpjFyN*v-J?3+qbk{;Ro0?C)uBDrpgi56DAt@^+?^)cnk3nm zBGQsW){-C7iyG018_$Fl%6=-$eG$oa4aIN?!fOV=X9NHL{{R30A^8LW2LOHmEC2ui z01yBW000M}fPR95goTEJR#S(DGCw~mi-Qba4jf_-k$zDx0}(<`kr`nCBOwiD9*bBj z5^HM~FkgoxQ~@)aYL>eb(g-}NeC^=cak S)VY&K&mKN~-efWq2mm{L=2nUT diff --git a/admin/images/progress.gif b/admin/images/progress.gif deleted file mode 100644 index bda2b5a942f42029e9e960e072aefdcc520f5f3f..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 72 zcmZ?wbhEHbJjTSxFp+`b^6kz4!GM8*LGdRGBRc~VgAS0*0Fq~5l5FW;dHOB?;yGJx Xb#K16=Qn@bBadm%I+uAfGFSru*QFe) diff --git a/admin/images/sprite.png b/admin/images/sprite.png deleted file mode 100644 index 3e776f88dfb85de2b4a6ad197de5c2c47e910a97..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2349 zcmd6n`BxHH8^8R5MZ;p{c2(C8i;+gFBXHfTpAti&|Ko8Bs?EjTEX1wH118`>hdfvG6v29|=U5t$2RDz8la3GWZ@=iKK$&$;J0=YG%kJol!0x?j-V zVXy-L0BAcS&ZD+6768zg0IF|Q(?#Q>TS=V=clHJXf#a_|rT_r7ZJw^)j>>;gD5VM& zB89wPE*B}J9H~?)l5*uDmPjO&3z>3Zp-=_4f2;0i@OV5qm#XC8xhgnv4pG^F=5RRj z1`LP8QnHY87P_IKLCJ(GnJ_66$zm~;gp}gW@cvAFqrPKKJu11 zz9f{p7vQTM|Kt5Waolw42CeIe03raeQ%4nQLz8#bw+@X+j{YRC=ulE@2muFh3&9Yg zBXQX9kV8)41YB%10Z%-1rs3*P8~~tc?tI?fJFZYRPVsw#FzC9GYRq|CU%7m`wDJ9X z#!%gqMp-v7a_l>9**%v$?+zu~)Wb)EX7j^AXo!a*{_HHUR%gkjxMkfQYyaZOHZTnIfTVl8PR2=6~ zAJmc%OYT|H0qf~`XhA9{v9rVdMfAQtz1=+$3GRXk)8J7M|CT6o>=qVrvZNqtc4_p? zk=e!xHJ7aIpRHg}%E&nVnc($@Wlw{byJhw%_+mCk#(Gy$T#!Ec zM?UrGNfp;}CdiBjzJa)`GJ=3U5MO41oGx$Fobw_^cZ}UdpB>L5lP`AHqsXanyWi!9QTvmke+9G>E!QGts{Lb%IOa$AIxYlzbytkN*(q=iIzr5oGE8Htv>s#=a2 zWc)Z=y^`RNc0MXtT{&8Hu|O;67y5<{heB}sg278F}yZc1qW`tgB6mIM5cXyZmp6{~wS5NJ4rN3>2)rv_z&)VwO$LR~b zQK4*t3Crm0{HK+cvS;FBjf4Bmvr+AwkN-p(UfF(FD|~I}m1TNjayU(Xg5FeF=Im7( zjxfOtKOkcqx@xjrBM0lFUZv1)kG$Qz7CAyA4SUO;O!em8Km2Rr9WQO(=$j1-?0^O5 zkk>G$S%TCu%{2K*x4p&xutYg~`$XxYDg54Cf$_A@dgvYW}y7H1zZ|3pL# z&;nbcqQgG;IlSpGJ78}%Z%o!573J&dxIQ1jIKUOLnmPn#yl!3^?RjbE41#fd^ZnKF zNY}oRYqlU%oyqG;H?zukO48vu`eXLNnlGvJdlBJm@$C-c*kVN%u(^NzC#dvM4IgTO z9h^ySwP>&Wy*;BPbRr|ZLoc18t-n(MnuLAnI@l2sjkTs~R+L;!3Wge9LtJ{wV34X3$TjA4Y}3cwo#Al;k9|E&lGk0G;LHz2zrchuF2Gbe6IRUqo`2Rf|^Su-a$R9 z*yhx=qM%>gSN;*y3MR~(BuD1SEv3$ig}8vl#F;Vj%c8-R(=orjD;HJK@0(=IEvSa7 zeQ=--9+5xkxwbZ4=Rm8T=;je*e>o14`gc;#KRU;IpS6I*T@~YB?5^GSb)o=Mt+3BC zbpq!_vw@!S+h=9;1FQw|7yly-^k1i1L1Mdh#8E6MYTLw%&u5tQ|3n$K3@-$)@B=v6 z?g%k^kDuEgo2VLvmzGtHW^lvt+)abwL~nS!(#ZopI_5WJElTTOC>b(%DhRv>{sj?c+BhF(xf=90wA{_fHU}qJ?~9wrR!k}C z_jNBmY?)@G0uMPV1pyqJ;W^E}l z#k2ZCk}7!jFA@WizP%v;An5to*~=j}cW;W5zJ1{BY8RHe^BlSd3zi)+MC;3fd!Hn; zr_Ds%JI=7_;P1 Date: Thu, 17 Oct 2013 15:25:51 +0800 Subject: [PATCH 3/4] =?UTF-8?q?=E6=8F=90=E7=A4=BA=E6=A1=86=E6=94=B9?= =?UTF-8?q?=E8=BF=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- admin/common-js.php | 51 ++++++++--- admin/css/style.css | 12 ++- admin/file-upload-js.php | 2 +- admin/javascript/jquery-ui.js | 163 +--------------------------------- admin/javascript/typecho.js | 130 --------------------------- admin/login.php | 4 +- admin/manage-comments.php | 6 +- admin/media.php | 2 +- admin/write-js.php | 2 +- 9 files changed, 57 insertions(+), 315 deletions(-) diff --git a/admin/common-js.php b/admin/common-js.php index d4555658..7a0db800 100644 --- a/admin/common-js.php +++ b/admin/common-js.php @@ -7,10 +7,7 @@ $(document).ready(function() { highlight): ?> //增加高亮效果 - $('#highlight; ?>').addClass('nohover') - .effect('highlight', '#AACB36', 1000, function () { - $(this).removeClass('nohover'); - }); + $('#highlight; ?>').effect('highlight', 1000); //增加淡出效果 @@ -18,17 +15,43 @@ var p = $('.popup'); if (p.length > 0) { - if (p.hasClass('notice')) { - p.effect('bounce'); - } else if (p.hasClass('error')) { - p.effect('shake'); - } else { - p.slideDown(); + var head = $('.typecho-head-nav'), + offset = head.length > 0 ? head.outerHeight() : 0; + + function checkScroll () { + if ($(window).scrollTop() >= offset) { + p.css({ + 'position' : 'fixed', + 'top' : 0 + }); + } else { + p.css({ + 'position' : 'absolute', + 'top' : offset + }); + } } - - p.sticky({ - getWidthFrom : document.body - }).delay(5000).fadeOut(); + + $(window).scroll(function () { + checkScroll(); + }); + + checkScroll(); + + p.slideDown(function () { + var t = $(this), color = '#C6D880'; + + if (t.hasClass('error')) { + color = '#FBC2C4'; + } else if (t.hasClass('notice')) { + color = '#FFD324'; + } + + t.effect('highlight', {color : color}) + .delay(5000).slideUp(function () { + $(this).remove(); + }); + }); } })(); diff --git a/admin/css/style.css b/admin/css/style.css index 2f7dc4ac..fe809ccf 100644 --- a/admin/css/style.css +++ b/admin/css/style.css @@ -427,12 +427,16 @@ button.primary:active, button.primary.active { /** 增加顶部消息样式 by 70 */ .popup { border-width: 0 0 1px 0; - position: relative; + position: absolute; + top: 0; + left: 0; + width: 100%; z-index: 10; text-align: center; font-weight: bold; display: none; margin: 0; + padding: 5px 0; -moz-border-radius: 0; -moz-border-radius: 0; @@ -448,6 +452,12 @@ button.primary:active, button.primary.active { list-style: none; margin: 0; padding: 0; + text-align: center; +} + +.popup ul li { + display: inline-block; + margin-right: 10px; } /** diff --git a/admin/file-upload-js.php b/admin/file-upload-js.php index 8eceb6cf..334e8da8 100644 --- a/admin/file-upload-js.php +++ b/admin/file-upload-js.php @@ -41,7 +41,7 @@ $(document).ready(function() { + data.cid + '">' + data.title + ' ' + data.bytes + ' ' + ' ×') - .effect('highlight', '#AACB36', 1000); + .effect('highlight', 1000); attachInsertEvent(li); attachDeleteEvent(li); diff --git a/admin/javascript/jquery-ui.js b/admin/javascript/jquery-ui.js index 9a94562f..5e24f394 100755 --- a/admin/javascript/jquery-ui.js +++ b/admin/javascript/jquery-ui.js @@ -1,6 +1,6 @@ /*! jQuery UI - v1.10.3 - 2013-10-16 * http://jqueryui.com -* Includes: jquery.ui.core.js, jquery.ui.widget.js, jquery.ui.mouse.js, jquery.ui.datepicker.js, jquery.ui.slider.js, jquery.ui.effect.js, jquery.ui.effect-bounce.js, jquery.ui.effect-highlight.js, jquery.ui.effect-shake.js +* Includes: jquery.ui.core.js, jquery.ui.widget.js, jquery.ui.mouse.js, jquery.ui.datepicker.js, jquery.ui.slider.js, jquery.ui.effect.js, jquery.ui.effect-highlight.js * Copyright 2013 jQuery Foundation and other contributors; Licensed MIT */ (function( $, undefined ) { @@ -4943,106 +4943,6 @@ $.each( baseEasings, function( name, easeIn ) { })(jQuery); (function( $, undefined ) { -$.effects.effect.bounce = function( o, done ) { - var el = $( this ), - props = [ "position", "top", "bottom", "left", "right", "height", "width" ], - - // defaults: - mode = $.effects.setMode( el, o.mode || "effect" ), - hide = mode === "hide", - show = mode === "show", - direction = o.direction || "up", - distance = o.distance, - times = o.times || 5, - - // number of internal animations - anims = times * 2 + ( show || hide ? 1 : 0 ), - speed = o.duration / anims, - easing = o.easing, - - // utility: - ref = ( direction === "up" || direction === "down" ) ? "top" : "left", - motion = ( direction === "up" || direction === "left" ), - i, - upAnim, - downAnim, - - // we will need to re-assemble the queue to stack our animations in place - queue = el.queue(), - queuelen = queue.length; - - // Avoid touching opacity to prevent clearType and PNG issues in IE - if ( show || hide ) { - props.push( "opacity" ); - } - - $.effects.save( el, props ); - el.show(); - $.effects.createWrapper( el ); // Create Wrapper - - // default distance for the BIGGEST bounce is the outer Distance / 3 - if ( !distance ) { - distance = el[ ref === "top" ? "outerHeight" : "outerWidth" ]() / 3; - } - - if ( show ) { - downAnim = { opacity: 1 }; - downAnim[ ref ] = 0; - - // if we are showing, force opacity 0 and set the initial position - // then do the "first" animation - el.css( "opacity", 0 ) - .css( ref, motion ? -distance * 2 : distance * 2 ) - .animate( downAnim, speed, easing ); - } - - // start at the smallest distance if we are hiding - if ( hide ) { - distance = distance / Math.pow( 2, times - 1 ); - } - - downAnim = {}; - downAnim[ ref ] = 0; - // Bounces up/down/left/right then back to 0 -- times * 2 animations happen here - for ( i = 0; i < times; i++ ) { - upAnim = {}; - upAnim[ ref ] = ( motion ? "-=" : "+=" ) + distance; - - el.animate( upAnim, speed, easing ) - .animate( downAnim, speed, easing ); - - distance = hide ? distance * 2 : distance / 2; - } - - // Last Bounce when Hiding - if ( hide ) { - upAnim = { opacity: 0 }; - upAnim[ ref ] = ( motion ? "-=" : "+=" ) + distance; - - el.animate( upAnim, speed, easing ); - } - - el.queue(function() { - if ( hide ) { - el.hide(); - } - $.effects.restore( el, props ); - $.effects.removeWrapper( el ); - done(); - }); - - // inject all the animations we just queued to be first in line (after "inprogress") - if ( queuelen > 1) { - queue.splice.apply( queue, - [ 1, 0 ].concat( queue.splice( queuelen, anims + 1 ) ) ); - } - el.dequeue(); - -}; - -})(jQuery); -(function( $, undefined ) { - $.effects.effect.highlight = function( o, done ) { var elem = $( this ), props = [ "backgroundImage", "backgroundColor", "opacity" ], @@ -5078,64 +4978,3 @@ $.effects.effect.highlight = function( o, done ) { }; })(jQuery); -(function( $, undefined ) { - -$.effects.effect.shake = function( o, done ) { - - var el = $( this ), - props = [ "position", "top", "bottom", "left", "right", "height", "width" ], - mode = $.effects.setMode( el, o.mode || "effect" ), - direction = o.direction || "left", - distance = o.distance || 20, - times = o.times || 3, - anims = times * 2 + 1, - speed = Math.round(o.duration/anims), - ref = (direction === "up" || direction === "down") ? "top" : "left", - positiveMotion = (direction === "up" || direction === "left"), - animation = {}, - animation1 = {}, - animation2 = {}, - i, - - // we will need to re-assemble the queue to stack our animations in place - queue = el.queue(), - queuelen = queue.length; - - $.effects.save( el, props ); - el.show(); - $.effects.createWrapper( el ); - - // Animation - animation[ ref ] = ( positiveMotion ? "-=" : "+=" ) + distance; - animation1[ ref ] = ( positiveMotion ? "+=" : "-=" ) + distance * 2; - animation2[ ref ] = ( positiveMotion ? "-=" : "+=" ) + distance * 2; - - // Animate - el.animate( animation, speed, o.easing ); - - // Shakes - for ( i = 1; i < times; i++ ) { - el.animate( animation1, speed, o.easing ).animate( animation2, speed, o.easing ); - } - el - .animate( animation1, speed, o.easing ) - .animate( animation, speed / 2, o.easing ) - .queue(function() { - if ( mode === "hide" ) { - el.hide(); - } - $.effects.restore( el, props ); - $.effects.removeWrapper( el ); - done(); - }); - - // inject all the animations we just queued to be first in line (after "inprogress") - if ( queuelen > 1) { - queue.splice.apply( queue, - [ 1, 0 ].concat( queue.splice( queuelen, anims + 1 ) ) ); - } - el.dequeue(); - -}; - -})(jQuery); diff --git a/admin/javascript/typecho.js b/admin/javascript/typecho.js index 78c0e961..d27dbd4d 100644 --- a/admin/javascript/typecho.js +++ b/admin/javascript/typecho.js @@ -1031,133 +1031,3 @@ jQuery.cookie = function (key, value, options) { return (result = new RegExp('(?:^|; )' + encodeURIComponent(key) + '=([^;]*)').exec(document.cookie)) ? decode(result[1]) : null; }; -// Sticky Plugin v1.0.0 for jQuery -// ============= -// Author: Anthony Garand -// Improvements by German M. Bravo (Kronuz) and Ruud Kamphuis (ruudk) -// Improvements by Leonardo C. Daronco (daronco) -// Created: 2/14/2011 -// Date: 2/12/2012 -// Website: http://labs.anthonygarand.com/sticky -// Description: Makes an element on the page stick on the screen as you scroll -// It will only set the 'top' and 'position' of your element, you -// might need to adjust the width in some cases. - -(function($) { - var defaults = { - topSpacing: 0, - bottomSpacing: 0, - className: 'is-sticky', - wrapperClassName: 'sticky-wrapper', - center: false, - getWidthFrom: '' - }, - $window = $(window), - $document = $(document), - sticked = [], - windowHeight = $window.height(), - scroller = function() { - var scrollTop = $window.scrollTop(), - documentHeight = $document.height(), - dwh = documentHeight - windowHeight, - extra = (scrollTop > dwh) ? dwh - scrollTop : 0; - - for (var i = 0; i < sticked.length; i++) { - var s = sticked[i], - elementTop = s.stickyWrapper.offset().top, - etse = elementTop - s.topSpacing - extra; - - if (scrollTop <= etse) { - if (s.currentTop !== null) { - s.stickyElement - .css('position', '') - .css('top', ''); - s.stickyElement.parent().removeClass(s.className); - s.currentTop = null; - } - } - else { - var newTop = documentHeight - s.stickyElement.outerHeight() - - s.topSpacing - s.bottomSpacing - scrollTop - extra; - if (newTop < 0) { - newTop = newTop + s.topSpacing; - } else { - newTop = s.topSpacing; - } - if (s.currentTop != newTop) { - s.stickyElement - .css('position', 'fixed') - .css('top', newTop); - - if (typeof s.getWidthFrom !== 'undefined') { - s.stickyElement.css('width', $(s.getWidthFrom).width()); - } - - s.stickyElement.parent().addClass(s.className); - s.currentTop = newTop; - } - } - } - }, - resizer = function() { - windowHeight = $window.height(); - }, - methods = { - init: function(options) { - var o = $.extend(defaults, options); - return this.each(function() { - var stickyElement = $(this); - - var stickyId = stickyElement.attr('id'); - var wrapper = $('
') - .attr('id', stickyId + '-sticky-wrapper') - .addClass(o.wrapperClassName); - stickyElement.wrapAll(wrapper); - - if (o.center) { - stickyElement.parent().css({width:stickyElement.outerWidth(),marginLeft:"auto",marginRight:"auto"}); - } - - if (stickyElement.css("float") == "right") { - stickyElement.css({"float":"none"}).parent().css({"float":"right"}); - } - - var stickyWrapper = stickyElement.parent(); - // stickyWrapper.css('height', stickyElement.outerHeight()); - sticked.push({ - topSpacing: o.topSpacing, - bottomSpacing: o.bottomSpacing, - stickyElement: stickyElement, - currentTop: null, - stickyWrapper: stickyWrapper, - className: o.className, - getWidthFrom: o.getWidthFrom - }); - }); - }, - update: scroller - }; - - // should be more efficient than using $window.scroll(scroller) and $window.resize(resizer): - if (window.addEventListener) { - window.addEventListener('scroll', scroller, false); - window.addEventListener('resize', resizer, false); - } else if (window.attachEvent) { - window.attachEvent('onscroll', scroller); - window.attachEvent('onresize', resizer); - } - - $.fn.sticky = function(method) { - if (methods[method]) { - return methods[method].apply(this, Array.prototype.slice.call(arguments, 1)); - } else if (typeof method === 'object' || !method ) { - return methods.init.apply( this, arguments ); - } else { - $.error('Method ' + method + ' does not exist on jQuery.sticky'); - } - }; - $(function() { - setTimeout(scroller, 0); - }); -})(jQuery); - diff --git a/admin/login.php b/admin/login.php index 2f0a44cb..0b4601c3 100644 --- a/admin/login.php +++ b/admin/login.php @@ -25,8 +25,8 @@ Typecho_Cookie::delete('__typecho_remember_name');