Browse Source

C'est mieux comme ca : chargement des css et js dynamiques

master v1.18.0
cedric@yterium.com 6 years ago
parent
commit
b6cc93f818
  1. 6
      .gitattributes
  2. 3
      css/barre_outils_icones.css.html
  3. 0
      javascript/porte_plume_start.js.html
  4. 0
      javascript/porte_plume_start.js_fonctions.php
  5. 4
      paquet.xml
  6. 31
      porte_plume_pipelines.php

6
.gitattributes vendored

@ -3,8 +3,8 @@ action/porte_plume_previsu.php -text
barre_outils/edition.php -text
barre_outils/forum.php -text
barre_outils/vide.php -text
/barre_outils_icones.css.html -text
css/barre_outils.css -text
css/barre_outils_icones.css.html -text
css/barre_outils_prive.css -text
css/img/arrow_in.png -text
css/img/arrow_out.png -text
@ -53,6 +53,8 @@ javascript/jquery.markitup.js -text
javascript/jquery.markitup_pour_spip.js -text
javascript/jquery.previsu_spip.js -text
javascript/porte_plume_forcer_hauteur.js -text
javascript/porte_plume_start.js.html -text
javascript/porte_plume_start.js_fonctions.php -text
lang/barreoutils.xml -text
lang/barreoutils_ar.php -text
lang/barreoutils_de.php -text
@ -90,8 +92,6 @@ markitup/templates/preview.html -text
/porte_plume_fonctions.php -text
/porte_plume_ieconfig.php -text
/porte_plume_pipelines.php -text
/porte_plume_start.js.html -text
/porte_plume_start.js_fonctions.php -text
prive/porte_plume_preview.html -text
prive/porte_plume_preview_fonctions.php -text
prive/squelettes/contenu/aide_typo.html -text

3
barre_outils_icones.css.html → css/barre_outils_icones.css.html

@ -1,6 +1,3 @@
#CACHE{7*24*3600,cache-client}
#HTTP_HEADER{Content-Type: text/css; charset=utf-8}
#HTTP_HEADER{Vary: Accept-Encoding}
[(#VAL|barre_outils_css_icones)]
/* roue ajax */

0
porte_plume_start.js.html → javascript/porte_plume_start.js.html

0
porte_plume_start.js_fonctions.php → javascript/porte_plume_start.js_fonctions.php

4
paquet.xml

@ -1,7 +1,7 @@
<paquet
prefix="porte_plume"
categorie="edition"
version="1.17.4"
version="1.18.0"
etat="stable"
compatibilite="[3.2.0-dev;3.2.*]"
logo="images/porte-plume-32.png"
@ -30,4 +30,4 @@
<pipeline nom="affiche_milieu" inclure="porte_plume_pipelines.php" />
<pipeline nom="configurer_liste_metas" inclure="porte_plume_pipelines.php" />
<pipeline nom="ieconfig_metas" inclure="porte_plume_ieconfig.php" />
</paquet>
</paquet>

31
porte_plume_pipelines.php

@ -88,7 +88,7 @@ function porte_plume_insert_head_public($flux) {
* @return string Contenu du head
*/
function porte_plume_insert_head_prive($flux) {
$js = find_in_path('javascript/porte_plume_forcer_hauteur.js');
$js = timestamp(find_in_path('javascript/porte_plume_forcer_hauteur.js'));
$flux = porte_plume_inserer_head($flux, $GLOBALS['spip_lang'], true)
. "<script type='text/javascript' src='$js'></script>\n";
@ -104,15 +104,11 @@ function porte_plume_insert_head_prive($flux) {
* @return string Contenu du head complété
*/
function porte_plume_inserer_head($flux, $lang, $prive = false) {
$markitup = find_in_path('javascript/jquery.markitup_pour_spip.js');
$js_previsu = find_in_path('javascript/jquery.previsu_spip.js');
if (defined('_VAR_MODE') and _VAR_MODE == 'recalcul') {
$js_start = parametre_url(generer_url_public('porte_plume_start.js'), 'lang', $lang);
$js_start = parametre_url($js_start, 'var_mode', 'recalcul');
} else {
$hash = md5(porte_plume_creer_json_markitup());
$js_start = produire_fond_statique('porte_plume_start.js', array('lang' => $lang, 'hash' => $hash));
}
$markitup = timestamp(find_in_path('javascript/jquery.markitup_pour_spip.js'));
$js_previsu = timestamp(find_in_path('javascript/jquery.previsu_spip.js'));
$hash = md5(porte_plume_creer_json_markitup());
$js_start = produire_fond_statique('javascript/porte_plume_start.js', array('lang' => $lang, 'hash' => $hash));
$flux .=
"<script type='text/javascript' src='$markitup'></script>\n"
@ -148,17 +144,14 @@ function porte_plume_insert_head_css($flux = '', $prive = false) {
// toujours autoriser pour le prive.
if ($prive or autoriser('afficher_public', 'porteplume')) {
if ($prive) {
$cssprive = find_in_path('css/barre_outils_prive.css');
$cssprive = timestamp(find_in_path('css/barre_outils_prive.css'));
$flux .= "<link rel='stylesheet' type='text/css' media='all' href='$cssprive' />\n";
}
$css = direction_css(find_in_path('css/barre_outils.css'), lang_dir());
if (defined('_VAR_MODE') and _VAR_MODE == 'recalcul') {
$css_icones = generer_url_public('barre_outils_icones.css');
$css_icones = parametre_url($css_icones, 'var_mode', 'recalcul');
} else {
$hash = md5(barre_outils_css_icones());
$css_icones = produire_fond_statique('barre_outils_icones.css', array('hash' => $hash));
}
$css = timestamp(direction_css(find_in_path('css/barre_outils.css'), lang_dir()));
$hash = md5(barre_outils_css_icones());
$css_icones = produire_fond_statique('css/barre_outils_icones.css', array('hash' => $hash));
$flux
.= "<link rel='stylesheet' type='text/css' media='all' href='$css' />\n"
. "<link rel='stylesheet' type='text/css' media='all' href='$css_icones' />\n";

Loading…
Cancel
Save