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

Correct the 'continue' button functionality #70

Open
wants to merge 4 commits 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
7 changes: 5 additions & 2 deletions routes/routes-api.js
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,8 @@ router.post('/exportCSVfile', async (req, res) => {
item_out,
item_uicolor,
item_dataformat,
item_relpath
item_relpath,
item_steps

rundownData.templates.forEach((item,index) => {
// console.log('Iterating template index ' + index);
Expand All @@ -263,6 +264,7 @@ router.post('/exportCSVfile', async (req, res) => {
item_uicolor = item.uicolor || '0';
item_dataformat = item.dataformat || 'json';
item_relpath = item.relpath || '';
item_steps = item.steps || '1';

CSVdata = '\r\n# SPX Rundown item CSV export. (More info: https://spxgc.tawk.help/article/help-csv-files)\r\n\r\n'
CSVdata += '# description #;' + item_description + '\r\n'
Expand All @@ -274,6 +276,7 @@ router.post('/exportCSVfile', async (req, res) => {
CSVdata += '# uicolor #;' + item_uicolor + '\r\n'
CSVdata += '# dataformat #;' + item_dataformat + '\r\n'
CSVdata += '# relpath #;' + item_relpath + '\r\n'
CSVdata += '# steps #;' + item_steps + '\r\n'
CSVdata += '# onair #;false\r\n'
CSVdata += '# project #;' + showFolder + '\r\n'
CSVdata += '# rundown #;' + datafile + '\r\n'
Expand Down Expand Up @@ -374,4 +377,4 @@ async function GetDataFiles() {
} // GetDataFiles ended


module.exports = router;
module.exports = router;
15 changes: 13 additions & 2 deletions routes/routes-application.js
Original file line number Diff line number Diff line change
Expand Up @@ -624,6 +624,7 @@ router.post('/show/:foldername/config', spxAuth.CheckLogin, async (req, res) =>
if (!SPXGCTemplateDefinition.out) {SPXGCTemplateDefinition.out = "manual"};
if (!SPXGCTemplateDefinition.dataformat) {SPXGCTemplateDefinition.dataformat = "xml"};
if (!SPXGCTemplateDefinition.uicolor) {SPXGCTemplateDefinition.uicolor = "0"};
if (!SPXGCTemplateDefinition.steps) {SPXGCTemplateDefinition.steps = "1"};

// v.1.0.15 add imported timestamp
SPXGCTemplateDefinition.imported = String(Date.now()); // epoch. This COULD be used to compare template versions in profile/rundown.
Expand Down Expand Up @@ -1003,6 +1004,7 @@ router.post('/gc/:foldername/:filename/', spxAuth.CheckLogin, async (req, res) =
var t_relpath
var t_project
var t_rundown
var t_steps


let curLineItems = []
Expand Down Expand Up @@ -1069,6 +1071,10 @@ router.post('/gc/:foldername/:filename/', spxAuth.CheckLogin, async (req, res) =
t_rundown = curLineItems[1].trim();
break;

case '# steps #':
t_steps = curLineItems[1].trim();
break;


case '# FieldUUIDs #':
// this line carries f-field ids (f0, f1, etc)
Expand Down Expand Up @@ -1130,6 +1136,8 @@ router.post('/gc/:foldername/:filename/', spxAuth.CheckLogin, async (req, res) =
templateData.onair = t_onair
templateData.dataformat = t_dataformat
templateData.relpath = t_relpath
templateData.steps = t_steps


// Append warning
templateData.DataFields.push({
Expand Down Expand Up @@ -1346,6 +1354,7 @@ router.post('/gc/playout', spxAuth.CheckLogin, async (req, res) => {
dataOut.playchannel= ItemData.playchannel;
dataOut.playlayer = ItemData.playlayer;
dataOut.webplayout = ItemData.webplayout;
dataOut.steps = ItemData.steps;
dataOut.dataformat = ItemData.dataformat || 'xml'; // TODO: Move this to all template's definition objet. Values 'xml' or 'json', defaulting to 'xml'
ItemData.DataFields.forEach(item => {
// We pass data as custom JSON format and the format is changed
Expand Down Expand Up @@ -1441,14 +1450,16 @@ router.post('/gc/playout', spxAuth.CheckLogin, async (req, res) => {
let thisChannel = item.playchannel || '1';
let thisLayer = item.playlayer || '1';
let thisWeb = item.webplayout || '-';
let thisOutput = thisServer.trim() + thisChannel.trim() + thisLayer.trim() + thisWeb.trim() + thisOnair.trim();
let thisSteps = item.steps || '1';
let thisOutput = thisServer.trim() + thisChannel.trim() + thisLayer.trim() + thisWeb.trim() + thisOnair.trim() + thisSteps.trim();

let dataOnair = 'true' // because we are in play;
let dataServer = dataOut.playserver || '-';
let dataChannel = dataOut.playchannel || '1';
let dataLayer = dataOut.playlayer || '1';
let dataWeb = dataOut.webplayout || '-';
let dataOutput = dataServer.trim() + dataChannel.trim() + dataLayer.trim() + dataWeb.trim() + dataOnair.trim();
let dataSteps = dataOut.steps || '1';
let dataOutput = dataServer.trim() + dataChannel.trim() + dataLayer.trim() + dataWeb.trim() + dataOnair.trim() + dataSteps.trim();

if (index!=templateIndex && thisOutput==dataOutput){
RundownData.templates[index].onair='false';
Expand Down
3 changes: 3 additions & 0 deletions static/js/spx_fileBrowser.js
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,7 @@ function playItem() {
spxPlayoutData.playchannel = extensionConfig.template.playchannel || 1;
spxPlayoutData.playlayer = extensionConfig.template.playlayer || 10;
spxPlayoutData.webplayout = extensionConfig.template.webplayout || 10;
spxPlayoutData.steps = extensionConfig.template.steps || 1;
spxPlayoutData.relpathCCG = spxPlayoutData.relpath.split('.htm')[0];
spxPlayoutData.fields = fFields
spxPlayoutData.command = 'play';
Expand Down Expand Up @@ -292,6 +293,7 @@ function stopItem() {
spxPlayoutData.playchannel = extensionConfig.template.playchannel || 1;
spxPlayoutData.playlayer = extensionConfig.template.playlayer || 10;
spxPlayoutData.webplayout = extensionConfig.template.webplayout || 10;
spxPlayoutData.steps = extensionConfig.template.steps || 1;
spxPlayoutData.relpathCCG = spxPlayoutData.relpath.split('.htm')[0];
spxPlayoutData.command = 'stop';
if (Array.isArray(spxPlayoutData.playserver)) {
Expand Down Expand Up @@ -333,6 +335,7 @@ window.addEventListener('load', async () => {
"playchannel": 1,
"playlayer": 2,
"webplayout": 2,
"steps": 1,
"imageLayerAnimationStyle": {
"inAnimation": "fade",
"easing": "linear"
Expand Down
3 changes: 2 additions & 1 deletion views/view-showconfig.handlebars
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@
</button>
<div class="collapsiblecontent spxConfigHead" >
<form name="config{{@index}}" id="config{{@index}}" method="post" action="config/saveTemplate">
<input type="hidden" name="templateData[steps]" value="{{steps}}">
<input type="hidden" name="showFolder" value="{{../folder}}">
<input type="hidden" name="TemplIndex" value="{{@index}}">
<input type="hidden" name="templateData[DataFields]" value="{{{DataToJSONString DataFields}}}">
Expand Down Expand Up @@ -498,4 +499,4 @@
}
</script>
</body>
</html>
</html>