fixed button hover for files added fontsize and font
This commit is contained in:
parent
43a33ed76c
commit
63c072f4f2
@ -33,8 +33,11 @@
|
|||||||
.w3-flat-pumpkin
|
.w3-flat-pumpkin
|
||||||
{color:#fff;background-color:#d35400}
|
{color:#fff;background-color:#d35400}
|
||||||
.w3-flat-pomegranate
|
.w3-flat-pomegranate
|
||||||
{color:#fff;background-color:#c0392b}
|
{color:#fff;background-color:#c0392b !important}
|
||||||
.w3-flat-silver
|
.w3-flat-silver
|
||||||
{color:#000;background-color:#bdc3c7}
|
{color:#000;background-color:#bdc3c7}
|
||||||
.w3-flat-asbestos
|
.w3-flat-asbestos
|
||||||
{color:#fff;background-color:#7f8c8d}
|
{color:#fff;background-color:#7f8c8d}
|
||||||
|
|
||||||
|
.w3-hover-flat-pomegranate:hover
|
||||||
|
{color:#fff !important;background-color:#c0392b !important}
|
||||||
@ -145,7 +145,7 @@ hr{border:0;border-top:1px solid #eee;margin:20px 0}
|
|||||||
.w3-padding-top-64{padding-top:64px!important}.w3-padding-top-48{padding-top:48px!important}
|
.w3-padding-top-64{padding-top:64px!important}.w3-padding-top-48{padding-top:48px!important}
|
||||||
.w3-padding-top-32{padding-top:32px!important}.w3-padding-top-24{padding-top:24px!important}
|
.w3-padding-top-32{padding-top:32px!important}.w3-padding-top-24{padding-top:24px!important}
|
||||||
.w3-left{float:left!important}.w3-right{float:right!important}
|
.w3-left{float:left!important}.w3-right{float:right!important}
|
||||||
.w3-button:hover{color:#000!important;background-color:#ccc!important}
|
.w3-button:hover{color:#000;background-color:#ccc}
|
||||||
.w3-transparent,.w3-hover-none:hover{background-color:transparent!important}
|
.w3-transparent,.w3-hover-none:hover{background-color:transparent!important}
|
||||||
.w3-hover-none:hover{box-shadow:none!important}
|
.w3-hover-none:hover{box-shadow:none!important}
|
||||||
/* Colors */
|
/* Colors */
|
||||||
|
|||||||
@ -13,8 +13,11 @@
|
|||||||
|
|
||||||
//settings
|
//settings
|
||||||
window.settings = {
|
window.settings = {
|
||||||
lineBreak: 150,
|
|
||||||
localOnly: true,
|
localOnly: true,
|
||||||
|
lineBreak: 150,
|
||||||
|
font: "Arial",
|
||||||
|
fontSize: 9,
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
let script = document.createElement("script");
|
let script = document.createElement("script");
|
||||||
|
|||||||
@ -11,7 +11,6 @@ import { modalNotifier } from "./evts.js";
|
|||||||
function buildFile() {
|
function buildFile() {
|
||||||
createStorageObj();
|
createStorageObj();
|
||||||
|
|
||||||
|
|
||||||
//set current page value in activeState object
|
//set current page value in activeState object
|
||||||
activeState.activePage = "files";
|
activeState.activePage = "files";
|
||||||
|
|
||||||
@ -24,7 +23,6 @@ function buildFile() {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (screen.width > 992) {
|
if (screen.width > 992) {
|
||||||
document.getElementById("siteTitle").innerHTML = "Saved files";
|
document.getElementById("siteTitle").innerHTML = "Saved files";
|
||||||
} else {
|
} else {
|
||||||
@ -114,7 +112,7 @@ function loadFileDivCallBack() {
|
|||||||
deleteButton.setAttribute("type", "submit");
|
deleteButton.setAttribute("type", "submit");
|
||||||
deleteButton.setAttribute("value", "Delete");
|
deleteButton.setAttribute("value", "Delete");
|
||||||
deleteButton.classList.add("w3-button");
|
deleteButton.classList.add("w3-button");
|
||||||
deleteButton.classList.add("w3-red");
|
deleteButton.classList.add("w3-flat-pomegranate");
|
||||||
document.getElementById("submitContainer").appendChild(deleteButton);
|
document.getElementById("submitContainer").appendChild(deleteButton);
|
||||||
|
|
||||||
if (screen.width > 992) {
|
if (screen.width > 992) {
|
||||||
@ -123,7 +121,6 @@ function loadFileDivCallBack() {
|
|||||||
document.getElementById("siteTitle").innerHTML = "TG";
|
document.getElementById("siteTitle").innerHTML = "TG";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
let title = document.createElement("div");
|
let title = document.createElement("div");
|
||||||
title.classList.add("w3-panel");
|
title.classList.add("w3-panel");
|
||||||
let titleText = document.createElement("h2");
|
let titleText = document.createElement("h2");
|
||||||
@ -192,13 +189,15 @@ function loadFileSidebar(tF) {
|
|||||||
sidebarListItem.style.borderBottom = "1px solid #ddd";
|
sidebarListItem.style.borderBottom = "1px solid #ddd";
|
||||||
sidebarListItem.id = "sb-" + obj.fileName.replace(/:/g, "_");
|
sidebarListItem.id = "sb-" + obj.fileName.replace(/:/g, "_");
|
||||||
|
|
||||||
|
//handle to many files on screen and display hidden files amount
|
||||||
if (c > sidebarItemsAmount) {
|
if (c > sidebarItemsAmount) {
|
||||||
sidebarListItem.setAttribute("data-template", '_overflow');
|
sidebarListItem.setAttribute("data-template", "_overflow");
|
||||||
sidebarListItem.setAttribute("data-file", '_overflow');
|
sidebarListItem.setAttribute("data-file", "_overflow");
|
||||||
sidebarListItem.classList.add("w3-flat-clouds");
|
sidebarListItem.classList.add("w3-flat-clouds");
|
||||||
sidebarListItem.classList.remove("w3-button");
|
sidebarListItem.classList.remove("w3-button");
|
||||||
sidebarListItem.style.borderRight = "1px solid rgb(221, 221, 221)"
|
sidebarListItem.style.borderRight = "1px solid rgb(221, 221, 221)";
|
||||||
sidebarListItem.innerHTML = tF.length - sidebarItemsAmount + " files not shown";
|
sidebarListItem.innerHTML =
|
||||||
|
tF.length - sidebarItemsAmount + " files not shown";
|
||||||
sidebarList.appendChild(sidebarListItem);
|
sidebarList.appendChild(sidebarListItem);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -209,16 +208,13 @@ function loadFileSidebar(tF) {
|
|||||||
c++;
|
c++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//clear all files button
|
||||||
sidebarListItem = document.createElement("li");
|
sidebarListItem = document.createElement("li");
|
||||||
sidebarListItem.classList.add(
|
sidebarListItem.classList.add("w3-bar-item", "w3-padding-large", "w3-button");
|
||||||
"w3-bar-item",
|
|
||||||
"w3-padding-large",
|
|
||||||
"w3-button"
|
|
||||||
);
|
|
||||||
sidebarListItem.style.borderBottom = "1px solid #ddd";
|
sidebarListItem.style.borderBottom = "1px solid #ddd";
|
||||||
sidebarListItem.setAttribute("data-template", '_clearAll');
|
sidebarListItem.setAttribute("data-template", "_clearAll");
|
||||||
sidebarListItem.setAttribute("data-file", '_clearAll');
|
sidebarListItem.setAttribute("data-file", "_clearAll");
|
||||||
sidebarListItem.classList.add("w3-flat-pomegranate", "w3-bottom");
|
sidebarListItem.classList.add("w3-hover-flat-pomegranate", "w3-bottom");
|
||||||
sidebarListItem.style.borderRight = "1px solid rgb(221, 221, 221)";
|
sidebarListItem.style.borderRight = "1px solid rgb(221, 221, 221)";
|
||||||
sidebarListItem.style.width = "300px";
|
sidebarListItem.style.width = "300px";
|
||||||
sidebarListItem.innerHTML = "Clear all files";
|
sidebarListItem.innerHTML = "Clear all files";
|
||||||
@ -228,7 +224,11 @@ function loadFileSidebar(tF) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function mainFormPlaceholder(msg = "Select a file") {
|
function mainFormPlaceholder(msg = "Select a file") {
|
||||||
return "<div class='w3-row-padding w3-padding-24 w3-container w3-flat-clouds'><div class='w3-code notranslate w3-border-white' style='font-family: Arial, Helvetica, sans-serif;'><p>" + msg + "</p><br><br><br><br><br><br><br><br><br><br><br></div></div>";
|
return (
|
||||||
|
"<div class='w3-row-padding w3-padding-24 w3-container w3-flat-clouds'><div class='w3-code notranslate w3-border-white' style='font-family: Arial, Helvetica, sans-serif;'><p>" +
|
||||||
|
msg +
|
||||||
|
"</p><br><br><br><br><br><br><br><br><br><br><br></div></div>"
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
function copyFileToClipboard() {
|
function copyFileToClipboard() {
|
||||||
@ -238,7 +238,6 @@ function copyFileToClipboard() {
|
|||||||
} else {
|
} else {
|
||||||
console.log("error file not found");
|
console.log("error file not found");
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function copyToClipBoard(html) {
|
function copyToClipBoard(html) {
|
||||||
@ -288,10 +287,16 @@ function formEvts(storageName) {
|
|||||||
break;
|
break;
|
||||||
case "Copy":
|
case "Copy":
|
||||||
copyFileToClipboard();
|
copyFileToClipboard();
|
||||||
e.target.className = e.target.className.replace(" w3-grey", " w3-flat-carrot");
|
e.target.className = e.target.className.replace(
|
||||||
|
" w3-grey",
|
||||||
|
" w3-flat-carrot"
|
||||||
|
);
|
||||||
e.target.style.pointerEvents = "none";
|
e.target.style.pointerEvents = "none";
|
||||||
const timeoutCopy = setTimeout(() => {
|
const timeoutCopy = setTimeout(() => {
|
||||||
e.target.className = e.target.className.replace(" w3-flat-carrot"," w3-grey");
|
e.target.className = e.target.className.replace(
|
||||||
|
" w3-flat-carrot",
|
||||||
|
" w3-grey"
|
||||||
|
);
|
||||||
e.target.style.pointerEvents = "auto";
|
e.target.style.pointerEvents = "auto";
|
||||||
}, 250);
|
}, 250);
|
||||||
break;
|
break;
|
||||||
@ -302,7 +307,8 @@ function formEvts(storageName) {
|
|||||||
if (previousFile) {
|
if (previousFile) {
|
||||||
loadFileDiv(previousFile.fileName, previousFile.template);
|
loadFileDiv(previousFile.fileName, previousFile.template);
|
||||||
} else {
|
} else {
|
||||||
document.getElementById("mainForm").innerHTML = mainFormPlaceholder("No file yet");
|
document.getElementById("mainForm").innerHTML =
|
||||||
|
mainFormPlaceholder("No file yet");
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
@ -325,7 +331,6 @@ function loadSpecificTemplate(storageName) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function getPreviousFile(storageName) {
|
function getPreviousFile(storageName) {
|
||||||
|
|
||||||
let orgFileName = storageName.split("_m21_")[0];
|
let orgFileName = storageName.split("_m21_")[0];
|
||||||
let tF = JSON.parse(retrieveData("templateFiles"));
|
let tF = JSON.parse(retrieveData("templateFiles"));
|
||||||
let i = 0;
|
let i = 0;
|
||||||
@ -333,17 +338,17 @@ function getPreviousFile(storageName) {
|
|||||||
|
|
||||||
for (let obj of tF) {
|
for (let obj of tF) {
|
||||||
if (obj.fileName == orgFileName) {
|
if (obj.fileName == orgFileName) {
|
||||||
previousFile = tF[i-1];
|
previousFile = tF[i - 1];
|
||||||
if (previousFile === undefined) {
|
if (previousFile === undefined) {
|
||||||
//get the next one if there is no previous one
|
//get the next one if there is no previous one
|
||||||
previousFile = tF[i+1];
|
previousFile = tF[i + 1];
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
|
|
||||||
return (previousFile != undefined) ? previousFile : false;
|
return previousFile != undefined ? previousFile : false;
|
||||||
}
|
}
|
||||||
|
|
||||||
function clickClearAllFiles() {
|
function clickClearAllFiles() {
|
||||||
@ -362,17 +367,18 @@ function clickClearAllFiles() {
|
|||||||
e.preventDefault;
|
e.preventDefault;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
});
|
||||||
modalNotifier(
|
modalNotifier(
|
||||||
"<div class='w3-container'> \
|
"<div class='w3-container'> \
|
||||||
<p>Would you really like to delete all stored files?</p> \
|
<p>Would you really like to delete all stored files?</p> \
|
||||||
<button class='w3-button w3-border w3-flat-pomegranate' >Delete</button>",
|
<button class='w3-button w3-border w3-flat-pomegranate' >Delete</button>",
|
||||||
0);
|
0
|
||||||
|
);
|
||||||
}
|
}
|
||||||
function clearAllFiles() {
|
function clearAllFiles() {
|
||||||
let tF = JSON.parse(retrieveData("templateFiles"));
|
let tF = JSON.parse(retrieveData("templateFiles"));
|
||||||
if (tF == null || tF.length == 0) {
|
if (tF == null || tF.length == 0) {
|
||||||
modalNotifier("there are no saved texts yet",2);
|
modalNotifier("there are no saved texts yet", 2);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
for (let storageName of tF) {
|
for (let storageName of tF) {
|
||||||
|
|||||||
@ -131,7 +131,7 @@ function parseFormOnSubmit(returnJSON = false, parseOnly = false) {
|
|||||||
bHtml = bHtml.replace(/ /g, " ");
|
bHtml = bHtml.replace(/ /g, " ");
|
||||||
|
|
||||||
bHtml =
|
bHtml =
|
||||||
"<div style='font-family: Arial, Helvetica, sans-serif;'>" +
|
"<div style='font-family: " + activeState.font + ", Helvetica, sans-serif; font-size: " + activeState.fontSize + "px;'>" +
|
||||||
bHtml +
|
bHtml +
|
||||||
"</div>";
|
"</div>";
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user