diff --git a/.env_default b/.env_default index e851c2492b555c1511182f0316a405aa0f0af708..10c973bf65d24cf5046855957c911bfebe745cad 100644 --- a/.env_default +++ b/.env_default @@ -69,4 +69,5 @@ LEGACY_URL_EXTERNAL=http://localhost:8081/legacy/ LEGACY_EXTERNAL_PREFIX=/legacy MEMBER_URL_EXTERNAL=http://localhost:8081/ -FRONT_URL_EXTERNAL=http://localhost:8081/ \ No newline at end of file +FRONT_URL_EXTERNAL=http://localhost:8081/ +LEGACY_PROJECT_DELETION_ENABLED=false \ No newline at end of file diff --git a/capsule-prototype/index.html b/capsule-prototype/index.html index 6a4892c846c6c0a2e4254cee1b7ebbe0d49d48bd..7ee885705fe9b68e931f1c62b895562c94bade6f 100644 --- a/capsule-prototype/index.html +++ b/capsule-prototype/index.html @@ -26,6 +26,8 @@ <script language="javascript" type='text/javascript' src='../shared/js/libs/fastdom.js'></script> <script language="javascript" type='text/javascript' src='../shared/js/libs/moment-with-langs.min.js'></script> + <script type="module" src="../shared/php/rekallApp.js.php"></script> + <script language="javascript" type='text/javascript' src='../shared/js/rekall/Utils.js'></script> <script language="javascript" type='text/javascript' src='../shared/js/online-rekall/Rekall.js'></script> <script language="javascript" type='text/javascript' src='../shared/js/rekall/Source.js'></script> @@ -38,7 +40,6 @@ <script language="javascript" type='text/javascript' src='../shared/js/iannix.js'></script> <script language="javascript" type='text/javascript' src='../shared/js/online-script.js'></script> - <script type="module" src="../shared/php/rekallApp.js.php"></script> <script language="javascript" type='text/javascript' src="../shared/js/libs/video-js/video.min.js"></script> <link rel="stylesheet" type="text/css" href="../shared/js/libs/video-js/video-js.min.css" /> @@ -244,13 +245,14 @@ </div> </tr></td> </table> - <video id="video" class="video-js vjs-default-skin vjs-big-play-centered"> + <div style="width: 100%; height: 30px; background: black"></div> + <video id="video" class="video-js vjs-default-skin vjs-big-play-centered"> <p class="vjs-no-js">Your browser is not compatible with HTML5. Please upgrade!</p> <!-- <track kind="captions" src="demo.captions.vtt" srclang="en" label="English"></track> <track kind="subtitles" src="demo.captions.vtt" srclang="en" label="English"></track> --> - </video> + </video> <div id='flattentimeline'> <div id="flattentimeline_highlight"> </div> diff --git a/capsule-prototype/js/online-rekall/Rekall.js b/capsule-prototype/js/online-rekall/Rekall.js index 676df7ed56778464df1f544e0e1ec2b3b377b304..50488999870f8e83050430cfb9e5206d6ef49755 100644 --- a/capsule-prototype/js/online-rekall/Rekall.js +++ b/capsule-prototype/js/online-rekall/Rekall.js @@ -22,12 +22,55 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. */ -function Rekall() { +function Rekall(options) { this.sortings = new Object(); this.sortings["horizontal"] = new Sorting("Time"); this.sortings["colors"] = new Sorting("Rekall->Type", false, ""); this.timeline = new Timeline(); this.videoPlayer = undefined; + + function getDefaultBaseUrl() { + var oldURL = window.document.location + ""; + var url = oldURL; + var index = 0; + url = url.replace("pro-index.html", ""); + url = url.replace("online-index.html", ""); + url = url.replace("index.html", ""); + index = oldURL.indexOf('?'); + if(index == -1) + index = oldURL.indexOf('#'); + if(index != -1) + url = oldURL.substring(0, index); + if(!url.endsWith("/")) + url = url + "/"; + + if(window.location.host == "dev3.memorekall.com") { + url = url.replace("dev3.memorekall.com", "dev2.memorekall.com"); + } + if(window.location.host == "legacy.memorekall.com") { + url = url.replace("legacy.memorekall.com", "project.memorekall.com"); + } + if(window.location.host == "legacy.memorekall.fr") { + url = url.replace("legacy.memorekall.fr", "project.memorekall.com"); + } + + return url; + } + + var defaultSettings = { + _allowProjectDeletion: false, + baseUrl: getDefaultBaseUrl() + } + + this.Settings = $.extend({}, defaultSettings, options); +} + +Rekall.prototype.enableProjectDeletion = function() { + this.Settings.allowProjectDeletion = true; +} + +Rekall.prototype.disableProjectDeletion = function() { + this.Settings.allowProjectDeletion = false; } Rekall.prototype.loadXMLFile = function() { @@ -44,6 +87,11 @@ Rekall.prototype.loadXMLFile = function() { url = oldURL.substring(0, index); if(!url.endsWith("/")) url = url + "/"; + + if(!this.Settings._allowProjectDeletion){ + $('#popupSettingsBtnDelete').hide(); + }; + if(window.location.host == "dev3.memorekall.com") { url = url.replace("dev3.memorekall.com", "dev2.memorekall.com"); $("#popupSettingsBtnDelete").hide(); diff --git a/capsule-prototype/js/online-script.js b/capsule-prototype/js/online-script.js index dd64c9b1619e71190a0dce9b399fad9390e9357f..17e974f547a9e7dbdd750a42931af9bc1a06a0e3 100644 --- a/capsule-prototype/js/online-script.js +++ b/capsule-prototype/js/online-script.js @@ -1,6 +1,8 @@ var rekall = new Rekall(); var rekall_common = new Object(); $(document).ready(function() { + rekall.Settings.ProjectDeletionEnabled = window.app.ProjectDeletionEnabled; + Utils.actionPrefix = "php/"; Utils.actionSuffix = ".php?r="; @@ -130,10 +132,8 @@ $(document).ready(function() { event.stopPropagation(); var tmp = shareLink(); openAlert("input",tmp); - }); - - -}); + }); +}); function setEditionControls() { //Drag&drop files @@ -534,9 +534,7 @@ function setEditionControls() { $("#popupEditSupprimer").click(function(){ openAlert("Do you really want to delete this file from the project ?", "yesnodelete"); - }); - - + }); } /*var rubanTimeout = 0; diff --git a/capsule-prototype/php/rekallApp.js.php b/capsule-prototype/php/rekallApp.js.php index 992a34b52cb228baab0d5da1cf7fe46a49f2811d..f0d9638ae007ffe7a7a43eaba518ec818a0e4249 100644 --- a/capsule-prototype/php/rekallApp.js.php +++ b/capsule-prototype/php/rekallApp.js.php @@ -3,8 +3,8 @@ Header("content-type: application/x-javascript"); $front_url = $_ENV["FRONT_URL_EXTERNAL"]; $member_url = $_ENV["MEMBER_URL_EXTERNAL"]; +$project_allow_deletion = isset($_ENV["LEGACY_PROJECT_DELETION_ENABLED"]) && $_ENV["LEGACY_PROJECT_DELETION_ENABLED"] == 'true'; ?> - function RekallApp (opts = {}){ const METHODS = [ 'openUrl', @@ -18,10 +18,10 @@ function RekallApp (opts = {}){ return; window.top.location.assign(arguments[0]); }, - pubSub: new function(PubSub){ + pubSub: function(PubSub){ return window.PubSub; }, - init: new function(PubSub){ + init: function(PubSub){ window.PubSub = PubSub; } }; @@ -54,5 +54,10 @@ function RekallApp (opts = {}){ frontHome : '<?= $front_url ?>', memberHome : '<?= $member_url ?>', }; + app.Settings = { + Project: { + ProjectDeletionEnabled: <?= $project_allow_deletion ?>, + } + }; return app; })(window.app = window.app || {}); diff --git a/docker-compose.yml b/docker-compose.yml index d0fdb7d86f15aefe8ce9283a6345b6ca12068fd6..07f02b8b4cfa95444bb7d1c429f3382a9015b6d1 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -35,6 +35,7 @@ services: environment: - MEMBER_URL_EXTERNAL - FRONT_URL_EXTERNAL + - LEGACY_PROJECT_DELETION_ENABLED volumes: - $PWD/legacy:/sites/memorekall/www/web_legacy:rw - $PWD/log:/sites/memorekall/www/log:rw