Overview
Comment:Un peu d'animation pour les longues tâches
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 587b766d75b820043b8b6a1c7e2889f2be09841b
User & Date: bohwaz on 2014-04-12 05:46:35
Other Links: manifest | tags
Context
2014-04-14
00:03
Normalisation numéro de téléphone : suppression du (0) check-in: 3044b2f967 user: bohwaz tags: trunk
2014-04-12
05:46
Un peu d'animation pour les longues tâches check-in: 587b766d75 user: bohwaz tags: trunk
01:03
Amélioration ergonomique des champs date pour les navigateurs qui ne gèrent pas le type date : on peut entrer la date au format dd/mm/YYYY check-in: e879dc5feb user: bohwaz tags: trunk
Changes

Modified src/templates/admin/install.tpl from [98677602dc] to [b65d4c6b37].

1
2
3
4
5
6
7
8
..
50
51
52
53
54
55
56
57
58
59
60

61

62











63
64
65
66
67
68
{include file="admin/_head.tpl" title="Garradin - Installation"}

{if $disabled}
    <p class="error">Garradin est déjà installé.</p>
{else}
    <p class="intro">
        Bienvenue dans Garradin !
        Veuillez remplir les quelques informations suivantes pour terminer
................................................................................
            <dt><label for="f_repasse_membre">Encore le mot de passe</label> (vérification) <b title="(Champ obligatoire)">obligatoire</b></dt>
            <dd><input type="password" name="repasse_membre" id="f_repasse_membre" value="{form_field name=repasse_membre}" pattern=".{ldelim}5,{rdelim}" required="required" /></dd>
        </dl>
    </fieldset>

    <p class="submit">
        {csrf_field key="install"}
        <input type="submit" name="save" value="Terminer l'installation &rarr;" />
    </p>

    <script type="text/javascript" src="{$admin_url}static/password.js"></script>

    <script type="text/javascript">

    initPasswordField('password_suggest', 'f_passe_membre', 'f_repasse_membre');











    </script>

    </form>
{/if}

{include file="admin/_foot.tpl"}
|







 







|



>

>

>
>
>
>
>
>
>
>
>
>
>






1
2
3
4
5
6
7
8
..
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
{include file="admin/_head.tpl" title="Garradin - Installation" js=1}

{if $disabled}
    <p class="error">Garradin est déjà installé.</p>
{else}
    <p class="intro">
        Bienvenue dans Garradin !
        Veuillez remplir les quelques informations suivantes pour terminer
................................................................................
            <dt><label for="f_repasse_membre">Encore le mot de passe</label> (vérification) <b title="(Champ obligatoire)">obligatoire</b></dt>
            <dd><input type="password" name="repasse_membre" id="f_repasse_membre" value="{form_field name=repasse_membre}" pattern=".{ldelim}5,{rdelim}" required="required" /></dd>
        </dl>
    </fieldset>

    <p class="submit">
        {csrf_field key="install"}
        <input type="submit" id="f_submit" name="save" value="Terminer l'installation &rarr;" />
    </p>

    <script type="text/javascript" src="{$admin_url}static/password.js"></script>
    <script type="text/javascript" src="{$admin_url}static/loader.js"></script>
    <script type="text/javascript">
    {literal}
    initPasswordField('password_suggest', 'f_passe_membre', 'f_repasse_membre');
    
    var form = $('form')[0];
    form.onsubmit = function () {
        $('#f_submit').style.opacity = 0;
        var loader = document.createElement('div');
        loader.className = 'loader install';
        loader.innerHTML = '<b>Garradin est en cours d\'installation…</b>';
        $('#f_submit').parentNode.appendChild(loader);
        animatedLoader(loader, 5);
    };
    {/literal}
    </script>

    </form>
{/if}

{include file="admin/_foot.tpl"}

Modified src/www/admin/static/admin.css from [d2031306cc] to [95362bba89].

200
201
202
203
204
205
206


































207
208
209
210
211
212
213
....
1057
1058
1059
1060
1061
1062
1063

    font-family: Sans-serif;
    min-width: 2em;
}

input[type=submit], input[type=button] {
    padding: 0.3em;
    cursor: pointer;


































}

input[type=button].icn {
    font-size: 1.2em;
    font-weight: bold;
    padding: 0 0.3em;
    font-family: "Courier New", Courier, monospace;
................................................................................
    width: 30%;
    overflow: auto;
}

