Commit aed92987 authored by dm141569's avatar dm141569 Committed by BZ

Generate Date and Time field, No merge of "database.sqlite"

parent 367357ef
* text=auto
* text=auto
/storage/database.sqlite merge=ours
\ No newline at end of file
/.idea
/vendor
/node_modules
/storage/database.sqlite
.env
.DS_Store
Thumbs.db
composer.lock
......
......@@ -230,7 +230,8 @@ legend {
font-weight: bold;
}
input {
input,
select {
display: block;
box-sizing: border-box;
width: 100%;
......@@ -239,9 +240,12 @@ input {
border: 1px solid #75706B;
border-radius: 7px;
font-size: 1.25em;
}
input:focus {
input:focus,
select:focus {
border: 1px solid #3D8EB9;
}
......@@ -261,6 +265,13 @@ label {
line-height: 2em;
}
#time-hour,
#time-minute {
float: left;
width: 50%;
}
/**
* ********** Meetups **********
*/
......
......@@ -2,7 +2,7 @@
* Sportmeetup FH Module
*/
var SPORTMEETUPFH = SPORTMEETUPFH || {};
SPORTMEETUPFH.Main = (function() {
SPORTMEETUPFH.Main = (function () {
'use strict';
/** Private */
......@@ -23,32 +23,32 @@ SPORTMEETUPFH.Main = (function() {
data = d;
$.each(data, function(key, value) {
var section = $( document.createElement('section') );
var header = $( document.createElement('header') );
var h1 = $( document.createElement('h1') );
var $section = $( document.createElement('section') );
var $header = $( document.createElement('header') );
var $h1 = $( document.createElement('h1') );
h1.append(key);
header.append(h1);
section.append(header);
$h1.append(key);
$header.append($h1);
$section.append($header);
$('#meetups').append(section);
$('#meetups').append($section);
$.each(value, function(k, v) {
var div = $( document.createElement('div') );
var title = $( document.createElement('h2') );
var name = $( document.createElement('span') );
var $div = $( document.createElement('div') );
var $title = $( document.createElement('h2') );
var $name = $( document.createElement('span') );
$(div).data('meetup-array-id', k);
$(div).data('meetup-date', v.date);
$(title).text(v.sport + ' um ' + v.time);
$(name).text('von ' + v.name);
$(div).append(title);
$(div).append(name);
$div.data('meetup-array-id', k);
$div.data('meetup-date', v.date);
$title.text(v.sport + ' um ' + v.time);
$name.text('von ' + v.name);
$div.append($title);
$div.append($name);
$(div).bind('click', details);
$div.bind('click', details);
$(section)
.append(div)
$section
.append($div)
.hide()
.slideDown();
});
......@@ -67,7 +67,8 @@ SPORTMEETUPFH.Main = (function() {
$('#contact').val(),
$('#sport').val(),
$('#date').val(),
$('#time').val(),
$('#time-hour').val(),
$('#time-minute').val(),
$('#meetup-place').val()
]);
......@@ -78,7 +79,7 @@ SPORTMEETUPFH.Main = (function() {
contact: $('#contact').val(),
sport: $('#sport').val(),
date: $('#date').val(),
time: $('#time').val(),
time: $('#time-hour').val() + ':' + $('#time-minute').val(),
meetupPlace: $('#meetup-place').val()
});
......@@ -90,10 +91,11 @@ SPORTMEETUPFH.Main = (function() {
$('#meetups').empty();
loadData();
$('#create-meetup').fadeOut();
animTop();
} else {
alert('Bitte alle Felder ausfüllen!');
}
return false;
}
......@@ -116,16 +118,16 @@ SPORTMEETUPFH.Main = (function() {
$.each(d, function(key, value) {
num++;
var p = $(document.createElement('p'));
var $p = $( document.createElement('p') );
$(p).text(
$p.text(
value.name
+ ' ('
+ value.contact
+ ')'
);
$('#participants')
.append(p)
.append($p)
.hide()
.slideDown();
});
......@@ -233,6 +235,17 @@ SPORTMEETUPFH.Main = (function() {
return false;
}
function featureDetection(element, attribute, value) {
/** With Modernizr:
Modernizr.inputtypes.date
Modernizr.inputtypes.time */
var el = document.createElement(element);
el.setAttribute(attribute, value);
return el.type == value;
}
/**
* Scroll to top animation
*/
......@@ -250,7 +263,7 @@ SPORTMEETUPFH.Main = (function() {
* Load data and call event listener setup
*/
init: function() {
this.initContainer();
this.initDOM();
loadData();
......@@ -272,12 +285,34 @@ SPORTMEETUPFH.Main = (function() {
/**
* Hide and show different containers at startup
*/
initContainer: function() {
initDOM: function() {
$('#info').hide();
$('#create-meetup').hide();
$('#details').hide();
$('#no-ps').hide();
$('.success').hide();
// var checkDate = featureDetection('input', 'type', 'date');
// var checkTime = featureDetection('input', 'type', 'time');
var today = new Date();
var year = today.getFullYear();
var month = today.getMonth() + 1;
var date = today.getDate();
for (var i = 0; i < 22; i++) {
var next = new Date(year, month, date + i);
var $option = $( document.createElement('option') );
$option.append(
next.getFullYear()
+ '-' + ('0' + next.getMonth()).slice(-2)
+ '-' + ('0' + next.getDate()).slice(-2)
);
$('#date').append($option);
}
}
}
}());
......
/* Modernizr 2.8.3 (Custom Build) | MIT & BSD
* Build: http://modernizr.com/download/#-input-inputtypes-shiv
*/
;window.Modernizr=function(a,b,c){function u(a){i.cssText=a}function v(a,b){return u(prefixes.join(a+";")+(b||""))}function w(a,b){return typeof a===b}function x(a,b){return!!~(""+a).indexOf(b)}function y(a,b,d){for(var e in a){var f=b[a[e]];if(f!==c)return d===!1?a[e]:w(f,"function")?f.bind(d||b):f}return!1}function z(){e.input=function(c){for(var d=0,e=c.length;d<e;d++)o[c[d]]=c[d]in j;return o.list&&(o.list=!!b.createElement("datalist")&&!!a.HTMLDataListElement),o}("autocomplete autofocus list placeholder max min multiple pattern required step".split(" ")),e.inputtypes=function(a){for(var d=0,e,g,h,i=a.length;d<i;d++)j.setAttribute("type",g=a[d]),e=j.type!=="text",e&&(j.value=k,j.style.cssText="position:absolute;visibility:hidden;",/^range$/.test(g)&&j.style.WebkitAppearance!==c?(f.appendChild(j),h=b.defaultView,e=h.getComputedStyle&&h.getComputedStyle(j,null).WebkitAppearance!=="textfield"&&j.offsetHeight!==0,f.removeChild(j)):/^(search|tel)$/.test(g)||(/^(url|email)$/.test(g)?e=j.checkValidity&&j.checkValidity()===!1:e=j.value!=k)),n[a[d]]=!!e;return n}("search tel url email datetime date month week time datetime-local number range color".split(" "))}var d="2.8.3",e={},f=b.documentElement,g="modernizr",h=b.createElement(g),i=h.style,j=b.createElement("input"),k=":)",l={}.toString,m={},n={},o={},p=[],q=p.slice,r,s={}.hasOwnProperty,t;!w(s,"undefined")&&!w(s.call,"undefined")?t=function(a,b){return s.call(a,b)}:t=function(a,b){return b in a&&w(a.constructor.prototype[b],"undefined")},Function.prototype.bind||(Function.prototype.bind=function(b){var c=this;if(typeof c!="function")throw new TypeError;var d=q.call(arguments,1),e=function(){if(this instanceof e){var a=function(){};a.prototype=c.prototype;var f=new a,g=c.apply(f,d.concat(q.call(arguments)));return Object(g)===g?g:f}return c.apply(b,d.concat(q.call(arguments)))};return e});for(var A in m)t(m,A)&&(r=A.toLowerCase(),e[r]=m[A](),p.push((e[r]?"":"no-")+r));return e.input||z(),e.addTest=function(a,b){if(typeof a=="object")for(var d in a)t(a,d)&&e.addTest(d,a[d]);else{a=a.toLowerCase();if(e[a]!==c)return e;b=typeof b=="function"?b():b,typeof enableClasses!="undefined"&&enableClasses&&(f.className+=" "+(b?"":"no-")+a),e[a]=b}return e},u(""),h=j=null,function(a,b){function l(a,b){var c=a.createElement("p"),d=a.getElementsByTagName("head")[0]||a.documentElement;return c.innerHTML="x<style>"+b+"</style>",d.insertBefore(c.lastChild,d.firstChild)}function m(){var a=s.elements;return typeof a=="string"?a.split(" "):a}function n(a){var b=j[a[h]];return b||(b={},i++,a[h]=i,j[i]=b),b}function o(a,c,d){c||(c=b);if(k)return c.createElement(a);d||(d=n(c));var g;return d.cache[a]?g=d.cache[a].cloneNode():f.test(a)?g=(d.cache[a]=d.createElem(a)).cloneNode():g=d.createElem(a),g.canHaveChildren&&!e.test(a)&&!g.tagUrn?d.frag.appendChild(g):g}function p(a,c){a||(a=b);if(k)return a.createDocumentFragment();c=c||n(a);var d=c.frag.cloneNode(),e=0,f=m(),g=f.length;for(;e<g;e++)d.createElement(f[e]);return d}function q(a,b){b.cache||(b.cache={},b.createElem=a.createElement,b.createFrag=a.createDocumentFragment,b.frag=b.createFrag()),a.createElement=function(c){return s.shivMethods?o(c,a,b):b.createElem(c)},a.createDocumentFragment=Function("h,f","return function(){var n=f.cloneNode(),c=n.createElement;h.shivMethods&&("+m().join().replace(/[\w\-]+/g,function(a){return b.createElem(a),b.frag.createElement(a),'c("'+a+'")'})+");return n}")(s,b.frag)}function r(a){a||(a=b);var c=n(a);return s.shivCSS&&!g&&!c.hasCSS&&(c.hasCSS=!!l(a,"article,aside,dialog,figcaption,figure,footer,header,hgroup,main,nav,section{display:block}mark{background:#FF0;color:#000}template{display:none}")),k||q(a,c),a}var c="3.7.0",d=a.html5||{},e=/^<|^(?:button|map|select|textarea|object|iframe|option|optgroup)$/i,f=/^(?:a|b|code|div|fieldset|h1|h2|h3|h4|h5|h6|i|label|li|ol|p|q|span|strong|style|table|tbody|td|th|tr|ul)$/i,g,h="_html5shiv",i=0,j={},k;(function(){try{var a=b.createElement("a");a.innerHTML="<xyz></xyz>",g="hidden"in a,k=a.childNodes.length==1||function(){b.createElement("a");var a=b.createDocumentFragment();return typeof a.cloneNode=="undefined"||typeof a.createDocumentFragment=="undefined"||typeof a.createElement=="undefined"}()}catch(c){g=!0,k=!0}})();var s={elements:d.elements||"abbr article aside audio bdi canvas data datalist details dialog figcaption figure footer header hgroup main mark meter nav output progress section summary template time video",version:c,shivCSS:d.shivCSS!==!1,supportsUnknownElements:k,shivMethods:d.shivMethods!==!1,type:"default",shivDocument:r,createElement:o,createDocumentFragment:p};a.html5=s,r(b)}(this,b),e._version=d,e}(this,this.document);
\ No newline at end of file
......@@ -17,8 +17,8 @@ dm141569@fhstp.ac.at
* [x] Teilnehmen
* [x] Frontend Style
* [x] Validation, auch ohne HTML5; Check ob Felder leer bzw. nur Leerzeichen
* [ ] Datumsfelder für Geräte die `type="date"` `type="time"` nicht verstehen
* [ ] QR Codes
* [x] Datumsfelder für Geräte die `type="date"` `type="time"` nicht verstehen
* [x] QR Codes
* --- snip ---
* [ ] Environment Check (PHP, JS, etc.)
* [ ] Datum Collision
......@@ -36,6 +36,7 @@ Datum | Von - Bis | Stunden
19.10.2014 | 11:00 - 12:00 | 1,0
20.10.2014 | 13:00 - 16:00 | 3,0
| 18:00 - 23:30 | 5,5
Zw. Sum | | 23,0
21.10.2014 | 19:00 - 22:00 | 3,0
Zw. Sum | | 26,0
Hilfe | | 2,0
Gesamt 2 | | 25,0
\ No newline at end of file
Gesamt 2 | | 28,0
\ No newline at end of file
......@@ -7,6 +7,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<link rel="stylesheet" href="css/style.css" type="text/css" />
<!-- <script src="js/vendor/modernizr-inputtypes-2.8.3.min.js"></script> -->
</head>
<body>
<header id="page-header">
......@@ -61,10 +62,32 @@
<input type="text" name="sport" id="sport" placeholder="Sportart eintragen" required="required" />
<label for="date">Datum:</label>
<input type="date" name="date" id="date" placeholder="An welchem Tag soll das stattfinden?" required="required" />
<label for="time">Zeit:</label>
<input type="time" name="time" id="time" placeholder="zu welcher Uhrzeit?" required="required" />
<!-- <input type="date" name="date" id="date" placeholder="An welchem Tag soll das stattfinden?" required="required" /> -->
<select name="date" id="date" required="required" />
</select>
<label for="time-hour">Zeit:</label>
<!-- <input type="time" name="time" id="time" placeholder="zu welcher Uhrzeit?" required="required" /> -->
<select name="time-hour" id="time-hour" required="required" />
<option>00</option><option>01</option>
<option>02</option><option>03</option>
<option>04</option><option>05</option>
<option>06</option><option>07</option>
<option>08</option><option>09</option>
<option>10</option><option>11</option>
<option>12</option><option>13</option>
<option>14</option><option>15</option>
<option>16</option><option>17</option>
<option>18</option><option>19</option>
<option>20</option><option>21</option>
<option>22</option><option>23</option>
</select>
<select name="time-minute" id="time-minute" required="required" />
<option>00</option>
<option>15</option>
<option>30</option>
<option>45</option>
</select>
<label for="meetup-place">Treffpunkt:</label>
<input type="text" name="meetup-place" id="meetup-place" placeholder="Wo trefft ihr euch?" required="required" />
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment