diff --git a/compile.js b/compile.js
index 602613d..3641efa 100644
--- a/compile.js
+++ b/compile.js
@@ -1,13 +1,15 @@
-import { execSync } from 'child_process';
import fs from "fs-extra";
console.log("Copying files...");
-const toCopy = ["data", "locales", "templates", "tmp", "trash", ".env"];
+const toCopy = ["data", "locales", "templates", "tmp", "trash"];
for (const dir of toCopy) {
console.log(`Copying ${dir}...`);
fs.cpSync(`./${dir}`, `./dist/${dir}`, {
recursive: true
- });
- console.log("done.");
-}
\ No newline at end of file
+ });
+}
+
+console.log(`Copying .env`);
+fs.cpSync(`./.env.example`, `./dist/.env`);
+console.log("Packaged infoscreen3 to /dist");
diff --git a/locales/en/translation.json b/locales/en/translation.json
index 1845dc2..1324fa9 100644
--- a/locales/en/translation.json
+++ b/locales/en/translation.json
@@ -20,6 +20,7 @@
"paste": "Paste",
"edit": "Edit",
"set": "Set",
+ "clear": "Clear",
"play": "Play",
"blackout": "Blackout",
"displayTime": "Display Time",
diff --git a/locales/fi/translation.json b/locales/fi/translation.json
index c763abd..295e82f 100644
--- a/locales/fi/translation.json
+++ b/locales/fi/translation.json
@@ -20,6 +20,7 @@
"copy": "Kopio",
"paste": "Liitä",
"set": "Aseta",
+ "clear": "Tyhjennä",
"play": "Toista",
"blackout": "Tummenna",
"displayTime": "Näytä aika",
diff --git a/public/js/dashboard.js b/public/js/dashboard.js
index 986c024..a222ce8 100644
--- a/public/js/dashboard.js
+++ b/public/js/dashboard.js
@@ -29,26 +29,26 @@ socket.on("callback.dashboard.sync", function (data) {
bundleDirs = data.bundleDirs;
displayList = data.displays;
updateControls(data.serverOptions);
-
+
// update dropdown at menu with bundles
let valueArray = [];
for (let dir of bundleDirs) {
valueArray.push({ name: dir.name, value: dir.dir });
}
-
+
$('#bundles')
- .dropdown({
- direction: "downward",
- values: valueArray,
- action: function (_label, _value) {
- $('#bundles')
- .dropdown("hide");
-
- emit("admin.setBundle", { bundle: _value });
- }
- }).dropdown("set selected", { bundle: serverOptions.currentBundle });
+ .dropdown({
+ direction: "downward",
+ values: valueArray,
+ action: function (_label, _value) {
+ $('#bundles')
+ .dropdown("hide");
+
+ emit("admin.setBundle", { bundle: _value });
+ }
+ }).dropdown("set selected", { bundle: serverOptions.currentBundle });
$('#currentBundle').text(serverOptions.currentBundle);
- $('#statusMessageAdmin').val(serverOptions.statusMessage);
+ $('#statusMessageAdmin').val(serverOptions.statusMessage.replace("
", "\n"));
// update dropdown at menu with bundles
valueArray = [];
let x = 0;
@@ -56,46 +56,46 @@ socket.on("callback.dashboard.sync", function (data) {
valueArray.push({ name: display.name, value: x });
x++;
}
-
+
$('#displays')
- .dropdown({
- direction: "downward",
- values: valueArray,
- action: function (text, value) {
- $('#displays')
- .dropdown("hide");
-
- displayId = parseInt(value);
- document.location = "/admin/display/" + displayId;
- }
- }).dropdown("set selected", displayId);
-
+ .dropdown({
+ direction: "downward",
+ values: valueArray,
+ action: function (text, value) {
+ $('#displays')
+ .dropdown("hide");
+
+ displayId = parseInt(value);
+ document.location = "/admin/display/" + displayId;
+ }
+ }).dropdown("set selected", displayId);
+
$('.currentDisplay').text(displayList[displayId].name);
-
+
let transitionArray = [];
// let values = ["bars", "blinds", "blinds3d", "zip", "blocks", "blocks2", "concentric", "warp", "cube", "tiles3d", "tiles3dprev", "slide", "swipe", "dissolve"];
-
+
transitionArray.push({ name: "random", value: null });
for (let i in SupportedTransitions) {
transitionArray.push({ name: SupportedTransitions[i], value: SupportedTransitions[i] });
}
-
+
$('#transitions')
- .dropdown({
- direction: "downward",
- values: transitionArray,
- action: function (text, value) {
- $('#transitions').dropdown("hide");
- $('#transitions').dropdown("set selected", value);
-
- emit("admin.setTransition", { transition: value });
- $('#currentTransition').text(text);
-
- }
- }).dropdown("set selected", serverOptions.transition);
-
+ .dropdown({
+ direction: "downward",
+ values: transitionArray,
+ action: function (text, value) {
+ $('#transitions').dropdown("hide");
+ $('#transitions').dropdown("set selected", value);
+
+ emit("admin.setTransition", { transition: value });
+ $('#currentTransition').text(text);
+
+ }
+ }).dropdown("set selected", serverOptions.transition);
+
$('#currentTransition').text(serverOptions.transition || "random");
-
+
// let preview = document.getElementById('preview');
// preview.src = "/admin/preview?displayId=" + displayId + "&socket=" + encodeURIComponent(socket.id);
updateBundleData(bundleDirs);
@@ -115,21 +115,21 @@ socket.on("callback.dashboard.updateBundles", function (data) {
socket.on("callback.dashboard.update", function (data) {
if (data.serverOptions.displayId !== displayId)
- return;
-
+ return;
+
displayId = parseInt(data.displayId);
bundleSettings = data.bundleSettings;
serverOptions = data.serverOptions;
updateControls(data.serverOptions);
updateSlides(bundleSettings.allSlides);
-
+
$('#allBundles').children().css("border", "1px solid black");
$('#bundle_' + simpleHash(serverOptions.currentBundle)).css("border", "1px solid #1ebc30");
$('#currentBundle').text(serverOptions.currentBundle);
$('#currentDisplay').text(displayList[displayId].name);
$('#transitions').dropdown("set selected", serverOptions.transition);
$('#currentTransition').text(serverOptions.transition || "random");
-
+
$('.editable').editable(function (value, settings) {
let uuid = $(this).parent().parent().attr("id");
emit("admin.renameSlide", { uuid: uuid, name: value, bundleName: serverOptions.currentBundle });
@@ -152,27 +152,43 @@ $(function () {
emit("admin.reorderSlides", { bundleName: serverOptions.currentBundle, sortedIDs: sortedIDs });
}
}).disableSelection();
+ $('#statusMessageAdmin').on("keyup", function(e) {
+ limitLines(e.currentTarget);
+ });
+
});
+function limitLines(elem) {
+ let maxLines = $(elem).attr('data-max');
+ let newLines = $(elem).val().split("\n").length;
+ if(newLines >= maxLines) {
+ let lines = $(elem).val().split("\n").slice(0, maxLines);
+ let newValue = lines.join("\n");
+ $(elem).val(newValue);
+ return true;
+ }
+ return false;
+};
+
function updateBundleData(bundleDirs) {
let output = "";
bundleDirs.sort(sortByName);
-
+
for (let i in bundleDirs) {
let bundle = bundleDirs[i];
output += `