Initial Version

This commit is contained in:
Filip Wieladek 2012-09-14 19:07:45 +02:00
parent ab9de33891
commit 2057213990
12 changed files with 1025 additions and 0 deletions

BIN
bg.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 243 KiB

BIN
font/LucidaGrande.ttf Normal file

Binary file not shown.

BIN
font/LucidaGrandeBold.ttf Normal file

Binary file not shown.

14
img/avatar.svg Normal file
View File

@ -0,0 +1,14 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg id="svg3172" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns="http://www.w3.org/2000/svg" height="24" width="24" version="1.0" xmlns:cc="http://creativecommons.org/ns#" xmlns:dc="http://purl.org/dc/elements/1.1/">
<metadata id="metadata9">
<rdf:RDF>
<cc:Work rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage"/>
</cc:Work>
</rdf:RDF>
</metadata>
<path id="rect2382-4" d="m11.914 3.0001c-0.648-0.0039-1.217 0.1203-1.604 0.3776-0.4997 0.3319-0.72 0.374-0.8595 0.1452-0.1334-0.2189-0.2548-0.1945-0.3724 0.1162-0.0994 0.2627-0.3073 0.3827-0.5442 0.2904-0.226-0.0879-0.3187-0.0596-0.2292 0.0872 0.085951 0.14103 0.043931 0.26141-0.085937 0.26141s-0.54579 0.4449-0.91667 0.98755c-0.59122 0.86502-0.68765 1.2604-0.6875 3.0788 0.0000823 1.1409 0.11275 2.2519-0.22917 2.3236-0.20054 0.0421-0.18144 0.83511-0.085937 1.6556 0.12489 1.0729 0.31144 1.5985 0.83073 2.0913 0.80882 0.76746 1.5469 2.0959 1.5469 2.8174-1e-7 1.031-2.576 2.9018-6.2161 4.5311l-1.461 0.639v1.598h22v-1.888l-1.3464-0.55186c-3.108-1.3116-5.8151-3.3224-5.8151-4.3278 0-0.71974 0.71022-2.0507 1.5182-2.8174 0.51928-0.49273 0.73448-1.0184 0.85938-2.0913 0.0955-0.82048 0.10841-1.5901-0.08594-1.6556-0.26779-0.09022-0.25781-1.1921-0.25781-2.3236-0.001-1.6216-0.102-2.2252-0.516-2.9041-0.824-1.3509-3.499-2.4282-5.443-2.4398z" style="opacity:.3;fill-rule:evenodd;fill:#fff"/>
<path id="rect2382" d="m11.914 2.0001c-0.648-0.0039-1.217 0.1203-1.604 0.3776-0.4997 0.3319-0.72 0.374-0.8595 0.1452-0.1334-0.2189-0.2548-0.1945-0.3724 0.1162-0.0994 0.2627-0.3073 0.3827-0.5442 0.2904-0.226-0.0879-0.3187-0.0596-0.2292 0.0872 0.085951 0.14103 0.043931 0.26141-0.085937 0.26141s-0.54579 0.4449-0.91667 0.98755c-0.59122 0.86502-0.68765 1.2604-0.6875 3.0788 0.0000823 1.1409 0.11275 2.2519-0.22917 2.3236-0.20054 0.042098-0.18144 0.83511-0.085937 1.6556 0.12489 1.0729 0.31144 1.5985 0.83073 2.0913 0.80882 0.76746 1.5469 2.0959 1.5469 2.8174-1e-7 1.031-2.576 2.9018-6.2161 4.5311l-1.461 0.639v1.598h22v-1.888l-1.3464-0.55186c-3.108-1.3116-5.8151-3.3224-5.8151-4.3278 0-0.71974 0.71022-2.0507 1.5182-2.8174 0.51928-0.49273 0.73448-1.0184 0.85938-2.0913 0.0955-0.82048 0.10841-1.5901-0.08594-1.6556-0.269-0.0901-0.259-1.192-0.259-2.3235 0-1.6221-0.101-2.2257-0.515-2.9046-0.824-1.3509-3.499-2.4282-5.443-2.4398z" style="fill-rule:evenodd;fill:#3c3c3c"/>
</svg>

