commit a0c911299f20b8917055b16fc2c75bf5cffab83c Author: Jørn Åne Date: Tue Sep 26 16:58:48 2017 +0200 Initial commit diff --git a/README.md b/README.md new file mode 100644 index 0000000..8c5d6e6 --- /dev/null +++ b/README.md @@ -0,0 +1,15 @@ +# fyrkat theme for SimpleSamlPhp + +Clone this repo to your modules directory + + git clone https://github.com/fyrkat/ssp-theme.git themefyrkat + +Make the following changes in your SSP setup: + +## config/config.php + + 'module.enable' => [ + 'themefyrkat' => TRUE, + ], + + 'theme.use' => 'themefyrkat:fyrkat', diff --git a/default-disable b/default-disable new file mode 100644 index 0000000..fa0bd82 --- /dev/null +++ b/default-disable @@ -0,0 +1,3 @@ +This file indicates that the default state of this module +is disabled. To enable, create a file named enable in the +same directory as this file. diff --git a/themes/fyrkat/core/loginuserpass.php b/themes/fyrkat/core/loginuserpass.php new file mode 100644 index 0000000..cbd72dc --- /dev/null +++ b/themes/fyrkat/core/loginuserpass.php @@ -0,0 +1,189 @@ + +<?php echo $this->t('{login:user_pass_header}'); ?> + + + + +data['header'] = $this->t('{login:user_pass_header}'); + +if (strlen($this->data['username']) > 0) { + $this->data['autofocus'] = 'password'; +} else { + $this->data['autofocus'] = 'username'; +} + +?> + +
+

data['header']) ? $this->data['header'] : 'SimpleSAMLphp'); ?>

+ +
+

data['forceUsername']) ? ' disabled="disabled"' : ''; ?> type="text" name="username" placeholder="t('{login:username}'); ?>" required + data['forceUsername']) { + echo 'tabindex="1"'; + if (!$this->data['username']) { + echo ' autofocus'; + } + } ?> value="data['username']); ?>" onkeyup="setSubmit()"> +

data['username']) { + echo ' autofocus'; + } ?> onkeyup="setSubmit()"> +

+ data['rememberMeEnabled']) { + // display the remember me checkbox (keep me logged in) + ?> +

data['rememberMeChecked']) ? 'checked="checked"' : ''; ?> + name="remember_me" value="Yes"/> + t('{login:remember_me}'); ?> + +data['rememberUsernameEnabled'] && !$this->data['forceUsername']) { + // display the "remember my username" checkbox +?> +

data['rememberUsernameChecked']) ? 'checked="checked"' : ''; ?> + name="remember_username" value="Yes"/> + t('{login:remember_username}'); ?> + +data)) { + ?> +

+

+ +data['errorcode'] !== null) { + ?> +

t( + '{errors:title_'.$this->data['errorcode'].'}', + $this->data['errorparams'] + )); ?>

+ + +

+ data['stateparams'] as $name => $value) { + echo(''); + } + ?> +

+ +data['links'])) { + echo ''; +} +?> + + data['hideLanguageBar']) && $this->data['hideLanguageBar'] === TRUE) + $includeLanguageBar = FALSE; + + if ($includeLanguageBar) { + + $languages = $this->getLanguageList(); + if ( count($languages) > 1 ) { + echo ''; + } + + } + + + + ?> diff --git a/themes/fyrkat/default/error.php b/themes/fyrkat/default/error.php new file mode 100644 index 0000000..cf24b37 --- /dev/null +++ b/themes/fyrkat/default/error.php @@ -0,0 +1,78 @@ + +<?php echo $this->t($this->data['dictTitle']); ?> + +data['header'] = $this->t($this->data['dictTitle']); + +$this->data['head'] = << + +EOF; + +?> +

t($this->data['dictTitle']); ?>

+
+t($this->data['dictDescr'], $this->data['parameters'])); + +// include optional information for error +if (isset($this->data['includeTemplate'])) { + $this->includeAtTemplateBase($this->data['includeTemplate']); +} +?> +
+
+

