Merge branch 'dev'
This commit is contained in:
commit
2cfb5d0699
7 changed files with 14 additions and 3137 deletions
|
@ -576,17 +576,19 @@ table.impact tr td
|
|||
#choixrss
|
||||
float: right
|
||||
width: 25%
|
||||
line-height: 2em
|
||||
#choixlang
|
||||
line-height: 2em
|
||||
|
||||
#entete
|
||||
#choixrss,
|
||||
#choixlang a
|
||||
margin-top: 0.3em
|
||||
height: 4em
|
||||
line-height: 4em
|
||||
#choix a
|
||||
color: $highlightColor
|
||||
#choix a:hover
|
||||
color: $revealColor
|
||||
|
||||
#choixlang a
|
||||
display: block
|
||||
width: 25%
|
||||
line-height: 4em
|
||||
text-align: center
|
||||
|
||||
.date
|
||||
|
@ -623,13 +625,6 @@ table.impact tr td
|
|||
margin-right: 1em
|
||||
text-align: right
|
||||
|
||||
#choixlang
|
||||
padding-top: 0.1em
|
||||
|
||||
#choixlang a,
|
||||
#clickcomment
|
||||
padding: 0.1em 1em
|
||||
|
||||
#clickcomment
|
||||
margin-left: 0
|
||||
width: 25%
|
||||
|
@ -640,13 +635,12 @@ table.impact tr td
|
|||
display: block
|
||||
width: 100%
|
||||
float: right
|
||||
padding: 0.1em 1em
|
||||
padding: 1em 0.1em
|
||||
|
||||
.return a
|
||||
text-align: center
|
||||
float: right
|
||||
width: 25%
|
||||
padding: 0.1em 1em
|
||||
|
||||
.corps .return a
|
||||
color: $lighterColor
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -1 +0,0 @@
|
|||
$('body').prepend('<div id="iemessage"><p><span><em>Avec <a href="http://www.firefox.com"> Firefox </a> et <a href="http://www.apple.com/safari">Safari</a> cette page est bien plus jolie !</em></span><br/><span><em>This page is far nicer with <a href="http://www.firefox.com"> Firefox </a> and <a href="http://www.apple.com/safari">Safari</a>!</em></span></p></div>');
|
|
@ -22,90 +22,7 @@ function initCode() {
|
|||
}
|
||||
// --- end of popin code ---
|
||||
|
||||
// -- multilanguage handling --
|
||||
|
||||
// show a message to user
|
||||
function message(msg) {
|
||||
$('#blackpage').css({cursor: 'auto'});
|
||||
$('#blackpage').show().html(msg);
|
||||
}
|
||||
|
||||
// from cookie first if not, from Navigator
|
||||
function getUserLanguage() {
|
||||
var language = $.cookie('language');
|
||||
if (! language) {
|
||||
if ( (navigator) &&
|
||||
(navigator.language) &&
|
||||
(navigator.language.substring(0,2) == 'fr' ) ) {
|
||||
language='fr';
|
||||
} else {
|
||||
language='en';
|
||||
}
|
||||
}
|
||||
return language;
|
||||
}
|
||||
|
||||
// return the path of the equivalent page in another language
|
||||
function pathToLanguage(lang) {
|
||||
return window.location.pathname.replace(/(.*\/Scratch\/)(..)(\/.*$)/,'$1'+lang+'$3');
|
||||
}
|
||||
|
||||
// return the link to the equivalent page in another language
|
||||
function linkToLang(lang, msg) {
|
||||
return '<a href="'+pathToLanguage(lang)+'">'+msg+'</a>';
|
||||
}
|
||||
|
||||
// return a link that will hide the message
|
||||
function hideClickMessage(msg) {
|
||||
return '<div><a onclick="hideMessage()">'+msg+'</a></div>';
|
||||
}
|
||||
|
||||
// put the selected language in the cookie
|
||||
function setLanguage(lang) {
|
||||
$.cookie('language',lang, { path: '/Scratch'});
|
||||
}
|
||||
|
||||
// select the good language and hide the message
|
||||
function hideMessage() {
|
||||
setLanguage(getPageLanguage());
|
||||
$('#blackpage').fadeOut();
|
||||
}
|
||||
|
||||
// get the language of the current page
|
||||
function getPageLanguage() {
|
||||
var lang=window.location.pathname.replace(/.*\/Scratch\/(..).*$/,'$1');
|
||||
if ( lang == window.location.pathname ) {
|
||||
return "";
|
||||
}
|
||||
else {
|
||||
return lang;
|
||||
}
|
||||
}
|
||||
|
||||
// alert the user if its navigator configuration tell
|
||||
// me it should prefer another language
|
||||
function alertLanguage() {
|
||||
var language=getUserLanguage();
|
||||
var language_of_current_page=getPageLanguage();
|
||||
if ( language_of_current_page == "" ) {
|
||||
return true;
|
||||
}
|
||||
if (language != language_of_current_page) {
|
||||
if ( language == 'fr' ) {
|
||||
message(linkToLang('fr','Aller sur la Version Française ?') + hideClickMessage('No thanks, I prefer read english.'));
|
||||
} else if (language == 'en') {
|
||||
message(linkToLang('en','Go to English Version?')+ hideClickMessage('Non merci, je préfère le français.'));
|
||||
} else {
|
||||
// don't know which language the user prefer
|
||||
message(linkToLang('en','Go to English Version?')+'<br/>'+linkToLang('fr','Version Française ?') + hideClickMessage('Non merci, je préfère le français.'));
|
||||
}
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
// --- end for language ---
|
||||
|
||||
// Google analytics
|
||||
// --- Google analytics ---
|
||||
function analytics() {
|
||||
var admin = $.cookie('admin');
|
||||
if (! admin) {
|
||||
|
@ -152,15 +69,9 @@ var userAgent;
|
|||
|
||||
function detectClient() {
|
||||
userAgent = navigator.userAgent.toLowerCase();
|
||||
// if ( /chrome/.test(userAgent) ) {
|
||||
// $('head').append('<link rel="stylesheet" href="/Scratch/assets/css/gen_chrome.css"/>');
|
||||
// } else if ( /webkit/.test(userAgent) ) {
|
||||
// $('head').append('<link rel="stylesheet" href="/Scratch/assets/css/gen_webkit.css"/>');
|
||||
// } else if ( /mozilla/.test(userAgent) ) {
|
||||
// $('head').append('<link rel="stylesheet" href="/Scratch/assets/css/gen_mozilla.css"/>');
|
||||
// } else
|
||||
if (/msie/.test(userAgent) ) {
|
||||
$('head').append('<script type="text/javascript" src="/Scratch/js/ie.js"></script>');
|
||||
if (/msie/.test(userAgent) ) {
|
||||
$('body').prepend('<div id="iemessage"><p><span><em>Avec <a href="http://www.firefox.com"> Firefox </a> et <a href="http://www.apple.com/safari">Safari</a> cette page est bien plus jolie !</em></span><br/><span><em>This page is far nicer with <a href="http://www.firefox.com"> Firefox </a> and <a href="http://www.apple.com/safari">Safari</a>!</em></span></p></div>');
|
||||
p
|
||||
} else if (/ip(od|hone)/.test(userAgent)) {
|
||||
$('head').append('<meta name="viewport" content="width=device-width; initial-scale=0.5; maximum-scale=2.0;">');
|
||||
$('head').append('<link rel="stylesheet" type="text/css" href="/Scratch/css/iPhone.css"/>');
|
||||
|
@ -171,10 +82,7 @@ function detectClient() {
|
|||
$(document).ready( function() {
|
||||
detectClient();
|
||||
initCode();
|
||||
// affiche la page une fois propre et la langue choisie
|
||||
if ( alertLanguage() ) {
|
||||
$('#blackpage').fadeOut();
|
||||
}
|
||||
$('#blackpage').fadeOut();
|
||||
analytics();
|
||||
});
|
||||
|
||||
|
|
|
@ -1,123 +0,0 @@
|
|||
/*
|
||||
* jQuery Color Animations
|
||||
* Copyright 2007 John Resig
|
||||
* Released under the MIT and GPL licenses.
|
||||
*/
|
||||
|
||||
(function(jQuery){
|
||||
|
||||
// We override the animation for all of these color styles
|
||||
jQuery.each(['backgroundColor', 'borderBottomColor', 'borderLeftColor', 'borderRightColor', 'borderTopColor', 'color', 'outlineColor'], function(i,attr){
|
||||
jQuery.fx.step[attr] = function(fx){
|
||||
if ( fx.state == 0 ) {
|
||||
fx.start = getColor( fx.elem, attr );
|
||||
fx.end = getRGB( fx.end );
|
||||
}
|
||||
|
||||
fx.elem.style[attr] = "rgb(" + [
|
||||
Math.max(Math.min( parseInt((fx.pos * (fx.end[0] - fx.start[0])) + fx.start[0]), 255), 0),
|
||||
Math.max(Math.min( parseInt((fx.pos * (fx.end[1] - fx.start[1])) + fx.start[1]), 255), 0),
|
||||
Math.max(Math.min( parseInt((fx.pos * (fx.end[2] - fx.start[2])) + fx.start[2]), 255), 0)
|
||||
].join(",") + ")";
|
||||
}
|
||||
});
|
||||
|
||||
// Color Conversion functions from highlightFade
|
||||
// By Blair Mitchelmore
|
||||
// http://jquery.offput.ca/highlightFade/
|
||||
|
||||
// Parse strings looking for color tuples [255,255,255]
|
||||
function getRGB(color) {
|
||||
var result;
|
||||
|
||||
// Check if we're already dealing with an array of colors
|
||||
if ( color && color.constructor == Array && color.length == 3 )
|
||||
return color;
|
||||
|
||||
// Look for rgb(num,num,num)
|
||||
if (result = /rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/.exec(color))
|
||||
return [parseInt(result[1]), parseInt(result[2]), parseInt(result[3])];
|
||||
|
||||
// Look for rgb(num%,num%,num%)
|
||||
if (result = /rgb\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*\)/.exec(color))
|
||||
return [parseFloat(result[1])*2.55, parseFloat(result[2])*2.55, parseFloat(result[3])*2.55];
|
||||
|
||||
// Look for #a0b1c2
|
||||
if (result = /#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(color))
|
||||
return [parseInt(result[1],16), parseInt(result[2],16), parseInt(result[3],16)];
|
||||
|
||||
// Look for #fff
|
||||
if (result = /#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/.exec(color))
|
||||
return [parseInt(result[1]+result[1],16), parseInt(result[2]+result[2],16), parseInt(result[3]+result[3],16)];
|
||||
|
||||
// Otherwise, we're most likely dealing with a named color
|
||||
return colors[jQuery.trim(color).toLowerCase()];
|
||||
}
|
||||
|
||||
function getColor(elem, attr) {
|
||||
var color;
|
||||
|
||||
do {
|
||||
color = jQuery.curCSS(elem, attr);
|
||||
|
||||
// Keep going until we find an element that has color, or we hit the body
|
||||
if ( color != '' && color != 'transparent' || jQuery.nodeName(elem, "body") )
|
||||
break;
|
||||
|
||||
attr = "backgroundColor";
|
||||
} while ( elem = elem.parentNode );
|
||||
|
||||
return getRGB(color);
|
||||
};
|
||||
|
||||
// Some named colors to work with
|
||||
// From Interface by Stefan Petre
|
||||
// http://interface.eyecon.ro/
|
||||
|
||||
var colors = {
|
||||
aqua:[0,255,255],
|
||||
azure:[240,255,255],
|
||||
beige:[245,245,220],
|
||||
black:[0,0,0],
|
||||
blue:[0,0,255],
|
||||
brown:[165,42,42],
|
||||
cyan:[0,255,255],
|
||||
darkblue:[0,0,139],
|
||||
darkcyan:[0,139,139],
|
||||
darkgrey:[169,169,169],
|
||||
darkgreen:[0,100,0],
|
||||
darkkhaki:[189,183,107],
|
||||
darkmagenta:[139,0,139],
|
||||
darkolivegreen:[85,107,47],
|
||||
darkorange:[255,140,0],
|
||||
darkorchid:[153,50,204],
|
||||
darkred:[139,0,0],
|
||||
darksalmon:[233,150,122],
|
||||
darkviolet:[148,0,211],
|
||||
fuchsia:[255,0,255],
|
||||
gold:[255,215,0],
|
||||
green:[0,128,0],
|
||||
indigo:[75,0,130],
|
||||
khaki:[240,230,140],
|
||||
lightblue:[173,216,230],
|
||||
lightcyan:[224,255,255],
|
||||
lightgreen:[144,238,144],
|
||||
lightgrey:[211,211,211],
|
||||
lightpink:[255,182,193],
|
||||
lightyellow:[255,255,224],
|
||||
lime:[0,255,0],
|
||||
magenta:[255,0,255],
|
||||
maroon:[128,0,0],
|
||||
navy:[0,0,128],
|
||||
olive:[128,128,0],
|
||||
orange:[255,165,0],
|
||||
pink:[255,192,203],
|
||||
purple:[128,0,128],
|
||||
violet:[128,0,128],
|
||||
red:[255,0,0],
|
||||
silver:[192,192,192],
|
||||
white:[255,255,255],
|
||||
yellow:[255,255,0]
|
||||
};
|
||||
|
||||
})(jQuery);
|
File diff suppressed because it is too large
Load diff
|
@ -1,47 +0,0 @@
|
|||
// initialisation du menu
|
||||
var decalageTop = 10;
|
||||
function entete_height() {
|
||||
return $('#entete').height() - $('#menuMessage').height() + decalageTop;
|
||||
}
|
||||
function fastHideMenu() {
|
||||
$('#entete').css({opacity: .2});
|
||||
}
|
||||
function hideMenu() {
|
||||
$('#entete').animate({opacity: .2}, 3000 );
|
||||
}
|
||||
function showMenu() {
|
||||
$('#entete').animate({opacity:1}, 200 );
|
||||
last+=1;
|
||||
autoHideMenu(last);
|
||||
}
|
||||
function fastShowMenu() {
|
||||
$('#entete').css({opacity:1});
|
||||
last+=1;
|
||||
autoHideMenu(last);
|
||||
}
|
||||
function toggleMenu() {
|
||||
if ( $('#entete').css('opacity')==1 ) {
|
||||
hideMenu();
|
||||
} else {
|
||||
showMenu();
|
||||
}
|
||||
}
|
||||
var last=0;
|
||||
function autoHideMenu(value) {
|
||||
setTimeout(function(){
|
||||
if ( last == value ) {
|
||||
hideMenu();
|
||||
}
|
||||
},2000);
|
||||
}
|
||||
function initMenu() {
|
||||
$('#entete').hover(showMenu);
|
||||
$('#entete').hover(function(){last+=1;}, function(){autoHideMenu(last);});
|
||||
autoHideMenu(0);
|
||||
}
|
||||
|
||||
|
||||
// Ce que l'on va lancer à l'init.
|
||||
$(document).ready( function() {
|
||||
initMenu();
|
||||
});
|
Loading…
Reference in a new issue