After

Width:  |  Height:  |  Size: 2.5 KiB

142
img/restart.svg Normal file
View File

@ -0,0 +1,142 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<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="350"
height="400"
id="svg2"
version="1.1"
inkscape:version="0.48.3.1 r9886"
sodipodi:docname="restart.svg">
<defs
id="defs4">
<filter
inkscape:collect="always"
id="filter3898"
x="-0.11897011"
width="1.2379402"
y="-0.12103891"
height="1.2420778"
color-interpolation-filters="sRGB">
<feGaussianBlur
inkscape:collect="always"
stdDeviation="16.570881"
id="feGaussianBlur3900" />
</filter>
<filter
inkscape:collect="always"
id="filter3918"
x="-0.19501376"
width="1.3900275"
y="-0.16888687"
height="1.3377737">
<feGaussianBlur
inkscape:collect="always"
stdDeviation="9.4024498"
id="feGaussianBlur3920" />
</filter>
</defs>
<sodipodi:namedview
id="base"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="0.84852814"
inkscape:cx="330.88647"
inkscape:cy="145.63126"
inkscape:document-units="px"
inkscape:current-layer="layer1"
showgrid="false"
inkscape:window-width="1421"
inkscape:window-height="660"
inkscape:window-x="94"
inkscape:window-y="86"
inkscape:window-maximized="0" />
<metadata
id="metadata7">
<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>
<g
inkscape:label="Layer 1"
inkscape:groupmode="layer"
id="layer1"
transform="translate(0,-652.36218)">
<path
sodipodi:type="star"
style="fill:#000000;fill-opacity:1;stroke:#000000;stroke-width:14.09505676999999935;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;filter:url(#filter3918)"
id="path3757"
sodipodi:sides="3"
sodipodi:cx="288.57144"
sodipodi:cy="246.6479"
sodipodi:r1="77.14286"
sodipodi:r2="38.57143"
sodipodi:arg1="3.1415927"
sodipodi:arg2="4.1887902"
inkscape:flatsided="false"
inkscape:rounded="0"
inkscape:randomized="0"
d="m 211.42858,246.6479 57.85715,-33.40383 57.85714,-33.40384 0,66.80767 0,66.80768 -57.85714,-33.40384 z"
inkscape:transform-center-x="12.934073"
transform="matrix(0.67065572,0,0,0.75052767,-17.809482,686.70179)" />
<path
sodipodi:open="true"
sodipodi:end="6.2846738"
sodipodi:start="0.015995771"
transform="matrix(0.8189498,0.00457854,-0.00466702,0.83161181,-115.09413,415.92376)"
d="m 525.69291,550.70424 a 167.14285,164.28572 0 1 1 0.0212,-2.38322"
sodipodi:ry="164.28572"
sodipodi:rx="167.14285"
sodipodi:cy="548.07648"
sodipodi:cx="358.57144"
id="path2984"
style="fill:none;stroke:#000000;stroke-width:30.2931366;stroke-linecap:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;filter:url(#filter3898)"
sodipodi:type="arc" />
<path
transform="matrix(0.66152266,0,0,0.75052767,-16.699981,686.70179)"
inkscape:transform-center-x="12.757935"
d="m 211.42858,246.6479 57.85715,-33.40383 57.85714,-33.40384 0,66.80767 0,66.80768 -57.85714,-33.40384 z"
inkscape:randomized="0"
inkscape:rounded="0"
inkscape:flatsided="false"
sodipodi:arg2="4.1887902"
sodipodi:arg1="3.1415927"
sodipodi:r2="38.57143"
sodipodi:r1="77.14286"
sodipodi:cy="246.6479"
sodipodi:cx="288.57144"
sodipodi:sides="3"
id="path3784"
style="fill:#b2b2b2;fill-opacity:1;stroke:#b2b2b2;stroke-width:14.19202232;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
sodipodi:type="star" />
<path
sodipodi:type="arc"
style="fill:none;stroke:#b2b2b2;stroke-width:30.2931366;stroke-linecap:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
id="path2985"
sodipodi:cx="358.57144"
sodipodi:cy="548.07648"
sodipodi:rx="167.14285"
sodipodi:ry="164.28572"
d="m 525.69291,550.70424 a 167.14285,164.28572 0 1 1 0.0212,-2.38322"
transform="matrix(0.8189498,0.00457854,-0.00466702,0.83161181,-115.09384,414.93358)"
sodipodi:start="0.015995771"
sodipodi:end="6.2846738"
sodipodi:open="true" />
</g>
</svg>

