diff --git a/oc454/apps/files_sharing_widget/js/widget.full.js b/oc454/apps/files_sharing_widget/js/widget.full.js index f9b77c3..3f497ec 100644 --- a/oc454/apps/files_sharing_widget/js/widget.full.js +++ b/oc454/apps/files_sharing_widget/js/widget.full.js @@ -50,7 +50,11 @@ // if($.browser.msie && $.browser.version<9){ //widgetContainer.css('opacity',0.3); // } - OwnWidget.init(ownWidgetOptions); + if(ownWidgetOptions.showButtonLink!=undefined){ + OwnWidget.prepareExternLink(ownWidgetOptions); + }else{ + if($("#ownWidget-container").length>0) OwnWidget.init(ownWidgetOptions); + } }); } @@ -61,6 +65,9 @@ var OwnWidget={ crypt:'', path:'', appspath:'apps', + showButtonLink:'', + customThumbHeight:'', + customThumbpPage:'', display:'', fbAppid:'', modal:true, @@ -83,9 +90,21 @@ var OwnWidget={ } else { this.showWidget(); } - this.initSupersized() + this.initSupersized(); + + }, + prepareExternLink:function(options){ + var self=this; + + if(options.showButtonLink!=''){ + jQuery('#'+options.showButtonLink).click(function(){ + clearTimeout(timeout); + var timeout=setTimeout(function(){self.init(options);}, 500); + + + }); + } }, - loadCssFile:function(){ if(jQuery('#ownWidgetCss').length<1){ jQuery("", {id:'ownWidgetCss',rel : "stylesheet",type : "text/css",href :this.options.path + this.options.appspath+ "/files_sharing_widget/css/widget.css"}).appendTo("head"); @@ -206,10 +225,16 @@ var OwnWidget={ loadData:function() { var self = this; + var addCustomThumbSize=''; + if(this.options.customThumbHeight!='') addCustomThumbSize='&cTh='+this.options.customThumbHeight; + + var addCustomThumbPage=''; + if(this.options.customThumbpPage!='') addCustomThumbPage='&cTpP='+this.options.customThumbpPage; + //customThumbpPage jQuery.ajax({ dataType : "jsonp", jsonp : "jsonp_callback", - url : self.options.path + "widget.php?iToken=" + rawurlencode(self.options.crypt) + self.loadPage, + url : self.options.path + "widget.php?iToken=" + rawurlencode(self.options.crypt) + self.loadPage+addCustomThumbSize+addCustomThumbPage, success : function(data) { @@ -241,6 +266,7 @@ var OwnWidget={ self.widgetContainer.css(self.options.cssAddWidget); if (!self.options.cssAddWidget.top && !self.options.cssAddWidget.left) { + self.widgetContainer.css({ top : (jQuery(window).height() / 2) - (self.widgetContainer.height() / 2), left : (jQuery(window).width() / 2) - (self.widgetContainer.width() / 2) diff --git a/oc454/apps/files_sharing_widget/js/widget.js b/oc454/apps/files_sharing_widget/js/widget.js index b8b9c33..000bab9 100644 --- a/oc454/apps/files_sharing_widget/js/widget.js +++ b/oc454/apps/files_sharing_widget/js/widget.js @@ -6,4 +6,4 @@ * * */ -(function(){var d;if(window.jQuery===undefined||window.jQuery.fn.jquery!=="1.8.2"){var e=document.createElement("script");e.setAttribute("type","text/javascript");e.setAttribute("src",ownWidgetOptions.path+ownWidgetOptions.appspath+"/files_sharing_widget/js/jquery-pack.min.js");if(e.readyState){e.onreadystatechange=function(){if(this.readyState=="complete"||this.readyState=="loaded"){b()}}}else{e.onload=b}(document.getElementsByTagName("head")[0]||document.documentElement).appendChild(e)}else{d=window.jQuery;a()}function b(){d=window.jQuery.noConflict(true);a()}function f(g){g=(g+"").toString();return encodeURIComponent(g).replace(/!/g,"%21").replace(/'/g,"%27").replace(/\(/g,"%28").replace(/\)/g,"%29").replace(/\*/g,"%2A")}function a(){d(document).ready(function(g){c.init(ownWidgetOptions)})}var c={init:function(g){var h={crypt:"",path:"",appspath:"apps",display:"",fbAppid:"",modal:true,cssAddWidget:{width:1000,height:560},cssAddButton:{top:20,left:20},buttonlabel:"Fotogalerie"};this.options=d.extend(true,h,g);this.loadCssFile();this.imageSlide=[];this.loadPage="";this.widgetContainer=d("#ownWidget-container");this.firstShow=true;if(this.options.fbAppid!=""){this.loginToFacebookApp()}if(this.options.display=="hidden"){this.createShowButton()}else{this.showWidget()}this.initSupersized()},loadCssFile:function(){if(d("#ownWidgetCss").length<1){d("",{id:"ownWidgetCss",rel:"stylesheet",type:"text/css",href:this.options.path+this.options.appspath+"/files_sharing_widget/css/widget.css"}).appendTo("head")}},createShowButton:function(){self=this;this.widgetContainer.hide();if(this.options.modal){this.overlay=d('
').appendTo("body")}this.addWidgetControls();var g=d('
'+this.options.buttonlabel+"
");g.css(this.options.cssAddButton);g.appendTo("body");g.click(function(){if(self.options.modal){self.overlay.height(d(window).height());self.overlay.width(d(window).width());self.overlay.animate({opacity:0.5},500,function(){self.loadData()})}else{self.loadData()}})},showWidget:function(){this.widgetContainer.hide();this.addWidgetControls();this.loadData()},addWidgetControls:function(){var g=this;if(this.options.display=="hidden"){var i=d('
X
');this.widgetContainer.prepend(i)}this.widgetContainer.prepend('
');var h=d('
Slideshow
');this.widgetContainer.prepend(h);d("#SlideShowButton").click(function(){g.widgetContainer.animate({opacity:"toggle"},500,function(){d("body").append("
");d("#supersized-loader").remove();d("#supersized").remove();d("#supersized-holder").append("
");d("#supersized").show();d("#slideshow-content").animate({opacity:"toggle"});d("a[rel=fancyArea]").each(function(j,k){g.imageSlide.push({image:k.href,title:k.title.replace(//,">"),thumb:k.children[0].src})});g.loadSupersized()})});d("#SlideShowButton").hide();if(this.options.display=="hidden"){i.click(function(){g.widgetContainer.animate({opacity:"toggle"},500,function(){if(g.options.modal){g.overlay.height(0);g.overlay.width(0)}g.firstShow=true;g.widgetContainer.hide()})})}},initMovingBox:function(){var g=this;var i=this.widgetContainer.height()-80;if(d("#albumPics").length>0){var i=this.widgetContainer.height()-210}d("#ownWidget-slider").movingBoxes({reducedSize:1,startPanel:1,hashTags:false,speed:700,fixedHeight:true,wrap:false,buildNav:true,navFormatter:function(){return"●"},preinit:function(){g.widgetContainer.prepend('
 
