Changeset 26863 in spip-zone


Ignore:
Timestamp:
Feb 22, 2009, 7:08:10 PM (10 years ago)
Author:
fil@…
Message:

une version pur javascript, compatibilite ascendante (plus ou moins) assuree

Location:
_plugins_/_stable_/socialtags
Files:
2 added
3 deleted
5 edited

Legend:

Unmodified
Added
Removed
  • _plugins_/_stable_/socialtags/fonds/cfg_socialtags.html

    r26854 r26863  
    1111<fieldset><legend>Social tags</legend>
    1212
     13<input type="hidden" name="tags[]" value="" />
     14
     15<?php
     16
     17        include_spip('socialtags_fonctions');
     18        $cfg = is_array($cfg = lire_config('socialtags/tags'))
     19                ? $cfg : array();
     20
     21        foreach (socialtags_liste() as $service) {
     22                $t = $service['titre'];
     23                $u = $service['url'];
     24                $a = $service['lesauteurs'];
     25                $d = $service['descriptif'];
     26
     27                $image = find_in_path('images/'.$a.'.png');
     28                $checked = in_array($a, $cfg)
     29                        ? ' checked="checked"' : '';
     30
     31                echo "
    1332<label>
    14 <img src="[(#CHEMIN{images/digg.png})]" title="Digg" alt="Digg" />
    15 <input type="checkbox" name="digg" [checked="(#ENV{digg}|?{checked})"] id="digg" />[(#ENV{digg}|?{[(#ENV{digg}|?{<strong>})]})]Digg[(#ENV{digg}|?{[(#ENV{digg}|?{</strong>})]})]</label>
    16 <input type="hidden" name="url_digg" value="http://digg.com/submit?phase=2&amp;url=%u&amp;title=%t"/>
     33<img src='{$image}' title='{$t}' alt='' />
     34<input type='checkbox' name='tags[]' value='{$a}'{$checked} />
     35" . ($checked ? "<strong>$t</strong>" : $t) ." &nbsp; {$d}
     36</label>
     37<br />
     38";
    1739
    18 
    19 <br />
    20 <label>
    21 <img src="[(#CHEMIN{images/delicious.png})]" title="Del.icio.us" alt="Del.icio.us" />
    22 <input type="checkbox" name="delicious" [checked="(#ENV{delicious}|?{checked})"] id="delicious" />[(#ENV{delicious}|?{<strong>})]Delicious[(#ENV{delicious}|?{</strong>})]</label>
    23 <input type="hidden" name="url_delicious" value="http://delicious.com/save?url=%u&amp;title=%t&amp;notes=%d"/>
    24 
    25 
    26 <br />
    27 <label>
    28 <img src="[(#CHEMIN{images/facebook.png})]" title="Facebook" alt="Facebook" />
    29 <input type="checkbox" name="facebook" [checked="(#ENV{facebook}|?{checked})"] id="facebook" />[(#ENV{facebook}|?{<strong>})]Facebook[(#ENV{facebook}|?{</strong>})]</label>
    30 <input type="hidden" name="url_facebook" value="http://www.facebook.com/sharer.php?u=%u&amp;t=%t"/>
    31 
    32 
    33 <br />
    34 <label>
    35 <img src="[(#CHEMIN{images/google.png})]" title="Google" alt="Google" />
    36 <input type="checkbox" name="google" [checked="(#ENV{google}|?{checked})"] id="google" />[(#ENV{google}|?{<strong>})]Google[(#ENV{google}|?{</strong>})]</label>
    37 <input type="hidden" name="url_google" value="http://www.google.com/bookmarks/mark?op=edit&amp;bkmk=%u&amp;title=%t"/>
    38 
    39 
    40 <br />
    41 <label>
    42 <img src="[(#CHEMIN{images/technorati.png})]" title="Technorati" alt="Technorati" />
    43 <input type="checkbox" name="technorati" [checked="(#ENV{technorati}|?{checked})"] id="technorati" />[(#ENV{technorati}|?{<strong>})]Technorati[(#ENV{technorati}|?{</strong>})]</label>
    44 <input type="hidden" name="url_technorati" value="http://technorati.com/faves?add=%u"/>
    45 
    46 
    47 <br />
    48 <label>
    49 <img src="[(#CHEMIN{images/live.png})]" title="Live" alt="Live" />
    50 <input type="checkbox" name="live" [checked="(#ENV{live}|?{checked})"] id="live" />[(#ENV{live}|?{<strong>})]Live[(#ENV{live}|?{</strong>})]</label>
    51 <input type="hidden" name="url_live" value="https://favorites.live.com/quickadd.aspx?marklet=1&amp;add=%u&amp;title=%t"/>
    52 
    53 
    54 <br />
    55 <label>
    56 <img src="[(#CHEMIN{images/myspace.png})]" title="MySpace" alt="MySpace" />
    57 <input type="checkbox" name="myspace" [checked="(#ENV{myspace}|?{checked})"] id="myspace" />[(#ENV{myspace}|?{<strong>})]MySpace[(#ENV{myspace}|?{</strong>})]</label>
    58 <input type="hidden" name="url_myspace" value="http://www.myspace.com/Modules/PostTo/Pages/?u=%u&amp;t=%t"/>
    59 
    60 
    61 <br />
    62 <label>
    63 <img src="[(#CHEMIN{images/scoopeo.png})]" title="Scoopeo" alt="Scoopeo" />
    64 <input type="checkbox" name="scoopeo" [checked="(#ENV{scoopeo}|?{checked})"] id="scoopeo" />[(#ENV{scoopeo}|?{<strong>})]Scoopeo[(#ENV{scoopeo}|?{</strong>})]</label>
    65 <input type="hidden" name="url_scoopeo" value="http://www.scoopeo.com/scoop/new?newurl=%u&amp;title=%t"/>
    66 
    67 
    68 <br />
    69 <label>
    70 <img src="[(#CHEMIN{images/wikio.png})]" title="Wikio" alt="Wikio" />
    71 <input type="checkbox" name="wikio" [checked="(#ENV{wikio}|?{checked})"] id="wikio" />[(#ENV{wikio}|?{<strong>})]Wikio[(#ENV{wikio}|?{</strong>})]</label>
    72 <input type="hidden" name="url_wikio" value="http://www.wikio.com/vote?newurl=%u"/>
    73 
    74 
    75 <br />
    76 <label>
    77 <img src="[(#CHEMIN{images/furl.png})]" title="Furl" alt="Furl" />
    78 <input type="checkbox" name="furl" [checked="(#ENV{furl}|?{checked})"] id="furl" />[(#ENV{furl}|?{<strong>})]Furl[(#ENV{furl}|?{</strong>})]</label>
    79 <input type="hidden" name="url_furl" value="http://www.furl.net/storeIt.jsp?add=%u&amp;t=%t"/>
    80 
    81 
    82 <br />
    83 <label>
    84 <img src="[(#CHEMIN{images/blogmarks.png})]" title="Blogmarks" alt="Blogmarks" />
    85 <input type="checkbox" name="blogmarks" [checked="(#ENV{blogmarks}|?{checked})"] id="blogmarks" />[(#ENV{blogmarks}|?{<strong>})]Blogmarks[(#ENV{blogmarks}|?{</strong>})]</label>
    86 <input type="hidden" name="url_blogmarks" value="http://blogmarks.net/my/new.php?mini=1&amp;url=%u&amp;title=%t"/>
    87 
    88 
    89 <br />
    90 <label>
    91 <img src="[(#CHEMIN{images/reddit.png})]" title="Reddit" alt="Reddit" />
    92 <input type="checkbox" name="reddit" [checked="(#ENV{reddit}|?{checked})"] id="reddit" />[(#ENV{reddit}|?{<strong>})]Reddit[(#ENV{reddit}|?{</strong>})]</label>
    93 <input type="hidden" name="url_reddit" value="http://reddit.com/submit?url=%u&amp;title=%t"/>
    94 
    95 
    96 <br />
    97 <label>
    98 <img src="[(#CHEMIN{images/misterwong.png})]" title="Mister wong" alt="Mister wong" />
    99 <input type="checkbox" name="misterwong" [checked="(#ENV{misterwong}|?{checked})"] id="misterwong" />[(#ENV{misterwong}|?{<strong>})]Mister wong[(#ENV{misterwong}|?{</strong>})]</label>
    100 <input type="hidden" name="url_misterwong" value="http://www.mister-wong.com/addurl/?bm_url=%u&amp;bm_description=%t"/>
    101 
    102 
    103 <br />
    104 <label>
    105 <img src="[(#CHEMIN{images/viadeo.png})]" title="Viadeo" alt="Viadeo" />
    106 <input type="checkbox" name="viadeo" [checked="(#ENV{viadeo}|?{checked})"] id="viadeo" />[(#ENV{viadeo}|?{<strong>})]Viadeo[(#ENV{viadeo}|?{</strong>})]</label>
    107 <input type="hidden" name="url_viadeo" value="http://www.viadeo.com/shareit/share/?url=%u&amp;title=%t"/>
    108 
    109 <br />
    110 <label>
    111 <img src="[(#CHEMIN{images/stumbleupon.png})]" title="StumbleUpon" alt="StumbleUpon" />
    112 <input type="checkbox" name="stumbleupon" [checked="(#ENV{stumbleupon}|?{checked})"] id="stumbleupon" />[(#ENV{stumbleupon}|?{<strong>})]StumbleUpon[(#ENV{stumbleupon}|?{</strong>})]</label>
    113 <input type="hidden" name="url_stumbleupon" value="http://www.stumbleupon.com/submit?url=%u&amp;title=%t""/>
    114 
    115 <br />
    116 <label>
    117 <img src="[(#CHEMIN{images/slashdot.png})]" title="Slashdot" alt="slashdot" />
    118 <input type="checkbox" name="slashdot" [checked="(#ENV{slashdot}|?{checked})"] id="slashdot" />[(#ENV{slashdot}|?{<strong>})]Slashdot[(#ENV{slashdot}|?{</strong>})]</label>
    119 <input type="hidden" name="url_slashdot" value="http://slashdot.org/bookmark.pl?url=%u&amp;title=%t"/>
    120 
    121 <br />
    122 <label>
    123 <img src="[(#CHEMIN{images/blogmemes.png})]" title="BlogMemes" alt="blogmemes" />
    124 <input type="checkbox" name="blogmemes" [checked="(#ENV{blogmemes}|?{checked})"] id="blogmemes" />[(#ENV{blogmemes}|?{<strong>})]BlogMemes[(#ENV{blogmemes}|?{</strong>})]</label>
    125 <input type="hidden" name="url_blogmemes" value="http://www.blogmemes.fr/post.php?url=%u&amp;title=%t" />
    126 
    127 <br />
    128 <label>
    129 <img src="[(#CHEMIN{images/buzzyahoo.png})]" title="Yahoo! Buzz" alt="Yahoo! Buzz" />
    130 <input type="checkbox" name="buzzyahoo" [checked="(#ENV{buzzyahoo}|?{checked})"] id="buzzyahoo" />[(#ENV{buzzyahoo}|?{<strong>})]Yahoo! Buzz[(#ENV{buzzyahoo}|?{</strong>})]</label>
    131 <input type="hidden" name="url_buzzyahoo" value="http://buzz.yahoo.com/submit?submitUrl=%u&amp;submitHeadline=%t&amp;submitSummary=%d" />
    132 
    133 <br />
    134 <label>
    135 <img src="[(#CHEMIN{images/propeller.png})]" title="Propeller" alt="Propeller" />
    136 <input type="checkbox" name="propeller" [checked="(#ENV{propeller}|?{checked})"] id="propeller" />[(#ENV{propeller}|?{<strong>})]Propeller[(#ENV{propeller}|?{</strong>})]</label>
    137 <input type="hidden" name="url_propeller" value="http://www.propeller.com/submit/?url=%u" />
    138 
     40        }
     41?>
    13942</fieldset>
    14043
    141 <fieldset><legend>Insertion dans les pages</legend>
     44<fieldset><legend>Insertion dans les pages :</legend>
    14245
    143 <label><input type="radio" name="jshead" value=""[ checked="(#ENV{jshead}|?{'',checked})"] /> Insertion par noisette (modifier le squelette).</label>
    144 <br />
    145 <label><input type="radio" name="jshead" value="1"[ checked="(#ENV{jshead}|=={1}|?{checked})"] /> Insertion javascript.</label>
    14646<br />Ins&#233;rer le bloc social-tags en-dessous du bloc suivant :
    14747<br />
     
    15353<dt><tt>.page_article .cartouche:first</tt></dt>
    15454<dd>Sous le bloc de titre des pages article</dd>
     55<dt><tt>#socialtags</tt></dt>
     56<dd>Sous la div nomm&#233;e id=socialtags</dd>
    15557</dl>
    15658</fieldset>
  • _plugins_/_stable_/socialtags/noisettes/socialtags.html

    r23634 r26863  
    1 [(#INCLURE{fond=noisettes/socialtags_articles}{id_article})]
    2 [(#INCLURE{fond=noisettes/socialtags_rubriques}{id_rubrique})]
    3 [(#INCLURE{fond=noisettes/socialtags_breves}{id_breve})]
     1[(#REM) Compatibilite ascendante avec l'ancienne noisette ]
     2<div id="socialtags"></div>
     3
  • _plugins_/_stable_/socialtags/plugin.xml

    r26848 r26863  
    77        </auteur>
    88        <version>
    9         0.4
     9        0.5
    1010        </version>
    1111        <etat>
  • _plugins_/_stable_/socialtags/socialtags.js.html

    r26853 r26863  
    44;(function($) { $(function(){
    55
    6 var socialtags = [
    7         [(#CONFIG{socialtags/digg}|oui) {
    8                 n: 'Digg', i:'[(#CHEMIN{images/digg.png})]', u:'[(#CONFIG{socialtags/url_digg})]' },
    9         ][(#CONFIG{socialtags/delicious}|oui)   {
    10                 n: 'Del.icio.us', i:'[(#CHEMIN{images/delicious.png})]', u:'[(#CONFIG{socialtags/url_delicious})]' },
    11         ][(#CONFIG{socialtags/facebook}|oui)    {
    12                 n: 'Facebook', i:'[(#CHEMIN{images/facebook.png})]', u:'[(#CONFIG{socialtags/url_facebook})]' },
    13         ][(#CONFIG{socialtags/google}|oui)      {
    14                 n: 'Google Bookmarks', i:'[(#CHEMIN{images/google.png})]', u:'[(#CONFIG{socialtags/url_google})]' },
    15         ][(#CONFIG{socialtags/technorati}|oui)  {
    16                 n: 'Technorati', i:'[(#CHEMIN{images/technorati.png})]', u:'[(#CONFIG{socialtags/url_technorati})]' },
    17         ][(#CONFIG{socialtags/live}|oui)        {
    18                 n: 'Live', i:'[(#CHEMIN{images/live.png})]', u:'[(#CONFIG{socialtags/url_live})]' },
    19         ][(#CONFIG{socialtags/myspace}|oui)     {
    20                 n: 'Myspace', i:'[(#CHEMIN{images/myspace.png})]', u:'[(#CONFIG{socialtags/url_myspace})]' },
    21         ][(#CONFIG{socialtags/scoopeo}|oui)     {
    22                 n: 'Scoopeo', i:'[(#CHEMIN{images/scoopeo.png})]', u:'[(#CONFIG{socialtags/url_scoopeo})]' },
    23         ][(#CONFIG{socialtags/wikio}|oui)       {
    24                 n: 'Wikio', i:'[(#CHEMIN{images/wikio.png})]', u:'[(#CONFIG{socialtags/url_wikio})]' },
    25         ][(#CONFIG{socialtags/furl}|oui)        {
    26                 n: 'Furl', i:'[(#CHEMIN{images/furl.png})]', u:'[(#CONFIG{socialtags/url_furl})]' },
    27         ][(#CONFIG{socialtags/blogmarks}|oui)   {
    28                 n: 'Blogmarks', i:'[(#CHEMIN{images/blogmarks.png})]', u:'[(#CONFIG{socialtags/url_blogmarks})]' },
    29         ][(#CONFIG{socialtags/reddit}|oui)      {
    30                 n: 'Reddit', i:'[(#CHEMIN{images/reddit.png})]', u:'[(#CONFIG{socialtags/url_reddit})]' },
    31         ][(#CONFIG{socialtags/misterwong}|oui)  {
    32                 n: 'Mister wong', i:'[(#CHEMIN{images/misterwong.png})]', u:'[(#CONFIG{socialtags/url_misterwong})]' },
    33         ][(#CONFIG{socialtags/viadeo}|oui)      {
    34                 n: 'Viadeo', i:'[(#CHEMIN{images/viadeo.png})]', u:'[(#CONFIG{socialtags/url_viadeo})]' },
    35         ][(#CONFIG{socialtags/stumbleupon}|oui) {
    36                 n: 'StumbleUpon', i:'[(#CHEMIN{images/stumbleupon.png})]', u:'[(#CONFIG{socialtags/url_stumbleupon})]' },
    37         ][(#CONFIG{socialtags/slashdot}|oui)    {
    38                 n: 'Slashdot', i:'[(#CHEMIN{images/slashdot.png})]', u:'[(#CONFIG{socialtags/url_slashdot})]' },
    39         ][(#CONFIG{socialtags/blogmemes}|oui)   {
    40                 n: 'Blogmemes', i:'[(#CHEMIN{images/blogmemes.png})]', u:'[(#CONFIG{socialtags/url_blogmemes})]' },
    41         ][(#CONFIG{socialtags/buzzyahoo}|oui)   {
    42                 n: 'Yahoo! Buzz', i:'[(#CHEMIN{images/buzzyahoo.png})]', u:'[(#CONFIG{socialtags/url_buzzyahoo})]' },
    43         ][(#CONFIG{socialtags/propeller}|oui)   {
    44                 n: 'Propeller', i:'[(#CHEMIN{images/propeller.png})]', u:'[(#CONFIG{socialtags/url_propeller})]' },
    45         ]       {}
    46 ];
     6var socialtags =
     7        [(#CONFIG{socialtags/tags}|socialtags_json)];
    478
    489var title = $('title').text() ||'';
  • _plugins_/_stable_/socialtags/socialtags_fonctions.php

    r26851 r26863  
    11<?php
    2 if (!defined('_DIR_PLUGIN_SOCIALTAGS')){ // defini automatiquement par SPIP 1.9.2
    3         $p=explode(basename(_DIR_PLUGINS)."/",str_replace('\\','/',realpath(dirname(__FILE__))));
    4         define('_DIR_PLUGIN_SOCIALTAGS',(_DIR_PLUGINS.end($p)."/"));
    5 }
    62 
    73//
     
    117  $flux .= '<link rel="stylesheet" type="text/css" href="'.find_in_path('socialtags.css').'" media="all" />';
    128
    13   if (lire_config('socialtags/jshead')) {
    14         $jsFile = generer_url_public('socialtags.js');
    15         $flux .= "<script src='$jsFile' type='text/javascript'></script>";
    16   }
     9  $jsFile = generer_url_public('socialtags.js');
     10  $flux .= "<script src='$jsFile' type='text/javascript'></script>";
    1711
    1812  return $flux;
     
    2014
    2115
     16// La liste est stockee en format RSS
     17function socialtags_liste() {
     18        include_spip('inc/syndic');
     19        lire_fichier(find_in_path('socialtags.xml'), $rss);
     20        return analyser_backend($rss);
     21}
     22
    2223?>
Note: See TracChangeset for help on using the changeset viewer.