diff --git a/bin/adduser.js b/bin/adduser.js index 486c94f..84cd699 100644 --- a/bin/adduser.js +++ b/bin/adduser.js @@ -31,7 +31,6 @@ function userPopover(title, text){ $("#newuser").data("container", "body"); $("#newuser").data("placement", "bottom"); $("#newuser").data("html", true); - // $("#newuser").data("trigger", "focus"); $("#newuser").attr("title", title); $("#newuser").data("content", text); $("#newuser").popover('show'); diff --git a/bin/autocomplete.js b/bin/autocomplete.js deleted file mode 100644 index 31daf95..0000000 --- a/bin/autocomplete.js +++ /dev/null @@ -1,80 +0,0 @@ -function autocomplete(textelement, values) { - var currentFocus; - textelement.addEventListener("input", function(e){ - var a, b, i, val = this.value; - closeAllLists(); - if(!val){ return false;} - currentFocus = -1; - a = document.createElement("div"); - a.setAttribute("id", this.id + "ingredientAutocomplete-list"); - a.setAttribute("class", "ingredientAutocomplete-items"); - this.parentNode.appendChild(a); - for (var i = 0; i < values.length; i++) { - if(values[i].substr(0, val.length).toUpperCase() == val.toUpperCase()){ - b = document.createElement("div"); - b.innerHTML = "" + values[i].substr(0, val.length) + ""; - b.innerHTML += values[i].substr(val.length); - b.innerHTML += ""; - b.addEventListener("click", function(e){ - textelement.value = this.getElementsByTagName("input")[0].value; - closeAllLists(); - }); - a.appendChild(b); - } - } - }); - textelement.addEventListener("keydown", function(e){ - var x = document.getElementById(this.id + "ingredientAutocomplete-list"); - if (x) {x.getElementsByTagName("div");} - if (e.keyCode == 40) { - currentFocus++; - addActive(x); - } - else if (e.keyCode == 38) { - currentFocus--; - addActive(x); - } - else if (e.keyCode == 13) { - e.preventDefault(); - if (currentFocus > -1) { - if (x) { - var y = $("#"+x.id).parent().find("input"); - x.childNodes[currentFocus].click(); - y.focus(); - } - } - } - }); - function addActive(x) { - if(!x) {return false;} - removeActive(x); - if(currentFocus>=x.childNodes.length){currentFocus=0;} - if(currentFocus<0){currentFocus = (x.childNodes.length-1);} - x.childNodes[currentFocus].classList.add("ingredientAutocomplete-active"); - } - function removeActive(x) { - for (var i = 0; i < x.childNodes.length; i++) { - x.childNodes[i].classList.remove("ingredientAutocomplete-active"); - } - } - function closeAllLists(elmnt){ - var x = document.getElementsByClassName("ingredientAutocomplete-items"); - for (var i = 0; i < x.length; i++) { - x[i].parentNode.removeChild(x[i]); - } - } - document.addEventListener("click", function(e){ - closeAllLists(e.target); - }); -} -var values = []; -$(document).ready(function(){ - $.ajax({ - type: "POST", - url: "/api/recipes/auto", - data: {}, - success: function(data){ - values = data.split("||"); - } - }); -}); diff --git a/bin/list.js b/bin/list.js index 811051b..ad0f094 100644 --- a/bin/list.js +++ b/bin/list.js @@ -1,3 +1,11 @@ +$(document).ready(function () { + $("input[type=checkbox]").change(checkItem); + $("#remove").click(deleteCheckeditems); + $("#nameField").focus(); + $("#anzahl").on("focus", function () { $(this).select(); }); + $("#nameField").on("focus", function () { $(this).select(); }); +}); + function deleteCheckeditems() { $.post({ url: "api/list/del", @@ -45,12 +53,4 @@ function checkItem() { $("[data-id='" + dataId + "'").parent().parent().popover('show'); } }); -} - -$(document).ready(function () { - $("input[type=checkbox]").change(checkItem); - $("#remove").click(deleteCheckeditems); - $("#nameField").focus(); - $("#anzahl").on("focus", function () { $(this).select(); }); - $("#nameField").on("focus", function () { $(this).select(); }); -}); \ No newline at end of file +} \ No newline at end of file diff --git a/cont/list.php b/cont/list.php index 586906d..a20b59c 100644 --- a/cont/list.php +++ b/cont/list.php @@ -48,7 +48,7 @@ ?> - +
diff --git a/fonts/lato/Lato-Black.ttf b/fonts/lato/Lato-Black.ttf new file mode 100644 index 0000000..421164c Binary files /dev/null and b/fonts/lato/Lato-Black.ttf differ diff --git a/fonts/lato/Lato-BlackItalic.ttf b/fonts/lato/Lato-BlackItalic.ttf new file mode 100644 index 0000000..f367ad4 Binary files /dev/null and b/fonts/lato/Lato-BlackItalic.ttf differ diff --git a/fonts/lato/Lato-Bold.ttf b/fonts/lato/Lato-Bold.ttf new file mode 100644 index 0000000..620c85e Binary files /dev/null and b/fonts/lato/Lato-Bold.ttf differ diff --git a/fonts/lato/Lato-BoldItalic.ttf b/fonts/lato/Lato-BoldItalic.ttf new file mode 100644 index 0000000..4c9cd19 Binary files /dev/null and b/fonts/lato/Lato-BoldItalic.ttf differ diff --git a/fonts/lato/Lato-Hairline.ttf b/fonts/lato/Lato-Hairline.ttf new file mode 100644 index 0000000..94da2dc Binary files /dev/null and b/fonts/lato/Lato-Hairline.ttf differ diff --git a/fonts/lato/Lato-HairlineItalic.ttf b/fonts/lato/Lato-HairlineItalic.ttf new file mode 100644 index 0000000..d2236ca Binary files /dev/null and b/fonts/lato/Lato-HairlineItalic.ttf differ diff --git a/fonts/lato/Lato-Italic.ttf b/fonts/lato/Lato-Italic.ttf new file mode 100644 index 0000000..bc2a622 Binary files /dev/null and b/fonts/lato/Lato-Italic.ttf differ diff --git a/fonts/lato/Lato-Light.ttf b/fonts/lato/Lato-Light.ttf new file mode 100644 index 0000000..1d023d7 Binary files /dev/null and b/fonts/lato/Lato-Light.ttf differ diff --git a/fonts/lato/Lato-LightItalic.ttf b/fonts/lato/Lato-LightItalic.ttf new file mode 100644 index 0000000..b28954b Binary files /dev/null and b/fonts/lato/Lato-LightItalic.ttf differ diff --git a/fonts/lato/Lato-Regular.ttf b/fonts/lato/Lato-Regular.ttf new file mode 100644 index 0000000..ade05be Binary files /dev/null and b/fonts/lato/Lato-Regular.ttf differ diff --git a/fonts/lato/OFL.txt b/fonts/lato/OFL.txt new file mode 100644 index 0000000..98383e3 --- /dev/null +++ b/fonts/lato/OFL.txt @@ -0,0 +1,93 @@ +Copyright (c) 2010-2014 by tyPoland Lukasz Dziedzic (team@latofonts.com) with Reserved Font Name "Lato" + +This Font Software is licensed under the SIL Open Font License, Version 1.1. +This license is copied below, and is also available with a FAQ at: +http://scripts.sil.org/OFL + + +----------------------------------------------------------- +SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007 +----------------------------------------------------------- + +PREAMBLE +The goals of the Open Font License (OFL) are to stimulate worldwide +development of collaborative font projects, to support the font creation +efforts of academic and linguistic communities, and to provide a free and +open framework in which fonts may be shared and improved in partnership +with others. + +The OFL allows the licensed fonts to be used, studied, modified and +redistributed freely as long as they are not sold by themselves. The +fonts, including any derivative works, can be bundled, embedded, +redistributed and/or sold with any software provided that any reserved +names are not used by derivative works. The fonts and derivatives, +however, cannot be released under any other type of license. The +requirement for fonts to remain under this license does not apply +to any document created using the fonts or their derivatives. + +DEFINITIONS +"Font Software" refers to the set of files released by the Copyright +Holder(s) under this license and clearly marked as such. This may +include source files, build scripts and documentation. + +"Reserved Font Name" refers to any names specified as such after the +copyright statement(s). + +"Original Version" refers to the collection of Font Software components as +distributed by the Copyright Holder(s). + +"Modified Version" refers to any derivative made by adding to, deleting, +or substituting -- in part or in whole -- any of the components of the +Original Version, by changing formats or by porting the Font Software to a +new environment. + +"Author" refers to any designer, engineer, programmer, technical +writer or other person who contributed to the Font Software. + +PERMISSION & CONDITIONS +Permission is hereby granted, free of charge, to any person obtaining +a copy of the Font Software, to use, study, copy, merge, embed, modify, +redistribute, and sell modified and unmodified copies of the Font +Software, subject to the following conditions: + +1) Neither the Font Software nor any of its individual components, +in Original or Modified Versions, may be sold by itself. + +2) Original or Modified Versions of the Font Software may be bundled, +redistributed and/or sold with any software, provided that each copy +contains the above copyright notice and this license. These can be +included either as stand-alone text files, human-readable headers or +in the appropriate machine-readable metadata fields within text or +binary files as long as those fields can be easily viewed by the user. + +3) No Modified Version of the Font Software may use the Reserved Font +Name(s) unless explicit written permission is granted by the corresponding +Copyright Holder. This restriction only applies to the primary font name as +presented to the users. + +4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font +Software shall not be used to promote, endorse or advertise any +Modified Version, except to acknowledge the contribution(s) of the +Copyright Holder(s) and the Author(s) or with their explicit written +permission. + +5) The Font Software, modified or unmodified, in part or in whole, +must be distributed entirely under this license, and must not be +distributed under any other license. The requirement for fonts to +remain under this license does not apply to any document created +using the Font Software. + +TERMINATION +This license becomes null and void if any of the above conditions are +not met. + +DISCLAIMER +THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT +OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE +COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL +DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM +OTHER DEALINGS IN THE FONT SOFTWARE. diff --git a/fonts/newscycle/NewsCycle-Bold.ttf b/fonts/newscycle/NewsCycle-Bold.ttf new file mode 100644 index 0000000..63cf4aa Binary files /dev/null and b/fonts/newscycle/NewsCycle-Bold.ttf differ diff --git a/fonts/newscycle/NewsCycle-Regular.ttf b/fonts/newscycle/NewsCycle-Regular.ttf new file mode 100644 index 0000000..fd89feb Binary files /dev/null and b/fonts/newscycle/NewsCycle-Regular.ttf differ diff --git a/fonts/newscycle/OFL.txt b/fonts/newscycle/OFL.txt new file mode 100644 index 0000000..a247fd8 --- /dev/null +++ b/fonts/newscycle/OFL.txt @@ -0,0 +1,93 @@ +Copyright (c) 2010-2011, Nathan Willis (nwillis@glyphography.com), with Reserved Font Name "News Cycle." + +This Font Software is licensed under the SIL Open Font License, Version 1.1. +This license is copied below, and is also available with a FAQ at: +http://scripts.sil.org/OFL + + +----------------------------------------------------------- +SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007 +----------------------------------------------------------- + +PREAMBLE +The goals of the Open Font License (OFL) are to stimulate worldwide +development of collaborative font projects, to support the font creation +efforts of academic and linguistic communities, and to provide a free and +open framework in which fonts may be shared and improved in partnership +with others. + +The OFL allows the licensed fonts to be used, studied, modified and +redistributed freely as long as they are not sold by themselves. The +fonts, including any derivative works, can be bundled, embedded, +redistributed and/or sold with any software provided that any reserved +names are not used by derivative works. The fonts and derivatives, +however, cannot be released under any other type of license. The +requirement for fonts to remain under this license does not apply +to any document created using the fonts or their derivatives. + +DEFINITIONS +"Font Software" refers to the set of files released by the Copyright +Holder(s) under this license and clearly marked as such. This may +include source files, build scripts and documentation. + +"Reserved Font Name" refers to any names specified as such after the +copyright statement(s). + +"Original Version" refers to the collection of Font Software components as +distributed by the Copyright Holder(s). + +"Modified Version" refers to any derivative made by adding to, deleting, +or substituting -- in part or in whole -- any of the components of the +Original Version, by changing formats or by porting the Font Software to a +new environment. + +"Author" refers to any designer, engineer, programmer, technical +writer or other person who contributed to the Font Software. + +PERMISSION & CONDITIONS +Permission is hereby granted, free of charge, to any person obtaining +a copy of the Font Software, to use, study, copy, merge, embed, modify, +redistribute, and sell modified and unmodified copies of the Font +Software, subject to the following conditions: + +1) Neither the Font Software nor any of its individual components, +in Original or Modified Versions, may be sold by itself. + +2) Original or Modified Versions of the Font Software may be bundled, +redistributed and/or sold with any software, provided that each copy +contains the above copyright notice and this license. These can be +included either as stand-alone text files, human-readable headers or +in the appropriate machine-readable metadata fields within text or +binary files as long as those fields can be easily viewed by the user. + +3) No Modified Version of the Font Software may use the Reserved Font +Name(s) unless explicit written permission is granted by the corresponding +Copyright Holder. This restriction only applies to the primary font name as +presented to the users. + +4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font +Software shall not be used to promote, endorse or advertise any +Modified Version, except to acknowledge the contribution(s) of the +Copyright Holder(s) and the Author(s) or with their explicit written +permission. + +5) The Font Software, modified or unmodified, in part or in whole, +must be distributed entirely under this license, and must not be +distributed under any other license. The requirement for fonts to +remain under this license does not apply to any document created +using the Font Software. + +TERMINATION +This license becomes null and void if any of the above conditions are +not met. + +DISCLAIMER +THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT +OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE +COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL +DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM +OTHER DEALINGS IN THE FONT SOFTWARE. diff --git a/fonts/Roboto-Black.ttf b/fonts/roboto/Roboto-Black.ttf similarity index 100% rename from fonts/Roboto-Black.ttf rename to fonts/roboto/Roboto-Black.ttf diff --git a/fonts/Roboto-BlackItalic.ttf b/fonts/roboto/Roboto-BlackItalic.ttf similarity index 100% rename from fonts/Roboto-BlackItalic.ttf rename to fonts/roboto/Roboto-BlackItalic.ttf diff --git a/fonts/Roboto-Bold.ttf b/fonts/roboto/Roboto-Bold.ttf similarity index 100% rename from fonts/Roboto-Bold.ttf rename to fonts/roboto/Roboto-Bold.ttf diff --git a/fonts/Roboto-BoldItalic.ttf b/fonts/roboto/Roboto-BoldItalic.ttf similarity index 100% rename from fonts/Roboto-BoldItalic.ttf rename to fonts/roboto/Roboto-BoldItalic.ttf diff --git a/fonts/Roboto-Italic.ttf b/fonts/roboto/Roboto-Italic.ttf similarity index 100% rename from fonts/Roboto-Italic.ttf rename to fonts/roboto/Roboto-Italic.ttf diff --git a/fonts/Roboto-Light.ttf b/fonts/roboto/Roboto-Light.ttf similarity index 100% rename from fonts/Roboto-Light.ttf rename to fonts/roboto/Roboto-Light.ttf diff --git a/fonts/Roboto-LightItalic.ttf b/fonts/roboto/Roboto-LightItalic.ttf similarity index 100% rename from fonts/Roboto-LightItalic.ttf rename to fonts/roboto/Roboto-LightItalic.ttf diff --git a/fonts/Roboto-Medium.ttf b/fonts/roboto/Roboto-Medium.ttf similarity index 100% rename from fonts/Roboto-Medium.ttf rename to fonts/roboto/Roboto-Medium.ttf diff --git a/fonts/Roboto-MediumItalic.ttf b/fonts/roboto/Roboto-MediumItalic.ttf similarity index 100% rename from fonts/Roboto-MediumItalic.ttf rename to fonts/roboto/Roboto-MediumItalic.ttf diff --git a/fonts/Roboto-Regular.ttf b/fonts/roboto/Roboto-Regular.ttf similarity index 100% rename from fonts/Roboto-Regular.ttf rename to fonts/roboto/Roboto-Regular.ttf diff --git a/fonts/Roboto-Thin.ttf b/fonts/roboto/Roboto-Thin.ttf similarity index 100% rename from fonts/Roboto-Thin.ttf rename to fonts/roboto/Roboto-Thin.ttf diff --git a/fonts/Roboto-ThinItalic.ttf b/fonts/roboto/Roboto-ThinItalic.ttf similarity index 100% rename from fonts/Roboto-ThinItalic.ttf rename to fonts/roboto/Roboto-ThinItalic.ttf diff --git a/index.php b/index.php index 875b5ce..51ac862 100644 --- a/index.php +++ b/index.php @@ -28,16 +28,20 @@ $user->get_info($_COOKIE["token"]); - theme . ".css")) { + $cssFileContents = file_get_contents($_SESSION["docroot"]."/style/themes/".$user->theme.".css"); + preg_match_all('/\s+--primary:\s#(.{3,6})/m', $cssFileContents, $matches, PREG_SET_ORDER, 0); + $themecolor = $matches[0][1]; print_r(''); + print_r(''); } else { print_r(''); + print_r(''); } ?> diff --git a/style/helper.css b/style/helper.css index 9255112..8d0be50 100644 --- a/style/helper.css +++ b/style/helper.css @@ -1,9 +1,3 @@ -#nameField { - min-width: calc(100% - 67px); -} -#add { - width: 40px; -} .toast { right: 0; left: unset !important; diff --git a/style/parsedown.css b/style/parsedown.css deleted file mode 100644 index 9c16646..0000000 --- a/style/parsedown.css +++ /dev/null @@ -1,100 +0,0 @@ -.parsedown-section h1 { - font-size: 1.3em; - text-align: left; - border-bottom: 1px solid grey; - color: #333; - text-transform: uppercase; - max-width: 75%; -} - -.parsedown-section h2 { - font-size: 1.2em; - text-align: left; - border-bottom: 1px solid grey; - color: #333; - text-transform: uppercase; - max-width: 70%; -} - -.parsedown-section h3 { - font-size: 1.1em; - text-align: left; - border-bottom: 1px solid grey; - color: #444; - text-transform: capitalize; - max-width: 60%; -} - -.parsedown-section h4 { - font-size: 1em; - text-align: left; - border-bottom: 1px solid grey; - color: #444; - text-transform: capitalize; - max-width: 60%; -} - -.parsedown-section h5 { - font-size: .9em; - text-align: left; - border-bottom: 1px solid grey; - color: #555; - text-transform: lowercase; - font-weight: normal; - max-width: 55%; -} - -.parsedown-section h6 { - font-size: .8em; - text-align: left; - border-bottom: 1px solid grey; - color: #555; - text-transform: lowercase; - font-weight: normal; - max-width: 50%; -} - -.parsedown-section table { - border-collapse: collapse; - border: 1px solid black; - margin: 1em 0; -} - -.parsedown-section th { - background-color: #4CAF50; - color: white; -} - -.parsedown-section td, th { - /* border: 1px solid black; */ - padding: .2em .5em; -} - -.parsedown-section tr:nth-child(even) { - background-color: #f2f2f2; -} - -.parsedown-section button { - display: block; - border: 1px solid #777777; - padding: .5em 1em; - margin: 1em .25em; -} - -.parsedown-section pre { - max-height: calc(50vh - 9em); - background: #f4f4f4; - border: 1px solid #ddd; - border-left: 3px solid #a0c391; - color: #666; - page-break-inside: avoid; - font-family: monospace; - font-size: 15px; - line-height: 1.6; - margin-bottom: 1.6em; - max-width: 100%; - overflow: auto; - padding: 1em 1.5em; - display: block; - word-wrap: break-word; -} diff --git a/style/settings.css b/style/settings.css deleted file mode 100644 index 7d19e53..0000000 --- a/style/settings.css +++ /dev/null @@ -1,61 +0,0 @@ -.settings { - display: flex; - justify-content: flex-start; - flex-direction: row; - flex-wrap: wrap; -} -.pane { - border: 1px solid grey; - border-radius: 5px; - background-color: #ddd; - margin: 1%; - width: auto; - min-width: max-content; - max-width: 45%; - height: max-content; -} -.userprofile-pane { - display: flex; - flex-direction: column; - justify-content: flex-start; -} -.userprofile { - width: 22em; - display: flex; - flex-direction: column; -} -.userpassword-pane { - display: flex; - flex-direction: column; - justify-content: flex-start; -} -.userpassword { - width: 22em; - display: flex; - flex-direction: column; -} -.userprofile span { - display: flex; - flex-direction: row; - align-items: center; -} -.userpassword span { - display: flex; - flex-direction: row; - align-items: center; -} -.attribute { - width: 6em; - padding: 1em; -} -.change-attribute-input { - text-indent: 1em; - color: grey; -} -.value { - padding: 1em; -} -#passwordSaveButton, #userSaveButton { - align-self: flex-end; - margin: 1em; -} diff --git a/style/themes/cyborg.css b/style/themes/cyborg.css index 6a928a4..ea50d34 100644 --- a/style/themes/cyborg.css +++ b/style/themes/cyborg.css @@ -1,4 +1,4 @@ -@import url("https://fonts.googleapis.com/css?family=Roboto:400,700"); +@import url("/fonts/roboto/Roboto-Regular.ttf"); :root { --blue: #2A9FD6; --indigo: #6610f2; diff --git a/style/themes/flatly.css b/style/themes/flatly.css index f7e78f9..2e2730f 100644 --- a/style/themes/flatly.css +++ b/style/themes/flatly.css @@ -1,4 +1,4 @@ -@import url("https://fonts.googleapis.com/css?family=Lato:400,700,400italic"); +@import url("/fonts/lato/Lato-Regular.ttf"); :root { --blue: #2C3E50; --indigo: #6610f2; diff --git a/style/themes/journal.css b/style/themes/journal.css index d553fab..d411967 100644 --- a/style/themes/journal.css +++ b/style/themes/journal.css @@ -1,4 +1,4 @@ -@import url("https://fonts.googleapis.com/css?family=News+Cycle:400,700"); +@import url("/fonts/newscycle/NewsCycle-Regular.ttf"); :root { --blue: #EB6864; --indigo: #6610f2; diff --git a/style/themes/sandstone.css b/style/themes/sandstone.css index 6255a06..4e3365e 100644 --- a/style/themes/sandstone.css +++ b/style/themes/sandstone.css @@ -1,4 +1,4 @@ -@import url("https://fonts.googleapis.com/css?family=Roboto:400,500,700"); +@import url("/fonts/roboto/Roboto-Regular.ttf"); :root { --blue: #325D88; --indigo: #6610f2;