-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Changed] Implement first working version of client-side validation.
- Loading branch information
Showing
8 changed files
with
153 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
<?xml version="1.0" encoding="utf-8" standalone="yes" ?> | ||
<xliff version="1.0"> | ||
<file source-language="en" datatype="plaintext" original="messages" date="2016-12-08T10:17:19Z" | ||
product-name="tw_baylat"> | ||
<header/> | ||
<body> | ||
<trans-unit id="form.nav.errors"> | ||
<source>Problematic form fields</source> | ||
<target>Fehlerhafte Formularfelder</target> | ||
</trans-unit> | ||
<trans-unit id="form.title.errors"> | ||
<source>%s Errors ⚠️ %s</source> | ||
<target>%s Fehler ⚠️ %s</target> | ||
</trans-unit> | ||
<trans-unit id="form.required"> | ||
<source>(required)</source> | ||
<target>(erforderlich)</target> | ||
</trans-unit> | ||
<trans-unit id="form.error"> | ||
<source>There are some problems with your input. Please check the fields below.</source> | ||
<target>Es gab ein Problem mit Ihrer Eingabe. Bitte prüfen Sie die folgenden Felder.</target> | ||
</trans-unit> | ||
<trans-unit id="form.submit"> | ||
<source>Send</source> | ||
<target>Absenden</target> | ||
</trans-unit> | ||
|
||
<!-- Error messages --> | ||
<trans-unit id="validation.error.1580509091" approved="yes"> | ||
<source>Please fill out this field</source> | ||
<target>Bitte füllen Sie dieses Feld aus</target> | ||
</trans-unit> | ||
</body> | ||
</file> | ||
</xliff> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
<?xml version="1.0" encoding="utf-8" standalone="yes" ?> | ||
<xliff version="1.0"> | ||
<file source-language="en" datatype="plaintext" original="messages" date="2016-12-08T10:17:19Z" | ||
product-name="tw_baylat"> | ||
<header/> | ||
<body> | ||
<trans-unit id="form.nav.errors"> | ||
<source>Problematic form fields</source> | ||
<target></target> | ||
</trans-unit> | ||
<trans-unit id="form.title.errors"> | ||
<source>%s Errors ⚠️ %s</source> | ||
<target></target> | ||
</trans-unit> | ||
<trans-unit id="form.required"> | ||
<source>(required)</source> | ||
<target></target> | ||
</trans-unit> | ||
<trans-unit id="form.error"> | ||
<source>There are some problems with your input. Please check the following fields.</source> | ||
<target></target> | ||
</trans-unit> | ||
<trans-unit id="form.submit"> | ||
<source>Send</source> | ||
<target></target> | ||
</trans-unit> | ||
|
||
<!-- Error messages --> | ||
<trans-unit id="validation.error.1580509091" approved="yes"> | ||
<source>Please fill out this field</source> | ||
<target></target> | ||
</trans-unit> | ||
</body> | ||
</file> | ||
</xliff> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
/* eslint no-param-reassign: ["error", { "props": true, "ignorePropertyModificationsFor": ["s", "e"] }] */ | ||
(function iefe(w, e, s, svg) { | ||
// NodeList.forEach | ||
if (window.NodeList && !NodeList.prototype.forEach) { | ||
NodeList.prototype.forEach = function foreEach(callback, thisArg) { | ||
for (let i = 0; i < this.length; ++i) { | ||
callback.call(thisArg || window, this[i], i, this); | ||
} | ||
}; | ||
} | ||
|
||
// Element.matches | ||
if (!e.matches) { | ||
e.matches = e.matchesSelector | ||
|| e.mozMatchesSelector | ||
|| e.msMatchesSelector | ||
|| e.oMatchesSelector | ||
|| e.webkitMatchesSelector | ||
|| ((str) => { | ||
const matches = (this.document || this.ownerDocument).querySelectorAll(str); | ||
let i = matches.length - 1; | ||
while ((i >= 0) && (matches.item(i) !== this)) { | ||
i -= 1; | ||
} | ||
return i > -1; | ||
}); | ||
} | ||
|
||
// Element.closest | ||
if (!e.closest) { | ||
e.closest = function closest(str) { | ||
let el = this; | ||
do { | ||
if (el.matches(str)) return el; | ||
el = el.parentElement || el.parentNode; | ||
} while (el !== null && el.nodeType === 1); | ||
return null; | ||
}; | ||
} | ||
|
||
// String.format | ||
if (!s.format) { | ||
s.format = function format(...args) { | ||
return this.replace( | ||
/{(\d+)}/g, | ||
(match, number) => (typeof args[number] !== 'undefined' ? args[number] : match) | ||
); | ||
}; | ||
} | ||
|
||
// classList support for IE11 | ||
if (!('classList' in svg)) { | ||
Object.defineProperty(svg, 'classList', { | ||
get() { | ||
return { | ||
contains: (className) => this.className.baseVal.split(' ').indexOf(className) !== -1, | ||
add: (className) => this.setAttribute( | ||
'class', | ||
`${this.getAttribute('class')} ${className}` | ||
), | ||
remove: (className) => { | ||
const removedClass = this.getAttribute('class') | ||
.replace(new RegExp(`(\\s|^)${className}(\\s|$)`, 'g'), '$2'); | ||
if (this.classList.contains(className)) { | ||
this.setAttribute('class', removedClass); | ||
} | ||
} | ||
}; | ||
} | ||
}); | ||
} | ||
}(window, Element.prototype, String.prototype, SVGElement.prototype)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters