diff --git a/.build_number b/.build_number index 7a220ac6ad..37dc1950bf 100644 --- a/.build_number +++ b/.build_number @@ -3,4 +3,4 @@ ; process. You don't need to edit it. In fact.. ; ; DO NOT EDIT THIS FILE BY HAND! -build_number=92 +build_number=129 diff --git a/installer/install.sql b/installer/install.sql index 5dc09ccac4..2b8ec11eb2 100644 --- a/installer/install.sql +++ b/installer/install.sql @@ -244,15 +244,15 @@ CREATE TABLE {modules} ( KEY `weight` (`weight`) ) AUTO_INCREMENT=10 DEFAULT CHARSET=utf8; /*!40101 SET character_set_client = @saved_cs_client */; -INSERT INTO {modules} VALUES (1,1,'gallery',47,1); -INSERT INTO {modules} VALUES (2,1,'user',3,2); +INSERT INTO {modules} VALUES (1,1,'gallery',49,1); +INSERT INTO {modules} VALUES (2,1,'user',4,2); INSERT INTO {modules} VALUES (3,1,'comment',4,3); INSERT INTO {modules} VALUES (4,1,'organize',4,4); INSERT INTO {modules} VALUES (5,1,'info',2,5); INSERT INTO {modules} VALUES (6,1,'rss',1,6); INSERT INTO {modules} VALUES (7,1,'search',1,7); INSERT INTO {modules} VALUES (8,1,'slideshow',2,8); -INSERT INTO {modules} VALUES (9,1,'tag',2,9); +INSERT INTO {modules} VALUES (9,1,'tag',3,9); DROP TABLE IF EXISTS {outgoing_translations}; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; @@ -382,7 +382,7 @@ CREATE TABLE {vars} ( `value` text, PRIMARY KEY (`id`), UNIQUE KEY `module_name` (`module_name`,`name`) -) AUTO_INCREMENT=41 DEFAULT CHARSET=utf8; +) AUTO_INCREMENT=43 DEFAULT CHARSET=utf8; /*!40101 SET character_set_client = @saved_cs_client */; INSERT INTO {vars} VALUES (NULL,'gallery','active_site_theme','wind'); INSERT INTO {vars} VALUES (NULL,'gallery','active_admin_theme','admin_wind'); @@ -413,9 +413,10 @@ INSERT INTO {vars} VALUES (NULL,'gallery','email_line_length','70'); INSERT INTO {vars} VALUES (NULL,'gallery','email_header_separator','s:1:\"\n\";'); INSERT INTO {vars} VALUES (NULL,'gallery','show_user_profiles_to','registered_users'); INSERT INTO {vars} VALUES (NULL,'gallery','extra_binary_paths','/usr/local/bin:/opt/local/bin:/opt/bin'); +INSERT INTO {vars} VALUES (NULL,'gallery','timezone',NULL); INSERT INTO {vars} VALUES (NULL,'gallery','blocks_site_sidebar','a:4:{i:10;a:2:{i:0;s:7:\"gallery\";i:1;s:8:\"language\";}i:11;a:2:{i:0;s:4:\"info\";i:1;s:8:\"metadata\";}i:12;a:2:{i:0;s:3:\"rss\";i:1;s:9:\"rss_feeds\";}i:13;a:2:{i:0;s:3:\"tag\";i:1;s:3:\"tag\";}}'); INSERT INTO {vars} VALUES (NULL,'gallery','identity_provider','user'); -INSERT INTO {vars} VALUES (NULL,'user','mininum_password_length','5'); +INSERT INTO {vars} VALUES (NULL,'user','minimum_password_length','5'); INSERT INTO {vars} VALUES (NULL,'comment','spam_caught','0'); INSERT INTO {vars} VALUES (NULL,'comment','access_permissions','everybody'); INSERT INTO {vars} VALUES (NULL,'info','show_title','1'); @@ -424,3 +425,4 @@ INSERT INTO {vars} VALUES (NULL,'info','show_owner','1'); INSERT INTO {vars} VALUES (NULL,'info','show_name','1'); INSERT INTO {vars} VALUES (NULL,'info','show_captured','1'); INSERT INTO {vars} VALUES (NULL,'slideshow','max_scale','0'); +INSERT INTO {vars} VALUES (NULL,'tag','tag_cloud_size','30'); diff --git a/lib/flowplayer.controls.swf b/lib/flowplayer.controls.swf index aacdcd309c..5507a531dd 100644 Binary files a/lib/flowplayer.controls.swf and b/lib/flowplayer.controls.swf differ diff --git a/lib/flowplayer.js b/lib/flowplayer.js index 57f00e6572..3bbdc1d3db 100644 --- a/lib/flowplayer.js +++ b/lib/flowplayer.js @@ -10,13 +10,13 @@ function el(id){return document.getElementById(id);} function extend(to,from,skipFuncs){if(typeof from!='object'){return to;} if(to&&from){each(from,function(name,value){if(!skipFuncs||typeof value!='function'){to[name]=value;}});} return to;} -function select(query){var index=query.indexOf(".");if(index!=-1){var tag=query.substring(0,index)||"*";var klass=query.substring(index+1,query.length);var els=[];each(document.getElementsByTagName(tag),function(){if(this.className&&this.className.indexOf(klass)!=-1){els.push(this);}});return els;}} +function select(query){var index=query.indexOf(".");if(index!=-1){var tag=query.slice(0,index)||"*";var klass=query.slice(index+1,query.length);var els=[];each(document.getElementsByTagName(tag),function(){if(this.className&&this.className.indexOf(klass)!=-1){els.push(this);}});return els;}} function stopEvent(e){e=e||window.event;if(e.preventDefault){e.stopPropagation();e.preventDefault();}else{e.returnValue=false;e.cancelBubble=true;} return false;} function bind(to,evt,fn){to[evt]=to[evt]||[];to[evt].push(fn);} -function makeId(){return"_"+(""+Math.random()).substring(2,10);} -var Clip=function(json,index,player){var self=this;var cuepoints={};var listeners={};self.index=index;if(typeof json=='string'){json={url:json};} -extend(this,json,true);each(("Begin*,Start,Pause*,Resume*,Seek*,Stop*,Finish*,LastSecond,Update,BufferFull,BufferEmpty,BufferStop").split(","),function(){var evt="on"+this;if(evt.indexOf("*")!=-1){evt=evt.substring(0,evt.length-1);var before="onBefore"+evt.substring(2);self[before]=function(fn){bind(listeners,before,fn);return self;};} +function makeId(){return"_"+(""+Math.random()).slice(2,10);} +var Clip=function(json,index,player){var self=this,cuepoints={},listeners={};self.index=index;if(typeof json=='string'){json={url:json};} +extend(this,json,true);each(("Begin*,Start,Pause*,Resume*,Seek*,Stop*,Finish*,LastSecond,Update,BufferFull,BufferEmpty,BufferStop").split(","),function(){var evt="on"+this;if(evt.indexOf("*")!=-1){evt=evt.slice(0,evt.length-1);var before="onBefore"+evt.slice(2);self[before]=function(fn){bind(listeners,before,fn);return self;};} self[evt]=function(fn){bind(listeners,evt,fn);return self;};if(index==-1){if(self[before]){player[before]=self[before];} if(self[evt]){player[evt]=self[evt];}}});extend(this,{onCuepoint:function(points,fn){if(arguments.length==1){cuepoints.embedded=[null,points];return self;} if(typeof points=='number'){points=[points];} @@ -26,7 +26,7 @@ var conf=player.getConfig();var clip=(index==-1)?conf.clip:conf.playlist[index]; target=target||self;if(evt=='onCuepoint'){var fn=cuepoints[arg1];if(fn){return fn[1].call(player,target,arg2);}} if(arg1&&"onBeforeBegin,onMetaData,onStart,onUpdate,onResume".indexOf(evt)!=-1){extend(target,arg1);if(arg1.metaData){if(!target.duration){target.duration=arg1.metaData.duration;}else{target.fullDuration=arg1.metaData.duration;}}} var ret=true;each(listeners[evt],function(){ret=this.call(player,target,arg1,arg2);});return ret;}});if(json.onCuepoint){var arg=json.onCuepoint;self.onCuepoint.apply(self,typeof arg=='function'?[arg]:arg);delete json.onCuepoint;} -each(json,function(key,val){if(typeof val=='function'){bind(listeners,key,val);delete json[key];}});if(index==-1){player.onCuepoint=this.onCuepoint;}};var Plugin=function(name,json,player,fn){var listeners={};var self=this;var hasMethods=false;if(fn){extend(listeners,fn);} +each(json,function(key,val){if(typeof val=='function'){bind(listeners,key,val);delete json[key];}});if(index==-1){player.onCuepoint=this.onCuepoint;}};var Plugin=function(name,json,player,fn){var self=this,listeners={},hasMethods=false;if(fn){extend(listeners,fn);} each(json,function(key,val){if(typeof val=='function'){listeners[key]=val;delete json[key];}});extend(this,{animate:function(props,speed,fn){if(!props){return self;} if(typeof speed=='function'){fn=speed;speed=500;} if(typeof props=='string'){var key=props;props={};props[key]=speed;speed=500;} @@ -37,32 +37,37 @@ json=player._api().fp_css(name,props);extend(self,json);return self;},show:funct if(fn){var fnId=makeId();listeners[fnId]=fn;} this.display=player._api().fp_fadeTo(name,o,speed,fnId);this.opacity=o;return self;},fadeIn:function(speed,fn){return self.fadeTo(1,speed,fn);},fadeOut:function(speed,fn){return self.fadeTo(0,speed,fn);},getName:function(){return name;},getPlayer:function(){return player;},_fireEvent:function(evt,arg,arg2){if(evt=='onUpdate'){var json=player._api().fp_getPlugin(name);if(!json){return;} extend(self,json);delete self.methods;if(!hasMethods){each(json.methods,function(){var method=""+this;self[method]=function(){var a=[].slice.call(arguments);var ret=player._api().fp_invoke(name,method,a);return ret==='undefined'||ret===undefined?self:ret;};});hasMethods=true;}} -var fn=listeners[evt];if(fn){fn.apply(self,arg);if(evt.substring(0,1)=="_"){delete listeners[evt];}}}});};function Player(wrapper,params,conf){var -self=this,api=null,html,commonClip,playlist=[],plugins={},listeners={},playerId,apiId,playerIndex,activeIndex,swfHeight,wrapperHeight;extend(self,{id:function(){return playerId;},isLoaded:function(){return(api!==null);},getParent:function(){return wrapper;},hide:function(all){if(all){wrapper.style.height="0px";} -if(api){api.style.height="0px";} -return self;},show:function(){wrapper.style.height=wrapperHeight+"px";if(api){api.style.height=swfHeight+"px";} -return self;},isHidden:function(){return api&&parseInt(api.style.height,10)===0;},load:function(fn){if(!api&&self._fireEvent("onBeforeLoad")!==false){each(players,function(){this.unload();});html=wrapper.innerHTML;if(html&&!flashembed.isSupported(params.version)){wrapper.innerHTML="";} -flashembed(wrapper,params,{config:conf});if(fn){fn.cached=true;bind(listeners,"onLoad",fn);}} -return self;},unload:function(){if(html.replace(/\s/g,'')!==''){if(self._fireEvent("onBeforeUnload")===false){return self;} -try{if(api){api.fp_close();self._fireEvent("onUnload");}}catch(error){} -api=null;wrapper.innerHTML=html;} +var fn=listeners[evt];if(fn){var ret=fn.apply(self,arg);if(evt.slice(0,1)=="_"){delete listeners[evt];} +return ret;} +return self;}});};function Player(wrapper,params,conf){var self=this,api=null,isUnloading=false,html,commonClip,playlist=[],plugins={},listeners={},playerId,apiId,playerIndex,activeIndex,swfHeight,wrapperHeight;extend(self,{id:function(){return playerId;},isLoaded:function(){return(api!==null&&api.fp_play!==undefined&&!isUnloading);},getParent:function(){return wrapper;},hide:function(all){if(all){wrapper.style.height="0px";} +if(self.isLoaded()){api.style.height="0px";} +return self;},show:function(){wrapper.style.height=wrapperHeight+"px";if(self.isLoaded()){api.style.height=swfHeight+"px";} +return self;},isHidden:function(){return self.isLoaded()&&parseInt(api.style.height,10)===0;},load:function(fn){if(!self.isLoaded()&&self._fireEvent("onBeforeLoad")!==false){var onPlayersUnloaded=function(){html=wrapper.innerHTML;if(html&&!flashembed.isSupported(params.version)){wrapper.innerHTML="";} +if(fn){fn.cached=true;bind(listeners,"onLoad",fn);} +flashembed(wrapper,params,{config:conf});};var unloadedPlayersNb=0;each(players,function(){this.unload(function(wasUnloaded){if(++unloadedPlayersNb==players.length){onPlayersUnloaded();}});});} +return self;},unload:function(fn){if(this.isFullscreen()&&/WebKit/i.test(navigator.userAgent)){if(fn){fn(false);} +return self;} +if(html.replace(/\s/g,'')!==''){if(self._fireEvent("onBeforeUnload")===false){if(fn){fn(false);} +return self;} +isUnloading=true;try{if(api){api.fp_close();self._fireEvent("onUnload");}}catch(error){} +var clean=function(){api=null;wrapper.innerHTML=html;isUnloading=false;if(fn){fn(true);}};setTimeout(clean,50);} +else if(fn){fn(false);} return self;},getClip:function(index){if(index===undefined){index=activeIndex;} return playlist[index];},getCommonClip:function(){return commonClip;},getPlaylist:function(){return playlist;},getPlugin:function(name){var plugin=plugins[name];if(!plugin&&self.isLoaded()){var json=self._api().fp_getPlugin(name);if(json){plugin=new Plugin(name,json,self);plugins[name]=plugin;}} -return plugin;},getScreen:function(){return self.getPlugin("screen");},getControls:function(){return self.getPlugin("controls");},getConfig:function(copy){return copy?clone(conf):conf;},getFlashParams:function(){return params;},loadPlugin:function(name,url,props,fn){if(typeof props=='function'){fn=props;props={};} -var fnId=fn?makeId():"_";self._api().fp_loadPlugin(name,url,props,fnId);var arg={};arg[fnId]=fn;var p=new Plugin(name,null,self,arg);plugins[name]=p;return p;},getState:function(){return api?api.fp_getState():-1;},play:function(clip,instream){function play(){if(clip!==undefined){self._api().fp_play(clip,instream);}else{self._api().fp_play();}} -if(api){play();}else{self.load(function(){play();});} -return self;},getVersion:function(){var js="flowplayer.js 3.1.4";if(api){var ver=api.fp_getVersion();ver.push(js);return ver;} -return js;},_api:function(){if(!api){throw"Flowplayer "+self.id()+" not loaded when calling an API method";} -return api;},setClip:function(clip){self.setPlaylist([clip]);return self;},getIndex:function(){return playerIndex;}});each(("Click*,Load*,Unload*,Keypress*,Volume*,Mute*,Unmute*,PlaylistReplace,ClipAdd,Fullscreen*,FullscreenExit,Error,MouseOver,MouseOut").split(","),function(){var name="on"+this;if(name.indexOf("*")!=-1){name=name.substring(0,name.length-1);var name2="onBefore"+name.substring(2);self[name2]=function(fn){bind(listeners,name2,fn);return self;};} -self[name]=function(fn){bind(listeners,name,fn);return self;};});each(("pause,resume,mute,unmute,stop,toggle,seek,getStatus,getVolume,setVolume,getTime,isPaused,isPlaying,startBuffering,stopBuffering,isFullscreen,toggleFullscreen,reset,close,setPlaylist,addClip,playFeed").split(","),function(){var name=this;self[name]=function(a1,a2){if(!api){return self;} +return plugin;},getScreen:function(){return self.getPlugin("screen");},getControls:function(){return self.getPlugin("controls")._fireEvent("onUpdate");},getLogo:function(){try{return self.getPlugin("logo")._fireEvent("onUpdate");}catch(ignored){}},getPlay:function(){return self.getPlugin("play")._fireEvent("onUpdate");},getConfig:function(copy){return copy?clone(conf):conf;},getFlashParams:function(){return params;},loadPlugin:function(name,url,props,fn){if(typeof props=='function'){fn=props;props={};} +var fnId=fn?makeId():"_";self._api().fp_loadPlugin(name,url,props,fnId);var arg={};arg[fnId]=fn;var p=new Plugin(name,null,self,arg);plugins[name]=p;return p;},getState:function(){return self.isLoaded()?api.fp_getState():-1;},play:function(clip,instream){var p=function(){if(clip!==undefined){self._api().fp_play(clip,instream);}else{self._api().fp_play();}};if(self.isLoaded()){p();}else if(isUnloading){setTimeout(function(){self.play(clip,instream);},50);}else{self.load(function(){p();});} +return self;},getVersion:function(){var js="flowplayer.js 3.2.6";if(self.isLoaded()){var ver=api.fp_getVersion();ver.push(js);return ver;} +return js;},_api:function(){if(!self.isLoaded()){throw"Flowplayer "+self.id()+" not loaded when calling an API method";} +return api;},setClip:function(clip){self.setPlaylist([clip]);return self;},getIndex:function(){return playerIndex;},_swfHeight:function(){return api.clientHeight;}});each(("Click*,Load*,Unload*,Keypress*,Volume*,Mute*,Unmute*,PlaylistReplace,ClipAdd,Fullscreen*,FullscreenExit,Error,MouseOver,MouseOut").split(","),function(){var name="on"+this;if(name.indexOf("*")!=-1){name=name.slice(0,name.length-1);var name2="onBefore"+name.slice(2);self[name2]=function(fn){bind(listeners,name2,fn);return self;};} +self[name]=function(fn){bind(listeners,name,fn);return self;};});each(("pause,resume,mute,unmute,stop,toggle,seek,getStatus,getVolume,setVolume,getTime,isPaused,isPlaying,startBuffering,stopBuffering,isFullscreen,toggleFullscreen,reset,close,setPlaylist,addClip,playFeed,setKeyboardShortcutsEnabled,isKeyboardShortcutsEnabled").split(","),function(){var name=this;self[name]=function(a1,a2){if(!self.isLoaded()){return self;} var ret=null;if(a1!==undefined&&a2!==undefined){ret=api["fp_"+name](a1,a2);}else{ret=(a1===undefined)?api["fp_"+name]():api["fp_"+name](a1);} return ret==='undefined'||ret===undefined?self:ret;};});self._fireEvent=function(a){if(typeof a=='string'){a=[a];} var evt=a[0],arg0=a[1],arg1=a[2],arg2=a[3],i=0;if(conf.debug){log(a);} -if(!api&&evt=='onLoad'&&arg0=='player'){api=api||el(apiId);swfHeight=api.clientHeight;each(playlist,function(){this._fireEvent("onLoad");});each(plugins,function(name,p){p._fireEvent("onUpdate");});commonClip._fireEvent("onLoad");} +if(!self.isLoaded()&&evt=='onLoad'&&arg0=='player'){api=api||el(apiId);swfHeight=self._swfHeight();each(playlist,function(){this._fireEvent("onLoad");});each(plugins,function(name,p){p._fireEvent("onUpdate");});commonClip._fireEvent("onLoad");} if(evt=='onLoad'&&arg0!='player'){return;} if(evt=='onError'){if(typeof arg0=='string'||(typeof arg0=='number'&&typeof arg1=='number')){arg0=arg1;arg1=arg2;}} if(evt=='onContextMenu'){each(conf.contextMenu[arg0],function(key,fn){fn.call(self);});return;} -if(evt=='onPluginEvent'){var name=arg0.name||arg0;var p=plugins[name];if(p){p._fireEvent("onUpdate",arg0);p._fireEvent(arg1,a.slice(3));} +if(evt=='onPluginEvent'||evt=='onBeforePluginEvent'){var name=arg0.name||arg0;var p=plugins[name];if(p){p._fireEvent("onUpdate",arg0);return p._fireEvent(arg1,a.slice(3));} return;} if(evt=='onPlaylistReplace'){playlist=[];var index=0;each(arg0,function(){playlist.push(new Clip(this,index++,self));});} if(evt=='onClipAdd'){if(arg0.isInStream){return;} @@ -72,60 +77,143 @@ if(!clip||ret!==false){ret=commonClip._fireEvent(evt,arg1,arg2,clip);}} each(listeners[evt],function(){ret=this.call(self,arg0,arg1);if(this.cached){listeners[evt].splice(i,1);} if(ret===false){return false;} i++;});return ret;};function init(){if($f(wrapper)){$f(wrapper).getParent().innerHTML="";playerIndex=$f(wrapper).getIndex();players[playerIndex]=self;}else{players.push(self);playerIndex=players.length-1;} -wrapperHeight=parseInt(wrapper.style.height,10)||wrapper.clientHeight;if(typeof params=='string'){params={src:params};} -playerId=wrapper.id||"fp"+makeId();apiId=params.id||playerId+"_api";params.id=apiId;conf.playerId=playerId;if(typeof conf=='string'){conf={clip:{url:conf}};} +wrapperHeight=parseInt(wrapper.style.height,10)||wrapper.clientHeight;playerId=wrapper.id||"fp"+makeId();apiId=params.id||playerId+"_api";params.id=apiId;conf.playerId=playerId;if(typeof conf=='string'){conf={clip:{url:conf}};} if(typeof conf.clip=='string'){conf.clip={url:conf.clip};} conf.clip=conf.clip||{};if(wrapper.getAttribute("href",2)&&!conf.clip.url){conf.clip.url=wrapper.getAttribute("href",2);} commonClip=new Clip(conf.clip,-1,self);conf.playlist=conf.playlist||[conf.clip];var index=0;each(conf.playlist,function(){var clip=this;if(typeof clip=='object'&&clip.length){clip={url:""+clip};} each(conf.clip,function(key,val){if(val!==undefined&&clip[key]===undefined&&typeof val!='function'){clip[key]=val;}});conf.playlist[index]=clip;clip=new Clip(clip,index,self);playlist.push(clip);index++;});each(conf,function(key,val){if(typeof val=='function'){if(commonClip[key]){commonClip[key](val);}else{bind(listeners,key,val);} delete conf[key];}});each(conf.plugins,function(name,val){if(val){plugins[name]=new Plugin(name,val,self);}});if(!conf.plugins||conf.plugins.controls===undefined){plugins.controls=new Plugin("controls",null,self);} -plugins.canvas=new Plugin("canvas",null,self);params.bgcolor=params.bgcolor||"#000000";params.version=params.version||[9,0];params.expressInstall='http://www.flowplayer.org/swf/expressinstall.swf';function doClick(e){if(!self.isLoaded()&&self._fireEvent("onBeforeClick")!==false){self.load();} +plugins.canvas=new Plugin("canvas",null,self);html=wrapper.innerHTML;function doClick(e){var hasiPadSupport=self.hasiPadSupport&&self.hasiPadSupport();if(/iPad|iPhone|iPod/i.test(navigator.userAgent)&&!/.flv$/i.test(playlist[0].url)&&!hasiPadSupport){return true;} +if(!self.isLoaded()&&self._fireEvent("onBeforeClick")!==false){self.load();} return stopEvent(e);} -html=wrapper.innerHTML;if(html.replace(/\s/g,'')!==''){if(wrapper.addEventListener){wrapper.addEventListener("click",doClick,false);}else if(wrapper.attachEvent){wrapper.attachEvent("onclick",doClick);}}else{if(wrapper.addEventListener){wrapper.addEventListener("click",stopEvent,false);} +function installPlayer(){if(html.replace(/\s/g,'')!==''){if(wrapper.addEventListener){wrapper.addEventListener("click",doClick,false);}else if(wrapper.attachEvent){wrapper.attachEvent("onclick",doClick);}}else{if(wrapper.addEventListener){wrapper.addEventListener("click",stopEvent,false);} self.load();}} -if(typeof wrapper=='string'){flashembed.domReady(function(){var node=el(wrapper);if(!node){throw"Flowplayer cannot access element: "+wrapper;}else{wrapper=node;init();}});}else{init();}} +setTimeout(installPlayer,0);} +if(typeof wrapper=='string'){var node=el(wrapper);if(!node){throw"Flowplayer cannot access element: "+wrapper;} +wrapper=node;init();}else{init();}} var players=[];function Iterator(arr){this.length=arr.length;this.each=function(fn){each(arr,fn);};this.size=function(){return arr.length;};} window.flowplayer=window.$f=function(){var instance=null;var arg=arguments[0];if(!arguments.length){each(players,function(){if(this.isLoaded()){instance=this;return false;}});return instance||players[0];} if(arguments.length==1){if(typeof arg=='number'){return players[arg];}else{if(arg=='*'){return new Iterator(players);} each(players,function(){if(this.id()==arg.id||this.id()==arg||this.getParent()==arg){instance=this;return false;}});return instance;}} -if(arguments.length>1){var swf=arguments[1];var conf=(arguments.length==3)?arguments[2]:{};if(typeof arg=='string'){if(arg.indexOf(".")!=-1){var instances=[];each(select(arg),function(){instances.push(new Player(this,clone(swf),clone(conf)));});return new Iterator(instances);}else{var node=el(arg);return new Player(node!==null?node:arg,swf,conf);}}else if(arg){return new Player(arg,swf,conf);}} -return null;};extend(window.$f,{fireEvent:function(){var a=[].slice.call(arguments);var p=$f(a[0]);return p?p._fireEvent(a.slice(1)):null;},addPlugin:function(name,fn){Player.prototype[name]=fn;return $f;},each:each,extend:extend});if(typeof jQuery=='function'){jQuery.prototype.flowplayer=function(params,conf){if(!arguments.length||typeof arguments[0]=='number'){var arr=[];this.each(function(){var p=$f(this);if(p){arr.push(p);}});return arguments.length?arr[arguments[0]]:new Iterator(arr);} -return this.each(function(){$f(this,clone(params),conf?clone(conf):{});});};}})();(function(){var jQ=typeof jQuery=='function';var options={width:'100%',height:'100%',allowfullscreen:true,allowscriptaccess:'always',quality:'high',version:null,onFail:null,expressInstall:null,w3c:false,cachebusting:false};if(jQ){jQuery.tools=jQuery.tools||{};jQuery.tools.flashembed={version:'1.0.4',conf:options};} -function isDomReady(){if(domReady.done){return false;} -var d=document;if(d&&d.getElementsByTagName&&d.getElementById&&d.body){clearInterval(domReady.timer);domReady.timer=null;for(var i=0;i1){var params=arguments[1],conf=(arguments.length==3)?arguments[2]:{};if(typeof params=='string'){params={src:params};} +params=extend({bgcolor:"#000000",version:[9,0],expressInstall:"http://static.flowplayer.org/swf/expressinstall.swf",cachebusting:false},params);if(typeof arg=='string'){if(arg.indexOf(".")!=-1){var instances=[];each(select(arg),function(){instances.push(new Player(this,clone(params),clone(conf)));});return new Iterator(instances);}else{var node=el(arg);return new Player(node!==null?node:arg,params,conf);}}else if(arg){return new Player(arg,params,conf);}} +return null;};extend(window.$f,{fireEvent:function(){var a=[].slice.call(arguments);var p=$f(a[0]);return p?p._fireEvent(a.slice(1)):null;},addPlugin:function(name,fn){Player.prototype[name]=fn;return $f;},each:each,extend:extend});if(typeof jQuery=='function'){jQuery.fn.flowplayer=function(params,conf){if(!arguments.length||typeof arguments[0]=='number'){var arr=[];this.each(function(){var p=$f(this);if(p){arr.push(p);}});return arguments.length?arr[arguments[0]]:new Iterator(arr);} +return this.each(function(){$f(this,clone(params),conf?clone(conf):{});});};}})();(function(){var IE=document.all,URL='http://www.adobe.com/go/getflashplayer',JQUERY=typeof jQuery=='function',RE=/(\d+)[^\d]+(\d+)[^\d]*(\d*)/,GLOBAL_OPTS={width:'100%',height:'100%',id:"_"+(""+Math.random()).slice(9),allowfullscreen:true,allowscriptaccess:'always',quality:'high',version:[3,0],onFail:null,expressInstall:null,w3c:false,cachebusting:false};if(window.attachEvent){window.attachEvent("onbeforeunload",function(){__flash_unloadHandler=function(){};__flash_savedUnloadHandler=function(){};});} +function extend(to,from){if(from){for(var key in from){if(from.hasOwnProperty(key)){to[key]=from[key];}}} return to;} -var cx=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,escapable=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,gap,indent,meta={'\b':'\\b','\t':'\\t','\n':'\\n','\f':'\\f','\r':'\\r','"':'\\"','\\':'\\\\'},rep;function string2JsonString(string){escapable.lastIndex=0;return escapable.test(string)?'"'+string.replace(escapable,function(a){var c=meta[a];return typeof c==='string'?c:'\\u'+('0000'+a.charCodeAt(0).toString(16)).slice(-4);})+'"':'"'+string+'"';} -function asString(obj){switch(typeOf(obj)){case'string':return string2JsonString(obj);case'array':return'['+map(obj,function(el){return asString(el);}).join(',')+']';case'function':return'"function()"';case'object':var str=[];for(var prop in obj){if(obj.hasOwnProperty(prop)){str.push('"'+prop+'":'+asString(obj[prop]));}} -return'{'+str.join(',')+'}';} -return String(obj).replace(/\s/g," ").replace(/\'/g,"\"");} -function typeOf(obj){if(obj===null||obj===undefined){return false;} -var type=typeof obj;return(type=='object'&&obj.push)?'array':type;} -if(window.attachEvent){window.attachEvent("onbeforeunload",function(){__flash_unloadHandler=function(){};__flash_savedUnloadHandler=function(){};});} function map(arr,func){var newArr=[];for(var i in arr){if(arr.hasOwnProperty(i)){newArr[i]=func(arr[i]);}} return newArr;} -function getHTML(p,c){var e=extend({},p);var ie=document.all;var html='';} -e.width=e.height=e.id=e.w3c=e.src=null;for(var k in e){if(e[k]!==null){html+='';}} -var vars="";if(c){for(var key in c){if(c[key]!==null){vars+=encodeURIComponent(key)+'=' -+encodeURIComponent(typeof c[key]=='object'?asString(c[key]):c[key]) +window.flashembed=function(root,opts,conf){if(typeof root=='string'){root=document.getElementById(root.replace("#",""));} +if(!root){return;} +if(typeof opts=='string'){opts={src:opts};} +return new Flash(root,extend(extend({},GLOBAL_OPTS),opts),conf);};var f=extend(window.flashembed,{conf:GLOBAL_OPTS,getVersion:function(){var fo,ver;try{ver=navigator.plugins["Shockwave Flash"].description.slice(16);}catch(e){try{fo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");ver=fo&&fo.GetVariable("$version");}catch(err){try{fo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");ver=fo&&fo.GetVariable("$version");}catch(err2){}}} +ver=RE.exec(ver);return ver?[ver[1],ver[3]]:[0,0];},asString:function(obj){if(obj===null||obj===undefined){return null;} +var type=typeof obj;if(type=='object'&&obj.push){type='array';} +switch(type){case'string':return string2JsonString(obj);case'array':return'['+map(obj,function(el){return f.asString(el);}).join(',')+']';case'function':return'"function()"';case'object':var str=[];for(var prop in obj){if(obj.hasOwnProperty(prop)){str.push('"'+prop+'":'+f.asString(obj[prop]));}} +return'{'+str.join(',')+'}';} +return String(obj).replace(/\s/g," ").replace(/\'/g,"\"");},getHTML:function(opts,conf){opts=extend({},opts);var html='';} +opts.width=opts.height=opts.id=opts.w3c=opts.src=null;opts.onFail=opts.version=opts.expressInstall=null;for(var key in opts){if(opts[key]){html+='';}} +var vars="";if(conf){for(var k in conf){if(conf[k]){var val=conf[k];vars+=encodeURIComponent(k)+'=' ++encodeURIComponent(/function|object/.test(typeof val)?f.asString(val):val) +'&';}} -vars=vars.substring(0,vars.length-1);html+='';} -html+="";return html;} -function Flash(root,opts,flashvars){var version=flashembed.getVersion();extend(this,{getContainer:function(){return root;},getConf:function(){return opts;},getVersion:function(){return version;},getFlashvars:function(){return flashvars;},getApi:function(){return root.firstChild;},getHTML:function(){return getHTML(opts,flashvars);}});var required=opts.version;var express=opts.expressInstall;var ok=!required||flashembed.isSupported(required);if(ok){opts.onFail=opts.version=opts.expressInstall=null;root.innerHTML=getHTML(opts,flashvars);}else if(required&&express&&flashembed.isSupported([6,65])){extend(opts,{src:express});flashvars={MMredirectURL:location.href,MMplayerType:'PlugIn',MMdoctitle:document.title};root.innerHTML=getHTML(opts,flashvars);}else{if(root.innerHTML.replace(/\s/g,'')!==''){}else{root.innerHTML="