.hidden {
    display: none;
}








>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







 







>
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
....
1091
1092
1093
1094
1095
1096
1097
1098
    font-family: Sans-serif;
    min-width: 2em;
}

input[type=submit], input[type=button] {
    padding: 0.3em;
    cursor: pointer;
    transition: opacity .5s ease;
}

.loader {
    width: 100%;
    min-height: 32px;
    display: block;
    position: relative;
}

.loader.install {
    margin-top: -40px;
}

.loader b {
    text-shadow: 2px 2px 5px #999;
    background: rgba(255, 255, 255, 0.5);
    border-radius: .5em;
    font-size: 16px;
    line-height: 16px;
    height: 16px;
    z-index: 9999;
    position: absolute;
    display: block;
    left: 10px;
    top: 10px;
    padding: .2em;
}

.loader img {
    position: absolute;
    opacity: 0;
    transition: all 0.5s ease;
    z-index: 2;
}

input[type=button].icn {
    font-size: 1.2em;
    font-weight: bold;
    padding: 0 0.3em;
    font-family: "Courier New", Courier, monospace;
................................................................................
    width: 30%;
    overflow: auto;
}

.hidden {
    display: none;
}

Added src/www/admin/static/loader.js version [ed5d9f8f69].

































































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
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
(function () {
	var points = new Array;
	points.push('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA0AAAAQBAMAAAA/jegKAAAAMFBMVEWcThVVIgBVIgBUIQBWHwBVIgBVIgBVIgBVIgBVIQBVIgBPJABVIgBWIwAAAABVIgCCdzN5AAAAD3RSTlMAlcl4FOT2ptfdvRhENwF6tE0BAAAAY0lEQVQI12NgYDFtdGAAAo///+eC6PX///8ECvD8B4ICBoanIPoPA8N9EP2JgUEeRP8/wKAPor4JMMSD+QsY8sF0AEM/mJ4AVbeA4RqYNmBgBFG/HjBwgySkgfbwVCbJMjAAAAYDSpeMp7/QAAAAAElFTkSuQmCC');
	points.push('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAALBAMAAAC9q6FRAAAAMFBMVEWcThWAMwCAMwCAMwCAMwCBMwCAMwCAMwCAMwCDLACAMwCAMwCANACAMgD/AACAMwAX2X54AAAAD3RSTlMAV83hfTmx++sLk+egJgFrG5vVAAAASklEQVQI12NgmJjckTKBgYFX////74UMDNf/g4ADw3owXcrQD6b/MJwH078Z5MH0ZwYuMP2JgW85iP7IwMAKNOD/AQYgw8k4kQEAgOI2ASlUEn0AAAAASUVORK5CYII=');
	points.push('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKBAMAAAB/HNKOAAAAMFBMVEWcThXIcTfIcTfIcTfIcTfIcTfIcTfHcTfIcjbIcTfHcTeqVVXIcTfIczf/AADIcTeCBB0DAAAAD3RSTlMAsOfT2/XGYxKMcwNYKgH3X2xUAAAAPUlEQVQI12PgEPK8wMCw8f//GAaG9f///z/AIA8kvRnsgeR3Bn8g+ZlBFEh+ZbgKZvPo////i4GhPc14HQDfoiJRD3ymmQAAAABJRU5ErkJggg==');
	points.push('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA4AAAALBAMAAAC9q6FRAAAAMFBMVEWcThX/mVX/mFX/mFX/mVX/mVT/mFX/m1X/mVX/mVX/mFX/mlT/pFr/mVX/mVX/mVVPZKOjAAAAD3RSTlMA96lr8Ie9JNfcQBgH4vnEmqxYAAAATUlEQVQI12NgYGDX8NRmYGDgCXz3/6MBA8PK/0AgzsAlD6I/Mex9D6J/MsSDqP9fGPLB9DeG+WD6MYM9mFZg2AaiRA8wMCxr9EwuYAAAYbQ00qywMe4AAAAASUVORK5CYII=');
	points.push('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAsAAAALBAMAAABbgmoVAAAAMFBMVEWcThXIcTfIcTfHcTfJcjXIcTfIcTfIbzbHcTfIcTfJcDbHcTfIcTfIcTf/AADIcTd/hisqAAAAD3RSTlMAXvKHDNbtK9LgF5vHyQH5nLrmAAAAS0lEQVQI12NgcA5tfMDAwJj///9xBoZl/////+nAsB9I/Tdg6AdRBxj0QZQCw30QFcBgD6I2MHgCyU8LGNjn//+fyMDAsPhQ9AIGALkqLN+K3VggAAAAAElFTkSuQmC');
	
	function getRandomInt (min, max) {
	    return Math.floor(Math.random() * (max - min + 1)) + min;
	}

	var anim = null;

	window.animatedLoader = function(elm, estimated_time) {
		var max = 500;
		var nb = 0;
		var prev = null;
		var i = (estimated_time * 1000) / max;

		anim = window.setInterval(function () {
			if (nb++ >= max)
			{
				window.clearInterval(anim);
			}
			
			if (prev)
			{
				prev.style.opacity = getRandomInt(25, 100) / 100;
			}

			var max_w = Math.min(elm.offsetWidth, elm.offsetWidth * ((nb / max)+0.1));
			var min_w = Math.max(0, max_w - (elm.offsetWidth / 10));

			var img = document.createElement('img');
			img.src = points[getRandomInt(0, points.length-1)];
			img.alt = '';
			img.style.left = getRandomInt(Math.abs(Math.floor(min_w)), Math.abs(Math.floor(max_w))) + 'px';
			img.style.top = getRandomInt(0, elm.offsetHeight) + 'px';
			elm.appendChild(img);
			prev = img;
		}, i);
	};

	window.stopAnimatedLoader = function() {
		window.clearInterval(anim);
	};
})();

