mirror of
https://github.com/Piwigo/Piwigo.git
synced 2026-10-30 21:52:00 +01:00
Change growfield directory.
Use of packed file. Add growfield option (animate false) git-svn-id: http://piwigo.org/svn/trunk@2606 68402e56-0260-453c-a942-63ccdbb3a9ee
This commit is contained in:
1 parent
9698c80fcf
commit
4e444f1e89
5 files changed
+6
-3
No files matched your search
@@ -27,7 +27,7 @@
|
||||
jQuery().ready(function(){
|
||||
jQuery(".doubleSelect select.categoryList").resizable({
|
||||
handles: "w,e",
|
||||
animate: true,
|
||||
animate: true,
|
||||
animateDuration: "slow",
|
||||
animateEasing: "swing",
|
||||
preventDefault: true,
|
||||
|
||||
@@ -41,7 +41,9 @@
|
||||
<script type="text/javascript">
|
||||
jQuery().ready(function(){
|
||||
// Auto size for all text area
|
||||
jQuery("TEXTAREA").growfield();
|
||||
jQuery("TEXTAREA").growfield({
|
||||
animate: false
|
||||
});
|
||||
});
|
||||
</script>
|
||||
{/literal}
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
{known_script id="jquery" src=$ROOT_URL|@cat:"template-common/lib/jquery.packed.js" now=1} {*jQuery is always available by default*}
|
||||
{known_script id="jquery.ui" src=$ROOT_URL|@cat:"template-common/lib/ui/ui.core.packed.js"}
|
||||
{known_script id="jquery.ui.resizable" src=$ROOT_URL|@cat:"template-common/lib/ui/ui.resizable.packed.js"}
|
||||
{known_script id="jquery.growfield" src=$ROOT_URL|@cat:"template-common/lib/growfield/jquery.growfield.js"}
|
||||
{known_script id="jquery.growfield" src=$ROOT_URL|@cat:"template-common/lib/plugins/jquery.growfield.packed.js"}
|
||||
{$themeconf.local_head}
|
||||
<script type="text/javascript" src="{$ROOT_URL}template-common/scripts.js"></script>
|
||||
<!--[if lt IE 7]>
|
||||
|
||||
File renamed without changes.
@@ -0,0 +1 @@
|
||||
(function($){$.fn.growfield=function(options){this.each(function(){this._growField=true;var txt=$(this);if(this.tagName.toLowerCase()!='textarea')return false;if(!options)options={};var th=this;this.gf={auto:(typeof(options.auto)!='undefined'?options.auto:true),animate:(typeof(options.animate)!='undefined'?options.animate:true),hOffset:(typeof(options.offset)!='undefined'?options.offset:0),before:(options.before||null),after:(options.after||null),min:(options.min||false),max:(options.max||false),restore:(options.restore||false),initialH:0,busy:false,keysEnabled:false,dummy:null,queue:0,speed:300,ms:15,timeout:false,opera9:false,impossible:false};this._growInit=function(){if(this.gf.before)this._growCallbackBefore=this.gf.before;if(this.gf.after)this._growCallbackAfter=this.gf.after;this.gf.initialH=txt.get(0).offsetHeight;if(typeof(txt.attr('autogrow'))!='undefined')this.gf.auto=parseInt(txt.attr('autogrow'));if(typeof(txt.attr('animate'))!='undefined')this.gf.animate=parseInt(txt.attr('animate'));if(typeof(txt.attr('min'))!='undefined')this.gf.min=parseInt(txt.attr('min'));if(typeof(txt.attr('max'))!='undefined')this.gf.max=parseInt(txt.attr('max'));if(typeof(txt.attr('restore'))!='undefined')this.gf.restore=parseInt(txt.attr('restore'));if(typeof(txt.attr('speed'))!='undefined')this.gf.speed=parseInt(txt.attr('speed'));if(!this.gf.min)this.gf.min=parseInt(txt.css('min-height'));if(!this.gf.min)this.gf.min=this.gf.initialH;if(!this.gf.max)this.gf.max=parseInt(txt.css('max-height'));this.gf.opera9=($.browser.opera&&$.browser.version<9.5);if(this.gf.restore){this.gf.restore=false;this._toggleRestore(true)}if(this.gf.auto){if(this.gf.initialH==0){txt.bind('keyup.growinit',this._afterShowInit)}else{this.gf.auto=false;this._toggleAuto(true)}}else this._toggleKeys(true);return true};this._afterShowInit=function(){this.gf.initialH=txt.get(0).offsetHeight;if(!this.gf.initialH)return true;if(!this.gf.min)this.gf.min=this.gf.initialH;txt.unbind('.growinit');this.gf.auto=false;this._toggleAuto(true);txt.focus();return true};this._toggleKeys=function(on){if(on){if(this.gf.keysEnabled)return false;txt.bind(($.browser.msie?'keyup':'keydown')+'.autogrow',function(event){if(!event.ctrlKey||$.inArray(event.keyCode,[38,40])==-1)return true;txt[event.keyCode==38?'decrease':'increase'](false,event);if($.browser.opera)txt.focus();if($.browser.msie||$.browser.opera)return false;return true});this.gf.keysEnabled=true}else{if(!this.gf.keysEnabled)return false;txt.unbind(($.browser.msie?'keyup':'keydown')+'.autogrow');this.gf.keysEnabled=false}};this._toggleAuto=function(on){if($.browser.opera||on){txt.css('overflow','hidden');if($.browser.opera&&txt.attr('style')&&txt.attr('style').indexOf('border')==-1)txt.css('border','1px solid #ccc')}if(on){if(this.gf.auto)return false;this._toggleKeys(false);this._createDummy();if(this.gf.impossible){this._growField=false;return false}txt.css('overflow','hidden');txt.bind('keyup.autogrow',function(event){if(!txt.val())this._changeSize(this.gf.min,event);else return this._changeSize(this._textHeight(),event)});if(txt.val())txt.keyup();$(window).bind('resize.autogrow',function(event){th.gf.dummy.width(txt.width())});this.gf.auto=true}else{if(!this.gf.auto)return false;this.gf.dummy.remove();this.gf.dummy=null;txt.unbind('keyup.autogrow');$(window).unbind('resize.autogrow');txt.css('overflow','auto');this.gf.auto=false;this._toggleKeys(true)}return true};this._toggleRestore=function(on){if(on){if(this.gf.restore)return false;this.gf.restore=true;txt.bind('focus.autogrow',function(event,noChange){if(!this.gf.auto||noChange||!txt.val())return true;else return this._changeSize(this._textHeight(),event)});txt.bind('blur.autogrow',function(event){return this.gf.auto?this._changeSize(this.gf.min,event):true})}else{if(!this.gf.restore)return false;this.gf.restore=false;txt.unbind('focus.autogrow').unbind('blur.autogrow');txt.keyup()}};this._changeSize=function(to,event){if(this.gf.busy)return true;if(!event)event={};this._growBefore(event);var ovr=txt.css('overflow');if(this.gf.max>0&&to>=this.gf.max){to=this.gf.max;if(ovr=='hidden'){txt.css('overflow','auto');if(event.type=='keyup')txt.focus();if(event.type=='focus'&&this.gf.animate&&this.gf.auto)txt.trigger('focus',true)}}else if(ovr=='auto'&&this.gf.auto){txt.css('overflow','hidden');if(event.type=='keyup')txt.focus()}if(this.gf.min>0&&to<=this.gf.min)to=this.gf.min;if(to==txt.get(0).offsetHeight){this.gf.busy=false;return true}return this._animate(txt.get(0).offsetHeight,to,event,ovr)};this._animate=function(from,to,event,ovr){if(!this.gf.animate||(ovr=='auto'&&this.gf.auto)||event.type=='init'){txt.height(to);return this._growAfter(event)}this.gf.queue=Math.floor((this.gf.speed/this.gf.ms)*(to<from?-1:1));this._timeout(from,to);return true};this._timeout=function(from,to){if(th.gf.queue==0)return th._growAfter();th.gf.queue+=(th.gf.queue>0?-1:1);if(Math.abs(to-from)<3){txt.height(to);return th._growAfter()}from=th.gf.queue==0?to:from+Math.ceil((Line truncated
|
||||
Reference in new issue
Block a user