Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

last changes #1

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -377,14 +377,14 @@ public void MirrorText(bool? isMirroredX, bool? isMirroredY)
Clients.OthersInGroup(GetGroupName()).mirrorText(isMirroredX, isMirroredY);
}

public void HandPlay()
public void HandPlay(double TextAreaPosition)
{
Clients.All.handPlay();
Clients.All.handPlay(TextAreaPosition);
}

public void HandPlayBack()
public void HandPlayBack(double TextAreaPosition)
{
Clients.All.handPlayBack();
Clients.All.handPlayBack(TextAreaPosition);
}

public void PadRight(int percentage)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -502,11 +502,13 @@
<button class="btn btn-default move-left glyphicon glyphicon-backward move-left"
ng-mousedown="handPlayBack()"
ng-mouseup="pause()"
ng-mouseleave="puauseIfMouseUp()"
ng-disabled="isHandPlayDisabled"></button>

<button class="btn btn-default move-left glyphicon glyphicon-forward move-left"
ng-mousedown="handPlay()"
ng-mouseup="pause()"
ng-mouseleave="puauseIfMouseUp()"
ng-disabled="isHandPlayDisabled"></button>

<button class="btn btn-default move-left"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
$scope.speed = 2;
$scope.velocity = startVelocity;
$scope.speedIndicator = 0;
$scope.speedHandlPlay = 10;
$scope.speedHandlPlay = 15;
$scope.currentSize = $scope.textSizes[6];
$scope.textSize = 90;
$scope.isPlayDisabled = false;
Expand Down Expand Up @@ -205,38 +205,53 @@
}, $scope.velocity);
}

var IsHandPlaying = false;
$scope.textAreaposition = textBox.scrollTop();

$scope.handPlayBack = function () {
$scope.textAreaposition = textBox.scrollTop();
IsHandPlaying = true;
$scope.isHandPlayDisabled = false;
$scope.isPlayDisabled = false;
broadcastHub.server.handPlayBack();
broadcastHub.server.handPlayBack($scope.textAreaposition);
}

broadcastHub.client.handPlayBack = function () {
broadcastHub.client.handPlayBack = function (textAreaposition) {
clearInterval(animation);
animation = setInterval(function () {
if (textBox.scrollTop() > 0) {
textBox.scrollTop(textBox.scrollTop() - $scope.speedHandlPlay);
$scope.textAreaposition -= $scope.speedHandlPlay;
textBox.scrollTop($scope.textAreaposition);
}
}, $scope.velocity);
}

$scope.handPlay = function () {
$scope.textAreaposition = textBox.scrollTop();
IsHandPlaying = true;
$scope.isHandPlayDisabled = false;
$scope.isPlayDisabled = false;
broadcastHub.server.handPlay();
broadcastHub.server.handPlay($scope.textAreaposition);
}

broadcastHub.client.handPlay = function () {
broadcastHub.client.handPlay = function (textAreaposition) {
clearInterval(animation);
animation = setInterval(function () {
if (textBox.scrollTop() <= textBox.get(0).scrollHeight) {
textBox.scrollTop(textBox.scrollTop() + $scope.speedHandlPlay);
$scope.textAreaposition += $scope.speedHandlPlay;
textBox.scrollTop($scope.textAreaposition);
}
}, $scope.velocity);
}

$scope.puauseIfMouseUp = function () {
if (IsHandPlaying == true) {
$scope.pause();
}
}

$scope.pause = function () {
IsHandPlaying = false;
$scope.isHandPlayDisabled = false;
$scope.isPlayDisabled = false;
broadcastHub.invoke('pause');
Expand All @@ -263,7 +278,7 @@
speedBtnClicked = true;
broadcastHub.server.speedUp();
$scope.speedIndicator++;
setTimeout(function () { speedBtnClicked = false; }, 500);
setTimeout(function () { speedBtnClicked = false; }, 300);
}
}

Expand All @@ -277,7 +292,7 @@
speedBtnClicked = true;
broadcastHub.server.speedDown();
$scope.speedIndicator--;
setTimeout(function () { speedBtnClicked = false; }, 500);
setTimeout(function () { speedBtnClicked = false; }, 300);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
//for adding text into operator screen :)
var sections = $scope.sortedScripts[$scope.index].Sections;
var area = $('#area')
if (area.length == 0) {
if (area.children.length > 0) {
area.empty();
}
_.each(sections, function (section) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
$scope.showDialog = false;
$scope.speed = 2;
$scope.velocity = startVelocity;
$scope.speedHandlPlay = 10;
$scope.speedHandlPlay = 15;
$scope.currentSize = $scope.textSizes[2];
$scope.textSize = 90;
$scope.leftPadding = 0;
Expand All @@ -54,7 +54,7 @@
///
var sections = $scope.script.Sections;
var area = $('#area')
if (area.length == 0) {
if (area.children.length > 0) {
area.empty();
}
_.each(sections, function (section) {
Expand Down Expand Up @@ -165,21 +165,27 @@
textBox.css({ 'transform': 'matrix(1, 0, 0, 1, 0, 0)' });
}
}

$scope.textAreaposition = textBox.scrollTop();

broadcastHub.client.handPlayBack = function () {
broadcastHub.client.handPlayBack = function (textAreaposition) {
clearInterval(animation);
$scope.textAreaposition = textAreaposition;
animation = setInterval(function () {
if (textBox.scrollTop() > 0) {
textBox.scrollTop(textBox.scrollTop() - $scope.speedHandlPlay);
$scope.textAreaposition -= $scope.speedHandlPlay;
textBox.scrollTop($scope.textAreaposition);
}
}, $scope.velocity);
}

broadcastHub.client.handPlay = function () {
broadcastHub.client.handPlay = function (textAreaposition) {
clearInterval(animation);
$scope.textAreaposition = textAreaposition;
animation = setInterval(function () {
if (textBox.scrollTop() <= textBox.get(0).scrollHeight) {
textBox.scrollTop(textBox.scrollTop() + $scope.speedHandlPlay);
$scope.textAreaposition += $scope.speedHandlPlay;
textBox.scrollTop($scope.textAreaposition);
}
}, $scope.velocity);
}
Expand Down