After

Width:  |  Height:  |  Size: 4.9 KiB

198
img/shutdown.svg Normal file
View File

@ -0,0 +1,198 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:osb="http://www.openswatchbook.org/uri/2009/osb"
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="350"
height="400"
id="svg2"
version="1.1"
inkscape:version="0.48.3.1 r9886"
sodipodi:docname="shutdown.svg">
<defs
id="defs4">
<linearGradient
id="linearGradient3800"
osb:paint="solid">
<stop
style="stop-color:#000000;stop-opacity:1;"
offset="0"
id="stop3802" />
</linearGradient>
<filter
inkscape:collect="always"
id="filter3814"
x="-0.11072097"
width="1.2214419"
y="-0.13080272"
height="1.2616054">
<feGaussianBlur
inkscape:collect="always"
stdDeviation="15.42185"
id="feGaussianBlur3816" />
</filter>
<filter
inkscape:collect="always"
id="filter3790">
<feGaussianBlur
inkscape:collect="always"
stdDeviation="3.3587572"
id="feGaussianBlur3792" />
</filter>
<filter
inkscape:collect="always"
id="filter3861"
x="-0.20333333"
width="1.4066667"
y="-1.5685715"
height="4.137143">
<feGaussianBlur
inkscape:collect="always"
stdDeviation="7.6249999"
id="feGaussianBlur3863" />
</filter>
<filter
inkscape:collect="always"
id="filter3869">
<feGaussianBlur
inkscape:collect="always"
stdDeviation="3.43463"
id="feGaussianBlur3871" />
</filter>
<filter
inkscape:collect="always"
id="filter3881">
<feGaussianBlur
inkscape:collect="always"
stdDeviation="3.43463"
id="feGaussianBlur3883" />
</filter>
<filter
inkscape:collect="always"
id="filter3923">
<feGaussianBlur
inkscape:collect="always"
stdDeviation="5.2807972"
id="feGaussianBlur3925" />
</filter>
<filter
inkscape:collect="always"
id="filter3929"
x="-0.10608696"
width="1.2121739"
y="-0.13811321"
height="1.2762264">
<feGaussianBlur
inkscape:collect="always"
stdDeviation="7.6249999"
id="feGaussianBlur3931" />
</filter>
<filter
inkscape:collect="always"
id="filter3943"
x="-7.8000297"
width="16.600059"
y="-0.060465103"
height="1.1209302">
<feGaussianBlur
inkscape:collect="always"
stdDeviation="2.7083328"
id="feGaussianBlur3945" />
</filter>
<filter
inkscape:collect="always"
id="filter3987"
x="-3.7532402"
width="8.5064804"
y="-0.22581523"
height="1.4516305">
<feGaussianBlur
inkscape:collect="always"
stdDeviation="11.377011"
id="feGaussianBlur3989" />
</filter>
</defs>
<sodipodi:namedview
id="base"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="1.1019846"
inkscape:cx="-4.208366"
inkscape:cy="223.98152"
inkscape:document-units="px"
inkscape:current-layer="layer1"
showgrid="false"
inkscape:window-width="1421"
inkscape:window-height="660"
inkscape:window-x="51"
inkscape:window-y="178"
inkscape:window-maximized="0" />
<metadata
id="metadata7">
<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>
<g
inkscape:label="Layer 1"
inkscape:groupmode="layer"
id="layer1"
transform="translate(0,-652.36218)">
<path
sodipodi:end="10.226427"
sodipodi:start="5.4900966"
transform="matrix(0.8189498,0.00457854,-0.00466702,0.83161181,-115.09413,415.92376)"
d="m 475.84687,431.01898 c 65.7734,63.66227 66.58727,167.67916 1.81784,232.32823 -64.76943,64.64907 -170.5953,65.44903 -236.3687,1.78676 -65.77339,-63.66226 -66.58727,-167.67915 -1.81784,-232.32822 0.93593,-0.93419 1.8832,-1.85733 2.8416,-2.76922"
sodipodi:ry="164.28572"
sodipodi:rx="167.14285"
sodipodi:cy="548.07648"
sodipodi:cx="358.57144"
id="path2984"
style="fill:none;stroke:#000000;stroke-width:30.29313660000000041;stroke-linecap:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;filter:url(#filter3814)"
sodipodi:type="arc"
sodipodi:open="true" />
<path
sodipodi:type="arc"
style="fill:none;stroke:#b2b2b2;stroke-width:30.2931366;stroke-linecap:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
id="path2985"
sodipodi:cx="358.57144"
sodipodi:cy="548.07648"
sodipodi:rx="167.14285"
sodipodi:ry="164.28572"
d="m 476.95677,432.10337 c 65.1641,64.26476 64.98711,168.28458 -0.3953,232.33477 -65.38241,64.05018 -171.21127,63.87622 -236.37536,-0.38855 -65.16409,-64.26477 -64.98711,-168.28459 0.3953,-232.33477 0.0877,-0.0859 0.17543,-0.17166 0.26329,-0.25735"
transform="matrix(0.8189498,0.00457854,-0.00466702,0.83161181,-115.09384,414.93358)"
sodipodi:start="5.4994595"
sodipodi:end="10.21407"
sodipodi:open="true" />
<rect
y="709.82043"
x="175.08333"
height="120.91667"
width="7.275001"
id="rect3949"
style="fill:none;stroke:#000000;stroke-width:31;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;filter:url(#filter3987)" />
<rect
style="fill:none;stroke:#b2b2b2;stroke-width:29.99999809;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
id="rect3947"
width="7.275001"
height="120.91667"
x="175.08333"
y="709.82043" />
</g>
</svg>

