|
|
|
#CACHE{7*24*3600,cache-client}
|
|
|
|
#HTTP_HEADER{Content-Type: text/javascript; charset=#CHARSET}
|
|
|
|
|
|
|
|
[(#REM) chargement des definitions des barres d'outils
|
|
|
|
<script>]
|
|
|
|
[(#VAL|porte_plume_creer_json_markitup)]
|
|
|
|
|
|
|
|
|
|
|
|
;(function($){
|
|
|
|
|
|
|
|
// 2 fonctions pour appeler le porte plume reutilisables pour d'autres plugins
|
|
|
|
// on envoie dedans la selection jquery qui doit etre effectuee
|
|
|
|
// ce qui evite des appels direct a markitup, aucazou on change de lib un jour
|
|
|
|
$.fn.barre_outils = function(nom, settings) {
|
|
|
|
options = {
|
|
|
|
lang:'[(#ENV{lang})]'
|
|
|
|
};
|
|
|
|
$.extend(options, settings);
|
|
|
|
|
|
|
|
return $(this)
|
|
|
|
.not('.markItUpEditor, .no_barre')
|
|
|
|
.markItUp(eval('barre_outils_' + nom), {lang:options.lang})
|
|
|
|
.parent().find('.markItUpButton a').attr('tabindex', -1) // ne pas tabuler les boutons
|
|
|
|
.end();
|
|
|
|
};
|
|
|
|
|
|
|
|
$.fn.barre_previsualisation = function(settings) {
|
|
|
|
options = {
|
|
|
|
previewParserPath:"index.php?action=porte_plume_previsu", // ici une url relative pour prive/public
|
|
|
|
textEditer:"<:barreoutils:editer:>",
|
|
|
|
textVoir:"<:barreoutils:voir:>"
|
|
|
|
};
|
|
|
|
$.extend(options, settings);
|
|
|
|
|
|
|
|
return $(this)
|
|
|
|
.not('.pp_previsualisation, .no_previsualisation')
|
|
|
|
.previsu_spip(options)
|
|
|
|
.parent().find('.markItUpTabs a').attr('tabindex', -1) // ne pas tabuler les onglets
|
|
|
|
.end();
|
|
|
|
};
|
|
|
|
|
|
|
|
$(window).load(function(){
|
|
|
|
// ajoute les barres d'outils markitup
|
|
|
|
function barrebouilles(){
|
|
|
|
// fonction generique appliquee aux classes CSS :
|
|
|
|
// inserer_barre_forum, inserer_barre_edition, inserer_previsualisation
|
|
|
|
$('.formulaire_spip textarea.inserer_barre_forum').barre_outils('forum');
|
|
|
|
$('.formulaire_spip textarea.inserer_barre_edition').barre_outils('edition');
|
|
|
|
$('.formulaire_spip textarea.inserer_previsualisation').barre_previsualisation();
|
|
|
|
// fonction specifique aux formulaires de SPIP :
|
|
|
|
// barre de forum
|
|
|
|
$('textarea.textarea_forum').barre_outils('forum');
|
|
|
|
[(#CONFIG{forums_afficher_barre}|=={non}|non)
|
|
|
|
$('.formulaire_forum textarea[(#VAL{91}|chr)]name=texte[(#VAL{93}|chr)]').barre_outils('forum');]
|
|
|
|
// barre d'edition et onglets de previsualisation
|
|
|
|
$('.formulaire_spip[(#CONFIG{forums_afficher_barre}|=={non}|?{':not(#formulaire_forum)',''})] textarea[name=texte]')
|
|
|
|
.barre_outils('edition').end()
|
|
|
|
.barre_previsualisation();
|
|
|
|
}
|
|
|
|
barrebouilles();
|
|
|
|
onAjaxLoad(barrebouilles);
|
|
|
|
|
|
|
|
});
|
|
|
|
})(jQuery);
|