t('report_trackid'); ?>

+
+
data['error']['trackId']; ?>
+ +
+
+data['showerrors']) { +?> +

t('debuginfo_header'); ?>

+

t('debuginfo_text'); ?>

+ +
+

data['error']['exceptionMsg']); ?>

+
data['error']['exceptionTrace']); ?>
+
+data['errorReportAddress'])) { +?> +

t('report_header'); ?>

+
+

t('report_text'); ?>

+

t('report_email'); ?> + +

+

+ +

+

+ + +

+
+ +

t('howto_header'); ?>

+

t('howto_text'); ?>

+ +includeAtTemplateBase('includes/footer.php'); diff --git a/themes/fyrkat/default/includes/footer.php b/themes/fyrkat/default/includes/footer.php new file mode 100644 index 0000000..c8beffa --- /dev/null +++ b/themes/fyrkat/default/includes/footer.php @@ -0,0 +1,11 @@ +data['htmlinject']['htmlContentPost'])) { + foreach($this->data['htmlinject']['htmlContentPost'] AS $c) { + echo $c; + } +} +?> + + + + diff --git a/themes/fyrkat/default/includes/header.php b/themes/fyrkat/default/includes/header.php new file mode 100644 index 0000000..58b8a5f --- /dev/null +++ b/themes/fyrkat/default/includes/header.php @@ -0,0 +1,189 @@ +data['htmlinject'] = array( + 'htmlContentPre' => array(), + 'htmlContentPost' => array(), + 'htmlContentHead' => array(), +); + + +$jquery = array(); +if (array_key_exists('jquery', $this->data)) $jquery = $this->data['jquery']; + +if (array_key_exists('pageid', $this->data)) { + $hookinfo = array( + 'pre' => &$this->data['htmlinject']['htmlContentPre'], + 'post' => &$this->data['htmlinject']['htmlContentPost'], + 'head' => &$this->data['htmlinject']['htmlContentHead'], + 'jquery' => &$jquery, + 'page' => $this->data['pageid'] + ); + + SimpleSAML_Module::callHooks('htmlinject', $hookinfo); +} +?> + + + +<?php +if(array_key_exists('header', $this->data)) { + echo $this->data['header']; +} else { + echo 'SimpleSAMLphp'; +} +?> + + + + +data['baseurlpath'] . 'resources/jquery-1.8.js">' . "\n"); + + if (isset($jquery['ui']) && $jquery['ui']) + echo('' . "\n"); + + if (isset($jquery['css']) && $jquery['css']) + echo('' . "\n"); + } +} + +if (isset($this->data['clipboard.js'])) { + echo ''."\n"; +} + +if(!empty($this->data['htmlinject']['htmlContentHead'])) { + foreach($this->data['htmlinject']['htmlContentHead'] AS $c) { + echo $c; + } +} + +?> + + + + + +data)) { + echo '' . $this->data['head'] . ''; +} +?> + +data)) { + $onLoad .= 'SimpleSAML_focus(\'' . $this->data['autofocus'] . '\');'; +} +if (isset($this->data['onLoad'])) { + $onLoad .= $this->data['onLoad']; +} + +if($onLoad !== '') { + echo ''; +} +?> + +

data['header']) ? $this->data['header'] : 'SimpleSAMLphp'); + ?>