After

Width:  |  Height:  |  Size: 6.3 KiB

134
img/sleep.svg Normal file
View File

@ -0,0 +1,134 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<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="350"
height="400"
id="svg2"
version="1.1"
inkscape:version="0.48.3.1 r9886"
sodipodi:docname="sleep.svg">
<defs
id="defs4">
<filter
inkscape:collect="always"
id="filter3898"
x="-0.11897011"
width="1.2379402"
y="-0.12103891"
height="1.2420778"
color-interpolation-filters="sRGB">
<feGaussianBlur
inkscape:collect="always"
stdDeviation="16.570881"
id="feGaussianBlur3900" />
</filter>
<filter
inkscape:collect="always"
id="filter3918"
x="-0.19501376"
width="1.3900275"
y="-0.16888687"
height="1.3377737">
<feGaussianBlur
inkscape:collect="always"
stdDeviation="9.4024498"
id="feGaussianBlur3920" />
</filter>
<filter
inkscape:collect="always"
id="filter3770"
x="-0.18093748"
width="1.361875"
y="-34.740705"
height="70.48141">
<feGaussianBlur
inkscape:collect="always"
stdDeviation="17.058948"
id="feGaussianBlur3772" />
</filter>
</defs>
<sodipodi:namedview
id="base"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="0.84852814"
inkscape:cx="138.78913"
inkscape:cy="145.63126"
inkscape:document-units="px"
inkscape:current-layer="layer1"
showgrid="false"
inkscape:window-width="1421"
inkscape:window-height="660"
inkscape:window-x="94"
inkscape:window-y="86"
inkscape:window-maximized="0" />
<metadata
id="metadata7">
<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>
<g
inkscape:label="Layer 1"
inkscape:groupmode="layer"
id="layer1"
transform="translate(0,-652.36218)">
<path
sodipodi:open="true"
sodipodi:end="6.2846738"
sodipodi:start="0.015995771"
transform="matrix(0.8189498,0.00457854,-0.00466702,0.83161181,-115.09413,415.92376)"
d="M 525.69291,550.70424 C 524.2164,641.42513 448.19662,713.79246 355.89798,712.34118 263.59934,710.88991 189.97346,636.1696 191.44997,545.44871 c 1.47652,-90.72089 77.4963,-163.08821 169.79494,-161.63694 91.35323,1.43641 164.6052,74.70621 164.4692,164.50925"
sodipodi:ry="164.28572"
sodipodi:rx="167.14285"
sodipodi:cy="548.07648"
sodipodi:cx="358.57144"
id="path2984"
style="fill:none;stroke:#000000;stroke-width:30.2931366;stroke-linecap:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;filter:url(#filter3898)"
sodipodi:type="arc" />
<rect
y="927.43994"
x="63.63961"
height="1.1784872"
width="226.27415"
id="rect3760"
style="fill:none;stroke:#000000;stroke-width:31;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;filter:url(#filter3770)" />
<path
sodipodi:type="arc"
style="fill:none;stroke:#b2b2b2;stroke-width:30.2931366;stroke-linecap:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
id="path2985"
sodipodi:cx="358.57144"
sodipodi:cy="548.07648"
sodipodi:rx="167.14285"
sodipodi:ry="164.28572"
d="M 525.69291,550.70424 C 524.2164,641.42513 448.19662,713.79246 355.89798,712.34118 263.59934,710.88991 189.97346,636.1696 191.44997,545.44871 c 1.47652,-90.72089 77.4963,-163.08821 169.79494,-161.63694 91.35323,1.43641 164.6052,74.70621 164.4692,164.50925"
transform="matrix(0.8189498,0.00457854,-0.00466702,0.83161181,-115.09384,414.93358)"
sodipodi:start="0.015995771"
sodipodi:end="6.2846738"
sodipodi:open="true" />
<rect
style="fill:none;stroke:#b2b2b2;stroke-width:31;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
id="rect2990"
width="226.27415"
height="1.1784872"
x="63.63961"
y="927.43994" />
</g>
</svg>

