Skip to content
Snippets Groups Projects
Commit 8eb2175c authored by Loïs Poujade's avatar Loïs Poujade
Browse files

wip use pubsup for tabs

+ ui fixes
parent b4b4439a
Branches
Tags
1 merge request!72tuleap-166 show mosaic in a tab
Pipeline #993 passed
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
flex: 1; flex: 1;
color: white; color: white;
overflow-x: hidden; overflow-x: hidden;
overflow-y: scroll; overflow-y: auto;
} }
#flattentimeline.drag { #flattentimeline.drag {
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
#mosaic_tab { #mosaic_tab {
display: flex; display: flex;
overflow: scroll; overflow: auto;
flex-direction: column; flex-direction: column;
} }
...@@ -44,13 +44,12 @@ ...@@ -44,13 +44,12 @@
padding: var(--base-spacing); padding: var(--base-spacing);
margin: var(--base-spacing); margin: var(--base-spacing);
border-radius: var(--border-radius); border-radius: var(--border-radius);
dispaly: flex; display: flex;
flex-direction: column; flex-direction: column;
} }
.mosaic_item { .mosaic_item {
width: var(--card-width); width: var(--card-width);
height: var(--card-height);
display: flex; display: flex;
flex-direction: column; flex-direction: column;
align-items: center; align-items: center;
......
#mosaic_tab {
background: #243538;
overflow: scroll;
padding: 20px;
display: none;
}
.mosaic_category {
padding: 1.0em 1vw;
margin: 2vh 0 1.5vh 0;
border-radius: 3px;
background: rgba(0,0,0,.15);
}
.mosaic_category_grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(125px, 1fr));
grid-auto-rows: 150px;
}
.mosaic_filter {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(125px, 1fr));
}
.mosaic_filter_item {
padding: 1.0em 1vw;
margin: 2vh 0.5vw 1.5vh 0.5vw;
border-radius: 3px;
cursor:pointer;
}
.mosaic_filter_disabled {
opacity: 0.5;
}
.mosaic_filter_disabled>h2:after {
background-image: url('images/icn-menu-filter.png');
}
.mosaic_filter_item > h2, .mosaic_category h2 {
text-transform: capitalize;
}
.mosaic_filter_item:not(.mosaic_filter_disabled) > h2:after{
background-image: url('images/icn-menu-preview.png');
}
.mosaic_filter_item > h2:after{
display:inline-block;
height:20px;
width:20px;
content: " ";
background-size: 20px 20px;
margin-left: 5px;
padding-top: 3px;
background-repeat: no-repeat;
}
.mosaic_filter_item_all > h2:after {
background-image: url('images/icn-reload.png') !important;
}
.mosaic_item img {
/* To correctly align image, regardless of content height: */
vertical-align: top;
display: inline-block;
/* To horizontally center images and caption */
text-align: center;
/* The width of the container also implies margin around the images. */
width: 100px;
margin: 2vh 0 1.5vh 0;
cursor:pointer;
}
.mosaic_item .caption {
/*
display:block;
*/
}
var rekall = new Rekall(); var rekall = new Rekall();
var rekall_common = new Object(); var rekall_common = new Object();
var pubSub = null;
window.onload = function() {
pubSub = window.top.PubSub;
pubSub.subscribe('mosaic', openMosaic);
pubSub.subscribe('video', openVideo);
};
$(document).ready(function() { $(document).ready(function() {
rekall.allowProjectDeletion(window.app.Settings.Project.ProjectDeletionEnabled) rekall.allowProjectDeletion(window.app.Settings.Project.ProjectDeletionEnabled)
...@@ -346,15 +354,7 @@ function setEditionControls() { ...@@ -346,15 +354,7 @@ function setEditionControls() {
} }
}); });
$('#tab_selector_form').change(function(event) { $('#tab_selector_form').change(function(event) { pubSub.publish(event.target.value) });
$('#mosaic_tab').toggle();
$('#video_tab').toggle();
if (event.target.value == 'mosaic') {
rekall.timeline.pause();
openMosaic();
}
});
$("#popupEdit").click(function(event){ $("#popupEdit").click(function(event){
event.stopPropagation(); event.stopPropagation();
...@@ -796,6 +796,12 @@ function closeEdit() { ...@@ -796,6 +796,12 @@ function closeEdit() {
$("#popupEdit").hide(); $("#popupEdit").hide();
} }
function openVideo() {
$('#mosaic_tab').hide();
$('#video_tab').show();
$('#left_menu .bottom').show();
}
function openMosaic() { function openMosaic() {
function getMosaicItem(tagOrDoc) { function getMosaicItem(tagOrDoc) {
let path = Utils.getPreviewPath(tagOrDoc); let path = Utils.getPreviewPath(tagOrDoc);
...@@ -824,6 +830,12 @@ function openMosaic() { ...@@ -824,6 +830,12 @@ function openMosaic() {
.append($('<h2/>').text(text)); .append($('<h2/>').text(text));
} }
rekall.timeline.pause();
$('#mosaic_tab').show();
$('#video_tab').hide();
$('#left_menu .bottom').hide();
let container = $('#mosaic_tab'); let container = $('#mosaic_tab');
container.html(''); container.html('');
let filterdiv = $('<div/>').addClass('mosaic_filter'); let filterdiv = $('<div/>').addClass('mosaic_filter');
......
...@@ -261,9 +261,9 @@ Sorting.prototype.analyseEnd = function(minTagCount) { ...@@ -261,9 +261,9 @@ Sorting.prototype.analyseEnd = function(minTagCount) {
else { else {
this.categories = Utils.sortObj(this.categories, this.valAreFloats); this.categories = Utils.sortObj(this.categories, this.valAreFloats);
if(this.analyse) { if(this.analyse) {
console.log("----------------------------------------------------------------"); console.debug("----------------------------------------------------------------");
for (var key in this.categories) for (var key in this.categories)
console.log(key); console.debug(key);
} }
......
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
<script> <script>
window.onload = function (){ window.onload = function (){
const iframe = document.getElementById('legacyContent').contentWindow; const iframe = document.getElementById('legacyContent').contentWindow;
iframe.init('init', PubSub); iframe.rekall.Rekall('init', PubSub);
} }
</script> </script>
{% endblock %} {% endblock %}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment