diff --git a/packages/lightdm-webkit-greeter-hamara/debian/changelog b/packages/lightdm-webkit-greeter-hamara/debian/changelog index dea1dff0702b8debb4bbee0efe9dfecbbc075885..6f8259cfaeaf99e755cb08d0d91537065642663c 100644 --- a/packages/lightdm-webkit-greeter-hamara/debian/changelog +++ b/packages/lightdm-webkit-greeter-hamara/debian/changelog @@ -1,3 +1,10 @@ +lightdm-webkit-greeter-hamara (2.0) namaste; urgency=medium + + * New design. + * Add session chooser. + + -- I Sagar Thu, 28 Jun 2018 17:53:11 +0530 + lightdm-webkit-greeter-hamara (1.0) namaste; urgency=medium * Initial release. diff --git a/packages/lightdm-webkit-greeter-hamara/debian/compat b/packages/lightdm-webkit-greeter-hamara/debian/compat index ec635144f60048986bc560c5576355344005e6e7..f599e28b8ab0d8c9c57a486c89c4a5132dcbd3b2 100644 --- a/packages/lightdm-webkit-greeter-hamara/debian/compat +++ b/packages/lightdm-webkit-greeter-hamara/debian/compat @@ -1 +1 @@ -9 +10 diff --git a/packages/lightdm-webkit-greeter-hamara/debian/control b/packages/lightdm-webkit-greeter-hamara/debian/control index 75e7b3f0cf2ce32050b8bef3fad44854defddfd6..01577e4c0ebcec8d6104f3ab9c3b61c69317d01d 100644 --- a/packages/lightdm-webkit-greeter-hamara/debian/control +++ b/packages/lightdm-webkit-greeter-hamara/debian/control @@ -3,7 +3,7 @@ Section: admin Priority: extra Maintainer: I Sagar Build-Depends: debhelper (>= 9.0.0) -Standards-Version: 3.9.8 +Standards-Version: 4.1.3 Homepage: https://bugs.hamaralinux.org/show_bug.cgi?id=301 Package: lightdm-webkit-greeter-hamara diff --git a/packages/lightdm-webkit-greeter-hamara/src/css/style.css b/packages/lightdm-webkit-greeter-hamara/src/css/style.css index 71f2b4e6801f177c1bdfc718d355f86c48a8e82f..99e71e85221e8201ff932e4cb7d0544840cd8c7f 100644 --- a/packages/lightdm-webkit-greeter-hamara/src/css/style.css +++ b/packages/lightdm-webkit-greeter-hamara/src/css/style.css @@ -1,376 +1,499 @@ -@font-face { - font-family: 'Source Sans Pro'; - src: url('../fonts/source_sans_pro.ttf') format('truetype'); - font-weight: normal; - font-style: normal; -} +/* + Copyright (C) 2018 Hamara Linux -@font-face { - font-family: 'powerbtn'; - src: url('../fonts/power.ttf') format('truetype'); - font-weight: normal; - font-style: normal; -} + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + +*/ +/* Load font files */ @font-face { - font-family: 'sleepbtn'; - src: url('../fonts/sleep.ttf') format('truetype'); - font-weight: normal; - font-style: normal; + font-family: 'Source Sans Pro'; + src: url('../fonts/source_sans_pro.ttf') format('truetype'); + font-weight: normal; + font-style: normal; } @font-face { - font-family: 'restartbtn'; - src: url('../fonts/restart.ttf') format('truetype'); - font-weight: normal; - font-style: normal; + font-family: 'powerbtn'; + src: url('../fonts/power.ttf') format('truetype'); + font-weight: normal; + font-style: normal; } @font-face { - font-family: 'shutdownbtn'; - src: url('../fonts/shutdown.ttf') format('truetype'); - font-weight: normal; - font-style: normal; + font-family: 'Icons'; + src: url('../fonts/Icons.eot?kqfb15'); + src: url('../fonts/Icons.eot?kqfb15#iefix') format('embedded-opentype'), url('../fonts/Icons.ttf?kqfb15') format('truetype'), url('../fonts/Icons.woff?kqfb15') format('woff'), url('../fonts/Icons.svg?kqfb15#Icons') format('svg'); + font-weight: normal; + font-style: normal; } - - body { - background-image: url('../img/bg.png'); - display: table; - height: 100%; - width: 100%; - margin: 0; - -webkit-user-drag: none; - -webkit-user-select: none; - } + background-image: url('../img/bg.png'); + display: table; + height: 100%; + width: 100%; + margin: 0; + -webkit-user-drag: none; + -webkit-user-select: none; +} input { - font-family: 'source sans pro'; - width: 240px; - border: 1px solid white; - padding: 4px 8px 4px 8px; - box-shadow: 0 0 2px 1px #606067; - -webkit-transition: box-shadow 0.3s ease-in-out; + font-family: 'Source Sans Pro'; + font-weight: 400; + width: 240px; + border: 1px solid white; + padding: 4px 8px 4px 8px; + box-shadow: 0 0 2px 1px #606067; + -webkit-transition: box-shadow all 0.3s; } -input:focus { - outline:none; - box-shadow: 0 0 5px 2px #7DBEF1; +input:focus { + outline: none; } a { - text-decoration: none; + text-decoration: none; } .smooth { - -webkit-transition: visibility 0s , opacity 0.3s , left 0.4s; + -webkit-transition: visibility 0s, opacity 0.3s, left 0.4s; } - .hidden { - opacity: 0; - visibility: hidden; - -webkit-transition-delay: 0.3s, 0s, 0s; + opacity: 0; + visibility: hidden; } .center { - text-align: center; + text-align: center; + margin: 0 auto; } .button { - display: inline-block; - font-weight: 500; - line-height: 1.25; - white-space: nowrap; - vertical-align: middle; - border: 1px solid transparent; - padding: 5px 9px 9px 9px; - font-size: 1rem; - font-family: 'Source Sans Pro'; - -webkit-transition: all .2s ease-in-out; - cursor: pointer; - transition: all .2s ease-in-out; - color: #ffffff; - height: 15; - width: 50; - text-align: center; + display: inline-block; + height: 20; + width: 49px; + text-align: center; + font-weight: 400; + font-size: 1em; + font-family: 'Source Sans Pro'; + white-space: nowrap; + vertical-align: middle; + padding:8px 11px; + cursor: pointer; + border: 1px solid transparent; + -webkit-transition: all 0.3s; + transition: all 0.3s; + color: #ffffff; } .login_content { - display: table-row; + display: table-row; } .login_container { - display: table-cell; - vertical-align: middle; - height: 90%; + display: table-cell; + vertical-align: middle; + height: 90%; } #cancel { - background-color: #B3B3B3; - border-color: #B3B3B3; - } - - #cancel:hover { - background-color: #5B5B62 ; - border-color: #5B5B62 ; - } - + background-color: #B3B3B3; + border-bottom: 2px solid #a1a1a7; + border-radius: 4px; +} +#cancel:hover { + background-color: #5B5B62; + border-color: #a1a1a7; +} #login { - background-color: #F7931E; - border-color: #F7931E; + background-color: #F7931E; + border-bottom: 2px solid #e68513; + border-radius: 4px; } #login:hover { - background-color: #F15A24; - border-color: #F15A24; + background-color: #F15A24; + border-color: #e68513; } - - - +/* Error message when authentication fails */ #message { - display: table-row; - height: 80px; - -webkit-transition: visibility 0s, opacity 0.3s, height 0.3s; + display: table-row; + height: 80px; + -webkit-transition: visibility 0s, opacity 0.3s, height 0.3s; } #message.hidden { - height: 0px; + height: 0px; } #message_content { - display: table-cell; - vertical-align: top; - text-align: center; - color: #EFEFEF; + display: table-cell; + vertical-align: top; + text-align: center; + color: #EFEFEF; } #message_content.error { - color:#F55; + color: #F55; } +/* User list */ .user { - display: inline-block; - margin-left: 20px; - margin-right: 20px; - margin-bottom: 20px; - position: relative; - cursor: pointer; - font-family: 'Source Sans Pro'; + display: inline-block; + margin-left: 15px; + margin-right: 15px; + margin-bottom: 15px; + position: relative; + transition: all 0.3s; + cursor: pointer; + font-family: 'Source Sans Pro'; + font-weight: 400; + align-content: center; } .user:active { - opacity: 0.5; + opacity: 0.5; } +/* User avatar */ .user_image_wrapper { - width: 80px; - height: 80px; - border-radius: 80px; - border: 2px solid #000; - background: -webkit-radial-gradient(circle, #FFF , #7b7b81 ); - + width: 80px; + height: 80px; + border-radius: 80px; + border: 1px solid #000; + background: #7b7b81; + transition: all 0.3s; + text-align: center; } .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; - -webkit-user-drag: none; - -webkit-user-select: none; + box-shadow: 0 0 10px 2px #777777; } -.user_name { - display: block; - margin-top: 15px; - color: #7B7B81; - font-weight: 600 ; +.user_template { + text-align: center; } -.footer { - height: 10%; - +.user_image { + width: 80px; + height: 80px; + text-align: center; + border-radius: 60px; + transition: all 0.3s; + -webkit-user-drag: none; + -webkit-user-select: none; } -.logo { - width:60; - height:60; - -webkit-user-drag: none; +/* User name styling */ +.user_name { + display: block; + margin-top: 15px; + margin-bottom: 15px; + color: #7B7B81; + transition: all 0.3s; + font-size: 20px; + font-weight: 400; + text-align: center; } ul { - list-style-type: none; - margin: 0; - padding: 0; - overflow: hidden; - display: inline-block; + list-style-type: none; + margin: 0; + padding: 0; + overflow: hidden; + display: inline-block; } ul li { - margin: 5px 20px; + margin: 5px 20px; } li { - float: left; + float: left; } -li a{ - list-style-position: inside; - cursor: pointer; +li a { + list-style-position: inside; + cursor: pointer; } -.power{ - display: inline-block; - font-size: 25px; - font-family: "powerbtn"; - color: #B3B3B3; - text-align: center; - text-decoration: none; - -webkit-user-drag: none; - margin-top: 5px; - } +.power { + display: inline-block; + font-size: 32px; + font-family: "powerbtn"; + color: #B3B3B3; + text-align: center; + text-decoration: none; + margin-top: 4px; + margin-bottom: 20px; + transition: all 0.3s; + -webkit-user-drag: none; +} -/* use hover button for poweroff*/ +/* Use hover button for poweroff */ .power:hover { - background: transparent; - color: #E53A40; + background: transparent; + color: #E53A40; } - /* Dropdown */ dropdown { - display: inline-block; + display: inline-block; + margin-top: 10px; } .dropdown-content { - visibility: hidden; - position: absolute; - opacity: 0; - z-index: -1; - transform: translateY(-2em); - transition: all 0.3s ease-in-out 0s, visibility 0s linear 0.3s, z-index 0s linear 0.01s; - margin-left: -40px; + visibility: hidden; + position: absolute; + opacity: 0; + z-index: -1; + transform: translateY(-2em); + transition: all 0.3s; + margin-left: -101px; } .dropdown-content a { - font-family: 'source sans pro'; - font-size: 1rem; - background-color: #F7931E; - color: white; - text-decoration: none; - display: block; - text-align: center; - height: 40px; - width: 110px; - -webkit-user-drag: none; + font-family: 'Source Sans Pro'; + font-size: 1rem; + background-color: inherit; + color: #b3b3b3; + text-decoration: none; + text-align: center; + display: inline; + height: 60px; + width: 60px; + transition: all 0.3s; + -webkit-user-drag: none; +} + +.dropdown-text{ + font-family: 'Source Sans Pro'; + font-size: 14px; + background-color: inherit; + text-decoration: none; + text-align: center; + display: inline; + height: 60px; + width: 60px; + padding-top: 10px; + -webkit-user-drag: none; + margin-left: 1px; + font-weight: 400; } -.dropdown-content a:hover { - background-color: #F15A24; - +.dropdown:hover .dropdown-content { + visibility: visible; + opacity: 1; + z-index: 1; + transform: translateY(0%); + color: #E53A40; } -.dropdown:hover .dropdown-content { - visibility: visible; - opacity: 1; - z-index: 1; - transform: translateY(0%); - transition-delay: 0s, 0s, 0.3s; -} - -.icon_sleep { - margin-top: 20px; -} - -.icon_restart { - margin-top: 1px; -} - -.icon_shutdown { - margin-top: 1px; -} - -.icon_sleep:before{ - font-family: "sleepbtn" ; - content: '\e900'; - position: relative; - top: 5px; - font-size: 25px; -} - -.icon_restart:before{ - font-family: 'restartbtn'; - content: '\e900'; - position: relative; - top: 5px; - padding-left: 5px; - font-size: 25px; -} - -.icon_shutdown:before{ - font-family: 'shutdownbtn'; - content: '\e900'; - padding-left: 5px; - position: relative; - top: 4px; - font-size: 25px; -} - -.overlay { - position: fixed; - top: 0; - bottom: 0; - left: 0; - right: 0; - background: rgba(0, 0, 0, 0.7); - transition: opacity 100ms; - visibility: hidden; - opacity: 0; -} -.overlay:target { - visibility: visible; - opacity: 1; -} - -.popup { - top: 50%; - left: 50%; - background: #fff; - border-radius: 5px; - transform: translate(-50%, -50%); - width: 30%; - height: 10%; - position: fixed; - transition: all 5s ease-in-out; -} - -.popup .close { - position: absolute; - top: 20px; - right: 30px; - transition: all 100ms; - font-size: 20px; - font-weight: bold; - color: #333; - margin: -20px; -} -.popup .close:hover { - color: #06D85F; -} -.popup .content { - max-height: 20%; -} - -@media screen and (max-width: 700px){ - .popup{ - width: 70%; - } -} \ No newline at end of file +.icon { + /* Use !important to prevent issues with browser extensions that change fonts */ + font-family: 'Icons' !important; + speak: none; + font-style: normal; + font-weight: normal; + font-variant: normal; + text-transform: none; + line-height: 1; + /* Better Font Rendering =========== */ + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; + padding-right: 20px; +} + +.icon-Sleep:before { + content: "\e902"; + position: relative; + padding: 10px; + font-size: 30px; +} + +.icon-Sleep:hover { + color: #E53A40; +} + +.icon-Restart:before { + content: "\e900"; + position: relative; + padding: 10px; + font-size: 31px; +} + +.icon-Restart:hover { + color: #E53A40; +} + +.icon-Shutdown:before { + content: "\e901"; + position: relative; + padding: 10px; + font-size: 29px; +} + +.icon-Shutdown:hover { + color: #E53A40; +} + +/* The container must be positioned relative: */ +.custom-select { + position: relative; + margin: 0 auto; + text-align: left; + background-color: #fff; + transition: all 0.3s; +} + +.custom-select select { + display: none; /*hide original SELECT element:*/ +} + +.select-selected { + background-color: #fff; + transition: all 0.3s; +} + +/*style the arrow inside the select element:*/ + +.select-selected:after { + position: absolute; + content: ""; + top: 17px; + right: 10px; + width: 0; + height: 0; + border: 6px solid transparent; + border-color: #5b5b62 transparent transparent transparent; + transition: all 0.3s; +} + +/*point the arrow upwards when the select box is open (active):*/ +.select-selected.select-arrow-active:after { + border-color: transparent transparent #5b5b62 transparent; + top: 10px; + transition: all 0.3s; +} + +/*style the items (options), including the selected item:*/ + .select-selected { + padding: 10px 8px; + box-shadow: none; + background: transparent; + background-image: none; + -webkit-appearance: none; + font-size: 14px; + color: #757575; + font-family: 'Source Sans Pro'; + text-align: left; + border-radius: 0px; + margin-top: -1px; + box-shadow: 0px 0px 22px 0px rgba(0,0,0,0.15); + border-radius: 4px; + transition: all 0.3s; +} + +.select-items div { + padding: 10px 8px; + box-shadow: none; + background: transparent; + background-image: none; + -webkit-appearance: none; + font-size: 14px; + color: #757575; + font-family: 'Source Sans Pro'; + text-align: left; + border-radius: 0px; + transition: all 0.3s; +} + +/*style items (options):*/ +.select-items { + position: absolute; + background-color: #fff; + top: 100%; + left: 0; + right: 0; + z-index: 99; + box-shadow: 0px 12px 22px 0px rgba(0,0,0,0.15); + border-radius: 0px 0px 4px 4px; + transition: all 0.3s; +} + +.center { + text-align: center; +} + +/*hide the items when the select box is closed:*/ +.select-hide { + display: none; + transition: all 0.3s; +} + +.select-items div:hover, .same-as-selected { + background-color: rgba(0, 0, 0, 0.1); + transition: all 0.3s; +} + +/* Password box styling */ + +.password_container{ + margin-bottom: 10px; +} + +input { + width: 257px; + padding: 10px 8px; + font-size:16px; + box-shadow: 0px 0px 22px 0px rgba(0,0,0,0.15); + border-radius: 4px; +} + +#password_entry{ + font-size:14px; + width: 257px; + color: #5b5b62; + padding-left: 8px; + text-align: left; +} + +input[type=number]::-webkit-inner-spin-button, +input[type=number]::-webkit-outer-spin-button { + -webkit-appearance: none; + margin: 0; +} + +/* Footer section */ +.footer { + height: 10%; + margin: 0 auto; +} + +.logo { + width: 60px; + height: 60px; + -webkit-user-drag: none; + margin: 0 auto; + margin-bottom: 20px; +} diff --git a/packages/lightdm-webkit-greeter-hamara/src/fonts/Icons.eot b/packages/lightdm-webkit-greeter-hamara/src/fonts/Icons.eot new file mode 100644 index 0000000000000000000000000000000000000000..3c39a9f4793074a57f47e66608333144914411eb Binary files /dev/null and b/packages/lightdm-webkit-greeter-hamara/src/fonts/Icons.eot differ diff --git a/packages/lightdm-webkit-greeter-hamara/src/fonts/Icons.svg b/packages/lightdm-webkit-greeter-hamara/src/fonts/Icons.svg new file mode 100644 index 0000000000000000000000000000000000000000..81b852cd8a9a37f3745f805b2c78a31e44968878 --- /dev/null +++ b/packages/lightdm-webkit-greeter-hamara/src/fonts/Icons.svg @@ -0,0 +1,13 @@ + + + +Generated by IcoMoon + + + + + + + + + \ No newline at end of file diff --git a/packages/lightdm-webkit-greeter-hamara/src/fonts/Icons.ttf b/packages/lightdm-webkit-greeter-hamara/src/fonts/Icons.ttf new file mode 100644 index 0000000000000000000000000000000000000000..78ed8aaacf9c83761f6a4f53e8b01ce75a621539 Binary files /dev/null and b/packages/lightdm-webkit-greeter-hamara/src/fonts/Icons.ttf differ diff --git a/packages/lightdm-webkit-greeter-hamara/src/fonts/Icons.woff b/packages/lightdm-webkit-greeter-hamara/src/fonts/Icons.woff new file mode 100644 index 0000000000000000000000000000000000000000..403f23528e90ea8efcfef3f7bc205102a616720f Binary files /dev/null and b/packages/lightdm-webkit-greeter-hamara/src/fonts/Icons.woff differ diff --git a/packages/lightdm-webkit-greeter-hamara/src/fonts/restart.ttf b/packages/lightdm-webkit-greeter-hamara/src/fonts/restart.ttf deleted file mode 100644 index ae183a9af28375190342c5a063917eb8b6f03a6c..0000000000000000000000000000000000000000 Binary files a/packages/lightdm-webkit-greeter-hamara/src/fonts/restart.ttf and /dev/null differ diff --git a/packages/lightdm-webkit-greeter-hamara/src/fonts/shutdown.ttf b/packages/lightdm-webkit-greeter-hamara/src/fonts/shutdown.ttf deleted file mode 100644 index bff40b4f39653e2411c1af2fb4160c4135990341..0000000000000000000000000000000000000000 Binary files a/packages/lightdm-webkit-greeter-hamara/src/fonts/shutdown.ttf and /dev/null differ diff --git a/packages/lightdm-webkit-greeter-hamara/src/fonts/sleep.ttf b/packages/lightdm-webkit-greeter-hamara/src/fonts/sleep.ttf deleted file mode 100644 index 4e823c00a113a0cfc8bf64dffe1fd88ad85ff89a..0000000000000000000000000000000000000000 Binary files a/packages/lightdm-webkit-greeter-hamara/src/fonts/sleep.ttf and /dev/null differ diff --git a/packages/lightdm-webkit-greeter-hamara/src/img/avatar.png b/packages/lightdm-webkit-greeter-hamara/src/img/avatar.png index ff14a5a89e90a8cc6b653e5353c06f900bbbec50..0aac976cd2d71a466e8224d0cea5cc890c371605 100644 Binary files a/packages/lightdm-webkit-greeter-hamara/src/img/avatar.png and b/packages/lightdm-webkit-greeter-hamara/src/img/avatar.png differ diff --git a/packages/lightdm-webkit-greeter-hamara/src/img/cancel.svg b/packages/lightdm-webkit-greeter-hamara/src/img/cancel.svg deleted file mode 100644 index 2e2278c0bbc6736bcc71d005af40055e7ac3361e..0000000000000000000000000000000000000000 --- a/packages/lightdm-webkit-greeter-hamara/src/img/cancel.svg +++ /dev/null @@ -1 +0,0 @@ -CancelCancel \ No newline at end of file diff --git a/packages/lightdm-webkit-greeter-hamara/src/img/sign-in.svg b/packages/lightdm-webkit-greeter-hamara/src/img/sign-in.svg deleted file mode 100644 index 66bb7a3189085331b1d5961b73b51d8a12b5a76f..0000000000000000000000000000000000000000 --- a/packages/lightdm-webkit-greeter-hamara/src/img/sign-in.svg +++ /dev/null @@ -1 +0,0 @@ -Sign InSign In \ No newline at end of file diff --git a/packages/lightdm-webkit-greeter-hamara/src/index.html b/packages/lightdm-webkit-greeter-hamara/src/index.html index 244531be504c8b7fe33403a01d6b8ace6a9bd70b..f9ed48f27125ff81633da7184f26bd5e53961ff1 100644 --- a/packages/lightdm-webkit-greeter-hamara/src/index.html +++ b/packages/lightdm-webkit-greeter-hamara/src/index.html @@ -1,55 +1,117 @@ - + + + - - + + + + + + + + + - - -
- -
-
-
-
- - - - - + + + + +
+
+
+
+ + + + diff --git a/packages/lightdm-webkit-greeter-hamara/src/index.theme b/packages/lightdm-webkit-greeter-hamara/src/index.theme index 0ec3b14893f52a283324e105b33bcf8f1e4853fd..495f03e6b0c270c754a8e39dee730efb72afd987 100644 --- a/packages/lightdm-webkit-greeter-hamara/src/index.theme +++ b/packages/lightdm-webkit-greeter-hamara/src/index.theme @@ -1,7 +1,6 @@ [theme] name=hamara -description=Hamara Sugam Login theme +description=Hamara Webkit based Login theme engine=lightdm-webkit-greeter url=index.html session=mate - diff --git a/packages/lightdm-webkit-greeter-hamara/src/js/script.js b/packages/lightdm-webkit-greeter-hamara/src/js/script.js index fd2fabb869bb812ca49dc0dea31f8dd58ae48706..661446d4484a7c8225aade92811189f792ab887f 100644 --- a/packages/lightdm-webkit-greeter-hamara/src/js/script.js +++ b/packages/lightdm-webkit-greeter-hamara/src/js/script.js @@ -1,123 +1,236 @@ +/* + Copyright (C) 2018 Hamara Linux + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + +*/ + selected_user= null; valid_image=/.*\.(png|svg|jpg|jpeg|bmp)$/i; +var selectedsession = lightdm.default_session; 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; - } + 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(); + 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"); + 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"); + show_message(text); + var message= document.getElementById("message_content"); + message.classList.add("error"); } function authentication_complete() { - if (lightdm.is_authenticated) - lightdm.login (lightdm.authentication_user, lightdm.default_session); - else { - show_error("Authentication Failed"); - start_authentication(selected_user); - } + if (lightdm.is_authenticated) + lightdm.login (lightdm.authentication_user, selectedsession); + else { + show_error("Authentication Failed"); + start_authentication(selected_user); + } } function timed_login(user) { - lightdm.login (lightdm.timed_login_user); - setTimeout('throbber()', 1000); + lightdm.login (lightdm.timed_login_user); + setTimeout('throbber()', 1000); } function start_authentication(username) { - lightdm.cancel_timed_login(); - selected_user= username; - lightdm.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); + 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; + 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; + 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"); - } + if(visible){ + element.classList.remove("hidden"); + } else { + element.classList.add("hidden"); + } } function isVisible(element) { - return !element.classList.contains("hidden"); + return !element.classList.contains("hidden"); } - - - // Initialization function initialize() { - show_message(""); - initialize_users(); + show_message(""); + initialize_users(); + if (lightdm.sessions.length < 2){ + document.getElementById("selectstylediv").style.display = 'none'; + selectedsession = lightdm.default_session; + } + else{ + for (i in lightdm.sessions){ + session = lightdm.sessions[i]; + var sessiondropdown = document.getElementById("sessionlist"); + var sessionoption = document.createElement('option'); + + if (session.key == selectedsession){ + sessionoption.value = session.key; + sessionoption.innerHTML = session.key; + sessiondropdown.appendChild(sessionoption); + } + else{ + sessionoption.value = session.key; + sessionoption.innerHTML = session.key; + sessiondropdown.appendChild(sessionoption); + } + } + /* For adding list of sessions */ + var x, i, j, selElmnt, a, b, c; + /*look for any elements with the class "custom-select":*/ + x = document.getElementsByClassName("custom-select"); + for (i = 0; i < x.length; i++) { + selElmnt = x[i].getElementsByTagName("select")[0]; + /*for each element, create a new DIV that will act as the selected item:*/ + a = document.createElement("DIV"); + a.setAttribute("class", "select-selected"); + a.innerHTML = selElmnt.options[selElmnt.selectedIndex].innerHTML; + x[i].appendChild(a); + /*for each element, create a new DIV that will contain the option list:*/ + b = document.createElement("DIV"); + b.setAttribute("class", "select-items select-hide"); + for (j = 0; j < selElmnt.length; j++) { + /*for each option in the original select element, + create a new DIV that will act as an option item:*/ + c = document.createElement("DIV"); + c.innerHTML = selElmnt.options[j].innerHTML; + c.addEventListener("click", function(e) { + /*when an item is clicked, update the original select box, + and the selected item:*/ + var y, i, k, s, h; + s = this.parentNode.parentNode.getElementsByTagName("select")[0]; + h = this.parentNode.previousSibling; + for (i = 0; i < s.length; i++) { + if (s.options[i].innerHTML == this.innerHTML) { + s.selectedIndex = i; + h.innerHTML = this.innerHTML; + y = this.parentNode.getElementsByClassName("same-as-selected"); + for (k = 0; k < y.length; k++) { + y[k].removeAttribute("class"); + } + this.setAttribute("class", "same-as-selected"); + break; + } + } + h.click(); + }); + b.appendChild(c); + } + x[i].appendChild(b); + a.addEventListener("click", function(e) { + /*when the select box is clicked, close any other select boxes, + and open/close the current select box:*/ + e.stopPropagation(); + closeAllSelect(this); + this.nextSibling.classList.toggle("select-hide"); + this.classList.toggle("select-arrow-active"); + }); + } + function closeAllSelect(elmnt) { + /*a function that will close all select boxes in the document, + except the current select box:*/ + var x, y, i, arrNo = []; + x = document.getElementsByClassName("select-items"); + y = document.getElementsByClassName("select-selected"); + for (i = 0; i < y.length; i++) { + if (elmnt == y[i]) { + arrNo.push(i) + } else { + y[i].classList.remove("select-arrow-active"); + } + } + for (i = 0; i < x.length; i++) { + if (arrNo.indexOf(i)) { + x[i].classList.add("select-hide"); + } + } + } + /*if the user clicks anywhere outside the select box, + then close all select boxes:*/ + document.addEventListener("click", closeAllSelect); + } } function initialize_users() { @@ -133,14 +246,15 @@ function initialize_users() { var name= userNode.getElementsByClassName("user_name")[0]; name.innerHTML= user.display_name; + /* User avatar.png as fallback */ if (user.image) { - image.src = user.image + image.src = user.image; image.onerror = function(e) { - e.currentTarget.src= "img/avatar.png" - } + e.currentTarget.src= "img/avatar.png"; + }; } else { - image.src = "img/avatar.png" - } + image.src = "img/avatar.png"; + } userNode.id= user.name; userNode.onclick= user_clicked; @@ -161,9 +275,13 @@ function restart_clicked(event){ lightdm.restart(); } } - + function shutdown_clicked(event){ if (lightdm.can_shutdown) { lightdm.shutdown(); } -} \ No newline at end of file +} + +function selectSession(event){ + selectedsession = document.getElementById("sessionlist").value; +}