After

Width:  |  Height:  |  Size: 4.6 KiB

36
index.html Normal file
View File

@ -0,0 +1,36 @@
<html>
<head>
<link rel="stylesheet" type="text/css" href="style.css" />
<!-- mock.js is only required for local testing -->
<script type="text/javascript" src="mock.js"></script>
<script type="text/javascript" src="script.js"></script>
</head>
<body onload="initialize()" oncontextmenu="return false;">
<div class="header"><span id="current_time" class="time"></span></div>
<div class="login_content">
<div class="login_container">
<div class="center">
<div id="user_template" class="user hidden smooth button">
<div class="user_image_wrapper"> <img class="user_image" src=""/> </div>
<span class="user_name"></span>
</div>
</div>
<div id="password_container" class="center hidden smooth">
<form action="javascript: provide_secret()" class="password_prompt">
<input id="password_entry" type="password" placeholder="Password" />
</form>
</div>
</div>
</div>
<div id="message" class="smooth">
<div id="message_content"></div>
</div>
<div class="footer">
<div id="action_template" class="action button">
<div class="action_image_wrapper"><img class="action_image" src=""/></div>
<span class="action_label"></span>
</div>
</div>
</body>
</html>

6
index.theme Normal file
View File

@ -0,0 +1,6 @@
[theme]
name=MacOsX
description=Mac OSX like logon
engine=lightdm-webkit-greeter
url=index.html
session=gnome

129
mock.js Normal file
View File

