Browse Source

fix: forum même pour les personnes non logguées

svn/root/tags/v0.17.1
fredlefred@gmail.com 10 years ago
parent
commit
2b45effbe0
  1. 5
      ckeditor4spip.js.html
  2. 48
      ckspip_convert.html
  3. 2
      paquet.xml
  4. 2
      plugin.xml
  5. 2
      spip-styles.html

5
ckeditor4spip.js.html

@ -168,7 +168,9 @@ function SpipEditor2CKEditor(editor_id){
.attr('src','[(#CHEMIN{images/ckeditor_spip.png}|url_absolue)]') ;
$('#swapeditor_'+stack[editor_id].ndx).attr('disabled',false);
this.setReadOnly(false);
this.resize(CKEDITOR.ckConfig.minwidth,CKEDITOR.ckConfig.height);
this.on('dataReady', function(e){
this.resize(CKEDITOR.ckConfig.minwidth,CKEDITOR.ckConfig.height);
});
$(editor_id).parents().find('input[class=submit]') // fix: a priori ceci n'est nécessaire que pour les forums, mais il semble que cela fonctionne aussi pour les autres formulaires
.attr('onclick', 'javacript:CKEditor2SpipEditor(\''+editor_id+'\');') ;
},EdConfig);
@ -312,6 +314,7 @@ function fullInitCKEDITOR(editor_ids){
stack[editor_id].ndx = ndx ;
stack[editor_id].tb = editor_tb ;
stack[editor_id].nobarre = ($(editor_id).hasClass('no_barre') || CKEDITOR.ckeditmode == 'spip') ;
stack[editor_id].md5 = editor_md5 ;
if (! stack[editor_id].nobarre)
$(editor_id).addClass('no_barre');[(#REM) // on fait en sorte de désactiver l'affichage du porte plume avant qu'il n'entre en scène ...]

48
ckspip_convert.html

@ -2,33 +2,31 @@
#CACHE{0}
<?php
include_spip('inc/autoriser');
if (autoriser('ecrire')) {
include_spip("inc/ckeditor_tools") ;
include_spip("inc/ckeditor_tools") ;
if ($_POST['text_area'] && $_POST['cvt']) {
if ($_POST['text_area'] && $_POST['cvt']) {
if ($GLOBALS['meta']['charset'] && ($GLOBALS['meta']['charset'] != 'utf-8')) {
$_POST['text_area'] = iconv('utf-8', $GLOBALS['meta']['charset'].'//TRANSLIT//IGNORE', $_POST['text_area']) ;
}
if ($GLOBALS['meta']['charset'] && ($GLOBALS['meta']['charset'] != 'utf-8')) {
$_POST['text_area'] = iconv('utf-8', $GLOBALS['meta']['charset'].'//TRANSLIT//IGNORE', $_POST['text_area']) ;
}
switch ($_POST['cvt']) {
case 'spip2html':
$result = ckeditor_spip2html($_POST['text_area']) ;
if (!$_POST['fix'] && preg_match("~\s*<p>.*?</p>\s*~s", $result, $m) && ($m[0] == $result)) {
echo preg_replace("~^\s*<p>(.*?)</p>\s*$~s", "$1", $result) ;
} else {
echo $result ;
}
break ;
case 'html2spip':
echo ckeditor_html2spip($_POST['text_area']) ;
break ;
case 'none':
echo $_POST['text_area'] ;
break ;
default:
echo _T('ckeditor:err_conversion')."\n".$_POST['text_area'] ;
}
switch ($_POST['cvt']) {
case 'spip2html':
$result = ckeditor_spip2html($_POST['text_area']) ;
if (!$_POST['fix'] && preg_match("~\s*<p>.*?</p>\s*~s", $result, $m) && ($m[0] == $result)) {
echo preg_replace("~^\s*<p>(.*?)</p>\s*$~s", "$1", $result) ;
} else {
echo $result ;
}
break ;
case 'html2spip':
echo ckeditor_html2spip($_POST['text_area']) ;
break ;
case 'none':
echo $_POST['text_area'] ;
break ;
default:
echo _T('ckeditor:err_conversion')."\n".$_POST['text_area'] ;
}
}
?>

2
paquet.xml

@ -1,7 +1,7 @@
<paquet
prefix="ckeditor"
categorie="edition"
version="0.16.8"
version="0.16.9"
etat="dev"
compatibilite="[3.0.5;3.0.*]"
logo="images/ckspip-logo.png"

2
plugin.xml

@ -1,7 +1,7 @@
<plugin>
<nom><multi>[fr]CKEditor pour SPIP[en]CKEditor for SPIP[ar]CKEDITOR &#1604; SPIP</multi></nom>
<auteur>Auteurs : [Fr&#233;d&#233;ric Bonnaud->mailto:fred@lea-linux.org], [Mehdi Cherifi (Superyms)->mailto:superyms@gmail.com], [Emmanuel Dreyfus->mailto:manu@netbsd.org]</auteur>
<version>0.16.8</version>
<version>0.16.9</version>
<etat>test</etat>
<description>
<h3><multi>[fr]Int&#233;gration de l'&#233;diteur WYSIWYG CKEditor à SPIP 2.0.9+[en]Integration of WYSIWYG editor CKEditor with SPIP 2.0.9+[ar]&#1578;&#1603;&#1575;&#1605;&#1604; CKEditor &#1606;&#1575;&#1588;&#1585; &#1604;SPIP 2.0.9+ et SPIP 3.0.4+</multi></h3>

2
spip-styles.html

@ -1,5 +1,5 @@
#CACHE{0}
[(#HTTP_HEADER{Content-type: text/css[; charset=(#CHARSET)]})]
[(#HTTP_HEADER{Content-type: text/javascript[; charset=(#CHARSET)]})]
<BOUCLE_si(CONDITION){si #SESSION{statut}|<{2}}>
<?php
include_spip('inc/ckeditor_cfgtools') ;

Loading…
Cancel
Save