+ + + data['hideLanguageBar']) && $this->data['hideLanguageBar'] === TRUE) + $includeLanguageBar = FALSE; + + if ($includeLanguageBar) { + + $languages = $this->getLanguageList(); + if ( count($languages) > 1 ) { + echo '
'; + $langnames = array( + 'no' => 'Bokmål', // Norwegian Bokmål + 'nn' => 'Nynorsk', // Norwegian Nynorsk + 'se' => 'Sámegiella', // Northern Sami + 'sam' => 'Åarjelh-saemien giele', // Southern Sami + 'da' => 'Dansk', // Danish + 'en' => 'English', + 'de' => 'Deutsch', // German + 'sv' => 'Svenska', // Swedish + 'fi' => 'Suomeksi', // Finnish + 'es' => 'Español', // Spanish + 'fr' => 'Français', // French + 'it' => 'Italiano', // Italian + 'nl' => 'Nederlands', // Dutch + 'lb' => 'Lëtzebuergesch', // Luxembourgish + 'cs' => 'Čeština', // Czech + 'sl' => 'Slovenščina', // Slovensk + 'lt' => 'Lietuvių kalba', // Lithuanian + 'hr' => 'Hrvatski', // Croatian + 'hu' => 'Magyar', // Hungarian + 'pl' => 'Język polski', // Polish + 'pt' => 'Português', // Portuguese + 'pt-br' => 'Português brasileiro', // Portuguese + 'ru' => 'русский язык', // Russian + 'et' => 'eesti keel', // Estonian + 'tr' => 'Türkçe', // Turkish + 'el' => 'ελληνικά', // Greek + 'ja' => '日本語', // Japanese + 'zh' => '简体中文', // Chinese (simplified) + 'zh-tw' => '繁體中文', // Chinese (traditional) + 'ar' => 'العربية', // Arabic + 'fa' => 'پارسی', // Persian + 'ur' => 'اردو', // Urdu + 'he' => 'עִבְרִית', // Hebrew + 'id' => 'Bahasa Indonesia', // Indonesian + 'sr' => 'Srpski', // Serbian + 'lv' => 'Latviešu', // Latvian + 'ro' => 'Românește', // Romanian + 'eu' => 'Euskara', // Basque + ); + + $textarray = array(); + foreach ($languages AS $lang => $current) { + $lang = strtolower($lang); + if ($current) { + $textarray[] = $langnames[$lang]; + } else { + $textarray[] = '' . + $langnames[$lang] . ''; + } + } + echo join(' | ', $textarray); + echo '
'; + } + + } + + + + ?> +
+ + + +data['htmlinject']['htmlContentPre'])) { + foreach($this->data['htmlinject']['htmlContentPre'] AS $c) { + echo $c; + } +} diff --git a/www/auth.css b/www/auth.css new file mode 100644 index 0000000..66230d1 --- /dev/null +++ b/www/auth.css @@ -0,0 +1,51 @@ +body { + background: #fafafa; +} +#loginform { + text-align: center; + /* background: #f8f8f8; */ + margin: 0 auto; + width: 24em; + padding: 2em 0 0 0; +} +#loginform h1 { + background: url('fyrkat.svg') no-repeat 0 0; + background-size: fill; + padding-top: 18em; + font-size: 1em; + color: gray; + + width: 18em; + margin: 1em auto; +} + + +form .inputstack input { + display: block; + padding: .6rem; + margin: 0 auto; + font-size: 1.1em; +} + +form .inputstack p { + margin: 0; + padding: 0; +} +form .inputstack p input { + border: .1em solid #aaa; + border-top: none; + width: 12.8rem; +} +form .inputstack p:first-child input { + border-top: .1em solid #aaa; + border-radius: .3em .3em 0 0; + box-shadow: inset #eee 0 2px 0; +} +form .inputstack p:last-child input { + border-radius: 0 0 .3em .3em; +} +#loginform input[type=submit] { + width: 14rem; + display: block; + margin: 0 auto; +} diff --git a/www/fyrkat.css b/www/fyrkat.css new file mode 100644 index 0000000..33eabce --- /dev/null +++ b/www/fyrkat.css @@ -0,0 +1,297 @@ +body { + background: #fff; + color: #000; + font-size: .8em; +} +h1, nav { + color: gray; +} +.overview code:before, .overview span:before { + content: attr(title) ':'; + font-weight: bold; + display: block; + font-family: sans-serif; +} +code, span { + display: block; +} +main { + margin-left: 20em; + margin-right: 5em; + min-height: 40em; +} +nav { + background: url('fyrkat.svg') no-repeat 0 0; + background-size: contain; + position: absolute; + width: 15em; + padding-top: 14em; + left: 2em; + top: 2em; +} +nav ul { + padding:0; +} +nav li { + text-align: right; + list-style: none; + margin: .5em 0; +} +nav li a { + padding: 1em; + color: #257; + display: block; + border-radius: .2em; + text-decoration: none; +} +nav li a:hover { + background: #eee; +} +nav li a:active { + background: #ddd; +} +nav li a.active { + color: #fff; + background: #257; +} +nav .current-user .username { + display: block; + margin-bottom: .3em; +} +nav .current-user { + font-size: .9em; + text-align: right; +} +nav .current-user .logout { + display: inline-block; + text-align: center; + cursor: pointer; + text-decoration: none; + color: white; + background: #567; + width: 6em; + padding: .5em 0 .3em 0; + border-radius: .3em; + box-shadow: #345 0 2px 0; + font-size: .9em; +} +nav .current-user .logout:active { + position: relative; + top: 1px; + box-shadow: #345 0 1px 0; +} +form .error { + color: #a66; + font-weight: bold; +} +form .error { + width: 18em; + margin: 1em auto; +} +.trackidtext, .maintext { /* remove form */ + background: #fff; + color: #000; + padding: 3.1em 0 2.1em 0; +} + +.buttons label, .buttons a { + cursor: pointer; + background: #06a; + box-shadow: 0 3px 0 #048; + color: white; + padding: .8em 2em; + border-radius: .3em; + text-decoration: none; +} +.buttons label:active, .buttons a:active { + position: relative; + top: 1px; + box-shadow: 0 2px 0 #048; +} +.buttons { +} +.center { + text-align: center; +} +.hidden { + display: none; +} +form input[type=submit] { /* remove explicit width, add padding */ + border: none; + cursor: pointer; + border-radius: .3em; + background: #084; + color: #fff; + box-shadow: #063 0 3px 0; + padding: 1em 2.5em .8em 2.5em; +} +form input[type=submit].disabled, form input[type=submit].disabled:active { + color: #ddd; + background: #576; + cursor: default; + /* border-bottom: .2em solid #254 !important; */ + box-shadow: #254 0 3px 0; + top: 0 !important; +} +form input[type=submit]:active, form input[type=submit].active { + position: relative; + top: 1px; + box-shadow: #063 0 2px 0; +} + +.input-group input[type=radio] { + display: none; +} +.input-group input[type=radio] ~ label, .input-group input[type=text], .input-group input[type=password] { + width: 17em; +} +.input-group input[type=radio] ~ label, .input-group input[type=text], .input-group input[type=password], .input-group textarea, .image-well { + border: 1px solid #abc; + display: block; + padding: 1em 1em .9em 1em; + border-radius: .3em; +} +.biginput { + border: none; + font-size: 2em; + text-align: center; + width: 100%; + margin-bottom: 2em; +} +.image-well, .image-well img { + width: 10em; + height: 10em; +} +.image-well { + padding: 1em; +} +.input-group input[type=radio] ~ label { + cursor: pointer; + box-shadow: #f2f2f2 0 2px 0; +} +.input-group input[type=text], .input-group input[type=password], .input-group textarea, .image-well { + margin-top: .3em; + box-shadow: inset #f2f2f2 0 2px 0; +} +.input-group input[type=text]:focus, .input-group input[type=password]:focus, .input-group textarea:focus { + box-shadow: rgba(166,202,240) 0 0 .5em, inset #f2f2f2 0 2px 0; +} +.input-group input[type=radio] ~ label:hover { + border: 1px solid #567; + box-shadow: #eee 0 2px 0; +} +.input-group input[type=radio] ~ label:active { + background: #eee; + box-shadow: #ddd 0 2px 0; +} +.input-group input[type=radio]:checked ~ label { + background: #257; + border: 1px solid #257; + color: #fff; + box-shadow: #134 0 2px 0; +} + +.btnaddonright img { + width: 1em; + height: 1em; +} + +#languagebar { + font-size: .7em; + color: #aaa; +} +#languagebar li { + display: inline; +} +#languagebar li:after { + content: ' | '; +} +#languagebar li:last-child:after { + content: ''; +} +#languagebar a { + color: #66a; +} + +.overview ul { + list-style: none; + padding: 0; + margin: 0 auto; + width: 100%; + border-collapse: separate; +} +.overview li { + display: inline-block; + width: 20em; + margin-bottom: 1.5em; + vertical-align: top; +} + +pre { + border: 2px solid white; + background: #fefefe; + padding: .5em; + border-radius: .3em; + box-shadow: 0 0 0 1px #eee; +} +hr, footer { + margin: 1em 2em 2em 2em; + border: none; + border-top: 1px solid #fafafa; +} + +@keyframes notification { + 0% { opacity: 0; display: block; } + 1% { opacity: 1; display: block; } + 70% { opacity: 1; display: block; } + 100% { opacity: 0; display: block; } +} +.hiding-notification { + animation-name: notification; + animation-duration: 30s; + animation-iteration-count: 1; + opacity: 0; +} +.notification-placeholder { + border: .1em solid rgba(0,0,0,0); + margin: 0 0 1em 0; + padding: 0 1em 1em 1em; +} +.notification-placeholder:after { + color: rgba(0,0,0,0); + content: "x"; +} +.info, .warning, .error, .complete { + border: .1em solid #eee; + border-radius: .3em; + margin: 0 0 1em 0; +} +div.info, div.warning, div.error, div.complete { + padding: 0 1em 1em 1em; +} +p.info, p.warning, p.error, p.complete { + padding: 1em; +} +.info { + border-left: 6px solid #06a; +} +.complete { + border-left: 6px solid #082; +} +.error { + border-left: 6px solid #c02; +} +.warning { + border-left: 6px solid #fa0; +} + +footer { + display: block; + text-align: center; + padding: 2em; + color: #557; + margin-top: 2em; +} +footer a { + color: #567; +} diff --git a/www/fyrkat.svg b/www/fyrkat.svg new file mode 100644 index 0000000..a478dca --- /dev/null +++ b/www/fyrkat.svg @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + + diff --git a/www/normalize.css b/www/normalize.css new file mode 100644 index 0000000..18ddf7f --- /dev/null +++ b/www/normalize.css @@ -0,0 +1,419 @@ +/*! normalize.css v4.1.1 | MIT License | github.com/necolas/normalize.css */ + +/** + * 1. Change the default font family in all browsers (opinionated). + * 2. Prevent adjustments of font size after orientation changes in IE and iOS. + */ + +html { + font-family: sans-serif; /* 1 */ + -ms-text-size-adjust: 100%; /* 2 */ + -webkit-text-size-adjust: 100%; /* 2 */ +} + +/** + * Remove the margin in all browsers (opinionated). + */ + +body { + margin: 0; +} + +/* HTML5 display definitions + ========================================================================== */ + +/** + * Add the correct display in IE 9-. + * 1. Add the correct display in Edge, IE, and Firefox. + * 2. Add the correct display in IE. + */ + +article, +aside, +details, /* 1 */ +figcaption, +figure, +footer, +header, +main, /* 2 */ +menu, +nav, +section, +summary { /* 1 */ + display: block; +} + +/** + * Add the correct display in IE 9-. + */ + +audio, +canvas, +progress, +video { + display: inline-block; +} + +/** + * Add the correct display in iOS 4-7. + */ + +audio:not([controls]) { + display: none; + height: 0; +} + +/** + * Add the correct vertical alignment in Chrome, Firefox, and Opera. + */ + +progress { + vertical-align: baseline; +} + +/** + * Add the correct display in IE 10-. + * 1. Add the correct display in IE. + */ + +template, /* 1 */ +[hidden] { + display: none; +} + +/* Links + ========================================================================== */ + +/** + * 1. Remove the gray background on active links in IE 10. + * 2. Remove gaps in links underline in iOS 8+ and Safari 8+. + */ + +a { + background-color: transparent; /* 1 */ + -webkit-text-decoration-skip: objects; /* 2 */ +} + +/** + * Remove the outline on focused links when they are also active or hovered + * in all browsers (opinionated). + */ + +a:active, +a:hover { + outline-width: 0; +} + +/* Text-level semantics + ========================================================================== */ + +/** + * 1. Remove the bottom border in Firefox 39-. + * 2. Add the correct text decoration in Chrome, Edge, IE, Opera, and Safari. + */ + +abbr[title] { + border-bottom: none; /* 1 */ + text-decoration: underline; /* 2 */ + text-decoration: underline dotted; /* 2 */ +} + +/** + * Prevent the duplicate application of `bolder` by the next rule in Safari 6. + */ + +b, +strong { + font-weight: inherit; +} + +/** + * Add the correct font weight in Chrome, Edge, and Safari. + */ + +b, +strong { + font-weight: bolder; +} + +/** + * Add the correct font style in Android 4.3-. + */ + +dfn { + font-style: italic; +} + +/** + * Correct the font size and margin on `h1` elements within `section` and + * `article` contexts in Chrome, Firefox, and Safari. + */ + +h1 { + font-size: 2em; + margin: 0.67em 0; +} + +/** + * Add the correct background and color in IE 9-. + */ + +mark { + background-color: #ff0; + color: #000; +} + +/** + * Add the correct font size in all browsers. + */ + +small { + font-size: 80%; +} + +/** + * Prevent `sub` and `sup` elements from affecting the line height in + * all browsers. + */ + +sub, +sup { + font-size: 75%; + line-height: 0; + position: relative; + vertical-align: baseline; +} + +sub { + bottom: -0.25em; +} + +sup { + top: -0.5em; +} + +/* Embedded content + ========================================================================== */ + +/** + * Remove the border on images inside links in IE 10-. + */ + +img { + border-style: none; +} + +/** + * Hide the overflow in IE. + */ + +svg:not(:root) { + overflow: hidden; +} + +/* Grouping content + ========================================================================== */ + +/** + * 1. Correct the inheritance and scaling of font size in all browsers. + * 2. Correct the odd `em` font sizing in all browsers. + */ + +code, +kbd, +pre, +samp { + font-family: monospace, monospace; /* 1 */ + font-size: 1em; /* 2 */ +} + +/** + * Add the correct margin in IE 8. + */ + +figure { + margin: 1em 40px; +} + +/** + * 1. Add the correct box sizing in Firefox. + * 2. Show the overflow in Edge and IE. + */ + +hr { + box-sizing: content-box; /* 1 */ + height: 0; /* 1 */ + overflow: visible; /* 2 */ +} + +/* Forms + ========================================================================== */ + +/** + * 1. Change font properties to `inherit` in all browsers (opinionated). + * 2. Remove the margin in Firefox and Safari. + */ + +button, +input, +select, +textarea { + font: inherit; /* 1 */ + margin: 0; /* 2 */ +} + +/** + * Restore the font weight unset by the previous rule. + */ + +optgroup { + font-weight: bold; +} + +/** + * Show the overflow in IE. + * 1. Show the overflow in Edge. + */ + +button, +input { /* 1 */ + overflow: visible; +} + +/** + * Remove the inheritance of text transform in Edge, Firefox, and IE. + * 1. Remove the inheritance of text transform in Firefox. + */ + +button, +select { /* 1 */ + text-transform: none; +} + +/** + * 1. Prevent a WebKit bug where (2) destroys native `audio` and `video` + * controls in Android 4. + * 2. Correct the inability to style clickable types in iOS and Safari. + */ + +button, +html [type="button"], /* 1 */ +[type="reset"], +[type="submit"] { + -webkit-appearance: button; /* 2 */ +} + +/** + * Remove the inner border and padding in Firefox. + */ + +button::-moz-focus-inner, +[type="button"]::-moz-focus-inner, +[type="reset"]::-moz-focus-inner, +[type="submit"]::-moz-focus-inner { + border-style: none; + padding: 0; +} + +/** + * Restore the focus styles unset by the previous rule. + */ + +button:-moz-focusring, +[type="button"]:-moz-focusring, +[type="reset"]:-moz-focusring, +[type="submit"]:-moz-focusring { + outline: 1px dotted ButtonText; +} + +/** + * Change the border, margin, and padding in all browsers (opinionated). + */ + +fieldset { + border: 1px solid #c0c0c0; + margin: 0 2px; + padding: 0.35em 0.625em 0.75em; +} + +/** + * 1. Correct the text wrapping in Edge and IE. + * 2. Correct the color inheritance from `fieldset` elements in IE. + * 3. Remove the padding so developers are not caught out when they zero out + * `fieldset` elements in all browsers. + */ + +legend { + box-sizing: border-box; /* 1 */ + color: inherit; /* 2 */ + display: table; /* 1 */ + max-width: 100%; /* 1 */ + padding: 0; /* 3 */ + white-space: normal; /* 1 */ +} + +/** + * Remove the default vertical scrollbar in IE. + */ + +textarea { + overflow: auto; +} + +/** + * 1. Add the correct box sizing in IE 10-. + * 2. Remove the padding in IE 10-. + */ + +[type="checkbox"], +[type="radio"] { + box-sizing: border-box; /* 1 */ + padding: 0; /* 2 */ +} + +/** + * Correct the cursor style of increment and decrement buttons in Chrome. + */ + +[type="number"]::-webkit-inner-spin-button, +[type="number"]::-webkit-outer-spin-button { + height: auto; +} + +/** + * 1. Correct the odd appearance in Chrome and Safari. + * 2. Correct the outline style in Safari. + */ + +[type="search"] { + -webkit-appearance: textfield; /* 1 */ + outline-offset: -2px; /* 2 */ +} + +/** + * Remove the inner padding and cancel buttons in Chrome and Safari on OS X. + */ + +[type="search"]::-webkit-search-cancel-button, +[type="search"]::-webkit-search-decoration { + -webkit-appearance: none; +} + +/** + * Correct the text style of placeholders in Chrome, Edge, and Safari. + */ + +::-webkit-input-placeholder { + color: inherit; + opacity: 0.54; +} + +/** + * 1. Correct the inability to style clickable types in iOS and Safari. + * 2. Change font properties to `inherit` in Safari. + */ + +::-webkit-file-upload-button { + -webkit-appearance: button; /* 1 */ + font: inherit; /* 2 */ +} diff --git a/www/scripts.js b/www/scripts.js new file mode 100644 index 0000000..713717d --- /dev/null +++ b/www/scripts.js @@ -0,0 +1,46 @@ +// @license magnet:?xt=urn:btih:c80d50af7d3db9be66a4d0a86db0286e4fd33292&dn=bsd-3-clause.txt BSD 3 Clause + +function checkSubmit() { + try { + var u = document.getElementById('username'); + var p = document.getElementById('password'); + if (!u.value) { + u.focus(); + return false; + } + if (!p.value) { + p.focus(); + return false; + } + var s = document.getElementById('submit'); + s.setAttribute('class', 'active'); + setTimeout(function(){ + s.removeAttribute('class'); + }, 250); + } catch (e) { + } + return true; +} +function setSubmit() { + try { + var u = document.getElementById('username'); + var p = document.getElementById('password'); + var s = document.getElementById('submit'); + if (u.value && p.value) { + s.removeAttribute('class'); + } else { + s.setAttribute('class', 'disabled'); + } + } catch (e) { + s.removeAttribute('class'); + } +} +document.getElementById('loginform').onsubmit = checkSubmit; +document.getElementById('username').onsubmit = setSubmit; +document.getElementById('password').onsubmit = setSubmit; +setSubmit(); + +document.getElementById('username').removeAttribute('required'); +document.getElementById('password').removeAttribute('required'); + +// @license-end