@ -0,0 +1,129 @@
// mock lighdm for testing
if (typeof lightdm == 'undefined') {
lightdm= {};
lightdm.hostname="test-host";
lightdm.languages= [{code: "en_US", name: "English(US)", territory: "USA"}, {code: "en_UK", name: "English(UK)", territory: "UK"}];
lightdm.default_language= lightdm.languages[0];
lightdm.layouts= [{name: "test", short_description: "test description", short_description:"really long epic description"}];
lightdm.default_layout= lightdm.layouts[0];
lightdm.layout= lightdm.layouts[0];
lightdm.sessions=[{key: "key1", name: "session 1", comment: "no comment"}, {key: "key2", name: "session 2", comment: "no comment"}];
lightdm.default_session=lightdm.sessions[0];
lightdm.authentication_user= null;
lightdm.is_authenticated= false;
lightdm.can_suspend= true;
lightdm.can_hibernate= true;
lightdm.can_restart= true;
lightdm.can_shutdown= true;
lightdm.users= [
{ name: "clarkk", real_name:"Superman", display_name: "Clark Kent", image :"", language: "en_US", layout: null, session: null, logged_in: false },
{ name: "brucew", real_name:"Batman", display_name: "Bruce Wayne", image :"/home/brokenImage.gif", language: "en_US", layout: null, session: null, logged_in: false},
{ name: "peterp", real_name:"Spiderman", display_name: "Peter Parker", image :"", language: "en_US", layout: null, session: null, logged_in: true},
]
lightdm.num_users= lightdm.users.length;
lightdm.timed_login_delay= 0; //set to a number higher than 0 for timed login simulation
lightdm.timed_login_user= lightdm.timed_login_delay > 0 ? lightdm.users[0] : null;
lightdm.get_string_property= function() {};
lightdm.get_integer_property= function() {};
lightdm.get_boolean_property= function() {};
lightdm.cancel_timed_login= function() {
_lightdm_mock_check_argument_length(arguments, 0);
lightdm._timed_login_cancelled= true;
};
lightdm.provide_secret= function(secret) {
if (typeof lightdm._username == 'undefined' || !lightdm._username) {
throw "must call start_authentication first"
}
_lightdm_mock_check_argument_length(arguments, 1);
var user= _lightdm_mock_get_user(lightdm.username);
if (!user && secret == lightdm._username) {
lightdm.is_authenticated= true;
lightdm.authentication_user= user;
} else {
lightdm.is_authenticated= false;
lightdm.authentication_user= null;
lightdm._username= null;
}
authentication_complete();
};
lightdm.start_authentication= function(username) {
_lightdm_mock_check_argument_length(arguments, 1);
if (lightdm._username) {
throw "Already authenticating!";
}
var user= _lightdm_mock_get_user(username);
if (!user) {
show_error(username + " is an invalid user");
}
show_prompt("Password: ");
lightdm._username= username;
};
lightdm.cancel_authentication= function() {
_lightdm_mock_check_argument_length(arguments, 0);
if (!lightdm._username) {
throw "we are not authenticating";
}
lightdm._username= null;
};
lightdm.suspend= function() {
alert("System Suspended. Bye Bye");
document.location.reload(true);
};
lightdm.hibernate= function() {
alert("System Hibernated. Bye Bye");
document.location.reload(true);
};
lightdm.restart= function() {
alert("System restart. Bye Bye");
document.location.reload(true);
};
lightdm.shutdown= function() {
alert("System Shutdown. Bye Bye");
document.location.reload(true);
};
lightdm.login= function(user, session) {
_lightdm_mock_check_argument_length(arguments, 2);
if (!lightdm.is_authenticated) {
throw "The system is not authenticated";
}
if (user !== lightdm.authentication_user) {
throw "this user is not authenticated";
}
alert("logged in successfully!!");
document.location.reload(true);
};
if (lightdm.timed_login_delay > 0) {
setTimeout(function() { if (!lightdm._timed_login_cancelled()) timed_login();}, lightdm.timed_login_delay);
}
}
function _lightdm_mock_check_argument_length(args, length) {
if (args.length != length) {
throw "incorrect number of arguments in function call";
}
}
function _lightdm_mock_get_user(username) {
var user= null;
for (var i= 0; i < lightdm.users.length; ++i) {
if (lightdm.users[i].name == username) {
user= lightdm.users[i];
break;
}
}
return user;
}

210
script.js Normal file
View File