Flash version "+required+" or greater is required

"+"

"+ -(version[0]>0?"Your version is "+version:"You have no flash plugin installed")+"

"+ -(root.tagName=='A'?"

Click here to download latest version

":"

Download latest version from here

");if(root.tagName=='A'){root.onclick=function(){location.href='http://www.adobe.com/go/getflashplayer';};}}} -if(!ok&&opts.onFail){var ret=opts.onFail.call(this);if(typeof ret=='string'){root.innerHTML=ret;}} -if(document.all){window[opts.id]=document.getElementById(opts.id);}} -window.flashembed=function(root,conf,flashvars){if(typeof root=='string'){var el=document.getElementById(root);if(el){root=el;}else{domReady(function(){flashembed(root,conf,flashvars);});return;}} +vars=vars.slice(0,-1);html+='';} +html+="
";return html;},isSupported:function(ver){return VERSION[0]>ver[0]||VERSION[0]==ver[0]&&VERSION[1]>=ver[1];}});var VERSION=f.getVersion();function Flash(root,opts,conf){if(f.isSupported(opts.version)){root.innerHTML=f.getHTML(opts,conf);}else if(opts.expressInstall&&f.isSupported([6,65])){root.innerHTML=f.getHTML(extend(opts,{src:opts.expressInstall}),{MMredirectURL:location.href,MMplayerType:'PlugIn',MMdoctitle:document.title});}else{if(!root.innerHTML.replace(/\s/g,'')){root.innerHTML="

