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

Commit 8129433

Browse files
committed
Skip updating embed_code if link is expired (error).
Rewrite getFlashVersion() function (removed from Controller) in ajxp_utils.
1 parent 337ae2b commit 8129433

File tree

3 files changed

+25
-4
lines changed

3 files changed

+25
-4
lines changed

core/src/plugins/action.share/class.ShareCenter.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -967,9 +967,9 @@ Class.create("ShareCenter", {
967967
<div class="infoPanelLabel">'+MessageHash['share_center.61']+'</div>\
968968
<div class="infoPanelValue"><textarea style="padding: 4px;width:97%;height: 80px;" id="embed_code" readonly="true"></textarea></div>\
969969
</div>');
970+
var dlPath = jsonData['content_filter']['filters'][node.getPath()];
971+
mainCont.down("#embed_code").setValue("<a href='"+ jsonData.minisite.public_link +"?dl=true&file="+dlPath+"'>Download "+ getBaseName(node.getPath()) +"</a>");
970972
}
971-
var dlPath = jsonData['content_filter']['filters'][node.getPath()];
972-
mainCont.down("#embed_code").setValue("<a href='"+ jsonData.minisite.public_link +"?dl=true&file="+dlPath+"'>Download "+ getBaseName(node.getPath()) +"</a>");
973973

974974
}else if(jsonData.minisite){
975975
// MINISITE FOLDER SHARE
@@ -986,8 +986,8 @@ Class.create("ShareCenter", {
986986
<div class="infoPanelLabel">'+MessageHash['share_center.61']+'</div>\
987987
<div class="infoPanelValue"><textarea style="padding: 4px;width:97%;height: 80px;" id="embed_code" readonly="true"></textarea></div>\
988988
</div>');
989+
mainCont.down("#embed_code").setValue("<iframe height='500' width='600' style='border:1px solid black;' src='"+jsonData.minisite.public_link+"'></iframe>");
989990
}
990-
mainCont.down("#embed_code").setValue("<iframe height='500' width='600' style='border:1px solid black;' src='"+jsonData.minisite.public_link+"'></iframe>");
991991
}else{
992992
// WORKSPACE FOLDER
993993
mainCont.update('<div class="share_info_panel_main_legend">'+MessageHash["share_center.139"+(jsonData['is_expired']?'b':'')]+'</div>');

core/src/plugins/gui.ajax/res/js/ui/prototype/util/ajxp_utils.js

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -472,3 +472,24 @@ function attachMobileScroll(targetId, direction){
472472
if(direction == 'horizontal' || direction == 'both') overflow['overflowX'] = 'auto';
473473
$(targetId).setStyle(overflow);
474474
}
475+
476+
/**
477+
* Utilitary to get FlashVersion
478+
* @returns String
479+
*/
480+
function getFlashVersion(){
481+
if (!window.PYDIO_DetectedFlashVersion) {
482+
var x;
483+
if(navigator.plugins && navigator.mimeTypes.length){
484+
x = navigator.plugins["Shockwave Flash"];
485+
if(x && x.description) x = x.description;
486+
} else if (Prototype.Browser.IE){
487+
try {
488+
x = new ActiveXObject("ShockwaveFlash.ShockwaveFlash");
489+
x = x.GetVariable("$version");
490+
} catch(e){}
491+
}
492+
window.PYDIO_DetectedFlashVersion = (typeof(x) == 'string') ? parseInt(x.match(/\d+/)[0]) : 0;
493+
}
494+
return window.PYDIO_DetectedFlashVersion;
495+
}

core/src/plugins/uploader.flex/manifest.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
var otherUploadersCount = XPathSelectNodes(ajaxplorer.getXmlRegistry(), 'plugins/uploader[@id!="uploader.flex"]').length;
4343
if(otherUploadersCount == 0) return true;
4444
var xhrUpload = (typeof File != "undefined" && typeof (new XMLHttpRequest()).upload != "undefined" && 'draggable' in new Element('span') && (window.FileReader || window.FormData) );
45-
return (pydio.getController().getFlashVersion() >= 8 && (document.location.href.substring(0,5)!='https' || Prototype.Browser.IE) && ! xhrUpload );
45+
return (getFlashVersion() >= 8 && (document.location.href.substring(0,5)!='https' || Prototype.Browser.IE) && ! xhrUpload );
4646
]]></activeCondition>
4747
</processing>
4848
</uploader>

0 commit comments

Comments
 (0)