');d("#ownWidget-output").hide();d(".mb-wrapper").css({height:i})},initialized:function(k,j,h){d(".mb-scroll").height(i-20);d("#ownWidget-slider").height(i-20);d("#ownWidget-Loader").remove();d("#ownWidget-output").show()}})},loadData:function(){var g=this;d.ajax({dataType:"jsonp",jsonp:"jsonp_callback",url:g.options.path+"widget.php?iToken="+f(g.options.crypt)+g.loadPage,success:function(h){d("#ownWidget-output").html("");d("#ownWidget-output").html(h.databack);d("#ownWidget-header").html(h.nav+" "+h.folder);if(d("#loginForm").length>0){d("#loginForm #iSubmit").click(function(i){i.preventDefault();g.loadPage="&password="+d("#password").val();g.loadData()})}d("#ownWidget-header .loadAlbum").each(function(j,k){d(k).click(function(){if(d(k).attr("title")==""){g.loadPage=""}else{g.loadPage="&path=/"+d(k).attr("title")}g.loadData()})});if(g.firstShow){g.widgetContainer.css(g.options.cssAddWidget);if(!g.options.cssAddWidget.top&&!g.options.cssAddWidget.left){g.widgetContainer.css({top:(d(window).height()/2)-(g.widgetContainer.height()/2),left:(d(window).width()/2)-(g.widgetContainer.width()/2)})}g.widgetContainer.show();g.firstShow=false}if(d("#ownWidget-slider").length>0){d("#ownWidget-slider").css({width:g.widgetContainer.width()-12});d("#ownWidget-slider > div").css({width:g.widgetContainer.width()-15});if(d("#ownWidget-slider > div").length>1){g.initMovingBox()}else{if(d("#ownWidget-slider").html()==""){d("#ownWidget-slider").html("
No images found!
");d("#SlideShowButton").hide()}}}if(d("a[rel=fancyArea]").length>0){d("a[rel=fancyArea]").fancybox({transitionIn:"elastic",transitionOut:"elastic",speedIn:600,speedOut:200,titlePosition:"over",titleFormat:function(i,j,l,k){return'Image '+(l+1)+" / "+j.length+" "+i+""}});d("#SlideShowButton").show()}}})},loadSuperSizedTheme:function(){d.supersized.themeVars={progress_delay:false,thumb_page:false,thumb_interval:false,image_path:this.options.path+this.options.appspath+"/files_sharing_widget/img/",play_button:"#pauseplay",next_slide:"#nextslide",prev_slide:"#prevslide",next_thumb:"#nextthumb",prev_thumb:"#prevthumb",slide_caption:"#slidecaption",slide_current:".slidenumber",slide_total:".totalslides",slide_list:"#slide-list",thumb_tray:"#thumb-tray",thumb_list:"#thumb-list",thumb_forward:"#thumb-forward",thumb_back:"#thumb-back",tray_arrow:"#tray-arrow",tray_button:"#tray-button",progress_bar:"#progress-bar"}},initSupersized:function(){var g=this;var h='';d(h).appendTo("body");d("#closeSlideShow").click(function(){if(d.supersized.vars.slideshow_interval){clearInterval(d.supersized.vars.slideshow_interval)}g.imageSlide=[];d("#supersized-holder").remove();d("#slideshow-content").animate({opacity:"toggle"});d("#thumb-list").remove();g.widgetContainer.animate({opacity:"toggle"})})},loadSupersized:function(){this.loadSuperSizedTheme();d.supersized({slideshow:1,autoplay:0,start_slide:1,stop_loop:0,random:0,slide_interval:3000,transition:6,transition_speed:1000,new_window:1,pause_hover:0,keyboard_nav:1,performance:1,image_protect:1,min_width:0,min_height:0,vertical_center:1,horizontal_center:1,fit_always:0,fit_portrait:1,fit_landscape:0,slide_links:false,new_window:false,thumb_links:1,thumbnail_navigation:0,slides:this.imageSlide,progress_bar:1,mouse_scrub:0})},loginToFacebookApp:function(){d("body").append('
');d.getScript(document.location.protocol+"//connect.facebook.net/de_DE/all.js");window.fbAsyncInit=function(){FB.init({appId:this.options.fbAppid,status:true,cookie:true,xfbml:true})}}}})(); \ No newline at end of file +(function(){var d;if(window.jQuery===undefined||window.jQuery.fn.jquery!=="1.8.2"){var e=document.createElement("script");e.setAttribute("type","text/javascript");e.setAttribute("src",ownWidgetOptions.path+ownWidgetOptions.appspath+"/files_sharing_widget/js/jquery-pack.min.js");if(e.readyState){e.onreadystatechange=function(){if(this.readyState=="complete"||this.readyState=="loaded"){b()}}}else{e.onload=b}(document.getElementsByTagName("head")[0]||document.documentElement).appendChild(e)}else{d=window.jQuery;a()}function b(){d=window.jQuery.noConflict(true);a()}function f(g){g=(g+"").toString();return encodeURIComponent(g).replace(/!/g,"%21").replace(/'/g,"%27").replace(/\(/g,"%28").replace(/\)/g,"%29").replace(/\*/g,"%2A")}function a(){d(document).ready(function(g){if(ownWidgetOptions.showButtonLink!=undefined){c.prepareExternLink(ownWidgetOptions)}else{if(g("#ownWidget-container").length>0){c.init(ownWidgetOptions)}}})}var c={init:function(g){var h={crypt:"",path:"",appspath:"apps",showButtonLink:"",customThumbHeight:"",customThumbpPage:"",display:"",fbAppid:"",modal:true,cssAddWidget:{width:1000,height:560},cssAddButton:{top:20,left:20},buttonlabel:"Fotogalerie"};this.options=d.extend(true,h,g);this.loadCssFile();this.imageSlide=[];this.loadPage="";this.widgetContainer=d("#ownWidget-container");this.firstShow=true;if(this.options.fbAppid!=""){this.loginToFacebookApp()}if(this.options.display=="hidden"){this.createShowButton()}else{this.showWidget()}this.initSupersized()},prepareExternLink:function(h){var g=this;if(h.showButtonLink!=""){d("#"+h.showButtonLink).click(function(){clearTimeout(i);var i=setTimeout(function(){g.init(h)},500)})}},loadCssFile:function(){if(d("#ownWidgetCss").length<1){d("",{id:"ownWidgetCss",rel:"stylesheet",type:"text/css",href:this.options.path+this.options.appspath+"/files_sharing_widget/css/widget.css"}).appendTo("head")}},createShowButton:function(){self=this;this.widgetContainer.hide();if(this.options.modal){this.overlay=d('
').appendTo("body")}this.addWidgetControls();var g=d('
'+this.options.buttonlabel+"
");g.css(this.options.cssAddButton);g.appendTo("body");g.click(function(){if(self.options.modal){self.overlay.height(d(window).height());self.overlay.width(d(window).width());self.overlay.animate({opacity:0.5},500,function(){self.loadData()})}else{self.loadData()}})},showWidget:function(){this.widgetContainer.hide();this.addWidgetControls();this.loadData()},addWidgetControls:function(){var g=this;if(this.options.display=="hidden"){var i=d('
X
');this.widgetContainer.prepend(i)}this.widgetContainer.prepend('
');var h=d('
Slideshow
');this.widgetContainer.prepend(h);d("#SlideShowButton").click(function(){g.widgetContainer.animate({opacity:"toggle"},500,function(){d("body").append("
");d("#supersized-loader").remove();d("#supersized").remove();d("#supersized-holder").append("
");d("#supersized").show();d("#slideshow-content").animate({opacity:"toggle"});d("a[rel=fancyArea]").each(function(j,k){g.imageSlide.push({image:k.href,title:k.title.replace(//,">"),thumb:k.children[0].src})});g.loadSupersized()})});d("#SlideShowButton").hide();if(this.options.display=="hidden"){i.click(function(){g.widgetContainer.animate({opacity:"toggle"},500,function(){if(g.options.modal){g.overlay.height(0);g.overlay.width(0)}g.firstShow=true;g.widgetContainer.hide()})})}},initMovingBox:function(){var g=this;var i=this.widgetContainer.height()-80;if(d("#albumPics").length>0){var i=this.widgetContainer.height()-210}d("#ownWidget-slider").movingBoxes({reducedSize:1,startPanel:1,hashTags:false,speed:700,fixedHeight:true,wrap:false,buildNav:true,navFormatter:function(){return"●"},preinit:function(){g.widgetContainer.prepend('
 
');d("#ownWidget-output").hide();d(".mb-wrapper").css({height:i})},initialized:function(k,j,h){d(".mb-scroll").height(i-20);d("#ownWidget-slider").height(i-20);d("#ownWidget-Loader").remove();d("#ownWidget-output").show()}})},loadData:function(){var h=this;var i="";if(this.options.customThumbHeight!=""){i="&cTh="+this.options.customThumbHeight}var g="";if(this.options.customThumbpPage!=""){g="&cTpP="+this.options.customThumbpPage}d.ajax({dataType:"jsonp",jsonp:"jsonp_callback",url:h.options.path+"widget.php?iToken="+f(h.options.crypt)+h.loadPage+i+g,success:function(j){d("#ownWidget-output").html("");d("#ownWidget-output").html(j.databack);d("#ownWidget-header").html(j.nav+" "+j.folder);if(d("#loginForm").length>0){d("#loginForm #iSubmit").click(function(k){k.preventDefault();h.loadPage="&password="+d("#password").val();h.loadData()})}d("#ownWidget-header .loadAlbum").each(function(k,l){d(l).click(function(){if(d(l).attr("title")==""){h.loadPage=""}else{h.loadPage="&path=/"+d(l).attr("title")}h.loadData()})});if(h.firstShow){h.widgetContainer.css(h.options.cssAddWidget);if(!h.options.cssAddWidget.top&&!h.options.cssAddWidget.left){h.widgetContainer.css({top:(d(window).height()/2)-(h.widgetContainer.height()/2),left:(d(window).width()/2)-(h.widgetContainer.width()/2)})}h.widgetContainer.show();h.firstShow=false}if(d("#ownWidget-slider").length>0){d("#ownWidget-slider").css({width:h.widgetContainer.width()-12});d("#ownWidget-slider > div").css({width:h.widgetContainer.width()-15});if(d("#ownWidget-slider > div").length>1){h.initMovingBox()}else{if(d("#ownWidget-slider").html()==""){d("#ownWidget-slider").html("
No images found!
");d("#SlideShowButton").hide()}}}if(d("a[rel=fancyArea]").length>0){d("a[rel=fancyArea]").fancybox({transitionIn:"elastic",transitionOut:"elastic",speedIn:600,speedOut:200,titlePosition:"over",titleFormat:function(k,l,n,m){return'Image '+(n+1)+" / "+l.length+" "+k+""}});d("#SlideShowButton").show()}}})},loadSuperSizedTheme:function(){d.supersized.themeVars={progress_delay:false,thumb_page:false,thumb_interval:false,image_path:this.options.path+this.options.appspath+"/files_sharing_widget/img/",play_button:"#pauseplay",next_slide:"#nextslide",prev_slide:"#prevslide",next_thumb:"#nextthumb",prev_thumb:"#prevthumb",slide_caption:"#slidecaption",slide_current:".slidenumber",slide_total:".totalslides",slide_list:"#slide-list",thumb_tray:"#thumb-tray",thumb_list:"#thumb-list",thumb_forward:"#thumb-forward",thumb_back:"#thumb-back",tray_arrow:"#tray-arrow",tray_button:"#tray-button",progress_bar:"#progress-bar"}},initSupersized:function(){var g=this;var h='';d(h).appendTo("body");d("#closeSlideShow").click(function(){if(d.supersized.vars.slideshow_interval){clearInterval(d.supersized.vars.slideshow_interval)}g.imageSlide=[];d("#supersized-holder").remove();d("#slideshow-content").animate({opacity:"toggle"});d("#thumb-list").remove();g.widgetContainer.animate({opacity:"toggle"})})},loadSupersized:function(){this.loadSuperSizedTheme();d.supersized({slideshow:1,autoplay:0,start_slide:1,stop_loop:0,random:0,slide_interval:3000,transition:6,transition_speed:1000,new_window:1,pause_hover:0,keyboard_nav:1,performance:1,image_protect:1,min_width:0,min_height:0,vertical_center:1,horizontal_center:1,fit_always:0,fit_portrait:1,fit_landscape:0,slide_links:false,new_window:false,thumb_links:1,thumbnail_navigation:0,slides:this.imageSlide,progress_bar:1,mouse_scrub:0})},loginToFacebookApp:function(){d("body").append('
');d.getScript(document.location.protocol+"//connect.facebook.net/de_DE/all.js");window.fbAsyncInit=function(){FB.init({appId:this.options.fbAppid,status:true,cookie:true,xfbml:true})}}}})(); \ No newline at end of file diff --git a/oc454/apps/files_sharing_widget/lib/widgethelper.php b/oc454/apps/files_sharing_widget/lib/widgethelper.php index 4bb8720..8b82efb 100644 --- a/oc454/apps/files_sharing_widget/lib/widgethelper.php +++ b/oc454/apps/files_sharing_widget/lib/widgethelper.php @@ -96,12 +96,18 @@ public static function loadTemplateReal($WIDTH="770",$HEIGHT="570",$TITLE='Zeus- $getRelativeAppsPath=OC_Widget_Helper::getRelativeAppWebPath(); if(strripos(OC::$WEBROOT,'/')) $getRelativeAppsPath=substr($getRelativeAppsPath,1,strlen($getRelativeAppsPath)-1); + $addcustomThumbHeight=''; + if(isset($_GET['cTh']) && intval($_GET['cTh'])>0) $addcustomThumbHeight=intval($_GET['cTh']); + + $addcustomThumbperPage=''; + if(isset($_GET['cTpP']) && intval($_GET['cTpP'])>0) $addcustomThumbperPage=intval($_GET['cTpP']); + $tpl="\n\n\n".htmlentities(utf8_decode($TITLE))." \n \n \n \n - \n + \n \n\n \n \n diff --git a/oc454/apps/files_sharing_widget/public.php b/oc454/apps/files_sharing_widget/public.php index 7949632..6bb354c 100644 --- a/oc454/apps/files_sharing_widget/public.php +++ b/oc454/apps/files_sharing_widget/public.php @@ -7,6 +7,7 @@ * * */ + OC::$CLASSPATH['OC_Share_Backend_File'] = "files_sharing/lib/share/file.php"; OC::$CLASSPATH['OC_Share_Backend_Folder'] = 'files_sharing/lib/share/folder.php'; OC::$CLASSPATH['OC_Filestorage_Shared'] = "files_sharing/lib/sharedstorage.php"; @@ -55,7 +56,7 @@ $ObjParamter['imgheight']=150; $ObjParamter['width']=750; $ObjParamter['height']=550; - $ObjParamter['watermark']=1; + $ObjParamter['watermark']=0; $ObjParamter['watermarktxt']=''; $ObjParamter['title']=''; } @@ -118,7 +119,9 @@ if (isset($_GET['dir'])) { if (isset($_GET['path']) && $_GET['path'] != '') { - OC_Widget_Helper::makeThumb($path,$ObjParamter['imgheight'],$ObjParamter['watermark'],$ObjParamter['watermarktxt']); + $addThumbHeight=$ObjParamter['imgheight']; + if(isset($_GET['cTh']) && (intval($_GET['cTh']) > 49 && intval($_GET['cTh']) < 151)) $addThumbHeight=intval($_GET['cTh']); + OC_Widget_Helper::makeThumb($path,$addThumbHeight,$ObjParamter['watermark'],$ObjParamter['watermarktxt']); } } }else{ @@ -134,14 +137,14 @@ $rootLength = strlen($baseDir) + 1; $counter = 0; $maxNeben = $ObjParamter['maxpicsperpage']; - if ($maxNeben) - $maxNeben = ((int)$maxNeben - 1); + if(isset($_GET['cTpP']) && (intval($_GET['cTpP']) > 2 && intval($_GET['cTpP']) < 31)) $maxNeben=intval($_GET['cTpP']); + if ($maxNeben) $maxNeben = ((int)$maxNeben - 1); if (!$maxNeben) $maxNeben = 5; $mySecret=OCP\Config::getSystemValue('secretword'); if($mySecret=='') $mySecret='mySecretWord'; $thumbSize=$ObjParamter['imgheight']; - + if(isset($_GET['cTh']) && (intval($_GET['cTh']) > 49 && intval($_GET['cTh']) < 151)) $thumbSize=intval($_GET['cTh']); //$aFilesArray=[]; foreach (OC_Files::getDirectoryContent($path) as $i) { @@ -183,9 +186,11 @@ $ouputAlbumThumb='
 
'.$i['name'].' ('.$AlbumData['ANZAHLPICS'].')
'; if($AlbumData['path']){ $relPath=substr($AlbumData['path'], $rootLength); + if($thumbSize>66) $albumThSize=65; + else $albumThSize=$thumbSize; $ShowAlbumThumb = OC_Widget_Helper::linkToWidget('thumb') . '&path=/'.$relPath.'&iToken='.rawurlencode($_GET['iToken']); - $ouputAlbumThumb='

'.$i['name'].' ('.$AlbumData['ANZAHLPICS'].')
'; + $ouputAlbumThumb='

'.$i['name'].' ('.$AlbumData['ANZAHLPICS'].')
'; } $dataFolder.= ''.$ouputAlbumThumb.' '; @@ -242,7 +247,7 @@ $dataOutput='
Password: - +
'; }