Flash version "+opts.version+" or greater is required

"+"

"+ +(VERSION[0]>0?"Your version is "+VERSION:"You have no flash plugin installed")+"

"+ +(root.tagName=='A'?"

Click here to download latest version

":"

Download latest version from here

");if(root.tagName=='A'){root.onclick=function(){location.href=URL;};}} +if(opts.onFail){var ret=opts.onFail.call(this);if(typeof ret=='string'){root.innerHTML=ret;}}} +if(IE){window[opts.id]=document.getElementById(opts.id);} +extend(this,{getRoot:function(){return root;},getOptions:function(){return opts;},getConf:function(){return conf;},getApi:function(){return root.firstChild;}});} +var cx=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,escapable=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,gap,indent,meta={'\b':'\\b','\t':'\\t','\n':'\\n','\f':'\\f','\r':'\\r','"':'\\"','\\':'\\\\'},rep;function string2JsonString(string){escapable.lastIndex=0;return escapable.test(string)?'"'+string.replace(escapable,function(a){var c=meta[a];return typeof c==='string'?c:'\\u'+('0000'+a.charCodeAt(0).toString(16)).slice(-4);})+'"':'"'+string+'"';} +if(JQUERY){jQuery.tools=jQuery.tools||{version:'3.2.6'};jQuery.tools.flashembed={conf:GLOBAL_OPTS};jQuery.fn.flashembed=function(opts,conf){return this.each(function(){jQuery(this).data("flashembed",flashembed(this,opts,conf));});};}})();$f.addPlugin("ipad",function(options){var STATE_UNLOADED=-1;var STATE_LOADED=0;var STATE_UNSTARTED=1;var STATE_BUFFERING=2;var STATE_PLAYING=3;var STATE_PAUSED=4;var STATE_ENDED=5;var self=this;var currentVolume=1;var onStartFired=false;var stopping=false;var playAfterSeek=false;var activeIndex=0;var activePlaylist=[];var clipDefaults={accelerated:false,autoBuffering:false,autoPlay:true,baseUrl:null,bufferLength:3,connectionProvider:null,cuepointMultiplier:1000,cuepoints:[],controls:{},duration:0,extension:'',fadeInSpeed:1000,fadeOutSpeed:1000,image:false,linkUrl:null,linkWindow:'_self',live:false,metaData:{},originalUrl:null,position:0,playlist:[],provider:'http',scaling:'scale',seekableOnBegin:false,start:0,url:null,urlResolvers:[]};var currentState=STATE_UNLOADED;var previousState=STATE_UNLOADED;var isiDevice=/iPad|iPhone|iPod/i.test(navigator.userAgent);var video=null;function extend(to,from,includeFuncs){if(from){for(key in from){if(key){if(from[key]&&typeof from[key]=="function"&&!includeFuncs) +continue;if(from[key]&&typeof from[key]=="object"&&from[key].length==undefined){var cp={};extend(cp,from[key]);to[key]=cp;}else{to[key]=from[key];}}}} +return to;} +var opts={simulateiDevice:false,controlsSizeRatio:1.5,controls:true,debug:false,validExtensions:/mov|m4v|mp4|avi/gi};extend(opts,options);function log(){if(opts.debug){if(isiDevice){var str=[].splice.call(arguments,0).join(', ');console.log.apply(console,[str]);}else{console.log.apply(console,arguments);}}} +function stateDescription(state){switch(state){case-1:return"UNLOADED";case 0:return"LOADED";case 1:return"UNSTARTED";case 2:return"BUFFERING";case 3:return"PLAYING";case 4:return"PAUSED";case 5:return"ENDED";} +return"UNKOWN";} +function actionAllowed(eventName){var ret=$f.fireEvent(self.id(),"onBefore"+eventName,activeIndex);return ret!==false;} +function stopEvent(e){e.stopPropagation();e.preventDefault();return false;} +function setState(state,force){if(currentState==STATE_UNLOADED&&!force) +return;previousState=currentState;currentState=state;stopPlayTimeTracker();if(state==STATE_PLAYING) +startPlayTimeTracker();log(stateDescription(state));} +function resetState(){video.fp_stop();onStartFired=false;stopping=false;playAfterSeek=false;setState(STATE_UNSTARTED);setState(STATE_UNSTARTED);} +var _playTimeTracker=null;function startPlayTimeTracker(){if(_playTimeTracker) +return;console.log("starting tracker");_playTimeTracker=setInterval(onTimeTracked,100);onTimeTracked();} +function stopPlayTimeTracker(){clearInterval(_playTimeTracker);_playTimeTracker=null;} +function onTimeTracked(){var currentTime=Math.floor(video.fp_getTime()*10)*100;var duration=Math.floor(video.duration*10)*100;var fireTime=(new Date()).time;function fireCuePointsIfNeeded(time,cues){time=time>=0?time:duration-Math.abs(time);for(var i=0;ifireTime){cues[i].lastTimeFired=-1;}else if(cues[i].lastTimeFired+500>fireTime){continue;}else{if(time==currentTime||(currentTime-500time)){cues[i].lastTimeFired=fireTime;$f.fireEvent(self.id(),'onCuepoint',activeIndex,cues[i].fnId,cues[i].parameters);}}}} +$f.each(self.getCommonClip()._cuepoints,fireCuePointsIfNeeded);$f.each(activePlaylist[activeIndex]._cuepoints,fireCuePointsIfNeeded);} +function replay(){resetState();playAfterSeek=true;video.fp_seek(0);} +function scaleVideo(clip){} +function addAPI(){function fixClip(clip){var extendedClip={};extend(extendedClip,clipDefaults);extend(extendedClip,self.getCommonClip());extend(extendedClip,clip);if(extendedClip.ipadUrl) +url=decodeURIComponent(extendedClip.ipadUrl);else if(extendedClip.url) +url=extendedClip.url;if(url&&url.indexOf('://')==-1&&extendedClip.baseUrl) +url=extendedClip.baseUrl+'/'+url;extendedClip.originalUrl=extendedClip.url;extendedClip.completeUrl=url;extendedClip.extension=extendedClip.completeUrl.substr(extendedClip.completeUrl.lastIndexOf('.'));extendedClip.type='video';delete extendedClip.index;log("fixed clip",extendedClip);return extendedClip;} +video.fp_play=function(clip,inStream,forcePlay){var url=null;var autoBuffering=true;var autoPlay=true;log("Calling play() "+clip,clip);if(inStream){log("ERROR: inStream clips not yet supported");return;} +if(clip!==undefined){if(typeof clip=="number"){if(activeIndex>=activePlaylist.length) +return;activeIndex=clip;clip=activePlaylist[activeIndex];}else{if(typeof clip=="string"){clip={url:clip};} +video.fp_setPlaylist(clip.length!==undefined?clip:[clip]);} +if(!opts.validExtensions.test(activePlaylist[activeIndex].extension)){if(activePlaylist.length>1&&activeIndex<(activePlaylist.length-1)){log("Not last clip in the playlist, moving to next one");video.fp_play(++activeIndex,false,true);} +return;} +clip=activePlaylist[activeIndex];url=clip.completeUrl;if(clip.autoBuffering!==undefined&&clip.autoBuffering===false) +autoBuffering=false;if(clip.autoPlay===undefined||clip.autoPlay===true||forcePlay===true){autoBuffering=true;autoPlay=true;}else{autoPlay=false;}}else{log("clip was not given, simply calling video.play, if not already buffering");if(currentState!=STATE_BUFFERING) +video.play();return;} +log("about to play "+url,autoBuffering,autoPlay);resetState();if(url){log("Changing SRC attribute"+url);video.setAttribute('src',url);} +if(autoBuffering){if(!actionAllowed('Begin')) +return false;$f.fireEvent(self.id(),'onBegin',activeIndex);log("calling video.load()");video.load();} +if(autoPlay){log("calling video.play()");video.play();}} +video.fp_pause=function(){log("pause called");if(!actionAllowed('Pause')) +return false;video.pause();};video.fp_resume=function(){log("resume called");if(!actionAllowed('Resume')) +return false;video.play();};video.fp_stop=function(){log("stop called");if(!actionAllowed('Stop')) +return false;stopping=true;video.pause();try{video.currentTime=0;}catch(ignored){}};video.fp_seek=function(position){log("seek called "+position);if(!actionAllowed('Seek')) +return false;var seconds=0;var position=position+"";if(position.charAt(position.length-1)=='%'){var percentage=parseInt(position.substr(0,position.length-1))/100;var duration=video.duration;seconds=duration*percentage;}else{seconds=position;} +try{video.currentTime=seconds;}catch(e){log("Wrong seek time");}};video.fp_getTime=function(){return video.currentTime;};video.fp_mute=function(){log("mute called");if(!actionAllowed('Mute')) +return false;currentVolume=video.volume;video.volume=0;};video.fp_unmute=function(){if(!actionAllowed('Unmute')) +return false;video.volume=currentVolume;};video.fp_getVolume=function(){return video.volume*100;};video.fp_setVolume=function(volume){if(!actionAllowed('Volume')) +return false;video.volume=volume/100;};video.fp_toggle=function(){log('toggle called');if(self.getState()==STATE_ENDED){replay();return;} +if(video.paused) +video.fp_play();else +video.fp_pause();};video.fp_isPaused=function(){return video.paused;};video.fp_isPlaying=function(){return!video.paused;};video.fp_getPlugin=function(name){if(name=='canvas'||name=='controls'){var config=self.getConfig();return config['plugins']&&config['plugins'][name]?config['plugins'][name]:null;} +log("ERROR: no support for "+name+" plugin on iDevices");return null;};video.fp_close=function(){setState(STATE_UNLOADED);video.parentNode.removeChild(video);video=null;};video.fp_getStatus=function(){var bufferStart=0;var bufferEnd=0;try{bufferStart=video.buffered.start();bufferEnd=video.buffered.end();}catch(ignored){} +return{bufferStart:bufferStart,bufferEnd:bufferEnd,state:currentState,time:video.fp_getTime(),muted:video.muted,volume:video.fp_getVolume()};};video.fp_getState=function(){return currentState;};video.fp_startBuffering=function(){if(currentState==STATE_UNSTARTED) +video.load();};video.fp_setPlaylist=function(playlist){log("Setting playlist");activeIndex=0;for(var i=0;i1&&activeIndex<(activePlaylist.length-1)){log("Not last clip in the playlist, moving to next one");video.fp_play(++activeIndex,false,true);}};video.addEventListener('ended',onFinish,false);var onError=function(e){setState(STATE_LOADED,true);$f.fireEvent(self.id(),'onError',activeIndex,201);if(opts.onFail&&opts.onFail instanceof Function) +opts.onFail.apply(self,[]);};video.addEventListener('error',onError,false);var onPause=function(e){log("got pause event from player"+self.id());if(stopping) +return;if(currentState==STATE_BUFFERING&&previousState==STATE_UNSTARTED){log("forcing play");setTimeout(function(){video.play();},0);return;} +if(!actionAllowed('Pause')){video.fp_resume();return stopEvent(e);} +setState(STATE_PAUSED);$f.fireEvent(self.id(),'onPause',activeIndex);} +video.addEventListener('pause',onPause,false);var onSeek=function(e){$f.fireEvent(self.id(),'onBeforeSeek',activeIndex);};video.addEventListener('seeking',onSeek,false);var onSeekDone=function(e){if(stopping){stopping=false;$f.fireEvent(self.id(),'onStop',activeIndex);} +else +$f.fireEvent(self.id(),'onSeek',activeIndex);log("seek done, currentState",stateDescription(currentState));if(playAfterSeek){playAfterSeek=false;video.fp_play();}else if(currentState!=STATE_PLAYING) +video.fp_pause();};video.addEventListener('seeked',onSeekDone,false);var onVolumeChange=function(e){$f.fireEvent(self.id(),'onVolume',video.fp_getVolume());};video.addEventListener('volumechange',onVolumeChange,false);} +function onPlayerLoaded(){video.fp_play(0);} +function installControlbar(){} +if(isiDevice||opts.simulateiDevice){if(!window.flashembed.__replaced){var realFlashembed=window.flashembed;window.flashembed=function(root,opts,conf){if(typeof root=='string'){root=document.getElementById(root.replace("#",""));} if(!root){return;} -if(typeof conf=='string'){conf={src:conf};} -var opts=extend({},options);extend(opts,conf);return new Flash(root,opts,flashvars);};extend(window.flashembed,{getVersion:function(){var version=[0,0];if(navigator.plugins&&typeof navigator.plugins["Shockwave Flash"]=="object"){var _d=navigator.plugins["Shockwave Flash"].description;if(typeof _d!="undefined"){_d=_d.replace(/^.*\s+(\S+\s+\S+$)/,"$1");var _m=parseInt(_d.replace(/^(.*)\..*$/,"$1"),10);var _r=/r/.test(_d)?parseInt(_d.replace(/^.*r(.*)$/,"$1"),10):0;version=[_m,_r];}}else if(window.ActiveXObject){try{var _a=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");}catch(e){try{_a=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");version=[6,0];_a.AllowScriptAccess="always";}catch(ee){if(version[0]==6){return version;}} -try{_a=new ActiveXObject("ShockwaveFlash.ShockwaveFlash");}catch(eee){}} -if(typeof _a=="object"){_d=_a.GetVariable("$version");if(typeof _d!="undefined"){_d=_d.replace(/^\S+\s+(.*)$/,"$1").split(",");version=[parseInt(_d[0],10),parseInt(_d[2],10)];}}} -return version;},isSupported:function(version){var now=flashembed.getVersion();var ret=(now[0]>version[0])||(now[0]==version[0]&&now[1]>=version[1]);return ret;},domReady:domReady,asString:asString,getHTML:getHTML});if(jQ){jQuery.fn.flashembed=function(conf,flashvars){var el=null;this.each(function(){el=flashembed(this,conf,flashvars);});return conf.api===false?this:el;};}})(); \ No newline at end of file +var style=window.getComputedStyle(root,null);var width=parseInt(style.width);var height=parseInt(style.height);while(root.firstChild) +root.removeChild(root.firstChild);var container=document.createElement('div');var api=document.createElement('video');container.appendChild(api);root.appendChild(container);container.style.height=height+'px';container.style.width=width+'px';container.style.display='block';container.style.position='relative';container.style.background='-webkit-gradient(linear, left top, left bottom, from(rgba(0, 0, 0, 0.5)), to(rgba(0, 0, 0, 0.7)))';container.style.cursor='default';container.style.webkitUserDrag='none';api.style.height='100%';api.style.width='100%';api.style.display='block';api.id=opts.id;api.name=opts.id;api.style.cursor='pointer';api.style.webkitUserDrag='none';api.type="video/mp4";api.playerConfig=conf.config;$f.fireEvent(conf.config.playerId,'onLoad','player');};flashembed.getVersion=realFlashembed.getVersion;flashembed.asString=realFlashembed.asString;flashembed.isSupported=function(){return true;} +flashembed.__replaced=true;} +var __fireEvent=self._fireEvent;self._fireEvent=function(a){if(a[0]=='onLoad'&&a[1]=='player'){video=self.getParent().querySelector('video');if(opts.controls) +video.controls="controls";addAPI();addListeners();setState(STATE_LOADED,true);video.fp_setPlaylist(video.playerConfig.playlist);onPlayerLoaded();__fireEvent.apply(self,[a]);} +var shouldFireEvent=currentState!=STATE_UNLOADED;if(currentState==STATE_UNLOADED&&typeof a=='string') +shouldFireEvent=true;if(shouldFireEvent) +return __fireEvent.apply(self,[a]);} +self._swfHeight=function(){return parseInt(video.style.height);} +self.hasiPadSupport=function(){return true;}} +return self;}); \ No newline at end of file diff --git a/lib/flowplayer.pseudostreaming.swf b/lib/flowplayer.pseudostreaming.swf index 91b3fdd6f8..28f5d72ae5 100644 Binary files a/lib/flowplayer.pseudostreaming.swf and b/lib/flowplayer.pseudostreaming.swf differ diff --git a/lib/flowplayer.swf b/lib/flowplayer.swf index 63f3934a9e..20a41193f5 100644 Binary files a/lib/flowplayer.swf and b/lib/flowplayer.swf differ diff --git a/lib/jquery-ui.js b/lib/jquery-ui.js index 3398b9e409..74515a5b23 100644 --- a/lib/jquery-ui.js +++ b/lib/jquery-ui.js @@ -18,7 +18,7 @@ this.started=false;},_mouseDestroy:function(){this.element.unbind('.'+this.widge (this._mouseStarted&&this._mouseUp(event));this._mouseDownEvent=event;var self=this,btnIsLeft=(event.which==1),elIsCancel=(typeof this.options.cancel=="string"?$(event.target).parents().add(event.target).filter(this.options.cancel).length:false);if(!btnIsLeft||elIsCancel||!this._mouseCapture(event)){return true;} this.mouseDelayMet=!this.options.delay;if(!this.mouseDelayMet){this._mouseDelayTimer=setTimeout(function(){self.mouseDelayMet=true;},this.options.delay);} if(this._mouseDistanceMet(event)&&this._mouseDelayMet(event)){this._mouseStarted=(this._mouseStart(event)!==false);if(!this._mouseStarted){event.preventDefault();return true;}} -this._mouseMoveDelegate=function(event){return self._mouseMove(event);};this._mouseUpDelegate=function(event){return self._mouseUp(event);};$(document).bind('mousemove.'+this.widgetName,this._mouseMoveDelegate).bind('mouseup.'+this.widgetName,this._mouseUpDelegate);($.browser.safari||event.preventDefault());event.originalEvent.mouseHandled=true;return true;},_mouseMove:function(event){if($.browser.msie&&!event.button){return this._mouseUp(event);} +this._mouseMoveDelegate=function(event){return self._mouseMove(event);};this._mouseUpDelegate=function(event){return self._mouseUp(event);};$(document).bind('mousemove.'+this.widgetName,this._mouseMoveDelegate).bind('mouseup.'+this.widgetName,this._mouseUpDelegate);($.browser.safari||event.preventDefault());event.originalEvent.mouseHandled=true;return true;},_mouseMove:function(event){if($.browser.msie&&!(document.documentMode>=9)&&!event.button){return this._mouseUp(event);} if(this._mouseStarted){this._mouseDrag(event);return event.preventDefault();} if(this._mouseDistanceMet(event)&&this._mouseDelayMet(event)){this._mouseStarted=(this._mouseStart(this._mouseDownEvent,event)!==false);(this._mouseStarted?this._mouseDrag(event):this._mouseUp(event));} return!this._mouseStarted;},_mouseUp:function(event){$(document).unbind('mousemove.'+this.widgetName,this._mouseMoveDelegate).unbind('mouseup.'+this.widgetName,this._mouseUpDelegate);if(this._mouseStarted){this._mouseStarted=false;this._preventClickEvent=(event.target==this._mouseDownEvent.target);this._mouseStop(event);} diff --git a/modules/akismet/module.info b/modules/akismet/module.info index b61ed107a7..6347346827 100644 --- a/modules/akismet/module.info +++ b/modules/akismet/module.info @@ -1,3 +1,7 @@ name = "Akismet" description = "Filter comments through the Akismet web service to detect and eliminate spam (http://akismet.com). You'll need a WordPress.com API key to use it." version = 1 +author_name = "Gallery Team" +author_url = "http://codex.gallery2.org/Gallery:Team" +info_url = "http://codex.gallery2.org/Gallery3:Modules:akismet" +discuss_url = "http://gallery.menalto.com/forum_module_akismet" diff --git a/modules/comment/module.info b/modules/comment/module.info index e5aa454d3f..4e7df6f177 100644 --- a/modules/comment/module.info +++ b/modules/comment/module.info @@ -1,3 +1,7 @@ name = "Comments" description = "Allows users and guests to leave comments on photos and albums." version = 4 +author_name = "Gallery Team" +author_url = "http://codex.gallery2.org/Gallery:Team" +info_url = "http://codex.gallery2.org/Gallery3:Modules:comment" +discuss_url = "http://gallery.menalto.com/forum_module_comment" diff --git a/modules/digibug/module.info b/modules/digibug/module.info index be4e880a5c..781d5f015e 100644 --- a/modules/digibug/module.info +++ b/modules/digibug/module.info @@ -1,3 +1,7 @@ name = "Digibug" description = "Digibug Photo Printing Module" version = 2 +author_name = "Gallery Team" +author_url = "http://codex.gallery2.org/Gallery:Team" +info_url = "http://codex.gallery2.org/Gallery3:Modules:digibug" +discuss_url = "http://gallery.menalto.com/forum_module_digibug" diff --git a/modules/exif/module.info b/modules/exif/module.info index c8ae688e2c..e266e20eb4 100644 --- a/modules/exif/module.info +++ b/modules/exif/module.info @@ -1,3 +1,7 @@ name = "Exif Data" description = "Extract Exif data and display it on photo pages." version = 1 +author_name = "Gallery Team" +author_url = "http://codex.gallery2.org/Gallery:Team" +info_url = "http://codex.gallery2.org/Gallery3:Modules:exif" +discuss_url = "http://gallery.menalto.com/forum_module_exif" diff --git a/modules/g2_import/controllers/admin_g2_import.php b/modules/g2_import/controllers/admin_g2_import.php index 33186fb569..cf68d91104 100644 --- a/modules/g2_import/controllers/admin_g2_import.php +++ b/modules/g2_import/controllers/admin_g2_import.php @@ -24,23 +24,42 @@ public function index() { g2_import::init(); } - if (class_exists("GalleryCoreApi")) { - $g2_stats = g2_import::stats(); - $g2_sizes = g2_import::common_sizes(); - } - $view = new Admin_View("admin.html"); $view->page_title = t("Gallery 2 import"); $view->content = new View("admin_g2_import.html"); + + if (class_exists("GalleryCoreApi")) { + $view->content->g2_stats = $g2_stats = g2_import::g2_stats(); + $view->content->g3_stats = $g3_stats = g2_import::g3_stats(); + $view->content->g2_sizes = g2_import::common_sizes(); + $view->content->g2_version = g2_import::version(); + + // Don't count tags because we don't track them in g2_map + $view->content->g2_resource_count = + $g2_stats["users"] + $g2_stats["groups"] + $g2_stats["albums"] + + $g2_stats["photos"] + $g2_stats["movies"] + $g2_stats["comments"]; + $view->content->g3_resource_count = + $g3_stats["user"] + $g3_stats["group"] + $g3_stats["album"] + + $g3_stats["item"] + $g3_stats["comment"] + $g3_stats["tag"]; + } + $view->content->form = $this->_get_import_form(); $view->content->version = ""; + $view->content->thumb_size = module::get_var("gallery", "thumb_size"); + $view->content->resize_size = module::get_var("gallery", "resize_size"); if (g2_import::is_initialized()) { - $view->content->g2_stats = $g2_stats; - $view->content->g2_sizes = $g2_sizes; - $view->content->thumb_size = module::get_var("gallery", "thumb_size"); - $view->content->resize_size = module::get_var("gallery", "resize_size"); - $view->content->version = g2_import::version(); + if ((bool)ini_get("eaccelerator.enable") || (bool)ini_get("xcache.cacher")) { + message::warning(t("The eAccelerator and XCache PHP performance extensions are known to cause issues. If you're using either of those and are having problems, please disable them while you do your import. Add the following lines:
%lines
to gallery3/.htaccess and remove them when the import is done.", array("lines" => "\n\n php_value eaccelerator.enable 0\n php_value xcache.cacher off\n php_value xcache.optimizer off\n\n"))); + } + + foreach (array("notification", "search", "exif") as $module_id) { + if (module::is_active($module_id)) { + message::warning( + t("Deactivating the %module_id module during your import will make it faster", + array("url" => url::site("admin/modules"), "module_id" => $module_id))); + } + } } else if (g2_import::is_configured()) { $view->content->form->configure_g2_import->embed_path->add_error("invalid", 1); } @@ -75,15 +94,28 @@ public function save() { print $view; } + public function autocomplete() { + $directories = array(); + $path_prefix = Input::instance()->get("q"); + foreach (glob("{$path_prefix}*") as $file) { + if (is_dir($file) && !is_link($file)) { + $directories[] = $file; + } + } + + print implode("\n", $directories); + } + private function _get_import_form() { + $embed_path = module::get_var("g2_import", "embed_path", ""); $form = new Forge( "admin/g2_import/save", "", "post", array("id" => "g-admin-configure-g2-import-form")); $group = $form->group("configure_g2_import")->label(t("Configure Gallery 2 Import")); $group->input("embed_path")->label(t("Filesystem path to your Gallery 2 embed.php file")) - ->value(module::get_var("g2_import", "embed_path", "")); + ->value($embed_path); $group->embed_path->error_messages( "invalid", t("The path you entered is not a Gallery 2 installation.")); - $group->submit("")->value(t("Save")); + $group->submit("")->value($embed_path ? t("Change") : t("Continue")); return $form; } } \ No newline at end of file diff --git a/modules/g2_import/helpers/g2_import.php b/modules/g2_import/helpers/g2_import.php index 22fb68c69d..23fb29e595 100644 --- a/modules/g2_import/helpers/g2_import.php +++ b/modules/g2_import/helpers/g2_import.php @@ -219,7 +219,7 @@ static function g2_module_active($module) { * Return a set of statistics about the number of users, groups, albums, photos, movies and * comments available for import from the Gallery 2 instance. */ - static function stats() { + static function g2_stats() { global $gallery; $root_album_id = g2(GalleryCoreApi::getDefaultAlbumId()); $stats["users"] = g2(GalleryCoreApi::fetchUserCount()); @@ -247,6 +247,25 @@ static function stats() { return $stats; } + /** + * Return a set of statistics about the number of users, groups, albums, photos, movies and + * comments already imported into the Gallery 3 instance. + */ + static function g3_stats() { + $g3_stats = array( + "album" => 0, "comment" => 0, "item" => 0, "user" => 0, "group" => 0, "tag" => 0); + foreach (db::build() + ->select("resource_type") + ->select(array("C" => 'COUNT("*")')) + ->from("g2_maps") + ->where("resource_type", "IN", array("album", "comment", "item", "user", "group")) + ->group_by("resource_type") + ->execute() as $row) { + $g3_stats[$row->resource_type] = $row->C; + } + return $g3_stats; + } + /** * Import a single group. */ diff --git a/modules/g2_import/helpers/g2_import_task.php b/modules/g2_import/helpers/g2_import_task.php index 6bda8f1791..5e908676f1 100644 --- a/modules/g2_import/helpers/g2_import_task.php +++ b/modules/g2_import/helpers/g2_import_task.php @@ -56,7 +56,7 @@ static function import($task) { $mode = $task->get("mode"); $queue = $task->get("queue"); if (!isset($mode)) { - $stats = g2_import::stats(); + $stats = g2_import::g2_stats(); $stats["items"] = $stats["photos"] + $stats["movies"]; unset($stats["photos"]); unset($stats["movies"]); diff --git a/modules/g2_import/module.info b/modules/g2_import/module.info index 977af25124..30fb46d41d 100644 --- a/modules/g2_import/module.info +++ b/modules/g2_import/module.info @@ -1,3 +1,7 @@ name = "Gallery2 Import" description = "Import your Gallery 2 content into Gallery 3" version = 2 +author_name = "Gallery Team" +author_url = "http://codex.gallery2.org/Gallery:Team" +info_url = "http://codex.gallery2.org/Gallery3:Modules:g2_import" +discuss_url = "http://gallery.menalto.com/forum_module_g2_import" diff --git a/modules/g2_import/views/admin_g2_import.html.php b/modules/g2_import/views/admin_g2_import.html.php index cb13363a80..cf5e475571 100644 --- a/modules/g2_import/views/admin_g2_import.html.php +++ b/modules/g2_import/views/admin_g2_import.html.php @@ -1,24 +1,60 @@ +css("jquery.autocomplete.css") ?> +script("jquery.autocomplete.js") ?> + +