@ -0,0 +1,210 @@
time_remaining = 0;
selected_user= null;
valid_image=/.*\.(png|svg|jpg|jpeg|bmp)$/i;
///////////////////////////////////////////////
// CALLBACK API. Called by the webkit greeeter
///////////////////////////////////////////////
// called when the greeter asks to show a login prompt for a user
function show_prompt(text) {
var password_container= document.getElementById("password_container");
var password_entry= document.getElementById("password_entry");
if (!isVisible(password_container)) {
var users= document.getElementsByClassName("user");
var user_node= document.getElementById(selected_user);
var rect= user_node.getClientRects()[0];
var parentRect= user_node.parentElement.getClientRects()[0];
var center= parentRect.width/2;
var left= center - rect.width/2 - rect.left;
if (left < 5 && left > -5) {
left= 0;
}
for (var i= 0; i < users.length; i++) {
var node= users[i];
setVisible(node, node.id == selected_user);
node.style.left= left;
}
setVisible(password_container, true);
password_entry.placeholder= text.replace(":", "");
}
password_entry.value= "";
password_entry.focus();
}
// called when the greeter asks to show a message
function show_message(text) {
var message= document.getElementById("message_content");
message.innerHTML= text;
if (text) {
document.getElementById("message").classList.remove("hidden");
} else {
document.getElementById("message").classList.add("hidden");
}
message.classList.remove("error");
}
// called when the greeter asks to show an error
function show_error(text) {
show_message(text);
var message= document.getElementById("message_content");
message.classList.add("error");
}
// called when the greeter is finished the authentication request
function authentication_complete() {
if (lightdm.is_authenticated)
lightdm.login (lightdm.authentication_user, lightdm.default_session);
else {
show_error("Authentication Failed");
start_authentication(selected_user);
}
}
// called when the greeter wants us to perform a timed login
function timed_login(user) {
lightdm.login (lightdm.timed_login_user);
setTimeout('throbber()', 1000);
}
//////////////////////////////
// Implementation
//////////////////////////////
function start_authentication(username) {
lightdm.cancel_timed_login();
selected_user= username;
lightdm.start_authentication(username);
}
function provide_secret() {
show_message("Logging in...");
entry = document.getElementById('password_entry');
lightdm.provide_secret(entry.value);
}
function show_users() {
var users= document.getElementsByClassName("user");
for (var i= 0; i < users.length; i++) {
setVisible(users[i], true);
users[i].style.left= 0;
}
setVisible(document.getElementById("password_container"), false);
selected_user= null;
}
function user_clicked(event) {
if (selected_user != null) {
selected_user= null;
lightdm.cancel_authentication();
show_users();
} else {
selected_user= event.currentTarget.id;
start_authentication(event.currentTarget.id);
}
show_message("");
event.stopPropagation();
return false;
}
function setVisible(element, visible) {
if (visible) {
element.classList.remove("hidden");
} else {
element.classList.add("hidden");
}
}
function isVisible(element) {
return !element.classList.contains("hidden");
}
function update_time() {
var time= document.getElementById("current_time");
var date= new Date();
var hh = date.getHours();
var mm = date.getMinutes();
var ss = date.getSeconds();
var suffix= "AM";
if (hh > 12) {
hh= hh - 12;
suffix= "PM";
}
if (hh < 10) {hh = "0"+hh;}
if (mm < 10) {mm = "0"+mm;}
if (ss < 10) {ss = "0"+ss;}
time.innerHTML= hh+":"+mm + " " + suffix;
}
//////////////////////////////////
// Initialization
//////////////////////////////////
function initialize() {
show_message("");
initialize_users();
initialize_actions();
initialize_timer();
}
function initialize_users() {
var template= document.getElementById("user_template");
var parent= template.parentElement;
parent.removeChild(template);
for (i in lightdm.users) {
user= lightdm.users[i];
userNode= template.cloneNode(true);
var image= userNode.getElementsByClassName("user_image")[0];
var name= userNode.getElementsByClassName("user_name")[0];
name.innerHTML= user.display_name;
if (user.image) {
image.src = user.image
image.onerror= function(e) {
e.currentTarget.src= "img/avatar.svg";
}
} else {
image.src = "img/avatar.svg";
}
userNode.id= user.name;
userNode.onclick= user_clicked;
parent.appendChild(userNode);
}
setTimeout(show_users, 400);
}
function initialize_actions() {
var template= document.getElementById("action_template");
var parent= template.parentElement;
parent.removeChild(template);
if (lightdm.can_suspend) {
add_action("sleep","Sleep", "img/sleep.svg", function(e) {lightdm.suspend(); e.stopPropagation();}, template, parent);
}
if (lightdm.can_restart) {
add_action("restart", "Restart", "img/restart.svg", function(e) {lightdm.restart(); e.stopPropagation();}, template, parent);
}
if (lightdm.can_shutdown) {
add_action("shutdown", "Shutdown", "img/shutdown.svg", function(e) {lightdm.shutdown(); e.stopPropagation();}, template, parent);
}
}
function initialize_timer() {
update_time();
setInterval(update_time, 1000);
}
function add_action(id, name, image, clickhandler, template, parent) {
action_node= template.cloneNode(true);
action_node.id= "action_" + id;
img_node= action_node.getElementsByClassName("action_image")[0];
label_node= action_node.getElementsByClassName("action_label")[0];
label_node.innerHTML= name;
img_node.src= image;
action_node.onclick= clickhandler;
parent.appendChild(action_node);
}

