From e43c6bda7ae684754761715d12ea0d73def52d31 Mon Sep 17 00:00:00 2001 From: Julien G Date: Mon, 1 Jul 2013 02:51:17 +0200 Subject: [PATCH] Fixtures --- jquery.plugins/jquery.analogueClock.mlklc.js | 42 ++++++------ jquery.plugins/jquery.analogueClock2.css | 44 ++++++------- jquery.plugins/jquery.analogueClock2.html | 58 ++++++++--------- jquery.plugins/jquery.analogueClock2.mlklc.js | 4 +- .../jquery.browsercssprefix.mlklc.js | 44 ++++++------- jquery.plugins/jquery.center.mlklc.js | 50 +++++++-------- jquery.plugins/jquery.colonizr.css | 11 ++++ jquery.plugins/jquery.colonizr.js | 39 +++++++---- jquery.plugins/jquery.colonizr.min.js | 9 ++- jquery.plugins/jquery.disableselect.mlklc.js | 24 +++---- jquery.plugins/jquery.scrollScreen.js | 2 +- jquery.plugins/jquery.scrollScreen.min.js | 14 ++-- jquery.plugins/jquery.selectrange.mlklc.js | 26 ++++---- jquery.plugins/jquery.styleswitch.mlklc.js | 64 +++++++++---------- jquery.plugins/jquery.tools.mlklc.js | 12 ++-- jquery.plugins/jquery.tooltips.js | 4 +- 16 files changed, 234 insertions(+), 213 deletions(-) diff --git a/jquery.plugins/jquery.analogueClock.mlklc.js b/jquery.plugins/jquery.analogueClock.mlklc.js index dd71b3d..7c5b4fd 100644 --- a/jquery.plugins/jquery.analogueClock.mlklc.js +++ b/jquery.plugins/jquery.analogueClock.mlklc.js @@ -2,30 +2,30 @@ ///// Code mixing by Molokoloco ..... 2011 ......... [EVER IN PROGRESS (it's not done yet)] //////////// //////////////////////////////////////////////////////////////////////////////////////////////////// */ /* - // Pixel polished jQuery & CSS3 analogue clock - // by @molokoloco 08/10/2011 - // Infos : http://www.b2bweb.fr/molokoloco/pixels-polished-jquery-css3-analogue-clock/ - // jsFiddle : http://jsfiddle.net/molokoloco/ajcRz/ + // Pixel polished jQuery & CSS3 analogue clock + // by @molokoloco 08/10/2011 + // Infos : http://www.b2bweb.fr/molokoloco/pixels-polished-jquery-css3-analogue-clock/ + // jsFiddle : http://jsfiddle.net/molokoloco/ajcRz/ - // HTML - - + // HTML + + -
- -
+
+ +
- // USAGE ; - $('div#clock').analogueClock({digitBoxWidth:18, withDigitalTime:false}); + // USAGE ; + $('div#clock').analogueClock({digitBoxWidth:18, withDigitalTime:false}); */ diff --git a/jquery.plugins/jquery.analogueClock2.css b/jquery.plugins/jquery.analogueClock2.css index 7758861..7272e2b 100644 --- a/jquery.plugins/jquery.analogueClock2.css +++ b/jquery.plugins/jquery.analogueClock2.css @@ -2,7 +2,7 @@ // Pixel polished jQuery & CSS3 analogue clock // by @molokoloco 08/10/2011 - //> Colors : easy to change, Sizes and positions : more tricky + //> Colors : easy to change, Sizes and positions : more tricky // Colors are based on a white semi-transparent theme : // replace "255,255,255" by "0,0,0" to blackify... or wathever you want // Mostly elements that need to be centered... are centered in JS, @@ -24,12 +24,12 @@ div#clock { border-radius:50%; /* (---MOD---) All round ? */ background:grey; background:rgba(0,0,0,0.1); - transition:all 250ms ease-in-out; /* for mouseover effect */ + transition:all 250ms ease-in-out; /* for mouseover effect */ -webkit-transition:all 250ms ease-in-out; -moz-transition:all 250ms ease-in-out; -ms-transition:all 250ms ease-in-out; -o-transition:all 250ms ease-in-out; - box-shadow:0 2px 6px rgba(0,0,0,0.3); + box-shadow:0 2px 6px rgba(0,0,0,0.3); -o-box-shadow:0 2px 6px rgba(0,0,0,0.3); -webkit-box-shadow:0 2px 6px rgba(0,0,0,0.3); -moz-box-shadow:0 2px 6px rgba(0,0,0,0.3); @@ -95,24 +95,24 @@ div.sec,div.min,div.hour { width:4px; /* (---MOD---) */ z-index:12; } - - div.sec div.clockwise { top:18px; } /* (---MOD---) dist from clock border == clockwise height */ - div.min div.clockwise { top:26px; } /* (---MOD---) */ - div.hour div.clockwise { top:32px; } /* (---MOD---) */ - - div.clockwise { - position:absolute; - left:0; right:0; /* parents sec,min,hour width */ - background:#FFF; - background:rgba(255,255,255,0.4); - border-radius:2px; - box-shadow:0 0 3px rgba(0,0,0,0.25); - -moz-box-shadow:0 0 3px rgba(0,0,0,0.25); - -webkit-box-shadow:0 0 3px rgba(0,0,0,0.25); - -ms-box-shadow:0 0 3px rgba(0,0,0,0.25); - -o-box-shadow:0 0 3px rgba(0,0,0,0.25); - } - + + div.sec div.clockwise { top:18px; } /* (---MOD---) dist from clock border == clockwise height */ + div.min div.clockwise { top:26px; } /* (---MOD---) */ + div.hour div.clockwise { top:32px; } /* (---MOD---) */ + + div.clockwise { + position:absolute; + left:0; right:0; /* parents sec,min,hour width */ + background:#FFF; + background:rgba(255,255,255,0.4); + border-radius:2px; + box-shadow:0 0 3px rgba(0,0,0,0.25); + -moz-box-shadow:0 0 3px rgba(0,0,0,0.25); + -webkit-box-shadow:0 0 3px rgba(0,0,0,0.25); + -ms-box-shadow:0 0 3px rgba(0,0,0,0.25); + -o-box-shadow:0 0 3px rgba(0,0,0,0.25); + } + div.digit, div.time, div.date { text-rendering:optimizeLegibility; font-smoothing:always; @@ -159,7 +159,7 @@ div.time, div.date { color:#000; color:rgba(0,0,0,0.3); } - div.date { top:70px; } /* (---MOD---) */ + div.date { top:70px; } /* (---MOD---) */ /* ------- Fancy CSS3 background example ------ */ /* http://leaverou.me/css3patterns/#cicada-stripes */ diff --git a/jquery.plugins/jquery.analogueClock2.html b/jquery.plugins/jquery.analogueClock2.html index e778de2..b036ceb 100644 --- a/jquery.plugins/jquery.analogueClock2.html +++ b/jquery.plugins/jquery.analogueClock2.html @@ -2,36 +2,36 @@ - - - - jQuery Analogue Clock - - - - + + + + jQuery Analogue Clock + + + + -
- -
- - - +
+ +
+ + + diff --git a/jquery.plugins/jquery.analogueClock2.mlklc.js b/jquery.plugins/jquery.analogueClock2.mlklc.js index b823532..f4c998e 100644 --- a/jquery.plugins/jquery.analogueClock2.mlklc.js +++ b/jquery.plugins/jquery.analogueClock2.mlklc.js @@ -10,7 +10,7 @@ script src="http://code.jquery.com/jquery-latest.js"
-
+
diff --git a/jquery.plugins/jquery.browsercssprefix.mlklc.js b/jquery.plugins/jquery.browsercssprefix.mlklc.js index b9b39ce..d922085 100644 --- a/jquery.plugins/jquery.browsercssprefix.mlklc.js +++ b/jquery.plugins/jquery.browsercssprefix.mlklc.js @@ -2,26 +2,26 @@ // JS HTML5 cssPrefix By molokoloco - http://www.b2bweb.fr - 2011 // /////////////////////////////////////////////////////////////////////// /* - // A function to get browser specific CSS style name properties... - // eg. "MozBorderRadius" or "WebkitTransform" ... - // Playground here : http://jsfiddle.net/molokoloco/f6Z3D/ - // Source here : https://github.com/molokoloco/FRAMEWORK/blob/master/jquery.plugins/jquery.browsercssprefix.mlklc.js - - // Usages examples - - var cssTransform = cssPrefix('Transform'); // "MozTransform" or "WebkitTransform" - if (cssTransform ) { - var cssProp = {}; - cssProp['border'] = '1px solid rgba(0, 0, 0, .5)'; - cssProp[cssTransform] = 'rotate(20deg)'; - cssProp[cssPrefix('borderRadius')] = '5px'; // Keep the camelCaze (jQuery like) - cssProp[cssPrefix('boxShadow')] = '2px 2px 2px grey'; - $('div#myDiv').css(cssProp); - // console.log(cssProp); - } - - // Want more code ? That here... - // https://github.com/molokoloco/FRAMEWORK/ + // A function to get browser specific CSS style name properties... + // eg. "MozBorderRadius" or "WebkitTransform" ... + // Playground here : http://jsfiddle.net/molokoloco/f6Z3D/ + // Source here : https://github.com/molokoloco/FRAMEWORK/blob/master/jquery.plugins/jquery.browsercssprefix.mlklc.js + + // Usages examples + + var cssTransform = cssPrefix('Transform'); // "MozTransform" or "WebkitTransform" + if (cssTransform ) { + var cssProp = {}; + cssProp['border'] = '1px solid rgba(0, 0, 0, .5)'; + cssProp[cssTransform] = 'rotate(20deg)'; + cssProp[cssPrefix('borderRadius')] = '5px'; // Keep the camelCaze (jQuery like) + cssProp[cssPrefix('boxShadow')] = '2px 2px 2px grey'; + $('div#myDiv').css(cssProp); + // console.log(cssProp); + } + + // Want more code ? That here... + // https://github.com/molokoloco/FRAMEWORK/ */ var cssPrefixString = {}; @@ -29,8 +29,8 @@ var cssPrefix = function(propertie) { if (cssPrefixString[propertie]) return cssPrefixString[propertie]; var e = document.createElement('div'); if (e.style[propertie]) { // HTML5 release ? ;) - cssPrefixString[propertie] = propertie; - return cssPrefixString[propertie]; + cssPrefixString[propertie] = propertie; + return cssPrefixString[propertie]; } var prefixes = ['Moz', 'Webkit', 'O', 'ms', 'Khtml']; // Various old supports... for (var i in prefixes) { diff --git a/jquery.plugins/jquery.center.mlklc.js b/jquery.plugins/jquery.center.mlklc.js index 3a7f496..e86dd36 100644 --- a/jquery.plugins/jquery.center.mlklc.js +++ b/jquery.plugins/jquery.center.mlklc.js @@ -2,13 +2,13 @@ ///// Code mixing by Molokoloco ..... 2011 ......... [EVER IN PROGRESS (it's not done yet)] //////////// //////////////////////////////////////////////////////////////////////////////////////////////////// */ /* - // Center element into an other - // Source here : http://plugins.jquery.com/project/autocenter + // Center element into an other + // Source here : http://plugins.jquery.com/project/autocenter - $('#mainDiv').center(); - $(window).bind('resize', function() { - $('#mainDiv').center({transition:300}); - }); + $('#mainDiv').center(); + $(window).bind('resize', function() { + $('#mainDiv').center({transition:300}); + }); */ (function($){ @@ -46,23 +46,23 @@ })(jQuery); /* - // SHORT VERSION - - (function($){ - $.fn.extend({ - center: function () { - return this.each(function() { - var top = ($(window).height() - $(this).outerHeight()) / 2; - var left = ($(window).width() - $(this).outerWidth()) / 2; - $(this).css({position:'absolute', margin:0, top: (top > 0 ? top : 0)+'px', left: (left > 0 ? left : 0)+'px'}); - }); - } - }); - })(jQuery); - - $('#myDiv').center(); - - // VERY SHORT VERSION - - $('#myDiv').css({top:'50%',left:'50%',margin:'-'+($('#myDiv').height() / 2)+'px 0 0 -'+($('#myDiv').width() / 2)+'px'}); + // SHORT VERSION + + (function($){ + $.fn.extend({ + center: function () { + return this.each(function() { + var top = ($(window).height() - $(this).outerHeight()) / 2; + var left = ($(window).width() - $(this).outerWidth()) / 2; + $(this).css({position:'absolute', margin:0, top: (top > 0 ? top : 0)+'px', left: (left > 0 ? left : 0)+'px'}); + }); + } + }); + })(jQuery); + + $('#myDiv').center(); + + // VERY SHORT VERSION + + $('#myDiv').css({top:'50%',left:'50%',margin:'-'+($('#myDiv').height() / 2)+'px 0 0 -'+($('#myDiv').width() / 2)+'px'}); */ \ No newline at end of file diff --git a/jquery.plugins/jquery.colonizr.css b/jquery.plugins/jquery.colonizr.css index fe33911..aef6d99 100644 --- a/jquery.plugins/jquery.colonizr.css +++ b/jquery.plugins/jquery.colonizr.css @@ -50,4 +50,15 @@ .multiplecolumns p { margin:0 10px; text-align: justify; + + /* http://stackoverflow.com/questions/8506783/css3-columns-force-non-breaking-splitting-element */ + display:inline-block; + /* OR */ + /* + -webkit-column-break-inside:avoid; + -moz-column-break-inside:avoid; + -o-column-break-inside:avoid; + -ms-column-break-inside:avoid; + column-break-inside:avoid; + */ } diff --git a/jquery.plugins/jquery.colonizr.js b/jquery.plugins/jquery.colonizr.js index 26e6490..445b243 100644 --- a/jquery.plugins/jquery.colonizr.js +++ b/jquery.plugins/jquery.colonizr.js @@ -49,11 +49,9 @@ * ========================== */ function colonizr(element, options) { - // Merge user options - this.options = $.extend(true, {}, $.fn.colonizr.defaults, typeof options == 'object' && options || {}); - // Privates vars + this.options = $.extend(true, {}, $.fn.colonizr.defaults, typeof options == 'object' && options || {}); // Merge user options this.$container = $(element); - this.wrapper = '
'; + this.wrapper = '
'; this.cWidth, this.intentNextP, this.lineMinHeight, this.maxHeight, this.estimateHeight; this.refresh(); }; @@ -63,31 +61,43 @@ constructor: colonizr, colsExtractor: function (i, e) { // Cannot be done with $.wrapAll() || $.nextAll() // :-( + var $element = $(e), $next = $element.next(), $collection = [], jumpNext = false, - totalHeight = 0; + totalHeight = 0, + intentNextE = 0; + while ($next) { - if (!$next.is(this.options.take)) { - if (!$next.is(this.options.chapters)) jumpNext = true; + if ($next.is(this.options.chapters)) { $next = null; // Break } - else { + else if ($next.is(this.options.take)) { $collection.push($next); $next = $next.next(); } + else { + intentNextE++; + if (intentNextE > 10) $next = null; // Break + else { + $element = $next; // Move inserting after all skipped elements... and them to chapers or take if you want to preserve order + $next = $next.next(); + } + } } + this.estimateHeight = 0; if ($collection.length) { for (var j = 0, len = $collection.length; j < len; j++) { - this.estimateHeight += $collection[j].outerHeight(); // Work better if "p" margin (2) == ".multiplecolumns p" margin (2*cols) + this.estimateHeight += $collection[j].outerHeight(); // Work fine if "p" margin (2) == ".multiplecolumns > p" margin (2 * nb cols) } } + if ($collection.length && this.estimateHeight > this.lineMinHeight) { var $wrapper = $(this.wrapper); for (var j = 0, len = $collection.length; j < len; j++) { - if (!(totalHeight == 0 && $collection[j].html() == ' ')) { // first col element empty

