Changeset 67969 in spip-zone


Ignore:
Timestamp:
Nov 27, 2012, 9:25:41 PM (7 years ago)
Author:
joseph@…
Message:

-- 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èmes
Location:
_plugins_/anythingslider/trunk
Files:
11 added
11 deleted
4 edited

Legend:

Unmodified
Added
Removed
  • _plugins_/anythingslider/trunk/README.textile

    r50142 r67969  
    11h1. AnythingSlider jQuery Plugin
    22
    3 *Just what the world needs, another jQuery slider. YAWN.* I know, check this one out though, it’s got lots of cool features.
     3A very robust jQuery-based slider plugin. Need to link to a specific slide? No problem. Like a choice of themes? Got it. Need callbacks for when specific slider actions happen? Sure. Need custom tab names? You got it. Need more than one slider per page? Easy.
    44
    5 Here on CSS-Tricks, I’ve created a number of different sliders. Three, in fact. A "“featured content”":http://css-tricks.com/creating-a-slick-auto-playing-featured-content-slider/ slider, a "“start/stop slider”":http://css-tricks.com/startstop-slider/, and "“moving boxes”":http://css-tricks.com/moving-boxes/. Each of them had some cool interesting feature that I needed to build at the time. All were well-received, but as is the case with these things, people want them to do X, Y, and Z in addition to what they already did.
     5* Having problems with installing or getting the plugin to work? Ask your question in the "CSS-Tricks forums":http://css-tricks.com/forums/ or on "StackOverflow":http://stackoverflow.com/questions/tagged/anythingslider
     6* Find a bug or have an enhancement request? Submit it "here":https://github.com/CSS-Tricks/AnythingSlider/issues
    67
    7 This new AnythingSlider is an attempt at bringing together the functionality of all of those previous sliders and adding new features. In other words, to create a really “full featured” slider that could be widely useful. This is the first time (on CSS-Tricks) that one of these sliders is an actual plugin as well, which should make implementing it and customizing it much easier.
     8h2. Main Demo
    89
    9 * "Documentation Wiki":https://github.com/ProLoser/AnythingSlider/wiki
    10 * "Keep Reading":http://css-tricks.com/anythingslider-1-4/
    11 * "Main Demo":http://proloser.github.com/AnythingSlider/
    12 * "More Demos":https://github.com/ProLoser/AnythingSlider/wiki
    13 * Having an issue? Submit it "here":https://github.com/ProLoser/AnythingSlider/issues
     10* "Documentation":https://github.com/CSS-Tricks/AnythingSlider/wiki is maintained in the wiki pages.
     11* "CSS-Tricks demo":http://css-tricks.com/examples/AnythingSlider/
     12* "Github demos!":http://css-tricks.github.com/AnythingSlider/
     13* "Download":https://github.com/CSS-Tricks/AnythingSlider/zipball/master
     14
     15h2. Related Projects
     16
     17Download the full repo for a full set of all the cool stuff AnythingSlider can do.
     18
     19* More themes - "AnythingSlider-Themes":https://github.com/CSS-Tricks/AnythingSlider-Themes
     20* Fx bookmarklet - "AnythingSlider-FX-Builder":https://github.com/CSS-Tricks/AnythingSlider-Fx-Builder
     21
     22CMS plugins/mods
     23
     24* Wordpress plugin - "AnythingSlider-for-WordPress":https://github.com/jacobdubail/AnythingSlider-for-WordPress
     25* Movable Type plugin - "mt-plugin-anythingslider":https://github.com/meancode/mt-plugin-anythingslider
     26* Joomla 2.5 mod - "mod_anythingslider":https://github.com/CSS-Tricks/mod_anythingslider
  • _plugins_/anythingslider/trunk/anythingslider_pipelines.php

    r50153 r67969  
    44if (!defined("_ECRIRE_INC_VERSION")) return;
    55
    6 function anythingslider_anythingslider_charger($flux){return $flux;}
     6/**
     7 * Insertion dynamique du js en pied de page,
     8 * uniquement en presence d'un ou plusieurs sliders sur la page
     9 *
     10 * @param string $flux
     11 * @return string
     12 */
     13function anythingslider_affichage_final($flux){
     14        if (stripos($flux,'slider-anythingslider')){
     15                $script = find_in_path('javascript/anythingslider.init.js');
     16                include_spip('filtres/compresseur');
     17                if (function_exists('compacte'))
     18                        $script = compacte($script,'js');
     19                lire_fichier($script, $js);
     20                $js = "var dir_anythingslider='"._DIR_PLUGIN_ANYTHINGSLIDER."lib/anythingslider/';"
     21                  . "var css_defaut_anythinslider='".find_in_path("lib/anythingslider/css/anythingslider.css")."';"
     22                  . $js;
     23                $js = '<script type="text/javascript">/*<![CDATA[*/'.$js.'/*]]>*/</script>';
     24                if ($p=stripos($flux,'</body>'))
     25                        $flux = substr_replace($flux,$js,$p,0);
     26                else
     27                        $flux .= $js;
     28        }
     29        return $flux;
     30}
    731
    8 function anythingslider_insert_head($flux){
    9         // Chargement de la CSS et du JS d'AnythingSlider
    10         $css = find_in_path('css/anythingslider.css');
    11         $flux .= "\n<link rel='stylesheet' href='$css' type='text/css' />\n";
    12         $js = find_in_path('js/jquery.anythingslider.min.js');
    13         $flux .= "<script type='text/javascript' src='$js'></script>\n";
    14         // Chargement optionnels de scripts et/ou de thèmes
    15         $config = unserialize($GLOBALS['meta']['anythingslider']);;
    16         if (!is_array($config))
    17                 $config = array();
    18         $config = array_unique(pipeline('anythingslider_charger',$config));
    19         foreach ($config as $script) {
    20                 $ext = substr(strrchr($script, "."), 1);
    21                 if ($fichier = find_in_path($ext.'/'.$script)) {
    22                         if ($ext=='css')
    23                                 $flux .= "<link rel='stylesheet' href='$fichier' type='text/css' />\n";
    24                         else
    25                                 $flux .= "<script type='text/javascript' src='$fichier'></script>\n";
    26                 }
    27         }
    28         // Script pour internet explorer, doit être placé en dernier.
    29         $css = find_in_path('css/anythingslider-ie.css');
    30         $flux .= "<!--[if lte IE 7]>\n";
    31         $flux .= "<link rel='stylesheet' href='$css' type='text/css' />\n";
    32         $flux .= "<![endif]-->\n";
     32/**
     33 * Insertion statique dans l'espace prive, car on ne sait pas faire mieux pour le moment,
     34 *
     35 * @param string $flux
     36 * @return string
     37 */
     38function anythingslider_header_prive($flux){
     39        $js = "var dir_anythingslider='"._DIR_PLUGIN_ANYTHINGSLIDER."lib/anythingslider/';"
     40          . "var css_defaut_anythinslider='".find_in_path("lib/anythingslider/css/anythingslider.css")."';";
     41        $js = '<script type="text/javascript">/*<![CDATA[*/'.$js.'/*]]>*/</script>';
     42
     43        $flux = $js
     44                . $flux
     45                . "<script type='text/javascript' src='".find_in_path('javascript/anythingslider.init.js')."'></script>";
    3346        return $flux;
    3447}
  • _plugins_/anythingslider/trunk/plugin.xml

    r67880 r67969  
    22        <nom>AnythingSlider</nom>
    33        <slogan>Faire d&#233;filer du contenu dans vos squelettes</slogan>
    4         <auteur>[Chris Coyier, Remy Sharp, Doug Neiner, ProLoser->https://github.com/ProLoser/AnythingSlider/wiki/Credits] pour le script AnythingSlider, [Joseph->http://www.spip-contrib.net/Joseph] pour la mise en plugin SPIP</auteur>
    5         <icon>images/anythingslider.png</icon>
     4        <auteur><i lang="en">Original by [Chris Coyier->http://css-tricks.com] and [many others->https://github.com/CSS-Tricks/AnythingSlider/wiki/Credits]</i>, incluant [AnythingSlider-Themes->https://github.com/CSS-Tricks/AnythingSlider-Themes], mis en plugin par [Joseph->http://www.spip-contrib.net/Joseph], [Cedric Morin Yterium->http://www.yterium.com] et [romy.tetue.net->http://romy.tetue.net]</auteur>
     5        <icon>prive/themes/spip/images/anythingslider.png</icon>
    66        <licence>GNU/GPL</licence>
    77        <version>2.0.0</version>
    88        <etat>dev</etat>
    9         <description>Ce plugin permet d'ins&#233;rer facilement le script jQuery [AnythingSlider->https://github.com/ProLoser/AnythingSlider/wiki] dans votre SPIP pour l’utiliser dans vos squelettes. Il peut &#234;tre &#233;galement &#234;tre utilis&#233; comme ressource pour d'autres plugins.</description>
    10         <lien>http://www.spip-contrib.net/?article3897</lien>
     9        <description>Ce plugin permet d'ins&#233;rer facilement le script jQuery [AnythingSlider->https://github.com/CSS-Tricks/AnythingSlider] dans votre SPIP pour l’utiliser dans vos squelettes. Il peut &#234;tre &#233;galement &#234;tre utilis&#233; comme ressource pour d'autres plugins.</description>
     10        <lien>http://www.spip-contrib.net/?article4283</lien>
    1111        <prefix>anythingslider</prefix>
    1212        <pipeline>
    13                 <nom>anythingslider_charger</nom>
     13                <nom>affichage_final</nom>
    1414                <inclure>anythingslider_pipelines.php</inclure>
    1515        </pipeline>
    1616        <pipeline>
    17                 <nom>insert_head</nom>
     17                <nom>header_prive</nom>
    1818                <inclure>anythingslider_pipelines.php</inclure>
    1919        </pipeline>
    20         <bouton id='anythingslider_2' parent='configuration'>
    21                 <icone>images/anythingslider-24.png</icone>
    22                 <titre>anythingslider:anythingslider</titre>
    23                 <url>configurer_anythingslider</url>
    24         </bouton>
    25         <bouton id='anythingslider' parent='bando_squelette'>
    26                 <icone>images/anythingslider-16.png</icone>
    27                 <titre>anythingslider:anythingslider</titre>
    28                 <url>configurer_anythingslider</url>
    29         </bouton>
    3020        <necessite id="SPIP" version="[2.1.0;3.0.99]" />
    3121        <categorie>multimedia</categorie>
  • _plugins_/anythingslider/trunk/saisies/themes_anythingslider.html

    r50153 r67969  
    33  - class : classe(s) css ajoutes au select
    44]
    5 [(#SET{dispos,[(#PIPELINE{anythingslider_charger,[(#CONFIG{anythingslider}|unserialize|sinon{#ARRAY})]})]})]
    65<select name="#ENV{nom}" id="champ_#ENV{nom}"[ class="(#ENV{class})"][ disabled="(#ENV{disable})"][ readonly="(#ENV{readonly})"]>
    7         <option value="default"[(#ENV{valeur,#ENV{defaut}}|=={default}|oui)selected="selected"]>Default</option>
    8         [(#VAL{theme-minimalist-round.css}|in_array{#GET{dispos}})<option value="minimalist-round"[(#ENV{valeur,#ENV{defaut}}|=={minimalist-round}|oui)selected="selected"]>Minimalist-Round</option>]
    9         [(#VAL{theme-minimalist-square.css}|in_array{#GET{dispos}})<option value="minimalist-square"[(#ENV{valeur,#ENV{defaut}}|=={minimalist-square}|oui)selected="selected"]>Minimalist-Square</option>]
    10         [(#VAL{theme-metallic.css}|in_array{#GET{dispos}})<option value="metallic"[(#ENV{valeur,#ENV{defaut}}|=={metallic}|oui)selected="selected"]>Metallic</option>]
    11         [(#VAL{theme-construction.css}|in_array{#GET{dispos}})<option value="construction"[(#ENV{valeur,#ENV{defaut}}|=={construction}|oui)selected="selected"]>Construction</option>]
    12         [(#VAL{theme-cs-portfolio.css}|in_array{#GET{dispos}})<option value="cs-portfolio"[(#ENV{valeur,#ENV{defaut}}|=={cs-portfolio}|oui)selected="selected"]>CS-Portfolio</option>]
    13         [(#VAL{theme-simple.css}|in_array{#GET{dispos}})<option value="simple"[(#ENV{valeur,#ENV{defaut}}|=={simple}|oui)selected="selected"]>Simple</option>]
     6        <option value=""[(#ENV{valeur,#ENV{defaut}}|=={default}|oui)selected="selected"]>AnythingSlider (base)</option>
     7        <option value="theme-construction"[(#ENV{valeur,#ENV{defaut}}|=={theme-construction}|oui)selected="selected"]>Construction</option>
     8        <option value="theme-cs-portfolio"[(#ENV{valeur,#ENV{defaut}}|=={theme-cs-portfolio}|oui)selected="selected"]>CS Portfolio</option>
     9        <option value="theme-default1"[(#ENV{valeur,#ENV{defaut}}|=={theme-default1}|oui)selected="selected"]>Default 1 (no image/CSS3)</option>
     10        <option value="theme-default2"[(#ENV{valeur,#ENV{defaut}}|=={theme-default2}|oui)selected="selected"]>Default 2 (images/CSS3)</option>
     11        <option value="theme-metallic"[(#ENV{valeur,#ENV{defaut}}|=={theme-metallic}|oui)selected="selected"]>Metallic</option>
     12        <option value="theme-mini-dark"[(#ENV{valeur,#ENV{defaut}}|=={theme-mini-dark}|oui)selected="selected"]>Mini (dark)</option>
     13        <option value="theme-mini-light"[(#ENV{valeur,#ENV{defaut}}|=={theme-mini-light}|oui)selected="selected"]>Mini (light)</option>
     14        <option value="theme-minimalist-round"[(#ENV{valeur,#ENV{defaut}}|=={theme-minimalist-round}|oui)selected="selected"]>Minimalist (round)</option>
     15        <option value="theme-minimalist-square"[(#ENV{valeur,#ENV{defaut}}|=={theme-minimalist-square}|oui)selected="selected"]>Minimalist (square)</option>
     16        <option value="theme-office"[(#ENV{valeur,#ENV{defaut}}|=={theme-office}|oui)selected="selected"]>Office</option>
     17        <option value="theme-ribbon"[(#ENV{valeur,#ENV{defaut}}|=={theme-ribbon}|oui)selected="selected"]>Ribbon</option>
     18        <option value="theme-shiny"[(#ENV{valeur,#ENV{defaut}}|=={theme-shiny}|oui)selected="selected"]>Shiny</option>
     19        <option value="theme-simple"[(#ENV{valeur,#ENV{defaut}}|=={theme-simple}|oui)selected="selected"]>Simple</option>
     20        <option value="theme-tabs-dark"[(#ENV{valeur,#ENV{defaut}}|=={theme-tabs-dark}|oui)selected="selected"]>Tabs (dark)</option>
     21        <option value="theme-tabs-light"[(#ENV{valeur,#ENV{defaut}}|=={theme-tabs-light}|oui)selected="selected"]>Tabs (light)</option>
    1422</select>
Note: See TracChangeset for help on using the changeset viewer.