[SPIP Zone] [Spip-zone-commit] r27574 - in /_plugins_/_stable_/couteau_suisse: ./ outils/

2009/3/30 <patfr@ifrance.com>

Author: patfr@ifrance.com
Date: Mon Mar 30 00:31:09 2009
New Revision: 27574

Log:
Pas de forums anonymes : désormais le script est présent sur tout le site car les formulaires de forum peuvent être présents n’importe où et fonctionner en AJAX.

Mouarf !!! :smiley:

Merci Pat :wink:

Etienne.

  • Reconnaissance des fichiers en mon_outil.js.html qui sont incorporés en inline au header.
  • Passage de 2 petits fichiers .js en .js.html

Cette mise à jour nécessite de recompiler le CS.

Added:
plugins/stable/couteau_suisse/outils/auteur_forum.js.html
plugins/stable/couteau_suisse/outils/desactiver_flash.js.html

  • copied unchanged from r27367, plugins/stable/couteau_suisse/outils/desactiver_flash.js
    plugins/stable/couteau_suisse/outils/jcorner.js.html
  • copied, changed from r27377, plugins/stable/couteau_suisse/outils/jcorner.js
    Removed:
    plugins/stable/couteau_suisse/outils/auteur_forum.php
    plugins/stable/couteau_suisse/outils/desactiver_flash.js
    plugins/stable/couteau_suisse/outils/jcorner.js
    Modified:
    plugins/stable/couteau_suisse/config_outils.php
    plugins/stable/couteau_suisse/cout_utils.php
    plugins/stable/couteau_suisse/outils/decoupe_fonctions.php

Modified: plugins/stable/couteau_suisse/config_outils.php

plugins/stable/couteau_suisse/config_outils.php (original)
+++ plugins/stable/couteau_suisse/config_outils.php Mon Mar 30 00:31:09 2009
@@ -288,8 +288,7 @@
‹ id › => ‹ auteur_forum ›,
‹ categorie › => ‹ admin ›,
‹ jquery › => ‹ oui ›,

  • ‹ code:options › => « @define(‹ _FORUM_OBLIGE_AUTEUR ›, ‹ oui ›); »,
  • ‹ pipeline:affichage_final › => ‹ Auteur_forum_affichage_final ›,
  • ‹ code:jq_init › => ‹ cs_auteur_forum.apply(this); ›,
    ));

// ici on a besoin de trois boutons radio : _T(‹ couteauprive:par_defaut ›), _T(‹ couteauprive:sf_amont ›) et _T(‹ couteauprive:sf_tous ›)

Modified: plugins/stable/couteau_suisse/cout_utils.php