? + if ( !($collection[j].html() == ' ' && (totalHeight == 0 || j == len)) ) { // first col element empty

? totalHeight += $collection[j].outerHeight(); // P height considered nearly the same as futur Col height $wrapper.append($collection[j].detach()); // Extract P if ($collection[(j + 1)] && this.maxHeight <= (totalHeight + $collection[(j + 1)].outerHeight())) { // Cut Cols if > screen height @@ -103,16 +113,16 @@ } else if (jumpNext) { this.intentNextP++; // Max, trois tags vides après un titre - if (this.intentNextP < 3 && $element.next()) this.colsExtractor(0, $element.next()); + if (this.intentNextP < 10 && $element.next()) this.colsExtractor(0, $element.next()); } }, refresh: function () { this.cWidth = this.$container.width(); + this.maxHeight = this.options.maxHeight; this.intentNextP = 0; this.lineMinHeight = 0; - this.maxHeight = this.options.maxHeight; - + if (this.options.maxHeight < 1) this.maxHeight = Math.max(80, $(window).height() * 0.8); // (Min/) Max cols height ? @@ -134,7 +144,8 @@ } var that = this; - this.$container // We cannot .detach() the container before operating because we need the height of some elements inside + this.$container + // .detach() // We cannot detach the container before operating because we need the height of some elements inside .find(this.options.chapters) //.each($.proxy(this.colsExtractor, this)); .each(function(i, e) { diff --git a/jquery.plugins/jquery.colonizr.min.js b/jquery.plugins/jquery.colonizr.min.js index eb5626e..e540b42 100644 --- a/jquery.plugins/jquery.colonizr.min.js +++ b/jquery.plugins/jquery.colonizr.min.js @@ -12,8 +12,7 @@ * * ============================================================== */ -!function(b){function g(c,f){this.options=b.extend(!0,{},b.fn.colonizr.defaults,"object"==typeof f&&f||{});this.$container=b(c);this.wrapper='

';this.cWidth;this.intentNextP;this.lineMinHeight;this.maxHeight;this.estimateHeight;this.refresh()}g.prototype={constructor:g,colsExtractor:function(c,f){for(var d=b(f),a=d.next(),e=[],g=!1,k=0;a;)a.is(this.options.take)?(e.push(a),a=a.next()):(a.is(this.options.chapters)||(g=!0),a=null);this.estimateHeight=0;if(e.length)for(var a= -0,l=e.length;athis.lineMinHeight){for(var h=b(this.wrapper),a=0,l=e.length;athis.intentNextP&&d.next()&&this.colsExtractor(0,d.next()))},refresh:function(){this.cWidth= -this.$container.width();this.lineMinHeight=this.intentNextP=0;this.maxHeight=this.options.maxHeight;1>this.options.maxHeight&&(this.maxHeight=Math.max(80,0.8*b(window).height()));var c=b("

A

").appendTo(this.$container);this.lineMinHeight=c.outerHeight()*this.options.minLine;c.remove();c=this.$container.find("."+this.options.css);if(c.length){var f=this.$container.prev();this.$container.detach();c.each(function(){var a=b(this);b(a.html()).insertBefore(a);a.remove()});this.$container.insertAfter(f)}var d= -this;this.$container.find(this.options.chapters).each(function(a,c){setTimeout(b.proxy(d.colsExtractor,d),0,a,c)})}};var m=b.fn.colonizr;b.fn.colonizr=function(c){return this.each(function(){var f=b(this),d=f.data("colonizr");d||f.data("colonizr",d=new g(this,c));if("string"==typeof c)d[c]()})};b.fn.colonizr.Constructor=g;b.fn.colonizr.defaults={chapters:"h1,h2,h3,h4,h5,h6",take:"p",css:"multiplecolumns",minLine:2,maxHeight:null};b.fn.colonizr.noConflict=function(){b.fn.colonizr=m;return this};b(window).on("load", -function(){b('[data-colonizr="true"]').each(function(){var c=b(this);c.colonizr(c.data())})})}(window.jQuery); \ No newline at end of file +!function(b){function l(c,f){this.options=b.extend(!0,{},b.fn.colonizr.defaults,"object"==typeof f&&f||{});this.$container=b(c);this.wrapper='
';this.cWidth;this.intentNextP;this.lineMinHeight;this.maxHeight;this.estimateHeight;this.refresh()}l.prototype={constructor:l,colsExtractor:function(c,f){for(var d=b(f),a=d.next(),e=[],h=0,g=0;a;)a.is(this.options.chapters)?a=null:a.is(this.options.take)?(e.push(a),a=a.next()):(g++,10this.lineMinHeight){for(var k=b(this.wrapper),a=0,g=e.length;athis.options.maxHeight&&(this.maxHeight=Math.max(80,0.8*b(window).height()));var c=b("

A

").appendTo(this.$container);this.lineMinHeight=c.outerHeight()*this.options.minLine;c.remove();c=this.$container.find("."+this.options.css);if(c.length){var f=this.$container.prev();this.$container.detach();c.each(function(){var a=b(this);b(a.html()).insertBefore(a);a.remove()});this.$container.insertAfter(f)}var d=this;this.$container.find(this.options.chapters).each(function(a,c){setTimeout(b.proxy(d.colsExtractor, +d),0,a,c)})}};var m=b.fn.colonizr;b.fn.colonizr=function(c){return this.each(function(){var f=b(this),d=f.data("colonizr");d||f.data("colonizr",d=new l(this,c));if("string"==typeof c)d[c]()})};b.fn.colonizr.Constructor=l;b.fn.colonizr.defaults={chapters:"h1,h2,h3,h4,h5,h6",take:"p",css:"multiplecolumns",minLine:2,maxHeight:null};b.fn.colonizr.noConflict=function(){b.fn.colonizr=m;return this};b(window).on("load",function(){b('[data-colonizr="true"]').each(function(){var c=b(this);c.colonizr(c.data())})})}(window.jQuery); \ No newline at end of file diff --git a/jquery.plugins/jquery.disableselect.mlklc.js b/jquery.plugins/jquery.disableselect.mlklc.js index a223792..34d63ae 100644 --- a/jquery.plugins/jquery.disableselect.mlklc.js +++ b/jquery.plugins/jquery.disableselect.mlklc.js @@ -2,22 +2,22 @@ ///// Code mixing by Molokoloco ..... 2011 ......... [EVER IN PROGRESS (it's not done yet)] //////////// //////////////////////////////////////////////////////////////////////////////////////////////////// */ /* - // Disabling elements and text mouse selection - // Source here : - - // Usages examples - - $('*').disableTextSelect(); + // Disabling elements and text mouse selection + // Source here : + + // Usages examples + + $('*').disableTextSelect(); */ $.fn.disableTextSelect = function () { - return this.each(function () { - $(this).css({'-webkit-user-select':'none', '-moz-user-select':'none','user-select':'none'}); - }) + return this.each(function () { + $(this).css({'-webkit-user-select':'none', '-moz-user-select':'none','user-select':'none'}); + }) }; $.fn.enableTextSelect = function () { - return this.each(function () { - $(this).css({'-webkit-user-select':'', '-moz-user-select':'','user-select':''}); - }) + return this.each(function () { + $(this).css({'-webkit-user-select':'', '-moz-user-select':'','user-select':''}); + }) }; \ No newline at end of file diff --git a/jquery.plugins/jquery.scrollScreen.js b/jquery.plugins/jquery.scrollScreen.js index c6b361d..4bb874b 100644 --- a/jquery.plugins/jquery.scrollScreen.js +++ b/jquery.plugins/jquery.scrollScreen.js @@ -71,7 +71,7 @@ $.easing.jswing = $.easing.swing; $.extend($.easing, { // Extract from jQuery UI - def: 'easeOutQuad', + def: 'easeOutCubic', swing: function (x, t, b, c, d) { return $.easing[$.easing.def](x, t, b, c, d); }, easeInQuad: function (x, t, b, c, d) { return c*(t/=d)*t + b; }, easeOutCubic: function (x, t, b, c, d) { return c*((t=t/d-1)*t*t + 1) + b; } diff --git a/jquery.plugins/jquery.scrollScreen.min.js b/jquery.plugins/jquery.scrollScreen.min.js index 20e6033..ad9d31a 100644 --- a/jquery.plugins/jquery.scrollScreen.min.js +++ b/jquery.plugins/jquery.scrollScreen.min.js @@ -5,10 +5,10 @@ // https://github.com/molokoloco/FRAMEWORK/blob/master/jquery.plugins/jquery.scrollScreen.css // Infos : http://www.b2bweb.fr/molokoloco/jquery-scrollview-viewport-scroll-and-screen-vertical-helper -(function(a,p,x){var q=a(p),r=a(x),A=a("body"),m="html,body,document",n=a(),s="",y=!1;a(m).each(function(){var b=parseInt(a(this).scrollTop(),10);a(this).scrollTop(b+1);if(q.scrollTop()==b+1)return m=this.nodeName.toLowerCase(),!1});var n=a(m),j=function(){return p.location.hash||""},t=function(){return parseInt(n.scrollTop()||q.scrollTop(),10)},u=function(b){y=!0;var a=360+0.42*Math.abs(b-t());22221
').appendTo(k),h=a('
').appendTo(k),e=null,g=null,f=q.height(),l=r.height(),m=f*(f/l),v=1+Math.floor(r.height()/f),n=-Math.floor(d.height()-d.height()/3),s=f-d.height(),B=function(){d.css({left:r.width()-d.width()-3})},C=function(){b.debug&&console.log("mouseIsMoveViewsClear()");e&& -clearTimeout(z);y?e=setTimeout(C,2500):(e=null,d.removeClass("current"),h.attr("title",""),w(t()))},D=function(c){b.debug&&console.log("moveViews(ascPos)",c);c=c||t();c+=n;c=Math.max(c,0);c=Math.min(c,s);var a=1+Math.floor(v*(c/f));d.css({top:c}).text(a);if(b.checkHash&&j()!="#screen_"+a&&(c="#screen_"+a)&&j()!=c)p.location.hash=c},z=function(c){b.debug&&console.log("mouseIsMoveViews(event)",c.clientY);e?(clearTimeout(e),e=null):d.addClass("current");D(c.clientY)},w=function(c){b.debug&&console.log("setCurrentViewport(scrollTop)", -c);c=((c||t())+f)/l;D((f-m)*c)},k=function(c){b.debug&&console.log("viewportClick(event)",c);var a=0,a=10>c.clientY?0:c.clientY>f-10?l:l*((c.clientY+n)/f);u(a);return!1};B();b.debug&&console.log("createViewport()");h.on("click touchend",k).on("dblclick",function(){b.debug&&console.log("viewportDbClick()");u(1);return!1}).on("mousemove",z).on("mouseout",function(a){b.debug&&console.log("mouseIsOutViews(event)",a);e&&clearTimeout(z);e=setTimeout(C,2500)});d.on("click touchend",k);w();var x=function(){b.debug&& -console.log("scrollRefreshEvent()");g=null;d.removeClass("current")},F=function(a){b.debug&&console.log("resizeRefreshEvent()");f=q.height();l=r.height();m=f*(f/l);v=Math.ceil(r.height()/f);1>=v?d.hide():d.show();B();w();b.checkHash&&(g=setTimeout(function(a){g=null;E(a)},1E3,a||j()))};q.on("scroll",function(){g&&clearTimeout(g);g=setTimeout(x,600);w();d.addClass("current")}).on("resize",function(){g&&clearTimeout(g);g=setTimeout(F,360,j())});F();var E=function(a){b.debug&&console.log("checkHash(hash)", -a,"getHash()",j());if(a=a||j())if(a=a.split("screen_"),11
').appendTo(l),h=b('
').appendTo(l),e=null,g=null,f=r.height(),m=s.height(),n=f*(f/m),w=1+Math.floor(s.height()/f),p=-Math.floor(d.height()-d.height()/3),t=f-d.height(),C=function(){d.css({left:s.width()-d.width()-3})},D=function(){c.debug&&console.log("mouseIsMoveViewsClear()");e&& +clearTimeout(A);z?e=setTimeout(D,2500):(e=null,d.removeClass("current"),h.attr("title",""),x(u()))},E=function(a){c.debug&&console.log("moveViews(ascPos)",a);a=a||u();a+=p;a=Math.max(a,0);a=Math.min(a,t);var b=1+Math.floor(w*(a/f));d.css({top:a}).text(b);c.checkHash&&k()!="#screen_"+b&&(a="#screen_"+b)&&k()!=a&&(q.location.hash=a)},A=function(a){c.debug&&console.log("mouseIsMoveViews(event)",a.clientY);e?(clearTimeout(e),e=null):d.addClass("current");E(a.clientY)},x=function(a){c.debug&&console.log("setCurrentViewport(scrollTop)", +a);a=((a||u())+f)/m;E((f-n)*a)},l=function(a){c.debug&&console.log("viewportClick(event)",a);var b=0,b=10>a.clientY?0:a.clientY>f-10?m:m*((a.clientY+p)/f);v(b);return!1};C();c.debug&&console.log("createViewport()");h.on("click touchend",l).on("dblclick",function(a){c.debug&&console.log("viewportDbClick()");v(1);return!1}).on("mousemove",A).on("mouseout",function(a){c.debug&&console.log("mouseIsOutViews(event)",a);e&&clearTimeout(A);e=setTimeout(D,2500)});d.on("click touchend",l);x();var y=function(){c.debug&& +console.log("scrollRefreshEvent()");g=null;d.removeClass("current")},G=function(a){c.debug&&console.log("resizeRefreshEvent()");f=r.height();m=s.height();n=f*(f/m);w=Math.ceil(s.height()/f);1>=w?d.hide():d.show();C();x();c.checkHash&&(g=setTimeout(function(a){g=null;F(a)},1E3,a||k()))};r.on("scroll",function(a){g&&clearTimeout(g);g=setTimeout(y,600);x();d.addClass("current")}).on("resize",function(a){g&&clearTimeout(g);g=setTimeout(G,360,k())});G();var F=function(a){c.debug&&console.log("checkHash(hash)", +a,"getHash()",k());if(a=a||k())if(a=a.split("screen_"),1 - - - - - - - // JS USE CASE - - $('a.css').styleInit(); // That all ! Wait user click... - $.fn.styleSwitch('css/styles.css'); // Direct style change with JS call + // Add Or Switch Stylesheet + + // Ressources : + * Source here : http://home.b2bweb.fr/js/jquery.style.js + * Official : http://plugins.jquery.com/project/AddOrSwitchStylesheet + * Use cookie manager from : http://plugins.jquery.com/project/cookie + + // Plugin who load (at the first demand) and switch stylesheet, with cookie : + * Manage links to change style + * Add stylesheet to head, if not exist + * If already exist, switch style with the disabled attribute + * Prevent changing styles who are not related to theme : No modification on styles without id attribute + * Prevent changing other styles who are not related to theme + * Stock and autoload user style preference, with a cookie + + // HTML + + + + + + + + + // JS USE CASE + + $('a.css').styleInit(); // That all ! Wait user click... + $.fn.styleSwitch('css/styles.css'); // Direct style change with JS call */ (function($){ diff --git a/jquery.plugins/jquery.tools.mlklc.js b/jquery.plugins/jquery.tools.mlklc.js index b8ab6ee..487641a 100644 --- a/jquery.plugins/jquery.tools.mlklc.js +++ b/jquery.plugins/jquery.tools.mlklc.js @@ -5,8 +5,8 @@ // ------------------------------------ Some vars... ------------------------------------ // var WWW = ( /localhost\//.test(document.location) ? 'http://localhost/www.b2bweb.fr/' : 'http://www.b2bweb.fr/' ), - H = $(window).height(), // Viewport dimensions - W = $(window).width(); + H = $(window).height(), // Viewport dimensions + W = $(window).width(); // ------------------------------------ Some littles functions... ------------------------------------ // @@ -29,10 +29,10 @@ var loadJs = function(jsPath) { var s = document.createElement('script'); s.setA var getScript = function(src, callback) { $.ajax({dataType:'script', async:false, cache:true, url:src, success:function(response) { if (callback && typeof callback == 'function') callback(); }}); }; // var touch = e2key(event); var event2key = { - '96':'0', '97':'1', '98':'2', '99':'3', '100':'4', '101':'5', '102':'6', '103':'7', '104':'8', '105':'9', // Chiffres clavier num - '48':'m0', '49':'m1', '50':'m2', '51':'m3', '52':'m4', '53':'m5', '54':'m6', '55':'m7', '56':'m8', '57':'m9', // Chiffres caracteres speciaux - '65':'a', '66':'b', '67':'c', '68':'d', '69':'e', '70':'f', '71':'g', '72':'h', '73':'i', '74':'j', '75':'k', '76':'l', '77':'m', '78':'n', '79':'o', '80':'p', '81':'q', '82':'r', '83':'s', '84':'t', '85':'u', '86':'v', '87':'w', '88':'x', '89':'y', '90':'z', // Alphabet - '37':'left', '39':'right', '38':'up', '40':'down', '13':'enter', '27':'esc', '32':'space', '107':'+', '109':'-'// Keycodes + '96':'0', '97':'1', '98':'2', '99':'3', '100':'4', '101':'5', '102':'6', '103':'7', '104':'8', '105':'9', // Chiffres clavier num + '48':'m0', '49':'m1', '50':'m2', '51':'m3', '52':'m4', '53':'m5', '54':'m6', '55':'m7', '56':'m8', '57':'m9', // Chiffres caracteres speciaux + '65':'a', '66':'b', '67':'c', '68':'d', '69':'e', '70':'f', '71':'g', '72':'h', '73':'i', '74':'j', '75':'k', '76':'l', '77':'m', '78':'n', '79':'o', '80':'p', '81':'q', '82':'r', '83':'s', '84':'t', '85':'u', '86':'v', '87':'w', '88':'x', '89':'y', '90':'z', // Alphabet + '37':'left', '39':'right', '38':'up', '40':'down', '13':'enter', '27':'esc', '32':'space', '107':'+', '109':'-'// Keycodes }; var e2key = function(e) { if (!e) return; return event2key[(e.which || e.keyCode)]; }; String.prototype.camelize = function() { diff --git a/jquery.plugins/jquery.tooltips.js b/jquery.plugins/jquery.tooltips.js index 37c59d1..c5ac7fb 100644 --- a/jquery.plugins/jquery.tooltips.js +++ b/jquery.plugins/jquery.tooltips.js @@ -53,7 +53,7 @@ data['tooltip'].stop(true, true).fadeOut(400); // End animation }, - fetch: function(url, $element) { + fetch: function(url, $element) { if (debug) console.log(plugName+'.fetch()'); $.ajax({ // http://api.jquery.com/jQuery.ajax/ dataType:'jsonp', @@ -71,7 +71,7 @@ console.log('JSON error', textStatus, errorThrown); } }); - } + } }; // End Privates plugin methods