-
- -
- -
- -
-

-
    -
  • - $version)) ?> + +
    +
      +
    • + +
    • +
    • + +
    • +
    • + +
    • +
    +
    + +
    +
    + +
      +
    • + $g2_version)) ?>
    • -
    • +
    • Using the same value will speed up your import.", array("g2_pixels" => $g2_sizes["thumb"]["size"], "g3_pixels" => $thumb_size, @@ -27,73 +63,84 @@ -
    • +
    • Using the same value will speed up your import.", - array("g2_pixels" => $g2_sizes["resize"]["size"], - "g3_pixels" => $resize_size, - "url" => html::mark_clean(url::site("admin/theme_options")))) ?> + array("g2_pixels" => $g2_sizes["resize"]["size"], + "g3_pixels" => $resize_size, + "url" => html::mark_clean(url::site("admin/theme_options")))) ?>
    • -
    • - -

      - , - , - , - , - , - , - -

      +
    • + + $t[0], "t1" => $t[1], "t2" => $t[2], + "t3" => $t[3], "t4" => $t[4], "t5" => $t[5])) ?>
    • -
    + +
  • + + $t[0], "t1" => $t[1], "t2" => $t[2], + "t3" => $t[3], "t4" => $t[4], "t5" => $t[5])) ?> +
  • + +

">

+
+
+
    +
  • + Review permissions!") ?> +
  • +
  • + +
  • +
  • +

    + +

    -
    -
    -

    -
      -
    • - Review permissions after your import is done.") ?> -
    • -
    • - -
    • -
    • - notification, search and exif modules during your import will make it go faster.") ?> -
    • -
    • - %lines to gallery3/.htaccess and remove them when the import is done.", array("lines" => "\n\n php_value eaccelerator.enable 0\n php_value xcache.cacher off\n php_value xcache.optimizer off\n\n")) ?> -
    • -
    -
    -
    - -
    -
    -

    -

    - -

    - - -
    - + RewriteRule ^(.*)$ [QSA,L,R=301] + </IfModule> + +
  • +
