Skip to content
This repository has been archived by the owner on Nov 25, 2020. It is now read-only.

Commit

Permalink
Skip updating embed_code if link is expired (error).
Browse files Browse the repository at this point in the history
Rewrite getFlashVersion() function (removed from Controller) in ajxp_utils.
  • Loading branch information
cdujeu committed Oct 26, 2015
1 parent 337ae2b commit 8129433
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 4 deletions.
6 changes: 3 additions & 3 deletions core/src/plugins/action.share/class.ShareCenter.js
Expand Up @@ -967,9 +967,9 @@ Class.create("ShareCenter", {
<div class="infoPanelLabel">'+MessageHash['share_center.61']+'</div>\
<div class="infoPanelValue"><textarea style="padding: 4px;width:97%;height: 80px;" id="embed_code" readonly="true"></textarea></div>\
</div>');
var dlPath = jsonData['content_filter']['filters'][node.getPath()];
mainCont.down("#embed_code").setValue("<a href='"+ jsonData.minisite.public_link +"?dl=true&file="+dlPath+"'>Download "+ getBaseName(node.getPath()) +"</a>");
}
var dlPath = jsonData['content_filter']['filters'][node.getPath()];
mainCont.down("#embed_code").setValue("<a href='"+ jsonData.minisite.public_link +"?dl=true&file="+dlPath+"'>Download "+ getBaseName(node.getPath()) +"</a>");

}else if(jsonData.minisite){
// MINISITE FOLDER SHARE
Expand All @@ -986,8 +986,8 @@ Class.create("ShareCenter", {
<div class="infoPanelLabel">'+MessageHash['share_center.61']+'</div>\
<div class="infoPanelValue"><textarea style="padding: 4px;width:97%;height: 80px;" id="embed_code" readonly="true"></textarea></div>\
</div>');
mainCont.down("#embed_code").setValue("<iframe height='500' width='600' style='border:1px solid black;' src='"+jsonData.minisite.public_link+"'></iframe>");
}
mainCont.down("#embed_code").setValue("<iframe height='500' width='600' style='border:1px solid black;' src='"+jsonData.minisite.public_link+"'></iframe>");
}else{
// WORKSPACE FOLDER
mainCont.update('<div class="share_info_panel_main_legend">'+MessageHash["share_center.139"+(jsonData['is_expired']?'b':'')]+'</div>');
Expand Down
21 changes: 21 additions & 0 deletions core/src/plugins/gui.ajax/res/js/ui/prototype/util/ajxp_utils.js
Expand Up @@ -472,3 +472,24 @@ function attachMobileScroll(targetId, direction){
if(direction == 'horizontal' || direction == 'both') overflow['overflowX'] = 'auto';
$(targetId).setStyle(overflow);
}

/**
* Utilitary to get FlashVersion
* @returns String
*/
function getFlashVersion(){
if (!window.PYDIO_DetectedFlashVersion) {
var x;
if(navigator.plugins && navigator.mimeTypes.length){
x = navigator.plugins["Shockwave Flash"];
if(x && x.description) x = x.description;
} else if (Prototype.Browser.IE){
try {
x = new ActiveXObject("ShockwaveFlash.ShockwaveFlash");
x = x.GetVariable("$version");
} catch(e){}
}
window.PYDIO_DetectedFlashVersion = (typeof(x) == 'string') ? parseInt(x.match(/\d+/)[0]) : 0;
}
return window.PYDIO_DetectedFlashVersion;
}
2 changes: 1 addition & 1 deletion core/src/plugins/uploader.flex/manifest.xml
Expand Up @@ -42,7 +42,7 @@
var otherUploadersCount = XPathSelectNodes(ajaxplorer.getXmlRegistry(), 'plugins/uploader[@id!="uploader.flex"]').length;
if(otherUploadersCount == 0) return true;
var xhrUpload = (typeof File != "undefined" && typeof (new XMLHttpRequest()).upload != "undefined" && 'draggable' in new Element('span') && (window.FileReader || window.FormData) );
return (pydio.getController().getFlashVersion() >= 8 && (document.location.href.substring(0,5)!='https' || Prototype.Browser.IE) && ! xhrUpload );
return (getFlashVersion() >= 8 && (document.location.href.substring(0,5)!='https' || Prototype.Browser.IE) && ! xhrUpload );
]]></activeCondition>
</processing>
</uploader>

0 comments on commit 8129433

Please sign in to comment.