Permalink
Browse files

added timeline v2

  • Loading branch information...
born2net committed Apr 17, 2017
1 parent 36146c2 commit 93ca8826f7a65e40932476767a1911b8e2a2b643
@@ -39,7 +39,6 @@
"./libs/rc4v1/rc4v1.js",
"./libs/rc4v2/rc4v2.js",
"./libs/qrcode/qrcode.js",
"./libs/ruler/ruler.js",
"./libs/bootstrap-timepicker/js/bootstrap-timepicker.min.js",
"./libs/contextmenu/bootstrap-contextmenu.js",
"./libs/stop-watch/stop-watch.js",
@@ -52,7 +51,8 @@
"./libs/gradient/colorpicker.js",
"./libs/gradient/jquery.gradientpicker.js",
"./libs/enjoyhint/enjoyhint.js",
"../node_modules/xdate/src/xdate.js"
"../node_modules/xdate/src/xdate.js",
"./libs/ruler/ruler.js"
],
"environmentSource": "environments/environment.ts",
"environments": {
@@ -31,40 +31,6 @@ export class CampaignEditor extends Compbaser {
private campaignTimelinesModel: CampaignTimelinesModel;
private channelModel: CampaignTimelineChanelsModel;
m_campaignTimelinesModels: List<CampaignTimelinesModel>;
m_campaignTimelineChanelPlayersModel: CampaignTimelineChanelPlayersModelExt;
m_isVisible1 = 'off';
m_isVisible2 = 'off';
m_toggleShowChannel = true;
id = 0
items = []
remove(id) {
let index = this.items.findIndex(item => item.id === id)
this.items.splice(index, 1)
}
reset() {
this.items = []
}
add() {
this.items.unshift({id: this.id++, name: 'item'})
}
itemMoved(state) {
console.log("Item moved", state);
}
channelAdded(state) {
console.log("Channel added", state);
}
itemAdded(state) {
console.log("Item Added", state);
}
resources = [
{
name: 'logo',
@@ -107,6 +73,22 @@ export class CampaignEditor extends Compbaser {
}
],
items: [
{
resource: "assets/sample1.png",
title: 'Logo_splash',
start: 0,
duration: 60,
channel: 0,
selected: false
},
{
resource: "assets/sample1.png",
title: 'Logo_splash',
start: 0,
duration: 160,
channel: 2,
selected: false
},
{
resource: "assets/sample1.png",
title: 'Logo_splash',
@@ -119,12 +101,48 @@ export class CampaignEditor extends Compbaser {
resource: "assets/sample3.svg",
title: '350x350',
start: 300,
duration: 60,
channel: 1,
duration: 6,
channel: 3,
selected: false
}
]
}
m_campaignTimelinesModels: List<CampaignTimelinesModel>;
m_campaignTimelineChanelPlayersModel: CampaignTimelineChanelPlayersModelExt;
m_isVisible1 = 'off';
m_isVisible2 = 'off';
m_toggleShowChannel = true;
id = 0
items = []
remove(id) {
let index = this.items.findIndex(item => item.id === id)
this.items.splice(index, 1)
}
reset() {
this.items = []
}
add() {
this.items.unshift({id: this.id++, name: 'item'})
}
itemMoved(state) {
console.log("Item moved", state);
}
channelAdded(state) {
console.log("Channel added", state);
}
itemAdded(state) {
console.log("Item Added", state);
}
constructor(private yp: YellowPepperService, private actions: AppdbAction, private rp: RedPepperService) {
super();
@@ -74,17 +74,18 @@ <h4 class="panel-title">
</button>
</h4>
</div>
<app-timeline
[resources]="resources"
[state]="state"
(itemAdded)="itemAdded($event)"
(channelAdded)="channelAdded($event)"
(itemMoved)="itemMoved($event)"
></app-timeline>
<div id="storylineContainerCollapse" class="panel-collapse collapse">
<div class="panel-body">
<aside>
<aside>
<app-timeline
[resources]="resources"
[state]="state"
(itemAdded)="itemAdded($event)"
(channelAdded)="channelAdded($event)"
(itemMoved)="itemMoved($event)"
></app-timeline>
</aside>
</aside>
</div>
@@ -114,7 +114,7 @@ export class TimelineComponent implements OnInit, AfterViewChecked {
$(this.target).addClass('ui-selected');
e.stopPropagation();
//when the user presses, we'll create an array ("companions") and populate it with all the OTHER elements that have the ".ui-selected" class applied (excluding the one that's being dragged). We also record their x and y position so that we can apply the delta to it in the onDrag.
// when the user presses, we'll create an array ("companions") and populate it with all the OTHER elements that have the ".ui-selected" class applied (excluding the one that's being dragged). We also record their x and y position so that we can apply the delta to it in the onDrag.
var boxes = $(".box.ui-selected"),
i = boxes.length;
@@ -330,7 +330,7 @@ export class TimelineComponent implements OnInit, AfterViewChecked {
$('.resizable').removeClass('ui-selected');
this.state.items.map((item) => {
item.selected = false;
})
});
}
drawChannels() {
@@ -372,7 +372,7 @@ export class TimelineComponent implements OnInit, AfterViewChecked {
};
});
//set the container's size to match the grid, and ensure that the box widths/heights reflect the variables above
// set the container's size to match the grid, and ensure that the box widths/heights reflect the variables above
this.updateContainerSize();
// update bounds for all draggable items
@@ -432,7 +432,7 @@ export class TimelineComponent implements OnInit, AfterViewChecked {
this.state.items.filter(item => item.selected)
.map((item, i) => {
this.moveItem(item, leftAlign, item.top)
this.moveItem(item, leftAlign, item.top);
});
}
@@ -18,7 +18,7 @@
"label-position": false,
"max-line-length": [
true,
240
440
],
"member-access": false,
"member-ordering": [
@@ -49,7 +49,7 @@
"no-empty": false,
"no-eval": true,
"no-inferrable-types": true,
"no-shadowed-variable": true,
"no-shadowed-variable": false,
"no-string-literal": false,
"no-switch-case-fall-through": true,
"no-trailing-whitespace": false,
@@ -67,12 +67,12 @@
false,
"single"
],
"radix": true,
"radix": false,
"semicolon": [
"always"
],
"triple-equals": [
true,
false,
"allow-null-check"
],
"typedef-whitespace": [

0 comments on commit 93ca882

Please sign in to comment.