diff --git a/modules/gallery/config/locale.php b/modules/gallery/config/locale.php index 0509e45f7d..13de909834 100644 --- a/modules/gallery/config/locale.php +++ b/modules/gallery/config/locale.php @@ -29,14 +29,10 @@ $config['language'] = array('en_US', 'English_United States'); /** - * Locale timezone. Defaults to use the server timezone. + * Locale timezone. Set in 'Advanced' settings, falling back to the server's zone. * @see http://php.net/timezones */ -$config['timezone'] = ini_get('date.timezone'); -if (empty($config['timezone'])) { - // This is a required field. Pick something as a default. - $config['timezone'] = "America/Los_Angeles"; -} +$config['timezone'] = module::get_var("gallery", "timezone", date_default_timezone_get()); // i18n settings diff --git a/modules/gallery/controllers/admin_modules.php b/modules/gallery/controllers/admin_modules.php index 787785eaf9..b712d14f2a 100644 --- a/modules/gallery/controllers/admin_modules.php +++ b/modules/gallery/controllers/admin_modules.php @@ -19,6 +19,9 @@ */ class Admin_Modules_Controller extends Admin_Controller { public function index() { + // If modules need upgrading, this will get recreated in module::available() + site_status::clear("upgrade_now"); + $view = new Admin_View("admin.html"); $view->page_title = t("Modules"); $view->content = new View("admin_modules.html"); @@ -103,9 +106,6 @@ private function _do_save() { module::event("module_change", $changes); - // If modules need upgrading, this will get recreated - site_status::clear("upgrade_now"); - // @todo this type of collation is questionable from an i18n perspective if ($activated_names) { message::success(t("Activated: %names", array("names" => join(", ", $activated_names)))); diff --git a/modules/gallery/controllers/admin_theme_options.php b/modules/gallery/controllers/admin_theme_options.php index cb46da90fe..a968a56de1 100644 --- a/modules/gallery/controllers/admin_theme_options.php +++ b/modules/gallery/controllers/admin_theme_options.php @@ -78,8 +78,10 @@ private function _get_edit_form_admin() { $group = $form->group("edit_theme")->label(t("Theme layout")); $group->input("page_size")->label(t("Items per page"))->id("g-page-size") ->rules("required|valid_digit") + ->callback(array($this, "_valididate_page_size")) ->error_messages("required", t("You must enter a number")) ->error_messages("valid_digit", t("You must enter a number")) + ->error_messages("valid_min_value", t("The value must be greater than zero")) ->value(module::get_var("gallery", "page_size")); $group->input("thumb_size")->label(t("Thumbnail size (in pixels)"))->id("g-thumb-size") ->rules("required|valid_digit") @@ -110,5 +112,12 @@ private function _get_edit_form_admin() { $group->submit("")->value(t("Save")); return $form; } + + function _valididate_page_size($input) { + if ($input->value < 1) { + $input->add_error("valid_min_value", true); + } + + } } diff --git a/modules/gallery/css/gallery.css b/modules/gallery/css/gallery.css index 275a3d7d3b..ecf895650d 100644 --- a/modules/gallery/css/gallery.css +++ b/modules/gallery/css/gallery.css @@ -29,12 +29,12 @@ #g-add-photos-canvas object, #g-add-photos-button { - left: 137px; - margin: .5em 0; + left: 90px; + margin: .5em 0; padding: .4em 1em; position: absolute; top: 0; - width: 175px; + width: 300px; } #g-add-photos-canvas object { diff --git a/modules/gallery/helpers/MY_num.php b/modules/gallery/helpers/MY_num.php index 9787044c28..842a2ee3c9 100644 --- a/modules/gallery/helpers/MY_num.php +++ b/modules/gallery/helpers/MY_num.php @@ -37,4 +37,18 @@ static function convert_to_bytes($val) { return $val; } + + /** + * Convert a size value as accepted by PHP's shorthand to bytes. + * ref: http://us2.php.net/manual/en/function.ini-get.php + * ref: http://us2.php.net/manual/en/faq.using.php#faq.using.shorthandbytes + */ + static function convert_to_human_readable($num) { + foreach (array("G" => 1e9, "M" => 1e6, "K" => 1e3) as $k => $v) { + if ($num > $v) { + $num = round($num / $v) . $k; + } + } + return $num; + } } diff --git a/modules/gallery/helpers/gallery_block.php b/modules/gallery/helpers/gallery_block.php index 0ba7c93655..49d16246f3 100644 --- a/modules/gallery/helpers/gallery_block.php +++ b/modules/gallery/helpers/gallery_block.php @@ -82,9 +82,13 @@ static function get($block_id) { break; case "block_adder": - $block->css_id = "g-block-adder"; - $block->title = t("Dashboard content"); - $block->content = gallery_block::get_add_block_form(); + if ($form = gallery_block::get_add_block_form()) { + $block->css_id = "g-block-adder"; + $block->title = t("Dashboard content"); + $block->content = $form; + } else { + $block = ""; + } break; case "language": @@ -118,11 +122,22 @@ static function get($block_id) { } static function get_add_block_form() { + $available_blocks = block_manager::get_available_admin_blocks(); + + $active = array(); + foreach (array_merge(block_manager::get_active("dashboard_sidebar"), + block_manager::get_active("dashboard_center")) as $b) { + unset($available_blocks[implode(":", $b)]); + } + + if (!$available_blocks) { + return; + } + $form = new Forge("admin/dashboard/add_block", "", "post", array("id" => "g-add-dashboard-block-form")); $group = $form->group("add_block")->label(t("Add Block")); - $group->dropdown("id")->label(t("Available Blocks")) - ->options(block_manager::get_available_admin_blocks()); + $group->dropdown("id")->label(t("Available blocks"))->options($available_blocks); $group->submit("center")->value(t("Add to center")); $group->submit("sidebar")->value(t("Add to sidebar")); return $form; diff --git a/modules/gallery/helpers/gallery_installer.php b/modules/gallery/helpers/gallery_installer.php index 20de1feae8..7a9af40228 100644 --- a/modules/gallery/helpers/gallery_installer.php +++ b/modules/gallery/helpers/gallery_installer.php @@ -311,8 +311,9 @@ static function install() { module::set_var("gallery", "email_header_separator", serialize("\n")); module::set_var("gallery", "show_user_profiles_to", "registered_users"); module::set_var("gallery", "extra_binary_paths", "/usr/local/bin:/opt/local/bin:/opt/bin"); + module::set_var("gallery", "timezone", null); - module::set_version("gallery", 47); + module::set_version("gallery", 49); } static function upgrade($version) { @@ -683,6 +684,14 @@ static function upgrade($version) { module::set_var("gallery", "apple_touch_icon_url", "lib/images/apple-touch-icon.png"); module::set_version("gallery", $version = 47); } + + if ($version == 47 || $version == 48) { + // Add configuration variable to set timezone. Defaults to the currently + // used timezone (from PHP configuration). Note that in v48 we werew + // setting this value incorrectly, so we're going to stomp this value for v49. + module::set_var("gallery", "timezone", null); + module::set_version("gallery", $version = 49); + } } static function uninstall() { diff --git a/modules/gallery/helpers/graphics.php b/modules/gallery/helpers/graphics.php index 045011328f..acb11bfb23 100644 --- a/modules/gallery/helpers/graphics.php +++ b/modules/gallery/helpers/graphics.php @@ -316,10 +316,10 @@ static function detect_toolkits() { // ImageMagick & GraphicsMagick $magick_kits = array( "imagemagick" => array( - "name" => "ImageMagick", "binary" => "convert", "version" => "convert -v", + "name" => "ImageMagick", "binary" => "convert", "version_arg" => "-v", "version_regex" => "/Version: \S+ (\S+)/"), "graphicsmagick" => array( - "name" => "GraphicsMagick", "binary" => "gm", "version" => "gm version", + "name" => "GraphicsMagick", "binary" => "gm", "version_arg" => "version", "version_regex" => "/\S+ (\S+)/")); // Loop through the kits foreach ($magick_kits as $index => $settings) { @@ -328,7 +328,8 @@ static function detect_toolkits() { $toolkits->$index->name = $settings["name"]; if ($path) { if (@is_file($path) && - preg_match($settings["version_regex"], shell_exec($settings["version"]), $matches)) { + preg_match( + $settings["version_regex"], shell_exec($path . " " . $settings["version_arg"]), $matches)) { $version = $matches[1]; $toolkits->$index->installed = true; @@ -423,4 +424,23 @@ static function can($func) { return true; } + + /** + * Return the max file size that this graphics toolkit can handle. + */ + static function max_filesize() { + if (module::get_var("gallery", "graphics_toolkit") == "gd") { + $memory_limit = trim(ini_get("memory_limit")); + $memory_limit_bytes = num::convert_to_bytes($memory_limit); + + // GD expands images in memory and uses 4 bytes of RAM for every byte + // in the file. + $max_filesize = $memory_limit_bytes / 4; + $max_filesize_human_readable = num::convert_to_human_readable($max_filesize); + return array($max_filesize, $max_filesize_human_readable); + } + + // Some arbitrarily large size + return array(1000000000, "1G"); + } } diff --git a/modules/gallery/helpers/item.php b/modules/gallery/helpers/item.php index 1a5c631e0c..7e7795441d 100644 --- a/modules/gallery/helpers/item.php +++ b/modules/gallery/helpers/item.php @@ -152,8 +152,18 @@ static function convert_filename_to_title($filename) { * @param string $filename */ static function convert_filename_to_slug($filename) { - $result = pathinfo($filename, PATHINFO_FILENAME); + $result = str_replace("&", "-and-", $filename); + $result = str_replace(" ", "-", $result); + + // It's not easy to extend the text helper since it's called by the Input class which is + // referenced in hooks/init_gallery, so it's + if (class_exists("transliterate")) { + $result = transliterate::utf8_to_ascii($result); + } else { + $result = text::transliterate_to_ascii($result); + } $result = preg_replace("/[^A-Za-z0-9-_]+/", "-", $result); + $result = preg_replace("/-+/", "-", $result); return trim($result, "-"); } diff --git a/modules/gallery/helpers/module.php b/modules/gallery/helpers/module.php index 37f7f68a80..4b7d4a5fe8 100644 --- a/modules/gallery/helpers/module.php +++ b/modules/gallery/helpers/module.php @@ -101,7 +101,7 @@ static function available() { $m->locked = false; if ($m->active && $m->version != $m->code_version) { - site_status::warning(t("Some of your modules are out of date. Upgrade now!", array("upgrader_url" => url::site("upgrader"))), "upgrade_now"); + site_status::warning(t("Some of your modules are out of date. Upgrade now!", array("upgrader_url" => url::abs_site("upgrader"))), "upgrade_now"); } } diff --git a/modules/gallery/libraries/Form_Uploadify.php b/modules/gallery/libraries/Form_Uploadify.php index ca189f0be5..c79b9aa216 100644 --- a/modules/gallery/libraries/Form_Uploadify.php +++ b/modules/gallery/libraries/Form_Uploadify.php @@ -49,6 +49,20 @@ public function render() { $v->movies_allowed = (bool) movie::find_ffmpeg(); $v->extensions = upload::get_upload_filters(); $v->suhosin_session_encrypt = (bool) ini_get("suhosin.session.encrypt"); + + list ($toolkit_max_filesize_bytes, $toolkit_max_filesize) = graphics::max_filesize(); + + $upload_max_filesize = trim(ini_get("upload_max_filesize")); + $upload_max_filesize_bytes = num::convert_to_bytes($upload_max_filesize); + + if ($upload_max_filesize_bytes < $toolkit_max_filesize_bytes) { + $v->size_limit_bytes = $upload_max_filesize_bytes; + $v->size_limit = $upload_max_filesize; + } else { + $v->size_limit_bytes = $toolkit_max_filesize_bytes; + $v->size_limit = $toolkit_max_filesize; + } + return $v; } diff --git a/modules/gallery/libraries/Gallery_View.php b/modules/gallery/libraries/Gallery_View.php index 77e3d20423..1395686cd9 100644 --- a/modules/gallery/libraries/Gallery_View.php +++ b/modules/gallery/libraries/Gallery_View.php @@ -136,6 +136,9 @@ public function get_combined($type, $group="core") { } unset($this->combine_queue[$type][$group]); + if (empty($this->combine_queue[$type])) { + unset($this->combine_queue[$type]); + } if ($type == "css") { return html::stylesheet("combined/css/$key", "screen,print,projection", true); diff --git a/modules/gallery/libraries/InPlaceEdit.php b/modules/gallery/libraries/InPlaceEdit.php index 88c30494c9..739cbb61fb 100644 --- a/modules/gallery/libraries/InPlaceEdit.php +++ b/modules/gallery/libraries/InPlaceEdit.php @@ -56,8 +56,12 @@ public function callback($callback) { } public function validate() { - $post = Validation::factory($_POST) - ->add_callbacks("input", $this->callback); + $post = Validation::factory($_POST); + + if (!empty($this->callback)) { + $post->add_callbacks("input", $this->callback); + } + foreach ($this->rules as $rule) { $post->add_rules("input", $rule); } diff --git a/modules/gallery/libraries/Theme_View.php b/modules/gallery/libraries/Theme_View.php index a507e9c870..152efc3745 100644 --- a/modules/gallery/libraries/Theme_View.php +++ b/modules/gallery/libraries/Theme_View.php @@ -38,6 +38,7 @@ public function __construct($name, $page_type, $page_subtype) { $this->item = null; $this->tag = null; $this->set_global(array("theme" => $this, + "theme_info" => theme::get_info($this->theme_name), "user" => identity::active_user(), "page_type" => $page_type, "page_subtype" => $page_subtype, diff --git a/modules/gallery/models/item.php b/modules/gallery/models/item.php index f4d4c52150..ba8e7cdec4 100644 --- a/modules/gallery/models/item.php +++ b/modules/gallery/models/item.php @@ -345,9 +345,7 @@ public function save() { // Make an url friendly slug from the name, if necessary if (empty($this->slug)) { - $tmp = pathinfo($this->name, PATHINFO_FILENAME); - $tmp = preg_replace("/[^A-Za-z0-9-_]+/", "-", $tmp); - $this->slug = trim($tmp, "-"); + $this->slug = item::convert_filename_to_slug($this->name); // If the filename is all invalid characters, then the slug may be empty here. Pick a // random value. diff --git a/modules/gallery/module.info b/modules/gallery/module.info index aa1dc341aa..42345531b4 100644 --- a/modules/gallery/module.info +++ b/modules/gallery/module.info @@ -1,3 +1,7 @@ name = "Gallery 3" description = "Gallery core application" -version = 47 +version = 49 +author_name = "Gallery Team" +author_url = "http://codex.gallery2.org/Gallery:Team" +info_url = "http://codex.gallery2.org/Gallery3:Modules:gallery" +discuss_url = "http://gallery.menalto.com/forum_module_gallery" diff --git a/modules/gallery/tests/Item_Helper_Test.php b/modules/gallery/tests/Item_Helper_Test.php index 4d5aed417e..2fde7cc0c5 100644 --- a/modules/gallery/tests/Item_Helper_Test.php +++ b/modules/gallery/tests/Item_Helper_Test.php @@ -49,6 +49,10 @@ public function convert_filename_to_title_test() { public function convert_filename_to_slug_test() { $this->assert_equal("foo", item::convert_filename_to_slug("{[foo]}")); $this->assert_equal("foo-bar", item::convert_filename_to_slug("{[foo!@#!$@#^$@($!(@bar]}")); + $this->assert_equal("english-text", item::convert_filename_to_slug("english text")); + $this->assert_equal("new-line", item::convert_filename_to_slug("new \n line")); + $this->assert_equal("foo-and-bar", item::convert_filename_to_slug("foo&bar")); + $this->assert_equal("special", item::convert_filename_to_slug("šṗëçîąļ")); } public function move_test() { diff --git a/modules/gallery/tests/Num_Helper_Test.php b/modules/gallery/tests/Num_Helper_Test.php new file mode 100644 index 0000000000..a22f9359a6 --- /dev/null +++ b/modules/gallery/tests/Num_Helper_Test.php @@ -0,0 +1,32 @@ +assert_equal(5 * 1024, num::convert_to_bytes("5K")); + $this->assert_equal(3 * 1024*1024, num::convert_to_bytes("3M")); + $this->assert_equal(4 * 1024*1024*1024, num::convert_to_bytes("4G")); + } + + public function convert_to_human_readable_test() { + $this->assert_equal("6K", num::convert_to_human_readable(5615)); + $this->assert_equal("1M", num::convert_to_human_readable(1205615)); + $this->assert_equal("3G", num::convert_to_human_readable(3091205615)); + } +} \ No newline at end of file diff --git a/modules/gallery/views/admin_modules.html.php b/modules/gallery/views/admin_modules.html.php index 2cc81b0d4c..03993bb283 100644 --- a/modules/gallery/views/admin_modules.html.php +++ b/modules/gallery/views/admin_modules.html.php @@ -43,7 +43,7 @@

- + adding more modules! Each module provides new cool features.", array("url" => "http://codex.gallery2.org/Category:Gallery_3:Modules")) ?>

@@ -55,6 +55,7 @@ + $module_info): ?> "> @@ -64,6 +65,55 @@ name) ?> version ?> description) ?> + + + diff --git a/modules/gallery/views/admin_themes.html.php b/modules/gallery/views/admin_themes.html.php index d14e8bd40d..7d947b28db 100644 --- a/modules/gallery/views/admin_themes.html.php +++ b/modules/gallery/views/admin_themes.html.php @@ -10,7 +10,7 @@ function() { load(type) });

- + with a new theme! There are separate themes for the regular site and for the administration interface. Click a theme below to preview and activate it.", array("url" => "http://codex.gallery2.org/Category:Gallery_3:Themes")) ?>

