Skip to content
Snippets Groups Projects
Commit d887ca1c authored by Camille Simiand's avatar Camille Simiand
Browse files

Merge branch 'tuleap-146-a-project-can-be-deleted-it-should-not' into 'main'

Tuleap 146 a project can be deleted it should not

See merge request !62
parents 884c2e04 cfab4ff6
Branches
Tags
1 merge request!62Tuleap 146 a project can be deleted it should not
Pipeline #842 passed
......@@ -70,3 +70,4 @@ LEGACY_EXTERNAL_PREFIX=/legacy
MEMBER_URL_EXTERNAL=http://localhost:8081/
FRONT_URL_EXTERNAL=http://localhost:8081/
LEGACY_PROJECT_DELETION_ENABLED=false
\ No newline at end of file
......@@ -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,6 +245,7 @@
</div>
</tr></td>
</table>
<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>
<!--
......
......@@ -22,18 +22,17 @@
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;
}
Rekall.prototype.loadXMLFile = function() {
function getDefaultBaseUrl() {
var oldURL = window.document.location + "";
var index = 0;
var url = oldURL;
var index = 0;
url = url.replace("pro-index.html", "");
url = url.replace("online-index.html", "");
url = url.replace("index.html", "");
......@@ -44,18 +43,53 @@ Rekall.prototype.loadXMLFile = function() {
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");
$("#popupSettingsBtnDelete").hide();
return url;
}
var defaultSettings = {
_allowProjectDeletion: false,
baseUrl: getDefaultBaseUrl()
}
this.Settings = $.extend({}, defaultSettings, options);
}
Rekall.prototype.allowProjectDeletion = function(){
if (arguments.length <= 0 && 'boolean' !== typeof arguments[0]){
return this.Settings._allowProjectDeletion;
}
if (arguments[0]) {
this.Settings._allowProjectDeletion = true;
$('#popupSettingsBtnDelete').attr('display', null);
}
if(window.location.host == "legacy.memorekall.com") {
url = url.replace("legacy.memorekall.com", "project.memorekall.com");
$("#popupSettingsBtnDelete").hide();
else {
this.Settings._allowProjectDeletion = false;
$('#popupSettingsBtnDelete').hide();
}
if(window.location.host == "legacy.memorekall.fr") {
url = url.replace("legacy.memorekall.fr", "project.memorekall.com");
$("#popupSettingsBtnDelete").hide();
this.Settings._allowProjectDeletion = arguments[0];
}
Rekall.prototype.loadXMLFile = function() {
var oldURL = window.document.location + "";
var index = 0;
var url = oldURL;
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(!this.Settings._allowProjectDeletion){
$('#popupSettingsBtnDelete').hide();
};
this.baseUrl = url;
var thiss = this;
......
var rekall = new Rekall();
var rekall_common = new Object();
$(document).ready(function() {
rekall.allowProjectDeletion(window.app.Settings.Project.ProjectDeletionEnabled)
Utils.actionPrefix = "php/";
Utils.actionSuffix = ".php?r=";
......@@ -131,8 +133,6 @@ $(document).ready(function() {
var tmp = shareLink();
openAlert("input",tmp);
});
});
function setEditionControls() {
......@@ -535,8 +535,6 @@ function setEditionControls() {
$("#popupEditSupprimer").click(function(){
openAlert("Do you really want to delete this file from the project ?", "yesnodelete");
});
}
/*var rubanTimeout = 0;
......
......@@ -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' ? 'true' : 'false';
?>
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 || {});
......@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment