diff --git a/capsule-prototype/js/online-rekall/Rekall.js b/capsule-prototype/js/online-rekall/Rekall.js index 50488999870f8e83050430cfb9e5206d6ef49755..0f1449047b9fcd21c03f02aa6d9f0dd26251cf14 100644 --- a/capsule-prototype/js/online-rekall/Rekall.js +++ b/capsule-prototype/js/online-rekall/Rekall.js @@ -44,16 +44,6 @@ function Rekall(options) { 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; } @@ -65,12 +55,20 @@ function Rekall(options) { this.Settings = $.extend({}, defaultSettings, options); } -Rekall.prototype.enableProjectDeletion = function() { - this.Settings.allowProjectDeletion = true; -} +Rekall.prototype.allowProjectDeletion = function(){ + if (arguments.length <= 0 && 'boolean' !== typeof arguments[0]){ + return this.Settings._allowProjectDeletion; + } -Rekall.prototype.disableProjectDeletion = function() { - this.Settings.allowProjectDeletion = false; + if (arguments[0]) { + this.Settings._allowProjectDeletion = true; + $('#popupSettingsBtnDelete').attr('display', null); + } + else { + this.Settings._allowProjectDeletion = false; + $('#popupSettingsBtnDelete').hide(); + } + this.Settings._allowProjectDeletion = arguments[0]; } Rekall.prototype.loadXMLFile = function() { @@ -92,18 +90,6 @@ Rekall.prototype.loadXMLFile = function() { $('#popupSettingsBtnDelete').hide(); }; - if(window.location.host == "dev3.memorekall.com") { - url = url.replace("dev3.memorekall.com", "dev2.memorekall.com"); - $("#popupSettingsBtnDelete").hide(); - } - if(window.location.host == "legacy.memorekall.com") { - url = url.replace("legacy.memorekall.com", "project.memorekall.com"); - $("#popupSettingsBtnDelete").hide(); - } - if(window.location.host == "legacy.memorekall.fr") { - url = url.replace("legacy.memorekall.fr", "project.memorekall.com"); - $("#popupSettingsBtnDelete").hide(); - } this.baseUrl = url; var thiss = this; diff --git a/capsule-prototype/js/online-script.js b/capsule-prototype/js/online-script.js index 17e974f547a9e7dbdd750a42931af9bc1a06a0e3..bf13d5c2f1e96b174deb165f5afe7d3561ceb22b 100644 --- a/capsule-prototype/js/online-script.js +++ b/capsule-prototype/js/online-script.js @@ -1,8 +1,8 @@ var rekall = new Rekall(); var rekall_common = new Object(); $(document).ready(function() { - rekall.Settings.ProjectDeletionEnabled = window.app.ProjectDeletionEnabled; + rekall.allowProjectDeletion(window.app.Settings.Project.ProjectDeletionEnabled) Utils.actionPrefix = "php/"; Utils.actionSuffix = ".php?r="; diff --git a/capsule-prototype/php/rekallApp.js.php b/capsule-prototype/php/rekallApp.js.php index f0d9638ae007ffe7a7a43eaba518ec818a0e4249..bce36d1c97fde5bd849797b7b4242de78a03ebbf 100644 --- a/capsule-prototype/php/rekallApp.js.php +++ b/capsule-prototype/php/rekallApp.js.php @@ -3,7 +3,7 @@ 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'; +$project_allow_deletion = isset($_ENV["LEGACY_PROJECT_DELETION_ENABLED"]) && $_ENV["LEGACY_PROJECT_DELETION_ENABLED"] == 'true' ? 'true' : 'false'; ?> function RekallApp (opts = {}){ const METHODS = [