Modified src/www/admin/upgrade.php from [c997c39907] to [bd334ced26].

14
15
16
17
18
19
20


21






22





23
24
25
26
27
28
29
...
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202

203
204
205
206



207
    throw new UserException("Pas de mise à jour à faire.");
}

$db = DB::getInstance();
$redirect = true;

echo '<!DOCTYPE html>


<meta charset="utf-8" />






<h3>Mise à jour de Garradin '.$config->getVersion().' vers la version '.garradin_version().'...</h3>';






flush();

// versions pré-0.3.0
if (!$v)
{
    $db->exec('ALTER TABLE membres ADD COLUMN lettre_infos INTEGER DEFAULT 0;');
................................................................................
    $config->save();
}

utils::clearCaches();

$config->setVersion(garradin_version());

echo '<h4>Mise à jour terminée.</h4>
<p><a href="'.WWW_URL.'admin/">Retour</a></p>';

if ($redirect)
{
    echo '
    <script type="text/javascript">
    window.setTimeout(function () { 
        window.location.href = "'.WWW_URL.'admin/"; 

    }, 1000);
    </script>';
}




?>







>
>
|
>
>
>
>
>
>
|
>
>
>
>
>







 







|








>




>
>
>

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
...
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
    throw new UserException("Pas de mise à jour à faire.");
}

$db = DB::getInstance();
$redirect = true;

echo '<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0, target-densitydpi=device-dpi" />
    <link rel="stylesheet" type="text/css" href="static/admin.css" media="all" />
    <script type="text/javascript" src="static/loader.js"></script>
    <title>Mise à jour</title>
</head>
<body>
<div class="header"><h1>Mise à jour de Garradin '.$config->getVersion().' vers la version '.garradin_version().'...</h1></div>
<div class="page">
<div id="loader" class="loader" style="margin: 2em 0; height: 50px;"></div>
<script>
animatedLoader(document.getElementById("loader"), 5);
</script>';

flush();

// versions pré-0.3.0
if (!$v)
{
    $db->exec('ALTER TABLE membres ADD COLUMN lettre_infos INTEGER DEFAULT 0;');
................................................................................
    $config->save();
}

utils::clearCaches();

$config->setVersion(garradin_version());

echo '<h2>Mise à jour terminée.</h2>
<p><a href="'.WWW_URL.'admin/">Retour</a></p>';

if ($redirect)
{
    echo '
    <script type="text/javascript">
    window.setTimeout(function () { 
        window.location.href = "'.WWW_URL.'admin/"; 
        stopAnimatedLoader();
    }, 1000);
    </script>';
}

echo '
</body>';

?>