[SPIP Zone] r4215 - in /_plugins_/splickrbox: head.php inc-splickrbox.html plugin.xml prototype_js.html rico_js.html

Author: booz@rezo.net
Date: Tue Jul 25 17:50:31 2006
New Revision: 4215

Log:
le badge spip passe en jquery, c plus in :slight_smile:

Removed:
    _plugins_/splickrbox/prototype_js.html
    _plugins_/splickrbox/rico_js.html
Modified:
    _plugins_/splickrbox/head.php
    _plugins_/splickrbox/inc-splickrbox.html
    _plugins_/splickrbox/plugin.xml

Modified: _plugins_/splickrbox/head.php

--- _plugins_/splickrbox/head.php (original)
+++ _plugins_/splickrbox/head.php Tue Jul 25 17:50:31 2006
@@ -2,10 +2,7 @@

   function Splickr_insert_head($flux){
   $flux .= '<script type="text/javascript" src="'
- .generer_url_public('prototype_js').'"></script>';
- $flux .= '<script type="text/javascript" src="'
- .generer_url_public('rico_js').'"></script>';
- return $flux;
+ .find_in_path('splickrbox.js').'"></script>';
   }

?>
\ No newline at end of file

Modified: _plugins_/splickrbox/inc-splickrbox.html

--- _plugins_/splickrbox/inc-splickrbox.html (original)
+++ _plugins_/splickrbox/inc-splickrbox.html Tue Jul 25 17:50:31 2006
@@ -1,72 +1,67 @@
-<div style="position:relative">
-
- <script>
- i=0;
+<script type="text/javascript">
+$(document).ready(function(){
   
- window.onload = getIt;
+cptj =0;
+max = $("td.image img").size();
    
- function getIt(){
+while(cptj <= max) {
+setTimeout('$("td.image img").splicker('+cptj+');',6000 + cptj*6000);
+//if(cptj==max) cptj=-1;
+cptj++;
+}
   
- //$('statusMsg').innerHTML += 'get'+i+'->';
- images = document.getElementsByTagName('td');
- if(i==0){
- a = images[i].firstChild ;
- $('changeMe').appendChild(a);
- a.style.width = '100%';
- a.style.height = '100%';
+});
     
+$.fn.splicker = function(i) {
+image = this.get(i).cloneNode(true) ;
+href = this.get(i).parentNode.href;
+$("div#changeMe").append(image);
+$("div#changeMe img").wrap("<a href=\""+href+"\">","</a>").click(function(){showLightbox(href);});
+$("div#changeMe img").showCustom("slow",70);
+if(i>=0 && i<=2){
+$("div#changeMe").css("top","70px");
     }
- //$('statusMsg').innerHTML += 'pecho'+i+'->';
- toggleEffect();
+if(i>=3 && i<=5){
+$("div#changeMe").css("top","35px");
+}
+if(i>=6 && i<=8){
+$("div#changeMe").css("top","0px");
   }
     
- function toggleEffect() {
- //$('statusMsg').innerHTML += 'tog'+i+'->';
+setTimeout('$("div#changeMe img").hide_propre();',5000);
+}
  
- var effectDone = false;
- if ( !effectDone ) {
- setTimeout( "startEffect();", 10000 );
- effectDone = true;
- setTimeout( "resetEffect();effectDone = false;toggleEffect();", 20000 );
         
- }
- }
+$.fn.hide_propre = function() {
+this.hide("slow", function(){
+ $(this).remove();
+ });

- function startEffect() {
- new Rico.Effect.SizeAndPosition( $('changeMe'), null, null, 35, 35, 1000, 10, '' );
    }

- function resetEffect() {
- // $('statusMsg').innerHTML += 'reset'+i+'->';
- var res = new Array();
- b = a ;
- i++;
- //$('statusMsg').innerHTML += 'choppe'+i+'->';
- a = images[i].firstChild ;
- a.style.width = '100%';
- a.style.height = '100%';
- $('changeMe').appendChild(a);
- b.style.width = '35px';
- b.style.height = '35px';
- images[i].appendChild(b);
- //images[i].appendChild(images[0].firstChild);
+$.fn.showCustom = function(a,w,o) {
+o = $.speed(a,o);
+return this.each(function(){
+(new fx.Opacity(this,o)).show();
+(new fx.Width(this,o)).custom(0,w);
+(new fx.Height(this,o)).custom(0,w);
+});
+};
      
- $('changeMe').style.width = '70px';
- $('changeMe').style.height ='70px';
- $('changeMe').style.top = '0px';
- $('changeMe').style.left = '0px';
- }
</script>

-<div id="changeMe" onClick="javascript:toggleEffect()" style="position:absolute;left:0px;top:0px;width:70px;height:70px;background-color:#000">
+
+<div style="position:relative">
+
+<div id="changeMe" style="position:absolute;left:0px;top:0px;width:70px;height:70px;">
</div>

       <B_flickr>
       <table cellpadding="0" cellspacing="0"><tr>
       <BOUCLE_flickr(DOCUMENTS){!par date}{extension==jpg|png|gif}{0,12}>
- [<td class="image" style="border:[(#COMPTEUR_BOUCLE|alterner{0px 0px 1px 0px , 0px 0px 1px 1px,0px 0px 1px 1px})] solid #fff">(#FICHIER|copie_locale|image_masque{carre.png}|inserer_attribut{style,'width:35px;height:35px'})</td>]
+ <td class="image" <a href="#FICHIER" rel="lightbox[diap]">[(#FICHIER|copie_locale|image_masque{carre.png}|inserer_attribut{style,'width:35px;height:35px'})]</a></td>
       [(#COMPTEUR_BOUCLE|alterner{'','',</tr><tr>})]
       </BOUCLE_flickr>
       </tr></table>

Modified: _plugins_/splickrbox/plugin.xml

--- _plugins_/splickrbox/plugin.xml (original)
+++ _plugins_/splickrbox/plugin.xml Tue Jul 25 17:50:31 2006
@@ -6,13 +6,13 @@
   BoOz (booz@rezo.net)
   </auteur>
   <version>
- 0.1
+ 0.2
   </version>
   <etat>
- test
+ dev
   </etat>
   <description>
- Noisette pour afficher les dernieres photos à la Flickr (le "badge") , tout ca en javascript via <code>#INSERT_HEAD</code>. <br /> Mettre <code><INCLURE{fond=inc-splickrbox}></code> dans un squelette, et hop :slight_smile:
+ Noisette pour afficher les dernieres photos à la Flickr (le "badge") , tout ca en javascript via <code>#INSERT_HEAD</code> et le plugin Jquery. <br /> Mettre <code><INCLURE{fond=inc-splickrbox}></code> dans un squelette, et hop :slight_smile:

   </description>
   <prefix>

Removed: _plugins_/splickrbox/prototype_js.html

--- _plugins_/splickrbox/prototype_js.html (original)
+++ _plugins_/splickrbox/prototype_js.html (removed)
@@ -1,1782 +0,0 @@
-#HTTP_HEADER{Content-Type: text/javascript}
-/* Prototype JavaScript framework, version 1.4.0
- * (c) 2005 Sam Stephenson <sam@conio.net>
- *
- * Prototype is freely distributable under the terms of an MIT-style license.
- * For details, see the Prototype web site: http://prototype.conio.net/
- *
-/*--------------------------------------------------------------------------*/
-
-var Prototype = {
- Version: '1.4.0',
- ScriptFragment: '(?:<script.*?>)((\n|\r|.)*?)(?:<\/script>)',
-
- emptyFunction: function() {},
- K: function(x) {return x}
-}
-
-var Class = {
- create: function() {
- return function() {
- this.initialize.apply(this, arguments);
- }
- }
-}
-
-var Abstract = new Object();
-
-Object.extend = function(destination, source) {
- for (property in source) {
- destination[property] = source[property];
- }
- return destination;
-}
-
-Object.inspect = function(object) {
- try {
- if (object == undefined) return 'undefined';
- if (object == null) return 'null';
- return object.inspect ? object.inspect() : object.toString();
- } catch (e) {
- if (e instanceof RangeError) return '...';
- throw e;
- }
-}
-
-Function.prototype.bind = function() {
- var __method = this, args = $A(arguments), object = args.shift();
- return function() {
- return __method.apply(object, args.concat($A(arguments)));
- }
-}
-
-Function.prototype.bindAsEventListener = function(object) {
- var __method = this;
- return function(event) {
- return __method.call(object, event || window.event);
- }
-}
-
-Object.extend(Number.prototype, {
- toColorPart: function() {
- var digits = this.toString(16);
- if (this < 16) return '0' + digits;
- return digits;
- },
-
- succ: function() {
- return this + 1;
- },
-
- times: function(iterator) {
- $R(0, this, true).each(iterator);
- return this;
- }
-});
-
-var Try = {
- these: function() {
- var returnValue;
-
- for (var i = 0; i < arguments.length; i++) {
- var lambda = arguments[i];
- try {
- returnValue = lambda();
- break;
- } catch (e) {}
- }
-
- return returnValue;
- }
-}
-
-/*--------------------------------------------------------------------------*/
-
-var PeriodicalExecuter = Class.create();
-PeriodicalExecuter.prototype = {
- initialize: function(callback, frequency) {
- this.callback = callback;
- this.frequency = frequency;
- this.currentlyExecuting = false;
-
- this.registerCallback();
- },
-
- registerCallback: function() {
- setInterval(this.onTimerEvent.bind(this), this.frequency * 1000);
- },
-
- onTimerEvent: function() {
- if (!this.currentlyExecuting) {
- try {
- this.currentlyExecuting = true;
- this.callback();
- } finally {
- this.currentlyExecuting = false;
- }
- }
- }
-}
-
-/*--------------------------------------------------------------------------*/
-
-function $() {
- var elements = new Array();
-
- for (var i = 0; i < arguments.length; i++) {
- var element = arguments[i];
- if (typeof element == 'string')
- element = document.getElementById(element);
-
- if (arguments.length == 1)
- return element;
-
- elements.push(element);
- }
-
- return elements;
-}
-Object.extend(String.prototype, {
- stripTags: function() {
- return this.replace(/<\/?[^>]+>/gi, '');
- },
-
- stripScripts: function() {
- return this.replace(new RegExp(Prototype.ScriptFragment, 'img'), '');
- },
-
- extractScripts: function() {
- var matchAll = new RegExp(Prototype.ScriptFragment, 'img');
- var matchOne = new RegExp(Prototype.ScriptFragment, 'im');
- return (this.match(matchAll) || []).map(function(scriptTag) {
- return (scriptTag.match(matchOne) || ['', ''])[1];
- });
- },
-
- evalScripts: function() {
- return this.extractScripts().map(eval);
- },
-
- escapeHTML: function() {
- var div = document.createElement('div');
- var text = document.createTextNode(this);
- div.appendChild(text);
- return div.innerHTML;
- },
-
- unescapeHTML: function() {
- var div = document.createElement('div');

[... 4441 lines stripped ...]