@@ -23,6 +23,7 @@ function() { load(type) });

description ?>

+ info = $themes[$site]; print $v; ?>

@@ -40,13 +41,14 @@ function() { load(type) }); description ?>

+ info = $info; print $v; ?>

- + Download one now!", array("url" => "http://codex.gallery2.org/Category:Gallery_3:Modules")) ?>

@@ -61,6 +63,7 @@ function() { load(type) });

description ?>

+ info = $themes[$admin]; print $v; ?>

@@ -78,17 +81,18 @@ function() { load(type) }); description ?>

+ info = $info; print $v; ?>

- + Download one now!", array("url" => "http://codex.gallery2.org/Category:Gallery_3:Modules")) ?>

- \ No newline at end of file + diff --git a/modules/gallery/views/admin_themes_buttonset.html.php b/modules/gallery/views/admin_themes_buttonset.html.php new file mode 100644 index 0000000000..5166f36c26 --- /dev/null +++ b/modules/gallery/views/admin_themes_buttonset.html.php @@ -0,0 +1,47 @@ + diff --git a/modules/gallery/views/form_uploadify.html.php b/modules/gallery/views/form_uploadify.html.php index db90b73336..ba4a3621fb 100644 --- a/modules/gallery/views/form_uploadify.html.php +++ b/modules/gallery/views/form_uploadify.html.php @@ -32,6 +32,7 @@ function(data) { fileDesc: for_js() ?>, cancelImg: "", simUploadLimit: , + sizeLimit: , wmode: "transparent", hideButton: true, /* should be true */ auto: true, @@ -66,26 +67,30 @@ function(data) { return true; }, onError: function(event, queueID, fileObj, errorObj) { - var msg = " - "; if (errorObj.type == "HTTP") { if (errorObj.info == "500") { - msg += for_js() ?>; - // Server error - check server logs + error_msg = for_js() ?>; } else if (errorObj.info == "404") { - msg += for_js() ?>; - // Server script not found + error_msg = for_js() ?>; + } else if (errorObj.info == "400") { + error_msg = $size_limit))->for_js() ?>; } else { - // Server Error: status: errorObj.info - msg += (for_js() ?>.replace("__INFO__", errorObj.info)); + msg += (for_js() ?> + .replace("__INFO__", errorObj.info) + .replace("__TYPE__", errorObj.type)); } } else if (errorObj.type == "File Size") { - var sizelimit = $("#g-uploadify").uploadifySettings(sizeLimit); - msg += fileObj.name+' '+errorObj.type+' Limit: '+Math.round(d.sizeLimit/1024)+'KB'; + error_msg = $size_limit))->for_js() ?>; } else { - msg += (for_js() ?> - .replace("__INFO__", errorObj.info) - .replace("__TYPE__", errorObj.type)); + error_msg = for_js() ?> + .replace("__INFO__", errorObj.info) + .replace("__TYPE__", errorObj.type); } + msg = " - " + + error_msg + ""; + $("#g-add-photos-status ul").append( "
  • " + fileObj.name + msg + "
  • "); $("#g-uploadify").uploadifyCancel(queueID); @@ -131,10 +136,7 @@ function(data) {
    -

    - -

    -
      +
        parents() as $i => $parent): ?> > title) ?> @@ -143,7 +145,7 @@ function(data) {
    - +
    diff --git a/modules/gallery/views/movieplayer.html.php b/modules/gallery/views/movieplayer.html.php index 5c280a3602..96d6532cb6 100644 --- a/modules/gallery/views/movieplayer.html.php +++ b/modules/gallery/views/movieplayer.html.php @@ -22,5 +22,5 @@ } } } - ) + ).ipad(); diff --git a/modules/gallery/views/upgrader.html.php b/modules/gallery/views/upgrader.html.php index ad2e34219b..70d37dd1ce 100644 --- a/modules/gallery/views/upgrader.html.php +++ b/modules/gallery/views/upgrader.html.php @@ -27,7 +27,7 @@ diff --git a/modules/image_block/module.info b/modules/image_block/module.info index 6836fabc2c..6722cc8f27 100644 --- a/modules/image_block/module.info +++ b/modules/image_block/module.info @@ -1,3 +1,7 @@ name = "Image Block" description = "Display a random image in the sidebar" version = 3 +author_name = "Gallery Team" +author_url = "http://codex.gallery2.org/Gallery:Team" +info_url = "http://codex.gallery2.org/Gallery3:Modules:image_block" +discuss_url = "http://gallery.menalto.com/forum_module_image_block" diff --git a/modules/info/module.info b/modules/info/module.info index 5f84cbb917..f8964a7823 100644 --- a/modules/info/module.info +++ b/modules/info/module.info @@ -1,3 +1,7 @@ name = "Info" description = "Display extra information about photos and albums" version = 2 +author_name = "Gallery Team" +author_url = "http://codex.gallery2.org/Gallery:Team" +info_url = "http://codex.gallery2.org/Gallery3:Modules:info" +discuss_url = "http://gallery.menalto.com/forum_module_info" diff --git a/modules/notification/module.info b/modules/notification/module.info index 8c5e11623e..84be8f99d3 100644 --- a/modules/notification/module.info +++ b/modules/notification/module.info @@ -1,3 +1,7 @@ name = "Notification" description = "Send notifications to users when changes are made to watched albums." version = 2 +author_name = "Gallery Team" +author_url = "http://codex.gallery2.org/Gallery:Team" +info_url = "http://codex.gallery2.org/Gallery3:Modules:notification" +discuss_url = "http://gallery.menalto.com/forum_module_notification" diff --git a/modules/organize/module.info b/modules/organize/module.info index 0d16144d7c..07b9dc38cd 100644 --- a/modules/organize/module.info +++ b/modules/organize/module.info @@ -1,3 +1,7 @@ name = "Organize" description = "Visually rearrange and move photos in your gallery" version = 4 +author_name = "Gallery Team" +author_url = "http://codex.gallery2.org/Gallery:Team" +info_url = "http://codex.gallery2.org/Gallery3:Modules:organize" +discuss_url = "http://gallery.menalto.com/forum_module_organize" diff --git a/modules/recaptcha/module.info b/modules/recaptcha/module.info index cfa1bf7a0c..ebaff7de3f 100644 --- a/modules/recaptcha/module.info +++ b/modules/recaptcha/module.info @@ -1,3 +1,7 @@ name = "reCAPTCHA" description = "reCAPTCHA displays a graphical verification that protects the input form from abuse from 'bots,' or automated programs usually written to generate spam (http://recaptcha.net)." version = 1 +author_name = "Gallery Team" +author_url = "http://codex.gallery2.org/Gallery:Team" +info_url = "http://codex.gallery2.org/Gallery3:Modules:recaptcha" +discuss_url = "http://gallery.menalto.com/forum_module_recaptcha" diff --git a/modules/rest/module.info b/modules/rest/module.info index 5aaffc2854..33c9f1cf53 100644 --- a/modules/rest/module.info +++ b/modules/rest/module.info @@ -2,3 +2,7 @@ name = "REST API Module" description = "A REST-based API that allows desktop clients and other apps to interact with Gallery 3" version = 3 +author_name = "Gallery Team" +author_url = "http://codex.gallery2.org/Gallery:Team" +info_url = "http://codex.gallery2.org/Gallery3:Modules:rest" +discuss_url = "http://gallery.menalto.com/forum_module_rest" diff --git a/modules/rss/module.info b/modules/rss/module.info index 48375da13b..cd13c1b062 100644 --- a/modules/rss/module.info +++ b/modules/rss/module.info @@ -1,3 +1,7 @@ name = "RSS" description = "Provides RSS feeds" version = 1 +author_name = "Gallery Team" +author_url = "http://codex.gallery2.org/Gallery:Team" +info_url = "http://codex.gallery2.org/Gallery3:Modules:rss" +discuss_url = "http://gallery.menalto.com/forum_module_rss" diff --git a/modules/search/module.info b/modules/search/module.info index f417c4fac5..1389798d38 100644 --- a/modules/search/module.info +++ b/modules/search/module.info @@ -1,3 +1,7 @@ name = "Search" description = "Allows users to search their Gallery" version = 1 +author_name = "Gallery Team" +author_url = "http://codex.gallery2.org/Gallery:Team" +info_url = "http://codex.gallery2.org/Gallery3:Modules:search" +discuss_url = "http://gallery.menalto.com/forum_module_search" diff --git a/modules/server_add/helpers/server_add_theme.php b/modules/server_add/helpers/server_add_theme.php index 50c050a8c9..cfca590179 100644 --- a/modules/server_add/helpers/server_add_theme.php +++ b/modules/server_add/helpers/server_add_theme.php @@ -24,20 +24,4 @@ static function head($theme) { . $theme->script("server_add.js"); } } - - static function admin_head($theme) { - $buf = ""; - if (strpos(Router::$current_uri, "admin/server_add") !== false) { - $buf .= $theme->css("server_add.css") - . $theme->css("jquery.autocomplete.css"); - $base = url::site("__ARGS__"); - $csrf = access::csrf_token(); - $buf .= ""; - - $buf .= $theme->script("jquery.autocomplete.js") - . $theme->script("admin.js"); - } - - return $buf; - } } \ No newline at end of file diff --git a/modules/server_add/js/admin.js b/modules/server_add/js/admin.js deleted file mode 100644 index 9d7bd1815a..0000000000 --- a/modules/server_add/js/admin.js +++ /dev/null @@ -1,8 +0,0 @@ -/** - * Set up autocomplete on the server path list - * - */ -$("document").ready(function() { - $("#g-path").autocomplete( - base_url.replace("__ARGS__", "admin/server_add/autocomplete"), {max: 256}); -}); diff --git a/modules/server_add/module.info b/modules/server_add/module.info index 87b317b136..4ce0a97d8e 100644 --- a/modules/server_add/module.info +++ b/modules/server_add/module.info @@ -1,3 +1,7 @@ name = "Server Add" description = "Allows authorized users to load images directly from your web server" version = 4 +author_name = "Gallery Team" +author_url = "http://codex.gallery2.org/Gallery:Team" +info_url = "http://codex.gallery2.org/Gallery3:Modules:server_add" +discuss_url = "http://gallery.menalto.com/forum_module_server_add" diff --git a/modules/server_add/views/admin_server_add.html.php b/modules/server_add/views/admin_server_add.html.php index 933ab7f837..474ad428ee 100644 --- a/modules/server_add/views/admin_server_add.html.php +++ b/modules/server_add/views/admin_server_add.html.php @@ -1,4 +1,18 @@ +css("server_add.css") ?> +css("jquery.autocomplete.css") ?> +script("jquery.autocomplete.js") ?> + +

    @@ -8,12 +22,17 @@
  • + $path): ?>
  • - " + ") ?>" id="icon_" - class="g-remove-dir g-button"> + class="g-remove-dir g-button"> + + + +
  • diff --git a/modules/slideshow/module.info b/modules/slideshow/module.info index b56eac814f..8c9a317634 100644 --- a/modules/slideshow/module.info +++ b/modules/slideshow/module.info @@ -1,3 +1,7 @@ name = "Slideshow" description = "Allows users to view a slideshow of photos" version = 2 +author_name = "Gallery Team" +author_url = "http://codex.gallery2.org/Gallery:Team" +info_url = "http://codex.gallery2.org/Gallery3:Modules:slideshow" +discuss_url = "http://gallery.menalto.com/forum_module_slideshow" diff --git a/modules/tag/controllers/admin_tags.php b/modules/tag/controllers/admin_tags.php index 73042a5577..7a64f7ab29 100644 --- a/modules/tag/controllers/admin_tags.php +++ b/modules/tag/controllers/admin_tags.php @@ -81,17 +81,26 @@ public function rename($id) { $in_place_edit = InPlaceEdit::factory($tag->name) ->action("admin/tags/rename/$tag->id") - ->rules(array("required", "length[1,64]")) - ->messages(array("in_use" => t("There is already a tag with that name"))) - ->callback(array($this, "check_for_duplicate")); + ->rules(array("required", "length[1,64]")); if ($in_place_edit->validate()) { $old_name = $tag->name; - $tag->name = $in_place_edit->value(); + $new_name_or_list = $in_place_edit->value(); + $tag_list = explode(",", $new_name_or_list); + $tag_count = count($tag_list); + + $tag->name = array_shift($tag_list); $tag->save(); - $message = t("Renamed tag %old_name to %new_name", - array("old_name" => $old_name, "new_name" => $tag->name)); + if (!empty($tag_list)) { + $this->_copy_items_for_tags($tag, $tag_list); + $message = t("Split tag %old_name into %tag_list", + array("old_name" => $old_name, "tag_list" => $new_name_or_list)); + } else { + $message = t("Renamed tag %old_name to %new_name", + array("old_name" => $old_name, "new_name" => $tag->name)); + } + message::success($message); log::success("tags", $message); @@ -101,12 +110,11 @@ public function rename($id) { } } - public function check_for_duplicate(Validation $post_data, $field) { - $tag_exists = ORM::factory("tag")->where("name", "=", $post_data[$field])->count_all(); - if ($tag_exists) { - $post_data->add_error($field, "in_use"); + private function _copy_items_for_tags($tag, $tag_list) { + foreach ($tag->items() as $item) { + foreach ($tag_list as $new_tag_name) { + tag::add($item, trim($new_tag_name)); + } } } - } - diff --git a/modules/tag/controllers/tags.php b/modules/tag/controllers/tags.php index fe6d747ba0..bf41c4df8e 100644 --- a/modules/tag/controllers/tags.php +++ b/modules/tag/controllers/tags.php @@ -22,7 +22,8 @@ public function index() { // Far from perfection, but at least require view permission for the root album $album = ORM::factory("item", 1); access::required("view", $album); - print tag::cloud(30); + + print tag::cloud(module::get_var("tag", "tag_cloud_size", 30)); } public function create($item_id) { diff --git a/modules/tag/helpers/tag.php b/modules/tag/helpers/tag.php index 733215b39f..c21104ee29 100644 --- a/modules/tag/helpers/tag.php +++ b/modules/tag/helpers/tag.php @@ -48,6 +48,7 @@ static function add($item, $tag_name) { * @return ORM_Iterator of Tag_Model in descending tag count order */ static function popular_tags($count) { + $count = max($count, 1); return ORM::factory("tag") ->order_by("count", "DESC") ->limit($count) diff --git a/modules/tag/helpers/tag_block.php b/modules/tag/helpers/tag_block.php index 8df58a6efb..69a9a1c4d4 100644 --- a/modules/tag/helpers/tag_block.php +++ b/modules/tag/helpers/tag_block.php @@ -30,7 +30,7 @@ static function get($block_id, $theme) { $block->css_id = "g-tag"; $block->title = t("Popular tags"); $block->content = new View("tag_block.html"); - $block->content->cloud = tag::cloud(30); + $block->content->cloud = tag::cloud(module::get_var("tag", "tag_cloud_size", 30)); if ($theme->item() && $theme->page_subtype() != "tag" && access::can("edit", $theme->item())) { $controller = new Tags_Controller(); diff --git a/modules/tag/helpers/tag_installer.php b/modules/tag/helpers/tag_installer.php index 16ad1239d7..66a78b9178 100644 --- a/modules/tag/helpers/tag_installer.php +++ b/modules/tag/helpers/tag_installer.php @@ -36,7 +36,8 @@ static function install() { KEY(`tag_id`, `id`), KEY(`item_id`, `id`)) DEFAULT CHARSET=utf8;"); - module::set_version("tag", 2); + module::set_var("tag", "tag_cloud_size", 30); + module::set_version("tag", 3); } static function upgrade($version) { @@ -45,6 +46,10 @@ static function upgrade($version) { $db->query("ALTER TABLE {tags} MODIFY COLUMN `name` VARCHAR(128)"); module::set_version("tag", $version = 2); } + if ($version == 2) { + module::set_var("tag", "tag_cloud_size", 30); + module::set_version("tag", $version = 3); + } } static function uninstall() { diff --git a/modules/tag/models/tag.php b/modules/tag/models/tag.php index bd6656676f..13e253ba43 100644 --- a/modules/tag/models/tag.php +++ b/modules/tag/models/tag.php @@ -69,15 +69,22 @@ public function items_count($type=null) { * to this tag. */ public function save() { - $related_item_ids = array(); - foreach (db::build() - ->select("item_id") - ->from("items_tags") - ->where("tag_id", "=", $this->id) - ->execute() as $row) { - $related_item_ids[$row->item_id] = 1; + // Check to see if another tag exists with the same name + $duplicate_tag = ORM::factory("tag") + ->where("name", "=", $this->name) + ->where("id", "!=", $this->id) + ->find(); + if ($duplicate_tag->loaded()) { + // If so, tag its items with this tag so as to merge it. + foreach ($duplicate_tag->items() as $item) { + $this->add($item); + } + + // ... and remove the duplicate tag + $duplicate_tag->delete(); } + // Figure out what items have changed in this tag for our item_related_update event below if (isset($this->object_relations["items"])) { $added = array_diff($this->changed_relations["items"], $this->object_relations["items"]); $removed = array_diff($this->object_relations["items"], $this->changed_relations["items"]); diff --git a/modules/tag/module.info b/modules/tag/module.info index 8851d1197c..75d16bf046 100644 --- a/modules/tag/module.info +++ b/modules/tag/module.info @@ -1,3 +1,7 @@ name = "Tags" description = "Allows users to tag photos and albums" -version = 2 +version = 3 +author_name = "Gallery Team" +author_url = "http://codex.gallery2.org/Gallery:Team" +info_url = "http://codex.gallery2.org/Gallery3:Modules:tag" +discuss_url = "http://gallery.menalto.com/forum_module_tag" diff --git a/modules/tag/tests/Tag_Test.php b/modules/tag/tests/Tag_Test.php index f5ccb3a2ec..9e10fa4aaf 100644 --- a/modules/tag/tests/Tag_Test.php +++ b/modules/tag/tests/Tag_Test.php @@ -18,18 +18,60 @@ * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ class Tag_Test extends Gallery_Unit_Test_Case { + public function teardown() { + ORM::factory("tag")->delete_all(); + } + public function create_tag_test() { $album = test::random_album(); tag::add($album, "tag1"); $tag = ORM::factory("tag")->where("name", "=", "tag1")->find(); - $this->assert_true(1, $tag->count); + $this->assert_equal(1, $tag->count); // Make sure adding the tag again doesn't increase the count tag::add($album, "tag1"); - $this->assert_true(1, $tag->reload()->count); + $this->assert_equal(1, $tag->reload()->count); tag::add(test::random_album(), "tag1"); - $this->assert_true(2, $tag->reload()->count); + $this->assert_equal(2, $tag->reload()->count); + } + + public function rename_merge_tag_test() { + $album1 = test::random_album(); + $album2 = test::random_album(); + + tag::add($album1, "tag1"); + tag::add($album2, "tag2"); + + $tag1 = ORM::factory("tag")->where("name", "=", "tag1")->find(); + $tag1->name = "tag2"; + $tag1->save(); + + // Tags should be merged; $tag2 should be deleted + $tag1->reload(); + + $this->assert_equal(2, $tag1->count); + $this->assert_true($tag1->has($album1)); + $this->assert_true($tag1->has($album2)); + $this->assert_equal(1, ORM::factory("tag")->count_all()); + } + + public function rename_merge_tag_with_same_items_test() { + $album = test::random_album(); + + tag::add($album, "tag1"); + tag::add($album, "tag2"); + + $tag1 = ORM::factory("tag")->where("name", "=", "tag1")->find(); + $tag1->name = "tag2"; + $tag1->save(); + + // Tags should be merged + $tag1->reload(); + + $this->assert_equal(1, $tag1->count); + $this->assert_true($tag1->has($album)); + $this->assert_equal(1, ORM::factory("tag")->count_all()); } -} \ No newline at end of file +} diff --git a/modules/user/controllers/password.php b/modules/user/controllers/password.php index 4e93d5ce84..cd46bbed24 100644 --- a/modules/user/controllers/password.php +++ b/modules/user/controllers/password.php @@ -105,7 +105,7 @@ private function _new_password_form($hash=null) { if (!empty($hash)) { $hidden->value($hash); } - $minimum_length = module::get_var("user", "mininum_password_length", 5); + $minimum_length = module::get_var("user", "minimum_password_length", 5); $input_password = $group->password("password")->label(t("Password"))->id("g-password") ->rules($minimum_length ? "required|length[$minimum_length, 40]" : "length[40]"); $group->password("password2")->label(t("Confirm Password"))->id("g-password2") diff --git a/modules/user/helpers/user_installer.php b/modules/user/helpers/user_installer.php index b889af49a7..9b58277317 100644 --- a/modules/user/helpers/user_installer.php +++ b/modules/user/helpers/user_installer.php @@ -24,6 +24,7 @@ static function can_activate() { static function install() { IdentityProvider::change_provider("user"); + // Set the latest version in initialize() below } static function upgrade($version) { @@ -44,6 +45,13 @@ static function upgrade($version) { ->execute(); module::set_version("user", $version = 3); } + + if ($version == 3) { + $password_length = module::get_var("user", "mininum_password_length", 5); + module::set_var("user", "minimum_password_length", $password_length); + module::clear_var("user", "mininum_password_length"); + module::set_version("user", $version = 4); + } } static function uninstall() { @@ -129,7 +137,7 @@ static function initialize() { access::allow($registered, "view", $root); access::allow($registered, "view_full", $root); - module::set_var("user", "mininum_password_length", 5); - module::set_version("user", 3); + module::set_var("user", "minimum_password_length", 5); + module::set_version("user", 4); } } \ No newline at end of file diff --git a/modules/user/models/user.php b/modules/user/models/user.php index 145738ca31..a8a3a0e743 100644 --- a/modules/user/models/user.php +++ b/modules/user/models/user.php @@ -147,7 +147,7 @@ public function valid_password(Validation $v, $field) { } if (!$this->loaded() || isset($this->password_length)) { - $minimum_length = module::get_var("user", "mininum_password_length", 5); + $minimum_length = module::get_var("user", "minimum_password_length", 5); if ($this->password_length < $minimum_length) { $v->add_error("password", "min_length"); } diff --git a/modules/user/module.info b/modules/user/module.info index 185a3e3af1..503bcd0d5b 100644 --- a/modules/user/module.info +++ b/modules/user/module.info @@ -1,4 +1,8 @@ name = "Users and Groups" description = "Gallery 3 user and group management" -version = 3 +version = 4 +author_name = "Gallery Team" +author_url = "http://codex.gallery2.org/Gallery:Team" +info_url = "http://codex.gallery2.org/Gallery3:Modules:user" +discuss_url = "http://gallery.menalto.com/forum_module_user" diff --git a/modules/watermark/module.info b/modules/watermark/module.info index 41a871bdda..58efa43f13 100644 --- a/modules/watermark/module.info +++ b/modules/watermark/module.info @@ -1,3 +1,7 @@ name = "Watermarks" description = "Allows users to watermark their photos" version = 2 +author_name = "Gallery Team" +author_url = "http://codex.gallery2.org/Gallery:Team" +info_url = "http://codex.gallery2.org/Gallery3:Modules:watermark" +discuss_url = "http://gallery.menalto.com/forum_module_watermark" diff --git a/themes/admin_wind/css/screen.css b/themes/admin_wind/css/screen.css index a5376ff6bb..f01c2a94ed 100644 --- a/themes/admin_wind/css/screen.css +++ b/themes/admin_wind/css/screen.css @@ -26,7 +26,10 @@ body, html { font-family: 'Lucida Grande', 'Lucida Sans', Arial, sans-serif; } -p { +p, +#g-content ul, +#g-content ol, +#g-content dl { margin-bottom: 1em; } @@ -87,7 +90,29 @@ a:hover, text-decoration: none; } +/* Lists ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ + +#g-content ul li { + list-style-type: disc; + margin-left: 1em; +} + +form ul li, +#g-action-status li, +#g-log-entries li, +#g-tag-admin li, +.g-buttonset li, +.g-buttonset-vertical li, +.g-paginator li, +.ui-sortable li, +.ui-widget-header li { + list-style: none !important; + margin-left: 0 !important; +} + + /* Forms ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ + form { margin: 0; } @@ -296,6 +321,7 @@ th { } /* Text ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ + .g-text-small { font-size: .8em; } @@ -333,10 +359,6 @@ th { padding: 0; } -#g-sidebar .g-block-content { - padding: 0; -} - #g-content .g-selected, #g-content .g-available .g-block { border: 1px solid #ccc; @@ -399,15 +421,12 @@ th { background-color: #fff; } -ul.enumeration li { - list-style-type: disc; - margin-left: 20px; -} - /*** ****************************************************************** * 3) Page layout containers *********************************************************************/ + /* Dimension and scale ~~~~~~~~~~~~~~~~~~~ */ + .g-one-quarter { width: 25%; } @@ -602,11 +621,13 @@ ul.enumeration li { } /* In-line editing ~~~~~~~~~~~~~~~~~~~~~~ */ + #g-in-place-edit-message { background-color: #FFF; } -/* Language options ~~~~~~~~~~~~~~~~~~~~~~~~ */ +/* Language options ~~~~~~~~~~~~~~~~~~~~~ */ + #g-share-translations-form fieldset { border: 0px; margin: 0px; @@ -703,11 +724,11 @@ tr.g-error td.g-error, } tr.g-success { - background-image: none; + background-image: none; } tr.g-success td.g-success { - background-image: url('../images/ico-success.png'); + background-image: url('../images/ico-success.png'); } .g-warning, @@ -731,8 +752,8 @@ form .g-error { } .g-default { - background-color: #c5dbec; - font-weight: bold; + background-color: #c5dbec; + font-weight: bold; } .g-draggable { @@ -810,6 +831,7 @@ form .g-error { /** ******************************************************************* * 8) jQuery and jQuery UI *********************************************************************/ + /* Generic block container ~~~~~~~~~~~~~~~ */ .g-block { @@ -993,18 +1015,19 @@ div#g-action-status { } /* Superfish menu overrides ~~~~~~~~~~~~~~ */ + .sf-menu ul { - width: 12em; + width: 12em; } ul.sf-menu li li:hover ul, ul.sf-menu li li.sfHover ul { - left: 12em; + left: 12em; } ul.sf-menu li li li:hover ul, ul.sf-menu li li li.sfHover ul { - left: 12em; + left: 12em; } @@ -1018,6 +1041,7 @@ ul.sf-menu li li li.sfHover ul { } /* jQuery UI Dialog ~~~~~~~~~~~~~~~~~~~~~~ */ + .ui-widget-overlay { background: #000; opacity: .7; @@ -1041,6 +1065,7 @@ ul.sf-menu li li li.sfHover ul { /** ******************************************************************* * 9) Right to left styles *********************************************************************/ + .rtl { direction: rtl; } @@ -1112,7 +1137,7 @@ ul.sf-menu li li li.sfHover ul { } .rtl .g-breadcrumbs li { - background: transparent url('..images/ico-separator-rtl.gif') no-repeat scroll right center; + background: transparent url('../images/ico-separator-rtl.gif') no-repeat scroll right center; padding: 1em 18px 1em 8px; } @@ -1139,149 +1164,154 @@ ul.sf-menu li li li.sfHover ul { } /* RTL Corner radius ~~~~~~~~~~~~~~~~~~~~~~ */ + .rtl .g-buttonset .ui-corner-tl { - -moz-border-radius-topleft: 0; - -webkit-border-top-left-radius: 0; - border-top-left-radius: 0; - -moz-border-radius-topright: 5px !important; - -webkit-border-top-right-radius: 5px !important; - border-top-right-radius: 5px !important; + -moz-border-radius-topleft: 0; + -webkit-border-top-left-radius: 0; + border-top-left-radius: 0; + -moz-border-radius-topright: 5px !important; + -webkit-border-top-right-radius: 5px !important; + border-top-right-radius: 5px !important; } .rtl .g-buttonset .ui-corner-tr { - -moz-border-radius-topright: 0; - -webkit-border-top-right-radius: 0; - border-top-right-radius: 0; - -moz-border-radius-topleft: 5px !important; - -webkit-border-top-left-radius: 5px !important; - border-top-left-radius: 5px !important; + -moz-border-radius-topright: 0; + -webkit-border-top-right-radius: 0; + border-top-right-radius: 0; + -moz-border-radius-topleft: 5px !important; + -webkit-border-top-left-radius: 5px !important; + border-top-left-radius: 5px !important; } .rtl .g-buttonset .ui-corner-bl { - -moz-border-radius-bottomleft: 0; - -webkit-border-bottom-left-radius: 0; - border-bottom-left-radius: 0; - -moz-border-radius-bottomright: 5px !important; - -webkit-border-bottom-right-radius: 5px !important; - border-bottom-right-radius: 5px !important; + -moz-border-radius-bottomleft: 0; + -webkit-border-bottom-left-radius: 0; + border-bottom-left-radius: 0; + -moz-border-radius-bottomright: 5px !important; + -webkit-border-bottom-right-radius: 5px !important; + border-bottom-right-radius: 5px !important; } .rtl .g-buttonset .ui-corner-br { - -moz-border-radius-bottomright: 0; - -webkit-border-bottom-right-radius: 0; - border-bottom-right-radius: 0; - -moz-border-radius-bottomleft: 5px !important; - -webkit-border-bottom-left-radius: 5px !important; - border-bottom-left-radius: 5px !important; + -moz-border-radius-bottomright: 0; + -webkit-border-bottom-right-radius: 0; + border-bottom-right-radius: 0; + -moz-border-radius-bottomleft: 5px !important; + -webkit-border-bottom-left-radius: 5px !important; + border-bottom-left-radius: 5px !important; } .rtl .g-buttonset .ui-corner-right, .rtl .ui-progressbar .ui-corner-right { - -moz-border-radius-topright: 0; - -webkit-border-top-right-radius: 0; - border-top-right-radius: 0; - -moz-border-radius-topleft: 5px !important; - -webkit-border-top-left-radius: 5px !important; - border-top-left-radius: 5px !important; - -moz-border-radius-bottomright: 0; - -webkit-border-bottom-right-radius: 0; - border-bottom-right-radius: 0; - -moz-border-radius-bottomleft: 5px !important; - -webkit-border-bottom-left-radius: 5px !important; - border-bottom-left-radius: 5px !important; + -moz-border-radius-topright: 0; + -webkit-border-top-right-radius: 0; + border-top-right-radius: 0; + -moz-border-radius-topleft: 5px !important; + -webkit-border-top-left-radius: 5px !important; + border-top-left-radius: 5px !important; + -moz-border-radius-bottomright: 0; + -webkit-border-bottom-right-radius: 0; + border-bottom-right-radius: 0; + -moz-border-radius-bottomleft: 5px !important; + -webkit-border-bottom-left-radius: 5px !important; + border-bottom-left-radius: 5px !important; } .rtl .g-buttonset .ui-corner-left, .rtl .ui-progressbar .ui-corner-left { - -moz-border-radius-topleft: 0; - -webkit-border-top-left-radius: 0; - border-top-left-radius: 0; - -moz-border-radius-topright: 5px !important; - -webkit-border-top-right-radius: 5px !important; - border-top-right-radius: 5px !important; - -moz-border-radius-bottomleft: 0; - -webkit-border-bottom-left-radius: 0; - border-bottom-left-radius: 0; - -moz-border-radius-bottomright: 5px !important; - -webkit-border-bottom-right-radius: 5px !important; - border-bottom-right-radius: 5px !important; + -moz-border-radius-topleft: 0; + -webkit-border-top-left-radius: 0; + border-top-left-radius: 0; + -moz-border-radius-topright: 5px !important; + -webkit-border-top-right-radius: 5px !important; + border-top-right-radius: 5px !important; + -moz-border-radius-bottomleft: 0; + -webkit-border-bottom-left-radius: 0; + border-bottom-left-radius: 0; + -moz-border-radius-bottomright: 5px !important; + -webkit-border-bottom-right-radius: 5px !important; + border-bottom-right-radius: 5px !important; } /* RTL Superfish ~~~~~~~~~~~~~~~~~~~~~~~~~ */ .rtl .sf-menu a { - border-left: none; - border-right:1px solid #fff; + border-left: none; + border-right:1px solid #fff; } .rtl .sf-menu a.sf-with-ul { - padding-left: 2.25em; - padding-right: 1em; + padding-left: 2.25em; + padding-right: 1em; } .rtl .sf-sub-indicator { - left: .75em !important; - right: auto; - background: url('../../../lib/superfish/images/arrows-ffffff-rtl.png') no-repeat -10px -100px; /* 8-bit indexed alpha png. IE6 gets solid image only */ + left: .75em !important; + right: auto; + background: url('../../../lib/superfish/images/arrows-ffffff-rtl.png') no-repeat -10px -100px; } -.rtl a > .sf-sub-indicator { /* give all except IE6 the correct values */ - top: .8em; - background-position: -10px -100px; /* use translucent arrow for modern browsers*/ + +.rtl a > .sf-sub-indicator { + top: .8em; + background-position: -10px -100px; } -/* apply hovers to modern browsers */ + .rtl a:focus > .sf-sub-indicator, .rtl a:hover > .sf-sub-indicator, .rtl a:active > .sf-sub-indicator, .rtl li:hover > a > .sf-sub-indicator, .rtl li.sfHover > a > .sf-sub-indicator { - background-position: 0 -100px; /* arrow hovers for modern browsers*/ + background-position: 0 -100px; +} + +.rtl .sf-menu ul .sf-sub-indicator { + background-position: 0 0; +} + +.rtl .sf-menu ul a > .sf-sub-indicator { + background-position: -10px 0; } -/* point right for anchors in subs */ -.rtl .sf-menu ul .sf-sub-indicator { background-position: 0 0; } -.rtl .sf-menu ul a > .sf-sub-indicator { background-position: -10px 0; } -/* apply hovers to modern browsers */ .rtl .sf-menu ul a:focus > .sf-sub-indicator, .rtl .sf-menu ul a:hover > .sf-sub-indicator, .rtl .sf-menu ul a:active > .sf-sub-indicator, .rtl .sf-menu ul li:hover > a > .sf-sub-indicator, .rtl .sf-menu ul li.sfHover > a > .sf-sub-indicator { - background-position: 0 0; /* arrow hovers for modern browsers*/ + background-position: 0 0; } .rtl .sf-menu li:hover ul, .rtl .sf-menu li.sfHover ul { - right: 0; - left: auto; + right: 0; + left: auto; } .rtl ul.sf-menu li li:hover ul, .rtl ul.sf-menu li li.sfHover ul { - right: 12em; /* match ul width */ - left: auto; + right: 12em; + left: auto; } .rtl ul.sf-menu li li li:hover ul, .rtl ul.sf-menu li li li.sfHover ul { - right: 12em; /* match ul width */ - left: auto; + right: 12em; + left: auto; } -/*** shadows for all but IE6 ***/ .rtl .sf-shadow ul { - background: url('../../../lib/superfish/images/shadow.png') no-repeat bottom left; - padding: 0 0 9px 8px; - border-top-right-radius: 0; - border-bottom-left-radius: 0; - -moz-border-radius-topright: 0; - -moz-border-radius-bottomleft: 0; - -webkit-border-top-right-radius: 0; - -webkit-border-bottom-left-radius: 0; - -moz-border-radius-topleft: 17px; - -moz-border-radius-bottomright: 17px; - -webkit-border-top-left-radius: 17px; - -webkit-border-bottom-right-radius: 17px; - border-top-left-radius: 17px; - border-bottom-right-radius: 17px; + background: url('../../../lib/superfish/images/shadow.png') no-repeat bottom left; + padding: 0 0 9px 8px; + border-top-right-radius: 0; + border-bottom-left-radius: 0; + -moz-border-radius-topright: 0; + -moz-border-radius-bottomleft: 0; + -webkit-border-top-right-radius: 0; + -webkit-border-bottom-left-radius: 0; + -moz-border-radius-topleft: 17px; + -moz-border-radius-bottomright: 17px; + -webkit-border-top-left-radius: 17px; + -webkit-border-bottom-right-radius: 17px; + border-top-left-radius: 17px; + border-bottom-right-radius: 17px; } /* RTL ThemeRoller ~~~~~~~~~~~~~~~~~~~~~~~~ */ @@ -1331,6 +1361,11 @@ ul.sf-menu li li li.sfHover ul { padding-right: 1.2em; } +.rtl #g-sidebar .g-block-content { + padding-left: 0em; + padding-right: 1em; +} + .rtl .g-selected img, .rtl .g-available .g-block img { margin: 0 0 1em 1em; diff --git a/themes/admin_wind/theme.info b/themes/admin_wind/theme.info index 4034b64a85..466d8e434d 100644 --- a/themes/admin_wind/theme.info +++ b/themes/admin_wind/theme.info @@ -4,3 +4,7 @@ version = 1 author = "Gallery Team" admin = 1 site = 0 +author_name = "Gallery Team" +author_url = "http://codex.gallery2.org/Gallery:Team" +info_url = "http://codex.gallery2.org/Gallery3:Themes:admin_wind" +discuss_url = "http://gallery.menalto.com/forum_theme_admin_wind" diff --git a/themes/admin_wind/views/admin.html.php b/themes/admin_wind/views/admin.html.php index 12301e0293..65473e5742 100644 --- a/themes/admin_wind/views/admin.html.php +++ b/themes/admin_wind/views/admin.html.php @@ -39,7 +39,7 @@ css("superfish/css/superfish.css") ?> css("screen.css") ?> diff --git a/themes/wind/css/screen.css b/themes/wind/css/screen.css index a49b8c2851..b470ab1c8b 100644 --- a/themes/wind/css/screen.css +++ b/themes/wind/css/screen.css @@ -106,12 +106,13 @@ a:hover, } #g-dialog #g-action-status li { - width: 400px; + width: 434px; white-space: normal; padding-left: 32px; } /* Forms ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ + form { margin: 0; } @@ -302,6 +303,7 @@ td { } /* Text ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ + .g-text-small { font-size: .8em; } @@ -332,6 +334,7 @@ td { *********************************************************************/ /* Dimension and scale ~~~~~~~~~~~~~~~~~~~ */ + .g-one-quarter { width: 25%; } @@ -523,7 +526,8 @@ td { background-color: #fff; } -/* Permissions ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ +/* Permissions ~~~~~~~~~~~~~~~~~~~~~~~~~~~ */ + #g-edit-permissions-form td { background-image: none; } @@ -635,11 +639,11 @@ tr.g-error td.g-error, } tr.g-success { - background-image: none; + background-image: none; } tr.g-success td.g-success { - background-image: url('../images/ico-success.png'); + background-image: url('../images/ico-success.png'); } .g-warning, @@ -823,6 +827,7 @@ form .g-error { /** ******************************************************************* * 8) jQuery and jQuery UI *********************************************************************/ + /* Generic block container ~~~~~~~~~~~~~~~ */ .g-block { @@ -834,18 +839,19 @@ form .g-error { } /* Superfish menu overrides ~~~~~~~~~~~~~~ */ + .sf-menu ul { - width: 12em; + width: 12em; } ul.sf-menu li li:hover ul, ul.sf-menu li li.sfHover ul { - left: 12em; + left: 12em; } ul.sf-menu li li li:hover ul, ul.sf-menu li li li.sfHover ul { - left: 12em; + left: 12em; } .sf-menu li li, @@ -1037,6 +1043,7 @@ div#g-action-status { } /* Autocomplete ~~~~~~~~~~ */ + .ac_loading { background: white url('../images/loading-small.gif') right center no-repeat !important; } @@ -1143,149 +1150,154 @@ div#g-action-status { } /* RTL Corner radius ~~~~~~~~~~~~~~~~~~~~~~ */ + .rtl .g-buttonset .ui-corner-tl { - -moz-border-radius-topleft: 0; - -webkit-border-top-left-radius: 0; - border-top-left-radius: 0; - -moz-border-radius-topright: 5px !important; - -webkit-border-top-right-radius: 5px !important; - border-top-right-radius: 5px !important; + -moz-border-radius-topleft: 0; + -webkit-border-top-left-radius: 0; + border-top-left-radius: 0; + -moz-border-radius-topright: 5px !important; + -webkit-border-top-right-radius: 5px !important; + border-top-right-radius: 5px !important; } .rtl .g-buttonset .ui-corner-tr { - -moz-border-radius-topright: 0; - -webkit-border-top-right-radius: 0; - border-top-right-radius: 0; - -moz-border-radius-topleft: 5px !important; - -webkit-border-top-left-radius: 5px !important; - border-top-left-radius: 5px !important; + -moz-border-radius-topright: 0; + -webkit-border-top-right-radius: 0; + border-top-right-radius: 0; + -moz-border-radius-topleft: 5px !important; + -webkit-border-top-left-radius: 5px !important; + border-top-left-radius: 5px !important; } .rtl .g-buttonset .ui-corner-bl { - -moz-border-radius-bottomleft: 0; - -webkit-border-bottom-left-radius: 0; - border-bottom-left-radius: 0; - -moz-border-radius-bottomright: 5px !important; - -webkit-border-bottom-right-radius: 5px !important; - border-bottom-right-radius: 5px !important; + -moz-border-radius-bottomleft: 0; + -webkit-border-bottom-left-radius: 0; + border-bottom-left-radius: 0; + -moz-border-radius-bottomright: 5px !important; + -webkit-border-bottom-right-radius: 5px !important; + border-bottom-right-radius: 5px !important; } .rtl .g-buttonset .ui-corner-br { - -moz-border-radius-bottomright: 0; - -webkit-border-bottom-right-radius: 0; - border-bottom-right-radius: 0; - -moz-border-radius-bottomleft: 5px !important; - -webkit-border-bottom-left-radius: 5px !important; - border-bottom-left-radius: 5px !important; + -moz-border-radius-bottomright: 0; + -webkit-border-bottom-right-radius: 0; + border-bottom-right-radius: 0; + -moz-border-radius-bottomleft: 5px !important; + -webkit-border-bottom-left-radius: 5px !important; + border-bottom-left-radius: 5px !important; } .rtl .g-buttonset .ui-corner-right, .rtl .ui-progressbar .ui-corner-right { - -moz-border-radius-topright: 0; - -webkit-border-top-right-radius: 0; - border-top-right-radius: 0; - -moz-border-radius-topleft: 5px !important; - -webkit-border-top-left-radius: 5px !important; - border-top-left-radius: 5px !important; - -moz-border-radius-bottomright: 0; - -webkit-border-bottom-right-radius: 0; - border-bottom-right-radius: 0; - -moz-border-radius-bottomleft: 5px !important; - -webkit-border-bottom-left-radius: 5px !important; - border-bottom-left-radius: 5px !important; + -moz-border-radius-topright: 0; + -webkit-border-top-right-radius: 0; + border-top-right-radius: 0; + -moz-border-radius-topleft: 5px !important; + -webkit-border-top-left-radius: 5px !important; + border-top-left-radius: 5px !important; + -moz-border-radius-bottomright: 0; + -webkit-border-bottom-right-radius: 0; + border-bottom-right-radius: 0; + -moz-border-radius-bottomleft: 5px !important; + -webkit-border-bottom-left-radius: 5px !important; + border-bottom-left-radius: 5px !important; } .rtl .g-buttonset .ui-corner-left, .rtl .ui-progressbar .ui-corner-left { - -moz-border-radius-topleft: 0; - -webkit-border-top-left-radius: 0; - border-top-left-radius: 0; - -moz-border-radius-topright: 5px !important; - -webkit-border-top-right-radius: 5px !important; - border-top-right-radius: 5px !important; - -moz-border-radius-bottomleft: 0; - -webkit-border-bottom-left-radius: 0; - border-bottom-left-radius: 0; - -moz-border-radius-bottomright: 5px !important; - -webkit-border-bottom-right-radius: 5px !important; - border-bottom-right-radius: 5px !important; + -moz-border-radius-topleft: 0; + -webkit-border-top-left-radius: 0; + border-top-left-radius: 0; + -moz-border-radius-topright: 5px !important; + -webkit-border-top-right-radius: 5px !important; + border-top-right-radius: 5px !important; + -moz-border-radius-bottomleft: 0; + -webkit-border-bottom-left-radius: 0; + border-bottom-left-radius: 0; + -moz-border-radius-bottomright: 5px !important; + -webkit-border-bottom-right-radius: 5px !important; + border-bottom-right-radius: 5px !important; } /* RTL Superfish ~~~~~~~~~~~~~~~~~~~~~~~~~ */ .rtl .sf-menu a { - border-left: none; - border-right:1px solid #fff; + border-left: none; + border-right:1px solid #fff; } .rtl .sf-menu a.sf-with-ul { - padding-left: 2.25em; - padding-right: 1em; + padding-left: 2.25em; + padding-right: 1em; } .rtl .sf-sub-indicator { - left: .75em !important; - right: auto; - background: url('../../../lib/superfish/images/arrows-ffffff-rtl.png') no-repeat -10px -100px; /* 8-bit indexed alpha png. IE6 gets solid image only */ + left: .75em !important; + right: auto; + background: url('../../../lib/superfish/images/arrows-ffffff-rtl.png') no-repeat -10px -100px; } -.rtl a > .sf-sub-indicator { /* give all except IE6 the correct values */ - top: .8em; - background-position: -10px -100px; /* use translucent arrow for modern browsers*/ + +.rtl a > .sf-sub-indicator { + top: .8em; + background-position: -10px -100px; } -/* apply hovers to modern browsers */ + .rtl a:focus > .sf-sub-indicator, .rtl a:hover > .sf-sub-indicator, .rtl a:active > .sf-sub-indicator, .rtl li:hover > a > .sf-sub-indicator, .rtl li.sfHover > a > .sf-sub-indicator { - background-position: 0 -100px; /* arrow hovers for modern browsers*/ + background-position: 0 -100px; +} + +.rtl .sf-menu ul .sf-sub-indicator { + background-position: 0 0; +} + +.rtl .sf-menu ul a > .sf-sub-indicator { + background-position: -10px 0; } -/* point right for anchors in subs */ -.rtl .sf-menu ul .sf-sub-indicator { background-position: 0 0; } -.rtl .sf-menu ul a > .sf-sub-indicator { background-position: -10px 0; } -/* apply hovers to modern browsers */ .rtl .sf-menu ul a:focus > .sf-sub-indicator, .rtl .sf-menu ul a:hover > .sf-sub-indicator, .rtl .sf-menu ul a:active > .sf-sub-indicator, .rtl .sf-menu ul li:hover > a > .sf-sub-indicator, .rtl .sf-menu ul li.sfHover > a > .sf-sub-indicator { - background-position: 0 0; /* arrow hovers for modern browsers*/ + background-position: 0 0; } .rtl .sf-menu li:hover ul, .rtl .sf-menu li.sfHover ul { - right: 0; - left: auto; + right: 0; + left: auto; } .rtl ul.sf-menu li li:hover ul, .rtl ul.sf-menu li li.sfHover ul { - right: 12em; /* match ul width */ - left: auto; + right: 12em; + left: auto; } .rtl ul.sf-menu li li li:hover ul, .rtl ul.sf-menu li li li.sfHover ul { - right: 12em; /* match ul width */ - left: auto; + right: 12em; + left: auto; } -/*** shadows for all but IE6 ***/ .rtl .sf-shadow ul { - background: url('../../../lib/superfish/images/shadow.png') no-repeat bottom left; - padding: 0 0 9px 8px; - border-top-right-radius: 0; - border-bottom-left-radius: 0; - -moz-border-radius-topright: 0; - -moz-border-radius-bottomleft: 0; - -webkit-border-top-right-radius: 0; - -webkit-border-bottom-left-radius: 0; - -moz-border-radius-topleft: 17px; - -moz-border-radius-bottomright: 17px; - -webkit-border-top-left-radius: 17px; - -webkit-border-bottom-right-radius: 17px; - border-top-left-radius: 17px; - border-bottom-right-radius: 17px; + background: url('../../../lib/superfish/images/shadow.png') no-repeat bottom left; + padding: 0 0 9px 8px; + border-top-right-radius: 0; + border-bottom-left-radius: 0; + -moz-border-radius-topright: 0; + -moz-border-radius-bottomleft: 0; + -webkit-border-top-right-radius: 0; + -webkit-border-bottom-left-radius: 0; + -moz-border-radius-topleft: 17px; + -moz-border-radius-bottomright: 17px; + -webkit-border-top-left-radius: 17px; + -webkit-border-bottom-right-radius: 17px; + border-top-left-radius: 17px; + border-bottom-right-radius: 17px; } /* RTL ThemeRoller ~~~~~~~~~~~~~~~~~~~~~~~~ */ diff --git a/themes/wind/theme.info b/themes/wind/theme.info index 17ea7c205a..e0be78b977 100644 --- a/themes/wind/theme.info +++ b/themes/wind/theme.info @@ -4,3 +4,7 @@ version = 1 author = "Gallery Team" site = 1 admin = 0 +author_name = "Gallery Team" +author_url = "http://codex.gallery2.org/Gallery:Team" +info_url = "http://codex.gallery2.org/Gallery3:Themes:wind" +discuss_url = "http://gallery.menalto.com/forum_theme_wind"