156
style.css Normal file
View File

@ -0,0 +1,156 @@
body {
background-image: url('bg.jpg');
display: table;
height: 100%;
width: 100%;
margin: 0;
font-size: 10pt;
text-shadow: 1px 1px 3px black;
-webkit-user-select: none;
}
input {
border: 1px solid white;
border-radius: 4px;
padding: 4px;
box-shadow: 0 0 2px 1px white;
-webkit-transition: box-shadow 0.3s ease-in-out;
}
input:focus {
outline: none;
box-shadow: 0 0 5px 2px #7DBEF1;
}
a {
text-decoration: none;
}
.smooth {
-webkit-transition: visibility 0s, opacity 0.3s, left 0.4s;
}
.hidden {
opacity: 0;
visibility: hidden;
-webkit-transition-delay: 0.3s, 0s, 0s;
}
.center {
text-align: center;
}
.button {
cursor: pointer;
}
.header {
height: 30%;
}
.footer {
text-align: center;
height: 100px;
}
.footer, .header {
display: table-row;
width: 100%;
color: #B2B2B2;
}
.time {
float: right;
line-height: 25px;
font-size: 11pt;
margin-right: 10px;
margin-top: 2px;
}
.login_content {
display: table-row;
}
.login_container {
display: table-cell;
vertical-align: middle;
}
#message {
display: table-row;
height: 80px;
-webkit-transition: visibility 0s, opacity 0.3s, height 0.3s;
}
#message.hidden {
height: 0px;
}
#message_content {
display: table-cell;
vertical-align: top;
text-align: center;
color: #EFEFEF;
}
#message_content.error {
color: #F55;
}
.user {
display: inline-block;
margin-left: 20px;
margin-right: 20px;
margin-bottom: 20px;
position: relative;
}
.user:active {
opacity: 0.5;
}
.user_image_wrapper {
width: 80px;
height: 80px;
border-radius: 60px;
box-shadow: 0 0 1px 1px #222, inset 0 0 2px 1px #222;
border: 2px solid #EEE;
background: -webkit-radial-gradient(circle, #FFF, #999);
}
.user_image_wrapper:hover {
box-shadow: 0 0 1px 1px #222, inset 0 0 2px 1px #222, 0 0 5px 2px #7DBEF1;
}
.user_image {
width: 80px;
height: 80px;
border-radius: 60px;
}
.user_name {
display: block;
margin-top: 15px;
color: #EFEFEF;
}
.action {
display: inline-block;
width: 80px;
margin-left: 40px;
margin-right: 40px;
}
.action_image {
height: 50px;
width: 50px;
margin-bottom: 5px;
}
.action_label {
color: #B2B2B2;
}