- Un peu de nettoyage
- Reprise du fonctionnement proposé par cédric sur https://github.com/Cerdic/anythingslider-for-spip, à savoir un passage par affichage_final pour charger les scripts seulement au besoin, adapté quelque peu : -- plus besoin de charger toujours anythingslider.css, -- conservation des options par défaut du script, -- correction d'un bug en l'absence de slider-nav -- ajout d'une option js pour charger des scripts additionnels - mise à jour de la saisie listant les thèmesv2
@ -1,40 +0,0 @@
|
||||
[(#REM)
|
||||
Copie du 2012-03-13 18:24:35 par François Rygaert
|
||||
Fichier original plugins/anythingslider/contenu/page-demoanythingslider.html
|
||||
]
|
||||
<B_liste_articles>
|
||||
<div id="liste anythingslider articles">
|
||||
<h2 class="h2">A la une</h2>
|
||||
<ul id="slider1">
|
||||
<BOUCLE_liste_articles(ARTICLES){par date}{0,10}>
|
||||
<li class="item hentry" style="width:100%;">
|
||||
<h3 class="h3 entry-title"><a href="#URL_ARTICLE" rel="bookmark">
|
||||
[(#LOGO_ARTICLE|image_reduire{150})]<span>#TITRE</span>
|
||||
</a></h3>
|
||||
[<div class="info-publi"><abbr class="published" title="[(#DATE|date_iso)]">(#DATE|affdate_jourcourt)</abbr></div>]
|
||||
[<div class="introduction entry-content">(#INTRODUCTION)</div>]
|
||||
<div class="meta-publi">
|
||||
<a class="lire-la-suite" href="#URL_ARTICLE"><:zpip:lire_la_suite:><span class="lire-la-suite-titre"><:zpip:lire_la_suite_de:> <em>#TITRE</em></span></a>
|
||||
</div>
|
||||
</li>
|
||||
</BOUCLE_liste_articles>
|
||||
</ul>
|
||||
</div>
|
||||
<script type="text/javascript">// <![CDATA[
|
||||
$(document).ready(function(){
|
||||
$('ul.#slider1').anythingSlider({
|
||||
expand: false,
|
||||
resizeContents: false,
|
||||
startText : "Start",
|
||||
stopText : "Stop",
|
||||
theme : 'simple', // Si la CSS du theme n'a pas ete activee dans le formulaire de config, le theme par defaut sera utilise.
|
||||
buildArrows: true,
|
||||
buildNavigation: true,
|
||||
buildStartStop: false,
|
||||
toggleControls: false,
|
||||
autoPlay: true,
|
||||
delay : 2000
|
||||
});
|
||||
});
|
||||
//]]></script>
|
||||
</B_liste_articles>
|
@ -1,70 +0,0 @@
|
||||
<div class='formulaire_spip formulaire_configurer formulaire_configurer_anythingslider' id='formulaire_configurer_anythingslider'>
|
||||
[<p class="reponse_formulaire reponse_formulaire_ok">(#ENV*{message_ok})</p>]
|
||||
[<p class="reponse_formulaire reponse_formulaire_erreur">(#ENV*{message_erreur})</p>]
|
||||
|
||||
<form action="#ENV{action}#formulaire_configurer_media" method="post" enctype='multipart/form-data'><div>
|
||||
[(#ACTION_FORMULAIRE{#ENV{action}})]
|
||||
|
||||
<div class='explication'><:anythingslider:explication_configurer_anythingslider:></div>
|
||||
<ul>
|
||||
<li class="editer_themes[ (#ENV**{erreurs}|table_valeur{themes}|oui)erreur]">
|
||||
<label><:anythingslider:label_themes:></label>
|
||||
<div class="choix">
|
||||
#SET{choix,theme-construction.css}
|
||||
<input type="checkbox" name="themes[]" class="checkbox" id="themes_#GET{choix}" [(#GET{choix}|in_array{#ENV{_config}}|oui)checked="checked"] value="#GET{choix}"[(#GET{choix}|in_array{#ENV{_lock}}|oui)disabled="disabled"] />
|
||||
<label for="themes_#GET{choix}">#GET{choix}</label>
|
||||
</div>
|
||||
<div class="choix">
|
||||
#SET{choix,theme-cs-portfolio.css}
|
||||
<input type="checkbox" name="themes[]" class="checkbox" id="themes_#GET{choix}" [(#GET{choix}|in_array{#ENV{_config}}|oui)checked="checked"] value="#GET{choix}"[(#GET{choix}|in_array{#ENV{_lock}}|oui)disabled="disabled"] />
|
||||
<label for="themes_#GET{choix}">#GET{choix}</label>
|
||||
</div>
|
||||
<div class="choix">
|
||||
#SET{choix,theme-metallic.css}
|
||||
<input type="checkbox" name="themes[]" class="checkbox" id="themes_#GET{choix}" [(#GET{choix}|in_array{#ENV{_config}}|oui)checked="checked"] value="#GET{choix}"[(#GET{choix}|in_array{#ENV{_lock}}|oui)disabled="disabled"] />
|
||||
<label for="themes_#GET{choix}">#GET{choix}</label>
|
||||
</div>
|
||||
<div class="choix">
|
||||
#SET{choix,theme-minimalist-round.css}
|
||||
<input type="checkbox" name="themes[]" class="checkbox" id="themes_#GET{choix}" [(#GET{choix}|in_array{#ENV{_config}}|oui)checked="checked"] value="#GET{choix}"[(#GET{choix}|in_array{#ENV{_lock}}|oui)disabled="disabled"] />
|
||||
<label for="themes_#GET{choix}">#GET{choix}</label>
|
||||
</div>
|
||||
<div class="choix">
|
||||
#SET{choix,theme-minimalist-square.css}
|
||||
<input type="checkbox" name="themes[]" class="checkbox" id="themes_#GET{choix}" [(#GET{choix}|in_array{#ENV{_config}}|oui)checked="checked"] value="#GET{choix}"[(#GET{choix}|in_array{#ENV{_lock}}|oui)disabled="disabled"] />
|
||||
<label for="themes_#GET{choix}">#GET{choix}</label>
|
||||
</div>
|
||||
<div class="choix">
|
||||
#SET{choix,theme-simple.css}
|
||||
<input type="checkbox" name="themes[]" class="checkbox" id="themes_#GET{choix}" [(#GET{choix}|in_array{#ENV{_config}}|oui)checked="checked"] value="#GET{choix}"[(#GET{choix}|in_array{#ENV{_lock}}|oui)disabled="disabled"] />
|
||||
<label for="themes_#GET{choix}">#GET{choix}</label>
|
||||
</div>
|
||||
</li>
|
||||
<li class="editer_scripts[ (#ENV**{erreurs}|table_valeur{scripts}|oui)erreur]">
|
||||
<label><:anythingslider:label_scripts:></label>
|
||||
<div class="choix">
|
||||
#SET{choix,jquery.anythingslider.video.min.js}
|
||||
<input type="checkbox" name="scripts[]" class="checkbox" id="scripts_#GET{choix}" [(#GET{choix}|in_array{#ENV{_config}}|oui)checked="checked"] value="#GET{choix}"[(#GET{choix}|in_array{#ENV{_lock}}|oui)disabled="disabled"] />
|
||||
<label for="scripts_#GET{choix}">#GET{choix}</label>
|
||||
</div>
|
||||
<div class="choix">
|
||||
#SET{choix,jquery.anythingslider.fx.min.js}
|
||||
<input type="checkbox" name="scripts[]" class="checkbox" id="scripts_#GET{choix}" [(#GET{choix}|in_array{#ENV{_config}}|oui)checked="checked"] value="#GET{choix}"[(#GET{choix}|in_array{#ENV{_lock}}|oui)disabled="disabled"] />
|
||||
<label for="scripts_#GET{choix}">#GET{choix}</label>
|
||||
</div>
|
||||
<div class="choix">
|
||||
#SET{choix,swfobject.js}
|
||||
<input type="checkbox" name="scripts[]" class="checkbox" id="scripts_#GET{choix}" [(#GET{choix}|in_array{#ENV{_config}}|oui)checked="checked"] value="#GET{choix}"[(#GET{choix}|in_array{#ENV{_lock}}|oui)disabled="disabled"] />
|
||||
<label for="scripts_#GET{choix}">#GET{choix}</label>
|
||||
</div>
|
||||
<div class="choix">
|
||||
#SET{choix,jquery.easing.1.2.js}
|
||||
<input type="checkbox" name="scripts[]" class="checkbox" id="scripts_#GET{choix}" [(#GET{choix}|in_array{#ENV{_config}}|oui)checked="checked"] value="#GET{choix}"[(#GET{choix}|in_array{#ENV{_lock}}|oui)disabled="disabled"] />
|
||||
<label for="scripts_#GET{choix}">#GET{choix}</label>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
<p class='boutons'><input class='submit' type="submit" name="ok" value="<:bouton_enregistrer:>"/></p>
|
||||
</div></form>
|
||||
|
||||
</div>
|
@ -1,27 +0,0 @@
|
||||
<?php
|
||||
|
||||
if (!defined("_ECRIRE_INC_VERSION")) return;
|
||||
|
||||
function formulaires_configurer_anythingslider_charger_dist(){
|
||||
|
||||
$valeurs = array();
|
||||
$config =unserialize($GLOBALS['meta']['anythingslider']);
|
||||
if (!is_array($config))
|
||||
$config = array();
|
||||
$config = pipeline('anythingslider_charger',$config);
|
||||
$valeurs['_config'] = $config;
|
||||
$valeurs['_lock'] = pipeline('anythingslider_charger',array());
|
||||
return $valeurs;
|
||||
}
|
||||
|
||||
function formulaires_configurer_anythingslider_traiter_dist(){
|
||||
$themes = is_array(_request('themes')) ? _request('themes') : array();
|
||||
$scripts = is_array(_request('scripts')) ? _request('scripts') : array();
|
||||
$config = array_merge($themes,$scripts);
|
||||
ecrire_meta('anythingslider',serialize($config));
|
||||
ecrire_metas();
|
||||
|
||||
return array('message_ok'=>_T('config_info_enregistree'));
|
||||
}
|
||||
|
||||
?>
|
@ -0,0 +1,75 @@
|
||||
jQuery(function(){
|
||||
if (dir_anythingslider && jQuery('.slider-anythingslider').length){
|
||||
/**
|
||||
* Fonction d'initialisation de chaque slider
|
||||
*/
|
||||
var my_anythinslider = {
|
||||
init : function(){
|
||||
var css_def = false;
|
||||
jQuery('.slider-anythingslider:not(.initialized)').each(function(){
|
||||
var me=jQuery(this);
|
||||
var settings = {
|
||||
navigationFormatter: my_anythinslider.navigationFormatter
|
||||
};
|
||||
var options=eval('options='+me.attr('data-slider')+';');
|
||||
if (options) {
|
||||
// charger les CSS du slider
|
||||
if (options.css){
|
||||
for (var k=0;k<options.css.length;k++) {
|
||||
if (options.css[k].length){
|
||||
my_anythinslider.addStylesheet(options.css[k]);
|
||||
var m;
|
||||
if (m = options.css[k].match(/\/theme-(.*)[.]css$/)){
|
||||
options.theme = m[1]; // definir le theme en fonction du nom de la css
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
css_def = true; // charger les CSS par defaut
|
||||
}
|
||||
// charger les JS additionnels
|
||||
if (options.js){
|
||||
for (var k=0;k<options.js.length;k++) {
|
||||
if (options.css[k].length){
|
||||
my_anythinslider.addJavascript(options.js[k]);
|
||||
}
|
||||
}
|
||||
}
|
||||
settings = jQuery.extend(settings,options);
|
||||
} else {
|
||||
css_def = true; // charger les CSS par defaut
|
||||
}
|
||||
me.anythingSlider(settings).addClass('initialized');
|
||||
});
|
||||
if (css_def) { // faut-il charger les CSS par defaut ?
|
||||
my_anythinslider.addStylesheet(css_defaut_anythinslider);
|
||||
}
|
||||
},
|
||||
addStylesheet : function(url) {
|
||||
var stylesheet = document.createElement('link');
|
||||
stylesheet.rel = 'stylesheet';
|
||||
stylesheet.type = 'text/css';
|
||||
stylesheet.href = url;
|
||||
document.getElementsByTagName('head')[0].appendChild(stylesheet);
|
||||
},
|
||||
addJavascript : function(url) {
|
||||
var javascript = document.createElement('script');
|
||||
javascript.type = 'text/javascript';
|
||||
javascript.src = url;
|
||||
document.getElementsByTagName('head')[0].appendChild(javascript);
|
||||
},
|
||||
navigationFormatter : function(index, panel){ // Format navigation labels with text
|
||||
if (jQuery('.slider-nav',panel).length)
|
||||
return jQuery('.slider-nav',panel).html();
|
||||
else
|
||||
return index+""; // Il faut convertir en texte
|
||||
}
|
||||
};
|
||||
jQuery.getScript(dir_anythingslider+"js/jquery.anythingslider.min.js",function(){
|
||||
my_anythinslider.init();
|
||||
onAjaxLoad(my_anythinslider.init);
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
/* See http://css-tricks.github.com/AnythingSlider/ for options */
|
@ -1,14 +0,0 @@
|
||||
<?php
|
||||
|
||||
// Sécurité
|
||||
if (!defined("_ECRIRE_INC_VERSION")) return;
|
||||
|
||||
$GLOBALS[$GLOBALS['idx_lang']] = array(
|
||||
'anythingslider' => 'AnythingSlider',
|
||||
'configurer_anythingslider' => 'Configurer AnythingSlider',
|
||||
'explication_configurer_anythingslider' => 'Choisissez les éléments à insérer dans l\'en-tête des pages publiques (voir la <a href="https://github.com/ProLoser/AnythingSlider/wiki">documentation du script</a>).',
|
||||
'label_scripts' => 'Scripts optionnels',
|
||||
'label_themes' => 'Thèmes',
|
||||
);
|
||||
|
||||
?>
|
Before Width: | Height: | Size: 828 B |
Before Width: | Height: | Size: 11 KiB |
Before Width: | Height: | Size: 11 KiB |
Before Width: | Height: | Size: 17 KiB |
Before Width: | Height: | Size: 20 KiB |
Before Width: | Height: | Size: 26 KiB |
@ -0,0 +1,24 @@
|
||||
<paquet
|
||||
prefix="anythingslider"
|
||||
categorie="multimedia"
|
||||
version="2.0.0"
|
||||
etat="dev"
|
||||
compatibilite="[2.1.0;3.0.99]"
|
||||
logo="prive/themes/spip/images/anythingslider.png"
|
||||
documentation="http://www.spip-contrib.net/?article4283"
|
||||
>
|
||||
|
||||
<nom>AnythingSlider</nom>
|
||||
<!-- Faire défiler du contenu dans vos squelettes -->
|
||||
|
||||
<auteur lien="http://css-tricks.com">Chris Coyier</auteur>
|
||||
<auteur lien="https://github.com/CSS-Tricks/AnythingSlider-Themes">AnythingSlider-Themes</auteur>
|
||||
<auteur lien="http://www.spip-contrib.net/Joseph">Joseph</auteur>
|
||||
<auteur lien="http://www.yterium.com">Cedric Morin Yterium</auteur>
|
||||
<auteur lien="http://romy.tetue.net">romy.tetue.net</auteur>
|
||||
|
||||
<licence lien="http://www.gnu.org/licenses/gpl-3.0.html">GPL 3</licence>
|
||||
|
||||
<pipeline nom="affichage_final" inclure="anythingslider_pipelines.php" />
|
||||
<pipeline nom="header_prive" inclure="anythingslider_pipelines.php" />
|
||||
</paquet>
|
@ -1,9 +0,0 @@
|
||||
<!-- titre=<:anythingslider:configurer_anythingslider:> -->
|
||||
<!-- icone=images/anythingslider-24.png -->
|
||||
|
||||
#CACHE{0}
|
||||
|
||||
<h1 class="grostitre"><:anythingslider:configurer_anythingslider:></h1>
|
||||
<div class="ajax">
|
||||
#FORMULAIRE_CONFIGURER_ANYTHINGSLIDER
|
||||
</div>
|
After Width: | Height: | Size: 792 B |
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 1.5 KiB |
After Width: | Height: | Size: 7.8 KiB |