plugins/stable/couteau_suisse/cout_utils.php (original)
+++ plugins/stable/couteau_suisse/cout_utils.php Mon Mar 30 00:31:09 2009
@@ -281,7 +281,7 @@
// liste des traitements utilises
$traitements_utilises =
// variables temporaires

  • $temp_html = $temp_css = $temp_js = $temp_jq = $temp_jq_init = $temp_filtre_imprimer = array();
  • $temp_js_html = $temp_css_html = $temp_css = $temp_js = $temp_jq = $temp_jq_init = $temp_filtre_imprimer = array();
    // inclure d’office outils/cout_fonctions.php
    if ($temp=cs_lire_fichier_php(« outils/cout_fonctions.php »))
    $infos_fichiers[‹ code_fonctions ›] = $temp;
    @@ -309,11 +309,9 @@
    if ($f=find_in_path($_css = « outils/$inc.css »)) $cs_metas_pipelines[‹ header ›] = cs_insert_header($f, ‹ css ›);
    if ($f=find_in_path(« outils/$inc.js »)) $cs_metas_pipelines[‹ header ›] = cs_insert_header($f, ‹ js ›);
    // en fait on peut pas compiler ici car les balises vont devoir etre traitees et les traitements ne sont pas encore dispo !
  • if ($f=find_in_path(« outils/$inc.css.html »)) {
    // le code est mis de cote. il sera compile plus tard au moment du pipeline grace a cs_compile_header()
  • lire_fichier($f, $ff);
  • $temp_html = $ff;
  • }
  • if ($f=find_in_path(« outils/$inc.css.html »)) { lire_fichier($f, $ff); $temp_css_html = $ff; }
  • if ($f=find_in_path(« outils/$inc.js.html »)) { lire_fichier($f, $ff); $temp_js_html = $ff; }
    // recherche d’un code inline eventuellement propose
    if (isset($outil[‹ code:spip_options ›])) $infos_fichiers[‹ code_spip_options ›] = $outil[‹ code:spip_options ›];
    if (isset($outil[‹ code:options ›])) $infos_fichiers[‹ code_options ›] = $outil[‹ code:options ›];
    @@ -333,10 +331,14 @@
    if(isset($infos_pipelines[‹ bt_toolbox ›]))
    $temp_css = ‹ span.cs_BT {background-color:#FFDDAA; font-weight:bold; border:1px outset #CCCC99; padding:0.2em 0.3em;}
    span.cs_BTg {font-size:140%; padding:0 0.3em;} ›;
  • // prise en compte des css.html qu’il faudra compiler plus tard
  • if (count($temp_html)) {
  • $temp_css = ‹ <cs_html> ›.join(« \n », $temp_html).‹ </cs_html> ›;
  • unset($temp_html);
  • // prise en compte des css.html et js.html qu’il faudra compiler plus tard
  • if(count($temp_css_html)){
  • $temp_css = ‹ <cs_html> ›.join(« \n », $temp_css_html).‹ </cs_html> ›;
  • unset($temp_css_html);
  • }
  • if(count($temp_js_html)){
  • $temp_js = ‹ <cs_html> ›.join(« \n », $temp_js_html).‹ </cs_html> ›;
  • unset($temp_js_html);
    }
    // concatenation des css inline, js inline et filtres trouves
    if (count($temp_css)) {

Added: plugins/stable/couteau_suisse/outils/auteur_forum.js.html

plugins/stable/couteau_suisse/outils/auteur_forum.js.html (added)
+++ plugins/stable/couteau_suisse/outils/auteur_forum.js.html Mon Mar 30 00:31:09 2009
@@ -0,0 +1,21 @@
+// compatibilite Ajax : ajouter « this » a « jQuery » pour mieux localiser les actions
+// et tagger avec cs_done pour eviter de binder plrs fois le meme bloc
+function cs_auteur_forum() {

  • // selecteur du bloc de previsualisation
  • var sel = ‹ fieldset.previsu ›;
  • if(!jQuery(sel, this).length) return;
  • var form = jQuery(sel, this).parents(‹ form ›).eq(0);
  • // SPIP 2.0 remplace ‹ auteur › par ‹ session_nom ›
  • var auteur = jQuery(‹ #session_nom ›, this);
  • if(!auteur.length) auteur = jQuery(‹ #auteur ›, this);
  • if(form.length && auteur.length)
  • // eviter les forums anonymes
  • form.not(‹ .cs_done ›).addClass(‹ cs_done ›).bind(‹ submit ›, function(event){
  • if(!auteur.val().length) {
  • alert(« <:couteau:nom_forum|html2unicode|addslashes|unicode_to_javascript:> »);
  • auteur.focus();
  • auteur.css(‹ background-color ›,‹ #FFFFE0 ›).auteur.css(‹ border ›,‹ solid 2px #E86519 ›);
  • return false;
  • }
  • });
    +}

Removed: plugins/stable/couteau_suisse/outils/auteur_forum.php

plugins/stable/couteau_suisse/outils/auteur_forum.php (original)
+++ plugins/stable/couteau_suisse/outils/auteur_forum.php (removed)
@@ -1,42 +0,0 @@
-<?php

-function Auteur_forum_affichage_final($flux){

  • if(_request(‹ page ›)==‹ forum ›) {
  • $form = defined(‹ _SPIP19100 ›)?« jQuery(‹ .previsu ›).parent() »:« jQuery(‹ fieldset.previsu ›, this).parent().parent() »;
  • include_spip(‹ inc/charsets ›);

  • // filtrer et remettre le tout dans le charset cible
  • $nom = unicode2charset(html2unicode(_T(‹ couteau:nom_forum ›)));
  • $nom = ‹ " › . str_replace(‹ " ›, ‹ " ›, $nom) . ‹ " ›;
  • // code jQuery
  • $code =<<<jscode
    -
    -jscode;
  • $flux = str_replace(«  »,« $code\n »,$flux);
  • }
  • return $flux;
    -}

-?>
\ No newline at end of file

Modified: plugins/stable/couteau_suisse/outils/decoupe_fonctions.php

(empty)

Removed: plugins/stable/couteau_suisse/outils/desactiver_flash.js

plugins/stable/couteau_suisse/outils/desactiver_flash.js (original)
+++ plugins/stable/couteau_suisse/outils/desactiver_flash.js (removed)
@@ -1,17 +0,0 @@
-// compatibilite Ajax : ajouter « this » a « jQuery » pour mieux localiser les actions
-// et tagger avec cs_done pour eviter de traiter plrs fois le meme bloc
-function InhibeFlash_init() {

  • var code;
  • jQuery(‹ object ›, this).each(function(){
  • jQuery(‹ param ›,this).remove();
  • }).wrap(« 
     »);
  • jQuery(‹ div.noflash ›, this).not(‹ .cs_done ›).addClass(‹ cs_done ›).each(function(){
  • var code = this.innerHTML;
  • // ajouter les attributs juste avant la fermeture de la balise object
  • var reg=new RegExp(« (<object [^>]*>) », « i »);
  • code = code.replace(reg,«  »);
  • var reg=new RegExp(« (</object>) », « i »);
  • code = code.replace(reg,«  »);
  • this.innerHTML=code;
  • })
    -}

Removed: plugins/stable/couteau_suisse/outils/jcorner.js

plugins/stable/couteau_suisse/outils/jcorner.js (original)
+++ plugins/stable/couteau_suisse/outils/jcorner.js (removed)
@@ -1,6 +0,0 @@
-jQuery.fn.jc_ajouter_parent = function(color, padding, margin) {

  • color = ((typeof color==‹ undefined ›) || (color==‹  ›))?‹  ›:(’ background-color:‹ +color+ ›;');
  • if ((typeof padding==‹ undefined ›) || (padding==‹  ›)) padding = ‹ 4px ›;
  • if ((typeof margin==‹ undefined ›) || (margin==‹  ›)) margin = ‹ 4px 0 ›;
  • return this.wrap(‹ 
     ›);
    -};
    \ No newline at end of file

Copied: plugins/stable/couteau_suisse/outils/jcorner.js.html (from r27377, plugins/stable/couteau_suisse/outils/jcorner.js)

plugins/stable/couteau_suisse/outils/jcorner.js (original)
+++ plugins/stable/couteau_suisse/outils/jcorner.js.html Mon Mar 30 00:31:09 2009
@@ -1,4 +1,4 @@

[… 6 lines stripped …]


Spip-zone-commit@rezo.net - http://listes.rezo.net/mailman/listinfo/spip-zone-commit


Etienne Brackers.
http://www.loiseau2nuit.net

| Webdesigner intégrateur indépendant
| Création de sites web avec Spip
| La Flèche, Angers, Pays de la Loire…

Attention yavait une chtite erreur, j'ai refait le commit lol
Pat

L'oiseau2nuit a écrit :

Mouarf !!! :smiley:

Merci Pat :wink:

2009/3/30 Pat <patrice.vanneufville@laposte.net>

Attention yavait une chtite erreur, j’ai refait le commit lol
Pat

Pour faire écho à ce que j’ai déjà dit sur le forum : merci beaucoup pour ta réactivité :wink:

L’oiseau2nuit a écrit :

Mouarf !!! :smiley:

Merci Pat :wink:


spip-zone@rezo.net - http://listes.rezo.net/mailman/listinfo/spip-zone


Etienne Brackers.
http://www.loiseau2nuit.net

| Webdesigner intégrateur indépendant
| Création de sites web avec Spip
| La Flèche, Angers, Pays de la Loire…