change all isProjected functions (closes #2462)
This commit is contained in:
parent
047697d0ae
commit
58dd2f2b30
@ -130,7 +130,7 @@ angular.module('OpenSlidesApp.agenda', ['OpenSlidesApp.users'])
|
|||||||
},
|
},
|
||||||
// override isProjected function of jsDataModel factory
|
// override isProjected function of jsDataModel factory
|
||||||
isProjected: function (tree) {
|
isProjected: function (tree) {
|
||||||
// Returns the id of the last projector with an agenda-item element. Else return 0.
|
// Returns all ids of all projectors with an agenda-item element. Otherwise an empty list.
|
||||||
if (typeof tree === 'undefined') {
|
if (typeof tree === 'undefined') {
|
||||||
tree = false;
|
tree = false;
|
||||||
}
|
}
|
||||||
@ -150,13 +150,13 @@ angular.module('OpenSlidesApp.agenda', ['OpenSlidesApp.users'])
|
|||||||
}
|
}
|
||||||
return value;
|
return value;
|
||||||
};
|
};
|
||||||
var isProjected = 0;
|
var isProjectedIds = [];
|
||||||
Projector.getAll().forEach(function (projector) {
|
Projector.getAll().forEach(function (projector) {
|
||||||
if (typeof _.findKey(projector.elements, predicate) === 'string') {
|
if (typeof _.findKey(projector.elements, predicate) === 'string') {
|
||||||
isProjected = projector.id;
|
isProjectedIds.push(projector.id);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
return isProjected;
|
return isProjectedIds;
|
||||||
},
|
},
|
||||||
// project list of speakers
|
// project list of speakers
|
||||||
projectListOfSpeakers: function(projectorId) {
|
projectListOfSpeakers: function(projectorId) {
|
||||||
@ -175,21 +175,21 @@ angular.module('OpenSlidesApp.agenda', ['OpenSlidesApp.users'])
|
|||||||
},
|
},
|
||||||
// check if list of speakers is projected
|
// check if list of speakers is projected
|
||||||
isListOfSpeakersProjected: function () {
|
isListOfSpeakersProjected: function () {
|
||||||
// Returns the id of the last projector with an element with the
|
// Returns all ids of all projectors with an element with the
|
||||||
// name 'agenda/list-of-speakers' and the same id.
|
// name 'agenda/list-of-speakers' and the same id. Else returns an empty list.
|
||||||
var self = this;
|
var self = this;
|
||||||
var predicate = function (element) {
|
var predicate = function (element) {
|
||||||
return element.name == 'agenda/list-of-speakers' &&
|
return element.name == 'agenda/list-of-speakers' &&
|
||||||
typeof element.id !== 'undefined' &&
|
typeof element.id !== 'undefined' &&
|
||||||
element.id == self.id;
|
element.id == self.id;
|
||||||
};
|
};
|
||||||
var isProjected = 0;
|
var isProjecteds = [];
|
||||||
Projector.getAll().forEach(function (projector) {
|
Projector.getAll().forEach(function (projector) {
|
||||||
if (typeof _.findKey(projector.elements, predicate) === 'string') {
|
if (typeof _.findKey(projector.elements, predicate) === 'string') {
|
||||||
isProjected = projector.id;
|
isProjecteds.push(projector.id);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
return isProjected;
|
return isProjecteds;
|
||||||
},
|
},
|
||||||
hasSubitems: function(items) {
|
hasSubitems: function(items) {
|
||||||
var self = this;
|
var self = this;
|
||||||
@ -378,19 +378,19 @@ angular.module('OpenSlidesApp.agenda', ['OpenSlidesApp.users'])
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
isProjected: function () {
|
isProjected: function () {
|
||||||
// Returns the id of the last projector with an agenda-item element. Else return 0.
|
// Returns the ids of all projectors with an agenda-item element. Else return an empty list.
|
||||||
var isProjected = 0;
|
|
||||||
var predicate = function (element) {
|
var predicate = function (element) {
|
||||||
var value;
|
var value;
|
||||||
value = element.name == 'agenda/current-list-of-speakers-overlay';
|
value = element.name == 'agenda/current-list-of-speakers-overlay';
|
||||||
return value;
|
return value;
|
||||||
};
|
};
|
||||||
|
var isProjectedIds = [];
|
||||||
Projector.getAll().forEach(function (projector) {
|
Projector.getAll().forEach(function (projector) {
|
||||||
if (typeof _.findKey(projector.elements, predicate) === 'string') {
|
if (typeof _.findKey(projector.elements, predicate) === 'string') {
|
||||||
isProjected = projector.id;
|
isProjectedIds.push(projector.id);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
return isProjected;
|
return isProjectedIds;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
@ -285,8 +285,8 @@ angular.module('OpenSlidesApp.agenda.site', [
|
|||||||
};
|
};
|
||||||
// check if agenda is projected
|
// check if agenda is projected
|
||||||
$scope.isAgendaProjected = function (tree) {
|
$scope.isAgendaProjected = function (tree) {
|
||||||
// Returns true if there is a projector element with the name
|
// Returns the ids of all projectors with an element with
|
||||||
// 'agenda/item-list'.
|
// the name 'agenda/item-list'. Else returns an empty list.
|
||||||
var predicate = function (element) {
|
var predicate = function (element) {
|
||||||
var value;
|
var value;
|
||||||
if (tree) {
|
if (tree) {
|
||||||
@ -302,13 +302,13 @@ angular.module('OpenSlidesApp.agenda.site', [
|
|||||||
}
|
}
|
||||||
return value;
|
return value;
|
||||||
};
|
};
|
||||||
var projectorId = 0;
|
var projectorIds = [];
|
||||||
$scope.projectors.forEach(function (projector) {
|
$scope.projectors.forEach(function (projector) {
|
||||||
if (typeof _.findKey(projector.elements, predicate) === 'string') {
|
if (typeof _.findKey(projector.elements, predicate) === 'string') {
|
||||||
projectorId = projector.id;
|
projectorIds.push(projector.id);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
return projectorId;
|
return projectorIds;
|
||||||
};
|
};
|
||||||
// auto numbering of agenda items
|
// auto numbering of agenda items
|
||||||
$scope.autoNumbering = function() {
|
$scope.autoNumbering = function() {
|
||||||
@ -580,18 +580,18 @@ angular.module('OpenSlidesApp.agenda.site', [
|
|||||||
};
|
};
|
||||||
// same logic as in core/base.js
|
// same logic as in core/base.js
|
||||||
$scope.isCurrentLoSProjected = function () {
|
$scope.isCurrentLoSProjected = function () {
|
||||||
// Returns the projector id if there is a projector element with the name
|
// Returns the ids of all projectors with an element with the name
|
||||||
// 'agenda/current-list-of-speakers'. Elsewise returns 0.
|
// 'agenda/current-list-of-speakers'. Elsewise returns an empty list.
|
||||||
var projectorId = 0;
|
var projectorIds = [];
|
||||||
$scope.projectors.forEach(function (projector) {
|
$scope.projectors.forEach(function (projector) {
|
||||||
var key = _.findKey(projector.elements, function (element) {
|
var key = _.findKey(projector.elements, function (element) {
|
||||||
return element.name == 'agenda/current-list-of-speakers';
|
return element.name == 'agenda/current-list-of-speakers';
|
||||||
});
|
});
|
||||||
if (typeof key === 'string') {
|
if (typeof key === 'string') {
|
||||||
projectorId = projector.id;
|
projectorIds.push(projector.id);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
return projectorId;
|
return projectorIds;
|
||||||
};
|
};
|
||||||
|
|
||||||
// go to the list of speakers (management) of the currently
|
// go to the list of speakers (management) of the currently
|
||||||
|
@ -15,24 +15,24 @@
|
|||||||
<!-- project -->
|
<!-- project -->
|
||||||
<div class="form-inline button">
|
<div class="form-inline button">
|
||||||
<div os-perms="core.can_manage_projector" class="btn-group" uib-dropdown
|
<div os-perms="core.can_manage_projector" class="btn-group" uib-dropdown
|
||||||
uib-tooltip="{{ 'Projector' | translate }} {{ isCurrentLoSProjected() }}"
|
uib-tooltip="{{ 'Projector' | translate }} {{ isCurrentLoSProjected()[0] || '' }}"
|
||||||
tooltip-enable="isCurrentLoSProjected() > 0">
|
tooltip-enable="isCurrentLoSProjected().length">
|
||||||
<button type="button" class="btn btn-default btn-sm"
|
<button type="button" class="btn btn-default btn-sm"
|
||||||
title="{{ 'Project current list of speakers' | translate }}"
|
title="{{ 'Project current list of speakers' | translate }}"
|
||||||
ng-click="projectCurrentLoS(defaultProjectorId)"
|
ng-click="projectCurrentLoS(defaultProjectorId)"
|
||||||
ng-class="{ 'btn-primary': isCurrentLoSProjected() > 0 && isCurrentLoSProjected() == defaultProjectorId}">
|
ng-class="{ 'btn-primary': isCurrentLoSProjected().length && inArray(isCurrentLoSProjected(), defaultProjectorId) }">
|
||||||
<i class="fa fa-video-camera"></i>
|
<i class="fa fa-video-camera"></i>
|
||||||
<translate>Current list of speakers</translate>
|
<translate>Current list of speakers</translate>
|
||||||
</button>
|
</button>
|
||||||
<button type="button" class="btn btn-default btn-sm" uib-dropdown-toggle
|
<button type="button" class="btn btn-default btn-sm" uib-dropdown-toggle
|
||||||
ng-class="{ 'btn-primary': isCurrentLoSProjected() > 0 && isCurrentLoSProjected() != defaultProjectorId}">
|
ng-class="{ 'btn-primary': isCurrentLoSProjected().length && !inArray(isCurrentLoSProjected(), defaultProjectorId) }">
|
||||||
<span class="caret"></span>
|
<span class="caret"></span>
|
||||||
</button>
|
</button>
|
||||||
<ul class="dropdown-menu" role="menu" aria-labelledby="split-button">
|
<ul class="dropdown-menu" role="menu" aria-labelledby="split-button">
|
||||||
<li role="menuitem" ng-repeat="projector in projectors">
|
<li role="menuitem" ng-repeat="projector in projectors">
|
||||||
<a href="" ng-click="projectCurrentLoS(projector.id)"
|
<a href="" ng-click="projectCurrentLoS(projector.id)"
|
||||||
ng-class="{ 'projected': isCurrentLoSProjected() == projector.id }">
|
ng-class="{ 'projected': inArray(isCurrentLoSProjected(), projector.id) }">
|
||||||
<i class="fa fa-video-camera" ng-show="isCurrentLoSProjected() == projector.id"></i>
|
<i class="fa fa-video-camera" ng-show="inArray(isCurrentLoSProjected(), projector.id) "></i>
|
||||||
{{ projector.name }}
|
{{ projector.name }}
|
||||||
<span ng-if="projector.id == defaultProjectorId">(<translate>Default</translate>)</span>
|
<span ng-if="projector.id == defaultProjectorId">(<translate>Default</translate>)</span>
|
||||||
</a>
|
</a>
|
||||||
|
@ -11,17 +11,17 @@
|
|||||||
</a>
|
</a>
|
||||||
<!-- project list of speakers -->
|
<!-- project list of speakers -->
|
||||||
<span class="btn-group" style="min-width:54px;" uib-dropdown
|
<span class="btn-group" style="min-width:54px;" uib-dropdown
|
||||||
uib-tooltip="{{ 'Projector' | translate }} {{ item.isListOfSpeakersProjected() }}"
|
uib-tooltip="{{ 'Projector' | translate }} {{ item.isListOfSpeakersProjected()[0] || '' }}"
|
||||||
tooltip-enable="item.isListofSpeakersProjected() > 0"
|
tooltip-enable="item.isListofSpeakersProjected().length"
|
||||||
os-perms="core.can_manage_projector">
|
os-perms="core.can_manage_projector">
|
||||||
<button type="button" class="btn btn-default btn-sm"
|
<button type="button" class="btn btn-default btn-sm"
|
||||||
ng-click="item.projectListOfSpeakers(defaultProjectorListOfSpeakersId)"
|
ng-click="item.projectListOfSpeakers(defaultProjectorListOfSpeakersId)"
|
||||||
ng-class="{ 'btn-primary': item.isListOfSpeakersProjected() == defaultProjectorListOfSpeakersId }">
|
ng-class="{ 'btn-primary': inArray(item.isListOfSpeakersProjected(), defaultProjectorListOfSpeakersId) }">
|
||||||
<i class="fa fa-video-camera"></i>
|
<i class="fa fa-video-camera"></i>
|
||||||
<translate>List of speakers</translate>
|
<translate>List of speakers</translate>
|
||||||
</button>
|
</button>
|
||||||
<button type="button" class="btn btn-default btn-sm slimDropDown"
|
<button type="button" class="btn btn-default btn-sm slimDropDown"
|
||||||
ng-class="{ 'btn-primary': (item.isListOfSpeakersProjected() > 0 && item.isListOfSpeakersProjected() != defaultProjectorListOfSpeakersId) }"
|
ng-class="{ 'btn-primary': (item.isListOfSpeakersProjected().length && !inArray(item.isListOfSpeakersProjected(), defaultProjectorListOfSpeakersId) ) }"
|
||||||
ng-if="projectors.length > 1"
|
ng-if="projectors.length > 1"
|
||||||
uib-dropdown-toggle>
|
uib-dropdown-toggle>
|
||||||
<span class="caret"></span>
|
<span class="caret"></span>
|
||||||
@ -29,8 +29,8 @@
|
|||||||
<ul class="dropdown-menu" ng-if="projectors.length > 1">
|
<ul class="dropdown-menu" ng-if="projectors.length > 1">
|
||||||
<li role="menuitem" ng-repeat="projector in projectors">
|
<li role="menuitem" ng-repeat="projector in projectors">
|
||||||
<a href="" ng-click="item.projectListOfSpeakers(projector.id)"
|
<a href="" ng-click="item.projectListOfSpeakers(projector.id)"
|
||||||
ng-class="{ 'projected': (item.isListOfSpeakersProjected() == projector.id) }">
|
ng-class="{ 'projected': inArray(item.isListOfSpeakersProjected(), projector.id) }">
|
||||||
<i class="fa fa-video-camera" ng-show="item.isListOfSpeakersProjected() == projector.id"></i>
|
<i class="fa fa-video-camera" ng-show="inArray(item.isListOfSpeakersProjected(), projector.id) "></i>
|
||||||
{{ projector.name }}
|
{{ projector.name }}
|
||||||
<span ng-if="defaultProjectorListOfSpeakersId == projector.id">(<translate>Default</translate>)</span>
|
<span ng-if="defaultProjectorListOfSpeakersId == projector.id">(<translate>Default</translate>)</span>
|
||||||
</a>
|
</a>
|
||||||
|
@ -21,18 +21,18 @@
|
|||||||
</a>
|
</a>
|
||||||
<!-- project agenda button -->
|
<!-- project agenda button -->
|
||||||
<div class="btn-group button" uib-dropdown
|
<div class="btn-group button" uib-dropdown
|
||||||
uib-tooltip="{{ 'Projector' | translate }} {{ isAgendaProjected(mainListTree) }}"
|
uib-tooltip="{{ 'Projector' | translate }} {{ isAgendaProjected(mainListTree)[0] || '' }}"
|
||||||
tooltip-enable="isAgendaProjected(mainListTree) > 0"
|
tooltip-enable="isAgendaProjected(mainListTree).length"
|
||||||
os-perms="core.can_manage_projector">
|
os-perms="core.can_manage_projector">
|
||||||
<button type="button" class="btn btn-default btn-sm"
|
<button type="button" class="btn btn-default btn-sm"
|
||||||
title="{{ 'Project agenda' | translate }}"
|
title="{{ 'Project agenda' | translate }}"
|
||||||
ng-click="projectAgenda(defaultProjectorId_all_items, mainListTree)"
|
ng-click="projectAgenda(defaultProjectorId_all_items, mainListTree)"
|
||||||
ng-class="{ 'btn-primary': isAgendaProjected(mainListTree) > 0 && isAgendaProjected(mainListTree) == defaultProjectorId_all_items}">
|
ng-class="{ 'btn-primary': isAgendaProjected(mainListTree).length && inArray(isAgendaProjected(mainListTree), defaultProjectorId_all_items)}">
|
||||||
<i class="fa fa-video-camera"></i>
|
<i class="fa fa-video-camera"></i>
|
||||||
<translate>Agenda</translate>
|
<translate>Agenda</translate>
|
||||||
</button>
|
</button>
|
||||||
<button type="button" class="btn btn-default btn-sm" uib-dropdown-toggle
|
<button type="button" class="btn btn-default btn-sm" uib-dropdown-toggle
|
||||||
ng-class="{ 'btn-primary': isAgendaProjected(mainListTree) > 0 && isAgendaProjected(mainListTree) != defaultProjectorId_all_items}"
|
ng-class="{ 'btn-primary': isAgendaProjected(mainListTree).length && !inArray(isAgendaProjected(mainListTree), defaultProjectorId_all_items)}"
|
||||||
ng-if="agendaHasSubitems || projectors.length > 1">
|
ng-if="agendaHasSubitems || projectors.length > 1">
|
||||||
<span class="caret"></span>
|
<span class="caret"></span>
|
||||||
</button>
|
</button>
|
||||||
@ -46,8 +46,8 @@
|
|||||||
<li class="divider" ng-show="agendaHasSubitems && projectors.length > 1"></li>
|
<li class="divider" ng-show="agendaHasSubitems && projectors.length > 1"></li>
|
||||||
<li role="menuitem" ng-repeat="projector in projectors" ng-show="projectors.length > 1">
|
<li role="menuitem" ng-repeat="projector in projectors" ng-show="projectors.length > 1">
|
||||||
<a href="" ng-click="projectAgenda(projectorId=projector.id, tree=mainListTree)"
|
<a href="" ng-click="projectAgenda(projectorId=projector.id, tree=mainListTree)"
|
||||||
ng-class="{ 'projected': isAgendaProjected(mainListTree) == projector.id }">
|
ng-class="{ 'projected': inArray(isAgendaProjected(mainListTree), projector.id) }">
|
||||||
<i class="fa fa-video-camera" ng-show="isAgendaProjected(mainListTree) == projector.id"></i>
|
<i class="fa fa-video-camera" ng-show="inArray(isAgendaProjected(mainListTree), projector.id) "></i>
|
||||||
{{ projector.name }}
|
{{ projector.name }}
|
||||||
<span ng-if="projector.id == defaultProjectorId_all_items">(<translate>Default</translate>)</span>
|
<span ng-if="projector.id == defaultProjectorId_all_items">(<translate>Default</translate>)</span>
|
||||||
</a>
|
</a>
|
||||||
@ -162,20 +162,20 @@
|
|||||||
filter: {is_hidden: filter.showHiddenItems} | filter: {closed: filter.showClosedItems}) |
|
filter: {is_hidden: filter.showHiddenItems} | filter: {closed: filter.showClosedItems}) |
|
||||||
limitTo : itemsPerPage : limitBegin"
|
limitTo : itemsPerPage : limitBegin"
|
||||||
class="animate-item"
|
class="animate-item"
|
||||||
ng-class="{ 'activeline': item.isProjected(), 'selected': item.selected, 'hiddenrow': item.is_hidden}">
|
ng-class="{ 'activeline': item.isProjected().length, 'selected': item.selected, 'hiddenrow': item.is_hidden}">
|
||||||
<!-- projector column -->
|
<!-- projector column -->
|
||||||
<td ng-show="!isDeleteMode" os-perms="core.can_manage_projector">
|
<td ng-show="!isDeleteMode" os-perms="core.can_manage_projector">
|
||||||
<div class="btn-group" style="min-width:{{ (item.hasSubitems(items) || projectors.length > 1) ? '54' : '34' }}px;" uib-dropdown
|
<div class="btn-group" style="min-width:{{ (item.hasSubitems(items) || projectors.length > 1) ? '54' : '34' }}px;" uib-dropdown
|
||||||
uib-tooltip="{{ 'Projector' | translate }} {{ item.isProjected(item.tree) }}"
|
uib-tooltip="{{ 'Projector' | translate }} {{ item.isProjected(item.tree)[0] || '' }}"
|
||||||
tooltip-enable="item.isProjected(item.tree) > 0">
|
tooltip-enable="item.isProjected(item.tree).length">
|
||||||
<button class="btn btn-default btn-sm"
|
<button class="btn btn-default btn-sm"
|
||||||
title="{{ 'Project item' | translate }}"
|
title="{{ 'Project item' | translate }}"
|
||||||
ng-click="item.project(getProjectionDefault(item), item.tree)"
|
ng-click="item.project(getProjectionDefault(item), item.tree)"
|
||||||
ng-class="{ 'btn-primary': item.isProjected(item.tree) > 0 && item.isProjected(item.tree) == getProjectionDefault(item)}">
|
ng-class="{ 'btn-primary': item.isProjected(item.tree).length && inArray(item.isProjected(item.tree), getProjectionDefault(item))}">
|
||||||
<i class="fa fa-video-camera"></i>
|
<i class="fa fa-video-camera"></i>
|
||||||
</button>
|
</button>
|
||||||
<button type="button" class="btn btn-default btn-sm slimDropDown"
|
<button type="button" class="btn btn-default btn-sm slimDropDown"
|
||||||
ng-class="{ 'btn-primary': item.isProjected(item.tree) > 0 && item.isProjected(item.tree) != getProjectionDefault(item)}"
|
ng-class="{ 'btn-primary': item.isProjected(item.tree).length && !inArray(item.isProjected(item.tree), getProjectionDefault(item))}"
|
||||||
ng-if="item.hasSubitems(items) || projectors.length > 1"
|
ng-if="item.hasSubitems(items) || projectors.length > 1"
|
||||||
uib-dropdown-toggle>
|
uib-dropdown-toggle>
|
||||||
<span class="caret"></span>
|
<span class="caret"></span>
|
||||||
@ -191,8 +191,8 @@
|
|||||||
<li class="divider" ng-show="item.hasSubitems(items)"></li>
|
<li class="divider" ng-show="item.hasSubitems(items)"></li>
|
||||||
<li role="menuitem" ng-repeat="projector in projectors">
|
<li role="menuitem" ng-repeat="projector in projectors">
|
||||||
<a href="" ng-click="item.project(projector.id, item.tree)"
|
<a href="" ng-click="item.project(projector.id, item.tree)"
|
||||||
ng-class="{ 'projected': item.isProjected(item.tree) == projector.id }">
|
ng-class="{ 'projected': inArray(item.isProjected(item.tree), projector.id) }">
|
||||||
<i class="fa fa-video-camera" ng-show="item.isProjected(item.tree) == projector.id"></i>
|
<i class="fa fa-video-camera" ng-show="inArray(item.isProjected(item.tree), projector.id)"></i>
|
||||||
{{ projector.name }}
|
{{ projector.name }}
|
||||||
<span ng-if="projector.id == getProjectionDefault(item)">(<translate>Default</translate>)</span>
|
<span ng-if="projector.id == getProjectionDefault(item)">(<translate>Default</translate>)</span>
|
||||||
</a>
|
</a>
|
||||||
|
@ -281,8 +281,8 @@ angular.module('OpenSlidesApp.assignments', [])
|
|||||||
},
|
},
|
||||||
// override isProjected function of jsDataModel factory
|
// override isProjected function of jsDataModel factory
|
||||||
isProjected: function (poll_id) {
|
isProjected: function (poll_id) {
|
||||||
// Returns the id of the last projector found with an element
|
// Returns the ids of all projectors with an element
|
||||||
// with the name 'assignments/assignment'.
|
// with the name 'assignments/assignment'. Else returns an empty list.
|
||||||
var self = this;
|
var self = this;
|
||||||
var predicate = function (element) {
|
var predicate = function (element) {
|
||||||
var value;
|
var value;
|
||||||
@ -302,13 +302,13 @@ angular.module('OpenSlidesApp.assignments', [])
|
|||||||
}
|
}
|
||||||
return value;
|
return value;
|
||||||
};
|
};
|
||||||
var isProjected = 0;
|
var isProjectedIds = [];
|
||||||
Projector.getAll().forEach(function (projector) {
|
Projector.getAll().forEach(function (projector) {
|
||||||
if (typeof _.findKey(projector.elements, predicate) === 'string') {
|
if (typeof _.findKey(projector.elements, predicate) === 'string') {
|
||||||
isProjected = projector.id;
|
isProjectedIds.push(projector.id);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
return isProjected;
|
return isProjectedIds;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
relations: {
|
relations: {
|
||||||
|
@ -117,7 +117,7 @@
|
|||||||
<tr ng-repeat="assignment in assignmentsFiltered = (assignments | osFilter: filter.search : getFilterString |
|
<tr ng-repeat="assignment in assignmentsFiltered = (assignments | osFilter: filter.search : getFilterString |
|
||||||
filter: {phase: phaseFilter} | orderBy: sortColumn:reverse)"
|
filter: {phase: phaseFilter} | orderBy: sortColumn:reverse)"
|
||||||
class="animate-item"
|
class="animate-item"
|
||||||
ng-class="{ 'activeline': assignment.isProjected(), 'selected': assignment.selected }">
|
ng-class="{ 'activeline': assignment.isProjected().length, 'selected': assignment.selected }">
|
||||||
|
|
||||||
<!-- projector -->
|
<!-- projector -->
|
||||||
<td ng-show="!isDeleteMode" os-perms="core.can_manage_projector">
|
<td ng-show="!isDeleteMode" os-perms="core.can_manage_projector">
|
||||||
|
@ -256,6 +256,16 @@ angular.module('OpenSlidesApp.core', [
|
|||||||
}
|
}
|
||||||
])
|
])
|
||||||
|
|
||||||
|
// Make the indexOf available in every scope; needed for the projectorbuttons
|
||||||
|
.run([
|
||||||
|
'$rootScope',
|
||||||
|
function ($rootScope) {
|
||||||
|
$rootScope.inArray = function (array, value) {
|
||||||
|
return _.indexOf(array, value) > -1;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
])
|
||||||
|
|
||||||
.factory('loadGlobalData', [
|
.factory('loadGlobalData', [
|
||||||
'ChatMessage',
|
'ChatMessage',
|
||||||
'Config',
|
'Config',
|
||||||
@ -393,23 +403,21 @@ angular.module('OpenSlidesApp.core', [
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
BaseModel.prototype.isProjected = function() {
|
BaseModel.prototype.isProjected = function() {
|
||||||
// Returns the projector id if there is a projector element
|
// Returns the ids of all projectors if there is a projector element
|
||||||
// with the same name and the same id. Else returns 0.
|
// with the same name and the same id. Else returns an empty list.
|
||||||
// Attention: if this element is projected multiple times, only the
|
|
||||||
// id of the last projector is returned.
|
|
||||||
var self = this;
|
var self = this;
|
||||||
var predicate = function (element) {
|
var predicate = function (element) {
|
||||||
return element.name == self.getResourceName() &&
|
return element.name == self.getResourceName() &&
|
||||||
typeof element.id !== 'undefined' &&
|
typeof element.id !== 'undefined' &&
|
||||||
element.id == self.id;
|
element.id == self.id;
|
||||||
};
|
};
|
||||||
var isProjectedId = 0;
|
var isProjectedIds = [];
|
||||||
Projector.getAll().forEach(function (projector) {
|
Projector.getAll().forEach(function (projector) {
|
||||||
if (typeof _.findKey(projector.elements, predicate) === 'string') {
|
if (typeof _.findKey(projector.elements, predicate) === 'string') {
|
||||||
isProjectedId = projector.id;
|
isProjectedIds.push(projector.id);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
return isProjectedId;
|
return isProjectedIds;
|
||||||
};
|
};
|
||||||
return BaseModel;
|
return BaseModel;
|
||||||
}
|
}
|
||||||
|
@ -1,15 +1,15 @@
|
|||||||
<div class="btn-group" style="min-width:{{ projectors.length > 1 ? '54' : '34' }}px;" uib-dropdown
|
<div class="btn-group" style="min-width:{{ projectors.length > 1 ? '54' : '34' }}px;" uib-dropdown
|
||||||
uib-tooltip="{{ 'Projector' | translate }} {{ model.isProjected(arg) }}"
|
uib-tooltip="{{ 'Projector' | translate }} {{ model.isProjected(arg)[0] || '' }}"
|
||||||
tooltip-enable="model.isProjected(arg) > 0"
|
tooltip-enable="model.isProjected(arg).length"
|
||||||
os-perms="core.can_manage_projector">
|
os-perms="core.can_manage_projector">
|
||||||
<button type="button" class="btn btn-default btn-sm"
|
<button type="button" class="btn btn-default btn-sm"
|
||||||
ng-click="model.project(defaultProjectorId, arg)"
|
ng-click="model.project(defaultProjectorId, arg)"
|
||||||
ng-class="{ 'btn-primary': model.isProjected(arg) == defaultProjectorId }">
|
ng-class="{ 'btn-primary': inArray(model.isProjected(arg), defaultProjectorId) }">
|
||||||
<i class="fa fa-video-camera"></i>
|
<i class="fa fa-video-camera"></i>
|
||||||
{{ content }}
|
{{ content }}
|
||||||
</button>
|
</button>
|
||||||
<button type="button" class="btn btn-default btn-sm slimDropDown"
|
<button type="button" class="btn btn-default btn-sm slimDropDown"
|
||||||
ng-class="{ 'btn-primary': (model.isProjected(arg) > 0 && model.isProjected(arg) != defaultProjectorId) }"
|
ng-class="{ 'btn-primary': (model.isProjected(arg).length && !inArray(model.isProjected(arg), defaultProjectorId)) }"
|
||||||
ng-if="projectors.length > 1"
|
ng-if="projectors.length > 1"
|
||||||
uib-dropdown-toggle>
|
uib-dropdown-toggle>
|
||||||
<span class="caret"></span>
|
<span class="caret"></span>
|
||||||
@ -17,8 +17,8 @@
|
|||||||
<ul class="dropdown-menu" ng-if="projectors.length > 1">
|
<ul class="dropdown-menu" ng-if="projectors.length > 1">
|
||||||
<li role="menuitem" ng-repeat="projector in projectors">
|
<li role="menuitem" ng-repeat="projector in projectors">
|
||||||
<a href="" ng-click="model.project(projector.id, arg)"
|
<a href="" ng-click="model.project(projector.id, arg)"
|
||||||
ng-class="{ 'projected': (model.isProjected(arg) == projector.id) }">
|
ng-class="{ 'projected': inArray(model.isProjected(arg), projector.id) }">
|
||||||
<i class="fa fa-video-camera" ng-show="model.isProjected(arg) == projector.id"></i>
|
<i class="fa fa-video-camera" ng-show="inArray(model.isProjected(arg), projector.id)"></i>
|
||||||
{{ projector.name }}
|
{{ projector.name }}
|
||||||
<span ng-if="defaultProjectorId == projector.id">(<translate>Default</translate>)</span>
|
<span ng-if="defaultProjectorId == projector.id">(<translate>Default</translate>)</span>
|
||||||
</a>
|
</a>
|
||||||
|
@ -197,21 +197,21 @@
|
|||||||
<tr ng-repeat="mediafile in mediafilesFiltered = (mediafiles | privateFilter | osFilter: filter.search : getFilterString |
|
<tr ng-repeat="mediafile in mediafilesFiltered = (mediafiles | privateFilter | osFilter: filter.search : getFilterString |
|
||||||
filter: {filetype: filter.showPDFs} | orderBy: sortColumn:reverse )"
|
filter: {filetype: filter.showPDFs} | orderBy: sortColumn:reverse )"
|
||||||
class="animate-item"
|
class="animate-item"
|
||||||
ng-class="{ 'activeline': mediafile.isProjected(), 'selected': mediafile.selected }">
|
ng-class="{ 'activeline': mediafile.isProjected().length, 'selected': mediafile.selected }">
|
||||||
<!-- projector column -->
|
<!-- projector column -->
|
||||||
<td ng-show="!isDeleteMode"
|
<td ng-show="!isDeleteMode"
|
||||||
os-perms="core.can_manage_projector">
|
os-perms="core.can_manage_projector">
|
||||||
<div class="btn-group" style="min-width:{{ projectors.length > 1 ? '54' : '34' }}px;" uib-dropdown
|
<div class="btn-group" style="min-width:{{ projectors.length > 1 ? '54' : '34' }}px;" uib-dropdown
|
||||||
ng-if="mediafile.is_presentable"
|
ng-if="mediafile.is_presentable"
|
||||||
uib-tooltip="{{ 'Projector' | translate }} {{ mediafile.isProjected() }}"
|
uib-tooltip="{{ 'Projector' | translate }} {{ mediafile.isProjected()[0] || '' }}"
|
||||||
tooltip-enable="mediafile.isProjected() > 0">
|
tooltip-enable="mediafile.isProjected().length">
|
||||||
<button type="button" class="btn btn-default btn-sm"
|
<button type="button" class="btn btn-default btn-sm"
|
||||||
ng-click="showMediafile(defaultProjectorId, mediafile)"
|
ng-click="showMediafile(defaultProjectorId, mediafile)"
|
||||||
ng-class="{ 'btn-primary': mediafile.isProjected() == defaultProjectorId }">
|
ng-class="{ 'btn-primary': inArray(mediafile.isProjected(), defaultProjectorId) }">
|
||||||
<i class="fa fa-video-camera"></i>
|
<i class="fa fa-video-camera"></i>
|
||||||
</button>
|
</button>
|
||||||
<button type="button" class="btn btn-default btn-sm slimDropDown"
|
<button type="button" class="btn btn-default btn-sm slimDropDown"
|
||||||
ng-class="{ 'btn-primary': (mediafile.isProjected() > 0 && mediafile.isProjected() != defaultProjectorId) }"
|
ng-class="{ 'btn-primary': (mediafile.isProjected().length && !inArray(mediafile.isProjected(), defaultProjectorId) ) }"
|
||||||
ng-if="projectors.length > 1"
|
ng-if="projectors.length > 1"
|
||||||
uib-dropdown-toggle>
|
uib-dropdown-toggle>
|
||||||
<span class="caret"></span>
|
<span class="caret"></span>
|
||||||
@ -219,8 +219,8 @@
|
|||||||
<ul class="dropdown-menu" ng-if="projectors.length > 1">
|
<ul class="dropdown-menu" ng-if="projectors.length > 1">
|
||||||
<li role="menuitem" ng-repeat="projector in projectors">
|
<li role="menuitem" ng-repeat="projector in projectors">
|
||||||
<a href="" ng-click="showMediafile(projector.id, mediafile)"
|
<a href="" ng-click="showMediafile(projector.id, mediafile)"
|
||||||
ng-class="{ 'projected': (mediafile.isProjected() == projector.id) }">
|
ng-class="{ 'projected': inArray(mediafile.isProjected(), projector.id) }">
|
||||||
<i class="fa fa-video-camera" ng-show="mediafile.isProjected() == projector.id"></i>
|
<i class="fa fa-video-camera" ng-show="inArray(mediafile.isProjected(), projector.id) "></i>
|
||||||
{{ projector.name }}
|
{{ projector.name }}
|
||||||
<span ng-if="defaultProjectorId == projector.id">(<translate>Default</translate>)</span>
|
<span ng-if="defaultProjectorId == projector.id">(<translate>Default</translate>)</span>
|
||||||
</a>
|
</a>
|
||||||
|
@ -63,7 +63,7 @@
|
|||||||
<translate>go</translate>
|
<translate>go</translate>
|
||||||
</button>
|
</button>
|
||||||
<button type="button" class="btn btn-sm btn-default" os-perms="core.can_manage_projector"
|
<button type="button" class="btn btn-sm btn-default" os-perms="core.can_manage_projector"
|
||||||
ng-show="lineNumberMode != 'none' && motion.isProjected()"
|
ng-show="lineNumberMode != 'none' && motion.isProjected().length"
|
||||||
ng-click="toggleLinesForProjector()"
|
ng-click="toggleLinesForProjector()"
|
||||||
uib-tooltip="{{ 'Show highlighted line also on projector.' | translate }}">
|
uib-tooltip="{{ 'Show highlighted line also on projector.' | translate }}">
|
||||||
<i class="fa" ng-class="linesForProjector ? 'fa-check-square-o' : 'fa-square-o'"></i>
|
<i class="fa" ng-class="linesForProjector ? 'fa-check-square-o' : 'fa-square-o'"></i>
|
||||||
|
@ -352,7 +352,7 @@
|
|||||||
<!-- data row -->
|
<!-- data row -->
|
||||||
<div class="row data-row" ng-mouseover="motion.hover=true"
|
<div class="row data-row" ng-mouseover="motion.hover=true"
|
||||||
ng-mouseleave="motion.hover=false"
|
ng-mouseleave="motion.hover=false"
|
||||||
ng-class="{'projected': motion.isProjected()}"
|
ng-class="{'projected': motion.isProjected().length}"
|
||||||
ng-repeat="motion in motionsFiltered = (motions
|
ng-repeat="motion in motionsFiltered = (motions
|
||||||
| osFilter: filter.search : getFilterString
|
| osFilter: filter.search : getFilterString
|
||||||
| SelectMultipleFilter: multiselectFilter.state : getItemId.state
|
| SelectMultipleFilter: multiselectFilter.state : getItemId.state
|
||||||
|
@ -182,7 +182,7 @@
|
|||||||
</i>
|
</i>
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr ng-repeat="user in usersFiltered | limitTo : itemsPerPage : limitBegin" class="animate-item"
|
<tr ng-repeat="user in usersFiltered | limitTo : itemsPerPage : limitBegin" class="animate-item"
|
||||||
ng-class="{ 'activeline': user.isProjected(), 'selected': user.selected }">
|
ng-class="{ 'activeline': user.isProjected().length, 'selected': user.selected }">
|
||||||
<!-- projector column -->
|
<!-- projector column -->
|
||||||
<td ng-show="!isSelectMode" os-perms="core.can_manage_projector">
|
<td ng-show="!isSelectMode" os-perms="core.can_manage_projector">
|
||||||
<projector-button model="user" default-projector-id="defaultProjectorId">
|
<projector-button model="user" default-projector-id="defaultProjectorId">
|
||||||
|
Loading…
Reference in New Issue
Block a user