Overview
Comment:Améliorations JS : on détecte si on a besoin de datepickr d'avance
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 0a46042d59394361fc6ec4cb3774a72f77159a73
User & Date: bohwaz on 2014-01-28 02:14:54
Other Links: manifest | tags
Context
2014-01-28
02:15
Inclure l'URL dans un data-tag check-in: 848fa7877b user: bohwaz tags: trunk
02:14
Améliorations JS : on détecte si on a besoin de datepickr d'avance check-in: 0a46042d59 user: bohwaz tags: trunk
01:02
Description doit pouvoir être NULL check-in: 4197205828 user: bohwaz tags: trunk
Changes

Modified src/www/admin/static/admin.css from [b7b96a8240] to [72e1f58f62].

989
990
991
992
993
994
995




996
997
998
999
1000
1001
1002
pre.sql_schema {
    float: right;
    color: #666;
    font-size: .9em;
    width: 30%;
    overflow: auto;
}





@media print {
    body {
        background: #fff;
    }
    .header .menu {
        display: none;







>
>
>
>







989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
pre.sql_schema {
    float: right;
    color: #666;
    font-size: .9em;
    width: 30%;
    overflow: auto;
}

.hidden {
    display: none;
}

@media print {
    body {
        background: #fff;
    }
    .header .menu {
        display: none;

Modified src/www/admin/static/datepickr.js from [0eef8662ba] to [6830703cb8].

419
420
421
422
423
424
425



426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453

		for (i = 0; i < inputs.length; i++)
		{
			if (inputs[i].getAttribute('type') == 'date' && (inputs[i].type == 'text' || window.webkitConvertPointFromNodeToPage))
			{
				inputs[i].setAttribute('type', 'text');
				new datepickr(inputs[i], config_fr);



				inputs[i].setAttribute('pattern', '[0-9]{4}-[0-9]{2}-[0-9]{2}');
				enabled = true;
			}
		}

		if (enabled)
		{
			var scripts = document.head.getElementsByTagName('script');
			var www_url = scripts[scripts.length - 1].src.replace(/\/[^\/]+$/, '/');

			var link = document.createElement('link');
			link.type = 'text/css';
			link.rel = 'stylesheet';
			link.href = www_url + 'datepickr.css';

			document.head.appendChild(link);
		}
	}

	if (document.addEventListener)
	{
		document.addEventListener("DOMContentLoaded", dateInputFallback, false);
	}
	else
	{
		document.attachEvent("onDOMContentLoaded", dateInputFallback);
	}
} () );







>
>
>

<


|
<
|
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
|
<

419
420
421
422
423
424
425
426
427
428
429

430
431
432

433


















434

435

		for (i = 0; i < inputs.length; i++)
		{
			if (inputs[i].getAttribute('type') == 'date' && (inputs[i].type == 'text' || window.webkitConvertPointFromNodeToPage))
			{
				inputs[i].setAttribute('type', 'text');
				new datepickr(inputs[i], config_fr);
				inputs[i].className += ' date';
				inputs[i].size = 10;
				inputs[i].maxlength = 10;
				inputs[i].setAttribute('pattern', '[0-9]{4}-[0-9]{2}-[0-9]{2}');

			}
		}
	}




















	dateInputFallback();

} () );

Added src/www/admin/static/global.js version [f20f9c86c7].

















































































































































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
(function () {
	window.$ = function(selector) {
		if (!selector.match(/^[.#]?[a-z0-9_-]+$/i))
		{
			return document.querySelectorAll(selector);
		}
		else if (selector.substr(0, 1) == '.')
		{
			return document.getElementsByClassName(selector.substr(1));
		}
		else if (selector.substr(0, 1) == '#')
		{
			return document.getElementById(selector.substr(1));
		}
		else
		{
			return document.getElementsByTagName(selector);
		}
	};

    window.toggleElementVisibility = function(selector, visibility)
    {
    	if (!('classList' in document.documentElement))
    		return false;

    	if (selector instanceof Array)
    	{
    		for (var i = 0; i < selector.length; i++)
    		{
    			toggleElementVisibility(selector[i], visibility);
    		}

    		return true;
    	}

        var elements = $(selector);

        for (var i = 0; i < elements.length; i++)
        {
        	if (!visibility)
        		elements[i].classList.add('hidden');
           	else
        		elements[i].classList.remove('hidden');
        }

        return true;
    };

	function dateInputFallback()
	{
		var inputs = document.getElementsByTagName('input');
		var length = inputs.length;
		var enabled = false;

		for (i = 0; i < inputs.length; i++)
		{
			if (inputs[i].getAttribute('type') == 'date' && (inputs[i].type == 'text' || window.webkitConvertPointFromNodeToPage))
			{
				enabled = true;
			}
		}

		if (enabled)
		{
			var www_url = document.body.getAttribute('data-url') + 'static/';

			var script = document.createElement('script');
			script.type = "text/javascript";
			script.src = www_url + 'datepickr.js';
			document.head.appendChild(script);
			
			var link = document.createElement('link');
			link.type = 'text/css';
			link.rel = 'stylesheet';
			link.href = www_url + 'datepickr.css';
			document.head.appendChild(link);
		}
	}

	if (document.addEventListener)
	{
		document.addEventListener("DOMContentLoaded", dateInputFallback, false);
	}
	else
	{
		document.attachEvent("onDOMContentLoaded", dateInputFallback);
	}
})();