Commit 9111ecaf authored by Philipp Nowinski's avatar Philipp Nowinski

[FEATURE] add license check + ads

parent 9dc1b81f
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xml:space="preserve"
enable-background="new 0 0 700.619 661.18"
viewBox="0 0 700.6201 821.97645"
height="821.97644"
width="700.62012"
y="0px"
x="0px"
id="Layer_1"
version="1.1"><metadata
id="metadata4559"><rdf:RDF><cc:Work
rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" /><dc:title></dc:title></cc:Work></rdf:RDF></metadata><defs
id="defs4557" /><path
style="fill:#ac8000;fill-opacity:0.94117647"
id="path4550"
d="m 693.32606,76.056885 c -18.119,-18.793 -39.26,-34.662 -62.35,-54.355 -5.66,138.027005 -11.098,270.602005 -16.533,403.172005 -0.291,0.012 -1.344,27.896 -1.66,34.771 -1.084,23.414 -10.168,39.371 -24.508,49.357 -15.674,10.914 -82.267,11.531 -91.995,11.205 -52.186,-0.078 -287.017,2.047 -352.247,3.182 -38.678,0.674 -64.818003,-15.823 -61.923003,-63.692 6.541,-108.152 14.607,-216.213 21.974003,-324.315 2.047,-30.096 4.965,-58.845005 7.996,-89.375005 1.067,-13.953 20.29,-33.744 36.232,-40.859 10.071,-4.49699999 19.158,-4.52199999 19.267,-5.10099999 C 126.01106,1.423885 54.197057,57.206885 42.416057,95.597885 c -1.138,3.709 -1.879,7.621005 -2.209,11.486005 -4.769,55.574 -9.597,111.138 -14.092,166.734 -8.609,106.502 -16.7189996,213.046 -25.65599963,319.522 -3.73799997,44.535 15.29299963,67.664 59.26599963,67.711 187.305003,0.203 374.609003,0.146 561.917003,-0.037 38.971,-0.037 58.531,-18.11 60.412,-56.602 4.85,-98.979 9.489,-197.965 13.352,-296.983 2.605,-66.812 4.086,-133.678 5.197,-200.529 0.175,-10.449005 -0.913,-24.247005 -7.277,-30.843005 z" /><path
style="fill:#ffc10f;fill-opacity:0.94117647"
id="path4552"
d="m 614.18506,409.49689 c -3.113,-117.715 -6.295,-235.428 -9.094,-353.147005 -0.894,-37.551 -10.738,-48.493 -47.646,-49.207 -128.91,-2.483 -257.82,-4.881 -386.732,-7.13499999 -9.01,-0.156 -20.053,1.99799999 -31.01,6.88699999 -14.586,6.512 -26.681,19.973 -27.138,34.488 0.027,36.871 0.625,73.749005 -0.141,110.605005 -2.1,101.709 -5.16,203.4 -7.055,305.122 -0.541,29.086 13.493,45.254 42.188,46.979 62.724,3.75 127.883,6.01 195.248,8.619 61.871,2.387 122.916,4.264 184.797,6.391 -0.004,0.146 43.806,2.14 63.565,-11.623 14.639,-10.192 21.151,-26.553 22.155,-48.354 0.493,-10.557 1.025,-43.385 0.863,-49.625 z m -360.57,-228.748 c -1.759,4.474 -4.303,8.376 -7.631,11.704 -3.329,3.329 -7.43,5.952 -12.303,7.87 -4.874,1.917 -10.427,2.876 -16.658,2.876 -3.675,0 -7.258,-0.359 -10.745,-1.079 -3.488,-0.719 -6.817,-1.73 -9.985,-3.036 -3.17,-1.305 -6.141,-2.889 -8.908,-4.754 -2.771,-1.864 -5.247,-3.941 -7.43,-6.231 l 5.433,-8.948 c 0.479,-0.745 1.091,-1.331 1.837,-1.757 0.745,-0.426 1.57,-0.639 2.478,-0.639 1.225,0 2.583,0.573 4.074,1.718 1.49,1.146 3.288,2.396 5.394,3.755 2.104,1.358 4.646,2.61 7.63,3.755 2.981,1.146 6.551,1.718 10.705,1.718 6.764,0 11.996,-1.65 15.699,-4.954 3.7,-3.302 5.553,-7.855 5.553,-13.662 0,-3.248 -0.773,-5.898 -2.317,-7.949 -1.545,-2.05 -3.583,-3.768 -6.11,-5.153 -2.53,-1.385 -5.421,-2.557 -8.669,-3.516 -3.249,-0.958 -6.552,-1.983 -9.906,-3.076 -3.355,-1.091 -6.658,-2.369 -9.907,-3.835 -3.249,-1.464 -6.139,-3.381 -8.668,-5.752 -2.53,-2.37 -4.567,-5.299 -6.111,-8.788 -1.546,-3.488 -2.316,-7.842 -2.316,-13.062 0,-4.154 0.812,-8.175 2.437,-12.064 1.624,-3.887 3.995,-7.336005 7.11,-10.346005 3.116,-3.008 6.964,-5.419 11.545,-7.23 4.58,-1.81 9.799,-2.716 15.659,-2.716 6.604,0 12.663,1.039 18.175,3.116 5.513,2.077 10.267,5.033 14.261,8.868 l -4.554,8.948005 c -0.586,0.959 -1.198,1.666 -1.837,2.117 -0.641,0.453 -1.438,0.679 -2.397,0.679 -1.012,0 -2.145,-0.426 -3.396,-1.278 -1.252,-0.852 -2.796,-1.798 -4.634,-2.836 -1.837,-1.039 -4.009,-1.997 -6.512,-2.876 -2.504,-0.879 -5.485,-1.318 -8.947,-1.318 -3.195,0 -6.007,0.399 -8.43,1.199 -2.424,0.799 -4.461,1.917 -6.11,3.355 -1.651,1.438 -2.891,3.129 -3.716,5.073 -0.825,1.945 -1.237,4.062 -1.237,6.351 0,2.93 0.771,5.367 2.315,7.31 1.544,1.945 3.582,3.609 6.112,4.994 2.528,1.386 5.419,2.596 8.668,3.635 3.248,1.039 6.563,2.145 9.946,3.316 3.382,1.172 6.696,2.504 9.946,3.995 3.248,1.492 6.139,3.383 8.669,5.672 2.528,2.291 4.565,5.087 6.11,8.389 1.545,3.303 2.317,7.324 2.317,12.063 -0.002,5.111 -0.881,9.904 -2.639,14.379 z m 116.959,10.066 c -11.452,8.256 -24.767,12.383 -39.945,12.383 -9.321,0 -17.749,-1.451 -25.285,-4.354 -7.538,-2.902 -13.969,-6.951 -19.295,-12.144 -5.326,-5.193 -9.427,-11.384 -12.303,-18.575 -2.876,-7.191 -4.314,-15.1 -4.314,-23.728 0,-8.681 1.385,-16.63 4.154,-23.848 2.769,-7.216 6.736,-13.422 11.903,-18.615 5.165,-5.193005 11.396,-9.214005 18.694,-12.064005 7.297,-2.849 15.499,-4.274 24.606,-4.274 4.635,0 8.935,0.359 12.902,1.079 3.967,0.719 7.656,1.717 11.065,2.996 3.406,1.278 6.551,2.824 9.427,4.634 2.876,1.812 5.513,3.835 7.909,6.072005 l -5.354,8.549 c -0.853,1.332 -1.943,2.157 -3.274,2.477 -1.332,0.319 -2.771,0 -4.314,-0.959 -1.545,-0.905 -3.183,-1.863 -4.913,-2.876 -1.73,-1.011 -3.715,-1.958 -5.952,-2.836 -2.236,-0.879 -4.82,-1.598 -7.749,-2.157 -2.931,-0.559 -6.392,-0.839 -10.387,-0.839 -6.071,0 -11.544,0.999 -16.418,2.996 -4.873,1.997 -9.041,4.847 -12.503,8.548 -3.463,3.703 -6.125,8.188 -7.988,13.462 -1.865,5.273 -2.797,11.159 -2.797,17.656 0,6.871 0.984,13.01 2.956,18.415 1.971,5.407 4.767,9.987 8.39,13.742 3.621,3.755 8.002,6.619 13.142,8.588 5.14,1.971 10.878,2.956 17.218,2.956 4.739,0 8.96,-0.506 12.662,-1.518 3.701,-1.011 7.337,-2.423 10.905,-4.234 v -22.849 h -16.058 c -1.227,0 -2.185,-0.332 -2.877,-0.999 -0.691,-0.666 -1.038,-1.531 -1.038,-2.597 v -10.625 h 36.83 v 45.538 z m 94.832,7.789 c -6.817,3.063 -14.967,4.594 -24.445,4.594 -8.417,0 -16.02,-1.451 -22.811,-4.354 -6.791,-2.902 -12.583,-6.951 -17.377,-12.144 -4.793,-5.193 -8.482,-11.384 -11.063,-18.575 -2.585,-7.19 -3.875,-15.1 -3.875,-23.728 0,-8.628 1.369,-16.55 4.113,-23.768 2.742,-7.216 6.604,-13.422 11.584,-18.615 4.98,-5.193005 10.945,-9.228005 17.896,-12.104005 6.95,-2.876 14.605,-4.314 22.969,-4.314 8.309,0 15.646,1.346 22.011,4.035 6.363,2.69 11.891,6.271 16.577,10.745005 l -6.15,8.708 c -0.428,0.587 -0.934,1.092 -1.519,1.518 -0.587,0.427 -1.386,0.639 -2.396,0.639 -1.065,0 -2.276,-0.492 -3.636,-1.478 -1.357,-0.985 -3.09,-2.077 -5.192,-3.276 -2.104,-1.198 -4.741,-2.289 -7.909,-3.275 -3.169,-0.985 -7.124,-1.478 -11.864,-1.478 -5.486,0 -10.52,0.958 -15.1,2.876 -4.581,1.917 -8.521,4.714 -11.824,8.389 -3.303,3.675 -5.872,8.149 -7.709,13.422 -1.838,5.273 -2.757,11.265 -2.757,17.976 0,6.765 0.959,12.796 2.877,18.096 1.917,5.3 4.554,9.774 7.909,13.422 3.354,3.649 7.296,6.431 11.823,8.349 4.526,1.917 9.399,2.876 14.62,2.876 3.195,0 6.059,-0.172 8.588,-0.519 2.529,-0.346 4.86,-0.905 6.991,-1.678 2.129,-0.771 4.142,-1.744 6.031,-2.916 1.891,-1.171 3.768,-2.609 5.633,-4.314 1.064,-0.958 2.13,-1.438 3.195,-1.438 1.012,0 1.891,0.399 2.637,1.198 l 7.43,8.069 c -4.686,5.646 -10.438,10 -17.257,13.062 z" /><text
id="text5792"
y="820.80878"
x="49.86882"
style="font-style:normal;font-weight:normal;font-size:145.95573425px;line-height:1.25;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#ac8000;fill-opacity:0.94117647;stroke:none;stroke-width:3.64889336"
xml:space="preserve"><tspan
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-family:Lato;-inkscape-font-specification:Lato;fill:#ac8000;fill-opacity:0.94117647;stroke-width:3.64889336"
y="820.80878"
x="49.86882"
id="tspan5790">Toolchain</tspan></text>
</svg>
\ No newline at end of file
'use strict';
/**
* This module provides service methods for ads
*/
module.exports = class AdService {
/**
* Returns a random entry from the ad definitions
*
* @return {object}
*/
static getRandomAd() {
const ads = require('./ads.json');
const adKeys = Object.keys(ads);
return ads[adKeys[Math.floor(Math.random()*adKeys.length)]];
}
};
{
"sgalinskiProducts": {
"icon": "sgalinski.svg",
"title": "Did you already hear about our other products?",
"message": "We offer products and tools around TYPO3\nand the web that help you to do your work more efficiently.\n\nVisit our website and learn more!",
"link": "https://www.sgalinski.de/en/typo3-products-web-development/"
}
}
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
xml:space="preserve"
enable-background="new 0 0 700.619 661.18"
viewBox="0 0 700.6201 661.13239"
height="661.13239"
width="700.62012"
y="0px"
x="0px"
id="Layer_1"
version="1.1"
sodipodi:docname="SGC.svg"
inkscape:version="0.92.3 (2405546, 2018-03-11)"><sodipodi:namedview
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1"
objecttolerance="10"
gridtolerance="10"
guidetolerance="10"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:window-width="3440"
inkscape:window-height="1361"
id="namedview9"
showgrid="false"
inkscape:zoom="1.6241556"
inkscape:cx="543.63794"
inkscape:cy="355.6649"
inkscape:window-x="1992"
inkscape:window-y="568"
inkscape:window-maximized="1"
inkscape:current-layer="Layer_1" /><metadata
id="metadata4559"><rdf:RDF><cc:Work
rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" /><dc:title /></cc:Work></rdf:RDF></metadata><defs
id="defs4557" /><path
style="fill:#ac8000;fill-opacity:0.94117647"
id="path4550"
d="m 693.32606,76.01 c -18.119,-18.793 -39.26,-34.662 -62.35,-54.355 -5.66,138.027 -11.098,270.602 -16.533,403.172 -0.291,0.012 -1.344,27.896 -1.66,34.771 -1.084,23.414 -10.168,39.371 -24.508,49.357 -15.674,10.914 -82.267,11.531 -91.995,11.205 -52.186,-0.078 -287.017,2.047 -352.247,3.182 -38.678,0.674 -64.818003,-15.823 -61.923003,-63.692 6.541,-108.152 14.607,-216.213 21.974003,-324.315 2.047,-30.096 4.965,-58.845 7.996,-89.375 1.067,-13.953 20.29,-33.744 36.232,-40.859 10.071,-4.497 19.158,-4.522 19.267,-5.101 -41.568,1.377 -113.382003,57.16 -125.163003,95.551 -1.138,3.709 -1.879,7.621 -2.209,11.486 -4.769,55.574 -9.597,111.138 -14.092,166.734 -8.609,106.502 -16.7189996,213.046 -25.65599963,319.522 -3.73799997,44.535 15.29299963,67.664 59.26599963,67.711 187.305003,0.203 374.609003,0.146 561.917003,-0.037 38.971,-0.037 58.531,-18.11 60.412,-56.602 4.85,-98.979 9.489,-197.965 13.352,-296.983 2.605,-66.812 4.086,-133.678 5.197,-200.529 0.175,-10.449 -0.913,-24.247 -7.277,-30.843 z"
inkscape:connector-curvature="0" /><rect
style="fill:#1a1a1a;fill-opacity:1;stroke:none;stroke-width:0.77417111;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
id="rect881"
width="349.72018"
height="149.61621"
x="158.23605"
y="66.361794" /><path
style="fill:#ffc51d;fill-opacity:1"
id="path4552"
d="m 614.18506,409.45 c -3.113,-117.715 -6.295,-235.428 -9.094,-353.147 -0.894,-37.551 -10.738,-48.493 -47.646,-49.207 -128.91,-2.483 -257.82,-4.881 -386.732,-7.135 -9.01,-0.156 -20.053,1.998 -31.01,6.887 -14.586,6.512 -26.681,19.973 -27.138,34.488 0.027,36.871 0.625,73.749 -0.141,110.605 -2.1,101.709 -5.16,203.4 -7.055,305.122 -0.541,29.086 13.493,45.254 42.188,46.979 62.724,3.75 127.883,6.01 195.248,8.619 61.871,2.387 122.916,4.264 184.797,6.391 -0.004,0.146 43.806,2.14 63.565,-11.623 14.639,-10.192 21.151,-26.553 22.155,-48.354 0.493,-10.557 1.025,-43.385 0.863,-49.625 z m -360.57,-228.748 c -1.759,4.474 -4.303,8.376 -7.631,11.704 -3.329,3.329 -7.43,5.952 -12.303,7.87 -4.874,1.917 -10.427,2.876 -16.658,2.876 -3.675,0 -7.258,-0.359 -10.745,-1.079 -3.488,-0.719 -6.817,-1.73 -9.985,-3.036 -3.17,-1.305 -6.141,-2.889 -8.908,-4.754 -2.771,-1.864 -5.247,-3.941 -7.43,-6.231 l 5.433,-8.948 c 0.479,-0.745 1.091,-1.331 1.837,-1.757 0.745,-0.426 1.57,-0.639 2.478,-0.639 1.225,0 2.583,0.573 4.074,1.718 1.49,1.146 3.288,2.396 5.394,3.755 2.104,1.358 4.646,2.61 7.63,3.755 2.981,1.146 6.551,1.718 10.705,1.718 6.764,0 11.996,-1.65 15.699,-4.954 3.7,-3.302 5.553,-7.855 5.553,-13.662 0,-3.248 -0.773,-5.898 -2.317,-7.949 -1.545,-2.05 -3.583,-3.768 -6.11,-5.153 -2.53,-1.385 -5.421,-2.557 -8.669,-3.516 -3.249,-0.958 -6.552,-1.983 -9.906,-3.076 -3.355,-1.091 -6.658,-2.369 -9.907,-3.835 -3.249,-1.464 -6.139,-3.381 -8.668,-5.752 -2.53,-2.37 -4.567,-5.299 -6.111,-8.788 -1.546,-3.488 -2.316,-7.842 -2.316,-13.062 0,-4.154 0.812,-8.175 2.437,-12.064 1.624,-3.887 3.995,-7.336 7.11,-10.346 3.116,-3.008 6.964,-5.419 11.545,-7.23 4.58,-1.81 9.799,-2.716 15.659,-2.716 6.604,0 12.663,1.039 18.175,3.116 5.513,2.077 10.267,5.033 14.261,8.868 l -4.554,8.948 c -0.586,0.959 -1.198,1.666 -1.837,2.117 -0.641,0.453 -1.438,0.679 -2.397,0.679 -1.012,0 -2.145,-0.426 -3.396,-1.278 -1.252,-0.852 -2.796,-1.798 -4.634,-2.836 -1.837,-1.039 -4.009,-1.997 -6.512,-2.876 -2.504,-0.879 -5.485,-1.318 -8.947,-1.318 -3.195,0 -6.007,0.399 -8.43,1.199 -2.424,0.799 -4.461,1.917 -6.11,3.355 -1.651,1.438 -2.891,3.129 -3.716,5.073 -0.825,1.945 -1.237,4.062 -1.237,6.351 0,2.93 0.771,5.367 2.315,7.31 1.544,1.945 3.582,3.609 6.112,4.994 2.528,1.386 5.419,2.596 8.668,3.635 3.248,1.039 6.563,2.145 9.946,3.316 3.382,1.172 6.696,2.504 9.946,3.995 3.248,1.492 6.139,3.383 8.669,5.672 2.528,2.291 4.565,5.087 6.11,8.389 1.545,3.303 2.317,7.324 2.317,12.063 -0.002,5.111 -0.881,9.904 -2.639,14.379 z m 116.959,10.066 c -11.452,8.256 -24.767,12.383 -39.945,12.383 -9.321,0 -17.749,-1.451 -25.285,-4.354 -7.538,-2.902 -13.969,-6.951 -19.295,-12.144 -5.326,-5.193 -9.427,-11.384 -12.303,-18.575 -2.876,-7.191 -4.314,-15.1 -4.314,-23.728 0,-8.681 1.385,-16.63 4.154,-23.848 2.769,-7.216 6.736,-13.422 11.903,-18.615 5.165,-5.193 11.396,-9.214 18.694,-12.064 7.297,-2.849 15.499,-4.274 24.606,-4.274 4.635,0 8.935,0.359 12.902,1.079 3.967,0.719 7.656,1.717 11.065,2.996 3.406,1.278 6.551,2.824 9.427,4.634 2.876,1.812 5.513,3.835 7.909,6.072 l -5.354,8.549 c -0.853,1.332 -1.943,2.157 -3.274,2.477 -1.332,0.319 -2.771,0 -4.314,-0.959 -1.545,-0.905 -3.183,-1.863 -4.913,-2.876 -1.73,-1.011 -3.715,-1.958 -5.952,-2.836 -2.236,-0.879 -4.82,-1.598 -7.749,-2.157 -2.931,-0.559 -6.392,-0.839 -10.387,-0.839 -6.071,0 -11.544,0.999 -16.418,2.996 -4.873,1.997 -9.041,4.847 -12.503,8.548 -3.463,3.703 -6.125,8.188 -7.988,13.462 -1.865,5.273 -2.797,11.159 -2.797,17.656 0,6.871 0.984,13.01 2.956,18.415 1.971,5.407 4.767,9.987 8.39,13.742 3.621,3.755 8.002,6.619 13.142,8.588 5.14,1.971 10.878,2.956 17.218,2.956 4.739,0 8.96,-0.506 12.662,-1.518 3.701,-1.011 7.337,-2.423 10.905,-4.234 v -22.849 h -16.058 c -1.227,0 -2.185,-0.332 -2.877,-0.999 -0.691,-0.666 -1.038,-1.531 -1.038,-2.597 V 145.23 h 36.83 v 45.538 z m 94.832,7.789 c -6.817,3.063 -14.967,4.594 -24.445,4.594 -8.417,0 -16.02,-1.451 -22.811,-4.354 -6.791,-2.902 -12.583,-6.951 -17.377,-12.144 -4.793,-5.193 -8.482,-11.384 -11.063,-18.575 -2.585,-7.19 -3.875,-15.1 -3.875,-23.728 0,-8.628 1.369,-16.55 4.113,-23.768 2.742,-7.216 6.604,-13.422 11.584,-18.615 4.98,-5.193 10.945,-9.228 17.896,-12.104 6.95,-2.876 14.605,-4.314 22.969,-4.314 8.309,0 15.646,1.346 22.011,4.035 6.363,2.69 11.891,6.271 16.577,10.745 l -6.15,8.708 c -0.428,0.587 -0.934,1.092 -1.519,1.518 -0.587,0.427 -1.386,0.639 -2.396,0.639 -1.065,0 -2.276,-0.492 -3.636,-1.478 -1.357,-0.985 -3.09,-2.077 -5.192,-3.276 -2.104,-1.198 -4.741,-2.289 -7.909,-3.275 -3.169,-0.985 -7.124,-1.478 -11.864,-1.478 -5.486,0 -10.52,0.958 -15.1,2.876 -4.581,1.917 -8.521,4.714 -11.824,8.389 -3.303,3.675 -5.872,8.149 -7.709,13.422 -1.838,5.273 -2.757,11.265 -2.757,17.976 0,6.765 0.959,12.796 2.877,18.096 1.917,5.3 4.554,9.774 7.909,13.422 3.354,3.649 7.296,6.431 11.823,8.349 4.526,1.917 9.399,2.876 14.62,2.876 3.195,0 6.059,-0.172 8.588,-0.519 2.529,-0.346 4.86,-0.905 6.991,-1.678 2.129,-0.771 4.142,-1.744 6.031,-2.916 1.891,-1.171 3.768,-2.609 5.633,-4.314 1.064,-0.958 2.13,-1.438 3.195,-1.438 1.012,0 1.891,0.399 2.637,1.198 l 7.43,8.069 c -4.686,5.646 -10.438,10 -17.257,13.062 z"
inkscape:connector-curvature="0" />
</svg>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="29.357"
height="33.858002"
viewBox="0 14.071 29.357 33.858003"
version="1.1"
id="svg8"
sodipodi:docname="sgalinski.svg"
inkscape:version="0.92.3 (2405546, 2018-03-11)">
<metadata
id="metadata14">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title />
</cc:Work>
</rdf:RDF>
</metadata>
<defs
id="defs12" />
<sodipodi:namedview
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1"
objecttolerance="10"
gridtolerance="10"
guidetolerance="10"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:window-width="3440"
inkscape:window-height="1361"
id="namedview10"
showgrid="false"
fit-margin-top="0"
fit-margin-left="0"
fit-margin-right="0"
fit-margin-bottom="0"
inkscape:zoom="37.184389"
inkscape:cx="8.898236"
inkscape:cy="18.918017"
inkscape:window-x="1992"
inkscape:window-y="568"
inkscape:window-maximized="1"
inkscape:current-layer="svg8" />
<path
d="M 14.679,14.071 V 19 l 0.053,-0.054 10.339,6 v 5.197 l -10.393,-6.268 -4.339,2.571 4.339,2.518 10.393,5.946 v 2.144 L 14.732,43.16 h -0.053 v 4.769 L 29.357,39.465 V 22.536"
id="path2"
inkscape:connector-curvature="0"
style="fill:#7c2623" />
<path
d="M 14.679,33.143 4.286,27.304 V 24.947 L 14.679,19 V 14.071 L 0,22.536 v 16.929 l 14.679,8.464 V 43.16 L 4.286,37.268 V 32.34 l 10.393,5.839 h 0.053 l 4.393,-2.571"
id="path4"
inkscape:connector-curvature="0"
style="fill:#bc3a2f" />
<path
style="fill:#ffffff;fill-opacity:1;stroke:#cc9900;stroke-width:0.01573241;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
d="m 9.4952608,26.138868 -5.1769037,-2.937591 -0.00687,-2.455161 -0.00687,-2.455161 0.1144372,0.06625 c 0.4018391,0.232645 10.2339957,5.747561 10.2665467,5.758568 0.04543,0.01536 4.418467,-2.537053 4.417798,-2.578542 -2.42e-4,-0.01448 -1.015834,-0.58928 -2.25689,-1.277332 -1.241056,-0.688053 -4.570747,-2.551377 -7.3993124,-4.14072 l -5.1428473,-2.889715 0.007,-1.17914 0.007,-1.17914 5.2145568,-2.9836511 5.2145569,-2.9836508 0.179916,0.1006636 c 0.09895,0.055365 2.420693,1.4014121 5.15942,2.9912156 l 4.979504,2.8905517 v 2.575452 c 0,1.416498 -0.0062,2.575451 -0.01379,2.575451 -0.0076,0 -2.334166,-1.399812 -5.17018,-3.110692 -2.836014,-1.710882 -5.174755,-3.111671 -5.197202,-3.1128659 -0.02245,-0.00119 -1.011491,0.5725159 -2.197875,1.2749129 -1.637402,0.969422 -2.149115,1.284346 -2.124074,1.30722 0.06677,0.061 4.341059,2.52556 9.444698,5.445834 l 5.244978,3.001147 v 1.068299 1.068298 l -5.163457,3.05008 c -2.839902,1.677544 -5.175559,3.049389 -5.190351,3.048544 -0.01479,-8.46e-4 -2.356499,-1.323453 -5.203796,-2.939128 z"
id="path816"
inkscape:connector-curvature="0"
transform="translate(0,14.071)" />
</svg>
......@@ -8,6 +8,9 @@ const freedesktopNotifier = require('freedesktop-notifications');
const path = require('path');
const browserSync = require('browser-sync');
const {argv} = require('yargs');
const adService = require('./adService');
const open = require('opn');
const settings = require('./settings');
/**
* Logging-Module for the SGC
......@@ -77,25 +80,42 @@ module.exports = class Logger {
*
* @param {String} _title The title for your notification
* @param {String} _message The message for your notification
* @param {Object} _options Contains advanced options
*/
static displayNotification(_title, _message) {
static displayNotification(_title, _message, _options = {wait: false, timeout: 5000}) {
let icon = _options.icon ? _options.icon : 'SGC.svg';
if (process.platform === 'linux') {
freedesktopNotifier.createNotification({
let notification = freedesktopNotifier.createNotification({
summary: _title,
body: _message,
icon: path.join(__dirname, 'SGC.svg'),
sound: 'message-new-instant'
}).push();
icon: path.join(__dirname, 'icons', icon),
sound: 'message-new-instant',
actions: {
default: ''
}
});
if (_options.link) {
notification.on('action', () => {
open(_options.link);
});
}
notification.push();
} else {
notifier.notify(
{
title: _title,
message: _message,
icon: path.join(__dirname, 'SGC.svg'),
icon: path.join(__dirname, 'icons', icon.replace('.svg', '.png')),
sound: true,
wait: false
wait: _options.wait,
timeout: _options.timeout
}
);
if (_options.link()) {
notifier.on('click', () => {
open(_options.link);
});
}
}
}
......@@ -105,6 +125,12 @@ module.exports = class Logger {
* @param {String} _message The message to display
*/
static displayBrowserSyncNotification(_message) {
browserSync.notify(`<b>SGC:</b> ${_message}`);
let message = _message;
if (!settings.validLicense) {
const pickedAd = adService.getRandomAd();
message = `<div style="text-align: left">${message}<div style="font-size: 18px"><br><br>
<strong>${pickedAd.title}</strong><br>${pickedAd.message.replace('\n', '<br>')}</div>`;
}
browserSync.notify(`<b>SGC:</b> ${message}`, 5000);
}
};
......@@ -6,6 +6,7 @@ const {argv} = require('yargs');
const merge = require('merge');
let extension;
let watcherActive = false;
let validLicense;
/**
* This module is a global settings singleton
......@@ -109,9 +110,43 @@ class Settings {
return this._config;
}
/**
* Returns true if a watcher is currently active
*
* @return {boolean}
*/
get watcherActive() {
return watcherActive;
}
/**
* Checks if a license key is provided and if it is a valid one
*
* @return {boolean}
*/
get validLicense() {
if (typeof validLicense !== 'undefined') {
return validLicense;
}
if (this._config.license) {
let platform;
switch (process.platform) {
case 'linux':
platform = 'linux';
break;
case 'darwin':
platform = 'mac';
break;
}
const processedLicense = require('child_process').execSync(
`${path.join(process.cwd(), `./sgc-core/core/licenseCheck-${platform}`)} ${this._config.license}`
).toString();
validLicense = (processedLicense.trim() === 'valid');
} else {
validLicense = false;
}
return validLicense;
}
}
const instance = new Settings();
......
......@@ -3,6 +3,7 @@ const fs = require('fs');
const path = require('path');
const mkdirp = require('mkdirp');
const chalk = require('chalk');
const adService = require('./adService');
const argv = require('yargs').argv;
const settings = require('./settings');
......@@ -32,10 +33,13 @@ module.exports = class task {
this._config.mode = 'dev';
this._logger.info(`Starting task ${chalk.bold(this.constructor.name.toLowerCase())} in dev mode`);
}
if (!this._settings.validLicense) {
this._runAd();
}
}
/**
* Runs the task. A subTask can be triggered by apending it with a colon
* Runs the task. A subTask can be triggered by appending it with a colon
*
* E.g: sgc css – triggers the main Css Task
* sgc css:qa – triggers the subTask qa
......@@ -104,4 +108,18 @@ module.exports = class task {
set embedded(_value) {
this._embedded = _value;
}
/**
* Displays an ad as a push notification
*
* @private
*/
_runAd() {
const pickedAd = adService.getRandomAd();
this._logger.displayNotification(
pickedAd.title,
pickedAd.message,
pickedAd
);
}
};
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment