Commit 16a2c9e9 authored by Clément Fauconnier's avatar Clément Fauconnier

fixed widgets recently added

parent d30479de
<?xml version="1.0" encoding="UTF-8"?>
<widget xmlns="http://www.w3.org/ns/widgets"
xmlns:ub="http://uniboard.mnemis.com/widgets"
id="http://uniboard.mnemis.com/widgets/calculator"
version="1.1"
width="460"
height="418"
minimum_width="460"
minimum_height="418"
ub:resizable="true"
ub:transparent="true">
<name>Calculator</name>
<content src="index.html"/>
</widget>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Unpredictable Calculator</title>
<script src="js/sankore.js" type="text/javascript"></script>
<script src="dist/calculator.js" type="text/javascript"></script>
<link rel="stylesheet" type="text/css" href="css/calculator.css" />
</head>
<body>
<div id="ubwidget"></div>
<script type="text/javascript">
var unpredictable = false;
var c = Sankore.Calculator.create('ubwidget', {
locale: window.sankore ? window.sankore.locale() : 'fr_FR',
unpredictableMode: unpredictable,
ready: function () {
var self = this, state = {}, timer = null;
if (window.sankore) {
try {
state = JSON.parse(window.sankore.preference('state'));
} catch (e) {}
this.eventDispatcher.addEventSubscriber({
events: [
'calculator.output_changed', 'calculator.memory_changed', 'calculator.layout_changed',
'editor.layout_created', 'editor.layout_removed', 'editor.layout_changed', 'editor.button_selected',
'keystroke_line.changed'
],
listener: function () {
if (null !== timer) {
clearTimeout(timer);
}
timer = setTimeout(function() {
window.sankore.setPreference('state', JSON.stringify(self.getState()));
timer = null;
}, 350);
}
});
}
this.init(state);
}
});
</script>
</body>
</html>
...@@ -3,9 +3,12 @@ ...@@ -3,9 +3,12 @@
xmlns:ub="http://uniboard.mnemis.com/widgets" xmlns:ub="http://uniboard.mnemis.com/widgets"
id="http://uniboard.mnemis.com/widgets/calculator" id="http://uniboard.mnemis.com/widgets/calculator"
version="1.1" version="1.1"
width="200" width="460"
height="300" height="418"
ub:resizable="false"> minimum_width="460"
minimum_height="418"
ub:resizable="true"
ub:transparent="true">
<name>Calculator</name> <name>Calculator</name>
<content src="index.html"/> <content src="index.html"/>
</widget> </widget>
* {
margin: 0;
padding: 0;
}
body{
margin:0px;
}
.ubw-container{
float:left;
margin:3px;
margin-right:0px;
margin-top: 2px;
background-image:url(../images/back_small.png);
overflow: hidden;
}
.ubw-body{
margin:5px;
margin-left: 9px;
margin-right: 0px;
}
.ubw-inspector{
position:absolute;
background-color:rgb(252, 252, 252);
border:1px solid #cccccc;
line-height:20px;
font-family:Arial, Helvetica, sans-serif;
font-weight:normal;
font-size:20px;
color:#333333;
}
.ubw-inpubox{
min-width:28px;
min-height:37px;
color:#333333;
background-image: url(../images/button_out.png);
border-left:1px solid rgb(231, 231, 231);
border-right:1px solid rgb(231, 231, 231);
border-bottom:1px solid rgb(221, 221, 221);
border-top:1px solid rgb(241, 241, 241);
}
/*BUTTONS*/
.ubw-button-wrapper{
float:left;
position:relative;
/*border:solid 1px yellow;*/
margin-right:-7px;
z-index:0;
font-family:Arial, Helvetica, sans-serif;
font-weight:normal;
font-size:30px;
overflow:visible;
}
.ubw-button-canvas{
width:auto;
float:left;
position:relative;
overflow:visible;
}
table{
line-height:90%;
}
.ubw-button-body{
position:relative;
float:left;
width:auto;
height:auto;
overflow:visible
text-align:center;
vertical-align:middle;
cursor:pointer;
}
.ubw-button-content{
height:auto;
width:auto;
text-align:center;
overflow:visible;
}
.ubw-button-over{
}
.ubw-button-out{
}
span.colored{
color: #0080ff;
}
\ No newline at end of file
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"> <html>
<head> <head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>ubwidget</title> <title>Unpredictable Calculator</title>
<script src="js/jquery-1.3.2.min.js" type="text/javascript"></script> <script src="js/sankore.js" type="text/javascript"></script>
<script src="js/jquery-ui-1.7.2.custom.min.js" type="text/javascript"></script> <script src="dist/calculator.js" type="text/javascript"></script>
<script src="js/jquery.disable.text.select.js" type="text/javascript"></script> <link rel="stylesheet" type="text/css" href="css/calculator.css" />
<script src="js/jquery.center.js" type="text/javascript"></script> </head>
<script src="js/jquery.ubwidget.js" type="text/javascript"></script>
<script src="js/DD_roundies_0.0.2a.js" type="text/javascript"></script> <body>
<script src="js/ubw-main.js" type="text/javascript"></script> <div id="ubwidget"></div>
<script src="js/calculate.js" type="text/javascript"></script>
<script type="text/javascript">
<link rel="stylesheet" type="text/css" href="css/ubwidget.css" /> var unpredictable = false;
</head> var c = Sankore.Calculator.create('ubwidget', {
locale: window.sankore ? window.sankore.locale() : 'fr_FR',
<body> unpredictableMode: unpredictable,
ready: function () {
<script type="text/javascript"> var self = this, state = {}, timer = null;
$(document).ready(function(){
init(); if (window.sankore) {
}); try {
</script> state = JSON.parse(window.sankore.preference('state'));
} catch (e) {}
<div id="ubwidget"></div>
this.eventDispatcher.addEventSubscriber({
</body> events: [
'calculator.output_changed', 'calculator.memory_changed', 'calculator.layout_changed',
</html> 'editor.layout_created', 'editor.layout_removed', 'editor.layout_changed', 'editor.button_selected',
\ No newline at end of file 'keystroke_line.changed'
],
listener: function () {
if (null !== timer) {
clearTimeout(timer);
}
timer = setTimeout(function() {
window.sankore.setPreference('state', JSON.stringify(self.getState()));
timer = null;
}, 350);
}
});
}
this.init(state);
}
});
</script>
</body>
</html>
/**
* DD_roundies, this adds rounded-corner CSS in standard browsers and VML sublayers in IE that accomplish a similar appearance when comparing said browsers.
* Author: Drew Diller
* Email: drew.diller@gmail.com
* URL: http://www.dillerdesign.com/experiment/DD_roundies/
* Version: 0.0.2a
* Licensed under the MIT License: http://dillerdesign.com/experiment/DD_roundies/#license
*
* Usage:
* DD_roundies.addRule('#doc .container', '10px 5px'); // selector and multiple radii
* DD_roundies.addRule('.box', 5, true); // selector, radius, and optional addition of border-radius code for standard browsers.
*
* Just want the PNG fixing effect for IE6, and don't want to also use the DD_belatedPNG library? Don't give any additional arguments after the CSS selector.
* DD_roundies.addRule('.your .example img');
**/
var DD_roundies = {
ns: 'DD_roundies',
IE6: false,
IE7: false,
IE8: false,
IEversion: function() {
if (document.documentMode != 8 && document.namespaces && !document.namespaces[this.ns]) {
this.IE6 = true;
this.IE7 = true;
}
else if (document.documentMode == 8) {
this.IE8 = true;
}
},
querySelector: document.querySelectorAll,
selectorsToProcess: [],
imgSize: {},
createVmlNameSpace: function() { /* enable VML */
if (this.IE6 || this.IE7) {
document.namespaces.add(this.ns, 'urn:schemas-microsoft-com:vml');
}
if (this.IE8) {
document.writeln('<?import namespace="' + this.ns + '" implementation="#default#VML" ?>');
}
},
createVmlStyleSheet: function() { /* style VML, enable behaviors */
/*
Just in case lots of other developers have added
lots of other stylesheets using document.createStyleSheet
and hit the 31-limit mark, let's not use that method!
further reading: http://msdn.microsoft.com/en-us/library/ms531194(VS.85).aspx
*/
var style = document.createElement('style');
document.documentElement.firstChild.insertBefore(style, document.documentElement.firstChild.firstChild);
if (style.styleSheet) { /* IE */
try {
var styleSheet = style.styleSheet;
styleSheet.addRule(this.ns + '\\:*', '{behavior:url(#default#VML)}');
this.styleSheet = styleSheet;
} catch(err) {}
}
else {
this.styleSheet = style;
}
},
/**
* Method to use from afar - refer to it whenever.
* Example for IE only: DD_roundies.addRule('div.boxy_box', '10px 5px');
* Example for IE, Firefox, and WebKit: DD_roundies.addRule('div.boxy_box', '10px 5px', true);
* @param {String} selector - REQUIRED - a CSS selector, such as '#doc .container'
* @param {Integer} radius - REQUIRED - the desired radius for the box corners
* @param {Boolean} standards - OPTIONAL - true if you also wish to output -moz-border-radius/-webkit-border-radius/border-radius declarations
**/
addRule: function(selector, rad, standards) {
if (typeof rad == 'undefined' || rad === null) {
rad = 0;
}
if (rad.constructor.toString().search('Array') == -1) {
rad = rad.toString().replace(/[^0-9 ]/g, '').split(' ');
}
for (var i=0; i<4; i++) {
rad[i] = (!rad[i] && rad[i] !== 0) ? rad[Math.max((i-2), 0)] : rad[i];
}
if (this.styleSheet) {
if (this.styleSheet.addRule) { /* IE */
var selectors = selector.split(','); /* multiple selectors supported, no need for multiple calls to this anymore */
for (var i=0; i<selectors.length; i++) {
this.styleSheet.addRule(selectors[i], 'behavior:expression(DD_roundies.roundify.call(this, [' + rad.join(',') + ']))'); /* seems to execute the function without adding it to the stylesheet - interesting... */
}
}
else if (standards) {
var moz_implementation = rad.join('px ') + 'px';
this.styleSheet.appendChild(document.createTextNode(selector + ' {border-radius:' + moz_implementation + '; -moz-border-radius:' + moz_implementation + ';}'));
this.styleSheet.appendChild(document.createTextNode(selector + ' {-webkit-border-top-left-radius:' + rad[0] + 'px ' + rad[0] + 'px; -webkit-border-top-right-radius:' + rad[1] + 'px ' + rad[1] + 'px; -webkit-border-bottom-right-radius:' + rad[2] + 'px ' + rad[2] + 'px; -webkit-border-bottom-left-radius:' + rad[3] + 'px ' + rad[3] + 'px;}'));
}
}
else if (this.IE8) {
this.selectorsToProcess.push({'selector':selector, 'radii':rad});
}
},
readPropertyChanges: function(el) {
switch (event.propertyName) {
case 'style.border':
case 'style.borderWidth':
case 'style.padding':
this.applyVML(el);
break;
case 'style.borderColor':
this.vmlStrokeColor(el);
break;
case 'style.backgroundColor':
case 'style.backgroundPosition':
case 'style.backgroundRepeat':
this.applyVML(el);
break;
case 'style.display':
el.vmlBox.style.display = (el.style.display == 'none') ? 'none' : 'block';
break;
case 'style.filter':
this.vmlOpacity(el);
break;
case 'style.zIndex':
el.vmlBox.style.zIndex = el.style.zIndex;
break;
}
},
applyVML: function(el) {
el.runtimeStyle.cssText = '';
this.vmlFill(el);
this.vmlStrokeColor(el);
this.vmlStrokeWeight(el);
this.vmlOffsets(el);
this.vmlPath(el);
this.nixBorder(el);
this.vmlOpacity(el);
},
vmlOpacity: function(el) {
if (el.currentStyle.filter.search('lpha') != -1) {
var trans = el.currentStyle.filter;
trans = parseInt(trans.substring(trans.lastIndexOf('=')+1, trans.lastIndexOf(')')), 10)/100;
for (var v in el.vml) {
el.vml[v].filler.opacity = trans;
}
}
},
vmlFill: function(el) {
if (!el.currentStyle) {
return;
} else {
var elStyle = el.currentStyle;
}
el.runtimeStyle.backgroundColor = '';
el.runtimeStyle.backgroundImage = '';
var noColor = (elStyle.backgroundColor == 'transparent');
var noImg = true;
if (elStyle.backgroundImage != 'none' || el.isImg) {
if (!el.isImg) {
el.vmlBg = elStyle.backgroundImage;
el.vmlBg = el.vmlBg.substr(5, el.vmlBg.lastIndexOf('")')-5);
}
else {
el.vmlBg = el.src;
}
var lib = this;
if (!lib.imgSize[el.vmlBg]) { /* determine size of loaded image */
var img = document.createElement('img');
img.attachEvent('onload', function() {
this.width = this.offsetWidth; /* weird cache-busting requirement! */
this.height = this.offsetHeight;
lib.vmlOffsets(el);
});
img.className = lib.ns + '_sizeFinder';
img.runtimeStyle.cssText = 'behavior:none; position:absolute; top:-10000px; left:-10000px; border:none;'; /* make sure to set behavior to none to prevent accidental matching of the helper elements! */
img.src = el.vmlBg;
img.removeAttribute('width');
img.removeAttribute('height');
document.body.insertBefore(img, document.body.firstChild);
lib.imgSize[el.vmlBg] = img;
}
el.vml.image.filler.src = el.vmlBg;
noImg = false;
}
el.vml.image.filled = !noImg;
el.vml.image.fillcolor = 'none';
el.vml.color.filled = !noColor;
el.vml.color.fillcolor = elStyle.backgroundColor;
el.runtimeStyle.backgroundImage = 'none';
el.runtimeStyle.backgroundColor = 'transparent';
},
vmlStrokeColor: function(el) {
el.vml.stroke.fillcolor = el.currentStyle.borderColor;
},
vmlStrokeWeight: function(el) {
var borders = ['Top', 'Right', 'Bottom', 'Left'];
el.bW = {};
for (var b=0; b<4; b++) {
el.bW[borders[b]] = parseInt(el.currentStyle['border' + borders[b] + 'Width'], 10) || 0;
}
},
vmlOffsets: function(el) {
var dims = ['Left', 'Top', 'Width', 'Height'];
for (var d=0; d<4; d++) {
el.dim[dims[d]] = el['offset'+dims[d]];
}
var assign = function(obj, topLeft) {
obj.style.left = (topLeft ? 0 : el.dim.Left) + 'px';
obj.style.top = (topLeft ? 0 : el.dim.Top) + 'px';
obj.style.width = el.dim.Width + 'px';
obj.style.height = el.dim.Height + 'px';
};
for (var v in el.vml) {
var mult = (v == 'image') ? 1 : 2;
el.vml[v].coordsize = (el.dim.Width*mult) + ', ' + (el.dim.Height*mult);
assign(el.vml[v], true);
}
assign(el.vmlBox, false);
if (DD_roundies.IE8) {
el.vml.stroke.style.margin = '-1px';
if (typeof el.bW == 'undefined') {
this.vmlStrokeWeight(el);
}
el.vml.color.style.margin = (el.bW.Top-1) + 'px ' + (el.bW.Left-1) + 'px';
}
},
vmlPath: function(el) {
var coords = function(direction, w, h, r, aL, aT, mult) {
var cmd = direction ? ['m', 'qy', 'l', 'qx', 'l', 'qy', 'l', 'qx', 'l'] : ['qx', 'l', 'qy', 'l', 'qx', 'l', 'qy', 'l', 'm']; /* whoa */
aL *= mult;
aT *= mult;
w *= mult;
h *= mult;
var R = r.slice(); /* do not affect original array */
for (var i=0; i<4; i++) {
R[i] *= mult;
R[i] = Math.min(w/2, h/2, R[i]); /* make sure you do not get funky shapes - pick the smallest: half of the width, half of the height, or current value */
}
var coords = [
cmd[0] + Math.floor(0+aL) +','+ Math.floor(R[0]+aT),
cmd[1] + Math.floor(R[0]+aL) +','+ Math.floor(0+aT),
cmd[2] + Math.ceil(w-R[1]+aL) +','+ Math.floor(0+aT),
cmd[3] + Math.ceil(w+aL) +','+ Math.floor(R[1]+aT),
cmd[4] + Math.ceil(w+aL) +','+ Math.ceil(h-R[2]+aT),
cmd[5] + Math.ceil(w-R[2]+aL) +','+ Math.ceil(h+aT),
cmd[6] + Math.floor(R[3]+aL) +','+ Math.ceil(h+aT),
cmd[7] + Math.floor(0+aL) +','+ Math.ceil(h-R[3]+aT),
cmd[8] + Math.floor(0+aL) +','+ Math.floor(R[0]+aT)
];
if (!direction) {
coords.reverse();
}
var path = coords.join('');
return path;
};
if (typeof el.bW == 'undefined') {
this.vmlStrokeWeight(el);
}
var bW = el.bW;
var rad = el.DD_radii.slice();
/* determine outer curves */
var outer = coords(true, el.dim.Width, el.dim.Height, rad, 0, 0, 2);
/* determine inner curves */
rad[0] -= Math.max(bW.Left, bW.Top);
rad[1] -= Math.max(bW.Top, bW.Right);
rad[2] -= Math.max(bW.Right, bW.Bottom);
rad[3] -= Math.max(bW.Bottom, bW.Left);
for (var i=0; i<4; i++) {
rad[i] = Math.max(rad[i], 0);
}
var inner = coords(false, el.dim.Width-bW.Left-bW.Right, el.dim.Height-bW.Top-bW.Bottom, rad, bW.Left, bW.Top, 2);
var image = coords(true, el.dim.Width-bW.Left-bW.Right+1, el.dim.Height-bW.Top-bW.Bottom+1, rad, bW.Left, bW.Top, 1);
/* apply huge path string */
el.vml.color.path = inner;
el.vml.image.path = image;
el.vml.stroke.path = outer + inner;
this.clipImage(el);
},
nixBorder: function(el) {
var s = el.currentStyle;
var sides = ['Top', 'Left', 'Right', 'Bottom'];
for (var i=0; i<4; i++) {
el.runtimeStyle['padding' + sides[i]] = (parseInt(s['padding' + sides[i]], 10) || 0) + (parseInt(s['border' + sides[i] + 'Width'], 10) || 0) + 'px';
}
el.runtimeStyle.border = 'none';
},
clipImage: function(el) {
var lib = DD_roundies;
if (!el.vmlBg || !lib.imgSize[el.vmlBg]) {
return;
}
var thisStyle = el.currentStyle;
var bg = {'X':0, 'Y':0};
var figurePercentage = function(axis, position) {
var fraction = true;
switch(position) {
case 'left':
case 'top':
bg[axis] = 0;
break;
case 'center':
bg[axis] = 0.5;
break;
case 'right':
case 'bottom':
bg[axis] = 1;
break;
default:
if (position.search('%') != -1) {
bg[axis] = parseInt(position, 10) * 0.01;
}
else {
fraction = false;
}
}
var horz = (axis == 'X');
bg[axis] = Math.ceil(fraction ? (( el.dim[horz ? 'Width' : 'Height'] - (el.bW[horz ? 'Left' : 'Top'] + el.bW[horz ? 'Right' : 'Bottom']) ) * bg[axis]) - (lib.imgSize[el.vmlBg][horz ? 'width' : 'height'] * bg[axis]) : parseInt(position, 10));
bg[axis] += 1;
};
for (var b in bg) {
figurePercentage(b, thisStyle['backgroundPosition'+b]);
}
el.vml.image.filler.position = (bg.X/(el.dim.Width-el.bW.Left-el.bW.Right+1)) + ',' + (bg.Y/(el.dim.Height-el.bW.Top-el.bW.Bottom+1));
var bgR = thisStyle.backgroundRepeat;
var c = {'T':1, 'R':el.dim.Width+1, 'B':el.dim.Height+1, 'L':1}; /* these are defaults for repeat of any kind */
var altC = { 'X': {'b1': 'L', 'b2': 'R', 'd': 'Width'}, 'Y': {'b1': 'T', 'b2': 'B', 'd': 'Height'} };
if (bgR != 'repeat') {
c = {'T':(bg.Y), 'R':(bg.X+lib.imgSize[el.vmlBg].width), 'B':(bg.Y+lib.imgSize[el.vmlBg].height), 'L':(bg.X)}; /* these are defaults for no-repeat - clips down to the image location */
if (bgR.search('repeat-') != -1) { /* now let's revert to dC for repeat-x or repeat-y */
var v = bgR.split('repeat-')[1].toUpperCase();
c[altC[v].b1] = 1;
c[altC[v].b2] = el.dim[altC[v].d]+1;
}
if (c.B > el.dim.Height) {
c.B = el.dim.Height+1;
}
}
el.vml.image.style.clip = 'rect('+c.T+'px '+c.R+'px '+c.B+'px '+c.L+'px)';
},
pseudoClass: function(el) {
var self = this;
setTimeout(function() { /* would not work as intended without setTimeout */
self.applyVML(el);
}, 1);
},
reposition: function(el) {
this.vmlOffsets(el);
this.vmlPath(el);
},
roundify: function(rad) {
this.style.behavior = 'none';
if (!this.currentStyle) {
return;
}
else {
var thisStyle = this.currentStyle;
}
var allowed = {BODY: false, TABLE: false, TR: false, TD: false, SELECT: false, OPTION: false, TEXTAREA: false};
if (allowed[this.nodeName] === false) { /* elements not supported yet */
return;
}
var self = this; /* who knows when you might need a setTimeout */
var lib = DD_roundies;
this.DD_radii = rad;
this.dim = {};
/* attach handlers */
var handlers = {resize: 'reposition', move: 'reposition'};
if (this.nodeName == 'A') {
var moreForAs = {mouseleave: 'pseudoClass', mouseenter: 'pseudoClass', focus: 'pseudoClass', blur: 'pseudoClass'};
for (var a in moreForAs) {
handlers[a] = moreForAs[a];
}
}
for (var h in handlers) {
this.attachEvent('on' + h, function() {
lib[handlers[h]](self);
});
}
this.attachEvent('onpropertychange', function() {
lib.readPropertyChanges(self);
});
/* ensure that this elent and its parent is given hasLayout (needed for accurate positioning) */
var giveLayout = function(el) {
el.style.zoom = 1;
if (el.currentStyle.position == 'static') {
el.style.position = 'relative';
}
};
giveLayout(this.offsetParent);
giveLayout(this);
/* create vml elements */
this.vmlBox = document.createElement('ignore'); /* IE8 really wants to be encased in a wrapper element for the VML to work, and I don't want to disturb getElementsByTagName('div') - open to suggestion on how to do this differently */
this.vmlBox.runtimeStyle.cssText = 'behavior:none; position:absolute; margin:0; padding:0; border:0; background:none;'; /* super important - if something accidentally matches this (you yourseld did this once, Drew), you'll get infinitely-created elements and a frozen browser! */
this.vmlBox.style.zIndex = thisStyle.zIndex;
this.vml = {'color':true, 'image':true, 'stroke':true};
for (var v in this.vml) {
this.vml[v] = document.createElement(lib.ns + ':shape');
this.vml[v].filler = document.createElement(lib.ns + ':fill');
this.vml[v].appendChild(this.vml[v].filler);
this.vml[v].stroked = false;
this.vml[v].style.position = 'absolute';
this.vml[v].style.zIndex = thisStyle.zIndex;
this.vml[v].coordorigin = '1,1';
this.vmlBox.appendChild(this.vml[v]);
}
this.vml.image.fillcolor = 'none';
this.vml.image.filler.type = 'tile';
this.parentNode.insertBefore(this.vmlBox, this);
this.isImg = false;
if (this.nodeName == 'IMG') {
this.isImg = true;
this.style.visibility = 'hidden';
}
setTimeout(function() {
lib.applyVML(self);
}, 1);
}
};
try {
document.execCommand("BackgroundImageCache", false, true);
} catch(err) {}
DD_roundies.IEversion();
DD_roundies.createVmlNameSpace();
DD_roundies.createVmlStyleSheet();
if (DD_roundies.IE8 && document.attachEvent && DD_roundies.querySelector) {
document.attachEvent('onreadystatechange', function() {
if (document.readyState == 'complete') {
var selectors = DD_roundies.selectorsToProcess;
var length = selectors.length;
var delayedCall = function(node, radii, index) {
setTimeout(function() {
DD_roundies.roundify.call(node, radii);
}, index*100);
};
for (var i=0; i<length; i++) {
var results = document.querySelectorAll(selectors[i].selector);
var rLength = results.length;
for (var r=0; r<rLength; r++) {
if (results[r].nodeName != 'INPUT') { /* IE8 doesn't like to do this to inputs yet */
delayedCall(results[r], selectors[i].radii, r);
}
}
}
}
});
}
\ No newline at end of file
/*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
function addChar(input, character) {
if(input.value == null || input.value == "0")
input.value = character
else
input.value += character
}
function cos(form) {
form.display.value = Math.cos(form.display.value);
}
function sin(form) {
form.display.value = Math.sin(form.display.value);
}
function tan(form) {
form.display.value = Math.tan(form.display.value);
}
function sqrt(form) {
form.display.value = Math.sqrt(form.display.value);
}
function ln(form) {
form.display.value = Math.log(form.display.value);
}
function exp(form) {
form.display.value = Math.exp(form.display.value);
}
function deleteChar(input) {
input.value = input.value.substring(0, input.value.length - 1)
}
function changeSign(input) {
if(input.value.substring(0, 1) == "-")
input.value = input.value.substring(1, input.value.length)
else
input.value = "-" + input.value
}
function square(form) {
form.display.value = eval(form.display.value) * eval(form.display.value)
}
function checkNum(str) {
for (var i = 0; i < str.length; i++) {
var ch = str.substring(i, i+1)
if (ch < "0" || ch > "9") {
if (ch != "/" && ch != "*" && ch != "+" && ch != "-" && ch != "."
&& ch != "(" && ch!= ")") {
$("#display").text("ERROR");
return false
}
}
}
return true
}
\ No newline at end of file
/*
* jQuery JavaScript Library v1.3.2
* http://jquery.com/
*
* Copyright (c) 2009 John Resig
* Dual licensed under the MIT and GPL licenses.
* http://docs.jquery.com/License
*
* Date: 2009-02-19 17:34:21 -0500 (Thu, 19 Feb 2009)
* Revision: 6246
*/
(function(){var l=this,g,y=l.jQuery,p=l.$,o=l.jQuery=l.$=function(E,F){return new o.fn.init(E,F)},D=/^[^<]*(<(.|\s)+>)[^>]*$|^#([\w-]+)$/,f=/^.[^:#\[\.,]*$/;o.fn=o.prototype={init:function(E,H){E=E||document;if(E.nodeType){this[0]=E;this.length=1;this.context=E;return this}if(typeof E==="string"){var G=D.exec(E);if(G&&(G[1]||!H)){if(G[1]){E=o.clean([G[1]],H)}else{var I=document.getElementById(G[3]);if(I&&I.id!=G[3]){return o().find(E)}var F=o(I||[]);F.context=document;F.selector=E;return F}}else{return o(H).find(E)}}else{if(o.isFunction(E)){return o(document).ready(E)}}if(E.selector&&E.context){this.selector=E.selector;this.context=E.context}return this.setArray(o.isArray(E)?E:o.makeArray(E))},selector:"",jquery:"1.3.2",size:function(){return this.length},get:function(E){return E===g?Array.prototype.slice.call(this):this[E]},pushStack:function(F,H,E){var G=o(F);G.prevObject=this;G.context=this.context;if(H==="find"){G.selector=this.selector+(this.selector?" ":"")+E}else{if(H){G.selector=this.selector+"."+H+"("+E+")"}}return G},setArray:function(E){this.length=0;Array.prototype.push.apply(this,E);return this},each:function(F,E){return o.each(this,F,E)},index:function(E){return o.inArray(E&&E.jquery?E[0]:E,this)},attr:function(F,H,G){var E=F;if(typeof F==="string"){if(H===g){return this[0]&&o[G||"attr"](this[0],F)}else{E={};E[F]=H}}return this.each(function(I){for(F in E){o.attr(G?this.style:this,F,o.prop(this,E[F],G,I,F))}})},css:function(E,F){if((E=="width"||E=="height")&&parseFloat(F)<0){F=g}return this.attr(E,F,"curCSS")},text:function(F){if(typeof F!=="object"&&F!=null){return this.empty().append((this[0]&&this[0].ownerDocument||document).createTextNode(F))}var E="";o.each(F||this,function(){o.each(this.childNodes,function(){if(this.nodeType!=8){E+=this.nodeType!=1?this.nodeValue:o.fn.text([this])}})});return E},wrapAll:function(E){if(this[0]){var F=o(E,this[0].ownerDocument).clone();if(this[0].parentNode){F.insertBefore(this[0])}F.map(function(){var G=this;while(G.firstChild){G=G.firstChild}return G}).append(this)}return this},wrapInner:function(E){return this.each(function(){o(this).contents().wrapAll(E)})},wrap:function(E){return this.each(function(){o(this).wrapAll(E)})},append:function(){return this.domManip(arguments,true,function(E){if(this.nodeType==1){this.appendChild(E)}})},prepend:function(){return this.domManip(arguments,true,function(E){if(this.nodeType==1){this.insertBefore(E,this.firstChild)}})},before:function(){return this.domManip(arguments,false,function(E){this.parentNode.insertBefore(E,this)})},after:function(){return this.domManip(arguments,false,function(E){this.parentNode.insertBefore(E,this.nextSibling)})},end:function(){return this.prevObject||o([])},push:[].push,sort:[].sort,splice:[].splice,find:function(E){if(this.length===1){var F=this.pushStack([],"find",E);F.length=0;o.find(E,this[0],F);return F}else{return this.pushStack(o.unique(o.map(this,function(G){return o.find(E,G)})),"find",E)}},clone:function(G){var E=this.map(function(){if(!o.support.noCloneEvent&&!o.isXMLDoc(this)){var I=this.outerHTML;if(!I){var J=this.ownerDocument.createElement("div");J.appendChild(this.cloneNode(true));I=J.innerHTML}return o.clean([I.replace(/ jQuery\d+="(?:\d+|null)"/g,"").replace(/^\s*/,"")])[0]}else{return this.cloneNode(true)}});if(G===true){var H=this.find("*").andSelf(),F=0;E.find("*").andSelf().each(function(){if(this.nodeName!==H[F].nodeName){return}var I=o.data(H[F],"events");for(var K in I){for(var J in I[K]){o.event.add(this,K,I[K][J],I[K][J].data)}}F++})}return E},filter:function(E){return this.pushStack(o.isFunction(E)&&o.grep(this,function(G,F){return E.call(G,F)})||o.multiFilter(E,o.grep(this,function(F){return F.nodeType===1})),"filter",E)},closest:function(E){var G=o.expr.match.POS.test(E)?o(E):null,F=0;return this.map(function(){var H=this;while(H&&H.ownerDocument){if(G?G.index(H)>-1:o(H).is(E)){o.data(H,"closest",F);return H}H=H.parentNode;F++}})},not:function(E){if(typeof E==="string"){if(f.test(E)){return this.pushStack(o.multiFilter(E,this,true),"not",E)}else{E=o.multiFilter(E,this)}}var F=E.length&&E[E.length-1]!==g&&!E.nodeType;return this.filter(function(){return F?o.inArray(this,E)<0:this!=E})},add:function(E){return this.pushStack(o.unique(o.merge(this.get(),typeof E==="string"?o(E):o.makeArray(E))))},is:function(E){return !!E&&o.multiFilter(E,this).length>0},hasClass:function(E){return !!E&&this.is("."+E)},val:function(K){if(K===g){var E=this[0];if(E){if(o.nodeName(E,"option")){return(E.attributes.value||{}).specified?E.value:E.text}if(o.nodeName(E,"select")){var I=E.selectedIndex,L=[],M=E.options,H=E.type=="select-one";if(I<0){return null}for(var F=H?I:0,J=H?I+1:M.length;F<J;F++){var G=M[F];if(G.selected){K=o(G).val();if(H){return K}L.push(K)}}return L}return(E.value||"").replace(/\r/g,"")}return g}if(typeof K==="number"){K+=""}return this.each(function(){if(this.nodeType!=1){return}if(o.isArray(K)&&/radio|checkbox/.test(this.type)){this.checked=(o.inArray(this.value,K)>=0||o.inArray(this.name,K)>=0)}else{if(o.nodeName(this,"select")){var N=o.makeArray(K);o("option",this).each(function(){this.selected=(o.inArray(this.value,N)>=0||o.inArray(this.text,N)>=0)});if(!N.length){this.selectedIndex=-1}}else{this.value=K}}})},html:function(E){return E===g?(this[0]?this[0].innerHTML.replace(/ jQuery\d+="(?:\d+|null)"/g,""):null):this.empty().append(E)},replaceWith:function(E){return this.after(E).remove()},eq:function(E){return this.slice(E,+E+1)},slice:function(){return this.pushStack(Array.prototype.slice.apply(this,arguments),"slice",Array.prototype.slice.call(arguments).join(","))},map:function(E){return this.pushStack(o.map(this,function(G,F){return E.call(G,F,G)}))},andSelf:function(){return this.add(this.prevObject)},domManip:function(J,M,L){if(this[0]){var I=(this[0].ownerDocument||this[0]).createDocumentFragment(),F=o.clean(J,(this[0].ownerDocument||this[0]),I),H=I.firstChild;if(H){for(var G=0,E=this.length;G<E;G++){L.call(K(this[G],H),this.length>1||G>0?I.cloneNode(true):I)}}if(F){o.each(F,z)}}return this;function K(N,O){return M&&o.nodeName(N,"table")&&o.nodeName(O,"tr")?(N.getElementsByTagName("tbody")[0]||N.appendChild(N.ownerDocument.createElement("tbody"))):N}}};o.fn.init.prototype=o.fn;function z(E,F){if(F.src){o.ajax({url:F.src,async:false,dataType:"script"})}else{o.globalEval(F.text||F.textContent||F.innerHTML||"")}if(F.parentNode){F.parentNode.removeChild(F)}}function e(){return +new Date}o.extend=o.fn.extend=function(){var J=arguments[0]||{},H=1,I=arguments.length,E=false,G;if(typeof J==="boolean"){E=J;J=arguments[1]||{};H=2}if(typeof J!=="object"&&!o.isFunction(J)){J={}}if(I==H){J=this;--H}for(;H<I;H++){if((G=arguments[H])!=null){for(var F in G){var K=J[F],L=G[F];if(J===L){continue}if(E&&L&&typeof L==="object"&&!L.nodeType){J[F]=o.extend(E,K||(L.length!=null?[]:{}),L)}else{if(L!==g){J[F]=L}}}}}return J};var b=/z-?index|font-?weight|opacity|zoom|line-?height/i,q=document.defaultView||{},s=Object.prototype.toString;o.extend({noConflict:function(E){l.$=p;if(E){l.jQuery=y}return o},isFunction:function(E){return s.call(E)==="[object Function]"},isArray:function(E){return s.call(E)==="[object Array]"},isXMLDoc:function(E){return E.nodeType===9&&E.documentElement.nodeName!=="HTML"||!!E.ownerDocument&&o.isXMLDoc(E.ownerDocument)},globalEval:function(G){if(G&&/\S/.test(G)){var F=document.getElementsByTagName("head")[0]||document.documentElement,E=document.createElement("script");E.type="text/javascript";if(o.support.scriptEval){E.appendChild(document.createTextNode(G))}else{E.text=G}F.insertBefore(E,F.firstChild);F.removeChild(E)}},nodeName:function(F,E){return F.nodeName&&F.nodeName.toUpperCase()==E.toUpperCase()},each:function(G,K,F){var E,H=0,I=G.length;if(F){if(I===g){for(E in G){if(K.apply(G[E],F)===false){break}}}else{for(;H<I;){if(K.apply(G[H++],F)===false){break}}}}else{if(I===g){for(E in G){if(K.call(G[E],E,G[E])===false){break}}}else{for(var J=G[0];H<I&&K.call(J,H,J)!==false;J=G[++H]){}}}return G},prop:function(H,I,G,F,E){if(o.isFunction(I)){I=I.call(H,F)}return typeof I==="number"&&G=="curCSS"&&!b.test(E)?I+"px":I},className:{add:function(E,F){o.each((F||"").split(/\s+/),function(G,H){if(E.nodeType==1&&!o.className.has(E.className,H)){E.className+=(E.className?" ":"")+H}})},remove:function(E,F){if(E.nodeType==1){E.className=F!==g?o.grep(E.className.split(/\s+/),function(G){return !o.className.has(F,G)}).join(" "):""}},has:function(F,E){return F&&o.inArray(E,(F.className||F).toString().split(/\s+/))>-1}},swap:function(H,G,I){var E={};for(var F in G){E[F]=H.style[F];H.style[F]=G[F]}I.call(H);for(var F in G){H.style[F]=E[F]}},css:function(H,F,J,E){if(F=="width"||F=="height"){var L,G={position:"absolute",visibility:"hidden",display:"block"},K=F=="width"?["Left","Right"]:["Top","Bottom"];function I(){L=F=="width"?H.offsetWidth:H.offsetHeight;if(E==="border"){return}o.each(K,function(){if(!E){L-=parseFloat(o.curCSS(H,"padding"+this,true))||0}if(E==="margin"){L+=parseFloat(o.curCSS(H,"margin"+this,true))||0}else{L-=parseFloat(o.curCSS(H,"border"+this+"Width",true))||0}})}if(H.offsetWidth!==0){I()}else{o.swap(H,G,I)}return Math.max(0,Math.round(L))}return o.curCSS(H,F,J)},curCSS:function(I,F,G){var L,E=I.style;if(F=="opacity"&&!o.support.opacity){L=o.attr(E,"opacity");return L==""?"1":L}if(F.match(/float/i)){F=w}if(!G&&E&&E[F]){L=E[F]}else{if(q.getComputedStyle){if(F.match(/float/i)){F="float"}F=F.replace(/([A-Z])/g,"-$1").toLowerCase();var M=q.getComputedStyle(I,null);if(M){L=M.getPropertyValue(F)}if(F=="opacity"&&L==""){L="1"}}else{if(I.currentStyle){var J=F.replace(/\-(\w)/g,function(N,O){return O.toUpperCase()});L=I.currentStyle[F]||I.currentStyle[J];if(!/^\d+(px)?$/i.test(L)&&/^\d/.test(L)){var H=E.left,K=I.runtimeStyle.left;I.runtimeStyle.left=I.currentStyle.left;E.left=L||0;L=E.pixelLeft+"px";E.left=H;I.runtimeStyle.left=K}}}}return L},clean:function(F,K,I){K=K||document;if(typeof K.createElement==="undefined"){K=K.ownerDocument||K[0]&&K[0].ownerDocument||document}if(!I&&F.length===1&&typeof F[0]==="string"){var H=/^<(\w+)\s*\/?>$/.exec(F[0]);if(H){return[K.createElement(H[1])]}}var G=[],E=[],L=K.createElement("div");o.each(F,function(P,S){if(typeof S==="number"){S+=""}if(!S){return}if(typeof S==="string"){S=S.replace(/(<(\w+)[^>]*?)\/>/g,function(U,V,T){return T.match(/^(abbr|br|col|img|input|link|meta|param|hr|area|embed)$/i)?U:V+"></"+T+">"});var O=S.replace(/^\s+/,"").substring(0,10).toLowerCase();var Q=!O.indexOf("<opt")&&[1,"<select multiple='multiple'>","</select>"]||!O.indexOf("<leg")&&[1,"<fieldset>","</fieldset>"]||O.match(/^<(thead|tbody|tfoot|colg|cap)/)&&[1,"<table>","</table>"]||!O.indexOf("<tr")&&[2,"<table><tbody>","</tbody></table>"]||(!O.indexOf("<td")||!O.indexOf("<th"))&&[3,"<table><tbody><tr>","</tr></tbody></table>"]||!O.indexOf("<col")&&[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"]||!o.support.htmlSerialize&&[1,"div<div>","</div>"]||[0,"",""];L.innerHTML=Q[1]+S+Q[2];while(Q[0]--){L=L.lastChild}if(!o.support.tbody){var R=/<tbody/i.test(S),N=!O.indexOf("<table")&&!R?L.firstChild&&L.firstChild.childNodes:Q[1]=="<table>"&&!R?L.childNodes:[];for(var M=N.length-1;M>=0;--M){if(o.nodeName(N[M],"tbody")&&!N[M].childNodes.length){N[M].parentNode.removeChild(N[M])}}}if(!o.support.leadingWhitespace&&/^\s/.test(S)){L.insertBefore(K.createTextNode(S.match(/^\s*/)[0]),L.firstChild)}S=o.makeArray(L.childNodes)}if(S.nodeType){G.push(S)}else{G=o.merge(G,S)}});if(I){for(var J=0;G[J];J++){if(o.nodeName(G[J],"script")&&(!G[J].type||G[J].type.toLowerCase()==="text/javascript")){E.push(G[J].parentNode?G[J].parentNode.removeChild(G[J]):G[J])}else{if(G[J].nodeType===1){G.splice.apply(G,[J+1,0].concat(o.makeArray(G[J].getElementsByTagName("script"))))}I.appendChild(G[J])}}return E}return G},attr:function(J,G,K){if(!J||J.nodeType==3||J.nodeType==8){return g}var H=!o.isXMLDoc(J),L=K!==g;G=H&&o.props[G]||G;if(J.tagName){var F=/href|src|style/.test(G);if(G=="selected"&&J.parentNode){J.parentNode.selectedIndex}if(G in J&&H&&!F){if(L){if(G=="type"&&o.nodeName(J,"input")&&J.parentNode){throw"type property can't be changed"}J[G]=K}if(o.nodeName(J,"form")&&J.getAttributeNode(G)){return J.getAttributeNode(G).nodeValue}if(G=="tabIndex"){var I=J.getAttributeNode("tabIndex");return I&&I.specified?I.value:J.nodeName.match(/(button|input|object|select|textarea)/i)?0:J.nodeName.match(/^(a|area)$/i)&&J.href?0:g}return J[G]}if(!o.support.style&&H&&G=="style"){return o.attr(J.style,"cssText",K)}if(L){J.setAttribute(G,""+K)}var E=!o.support.hrefNormalized&&H&&F?J.getAttribute(G,2):J.getAttribute(G);return E===null?g:E}if(!o.support.opacity&&G=="opacity"){if(L){J.zoom=1;J.filter=(J.filter||"").replace(/alpha\([^)]*\)/,"")+(parseInt(K)+""=="NaN"?"":"alpha(opacity="+K*100+")")}return J.filter&&J.filter.indexOf("opacity=")>=0?(parseFloat(J.filter.match(/opacity=([^)]*)/)[1])/100)+"":""}G=G.replace(/-([a-z])/ig,function(M,N){return N.toUpperCase()});if(L){J[G]=K}return J[G]},trim:function(E){return(E||"").replace(/^\s+|\s+$/g,"")},makeArray:function(G){var E=[];if(G!=null){var F=G.length;if(F==null||typeof G==="string"||o.isFunction(G)||G.setInterval){E[0]=G}else{while(F){E[--F]=G[F]}}}return E},inArray:function(G,H){for(var E=0,F=H.length;E<F;E++){if(H[E]===G){return E}}return -1},merge:function(H,E){var F=0,G,I=H.length;if(!o.support.getAll){while((G=E[F++])!=null){if(G.nodeType!=8){H[I++]=G}}}else{while((G=E[F++])!=null){H[I++]=G}}return H},unique:function(K){var F=[],E={};try{for(var G=0,H=K.length;G<H;G++){var J=o.data(K[G]);if(!E[J]){E[J]=true;F.push(K[G])}}}catch(I){F=K}return F},grep:function(F,J,E){var G=[];for(var H=0,I=F.length;H<I;H++){if(!E!=!J(F[H],H)){G.push(F[H])}}return G},map:function(E,J){var F=[];for(var G=0,H=E.length;G<H;G++){var I=J(E[G],G);if(I!=null){F[F.length]=I}}return F.concat.apply([],F)}});var C=navigator.userAgent.toLowerCase();o.browser={version:(C.match(/.+(?:rv|it|ra|ie)[\/: ]([\d.]+)/)||[0,"0"])[1],safari:/webkit/.test(C),opera:/opera/.test(C),msie:/msie/.test(C)&&!/opera/.test(C),mozilla:/mozilla/.test(C)&&!/(compatible|webkit)/.test(C)};o.each({parent:function(E){return E.parentNode},parents:function(E){return o.dir(E,"parentNode")},next:function(E){return o.nth(E,2,"nextSibling")},prev:function(E){return o.nth(E,2,"previousSibling")},nextAll:function(E){return o.dir(E,"nextSibling")},prevAll:function(E){return o.dir(E,"previousSibling")},siblings:function(E){return o.sibling(E.parentNode.firstChild,E)},children:function(E){return o.sibling(E.firstChild)},contents:function(E){return o.nodeName(E,"iframe")?E.contentDocument||E.contentWindow.document:o.makeArray(E.childNodes)}},function(E,F){o.fn[E]=function(G){var H=o.map(this,F);if(G&&typeof G=="string"){H=o.multiFilter(G,H)}return this.pushStack(o.unique(H),E,G)}});o.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(E,F){o.fn[E]=function(G){var J=[],L=o(G);for(var K=0,H=L.length;K<H;K++){var I=(K>0?this.clone(true):this).get();o.fn[F].apply(o(L[K]),I);J=J.concat(I)}return this.pushStack(J,E,G)}});o.each({removeAttr:function(E){o.attr(this,E,"");if(this.nodeType==1){this.removeAttribute(E)}},addClass:function(E){o.className.add(this,E)},removeClass:function(E){o.className.remove(this,E)},toggleClass:function(F,E){if(typeof E!=="boolean"){E=!o.className.has(this,F)}o.className[E?"add":"remove"](this,F)},remove:function(E){if(!E||o.filter(E,[this]).length){o("*",this).add([this]).each(function(){o.event.remove(this);o.removeData(this)});if(this.parentNode){this.parentNode.removeChild(this)}}},empty:function(){o(this).children().remove();while(this.firstChild){this.removeChild(this.firstChild)}}},function(E,F){o.fn[E]=function(){return this.each(F,arguments)}});function j(E,F){return E[0]&&parseInt(o.curCSS(E[0],F,true),10)||0}var h="jQuery"+e(),v=0,A={};o.extend({cache:{},data:function(F,E,G){F=F==l?A:F;var H=F[h];if(!H){H=F[h]=++v}if(E&&!o.cache[H]){o.cache[H]={}}if(G!==g){o.cache[H][E]=G}return E?o.cache[H][E]:H},removeData:function(F,E){F=F==l?A:F;var H=F[h];if(E){if(o.cache[H]){delete o.cache[H][E];E="";for(E in o.cache[H]){break}if(!E){o.removeData(F)}}}else{try{delete F[h]}catch(G){if(F.removeAttribute){F.removeAttribute(h)}}delete o.cache[H]}},queue:function(F,E,H){if(F){E=(E||"fx")+"queue";var G=o.data(F,E);if(!G||o.isArray(H)){G=o.data(F,E,o.makeArray(H))}else{if(H){G.push(H)}}}return G},dequeue:function(H,G){var E=o.queue(H,G),F=E.shift();if(!G||G==="fx"){F=E[0]}if(F!==g){F.call(H)}}});o.fn.extend({data:function(E,G){var H=E.split(".");H[1]=H[1]?"."+H[1]:"";if(G===g){var F=this.triggerHandler("getData"+H[1]+"!",[H[0]]);if(F===g&&this.length){F=o.data(this[0],E)}return F===g&&H[1]?this.data(H[0]):F}else{return this.trigger("setData"+H[1]+"!",[H[0],G]).each(function(){o.data(this,E,G)})}},removeData:function(E){return this.each(function(){o.removeData(this,E)})},queue:function(E,F){if(typeof E!=="string"){F=E;E="fx"}if(F===g){return o.queue(this[0],E)}return this.each(function(){var G=o.queue(this,E,F);if(E=="fx"&&G.length==1){G[0].call(this)}})},dequeue:function(E){return this.each(function(){o.dequeue(this,E)})}});
/*
* Sizzle CSS Selector Engine - v0.9.3
* Copyright 2009, The Dojo Foundation
* Released under the MIT, BSD, and GPL Licenses.
* More information: http://sizzlejs.com/
*/
(function(){var R=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"][^'"]*['"]|[^[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?/g,L=0,H=Object.prototype.toString;var F=function(Y,U,ab,ac){ab=ab||[];U=U||document;if(U.nodeType!==1&&U.nodeType!==9){return[]}if(!Y||typeof Y!=="string"){return ab}var Z=[],W,af,ai,T,ad,V,X=true;R.lastIndex=0;while((W=R.exec(Y))!==null){Z.push(W[1]);if(W[2]){V=RegExp.rightContext;break}}if(Z.length>1&&M.exec(Y)){if(Z.length===2&&I.relative[Z[0]]){af=J(Z[0]+Z[1],U)}else{af=I.relative[Z[0]]?[U]:F(Z.shift(),U);while(Z.length){Y=Z.shift();if(I.relative[Y]){Y+=Z.shift()}af=J(Y,af)}}}else{var ae=ac?{expr:Z.pop(),set:E(ac)}:F.find(Z.pop(),Z.length===1&&U.parentNode?U.parentNode:U,Q(U));af=F.filter(ae.expr,ae.set);if(Z.length>0){ai=E(af)}else{X=false}while(Z.length){var ah=Z.pop(),ag=ah;if(!I.relative[ah]){ah=""}else{ag=Z.pop()}if(ag==null){ag=U}I.relative[ah](ai,ag,Q(U))}}if(!ai){ai=af}if(!ai){throw"Syntax error, unrecognized expression: "+(ah||Y)}if(H.call(ai)==="[object Array]"){if(!X){ab.push.apply(ab,ai)}else{if(U.nodeType===1){for(var aa=0;ai[aa]!=null;aa++){if(ai[aa]&&(ai[aa]===true||ai[aa].nodeType===1&&K(U,ai[aa]))){ab.push(af[aa])}}}else{for(var aa=0;ai[aa]!=null;aa++){if(ai[aa]&&ai[aa].nodeType===1){ab.push(af[aa])}}}}}else{E(ai,ab)}if(V){F(V,U,ab,ac);if(G){hasDuplicate=false;ab.sort(G);if(hasDuplicate){for(var aa=1;aa<ab.length;aa++){if(ab[aa]===ab[aa-1]){ab.splice(aa--,1)}}}}}return ab};F.matches=function(T,U){return F(T,null,null,U)};F.find=function(aa,T,ab){var Z,X;if(!aa){return[]}for(var W=0,V=I.order.length;W<V;W++){var Y=I.order[W],X;if((X=I.match[Y].exec(aa))){var U=RegExp.leftContext;if(U.substr(U.length-1)!=="\\"){X[1]=(X[1]||"").replace(/\\/g,"");Z=I.find[Y](X,T,ab);if(Z!=null){aa=aa.replace(I.match[Y],"");break}}}}if(!Z){Z=T.getElementsByTagName("*")}return{set:Z,expr:aa}};F.filter=function(ad,ac,ag,W){var V=ad,ai=[],aa=ac,Y,T,Z=ac&&ac[0]&&Q(ac[0]);while(ad&&ac.length){for(var ab in I.filter){if((Y=I.match[ab].exec(ad))!=null){var U=I.filter[ab],ah,af;T=false;if(aa==ai){ai=[]}if(I.preFilter[ab]){Y=I.preFilter[ab](Y,aa,ag,ai,W,Z);if(!Y){T=ah=true}else{if(Y===true){continue}}}if(Y){for(var X=0;(af=aa[X])!=null;X++){if(af){ah=U(af,Y,X,aa);var ae=W^!!ah;if(ag&&ah!=null){if(ae){T=true}else{aa[X]=false}}else{if(ae){ai.push(af);T=true}}}}}if(ah!==g){if(!ag){aa=ai}ad=ad.replace(I.match[ab],"");if(!T){return[]}break}}}if(ad==V){if(T==null){throw"Syntax error, unrecognized expression: "+ad}else{break}}V=ad}return aa};var I=F.selectors={order:["ID","NAME","TAG"],match:{ID:/#((?:[\w\u00c0-\uFFFF_-]|\\.)+)/,CLASS:/\.((?:[\w\u00c0-\uFFFF_-]|\\.)+)/,NAME:/\[name=['"]*((?:[\w\u00c0-\uFFFF_-]|\\.)+)['"]*\]/,ATTR:/\[\s*((?:[\w\u00c0-\uFFFF_-]|\\.)+)\s*(?:(\S?=)\s*(['"]*)(.*?)\3|)\s*\]/,TAG:/^((?:[\w\u00c0-\uFFFF\*_-]|\\.)+)/,CHILD:/:(only|nth|last|first)-child(?:\((even|odd|[\dn+-]*)\))?/,POS:/:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^-]|$)/,PSEUDO:/:((?:[\w\u00c0-\uFFFF_-]|\\.)+)(?:\((['"]*)((?:\([^\)]+\)|[^\2\(\)]*)+)\2\))?/},attrMap:{"class":"className","for":"htmlFor"},attrHandle:{href:function(T){return T.getAttribute("href")}},relative:{"+":function(aa,T,Z){var X=typeof T==="string",ab=X&&!/\W/.test(T),Y=X&&!ab;if(ab&&!Z){T=T.toUpperCase()}for(var W=0,V=aa.length,U;W<V;W++){if((U=aa[W])){while((U=U.previousSibling)&&U.nodeType!==1){}aa[W]=Y||U&&U.nodeName===T?U||false:U===T}}if(Y){F.filter(T,aa,true)}},">":function(Z,U,aa){var X=typeof U==="string";if(X&&!/\W/.test(U)){U=aa?U:U.toUpperCase();for(var V=0,T=Z.length;V<T;V++){var Y=Z[V];if(Y){var W=Y.parentNode;Z[V]=W.nodeName===U?W:false}}}else{for(var V=0,T=Z.length;V<T;V++){var Y=Z[V];if(Y){Z[V]=X?Y.parentNode:Y.parentNode===U}}if(X){F.filter(U,Z,true)}}},"":function(W,U,Y){var V=L++,T=S;if(!U.match(/\W/)){var X=U=Y?U:U.toUpperCase();T=P}T("parentNode",U,V,W,X,Y)},"~":function(W,U,Y){var V=L++,T=S;if(typeof U==="string"&&!U.match(/\W/)){var X=U=Y?U:U.toUpperCase();T=P}T("previousSibling",U,V,W,X,Y)}},find:{ID:function(U,V,W){if(typeof V.getElementById!=="undefined"&&!W){var T=V.getElementById(U[1]);return T?[T]:[]}},NAME:function(V,Y,Z){if(typeof Y.getElementsByName!=="undefined"){var U=[],X=Y.getElementsByName(V[1]);for(var W=0,T=X.length;W<T;W++){if(X[W].getAttribute("name")===V[1]){U.push(X[W])}}return U.length===0?null:U}},TAG:function(T,U){return U.getElementsByTagName(T[1])}},preFilter:{CLASS:function(W,U,V,T,Z,aa){W=" "+W[1].replace(/\\/g,"")+" ";if(aa){return W}for(var X=0,Y;(Y=U[X])!=null;X++){if(Y){if(Z^(Y.className&&(" "+Y.className+" ").indexOf(W)>=0)){if(!V){T.push(Y)}}else{if(V){U[X]=false}}}}return false},ID:function(T){return T[1].replace(/\\/g,"")},TAG:function(U,T){for(var V=0;T[V]===false;V++){}return T[V]&&Q(T[V])?U[1]:U[1].toUpperCase()},CHILD:function(T){if(T[1]=="nth"){var U=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(T[2]=="even"&&"2n"||T[2]=="odd"&&"2n+1"||!/\D/.test(T[2])&&"0n+"+T[2]||T[2]);T[2]=(U[1]+(U[2]||1))-0;T[3]=U[3]-0}T[0]=L++;return T},ATTR:function(X,U,V,T,Y,Z){var W=X[1].replace(/\\/g,"");if(!Z&&I.attrMap[W]){X[1]=I.attrMap[W]}if(X[2]==="~="){X[4]=" "+X[4]+" "}return X},PSEUDO:function(X,U,V,T,Y){if(X[1]==="not"){if(X[3].match(R).length>1||/^\w/.test(X[3])){X[3]=F(X[3],null,null,U)}else{var W=F.filter(X[3],U,V,true^Y);if(!V){T.push.apply(T,W)}return false}}else{if(I.match.POS.test(X[0])||I.match.CHILD.test(X[0])){return true}}return X},POS:function(T){T.unshift(true);return T}},filters:{enabled:function(T){return T.disabled===false&&T.type!=="hidden"},disabled:function(T){return T.disabled===true},checked:function(T){return T.checked===true},selected:function(T){T.parentNode.selectedIndex;return T.selected===true},parent:function(T){return !!T.firstChild},empty:function(T){return !T.firstChild},has:function(V,U,T){return !!F(T[3],V).length},header:function(T){return/h\d/i.test(T.nodeName)},text:function(T){return"text"===T.type},radio:function(T){return"radio"===T.type},checkbox:function(T){return"checkbox"===T.type},file:function(T){return"file"===T.type},password:function(T){return"password"===T.type},submit:function(T){return"submit"===T.type},image:function(T){return"image"===T.type},reset:function(T){return"reset"===T.type},button:function(T){return"button"===T.type||T.nodeName.toUpperCase()==="BUTTON"},input:function(T){return/input|select|textarea|button/i.test(T.nodeName)}},setFilters:{first:function(U,T){return T===0},last:function(V,U,T,W){return U===W.length-1},even:function(U,T){return T%2===0},odd:function(U,T){return T%2===1},lt:function(V,U,T){return U<T[3]-0},gt:function(V,U,T){return U>T[3]-0},nth:function(V,U,T){return T[3]-0==U},eq:function(V,U,T){return T[3]-0==U}},filter:{PSEUDO:function(Z,V,W,aa){var U=V[1],X=I.filters[U];if(X){return X(Z,W,V,aa)}else{if(U==="contains"){return(Z.textContent||Z.innerText||"").indexOf(V[3])>=0}else{if(U==="not"){var Y=V[3];for(var W=0,T=Y.length;W<T;W++){if(Y[W]===Z){return false}}return true}}}},CHILD:function(T,W){var Z=W[1],U=T;switch(Z){case"only":case"first":while(U=U.previousSibling){if(U.nodeType===1){return false}}if(Z=="first"){return true}U=T;case"last":while(U=U.nextSibling){if(U.nodeType===1){return false}}return true;case"nth":var V=W[2],ac=W[3];if(V==1&&ac==0){return true}var Y=W[0],ab=T.parentNode;if(ab&&(ab.sizcache!==Y||!T.nodeIndex)){var X=0;for(U=ab.firstChild;U;U=U.nextSibling){if(U.nodeType===1){U.nodeIndex=++X}}ab.sizcache=Y}var aa=T.nodeIndex-ac;if(V==0){return aa==0}else{return(aa%V==0&&aa/V>=0)}}},ID:function(U,T){return U.nodeType===1&&U.getAttribute("id")===T},TAG:function(U,T){return(T==="*"&&U.nodeType===1)||U.nodeName===T},CLASS:function(U,T){return(" "+(U.className||U.getAttribute("class"))+" ").indexOf(T)>-1},ATTR:function(Y,W){var V=W[1],T=I.attrHandle[V]?I.attrHandle[V](Y):Y[V]!=null?Y[V]:Y.getAttribute(V),Z=T+"",X=W[2],U=W[4];return T==null?X==="!=":X==="="?Z===U:X==="*="?Z.indexOf(U)>=0:X==="~="?(" "+Z+" ").indexOf(U)>=0:!U?Z&&T!==false:X==="!="?Z!=U:X==="^="?Z.indexOf(U)===0:X==="$="?Z.substr(Z.length-U.length)===U:X==="|="?Z===U||Z.substr(0,U.length+1)===U+"-":false},POS:function(X,U,V,Y){var T=U[2],W=I.setFilters[T];if(W){return W(X,V,U,Y)}}}};var M=I.match.POS;for(var O in I.match){I.match[O]=RegExp(I.match[O].source+/(?![^\[]*\])(?![^\(]*\))/.source)}var E=function(U,T){U=Array.prototype.slice.call(U);if(T){T.push.apply(T,U);return T}return U};try{Array.prototype.slice.call(document.documentElement.childNodes)}catch(N){E=function(X,W){var U=W||[];if(H.call(X)==="[object Array]"){Array.prototype.push.apply(U,X)}else{if(typeof X.length==="number"){for(var V=0,T=X.length;V<T;V++){U.push(X[V])}}else{for(var V=0;X[V];V++){U.push(X[V])}}}return U}}var G;if(document.documentElement.compareDocumentPosition){G=function(U,T){var V=U.compareDocumentPosition(T)&4?-1:U===T?0:1;if(V===0){hasDuplicate=true}return V}}else{if("sourceIndex" in document.documentElement){G=function(U,T){var V=U.sourceIndex-T.sourceIndex;if(V===0){hasDuplicate=true}return V}}else{if(document.createRange){G=function(W,U){var V=W.ownerDocument.createRange(),T=U.ownerDocument.createRange();V.selectNode(W);V.collapse(true);T.selectNode(U);T.collapse(true);var X=V.compareBoundaryPoints(Range.START_TO_END,T);if(X===0){hasDuplicate=true}return X}}}}(function(){var U=document.createElement("form"),V="script"+(new Date).getTime();U.innerHTML="<input name='"+V+"'/>";var T=document.documentElement;T.insertBefore(U,T.firstChild);if(!!document.getElementById(V)){I.find.ID=function(X,Y,Z){if(typeof Y.getElementById!=="undefined"&&!Z){var W=Y.getElementById(X[1]);return W?W.id===X[1]||typeof W.getAttributeNode!=="undefined"&&W.getAttributeNode("id").nodeValue===X[1]?[W]:g:[]}};I.filter.ID=function(Y,W){var X=typeof Y.getAttributeNode!=="undefined"&&Y.getAttributeNode("id");return Y.nodeType===1&&X&&X.nodeValue===W}}T.removeChild(U)})();(function(){var T=document.createElement("div");T.appendChild(document.createComment(""));if(T.getElementsByTagName("*").length>0){I.find.TAG=function(U,Y){var X=Y.getElementsByTagName(U[1]);if(U[1]==="*"){var W=[];for(var V=0;X[V];V++){if(X[V].nodeType===1){W.push(X[V])}}X=W}return X}}T.innerHTML="<a href='#'></a>";if(T.firstChild&&typeof T.firstChild.getAttribute!=="undefined"&&T.firstChild.getAttribute("href")!=="#"){I.attrHandle.href=function(U){return U.getAttribute("href",2)}}})();if(document.querySelectorAll){(function(){var T=F,U=document.createElement("div");U.innerHTML="<p class='TEST'></p>";if(U.querySelectorAll&&U.querySelectorAll(".TEST").length===0){return}F=function(Y,X,V,W){X=X||document;if(!W&&X.nodeType===9&&!Q(X)){try{return E(X.querySelectorAll(Y),V)}catch(Z){}}return T(Y,X,V,W)};F.find=T.find;F.filter=T.filter;F.selectors=T.selectors;F.matches=T.matches})()}if(document.getElementsByClassName&&document.documentElement.getElementsByClassName){(function(){var T=document.createElement("div");T.innerHTML="<div class='test e'></div><div class='test'></div>";if(T.getElementsByClassName("e").length===0){return}T.lastChild.className="e";if(T.getElementsByClassName("e").length===1){return}I.order.splice(1,0,"CLASS");I.find.CLASS=function(U,V,W){if(typeof V.getElementsByClassName!=="undefined"&&!W){return V.getElementsByClassName(U[1])}}})()}function P(U,Z,Y,ad,aa,ac){var ab=U=="previousSibling"&&!ac;for(var W=0,V=ad.length;W<V;W++){var T=ad[W];if(T){if(ab&&T.nodeType===1){T.sizcache=Y;T.sizset=W}T=T[U];var X=false;while(T){if(T.sizcache===Y){X=ad[T.sizset];break}if(T.nodeType===1&&!ac){T.sizcache=Y;T.sizset=W}if(T.nodeName===Z){X=T;break}T=T[U]}ad[W]=X}}}function S(U,Z,Y,ad,aa,ac){var ab=U=="previousSibling"&&!ac;for(var W=0,V=ad.length;W<V;W++){var T=ad[W];if(T){if(ab&&T.nodeType===1){T.sizcache=Y;T.sizset=W}T=T[U];var X=false;while(T){if(T.sizcache===Y){X=ad[T.sizset];break}if(T.nodeType===1){if(!ac){T.sizcache=Y;T.sizset=W}if(typeof Z!=="string"){if(T===Z){X=true;break}}else{if(F.filter(Z,[T]).length>0){X=T;break}}}T=T[U]}ad[W]=X}}}var K=document.compareDocumentPosition?function(U,T){return U.compareDocumentPosition(T)&16}:function(U,T){return U!==T&&(U.contains?U.contains(T):true)};var Q=function(T){return T.nodeType===9&&T.documentElement.nodeName!=="HTML"||!!T.ownerDocument&&Q(T.ownerDocument)};var J=function(T,aa){var W=[],X="",Y,V=aa.nodeType?[aa]:aa;while((Y=I.match.PSEUDO.exec(T))){X+=Y[0];T=T.replace(I.match.PSEUDO,"")}T=I.relative[T]?T+"*":T;for(var Z=0,U=V.length;Z<U;Z++){F(T,V[Z],W)}return F.filter(X,W)};o.find=F;o.filter=F.filter;o.expr=F.selectors;o.expr[":"]=o.expr.filters;F.selectors.filters.hidden=function(T){return T.offsetWidth===0||T.offsetHeight===0};F.selectors.filters.visible=function(T){return T.offsetWidth>0||T.offsetHeight>0};F.selectors.filters.animated=function(T){return o.grep(o.timers,function(U){return T===U.elem}).length};o.multiFilter=function(V,T,U){if(U){V=":not("+V+")"}return F.matches(V,T)};o.dir=function(V,U){var T=[],W=V[U];while(W&&W!=document){if(W.nodeType==1){T.push(W)}W=W[U]}return T};o.nth=function(X,T,V,W){T=T||1;var U=0;for(;X;X=X[V]){if(X.nodeType==1&&++U==T){break}}return X};o.sibling=function(V,U){var T=[];for(;V;V=V.nextSibling){if(V.nodeType==1&&V!=U){T.push(V)}}return T};return;l.Sizzle=F})();o.event={add:function(I,F,H,K){if(I.nodeType==3||I.nodeType==8){return}if(I.setInterval&&I!=l){I=l}if(!H.guid){H.guid=this.guid++}if(K!==g){var G=H;H=this.proxy(G);H.data=K}var E=o.data(I,"events")||o.data(I,"events",{}),J=o.data(I,"handle")||o.data(I,"handle",function(){return typeof o!=="undefined"&&!o.event.triggered?o.event.handle.apply(arguments.callee.elem,arguments):g});J.elem=I;o.each(F.split(/\s+/),function(M,N){var O=N.split(".");N=O.shift();H.type=O.slice().sort().join(".");var L=E[N];if(o.event.specialAll[N]){o.event.specialAll[N].setup.call(I,K,O)}if(!L){L=E[N]={};if(!o.event.special[N]||o.event.special[N].setup.call(I,K,O)===false){if(I.addEventListener){I.addEventListener(N,J,false)}else{if(I.attachEvent){I.attachEvent("on"+N,J)}}}}L[H.guid]=H;o.event.global[N]=true});I=null},guid:1,global:{},remove:function(K,H,J){if(K.nodeType==3||K.nodeType==8){return}var G=o.data(K,"events"),F,E;if(G){if(H===g||(typeof H==="string"&&H.charAt(0)==".")){for(var I in G){this.remove(K,I+(H||""))}}else{if(H.type){J=H.handler;H=H.type}o.each(H.split(/\s+/),function(M,O){var Q=O.split(".");O=Q.shift();var N=RegExp("(^|\\.)"+Q.slice().sort().join(".*\\.")+"(\\.|$)");if(G[O]){if(J){delete G[O][J.guid]}else{for(var P in G[O]){if(N.test(G[O][P].type)){delete G[O][P]}}}if(o.event.specialAll[O]){o.event.specialAll[O].teardown.call(K,Q)}for(F in G[O]){break}if(!F){if(!o.event.special[O]||o.event.special[O].teardown.call(K,Q)===false){if(K.removeEventListener){K.removeEventListener(O,o.data(K,"handle"),false)}else{if(K.detachEvent){K.detachEvent("on"+O,o.data(K,"handle"))}}}F=null;delete G[O]}}})}for(F in G){break}if(!F){var L=o.data(K,"handle");if(L){L.elem=null}o.removeData(K,"events");o.removeData(K,"handle")}}},trigger:function(I,K,H,E){var G=I.type||I;if(!E){I=typeof I==="object"?I[h]?I:o.extend(o.Event(G),I):o.Event(G);if(G.indexOf("!")>=0){I.type=G=G.slice(0,-1);I.exclusive=true}if(!H){I.stopPropagation();if(this.global[G]){o.each(o.cache,function(){if(this.events&&this.events[G]){o.event.trigger(I,K,this.handle.elem)}})}}if(!H||H.nodeType==3||H.nodeType==8){return g}I.result=g;I.target=H;K=o.makeArray(K);K.unshift(I)}I.currentTarget=H;var J=o.data(H,"handle");if(J){J.apply(H,K)}if((!H[G]||(o.nodeName(H,"a")&&G=="click"))&&H["on"+G]&&H["on"+G].apply(H,K)===false){I.result=false}if(!E&&H[G]&&!I.isDefaultPrevented()&&!(o.nodeName(H,"a")&&G=="click")){this.triggered=true;try{H[G]()}catch(L){}}this.triggered=false;if(!I.isPropagationStopped()){var F=H.parentNode||H.ownerDocument;if(F){o.event.trigger(I,K,F,true)}}},handle:function(K){var J,E;K=arguments[0]=o.event.fix(K||l.event);K.currentTarget=this;var L=K.type.split(".");K.type=L.shift();J=!L.length&&!K.exclusive;var I=RegExp("(^|\\.)"+L.slice().sort().join(".*\\.")+"(\\.|$)");E=(o.data(this,"events")||{})[K.type];for(var G in E){var H=E[G];if(J||I.test(H.type)){K.handler=H;K.data=H.data;var F=H.apply(this,arguments);if(F!==g){K.result=F;if(F===false){K.preventDefault();K.stopPropagation()}}if(K.isImmediatePropagationStopped()){break}}}},props:"altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode metaKey newValue originalTarget pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "),fix:function(H){if(H[h]){return H}var F=H;H=o.Event(F);for(var G=this.props.length,J;G;){J=this.props[--G];H[J]=F[J]}if(!H.target){H.target=H.srcElement||document}if(H.target.nodeType==3){H.target=H.target.parentNode}if(!H.relatedTarget&&H.fromElement){H.relatedTarget=H.fromElement==H.target?H.toElement:H.fromElement}if(H.pageX==null&&H.clientX!=null){var I=document.documentElement,E=document.body;H.pageX=H.clientX+(I&&I.scrollLeft||E&&E.scrollLeft||0)-(I.clientLeft||0);H.pageY=H.clientY+(I&&I.scrollTop||E&&E.scrollTop||0)-(I.clientTop||0)}if(!H.which&&((H.charCode||H.charCode===0)?H.charCode:H.keyCode)){H.which=H.charCode||H.keyCode}if(!H.metaKey&&H.ctrlKey){H.metaKey=H.ctrlKey}if(!H.which&&H.button){H.which=(H.button&1?1:(H.button&2?3:(H.button&4?2:0)))}return H},proxy:function(F,E){E=E||function(){return F.apply(this,arguments)};E.guid=F.guid=F.guid||E.guid||this.guid++;return E},special:{ready:{setup:B,teardown:function(){}}},specialAll:{live:{setup:function(E,F){o.event.add(this,F[0],c)},teardown:function(G){if(G.length){var E=0,F=RegExp("(^|\\.)"+G[0]+"(\\.|$)");o.each((o.data(this,"events").live||{}),function(){if(F.test(this.type)){E++}});if(E<1){o.event.remove(this,G[0],c)}}}}}};o.Event=function(E){if(!this.preventDefault){return new o.Event(E)}if(E&&E.type){this.originalEvent=E;this.type=E.type}else{this.type=E}this.timeStamp=e();this[h]=true};function k(){return false}function u(){return true}o.Event.prototype={preventDefault:function(){this.isDefaultPrevented=u;var E=this.originalEvent;if(!E){return}if(E.preventDefault){E.preventDefault()}E.returnValue=false},stopPropagation:function(){this.isPropagationStopped=u;var E=this.originalEvent;if(!E){return}if(E.stopPropagation){E.stopPropagation()}E.cancelBubble=true},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=u;this.stopPropagation()},isDefaultPrevented:k,isPropagationStopped:k,isImmediatePropagationStopped:k};var a=function(F){var E=F.relatedTarget;while(E&&E!=this){try{E=E.parentNode}catch(G){E=this}}if(E!=this){F.type=F.data;o.event.handle.apply(this,arguments)}};o.each({mouseover:"mouseenter",mouseout:"mouseleave"},function(F,E){o.event.special[E]={setup:function(){o.event.add(this,F,a,E)},teardown:function(){o.event.remove(this,F,a)}}});o.fn.extend({bind:function(F,G,E){return F=="unload"?this.one(F,G,E):this.each(function(){o.event.add(this,F,E||G,E&&G)})},one:function(G,H,F){var E=o.event.proxy(F||H,function(I){o(this).unbind(I,E);return(F||H).apply(this,arguments)});return this.each(function(){o.event.add(this,G,E,F&&H)})},unbind:function(F,E){return this.each(function(){o.event.remove(this,F,E)})},trigger:function(E,F){return this.each(function(){o.event.trigger(E,F,this)})},triggerHandler:function(E,G){if(this[0]){var F=o.Event(E);F.preventDefault();F.stopPropagation();o.event.trigger(F,G,this[0]);return F.result}},toggle:function(G){var E=arguments,F=1;while(F<E.length){o.event.proxy(G,E[F++])}return this.click(o.event.proxy(G,function(H){this.lastToggle=(this.lastToggle||0)%F;H.preventDefault();return E[this.lastToggle++].apply(this,arguments)||false}))},hover:function(E,F){return this.mouseenter(E).mouseleave(F)},ready:function(E){B();if(o.isReady){E.call(document,o)}else{o.readyList.push(E)}return this},live:function(G,F){var E=o.event.proxy(F);E.guid+=this.selector+G;o(document).bind(i(G,this.selector),this.selector,E);return this},die:function(F,E){o(document).unbind(i(F,this.selector),E?{guid:E.guid+this.selector+F}:null);return this}});function c(H){var E=RegExp("(^|\\.)"+H.type+"(\\.|$)"),G=true,F=[];o.each(o.data(this,"events").live||[],function(I,J){if(E.test(J.type)){var K=o(H.target).closest(J.data)[0];if(K){F.push({elem:K,fn:J})}}});F.sort(function(J,I){return o.data(J.elem,"closest")-o.data(I.elem,"closest")});o.each(F,function(){if(this.fn.call(this.elem,H,this.fn.data)===false){return(G=false)}});return G}function i(F,E){return["live",F,E.replace(/\./g,"`").replace(/ /g,"|")].join(".")}o.extend({isReady:false,readyList:[],ready:function(){if(!o.isReady){o.isReady=true;if(o.readyList){o.each(o.readyList,function(){this.call(document,o)});o.readyList=null}o(document).triggerHandler("ready")}}});var x=false;function B(){if(x){return}x=true;if(document.addEventListener){document.addEventListener("DOMContentLoaded",function(){document.removeEventListener("DOMContentLoaded",arguments.callee,false);o.ready()},false)}else{if(document.attachEvent){document.attachEvent("onreadystatechange",function(){if(document.readyState==="complete"){document.detachEvent("onreadystatechange",arguments.callee);o.ready()}});if(document.documentElement.doScroll&&l==l.top){(function(){if(o.isReady){return}try{document.documentElement.doScroll("left")}catch(E){setTimeout(arguments.callee,0);return}o.ready()})()}}}o.event.add(l,"load",o.ready)}o.each(("blur,focus,load,resize,scroll,unload,click,dblclick,mousedown,mouseup,mousemove,mouseover,mouseout,mouseenter,mouseleave,change,select,submit,keydown,keypress,keyup,error").split(","),function(F,E){o.fn[E]=function(G){return G?this.bind(E,G):this.trigger(E)}});o(l).bind("unload",function(){for(var E in o.cache){if(E!=1&&o.cache[E].handle){o.event.remove(o.cache[E].handle.elem)}}});(function(){o.support={};var F=document.documentElement,G=document.createElement("script"),K=document.createElement("div"),J="script"+(new Date).getTime();K.style.display="none";K.innerHTML=' <link/><table></table><a href="/a" style="color:red;float:left;opacity:.5;">a</a><select><option>text</option></select><object><param/></object>';var H=K.getElementsByTagName("*"),E=K.getElementsByTagName("a")[0];if(!H||!H.length||!E){return}o.support={leadingWhitespace:K.firstChild.nodeType==3,tbody:!K.getElementsByTagName("tbody").length,objectAll:!!K.getElementsByTagName("object")[0].getElementsByTagName("*").length,htmlSerialize:!!K.getElementsByTagName("link").length,style:/red/.test(E.getAttribute("style")),hrefNormalized:E.getAttribute("href")==="/a",opacity:E.style.opacity==="0.5",cssFloat:!!E.style.cssFloat,scriptEval:false,noCloneEvent:true,boxModel:null};G.type="text/javascript";try{G.appendChild(document.createTextNode("window."+J+"=1;"))}catch(I){}F.insertBefore(G,F.firstChild);if(l[J]){o.support.scriptEval=true;delete l[J]}F.removeChild(G);if(K.attachEvent&&K.fireEvent){K.attachEvent("onclick",function(){o.support.noCloneEvent=false;K.detachEvent("onclick",arguments.callee)});K.cloneNode(true).fireEvent("onclick")}o(function(){var L=document.createElement("div");L.style.width=L.style.paddingLeft="1px";document.body.appendChild(L);o.boxModel=o.support.boxModel=L.offsetWidth===2;document.body.removeChild(L).style.display="none"})})();var w=o.support.cssFloat?"cssFloat":"styleFloat";o.props={"for":"htmlFor","class":"className","float":w,cssFloat:w,styleFloat:w,readonly:"readOnly",maxlength:"maxLength",cellspacing:"cellSpacing",rowspan:"rowSpan",tabindex:"tabIndex"};o.fn.extend({_load:o.fn.load,load:function(G,J,K){if(typeof G!=="string"){return this._load(G)}var I=G.indexOf(" ");if(I>=0){var E=G.slice(I,G.length);G=G.slice(0,I)}var H="GET";if(J){if(o.isFunction(J)){K=J;J=null}else{if(typeof J==="object"){J=o.param(J);H="POST"}}}var F=this;o.ajax({url:G,type:H,dataType:"html",data:J,complete:function(M,L){if(L=="success"||L=="notmodified"){F.html(E?o("<div/>").append(M.responseText.replace(/<script(.|\s)*?\/script>/g,"")).find(E):M.responseText)}if(K){F.each(K,[M.responseText,L,M])}}});return this},serialize:function(){return o.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?o.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||/select|textarea/i.test(this.nodeName)||/text|hidden|password|search/i.test(this.type))}).map(function(E,F){var G=o(this).val();return G==null?null:o.isArray(G)?o.map(G,function(I,H){return{name:F.name,value:I}}):{name:F.name,value:G}}).get()}});o.each("ajaxStart,ajaxStop,ajaxComplete,ajaxError,ajaxSuccess,ajaxSend".split(","),function(E,F){o.fn[F]=function(G){return this.bind(F,G)}});var r=e();o.extend({get:function(E,G,H,F){if(o.isFunction(G)){H=G;G=null}return o.ajax({type:"GET",url:E,data:G,success:H,dataType:F})},getScript:function(E,F){return o.get(E,null,F,"script")},getJSON:function(E,F,G){return o.get(E,F,G,"json")},post:function(E,G,H,F){if(o.isFunction(G)){H=G;G={}}return o.ajax({type:"POST",url:E,data:G,success:H,dataType:F})},ajaxSetup:function(E){o.extend(o.ajaxSettings,E)},ajaxSettings:{url:location.href,global:true,type:"GET",contentType:"application/x-www-form-urlencoded",processData:true,async:true,xhr:function(){return l.ActiveXObject?new ActiveXObject("Microsoft.XMLHTTP"):new XMLHttpRequest()},accepts:{xml:"application/xml, text/xml",html:"text/html",script:"text/javascript, application/javascript",json:"application/json, text/javascript",text:"text/plain",_default:"*/*"}},lastModified:{},ajax:function(M){M=o.extend(true,M,o.extend(true,{},o.ajaxSettings,M));var W,F=/=\?(&|$)/g,R,V,G=M.type.toUpperCase();if(M.data&&M.processData&&typeof M.data!=="string"){M.data=o.param(M.data)}if(M.dataType=="jsonp"){if(G=="GET"){if(!M.url.match(F)){M.url+=(M.url.match(/\?/)?"&":"?")+(M.jsonp||"callback")+"=?"}}else{if(!M.data||!M.data.match(F)){M.data=(M.data?M.data+"&":"")+(M.jsonp||"callback")+"=?"}}M.dataType="json"}if(M.dataType=="json"&&(M.data&&M.data.match(F)||M.url.match(F))){W="jsonp"+r++;if(M.data){M.data=(M.data+"").replace(F,"="+W+"$1")}M.url=M.url.replace(F,"="+W+"$1");M.dataType="script";l[W]=function(X){V=X;I();L();l[W]=g;try{delete l[W]}catch(Y){}if(H){H.removeChild(T)}}}if(M.dataType=="script"&&M.cache==null){M.cache=false}if(M.cache===false&&G=="GET"){var E=e();var U=M.url.replace(/(\?|&)_=.*?(&|$)/,"$1_="+E+"$2");M.url=U+((U==M.url)?(M.url.match(/\?/)?"&":"?")+"_="+E:"")}if(M.data&&G=="GET"){M.url+=(M.url.match(/\?/)?"&":"?")+M.data;M.data=null}if(M.global&&!o.active++){o.event.trigger("ajaxStart")}var Q=/^(\w+:)?\/\/([^\/?#]+)/.exec(M.url);if(M.dataType=="script"&&G=="GET"&&Q&&(Q[1]&&Q[1]!=location.protocol||Q[2]!=location.host)){var H=document.getElementsByTagName("head")[0];var T=document.createElement("script");T.src=M.url;if(M.scriptCharset){T.charset=M.scriptCharset}if(!W){var O=false;T.onload=T.onreadystatechange=function(){if(!O&&(!this.readyState||this.readyState=="loaded"||this.readyState=="complete")){O=true;I();L();T.onload=T.onreadystatechange=null;H.removeChild(T)}}}H.appendChild(T);return g}var K=false;var J=M.xhr();if(M.username){J.open(G,M.url,M.async,M.username,M.password)}else{J.open(G,M.url,M.async)}try{if(M.data){J.setRequestHeader("Content-Type",M.contentType)}if(M.ifModified){J.setRequestHeader("If-Modified-Since",o.lastModified[M.url]||"Thu, 01 Jan 1970 00:00:00 GMT")}J.setRequestHeader("X-Requested-With","XMLHttpRequest");J.setRequestHeader("Accept",M.dataType&&M.accepts[M.dataType]?M.accepts[M.dataType]+", */*":M.accepts._default)}catch(S){}if(M.beforeSend&&M.beforeSend(J,M)===false){if(M.global&&!--o.active){o.event.trigger("ajaxStop")}J.abort();return false}if(M.global){o.event.trigger("ajaxSend",[J,M])}var N=function(X){if(J.readyState==0){if(P){clearInterval(P);P=null;if(M.global&&!--o.active){o.event.trigger("ajaxStop")}}}else{if(!K&&J&&(J.readyState==4||X=="timeout")){K=true;if(P){clearInterval(P);P=null}R=X=="timeout"?"timeout":!o.httpSuccess(J)?"error":M.ifModified&&o.httpNotModified(J,M.url)?"notmodified":"success";if(R=="success"){try{V=o.httpData(J,M.dataType,M)}catch(Z){R="parsererror"}}if(R=="success"){var Y;try{Y=J.getResponseHeader("Last-Modified")}catch(Z){}if(M.ifModified&&Y){o.lastModified[M.url]=Y}if(!W){I()}}else{o.handleError(M,J,R)}L();if(X){J.abort()}if(M.async){J=null}}}};if(M.async){var P=setInterval(N,13);if(M.timeout>0){setTimeout(function(){if(J&&!K){N("timeout")}},M.timeout)}}try{J.send(M.data)}catch(S){o.handleError(M,J,null,S)}if(!M.async){N()}function I(){if(M.success){M.success(V,R)}if(M.global){o.event.trigger("ajaxSuccess",[J,M])}}function L(){if(M.complete){M.complete(J,R)}if(M.global){o.event.trigger("ajaxComplete",[J,M])}if(M.global&&!--o.active){o.event.trigger("ajaxStop")}}return J},handleError:function(F,H,E,G){if(F.error){F.error(H,E,G)}if(F.global){o.event.trigger("ajaxError",[H,F,G])}},active:0,httpSuccess:function(F){try{return !F.status&&location.protocol=="file:"||(F.status>=200&&F.status<300)||F.status==304||F.status==1223}catch(E){}return false},httpNotModified:function(G,E){try{var H=G.getResponseHeader("Last-Modified");return G.status==304||H==o.lastModified[E]}catch(F){}return false},httpData:function(J,H,G){var F=J.getResponseHeader("content-type"),E=H=="xml"||!H&&F&&F.indexOf("xml")>=0,I=E?J.responseXML:J.responseText;if(E&&I.documentElement.tagName=="parsererror"){throw"parsererror"}if(G&&G.dataFilter){I=G.dataFilter(I,H)}if(typeof I==="string"){if(H=="script"){o.globalEval(I)}if(H=="json"){I=l["eval"]("("+I+")")}}return I},param:function(E){var G=[];function H(I,J){G[G.length]=encodeURIComponent(I)+"="+encodeURIComponent(J)}if(o.isArray(E)||E.jquery){o.each(E,function(){H(this.name,this.value)})}else{for(var F in E){if(o.isArray(E[F])){o.each(E[F],function(){H(F,this)})}else{H(F,o.isFunction(E[F])?E[F]():E[F])}}}return G.join("&").replace(/%20/g,"+")}});var m={},n,d=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]];function t(F,E){var G={};o.each(d.concat.apply([],d.slice(0,E)),function(){G[this]=F});return G}o.fn.extend({show:function(J,L){if(J){return this.animate(t("show",3),J,L)}else{for(var H=0,F=this.length;H<F;H++){var E=o.data(this[H],"olddisplay");this[H].style.display=E||"";if(o.css(this[H],"display")==="none"){var G=this[H].tagName,K;if(m[G]){K=m[G]}else{var I=o("<"+G+" />").appendTo("body");K=I.css("display");if(K==="none"){K="block"}I.remove();m[G]=K}o.data(this[H],"olddisplay",K)}}for(var H=0,F=this.length;H<F;H++){this[H].style.display=o.data(this[H],"olddisplay")||""}return this}},hide:function(H,I){if(H){return this.animate(t("hide",3),H,I)}else{for(var G=0,F=this.length;G<F;G++){var E=o.data(this[G],"olddisplay");if(!E&&E!=="none"){o.data(this[G],"olddisplay",o.css(this[G],"display"))}}for(var G=0,F=this.length;G<F;G++){this[G].style.display="none"}return this}},_toggle:o.fn.toggle,toggle:function(G,F){var E=typeof G==="boolean";return o.isFunction(G)&&o.isFunction(F)?this._toggle.apply(this,arguments):G==null||E?this.each(function(){var H=E?G:o(this).is(":hidden");o(this)[H?"show":"hide"]()}):this.animate(t("toggle",3),G,F)},fadeTo:function(E,G,F){return this.animate({opacity:G},E,F)},animate:function(I,F,H,G){var E=o.speed(F,H,G);return this[E.queue===false?"each":"queue"](function(){var K=o.extend({},E),M,L=this.nodeType==1&&o(this).is(":hidden"),J=this;for(M in I){if(I[M]=="hide"&&L||I[M]=="show"&&!L){return K.complete.call(this)}if((M=="height"||M=="width")&&this.style){K.display=o.css(this,"display");K.overflow=this.style.overflow}}if(K.overflow!=null){this.style.overflow="hidden"}K.curAnim=o.extend({},I);o.each(I,function(O,S){var R=new o.fx(J,K,O);if(/toggle|show|hide/.test(S)){R[S=="toggle"?L?"show":"hide":S](I)}else{var Q=S.toString().match(/^([+-]=)?([\d+-.]+)(.*)$/),T=R.cur(true)||0;if(Q){var N=parseFloat(Q[2]),P=Q[3]||"px";if(P!="px"){J.style[O]=(N||1)+P;T=((N||1)/R.cur(true))*T;J.style[O]=T+P}if(Q[1]){N=((Q[1]=="-="?-1:1)*N)+T}R.custom(T,N,P)}else{R.custom(T,S,"")}}});return true})},stop:function(F,E){var G=o.timers;if(F){this.queue([])}this.each(function(){for(var H=G.length-1;H>=0;H--){if(G[H].elem==this){if(E){G[H](true)}G.splice(H,1)}}});if(!E){this.dequeue()}return this}});o.each({slideDown:t("show",1),slideUp:t("hide",1),slideToggle:t("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"}},function(E,F){o.fn[E]=function(G,H){return this.animate(F,G,H)}});o.extend({speed:function(G,H,F){var E=typeof G==="object"?G:{complete:F||!F&&H||o.isFunction(G)&&G,duration:G,easing:F&&H||H&&!o.isFunction(H)&&H};E.duration=o.fx.off?0:typeof E.duration==="number"?E.duration:o.fx.speeds[E.duration]||o.fx.speeds._default;E.old=E.complete;E.complete=function(){if(E.queue!==false){o(this).dequeue()}if(o.isFunction(E.old)){E.old.call(this)}};return E},easing:{linear:function(G,H,E,F){return E+F*G},swing:function(G,H,E,F){return((-Math.cos(G*Math.PI)/2)+0.5)*F+E}},timers:[],fx:function(F,E,G){this.options=E;this.elem=F;this.prop=G;if(!E.orig){E.orig={}}}});o.fx.prototype={update:function(){if(this.options.step){this.options.step.call(this.elem,this.now,this)}(o.fx.step[this.prop]||o.fx.step._default)(this);if((this.prop=="height"||this.prop=="width")&&this.elem.style){this.elem.style.display="block"}},cur:function(F){if(this.elem[this.prop]!=null&&(!this.elem.style||this.elem.style[this.prop]==null)){return this.elem[this.prop]}var E=parseFloat(o.css(this.elem,this.prop,F));return E&&E>-10000?E:parseFloat(o.curCSS(this.elem,this.prop))||0},custom:function(I,H,G){this.startTime=e();this.start=I;this.end=H;this.unit=G||this.unit||"px";this.now=this.start;this.pos=this.state=0;var E=this;function F(J){return E.step(J)}F.elem=this.elem;if(F()&&o.timers.push(F)&&!n){n=setInterval(function(){var K=o.timers;for(var J=0;J<K.length;J++){if(!K[J]()){K.splice(J--,1)}}if(!K.length){clearInterval(n);n=g}},13)}},show:function(){this.options.orig[this.prop]=o.attr(this.elem.style,this.prop);this.options.show=true;this.custom(this.prop=="width"||this.prop=="height"?1:0,this.cur());o(this.elem).show()},hide:function(){this.options.orig[this.prop]=o.attr(this.elem.style,this.prop);this.options.hide=true;this.custom(this.cur(),0)},step:function(H){var G=e();if(H||G>=this.options.duration+this.startTime){this.now=this.end;this.pos=this.state=1;this.update();this.options.curAnim[this.prop]=true;var E=true;for(var F in this.options.curAnim){if(this.options.curAnim[F]!==true){E=false}}if(E){if(this.options.display!=null){this.elem.style.overflow=this.options.overflow;this.elem.style.display=this.options.display;if(o.css(this.elem,"display")=="none"){this.elem.style.display="block"}}if(this.options.hide){o(this.elem).hide()}if(this.options.hide||this.options.show){for(var I in this.options.curAnim){o.attr(this.elem.style,I,this.options.orig[I])}}this.options.complete.call(this.elem)}return false}else{var J=G-this.startTime;this.state=J/this.options.duration;this.pos=o.easing[this.options.easing||(o.easing.swing?"swing":"linear")](this.state,J,0,1,this.options.duration);this.now=this.start+((this.end-this.start)*this.pos);this.update()}return true}};o.extend(o.fx,{speeds:{slow:600,fast:200,_default:400},step:{opacity:function(E){o.attr(E.elem.style,"opacity",E.now)},_default:function(E){if(E.elem.style&&E.elem.style[E.prop]!=null){E.elem.style[E.prop]=E.now+E.unit}else{E.elem[E.prop]=E.now}}}});if(document.documentElement.getBoundingClientRect){o.fn.offset=function(){if(!this[0]){return{top:0,left:0}}if(this[0]===this[0].ownerDocument.body){return o.offset.bodyOffset(this[0])}var G=this[0].getBoundingClientRect(),J=this[0].ownerDocument,F=J.body,E=J.documentElement,L=E.clientTop||F.clientTop||0,K=E.clientLeft||F.clientLeft||0,I=G.top+(self.pageYOffset||o.boxModel&&E.scrollTop||F.scrollTop)-L,H=G.left+(self.pageXOffset||o.boxModel&&E.scrollLeft||F.scrollLeft)-K;return{top:I,left:H}}}else{o.fn.offset=function(){if(!this[0]){return{top:0,left:0}}if(this[0]===this[0].ownerDocument.body){return o.offset.bodyOffset(this[0])}o.offset.initialized||o.offset.initialize();var J=this[0],G=J.offsetParent,F=J,O=J.ownerDocument,M,H=O.documentElement,K=O.body,L=O.defaultView,E=L.getComputedStyle(J,null),N=J.offsetTop,I=J.offsetLeft;while((J=J.parentNode)&&J!==K&&J!==H){M=L.getComputedStyle(J,null);N-=J.scrollTop,I-=J.scrollLeft;if(J===G){N+=J.offsetTop,I+=J.offsetLeft;if(o.offset.doesNotAddBorder&&!(o.offset.doesAddBorderForTableAndCells&&/^t(able|d|h)$/i.test(J.tagName))){N+=parseInt(M.borderTopWidth,10)||0,I+=parseInt(M.borderLeftWidth,10)||0}F=G,G=J.offsetParent}if(o.offset.subtractsBorderForOverflowNotVisible&&M.overflow!=="visible"){N+=parseInt(M.borderTopWidth,10)||0,I+=parseInt(M.borderLeftWidth,10)||0}E=M}if(E.position==="relative"||E.position==="static"){N+=K.offsetTop,I+=K.offsetLeft}if(E.position==="fixed"){N+=Math.max(H.scrollTop,K.scrollTop),I+=Math.max(H.scrollLeft,K.scrollLeft)}return{top:N,left:I}}}o.offset={initialize:function(){if(this.initialized){return}var L=document.body,F=document.createElement("div"),H,G,N,I,M,E,J=L.style.marginTop,K='<div style="position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;"><div></div></div><table style="position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;" cellpadding="0" cellspacing="0"><tr><td></td></tr></table>';M={position:"absolute",top:0,left:0,margin:0,border:0,width:"1px",height:"1px",visibility:"hidden"};for(E in M){F.style[E]=M[E]}F.innerHTML=K;L.insertBefore(F,L.firstChild);H=F.firstChild,G=H.firstChild,I=H.nextSibling.firstChild.firstChild;this.doesNotAddBorder=(G.offsetTop!==5);this.doesAddBorderForTableAndCells=(I.offsetTop===5);H.style.overflow="hidden",H.style.position="relative";this.subtractsBorderForOverflowNotVisible=(G.offsetTop===-5);L.style.marginTop="1px";this.doesNotIncludeMarginInBodyOffset=(L.offsetTop===0);L.style.marginTop=J;L.removeChild(F);this.initialized=true},bodyOffset:function(E){o.offset.initialized||o.offset.initialize();var G=E.offsetTop,F=E.offsetLeft;if(o.offset.doesNotIncludeMarginInBodyOffset){G+=parseInt(o.curCSS(E,"marginTop",true),10)||0,F+=parseInt(o.curCSS(E,"marginLeft",true),10)||0}return{top:G,left:F}}};o.fn.extend({position:function(){var I=0,H=0,F;if(this[0]){var G=this.offsetParent(),J=this.offset(),E=/^body|html$/i.test(G[0].tagName)?{top:0,left:0}:G.offset();J.top-=j(this,"marginTop");J.left-=j(this,"marginLeft");E.top+=j(G,"borderTopWidth");E.left+=j(G,"borderLeftWidth");F={top:J.top-E.top,left:J.left-E.left}}return F},offsetParent:function(){var E=this[0].offsetParent||document.body;while(E&&(!/^body|html$/i.test(E.tagName)&&o.css(E,"position")=="static")){E=E.offsetParent}return o(E)}});o.each(["Left","Top"],function(F,E){var G="scroll"+E;o.fn[G]=function(H){if(!this[0]){return null}return H!==g?this.each(function(){this==l||this==document?l.scrollTo(!F?H:o(l).scrollLeft(),F?H:o(l).scrollTop()):this[G]=H}):this[0]==l||this[0]==document?self[F?"pageYOffset":"pageXOffset"]||o.boxModel&&document.documentElement[G]||document.body[G]:this[0][G]}});o.each(["Height","Width"],function(I,G){var E=I?"Left":"Top",H=I?"Right":"Bottom",F=G.toLowerCase();o.fn["inner"+G]=function(){return this[0]?o.css(this[0],F,false,"padding"):null};o.fn["outer"+G]=function(K){return this[0]?o.css(this[0],F,false,K?"margin":"border"):null};var J=G.toLowerCase();o.fn[J]=function(K){return this[0]==l?document.compatMode=="CSS1Compat"&&document.documentElement["client"+G]||document.body["client"+G]:this[0]==document?Math.max(document.documentElement["client"+G],document.body["scroll"+G],document.documentElement["scroll"+G],document.body["offset"+G],document.documentElement["offset"+G]):K===g?(this.length?o.css(this[0],J):null):this.css(J,typeof K==="string"?K:K+"px")}})})();
\ No newline at end of file
This source diff could not be displayed because it is too large. You can view the blob instead.
jQuery.fn.center = function(params) {
var options = {
vertical: true,
horizontal: true
}
op = jQuery.extend(options, params);
this.each(function(){
//initializing variables
var $self = jQuery(this);
//get the dimensions using dimensions plugin
var width = $self.width();
var height = $self.height();
//get the paddings
var paddingTop = parseInt($self.css("padding-top"));
var paddingBottom = parseInt($self.css("padding-bottom"));
//get the borders
var borderTop = parseInt($self.css("border-top-width"));
var borderBottom = parseInt($self.css("border-bottom-width"));
//get the media of padding and borders
var mediaBorder = (borderTop+borderBottom)/2;
var mediaPadding = (paddingTop+paddingBottom)/2;
//get the type of positioning
var positionType = $self.parent().css("position");
// get the half minus of width and height
var halfWidth = (width/2)*(-1);
var halfHeight = ((height/2)*(-1))-mediaPadding-mediaBorder;
// initializing the css properties
var cssProp = {
position: 'absolute'
};
if(op.vertical) {
cssProp.height = height;
cssProp.top = '50%';
cssProp.marginTop = halfHeight;
}
if(op.horizontal) {
cssProp.width = width;
cssProp.left = '50%';
cssProp.marginLeft = halfWidth;
}
//check the current position
if(positionType == 'static') {
$self.parent().css("position","relative");
}
//aplying the css
$self.css(cssProp);
});
};
\ No newline at end of file
/**
* .disableTextSelect - Disable Text Select Plugin
*
* Version: 1.1
* Updated: 2007-11-28
*
* Used to stop users from selecting text
*
* Copyright (c) 2007 James Dempster (letssurf@gmail.com, http://www.jdempster.com/category/jquery/disabletextselect/)
*
* Dual licensed under the MIT (MIT-LICENSE.txt)
* and GPL (GPL-LICENSE.txt) licenses.
**/
/**
* Requirements:
* - jQuery (John Resig, http://www.jquery.com/)
**/
(function($) {
if ($.browser.mozilla) {
$.fn.disableTextSelect = function() {
return this.each(function() {
$(this).css({
'MozUserSelect' : 'none'
});
});
};
$.fn.enableTextSelect = function() {
return this.each(function() {
$(this).css({
'MozUserSelect' : ''
});
});
};
} else if ($.browser.msie) {
$.fn.disableTextSelect = function() {
return this.each(function() {
$(this).bind('selectstart.disableTextSelect', function() {
return false;
});
});
};
$.fn.enableTextSelect = function() {
return this.each(function() {
$(this).unbind('selectstart.disableTextSelect');
});
};
} else {
$.fn.disableTextSelect = function() {
return this.each(function() {
$(this).bind('mousedown.disableTextSelect', function() {
return false;
});
});
};
$.fn.enableTextSelect = function() {
return this.each(function() {
$(this).unbind('mousedown.disableTextSelect');
});
};
}
})(jQuery);
\ No newline at end of file
/*
* jQuery EasIng v1.1.2 - http://gsgd.co.uk/sandbox/jquery.easIng.php
*
* Uses the built In easIng capabilities added In jQuery 1.1
* to offer multiple easIng options
*
* Copyright (c) 2007 George Smith
* Licensed under the MIT License:
* http://www.opensource.org/licenses/mit-license.php
*/
// t: current time, b: begInnIng value, c: change In value, d: duration
jQuery.extend( jQuery.easing,
{
easeInQuad: function (x, t, b, c, d) {
return c*(t/=d)*t + b;
},
easeOutQuad: function (x, t, b, c, d) {
return -c *(t/=d)*(t-2) + b;
},
easeInOutQuad: function (x, t, b, c, d) {
if ((t/=d/2) < 1) return c/2*t*t + b;
return -c/2 * ((--t)*(t-2) - 1) + b;
},
easeInCubic: function (x, t, b, c, d) {
return c*(t/=d)*t*t + b;
},
easeOutCubic: function (x, t, b, c, d) {
return c*((t=t/d-1)*t*t + 1) + b;
},
easeInOutCubic: function (x, t, b, c, d) {
if ((t/=d/2) < 1) return c/2*t*t*t + b;
return c/2*((t-=2)*t*t + 2) + b;
},
easeInQuart: function (x, t, b, c, d) {
return c*(t/=d)*t*t*t + b;
},
easeOutQuart: function (x, t, b, c, d) {
return -c * ((t=t/d-1)*t*t*t - 1) + b;
},
easeInOutQuart: function (x, t, b, c, d) {
if ((t/=d/2) < 1) return c/2*t*t*t*t + b;
return -c/2 * ((t-=2)*t*t*t - 2) + b;
},
easeInQuint: function (x, t, b, c, d) {
return c*(t/=d)*t*t*t*t + b;
},
easeOutQuint: function (x, t, b, c, d) {
return c*((t=t/d-1)*t*t*t*t + 1) + b;
},
easeInOutQuint: function (x, t, b, c, d) {
if ((t/=d/2) < 1) return c/2*t*t*t*t*t + b;
return c/2*((t-=2)*t*t*t*t + 2) + b;
},
easeInSine: function (x, t, b, c, d) {
return -c * Math.cos(t/d * (Math.PI/2)) + c + b;
},
easeOutSine: function (x, t, b, c, d) {
return c * Math.sin(t/d * (Math.PI/2)) + b;
},
easeInOutSine: function (x, t, b, c, d) {
return -c/2 * (Math.cos(Math.PI*t/d) - 1) + b;
},
easeInExpo: function (x, t, b, c, d) {
return (t==0) ? b : c * Math.pow(2, 10 * (t/d - 1)) + b;
},
easeOutExpo: function (x, t, b, c, d) {
return (t==d) ? b+c : c * (-Math.pow(2, -10 * t/d) + 1) + b;
},
easeInOutExpo: function (x, t, b, c, d) {
if (t==0) return b;
if (t==d) return b+c;
if ((t/=d/2) < 1) return c/2 * Math.pow(2, 10 * (t - 1)) + b;
return c/2 * (-Math.pow(2, -10 * --t) + 2) + b;
},
easeInCirc: function (x, t, b, c, d) {
return -c * (Math.sqrt(1 - (t/=d)*t) - 1) + b;
},
easeOutCirc: function (x, t, b, c, d) {
return c * Math.sqrt(1 - (t=t/d-1)*t) + b;
},
easeInOutCirc: function (x, t, b, c, d) {
if ((t/=d/2) < 1) return -c/2 * (Math.sqrt(1 - t*t) - 1) + b;
return c/2 * (Math.sqrt(1 - (t-=2)*t) + 1) + b;
},
easeInElastic: function (x, t, b, c, d) {
var s=1.70158;var p=0;var a=c;
if (t==0) return b; if ((t/=d)==1) return b+c; if (!p) p=d*.3;
if (a < Math.abs(c)) { a=c; var s=p/4; }
else var s = p/(2*Math.PI) * Math.asin (c/a);
return -(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b;
},
easeOutElastic: function (x, t, b, c, d) {
var s=1.70158;var p=0;var a=c;
if (t==0) return b; if ((t/=d)==1) return b+c; if (!p) p=d*.3;
if (a < Math.abs(c)) { a=c; var s=p/4; }
else var s = p/(2*Math.PI) * Math.asin (c/a);
return a*Math.pow(2,-10*t) * Math.sin( (t*d-s)*(2*Math.PI)/p ) + c + b;
},
easeInOutElastic: function (x, t, b, c, d) {
var s=1.70158;var p=0;var a=c;
if (t==0) return b; if ((t/=d/2)==2) return b+c; if (!p) p=d*(.3*1.5);
if (a < Math.abs(c)) { a=c; var s=p/4; }
else var s = p/(2*Math.PI) * Math.asin (c/a);
if (t < 1) return -.5*(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b;
return a*Math.pow(2,-10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )*.5 + c + b;
},
easeInBack: function (x, t, b, c, d, s) {
if (s == undefined) s = 1.70158;
return c*(t/=d)*t*((s+1)*t - s) + b;
},
easeOutBack: function (x, t, b, c, d, s) {
if (s == undefined) s = 1.70158;
return c*((t=t/d-1)*t*((s+1)*t + s) + 1) + b;
},
easeInOutBack: function (x, t, b, c, d, s) {
if (s == undefined) s = 1.70158;
if ((t/=d/2) < 1) return c/2*(t*t*(((s*=(1.525))+1)*t - s)) + b;
return c/2*((t-=2)*t*(((s*=(1.525))+1)*t + s) + 2) + b;
},
easeInBounce: function (x, t, b, c, d) {
return c - jQuery.easing.easeOutBounce (x, d-t, 0, c, d) + b;
},
easeOutBounce: function (x, t, b, c, d) {
if ((t/=d) < (1/2.75)) {
return c*(7.5625*t*t) + b;
} else if (t < (2/2.75)) {
return c*(7.5625*(t-=(1.5/2.75))*t + .75) + b;
} else if (t < (2.5/2.75)) {
return c*(7.5625*(t-=(2.25/2.75))*t + .9375) + b;
} else {
return c*(7.5625*(t-=(2.625/2.75))*t + .984375) + b;
}
},
easeInOutBounce: function (x, t, b, c, d) {
if (t < d/2) return jQuery.easing.easeInBounce (x, t*2, 0, c, d) * .5 + b;
return jQuery.easing.easeOutBounce (x, t*2-d, 0, c, d) * .5 + c*.5 + b;
}
});
\ No newline at end of file
(function($) {
jQuery.fn.ubwidget = function(options) {
var settings = jQuery.extend({}, jQuery.fn.ubwidget.defaults, options);
DD_roundies.addRule('.ubw-standard-corners', '5px', true);
DD_roundies.addRule('.ubw-button-corners', '4px', true);
DD_roundies.addRule('.ubw-i-corners', '4px', true);
$(window)
.bind("blur", function(event){
})
.trigger("focus");
return this.each(function() {
var ubwbody = $(this)
.addClass("ubw-body");
var ubwcontainer = $("<div></div>")
.append(ubwbody)
.addClass("ubw-container")
.css({
width:settings.width,
height:settings.height
})
.disableTextSelect();
$('body').append(ubwcontainer);
});
};
// Default options
jQuery.fn.ubwidget.defaults = {
width:200,
height:250
};
// Shadows
jQuery.fn.ubwshadows = function(settings){
var shadow = $("<div class='ubw-shadow'></div>")
.addClass("ubw-standard-corners")
.css({
backgroundColor:"#333377",
opacity:".1",
filter: "alpha(opacity = 10)",
position:"absolute",
top:settings.t,
left:settings.l,
width:settings.w,
height:settings.h
});
$(this).before(shadow);
};
jQuery.fn.ubwbutton = function(size, arrows) {
var arrows = typeof(arrows) != "undefined" ? arrows = arrows : arrows = {top:0, right:0, bottom:0, left:0};
var button = null;
var scale = 0.20;
var url = "";
var buttonbody;
return this.each(function() {
button = $(this)
.addClass("ubw-button-wrapper")
.css({zIndex:0});
url = $(this).find("img").attr("src");
url = url.split(".");
var buttonContent = $("<table cellpadding='0' cellspacing='0' border='0' width='auto' height='100%'><tr><td height='auto' width='auto' valign='middle' align='center'></td></tr></table>")
.addClass("ubw-button-content");
buttonContent.find("td").html($(this).html());
$(this).empty();
var buttonCanvas = $("<div></div>")
.addClass("ubw-button-canvas")
.appendTo(button)
.html('<table width="auto" height="auto" cellpadding="0" cellspacing="0"><tr><td class="ubw-button-arrowTop" align="center"><img style="visibility:hidden; margin-bottom:-1px" src="images/arrows_out/top.png"></td></tr><tr><td><table width="auto" height="auto" border="0" cellpadding="0" cellspacing="0"><tr><td class="ubw-button-arrowLeft"><img style="visibility:hidden; margin-right:-1px" src="images/arrows_out/left.png"></td><td class="ubw-button-body"></td><td class="ubw-button-arrowRight"><img style="visibility:hidden; margin-left:-1px" src="images/arrows_out/right.png"></td></tr></table></td></tr><tr><td class="ubw-button-arrowBottom" align="center"><img style="visibility:hidden; margin-top:-1px" src="images/arrows_out/bottom.png"></td></tr></table>');
if(arrows.top)buttonCanvas.find(".ubw-button-arrowTop").children("img").css({visibility:"visible"});
if(arrows.right)buttonCanvas.find(".ubw-button-arrowRight").children("img").css({visibility:"visible"});
if(arrows.bottom)buttonCanvas.find(".ubw-button-arrowBottom").children("img").css({visibility:"visible"});
if(arrows.left)buttonCanvas.find(".ubw-button-arrowLeft").children("img").css({visibility:"visible"});
var buttonBody = buttonCanvas.find(".ubw-button-body")
.addClass("ubw-button-out")
.append(buttonContent)
.bind("mouseenter", buttonOverHandler)
.bind("mouseleave", buttonOutHandler)
.bind("mousedown", buttonDownHandler)
.bind("mouseup", buttonUpHandler)
.css({
width:size.w,
height:size.h
});
button.width(size.w+9).height(size.h+2);
buttonbody = buttonBody.find(".ubw-button-content");
});
function buttonOverHandler(e) {
buttonbody.find("img").attr("src", url[0]+"_over.png");
button.css({
zIndex:1
});
};
function buttonOutHandler(e){
buttonbody.find("img").attr("src", url[0]+".png");
button.css({
zIndex:0
});
};
function buttonDownHandler(e){
buttonbody.find("img").attr("src", url[0]+"_over_down.png");
};
function buttonUpHandler(e){
url[0] = url[0].replace("_down", "");
buttonbody.find("img").attr("src", url[0]+"_over.png");
};
};
jQuery.fn.ubwtoggle = function(activated, _firstFunc, _secondFunc) {
var activated = typeof(activated) != "undefined" ? activated = 1 : activated = 0;
return this.each(function(){
var button = $(this);
var buttonBody = button.find(".ubw-button-body");
var img = buttonBody.find("img");
var imgsrc = img.attr("src");
var firstFunc = _firstFunc;
var secondFunc = _secondFunc;
buttonBody
.toggle(
function(){
img.css({visibility:"hidden"});
firstFunc();
},
function(){
img.css({visibility:"visible"});
secondFunc();
}
);
if(activated){
buttonBody.trigger("click");
};
});
};
jQuery.fn.ubwidget.sliderbutton = function() {
};
jQuery.fn.ubwidget.inspector = function(_position, content, button){
var position = {x:_position.x, y:_position.y};
var catcher = $("<div id='ubw-catcher'></div>")
.css({
position:"absolute",
width:"100%",
height:"100%"
})
.mousedown(function(){
inspector.hide();
removeDropShadow();
catcher.hide();
//resizeubcanvas()
});
$("body").append(catcher);
catcher.hide();
var inspector = $("<div class='ubw-inspector'></div>")
.css({
left:position.x,
top:position.y
})
.append(content)
.appendTo($("body"))
.hide()
.disableTextSelect();
var inspectorWidth = inspector.width();
var inspectorHeight = inspector.height();
var windowWidth = $(window).width();
var windowHeight = $(window).height();
$("body").prepend(button);
button.addClass("ubw-rounded")
.click(function(){
catcher.show();
inspector.show();
dropShadow();
resizeubcanvas()
});
function dropShadow (){
inspector.ubwshadows({w:inspectorWidth+23,h:inspectorHeight+22,l:55,t:55})}
function removeDropShadow (){
$(".ubw-shadow").remove()}
// !!
$(".ubw-shadow")
.mousedown(function(){
inspector.hide();
removeDropShadow();
catcher.hide();
resizeubcanvas()
});
function resizeWidget(w, h){
window.resizeTo(w+2, h+2);
$("#indicator").remove();
var indicator = $("<div id='indicator'></div>")
.css({
width:w,
height:h,
position:"absolute",
left:0,
top:0,
border:"1px solid #ff0000"
});
//$("body").prepend(indicator);
}
function resizeubcanvas(){
if(inspector.css("display")=="none"){
resizeWidget(windowWidth, windowHeight);
return 0;
};
var inspectorbottom = inspector.position().top+inspector.height()+40;
var inspectorright = inspector.position().left+inspector.width()+40;
if($(window).height()<inspectorbottom){
resizeWidget($(window).width(), inspectorbottom)};
if($(window).width()<inspectorright){
resizeWidget(inspectorright, $(window).height())};
}
};
})(jQuery);
\ No newline at end of file
/*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
function init(){
var h = 292;
var w = 160;
var wh = h+6;
var ww = w+6;
var clickFlag = false;
var ubwidget = $("#ubwidget").ubwidget({
width:w,
height:h
});
var historyTab = $("<div></div>")
.css({
height:h,
marginRight:0,
width:20,
float:"left",
backgroundImage:"url(images/historytab.png)",
backgroundRepeat:"no-repeat"
})
.toggle(
function(){
resizeWidget(370, 294);
historyPanel.show();
$(".ubw-container").css({
backgroundImage:"url(images/back.png)",
width:328
});
if(window.sankore){
window.sankore.setPreference('historyTab', "visible");
};
},
function(){
resizeWidget(200, 294);
historyPanel.hide();
$(".ubw-container").css({
backgroundImage:"url(images/back_small.png)",
width:160
});
if(window.sankore){
window.sankore.setPreference('historyTab', "hidden");
};
}
)
.hover(
function(){
$(this).css({
backgroundImage:"url(images/historytabOver.png)"
});
},
function(){
$(this).css({
backgroundImage:"url(images/historytab.png)"
});
}
)
.appendTo($("body"));
var space = $("<div></div>");
space.css({
width:5,
height:1,
float:"left"
});
var keysPanel = $("<div id='keysPanel'></div>").css({
float:"left"
});
var mode = "standard";
var calc = "";
var displayTrunk = "";
var historyTrunk = "";
var lastHistory = "";
var subtrunk = 0;
var itrunk = 0;
var trunkpos = 0;
var lastchar = {
type:"NaN",
value:"null"
};
var inparenthesis = false;
var erase = false;
var abtn;
var readyToCompute = false;
var lastResult = "0";
var gDecimalSeparator = "";
var gThousandsSeparator = "";
var gDecimalCode = 0;
var gDecimalString = "";
var gError = false;
var historyTxt = "0";
var display = $("<div id='display'>0</div>")
.addClass("ubw-inputbox")
.css({
padding:"12px",
marginLeft:"2px",
marginBottom:"9px",
marginTop:7,
backgroundImage:"url(images/display.png)",
fontSize:"22px",
fontFamily:"Arial, Helvetica, Sans-serif",
color:"#777788",
width:118,
height:28,
overflow:"hidden",
textAlign:"right",
});
var standardPanel = $("<div></div>").css({
float:"left"
});
var cKeySize = {
w:33,
h:36
};
var btn7 = $("<div><img src='images/touche7.png'/></div>").ubwbutton({
w:cKeySize.w,
h:cKeySize.h
})
.mousedown(function(){
appendToDisplay("7", 1)
});
var btn8 = $("<div><img src='images/touche8.png'/></div>").ubwbutton({
w:cKeySize.w,
h:cKeySize.h
})
.mousedown(function(){
appendToDisplay("8", 1)
});
var btn9 = $("<div><img src='images/touche9.png'/></div>").ubwbutton({
w:cKeySize.w,
h:cKeySize.h
})
.mousedown(function(){
appendToDisplay("9", 1)
});
var btnDiv = $("<div><img src='images/touchediv.png'/></div>").ubwbutton({
w:cKeySize.w,
h:cKeySize.h
})
.mousedown(function(){
appendToDisplay("/", 0)
});
var btn4 = $("<div><img src='images/touche4.png'/></div>").ubwbutton({
w:cKeySize.w,
h:cKeySize.h
})
.mousedown(function(){
appendToDisplay("4", 1)
});
var btn5 = $("<div><img src='images/touche5.png'/></div>").ubwbutton({
w:cKeySize.w,
h:cKeySize.h
})
.mousedown(function(){
appendToDisplay("5", 1)
});
var btn6 = $("<div><img src='images/touche6.png'/></div>").ubwbutton({
w:cKeySize.w,
h:cKeySize.h
})
.mousedown(function(){
appendToDisplay("6", 1)
});
var btnMul = $("<div><img src='images/touchef.png'/></div>").ubwbutton({
w:cKeySize.w,
h:cKeySize.h
})
.mousedown(function(){
appendToDisplay("*", 0)
});
var btn1 = $("<div><img src='images/touche1.png'/></div>").ubwbutton({
w:cKeySize.w,
h:cKeySize.h
})
.mousedown(function(){
appendToDisplay("1", 1)
});
var btn2 = $("<div><img src='images/touche2.png'/></div>").ubwbutton({
w:cKeySize.w,
h:cKeySize.h
})
.mousedown(function(){
appendToDisplay("2", 1)
});
var btn3 = $("<div><img src='images/touche3.png'/></div>").ubwbutton({
w:cKeySize.w,
h:cKeySize.h
})
.mousedown(function(){
appendToDisplay("3", 1)
});
var btnSou = $("<div><img src='images/touchem.png'/></div>").ubwbutton({
w:68,
h:34
})
.mousedown(function(){
appendToDisplay("-", 0)
});
var btn0 = $("<div><img src='images/touche0.png'/></div>").ubwbutton({
w:cKeySize.w,
h:cKeySize.h
})
.mousedown(function(){
appendToDisplay("0", 1)
});
var btnDot = $("<div><img src='images/touchedot.png'/></div>").ubwbutton({
w:cKeySize.w,
h:cKeySize.h
})
.mousedown(function(){
appendToDisplay(".", 1)
});
var btnC = $("<div><img src='images/touchec.png'/></div>").ubwbutton({
w:cKeySize.w,
h:cKeySize.h
})
.mousedown(function(){
reset()
});
var btnAdd = $("<div><img src='images/touchep.png'/></div>").ubwbutton({
w:68,
h:34
})
.mousedown(function(){
appendToDisplay("+", 0)
});
var btnPaL = $("<div><img src='images/touchepg.png'/></div>").ubwbutton({
w:cKeySize.w,
h:cKeySize.h
})
.mousedown(function(){
appendToDisplay("(", 1)
});
var btnPaR = $("<div><img src='images/touchepd.png'/></div>").ubwbutton({
w:cKeySize.w,
h:cKeySize.h
})
.mousedown(function(){
appendToDisplay(")", 1)
});
var btnEqu = $("<div><img src='images/toucheeq.png'/></div>").ubwbutton({
w:cKeySize.w,
h:cKeySize.h
})
.mousedown(function(){
compute()
});
var historyPanel = $("<div id='historyPanel'></div>")
.css({
backgroundImage:"url(images/historyback.png)",
width:"auto",
height:"auto",
float:"left",
marginLeft:3,
marginRight:2,
marginTop:6
})
.hide();
var historyBox = $("<textarea id='historyBox'></textarea>")
.css({
padding:10,
fontSize:"20px",
fontFamily:"Arial, Helvetica, Sans-serif",
width:143,
height:236,
backgroundColor:"transparent",
resize:"none",
border:"none",
overlay:"none",
color:"#eeeeee"
})
.val("0");
historyPanel.append(historyBox);
var stop = $("<div></div>");
var sleft = $("<div></div>");
var sright = $("<div></div>");
stop.css({
width:140
})
.append(btnAdd).append(btnSou)
.append(btn7).append(btn8).append(btn9).append(btnMul)
.append(btn4).append(btn5).append(btn6).append(btnDiv);
sleft.css({
width:105,
float:"left"
})
.append(btn1).append(btn2).append(btn3)
.append(btn0).append(btnDot).append(btnC);
sright.css({
width:45,
float:"left"
})
.append(btnEqu);
standardPanel.css({
width:150
})
.append(stop)
.append(sleft).append(sright);
keysPanel
.append(display)
.append(standardPanel);
ubwidget
.append(historyPanel)
.append(keysPanel);
if(window.sankore){
historyTxt = window.sankore.preference('historyTxt', historyTxt);
var ht = window.sankore.preference('historyTab', "hidden");
$("#historyBox").val(historyTxt);
if(ht === "visible"){
historyTab.trigger("click");
};
}
function resizeWidget(w, h){
window.sankore.resize(w+2, h+2);
}
function compute(){
var result;
if(calc.length <= 1)
result = eval(calc);
else{
var fNumber, lNumber, operation = "", fMinus = "";
if(calc.charAt(0) == '-'){
fMinus = "-";
calc = calc.substr(1, calc.length);
}
operation = (calc.indexOf("+", 0) != -1)?calc.charAt(calc.indexOf("+", 0)):((calc.indexOf("*", 0) != -1)?calc.charAt(calc.indexOf("*", 0)):((calc.indexOf("/", 0) != -1)?calc.charAt(calc.indexOf("/", 0)):((calc.indexOf("-", 0) != -1)?calc.charAt(calc.indexOf("-", 0)):"")));
fNumber = fMinus + calc.substring(0, calc.indexOf(operation, 0));
lNumber = calc.substring(calc.indexOf(operation, 0)+1, calc.length);
result = calcIt(fNumber, operation, lNumber);
}
$("#display").text(updateDisplay(result));
lastResult = result;
lastchar.type = "Nan";
lastchar.value = "";
calc = "";
$("#historyBox").val($("#historyBox").val()+historyTrunk+"\n= "+updateDisplay(result)+"\n\n");
$("#historyBox").scrollTop(99999);
displayTrunk = "";
historyTrunk = "";
if(window.sankore){
window.sankore.setPreference('historyTxt', $("#historyBox").val());
}
lastHistory = $("#historyBox").val();
}
function calcIt(fNumber, operation, lNumber){
var result, fCount = "", lCount = "", length = 0;
fCount = (fNumber.indexOf(".", 0) != -1)?fNumber.substring(fNumber.indexOf(".", 0)+1, fNumber.length):"";
lCount = (lNumber.indexOf(".", 0) != -1)?lNumber.substring(lNumber.indexOf(".", 0)+1, lNumber.length):"";
length = (fCount.length >= lCount.length)?fCount.length:lCount.length;
length = Math.pow(10, length);
fNumber = Math.round(fNumber * length);
lNumber = Math.round(lNumber * length);
switch(operation){
case "+":
result = (fNumber + lNumber)/length;
break;
case "-":
result = (fNumber - lNumber)/length;
break;
case "*":
result = (fNumber * lNumber)/Math.pow(length, 2);
break;
case "/":
result = fNumber/lNumber;
break;
}
return result;
}
function reset(){
$("#display").text("0");
calc="";
lastchar.type = "NaN";
displayTrunk="";
historyTrunk="";
$("#historyBox").val(lastHistory);
$("#historyBox").scrollTop(99999);
}
function formatNumberWithDelimiters(number) {
var delimiter = gThousandsSeparator;
var numString = number.toString();
if (!numString)
return "0";
var dot = numString.indexOf(gDecimalSeparator);
if (dot == -1)
dot = numString.length;
var stop = numString.length-dot;
var characteristic = numString.substr(0, dot);
if (!parseInt(characteristic))
return numString;
// see if it's a negative number
var numIsNegative = (parseInt(characteristic) < 0)
var newNumber = "";
var delimiterCount = Math.floor((characteristic.length-1) / 3);
var extras = characteristic.length % 3;
if (!extras && characteristic.length > 2)
extras = 3;
if (extras)
newNumber = newNumber + characteristic.substr(0, extras);
for (var i=0;i< delimiterCount; i++) {
if ( (0 == i) && numIsNegative && (extras == 1))
newNumber = newNumber + characteristic.substr(extras + (i * 3), 3);
else
newNumber = newNumber + delimiter + characteristic.substr(extras + (i * 3), 3);
}
return (dot ? (newNumber + numString.substr(dot, stop)) : newNumber);
}
function formatNumberWithScientificNotation(number) {
if (number == 0)
return number;
var numString = number.toString();
if (!numString)
return "0";
var num = new Number(numString);
var sci = num.toExponential(5);
if (sci == "NaN")
sci = formatNumberWithDelimiters(numString);
if (!sci)
return "0";
return sci;
}
function updateDisplay(number){
if(String(number).length > 8){
number = formatNumberWithScientificNotation(number);
}
else{
number = number;
}
return number;
}
function appendToDisplay(_char, v){
var char = _char;
// Display
if($("#historyBox").val() === "0"){
$("#historyBox").val("");
};
if(char == "-" && lastchar.type == "NaN"){
char = "m";
};
// char is a number
if(char <= 0 || char > 0 || char == "." || char == "m" || char == "(" || char == ")"){
if(char == "m"){
char = "-";
};
if(lastchar.type == "NaN"){
displayTrunk = "";
};
if(lastchar.value == "." && char == "."){
calc = calc.substr(0, calc.length-1);
displayTrunk = displayTrunk.substr(0, displayTrunk.length-1);
};
if(calc == "0"){
if(char != "0"){
if(char != "."){
calc = String(char);
displayTrunk = String(char);
historyTrunk = String(char);
lastchar.type = "Number";
} else{
calc += String(char);
displayTrunk += String(char);
historyTrunk += String(char);
lastchar.type = "Number";
}
}
} else {
char = (char == ".")?((displayTrunk.indexOf(".", 0) != -1)?"":"."):char;
calc += String(char);
displayTrunk += String(char);
historyTrunk += String(char);
lastchar.type = "Number";
}
}
// char is an operator
else {
if(calc.length === 0){
var endCalc = calc;
calc = lastResult + endCalc;
historyTrunk = updateDisplay(lastResult);
}
if(lastchar.type == "NaN"){
calc = calc.substr(0, calc.length-1);
calc += char;
$("#historyBox").val($("#historyBox").val().substr(0, $("#historyBox").val().length-1));
}
else{
try{
calc = eval(calc) + String(char);
}catch(e){}
}
lastchar.type = "NaN";
try{
displayTrunk = eval(calc.substr(0, calc.length-1));
}catch(e){}
$("#historyBox").val($("#historyBox").val()+historyTrunk+char);
$("#historyBox").scrollTop(99999);
historyTrunk = "";
}
lastchar.value = char;
$("#display").text(updateDisplay(displayTrunk));
}
$("#historyBox").click(function(){
if(!clickFlag){
$(this).select();
clickFlag = true;
}
else{
clickFlag = false;
$(this).blur();
}
});
$(document).disableTextSelect();
};
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title>GraphMe - Guide utilisateur</title>
<link rel="stylesheet" type="text/css" href="Style/Guide_Utilisateur.css"/>
</head>
<body>
<h1>GraphMe</h1>
<img src="Images/GraphMe.png"/>
<h1>Guide d'utilisation</h1>
<ol id="Sommaire">
<li><a href="#Introduction">Introduction</a></li>
<li><a href="#Installation">Installation</a></li>
<li><a href="#AfficherLeWidget">Afficher le widget</a></li>
<li><a href="#PresentationAffichage">Présentation de l'affichage</a></li>
<li><a href="#DessinerFonction">Dessiner une fonction</a></li>
<li><a href="#DeplacerAffichage">Se déplacer à travers la fonction</a></li>
<li><a href="#MenuOptions">Le menu des options</a></li>
<li><a href="#MenuOutils">Le menu des outils</a></li>
<li><a href="#PlusieursFonctions">Dessiner plusieurs fonctions</a></li>
<li><a href="#MaJ">Mettre à jour GraphMe</a></li>
<li><a href="#Contact">Contact</a></li>
</ol>
<h2 id="Introduction">1. Introduction</h2>
<p>
GraphMe est un traceur de fonctions mathématiques que j'ai programmé dans le cadre du travail de maturité gymnasiale. Il est codé en HTML, CSS et JavaScript. Ce grapheur est disponible sur un cd-rom accompagnant mon travail de maturité ainsi que sur internet à la page <a href="http://gyb.educanet2.ch/tm-widgets/.ws_gen/?15">http://gyb.educanet2.ch/tm-widgets/.ws_gen/?15</a>. Ce document a pour but d'expliquer comment utiliser GraphMe. Il présente ses différentes fonctions ainsi que quelques astuces utiles à l'utilisateur.
</p>
<h2 id="Installation">2. Installation</h2>
<p>
Le widget que vous pouvez télécharger sur internet est compressé au format zip. Avant de l'utiliser, il est nécessaire de le décompresser. Si vous n'avez aucuns programmes permettant d'ouvrir les fichiers zip, vous pouvez télécharger 7zip sur <a href="http://www.7-zip.org/">http://www.7-zip.org/</a>. GraphMe a été conçu pour s'utiliser dans un navigateur internet ou s'intégrer à Uniboard. Pour l'ajouter aux widgets d'Uniboard, il faut copier le dossier « GraphMe.wgt » dans « library/interactive/ ». Par exemple, sous Windows, le widget doit être dans : « C:/Program Files/Uniboard 4/library/interactive/GraphMe.wgt ». Si vous n'avez pas Uniboard, vous pouvez l'obtenir sur <a href="http://getuniboard.com">http://getuniboard.com/</a>.
</p>
<h2 id="AfficherLeWidget">3. Afficher le widget</h2>
<div class="droite"><img src="Images/Guide_Navigateur.png"/>Image de GraphMe dans un navigateur internet</div>
<p>
A) Pour afficher le widget dans un navigateur, il faut simplement ouvrir le fichier « Grapheur.xhtml » qui se trouve dans le dossier « GraphMe.wgt » avec votre navigateur internet. Toutefois, certains navigateurs n'arrivent pas à afficher le widget. La liste suivante contient les navigateurs sur lesquels le widget a été testé :
</p>
<ul>
<li>Mozilla Firefox (3.5) : tout fonctionne très bien.</li>
<li>Internet Explorer (8.0) : impossible d'ouvrir le widget, le format .xhtml n'est pas reconnu.</li>
<li>Internet Explorer (pré-version 9.0) : le widget est ouvrable mais seul l'affichage utilisant SVG fonctionne, « canvas » n'est toujours pas supporté.</li>
<li>Konqueror (4.3.4) : le widget s'ouvre mais il y a quelques problèmes d'affichage. Il est quand même utilisable en sélectionnant la méthode d'affichage « canvas » dans les options.</li>
<li>Rekonq (0.5) : le widget fonctionne très bien avec « canvas » mais est un peut lent en utilisant SVG.</li>
<li>Opera (10.51) : le widget est parfaitement utilisable</li>
<li>Google Chrome (4.1) : tout fonctionne également. L'affichage 3D est même très rapide comparé à d'autres navigateurs.</li>
</ul>
<p>
B) Pour ouvrir le widget dans Uniboard, il faut tout d'abord cliquer sur le bouton « Bibliothèque » en haut de la fenêtre. Ensuite, allez dans l'onglet « Interactif » ou autrement, selon les version d'Uniboard, dans l'onglet « Applications ». Cliquez sur l'icône correspondant à « Traceur de fonctions mathématiques » et finalement sur « Ajouter à la page ».
</p>
<div class="gauche"><img src="Images/Guide_Uniboard.png"/>Image de GraphMe dans Uniboard</div>
<img src="Images/Guide_AjouterWidget.png"/>
<h2 id="PresentationAffichage">4. Présentation de l'affichage</h2>
<ol>
<li>Champ permettant de définir la fonction à afficher.</li>
<li>Bouton affichant la fonction.</li>
<li>Bouton servant à ajouter une nouvelle fonction ou à accéder à l'historique des fonctions.</li>
<li>Zone d'affichage.</li>
<li>Options d'affichage permettant de définir la partie de la fonction à afficher.</li>
<li>Boutons de zoom.</li>
<li>Bouton servant à changer la couleur.</li>
<li>Boutons accédant aux différents menus.</li>
<li>Onglet choisissant entre les fonctions 2D et 3D.</li>
<li>Bouton de maximisation du widget.</li>
</ol>
<img src="Images/Guide_Presentation.png"/>
<h2 id="DessinerFonction">5. Dessiner une fonction</h2>
<p>
Pour dessiner une fonction mathématique, il suffit d'entrer celle-ci dans le champ en haut du widget et de cliquer sur le bouton « Afficher ». On peut utiliser différentes fonctions et constantes prédéfinies:
</p>
<h4>Les opérations de base</h4>
<ul>
<li>l'addition → +</li>
<li>la soustraction → -</li>
<li>la multiplication → *</li>
<li>la division → /</li>
<li>le modulo → %</li>
</ul>
<h4>Les fonctions trigonométriques</h4>
<ul>
<li>sin(x), cos(x), tan(x), cot(x)</li>
<li>asin(x), acos(x), atan(x), acot(x) ( ou arcsin(x), arccos(x), arctan(x), arccot(x) )</li>
</ul>
<h4>Les racines et les puissances</h4>
<ul>
<li>sqrt(x) fait la racine carrée de x</li>
<li>pow(x, y) élève un nombre x à une puissance y, par exemple :<br/>x² → pow(x, 2)<br/>(x+3)⁵ → pow((x+3), 5)</li>
<li>root(x, y) fait la racine yème d'un nombre x</li>
</ul>
<h4>Les exponentielles et logarithmes</h4>
<ul>
<li>exp(x)</li>
<li>ln(x) est le logarithme naturel</li>
<li>log(x) est le logarithme de base 10</li>
</ul>
<h4>Les arrondis</h4>
<ul>
<li>round(x) → arrondit à l'entier le plus proche</li>
<li>ceil(x) → arrondit à l'entier supérieur</li>
<li>floor(x) → arrondit à l'entier inférieur</li>
</ul>
<h4>Autres fonctions prédéfinies</h4>
<ul>
<li>abs(x) → la valeur absolue d'un nombre</li>
<li>random() → retourne un nombre aléatoire entre 0 et 1</li>
</ul>
<h4>Les constantes</h4>
<ul>
<li>pi = 4 * atan(1) ≈ 3.141592653589793</li>
<li>e = exp(1) ≈ 2.718281828459045 </li>
</ul>
<p>
Il n'est pas toujours facile de comprendre comment écrire la fonction désirée. En effet, une petite faute et elle ne s'affichera pas. De plus, il ne faut pas oublier de mettre un « * » entre les thermes à multiplier et d'utiliser le point « . » pour écrire des nombres à virgule.
</p>
<p>
Les fonctions en deux dimensions s'écrivent sous la forme : y=[...] et les fonctions en trois dimensions sous la forme : z=[...]. D'autres exemples sont disponibles dans le menu « aide » du widget si vous avez de la peine à entrer une fonction.
</p>
<h2 id="DeplacerAffichage">6. Se déplacer à travers la fonction</h2>
<p>
Parfois, lorsqu'on dessine une fonction, la zone visible n'est pas très intéressante. Pour cela, il est utile de déplacer l'affichage ou de définir soi-même la zone à afficher.
</p>
<img src="Images/Guide_Deplacement.png"/>
<p>
Pour déplacer la fonction, il suffit d'utiliser les flèches de navigation situées dans les quatre bords de l'affichage ou l'outil de déplacement à la souris (dans le menu « Outils »).
</p>
<p>
Pour définir la zone à afficher, il faut entrer des valeurs personnalisées dans les champs à gauche du widget. La valeur de gauche doit obligatoirement être plus petite que la valeur de droite. Dans le cas contraire, la fonction ne se dessinera pas.
</p>
<p>
Il est possible de zoomer ou dé-zoomer l'affichage en utilisant les boutons du menu de gauche pour voir une plus grande partie de la fonction. Le zoom peut être réinitialisé dans les options. On peut également cliquer deux fois sur le graphique pour zoomer ainsi que dé-zoomer en maintenant la touche « ctrl » appuyée et en cliquant deux fois.
</p>
<h2 id="MenuOptions">7. Le menu des options</h2>
<p>
Cliquez sur le bouton « Options » à gauche du widget pour ouvrir ce menu. En cliquant à nouveau sur le bouton, cela ferme le menu. Plusieurs onglets permettent de naviguer entre les différentes options. Description des options :
</p>
<ul>
<li>Le thème du widget change l'image de fond ainsi que différentes couleurs. Dans Uniboard, changer le thème permet de rendre le widget plus visible selon qu'il se trouve sur un fond noir ou un fond blanc.</li>
<li>La méthode d'affichage permet de définir la façon dont le graphique de la fonction sera dessiné. Il y a le choix entre six possibilités : <br/>
<ol>
<li>SVG est un format d'image vectoriel qui peut être intégré dans une page HTML. Il est compatible dans la plupart des navigateurs Internet et est très bien supporté par Uniboard, c'est pourquoi il est choisi par défaut.</li>
<li>« SVG (une image) » ne présente que peu de différence avec la méthode d'affichage « SVG ». A moins d'un problème de compatibilité, il n'est pas très utile de la choisir.</li>
<li>Canvas est une nouvelle balise présente depuis HTML 5.0. Elle permet de définir une zone dans laquelle on peut faire des dessins. Cette méthode d'affichage est plus rapide que d'utiliser du SVG, cependant, elle n'est pas complètement compatible dans Uniboard. Il est conseillé de choisir cette option si vous utilisez le widget ailleurs que dans Uniboard.</li>
<li>Canvas (point) utilise aussi canvas, mais dessine des points à la place de lignes.</li>
<li>XPM est un format d'image très peu connu. De ce fait, il est compatible qu'avec une minorité de navigateur.</li>
<li>La méthode d'affichage « Uniboard » permet de dessiner directement sur la page d'Uniboard avec les outils de dessins.</li>
</ol>
<img src="Images/Guide_Options.png"/>
</li>
<li>Le zoom par défaut ainsi que le bouton « réinitialiser le zoom » permettent de remettre l'affichage à l'état qu'il était à l'ouverture du widget. Cela permet aussi de centrer l'affichage sur l'origine.</li>
<li>Les options d'affichage permettent d'afficher ou non la grille, les axes ainsi que l'échelle. Elles sont utiles pour rendre l'affichage plus lisible. Il est également possible de modifier l'épaisseur du trait de la fonction.</li>
<li>Le décalage du graphique n'a en principe pas besoin d'être utilisé. Il permet de déplacer tout l'affichage dans un sens ou dans l'autre, s'il n'est pas centré à la bonne place. Cela peut arriver avec certains navigateurs Internet.</li>
<li>La précision des calculs du graphique permet d'augmenter ou de diminuer le nombre de points calculés. Plus le nombre est petit, plus la précision est grande. Il est utile de mettre cette valeur à « 0.01 » si vous dessinez des fonctions ressemblant à 0.5*sin(10*x*x).</li>
<li>Dans les options 3D, le style d'affichage permet de choisir comment la fonction est dessinée : avec des petits points ou avec des polygones (surfaces). La plupart des fonctions sont plus jolies en dessinant la surface entre les points calculés. Toutefois, c'est mieux de dessiner des points pour des fonctions comme la demi-sphère : sqrt(12-x*x-y*y).</li>
<li>Dans le dernier onglet, vous pouvez modifier d'autres options 3D, comme la précision des calculs ainsi que la couleur de la fonction.</li>
</ul>
<h2 id="MenuOutils">8. Le menu des outils</h2>
<p>
Ce menu permet tout d'abord de choisir l'action de la souris sur le graphique. Il y a le choix entre trois possibilités :
</p>
<ul>
<li>L'outil sélectionné par défaut est le point. En bougeant la souris, un point se déplace sur la fonction et les coordonnées de ce point sont indiquées en haut à gauche de l'affichage.</li>
<li>Le deuxième outil est le déplacement. Il permet de déplacer le graphique avec la souris. Il suffit de tenir cliqué sur l'affichage et de bouger la souris. Malheureusement, cet outil peut être lent sur certains navigateurs.</li>
<li>Le troisième outil est la tangente. Cet outil dessine la tangente à la fonction au point où se trouve la souris.</li>
</ul>
<p>
Ensuite, ce menu permet aussi de calculer un point de la fonction. Il faut simplement entrer la coordonnée « x » du point dont on veut trouver la coordonnée « y », et appuyer sur le bouton « Évaluer ». Par exemple, si la fonction est « x*x » et qu'on défini « x=2 », alors le point dont la coordonnée sur l'axe des X est « 2 » aura comme coordonnée sur l'axe des Y « 4 ».
</p>
<p>
Un autre outil très utile est l'étude de fonction. Pour étudier la fonction entrée dans le champ en haut du widget, cliquez sur « démarrer l'étude ». Les études de fonction de ce widget ne sont pas fiables à 100% mais servent de complément à une étude de fonction que l'on fait soi-même. Il se peut que cet outil soit amélioré dans une prochaine version du widget.
</p>
<p>
Dans ce menu, on trouve également des tests d'affichage. Ils permettent d'essayer les différentes méthodes d'affichage et de voir si elles fonctionnent sur le navigateur internet utilisé.
</p>
<h2 id="PlusieursFonctions">9. Dessiner plusieurs fonctions</h2>
<p>
Pour dessiner plusieurs fonctions simultanément, cliquez sur le petit bouton « + » qui se situe à droite du bouton « Afficher » (point 1). Ensuite, un menu apparaît.
</p>
<img src="Images/Guide_Plus.png"/>
<p>
Dans ce menu, des onglets permettent d'aller à l'historique ou aux fonctions supplémentaires (point 2). Pour ajouter une fonction, cliquez sur le bouton à droite de la fonction actuelle (point 3). En dessous, une liste contient toutes les fonctions affichées (point 4). Pour supprimer une fonction, il faut simplement cliquer sur le bouton « - » à coté de celle-ci. Il est également possible de modifier la couleur de chaque fonction séparément.
</p>
<p>
L'historique permet de revoir toutes les fonctions qui ont déjà été dessinées. Lorsque l'on clique sur une fonction de l'historique, celle qui est dessinée actuellement est remplacée par la fonction de l'historique.
</p>
<p>
Dessiner plusieurs fonctions simultanément est uniquement possible avec la méthode d'affichage « canvas » en deux dimensions. Par contre, l'historique est utilisable avec toutes les méthodes d'affichage.
</p>
<h2 id="MaJ">10. Mettre à jour GraphMe</h2>
<p>
La dernière version du widget est téléchargeable sur la page suivante : <a href="http://gyb.educanet2.ch/tm-widgets/.ws_gen/?15">http://gyb.educanet2.ch/tm-widgets/.ws_gen/?15</a>. Pour mettre à jour GraphMe, vous pouvez aussi cliquer sur le bouton "Mise à jour" dans le menu des options.
</p>
<h2 id="Contact">11. Contact</h2>
<p>
Si vous voulez rapporter un bug, avez une suggestion par rapport au widget ou voulez simplement poser une question, merci de me contacter par e-mail à l'adresse : <a href="mailto:yannick.vessaz@gmail.com">yannick.vessaz@gmail.com</a>.
</p>
</body>
</html>
\ No newline at end of file
var fonction3D = false;
var outilPrecedent = "";
function activer3D(){
if(fonction3D){ // Si activé alors on le désative
fonction3D = false;
outil.choisir(outilPrecedent);
document.getElementById('onglet3D').innerHTML = "3D";
document.getElementById('zoomButtons').style.display = "block";
document.getElementById('toolButtons').style.display = "block";
affichage.init();
outil.init();
affichage.initZoom2(document.getElementById('zoomDefaut').value);
}
else{ // Sinon on l'active
fonction3D = true;
outilPrecedent = outil.actuel;
outil.choisir("deplacement");
document.getElementById('onglet3D').innerHTML = "2D";
document.getElementById('zoomButtons').style.display = "none";
document.getElementById('toolButtons').style.display = "none";
display3D.init();
outil.liste = [];
outil.init();
message.supprimer();
}
cacherMenu();
if(fonction3D){
if(document.getElementById('input3D').value == ""){
afficherMenu('menuFonctions3D');
}
else{
display3D.draw();
}
}
saveOptions();
}
var display3D = {
canvas: null,
ctx: null,
width: 0,
height: 0,
centerX: 0,
centerY: 0,
scale: 50,
linePrecision: 0.02,
functionPrecision: 0.2,
angle: Math.PI/8,
zoomValue: 1,
left: -6.5,
right: 6.5,
rouge3D: 0,
vert3D: 1,
bleu3D: 2,
couleurGenerale: 0,
background: "rgba(0, 0, 0, 0.5)",
init: function(width, height){
var displayElement = document.getElementById("affichage");
// Clear displayElement content
if(displayElement.hasChildNodes()){
while(displayElement.childNodes.length >= 1 ){
displayElement.removeChild(displayElement.firstChild);
}
}
// Setup sizes
this.width = width || displayElement.clientWidth;
this.height = height || displayElement.clientHeight;
this.centerX = this.width / 2;
this.centerY = this.height / 2;
// Create canvas
this.canvas = document.createElement("canvas");
this.canvas.width = this.width;
this.canvas.height = this.height;
displayElement.appendChild(this.canvas);
this.ctx = this.canvas.getContext('2d');
this.clear();
},
clear: function(){
var ctx = this.ctx;
ctx.clearRect(0, 0, this.width, this.height);
ctx.fillStyle = this.background;
ctx.fillRect(0, 0, this.width, this.height);
this.axes();
},
draw: function(){
// var ti = new Date().getTime();
// this.init();
this.clear();
var txtFct = fct.remplacer(fct.verifier(document.getElementById("input3D").value));
if(txtFct == ""){
return;
}
var func = new CartesianFunction(txtFct);
if(document.getElementById("selectAffichage3D").value == "points"){
var coordX, coordY, coordZ;
for(var x=this.left; x<this.right; x+=this.functionPrecision){
for(var y=this.left; y<this.right; y+=this.functionPrecision){
coordX = x;
coordY = y;
coordZ = func.f(x,y);
if(isNaN(coordZ)){
continue;
}
this.point3D(coordX, coordY, coordZ);
}
}
}
else{
var x1, y1, z1, x2, y2, z2, x3, y3, z3;
var x, y;
var valAngle = Math.round(this.angle/Math.PI);
if(valAngle%2==0){
for(var x1=this.left; x1<this.right; x1+=this.functionPrecision){
for(var y1=this.left; y1<this.right; y1+=this.functionPrecision){
x = x1;
y = y1;
z1 = func.f(x,y);
x2 = x1 + this.functionPrecision;
y2 = y1;
x = x2;
//y = y2;
z2 = func.f(x,y);
x3 = x2;
y3 = y2 + this.functionPrecision;
//x = x3
y = y3;
z3 = func.f(x,y);
x4 = x3 - this.functionPrecision;
y4 = y3;
x = x4;
//y = y4;
z4 = func.f(x,y);
if(isNaN(z1)||isNaN(z2)||isNaN(z3)||isNaN(z4)){
continue;
}
this.polygone3D(x1, y1, z1, x2, y2, z2, x3, y3, z3, x4, y4, z4);
}
}
}
else{
for(var x1=this.right; x1>this.left; x1-=this.functionPrecision){
for(var y1=this.right; y1>this.left; y1-=this.functionPrecision){
x = x1;
y = y1;
z1 = func.f(x,y);
x2 = x1 - this.functionPrecision;
y2 = y1;
x = x2;
//y = y2;
z2 = func.f(x,y);
x3 = x2;
y3 = y2 - this.functionPrecision;
//x = x3;
y = y3;
z3 = func.f(x,y);
x4 = x3 + this.functionPrecision;
y4 = y3;
x = x4;
//y = y4;
z4 = func.f(x,y);
if(isNaN(z1)||isNaN(z2)||isNaN(z3)||isNaN(z4)){
continue;
}
this.polygone3D(x1, y1, z1, x2, y2, z2, x3, y3, z3, x4, y4, z4);
}
}
}
}
// var tf = new Date().getTime();
// window.console.log(tf-ti);
},
// Dessine un point à la position (x, y, z)
point3D: function(x, y, z){
var posX = (Math.sin(this.angle)*x + Math.cos(this.angle)*y)*this.scale;
var posZ = -(z - Math.cos(this.angle)*x/2.6 + Math.sin(this.angle)*y/2.6)*this.scale;
var opacity = Math.round((1-((5+y*Math.sin(this.angle)-x*Math.cos(this.angle)) / 450)*this.scale)*1000)/1000;
var couleur = new Array();
couleur[0] = Math.round((5+z)*this.scale);
couleur[1] = Math.round(510 - (5+z)*this.scale);
couleur[2] = this.couleurGenerale;
if(opacity > 1){ opacity = 1; }
if(opacity < 0){ opacity = 0; }
if(couleur[0] > 255){ couleur[0] = 255; }
if(couleur[0] < 0){ couleur[0] = 0; }
if(couleur[1] > 255){ couleur[1] = 255; }
if(couleur[1] < 0){ couleur[1] = 0; }
var ctx = this.ctx;
ctx.save();
ctx.translate(this.centerX, this.centerY);
ctx.scale(this.zoomValue, this.zoomValue);
ctx.fillStyle = "rgba("+couleur[this.rouge3D]+","+couleur[this.vert3D]+", "+couleur[this.bleu3D]+", "+opacity+")";
ctx.fillRect(posX-1, posZ-1, 2, 2);
ctx.restore();
},
// Dessine un polygone qui a comme sommets : (x1, y1, z1) , (x2, y2, z2), (x3, y3, z3) et (x4, y4, z4)
polygone3D: function(x1, y1, z1, x2, y2, z2, x3, y3, z3, x4, y4, z4){
var ctx = this.ctx;
ctx.save();
ctx.translate(this.centerX, this.centerY);
ctx.scale(this.zoomValue, this.zoomValue);
ctx.beginPath();
ctx.moveTo((Math.sin(this.angle)*x1 + Math.cos(this.angle)*y1)*this.scale , -(z1 - Math.cos(this.angle)*x1/2.6 + Math.sin(this.angle)*y1/2.6)*this.scale);
ctx.lineTo((Math.sin(this.angle)*x2 + Math.cos(this.angle)*y2)*this.scale , -(z2 - Math.cos(this.angle)*x2/2.6 + Math.sin(this.angle)*y2/2.6)*this.scale);
ctx.lineTo((Math.sin(this.angle)*x3 + Math.cos(this.angle)*y3)*this.scale , -(z3 - Math.cos(this.angle)*x3/2.6 + Math.sin(this.angle)*y3/2.6)*this.scale);
ctx.lineTo((Math.sin(this.angle)*x4 + Math.cos(this.angle)*y4)*this.scale , -(z4 - Math.cos(this.angle)*x4/2.6 + Math.sin(this.angle)*y4/2.6)*this.scale);
var opacity = Math.round((1-((5+y1*Math.sin(this.angle)-x1*Math.cos(this.angle)) / 450)*this.scale)*1000)/1000;
var couleur = new Array();
couleur[0] = Math.round((5+z1)*this.scale);
couleur[1] = Math.round(510 - (5+z1)*this.scale);
couleur[2] = this.couleurGenerale;
if(opacity > 1){ opacity = 1; }
if(opacity < 0){ opacity = 0; }
// for(var i=0; i<couleur.length; i++){
// couleur[i] -= parseInt((opacity*255));
// }
if(couleur[0] > 255){ couleur[0] = 255; }
if(couleur[0] < 0){ couleur[0] = 0; }
if(couleur[1] > 255){ couleur[1] = 255; }
if(couleur[1] < 0){ couleur[1] = 0; }
ctx.fillStyle = "rgba("+couleur[this.rouge3D]+","+couleur[this.vert3D]+", "+couleur[this.bleu3D]+", "+opacity+")";
ctx.strokeStyle = "rgba(0,0,0,0.1)";
ctx.closePath();
ctx.fill();
ctx.stroke();
ctx.restore();
},
// Dessine les axes
axes: function(){
for(var i=-5; i<5; i+=this.linePrecision){
this.point3D(0, 0, i);
}
for(var i=-5.5; i<5.5; i+=this.linePrecision){
this.point3D(i, 0, 0);
}
for(var i=-5.5; i<5.5; i+=this.linePrecision){
this.point3D(0, i, 0);
}
},
cube: function(x, y, z, r){
// Face de devant
for(var i=0; i<r; i+=this.linePrecision){
this.point3D(x+i, y, z);
}
for(var i=0; i<r; i+=this.linePrecision){
this.point3D(x+r, y+i, z);
}
for(var i=0; i<r; i+=this.linePrecision){
this.point3D(x+r-i, y+r, z);
}
for(var i=0; i<r; i+=this.linePrecision){
this.point3D(x, y+r-i, z);
}
// Face de derrière
for(var i=0; i<r; i+=this.linePrecision){
this.point3D(x+i, y, z+r);
}
for(var i=0; i<r; i+=this.linePrecision){
this.point3D(x+r, y+i, z+r);
}
for(var i=0; i<r; i+=this.linePrecision){
this.point3D(x+r-i, y+r, z+r);
}
for(var i=0; i<r; i+=this.linePrecision){
this.point3D(x, y+r-i, z+r);
}
// Arrêtes
for(var i=0; i<r; i+=this.linePrecision){
this.point3D(x, y, z+i);
}
for(var i=0; i<r; i+=this.linePrecision){
this.point3D(x, y+r, z+i);
}
for(var i=0; i<r; i+=this.linePrecision){
this.point3D(x+r, y, z+i);
}
for(var i=0; i<r; i+=this.linePrecision){
this.point3D(x+r, y+r, z+i);
}
},
// Change les couleurs de l'affichage 3D et affiche l'aperçu de celles-ci.
checkCouleurs3D: function(){
var rouge, vert, bleu;
var sensRouge, sensVert, sensBleu;
var precisionApercu = 64;
this.couleurGenerale = parseInt(document.getElementById("couleur3Dgenerale").value);
if(!this.couleurGenerale){
this.couleurGenerale = 0;
}
if(this.couleurGenerale < 0){
this.couleurGenerale = 0;
}
if(this.couleurGenerale > 255){
this.couleurGenerale = 255;
}
switch(document.getElementById("selectRouge3D").value){
case "plus":
this.rouge3D = 0;
rouge = 255;
sensRouge = -1;
break;
case "moins":
this.rouge3D = 1;
rouge = 0;
sensRouge = 1;
break;
case "tout":
this.rouge3D = 2;
rouge = this.couleurGenerale;
sensRouge = 0;
break;
}
switch(document.getElementById("selectVert3D").value){
case "plus":
this.vert3D = 0;
vert = 255;
sensVert = -1;
break;
case "moins":
this.vert3D = 1;
vert = 0;
sensVert = 1;
break;
case "tout":
this.vert3D = 2;
vert = this.couleurGenerale;
sensVert = 0;
break;
}
switch(document.getElementById("selectBleu3D").value){
case "plus":
this.bleu3D = 0;
bleu = 255;
sensBleu = -1;
break;
case "moins":
this.bleu3D = 1;
bleu = 0;
sensBleu = 1;
break;
case "tout":
this.bleu3D = 2;
bleu = this.couleurGenerale;
sensBleu = 0;
break;
}
document.getElementById("apercuCouleur3D").innerHTML = "<span style='background-color:rgba("+rouge+","+vert+","+bleu+",1);color:rgba(0,0,0,0);'>.</span>";
for(var i=0; i<precisionApercu; i++){
rouge = rouge + sensRouge*(256/precisionApercu);
vert = vert + sensVert*(256/precisionApercu);
bleu = bleu + sensBleu*(256/precisionApercu);
document.getElementById("apercuCouleur3D").innerHTML = document.getElementById("apercuCouleur3D").innerHTML + "<span style='background-color:rgba("+rouge+","+vert+","+bleu+",1);color:rgba(0,0,0,0);'>.</span>";
}
if(this.ctx){
this.draw();
}
},
zoom: function(value){
if(!fonction3D){
return;
}
this.zoomValue *= value;
this.left /= value;
this.right /= value;
this.functionPrecision /= value;
this.linePrecision /= value;
//alert(this.zoomValue+" ; "+this.left+" ; "+this.right+" ; "+this.functionPrecision+" ; "+this.linePrecision);
this.draw();
},
move: function(value){
this.angle += Math.PI/32 * value;
this.draw();
},
initZoom: function(){
this.angle = Math.PI/8;
this.zoomValue = 1;
this.left = -6.5;
this.right = 6.5;
this.draw();
}
};
// -------------------- Uniboard --------------------
// Ces fonctions permettent de dessiner le graphique directement dans Uniboard.
function colorToHex(color) {
var addZero = function(myString){
if (myString.length == 1) return "0" + myString;
else return myString;
}
var digits = /(.*?)rgb\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)/.exec(color);
if (digits == null){
digits = /(.*?)rgba\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)/.exec(color);
}
if(digits == null){
return "";
}
var red = parseInt(digits[2]);
var green = parseInt(digits[3]);
var blue = parseInt(digits[4]);
var hexcode = addZero(red.toString(16)) + addZero(green.toString(16)) + addZero(blue.toString(16));
return '#' + hexcode.toUpperCase();
}
function initUniboard(){
if(!window.uniboard && window.sankore){
uniboard = sankore;
}
uniboard.centerOn(337,245);
// uniboard.setTool("pen");
// Paramètres par défaut
uniboard.lineWidth = 1;
uniboard.fillStyle = "black";
uniboard.strokeStyle = "black";
// Position du curseur pour écrire des nombres
uniboard.cursorX = 0;
uniboard.cursorY = 0;
// Fonctions
uniboard.strokeColor = function(){
this.setPenColor(colorToHex(this.strokeStyle));
};
uniboard.fillColor = function(){
this.setPenColor(colorToHex(this.fillStyle));
};
uniboard.lineTo = function(x, y){
if(y>-20 && y<affichage.hauteur+20){
this.strokeColor();
this.drawLineTo(x, y, this.lineWidth/2);
}
};
uniboard.arc = function(x, y, r){
this.fillColor();
this.moveTo(x, y);
this.drawLineTo(x, y, r*2);
};
uniboard.clearRect = function(x, y, width, height){
if(height<0){
height = Math.abs(height);
y -= height;
}
if(width<0){
width = Math.abs(width);
x -= width;
}
this.moveTo(x, y)
this.eraseLineTo(x+width, y+height, this.lineWidth);
};
uniboard.fillRect = function(x, y, width, height){
this.fillColor();
if(height<0){
height = Math.abs(height);
y -= height;
}
if(width<0){
width = Math.abs(width);
x -= width;
}
this.moveTo(x, y)
this.drawLineTo(x+width, y+height, this.lineWidth);
};
uniboard.fillText = function(txt, x, y){
// TODO
this.fillNumber(txt, x, y);
};
uniboard.beginPath = function(){
this.moveTo(0, 0);
};
uniboard.fill = function(){};
uniboard.stroke = function(){};
uniboard.fillNumber = function(nbr, x, y){
var w = 5;
var number = "" + nbr;
if(!x || !y){
x = this.cursorX;
y = this.cursorY;
}
else{
x += 3;
y -= 12;
}
this.moveTo(x, y);
this.fillColor();
var move = function(){
uniboard.moveTo(x, y);
};
var draw = function(){
uniboard.drawLineTo(x, y, uniboard.lineWidth)
};
var space = function(){
x += 2*w/3;
move();
};
for(var i=0; i<number.length; i++){
switch(number.charAt(i)){
case "1":
y += w
move()
x += w
y -= w
draw()
y += 2*w
draw()
y -= 2*w
space()
break;
case "2":
x += w
draw()
y += w
draw()
x -= w
draw()
y += w
draw()
x += w
draw()
y -= 2*w
space()
break;
case "3":
x += w
draw()
y += w
draw()
x -= w
draw()
x += w
move()
y += w
draw()
x -= w
draw()
y -= 2*w
x += w
space()
break;
case "4":
y += w
draw()
x += w
draw()
y -= w
draw()
y += w
move()
y += w
draw()
y -= 2*w
space()
break;
case "5":
x += w
move()
x -= w
draw()
y += w
draw()
x += w
draw()
y += w
draw()
x -= w
draw()
x += w
y -= 2*w
space()
break;
case "6":
x += w
move()
x -= w
draw()
y += w
draw()
x += w
draw()
y += w
draw()
x -= w
draw()
y -= w
draw()
x += w
y -= w
space()
break;
case "7":
x += w
draw()
x -= w/2
y += 2*w
draw()
x += w/2
y -= 2*w
space()
break;
case "8":
x += w
draw()
y += 2*w
draw()
x -= w
draw()
y -= 2*w
draw()
y += w
move()
x += w
draw()
y -= w
move()
space()
break;
case "9":
x += w
move()
x -= w
draw()
y += w
draw()
x += w
draw()
y += w
draw()
x -= w
draw()
y -= w
x += w
move()
y -= w
draw()
space()
break;
case "0":
x += w
draw()
y += 2*w
draw()
x -= w
draw()
y -= 2*w
draw()
x += w
move()
space()
break;
case "-":
y += w
move()
x += w
draw()
y -= w
move()
space()
break;
default: // Nombre inconnu
// this.showMessage("Error : "+number.charAt(i)+" isn't a number");
}
}
this.cursorX = x;
this.cursorY = y;
// this.showMessage(number);
}
}
// -------------------- Color Picker --------------------
var idColor = "";
// Différentes fonctions nécessaire au Color Picker (menu du choix de la couleur)
var colorPicker = {
// Configuration
idSV : "canvasSV", // id du canvas affichant la saturation et la valeur
idT : "canvasT", // id du canvas affichant la teinte
idO : "canvasO", // id du canvas affichant l'opacité
width : 250, // largeur
height : 250, // hauteur
rayonRonds : 5, // rayon des ronds
ombreActive : "0px 0px 3px rgba(150,200,255,1), 0px 0px 8px rgba(64,190,255,1)",
ombreInactive : "0px 0px 5px rgba(64,64,64,0.4)",
// Variables définies lors de l'initialisation
canvasSV : null,
canvasT : null,
canvasO : null,
ctxSV : null,
ctxT : null,
ctxO : null,
lingradS : null,
lingradV : null,
lingradT : null,
// Couleurs
backgroundColor : "rgb(193,255,0)",
saturation : 100,
valeur : 100,
teinte : 75,
rouge : 193,
vert : 255,
bleu : 0,
opacity: 1,
// Couleurs RGB sans application de la saturation et de la valeur
r : 255,
g : 0,
b : 0,
// Autres variables
sourisDown : false, // Indique si on clique sur le colorPicker ou pas
sourisDehors : true, // Indique si la souris est en-dehors du colorPicker lors d'un clique
idColor : null,
// Fonction d'initialisation
init : function(id){
// Récupérer les éléments
this.canvasSV = document.getElementById(this.idSV);
this.canvasT = document.getElementById(this.idT);
this.canvasO = document.getElementById(this.idO);
// Définir la taille
this.canvasSV.width = this.width;
this.canvasSV.height = this.height;
this.canvasSV.style.width = this.width + "px";
this.canvasSV.style.height = this.height + "px";
this.canvasT.width = this.width/10;
this.canvasT.height = this.height;
this.canvasT.style.width = this.width/10 + "px";
this.canvasT.style.height = this.height + "px";
this.canvasO.width = this.width*1.15;
this.canvasO.height = this.height/10;
this.canvasO.style.width = this.width*1.15 + "px";
this.canvasO.style.height = this.height/10 + "px";
// Initialisation canvas
this.ctxSV = this.canvasSV.getContext("2d");
this.ctxT = this.canvasT.getContext("2d");
this.ctxO = this.canvasO.getContext("2d");
// Création des dégradés
this.lingradV = this.ctxSV.createLinearGradient(0, 0, 0, this.height);
this.lingradV.addColorStop(0, 'rgba(255,255,255,0)');
this.lingradV.addColorStop(1, 'rgba(255,255,255,1)');
this.lingradS = this.ctxSV.createLinearGradient(0, 0, this.width, 0);
this.lingradS.addColorStop(0, 'rgba(0,0,0,1)');
this.lingradS.addColorStop(1, 'rgba(0,0,0,0)');
this.lingradT = this.ctxT.createLinearGradient(0, 0, 0, this.height);
this.lingradT.addColorStop(0, 'rgb(255,0,0)');
this.lingradT.addColorStop(1/6, 'rgb(255,255,0)');
this.lingradT.addColorStop(2/6, 'rgb(0,255,0)');
this.lingradT.addColorStop(3/6, 'rgb(0,255,255)');
this.lingradT.addColorStop(4/6, 'rgb(0,0,255)');
this.lingradT.addColorStop(5/6, 'rgb(255,0,255)');
this.lingradT.addColorStop(1, 'rgb(255,0,0)');
// Événements roulette (initialisé seulement une fois)
if(window.addEventListener && !this.idColor){
this.canvasSV.addEventListener('DOMMouseScroll', function(event){colorPicker.eventWheel(event, colorPicker.idSV)}, false);
this.canvasSV.onmousewheel = function(event){colorPicker.eventWheel(event, colorPicker.idSV)};
this.canvasT.addEventListener('DOMMouseScroll', function(event){colorPicker.eventWheel(event, colorPicker.idT)}, false);
this.canvasT.onmousewheel = function(event){colorPicker.eventWheel(event, colorPicker.idT)};
this.canvasO.addEventListener('DOMMouseScroll', function(event){colorPicker.eventWheel(event, colorPicker.idO)}, false);
this.canvasO.onmousewheel = function(event){colorPicker.eventWheel(event, colorPicker.idO)};
}
// Définir la couleur
this.idColor = id;
var couleur = eval(document.getElementById(this.idColor).title);
// alert(id+" ; "+couleur)
document.getElementById("apercuCouleur").style.backgroundColor = couleur;
document.getElementById("apercuCouleur2").style.backgroundColor = couleur;
this.definirCouleur(couleur);
// Dessiner
this.dessiner();
this.dessinerApercu();
// Définir les valeurs des inputs
this.definirInputs();
// Définir le style de l'ombre
this.sourisOut();
},
definirCouleur : function(colorRGB){
var table = /(.*?)rgb\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)/.exec(colorRGB);
if (table == null){
table = /(.*?)rgba\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)/.exec(colorRGB);
}
if(table == null){
return "";
}
this.rouge = parseInt(table[2]);
this.vert = parseInt(table[3]);
this.bleu = parseInt(table[4]);
this.RGB_SVT();
},
sourisClick : function(id){
this.sourisDown = id;
if(id != this.idO){
document.getElementById(id).style.boxShadow = this.ombreActive;
}
},
sourisOut : function(){
this.canvasSV.style.boxShadow = this.ombreInactive;
this.canvasT.style.boxShadow = this.ombreInactive;
},
sourisOver : function(id){
if(this.sourisDown == id && id != this.idO){
document.getElementById(id).style.boxShadow = this.ombreActive;
}
},
sourisUp : function(){
this.sourisDown = false;
this.canvasSV.style.boxShadow = this.ombreInactive;
this.canvasT.style.boxShadow = this.ombreInactive;
this.dessinerO();
},
eventWheel : function(event, id){
if(!event) event = window.event;
if(event.wheelDelta){
if(event.wheelDelta < 0){
colorPicker.sourisWheelUp(id);
}
else{
colorPicker.sourisWheelDown(id);
}
}
else if(event.detail){
if(event.detail > 0){
colorPicker.sourisWheelUp(id);
}
else{
colorPicker.sourisWheelDown(id);
}
}
},
sourisWheelUp : function(id){
switch(id){
case this.idT:
colorPicker.ajouterT(5);
break;
case this.idO:
colorPicker.ajouterO(0.1);
break;
case this.idSV:
colorPicker.ajouterS(-5);
break;
}
},
sourisWheelDown : function(id){
switch(id){
case this.idT:
colorPicker.ajouterT(-5);
break;
case this.idO:
colorPicker.ajouterO(-0.1);
break;
case this.idSV:
colorPicker.ajouterS(5);
break;
}
},
ajouterT : function(nbr){
this.teinte += nbr;
if(this.teinte < 0){
this.teinte = 0;
}
else if(this.teinte > 360){
this.teinte = 360;
}
this.SVT_RGB();
},
ajouterO : function(nbr){
this.opacity = Math.round((this.opacity+nbr)*100)/100;
if(this.opacity < 0){
this.opacity = 0;
}
else if(this.opacity > 1){
this.opacity = 1;
}
this.SVT_RGB();
},
ajouterS : function(nbr){
this.saturation += nbr;
if(this.saturation < 0){
this.saturation = 0;
}
else if(this.saturation > 100){
this.saturation = 100;
}
this.SVT_RGB();
},
// Lors du déplacement de la souris
moveSV : function(event){
// Vérifie si on appuie sur la souris
if(this.sourisDown != this.idSV){
return 0;
}
var element = this.canvasSV;
var posDivY = 0;
var posDivX = 0;
// Récupérer la position du canvas par rapport à la page
while(element){
posDivY = posDivY + element.offsetTop;
posDivX = posDivX + element.offsetLeft;
element = element.offsetParent;
}
// Définir la saturation et la valeur à partir de la position de la souris
this.saturation = 100-Math.round((event.clientY - posDivY -1)/(this.height+1)*100);
this.valeur = Math.round((event.clientX - posDivX -1)/(this.width+1)*100);
this.SVT_RGB();
},
moveT : function(event){
if(this.sourisDown != this.idT){
return 0;
}
var element = this.canvasT;
var posDivY = 0;
while(element){
posDivY = posDivY + element.offsetTop;
element = element.offsetParent;
}
this.teinte = Math.round( (event.clientY - posDivY -0) / (this.height+1)*360);
this.SVT_RGB();
},
SVT_RGB : function(){
this.T_rgb();
this.rouge = Math.round((this.r + (255-this.r) * (-1) * (this.saturation-100) / 100 )* this.valeur / 100);
this.vert = Math.round((this.g + (255-this.g) * (-1) * (this.saturation-100) / 100 )* this.valeur / 100);
this.bleu = Math.round((this.b + (255-this.b) * (-1) * (this.saturation-100) / 100 )* this.valeur / 100);
this.definirInputs();
this.dessinerApercu();
this.dessiner();
},
T_rgb : function(){
var r,g,b = 0;
var T = this.teinte;
if (T<60){
r = 255;
g = T/60*255;
b = 0;
}
else if (T<120){
r = (255-(T%60/60*255))%256;
g = 255;
b = 0;
}
else if (T<180){
r = 0;
g = 255;
b = T%60/60*255;
}
else if (T<240){
r = 0;
g = (255-(T%60/60*255))%256;
b = 255;
}
else if (T<300){
r = T%60/60*255;
g = 0;
b = 255;
}
else if (T<360){
r = 255;
g = 0;
b = (255-(T%60/60*255))%256;
}
else{
r = 255;
g = 0;
b = 0;
}
this.r = Math.round(r);
this.g = Math.round(g);
this.b = Math.round(b);
},
RGB_SVT : function(){
// Voir http://fr.wikipedia.org/wiki/Teinte_Saturation_Valeur#Conversion_de_RVB_vers_TSV
var r = this.rouge/255;
var g = this.vert/255;
var b = this.bleu/255;
if(!isFinite(r)){
r = 0;
}
if(!isFinite(g)){
g = 0;
}
if(!isFinite(b)){
b = 0;
}
var max = Math.max(r,g,b);
var min = Math.min(r,g,b);
var s, v, t;
// Teinte
switch(max){
case r:
t = (60 * (g-b)/(max-min) + 360) % 360;
break;
case g:
t = 60 * (b-r)/(max-min) + 120;
break;
case b:
t = 60 * (r-g)/(max-min) + 240;
break;
default: /* case min: */
t = 0;
break;
}
// Saturation
if(max == 0){
s = 0;
}
else{
s = 1-(min/max);
}
// Valeur
v = max;
// Définir les variables
this.saturation = s*100;
this.valeur = v*100;
this.teinte = Math.round(t);
this.T_rgb();
},
dessiner : function(){
var ctxSV = this.ctxSV;
var ctxT = this.ctxT;
// Fond
ctxSV.fillStyle = "rgb("+this.r+","+this.g+","+this.b+")";
ctxSV.fillRect(0, 0, this.width, this.height);
// Dégradés
ctxSV.fillStyle = this.lingradV;
ctxSV.fillRect(0, 0, this.width, this.height);
ctxSV.fillStyle = this.lingradS;
ctxSV.fillRect(0, 0, this.width, this.height);
// Souris
var x = Math.round(this.width*this.valeur/100);
var y = Math.round(this.height-this.height*this.saturation/100);
ctxSV.beginPath();
ctxSV.arc(x, y, this.rayonRonds, 0, 2*Math.PI, true);
ctxSV.strokeStyle = "rgba(255,255,255,0.8)";
ctxSV.shadowOffsetX = 1;
ctxSV.shadowOffsetY = 1;
ctxSV.shadowColor = "rgba(0,0,0,1)";
ctxSV.shadowBlur = 2;
ctxSV.lineWidth = 1.5;
ctxSV.stroke();
// Fond Teinte
ctxT.fillStyle = this.lingradT;
ctxT.fillRect(0, 0, this.width/10, this.height);
// Souris Teinte
var pos = Math.round(0.99*this.height*this.teinte/360);
ctxT.fillStyle = "rgba(255,255,255,0.8)";
ctxT.shadowOffsetX = 0;
ctxT.shadowOffsetY = 0;
ctxT.shadowColor = "rgba(0,0,0,1)";
ctxT.shadowBlur = 3;
ctxT.fillRect(0, pos, this.width/10, 2);
// Désactiver les ombres
ctxSV.shadowColor = "rgba(0,0,0,0)";
ctxT.shadowColor = "rgba(0,0,0,0)";
this.dessinerO();
},
dessinerApercu : function(){
document.getElementById("apercuCouleur").style.backgroundColor = "rgba("+this.rouge+","+this.vert+","+this.bleu+","+this.opacity+")";
},
definirInputs : function(){
document.getElementById("inputValeur").value = this.valeur;
document.getElementById("inputSaturation").value = this.saturation;
document.getElementById("inputTeinte").value = this.teinte;
document.getElementById("inputRouge").value = this.rouge;
document.getElementById("inputVert").value = this.vert;
document.getElementById("inputBleu").value = this.bleu;
document.getElementById("inputOpacity").value = this.opacity;
},
recupererInputs : function(){
this.valeur = parseInt(document.getElementById("inputValeur").value);
this.saturation = parseInt(document.getElementById("inputSaturation").value);
this.teinte = parseInt(document.getElementById("inputTeinte").value);
this.opacity = parseFloat(document.getElementById("inputOpacity").value);
this.SVT_RGB();
this.definirInputs();
this.dessinerApercu();
this.dessiner();
},
recupererInputs2 : function(){
this.rouge = parseInt(document.getElementById("inputRouge").value);
this.vert = parseInt(document.getElementById("inputVert").value);
this.bleu = parseInt(document.getElementById("inputBleu").value);
this.RGB_SVT();
this.definirInputs();
this.dessinerApercu();
this.dessiner();
},
moveO : function(event){
if(this.sourisDown != this.idO){
return 0;
}
var element = this.canvasO;
var posDivX = 0;
while(element){
posDivX = posDivX + element.offsetLeft;
element = element.offsetParent;
}
this.opacity = Math.round( (event.clientX - posDivX -this.width/10) / (this.width*0.9)*100)/100;
if(this.opacity < 0){
this.opacity = 0;
}
else if(this.opacity > 1){
this.opacity = 1;
}
this.dessinerO();
this.definirInputs();
this.dessinerApercu();
},
dessinerO : function(){
var ctx = this.ctxO;
ctx.shadowBlur = 2;
// Ligne
if(this.sourisDown == this.idO){
ctx.shadowColor = "rgba(0,50,100,1)";
}
else{
ctx.shadowColor = "rgba(0,0,0,1)";
}
ctx.globalAlpha = 1;
ctx.shadowOffsetX = 0;
ctx.shadowOffsetY = 0;
ctx.fillStyle = "rgba("+this.rouge+","+this.vert+","+this.bleu+",1)";
ctx.clearRect(0,0,this.width*1.15,this.height);
ctx.fillRect(this.width/10, this.height/20-1, this.width*0.9, 3);
// Rond
var x = this.width/10 + this.width*0.9*this.opacity-1;
var y = this.height/20;
if(this.sourisDown == this.idO){
ctx.fillStyle = "rgba(0,40,80,1)";
ctx.strokeStyle = "rgba(230,250,255,0.8)";
}
else{
ctx.fillStyle = "rgba(0,0,0,1)";
ctx.strokeStyle = "rgba(255,255,255,0.8)";
}
ctx.globalAlpha = 0.1+this.opacity*0.9;
ctx.beginPath();
ctx.arc(x, y, this.rayonRonds+1, 0, 2*Math.PI, true);
ctx.shadowColor = "rgba(0,0,0,1)";
ctx.shadowOffsetX = 1;
ctx.shadowOffsetY = 1;
ctx.lineWidth = 1;
ctx.fill();
ctx.stroke();
// Petits ronds
ctx.globalAlpha = 1;
ctx.shadowColor = "rgba(0,0,0,1)";
ctx.beginPath();
ctx.arc(8, this.height/20+0.5, this.rayonRonds, 0, 2*Math.PI, true);
ctx.strokeStyle = "rgba(0,0,0,0.5)";
ctx.shadowOffsetX = 0;
ctx.shadowOffsetY = 0;
ctx.lineWidth = 1;
ctx.stroke();
ctx.beginPath();
ctx.arc(this.width*1.08, this.height/20+0.5, this.rayonRonds, 0, 2*Math.PI, true);
ctx.strokeStyle = "rgba(0,0,0,0.8)";
ctx.fillStyle = "rgba(0,0,0,0.6)";
ctx.shadowOffsetX = 0;
ctx.shadowOffsetY = 0;
ctx.lineWidth = 1;
ctx.stroke();
ctx.fill();
},
exporterCouleur : function(){
eval(document.getElementById(this.idColor).title+' = "rgba(" + this.rouge +", " + this.vert + ", " + this.bleu +", "+this.opacity+")"');
document.getElementById(this.idColor).style.backgroundColor = eval(document.getElementById(this.idColor).title);
},
fermer : function(){
colorPicker.exporterCouleur();
if(colorPicker.idColor == 'buttonColor'){
cacherMenu();
}
else if(dernierMenu == "menuFonctions"){
editeur.getOptions();
afficherMenu(dernierMenu);
}
else{
cacherMenu();
}
actualiserGraph();
}
};
// -------------------- Fonctions de l'interface --------------------
var menuActuel = "divInputRapide"
var dernierMenu = ""
var pleinEcran = false
var maximise = true
var tailleFenetreX = window.innerWidth
var tailleFenetreY = window.innerHeight
var AncienneMethodeAffichage = 0
// Cette fonction permet d'afficher le menu désiré.
// Il faut lui donner l'id du menu à afficher.
function afficherMenu(id){
if (menuActuel == id){
cacherMenu()
dernierMenu = false;
}
else {
if (menuActuel != ""){
dernierMenu = menuActuel;
cacherMenu()
}
menuActuel = id
document.getElementById(id).style.display = "block"
message.supprimer();
}
}
// Permet de cacher le menu actuellement affiché
function cacherMenu(){
if(menuActuel != ""){
document.getElementById(menuActuel).style.display = "none"
menuActuel = ""
}
}
// Affiche un message d'erreur
function afficherErreur(message){
document.getElementById("spanErreurFct").innerHTML = message;
afficherMenu("erreurFct");
}
// Messages d'info
var message = {
liste : [],
ajouter : function(x, y, contenu){
var newDiv = document.createElement("div");
newDiv.style.left = x + "px";
newDiv.style.top = y + "px";
var textDiv = document.createElement("span");
textDiv.innerHTML = contenu;
newDiv.appendChild(textDiv);
document.getElementById("divMessages").appendChild(newDiv);
},
supprimer : function(){
var div = document.getElementById("divMessages");
div.innerHTML = "";
}
};
// ---- Minimiser ou Maximiser le widget (pour Uniboard) ----
function miniMax(){
if (maximise){
maximise = false
document.getElementById('affichage').style.display = "none"
document.getElementById('gauche').style.display = "none"
document.getElementById('miniMax').innerHTML = "+"
window.resizeTo(400,50)
AncienneMethodeAffichage = document.getElementById("selectMethodeAffichage").selectedIndex
document.getElementById("selectMethodeAffichage").selectedIndex = "3"
}
else{
maximise = true
document.getElementById('affichage').style.display = "block"
document.getElementById('gauche').style.display = "block"
document.getElementById('miniMax').innerHTML = "-"
window.resizeTo(tailleFenetreX,tailleFenetreY)
document.getElementById("selectMethodeAffichage").selectedIndex = AncienneMethodeAffichage
}
}
// Affiche le menu +
function menuFonctions(){
if(fonction3D){
afficherMenu('menuHistorique');
}
else{
afficherMenu('menuFonctions');
editeur.editer(0);
}
}
// Action des petits bouton + et - dans les options
function boutonPlus(id, nombre){
var element = document.getElementById(id)
var valeurActuelle = Number(element.value)
element.value = valeurActuelle + nombre
}
function boutonMoins(id, nombre){
var element = document.getElementById(id)
var valeurActuelle = Number(element.value)
if(valeurActuelle>=nombre*2){
element.value = valeurActuelle - nombre
}
}
// Changer de thème
function changerTheme(theme){
var positions = [
"top-left",
"top",
"top-right",
"right",
"bottom-right",
"bottom",
"bottom-left",
"left",
"center"
];
for(var i=0; i<positions.length; i++){
var pos = positions[i];
var id = "background-" + pos;
var path = "Images/" + theme + "/" + pos + ".png";
document.getElementById(id).style.backgroundImage = "url("+path+")";
}
// switch(theme){
// case "white":
// document.body.style.backgroundColor = "black";
// var couleurEchelle = "rgba(0,0,0,0.8)"
// var couleurGrille = "rgba(255,255,255,0.2)"
// var couleurAxes = "rgba(0,0,0,0.5)"
// break;
// default:
// document.body.style.backgroundColor = "transparent";
// var couleurEchelle = "rgba(255,255,255,0.8)"
// var couleurGrille = "rgba(255,255,255,0.1)"
// var couleurAxes = "rgba(0,0,0,0.5)"
// break;
// }
saveOptions();
}
// Affiche un message d'erreur
function error(err){
alert(" Erreur sur la page...\n\n Description: " + err.description + "\n\n Cliquez sur OK pour continuer.\n\n")
}
function agrandirAffichage(){
if(pleinEcran){
pleinEcran = false;
document.getElementById('background-center').style.paddingTop = "30px";
document.getElementById('ongletsHaut').style.display = "block";
document.getElementById('onglet3D').style.display = "block";
document.getElementById('boutonSaveGraph').style.display = "inline-block";
if(window.sankore || window.uniboard){
document.getElementById('zoneJoystick').style.display = "block";
document.getElementById('zoomButtons').style.display = "block";
document.getElementById('toolButtons').style.display = "block";
}
}
else{
pleinEcran = true;
document.getElementById('background-center').style.paddingTop = "0px";
document.getElementById('ongletsHaut').style.display = "none";
document.getElementById('onglet3D').style.display = "none";
document.getElementById('boutonSaveGraph').style.display = "none";
if(window.sankore || window.uniboard){
document.getElementById('zoneJoystick').style.display = "none";
document.getElementById('zoomButtons').style.display = "none";
document.getElementById('toolButtons').style.display = "none";
}
}
widget.resize();
}
// Ferme le widget
function close(){
window.close()
}
// Actions de mise à jour du widget
function miseAjour(){
var txtHTML = "";
document.getElementById("thisVersion").innerHTML = '<object type="text/html" data="version.html"></object>';
for(var i=0; i<listeServeurs.length; i++){
if(i != 0){
txtHTML += '<br/>';
}
txtHTML += '<object type="text/html" data="'+listeServeurs[i]+'version.html"></object>';
// txtHTML += '<input type="button" value="utiliser" onclick="document.location.href = \''+listeServeurs[i]+'Grapheur.html\'"/>';
// txtHTML += '<input type="button" value="télécharger" onclick="window.open(\''+listeServeurs[i]+'../GraphMe.zip\', \'_blank\')"/>';
}
document.getElementById("newVersion").innerHTML = txtHTML;
afficherMenu("mAj");
}
function checkboxMaJ(){
if(versionOnline()){
afficherMenu('erreurMaJ')
document.getElementById("checkMaJ").checked = false
}
else{
if(document.getElementById("checkMaJ").checked){
loadOptions()
document.getElementById("checkMaJ").checked = true
saveOptions()
}
else{
loadOptions()
document.getElementById("checkMaJ").checked = false
saveOptions()
}
}
}
function majAuto(){
// var audio = new Audio();
// audio.src = "version.ogg";
// audio.load();
// setTimeout(function(){
// window.console.log(" "+audio.duration);
// }, 0)
if(versionOnline()){
document.getElementById("cacheMaJ").style.display = "block";
document.getElementById("checkMaJ").disabled = true;
document.getElementById("checkMaJ").checked = true;
}
else{
if(document.getElementById("checkMaJ").checked){
afficherMenu('demandeMaJ');
}
}
}
function majAccept(){
// document.location.href='http://gyb.educanet2.ch/tm-widgets/yannick/GraphMe.wgt/Grapheur.html';
for(var i=0; i<listeServeurs.length; i++){
setTimeout(majServeur, i*500, listeServeurs[i]);
}
}
function majServeur(serveur){
var img = new Image();
img.onload = function(){
document.location.href = serveur + "Grapheur.html";
};
img.src = serveur + "icon.png";
}
// Retourne true si le widget est utilisé depuis un des sites en ligne
function versionOnline(){
for(var i=0; i<listeServeurs.length; i++){
if(document.location.href == listeServeurs[i]+"Grapheur.html"){
return true;
}
}
return false;
}
// Afficher une page web à la place dans la zone d'affichage
function navigateur(lien){
// cacherMenu()
// document.getElementById("affichage").innerHTML = '<object type="text/html" data="'+lien+'" style="width:100%;height:100%;"></object>'
window.open(lien, "_blank")
}
// -------------------- Fonctions des outils --------------------
// Permet d'afficher la valeur en "y" pour un point donné en "x"
function calculerPoint() {
x = document.getElementById("inputX").value;
document.getElementById("outputX").innerHTML = " f(x) = "+fct.list[editeur.idFct].f(x)+"";
//alert("Si x = "+x+" \nf(x) = "+eval(fonction)+"")
}
// Historique
var historique = {
liste : [],
actualiser : function(){
var texteHistorique = ""
for(var i=0; i<this.liste.length; i++){
texteHistorique += '<span class="survol" onclick="historique.use('+i+'); actualiserGraph()">';
texteHistorique += this.liste[i].readableText();
texteHistorique += '</span> <br/>';
}
document.getElementById("spanHistorique").innerHTML = texteHistorique
document.getElementById("divHistorique").scrollTop = 0
},
use : function(index){
fct.add(this.liste[index]);
},
ajouter : function(func){
if(func.fct == ""){
return;
}
for(var i=0; i<this.liste.length; i++){
if(this.liste[i].fct == func.fct){
this.liste.splice(i, 1);
}
}
var newFunction = fct.functionFromObject(func.get());
this.liste.unshift(newFunction);
this.actualiser();
saveOptions();
},
get: function(){
var list = [];
for(var i=0; i<this.liste.length; i++){
list.push(this.liste[i].get());
}
return list;
},
set: function(obj){
for(var i=0; i<obj.length; i++){
this.liste.push(fct.functionFromObject(obj[i]));
}
this.actualiser();
}
}
// Outils de la souris
var outil = {
//
idAffichage : "affichageOutils",
// Outil sélectionné
actuel : "point",
// Canvas
canvas : null,
ctx : null,
width: 0,
height: 0,
// Liste des éléments à dessiner
liste : [],
// Fonction d'initialisation
init : function(width, height){
var element = document.getElementById(this.idAffichage);
if(element.hasChildNodes()){
while(element.childNodes.length >= 1 ){
element.removeChild(element.firstChild);
}
}
this.width = width || element.clientWidth;
this.height = height || element.clientHeight;
// element.style.width = affichage.largeur +"px";
// element.style.height = affichage.hauteur +"px";
// element.style.left = document.getElementById(affichage.id).offsetLeft+1 +"px";
// element.style.top = document.getElementById(affichage.id).offsetTop+1 +"px";
this.canvas = document.createElement("canvas");
this.canvas.width = this.width;
this.canvas.height = this.height;
element.appendChild(this.canvas);
this.ctx = this.canvas.getContext('2d');
},
// Permet de changer d'outil et de faire différentes actions lors du choix de l'outil
choisir : function(nom){
document.getElementById("pointTool").className = "toolButton";
document.getElementById("moveTool").className = "toolButton";
document.getElementById("tangentTool").className = "toolButton";
switch(nom){
case 'point':
document.getElementById("pointTool").className += " selectedTool";
break;
case 'deplacement':
document.getElementById("moveTool").className += " selectedTool";
break;
case 'tangente':
document.getElementById("tangentTool").className += " selectedTool";
break;
}
if(nom == 'deplacement'){
document.getElementById("eventAffichage").style.cursor = "move";
}
else{
document.getElementById("eventAffichage").style.cursor = "auto";
}
this.dessinerListe();
this.actuel = nom;
saveOptions();
},
// Gestion des événements reçus de l'objet souris
move : function(x, y, xInit, yInit, active){
switch(this.actuel){
case "deplacement":
if(active){
this.deplacement(x, y, xInit, yInit);
}
break;
case "point":
this.point(x, y);
break;
case "tangente":
this.tangente(x, y);
break;
}
},
down : function(x, y){
switch(this.actuel){
case "point":
this.point(x, y, true)
break;
case "tangente":
this.tangente(x, y, true);
break;
}
},
// Fonctions des outils
deplacement : function(x, y, xInit, yInit){
var valeurX = (x-xInit)/affichage.multX;
var valeurY = (yInit-y)/affichage.multY;
if(Math.round(Math.abs(valeurX)) > 0){
if(fonction3D){
affichage.deplacerX(Math.round(2*valeurX)/2);
}
else{
affichage.deplacerX(-Math.round(2*valeurX)/2);
}
souris.xInit = x;
}
if(Math.round(Math.abs(valeurY)) > 0){
affichage.deplacerY(-Math.round(2*valeurY)/2);
souris.yInit = y;
}
},
point : function(sourisX, sourisY, ajouterDansListe){
var ctx = new Object();
ctx = this.ctx;
// Dessiner les points et tangentes supplémentaires
this.dessinerListe();
for(var i=0; i<fct.list.length; i++){
var func = fct.list[i];
if(!func || func == ""){
continue;
}
// Position de la souris par rapport au coin supérieur gauche de l'affichage
var posX = sourisX - affichage.offsetLeft - 2;
// Valeur de la coordonnée x et y sous la souris
var t = posX / affichage.multX + affichage.xGauche;
if("startAngle" in func){
if(t < func.startAngle || t > func.endAngle){
continue;
}
}
var x = func.getX(t);
var y = func.getY(t);
// Afficher les coordonnées et le point sous la souris
if(!isNaN(x) && !isNaN(y)){
if(ajouterDansListe){
this.ajouterPoint(x, y, func.couleur);
}
this.dessinerPoint(x, y, func.couleur);
}
}
},
dessinerPoint : function(x, y, couleur){
var ctx = new Object();
ctx = this.ctx;
// Conversion des coordonnées
var posX = coordToPosX(x) + 1;
var posY = coordToPosY(y) + 1;
ctx.shadowColor = couleur;
ctx.shadowBlur = 4;
// Texte
var txtPos = "("+Math.round(x*100)/100+";"+Math.round(y*100)/100+")";
ctx.fillStyle = "rgba(255,255,255,0.5)";
try{
ctx.bulle(posX+7, posY-7, txtPos.length*5.5, 20);
}
catch(err){
ctx.fillRect(posX+7, posY-27, txtPos.length*5.5, 20);
}
ctx.fillStyle = "black";
ctx.shadowColor = "black";
ctx.shadowOffsetX = 1;
ctx.shadowOffsetY = 1;
ctx.shadowBlur = 2;
ctx.fillText(txtPos, posX+8+txtPos.length/4, posY-13);
// Rond
ctx.beginPath();
ctx.arc(posX, posY, 4, 0, 2*Math.PI, true);
ctx.shadowColor = couleur;
ctx.shadowOffsetX = 0;
ctx.shadowOffsetY = 0;
ctx.shadowBlur = 4;
ctx.fillStyle = "rgba(0,0,0,1)";
ctx.strokeStyle = "rgba(255,255,255,0.8)";
ctx.lineWidth = 1;
ctx.fill()
ctx.stroke();
},
tangente : function(sourisX, sourisY, ajouterDansListe){
var delta = 0.001;
var ctx = new Object();
ctx = this.ctx;
// Dessiner les points et tangentes supplémentaires
this.dessinerListe();
// Dessiner les tangentes des fonctions
for(var i=0; i<fct.list.length; i++){
var func = fct.list[i];
// Vérifier la fonction sur laquelle doit s'appliquer l'outil
if(!func || func == ""){
continue;
}
// Position de la souris par rapport au coin supérieur gauche de l'affichage
var posX = sourisX - affichage.offsetLeft - 2;
// Valeur de la coordonnée x sous la souris
var t = posX / affichage.multX + affichage.xGauche;
if("startAngle" in func){
if(t < func.startAngle || t > func.endAngle){
continue;
}
}
var t1 = t + delta;
var x = func.getX(t);
var x1 = func.getX(t1);
// Calcul de deux valeurs y et de la pente
var y = func.getY(t);
var y1 = func.getY(t1);
var pente;
if(x1 != x){
pente = (y1-y)/(x1-x);
}
else{
pente = Number.POSITIVE_INFINITY;
}
// Dessiner la pente;
if(!isNaN(x) && !isNaN(y) && !isNaN(y1)){
if(ajouterDansListe){
this.ajouterTangente(x, y, pente, func.couleur);
}
this.dessinerTangente(x, y, pente, func.couleur);
}
}
},
dessinerTangente : function(x, y, pente, couleur){
var ctx = new Object();
ctx = this.ctx;
// Conversion des coordonnées
var posX = coordToPosX(x) + 1;
var posY = coordToPosY(y) + 1;
// Carré
ctx.shadowColor = couleur;
ctx.shadowBlur = 4;
ctx.fillStyle = "white";
ctx.fillRect(posX-3, posY-3, 6, 6);
// Pente
ctx.strokeStyle = "white";
ctx.lineWidth = 2;
ctx.beginPath();
var pente2 = pente * (affichage.hauteur/affichage.largeur) * (affichage.xDroite-affichage.xGauche)/(affichage.yHaut-affichage.yBas);
ctx.moveTo(0, posY+posX*pente2);
ctx.lineTo(affichage.largeur, posY+posX*pente2-affichage.largeur*pente2);
ctx.stroke();
// Texte
var txtPente;
if(isFinite(pente)){
txtPente = pente.toFixed(2);
}
else{
txtPente = "∞"
}
ctx.fillStyle = "rgba(255,255,255,0.5)";
try{
ctx.bulle(posX+7, posY-7, txtPente.length*5.5+1, 20);
}
catch(err){
ctx.fillRect(posX+7, posY-27, txtPente.length*5.5, 20);
}
ctx.fillStyle = "black";
ctx.shadowColor = "black";
ctx.shadowOffsetX = 1;
ctx.shadowOffsetY = 1;
ctx.shadowBlur = 2;
ctx.fillText(txtPente, posX+8+txtPente.length/4, posY-13);
},
ajouterPoint : function(x, y, couleur){
var newPoint = {
x : x,
y : y,
couleur : couleur,
dessiner : function(){
outil.dessinerPoint(this.x, this.y, this.couleur);
}
};
this.liste.push(newPoint);
},
ajouterTangente : function(x, y, pente, couleur){
var newTangente = {
x : x,
y : y,
pente : pente,
couleur : couleur,
dessiner : function(){
outil.dessinerTangente(this.x, this.y, this.pente, this.couleur);
}
};
this.liste.push(newTangente);
},
dessinerListe : function(){
if(!this.ctx){
return;
}
this.ctx.clearRect(0,0,affichage.largeur*2,affichage.hauteur*2);
for(var i=0; i<this.liste.length; i++){
this.liste[i].dessiner();
}
this.actualiserListe();
},
actualiserListe : function(){
var element = document.getElementById("divSuppOutil");
element.innerHTML = "";
for(var i=0; i<this.liste.length; i++){
var posX = Math.floor(coordToPosX(this.liste[i].x, true)+9);
var posY = Math.floor(coordToPosY(this.liste[i].y, true)-28);
if(posX > affichage.largeur+affichage.offsetLeft || posX < affichage.offsetLeft || posY > affichage.hauteur+affichage.offsetTop || posX < affichage.offsetTop){
continue;
}
var txt = '<div style="left:'
txt += posX +'px;';
txt += 'top:'
txt += posY +'px;" ';
txt += 'onclick="'
txt += 'outil.supprimer('+i+')';
txt += '">x</div>';
// alert(txt);
element.innerHTML += txt;
}
},
supprimer : function(id){
outil.liste.splice(id, 1);
outil.dessinerListe();
// alert(id)
}
};
// Evènements du clavier
function keyPress(event){
switch(event.keyCode){
case 27:
// widget.resetState()
break
case 37:
if(event.ctrlKey){
affichage.deplacerX(-1)
}
break
case 38:
if(event.ctrlKey){
affichage.deplacerY(1)
}
break
case 39:
if(event.ctrlKey){
affichage.deplacerX(1)
}
break
case 40:
if(event.ctrlKey){
affichage.deplacerY(-1)
}
break
default:
//alert(event.keyCode+" ; "+event.ctrlKey)
}
}
// ---- Aire sous la fonction (intégrale) ----
function AireSousFct(fct, a, b, n){
var aire, largeurRect, gaucheRect, droiteRect, millieuRect, hauteurRect, aireRect;
var f = new Function("x", "return "+fct);
aire = 0;
largeurRect = (b-a)/n;
for(var i=0; i<n; i++){
gaucheRect = a + i*largeurRect;
droiteRect = a + (i+1)*largeurRect;
millieuRect = (gaucheRect+droiteRect) / 2;
hauteurRect = f(millieuRect);
aireRect = largeurRect * hauteurRect;
aire = aire + aireRect;
}
//alert("a="+a+";b="+b+";n="+n+";A="+aire)
return aire;
}
function calculerAire(){
var fonction = fct.remplacer(fct.verifier(fct.list[editeur.idFct].fct));
var a = parseInt(document.getElementById("aireG").value);
var b = parseInt(document.getElementById("aireD").value);
var n = 50;
var arrondi = Math.round(AireSousFct(fonction, a, b, n)*1000)/1000;
document.getElementById("outputAire").innerHTML = "A = " + arrondi;
actualiserGraph();
}
// ---- Sauvegarde du graphique ----
var backgroundSauvegarde = "rgba(0,0,0,0.5)";
function saveGraph(){
var userWidth = parseInt(document.getElementById("saveWidth").value);
var userHeight = parseInt(document.getElementById("saveHeight").value);
if(userWidth <= 0 || userHeight <= 0){
userWidth = affichage.width;
userHeight = affichage.height;
}
if(fonction3D){
var background = display3D.background;
display3D.background = backgroundSauvegarde;
display3D.init(userWidth, userHeight);
display3D.draw();
var dataURL;
if(document.getElementById("selectSaveType").value == "jpg"){
dataURL = display3D.canvas.toDataURL("image/jpeg");
}
else{
dataURL = display3D.canvas.toDataURL();
}
document.getElementById("saveImageContent").innerHTML = '<img src="' + dataURL + '"/>';
afficherMenu('menuSaveImage');
display3D.background = background;
setTimeout(function(){
display3D.init();
display3D.draw();
}, 1);
}
else{
if(affichage.methode == "canvas"){
var l = affichage.largeur;
var h = affichage.hauteur;
var c = affichage.couleurFond;
affichage.largeur = parseInt(document.getElementById("saveWidth").value);
affichage.hauteur = parseInt(document.getElementById("saveHeight").value);
affichage.couleurFond = backgroundSauvegarde;
var newDiv = document.createElement("div");
affichage.init(newDiv, userWidth, userHeight);
outil.init();
outil.dessinerListe();
affichage.ctx.drawImage(outil.canvas,0,0);
var dataURL;
if(document.getElementById("selectSaveType").value == "jpg"){
dataURL = affichage.canvas.toDataURL("image/jpeg");
}
else{
dataURL = affichage.canvas.toDataURL();
}
document.getElementById("saveImageContent").innerHTML = '<img src="' + dataURL + '"/>';
afficherMenu('menuSaveImage');
affichage.largeur = l;
affichage.hauteur = h;
affichage.couleurFond = c;
affichage.init();
outil.init();
}
else if(affichage.methode == "svg"){
window.open("JavaScript/AffichageSVG.svg");
}
}
}
// Fonctions permettant de sauvegarder les options
var optionsLoaded = false;
function setCookie(nom,valeur){
var jours = 545; // Durée de validité des cookies
var date = new Date();
date.setDate(date.getDate()+jours);
document.cookie = nom + "=" + escape(valeur) + "; expires="+date.toGMTString();
}
function getCookie(nom){
var start = 0;
var end = 0;
if(document.cookie.length>0){
start = document.cookie.indexOf(nom + "=");
if(start!=-1){
start = start + nom.length+1;
end = document.cookie.indexOf(";",start);
if(end==-1){
end = document.cookie.length;
}
return unescape(document.cookie.substring(start,end));
}
}
return "";
}
function delCookie(nom){
var date = new Date();
date.setDate(date.getDate()-1);
document.cookie = nom + "=; expires="+date.toGMTString();
}
function saveOptions(){
if(!optionsLoaded){
return;
}
var state = JSON.stringify(widget.getState());
if(window.sankore){
sankore.setPreference("state", state);
}
else if(navigator.cookieEnabled){
setCookie("state", state);
}
}
function loadOptions(){
var state;
if(window.sankore){
state = sankore.preference("state", null);
}
else if(navigator.cookieEnabled){
state = getCookie("state");
}
if(!state){
optionsLoaded = true;
return;
}
var stateObject = JSON.parse(state);
var goodState = widget.getState();
if(!checkState(stateObject, goodState)){
loadOptionsFailed();
}
try{
widget.setState(stateObject);
optionsLoaded = true;
}
catch(e){
loadOptionsFailed();
}
}
function loadOptionsFailed(){
var text = "Unable to load the saved parameters...";
try{
text = languages.getText("unableLoadParameters");
}
catch(e){}
alert(text);
delOptions();
}
function checkState(state, goodState){
for(var i in goodState){
if(! i in state){
return false;
}
}
return true;
}
function delOptions(){
if(window.sankore){
sankore.setPreference("state", "");
}
else if(navigator.cookieEnabled){
delCookie("state");
}
}
function alertOptions(){
// alert("Options actuellement sauvegardées\n------------------------------------------------------------\n"+document.cookie);
document.getElementById("divAlertCookies").innerHTML = document.cookie;
afficherMenu("menuAlertCookies");
}
body{
background-color: rgba(255,255,255,0.6);
}
h1{
font-size: 250%;
text-align: center;
text-decoration: underline;
}
h2{
margin-top: 40px;
}
h4{
margin-top: 20px;
margin-bottom: 0px;
}
img{
display: block;
margin-left: auto;
margin-right: auto;
}
p{
text-align: justify;
}
li{
text-align: justify;
}
.droite{
float: right;
font-size: 80%;
font-style: italic;
margin: 5px;
}
.gauche{
float: left;
font-size: 80%;
font-style: italic;
}
#Sommaire{
margin-top: 100px;
margin-bottom: 100px;
}
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<widget xmlns="http://www.w3.org/ns/widgets"
identifier="http://getuniboard.com/"
version="1.6.0"
width="800"
height="600"
ub:resizable="true">
<name>Mathematical function plotter</name>
<content src="Grapheur.html"/>
</widget>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta charset="utf-8" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title>GraphMe - Version</title>
</head>
<body>
<span style="font-size:12px; text-align:center;">2.1.0 (2018-06-04)</span>
</body>
</html>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:svg="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<meta name="description" content="Traceur de fonctions mathématiques en JavaScript"/>
<meta name="author" content="Yannick Vessaz"/>
<meta name="revised" content="2010/09/25"/>
<title>Graphics</title>
<link rel="stylesheet" type="text/css" href="Style/default.css"/>
<script type="text/javascript" src="JavaScript/ColorPicker.js"></script>
<script type="text/javascript" src="JavaScript/Interface.js"></script>
<script type="text/javascript" src="JavaScript/Outils.js"></script>
<script type="text/javascript" src="JavaScript/AffichageStandard.js"></script>
<script type="text/javascript" src="JavaScript/Affichage3D.js"></script>
<script type="text/javascript" src="JavaScript/AffichageUniboard.js"></script>
<script type="text/javascript" src="JavaScript/AffichageXPM.js"></script>
<script type="text/javascript" src="JavaScript/languages.js"></script>
<script type="text/javascript" src="JavaScript/Etude.js"></script>
<script type="text/javascript" src="JavaScript/Sauvegardes.js"></script>
<script src="JavaScript/jquery-1.3.2.min.js" type="text/javascript"></script>
<script src="JavaScript/jquery.disable.text.select.js" type="text/javascript"></script>
<script type="text/javascript">
// <![CDATA[
// --- Variables nécessaires au fonctionnement du widget ---
var lang = ""; //locale language
var loadingFlag = false
var largeur = 500
var hauteur = 400
var graphique = ""
var image = ""
var tableau = new Array()
var ligne = new Array()
var j = 0
var interdit = new Array(";", "interdit", "'", '"', "eval", "new", "sankore", "=", "document", "window", "alert")
var menuActuel = ""
var mouseDown = false
var outil = "point"
var pointX = new Array()
var pointY = new Array()
var pente = new Array()
var pente2 = new Array()
var precision = 0.02
var couleurFonction = "rgb(193,255,0)"
var r = 255
var g = 0
var b = 0
var couleurEchelle = "rgba(255,255,255,0.8)"
var couleurGrille = "rgba(255,255,255,0.1)"
var couleurAxes = "rgba(0,0,0,0.5)"
var decalageX = 0
var decalageY = 0
var lineWidth = 3
if(window.sankore){
try{
lang = sankore.locale().substr(0,2);
sankoreLang[lang].display;
} catch(e){
lang = "en";
}
} else
lang = "en";
$(document).ready(function(){
if(window.sankore){
$("#inputEq").val(sankore.preference("functionData", ""));
$("#inputTeinte").val(sankore.preference("functionColor",""));
$("#inputValeur").val(sankore.preference("functionValue","0"));
$("#inputSaturation").val(sankore.preference("functionSaturation","0"));
$("#inputRouge").val(sankore.preference("functionRed","255"));
$("#inputVert").val(sankore.preference("functionGreen","0"));
$("#inputBleu").val(sankore.preference("functionBlue","0"));
$("#inputOpacity").val(sankore.preference("functionOpacity","1"));
idColor = sankore.preference("functionColorId","");
actualiserGraph();
if(sankore.preference("simplefx","0") == 1)
$("#checkDerivee").attr("checked", "checked");
else
$("#checkDerivee").removeAttr('checked');
if(sankore.preference("hardfx","0") == 1)
$("#checkDerivee2").attr("checked", "checked");
else
$("#checkDerivee2").removeAttr('checked');
actualiserGraph();
$("#aireG").val(sankore.preference("squareUnderFrom","-5"));
$("#aireD").val(sankore.preference("squareUnderTo","5"));
calculerAire();
$("#inputX").val(sankore.preference("calculateThePoint","0"));
execute($("#inputEq").val());
if(sankore.preference("checkboxDraw","0") == 1)
$("#checkAire").attr("checked", "checked");
else
$("#checkAire").removeAttr('checked');
actualiserGraph();
$("#selectTheme").val(sankore.preference("selectedTheme","noir"));
changerTheme($("#selectTheme").val());
$("#selectMethodeAffichage").val(sankore.preference("graphicalMethodDisplaying", "canvas"));
$("#zoomDefaut").val(sankore.preference("defaultZoom", "4"));
reinitialiserZoom($("#zoomDefaut").val());
if(sankore.preference("showGrid","1") == 1)
$("#checkGrille").attr("checked", "checked");
else
$("#checkGrille").removeAttr('checked');
if(sankore.preference("showAxis","1") == 1)
$("#checkAxes").attr("checked", "checked");
else
$("#checkAxes").removeAttr('checked');
if(sankore.preference("showScale","1") == 1)
$("#checkEchelle").attr("checked", "checked");
else
$("#checkEchelle").removeAttr('checked');
actualiserGraph();
$("#inputTaille").val(sankore.preference("thickness", "3"));
actualiserGraph();
$("#inputDecalageX").val(sankore.preference("offsetDiagrammX", "0"));
decalageX = parseFloat($("#inputDecalageX").val())
$("#inputDecalageY").val(sankore.preference("offsetDiagrammY", "0"));
decalageY = parseFloat($("#inputDecalageY").val())
$("#inputPrecision").val(sankore.preference("accuracyGraph", "0.02"));
precision = parseFloat($("#inputPrecision").val());
$("#selectAffichage3D").val(sankore.preference("styleOf3DShow", "surfaces"));
reinitialiserZoom(5);
$("#inputPrecision3D").val(sankore.preference("accuracyFunction", "0.2"));
precisionFonction3D = parseFloat($("#inputPrecision3D").val());
$("#selectRouge3D").val(sankore.preference("redColor", "plus"));
$("#selectVert3D").val(sankore.preference("greenColor", "moins"));
$("#selectBleu3D").val(sankore.preference("blueColor", "tout"));
checkCouleurs3D();
$("#couleur3Dgenerale").val(sankore.preference("3DGeneralColor", "0"));
checkCouleurs3D();
actualiserGraph();
$("#borneXGauche").val(sankore.preference("xAxisFrom", "-5"));
$("#borneXDroite").val(sankore.preference("xAxisTo", "5"));
$("#borneYGauche").val(sankore.preference("yAxisFrom", "-5"));
$("#borneYDroite").val(sankore.preference("yAxisTo", "5"));
var tempArray;
if(sankore.preference("graphmeHistory",""))
tempArray = sankore.preference("graphmeHistory","").split(",");
if(sankore.preference("graphmeHistory","")){
for(i in tempArray)
evaluer(tempArray[i]);
}
actualiserGraph();
loadingFlag = true;
////////////////////////////////////// languages suppot
document.getElementById("texteFonction").innerHTML = sankoreLang[lang].fnc;
$("#xAxis").html(sankoreLang[lang].x_axis);
$("#yAxis").html(sankoreLang[lang].y_axis);
$("#scaleZoom").html(sankoreLang[lang].zoom);
$("#graphColor").html(sankoreLang[lang].color);
$("#menuCouleur .contenuMenu em").text(sankoreLang[lang].choosing_color);
$("#colorValues tr").eq(0).find("td").eq(0).html(sankoreLang[lang].color + ":");
$("#colorValues tr").eq(1).find("td").eq(0).html(sankoreLang[lang].value);
$("#colorValues tr").eq(2).find("td").eq(0).html(sankoreLang[lang].saturation);
$("#colorValues tr").eq(3).find("td").eq(0).html(sankoreLang[lang].red);
$("#colorValues tr").eq(4).find("td").eq(0).html(sankoreLang[lang].green);
$("#colorValues tr").eq(5).find("td").eq(0).html(sankoreLang[lang].blue);
$("#colorValues tr").eq(6).find("td").eq(0).html(sankoreLang[lang].opacity);
$("#menuOutils .contenuMenu h3").eq(0).text(sankoreLang[lang].tools);
$("#menuOutils .contenuMenu span").each(function(){
switch($(this).html()){
case "Mouse events:":
$(this).html(sankoreLang[lang].mouse_events);
break;
case "Derivative:":
$(this).html(sankoreLang[lang].derivative);
break;
case "Square under function:":
$(this).html(sankoreLang[lang].square_under_func);
break;
case "Calculate the point on the function:":
$(this).html(sankoreLang[lang].point_calculate);
break;
case "Analysis of function:":
$(this).html(sankoreLang[lang].analysis_of_func);
break;
case "Display test:":
$(this).html(sankoreLang[lang].display_test);
break;
case "From":
$(this).html(sankoreLang[lang].from);
break;
case "to":
$(this).html(sankoreLang[lang].to);
break;
default:
break;
}
return true;
});
$("label[for*='checkAire']").text(sankoreLang[lang].draw);
$("#menuOptions td").eq(0).html(sankoreLang[lang].widget);
$("#menuOptions h3").eq(0).text(sankoreLang[lang].widget_options);
$("#menuOptions2D h3").eq(0).text(sankoreLang[lang].options + " 2D");
$("#menuOptions2D span").each(function(){
switch($(this).html()){
case "The graphical method displaying:":
$(this).html(sankoreLang[lang].the_graphical);
break;
case "Zoom default:":
$(this).html(sankoreLang[lang].zoom_def);
break;
case "Thickness:":
$(this).html(sankoreLang[lang].thickness);
break;
case "Offset diagram:":
$(this).html(sankoreLang[lang].offset_diagram);
break;
case "Accuracy graph:":
$(this).html(sankoreLang[lang].accuracy_graph);
break;
}
return true;
});
$("#selectMethodeAffichage option").eq(0).text("canvas (" + sankoreLang[lang].lines + ")")
.next().text("canvas (" + sankoreLang[lang].points + ")")
.next().next().text("svg (1 " + sankoreLang[lang].image + ")");
$("label[for*='checkGrille']").text(sankoreLang[lang].show_grid);
$("label[for*='checkAxes']").text(sankoreLang[lang].show_axis);
$("label[for*='checkEchelle']").text(sankoreLang[lang].scale);
$("#menuOptions3D h3").eq(0).text(sankoreLang[lang].options + " 3D");
$("#menuOptions3D span").each(function(){
switch($(this).html()){
case "Show the style:":
$(this).html(sankoreLang[lang].show_the_style);
break;
case "Accuracy function:":
$(this).html(sankoreLang[lang].accuracy_func);
break;
case "Use the color":
$(this).html(sankoreLang[lang].use_the_color);
break;
case "red:":
$(this).html(sankoreLang[lang].red);
break;
case "green:":
$(this).html(sankoreLang[lang].green);
break;
case "blue:":
$(this).html(sankoreLang[lang].blue);
break;
case "General value:":
$(this).html(sankoreLang[lang].general_value);
break;
case "from":
$(this).html(sankoreLang[lang].from);
break;
case "to":
$(this).html(sankoreLang[lang].to);
break;
}
return true;
});
$("#selectAffichage3D option").eq(0).text(sankoreLang[lang].surfaces)
.next().text(sankoreLang[lang].points);
$("#selectRouge3D option").eq(0).text(sankoreLang[lang].positive_value)
.next().text(sankoreLang[lang].negative_value)
.next().text(sankoreLang[lang].general_value);
$("#selectVert3D option").eq(0).text(sankoreLang[lang].negative_value)
.next().text(sankoreLang[lang].positive_value)
.next().text(sankoreLang[lang].general_value);
$("#selectBleu3D option").eq(0).text(sankoreLang[lang].general_value)
.next().text(sankoreLang[lang].positive_value)
.next().text(sankoreLang[lang].negative_value);
$("#menuAide .ongletMenu td, #menuAideExemples .ongletMenu td, #menuAideAutres .ongletMenu td").each(function(){
switch($(this).html()){
case "Using":
$(this).html(sankoreLang[lang].using);
break;
case "Examples":
$(this).html(sankoreLang[lang].examples);
break;
case "Other":
$(this).html(sankoreLang[lang].other);
break;
}
});
$("#menuAide h1").each(function(){
switch($(this).html()){
case "How it work.":
$(this).html(sankoreLang[lang].how_it_work);
break;
case "Constants":
$(this).html(sankoreLang[lang].consts);
break;
case "Keyboard keys":
$(this).html(sankoreLang[lang].keys);
break;
}
return true;
});
$("#menuAide h2").each(function(){
switch($(this).html()){
case "Basic operations":
$(this).html(sankoreLang[lang].basic_operations);
break;
case "Trigonometric functions":
$(this).html(sankoreLang[lang].trigonometric);
break;
case "Hyperbolic functions":
$(this).html(sankoreLang[lang].hyperbolic_func);
break;
case "Square roots and degrees":
$(this).html(sankoreLang[lang].square_roots_and_degrees);
break;
case "Exponential and logarithm":
$(this).html(sankoreLang[lang].exponential);
break;
case "Absolute number value":
$(this).html(sankoreLang[lang].abs);
break;
case "Rounding":
$(this).html(sankoreLang[lang].rounding);
break;
}
return true;
});
$("#menuAide span").each(function(){
switch($(this).html()){
case "This widget allow to draw mathematical function. Enter function in the field in the top part of widget and press \"Show\".":
$(this).html(sankoreLang[lang].this_widget_allow);
break;
case "You can enter following mathematical function:":
$(this).html(sankoreLang[lang].you_can_enter);
break;
case "Plus":
$(this).html(sankoreLang[lang].plus);
break;
case "Minus":
$(this).html(sankoreLang[lang].minus);
break;
case "Multiplication":
$(this).html(sankoreLang[lang].multi);
break;
case "Division":
$(this).html(sankoreLang[lang].division);
break;
case "Mod":
$(this).html(sankoreLang[lang].mod);
break;
case "Sine":
$(this).html(sankoreLang[lang].sine);
break;
case "Cosine":
$(this).html(sankoreLang[lang].cosine);
break;
case "Tangent":
$(this).html(sankoreLang[lang].tangent);
break;
case "Cotangent":
$(this).html(sankoreLang[lang].cotangent);
break;
case "Secant":
$(this).html(sankoreLang[lang].secant);
break;
case "Cosecant":
$(this).html(sankoreLang[lang].cosecant);
break;
case "Arc sine":
$(this).html(sankoreLang[lang].arc_sine);
break;
case "Arc cosine":
$(this).html(sankoreLang[lang].arc_cosine);
break;
case "Arc tangent":
$(this).html(sankoreLang[lang].arc_tangent);
break;
case "Arc cotangent":
$(this).html(sankoreLang[lang].arc_cotangent);
break;
case "Hyperbolic sine":
$(this).html(sankoreLang[lang].hyp_sine);
break;
case "Hyperbolic cosine":
$(this).html(sankoreLang[lang].hyp_cosine);
break;
case "Hyperbolic tangent":
$(this).html(sankoreLang[lang].hyp_tangent);
break;
case "Hyperbolic cotangent":
$(this).html(sankoreLang[lang].hyp_cotangent);
break;
case "Hyperbolic secant":
$(this).html(sankoreLang[lang].hyp_secant);
break;
case "Hyperbolic cosecant":
$(this).html(sankoreLang[lang].hyp_cosecant);
break;
case "Hyperbolic arc sine":
$(this).html(sankoreLang[lang].hyp_arc_sine);
break;
case "Hyperbolic arc cosine":
$(this).html(sankoreLang[lang].hyp_arc_cosine);
break;
case "Hyperbolic arc tangent":
$(this).html(sankoreLang[lang].hyp_arc_tangent);
break;
case "Hyperbolic arc cotangent":
$(this).html(sankoreLang[lang].hyp_arc_cotangent);
break;
case "Square root":
$(this).html(sankoreLang[lang].square_root);
break;
case "Degree":
$(this).html(sankoreLang[lang].degree);
break;
case "Root":
$(this).html(sankoreLang[lang].root);
break;
case "Variable x to the power y":
$(this).html(sankoreLang[lang].variable_x);
break;
case "Root y of x":
$(this).html(sankoreLang[lang].root_y);
break;
case "Natural logarithm":
$(this).html(sankoreLang[lang].natural_log);
break;
case "Decimal logarithm":
$(this).html(sankoreLang[lang].decimal_log);
break;
case "rounding to the nearest whole number":
$(this).html(sankoreLang[lang].round_nearest);
break;
case "rounding to the nearest whole number in a big way":
$(this).html(sankoreLang[lang].round_nearest_big);
break;
case "rounding to the nearest whole number the smaller side":
$(this).html(sankoreLang[lang].round_nearest_small);
break;
case "Also are available some constants:":
$(this).html(sankoreLang[lang].available_const);
break;
case "reset widget":
$(this).html(sankoreLang[lang].reload_widget);
break;
case "left arrow":
$(this).html(sankoreLang[lang].left_arrow);
break;
case "top arrow":
$(this).html(sankoreLang[lang].top_arrow);
break;
case "right arrow":
$(this).html(sankoreLang[lang].right_arrow);
break;
case "bottom arrow":
$(this).html(sankoreLang[lang].bottom_arrow);
break;
case "graph will be moved left":
$(this).html(sankoreLang[lang].moved_left);
break;
case "graph will be moved top":
$(this).html(sankoreLang[lang].moved_top);
break;
case "graph will be moved right":
$(this).html(sankoreLang[lang].moved_right);
break;
case "graph will be moved bottom":
$(this).html(sankoreLang[lang].moved_bottom);
break;
case "or":
$(this).html(sankoreLang[lang].or);
break;
}
return true;
});
$("#menuAideExemples h1").each(function(){
if($(this).text() == "Functions 2D")
$(this).text(sankoreLang[lang].funcs + " 2D");
else
$(this).text(sankoreLang[lang].funcs + " 3D");
});
$("#menuAideExemples span").eq(0).html("(" + sankoreLang[lang].you_can_view + ")");
$("#menuAideAutres h4").eq(0).text(sankoreLang[lang].save_graph);
$("#menuAideAutres h4").eq(1).text(sankoreLang[lang].offset);
$("#menuAideAutres span").eq(0).text(sankoreLang[lang].in_some_browsers);
$("#menuAideAutres span").eq(1).text(sankoreLang[lang].if_graph_isnt);
$("#credits h3").eq(0).text(sankoreLang[lang].widget_is_developed);
$("#menuCredits .texteSecondaire span").eq(0).html(sankoreLang[lang].if_you_want_to);
$("#menuCredits .texteSecondaire span").eq(1).html(sankoreLang[lang].if_you_want_to_change);
$("#menuFonctions td").eq(0).text(sankoreLang[lang].funcs);
$("#menuFonctions td").eq(1).text(sankoreLang[lang].history);
$("#menuFonctions em").eq(0).text(sankoreLang[lang].current);
$("#menuFonctions em").eq(1).text(sankoreLang[lang].additional);
$("#menuHistorique td").eq(0).text(sankoreLang[lang].funcs);
$("#menuHistorique td").eq(1).text(sankoreLang[lang].history);
$("#menuEtude h3").text(sankoreLang[lang].analysis_of_func);
$("#menuEtude span").each(function(){
switch($(this).html()){
case "Set of definitions:":
$(this).html(sankoreLang[lang].set_of_def);
break;
case "Parity:":
$(this).html(sankoreLang[lang].parity);
break;
case "Zeros of functions:":
$(this).html(sankoreLang[lang].zeros);
break;
case "Signe:":
$(this).html(sankoreLang[lang].signe);
break;
case "Asymptotes":
$(this).html(sankoreLang[lang].asympt);
break;
case "AH left:":
$(this).html(sankoreLang[lang].ah_left);
break;
case "AH right:":
$(this).html(sankoreLang[lang].ah_right);
break;
case "AV:":
$(this).html(sankoreLang[lang].av);
break;
case "Tool for analysis of function is not reliable on 100%. Don't forget check results of analysis before use it.":
$(this).html(sankoreLang[lang].tool_for);
break;
}
return true;
});
$("#infoSauvegarde h1").text(sankoreLang[lang].options_saved);
$("#mAj h1").text(sankoreLang[lang].update);
$("#mAj span").each(function(){
switch($(this).html()){
case "Current version:":
$(this).html(sankoreLang[lang].cur_version);
break;
case "The last on-line version:":
$(this).html(sankoreLang[lang].last_version);
break;
case "This widget is available to using on web-site:":
$(this).html(sankoreLang[lang].using_web);
break;
}
});
$("#menuOptions span").each(function(){
switch($(this).html()){
case "Themes of widget:":
$(this).html(sankoreLang[lang].themes_of_widget);
break;
case "Control options:":
$(this).html(sankoreLang[lang].control_options);
break;
case "Save a widget options in cookies or load an options from cookies or delete a registered options.":
$(this).html(sankoreLang[lang].save_a_widget_options);
break;
}
return true;
});
$("#selectTheme option").eq(0).text(sankoreLang[lang].black).next().text(sankoreLang[lang].blue).next().text(sankoreLang[lang].white);
$("input:button").each(function(){
switch($(this).val()){
case "Check":
$(this).val(sankoreLang[lang].check);
break;
case "Cancel":
$(this).val(sankoreLang[lang].quit);
break;
case "Tools":
$(this).val(sankoreLang[lang].tools);
break;
case "Options":
$(this).val(sankoreLang[lang].options);
break;
case "Help":
$(this).val(sankoreLang[lang].help);
break;
case "About":
$(this).val(sankoreLang[lang].about);
break;
case "Moving":
$(this).val(sankoreLang[lang].moving);
break;
case "Tangente":
$(this).val(sankoreLang[lang].tangente);
break;
case "Point":
$(this).val(sankoreLang[lang].point);
break;
case "Calculate":
$(this).val(sankoreLang[lang].calculate);
break;
case "Estimate":
$(this).val(sankoreLang[lang].estimate);
break;
case "Start to analysis":
$(this).val(sankoreLang[lang].start_to_analysis);
break;
case "Test XPM":
$(this).val(sankoreLang[lang].test + " XPM");
break;
case "Test SVG":
$(this).val(sankoreLang[lang].test + " SVG");
break;
case "Test Canvas":
$(this).val(sankoreLang[lang].test + " Canvas");
break;
case "Save":
$(this).val(sankoreLang[lang].save);
break;
case "Load":
$(this).val(sankoreLang[lang].load);
break;
case "Delete":
$(this).val(sankoreLang[lang].del);
break;
case "Display":
$(this).val(sankoreLang[lang].display);
break;
case "Reload widget":
$(this).val(sankoreLang[lang].reload_widget);
break;
case "Updated":
$(this).val(sankoreLang[lang].update);
break;
case "Update zoom":
$(this).val(sankoreLang[lang].update_zoom);
break;
case "Reset display":
$(this).val(sankoreLang[lang].reset_display);
break;
case "User's guide":
$(this).val(sankoreLang[lang].guide);
break;
default:
break;
}
return true;
});
}
$(document).disableTextSelect();
$("input, select").mouseover(function(){
$(document).enableTextSelect();
});
$("input, select").mouseout(function(){
$(document).disableTextSelect();
});
$("body").mouseout(function(){
if(window.sankore && loadingFlag){
sankore.setPreference("functionData",$("#inputEq").val());
sankore.setPreference("xAxisFrom",$("#borneXGauche").val());
sankore.setPreference("xAxisTo",$("#borneXDroite").val());
sankore.setPreference("yAxisFrom",$("#borneYGauche").val());
sankore.setPreference("yAxisTo",$("#borneYDroite").val());
sankore.setPreference("functionColor",$("#inputTeinte").val());
sankore.setPreference("functionValue",$("#inputValeur").val());
sankore.setPreference("functionSaturation",$("#inputSaturation").val());
sankore.setPreference("functionRed",$("#inputRouge").val());
sankore.setPreference("functionGreen",$("#inputVert").val());
sankore.setPreference("functionBlue",$("#inputBleu").val());
sankore.setPreference("functionOpacity",$("#inputOpacity").val());
sankore.setPreference("functionColorId", idColor);
if ($('#checkDerivee').is(":checked"))
sankore.setPreference("simplefx","1");
else
sankore.setPreference("simplefx","0");
if ($('#checkDerivee2').is(":checked"))
sankore.setPreference("hardfx","1");
else
sankore.setPreference("hardfx","0");
sankore.setPreference("squareUnderFrom", $("#aireG").val());
sankore.setPreference("squareUnderTo", $("#aireD").val());
sankore.setPreference("calculateThePoint", $("#inputX").val());
if ($('#checkAire').is(":checked"))
sankore.setPreference("checkboxDraw","1");
else
sankore.setPreference("checkboxDraw","0");
sankore.setPreference("selectedTheme", $("#selectTheme").val());
sankore.setPreference("graphicalMethodDisplaying", $("#selectMethodeAffichage").val());
sankore.setPreference("defaultZoom", $("#zoomDefaut").val());
if ($('#checkGrille').is(":checked"))
sankore.setPreference("showGrid","1");
else
sankore.setPreference("showGrid","0");
if ($('#checkAxes').is(":checked"))
sankore.setPreference("showAxis","1");
else
sankore.setPreference("showAxis","0");
if ($('#checkEchelle').is(":checked"))
sankore.setPreference("showScale","1");
else
sankore.setPreference("showScale","0");
sankore.setPreference("styleOf3DShow", $("#selectAffichage3D").val());
sankore.setPreference("accuracyFunction", $("#inputPrecision3D").val());
sankore.setPreference("redColor", $("#selectRouge3D").val());
sankore.setPreference("greenColor", $("#selectVert3D").val());
sankore.setPreference("blueColor", $("#selectBleu3D").val());
sankore.setPreference("3DGeneralColor", $("#couleur3Dgenerale").val());
sankore.setPreference("thickness", $("#inputTaille").val());
sankore.setPreference("offsetDiagrammX", $("#inputDecalageX").val());
sankore.setPreference("offsetDiagrammY", $("#inputDecalageY").val());
sankore.setPreference("accuracyGraph", $("#inputPrecision").val());
if(historique.length)
sankore.setPreference("graphmeHistory", historique.toString());
}
});
});
//alert(navigator.appName+" ; "+navigator.appVersion+" ; "+navigator.userAgent)
// ------------- Fonctions du widgets -------------
// Lance la procédure pour dessiner la fonction qui se trouve dans l'input en haut du widget.
// Permet aussi d'actualiser le graphique.
function actualiserGraph(){
evaluer(document.getElementById("inputEq").value)
}
// Cette fonction détermine si la fonction entrée est valide ou non.
// Elle retourne "true" si la fonction ne comporte pas de caractères interdits et "false" dans le cas contraire.
function check(eq){
for(var i=0; i<interdit.length; i++){
var condition = ""
for(var k=0; k<interdit[i].length; k++){
if(k==0){
condition = condition + "eq.charAt(j) == interdit[i].charAt(0)"
}
else{
condition = condition + "&& eq.charAt(j+"+k+") == interdit[i].charAt("+k+")"
}
}
//alert(interdit[i]+" ; "+condition)
for(var j=0; j<eq.length; j++){
if(eval(condition)){
document.getElementById("spanFctInterdite").innerHTML = interdit[i]
afficherMenu("fctInterdite")
//alert("------- Erreur -------\nImpossible de dessiner la fonction ... \nExpression ou carractère invalide : "+interdit[i]+"")
return false
}
}
}
return true
}
// Cette fonction permet de choisir la méthode d'affichage entre:
// 1) Image au format XPM
// 2) Affichage directe dans sankore
// 3) Autres Méthodes d'affichages (svg ou canvas)
function evaluer(eq){
if(check(eq)){
try{
if(historique[0]!=eq && eq!="1000"){
for(var i=0;i<historique.length;i++){
if(historique[i]==eq){
historique.splice(i, 1)
}
}
historique.unshift(eq)
actualiserHistorique()
}
if(fonction3D){
dessiner3D(eq)
}
else if(document.getElementById("selectMethodeAffichage").value == "xpm"){
evaluerXPM(eq)
}
else if(document.getElementById("selectMethodeAffichage").value == "sankore"){
evaluerUniboard(eq)
}
else if(document.getElementById("selectMethodeAffichage").value == "canvas" || document.getElementById("selectMethodeAffichage").value == "canvas2"){
evaluerCanvas(eq)
}
else{
evaluerSVG(eq)
}
}
catch(err){
afficherMenu("erreurFct")
}
}
}
// ---- Fonctions Mathématiques et constantes ----
// (rempalce sin() par Math.sin(), cos() par Math.cos(), tan() par Math.tan(), etc.
var pi = 4 * atan(1)
var e = exp(1)
function sin(valeur){
return Math.sin(valeur)
}
function cos(valeur){
return Math.cos(valeur)
}
function tan(valeur){
return Math.tan(valeur)
}
function cot(valeur){
return 1/Math.tan(valeur)
}
function sec(valeur){
return 1/cos(valeur)
}
function csc(valeur){
return 1/sin(valeur)
}
function asin(valeur){
return Math.asin(valeur)
}
function acos(valeur){
return Math.acos(valeur)
}
function atan(valeur){
return Math.atan(valeur)
}
function acot(valeur){
return Math.atan(1/valeur)
}
function asec(valeur){
return Math.acos(1/valeur)
}
function acsc(valeur){
return Math.asin(1/valeur)
}
var arcsin = asin
var arccos = acos
var arctan = atan
var arccot = acot
var arcsec = asec
var arccsc = acsc
function sinh(valeur){
return (Math.exp(valeur)-Math.exp(-valeur))/2
}
function cosh(valeur){
return (Math.exp(valeur)+Math.exp(-valeur))/2
}
function tanh(valeur){
return (Math.exp(valeur)-Math.exp(-valeur))/(Math.exp(valeur)+Math.exp(-valeur))
}
function coth(valeur){
return (Math.exp(valeur)+Math.exp(-valeur))/(Math.exp(valeur)-Math.exp(-valeur))
}
function sech(valeur){
return 1/cosh(valeur)
}
function csch(valeur){
return 1/sinh(valeur)
}
function asinh(valeur){
return Math.log(valeur+Math.sqrt(Math.pow(valeur,2)+1))
}
function acosh(valeur){
return Math.log(valeur+Math.sqrt(Math.pow(valeur,2)-1))
}
function atanh(valeur){
return Math.log((1+valeur)/(1-valeur))/2
}
function acoth(valeur){
return Math.log((valeur+1)/(valeur-1))/2
}
var arcsinh = asinh
var arccosh = acosh
var arctanh = atanh
var arccoth = acoth
function sqrt(valeur){
return Math.sqrt(valeur)
}
function pow(valeur1, valeur2){
return Math.pow(valeur1, valeur2)
}
function root(valeur1, valeur2){
if(valeur2%2==1 && valeur1<0){
return -Math.pow(-valeur1, (1/valeur2))
}
else{
return Math.pow(valeur1, (1/valeur2))
}
}
function exp(valeur){
return Math.exp(valeur)
}
function log(valeur){
return Math.log(valeur)/Math.log(10)
}
function ln(valeur){
return Math.log(valeur)
}
function abs(valeur){
return Math.abs(valeur)
}
function sign(valeur){
if(valeur<0){
return -1
}
else if(valeur>0){
return 1
}
else{
return undefined
}
}
function round(valeur){
return Math.round(valeur)
}
function ceil(valeur){
return Math.ceil(valeur)
}
function floor(valeur){
return Math.floor(valeur)
}
function random(){
return Math.random()
}
// ]]>
</script>
</head>
<body onload="evaluer(1000);checkCouleurs3D();loadOptions();majAuto()" onkeypress="keyPress(event)">
<!-- ..... Haut du Widget ..... -->
<span id="haut">
<span id="texteFonction">Function: </span><input id="inputEq" onkeypress='if(event.keyCode==13) evaluer(this.value)' onkeyup="document.getElementById('fonctionActuelle').innerHTML = this.value"/>
<input type="button" onclick='evaluer(document.getElementById("inputEq").value)' value="Display"/><input type="button" style="width:21px;" onclick="menuFonctions()" value="+"/>
</span>
<!--<div id="miniMax" onclick="miniMax()">-</div> ▶▼ -->
<div id="boutonAgrandir" class="miniBouton" onclick="agrandirAffichage()">^</div>
<!--<div id="boutonFermer" class="miniBouton" onclick="close()"></div>-->
<br/>
<!-- ..... Millieu du Widget ..... -->
<!-- Zone d'affichage -->
<div id="affichage" onmousedown="sourisDown()" onmouseup="sourisUp()" onmousemove="sourisMove(event)" ondblclick="doubleClick(event.ctrlKey)"></div>
<!-- Zone de boutons gauche -->
<div id="gauche">
<span id="xAxis">X-axis:</span> <br/>
<input id="borneXGauche" class="smallInput" value="-5" onkeypress='if(event.keyCode==13) actualiserGraph()'/> ... <input id="borneXDroite" class="smallInput" value="5" onkeypress='if(event.keyCode==13) actualiserGraph()'/> <br/>
<span id="yAxis">Y-axis:</span> <br/>
<input id="borneYGauche" class="smallInput" value="-5" onkeypress='if(event.keyCode==13) actualiserGraph()'/> ... <input id="borneYDroite" class="smallInput" value="5" onkeypress='if(event.keyCode==13) actualiserGraph()'/>
<br/><span id="scaleZoom">Zoom:</span> <br/>
<input type="button" style="width:45%;" onclick='zoom(1.25)' value="-"/><input type="button" style="width:45%; position:relative; left: 9px;" onclick='zoom(0.8)' value="+"/><br/><br/>
<span id="graphColor">Color:</span> <br/>
<div id="buttonColor" title="couleurFonction" onclick="colorPicker(this.id); afficherMenu('menuCouleur')"></div>
<br/><br/>
<hr/>
<br/>
Menus:
<input type="button" class="boutonGauche" onclick='document.getElementById("etudeFct").innerHTML = document.getElementById("inputEq").value;afficherMenu("menuOutils")' value="Tools"/>
<input type="button" class="boutonGauche" onclick='afficherMenu("menuOptions")' value="Options"/>
<input type="button" class="boutonGauche" onclick='afficherMenu("menuAide")' value="Help"/>
<input type="button" class="boutonGauche" onclick='afficherMenu("menuCredits")' value="About"/>
<!-- ..... Menus ..... -->
<div id="menu" class="menu">
<div id="contenuMenu" class="contenuMenu"></div>
<div class="barreBasMenu">
<input type="button" onclick='cacherMenu()' value="Cancel"/>
</div>
</div>
</div>
<div id="gauche3D">
<input type="button" class="boutonGauche3D" onclick='afficherMenu("menuCredits")' value="About"/>
<input type="button" class="boutonGauche3D" onclick='afficherMenu("menuAide")' value="Help"/>
<input type="button" class="boutonGauche3D" onclick='afficherMenu("menuOptions")' value="Options"/>
<input type="button" style="width:30px;" onclick='zoom3D(0.8)' value="-"/><input type="button" style="width:30px;" onclick='zoom3D(1.25)' value="+"/>
</div>
<!-- Options -->
<div id="menuOptions" class="menu">
<table class="ongletMenu">
<tr>
<td class="ongletMenuActuel" onclick='afficherMenu("menuOptions")'>Widget</td>
<td onclick='afficherMenu("menuOptions2D")'>2D</td>
<td onclick='afficherMenu("menuOptions3D")'>3D</td>
</tr>
</table>
<div class="contenuMenu avecBordures">
<h3>Widget options</h3>
<span>Themes of widget:</span> <select id="selectTheme" onchange="changerTheme(this.value)">
<option value="noir">Black</option>
<option value="bleu">Blue</option>
<option value="blanc">White</option>
</select><br/>
<br/><br/><br/>
<span class="gras">Control options:</span><br/>
<input type="button" class="boutonSauvegarde" onclick="saveOptions()" value="Save"/><input type="button" class="boutonSauvegarde" onclick="loadOptions()" value="Load"/> <input class="boutonSauvegarde2" type="button" onclick="delOptions()" value="Delete"/><input class="boutonSauvegarde2" type="button" onclick="alertOptions()" value="Display"/><br/>
<span class="texteSecondaire">Save a widget options in cookies or load an options from cookies or delete a registered options.</span>
<br/>
<div id="cacheCookies"><br/><br/><h1>Cookies are disabled. You cannot save an options...</h1></div>
<div id="cacheMaJ">You are using the last version of this widget.</div>
<input type="button" onclick='reset()' value="Reload widget" style="position:absolute; bottom:20px; width:140px; height:32px;"/>
</div>
<div class="barreBasMenu"><input type="button" onclick="cacherMenu(); actualiserGraph()" value="Check"/></div>
</div>
<div id="menuOptions2D" class="menu">
<table class="ongletMenu">
<tr>
<td onclick='afficherMenu("menuOptions")'>Widget</td>
<td class="ongletMenuActuel" onclick='afficherMenu("menuOptions2D")'>2D</td>
<td onclick='afficherMenu("menuOptions3D")'>3D</td>
</tr>
</table>
<div class="contenuMenu avecBordures">
<h3>Options 2D</h3>
<span>The graphical method displaying:</span><select id="selectMethodeAffichage">
<option value="canvas">canvas (lines)</option>
<option value="canvas2">canvas (points)</option>
<option value="svg">svg</option>
<option value="svg2">svg (1 image)</option>
<option value="xpm">xpm</option>
<option value="sankore">sankore</option>
</select> <br/>
<span>Zoom default:</span>
<input value="5" class="smallInput" id="zoomDefaut"/>
<input type="button" onclick='reinitialiserZoom(document.getElementById("zoomDefaut").value)' value="Update zoom"/> <br/>
<br/>
<input type="checkbox" id="checkGrille" checked="true" onclick="actualiserGraph()"/><label for="checkGrille">Show grid</label> <br/>
<input type="checkbox" id="checkAxes" checked="true" onclick="actualiserGraph()"/><label for="checkAxes">Show axis</label> <br/>
<input type="checkbox" id="checkEchelle" checked="true" onclick="actualiserGraph()"/><label for="checkEchelle">Scale</label> <br/>
<span>Thickness:</span> <input id="inputTaille" class="smallInput" value="3" onkeypress='if(event.keyCode==13) actualiserGraph()' style=""/>
<div class="boutonPlus" type="button" onclick="boutonPlus('inputTaille', 1); actualiserGraph()">+</div><div class="boutonMoins" type="button" onclick="boutonMoins('inputTaille', 1); actualiserGraph()">-</div> <br/>
<br/>
<span>Offset diagram:</span>
x=<input value="0" class="smallInput" id="inputDecalageX" onkeyup="decalageX = parseFloat(this.value)"/>
y=<input value="0" class="smallInput" id="inputDecalageY" onkeyup="decalageY = parseFloat(this.value)"/>
<br/>
<span>Accuracy graph:</span>
<input value="0.02" class="smallInput" id="inputPrecision" onkeyup="precision = parseFloat(this.value)"/>
<div class="boutonPlus" type="button" onclick="boutonPlus('inputPrecision', 0.01); precision = parseFloat(document.getElementById('inputPrecision').value); actualiserGraph()">+</div><div class="boutonMoins" type="button" onclick="boutonMoins('inputPrecision', 0.01); precision = parseFloat(document.getElementById('inputPrecision').value); actualiserGraph()">-</div> <br/>
<br/>
</div>
<div class="barreBasMenu"><input type="button" onclick='cacherMenu(); actualiserGraph()' value="Check"/></div>
</div>
<div id="menuOptions3D" class="menu">
<table class="ongletMenu">
<tr>
<td onclick='afficherMenu("menuOptions")'>Widget</td>
<td onclick='afficherMenu("menuOptions2D")'>2D</td>
<td class="ongletMenuActuel" onclick='afficherMenu("menuOptions3D")'>3D</td>
</tr>
</table>
<div class="contenuMenu avecBordures">
<h3>Options 3D</h3>
<span>Show the style:</span>
<select id="selectAffichage3D">
<option value="surfaces"> surfaces </option>
<option value="points"> points </option>
</select> <input type="button" onclick='reinitialiserZoom(5)' value="Reset display"/> <br/>
<br/>
<span>Accuracy function:</span> <input value="0.2" class="smallInput" id="inputPrecision3D" onkeyup="precisionFonction3D = parseFloat(this.value)"/>
<div class="boutonPlus" type="button" onclick="boutonPlus('inputPrecision3D', 0.1); precisionFonction3D = parseFloat(document.getElementById('inputPrecision3D').value); actualiserGraph()">+</div><div class="boutonMoins" type="button" onclick="boutonMoins('inputPrecision3D', 0.1); precisionFonction3D = parseFloat(document.getElementById('inputPrecision3D').value); actualiserGraph()">-</div> <br/>
<br/>
<span>Use the color:</span><br/>
<span>red:</span>
<select onchange="checkCouleurs3D()" id="selectRouge3D">
<option value="plus">positive value</option>
<option value="moins">negative value</option>
<option value="tout">general value</option>
</select>
<br/>
<span>green:</span>
<select onchange="checkCouleurs3D()" id="selectVert3D">
<option value="moins">negative value</option>
<option value="plus">positive value</option>
<option value="tout">general value</option>
</select>
<br/>
<span>blue:</span>
<select onchange="checkCouleurs3D()" id="selectBleu3D">
<option value="tout">general value</option>
<option value="plus">positive value</option>
<option value="moins">negative value</option>
</select>
<br/>
<span>General value:</span> <input class="smallInput" id="couleur3Dgenerale" type="texte" value="0" onkeyup="checkCouleurs3D()"/> (<span>from</span> 0 <span>to</span> 255)
<br/>
<span id="apercuCouleur3D"></span>
</div>
<div class="barreBasMenu"><input type="button" onclick='cacherMenu(); actualiserGraph()' value="Check"/></div>
</div>
<!-- Aide -->
<div id="menuAide" class="menu">
<table class="ongletMenu">
<tr>
<td class="ongletMenuActuel" onclick='afficherMenu("menuAide")'>Using</td>
<td onclick='afficherMenu("menuAideExemples")'>Examples</td>
<td onclick='afficherMenu("menuAideAutres")'>Other</td>
</tr>
</table>
<div class="contenuMenu avecBordures">
<h1>How it work.</h1>
<p><span>This widget allow to draw mathematical function. Enter function in the field in the top part of widget and press "Show".</span></p>
<p><span>You can enter following mathematical function:</span><br/>
<h2>Basic operations</h2>
<ul>
<li><span>Plus</span> -> <span class="gras">+</span></li>
<li><span>Minus</span> -> <span class="gras">-</span></li>
<li><span>Multiplication</span> -> <span class="gras">*</span></li>
<li><span>Division</span> -> <span class="gras">/</span></li>
<li><span>Mod</span> -> <span class="gras">%</span></li>
</ul>
<h2>Trigonometric functions</h2>
<ul>
<li><span>Sine</span> -> <span class="gras">sin(x)</span></li>
<li><span>Cosine</span> -> <span class="gras">cos(x)</span></li>
<li><span>Tangent</span> -> <span class="gras">tan(x)</span></li>
<li><span>Cotangent</span> -> <span class="gras">cot(x)</span></li>
<li><span>Secant</span> -> <span class="gras">sec(x)</span></li>
<li><span>Cosecant</span> -> <span class="gras">csc(x)</span></li>
</ul>
<ul>
<li><span>Arc sine</span> -> <span class="gras">arcsin(x)</span> <span>or</span> <span class="gras">asin(x)</span></li>
<li><span>Arc cosine</span> -> <span class="gras">arccos(x)</span> <span>or</span> <span class="gras">acos(x)</span></li>
<li><span>Arc tangent</span> -> <span class="gras">arctan(x)</span> <span>or</span> <span class="gras">atan(x)</span></li>
<li><span>Arc cotangent</span> -> <span class="gras">arccot(x)</span> <span>or</span> <span class="gras">acot(x)</span></li>
</ul>
<h2>Hyperbolic functions</h2>
<ul>
<li><span>Hyperbolic sine</span> -> <span class="gras">sinh(x)</span></li>
<li><span>Hyperbolic cosine</span> -> <span class="gras">cosh(x)</span></li>
<li><span>Hyperbolic tangent</span> -> <span class="gras">tanh(x)</span></li>
<li><span>Hyperbolic cotangent</span> -> <span class="gras">coth(x)</span></li>
<li><span>Hyperbolic secant</span> -> <span class="gras">sech(x)</span></li>
<li><span>Hyperbolic cosecant</span> -> <span class="gras">csch(x)</span></li>
</ul>
<ul>
<li><span>Hyperbolic arc sine</span> -> <span class="gras">arcsinh(x)</span> <span>or</span> <span class="gras">asinh(x)</span></li>
<li><span>Hyperbolic arc cosine</span> -> <span class="gras">arccosh(x)</span> <span>or</span> <span class="gras">acosh(x)</span></li>
<li><span>Hyperbolic arc tangent</span> -> <span class="gras">arctanh(x)</span> <span>or</span> <span class="gras">atanh(x)</span></li>
<li><span>Hyperbolic arc cotangent</span> -> <span class="gras">arccoth(x)</span> <span>or</span> <span class="gras">acoth(x)</span></li>
</ul>
<h2>Square roots and degrees</h2>
<ul>
<li><span>Square root</span> -> <span class="gras">sqrt(x)</span></li>
<li><span>Degree</span> -> <span class="gras">pow(x, y)</span> <span class="texteSecondaire">Variable x to the power y</span></li>
<li><span>Root</span> -> <span class="gras">root(x, y)</span> <span class="texteSecondaire">Root y of x</span></li>
</ul>
<h2>Exponential and logarithm</h2>
<ul>
<li>e<span style="vertical-align:super;">x</span> -> <span class="gras">exp(x)</span></li>
<li><span>Natural logarithm</span> -> <span class="gras">ln(x)</span></li>
<li><span>Decimal logarithm</span> -> <span class="gras">log(x)</span></li>
</ul>
<h2>Absolute number value</h2>
<ul>
<li>|x| -> <span class="gras">abs(x)</span></li>
</ul>
<h2>Rounding</h2>
<ul>
<li><span class="gras">round(x)</span> -> <span>rounding to the nearest whole number</span></li>
<li><span class="gras">ceil(x)</span> -> <span>rounding to the nearest whole number in a big way</span></li>
<li><span class="gras">floor(x)</span> -> <span>rounding to the nearest whole number the smaller side</span></li>
</ul>
</p> <br/>
<hr/>
<h1>Constants</h1>
<p><span>Also are available some constants:</span><br/>
<ul>
<li><span class="gras">pi</span> = 4 * atan(1) ≈ 3,141592653589793</li>
<li><span class="gras">e</span> = exp(1) ≈ 2.718281828459045</li>
</ul>
</p>
<br/>
<hr/>
<h1>Keyboard keys</h1>
<p style="font-size:90%;">
esc -> <span>reset widget</span> <br/>
ctrl + <span>left arrow</span> -> <span>graph will be moved left</span><br/>
ctrl + <span>top arrow</span> -> <span>graph will be moved top</span><br/>
ctrl + <span>right arrow</span> -> <span>graph will be moved right</span><br/>
ctrl + <span>bottom arrow</span> -> <span>graph will be moved bottom</span><br/>
<br/>
</p>
<br/>
<input type="button" value="User's guide" onclick="navigateur('Guide_Utilisateur.html')" style="position:absolute;bottom:0px;left:0px;"/>
</div>
<div class="barreBasMenu"><input type="button" onclick='cacherMenu()' value="Cancel"/></div>
</div>
<div id="menuAideExemples" class="menu">
<table class="ongletMenu">
<tr>
<td onclick='afficherMenu("menuAide")'>Using</td>
<td class="ongletMenuActuel" onclick='afficherMenu("menuAideExemples")'>Examples</td>
<td onclick='afficherMenu("menuAideAutres")'>Other</td>
</tr>
</table>
<div class="contenuMenu avecBordures">
<span class="texteSecondaire">(You can view example. Do not forget to set accuracy in options if necessary.)</span>
<br/><br/>
<hr/>
<h1>Functions 2D</h1>
<p>
<span class="survol" onclick="document.getElementById('inputEq').value = '0.5*x+1' ; actualiserGraph()">0.5*x+1</span> <br/>
<span class="survol" onclick="document.getElementById('inputEq').value = 'pow(x,2)-3' ; actualiserGraph()">pow(x,2)-3</span> <br/>
<span class="survol" onclick="document.getElementById('inputEq').value = '1/x' ; actualiserGraph()">1/x</span> <br/>
<span class="survol" onclick="document.getElementById('inputEq').value = 'atan(x)' ; actualiserGraph()">atan(x)</span> <br/>
<span class="survol" onclick="document.getElementById('inputEq').value = '(x+1/x)/1.2' ; actualiserGraph()">(x+1/x)/1.2</span> <br/>
<span class="survol" onclick="document.getElementById('inputEq').value = 'sin(10*x*x)*0.5' ; actualiserGraph()">sin(10*x*x)*0.5</span> <br/>
<span class="survol" onclick="document.getElementById('inputEq').value = 'log(pow(x-2,2))' ; actualiserGraph()">log(pow(x-2,2))</span> <br/>
<span class="survol" onclick="document.getElementById('inputEq').value = '(x*x-5*x+5)*exp(x)/5' ; actualiserGraph()">(x*x-5*x+5)*exp(x)/5</span> <br/>
<span class="survol" onclick="document.getElementById('inputEq').value = 'random()' ; evaluer('random()')">random()</span> <br/>
</p>
<br/><br/>
<hr/>
<h1>Functions 3D</h1>
<p>
<span class="survol" onclick="document.getElementById('inputEq').value = 'sin(x)+cos(y)' ; actualiserGraph()">sin(x)+cos(y)</span> <br/>
<span class="survol" onclick="document.getElementById('inputEq').value = 'sqrt(10-x*x)' ; actualiserGraph()">sqrt(10-x*x)</span> <br/>
<span class="survol" onclick="document.getElementById('inputEq').value = 'atan(x)+atan(y)' ; actualiserGraph()">atan(x)+atan(y)</span> <br/>
</p>
<br/>
</div>
<div class="barreBasMenu"><input type="button" onclick='cacherMenu()' value="Cancel"/></div>
</div>
<div id="menuAideAutres" class="menu">
<table class="ongletMenu">
<tr>
<td onclick='afficherMenu("menuAide")'>Using</td>
<td onclick='afficherMenu("menuAideExemples")'>Examples</td>
<td class="ongletMenuActuel" onclick='afficherMenu("menuAideAutres")'>Other</td>
</tr>
</table>
<div class="contenuMenu avecBordures">
<h4>Save graph</h4>
<span>In some browsers when used display method "Canvas" you can save graph by clicking it with right mouse button and selecting "Save image". Also you can save 3D-graphs.</span>
<br/><br/>
<h4>Offset</h4>
<span>If graph isn't in the right place (larger than canvas) then can you set necessary parameters graph displaying in settings menu.</span>
</div>
<div class="barreBasMenu"><input type="button" onclick='cacherMenu()' value="Cancel"/></div>
</div>
<!-- Crédits -->
<div id="menuCredits" class="menu">
<div class="contenuMenu" style="text-align:justify;">
<br/>
<table id="credits">
<tr>
<td>
<img src="icon.png"/>
<h3>Widget is developed by</h3>
Yannick Vessaz <br/>
<a href='mailto:yannick.vessaz@gmail.com'>yannick.vessaz@gmail.com</a>
</td>
</tr>
</table>
<span class="texteSecondaire">
<br/><br/>
<span>If you want to inform about bug, make a proposal or just ask some questions then you can contact to me at the following e-mail:</span> <a href='mailto:yannick.vessaz@gmail.com'>e-mail</a>.
<br/><br/>
<span>If you want to change background design then you can contact at following address:</span> <a href="http://kde.org">KDE</a>.
</span>
<span id="version" class="texteSecondaire" style="position:absolute;bottom:10px;left:15px;">version 1.3</span>
</div>
<div class="barreBasMenu"><input type="button" onclick='cacherMenu()' value="Cancel"/></div>
</div>
<!-- Outils -->
<div id="menuOutils" class="menu">
<div class="contenuMenu">
<h3 style="margin-top:0px; margin-bottom:15px;">Tools</h3>
<span>Mouse events:</span><br/>
<input type="button" class="choixOutil" onclick="choixOutil('deplacement');cacherMenu()" value="Moving"/>
<input type="button" class="choixOutil" onclick="choixOutil('tangente');cacherMenu()" value="Tangente"/>
<input type="button" class="choixOutil" onclick="choixOutil('point');cacherMenu()" value="Point"/>
<br/><br/>
<span>Derivative:</span><br/>
<label for="checkDerivee"> f'(x) </label><input type="checkbox" id="checkDerivee" onclick="actualiserGraph()"/><label for="checkDerivee2"> f''(x) </label><input type="checkbox" id="checkDerivee2" onclick="actualiserGraph()"/>
<br/><br/>
<span>Square under function:</span><br/>
<span>From</span> <input value="-5" class="smallInput" id="aireG"/> <span>to</span> <input value="5" class="smallInput" id="aireD"/> <input type="button" onclick='calculerAire()' value="Calculate"/> <span id="outputAire"></span>
<div style="float: right;"><label for="checkAire">Draw </label><input type="checkbox" id="checkAire" onclick="actualiserGraph()"/></div>
<br/><br/>
<span>Calculate the point on the function:</span><br/>
x=<input value="0" class="smallInput" id="inputX" onkeypress='if(event.keyCode==13) execute(document.getElementById("inputEq").value)'/>
<input type="button" onclick='execute(document.getElementById("inputEq").value)' value="Estimate"/>
<span id="outputX"></span>
<br/><br/>
<span>Analysis of function:</span> <br/>
f(x) = <span id="etudeFct"></span> <input type="button" value="Start to analysis" onclick='etudier(document.getElementById("inputEq").value);afficherMenu("menuEtude")'/>
<br/><br/>
<span>Display test:</span><br/>
<input type="button" onclick='cacherMenu(); testXPM()' value="Test XPM"/><input type="button" onclick='cacherMenu(); testSVG()' value="Test SVG"/><input type="button" onclick='cacherMenu(); testCanvas()' value="Test Canvas"/>
</div>
<div class="barreBasMenu"><input type="button" onclick='cacherMenu()' value="Cancel"/></div>
</div>
<!--Etude de fonction -->
<div id="menuEtude" class="menu">
<div class="contenuMenu">
<h3>Analysis of function</h3>
<span>Set of definitions:</span> <span id="etudeEDF">...</span> <br/>
<span>Parity:</span> <span id="etudeParite">...</span> <br/>
<span>Zeros of functions:</span> <span id="etudeZeros">...</span> <br/>
<table>
<tr id="etudeSigne">
<td>Sign : ...</td>
</tr>
</table>
<span>Asymptotes</span> <br/>
<span>AH left:</span> : <span id="etudeAHG">...</span> <br/>
<span>AH right:</span> <span id="etudeAHD">...</span> <br/>
<span>AV:</span> <span id="etudeAV">...</span>
<span id="etudeMin">...</span>
<span id="etudeMax">...</span>
<span id="etudeI">...</span> <br/><br/>
<span class="texteSecondaire" style="font-size:10px;">Tool for analysis of function is not reliable on 100%. Don't forget check results of analysis before use it.</span>
</div>
<div class="barreBasMenu"><input type="button" onclick='cacherMenu()' value="Cancel"/></div>
</div>
<!-- Fonctions multiples -->
<div id="menuFonctions" class="menu">
<table class="ongletMenu">
<tr>
<td class="ongletMenuActuel" onclick='afficherMenu("menuFonctions")'>Functions</td>
<td onclick='afficherMenu("menuHistorique")'>History</td>
</tr>
</table>
<div class="contenuMenu avecBordures">
<em>Current</em><br/>
f(x) = <span id="fonctionActuelle">x</span> <input type="button" value="+" onclick="ajouterFonction(document.getElementById('fonctionActuelle').innerHTML)"/>
<br/><br/>
<em>Additional</em><br/>
<span id="fonctionsSupp">n/a ...</span>
</div>
<div class="barreBasMenu"><input type="button" onclick='cacherMenu()' value="Cancel"/></div>
</div>
<!-- Historique -->
<div id="menuHistorique" class="menu">
<table class="ongletMenu">
<tr>
<td onclick='afficherMenu("menuFonctions")'>Functions</td>
<td class="ongletMenuActuel" onclick='afficherMenu("menuHistorique")'>History</td>
</tr>
</table>
<div class="contenuMenu avecBordures" id="divHistorique">
<span id="spanHistorique"></span>
</div>
<div class="barreBasMenu"><input type="button" onclick='cacherMenu()' value="Cancel"/></div>
</div>
<!-- Couleur -->
<div id="menuCouleur" class="menu">
<div class="contenuMenu">
<em>Choosing the color:</em> <br/><br/>
<div id="colorSV" onmousemove="if(mouseDown==true){colorSV(event)}" onmousedown="colorSV(event); mouseDown = true" onmouseup="mouseDown = false">
<svg:svg width="100%" height="100%" version="1.1" xmlns="http://www.w3.org/2000/svg">
<svg:defs id="defs1">
<svg:linearGradient id="linearGradient1" x1="0%" y1="0%" x2="100%" y2="0%">
<svg:stop
style="stop-color:#000000;stop-opacity:1;"
offset="0%" />
<svg:stop
style="stop-color:#000000;stop-opacity:0;"
offset="100%" />
</svg:linearGradient>
<svg:linearGradient id="linearGradient2" x1="0%" y1="0%" x2="0%" y2="100%">
<svg:stop
style="stop-color:#ffffff;stop-opacity:0;"
offset="0%" />
<svg:stop
style="stop-color:#ffffff;stop-opacity:1;"
offset="100%" />
</svg:linearGradient>
</svg:defs>
<svg:rect
style="fill:url(#linearGradient2);fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;fill-opacity:1"
width="255"
height="255"
x="0"
y="0"
ry="0" />
<svg:rect
style="fill:url(#linearGradient1);fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;fill-opacity:1"
width="255"
height="255"
x="0"
y="0"
ry="0" />
<svg:line
id="ligneValeur"
x1="255"
y1="0"
x2="255"
y2="255"
style="stroke:rgb(0,0,0);stroke-width:2"/>
<svg:line
id="ligneSaturation"
x1="0"
y1="0"
x2="255"
y2="0"
style="stroke:rgb(0,0,0);stroke-width:2"/>
</svg:svg>
</div>
<div id="colorT" onmousemove="if(mouseDown==true){colorT(event)}" onmousedown="colorT(event); mouseDown = true" onmouseup="mouseDown = false">
<svg:svg width="100%" height="100%" version="1.1" xmlns="http://www.w3.org/2000/svg">
<svg:defs id="defs2">
<svg:linearGradient id="linearGradient3" x1="0%" y1="100%" x2="0%" y2="0%">
<svg:stop
style="stop-color:#ff0000;stop-opacity:1;"
offset="0%" />
<svg:stop
style="stop-color:#ff00ff;stop-opacity:1;"
offset="16.66%" />
<svg:stop
style="stop-color:#0000ff;stop-opacity:1;"
offset="33.33%" />
<svg:stop
style="stop-color:#00ffff;stop-opacity:1;"
offset="50%" />
<svg:stop
style="stop-color:#00ff00;stop-opacity:1;"
offset="66.66%" />
<svg:stop
style="stop-color:#ffff00;stop-opacity:1;"
offset="83.33%" />
<svg:stop
style="stop-color:#ff0000;stop-opacity:1;"
offset="100%" />
</svg:linearGradient>
</svg:defs>
<svg:rect
style="fill:url(#linearGradient3);fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;fill-opacity:1"
width="255"
height="255"
x="0"
y="0"
ry="0" />
<svg:line
id="ligneTeinte"
x1="0"
y1="0"
x2="20"
y2="0"
style="stroke:rgb(0,0,0);stroke-width:2"/>
</svg:svg>
</div>
<table id="colorValues">
<tr>
<td>Color: </td><td><input id="inputTeinte" class="smallInput" value="0" onkeypress=''/></td>
</tr><tr>
<td>Value: </td><td><input id="inputValeur" class="smallInput" value="0" onkeypress=''/></td>
</tr><tr>
<td>Saturation: </td><td><input id="inputSaturation" class="smallInput" value="0" onkeypress=''/></td>
</tr><tr>
<td>Red: </td><td><input id="inputRouge" class="smallInput" value="255" onkeypress=''/></td>
</tr><tr>
<td>Green: </td><td><input id="inputVert" class="smallInput" value="0" onkeypress=''/></td>
</tr><tr>
<td>Blue: </td><td><input id="inputBleu" class="smallInput" value="0" onkeypress=''/></td>
</tr><tr>
<td>Opacity: </td><td><input id="inputOpacity" class="smallInput" value="1" onkeypress=''/></td>
</tr><!--<tr>
<td><input id="inputCouleur" style="width: 70%" value="cyan" onkeypress='couleurFonction = this.value; if(event.keyCode==13) actualiserGraph()'/></td>
</tr>-->
</table>
<div id="apercuCouleur" title="New Color"></div><div id="apercuCouleur2" title="Old Color"></div>
</div>
<div class="barreBasMenu"><input type="button" onclick="if(idColor=='buttonColor'){cacherMenu()}else{afficherMenu('menuFonctions')}; actualiserGraph()" value="Check"/></div>
</div>
<!-- Erreurs Fonctions interdites -->
<div id="fctInterdite" class="miniMenu">
<br/>
<h1>------- Error -------</h1>
<br/>
Impossible to draw the function ...
<br/><br/>
Error in expression or unexpected char: <br/>
<span id="spanFctInterdite" style="font-style:italic;"></span>
<br/><br/>
<input type="button" onclick="cacherMenu()" value="Ok"/>
</div>
<!-- Autres erreurs -->
<div id="erreurFct" class="miniMenu">
<h1>------- Error -------</h1>
Runtime error! Check your function and try to draw it again.
<br/>
Description and parameters various functions which are available to help.
<br/><br/>
<input type="button" onclick="afficherMenu('menuAide')" value="Help"/>
<input type="button" onclick="cacherMenu()" value="Ok"/>
</div>
<!-- Menu des mises à jour -->
<div id="mAj" class="menu">
<h1>Updated</h1>
<span>Current version:</span> <br/><span id="thisVersion"></span><br/>
<span>The last on-line version:</span> <br/><span id="newVersion"></span><br/>
<br/>
<span>This widget is available to using on web-site:</span> <em>http://gyb.educanet2.ch/tm-widgets/yannick</em><br/>
<br/>
</div>
<!-- Erreur mise à jour -->
<div id="erreurMaJ" class="miniMenu">
<br/>
<h1>------- Error -------</h1>
<br/><br/>
Update to latest version is not available because you already use the latest version.
<br/><br/><br/>
<input type="button" onclick="cacherMenu()" value="Ok"/>
</div>
<!-- Info options sauvegardées -->
<div id="infoSauvegarde" class="alertMenu">
<br/>
<h1>Options saved!</h1>
<br/>
<input type="button" onclick="document.getElementById('infoSauvegarde').style.display = 'none'" value="Ok"/>
</div>
<!-- ..... Flèches de déplacement ..... -->
<div class="flecheDeplacement" id="flecheHaut" onclick="if(fonction3D){zoom3D(1.25)}else{deplacerY(1)}" onmousemove="sourisMove(event)"></div>
<div class="flecheDeplacement" id="flecheGauche" onclick="deplacerX(-1)" onmousemove="sourisMove(event)"></div>
<div class="flecheDeplacement" id="flecheBas" onclick="if(fonction3D){zoom3D(0.8)}else{deplacerY(-1)}" onmousemove="sourisMove(event)"></div>
<div class="flecheDeplacement" id="flecheDroite" onclick="deplacerX(1)" onmousemove="sourisMove(event)"></div>
<!-- ..... Bas du Widget ..... -->
<div class="info" id="info"></div>
<div id="point">o</div>
<div id="tangente"></div>
<!-- .... Autres .... -->
<div id="onglet3D" onclick="activer3D()">3D</div>
</body>
<!-- .............................. Widget réalisé par Yannick Vessaz .............................. -->
<!-- .............................. e-mail: yannick.vessaz@gmail.com .............................. -->
</html>
...@@ -2,199 +2,200 @@ ...@@ -2,199 +2,200 @@
<html> <html>
<head> <head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title>GraphMe - User's guide.</title> <title>GraphMe - Guide utilisateur</title>
<link rel="stylesheet" type="text/css" href="Style/Guide_Utilisateur.css"/> <link rel="stylesheet" type="text/css" href="Style/Guide_Utilisateur.css"/>
</head> </head>
<body> <body>
<h1>GraphMe</h1> <h1>GraphMe</h1>
<img src="Images/GraphMe.png"/> <img src="Images/GraphMe.png"/>
<h1>User's guide</h1> <h1>Guide d'utilisation</h1>
<ol id="Sommaire"> <ol id="Sommaire">
<li><a href="#Introduction">Introduction</a></li> <li><a href="#Introduction">Introduction</a></li>
<li><a href="#Installation">Installation</a></li> <li><a href="#Installation">Installation</a></li>
<li><a href="#AfficherLeWidget">Review widget</a></li> <li><a href="#AfficherLeWidget">Afficher le widget</a></li>
<li><a href="#PresentationAffichage">View presentation</a></li> <li><a href="#PresentationAffichage">Présentation de l'affichage</a></li>
<li><a href="#DessinerFonction">Drawing the function</a></li> <li><a href="#DessinerFonction">Dessiner une fonction</a></li>
<li><a href="#DeplacerAffichage">Offset function</a></li> <li><a href="#DeplacerAffichage">Se déplacer à travers la fonction</a></li>
<li><a href="#MenuOptions">The options menu</a></li> <li><a href="#MenuOptions">Le menu des options</a></li>
<li><a href="#MenuOutils">the tools menu</a></li> <li><a href="#MenuOutils">Le menu des outils</a></li>
<li><a href="#PlusieursFonctions">Drawing some functions</a></li> <li><a href="#PlusieursFonctions">Dessiner plusieurs fonctions</a></li>
<li><a href="#MaJ">GraphMe update</a></li> <li><a href="#MaJ">Mettre à jour GraphMe</a></li>
<li><a href="#Contact">Contact</a></li> <li><a href="#Contact">Contact</a></li>
</ol> </ol>
<h2 id="Introduction">1. Introduction</h2> <h2 id="Introduction">1. Introduction</h2>
<p> <p>
GraphMe is a app that is developed using html, javascript and css. It can be used for drawing graphs. This document must explain how to use GraphMe. This app have a different functions and some useful advices for users. GraphMe est un traceur de fonctions mathématiques que j'ai programmé dans le cadre du travail de maturité gymnasiale. Il est codé en HTML, CSS et JavaScript. Ce grapheur est disponible sur un cd-rom accompagnant mon travail de maturité ainsi que sur internet à la page <a href="http://gyb.educanet2.ch/tm-widgets/.ws_gen/?15">http://gyb.educanet2.ch/tm-widgets/.ws_gen/?15</a>. Ce document a pour but d'expliquer comment utiliser GraphMe. Il présente ses différentes fonctions ainsi que quelques astuces utiles à l'utilisateur.
</p> </p>
<h2 id="Installation">2. Installation</h2> <h2 id="Installation">2. Installation</h2>
<p> <p>
This widget can be downloaded from the Internet in a packed format. Before using it must be unpacked. GraphMe was developed for using in web-browsers and integration in Sankore. To add this app in Sankore you should copy folder named "GraphMe.wgt" in "../library/interactive/". For example, on "windows OS" GraphMe must be in folder with following path: "C: / Program Files / Sankore 4/library/interactive/GraphMe.wgt". If you have no Sankore then you can get it on <a href="http://getuniboard.com">http://getuniboard.com/</a>. Le widget que vous pouvez télécharger sur internet est compressé au format zip. Avant de l'utiliser, il est nécessaire de le décompresser. Si vous n'avez aucuns programmes permettant d'ouvrir les fichiers zip, vous pouvez télécharger 7zip sur <a href="http://www.7-zip.org/">http://www.7-zip.org/</a>. GraphMe a été conçu pour s'utiliser dans un navigateur internet ou s'intégrer à Uniboard. Pour l'ajouter aux widgets d'Uniboard, il faut copier le dossier « GraphMe.wgt » dans « library/interactive/ ». Par exemple, sous Windows, le widget doit être dans : « C:/Program Files/Uniboard 4/library/interactive/GraphMe.wgt ». Si vous n'avez pas Uniboard, vous pouvez l'obtenir sur <a href="http://getuniboard.com">http://getuniboard.com/</a>.
</p> </p>
<h2 id="AfficherLeWidget">3. Review widget</h2> <h2 id="AfficherLeWidget">3. Afficher le widget</h2>
<div class="droite"><img src="Images/Guide_Navigateur.png"/>Display GraphMe in browsers</div> <div class="droite"><img src="Images/Guide_Navigateur.png"/>Image de GraphMe dans un navigateur internet</div>
<p> <p>
A) To display this app in browser just enough to open the file named "Grapheur.xhtml" (it's in root folder) with your browser. But some browsers can not display app correctly. Below is the list of browsers that are able to display app: A) Pour afficher le widget dans un navigateur, il faut simplement ouvrir le fichier « Grapheur.xhtml » qui se trouve dans le dossier « GraphMe.wgt » avec votre navigateur internet. Toutefois, certains navigateurs n'arrivent pas à afficher le widget. La liste suivante contient les navigateurs sur lesquels le widget a été testé :
</p> </p>
<ul> <ul>
<li>Mozilla Firefox (3.5) : Everything works fine.</li> <li>Mozilla Firefox (3.5) : tout fonctionne très bien.</li>
<li>Internet Explorer (8.0) : Cannot open a widget, because .xhtml format is not recognized.</li> <li>Internet Explorer (8.0) : impossible d'ouvrir le widget, le format .xhtml n'est pas reconnu.</li>
<li>Internet Explorer (pré-version 9.0) : Widget works but just using SVG. Canvas not supported yet.</li> <li>Internet Explorer (pré-version 9.0) : le widget est ouvrable mais seul l'affichage utilisant SVG fonctionne, « canvas » n'est toujours pas supporté.</li>
<li>Konqueror (4.3.4) : Widget can be opened but there is some problems with displaying. It still occur when choosed display method "canvas".</li> <li>Konqueror (4.3.4) : le widget s'ouvre mais il y a quelques problèmes d'affichage. Il est quand même utilisable en sélectionnant la méthode d'affichage « canvas » dans les options.</li>
<li>Opera (10.51) : Widget quite useful.</li> <li>Rekonq (0.5) : le widget fonctionne très bien avec « canvas » mais est un peut lent en utilisant SVG.</li>
<li>Google Chrome (4.1) : Everything works very nice! 3D-display is faster as compared with other browsers.</li> <li>Opera (10.51) : le widget est parfaitement utilisable</li>
<li>Google Chrome (4.1) : tout fonctionne également. L'affichage 3D est même très rapide comparé à d'autres navigateurs.</li>
</ul> </ul>
<p> <p>
B) To open widget in Sankore you should first open folder "Application" that is at the left of the screen. Then you must find this app and add it to the page. B) Pour ouvrir le widget dans Uniboard, il faut tout d'abord cliquer sur le bouton « Bibliothèque » en haut de la fenêtre. Ensuite, allez dans l'onglet « Interactif » ou autrement, selon les version d'Uniboard, dans l'onglet « Applications ». Cliquez sur l'icône correspondant à « Traceur de fonctions mathématiques » et finalement sur « Ajouter à la page ».
</p> </p>
<div class="gauche"><img src="Images/Guide_Uniboard.png"/>Display GraphMe in Sankore</div> <div class="gauche"><img src="Images/Guide_Uniboard.png"/>Image de GraphMe dans Uniboard</div>
<img src="Images/Guide_AjouterWidget.png"/> <img src="Images/Guide_AjouterWidget.png"/>
<h2 id="PresentationAffichage">4. View presentation</h2> <h2 id="PresentationAffichage">4. Présentation de l'affichage</h2>
<ol> <ol>
<li>Place for functions display.</li> <li>Champ permettant de définir la fonction à afficher.</li>
<li>Button for beginning the work.</li> <li>Bouton affichant la fonction.</li>
<li>Button for adding new function or for getting access to functions history.</li> <li>Bouton servant à ajouter une nouvelle fonction ou à accéder à l'historique des fonctions.</li>
<li>Display.</li> <li>Zone d'affichage.</li>
<li>Parameters that define the part of graph that will be displayed.</li> <li>Options d'affichage permettant de définir la partie de la fonction à afficher.</li>
<li>Buttons for zoom.</li> <li>Boutons de zoom.</li>
<li>Button for color changing.</li> <li>Bouton servant à changer la couleur.</li>
<li>Buttons for access to menu.</li> <li>Boutons accédant aux différents menus.</li>
<li>Tab-button that toggles 2D and 3D modes.</li> <li>Onglet choisissant entre les fonctions 2D et 3D.</li>
<li>Button for maximize the widget.</li> <li>Bouton de maximisation du widget.</li>
</ol> </ol>
<img src="Images/Guide_Presentation.png"/> <img src="Images/Guide_Presentation.png"/>
<h2 id="DessinerFonction">5. Drawing the function</h2> <h2 id="DessinerFonction">5. Dessiner une fonction</h2>
<p> <p>
To draw mathematical function just enter it at the top of widget and press button "Display". You can use different functions and predefined constants. Pour dessiner une fonction mathématique, il suffit d'entrer celle-ci dans le champ en haut du widget et de cliquer sur le bouton « Afficher ». On peut utiliser différentes fonctions et constantes prédéfinies:
</p> </p>
<h4>Basic operations:</h4> <h4>Les opérations de base</h4>
<ul> <ul>
<li>Addition → +</li> <li>l'addition → +</li>
<li>Subtraction → -</li> <li>la soustraction → -</li>
<li>Multiplication → *</li> <li>la multiplication → *</li>
<li>Division → /</li> <li>la division → /</li>
<li>Mod → %</li> <li>le modulo → %</li>
</ul> </ul>
<h4>Trigonometric functions</h4> <h4>Les fonctions trigonométriques</h4>
<ul> <ul>
<li>sin(x), cos(x), tan(x), cot(x)</li> <li>sin(x), cos(x), tan(x), cot(x)</li>
<li>asin(x), acos(x), atan(x), acot(x) ( ou arcsin(x), arccos(x), arctan(x), arccot(x) )</li> <li>asin(x), acos(x), atan(x), acot(x) ( ou arcsin(x), arccos(x), arctan(x), arccot(x) )</li>
</ul> </ul>
<h4>Square roots and degrees</h4> <h4>Les racines et les puissances</h4>
<ul> <ul>
<li>sqrt(x) is square root from x</li> <li>sqrt(x) fait la racine carrée de x</li>
<li>pow(x, y). Variable x to the power y. For examle:<br/>x² → pow(x, 2)<br/>(x+3)⁵ → pow((x+3), 5)</li> <li>pow(x, y) élève un nombre x à une puissance y, par exemple :<br/>x² → pow(x, 2)<br/>(x+3)⁵ → pow((x+3), 5)</li>
<li>root(x, y). Root y of x</li> <li>root(x, y) fait la racine yème d'un nombre x</li>
</ul> </ul>
<h4>Exponential and logarithm</h4> <h4>Les exponentielles et logarithmes</h4>
<ul> <ul>
<li>exp(x)</li> <li>exp(x)</li>
<li>ln(x) is natural logarithm.</li> <li>ln(x) est le logarithme naturel</li>
<li>log(x) is decimal logarithm.</li> <li>log(x) est le logarithme de base 10</li>
</ul> </ul>
<h4>Rounding</h4> <h4>Les arrondis</h4>
<ul> <ul>
<li>round(x) → rounding to the nearest whole number</li> <li>round(x) → arrondit à l'entier le plus proche</li>
<li>ceil(x) → rounding to the nearest whole number in a big way</li> <li>ceil(x) → arrondit à l'entier supérieur</li>
<li>floor(x) → rounding to the nearest whole number the smaller side</li> <li>floor(x) → arrondit à l'entier inférieur</li>
</ul> </ul>
<h4>Other predefined function</h4> <h4>Autres fonctions prédéfinies</h4>
<ul> <ul>
<li>abs(x) → Absolute number value</li> <li>abs(x) → la valeur absolue d'un nombre</li>
<li>random() → Return random number between 0 and 1</li> <li>random() → retourne un nombre aléatoire entre 0 et 1</li>
</ul> </ul>
<h4>Also are available some constants:</h4> <h4>Les constantes</h4>
<ul> <ul>
<li>pi = 4 * atan(1) ≈ 3.141592653589793</li> <li>pi = 4 * atan(1) ≈ 3.141592653589793</li>
<li>e = exp(1) ≈ 2.718281828459045 </li> <li>e = exp(1) ≈ 2.718281828459045 </li>
</ul> </ul>
<p> <p>
Not always it's easy to understand how to record a required function. Really if anywhere you err then graph will not displayed. Also do not forget about "*" (multiply) to multiply and "." (decimal point) to write point. Il n'est pas toujours facile de comprendre comment écrire la fonction désirée. En effet, une petite faute et elle ne s'affichera pas. De plus, il ne faut pas oublier de mettre un « * » entre les thermes à multiplier et d'utiliser le point « . » pour écrire des nombres à virgule.
</p> </p>
<p> <p>
The two-dimensional function must be written as y=[...] and the three-dimensional function nust be written as z=[...]. Other examples are available to use in menu "Help" if you have some difficulties with function definition. Les fonctions en deux dimensions s'écrivent sous la forme : y=[...] et les fonctions en trois dimensions sous la forme : z=[...]. D'autres exemples sont disponibles dans le menu « aide » du widget si vous avez de la peine à entrer une fonction.
</p> </p>
<h2 id="DeplacerAffichage">6. Offset function</h2> <h2 id="DeplacerAffichage">6. Se déplacer à travers la fonction</h2>
<p> <p>
Sometimes when you draw the function you don't see all necessary information about this function. In this case you can change position of graph. Parfois, lorsqu'on dessine une fonction, la zone visible n'est pas très intéressante. Pour cela, il est utile de déplacer l'affichage ou de définir soi-même la zone à afficher.
</p> </p>
<img src="Images/Guide_Deplacement.png"/> <img src="Images/Guide_Deplacement.png"/>
<p> <p>
To move the function graph just use a navigation arrows that are in the four edges of the display or mouse move tool (menu Service). Pour déplacer la fonction, il suffit d'utiliser les flèches de navigation situées dans les quatre bords de l'affichage ou l'outil de déplacement à la souris (dans le menu « Outils »).
</p> </p>
<p> <p>
To define place to display you should enter a custom values in the left side of the widget. The left value must be less than the right value. In other case graph will not displayed. Pour définir la zone à afficher, il faut entrer des valeurs personnalisées dans les champs à gauche du widget. La valeur de gauche doit obligatoirement être plus petite que la valeur de droite. Dans le cas contraire, la fonction ne se dessinera pas.
</p> </p>
<p> <p>
You can increase or decrease the scale of displaying using buttons that are in the left menu. So you'll see more information about function. Zoom can be reset in options. Il est possible de zoomer ou dé-zoomer l'affichage en utilisant les boutons du menu de gauche pour voir une plus grande partie de la fonction. Le zoom peut être réinitialisé dans les options. On peut également cliquer deux fois sur le graphique pour zoomer ainsi que dé-zoomer en maintenant la touche « ctrl » appuyée et en cliquant deux fois.
</p> </p>
<h2 id="MenuOptions">7. The options menu</h2> <h2 id="MenuOptions">7. Le menu des options</h2>
<p> <p>
To open the menu you should click a button "Options" that is in the left of the widget. If you click on this button again then menu will close. There are some buttons for navigation between options. Their short description: Cliquez sur le bouton « Options » à gauche du widget pour ouvrir ce menu. En cliquant à nouveau sur le bouton, cela ferme le menu. Plusieurs onglets permettent de naviguer entre les différentes options. Description des options :
</p> </p>
<ul> <ul>
<li>Changing a background image and color. In Sankore changing background theme used for displaying widget on black and white background.</li> <li>Le thème du widget change l'image de fond ainsi que différentes couleurs. Dans Uniboard, changer le thème permet de rendre le widget plus visible selon qu'il se trouve sur un fond noir ou un fond blanc.</li>
<li>Display-method used for defining displaying function. There are 6 possibilities: <br/> <li>La méthode d'affichage permet de définir la façon dont le graphique de la fonction sera dessiné. Il y a le choix entre six possibilités : <br/>
<ol> <ol>
<li>SVG is a vector format of image and it can be built in HTML-page. It's compatible in most of browsers and Sankore support it very well so is it selected default.</li> <li>SVG est un format d'image vectoriel qui peut être intégré dans une page HTML. Il est compatible dans la plupart des navigateurs Internet et est très bien supporté par Uniboard, c'est pourquoi il est choisi par défaut.</li>
<li>There is a big difference between SVG (image) and display method SVG. If you have a compatibility problems then you should not use this method.</li> <li>« SVG (une image) » ne présente que peu de différence avec la méthode d'affichage « SVG ». A moins d'un problème de compatibilité, il n'est pas très utile de la choisir.</li>
<li>"Canvas" is a new tag that used in HTML 5.0. It define a area in which you can place some images. This display-method is faster than SVG-method, but Sankore does not fully support it. It's desirable to choose this method when you use no Sankore widget.</li> <li>Canvas est une nouvelle balise présente depuis HTML 5.0. Elle permet de définir une zone dans laquelle on peut faire des dessins. Cette méthode d'affichage est plus rapide que d'utiliser du SVG, cependant, elle n'est pas complètement compatible dans Uniboard. Il est conseillé de choisir cette option si vous utilisez le widget ailleurs que dans Uniboard.</li>
<li>"Canvas" (point) also uses a canvas but draws a points instead of lines.</li> <li>Canvas (point) utilise aussi canvas, mais dessine des points à la place de lignes.</li>
<li>XPM format is little known so it's compatible just with a minority of browsers.</li> <li>XPM est un format d'image très peu connu. De ce fait, il est compatible qu'avec une minorité de navigateur.</li>
<li>Display method "Uniboard" allows to draw directly on the page using Sankore drawing.</li> <li>La méthode d'affichage « Uniboard » permet de dessiner directement sur la page d'Uniboard avec les outils de dessins.</li>
</ol> </ol>
<img src="Images/Guide_Options.png"/> <img src="Images/Guide_Options.png"/>
</li> </li>
<li>Default zoom button returns display into original state. It helps alsoto return to the origin.</li> <li>Le zoom par défaut ainsi que le bouton « réinitialiser le zoom » permettent de remettre l'affichage à l'état qu'il était à l'ouverture du widget. Cela permet aussi de centrer l'affichage sur l'origine.</li>
<li>Display options allow to display or not a grid, axis and scale. They make a mapping more readable. Also you can change the thickness of function line.</li> <li>Les options d'affichage permettent d'afficher ou non la grille, les axes ainsi que l'échelle. Elles sont utiles pour rendre l'affichage plus lisible. Il est également possible de modifier l'épaisseur du trait de la fonction.</li>
<li>Offset of graph not used usually. But if you use it then you can move a mapping in any direction when a center isn't in the right place. It's avaliable in some browsers.</li> <li>Le décalage du graphique n'a en principe pas besoin d'être utilisé. Il permet de déplacer tout l'affichage dans un sens ou dans l'autre, s'il n'est pas centré à la bonne place. Cela peut arriver avec certains navigateurs Internet.</li>
<li>The accuracy of calculations of the graph will increase or decrease the number of points calculated. The higher the number, the more accuracy. It is useful to set this value to "0.01" if you draw functions like 0.5 * sin (10 * x * x).</li> <li>La précision des calculs du graphique permet d'augmenter ou de diminuer le nombre de points calculés. Plus le nombre est petit, plus la précision est grande. Il est utile de mettre cette valeur à « 0.01 » si vous dessinez des fonctions ressemblant à 0.5*sin(10*x*x).</li>
<li>Options in 3D, the display style to choose how the function is designed: with small points or polygons (areas). Most functions are prettier drawing surface between the points calculated. However, it is better to draw points for functions such as the hemisphere: sqrt (12 - x*x - y*y).</li> <li>Dans les options 3D, le style d'affichage permet de choisir comment la fonction est dessinée : avec des petits points ou avec des polygones (surfaces). La plupart des fonctions sont plus jolies en dessinant la surface entre les points calculés. Toutefois, c'est mieux de dessiner des points pour des fonctions comme la demi-sphère : sqrt(12-x*x-y*y).</li>
<li>In the last tab you can change such options 3D, as the accuracy of the calculations and the color of the function.</li> <li>Dans le dernier onglet, vous pouvez modifier d'autres options 3D, comme la précision des calculs ainsi que la couleur de la fonction.</li>
</ul> </ul>
<h2 id="MenuOutils">8. The tools menu.</h2> <h2 id="MenuOutils">8. Le menu des outils</h2>
<p> <p>
This menu allows you to choose first action of the mouse on the graph. There is a choice of three options: Ce menu permet tout d'abord de choisir l'action de la souris sur le graphique. Il y a le choix entre trois possibilités :
</p> </p>
<ul> <ul>
<li>The selected tool is the default. By moving the mouse, a point moves on the function and the coordinates of this point are shown in the top left of the display.</li> <li>L'outil sélectionné par défaut est le point. En bougeant la souris, un point se déplace sur la fonction et les coordonnées de ce point sont indiquées en haut à gauche de l'affichage.</li>
<li>The second tool is moving. It allows you to move the chart with the mouse. Just keep clicking on the display and move the mouse. Unfortunately, this tool can be slow on some browsers.</li> <li>Le deuxième outil est le déplacement. Il permet de déplacer le graphique avec la souris. Il suffit de tenir cliqué sur l'affichage et de bouger la souris. Malheureusement, cet outil peut être lent sur certains navigateurs.</li>
<li>The third tool is the tangent. This tool draws the tangent to the function at the point where is a mouse cursor.</li> <li>Le troisième outil est la tangente. Cet outil dessine la tangente à la fonction au point où se trouve la souris.</li>
</ul> </ul>
<p> <p>
Then, this menu also allows to calculate a point of the function. Simply enter the coordinate "x" from the point where we want to find the coordinate "y" and press the "Evaluate". For example, if the function is "x * x" and that defined "x = 2", then the point whose coordinate on the X axis is "2" will be to coordinate on the Y axis "4". Ensuite, ce menu permet aussi de calculer un point de la fonction. Il faut simplement entrer la coordonnée « x » du point dont on veut trouver la coordonnée « y », et appuyer sur le bouton « Évaluer ». Par exemple, si la fonction est « x*x » et qu'on défini « x=2 », alors le point dont la coordonnée sur l'axe des X est « 2 » aura comme coordonnée sur l'axe des Y « 4 ».
</p> </p>
<p> <p>
Another useful tool is the analysis of function. To analyse the function click on "start the analysis". Analyses based on this widget are not 100% reliable, but are complementary to a analysis of function that you are doing yourself. It may be that this tool will be improved in a future version of the widget. Un autre outil très utile est l'étude de fonction. Pour étudier la fonction entrée dans le champ en haut du widget, cliquez sur « démarrer l'étude ». Les études de fonction de ce widget ne sont pas fiables à 100% mais servent de complément à une étude de fonction que l'on fait soi-même. Il se peut que cet outil soit amélioré dans une prochaine version du widget.
</p> </p>
<p> <p>
In this menu there are also tests the display. They can try different methods to display and see if they work on the browser used. Dans ce menu, on trouve également des tests d'affichage. Ils permettent d'essayer les différentes méthodes d'affichage et de voir si elles fonctionnent sur le navigateur internet utilisé.
</p> </p>
<h2 id="PlusieursFonctions">9. Drawing some functions</h2> <h2 id="PlusieursFonctions">9. Dessiner plusieurs fonctions</h2>
<p> <p>
To draw multiple functions simultaneously, click the small "+" button which is located to the right of "View" (point 1). Then, a menu appears. Pour dessiner plusieurs fonctions simultanément, cliquez sur le petit bouton « + » qui se situe à droite du bouton « Afficher » (point 1). Ensuite, un menu apparaît.
</p> </p>
<img src="Images/Guide_Plus.png"/> <img src="Images/Guide_Plus.png"/>
<p> <p>
The tabs in this menu can go to the history or the additional features (point 2). To add a function click the button to the right of the current function (point 3). Below is a list that contains all the displayed functions (point 4). To remove a function, just click on the "-" button next to it. It is also possible to change the color of each function separately. Dans ce menu, des onglets permettent d'aller à l'historique ou aux fonctions supplémentaires (point 2). Pour ajouter une fonction, cliquez sur le bouton à droite de la fonction actuelle (point 3). En dessous, une liste contient toutes les fonctions affichées (point 4). Pour supprimer une fonction, il faut simplement cliquer sur le bouton « - » à coté de celle-ci. Il est également possible de modifier la couleur de chaque fonction séparément.
</p> </p>
<p> <p>
History can review all the functions that have already been drawn. When you click on a function of history current function replaced by the function of history. L'historique permet de revoir toutes les fonctions qui ont déjà été dessinées. Lorsque l'on clique sur une fonction de l'historique, celle qui est dessinée actuellement est remplacée par la fonction de l'historique.
</p> </p>
<p> <p>
"Drawing several functions simultaneously" mode is only possible with the display method "canvas" in two dimensions, but the history can be used with all methods of display. Dessiner plusieurs fonctions simultanément est uniquement possible avec la méthode d'affichage « canvas » en deux dimensions. Par contre, l'historique est utilisable avec toutes les méthodes d'affichage.
</p> </p>
<h2 id="MaJ">10. GraphMe update</h2> <h2 id="MaJ">10. Mettre à jour GraphMe</h2>
<p> <p>
The latest version of the widget can be downloaded from the following page: <a href="http://gyb.educanet2.ch/tm-widgets/.ws_gen/?15">http://gyb.educanet2.ch/tm-widgets/.ws_gen/?15</a>. To update GraphMe, you can also click on "Update" in the options menu. La dernière version du widget est téléchargeable sur la page suivante : <a href="http://gyb.educanet2.ch/tm-widgets/.ws_gen/?15">http://gyb.educanet2.ch/tm-widgets/.ws_gen/?15</a>. Pour mettre à jour GraphMe, vous pouvez aussi cliquer sur le bouton "Mise à jour" dans le menu des options.
</p> </p>
<h2 id="Contact">11. Contact</h2> <h2 id="Contact">11. Contact</h2>
<p> <p>
If you want to report a bug, have a suggestion from the widget or just want to ask a question, please contact me by e-mail at: <a href="mailto:yannick.vessaz@gmail.com">yannick.vessaz@gmail.com</a>. Si vous voulez rapporter un bug, avez une suggestion par rapport au widget ou voulez simplement poser une question, merci de me contacter par e-mail à l'adresse : <a href="mailto:yannick.vessaz@gmail.com">yannick.vessaz@gmail.com</a>.
</p> </p>
</body> </body>
</html> </html>
\ No newline at end of file
var ctx
var centreX, centreY
var echelle3D = 50
var precisionDroite3D = 0.02
var precisionFonction3D = 0.2
var fonction3D = false
var angle = Math.PI/8
var valeurZoom3D = 1
var gauche3D = -6.5
var droite3D = 6.5
var outilPrecedent = ""
var rouge3D = 0
var vert3D = 1
var bleu3D = 2
var couleurGenerale = 0
function activer3D(){ var fonction3D = false;
if(fonction3D){ // Si activé alors on le désative var outilPrecedent = "";
fonction3D = false
choixOutil(outilPrecedent)
document.getElementById('onglet3D').innerHTML = "3D"
largeur = 500
document.getElementById("affichage").style.width = largeur+"px"
document.getElementById("affichage").style.left = "129px"
document.getElementById("flecheGauche").style.left = "137px"
document.getElementById("flecheHaut").style.left = "345px"
document.getElementById("flecheBas").style.left = "345px"
document.getElementById("gauche").style.display = "block"
document.getElementById("gauche3D").style.display = "none"
var elements = document.getElementsByClassName("menu")
for(var i=0; i<elements.length; i++){
elements[i].style.left = "121px"
}
reinitialiserZoom(5)
}
else{ // Sinon on l'active
fonction3D = true
outilPrecedent = outil
choixOutil("deplacement")
document.getElementById('onglet3D').innerHTML = "2D"
largeur = 570
document.getElementById("affichage").style.width = largeur+"px"
document.getElementById("affichage").style.left = "59px"
document.getElementById("flecheGauche").style.left = "67px"
document.getElementById("flecheHaut").style.left = "290px"
document.getElementById("flecheBas").style.left = "290px"
document.getElementById("gauche").style.display = "none"
document.getElementById("gauche3D").style.display = "block"
var elements = document.getElementsByClassName("menu")
for(var i=0; i<elements.length; i++){
elements[i].style.left = "61px"
}
initialise3D()
}
}
function initialise3D() {
centreX = largeur / 2
centreY = hauteur / 2
document.getElementById("affichage").innerHTML = '<canvas id="canvas" width="'+largeur+'" height="'+hauteur+'"></canvas>'
ctx = document.getElementById('canvas').getContext('2d')
ctx.clearRect(0, 0, 640, 480)
ctx.fillStyle = "rgba(0, 0, 0, 0.5)"
ctx.fillRect(0,0,640,480)
axes()
}
function dessiner3D(eq){ function activer3D(){
initialise3D() if(fonction3D){ // Si activé alors on le désative
if(document.getElementById("selectAffichage3D").value == "points"){ fonction3D = false;
var coordX, coordY, coordZ outil.choisir(outilPrecedent);
for(var x=gauche3D; x<droite3D; x+=precisionFonction3D){ document.getElementById('onglet3D').innerHTML = "3D";
for(var y=gauche3D; y<droite3D; y+=precisionFonction3D){ document.getElementById('zoomButtons').style.display = "block";
coordX = x document.getElementById('toolButtons').style.display = "block";
coordY = y affichage.init();
coordZ = eval(eq) outil.init();
if(isNaN(coordZ)){ affichage.initZoom2(document.getElementById('zoomDefaut').value);
continue }
} else{ // Sinon on l'active
point3D(coordX, coordY, coordZ) fonction3D = true;
} outilPrecedent = outil.actuel;
} outil.choisir("deplacement");
} document.getElementById('onglet3D').innerHTML = "2D";
else{ document.getElementById('zoomButtons').style.display = "none";
var x1, y1, z1, x2, y2, z2, x3, y3, z3 document.getElementById('toolButtons').style.display = "none";
var x, y display3D.init();
for(var x1=gauche3D; x1<droite3D; x1+=precisionFonction3D){ outil.liste = [];
for(var y1=gauche3D; y1<droite3D; y1+=precisionFonction3D){ outil.init();
x = x1 message.supprimer();
y = y1 }
z1 = eval(eq) cacherMenu();
x2 = x1 + precisionFonction3D if(fonction3D){
y2 = y1 if(document.getElementById('input3D').value == ""){
x = x2 afficherMenu('menuFonctions3D');
//y = y2 }
z2 = eval(eq) else{
x3 = x2 display3D.draw();
y3 = y2 + precisionFonction3D }
//x = x3 }
y = y3 saveOptions();
z3 = eval(eq)
x4 = x3 - precisionFonction3D
y4 = y3
x = x4
//y = y4
z4 = eval(eq)
if(isNaN(z1)||isNaN(z2)||isNaN(z3)||isNaN(z4)){
continue
}
polygone3D(x1, y1, z1, x2, y2, z2, x3, y3, z3, x4, y4, z4)
}
}
}
} }
// Dessine un point à la position (x, y, z) var display3D = {
function point3D(x, y, z){ canvas: null,
var posX = (Math.sin(angle)*x + Math.cos(angle)*y)*echelle3D ctx: null,
var posZ = -(z - Math.cos(angle)*x/2.6 + Math.sin(angle)*y/2.6)*echelle3D width: 0,
height: 0,
var opacity = Math.round((1-((5+y*Math.sin(angle)-x*Math.cos(angle)) / 450)*echelle3D)*1000)/1000 centerX: 0,
var couleur = new Array() centerY: 0,
couleur[0] = Math.round((5+z)*echelle3D) scale: 50,
couleur[1] = Math.round(510 - (5+z)*echelle3D) linePrecision: 0.02,
couleur[2] = couleurGenerale functionPrecision: 0.2,
if(opacity > 1){ angle: Math.PI/8,
opacity = 1 zoomValue: 1,
} left: -6.5,
if(opacity < 0){ right: 6.5,
opacity = 0 rouge3D: 0,
} vert3D: 1,
if(couleur[0] > 255){ bleu3D: 2,
couleur[0] = 255 couleurGenerale: 0,
} background: "rgba(0, 0, 0, 0.5)",
if(couleur[0] < 0){
couleur[0] = 0 init: function(width, height){
} var displayElement = document.getElementById("affichage");
if(couleur[1] > 255){
couleur[1] = 255 // Clear displayElement content
} if(displayElement.hasChildNodes()){
if(couleur[1] < 0){ while(displayElement.childNodes.length >= 1 ){
couleur[1] = 0 displayElement.removeChild(displayElement.firstChild);
} }
}
// Setup sizes
this.width = width || displayElement.clientWidth;
this.height = height || displayElement.clientHeight;
this.centerX = this.width / 2;
this.centerY = this.height / 2;
// Create canvas
this.canvas = document.createElement("canvas");
this.canvas.width = this.width;
this.canvas.height = this.height;
displayElement.appendChild(this.canvas);
this.ctx = this.canvas.getContext('2d');
this.clear();
},
clear: function(){
var ctx = this.ctx;
ctx.clearRect(0, 0, this.width, this.height);
ctx.fillStyle = this.background;
ctx.fillRect(0, 0, this.width, this.height);
this.axes();
},
draw: function(){
// var ti = new Date().getTime();
// this.init();
this.clear();
var txtFct = fct.remplacer(fct.verifier(document.getElementById("input3D").value));
if(txtFct == ""){
return;
}
var func = new CartesianFunction(txtFct);
if(document.getElementById("selectAffichage3D").value == "points"){
var coordX, coordY, coordZ;
for(var x=this.left; x<this.right; x+=this.functionPrecision){
for(var y=this.left; y<this.right; y+=this.functionPrecision){
coordX = x;
coordY = y;
coordZ = func.f(x,y);
if(isNaN(coordZ)){
continue;
}
this.point3D(coordX, coordY, coordZ);
}
}
}
else{
var x1, y1, z1, x2, y2, z2, x3, y3, z3;
var x, y;
var valAngle = Math.round(this.angle/Math.PI);
if(valAngle%2==0){
for(var x1=this.left; x1<this.right; x1+=this.functionPrecision){
for(var y1=this.left; y1<this.right; y1+=this.functionPrecision){
x = x1;
y = y1;
z1 = func.f(x,y);
x2 = x1 + this.functionPrecision;
y2 = y1;
x = x2;
//y = y2;
z2 = func.f(x,y);
x3 = x2;
y3 = y2 + this.functionPrecision;
//x = x3
y = y3;
z3 = func.f(x,y);
x4 = x3 - this.functionPrecision;
y4 = y3;
x = x4;
//y = y4;
z4 = func.f(x,y);
if(isNaN(z1)||isNaN(z2)||isNaN(z3)||isNaN(z4)){
continue;
}
this.polygone3D(x1, y1, z1, x2, y2, z2, x3, y3, z3, x4, y4, z4);
}
}
}
else{
for(var x1=this.right; x1>this.left; x1-=this.functionPrecision){
for(var y1=this.right; y1>this.left; y1-=this.functionPrecision){
x = x1;
y = y1;
z1 = func.f(x,y);
x2 = x1 - this.functionPrecision;
y2 = y1;
x = x2;
//y = y2;
z2 = func.f(x,y);
x3 = x2;
y3 = y2 - this.functionPrecision;
//x = x3;
y = y3;
z3 = func.f(x,y);
x4 = x3 + this.functionPrecision;
y4 = y3;
x = x4;
//y = y4;
z4 = func.f(x,y);
if(isNaN(z1)||isNaN(z2)||isNaN(z3)||isNaN(z4)){
continue;
}
this.polygone3D(x1, y1, z1, x2, y2, z2, x3, y3, z3, x4, y4, z4);
}
}
}
}
// var tf = new Date().getTime();
// window.console.log(tf-ti);
},
// Dessine un point à la position (x, y, z)
point3D: function(x, y, z){
var posX = (Math.sin(this.angle)*x + Math.cos(this.angle)*y)*this.scale;
var posZ = -(z - Math.cos(this.angle)*x/2.6 + Math.sin(this.angle)*y/2.6)*this.scale;
ctx.save() var opacity = Math.round((1-((5+y*Math.sin(this.angle)-x*Math.cos(this.angle)) / 450)*this.scale)*1000)/1000;
ctx.translate(centreX, centreY) var couleur = new Array();
ctx.scale(valeurZoom3D, valeurZoom3D) couleur[0] = Math.round((5+z)*this.scale);
ctx.fillStyle = "rgba("+couleur[rouge3D]+","+couleur[vert3D]+", "+couleur[bleu3D]+", "+opacity+")" couleur[1] = Math.round(510 - (5+z)*this.scale);
ctx.fillRect(posX-1, posZ-1, 2, 2) couleur[2] = this.couleurGenerale;
ctx.restore() if(opacity > 1){ opacity = 1; }
} if(opacity < 0){ opacity = 0; }
if(couleur[0] > 255){ couleur[0] = 255; }
// Dessine un polygone qui a comme sommets : (x1, y1, z1) , (x2, y2, z2), (x3, y3, z3) et (x4, y4, z4) if(couleur[0] < 0){ couleur[0] = 0; }
function polygone3D(x1, y1, z1, x2, y2, z2, x3, y3, z3, x4, y4, z4){ if(couleur[1] > 255){ couleur[1] = 255; }
ctx.save() if(couleur[1] < 0){ couleur[1] = 0; }
ctx.translate(centreX, centreY)
ctx.scale(valeurZoom3D, valeurZoom3D)
ctx.beginPath()
ctx.moveTo((Math.sin(angle)*x1 + Math.cos(angle)*y1)*echelle3D , -(z1 - Math.cos(angle)*x1/2.6 + Math.sin(angle)*y1/2.6)*echelle3D)
ctx.lineTo((Math.sin(angle)*x2 + Math.cos(angle)*y2)*echelle3D , -(z2 - Math.cos(angle)*x2/2.6 + Math.sin(angle)*y2/2.6)*echelle3D)
ctx.lineTo((Math.sin(angle)*x3 + Math.cos(angle)*y3)*echelle3D , -(z3 - Math.cos(angle)*x3/2.6 + Math.sin(angle)*y3/2.6)*echelle3D)
ctx.lineTo((Math.sin(angle)*x4 + Math.cos(angle)*y4)*echelle3D , -(z4 - Math.cos(angle)*x4/2.6 + Math.sin(angle)*y4/2.6)*echelle3D)
var opacity = Math.round((1-((5+y1*Math.sin(angle)-x1*Math.cos(angle)) / 450)*echelle3D)*1000)/1000 var ctx = this.ctx;
var couleur = new Array() ctx.save();
couleur[0] = Math.round((5+z1)*echelle3D) ctx.translate(this.centerX, this.centerY);
couleur[1] = Math.round(510 - (5+z1)*echelle3D) ctx.scale(this.zoomValue, this.zoomValue);
couleur[2] = couleurGenerale ctx.fillStyle = "rgba("+couleur[this.rouge3D]+","+couleur[this.vert3D]+", "+couleur[this.bleu3D]+", "+opacity+")";
if(opacity > 1){ ctx.fillRect(posX-1, posZ-1, 2, 2);
opacity = 1 ctx.restore();
} },
if(opacity < 0){
opacity = 0 // Dessine un polygone qui a comme sommets : (x1, y1, z1) , (x2, y2, z2), (x3, y3, z3) et (x4, y4, z4)
} polygone3D: function(x1, y1, z1, x2, y2, z2, x3, y3, z3, x4, y4, z4){
if(couleur[0] > 255){ var ctx = this.ctx;
couleur[0] = 255 ctx.save();
} ctx.translate(this.centerX, this.centerY);
if(couleur[0] < 0){ ctx.scale(this.zoomValue, this.zoomValue);
couleur[0] = 0 ctx.beginPath();
} ctx.moveTo((Math.sin(this.angle)*x1 + Math.cos(this.angle)*y1)*this.scale , -(z1 - Math.cos(this.angle)*x1/2.6 + Math.sin(this.angle)*y1/2.6)*this.scale);
if(couleur[1] > 255){ ctx.lineTo((Math.sin(this.angle)*x2 + Math.cos(this.angle)*y2)*this.scale , -(z2 - Math.cos(this.angle)*x2/2.6 + Math.sin(this.angle)*y2/2.6)*this.scale);
couleur[1] = 255 ctx.lineTo((Math.sin(this.angle)*x3 + Math.cos(this.angle)*y3)*this.scale , -(z3 - Math.cos(this.angle)*x3/2.6 + Math.sin(this.angle)*y3/2.6)*this.scale);
} ctx.lineTo((Math.sin(this.angle)*x4 + Math.cos(this.angle)*y4)*this.scale , -(z4 - Math.cos(this.angle)*x4/2.6 + Math.sin(this.angle)*y4/2.6)*this.scale);
if(couleur[1] < 0){
couleur[1] = 0
}
ctx.fillStyle = "rgba("+couleur[rouge3D]+","+couleur[vert3D]+", "+couleur[bleu3D]+", "+opacity+")" var opacity = Math.round((1-((5+y1*Math.sin(this.angle)-x1*Math.cos(this.angle)) / 450)*this.scale)*1000)/1000;
ctx.closePath() var couleur = new Array();
ctx.fill() couleur[0] = Math.round((5+z1)*this.scale);
ctx.restore() couleur[1] = Math.round(510 - (5+z1)*this.scale);
} couleur[2] = this.couleurGenerale;
if(opacity > 1){ opacity = 1; }
if(opacity < 0){ opacity = 0; }
// for(var i=0; i<couleur.length; i++){
// couleur[i] -= parseInt((opacity*255));
// }
if(couleur[0] > 255){ couleur[0] = 255; }
if(couleur[0] < 0){ couleur[0] = 0; }
if(couleur[1] > 255){ couleur[1] = 255; }
if(couleur[1] < 0){ couleur[1] = 0; }
// Dessine les axes ctx.fillStyle = "rgba("+couleur[this.rouge3D]+","+couleur[this.vert3D]+", "+couleur[this.bleu3D]+", "+opacity+")";
function axes(){ ctx.strokeStyle = "rgba(0,0,0,0.1)";
for(var i=-5; i<5; i+=precisionDroite3D){ ctx.closePath();
point3D(0, 0, i) ctx.fill();
} ctx.stroke();
for(var i=-5.5; i<5.5; i+=precisionDroite3D){ ctx.restore();
point3D(i, 0, 0) },
}
for(var i=-5.5; i<5.5; i+=precisionDroite3D){
point3D(0, i, 0)
}
}
function cube(x, y, z, r){ // Dessine les axes
// Face de devant axes: function(){
for(var i=0; i<r; i+=precisionDroite3D){ for(var i=-5; i<5; i+=this.linePrecision){
point3D(x+i, y, z) this.point3D(0, 0, i);
} }
for(var i=0; i<r; i+=precisionDroite3D){ for(var i=-5.5; i<5.5; i+=this.linePrecision){
point3D(x+r, y+i, z) this.point3D(i, 0, 0);
} }
for(var i=0; i<r; i+=precisionDroite3D){ for(var i=-5.5; i<5.5; i+=this.linePrecision){
point3D(x+r-i, y+r, z) this.point3D(0, i, 0);
} }
for(var i=0; i<r; i+=precisionDroite3D){ },
point3D(x, y+r-i, z)
}
// Face de derrière
for(var i=0; i<r; i+=precisionDroite3D){
point3D(x+i, y, z+r)
}
for(var i=0; i<r; i+=precisionDroite3D){
point3D(x+r, y+i, z+r)
}
for(var i=0; i<r; i+=precisionDroite3D){
point3D(x+r-i, y+r, z+r)
}
for(var i=0; i<r; i+=precisionDroite3D){
point3D(x, y+r-i, z+r)
}
// Arrêtes
for(var i=0; i<r; i+=precisionDroite3D){
point3D(x, y, z+i)
}
for(var i=0; i<r; i+=precisionDroite3D){
point3D(x, y+r, z+i)
}
for(var i=0; i<r; i+=precisionDroite3D){
point3D(x+r, y, z+i)
}
for(var i=0; i<r; i+=precisionDroite3D){
point3D(x+r, y+r, z+i)
}
}
// Change les couleurs de l'affichage 3D et affiche l'aperçu de celles-ci. cube: function(x, y, z, r){
function checkCouleurs3D(){ // Face de devant
var rouge, vert, bleu for(var i=0; i<r; i+=this.linePrecision){
var sensRouge, sensVert, sensBleu this.point3D(x+i, y, z);
var precisionApercu = 64 }
couleurGenerale = parseInt(document.getElementById("couleur3Dgenerale").value) for(var i=0; i<r; i+=this.linePrecision){
if(!couleurGenerale){ this.point3D(x+r, y+i, z);
couleurGenerale = 0 }
} for(var i=0; i<r; i+=this.linePrecision){
if(couleurGenerale < 0){ this.point3D(x+r-i, y+r, z);
couleurGenerale = 0 }
} for(var i=0; i<r; i+=this.linePrecision){
if(couleurGenerale > 255){ this.point3D(x, y+r-i, z);
couleurGenerale = 255 }
} // Face de derrière
switch(document.getElementById("selectRouge3D").value){ for(var i=0; i<r; i+=this.linePrecision){
case "plus": this.point3D(x+i, y, z+r);
rouge3D = 0 }
rouge = 255 for(var i=0; i<r; i+=this.linePrecision){
sensRouge = -1 this.point3D(x+r, y+i, z+r);
break }
case "moins": for(var i=0; i<r; i+=this.linePrecision){
rouge3D = 1 this.point3D(x+r-i, y+r, z+r);
rouge = 0 }
sensRouge = 1 for(var i=0; i<r; i+=this.linePrecision){
break this.point3D(x, y+r-i, z+r);
case "tout": }
rouge3D = 2 // Arrêtes
rouge = couleurGenerale for(var i=0; i<r; i+=this.linePrecision){
sensRouge = 0 this.point3D(x, y, z+i);
break }
} for(var i=0; i<r; i+=this.linePrecision){
switch(document.getElementById("selectVert3D").value){ this.point3D(x, y+r, z+i);
case "plus": }
vert3D = 0 for(var i=0; i<r; i+=this.linePrecision){
vert = 255 this.point3D(x+r, y, z+i);
sensVert = -1 }
break for(var i=0; i<r; i+=this.linePrecision){
case "moins": this.point3D(x+r, y+r, z+i);
vert3D = 1 }
vert = 0 },
sensVert = 1
break // Change les couleurs de l'affichage 3D et affiche l'aperçu de celles-ci.
case "tout": checkCouleurs3D: function(){
vert3D = 2 var rouge, vert, bleu;
vert = couleurGenerale var sensRouge, sensVert, sensBleu;
sensVert = 0 var precisionApercu = 64;
break this.couleurGenerale = parseInt(document.getElementById("couleur3Dgenerale").value);
} if(!this.couleurGenerale){
switch(document.getElementById("selectBleu3D").value){ this.couleurGenerale = 0;
case "plus": }
bleu3D = 0 if(this.couleurGenerale < 0){
bleu = 255 this.couleurGenerale = 0;
sensBleu = -1 }
break if(this.couleurGenerale > 255){
case "moins": this.couleurGenerale = 255;
bleu3D = 1 }
bleu = 0 switch(document.getElementById("selectRouge3D").value){
sensBleu = 1 case "plus":
break this.rouge3D = 0;
case "tout": rouge = 255;
bleu3D = 2 sensRouge = -1;
bleu = couleurGenerale break;
sensBleu = 0 case "moins":
break this.rouge3D = 1;
} rouge = 0;
document.getElementById("apercuCouleur3D").innerHTML = "<span style='background-color:rgba("+rouge+","+vert+","+bleu+",1);color:rgba(0,0,0,0);'>.</span>" sensRouge = 1;
for(var i=0; i<precisionApercu; i++){ break;
rouge = rouge + sensRouge*(256/precisionApercu) case "tout":
vert = vert + sensVert*(256/precisionApercu) this.rouge3D = 2;
bleu = bleu + sensBleu*(256/precisionApercu) rouge = this.couleurGenerale;
document.getElementById("apercuCouleur3D").innerHTML = document.getElementById("apercuCouleur3D").innerHTML + "<span style='background-color:rgba("+rouge+","+vert+","+bleu+",1);color:rgba(0,0,0,0);'>.</span>" sensRouge = 0;
} break;
} }
switch(document.getElementById("selectVert3D").value){
case "plus":
this.vert3D = 0;
vert = 255;
sensVert = -1;
break;
case "moins":
this.vert3D = 1;
vert = 0;
sensVert = 1;
break;
case "tout":
this.vert3D = 2;
vert = this.couleurGenerale;
sensVert = 0;
break;
}
switch(document.getElementById("selectBleu3D").value){
case "plus":
this.bleu3D = 0;
bleu = 255;
sensBleu = -1;
break;
case "moins":
this.bleu3D = 1;
bleu = 0;
sensBleu = 1;
break;
case "tout":
this.bleu3D = 2;
bleu = this.couleurGenerale;
sensBleu = 0;
break;
}
document.getElementById("apercuCouleur3D").innerHTML = "<span style='background-color:rgba("+rouge+","+vert+","+bleu+",1);color:rgba(0,0,0,0);'>.</span>";
for(var i=0; i<precisionApercu; i++){
rouge = rouge + sensRouge*(256/precisionApercu);
vert = vert + sensVert*(256/precisionApercu);
bleu = bleu + sensBleu*(256/precisionApercu);
document.getElementById("apercuCouleur3D").innerHTML = document.getElementById("apercuCouleur3D").innerHTML + "<span style='background-color:rgba("+rouge+","+vert+","+bleu+",1);color:rgba(0,0,0,0);'>.</span>";
}
if(this.ctx){
this.draw();
}
},
zoom: function(value){
if(!fonction3D){
return;
}
this.zoomValue *= value;
this.left /= value;
this.right /= value;
this.functionPrecision /= value;
this.linePrecision /= value;
//alert(this.zoomValue+" ; "+this.left+" ; "+this.right+" ; "+this.functionPrecision+" ; "+this.linePrecision);
this.draw();
},
move: function(value){
this.angle += Math.PI/32 * value;
this.draw();
},
initZoom: function(){
this.angle = Math.PI/8;
this.zoomValue = 1;
this.left = -6.5;
this.right = 6.5;
this.draw();
}
};
function zoom3D(valeur){
valeurZoom3D *= valeur
gauche3D /= valeur
droite3D /= valeur
precisionFonction3D /= valeur
precisionDroite3D /= valeur
//alert(valeurZoom3D+" ; "+gauche3D+" ; "+droite3D+" ; "+precisionFonction3D+" ; "+precisionDroite3D)
actualiserGraph()
}
\ No newline at end of file
// ------------------ SVG et canvas ------------------
// Cette fonction calcule tous les points de la fonction mathématique.
// Elle place chaque coordonnée "x" et "y" dans les tableaux "pointX" et "pointY"
// A la fin, elle choisi la méthode d'affichage entre :
// 1) une seule image SVG
// 2) plusieurs images SVG
function evaluerSVG(eq) {
borneXGauche = parseFloat(document.getElementById("borneXGauche").value)
borneXDroite = parseFloat(document.getElementById("borneXDroite").value)
borneYGauche = parseFloat(document.getElementById("borneYGauche").value)
borneYDroite = parseFloat(document.getElementById("borneYDroite").value)
multiplicateurX = largeur/Math.abs(borneXDroite - borneXGauche)
multiplicateurY = hauteur/Math.abs(borneYDroite - borneYGauche)
lineWidth = document.getElementById("inputTaille").value
var i = 0
var y1, p1
for(x=borneXGauche; x<=(borneXDroite+5*precision); x=x+precision){
y = eval(eq)
if(!isNaN(y)){
i++
pointX[i] = (x - borneXGauche) * multiplicateurX
pointY[i] = hauteur - ((y - borneYGauche) * multiplicateurY)
pente[i] = hauteur - (((y-y1)/precision - borneYGauche)* multiplicateurY)
pente2[i] = hauteur - ((((y-y1)/precision-p1)/precision - borneYGauche)* multiplicateurY)
p1 = (y-y1)/precision
y1 = y
}
}
pente[1]=pente[2]
pente2[2]=pente2[3]
pente2[1]=pente2[2]
//alert(pointX+'\n'+pointY)
if(document.getElementById("selectMethodeAffichage").value == "svg2"){
calculerGraphSVG2(i)
}
else{
calculerGraphSVG(i)
}
}
// Même fonction mais pour dessiner à l'aide de canvas
function evaluerCanvas(eq) {
borneXGauche = parseFloat(document.getElementById("borneXGauche").value)
borneXDroite = parseFloat(document.getElementById("borneXDroite").value)
borneYGauche = parseFloat(document.getElementById("borneYGauche").value)
borneYDroite = parseFloat(document.getElementById("borneYDroite").value)
multiplicateurX = largeur/Math.abs(borneXDroite - borneXGauche)
multiplicateurY = hauteur/Math.abs(borneYDroite - borneYGauche)
lineWidth = document.getElementById("inputTaille").value
var i = 0
var y1, p1
for(x=borneXGauche; x<=(borneXDroite+5*precision); x=x+precision){
y = eval(eq)
i++
if(!isNaN(y)){
pointX[i] = (x - borneXGauche) * multiplicateurX
pointY[i] = hauteur - ((y - borneYGauche) * multiplicateurY)
pente[i] = hauteur - (((y-y1)/precision - borneYGauche)* multiplicateurY)
pente2[i] = hauteur - ((((y-y1)/precision-p1)/precision - borneYGauche)* multiplicateurY)
p1 = (y-y1)/precision
y1 = y
}
else{
pointX[i] = "undefined"
pointY[i] = "undefined"
pente[i] = "undefined"
pente2[i] = "undefined"
}
}
pente[1]=pente[2]
pente2[2]=pente2[3]
pente2[1]=pente2[2]
calculerGraphCanevas(i)
}
// ---- SVG (une image) ----
// Génère le code HTML qui permet d'afficher le graphique et le place dans la div "affichage"
function calculerGraphSVG2(fin){
image = ""
for (i=1; i<fin; i++){
image = image + '<line x1="'+pointX[i]+'" y1="'+pointY[i]+'" x2="'+pointX[i+1]+'" y2="'+pointY[i+1]+'" style="stroke:'+couleurFonction+';stroke-width:2;"/>'
}
graphique = '<line x1="'+(-borneXGauche*multiplicateurX)+'" y1="'+0+'" x2="'+(-borneXGauche*multiplicateurX)+'" y2="'+hauteur+'" style="stroke:rgb(0,0,0);stroke-width:2;opacity:0.3;"/>'
graphique = graphique + '<line x1="'+0+'" y1="'+(hauteur-(-borneYGauche*multiplicateurY))+'" x2="'+largeur+'" y2="'+(hauteur-(-borneYGauche*multiplicateurY))+'" style="stroke:rgb(0,0,0);stroke-width:2;opacity:0.3;"/>'
image = '<svg width="100%" height="100%" version="1.1" xmlns="http://www.w3.org/2000/svg">'+image+graphique+'</svg> '
document.getElementById("affichage").innerHTML = image
//alert(image)
}
// ---- SVG (images multiples) ----
// Créé les différents éléments pour dessiner la fonction mathématique
// et les place dans la div "affichage"
function calculerGraphSVG(fin){
document.getElementById("affichage").innerHTML = ""
svg = document.createElementNS("http://www.w3.org/2000/svg", "svg")
svg.setAttribute("width", "100%")
svg.setAttribute("height", "100%")
for (i=1; i<fin; i++){
if ((pointY[i]<0) && (pointY[i+1]>hauteur)){
i++
}
if ((pointY[i]>hauteur) && (pointY[i+1]<0)){
i++
}
var ligne = document.createElementNS("http://www.w3.org/2000/svg", "line")
ligne.setAttribute("x1", pointX[i]+decalageX)
ligne.setAttribute("x2", pointX[i+1]+decalageX)
ligne.setAttribute("y1", pointY[i]+decalageY)
ligne.setAttribute("y2", pointY[i+1]+decalageY)
ligne.setAttribute("stroke", couleurFonction)
ligne.setAttribute("stroke-width", lineWidth)
svg.appendChild(ligne)
}
// dérivée
if(document.getElementById("checkDerivee").checked){
for (i=1; i<fin; i++){
var ligne = document.createElementNS("http://www.w3.org/2000/svg", "line")
ligne.setAttribute("x1", pointX[i]+decalageX)
ligne.setAttribute("x2", pointX[i+1]+decalageX)
ligne.setAttribute("y1", pente[i]+decalageY)
ligne.setAttribute("y2", pente[i+1]+decalageY)
ligne.setAttribute("stroke", "white")
ligne.setAttribute("stroke-width", lineWidth)
ligne.setAttribute("opacity", "0.8")
svg.appendChild(ligne)
}
}
if(document.getElementById("checkAxes").checked){
calculerAxes()
}
calculerGrilleEchelle()
document.getElementById("affichage").appendChild(svg)
}
// axes
function calculerAxes(){
var ligne = document.createElementNS("http://www.w3.org/2000/svg", "line")
ligne.setAttribute("x1", (-borneXGauche*multiplicateurX)+decalageX)
ligne.setAttribute("y1", 0+decalageY)
ligne.setAttribute("x2", (-borneXGauche*multiplicateurX)+decalageX)
ligne.setAttribute("y2", hauteur+decalageY)
ligne.setAttribute("stroke", "rgb(0,0,0)")
ligne.setAttribute("stroke-width", "2")
ligne.setAttribute("opacity", "0.3")
svg.appendChild(ligne)
var ligne = document.createElementNS("http://www.w3.org/2000/svg", "line")
ligne.setAttribute("x1", 0+decalageX)
ligne.setAttribute("y1", (hauteur-(-borneYGauche*multiplicateurY))+decalageY)
ligne.setAttribute("x2", largeur+decalageX)
ligne.setAttribute("y2", (hauteur-(-borneYGauche*multiplicateurY))+decalageY)
ligne.setAttribute("stroke", "rgb(0,0,0)")
ligne.setAttribute("stroke-width", "2")
ligne.setAttribute("opacity", "0.3")
svg.appendChild(ligne)
}
// grille et échelle
function calculerGrilleEchelle(){
var intervalX = Math.round(Math.abs(borneXGauche-borneXDroite)/10)
var intervalY = Math.round(Math.abs(borneYGauche-borneYDroite)/10)
var initialX = Math.round(-borneXGauche) % intervalX
var initialY = Math.round(-borneYGauche) % intervalY
for(var i=initialX;i<=Math.round(borneXDroite-borneXGauche);i=i+intervalX){
var position = Math.round((Math.round(borneXGauche) - borneXGauche +i) * multiplicateurX)
if(document.getElementById("checkGrille").checked){
var grille = document.createElementNS("http://www.w3.org/2000/svg", "line")
grille.setAttribute("x1", position)
grille.setAttribute("y1", 0)
grille.setAttribute("x2", position)
grille.setAttribute("y2", hauteur)
grille.setAttribute("stroke", "rgb(0,0,0)")
grille.setAttribute("stroke-width", "2")
grille.setAttribute("opacity", "0.05")
svg.appendChild(grille)
}
if(document.getElementById("checkEchelle").checked){
var txt = document.createElementNS("http://www.w3.org/2000/svg", "text")
txt.appendChild(document.createTextNode(i+borneXGauche))
txt.setAttribute("x", position-6)
txt.setAttribute("y", (hauteur-(-borneYGauche*multiplicateurY))+decalageY-2)
txt.setAttribute("fill-opacity", 0.6)
txt.setAttribute("fill", couleurEchelle)
svg.appendChild(txt)
}
}
for(var i=initialY;i<=Math.round(borneYDroite-borneYGauche);i=i+intervalY){
var position = hauteur - Math.round((Math.round(borneYGauche) - borneYGauche +i) * multiplicateurY)
if(document.getElementById("checkGrille").checked){
var grille = document.createElementNS("http://www.w3.org/2000/svg", "line")
grille.setAttribute("x1", 0)
grille.setAttribute("y1", position)
grille.setAttribute("x2", largeur)
grille.setAttribute("y2", position)
grille.setAttribute("stroke", "rgb(0,0,0)")
grille.setAttribute("stroke-width", "2")
grille.setAttribute("opacity", "0.05")
svg.appendChild(grille)
}
if(document.getElementById("checkEchelle").checked){
var txt = document.createElementNS("http://www.w3.org/2000/svg", "text")
txt.appendChild(document.createTextNode(i+borneYGauche))
txt.setAttribute("x", (-borneXGauche*multiplicateurX)+decalageX+2)
txt.setAttribute("y", position+6)
txt.setAttribute("fill-opacity", 0.6)
txt.setAttribute("fill", couleurEchelle)
svg.appendChild(txt)
}
}
}
// ---- Canevas ----
// Permet de générer le code HTML nécessaire à canvas et dessine la fonction
// à l'aide de lignes dans la zone de canvas.
function calculerGraphCanevas(fin){
document.getElementById("affichage").innerHTML = '<canvas id="canvas" width="'+largeur+'" height="'+hauteur+'"></canvas>'
ctx = document.getElementById('canvas').getContext('2d')
var undefined = true
// Autres fonctions
for(var i=0; i<listeFonctions.length; i++){
ctx.beginPath()
x = borneXGauche-3*precision
y = eval(listeFonctions[i])
if(isNaN(y)){
ctx.moveTo(x, 0)
}
else{
ctx.moveTo(x, y)
}
ctx.strokeStyle = listeCouleurs[i]
ctx.fillStyle = listeCouleurs[i]
ctx.lineWidth = lineWidth
for(x=borneXGauche-2*precision; x<=(borneXDroite+2*precision); x+=precision){
y = eval(listeFonctions[i])
if(!isNaN(y)){
ctx.lineTo((x - borneXGauche) * multiplicateurX+decalageX, hauteur - ((y - borneYGauche) * multiplicateurY)+decalageY)
/*pente[i] = hauteur - ((10*(y-y1) - borneYGauche) * multiplicateurY)*/
}
}
ctx.stroke()
}
// aire sous la fonctions
if(document.getElementById("checkAire").checked){
ctx.strokeStyle = "rgba(255,255,255,0)";
ctx.fillStyle = "rgba(0,180,255,0.3)";
var a = parseInt(document.getElementById("aireG").value);
var b = parseInt(document.getElementById("aireD").value);
var fct = document.getElementById("inputEq").value;
var f = function(x){
return eval(fct);
};
var convertX = function(nbr){
return (nbr - borneXGauche) * multiplicateurX;
};
var convertY = function(nbr){
return hauteur - ((nbr - borneYGauche) * multiplicateurY)
};
var n = 5000/(borneXDroite-borneXGauche);
var aire, largeurRect, gaucheRect, droiteRect, millieuRect, hauteurRect, aireRect;
aire = 0;
largeurRect = (b-a)/n;
for(var i=0; i<n; i++){
gaucheRect = a + i*largeurRect;
droiteRect = a + (i+1)*largeurRect;
millieuRect = (gaucheRect+droiteRect) / 2;
hauteurRect = f(millieuRect);
//aireRect = largeurRect * hauteurRect;
//aire = aire + aireRect;
try{
ctx.fillRect(convertX(gaucheRect), convertY(hauteurRect), 2, hauteurRect*multiplicateurY);
}
catch(err){
}
}
}
// fonction
ctx.beginPath()
//ctx.moveTo(pointX[1]+decalageX, pointY[1]+decalageY)
ctx.strokeStyle = couleurFonction
ctx.fillStyle = couleurFonction
ctx.lineWidth = lineWidth
if(document.getElementById("selectMethodeAffichage").value == "canvas"){
for (i=1; i<fin; i++){
if(isNaN(pointX[i]) || isNaN(pointY[i])){
undefined = true
}
else{
if(undefined){
ctx.moveTo(pointX[i]+decalageX, pointY[i]+decalageY)
}
undefined = false
ctx.lineTo(pointX[i]+decalageX, pointY[i]+decalageY)
}
}
ctx.stroke()
}
else{
for (i=1; i<fin; i++){
if(!isNaN(pointX[i]) && !isNaN(pointY[i])){
ctx.moveTo(pointX[i]+decalageX, pointY[i]+decalageY)
ctx.arc(pointX[i]+decalageX, pointY[i]+decalageY, lineWidth/2, 0, 2*Math.PI, false)
}
}
ctx.fill()
//ctx.stroke()
}
// dérivée première
if(document.getElementById("checkDerivee").checked){
undefined = true
ctx.beginPath()
ctx.strokeStyle = "rgba(255, 255, 255, 0.8)"
ctx.fillStyle = "rgba(255, 255, 255, 0.8)"
ctx.lineWidth = lineWidth
//ctx.moveTo(pointX[1]+decalageX, pente[1]+decalageY)
for (i=1; i<fin; i++){
if(isNaN(pointX[i]) || isNaN(pente[i])){
undefined = true
}
else{
if(undefined){
try{
ctx.moveTo(pointX[i]+decalageX, pente[i]+decalageY)
}
catch(err){
//alert(";"+pente[i]+" ; "+pointX[i])
}
}
undefined = false
try{
ctx.lineTo(pointX[i]+decalageX, pente[i]+decalageY)
}
catch(err){
//alert(pente[i]+" ; "+pointX[i])
}
}
}
ctx.stroke()
}
// dérivée seconde
if(document.getElementById("checkDerivee2").checked){
undefined = true
ctx.beginPath()
ctx.strokeStyle = "rgba(150, 150, 150, 0.8)"
ctx.fillStyle = "rgba(150, 150, 150, 0.8)"
ctx.lineWidth = lineWidth
//ctx.moveTo(pointX[1]+decalageX, pente2[1]+decalageY)
for (i=1; i<fin-1; i++){
if(isNaN(pointX[i]) || isNaN(pente2[i])){
undefined = true
}
else{
if(undefined){
try{
ctx.moveTo(pointX[i+2]+decalageX, pente2[i+2]+decalageY)
}
catch(err){
}
}
undefined = false
try{
ctx.lineTo(pointX[i+2]+decalageX, pente2[i+2]+decalageY)
}
catch(err){
}
}
}
ctx.stroke()
}
// grille et échelle
var intervalX = Math.round(Math.abs(borneXGauche-borneXDroite)/10)
var intervalY = Math.round(Math.abs(borneYGauche-borneYDroite)/10)
var initialX = Math.round(-borneXGauche) % intervalX
var initialY = Math.round(-borneYGauche) % intervalY
ctx.beginPath()
ctx.fillStyle = couleurEchelle
ctx.lineWidth = "2"
for(var i=initialX;i<=Math.round(borneXDroite-borneXGauche);i=i+intervalX){
var position = Math.round((Math.round(borneXGauche) - borneXGauche +i) * multiplicateurX)
if(document.getElementById("checkGrille").checked){
ctx.moveTo(position, 0)
ctx.lineTo(position, hauteur)
}
if(document.getElementById("checkEchelle").checked){
ctx.fillText(Math.ceil(i+borneXGauche), position-6, (hauteur-(-borneYGauche*multiplicateurY))+decalageY-2)
}
}
for(var i=initialY;i<=Math.round(borneYDroite-borneYGauche);i=i+intervalY){
var position = hauteur - Math.round((Math.round(borneYGauche) - borneYGauche +i) * multiplicateurY)
if(document.getElementById("checkGrille").checked){
ctx.moveTo(0, position)
ctx.lineTo(largeur, position)
}
if(document.getElementById("checkEchelle").checked){
ctx.fillText(Math.ceil(i+borneYGauche), (-borneXGauche*multiplicateurX)+decalageX+2, position+6)
}
}
ctx.strokeStyle = couleurGrille
ctx.stroke()
// axes
if(document.getElementById("checkAxes").checked){
ctx.beginPath()
ctx.strokeStyle = couleurAxes
ctx.lineWidth = "2"
ctx.moveTo((-borneXGauche*multiplicateurX)+decalageX, 0+decalageY)
ctx.lineTo((-borneXGauche*multiplicateurX)+decalageX, hauteur+decalageY)
ctx.moveTo(0+decalageX, (hauteur-(-borneYGauche*multiplicateurY))+decalageY)
ctx.lineTo(largeur+decalageX, (hauteur-(-borneYGauche*multiplicateurY))+decalageY)
ctx.stroke()
}
}
// -------------------- sankore -------------------- // -------------------- Uniboard --------------------
// Ces fonctions permettent de dessiner le graphique directement dans sankore. // Ces fonctions permettent de dessiner le graphique directement dans Uniboard.
// Calcule tous les points de la fonction mathématique et les place dans des tableaux. function colorToHex(color) {
function evaluerUniboard(eq) { var addZero = function(myString){
largeur += 100 if (myString.length == 1) return "0" + myString;
hauteur += 100 else return myString;
decalageX -= 250
decalageY -= 200
borneXGauche = parseFloat(document.getElementById("borneXGauche").value)
borneXDroite = parseFloat(document.getElementById("borneXDroite").value)
borneYGauche = parseFloat(document.getElementById("borneYGauche").value)
borneYDroite = parseFloat(document.getElementById("borneYDroite").value)
multiplicateurX = (largeur)/Math.abs(borneXDroite - borneXGauche)
multiplicateurY = (hauteur)/Math.abs(borneYDroite - borneYGauche)
lineWidth = document.getElementById("inputTaille").value
var i = 0
BoucleFor: for(x=borneXGauche; x<=(borneXDroite+0); x=x+precision){
i++
y = eval(eq)
pointX[i] = Math.round((x - borneXGauche) * multiplicateurX)
pointY[i] = hauteur - Math.round((y - borneYGauche) * multiplicateurY)
}
calculerGraphUniboard(i)
} }
var digits = /(.*?)rgb\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)/.exec(color);
if (digits == null){
digits = /(.*?)rgba\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)/.exec(color);
}
if(digits == null){
return "";
}
var red = parseInt(digits[2]);
var green = parseInt(digits[3]);
var blue = parseInt(digits[4]);
var hexcode = addZero(red.toString(16)) + addZero(green.toString(16)) + addZero(blue.toString(16));
return '#' + hexcode.toUpperCase();
}
// Regarde chaque coordonnées stockées dans le tableau et dessine le graphique function initUniboard(){
function calculerGraphUniboard(fin){ if(!window.uniboard && window.sankore){
document.getElementById("affichage").innerHTML = "" uniboard = sankore;
sankore.setTool('pen')
sankore.moveTo(pointX[2]+decalageX, pointY[2]+decalageY)
for (i=3; i<fin; i++){
if ((pointY[i]<0) || (pointY[i]>hauteur)){
sankore.moveTo(pointX[i+1]+decalageX,pointY[i+1]+decalageY)
continue
}
sankore.drawLineTo(pointX[i]+decalageX, pointY[i]+decalageY, lineWidth)
}
//dessiner le cadre
sankore.moveTo(0+decalageX,0+decalageY)
sankore.drawLineTo(largeur+decalageX, 0+decalageY, lineWidth)
sankore.drawLineTo(largeur+decalageX, hauteur+decalageY, lineWidth)
sankore.drawLineTo(0+decalageX, hauteur+decalageY, lineWidth)
sankore.drawLineTo(0+decalageX, 0+decalageY, lineWidth)
//dessiner les axes
sankore.moveTo((-borneXGauche*multiplicateurX)+decalageX, 0+decalageY)
sankore.drawLineTo((-borneXGauche*multiplicateurX)+decalageX, hauteur+decalageY, lineWidth)
sankore.moveTo(0+decalageX, (hauteur-(-borneYGauche*multiplicateurY))+decalageY)
sankore.drawLineTo(largeur+decalageX, (hauteur-(-borneYGauche*multiplicateurY))+decalageY, lineWidth)
decalageX += 250
decalageY += 200
largeur -= 100
hauteur -= 100
sankore.setTool('arrow')
} }
uniboard.centerOn(337,245);
\ No newline at end of file // uniboard.setTool("pen");
// Paramètres par défaut
uniboard.lineWidth = 1;
uniboard.fillStyle = "black";
uniboard.strokeStyle = "black";
// Position du curseur pour écrire des nombres
uniboard.cursorX = 0;
uniboard.cursorY = 0;
// Fonctions
uniboard.strokeColor = function(){
this.setPenColor(colorToHex(this.strokeStyle));
};
uniboard.fillColor = function(){
this.setPenColor(colorToHex(this.fillStyle));
};
uniboard.lineTo = function(x, y){
if(y>-20 && y<affichage.hauteur+20){
this.strokeColor();
this.drawLineTo(x, y, this.lineWidth/2);
}
};
uniboard.arc = function(x, y, r){
this.fillColor();
this.moveTo(x, y);
this.drawLineTo(x, y, r*2);
};
uniboard.clearRect = function(x, y, width, height){
if(height<0){
height = Math.abs(height);
y -= height;
}
if(width<0){
width = Math.abs(width);
x -= width;
}
this.moveTo(x, y)
this.eraseLineTo(x+width, y+height, this.lineWidth);
};
uniboard.fillRect = function(x, y, width, height){
this.fillColor();
if(height<0){
height = Math.abs(height);
y -= height;
}
if(width<0){
width = Math.abs(width);
x -= width;
}
this.moveTo(x, y)
this.drawLineTo(x+width, y+height, this.lineWidth);
};
uniboard.fillText = function(txt, x, y){
// TODO
this.fillNumber(txt, x, y);
};
uniboard.beginPath = function(){
this.moveTo(0, 0);
};
uniboard.fill = function(){};
uniboard.stroke = function(){};
uniboard.fillNumber = function(nbr, x, y){
var w = 5;
var number = "" + nbr;
if(!x || !y){
x = this.cursorX;
y = this.cursorY;
}
else{
x += 3;
y -= 12;
}
this.moveTo(x, y);
this.fillColor();
var move = function(){
uniboard.moveTo(x, y);
};
var draw = function(){
uniboard.drawLineTo(x, y, uniboard.lineWidth)
};
var space = function(){
x += 2*w/3;
move();
};
for(var i=0; i<number.length; i++){
switch(number.charAt(i)){
case "1":
y += w
move()
x += w
y -= w
draw()
y += 2*w
draw()
y -= 2*w
space()
break;
case "2":
x += w
draw()
y += w
draw()
x -= w
draw()
y += w
draw()
x += w
draw()
y -= 2*w
space()
break;
case "3":
x += w
draw()
y += w
draw()
x -= w
draw()
x += w
move()
y += w
draw()
x -= w
draw()
y -= 2*w
x += w
space()
break;
case "4":
y += w
draw()
x += w
draw()
y -= w
draw()
y += w
move()
y += w
draw()
y -= 2*w
space()
break;
case "5":
x += w
move()
x -= w
draw()
y += w
draw()
x += w
draw()
y += w
draw()
x -= w
draw()
x += w
y -= 2*w
space()
break;
case "6":
x += w
move()
x -= w
draw()
y += w
draw()
x += w
draw()
y += w
draw()
x -= w
draw()
y -= w
draw()
x += w
y -= w
space()
break;
case "7":
x += w
draw()
x -= w/2
y += 2*w
draw()
x += w/2
y -= 2*w
space()
break;
case "8":
x += w
draw()
y += 2*w
draw()
x -= w
draw()
y -= 2*w
draw()
y += w
move()
x += w
draw()
y -= w
move()
space()
break;
case "9":
x += w
move()
x -= w
draw()
y += w
draw()
x += w
draw()
y += w
draw()
x -= w
draw()
y -= w
x += w
move()
y -= w
draw()
space()
break;
case "0":
x += w
draw()
y += 2*w
draw()
x -= w
draw()
y -= 2*w
draw()
x += w
move()
space()
break;
case "-":
y += w
move()
x += w
draw()
y -= w
move()
space()
break;
default: // Nombre inconnu
// this.showMessage("Error : "+number.charAt(i)+" isn't a number");
}
}
this.cursorX = x;
this.cursorY = y;
// this.showMessage(number);
}
}
// -------------------- XPM --------------------
// Diverses fonctions permettant de dessiner la fonction mathématique à
// l'aide d'une image au format XPM
// Permet de calculer tous les points de l'image et de les placer dans un tableau.
// Chaque "case" du tableau est un point de l'image.
// Plus tard, chaque pixel de l'image correspondra a une case du tableau.
// Le pixel sera blanc si la "case" vaut 0 et sera noir si la "case" vaut 1
function evaluerXPM(eq){
tableauUni(0)
var y = 0
BoucleFor: for (x=0; x<largeur; x++){
y = Math.round(eval(eq))
if (y>hauteur-1){ break BoucleFor }
tableau[y][x] = 1
}
tableau.reverse()
graphique = ""
calculerGraphXPM()
}
// Permet de remplir le tableau avec uniquement des 1 ou des 0.
// (pour que l'image soit toute blanche ou toute noir)
function tableauUni(valeurCouleur){
for (i=0; i<hauteur; i++){
ligne = new Array()
for (k=0; k<largeur; k++){
ligne.push(valeurCouleur)
}
tableau[i] = ligne
}
graphique = ""
calculerGraphXPM()
}
// Cette fonction regarde chaque "case" du tableau.
// Elle permet de générer le texte ASCII de l'image XPM.
function calculerGraphXPM() {
graphique = graphique + '"'
for (i=0; i<largeur; i++){
switch (tableau[j][i]){
case 1:
graphique = graphique + ' '
break
default:
graphique = graphique + '.'
break
}
}
j++
graphique = graphique + '",'
if (j == hauteur){
afficherGraphXPM()
j = 0
return true
}
calculerGraphXPM()
}
// Cette fonction génére le code HTML nécessaire à afficher l'image XPM.
// Elle place ce code dans la div "affichage" ce qui permet d'afficher le graphique.
function afficherGraphXPM(){
image = "<img src='data:image/xpm;ASCII,"+'/* XPM */static char * test_xpm[] = {"'+largeur+' '+hauteur+' 2 1"," c #000000",". c #FFFFFF",' + graphique + "};'"+" />"
document.getElementById("affichage").innerHTML = image
}
\ No newline at end of file
// -------------------- Color Picker -------------------- // -------------------- Color Picker --------------------
var idColor = "" var idColor = "";
// Différentes fonctions nécessaire au Color Picker (menu du choix de la couleur) // Différentes fonctions nécessaire au Color Picker (menu du choix de la couleur)
function colorSV(e){
var element = document.getElementById('colorSV')
var posDivY = 0
var posDivX = 0
while(element){
posDivY = posDivY + element.offsetTop
posDivX = posDivX + element.offsetLeft
element = element.offsetParent
}
document.getElementById("info").innerHTML = posDivX+" ; "+posDivY
S = 100-Math.round((e.clientY - posDivY -0)/255*100)
V = Math.round((e.clientX - posDivX -0)/255*100)
document.getElementById("inputValeur").value = V
document.getElementById("inputSaturation").value = S
document.getElementById("ligneValeur").setAttribute("x1", e.clientX-posDivX)
document.getElementById("ligneValeur").setAttribute("x2", e.clientX-posDivX)
document.getElementById("ligneSaturation").setAttribute("y1", e.clientY-posDivY)
document.getElementById("ligneSaturation").setAttribute("y2", e.clientY-posDivY)
colorRGB()
}
function colorT(e){ var colorPicker = {
var element = document.getElementById('colorT') // Configuration
var posDiv = 0 idSV : "canvasSV", // id du canvas affichant la saturation et la valeur
while(element){ idT : "canvasT", // id du canvas affichant la teinte
posDiv = posDiv + element.offsetTop idO : "canvasO", // id du canvas affichant l'opacité
element = element.offsetParent width : 250, // largeur
} height : 250, // hauteur
T = (e.clientY - posDiv -0) / 256*360 rayonRonds : 5, // rayon des ronds
r,g,b = 0 ombreActive : "0px 0px 3px rgba(150,200,255,1), 0px 0px 8px rgba(64,190,255,1)",
while (true){ ombreInactive : "0px 0px 5px rgba(64,64,64,0.4)",
// Variables définies lors de l'initialisation
canvasSV : null,
canvasT : null,
canvasO : null,
ctxSV : null,
ctxT : null,
ctxO : null,
lingradS : null,
lingradV : null,
lingradT : null,
// Couleurs
backgroundColor : "rgb(193,255,0)",
saturation : 100,
valeur : 100,
teinte : 75,
rouge : 193,
vert : 255,
bleu : 0,
opacity: 1,
// Couleurs RGB sans application de la saturation et de la valeur
r : 255,
g : 0,
b : 0,
// Autres variables
sourisDown : false, // Indique si on clique sur le colorPicker ou pas
sourisDehors : true, // Indique si la souris est en-dehors du colorPicker lors d'un clique
idColor : null,
// Fonction d'initialisation
init : function(id){
// Récupérer les éléments
this.canvasSV = document.getElementById(this.idSV);
this.canvasT = document.getElementById(this.idT);
this.canvasO = document.getElementById(this.idO);
// Définir la taille
this.canvasSV.width = this.width;
this.canvasSV.height = this.height;
this.canvasSV.style.width = this.width + "px";
this.canvasSV.style.height = this.height + "px";
this.canvasT.width = this.width/10;
this.canvasT.height = this.height;
this.canvasT.style.width = this.width/10 + "px";
this.canvasT.style.height = this.height + "px";
this.canvasO.width = this.width*1.15;
this.canvasO.height = this.height/10;
this.canvasO.style.width = this.width*1.15 + "px";
this.canvasO.style.height = this.height/10 + "px";
// Initialisation canvas
this.ctxSV = this.canvasSV.getContext("2d");
this.ctxT = this.canvasT.getContext("2d");
this.ctxO = this.canvasO.getContext("2d");
// Création des dégradés
this.lingradV = this.ctxSV.createLinearGradient(0, 0, 0, this.height);
this.lingradV.addColorStop(0, 'rgba(255,255,255,0)');
this.lingradV.addColorStop(1, 'rgba(255,255,255,1)');
this.lingradS = this.ctxSV.createLinearGradient(0, 0, this.width, 0);
this.lingradS.addColorStop(0, 'rgba(0,0,0,1)');
this.lingradS.addColorStop(1, 'rgba(0,0,0,0)');
this.lingradT = this.ctxT.createLinearGradient(0, 0, 0, this.height);
this.lingradT.addColorStop(0, 'rgb(255,0,0)');
this.lingradT.addColorStop(1/6, 'rgb(255,255,0)');
this.lingradT.addColorStop(2/6, 'rgb(0,255,0)');
this.lingradT.addColorStop(3/6, 'rgb(0,255,255)');
this.lingradT.addColorStop(4/6, 'rgb(0,0,255)');
this.lingradT.addColorStop(5/6, 'rgb(255,0,255)');
this.lingradT.addColorStop(1, 'rgb(255,0,0)');
// Événements roulette (initialisé seulement une fois)
if(window.addEventListener && !this.idColor){
this.canvasSV.addEventListener('DOMMouseScroll', function(event){colorPicker.eventWheel(event, colorPicker.idSV)}, false);
this.canvasSV.onmousewheel = function(event){colorPicker.eventWheel(event, colorPicker.idSV)};
this.canvasT.addEventListener('DOMMouseScroll', function(event){colorPicker.eventWheel(event, colorPicker.idT)}, false);
this.canvasT.onmousewheel = function(event){colorPicker.eventWheel(event, colorPicker.idT)};
this.canvasO.addEventListener('DOMMouseScroll', function(event){colorPicker.eventWheel(event, colorPicker.idO)}, false);
this.canvasO.onmousewheel = function(event){colorPicker.eventWheel(event, colorPicker.idO)};
}
// Définir la couleur
this.idColor = id;
var couleur = eval(document.getElementById(this.idColor).title);
// alert(id+" ; "+couleur)
document.getElementById("apercuCouleur").style.backgroundColor = couleur;
document.getElementById("apercuCouleur2").style.backgroundColor = couleur;
this.definirCouleur(couleur);
// Dessiner
this.dessiner();
this.dessinerApercu();
// Définir les valeurs des inputs
this.definirInputs();
// Définir le style de l'ombre
this.sourisOut();
},
definirCouleur : function(colorRGB){
var table = /(.*?)rgb\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)/.exec(colorRGB);
if (table == null){
table = /(.*?)rgba\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)/.exec(colorRGB);
}
if(table == null){
return "";
}
this.rouge = parseInt(table[2]);
this.vert = parseInt(table[3]);
this.bleu = parseInt(table[4]);
this.RGB_SVT();
},
sourisClick : function(id){
this.sourisDown = id;
if(id != this.idO){
document.getElementById(id).style.boxShadow = this.ombreActive;
}
},
sourisOut : function(){
this.canvasSV.style.boxShadow = this.ombreInactive;
this.canvasT.style.boxShadow = this.ombreInactive;
},
sourisOver : function(id){
if(this.sourisDown == id && id != this.idO){
document.getElementById(id).style.boxShadow = this.ombreActive;
}
},
sourisUp : function(){
this.sourisDown = false;
this.canvasSV.style.boxShadow = this.ombreInactive;
this.canvasT.style.boxShadow = this.ombreInactive;
this.dessinerO();
},
eventWheel : function(event, id){
if(!event) event = window.event;
if(event.wheelDelta){
if(event.wheelDelta < 0){
colorPicker.sourisWheelUp(id);
}
else{
colorPicker.sourisWheelDown(id);
}
}
else if(event.detail){
if(event.detail > 0){
colorPicker.sourisWheelUp(id);
}
else{
colorPicker.sourisWheelDown(id);
}
}
},
sourisWheelUp : function(id){
switch(id){
case this.idT:
colorPicker.ajouterT(5);
break;
case this.idO:
colorPicker.ajouterO(0.1);
break;
case this.idSV:
colorPicker.ajouterS(-5);
break;
}
},
sourisWheelDown : function(id){
switch(id){
case this.idT:
colorPicker.ajouterT(-5);
break;
case this.idO:
colorPicker.ajouterO(-0.1);
break;
case this.idSV:
colorPicker.ajouterS(5);
break;
}
},
ajouterT : function(nbr){
this.teinte += nbr;
if(this.teinte < 0){
this.teinte = 0;
}
else if(this.teinte > 360){
this.teinte = 360;
}
this.SVT_RGB();
},
ajouterO : function(nbr){
this.opacity = Math.round((this.opacity+nbr)*100)/100;
if(this.opacity < 0){
this.opacity = 0;
}
else if(this.opacity > 1){
this.opacity = 1;
}
this.SVT_RGB();
},
ajouterS : function(nbr){
this.saturation += nbr;
if(this.saturation < 0){
this.saturation = 0;
}
else if(this.saturation > 100){
this.saturation = 100;
}
this.SVT_RGB();
},
// Lors du déplacement de la souris
moveSV : function(event){
// Vérifie si on appuie sur la souris
if(this.sourisDown != this.idSV){
return 0;
}
var element = this.canvasSV;
var posDivY = 0;
var posDivX = 0;
// Récupérer la position du canvas par rapport à la page
while(element){
posDivY = posDivY + element.offsetTop;
posDivX = posDivX + element.offsetLeft;
element = element.offsetParent;
}
// Définir la saturation et la valeur à partir de la position de la souris
this.saturation = 100-Math.round((event.clientY - posDivY -1)/(this.height+1)*100);
this.valeur = Math.round((event.clientX - posDivX -1)/(this.width+1)*100);
this.SVT_RGB();
},
moveT : function(event){
if(this.sourisDown != this.idT){
return 0;
}
var element = this.canvasT;
var posDivY = 0;
while(element){
posDivY = posDivY + element.offsetTop;
element = element.offsetParent;
}
this.teinte = Math.round( (event.clientY - posDivY -0) / (this.height+1)*360);
this.SVT_RGB();
},
SVT_RGB : function(){
this.T_rgb();
this.rouge = Math.round((this.r + (255-this.r) * (-1) * (this.saturation-100) / 100 )* this.valeur / 100);
this.vert = Math.round((this.g + (255-this.g) * (-1) * (this.saturation-100) / 100 )* this.valeur / 100);
this.bleu = Math.round((this.b + (255-this.b) * (-1) * (this.saturation-100) / 100 )* this.valeur / 100);
this.definirInputs();
this.dessinerApercu();
this.dessiner();
},
T_rgb : function(){
var r,g,b = 0;
var T = this.teinte;
if (T<60){ if (T<60){
r = 255 r = 255;
g = T/60*255 g = T/60*255;
b = 0 b = 0;
break }
} else if (T<120){
if (T<=120){ r = (255-(T%60/60*255))%256;
r = (255-(T%60/60*255))%256 g = 255;
g = 255 b = 0;
b = 0 }
break else if (T<180){
} r = 0;
if (T<180){ g = 255;
r = 0 b = T%60/60*255;
g = 255 }
b = T%60/60*255 else if (T<240){
break r = 0;
} g = (255-(T%60/60*255))%256;
if (T<=240){ b = 255;
r = 0 }
g = (255-(T%60/60*255))%256 else if (T<300){
b = 255 r = T%60/60*255;
break g = 0;
} b = 255;
if (T<300){ }
r = T%60/60*255 else if (T<360){
g = 0 r = 255;
b = 255 g = 0;
break b = (255-(T%60/60*255))%256;
} }
if (T<360){ else{
r = 255 r = 255;
g = 0 g = 0;
b = (255-(T%60/60*255))%256 b = 0;
break }
}
r = 255 this.r = Math.round(r);
g = 0 this.g = Math.round(g);
b = 0 this.b = Math.round(b);
break },
RGB_SVT : function(){
// Voir http://fr.wikipedia.org/wiki/Teinte_Saturation_Valeur#Conversion_de_RVB_vers_TSV
var r = this.rouge/255;
var g = this.vert/255;
var b = this.bleu/255;
if(!isFinite(r)){
r = 0;
}
if(!isFinite(g)){
g = 0;
}
if(!isFinite(b)){
b = 0;
}
var max = Math.max(r,g,b);
var min = Math.min(r,g,b);
var s, v, t;
// Teinte
switch(max){
case r:
t = (60 * (g-b)/(max-min) + 360) % 360;
break;
case g:
t = 60 * (b-r)/(max-min) + 120;
break;
case b:
t = 60 * (r-g)/(max-min) + 240;
break;
default: /* case min: */
t = 0;
break;
}
// Saturation
if(max == 0){
s = 0;
}
else{
s = 1-(min/max);
}
// Valeur
v = max;
// Définir les variables
this.saturation = s*100;
this.valeur = v*100;
this.teinte = Math.round(t);
this.T_rgb();
},
dessiner : function(){
var ctxSV = this.ctxSV;
var ctxT = this.ctxT;
// Fond
ctxSV.fillStyle = "rgb("+this.r+","+this.g+","+this.b+")";
ctxSV.fillRect(0, 0, this.width, this.height);
// Dégradés
ctxSV.fillStyle = this.lingradV;
ctxSV.fillRect(0, 0, this.width, this.height);
ctxSV.fillStyle = this.lingradS;
ctxSV.fillRect(0, 0, this.width, this.height);
// Souris
var x = Math.round(this.width*this.valeur/100);
var y = Math.round(this.height-this.height*this.saturation/100);
ctxSV.beginPath();
ctxSV.arc(x, y, this.rayonRonds, 0, 2*Math.PI, true);
ctxSV.strokeStyle = "rgba(255,255,255,0.8)";
ctxSV.shadowOffsetX = 1;
ctxSV.shadowOffsetY = 1;
ctxSV.shadowColor = "rgba(0,0,0,1)";
ctxSV.shadowBlur = 2;
ctxSV.lineWidth = 1.5;
ctxSV.stroke();
// Fond Teinte
ctxT.fillStyle = this.lingradT;
ctxT.fillRect(0, 0, this.width/10, this.height);
// Souris Teinte
var pos = Math.round(0.99*this.height*this.teinte/360);
ctxT.fillStyle = "rgba(255,255,255,0.8)";
ctxT.shadowOffsetX = 0;
ctxT.shadowOffsetY = 0;
ctxT.shadowColor = "rgba(0,0,0,1)";
ctxT.shadowBlur = 3;
ctxT.fillRect(0, pos, this.width/10, 2);
// Désactiver les ombres
ctxSV.shadowColor = "rgba(0,0,0,0)";
ctxT.shadowColor = "rgba(0,0,0,0)";
this.dessinerO();
},
dessinerApercu : function(){
document.getElementById("apercuCouleur").style.backgroundColor = "rgba("+this.rouge+","+this.vert+","+this.bleu+","+this.opacity+")";
},
definirInputs : function(){
document.getElementById("inputValeur").value = this.valeur;
document.getElementById("inputSaturation").value = this.saturation;
document.getElementById("inputTeinte").value = this.teinte;
document.getElementById("inputRouge").value = this.rouge;
document.getElementById("inputVert").value = this.vert;
document.getElementById("inputBleu").value = this.bleu;
document.getElementById("inputOpacity").value = this.opacity;
},
recupererInputs : function(){
this.valeur = parseInt(document.getElementById("inputValeur").value);
this.saturation = parseInt(document.getElementById("inputSaturation").value);
this.teinte = parseInt(document.getElementById("inputTeinte").value);
this.opacity = parseFloat(document.getElementById("inputOpacity").value);
this.SVT_RGB();
this.definirInputs();
this.dessinerApercu();
this.dessiner();
},
recupererInputs2 : function(){
this.rouge = parseInt(document.getElementById("inputRouge").value);
this.vert = parseInt(document.getElementById("inputVert").value);
this.bleu = parseInt(document.getElementById("inputBleu").value);
this.RGB_SVT();
this.definirInputs();
this.dessinerApercu();
this.dessiner();
},
moveO : function(event){
if(this.sourisDown != this.idO){
return 0;
}
var element = this.canvasO;
var posDivX = 0;
while(element){
posDivX = posDivX + element.offsetLeft;
element = element.offsetParent;
}
this.opacity = Math.round( (event.clientX - posDivX -this.width/10) / (this.width*0.9)*100)/100;
if(this.opacity < 0){
this.opacity = 0;
}
else if(this.opacity > 1){
this.opacity = 1;
}
this.dessinerO();
this.definirInputs();
this.dessinerApercu();
},
dessinerO : function(){
var ctx = this.ctxO;
ctx.shadowBlur = 2;
// Ligne
if(this.sourisDown == this.idO){
ctx.shadowColor = "rgba(0,50,100,1)";
}
else{
ctx.shadowColor = "rgba(0,0,0,1)";
}
ctx.globalAlpha = 1;
ctx.shadowOffsetX = 0;
ctx.shadowOffsetY = 0;
ctx.fillStyle = "rgba("+this.rouge+","+this.vert+","+this.bleu+",1)";
ctx.clearRect(0,0,this.width*1.15,this.height);
ctx.fillRect(this.width/10, this.height/20-1, this.width*0.9, 3);
// Rond
var x = this.width/10 + this.width*0.9*this.opacity-1;
var y = this.height/20;
if(this.sourisDown == this.idO){
ctx.fillStyle = "rgba(0,40,80,1)";
ctx.strokeStyle = "rgba(230,250,255,0.8)";
}
else{
ctx.fillStyle = "rgba(0,0,0,1)";
ctx.strokeStyle = "rgba(255,255,255,0.8)";
}
ctx.globalAlpha = 0.1+this.opacity*0.9;
ctx.beginPath();
ctx.arc(x, y, this.rayonRonds+1, 0, 2*Math.PI, true);
ctx.shadowColor = "rgba(0,0,0,1)";
ctx.shadowOffsetX = 1;
ctx.shadowOffsetY = 1;
ctx.lineWidth = 1;
ctx.fill();
ctx.stroke();
// Petits ronds
ctx.globalAlpha = 1;
ctx.shadowColor = "rgba(0,0,0,1)";
ctx.beginPath();
ctx.arc(8, this.height/20+0.5, this.rayonRonds, 0, 2*Math.PI, true);
ctx.strokeStyle = "rgba(0,0,0,0.5)";
ctx.shadowOffsetX = 0;
ctx.shadowOffsetY = 0;
ctx.lineWidth = 1;
ctx.stroke();
ctx.beginPath();
ctx.arc(this.width*1.08, this.height/20+0.5, this.rayonRonds, 0, 2*Math.PI, true);
ctx.strokeStyle = "rgba(0,0,0,0.8)";
ctx.fillStyle = "rgba(0,0,0,0.6)";
ctx.shadowOffsetX = 0;
ctx.shadowOffsetY = 0;
ctx.lineWidth = 1;
ctx.stroke();
ctx.fill();
},
exporterCouleur : function(){
eval(document.getElementById(this.idColor).title+' = "rgba(" + this.rouge +", " + this.vert + ", " + this.bleu +", "+this.opacity+")"');
document.getElementById(this.idColor).style.backgroundColor = eval(document.getElementById(this.idColor).title);
},
fermer : function(){
colorPicker.exporterCouleur();
if(colorPicker.idColor == 'buttonColor'){
cacherMenu();
}
else if(dernierMenu == "menuFonctions"){
editeur.getOptions();
afficherMenu(dernierMenu);
}
else{
cacherMenu();
}
actualiserGraph();
} }
T = Math.round(T) };
r = Math.round(r)
g = Math.round(g)
b = Math.round(b)
document.getElementById("inputTeinte").value = T
document.getElementById("colorSV").style.backgroundColor = "rgb("+r+","+g+","+b+")"
document.getElementById("ligneTeinte").setAttribute("y2", e.clientY-posDiv)
document.getElementById("ligneTeinte").setAttribute("y1", e.clientY-posDiv)
colorRGB()
}
function colorRGB(){
var S = document.getElementById("inputSaturation").value
var V = document.getElementById("inputValeur").value
var rouge = Math.round((r + (255-r) * (-1) * (S-100) / 100 )* V / 100)
var vert = Math.round((g + (255-g) * (-1) * (S-100) / 100 )* V / 100)
var bleu = Math.round((b + (255-b) * (-1) * (S-100) / 100 )* V / 100)
document.getElementById("inputRouge").value = rouge
document.getElementById("inputVert").value = vert
document.getElementById("inputBleu").value = bleu
eval(document.getElementById(idColor).title+' = "rgba(" + rouge +", " + vert + ", " + bleu +", "+document.getElementById("inputOpacity").value+")"')
document.getElementById(idColor).style.backgroundColor = eval(document.getElementById(idColor).title)
document.getElementById("apercuCouleur").style.backgroundColor = eval(document.getElementById(idColor).title)
}
function colorPicker(id){
idColor = id
document.getElementById("apercuCouleur").style.backgroundColor = eval(document.getElementById(idColor).title)
document.getElementById("apercuCouleur2").style.backgroundColor = eval(document.getElementById(idColor).title)
}
// -------------------- Etude de fonctions --------------------
var etudeX = new Array()
var etudeY = new Array()
var etudeD = new Array()
var limGauche = new Array()
var limDroite = new Array()
var listeIndefini = new Array()
var listeZeros = new Array()
var intervalEtudeGauche = -50
var intervalEtudeDroite = 50
var precisionEtude = 0.001
function etudier(fct){
if(check(fct)){
prepareEtude(fct)
pariteFct()
signeFct(fct)
asymptotes()
courbure()
ensembleDefinition()
}
}
// Préparation à l'étude de fonction
function prepareEtude(fct){
listeIndefini = new Array()
var f = function(x){
return eval(fct)
}
// Calcul de tous les points de la fonction
var i = 0
for(var x=intervalEtudeGauche; x<=intervalEtudeDroite; x+=precisionEtude){
etudeX[i] = x
etudeY[i] = Math.round(f(x)*10000)/10000
etudeD[i] = Math.round(1000000*(f(x+0.0001)-f(x-0.0001))/(2*0.0001))/1000000
i++
}
// Calcul des extrémités de la fonction
var x = -100000
limGauche[0] = f(x)
x = -10000
limGauche[1] = f(x)
x = 100000
limDroite[0] = f(x)
x = 10000
limDroite[1] = f(x)
}
// Recherche de l'ensemble de définition
function ensembleDefinition(){
var fctDefinie = false
var dejaDefinie = false
var EDF = ""
if(!isNaN(limGauche[0])){
fctDefinie = true
dejaDefinie = true
EDF += "]-∞;"
}
if(!isNaN(limGauche[1]) && !fctDefinie){
fctDefinie = true
dejaDefinie = true
EDF += "]-∞;"
}
for(var i=0; i<etudeX.length; i++){
if(fctDefinie && isNaN(etudeY[i])){
fctDefinie = false
EDF += (parseInt(etudeX[i]/precisionEtude)*precisionEtude)+"["
}
else if(!fctDefinie && !isNaN(etudeY[i])){
fctDefinie = true
if(dejaDefinie){
EDF += " u "
}
EDF += "["+(parseInt(etudeX[i]/precisionEtude)*precisionEtude)+";"
dejaDefinie = true
}
}
if(fctDefinie && !isNaN(limDroite[1])){
fctDefinie = false
EDF += "+∞["
}
if(fctDefinie && !isNaN(limDroite[0])){
fctDefinie = false
EDF += "+∞["
}
for(var i=0; i<listeIndefini.length; i++){
if(i==0){
EDF += " - {"
}
EDF += listeIndefini[i]
if(i==listeIndefini.length-1){
EDF += "}"
}
else
EDF += ";"
}
document.getElementById('etudeEDF').innerHTML = EDF
}
// Etude de la parité
function pariteFct(){
var posZero
var paire = true
var impaire = true
var positif, negatif
var precisionParite = 1000
for(var i=0;i<etudeX.length;i++){
if(Math.round(etudeX[i]*precisionParite)/precisionParite==0){
posZero = i
}
}
for(var i=1; i<etudeX.length/2; i++){
if(etudeY[posZero+i]>0){
positif = Math.floor(etudeY[posZero+i])
}
else{
positif = Math.ceil(etudeY[posZero+i])
}
if(etudeY[posZero-i]>0){
negatif = Math.floor(etudeY[posZero-i])
}
else{
negatif = Math.ceil(etudeY[posZero-i])
}
if(positif<25000 && positif>-25000){
if(positif != negatif){
paire = false
//alert(i+" ; "+posZero+" ; "+etudeX.length+" ; "+positif+" ; "+negatif)
}
if(positif != (-negatif)){
impaire = false
}
}
}
if(paire){
document.getElementById("etudeParite").innerHTML = sankoreLang[lang].ev;
}
else if(impaire){
document.getElementById("etudeParite").innerHTML = sankoreLang[lang].unev;
}
else{
document.getElementById("etudeParite").innerHTML = sankoreLang[lang].na;
}
}
function zeroFct(){
listeZeros = new Array()
var listeZerosArr = new Array()
var precZeros = 5
for(var i=0; i<etudeX.length; i++){
if(Math.round(etudeY[i]*1000)/1000==0){
var nouveauZero = Math.round(etudeX[i]*precZeros)/precZeros
if(listeZerosArr[listeZerosArr.length-1]!=nouveauZero){
listeZeros.push(Math.round(etudeX[i]*10)/10)
listeZerosArr.push(nouveauZero)
}
}
}
}
function signeFct(fct){
var signe = new Array()
var signePlus = new Array()
var signeMoins = new Array()
var dernier = 0
if(limGauche[0]>0){
signe[0] = "+"
signePlus[0] = limGauche[1]
signeMoins[0] = limGauche[0]
}
else{
signe[0] = "-"
signePlus[0] = limGauche[1]
signeMoins[0] = limGauche[0]
}
for(var i=0; i<etudeY.length; i++){
if(signe[signe.length-1]=="+"){
if(etudeY[i]<0){
signe.push("-")
signePlus.push(etudeX[i])
signeMoins.push(etudeX[dernier])
}
else if(etudeY[i]>0){
dernier = i
}
}
if(signe[signe.length-1]=="-"){
if(etudeY[i]>0){
signe.push("+")
signePlus.push(etudeX[i])
signeMoins.push(etudeX[dernier])
//alert(signe+" ; "+signePlus+'\n'+etudeY[i+1]+" ; "+etudeY[i]+" ; "+etudeY[i-1]+" ; "+etudeY[i-2]+'\n'+etudeX[i+1]+" ; "+etudeX[i]+" ; "+etudeX[i-1]+" ; "+etudeX[i-2])
}
else if(etudeY[i]<0){
dernier = i
}
}
}
var valeurPlus, valeurMoins, millieu, precisionZero
listeZeros = new Array()
for(var i=1; i<signePlus.length; i++){
valeurPlus = signePlus[i]
valeurMoins = signeMoins[i]
for(var k=0;k<10000;k++){
millieu = (valeurPlus + valeurMoins)/2
x = valeurPlus
if(eval(fct)>0){
x = millieu
if(eval(fct)>0){
valeurPlus=millieu
}
else if(eval(fct)<0){
valeurMoins=millieu
}
else{
break
}
}
else if(eval(fct)<0){
x = millieu
if(eval(fct)<0){
valeurPlus=millieu
}
else if(eval(fct)>0){
valeurMoins=millieu
}
else{
break
}
}
else{
millieu = valeurPlus
break
}
x = valeurPlus
precisionZero = eval(fct)
x = valeurMoins
precisionZero -= eval(fct)
if(precisionZero>0.0001){
break
}
}
listeZeros.push(Math.round(millieu*100)/100)
}
var texteZeros = ""
if(listeZeros==""){
zeroFct()
texteZeros = "~ "
}
var texte = sankoreLang[lang].signe;
var aSupprimer = new Array()
for(var i=0; i<signe.length; i++){
texte += "<td>"+signe[i]+"</td>"
if(listeZeros[i]!=undefined){
x = listeZeros[i]
if(isFinite(eval(fct))){
texte += "<td class='border'>"+listeZeros[i]+"</td>"
}
else{
texte += "<td class='border infini'>"+listeZeros[i]+"</td>"
listeIndefini.push(listeZeros[i])
aSupprimer.push(i)
}
}
}
document.getElementById("etudeSigne").innerHTML = texte
for(var i=0; i<aSupprimer.length; i++){
listeZeros.splice((aSupprimer[i]-i), 1)
}
if(listeZeros==""){
texteZeros = sankoreLang[lang].na;
}
document.getElementById("etudeZeros").innerHTML = texteZeros+listeZeros
}
function asymptotes(){
// Horizontales
if(Math.abs(limGauche[0])<1000){
var limRound = Math.round(limGauche[0]*100)/100
if(limGauche[0]<limRound){
document.getElementById("etudeAHG").innerHTML = "y = "+limRound +" <span class='texteSecondaire'>" + sankoreLang[lang].curve_higher + "</span>"
}
else if(limGauche[0]>limRound){
document.getElementById("etudeAHG").innerHTML = "y = "+limRound +" <span class='texteSecondaire'>" + sankoreLang[lang].curve_lower + "</span>"
}
else{
document.getElementById("etudeAHG").innerHTML = "y = "+limRound
}
}
else{
document.getElementById("etudeAHG").innerHTML = sankoreLang[lang].na;
}
if(Math.abs(limDroite[0])<1000){
var limRound = Math.round(limDroite[0]*100)/100
if(limDroite[0]<limRound){
document.getElementById("etudeAHD").innerHTML = "y = "+limRound +" <span class='texteSecondaire'>" + sankoreLang[lang].curve_lower + "</span>"
}
else if(limDroite[0]>limRound){
document.getElementById("etudeAHD").innerHTML = "y = "+limRound +" <span class='texteSecondaire'>" + sankoreLang[lang].curve_higher + "</span>"
}
else{
document.getElementById("etudeAHD").innerHTML = "y = "+limRound
}
}
else{
document.getElementById("etudeAHD").innerHTML = sankoreLang[lang].na;
}
// Verticales
var texteAV = ""
for(var i=0; i<listeIndefini.length; i++){
texteAV += "x = "+listeIndefini[i]
if(listeIndefini[i+1]!=undefined){
texteAV += " ; "
}
}
if(texteAV==""){
texteAV = sankoreLang[lang].na + " <br/>"
}
document.getElementById("etudeAV").innerHTML = texteAV
}
function courbure(){
var texteMin = "";
var texteMax = "";
var texteI = "";
var nbrI = 0;
var i;
for(i=0; i<etudeD.length; i++){
if(etudeD[i]==0){
if(etudeD[i-1]<0 && etudeD[i+1]>0){
texteMin += "<br/>" + sankoreLang[lang].min + "("+Math.round(etudeX[i]*10000)/10000+";"+etudeY[i]+")";
}
else if(etudeD[i-1]>0 && etudeD[i+1]<0){
texteMax += "<br/>" + sankoreLang[lang].max + "("+Math.round(etudeX[i]*10000)/10000+";"+etudeY[i]+")";
}
else{
nbrI++;
texteI += '<br/>I<span style="vertical-align:sub;font-size:50%;">'+nbrI+"</span>("+Math.round(etudeX[i]*10000)/10000+";"+etudeY[i]+")";
}
}
}
if(texteMin==""){
texteMin = "<br/>" + sankoreLang[lang].no_min;
}
if(texteMax==""){
texteMax = "<br/>" + sankoreLang[lang].no_max;
}
if(texteI==""){
texteI = "<br/>Aucun I";
}
document.getElementById("etudeMin").innerHTML = texteMin;
document.getElementById("etudeMax").innerHTML = texteMax;
}
\ No newline at end of file
// -------------------- Fonctions de l'interface -------------------- // -------------------- Fonctions de l'interface --------------------
var menuActuel = "divInputRapide"
var dernierMenu = ""
var pleinEcran = false var pleinEcran = false
var maximise = true var maximise = true
var tailleFenetreX = window.innerWidth var tailleFenetreX = window.innerWidth
...@@ -12,23 +16,56 @@ var AncienneMethodeAffichage = 0 ...@@ -12,23 +16,56 @@ var AncienneMethodeAffichage = 0
function afficherMenu(id){ function afficherMenu(id){
if (menuActuel == id){ if (menuActuel == id){
cacherMenu() cacherMenu()
dernierMenu = false;
} }
else { else {
if (menuActuel !== ""){ if (menuActuel != ""){
dernierMenu = menuActuel;
cacherMenu() cacherMenu()
} }
menuActuel = id menuActuel = id
document.getElementById(id).style.display = "block" document.getElementById(id).style.display = "block"
message.supprimer();
} }
} }
// Permet de cacher le menu actuellement affiché // Permet de cacher le menu actuellement affiché
function cacherMenu(){ function cacherMenu(){
document.getElementById(menuActuel).style.display = "none" if(menuActuel != ""){
menuActuel = "" document.getElementById(menuActuel).style.display = "none"
menuActuel = ""
}
} }
// ---- Minimiser ou Maximiser le widget (pour sankore) ---- // Affiche un message d'erreur
function afficherErreur(message){
document.getElementById("spanErreurFct").innerHTML = message;
afficherMenu("erreurFct");
}
// Messages d'info
var message = {
liste : [],
ajouter : function(x, y, contenu){
var newDiv = document.createElement("div");
newDiv.style.left = x + "px";
newDiv.style.top = y + "px";
var textDiv = document.createElement("span");
textDiv.innerHTML = contenu;
newDiv.appendChild(textDiv);
document.getElementById("divMessages").appendChild(newDiv);
},
supprimer : function(){
var div = document.getElementById("divMessages");
div.innerHTML = "";
}
};
// ---- Minimiser ou Maximiser le widget (pour Uniboard) ----
function miniMax(){ function miniMax(){
if (maximise){ if (maximise){
maximise = false maximise = false
...@@ -49,6 +86,17 @@ function miniMax(){ ...@@ -49,6 +86,17 @@ function miniMax(){
} }
} }
// Affiche le menu +
function menuFonctions(){
if(fonction3D){
afficherMenu('menuHistorique');
}
else{
afficherMenu('menuFonctions');
editeur.editer(0);
}
}
// Action des petits bouton + et - dans les options // Action des petits bouton + et - dans les options
function boutonPlus(id, nombre){ function boutonPlus(id, nombre){
var element = document.getElementById(id) var element = document.getElementById(id)
...@@ -64,101 +112,73 @@ function boutonMoins(id, nombre){ ...@@ -64,101 +112,73 @@ function boutonMoins(id, nombre){
} }
// Changer de thème // Changer de thème
function changerTheme(){ function changerTheme(theme){
var theme = document.getElementById("selectTheme").value var positions = [
switch(theme){ "top-left",
case "noir": "top",
document.body.style.backgroundImage = "url(Images/fond2.png)" "top-right",
document.getElementById("gauche").style.backgroundImage = "url(Images/gauche2.png)" "right",
document.getElementById("onglet3D").style.backgroundImage = "url(Images/onglet1.png)" "bottom-right",
document.getElementById("texteFonction").style.color = "white" "bottom",
var couleurEchelle = "rgba(255,255,255,0.8)" "bottom-left",
var couleurGrille = "rgba(255,255,255,0.1)" "left",
var couleurAxes = "rgba(0,0,0,0.5)" "center"
break ];
case "bleu": for(var i=0; i<positions.length; i++){
document.body.style.backgroundImage = "url(Images/fond4.png)" var pos = positions[i];
document.getElementById("gauche").style.backgroundImage = "url(Images/gauche3.png)" var id = "background-" + pos;
document.getElementById("onglet3D").style.backgroundImage = "url(Images/onglet2.png)" var path = "Images/" + theme + "/" + pos + ".png";
document.getElementById("texteFonction").style.color = "white" document.getElementById(id).style.backgroundImage = "url("+path+")";
var couleurEchelle = "rgba(255,255,255,0.8)"
var couleurGrille = "rgba(255,255,255,0.1)"
var couleurAxes = "rgba(0,0,0,0.5)"
break
case "blanc":
document.body.style.backgroundImage = "url(Images/fond5.png)"
document.getElementById("gauche").style.backgroundImage = "url(Images/gauche3.png)"
document.getElementById("onglet3D").style.backgroundImage = "url(Images/onglet2.png)"
document.getElementById("texteFonction").style.color = "black"
var couleurEchelle = "rgba(0,0,0,0.8)"
var couleurGrille = "rgba(255,255,255,0.2)"
var couleurAxes = "rgba(0,0,0,0.5)"
break
} }
// switch(theme){
// case "white":
// document.body.style.backgroundColor = "black";
// var couleurEchelle = "rgba(0,0,0,0.8)"
// var couleurGrille = "rgba(255,255,255,0.2)"
// var couleurAxes = "rgba(0,0,0,0.5)"
// break;
// default:
// document.body.style.backgroundColor = "transparent";
// var couleurEchelle = "rgba(255,255,255,0.8)"
// var couleurGrille = "rgba(255,255,255,0.1)"
// var couleurAxes = "rgba(0,0,0,0.5)"
// break;
// }
saveOptions();
} }
// Affiche un message d'erreur // Affiche un message d'erreur
function error(err){ function error(err){
alert(" Error has occurred on the page ...\n\n Description: " + err.description + "\n\n Click 'OK' to continue.\n\n") alert(" Erreur sur la page...\n\n Description: " + err.description + "\n\n Cliquez sur OK pour continuer.\n\n")
} }
function agrandirAffichage(){ function agrandirAffichage(){
if (pleinEcran){ if(pleinEcran){
pleinEcran = false pleinEcran = false;
if(fonction3D){ document.getElementById('background-center').style.paddingTop = "30px";
document.getElementById('gauche3D').style.display = "block" document.getElementById('ongletsHaut').style.display = "block";
largeur = 570 document.getElementById('onglet3D').style.display = "block";
document.getElementById("affichage").style.width = largeur+"px" document.getElementById('boutonSaveGraph').style.display = "inline-block";
document.getElementById("affichage").style.left = "59px" if(window.sankore || window.uniboard){
document.getElementById("flecheGauche").style.left = "67px" document.getElementById('zoneJoystick').style.display = "block";
document.getElementById("flecheHaut").style.left = "290px" document.getElementById('zoomButtons').style.display = "block";
document.getElementById("flecheBas").style.left = "290px" document.getElementById('toolButtons').style.display = "block";
}
else{
choixOutil(outilPrecedent)
document.getElementById('gauche').style.display = "block"
largeur = 500
document.getElementById("affichage").style.width = largeur+"px"
document.getElementById("affichage").style.left = "129px"
document.getElementById("flecheGauche").style.left = "137px"
document.getElementById("flecheHaut").style.left = "345px"
document.getElementById("flecheBas").style.left = "345px"
} }
document.getElementById('haut').style.display = "block"
document.getElementById('onglet3D').style.display = "block"
hauteur = 400
document.getElementById("affichage").style.height = hauteur+"px"
document.getElementById("affichage").style.top = "52px"
} }
else{ else{
pleinEcran = true pleinEcran = true;
if(fonction3D){ document.getElementById('background-center').style.paddingTop = "0px";
document.getElementById('gauche3D').style.display = "none" document.getElementById('ongletsHaut').style.display = "none";
document.getElementById('onglet3D').style.display = "none";
document.getElementById('boutonSaveGraph').style.display = "none";
if(window.sankore || window.uniboard){
document.getElementById('zoneJoystick').style.display = "none";
document.getElementById('zoomButtons').style.display = "none";
document.getElementById('toolButtons').style.display = "none";
} }
else{
document.getElementById('gauche').style.display = "none"
outilPrecedent = outil
choixOutil("deplacement")
}
document.getElementById('haut').style.display = "none"
document.getElementById('onglet3D').style.display = "none"
largeur = 625
hauteur = 445
document.getElementById("affichage").style.width = largeur+"px"
document.getElementById("affichage").style.left = "15px"
document.getElementById("affichage").style.height = hauteur+"px"
document.getElementById("affichage").style.top = "15px"
document.getElementById("flecheGauche").style.left = "67px"
document.getElementById("flecheHaut").style.left = "290px"
document.getElementById("flecheBas").style.left = "290px"
} }
actualiserGraph() widget.resize();
}
// Redémarre le widget
function reset(){
window.location.reload()
} }
// Ferme le widget // Ferme le widget
...@@ -168,14 +188,23 @@ function close(){ ...@@ -168,14 +188,23 @@ function close(){
// Actions de mise à jour du widget // Actions de mise à jour du widget
function miseAjour(){ function miseAjour(){
afficherMenu("mAj") var txtHTML = "";
choixOutil("deplacement") document.getElementById("thisVersion").innerHTML = '<object type="text/html" data="version.html"></object>';
document.getElementById("thisVersion").innerHTML = '<object type="text/html" data="version.html"></object>' for(var i=0; i<listeServeurs.length; i++){
document.getElementById("newVersion").innerHTML = '<object type="text/html" data="http://gyb.educanet2.ch/tm-widgets/yannick/GraphMe.wgt/version.html"></object>' if(i != 0){
txtHTML += '<br/>';
}
txtHTML += '<object type="text/html" data="'+listeServeurs[i]+'version.html"></object>';
// txtHTML += '<input type="button" value="utiliser" onclick="document.location.href = \''+listeServeurs[i]+'Grapheur.html\'"/>';
// txtHTML += '<input type="button" value="télécharger" onclick="window.open(\''+listeServeurs[i]+'../GraphMe.zip\', \'_blank\')"/>';
}
document.getElementById("newVersion").innerHTML = txtHTML;
afficherMenu("mAj");
} }
function checkboxMaJ(){ function checkboxMaJ(){
if(document.location.href=='http://gyb.educanet2.ch/tm-widgets/yannick/GraphMe.wgt/Grapheur.xhtml'){ if(versionOnline()){
afficherMenu('erreurMaJ') afficherMenu('erreurMaJ')
document.getElementById("checkMaJ").checked = false document.getElementById("checkMaJ").checked = false
} }
...@@ -194,20 +223,52 @@ function checkboxMaJ(){ ...@@ -194,20 +223,52 @@ function checkboxMaJ(){
} }
function majAuto(){ function majAuto(){
if(document.location.href=='http://gyb.educanet2.ch/tm-widgets/yannick/GraphMe.wgt/Grapheur.xhtml'){ // var audio = new Audio();
document.getElementById("cacheMaJ").style.display = "block" // audio.src = "version.ogg";
document.getElementById("checkMaJ").checked = true // audio.load();
// setTimeout(function(){
// window.console.log(" "+audio.duration);
// }, 0)
if(versionOnline()){
document.getElementById("cacheMaJ").style.display = "block";
document.getElementById("checkMaJ").disabled = true;
document.getElementById("checkMaJ").checked = true;
} }
else{ else{
if(document.getElementById("checkMaJ").checked){ if(document.getElementById("checkMaJ").checked){
afficherMenu('demandeMaJ') afficherMenu('demandeMaJ');
}
}
}
function majAccept(){
// document.location.href='http://gyb.educanet2.ch/tm-widgets/yannick/GraphMe.wgt/Grapheur.html';
for(var i=0; i<listeServeurs.length; i++){
setTimeout(majServeur, i*500, listeServeurs[i]);
}
}
function majServeur(serveur){
var img = new Image();
img.onload = function(){
document.location.href = serveur + "Grapheur.html";
};
img.src = serveur + "icon.png";
}
// Retourne true si le widget est utilisé depuis un des sites en ligne
function versionOnline(){
for(var i=0; i<listeServeurs.length; i++){
if(document.location.href == listeServeurs[i]+"Grapheur.html"){
return true;
} }
} }
return false;
} }
// Afficher une page web à la place dans la zone d'affichage // Afficher une page web à la place dans la zone d'affichage
function navigateur(lien){ function navigateur(lien){
cacherMenu() // cacherMenu()
agrandirAffichage() // document.getElementById("affichage").innerHTML = '<object type="text/html" data="'+lien+'" style="width:100%;height:100%;"></object>'
document.getElementById("affichage").innerHTML = '<object type="text/html" data="'+lien+'" style="width:100%;height:100%;"></object>' window.open(lien, "_blank")
} }
\ No newline at end of file
// -------------------- Fonctions des outils -------------------- // -------------------- Fonctions des outils --------------------
var listeFonctions = new Array()
var listeCouleurs = new Array()
var historique = new Array()
var ctxT
// Cette fonction permet d'effectuer un zoom. Elle change la valeur des inputs à gauche
// qui définnissent la zone à afficher et actualise le graphique.
function zoom(valeur){
var diffBornes = Math.abs(parseFloat(document.getElementById("borneXGauche").value) - parseFloat(document.getElementById("borneXDroite").value))
var ajouter = (diffBornes * valeur - diffBornes)/2
var nouvelleValeur = parseFloat(document.getElementById("borneXGauche").value) - ajouter
if (nouvelleValeur < 0){ nouvelleValeur = Math.ceil(nouvelleValeur) }
if (nouvelleValeur > 0){ nouvelleValeur = Math.floor(nouvelleValeur) }
if (nouvelleValeur == parseFloat(document.getElementById("borneXGauche").value) && valeur>1){ nouvelleValeur=nouvelleValeur-1 }
if (nouvelleValeur == parseFloat(document.getElementById("borneXGauche").value) && valeur<1){ nouvelleValeur=nouvelleValeur+1 }
document.getElementById("borneXGauche").value = nouvelleValeur
var nouvelleValeur = parseFloat(document.getElementById("borneXDroite").value) + ajouter
if (nouvelleValeur < 0){ nouvelleValeur = Math.ceil(nouvelleValeur) }
if (nouvelleValeur > 0){ nouvelleValeur = Math.floor(nouvelleValeur) }
if (nouvelleValeur == parseFloat(document.getElementById("borneXDroite").value) && valeur>1){ nouvelleValeur=nouvelleValeur+1 }
if (nouvelleValeur == parseFloat(document.getElementById("borneXDroite").value) && valeur<1){ nouvelleValeur=nouvelleValeur-1 }
document.getElementById("borneXDroite").value = nouvelleValeur
var diffBornes = Math.abs(parseFloat(document.getElementById("borneYGauche").value) - parseFloat(document.getElementById("borneYDroite").value))
var ajouter = (diffBornes * valeur - diffBornes)/2
var nouvelleValeur = parseFloat(document.getElementById("borneYGauche").value) - ajouter
if (nouvelleValeur < 0){ nouvelleValeur = Math.ceil(nouvelleValeur) }
if (nouvelleValeur > 0){ nouvelleValeur = Math.floor(nouvelleValeur) }
if (nouvelleValeur == parseFloat(document.getElementById("borneYGauche").value) && valeur>1){ nouvelleValeur=nouvelleValeur-1 }
if (nouvelleValeur == parseFloat(document.getElementById("borneYGauche").value) && valeur<1){ nouvelleValeur=nouvelleValeur+1 }
document.getElementById("borneYGauche").value = nouvelleValeur
var nouvelleValeur = parseFloat(document.getElementById("borneYDroite").value) + ajouter
if (nouvelleValeur < 0){ nouvelleValeur = Math.ceil(nouvelleValeur) }
if (nouvelleValeur > 0){ nouvelleValeur = Math.floor(nouvelleValeur) }
if (nouvelleValeur == parseFloat(document.getElementById("borneYDroite").value) && valeur>1){ nouvelleValeur=nouvelleValeur+1 }
if (nouvelleValeur == parseFloat(document.getElementById("borneYDroite").value) && valeur<1){ nouvelleValeur=nouvelleValeur-1 }
document.getElementById("borneYDroite").value = nouvelleValeur
if(Math.abs(parseFloat(document.getElementById("borneXGauche").value) - parseFloat(document.getElementById("borneXDroite").value)) == 0){reinitialiserZoom(1)}
if(Math.abs(parseFloat(document.getElementById("borneYGauche").value) - parseFloat(document.getElementById("borneYDroite").value)) == 0){reinitialiserZoom(1)}
actualiserGraph()
}
// Permet de réinitialiser le zoom à la valeur donnée.
function reinitialiserZoom(valeur){
document.getElementById("borneXGauche").value = -valeur
document.getElementById("borneXDroite").value = valeur
document.getElementById("borneYGauche").value = -valeur
document.getElementById("borneYDroite").value = valeur
angle = Math.PI/8
valeurZoom3D = 1
gauche3D = -6.5
droite3D = 6.5
precisionDroite3D = 0.02
precisionFonction3D = 0.2
document.getElementById("inputPrecision3D").value = 0.2
actualiserGraph()
}
// Ces fonctions permettent de déplacer le graphique sur l'axe "x" et "y"
// Pour cela, elles redéfinissent la zone à afficher (à gauche dans les inputs)
function deplacerY(valeur){
document.getElementById("borneYGauche").value = parseFloat(document.getElementById("borneYGauche").value) + valeur
document.getElementById("borneYDroite").value = parseFloat(document.getElementById("borneYDroite").value) + valeur
actualiserGraph()
}
function deplacerX(valeur){
document.getElementById("borneXGauche").value = parseFloat(document.getElementById("borneXGauche").value) + valeur
document.getElementById("borneXDroite").value = parseFloat(document.getElementById("borneXDroite").value) + valeur
if(fonction3D){
angle = angle + valeur * Math.PI/8
}
actualiserGraph()
}
// Permet d'afficher la valeur en "y" pour un point donné en "x" // Permet d'afficher la valeur en "y" pour un point donné en "x"
function execute(fonction) { function calculerPoint() {
if(check(fonction)){ x = document.getElementById("inputX").value;
x = document.getElementById("inputX").value document.getElementById("outputX").innerHTML = " f(x) = "+fct.list[editeur.idFct].f(x)+"";
document.getElementById("outputX").innerHTML = " f(x) = "+eval(fonction)+"" //alert("Si x = "+x+" \nf(x) = "+eval(fonction)+"")
//alert("Si x = "+x+" \nf(x) = "+eval(fonction)+"")
}
}
// Ajoute la fonction mathématique se trouvant dans l'input en haut à une liste.
// Ceci est utile à l'affichage de plusieurs fonctions simultanées.
function menuFonctions(){
if(fonction3D){
afficherMenu('menuHistorique')
}
else{
afficherMenu('menuFonctions')
}
} }
function ajouterFonction(fct){
listeFonctions.push(fct)
listeCouleurs.push("rgba(0,171,255,0.9)")
actualiserListeFonctions()
}
function actualiserListeFonctions(){
var texteFctSupp = ""
for(var i=0; i<listeFonctions.length; i++){
texteFctSupp += 'f(x)='+listeFonctions[i]+' <input type="button" value="-" onclick="listeFonctions.splice('+i+', 1); actualiserListeFonctions()"/>'
texteFctSupp += ' <span id="FctSupp'+i+'" title="listeCouleurs['+i+']" class="boutonCouleur" onclick="colorPicker(this.id); afficherMenu(\'menuCouleur\')">....</span><br/>'
}
document.getElementById("fonctionsSupp").innerHTML = texteFctSupp
actualiserGraph()
}
function actualiserHistorique(){ // Historique
var texteHistorique = ""
for(var i=0; i<historique.length; i++){ var historique = {
texteHistorique += '<span class="survol" onclick="document.getElementById(\'inputEq\').value = ' liste : [],
texteHistorique += "'"+historique[i]+"'"+'; actualiserGraph()">'+historique[i]+'</span> <br/>'
actualiser : function(){
var texteHistorique = ""
for(var i=0; i<this.liste.length; i++){
texteHistorique += '<span class="survol" onclick="historique.use('+i+'); actualiserGraph()">';
texteHistorique += this.liste[i].readableText();
texteHistorique += '</span> <br/>';
}
document.getElementById("spanHistorique").innerHTML = texteHistorique
document.getElementById("divHistorique").scrollTop = 0
},
use : function(index){
fct.add(this.liste[index]);
},
ajouter : function(func){
if(func.fct == ""){
return;
}
for(var i=0; i<this.liste.length; i++){
if(this.liste[i].fct == func.fct){
this.liste.splice(i, 1);
}
}
var newFunction = fct.functionFromObject(func.get());
this.liste.unshift(newFunction);
this.actualiser();
saveOptions();
},
get: function(){
var list = [];
for(var i=0; i<this.liste.length; i++){
list.push(this.liste[i].get());
}
return list;
},
set: function(obj){
for(var i=0; i<obj.length; i++){
this.liste.push(fct.functionFromObject(obj[i]));
}
this.actualiser();
} }
document.getElementById("spanHistorique").innerHTML = texteHistorique
document.getElementById("divHistorique").scrollTop = 0
} }
// Permet de changer d'outil et de faire différentes actions lors du choix de l'outil
function choixOutil(nom){
outil = nom
if(outil == 'deplacement'){
document.getElementById("affichage").style.cursor = "move"
document.getElementById("info").style.display = "none"
}
else{
document.getElementById("affichage").style.cursor = "auto"
document.getElementById("info").style.display = "block"
}
if(outil == 'point'){ // Outils de la souris
document.getElementById("point").style.display = "block"
}
else{
document.getElementById("point").style.display = "none"
}
if(outil == 'tangente'){ var outil = {
document.getElementById("tangente").innerHTML = '<canvas id="canvasT" width="'+largeur+'" height="'+hauteur+'"></canvas>' //
ctxT = document.getElementById('canvasT').getContext('2d') idAffichage : "affichageOutils",
}
else{ // Outil sélectionné
document.getElementById("tangente").innerHTML = "" actuel : "point",
ctxT = null
} // Canvas
} canvas : null,
ctx : null,
width: 0,
height: 0,
// Liste des éléments à dessiner
liste : [],
// Fonction d'initialisation
init : function(width, height){
var element = document.getElementById(this.idAffichage);
if(element.hasChildNodes()){
while(element.childNodes.length >= 1 ){
element.removeChild(element.firstChild);
}
}
this.width = width || element.clientWidth;
this.height = height || element.clientHeight;
// element.style.width = affichage.largeur +"px";
// element.style.height = affichage.hauteur +"px";
// element.style.left = document.getElementById(affichage.id).offsetLeft+1 +"px";
// element.style.top = document.getElementById(affichage.id).offsetTop+1 +"px";
this.canvas = document.createElement("canvas");
this.canvas.width = this.width;
this.canvas.height = this.height;
element.appendChild(this.canvas);
this.ctx = this.canvas.getContext('2d');
},
// Permet de changer d'outil et de faire différentes actions lors du choix de l'outil
choisir : function(nom){
document.getElementById("pointTool").className = "toolButton";
document.getElementById("moveTool").className = "toolButton";
document.getElementById("tangentTool").className = "toolButton";
switch(nom){
case 'point':
document.getElementById("pointTool").className += " selectedTool";
break;
case 'deplacement':
document.getElementById("moveTool").className += " selectedTool";
break;
case 'tangente':
document.getElementById("tangentTool").className += " selectedTool";
break;
}
if(nom == 'deplacement'){
document.getElementById("eventAffichage").style.cursor = "move";
}
else{
document.getElementById("eventAffichage").style.cursor = "auto";
}
this.dessinerListe();
this.actuel = nom;
saveOptions();
},
// Gestion des événements reçus de l'objet souris
move : function(x, y, xInit, yInit, active){
switch(this.actuel){
case "deplacement":
if(active){
this.deplacement(x, y, xInit, yInit);
}
break;
case "point":
this.point(x, y);
break;
case "tangente":
this.tangente(x, y);
break;
}
},
down : function(x, y){
switch(this.actuel){
case "point":
this.point(x, y, true)
break;
case "tangente":
this.tangente(x, y, true);
break;
}
},
// Fonctions des outils
deplacement : function(x, y, xInit, yInit){
var valeurX = (x-xInit)/affichage.multX;
var valeurY = (yInit-y)/affichage.multY;
if(Math.round(Math.abs(valeurX)) > 0){
if(fonction3D){
affichage.deplacerX(Math.round(2*valeurX)/2);
}
else{
affichage.deplacerX(-Math.round(2*valeurX)/2);
}
souris.xInit = x;
}
if(Math.round(Math.abs(valeurY)) > 0){
affichage.deplacerY(-Math.round(2*valeurY)/2);
souris.yInit = y;
}
},
point : function(sourisX, sourisY, ajouterDansListe){
var ctx = new Object();
ctx = this.ctx;
// Dessiner les points et tangentes supplémentaires
this.dessinerListe();
for(var i=0; i<fct.list.length; i++){
var func = fct.list[i];
if(!func || func == ""){
continue;
}
// Position de la souris par rapport au coin supérieur gauche de l'affichage
var posX = sourisX - affichage.offsetLeft - 2;
// Valeur de la coordonnée x et y sous la souris
var t = posX / affichage.multX + affichage.xGauche;
if("startAngle" in func){
if(t < func.startAngle || t > func.endAngle){
continue;
}
}
var x = func.getX(t);
var y = func.getY(t);
// Afficher les coordonnées et le point sous la souris
if(!isNaN(x) && !isNaN(y)){
if(ajouterDansListe){
this.ajouterPoint(x, y, func.couleur);
}
this.dessinerPoint(x, y, func.couleur);
}
}
},
dessinerPoint : function(x, y, couleur){
var ctx = new Object();
ctx = this.ctx;
// Conversion des coordonnées
var posX = coordToPosX(x) + 1;
var posY = coordToPosY(y) + 1;
ctx.shadowColor = couleur;
ctx.shadowBlur = 4;
// Texte
var txtPos = "("+Math.round(x*100)/100+";"+Math.round(y*100)/100+")";
ctx.fillStyle = "rgba(255,255,255,0.5)";
try{
ctx.bulle(posX+7, posY-7, txtPos.length*5.5, 20);
}
catch(err){
ctx.fillRect(posX+7, posY-27, txtPos.length*5.5, 20);
}
ctx.fillStyle = "black";
ctx.shadowColor = "black";
ctx.shadowOffsetX = 1;
ctx.shadowOffsetY = 1;
ctx.shadowBlur = 2;
ctx.fillText(txtPos, posX+8+txtPos.length/4, posY-13);
// Rond
ctx.beginPath();
ctx.arc(posX, posY, 4, 0, 2*Math.PI, true);
ctx.shadowColor = couleur;
ctx.shadowOffsetX = 0;
ctx.shadowOffsetY = 0;
ctx.shadowBlur = 4;
// Fonctions servant à gérer les événements de la souris ctx.fillStyle = "rgba(0,0,0,1)";
function sourisDown(){ ctx.strokeStyle = "rgba(255,255,255,0.8)";
mouseDown = true ctx.lineWidth = 1;
posSourisXinit = posSourisX ctx.fill()
posSourisYinit = posSourisY ctx.stroke();
} },
function sourisUp(){
mouseDown = false tangente : function(sourisX, sourisY, ajouterDansListe){
} var delta = 0.001;
function sourisMove(event){
posSourisX = event.clientX var ctx = new Object();
posSourisY = event.clientY ctx = this.ctx;
if(mouseDown){
if(outil == "deplacement"){ // Dessiner les points et tangentes supplémentaires
var valeurX = (posSourisX-posSourisXinit)/multiplicateurX this.dessinerListe();
var valeurY = (posSourisYinit-posSourisY)/multiplicateurY
if(Math.round(Math.abs(valeurX)) > 0){ // Dessiner les tangentes des fonctions
deplacerX(-Math.round(2*valeurX)/2) for(var i=0; i<fct.list.length; i++){
posSourisXinit = posSourisX var func = fct.list[i];
// Vérifier la fonction sur laquelle doit s'appliquer l'outil
if(!func || func == ""){
continue;
} }
if(Math.round(Math.abs(valeurY)) > 0){
deplacerY(-Math.round(2*valeurY)/2) // Position de la souris par rapport au coin supérieur gauche de l'affichage
posSourisYinit = posSourisY var posX = sourisX - affichage.offsetLeft - 2;
// Valeur de la coordonnée x sous la souris
var t = posX / affichage.multX + affichage.xGauche;
if("startAngle" in func){
if(t < func.startAngle || t > func.endAngle){
continue;
}
}
var t1 = t + delta;
var x = func.getX(t);
var x1 = func.getX(t1);
// Calcul de deux valeurs y et de la pente
var y = func.getY(t);
var y1 = func.getY(t1);
var pente;
if(x1 != x){
pente = (y1-y)/(x1-x);
}
else{
pente = Number.POSITIVE_INFINITY;
}
// Dessiner la pente;
if(!isNaN(x) && !isNaN(y) && !isNaN(y1)){
if(ajouterDansListe){
this.ajouterTangente(x, y, pente, func.couleur);
}
this.dessinerTangente(x, y, pente, func.couleur);
} }
//decalageX = posSourisX-posSourisXinit
//decalageY = posSourisY-posSourisYinit
//actualiserGraph()
} }
} },
if(outil == "point"){ dessinerTangente : function(x, y, pente, couleur){
var position = Math.round((posSourisX-132)*(borneXDroite-borneXGauche)/(precision*500)) var ctx = new Object();
var positionX = pointX[position] ctx = this.ctx;
var positionY = pointY[position]
if(!isNaN(positionX) && !isNaN(positionY)){ // Conversion des coordonnées
document.getElementById("info").innerHTML = "("+Math.round((positionX/multiplicateurX+borneXGauche)*100)/100+";"+Math.round(-(positionY/multiplicateurY-borneYDroite)*100)/100+")" var posX = coordToPosX(x) + 1;
document.getElementById("point").style.left = (positionX+130-4)+"px" var posY = coordToPosY(y) + 1;
document.getElementById("point").style.top = (positionY+53-10)+"px"
// Carré
ctx.shadowColor = couleur;
ctx.shadowBlur = 4;
ctx.fillStyle = "white";
ctx.fillRect(posX-3, posY-3, 6, 6);
// Pente
ctx.strokeStyle = "white";
ctx.lineWidth = 2;
ctx.beginPath();
var pente2 = pente * (affichage.hauteur/affichage.largeur) * (affichage.xDroite-affichage.xGauche)/(affichage.yHaut-affichage.yBas);
ctx.moveTo(0, posY+posX*pente2);
ctx.lineTo(affichage.largeur, posY+posX*pente2-affichage.largeur*pente2);
ctx.stroke();
// Texte
var txtPente;
if(isFinite(pente)){
txtPente = pente.toFixed(2);
} }
} else{
if(outil == "tangente"){ txtPente = "∞"
var position = Math.round((posSourisX-129)/multiplicateurX/precision)
var positionX = pointX[position]
var positionY = pointY[position]
var valeurPente = ((hauteur-pente[position])/multiplicateurY+borneYGauche)
//hauteur - (((y-y1)/precision - borneYGauche)* multiplicateurY)
document.getElementById("info").innerHTML = "("+Math.round(valeurPente*100)/100+")"
ctxT.clearRect(0,0,largeur*2,hauteur*2)
if(!isNaN(positionX) && !isNaN(positionY)){
ctxT.fillStyle = "white"
ctxT.fillRect (positionX-1, positionY-2, 6, 6)
ctxT.strokeStyle = "white"
ctxT.lineWidth = 2
ctxT.beginPath()
valeurPente = valeurPente * (hauteur/largeur) * (borneXDroite-borneXGauche)/(borneYDroite-borneYGauche)
ctxT.moveTo(0+4, positionY+positionX*valeurPente+1)
ctxT.lineTo(largeur+4, positionY+positionX*valeurPente-largeur*valeurPente+1)
ctxT.stroke()
} }
ctx.fillStyle = "rgba(255,255,255,0.5)";
try{
ctx.bulle(posX+7, posY-7, txtPente.length*5.5+1, 20);
}
catch(err){
ctx.fillRect(posX+7, posY-27, txtPente.length*5.5, 20);
}
ctx.fillStyle = "black";
ctx.shadowColor = "black";
ctx.shadowOffsetX = 1;
ctx.shadowOffsetY = 1;
ctx.shadowBlur = 2;
ctx.fillText(txtPente, posX+8+txtPente.length/4, posY-13);
},
ajouterPoint : function(x, y, couleur){
var newPoint = {
x : x,
y : y,
couleur : couleur,
dessiner : function(){
outil.dessinerPoint(this.x, this.y, this.couleur);
}
};
this.liste.push(newPoint);
},
ajouterTangente : function(x, y, pente, couleur){
var newTangente = {
x : x,
y : y,
pente : pente,
couleur : couleur,
dessiner : function(){
outil.dessinerTangente(this.x, this.y, this.pente, this.couleur);
}
};
this.liste.push(newTangente);
},
dessinerListe : function(){
if(!this.ctx){
return;
}
this.ctx.clearRect(0,0,affichage.largeur*2,affichage.hauteur*2);
for(var i=0; i<this.liste.length; i++){
this.liste[i].dessiner();
}
this.actualiserListe();
},
actualiserListe : function(){
var element = document.getElementById("divSuppOutil");
element.innerHTML = "";
for(var i=0; i<this.liste.length; i++){
var posX = Math.floor(coordToPosX(this.liste[i].x, true)+9);
var posY = Math.floor(coordToPosY(this.liste[i].y, true)-28);
if(posX > affichage.largeur+affichage.offsetLeft || posX < affichage.offsetLeft || posY > affichage.hauteur+affichage.offsetTop || posX < affichage.offsetTop){
continue;
}
var txt = '<div style="left:'
txt += posX +'px;';
txt += 'top:'
txt += posY +'px;" ';
txt += 'onclick="'
txt += 'outil.supprimer('+i+')';
txt += '">x</div>';
// alert(txt);
element.innerHTML += txt;
}
},
supprimer : function(id){
outil.liste.splice(id, 1);
outil.dessinerListe();
// alert(id)
} }
//document.getElementById("info").innerHTML = " "+ (posSourisX-120) + ";" + (posSourisY-43) };
}
function doubleClick(ctrlKey){
if(ctrlKey){
zoom(1.25)
zoom3D(1.25)
}
else{
zoom(0.8)
zoom3D(0.8)
}
}
// Evènements du clavier // Evènements du clavier
function keyPress(event){ function keyPress(event){
switch(event.keyCode){ switch(event.keyCode){
case 27: case 27:
reset() // widget.resetState()
break break
case 37: case 37:
if(event.ctrlKey){ if(event.ctrlKey){
deplacerX(-1) affichage.deplacerX(-1)
} }
break break
case 38: case 38:
if(event.ctrlKey){ if(event.ctrlKey){
deplacerY(1) affichage.deplacerY(1)
} }
break break
case 39: case 39:
if(event.ctrlKey){ if(event.ctrlKey){
deplacerX(1) affichage.deplacerX(1)
} }
break break
case 40: case 40:
if(event.ctrlKey){ if(event.ctrlKey){
deplacerY(-1) affichage.deplacerY(-1)
} }
break break
default: default:
...@@ -255,32 +449,10 @@ function keyPress(event){ ...@@ -255,32 +449,10 @@ function keyPress(event){
} }
// ---- Fonctions de test ----
function testSVG(){
document.getElementById("affichage").innerHTML = '<svg:svg width="100%" height="100%" version="1.1" xmlns="http://www.w3.org/2000/svg"> <svg:line x1="0" y1="0" x2="300" y2="300" style="stroke:rgb(99,99,99);stroke-width:2"/> </svg:svg> '
}
function testCanvas(){
document.getElementById("affichage").innerHTML = '<canvas id="canvas" width="'+largeur+'" height="'+hauteur+'"></canvas>'
ctx = document.getElementById('canvas').getContext('2d')
var lingrad = ctx.createLinearGradient(100,100,largeur-100,hauteur-100)
lingrad.addColorStop(0, 'rgba(0,50,255,1)')
lingrad.addColorStop(1, 'rgba(0,255,255,1)')
ctx.fillStyle = lingrad
ctx.textAlign = "center"
ctx.font = "72px bold"
ctx.fillText("Canvas", largeur/2, hauteur/2-1)
}
function testXPM(){
document.getElementById("affichage").innerHTML = '<img src='+"'"+'data:image/xpm;ASCII,/* XPM */static char * text_xpm[] = {"100 50 2 1"," c None",". c #000000"," "," "," "," "," "," "," "," "," "," "," ..... ..... ............... ....... ....... "," ..... ..... .................. ....... ....... "," .... ..... ................... ........ ........ "," ..... ..... .................... ........ ........ "," ..... ..... .... ....... ........ ........ "," .... ..... .... ..... ......... ......... "," ..... ..... .... .... .... .... .... .... "," ..... ..... .... ..... .... ..... ..... .... "," .... ..... .... .... .... .... .... .... "," ..... ..... .... .... .... .... .... .... "," ..... ..... .... .... .... ..... ..... .... "," ..... ..... .... .... .... .... .... .... "," ......... .... ..... .... .... .... .... "," ........ .... .... .... .... .... .... "," ....... .... ..... .... .... .... .... "," ..... .... ....... .... ..... ..... .... "," ...... .................... .... .... .... .... "," ....... ................... .... .... .... .... "," ........ .................. .... ..... ..... .... "," .......... ............... .... .... .... .... "," ..... ..... .... .... ..... ..... .... "," .... ..... .... .... .... .... .... "," ..... .... .... .... ......... .... "," ..... ..... .... .... ......... .... "," ..... ..... .... .... ....... .... "," ..... .... .... .... ....... .... "," ..... ..... .... .... ..... .... "," ..... ..... .... .... ..... .... "," ..... .... .... .... .... "," ..... ..... .... .... .... "," ..... ..... .... .... .... "," ..... .... .... .... .... "," ..... ..... .... .... .... "," ..... ..... .... .... .... "," "," "," "," "," "," "};'+"'"+'width="500" height="330"/>'
}
// ---- Aire sous la fonction (intégrale) ---- // ---- Aire sous la fonction (intégrale) ----
function AireSousFct(fct, a, b, n){ function AireSousFct(fct, a, b, n){
var aire, largeurRect, gaucheRect, droiteRect, millieuRect, hauteurRect, aireRect; var aire, largeurRect, gaucheRect, droiteRect, millieuRect, hauteurRect, aireRect;
var f = function(x){ var f = new Function("x", "return "+fct);
return eval(fct);
};
aire = 0; aire = 0;
largeurRect = (b-a)/n; largeurRect = (b-a)/n;
for(var i=0; i<n; i++){ for(var i=0; i<n; i++){
...@@ -296,13 +468,83 @@ function AireSousFct(fct, a, b, n){ ...@@ -296,13 +468,83 @@ function AireSousFct(fct, a, b, n){
} }
function calculerAire(){ function calculerAire(){
var fonction = document.getElementById("inputEq").value var fonction = fct.remplacer(fct.verifier(fct.list[editeur.idFct].fct));
if(check(fonction)){ var a = parseInt(document.getElementById("aireG").value);
var a = parseInt(document.getElementById("aireG").value); var b = parseInt(document.getElementById("aireD").value);
var b = parseInt(document.getElementById("aireD").value); var n = 50;
var n = 50; var arrondi = Math.round(AireSousFct(fonction, a, b, n)*1000)/1000;
var arrondi = Math.round(AireSousFct(fonction, a, b, n)*1000)/1000; document.getElementById("outputAire").innerHTML = "A = " + arrondi;
document.getElementById("outputAire").innerHTML = "A = " + arrondi;
}
actualiserGraph(); actualiserGraph();
} }
\ No newline at end of file
// ---- Sauvegarde du graphique ----
var backgroundSauvegarde = "rgba(0,0,0,0.5)";
function saveGraph(){
var userWidth = parseInt(document.getElementById("saveWidth").value);
var userHeight = parseInt(document.getElementById("saveHeight").value);
if(userWidth <= 0 || userHeight <= 0){
userWidth = affichage.width;
userHeight = affichage.height;
}
if(fonction3D){
var background = display3D.background;
display3D.background = backgroundSauvegarde;
display3D.init(userWidth, userHeight);
display3D.draw();
var dataURL;
if(document.getElementById("selectSaveType").value == "jpg"){
dataURL = display3D.canvas.toDataURL("image/jpeg");
}
else{
dataURL = display3D.canvas.toDataURL();
}
document.getElementById("saveImageContent").innerHTML = '<img src="' + dataURL + '"/>';
afficherMenu('menuSaveImage');
display3D.background = background;
setTimeout(function(){
display3D.init();
display3D.draw();
}, 1);
}
else{
if(affichage.methode == "canvas"){
var l = affichage.largeur;
var h = affichage.hauteur;
var c = affichage.couleurFond;
affichage.largeur = parseInt(document.getElementById("saveWidth").value);
affichage.hauteur = parseInt(document.getElementById("saveHeight").value);
affichage.couleurFond = backgroundSauvegarde;
var newDiv = document.createElement("div");
affichage.init(newDiv, userWidth, userHeight);
outil.init();
outil.dessinerListe();
affichage.ctx.drawImage(outil.canvas,0,0);
var dataURL;
if(document.getElementById("selectSaveType").value == "jpg"){
dataURL = affichage.canvas.toDataURL("image/jpeg");
}
else{
dataURL = affichage.canvas.toDataURL();
}
document.getElementById("saveImageContent").innerHTML = '<img src="' + dataURL + '"/>';
afficherMenu('menuSaveImage');
affichage.largeur = l;
affichage.hauteur = h;
affichage.couleurFond = c;
affichage.init();
outil.init();
}
else if(affichage.methode == "svg"){
window.open("JavaScript/AffichageSVG.svg");
}
}
}
var listeOptions = ["theme","precision","decalageX","decalageY","epaisseur","grille","axes","echelle","zoom","methode","methode3D","precision3D","maj"]; // Fonctions permettant de sauvegarder les options
var optionsLoaded = false;
function setCookie(nom,valeur){ function setCookie(nom,valeur){
var jours = 545; // Durée de validité des cookies var jours = 545; // Durée de validité des cookies
...@@ -31,89 +33,74 @@ function delCookie(nom){ ...@@ -31,89 +33,74 @@ function delCookie(nom){
} }
function saveOptions(){ function saveOptions(){
setCookie("theme",document.getElementById("selectTheme").value); if(!optionsLoaded){
setCookie("precision",document.getElementById("inputPrecision").value); return;
setCookie("decalageX",document.getElementById("inputDecalageX").value); }
setCookie("decalageY",document.getElementById("inputDecalageY").value); var state = JSON.stringify(widget.getState());
setCookie("epaisseur",document.getElementById("inputTaille").value); if(window.sankore){
setCookie("grille",document.getElementById("checkGrille").checked); sankore.setPreference("state", state);
setCookie("axes",document.getElementById("checkAxes").checked); }
setCookie("echelle",document.getElementById("checkEchelle").checked); else if(navigator.cookieEnabled){
setCookie("zoom",document.getElementById("zoomDefaut").value); setCookie("state", state);
setCookie("methode",document.getElementById("selectMethodeAffichage").value); }
setCookie("methode3D",document.getElementById("selectAffichage3D").value);
setCookie("precision3D",document.getElementById("inputPrecision3D").value);
setCookie("maj",document.getElementById("checkMaJ").checked);
document.getElementById("infoSauvegarde").style.display = "block"
} }
function loadOptions(){ function loadOptions(){
if(navigator.cookieEnabled){ var state;
if(checkOptions()){ if(window.sankore){
document.getElementById("selectTheme").value = getCookie("theme"); state = sankore.preference("state", null);
changerTheme(document.getElementById("selectTheme").value); }
document.getElementById("inputPrecision").value = getCookie("precision"); else if(navigator.cookieEnabled){
document.getElementById("inputDecalageX").value = getCookie("decalageX"); state = getCookie("state");
document.getElementById("inputDecalageY").value = getCookie("decalageY"); }
document.getElementById("inputTaille").value = getCookie("epaisseur"); if(!state){
if(getCookie("grille")=="true"){ optionsLoaded = true;
document.getElementById("checkGrille").checked = true; return;
}
else{
document.getElementById("checkGrille").checked = false;
}
if(getCookie("axes")=="true"){
document.getElementById("checkAxes").checked = true;
}
else{
document.getElementById("checkAxes").checked = false;
}
if(getCookie("echelle")=="true"){
document.getElementById("checkEchelle").checked = true;
}
else{
document.getElementById("checkEchelle").checked = false;
}
document.getElementById("zoomDefaut").value = getCookie("zoom");
document.getElementById("selectMethodeAffichage").value = getCookie("methode");
document.getElementById("selectAffichage3D").value = getCookie("methode3D");
document.getElementById("inputPrecision3D").value = getCookie("precision3D");
if(getCookie("maj")=="true"){
document.getElementById("checkMaJ").checked = true;
}
else{
document.getElementById("checkMaJ").checked = false;
}
actualiserGraph();
}
else{
if(document.cookie!=""){
alert("It's can't be downloaded ...");
}
}
} }
else{ var stateObject = JSON.parse(state);
document.getElementById("cacheCookies").style.display = "block"; var goodState = widget.getState();
if(!checkState(stateObject, goodState)){
loadOptionsFailed();
}
try{
widget.setState(stateObject);
optionsLoaded = true;
}
catch(e){
loadOptionsFailed();
} }
} }
function delOptions(){ function loadOptionsFailed(){
var i; var text = "Unable to load the saved parameters...";
for(i=0; i<listeOptions.length; i++){ try{
delCookie(listeOptions[i]); text = languages.getText("unableLoadParameters");
} }
catch(e){}
alert(text);
delOptions();
} }
function checkOptions(){ function checkState(state, goodState){
var test = true; for(var i in goodState){
for(i=0; i<listeOptions.length; i++){ if(! i in state){
if(getCookie(listeOptions[i])==""){ return false;
test = false;
} }
} }
return test; return true;
}
function delOptions(){
if(window.sankore){
sankore.setPreference("state", "");
}
else if(navigator.cookieEnabled){
delCookie("state");
}
} }
function alertOptions(){ function alertOptions(){
alert(sankoreLang[lang].show_saved + "\n------------------------------------------------------------\n"+document.cookie); // alert("Options actuellement sauvegardées\n------------------------------------------------------------\n"+document.cookie);
} document.getElementById("divAlertCookies").innerHTML = document.cookie;
\ No newline at end of file afficherMenu("menuAlertCookies");
}
/*
* jQuery JavaScript Library v1.3.2
* http://jquery.com/
*
* Copyright (c) 2009 John Resig
* Dual licensed under the MIT and GPL licenses.
* http://docs.jquery.com/License
*
* Date: 2009-02-19 17:34:21 -0500 (Thu, 19 Feb 2009)
* Revision: 6246
*/
(function(){var l=this,g,y=l.jQuery,p=l.$,o=l.jQuery=l.$=function(E,F){return new o.fn.init(E,F)},D=/^[^<]*(<(.|\s)+>)[^>]*$|^#([\w-]+)$/,f=/^.[^:#\[\.,]*$/;o.fn=o.prototype={init:function(E,H){E=E||document;if(E.nodeType){this[0]=E;this.length=1;this.context=E;return this}if(typeof E==="string"){var G=D.exec(E);if(G&&(G[1]||!H)){if(G[1]){E=o.clean([G[1]],H)}else{var I=document.getElementById(G[3]);if(I&&I.id!=G[3]){return o().find(E)}var F=o(I||[]);F.context=document;F.selector=E;return F}}else{return o(H).find(E)}}else{if(o.isFunction(E)){return o(document).ready(E)}}if(E.selector&&E.context){this.selector=E.selector;this.context=E.context}return this.setArray(o.isArray(E)?E:o.makeArray(E))},selector:"",jquery:"1.3.2",size:function(){return this.length},get:function(E){return E===g?Array.prototype.slice.call(this):this[E]},pushStack:function(F,H,E){var G=o(F);G.prevObject=this;G.context=this.context;if(H==="find"){G.selector=this.selector+(this.selector?" ":"")+E}else{if(H){G.selector=this.selector+"."+H+"("+E+")"}}return G},setArray:function(E){this.length=0;Array.prototype.push.apply(this,E);return this},each:function(F,E){return o.each(this,F,E)},index:function(E){return o.inArray(E&&E.jquery?E[0]:E,this)},attr:function(F,H,G){var E=F;if(typeof F==="string"){if(H===g){return this[0]&&o[G||"attr"](this[0],F)}else{E={};E[F]=H}}return this.each(function(I){for(F in E){o.attr(G?this.style:this,F,o.prop(this,E[F],G,I,F))}})},css:function(E,F){if((E=="width"||E=="height")&&parseFloat(F)<0){F=g}return this.attr(E,F,"curCSS")},text:function(F){if(typeof F!=="object"&&F!=null){return this.empty().append((this[0]&&this[0].ownerDocument||document).createTextNode(F))}var E="";o.each(F||this,function(){o.each(this.childNodes,function(){if(this.nodeType!=8){E+=this.nodeType!=1?this.nodeValue:o.fn.text([this])}})});return E},wrapAll:function(E){if(this[0]){var F=o(E,this[0].ownerDocument).clone();if(this[0].parentNode){F.insertBefore(this[0])}F.map(function(){var G=this;while(G.firstChild){G=G.firstChild}return G}).append(this)}return this},wrapInner:function(E){return this.each(function(){o(this).contents().wrapAll(E)})},wrap:function(E){return this.each(function(){o(this).wrapAll(E)})},append:function(){return this.domManip(arguments,true,function(E){if(this.nodeType==1){this.appendChild(E)}})},prepend:function(){return this.domManip(arguments,true,function(E){if(this.nodeType==1){this.insertBefore(E,this.firstChild)}})},before:function(){return this.domManip(arguments,false,function(E){this.parentNode.insertBefore(E,this)})},after:function(){return this.domManip(arguments,false,function(E){this.parentNode.insertBefore(E,this.nextSibling)})},end:function(){return this.prevObject||o([])},push:[].push,sort:[].sort,splice:[].splice,find:function(E){if(this.length===1){var F=this.pushStack([],"find",E);F.length=0;o.find(E,this[0],F);return F}else{return this.pushStack(o.unique(o.map(this,function(G){return o.find(E,G)})),"find",E)}},clone:function(G){var E=this.map(function(){if(!o.support.noCloneEvent&&!o.isXMLDoc(this)){var I=this.outerHTML;if(!I){var J=this.ownerDocument.createElement("div");J.appendChild(this.cloneNode(true));I=J.innerHTML}return o.clean([I.replace(/ jQuery\d+="(?:\d+|null)"/g,"").replace(/^\s*/,"")])[0]}else{return this.cloneNode(true)}});if(G===true){var H=this.find("*").andSelf(),F=0;E.find("*").andSelf().each(function(){if(this.nodeName!==H[F].nodeName){return}var I=o.data(H[F],"events");for(var K in I){for(var J in I[K]){o.event.add(this,K,I[K][J],I[K][J].data)}}F++})}return E},filter:function(E){return this.pushStack(o.isFunction(E)&&o.grep(this,function(G,F){return E.call(G,F)})||o.multiFilter(E,o.grep(this,function(F){return F.nodeType===1})),"filter",E)},closest:function(E){var G=o.expr.match.POS.test(E)?o(E):null,F=0;return this.map(function(){var H=this;while(H&&H.ownerDocument){if(G?G.index(H)>-1:o(H).is(E)){o.data(H,"closest",F);return H}H=H.parentNode;F++}})},not:function(E){if(typeof E==="string"){if(f.test(E)){return this.pushStack(o.multiFilter(E,this,true),"not",E)}else{E=o.multiFilter(E,this)}}var F=E.length&&E[E.length-1]!==g&&!E.nodeType;return this.filter(function(){return F?o.inArray(this,E)<0:this!=E})},add:function(E){return this.pushStack(o.unique(o.merge(this.get(),typeof E==="string"?o(E):o.makeArray(E))))},is:function(E){return !!E&&o.multiFilter(E,this).length>0},hasClass:function(E){return !!E&&this.is("."+E)},val:function(K){if(K===g){var E=this[0];if(E){if(o.nodeName(E,"option")){return(E.attributes.value||{}).specified?E.value:E.text}if(o.nodeName(E,"select")){var I=E.selectedIndex,L=[],M=E.options,H=E.type=="select-one";if(I<0){return null}for(var F=H?I:0,J=H?I+1:M.length;F<J;F++){var G=M[F];if(G.selected){K=o(G).val();if(H){return K}L.push(K)}}return L}return(E.value||"").replace(/\r/g,"")}return g}if(typeof K==="number"){K+=""}return this.each(function(){if(this.nodeType!=1){return}if(o.isArray(K)&&/radio|checkbox/.test(this.type)){this.checked=(o.inArray(this.value,K)>=0||o.inArray(this.name,K)>=0)}else{if(o.nodeName(this,"select")){var N=o.makeArray(K);o("option",this).each(function(){this.selected=(o.inArray(this.value,N)>=0||o.inArray(this.text,N)>=0)});if(!N.length){this.selectedIndex=-1}}else{this.value=K}}})},html:function(E){return E===g?(this[0]?this[0].innerHTML.replace(/ jQuery\d+="(?:\d+|null)"/g,""):null):this.empty().append(E)},replaceWith:function(E){return this.after(E).remove()},eq:function(E){return this.slice(E,+E+1)},slice:function(){return this.pushStack(Array.prototype.slice.apply(this,arguments),"slice",Array.prototype.slice.call(arguments).join(","))},map:function(E){return this.pushStack(o.map(this,function(G,F){return E.call(G,F,G)}))},andSelf:function(){return this.add(this.prevObject)},domManip:function(J,M,L){if(this[0]){var I=(this[0].ownerDocument||this[0]).createDocumentFragment(),F=o.clean(J,(this[0].ownerDocument||this[0]),I),H=I.firstChild;if(H){for(var G=0,E=this.length;G<E;G++){L.call(K(this[G],H),this.length>1||G>0?I.cloneNode(true):I)}}if(F){o.each(F,z)}}return this;function K(N,O){return M&&o.nodeName(N,"table")&&o.nodeName(O,"tr")?(N.getElementsByTagName("tbody")[0]||N.appendChild(N.ownerDocument.createElement("tbody"))):N}}};o.fn.init.prototype=o.fn;function z(E,F){if(F.src){o.ajax({url:F.src,async:false,dataType:"script"})}else{o.globalEval(F.text||F.textContent||F.innerHTML||"")}if(F.parentNode){F.parentNode.removeChild(F)}}function e(){return +new Date}o.extend=o.fn.extend=function(){var J=arguments[0]||{},H=1,I=arguments.length,E=false,G;if(typeof J==="boolean"){E=J;J=arguments[1]||{};H=2}if(typeof J!=="object"&&!o.isFunction(J)){J={}}if(I==H){J=this;--H}for(;H<I;H++){if((G=arguments[H])!=null){for(var F in G){var K=J[F],L=G[F];if(J===L){continue}if(E&&L&&typeof L==="object"&&!L.nodeType){J[F]=o.extend(E,K||(L.length!=null?[]:{}),L)}else{if(L!==g){J[F]=L}}}}}return J};var b=/z-?index|font-?weight|opacity|zoom|line-?height/i,q=document.defaultView||{},s=Object.prototype.toString;o.extend({noConflict:function(E){l.$=p;if(E){l.jQuery=y}return o},isFunction:function(E){return s.call(E)==="[object Function]"},isArray:function(E){return s.call(E)==="[object Array]"},isXMLDoc:function(E){return E.nodeType===9&&E.documentElement.nodeName!=="HTML"||!!E.ownerDocument&&o.isXMLDoc(E.ownerDocument)},globalEval:function(G){if(G&&/\S/.test(G)){var F=document.getElementsByTagName("head")[0]||document.documentElement,E=document.createElement("script");E.type="text/javascript";if(o.support.scriptEval){E.appendChild(document.createTextNode(G))}else{E.text=G}F.insertBefore(E,F.firstChild);F.removeChild(E)}},nodeName:function(F,E){return F.nodeName&&F.nodeName.toUpperCase()==E.toUpperCase()},each:function(G,K,F){var E,H=0,I=G.length;if(F){if(I===g){for(E in G){if(K.apply(G[E],F)===false){break}}}else{for(;H<I;){if(K.apply(G[H++],F)===false){break}}}}else{if(I===g){for(E in G){if(K.call(G[E],E,G[E])===false){break}}}else{for(var J=G[0];H<I&&K.call(J,H,J)!==false;J=G[++H]){}}}return G},prop:function(H,I,G,F,E){if(o.isFunction(I)){I=I.call(H,F)}return typeof I==="number"&&G=="curCSS"&&!b.test(E)?I+"px":I},className:{add:function(E,F){o.each((F||"").split(/\s+/),function(G,H){if(E.nodeType==1&&!o.className.has(E.className,H)){E.className+=(E.className?" ":"")+H}})},remove:function(E,F){if(E.nodeType==1){E.className=F!==g?o.grep(E.className.split(/\s+/),function(G){return !o.className.has(F,G)}).join(" "):""}},has:function(F,E){return F&&o.inArray(E,(F.className||F).toString().split(/\s+/))>-1}},swap:function(H,G,I){var E={};for(var F in G){E[F]=H.style[F];H.style[F]=G[F]}I.call(H);for(var F in G){H.style[F]=E[F]}},css:function(H,F,J,E){if(F=="width"||F=="height"){var L,G={position:"absolute",visibility:"hidden",display:"block"},K=F=="width"?["Left","Right"]:["Top","Bottom"];function I(){L=F=="width"?H.offsetWidth:H.offsetHeight;if(E==="border"){return}o.each(K,function(){if(!E){L-=parseFloat(o.curCSS(H,"padding"+this,true))||0}if(E==="margin"){L+=parseFloat(o.curCSS(H,"margin"+this,true))||0}else{L-=parseFloat(o.curCSS(H,"border"+this+"Width",true))||0}})}if(H.offsetWidth!==0){I()}else{o.swap(H,G,I)}return Math.max(0,Math.round(L))}return o.curCSS(H,F,J)},curCSS:function(I,F,G){var L,E=I.style;if(F=="opacity"&&!o.support.opacity){L=o.attr(E,"opacity");return L==""?"1":L}if(F.match(/float/i)){F=w}if(!G&&E&&E[F]){L=E[F]}else{if(q.getComputedStyle){if(F.match(/float/i)){F="float"}F=F.replace(/([A-Z])/g,"-$1").toLowerCase();var M=q.getComputedStyle(I,null);if(M){L=M.getPropertyValue(F)}if(F=="opacity"&&L==""){L="1"}}else{if(I.currentStyle){var J=F.replace(/\-(\w)/g,function(N,O){return O.toUpperCase()});L=I.currentStyle[F]||I.currentStyle[J];if(!/^\d+(px)?$/i.test(L)&&/^\d/.test(L)){var H=E.left,K=I.runtimeStyle.left;I.runtimeStyle.left=I.currentStyle.left;E.left=L||0;L=E.pixelLeft+"px";E.left=H;I.runtimeStyle.left=K}}}}return L},clean:function(F,K,I){K=K||document;if(typeof K.createElement==="undefined"){K=K.ownerDocument||K[0]&&K[0].ownerDocument||document}if(!I&&F.length===1&&typeof F[0]==="string"){var H=/^<(\w+)\s*\/?>$/.exec(F[0]);if(H){return[K.createElement(H[1])]}}var G=[],E=[],L=K.createElement("div");o.each(F,function(P,S){if(typeof S==="number"){S+=""}if(!S){return}if(typeof S==="string"){S=S.replace(/(<(\w+)[^>]*?)\/>/g,function(U,V,T){return T.match(/^(abbr|br|col|img|input|link|meta|param|hr|area|embed)$/i)?U:V+"></"+T+">"});var O=S.replace(/^\s+/,"").substring(0,10).toLowerCase();var Q=!O.indexOf("<opt")&&[1,"<select multiple='multiple'>","</select>"]||!O.indexOf("<leg")&&[1,"<fieldset>","</fieldset>"]||O.match(/^<(thead|tbody|tfoot|colg|cap)/)&&[1,"<table>","</table>"]||!O.indexOf("<tr")&&[2,"<table><tbody>","</tbody></table>"]||(!O.indexOf("<td")||!O.indexOf("<th"))&&[3,"<table><tbody><tr>","</tr></tbody></table>"]||!O.indexOf("<col")&&[2,"<table><tbody></tbody><colgroup>","</colgroup></table>"]||!o.support.htmlSerialize&&[1,"div<div>","</div>"]||[0,"",""];L.innerHTML=Q[1]+S+Q[2];while(Q[0]--){L=L.lastChild}if(!o.support.tbody){var R=/<tbody/i.test(S),N=!O.indexOf("<table")&&!R?L.firstChild&&L.firstChild.childNodes:Q[1]=="<table>"&&!R?L.childNodes:[];for(var M=N.length-1;M>=0;--M){if(o.nodeName(N[M],"tbody")&&!N[M].childNodes.length){N[M].parentNode.removeChild(N[M])}}}if(!o.support.leadingWhitespace&&/^\s/.test(S)){L.insertBefore(K.createTextNode(S.match(/^\s*/)[0]),L.firstChild)}S=o.makeArray(L.childNodes)}if(S.nodeType){G.push(S)}else{G=o.merge(G,S)}});if(I){for(var J=0;G[J];J++){if(o.nodeName(G[J],"script")&&(!G[J].type||G[J].type.toLowerCase()==="text/javascript")){E.push(G[J].parentNode?G[J].parentNode.removeChild(G[J]):G[J])}else{if(G[J].nodeType===1){G.splice.apply(G,[J+1,0].concat(o.makeArray(G[J].getElementsByTagName("script"))))}I.appendChild(G[J])}}return E}return G},attr:function(J,G,K){if(!J||J.nodeType==3||J.nodeType==8){return g}var H=!o.isXMLDoc(J),L=K!==g;G=H&&o.props[G]||G;if(J.tagName){var F=/href|src|style/.test(G);if(G=="selected"&&J.parentNode){J.parentNode.selectedIndex}if(G in J&&H&&!F){if(L){if(G=="type"&&o.nodeName(J,"input")&&J.parentNode){throw"type property can't be changed"}J[G]=K}if(o.nodeName(J,"form")&&J.getAttributeNode(G)){return J.getAttributeNode(G).nodeValue}if(G=="tabIndex"){var I=J.getAttributeNode("tabIndex");return I&&I.specified?I.value:J.nodeName.match(/(button|input|object|select|textarea)/i)?0:J.nodeName.match(/^(a|area)$/i)&&J.href?0:g}return J[G]}if(!o.support.style&&H&&G=="style"){return o.attr(J.style,"cssText",K)}if(L){J.setAttribute(G,""+K)}var E=!o.support.hrefNormalized&&H&&F?J.getAttribute(G,2):J.getAttribute(G);return E===null?g:E}if(!o.support.opacity&&G=="opacity"){if(L){J.zoom=1;J.filter=(J.filter||"").replace(/alpha\([^)]*\)/,"")+(parseInt(K)+""=="NaN"?"":"alpha(opacity="+K*100+")")}return J.filter&&J.filter.indexOf("opacity=")>=0?(parseFloat(J.filter.match(/opacity=([^)]*)/)[1])/100)+"":""}G=G.replace(/-([a-z])/ig,function(M,N){return N.toUpperCase()});if(L){J[G]=K}return J[G]},trim:function(E){return(E||"").replace(/^\s+|\s+$/g,"")},makeArray:function(G){var E=[];if(G!=null){var F=G.length;if(F==null||typeof G==="string"||o.isFunction(G)||G.setInterval){E[0]=G}else{while(F){E[--F]=G[F]}}}return E},inArray:function(G,H){for(var E=0,F=H.length;E<F;E++){if(H[E]===G){return E}}return -1},merge:function(H,E){var F=0,G,I=H.length;if(!o.support.getAll){while((G=E[F++])!=null){if(G.nodeType!=8){H[I++]=G}}}else{while((G=E[F++])!=null){H[I++]=G}}return H},unique:function(K){var F=[],E={};try{for(var G=0,H=K.length;G<H;G++){var J=o.data(K[G]);if(!E[J]){E[J]=true;F.push(K[G])}}}catch(I){F=K}return F},grep:function(F,J,E){var G=[];for(var H=0,I=F.length;H<I;H++){if(!E!=!J(F[H],H)){G.push(F[H])}}return G},map:function(E,J){var F=[];for(var G=0,H=E.length;G<H;G++){var I=J(E[G],G);if(I!=null){F[F.length]=I}}return F.concat.apply([],F)}});var C=navigator.userAgent.toLowerCase();o.browser={version:(C.match(/.+(?:rv|it|ra|ie)[\/: ]([\d.]+)/)||[0,"0"])[1],safari:/webkit/.test(C),opera:/opera/.test(C),msie:/msie/.test(C)&&!/opera/.test(C),mozilla:/mozilla/.test(C)&&!/(compatible|webkit)/.test(C)};o.each({parent:function(E){return E.parentNode},parents:function(E){return o.dir(E,"parentNode")},next:function(E){return o.nth(E,2,"nextSibling")},prev:function(E){return o.nth(E,2,"previousSibling")},nextAll:function(E){return o.dir(E,"nextSibling")},prevAll:function(E){return o.dir(E,"previousSibling")},siblings:function(E){return o.sibling(E.parentNode.firstChild,E)},children:function(E){return o.sibling(E.firstChild)},contents:function(E){return o.nodeName(E,"iframe")?E.contentDocument||E.contentWindow.document:o.makeArray(E.childNodes)}},function(E,F){o.fn[E]=function(G){var H=o.map(this,F);if(G&&typeof G=="string"){H=o.multiFilter(G,H)}return this.pushStack(o.unique(H),E,G)}});o.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(E,F){o.fn[E]=function(G){var J=[],L=o(G);for(var K=0,H=L.length;K<H;K++){var I=(K>0?this.clone(true):this).get();o.fn[F].apply(o(L[K]),I);J=J.concat(I)}return this.pushStack(J,E,G)}});o.each({removeAttr:function(E){o.attr(this,E,"");if(this.nodeType==1){this.removeAttribute(E)}},addClass:function(E){o.className.add(this,E)},removeClass:function(E){o.className.remove(this,E)},toggleClass:function(F,E){if(typeof E!=="boolean"){E=!o.className.has(this,F)}o.className[E?"add":"remove"](this,F)},remove:function(E){if(!E||o.filter(E,[this]).length){o("*",this).add([this]).each(function(){o.event.remove(this);o.removeData(this)});if(this.parentNode){this.parentNode.removeChild(this)}}},empty:function(){o(this).children().remove();while(this.firstChild){this.removeChild(this.firstChild)}}},function(E,F){o.fn[E]=function(){return this.each(F,arguments)}});function j(E,F){return E[0]&&parseInt(o.curCSS(E[0],F,true),10)||0}var h="jQuery"+e(),v=0,A={};o.extend({cache:{},data:function(F,E,G){F=F==l?A:F;var H=F[h];if(!H){H=F[h]=++v}if(E&&!o.cache[H]){o.cache[H]={}}if(G!==g){o.cache[H][E]=G}return E?o.cache[H][E]:H},removeData:function(F,E){F=F==l?A:F;var H=F[h];if(E){if(o.cache[H]){delete o.cache[H][E];E="";for(E in o.cache[H]){break}if(!E){o.removeData(F)}}}else{try{delete F[h]}catch(G){if(F.removeAttribute){F.removeAttribute(h)}}delete o.cache[H]}},queue:function(F,E,H){if(F){E=(E||"fx")+"queue";var G=o.data(F,E);if(!G||o.isArray(H)){G=o.data(F,E,o.makeArray(H))}else{if(H){G.push(H)}}}return G},dequeue:function(H,G){var E=o.queue(H,G),F=E.shift();if(!G||G==="fx"){F=E[0]}if(F!==g){F.call(H)}}});o.fn.extend({data:function(E,G){var H=E.split(".");H[1]=H[1]?"."+H[1]:"";if(G===g){var F=this.triggerHandler("getData"+H[1]+"!",[H[0]]);if(F===g&&this.length){F=o.data(this[0],E)}return F===g&&H[1]?this.data(H[0]):F}else{return this.trigger("setData"+H[1]+"!",[H[0],G]).each(function(){o.data(this,E,G)})}},removeData:function(E){return this.each(function(){o.removeData(this,E)})},queue:function(E,F){if(typeof E!=="string"){F=E;E="fx"}if(F===g){return o.queue(this[0],E)}return this.each(function(){var G=o.queue(this,E,F);if(E=="fx"&&G.length==1){G[0].call(this)}})},dequeue:function(E){return this.each(function(){o.dequeue(this,E)})}});
/*
* Sizzle CSS Selector Engine - v0.9.3
* Copyright 2009, The Dojo Foundation
* Released under the MIT, BSD, and GPL Licenses.
* More information: http://sizzlejs.com/
*/
(function(){var R=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^[\]]*\]|['"][^'"]*['"]|[^[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?/g,L=0,H=Object.prototype.toString;var F=function(Y,U,ab,ac){ab=ab||[];U=U||document;if(U.nodeType!==1&&U.nodeType!==9){return[]}if(!Y||typeof Y!=="string"){return ab}var Z=[],W,af,ai,T,ad,V,X=true;R.lastIndex=0;while((W=R.exec(Y))!==null){Z.push(W[1]);if(W[2]){V=RegExp.rightContext;break}}if(Z.length>1&&M.exec(Y)){if(Z.length===2&&I.relative[Z[0]]){af=J(Z[0]+Z[1],U)}else{af=I.relative[Z[0]]?[U]:F(Z.shift(),U);while(Z.length){Y=Z.shift();if(I.relative[Y]){Y+=Z.shift()}af=J(Y,af)}}}else{var ae=ac?{expr:Z.pop(),set:E(ac)}:F.find(Z.pop(),Z.length===1&&U.parentNode?U.parentNode:U,Q(U));af=F.filter(ae.expr,ae.set);if(Z.length>0){ai=E(af)}else{X=false}while(Z.length){var ah=Z.pop(),ag=ah;if(!I.relative[ah]){ah=""}else{ag=Z.pop()}if(ag==null){ag=U}I.relative[ah](ai,ag,Q(U))}}if(!ai){ai=af}if(!ai){throw"Syntax error, unrecognized expression: "+(ah||Y)}if(H.call(ai)==="[object Array]"){if(!X){ab.push.apply(ab,ai)}else{if(U.nodeType===1){for(var aa=0;ai[aa]!=null;aa++){if(ai[aa]&&(ai[aa]===true||ai[aa].nodeType===1&&K(U,ai[aa]))){ab.push(af[aa])}}}else{for(var aa=0;ai[aa]!=null;aa++){if(ai[aa]&&ai[aa].nodeType===1){ab.push(af[aa])}}}}}else{E(ai,ab)}if(V){F(V,U,ab,ac);if(G){hasDuplicate=false;ab.sort(G);if(hasDuplicate){for(var aa=1;aa<ab.length;aa++){if(ab[aa]===ab[aa-1]){ab.splice(aa--,1)}}}}}return ab};F.matches=function(T,U){return F(T,null,null,U)};F.find=function(aa,T,ab){var Z,X;if(!aa){return[]}for(var W=0,V=I.order.length;W<V;W++){var Y=I.order[W],X;if((X=I.match[Y].exec(aa))){var U=RegExp.leftContext;if(U.substr(U.length-1)!=="\\"){X[1]=(X[1]||"").replace(/\\/g,"");Z=I.find[Y](X,T,ab);if(Z!=null){aa=aa.replace(I.match[Y],"");break}}}}if(!Z){Z=T.getElementsByTagName("*")}return{set:Z,expr:aa}};F.filter=function(ad,ac,ag,W){var V=ad,ai=[],aa=ac,Y,T,Z=ac&&ac[0]&&Q(ac[0]);while(ad&&ac.length){for(var ab in I.filter){if((Y=I.match[ab].exec(ad))!=null){var U=I.filter[ab],ah,af;T=false;if(aa==ai){ai=[]}if(I.preFilter[ab]){Y=I.preFilter[ab](Y,aa,ag,ai,W,Z);if(!Y){T=ah=true}else{if(Y===true){continue}}}if(Y){for(var X=0;(af=aa[X])!=null;X++){if(af){ah=U(af,Y,X,aa);var ae=W^!!ah;if(ag&&ah!=null){if(ae){T=true}else{aa[X]=false}}else{if(ae){ai.push(af);T=true}}}}}if(ah!==g){if(!ag){aa=ai}ad=ad.replace(I.match[ab],"");if(!T){return[]}break}}}if(ad==V){if(T==null){throw"Syntax error, unrecognized expression: "+ad}else{break}}V=ad}return aa};var I=F.selectors={order:["ID","NAME","TAG"],match:{ID:/#((?:[\w\u00c0-\uFFFF_-]|\\.)+)/,CLASS:/\.((?:[\w\u00c0-\uFFFF_-]|\\.)+)/,NAME:/\[name=['"]*((?:[\w\u00c0-\uFFFF_-]|\\.)+)['"]*\]/,ATTR:/\[\s*((?:[\w\u00c0-\uFFFF_-]|\\.)+)\s*(?:(\S?=)\s*(['"]*)(.*?)\3|)\s*\]/,TAG:/^((?:[\w\u00c0-\uFFFF\*_-]|\\.)+)/,CHILD:/:(only|nth|last|first)-child(?:\((even|odd|[\dn+-]*)\))?/,POS:/:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^-]|$)/,PSEUDO:/:((?:[\w\u00c0-\uFFFF_-]|\\.)+)(?:\((['"]*)((?:\([^\)]+\)|[^\2\(\)]*)+)\2\))?/},attrMap:{"class":"className","for":"htmlFor"},attrHandle:{href:function(T){return T.getAttribute("href")}},relative:{"+":function(aa,T,Z){var X=typeof T==="string",ab=X&&!/\W/.test(T),Y=X&&!ab;if(ab&&!Z){T=T.toUpperCase()}for(var W=0,V=aa.length,U;W<V;W++){if((U=aa[W])){while((U=U.previousSibling)&&U.nodeType!==1){}aa[W]=Y||U&&U.nodeName===T?U||false:U===T}}if(Y){F.filter(T,aa,true)}},">":function(Z,U,aa){var X=typeof U==="string";if(X&&!/\W/.test(U)){U=aa?U:U.toUpperCase();for(var V=0,T=Z.length;V<T;V++){var Y=Z[V];if(Y){var W=Y.parentNode;Z[V]=W.nodeName===U?W:false}}}else{for(var V=0,T=Z.length;V<T;V++){var Y=Z[V];if(Y){Z[V]=X?Y.parentNode:Y.parentNode===U}}if(X){F.filter(U,Z,true)}}},"":function(W,U,Y){var V=L++,T=S;if(!U.match(/\W/)){var X=U=Y?U:U.toUpperCase();T=P}T("parentNode",U,V,W,X,Y)},"~":function(W,U,Y){var V=L++,T=S;if(typeof U==="string"&&!U.match(/\W/)){var X=U=Y?U:U.toUpperCase();T=P}T("previousSibling",U,V,W,X,Y)}},find:{ID:function(U,V,W){if(typeof V.getElementById!=="undefined"&&!W){var T=V.getElementById(U[1]);return T?[T]:[]}},NAME:function(V,Y,Z){if(typeof Y.getElementsByName!=="undefined"){var U=[],X=Y.getElementsByName(V[1]);for(var W=0,T=X.length;W<T;W++){if(X[W].getAttribute("name")===V[1]){U.push(X[W])}}return U.length===0?null:U}},TAG:function(T,U){return U.getElementsByTagName(T[1])}},preFilter:{CLASS:function(W,U,V,T,Z,aa){W=" "+W[1].replace(/\\/g,"")+" ";if(aa){return W}for(var X=0,Y;(Y=U[X])!=null;X++){if(Y){if(Z^(Y.className&&(" "+Y.className+" ").indexOf(W)>=0)){if(!V){T.push(Y)}}else{if(V){U[X]=false}}}}return false},ID:function(T){return T[1].replace(/\\/g,"")},TAG:function(U,T){for(var V=0;T[V]===false;V++){}return T[V]&&Q(T[V])?U[1]:U[1].toUpperCase()},CHILD:function(T){if(T[1]=="nth"){var U=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(T[2]=="even"&&"2n"||T[2]=="odd"&&"2n+1"||!/\D/.test(T[2])&&"0n+"+T[2]||T[2]);T[2]=(U[1]+(U[2]||1))-0;T[3]=U[3]-0}T[0]=L++;return T},ATTR:function(X,U,V,T,Y,Z){var W=X[1].replace(/\\/g,"");if(!Z&&I.attrMap[W]){X[1]=I.attrMap[W]}if(X[2]==="~="){X[4]=" "+X[4]+" "}return X},PSEUDO:function(X,U,V,T,Y){if(X[1]==="not"){if(X[3].match(R).length>1||/^\w/.test(X[3])){X[3]=F(X[3],null,null,U)}else{var W=F.filter(X[3],U,V,true^Y);if(!V){T.push.apply(T,W)}return false}}else{if(I.match.POS.test(X[0])||I.match.CHILD.test(X[0])){return true}}return X},POS:function(T){T.unshift(true);return T}},filters:{enabled:function(T){return T.disabled===false&&T.type!=="hidden"},disabled:function(T){return T.disabled===true},checked:function(T){return T.checked===true},selected:function(T){T.parentNode.selectedIndex;return T.selected===true},parent:function(T){return !!T.firstChild},empty:function(T){return !T.firstChild},has:function(V,U,T){return !!F(T[3],V).length},header:function(T){return/h\d/i.test(T.nodeName)},text:function(T){return"text"===T.type},radio:function(T){return"radio"===T.type},checkbox:function(T){return"checkbox"===T.type},file:function(T){return"file"===T.type},password:function(T){return"password"===T.type},submit:function(T){return"submit"===T.type},image:function(T){return"image"===T.type},reset:function(T){return"reset"===T.type},button:function(T){return"button"===T.type||T.nodeName.toUpperCase()==="BUTTON"},input:function(T){return/input|select|textarea|button/i.test(T.nodeName)}},setFilters:{first:function(U,T){return T===0},last:function(V,U,T,W){return U===W.length-1},even:function(U,T){return T%2===0},odd:function(U,T){return T%2===1},lt:function(V,U,T){return U<T[3]-0},gt:function(V,U,T){return U>T[3]-0},nth:function(V,U,T){return T[3]-0==U},eq:function(V,U,T){return T[3]-0==U}},filter:{PSEUDO:function(Z,V,W,aa){var U=V[1],X=I.filters[U];if(X){return X(Z,W,V,aa)}else{if(U==="contains"){return(Z.textContent||Z.innerText||"").indexOf(V[3])>=0}else{if(U==="not"){var Y=V[3];for(var W=0,T=Y.length;W<T;W++){if(Y[W]===Z){return false}}return true}}}},CHILD:function(T,W){var Z=W[1],U=T;switch(Z){case"only":case"first":while(U=U.previousSibling){if(U.nodeType===1){return false}}if(Z=="first"){return true}U=T;case"last":while(U=U.nextSibling){if(U.nodeType===1){return false}}return true;case"nth":var V=W[2],ac=W[3];if(V==1&&ac==0){return true}var Y=W[0],ab=T.parentNode;if(ab&&(ab.sizcache!==Y||!T.nodeIndex)){var X=0;for(U=ab.firstChild;U;U=U.nextSibling){if(U.nodeType===1){U.nodeIndex=++X}}ab.sizcache=Y}var aa=T.nodeIndex-ac;if(V==0){return aa==0}else{return(aa%V==0&&aa/V>=0)}}},ID:function(U,T){return U.nodeType===1&&U.getAttribute("id")===T},TAG:function(U,T){return(T==="*"&&U.nodeType===1)||U.nodeName===T},CLASS:function(U,T){return(" "+(U.className||U.getAttribute("class"))+" ").indexOf(T)>-1},ATTR:function(Y,W){var V=W[1],T=I.attrHandle[V]?I.attrHandle[V](Y):Y[V]!=null?Y[V]:Y.getAttribute(V),Z=T+"",X=W[2],U=W[4];return T==null?X==="!=":X==="="?Z===U:X==="*="?Z.indexOf(U)>=0:X==="~="?(" "+Z+" ").indexOf(U)>=0:!U?Z&&T!==false:X==="!="?Z!=U:X==="^="?Z.indexOf(U)===0:X==="$="?Z.substr(Z.length-U.length)===U:X==="|="?Z===U||Z.substr(0,U.length+1)===U+"-":false},POS:function(X,U,V,Y){var T=U[2],W=I.setFilters[T];if(W){return W(X,V,U,Y)}}}};var M=I.match.POS;for(var O in I.match){I.match[O]=RegExp(I.match[O].source+/(?![^\[]*\])(?![^\(]*\))/.source)}var E=function(U,T){U=Array.prototype.slice.call(U);if(T){T.push.apply(T,U);return T}return U};try{Array.prototype.slice.call(document.documentElement.childNodes)}catch(N){E=function(X,W){var U=W||[];if(H.call(X)==="[object Array]"){Array.prototype.push.apply(U,X)}else{if(typeof X.length==="number"){for(var V=0,T=X.length;V<T;V++){U.push(X[V])}}else{for(var V=0;X[V];V++){U.push(X[V])}}}return U}}var G;if(document.documentElement.compareDocumentPosition){G=function(U,T){var V=U.compareDocumentPosition(T)&4?-1:U===T?0:1;if(V===0){hasDuplicate=true}return V}}else{if("sourceIndex" in document.documentElement){G=function(U,T){var V=U.sourceIndex-T.sourceIndex;if(V===0){hasDuplicate=true}return V}}else{if(document.createRange){G=function(W,U){var V=W.ownerDocument.createRange(),T=U.ownerDocument.createRange();V.selectNode(W);V.collapse(true);T.selectNode(U);T.collapse(true);var X=V.compareBoundaryPoints(Range.START_TO_END,T);if(X===0){hasDuplicate=true}return X}}}}(function(){var U=document.createElement("form"),V="script"+(new Date).getTime();U.innerHTML="<input name='"+V+"'/>";var T=document.documentElement;T.insertBefore(U,T.firstChild);if(!!document.getElementById(V)){I.find.ID=function(X,Y,Z){if(typeof Y.getElementById!=="undefined"&&!Z){var W=Y.getElementById(X[1]);return W?W.id===X[1]||typeof W.getAttributeNode!=="undefined"&&W.getAttributeNode("id").nodeValue===X[1]?[W]:g:[]}};I.filter.ID=function(Y,W){var X=typeof Y.getAttributeNode!=="undefined"&&Y.getAttributeNode("id");return Y.nodeType===1&&X&&X.nodeValue===W}}T.removeChild(U)})();(function(){var T=document.createElement("div");T.appendChild(document.createComment(""));if(T.getElementsByTagName("*").length>0){I.find.TAG=function(U,Y){var X=Y.getElementsByTagName(U[1]);if(U[1]==="*"){var W=[];for(var V=0;X[V];V++){if(X[V].nodeType===1){W.push(X[V])}}X=W}return X}}T.innerHTML="<a href='#'></a>";if(T.firstChild&&typeof T.firstChild.getAttribute!=="undefined"&&T.firstChild.getAttribute("href")!=="#"){I.attrHandle.href=function(U){return U.getAttribute("href",2)}}})();if(document.querySelectorAll){(function(){var T=F,U=document.createElement("div");U.innerHTML="<p class='TEST'></p>";if(U.querySelectorAll&&U.querySelectorAll(".TEST").length===0){return}F=function(Y,X,V,W){X=X||document;if(!W&&X.nodeType===9&&!Q(X)){try{return E(X.querySelectorAll(Y),V)}catch(Z){}}return T(Y,X,V,W)};F.find=T.find;F.filter=T.filter;F.selectors=T.selectors;F.matches=T.matches})()}if(document.getElementsByClassName&&document.documentElement.getElementsByClassName){(function(){var T=document.createElement("div");T.innerHTML="<div class='test e'></div><div class='test'></div>";if(T.getElementsByClassName("e").length===0){return}T.lastChild.className="e";if(T.getElementsByClassName("e").length===1){return}I.order.splice(1,0,"CLASS");I.find.CLASS=function(U,V,W){if(typeof V.getElementsByClassName!=="undefined"&&!W){return V.getElementsByClassName(U[1])}}})()}function P(U,Z,Y,ad,aa,ac){var ab=U=="previousSibling"&&!ac;for(var W=0,V=ad.length;W<V;W++){var T=ad[W];if(T){if(ab&&T.nodeType===1){T.sizcache=Y;T.sizset=W}T=T[U];var X=false;while(T){if(T.sizcache===Y){X=ad[T.sizset];break}if(T.nodeType===1&&!ac){T.sizcache=Y;T.sizset=W}if(T.nodeName===Z){X=T;break}T=T[U]}ad[W]=X}}}function S(U,Z,Y,ad,aa,ac){var ab=U=="previousSibling"&&!ac;for(var W=0,V=ad.length;W<V;W++){var T=ad[W];if(T){if(ab&&T.nodeType===1){T.sizcache=Y;T.sizset=W}T=T[U];var X=false;while(T){if(T.sizcache===Y){X=ad[T.sizset];break}if(T.nodeType===1){if(!ac){T.sizcache=Y;T.sizset=W}if(typeof Z!=="string"){if(T===Z){X=true;break}}else{if(F.filter(Z,[T]).length>0){X=T;break}}}T=T[U]}ad[W]=X}}}var K=document.compareDocumentPosition?function(U,T){return U.compareDocumentPosition(T)&16}:function(U,T){return U!==T&&(U.contains?U.contains(T):true)};var Q=function(T){return T.nodeType===9&&T.documentElement.nodeName!=="HTML"||!!T.ownerDocument&&Q(T.ownerDocument)};var J=function(T,aa){var W=[],X="",Y,V=aa.nodeType?[aa]:aa;while((Y=I.match.PSEUDO.exec(T))){X+=Y[0];T=T.replace(I.match.PSEUDO,"")}T=I.relative[T]?T+"*":T;for(var Z=0,U=V.length;Z<U;Z++){F(T,V[Z],W)}return F.filter(X,W)};o.find=F;o.filter=F.filter;o.expr=F.selectors;o.expr[":"]=o.expr.filters;F.selectors.filters.hidden=function(T){return T.offsetWidth===0||T.offsetHeight===0};F.selectors.filters.visible=function(T){return T.offsetWidth>0||T.offsetHeight>0};F.selectors.filters.animated=function(T){return o.grep(o.timers,function(U){return T===U.elem}).length};o.multiFilter=function(V,T,U){if(U){V=":not("+V+")"}return F.matches(V,T)};o.dir=function(V,U){var T=[],W=V[U];while(W&&W!=document){if(W.nodeType==1){T.push(W)}W=W[U]}return T};o.nth=function(X,T,V,W){T=T||1;var U=0;for(;X;X=X[V]){if(X.nodeType==1&&++U==T){break}}return X};o.sibling=function(V,U){var T=[];for(;V;V=V.nextSibling){if(V.nodeType==1&&V!=U){T.push(V)}}return T};return;l.Sizzle=F})();o.event={add:function(I,F,H,K){if(I.nodeType==3||I.nodeType==8){return}if(I.setInterval&&I!=l){I=l}if(!H.guid){H.guid=this.guid++}if(K!==g){var G=H;H=this.proxy(G);H.data=K}var E=o.data(I,"events")||o.data(I,"events",{}),J=o.data(I,"handle")||o.data(I,"handle",function(){return typeof o!=="undefined"&&!o.event.triggered?o.event.handle.apply(arguments.callee.elem,arguments):g});J.elem=I;o.each(F.split(/\s+/),function(M,N){var O=N.split(".");N=O.shift();H.type=O.slice().sort().join(".");var L=E[N];if(o.event.specialAll[N]){o.event.specialAll[N].setup.call(I,K,O)}if(!L){L=E[N]={};if(!o.event.special[N]||o.event.special[N].setup.call(I,K,O)===false){if(I.addEventListener){I.addEventListener(N,J,false)}else{if(I.attachEvent){I.attachEvent("on"+N,J)}}}}L[H.guid]=H;o.event.global[N]=true});I=null},guid:1,global:{},remove:function(K,H,J){if(K.nodeType==3||K.nodeType==8){return}var G=o.data(K,"events"),F,E;if(G){if(H===g||(typeof H==="string"&&H.charAt(0)==".")){for(var I in G){this.remove(K,I+(H||""))}}else{if(H.type){J=H.handler;H=H.type}o.each(H.split(/\s+/),function(M,O){var Q=O.split(".");O=Q.shift();var N=RegExp("(^|\\.)"+Q.slice().sort().join(".*\\.")+"(\\.|$)");if(G[O]){if(J){delete G[O][J.guid]}else{for(var P in G[O]){if(N.test(G[O][P].type)){delete G[O][P]}}}if(o.event.specialAll[O]){o.event.specialAll[O].teardown.call(K,Q)}for(F in G[O]){break}if(!F){if(!o.event.special[O]||o.event.special[O].teardown.call(K,Q)===false){if(K.removeEventListener){K.removeEventListener(O,o.data(K,"handle"),false)}else{if(K.detachEvent){K.detachEvent("on"+O,o.data(K,"handle"))}}}F=null;delete G[O]}}})}for(F in G){break}if(!F){var L=o.data(K,"handle");if(L){L.elem=null}o.removeData(K,"events");o.removeData(K,"handle")}}},trigger:function(I,K,H,E){var G=I.type||I;if(!E){I=typeof I==="object"?I[h]?I:o.extend(o.Event(G),I):o.Event(G);if(G.indexOf("!")>=0){I.type=G=G.slice(0,-1);I.exclusive=true}if(!H){I.stopPropagation();if(this.global[G]){o.each(o.cache,function(){if(this.events&&this.events[G]){o.event.trigger(I,K,this.handle.elem)}})}}if(!H||H.nodeType==3||H.nodeType==8){return g}I.result=g;I.target=H;K=o.makeArray(K);K.unshift(I)}I.currentTarget=H;var J=o.data(H,"handle");if(J){J.apply(H,K)}if((!H[G]||(o.nodeName(H,"a")&&G=="click"))&&H["on"+G]&&H["on"+G].apply(H,K)===false){I.result=false}if(!E&&H[G]&&!I.isDefaultPrevented()&&!(o.nodeName(H,"a")&&G=="click")){this.triggered=true;try{H[G]()}catch(L){}}this.triggered=false;if(!I.isPropagationStopped()){var F=H.parentNode||H.ownerDocument;if(F){o.event.trigger(I,K,F,true)}}},handle:function(K){var J,E;K=arguments[0]=o.event.fix(K||l.event);K.currentTarget=this;var L=K.type.split(".");K.type=L.shift();J=!L.length&&!K.exclusive;var I=RegExp("(^|\\.)"+L.slice().sort().join(".*\\.")+"(\\.|$)");E=(o.data(this,"events")||{})[K.type];for(var G in E){var H=E[G];if(J||I.test(H.type)){K.handler=H;K.data=H.data;var F=H.apply(this,arguments);if(F!==g){K.result=F;if(F===false){K.preventDefault();K.stopPropagation()}}if(K.isImmediatePropagationStopped()){break}}}},props:"altKey attrChange attrName bubbles button cancelable charCode clientX clientY ctrlKey currentTarget data detail eventPhase fromElement handler keyCode metaKey newValue originalTarget pageX pageY prevValue relatedNode relatedTarget screenX screenY shiftKey srcElement target toElement view wheelDelta which".split(" "),fix:function(H){if(H[h]){return H}var F=H;H=o.Event(F);for(var G=this.props.length,J;G;){J=this.props[--G];H[J]=F[J]}if(!H.target){H.target=H.srcElement||document}if(H.target.nodeType==3){H.target=H.target.parentNode}if(!H.relatedTarget&&H.fromElement){H.relatedTarget=H.fromElement==H.target?H.toElement:H.fromElement}if(H.pageX==null&&H.clientX!=null){var I=document.documentElement,E=document.body;H.pageX=H.clientX+(I&&I.scrollLeft||E&&E.scrollLeft||0)-(I.clientLeft||0);H.pageY=H.clientY+(I&&I.scrollTop||E&&E.scrollTop||0)-(I.clientTop||0)}if(!H.which&&((H.charCode||H.charCode===0)?H.charCode:H.keyCode)){H.which=H.charCode||H.keyCode}if(!H.metaKey&&H.ctrlKey){H.metaKey=H.ctrlKey}if(!H.which&&H.button){H.which=(H.button&1?1:(H.button&2?3:(H.button&4?2:0)))}return H},proxy:function(F,E){E=E||function(){return F.apply(this,arguments)};E.guid=F.guid=F.guid||E.guid||this.guid++;return E},special:{ready:{setup:B,teardown:function(){}}},specialAll:{live:{setup:function(E,F){o.event.add(this,F[0],c)},teardown:function(G){if(G.length){var E=0,F=RegExp("(^|\\.)"+G[0]+"(\\.|$)");o.each((o.data(this,"events").live||{}),function(){if(F.test(this.type)){E++}});if(E<1){o.event.remove(this,G[0],c)}}}}}};o.Event=function(E){if(!this.preventDefault){return new o.Event(E)}if(E&&E.type){this.originalEvent=E;this.type=E.type}else{this.type=E}this.timeStamp=e();this[h]=true};function k(){return false}function u(){return true}o.Event.prototype={preventDefault:function(){this.isDefaultPrevented=u;var E=this.originalEvent;if(!E){return}if(E.preventDefault){E.preventDefault()}E.returnValue=false},stopPropagation:function(){this.isPropagationStopped=u;var E=this.originalEvent;if(!E){return}if(E.stopPropagation){E.stopPropagation()}E.cancelBubble=true},stopImmediatePropagation:function(){this.isImmediatePropagationStopped=u;this.stopPropagation()},isDefaultPrevented:k,isPropagationStopped:k,isImmediatePropagationStopped:k};var a=function(F){var E=F.relatedTarget;while(E&&E!=this){try{E=E.parentNode}catch(G){E=this}}if(E!=this){F.type=F.data;o.event.handle.apply(this,arguments)}};o.each({mouseover:"mouseenter",mouseout:"mouseleave"},function(F,E){o.event.special[E]={setup:function(){o.event.add(this,F,a,E)},teardown:function(){o.event.remove(this,F,a)}}});o.fn.extend({bind:function(F,G,E){return F=="unload"?this.one(F,G,E):this.each(function(){o.event.add(this,F,E||G,E&&G)})},one:function(G,H,F){var E=o.event.proxy(F||H,function(I){o(this).unbind(I,E);return(F||H).apply(this,arguments)});return this.each(function(){o.event.add(this,G,E,F&&H)})},unbind:function(F,E){return this.each(function(){o.event.remove(this,F,E)})},trigger:function(E,F){return this.each(function(){o.event.trigger(E,F,this)})},triggerHandler:function(E,G){if(this[0]){var F=o.Event(E);F.preventDefault();F.stopPropagation();o.event.trigger(F,G,this[0]);return F.result}},toggle:function(G){var E=arguments,F=1;while(F<E.length){o.event.proxy(G,E[F++])}return this.click(o.event.proxy(G,function(H){this.lastToggle=(this.lastToggle||0)%F;H.preventDefault();return E[this.lastToggle++].apply(this,arguments)||false}))},hover:function(E,F){return this.mouseenter(E).mouseleave(F)},ready:function(E){B();if(o.isReady){E.call(document,o)}else{o.readyList.push(E)}return this},live:function(G,F){var E=o.event.proxy(F);E.guid+=this.selector+G;o(document).bind(i(G,this.selector),this.selector,E);return this},die:function(F,E){o(document).unbind(i(F,this.selector),E?{guid:E.guid+this.selector+F}:null);return this}});function c(H){var E=RegExp("(^|\\.)"+H.type+"(\\.|$)"),G=true,F=[];o.each(o.data(this,"events").live||[],function(I,J){if(E.test(J.type)){var K=o(H.target).closest(J.data)[0];if(K){F.push({elem:K,fn:J})}}});F.sort(function(J,I){return o.data(J.elem,"closest")-o.data(I.elem,"closest")});o.each(F,function(){if(this.fn.call(this.elem,H,this.fn.data)===false){return(G=false)}});return G}function i(F,E){return["live",F,E.replace(/\./g,"`").replace(/ /g,"|")].join(".")}o.extend({isReady:false,readyList:[],ready:function(){if(!o.isReady){o.isReady=true;if(o.readyList){o.each(o.readyList,function(){this.call(document,o)});o.readyList=null}o(document).triggerHandler("ready")}}});var x=false;function B(){if(x){return}x=true;if(document.addEventListener){document.addEventListener("DOMContentLoaded",function(){document.removeEventListener("DOMContentLoaded",arguments.callee,false);o.ready()},false)}else{if(document.attachEvent){document.attachEvent("onreadystatechange",function(){if(document.readyState==="complete"){document.detachEvent("onreadystatechange",arguments.callee);o.ready()}});if(document.documentElement.doScroll&&l==l.top){(function(){if(o.isReady){return}try{document.documentElement.doScroll("left")}catch(E){setTimeout(arguments.callee,0);return}o.ready()})()}}}o.event.add(l,"load",o.ready)}o.each(("blur,focus,load,resize,scroll,unload,click,dblclick,mousedown,mouseup,mousemove,mouseover,mouseout,mouseenter,mouseleave,change,select,submit,keydown,keypress,keyup,error").split(","),function(F,E){o.fn[E]=function(G){return G?this.bind(E,G):this.trigger(E)}});o(l).bind("unload",function(){for(var E in o.cache){if(E!=1&&o.cache[E].handle){o.event.remove(o.cache[E].handle.elem)}}});(function(){o.support={};var F=document.documentElement,G=document.createElement("script"),K=document.createElement("div"),J="script"+(new Date).getTime();K.style.display="none";K.innerHTML=' <link/><table></table><a href="/a" style="color:red;float:left;opacity:.5;">a</a><select><option>text</option></select><object><param/></object>';var H=K.getElementsByTagName("*"),E=K.getElementsByTagName("a")[0];if(!H||!H.length||!E){return}o.support={leadingWhitespace:K.firstChild.nodeType==3,tbody:!K.getElementsByTagName("tbody").length,objectAll:!!K.getElementsByTagName("object")[0].getElementsByTagName("*").length,htmlSerialize:!!K.getElementsByTagName("link").length,style:/red/.test(E.getAttribute("style")),hrefNormalized:E.getAttribute("href")==="/a",opacity:E.style.opacity==="0.5",cssFloat:!!E.style.cssFloat,scriptEval:false,noCloneEvent:true,boxModel:null};G.type="text/javascript";try{G.appendChild(document.createTextNode("window."+J+"=1;"))}catch(I){}F.insertBefore(G,F.firstChild);if(l[J]){o.support.scriptEval=true;delete l[J]}F.removeChild(G);if(K.attachEvent&&K.fireEvent){K.attachEvent("onclick",function(){o.support.noCloneEvent=false;K.detachEvent("onclick",arguments.callee)});K.cloneNode(true).fireEvent("onclick")}o(function(){var L=document.createElement("div");L.style.width=L.style.paddingLeft="1px";document.body.appendChild(L);o.boxModel=o.support.boxModel=L.offsetWidth===2;document.body.removeChild(L).style.display="none"})})();var w=o.support.cssFloat?"cssFloat":"styleFloat";o.props={"for":"htmlFor","class":"className","float":w,cssFloat:w,styleFloat:w,readonly:"readOnly",maxlength:"maxLength",cellspacing:"cellSpacing",rowspan:"rowSpan",tabindex:"tabIndex"};o.fn.extend({_load:o.fn.load,load:function(G,J,K){if(typeof G!=="string"){return this._load(G)}var I=G.indexOf(" ");if(I>=0){var E=G.slice(I,G.length);G=G.slice(0,I)}var H="GET";if(J){if(o.isFunction(J)){K=J;J=null}else{if(typeof J==="object"){J=o.param(J);H="POST"}}}var F=this;o.ajax({url:G,type:H,dataType:"html",data:J,complete:function(M,L){if(L=="success"||L=="notmodified"){F.html(E?o("<div/>").append(M.responseText.replace(/<script(.|\s)*?\/script>/g,"")).find(E):M.responseText)}if(K){F.each(K,[M.responseText,L,M])}}});return this},serialize:function(){return o.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?o.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||/select|textarea/i.test(this.nodeName)||/text|hidden|password|search/i.test(this.type))}).map(function(E,F){var G=o(this).val();return G==null?null:o.isArray(G)?o.map(G,function(I,H){return{name:F.name,value:I}}):{name:F.name,value:G}}).get()}});o.each("ajaxStart,ajaxStop,ajaxComplete,ajaxError,ajaxSuccess,ajaxSend".split(","),function(E,F){o.fn[F]=function(G){return this.bind(F,G)}});var r=e();o.extend({get:function(E,G,H,F){if(o.isFunction(G)){H=G;G=null}return o.ajax({type:"GET",url:E,data:G,success:H,dataType:F})},getScript:function(E,F){return o.get(E,null,F,"script")},getJSON:function(E,F,G){return o.get(E,F,G,"json")},post:function(E,G,H,F){if(o.isFunction(G)){H=G;G={}}return o.ajax({type:"POST",url:E,data:G,success:H,dataType:F})},ajaxSetup:function(E){o.extend(o.ajaxSettings,E)},ajaxSettings:{url:location.href,global:true,type:"GET",contentType:"application/x-www-form-urlencoded",processData:true,async:true,xhr:function(){return l.ActiveXObject?new ActiveXObject("Microsoft.XMLHTTP"):new XMLHttpRequest()},accepts:{xml:"application/xml, text/xml",html:"text/html",script:"text/javascript, application/javascript",json:"application/json, text/javascript",text:"text/plain",_default:"*/*"}},lastModified:{},ajax:function(M){M=o.extend(true,M,o.extend(true,{},o.ajaxSettings,M));var W,F=/=\?(&|$)/g,R,V,G=M.type.toUpperCase();if(M.data&&M.processData&&typeof M.data!=="string"){M.data=o.param(M.data)}if(M.dataType=="jsonp"){if(G=="GET"){if(!M.url.match(F)){M.url+=(M.url.match(/\?/)?"&":"?")+(M.jsonp||"callback")+"=?"}}else{if(!M.data||!M.data.match(F)){M.data=(M.data?M.data+"&":"")+(M.jsonp||"callback")+"=?"}}M.dataType="json"}if(M.dataType=="json"&&(M.data&&M.data.match(F)||M.url.match(F))){W="jsonp"+r++;if(M.data){M.data=(M.data+"").replace(F,"="+W+"$1")}M.url=M.url.replace(F,"="+W+"$1");M.dataType="script";l[W]=function(X){V=X;I();L();l[W]=g;try{delete l[W]}catch(Y){}if(H){H.removeChild(T)}}}if(M.dataType=="script"&&M.cache==null){M.cache=false}if(M.cache===false&&G=="GET"){var E=e();var U=M.url.replace(/(\?|&)_=.*?(&|$)/,"$1_="+E+"$2");M.url=U+((U==M.url)?(M.url.match(/\?/)?"&":"?")+"_="+E:"")}if(M.data&&G=="GET"){M.url+=(M.url.match(/\?/)?"&":"?")+M.data;M.data=null}if(M.global&&!o.active++){o.event.trigger("ajaxStart")}var Q=/^(\w+:)?\/\/([^\/?#]+)/.exec(M.url);if(M.dataType=="script"&&G=="GET"&&Q&&(Q[1]&&Q[1]!=location.protocol||Q[2]!=location.host)){var H=document.getElementsByTagName("head")[0];var T=document.createElement("script");T.src=M.url;if(M.scriptCharset){T.charset=M.scriptCharset}if(!W){var O=false;T.onload=T.onreadystatechange=function(){if(!O&&(!this.readyState||this.readyState=="loaded"||this.readyState=="complete")){O=true;I();L();T.onload=T.onreadystatechange=null;H.removeChild(T)}}}H.appendChild(T);return g}var K=false;var J=M.xhr();if(M.username){J.open(G,M.url,M.async,M.username,M.password)}else{J.open(G,M.url,M.async)}try{if(M.data){J.setRequestHeader("Content-Type",M.contentType)}if(M.ifModified){J.setRequestHeader("If-Modified-Since",o.lastModified[M.url]||"Thu, 01 Jan 1970 00:00:00 GMT")}J.setRequestHeader("X-Requested-With","XMLHttpRequest");J.setRequestHeader("Accept",M.dataType&&M.accepts[M.dataType]?M.accepts[M.dataType]+", */*":M.accepts._default)}catch(S){}if(M.beforeSend&&M.beforeSend(J,M)===false){if(M.global&&!--o.active){o.event.trigger("ajaxStop")}J.abort();return false}if(M.global){o.event.trigger("ajaxSend",[J,M])}var N=function(X){if(J.readyState==0){if(P){clearInterval(P);P=null;if(M.global&&!--o.active){o.event.trigger("ajaxStop")}}}else{if(!K&&J&&(J.readyState==4||X=="timeout")){K=true;if(P){clearInterval(P);P=null}R=X=="timeout"?"timeout":!o.httpSuccess(J)?"error":M.ifModified&&o.httpNotModified(J,M.url)?"notmodified":"success";if(R=="success"){try{V=o.httpData(J,M.dataType,M)}catch(Z){R="parsererror"}}if(R=="success"){var Y;try{Y=J.getResponseHeader("Last-Modified")}catch(Z){}if(M.ifModified&&Y){o.lastModified[M.url]=Y}if(!W){I()}}else{o.handleError(M,J,R)}L();if(X){J.abort()}if(M.async){J=null}}}};if(M.async){var P=setInterval(N,13);if(M.timeout>0){setTimeout(function(){if(J&&!K){N("timeout")}},M.timeout)}}try{J.send(M.data)}catch(S){o.handleError(M,J,null,S)}if(!M.async){N()}function I(){if(M.success){M.success(V,R)}if(M.global){o.event.trigger("ajaxSuccess",[J,M])}}function L(){if(M.complete){M.complete(J,R)}if(M.global){o.event.trigger("ajaxComplete",[J,M])}if(M.global&&!--o.active){o.event.trigger("ajaxStop")}}return J},handleError:function(F,H,E,G){if(F.error){F.error(H,E,G)}if(F.global){o.event.trigger("ajaxError",[H,F,G])}},active:0,httpSuccess:function(F){try{return !F.status&&location.protocol=="file:"||(F.status>=200&&F.status<300)||F.status==304||F.status==1223}catch(E){}return false},httpNotModified:function(G,E){try{var H=G.getResponseHeader("Last-Modified");return G.status==304||H==o.lastModified[E]}catch(F){}return false},httpData:function(J,H,G){var F=J.getResponseHeader("content-type"),E=H=="xml"||!H&&F&&F.indexOf("xml")>=0,I=E?J.responseXML:J.responseText;if(E&&I.documentElement.tagName=="parsererror"){throw"parsererror"}if(G&&G.dataFilter){I=G.dataFilter(I,H)}if(typeof I==="string"){if(H=="script"){o.globalEval(I)}if(H=="json"){I=l["eval"]("("+I+")")}}return I},param:function(E){var G=[];function H(I,J){G[G.length]=encodeURIComponent(I)+"="+encodeURIComponent(J)}if(o.isArray(E)||E.jquery){o.each(E,function(){H(this.name,this.value)})}else{for(var F in E){if(o.isArray(E[F])){o.each(E[F],function(){H(F,this)})}else{H(F,o.isFunction(E[F])?E[F]():E[F])}}}return G.join("&").replace(/%20/g,"+")}});var m={},n,d=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]];function t(F,E){var G={};o.each(d.concat.apply([],d.slice(0,E)),function(){G[this]=F});return G}o.fn.extend({show:function(J,L){if(J){return this.animate(t("show",3),J,L)}else{for(var H=0,F=this.length;H<F;H++){var E=o.data(this[H],"olddisplay");this[H].style.display=E||"";if(o.css(this[H],"display")==="none"){var G=this[H].tagName,K;if(m[G]){K=m[G]}else{var I=o("<"+G+" />").appendTo("body");K=I.css("display");if(K==="none"){K="block"}I.remove();m[G]=K}o.data(this[H],"olddisplay",K)}}for(var H=0,F=this.length;H<F;H++){this[H].style.display=o.data(this[H],"olddisplay")||""}return this}},hide:function(H,I){if(H){return this.animate(t("hide",3),H,I)}else{for(var G=0,F=this.length;G<F;G++){var E=o.data(this[G],"olddisplay");if(!E&&E!=="none"){o.data(this[G],"olddisplay",o.css(this[G],"display"))}}for(var G=0,F=this.length;G<F;G++){this[G].style.display="none"}return this}},_toggle:o.fn.toggle,toggle:function(G,F){var E=typeof G==="boolean";return o.isFunction(G)&&o.isFunction(F)?this._toggle.apply(this,arguments):G==null||E?this.each(function(){var H=E?G:o(this).is(":hidden");o(this)[H?"show":"hide"]()}):this.animate(t("toggle",3),G,F)},fadeTo:function(E,G,F){return this.animate({opacity:G},E,F)},animate:function(I,F,H,G){var E=o.speed(F,H,G);return this[E.queue===false?"each":"queue"](function(){var K=o.extend({},E),M,L=this.nodeType==1&&o(this).is(":hidden"),J=this;for(M in I){if(I[M]=="hide"&&L||I[M]=="show"&&!L){return K.complete.call(this)}if((M=="height"||M=="width")&&this.style){K.display=o.css(this,"display");K.overflow=this.style.overflow}}if(K.overflow!=null){this.style.overflow="hidden"}K.curAnim=o.extend({},I);o.each(I,function(O,S){var R=new o.fx(J,K,O);if(/toggle|show|hide/.test(S)){R[S=="toggle"?L?"show":"hide":S](I)}else{var Q=S.toString().match(/^([+-]=)?([\d+-.]+)(.*)$/),T=R.cur(true)||0;if(Q){var N=parseFloat(Q[2]),P=Q[3]||"px";if(P!="px"){J.style[O]=(N||1)+P;T=((N||1)/R.cur(true))*T;J.style[O]=T+P}if(Q[1]){N=((Q[1]=="-="?-1:1)*N)+T}R.custom(T,N,P)}else{R.custom(T,S,"")}}});return true})},stop:function(F,E){var G=o.timers;if(F){this.queue([])}this.each(function(){for(var H=G.length-1;H>=0;H--){if(G[H].elem==this){if(E){G[H](true)}G.splice(H,1)}}});if(!E){this.dequeue()}return this}});o.each({slideDown:t("show",1),slideUp:t("hide",1),slideToggle:t("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"}},function(E,F){o.fn[E]=function(G,H){return this.animate(F,G,H)}});o.extend({speed:function(G,H,F){var E=typeof G==="object"?G:{complete:F||!F&&H||o.isFunction(G)&&G,duration:G,easing:F&&H||H&&!o.isFunction(H)&&H};E.duration=o.fx.off?0:typeof E.duration==="number"?E.duration:o.fx.speeds[E.duration]||o.fx.speeds._default;E.old=E.complete;E.complete=function(){if(E.queue!==false){o(this).dequeue()}if(o.isFunction(E.old)){E.old.call(this)}};return E},easing:{linear:function(G,H,E,F){return E+F*G},swing:function(G,H,E,F){return((-Math.cos(G*Math.PI)/2)+0.5)*F+E}},timers:[],fx:function(F,E,G){this.options=E;this.elem=F;this.prop=G;if(!E.orig){E.orig={}}}});o.fx.prototype={update:function(){if(this.options.step){this.options.step.call(this.elem,this.now,this)}(o.fx.step[this.prop]||o.fx.step._default)(this);if((this.prop=="height"||this.prop=="width")&&this.elem.style){this.elem.style.display="block"}},cur:function(F){if(this.elem[this.prop]!=null&&(!this.elem.style||this.elem.style[this.prop]==null)){return this.elem[this.prop]}var E=parseFloat(o.css(this.elem,this.prop,F));return E&&E>-10000?E:parseFloat(o.curCSS(this.elem,this.prop))||0},custom:function(I,H,G){this.startTime=e();this.start=I;this.end=H;this.unit=G||this.unit||"px";this.now=this.start;this.pos=this.state=0;var E=this;function F(J){return E.step(J)}F.elem=this.elem;if(F()&&o.timers.push(F)&&!n){n=setInterval(function(){var K=o.timers;for(var J=0;J<K.length;J++){if(!K[J]()){K.splice(J--,1)}}if(!K.length){clearInterval(n);n=g}},13)}},show:function(){this.options.orig[this.prop]=o.attr(this.elem.style,this.prop);this.options.show=true;this.custom(this.prop=="width"||this.prop=="height"?1:0,this.cur());o(this.elem).show()},hide:function(){this.options.orig[this.prop]=o.attr(this.elem.style,this.prop);this.options.hide=true;this.custom(this.cur(),0)},step:function(H){var G=e();if(H||G>=this.options.duration+this.startTime){this.now=this.end;this.pos=this.state=1;this.update();this.options.curAnim[this.prop]=true;var E=true;for(var F in this.options.curAnim){if(this.options.curAnim[F]!==true){E=false}}if(E){if(this.options.display!=null){this.elem.style.overflow=this.options.overflow;this.elem.style.display=this.options.display;if(o.css(this.elem,"display")=="none"){this.elem.style.display="block"}}if(this.options.hide){o(this.elem).hide()}if(this.options.hide||this.options.show){for(var I in this.options.curAnim){o.attr(this.elem.style,I,this.options.orig[I])}}this.options.complete.call(this.elem)}return false}else{var J=G-this.startTime;this.state=J/this.options.duration;this.pos=o.easing[this.options.easing||(o.easing.swing?"swing":"linear")](this.state,J,0,1,this.options.duration);this.now=this.start+((this.end-this.start)*this.pos);this.update()}return true}};o.extend(o.fx,{speeds:{slow:600,fast:200,_default:400},step:{opacity:function(E){o.attr(E.elem.style,"opacity",E.now)},_default:function(E){if(E.elem.style&&E.elem.style[E.prop]!=null){E.elem.style[E.prop]=E.now+E.unit}else{E.elem[E.prop]=E.now}}}});if(document.documentElement.getBoundingClientRect){o.fn.offset=function(){if(!this[0]){return{top:0,left:0}}if(this[0]===this[0].ownerDocument.body){return o.offset.bodyOffset(this[0])}var G=this[0].getBoundingClientRect(),J=this[0].ownerDocument,F=J.body,E=J.documentElement,L=E.clientTop||F.clientTop||0,K=E.clientLeft||F.clientLeft||0,I=G.top+(self.pageYOffset||o.boxModel&&E.scrollTop||F.scrollTop)-L,H=G.left+(self.pageXOffset||o.boxModel&&E.scrollLeft||F.scrollLeft)-K;return{top:I,left:H}}}else{o.fn.offset=function(){if(!this[0]){return{top:0,left:0}}if(this[0]===this[0].ownerDocument.body){return o.offset.bodyOffset(this[0])}o.offset.initialized||o.offset.initialize();var J=this[0],G=J.offsetParent,F=J,O=J.ownerDocument,M,H=O.documentElement,K=O.body,L=O.defaultView,E=L.getComputedStyle(J,null),N=J.offsetTop,I=J.offsetLeft;while((J=J.parentNode)&&J!==K&&J!==H){M=L.getComputedStyle(J,null);N-=J.scrollTop,I-=J.scrollLeft;if(J===G){N+=J.offsetTop,I+=J.offsetLeft;if(o.offset.doesNotAddBorder&&!(o.offset.doesAddBorderForTableAndCells&&/^t(able|d|h)$/i.test(J.tagName))){N+=parseInt(M.borderTopWidth,10)||0,I+=parseInt(M.borderLeftWidth,10)||0}F=G,G=J.offsetParent}if(o.offset.subtractsBorderForOverflowNotVisible&&M.overflow!=="visible"){N+=parseInt(M.borderTopWidth,10)||0,I+=parseInt(M.borderLeftWidth,10)||0}E=M}if(E.position==="relative"||E.position==="static"){N+=K.offsetTop,I+=K.offsetLeft}if(E.position==="fixed"){N+=Math.max(H.scrollTop,K.scrollTop),I+=Math.max(H.scrollLeft,K.scrollLeft)}return{top:N,left:I}}}o.offset={initialize:function(){if(this.initialized){return}var L=document.body,F=document.createElement("div"),H,G,N,I,M,E,J=L.style.marginTop,K='<div style="position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;"><div></div></div><table style="position:absolute;top:0;left:0;margin:0;border:5px solid #000;padding:0;width:1px;height:1px;" cellpadding="0" cellspacing="0"><tr><td></td></tr></table>';M={position:"absolute",top:0,left:0,margin:0,border:0,width:"1px",height:"1px",visibility:"hidden"};for(E in M){F.style[E]=M[E]}F.innerHTML=K;L.insertBefore(F,L.firstChild);H=F.firstChild,G=H.firstChild,I=H.nextSibling.firstChild.firstChild;this.doesNotAddBorder=(G.offsetTop!==5);this.doesAddBorderForTableAndCells=(I.offsetTop===5);H.style.overflow="hidden",H.style.position="relative";this.subtractsBorderForOverflowNotVisible=(G.offsetTop===-5);L.style.marginTop="1px";this.doesNotIncludeMarginInBodyOffset=(L.offsetTop===0);L.style.marginTop=J;L.removeChild(F);this.initialized=true},bodyOffset:function(E){o.offset.initialized||o.offset.initialize();var G=E.offsetTop,F=E.offsetLeft;if(o.offset.doesNotIncludeMarginInBodyOffset){G+=parseInt(o.curCSS(E,"marginTop",true),10)||0,F+=parseInt(o.curCSS(E,"marginLeft",true),10)||0}return{top:G,left:F}}};o.fn.extend({position:function(){var I=0,H=0,F;if(this[0]){var G=this.offsetParent(),J=this.offset(),E=/^body|html$/i.test(G[0].tagName)?{top:0,left:0}:G.offset();J.top-=j(this,"marginTop");J.left-=j(this,"marginLeft");E.top+=j(G,"borderTopWidth");E.left+=j(G,"borderLeftWidth");F={top:J.top-E.top,left:J.left-E.left}}return F},offsetParent:function(){var E=this[0].offsetParent||document.body;while(E&&(!/^body|html$/i.test(E.tagName)&&o.css(E,"position")=="static")){E=E.offsetParent}return o(E)}});o.each(["Left","Top"],function(F,E){var G="scroll"+E;o.fn[G]=function(H){if(!this[0]){return null}return H!==g?this.each(function(){this==l||this==document?l.scrollTo(!F?H:o(l).scrollLeft(),F?H:o(l).scrollTop()):this[G]=H}):this[0]==l||this[0]==document?self[F?"pageYOffset":"pageXOffset"]||o.boxModel&&document.documentElement[G]||document.body[G]:this[0][G]}});o.each(["Height","Width"],function(I,G){var E=I?"Left":"Top",H=I?"Right":"Bottom",F=G.toLowerCase();o.fn["inner"+G]=function(){return this[0]?o.css(this[0],F,false,"padding"):null};o.fn["outer"+G]=function(K){return this[0]?o.css(this[0],F,false,K?"margin":"border"):null};var J=G.toLowerCase();o.fn[J]=function(K){return this[0]==l?document.compatMode=="CSS1Compat"&&document.documentElement["client"+G]||document.body["client"+G]:this[0]==document?Math.max(document.documentElement["client"+G],document.body["scroll"+G],document.documentElement["scroll"+G],document.body["offset"+G],document.documentElement["offset"+G]):K===g?(this.length?o.css(this[0],J):null):this.css(J,typeof K==="string"?K:K+"px")}})})();
\ No newline at end of file
/**
* .disableTextSelect - Disable Text Select Plugin
*
* Version: 1.1
* Updated: 2007-11-28
*
* Used to stop users from selecting text
*
* Copyright (c) 2007 James Dempster (letssurf@gmail.com, http://www.jdempster.com/category/jquery/disabletextselect/)
*
* Dual licensed under the MIT (MIT-LICENSE.txt)
* and GPL (GPL-LICENSE.txt) licenses.
**/
/**
* Requirements:
* - jQuery (John Resig, http://www.jquery.com/)
**/
(function($) {
if ($.browser.mozilla) {
$.fn.disableTextSelect = function() {
return this.each(function() {
$(this).css({
'MozUserSelect' : 'none'
});
});
};
$.fn.enableTextSelect = function() {
return this.each(function() {
$(this).css({
'MozUserSelect' : ''
});
});
};
} else if ($.browser.msie) {
$.fn.disableTextSelect = function() {
return this.each(function() {
$(this).bind('selectstart.disableTextSelect', function() {
return false;
});
});
};
$.fn.enableTextSelect = function() {
return this.each(function() {
$(this).unbind('selectstart.disableTextSelect');
});
};
} else {
$.fn.disableTextSelect = function() {
return this.each(function() {
$(this).bind('mousedown.disableTextSelect', function() {
return false;
});
});
};
$.fn.enableTextSelect = function() {
return this.each(function() {
$(this).unbind('mousedown.disableTextSelect');
});
};
}
})(jQuery);
\ No newline at end of file
var sankoreLang = {
"en":{
"fnc":"Function: ",
"display":"Display",
"x_axis":"X-axis",
"y_axis":"Y-axis",
"zoom":"Zoom",
"color":"Color:",
"menus":"Menu",
"tools":"Tools",
"options":"Options",
"help":"Help",
"about":"About",
"mouse_events":"Mouse events:",
"moving":"Moving",
"tangente":"Tangente",
"point":"Point",
"choosing_color":"Choosing the color:",
"value":"Value:",
"saturation":"Saturation:",
"red":"Red:",
"green":"Green:",
"blue":"Blue:",
"opacity":"Opacity:",
"check":"Check",
"derivative":"Derivative:",
"square_under_func":"Square under function:",
"from":"From",
"to":"To",
"calculate":"Calculate",
"draw":"Draw",
"point_calculate":"Calculate the point on the function:",
"estimate":"Estimate",
"analysis_of_func":"Analysis of function:",
"start_to_analysis":"Start to analysis",
"quit":"Quit",
"display_test":"Display the test:",
"test":"Test",
"widget":"Widget",
"widget_options":"Widget options",
"themes_of_widget":"Themes of the widget:",
"black":"Black",
"white":"White",
"control_options":"Control options:",
"save":"Save",
"load":"Load",
"del":"Delete",
"save_a_widget_options":"Save a widget options in cookies or load an options from cookies or delete a registered options.",
"auto_update":"Automatically update when a widget opening.",
"reload_widget":"Reload widget",
"update":"Update",
"the_graphical":"The graphical method displaying:",
"lines":"lines",
"points":"points",
"image":"image",
"zoom_def":"Zoom default:",
"update_zoom":"Update zoom",
"show_grid":"Show grid",
"show_axis":"Show axis",
"scale":"Scale",
"thickness":"Thickness:",
"offset_diagram":"Offset diagram:",
"accuracy_graph":"Accuracy graph:",
"show_the_style":"Show the style:",
"surfaces":"surfaces",
"points":"points",
"reset_display":"Reset display",
"accuracy_func":"Accuracy function:",
"use_the_color":"Use the color:",
"positive_value":"positive value",
"negative_value":"negative value",
"general_value":"general value",
"how_it_work":"How it works",
"this_widget_allow":"This widget allows to draw mathematical function. Enter function in the field in the top part of the widget and press\"Display\"",
"you_can_enter":"You can enter following mathematical functions:",
"basic_operations":"Basic operations",
"plus":"Plus",
"minus":"Minus",
"multi":"Multiplication",
"division":"Division",
"mod":"Mod",
"trigonometric":"Trigonometric functions",
"sine":"Sine",
"cosine":"Cosine",
"tangent":"Tangent",
"cotangent":"Cotangent",
"secant":"Secant",
"cosecant":"Cosecant",
"arc_sine":"Arc sine",
"arc_cosine":"Arc cosine",
"arc_tangent":"Arc tangent",
"arc_cotangent":"Arc cotangent",
"hyperbolic_func":"Hyperbolic functions",
"hyp_sine":"Hyperbolic sine",
"hyp_cosine":"Hyperbolic cosine",
"hyp_tangent":"Hyperbolic tangent",
"hyp_cotangent":"Hyperbolic cotangent",
"hyp_secant":"Hyperbolic secant",
"hyp_cosecant":"Hyperbolic cosecant",
"hyp_arc_sine":"Hyperbolic arc sine",
"hyp_arc_cosine":"Hyperbolic arc cosine",
"hyp_arc_tangent":"Hyperbolic arc tangent",
"hyp_arc_cotangent":"Hyperbolic arc cotangent",
"square_roots_and_degrees":"Square roots and degrees",
"square_root":"Square root",
"degree":"Degree",
"root":"Root",
"variable_x":"Variable x to the power y",
"root_y":"Root y of x",
"exponential":"Exponential and logarithm",
"natural_log":"Natural logarithm",
"decimal_log":"Decimal logarithm",
"abs":"Absolute number value",
"rounding":"Rounding",
"round_nearest":"Rounding to the nearest whole number",
"round_nearest_big":"Rounding to the nearest whole number in a big way",
"round_nearest_small":"Rounding to the nearest whole number the smaller side",
"consts":"Constants",
"available_const":"Also are some constants available:",
"keys":"Keyboard keys",
"moved_left":"Graph will be moved left",
"moved_top":"Graph will be moved top",
"moved_right":"Graph will be moved right",
"moved_botom":"Graph will be moved bottom",
"guide":"User's guide",
"using":"Using",
"examples":"Examples",
"other":"Other",
"you_can_view":"You can view example. Don't forget to set a accuracy in option if it will be necessary.",
"save_graph":"Save graph",
"in_some_browsers":"In some browsers when display method \"Canvas\" used you can save graph by clcking it with right mouse button and selecting \"Save image\". Also you can save 3D-graphs.",
"offset":"Offset",
"if_graph_isnt":"If graph isn't in the right plase (larger than canvas) then can you set necessary parameters graph displaying in settings menu.",
"history":"History",
"current":"Current",
"additional":"Additional",
"left_arrow":"left arrow",
"right_arrow":"right arrow",
"top_arrow":"top arrow",
"bottom_arrow":"bottom arrow",
"or":"or",
"funcs":"Functions",
"widget_is_developed":"Widget is developed by",
"if_you_want_to":"If you want to inform about a bug, make a proposal or just ask some questions. You can contact to me at the following e-mail:",
"if_you_want_to_change":"If you want to change background design then you can contact at following address:",
"set_of_def":"Set of definitions:",
"parity":"Parity:",
"zeros":"Zeros of function:",
"signe":"Sign:",
"asympt":"Asymptotes",
"min":"Min",
"ev":"even",
"unev":"uneven",
"na":"n/a",
"curve_lower":"curve is lower than a AH",
"curve_higher":"curve is higher than a AH",
"max":"Max",
"no_min":"No minimum",
"no_max":"No maximum",
"tool_for":"Tool for analysis of function is not reliable on 100%. Don't forget check results of analysis before use it.",
"ah_left":"AH left:",
"ah_right":"AH right:",
"av":"AV:",
"options_saved":"Options saved!",
"cur_version":"Current version:",
"last_version":"The last on-line version:",
"using_web":"This widget is available to using on web-site:",
"show_saved":"Now parameters will be saved"
},
"ru":{
"fnc": "Функция: ",
"display":"Показать",
"x_axis":"ось X",
"y_axis":"ось Y",
"zoom":"Размер",
"color":"Цвет:",
"menus":"Меню",
"tools":"Инструменты",
"options":"Опции",
"help":"Помощь",
"about":"О программе",
"mouse_events":"События мыши:",
"moving":"Движение",
"tangente":"Касательная",
"point":"Точка",
"choosing_color":"Выбор цвета:",
"value":"Значение:",
"saturation":"Насыщенность:",
"red":"Красный:",
"green":"Зеленый:",
"blue":"Голубой:",
"opacity":"Прозрачность:",
"check":"Применить",
"derivative":"Производная:",
"square_under_func":"Область функции:",
"from":"От",
"to":"До",
"calculate":"Посчитать",
"draw":"Зарисовать",
"point_calculate":"Рассчитать точку функции:",
"estimate":"Оценить",
"analysis_of_func":"Анализ функции:",
"start_to_analysis":"Начать анализ",
"quit":"Выйти",
"display_test":"Показать тест:",
"test":"Тест",
"widget":"Виджет",
"widget_options":"Настройки виджета",
"themes_of_widget":"Темы виджета:",
"black":"Черный",
"white":"Белый",
"control_options":"Опции управления:",
"save":"Сохранить",
"load":"Загрузить",
"del":"Удалить",
"save_a_widget_options":"Сохранить или загрузить настройки виджета в/из куки-файлов, или же удалить выбранные опции",
"auto_update":"Автоматическое обновление виджета при загрузке",
"reload_widget":"Перегрузить виджет",
"update":"Обновить",
"the_graphical":"Графический метод отображения:",
"lines":"линии",
"points":"точки",
"image":"изображения",
"zoom_def":"Размер по-умолчанию:",
"update_zoom":"Изменить размер:",
"show_grid":"Показать таблицу",
"show_axis":"Показать оси",
"scale":"Масштаб",
"thickness":"Толщина",
"offset_diagram":"Смещение диаграммы:",
"accuracy_graph":"Точность графика:",
"show_the_style":"Показать стиль:",
"surfaces":"поверхности",
"points":"точки",
"reset_display":"Обновить отображение",
"accuracy_func":"Точность функции:",
"use_the_color":"Использовать цвет:",
"positive_value":"положительное значение",
"negative_value":"отрицательное значение",
"general_value":"основное значение",
"how_it_work":"Как это работает",
"this_widget_allow":"Этот виджет позволяет рисовать математические функции. Введите функцию в верхней части виджета и нажмите \"Показать\"",
"you_can_enter":"Вы можете использовать следующие математические функции:",
"basic_operations":"Основные операции",
"plus":"Сложение",
"minus":"Вычетание",
"multi":"Произведение",
"division":"Частное",
"mod":"Остаток от деления",
"trigonometric":"Тригонометрические функции",
"sine":"Синус",
"cosine":"Косинус",
"tangent":"Тангенс",
"cotangent":"Котангенс",
"secant":"Секанс",
"cosecant":"Косеканс",
"arc_sine":"Арксинус",
"arc_cosine":"Арккосинус",
"arc_tangent":"Арктангенс",
"arc_cotangent":"Арккотангенс",
"hyperbolic_func":"Гиперболические функции",
"hyp_sine":"Гиперболический синус",
"hyp_cosine":"Гиперболический косинус",
"hyp_tangent":"Гиперболический тангенс",
"hyp_cotangent":"Гиперболический котангенс",
"hyp_secant":"Гиперболический секанс",
"hyp_cosecant":"Гиперболический косеканс",
"hyp_arc_sine":"Гиперболический арксинус",
"hyp_arc_cosine":"Гиперболический арккосинус",
"hyp_arc_tangent":"Гиперболический арктангенс",
"hyp_arc_cotangent":"Гиперболический арккотангенс",
"square_roots_and_degrees":"Квардатные корни и степени",
"square_root":"Квадратный корень",
"degree":"Степень",
"root":"Корень",
"variable_x":"Переменная х в степени у",
"root_y":"Корень y степени x",
"exponential":"Экспоненты и логарифмы",
"natural_log":"Натуральный логарифм",
"decimal_log":"Десятичный логарифм",
"abs":"Абсолютное значение числа",
"rounding":"Округление",
"round_nearest":"Округление до ближайшего целого числа",
"round_nearest_big":"Округление до ближайшего целого числа в большую сторону",
"round_nearest_small":"Округление до ближайшего целого числа в меньую сторону",
"consts":"Константы",
"available_const":"Также доступны некоторые константы:",
"keys":"Горячие клавиши",
"moved_left":"График будет сдвинут влево",
"moved_top":"График будет сдвинут вверх",
"moved_right":"График будет сдвинут вправо",
"moved_bottom":"График будет сдвинут вниз",
"guide":"Руководство пользователя",
"using":"Использование",
"examples":"Примеры",
"other":"Другое",
"you_can_view":"Вы можете посмотреть примеры. Не забывайте выставить точность в настройках, если это необходимо.",
"save_graph":"Сохранить график",
"in_some_browsers":"В некоторых браузерах при выборе метода отоюражения \"Canvas\" вы можете сохранить гафик кликом ПКМ на нем и выбором пункта \"Сохранить изображение\". Таким же способом вы можете сохранять 3D-графики.",
"offset":"Смещение",
"if_graph_isnt":"Если график арсположен в неправильном месте (больше, чем холст), то Вы можете выставить необходимые параметры отображения графа в настройках виджета.",
"history":"История",
"current":"Текущие",
"additional":"Дополнительные",
"left_arrow":"стрелка влево",
"right_arrow":"стрелка вправо",
"top_arrow":"стрелка вверх",
"bottom_arrow":"стрелка вниз",
"or":"или",
"funcs":"Функции",
"widget_is_developed":"Виджет разработан ",
"if_you_want_to":"Если вы хотите сообщить о проблеме, внести предложение или задать некоторые вопросы, то можете связаться со мной через электронную почту:",
"if_you_want_to_change":"Если вы хотите изменить дизайн, обращайтесь по адресу:",
"set_of_def":"Набор определений:",
"parity":"Равенство:",
"zeros":"Нули функции:",
"signe":"Знак:",
"asympt":"Ассимптоты",
"min":"Мин",
"ev":"равны",
"unev":"не равны",
"na":"не определено",
"curve_lower":"кривая ниже, чем горизонтальная ассимптота",
"curve_higher":"кривая выше, чем горизонтальная ассимптота",
"max":"Макс",
"no_min":"Нет минимума",
"no_max":"Нет максимума",
"tool_for":"Анализ функции не надежен на 100%. Не забывайте проверить результат анализа перед их использованием.",
"ah_left":"ГА слева:",
"ah_right":"ГА справа:",
"av":"ВА:",
"options_saved":"Настройки сохранены!",
"cur_version":"Текущая версия:",
"last_version":"Последняя он-лайн версия:",
"using_web":"Этот виджет доступен для использования на сайте:",
"show_saved":"Теперь параметры будут сохранены"
},
"fr":{
"fnc":"Fonction: ",
"display":"Afficher",
"x_axis":"Axe des X de:",
"y_axis":"Axe des Y de:",
"zoom":"Zoom",
"color":"Couleur:",
"menus":"Menus",
"tools":"Outils",
"options":"Options",
"help":"Aide",
"about":"À propos",
"mouse_events":"Action de la souris:",
"moving":"Déplacement",
"tangente":"Tangente",
"point":"Point",
"choosing_color":"Choix de la couleur:",
"value":"Valeur:",
"saturation":"Saturation:",
"red":"Rouge:",
"green":"Vert:",
"blue":"Bleu:",
"opacity":"Opacité:",
"check":"Valider",
"derivative":"Dessiner la dérivée de la fonction:",
"square_under_func":"Aire sous la fonction:",
"from":"From",
"to":"To",
"calculate":"Calculer",
"draw":"Dessiner",
"point_calculate":"Calculer un point de la fonction:",
"estimate":"Évaluer",
"analysis_of_func":"Analyse de la fonction:",
"start_to_analysis":"Démarrer l'étude",
"quit":"Fermer",
"display_test":"Afficher les tests:",
"test":"Test",
"widget":"Widget",
"widget_options":"Options du widget",
"themes_of_widget":"Thème du widget:",
"black":"Noir",
"white":"Blanc",
"control_options":"Gèrer les options:",
"save":"Sauvegarder",
"load":"Charger",
"del":"Supprimer",
"save_a_widget_options":"Sauvegarder les options du widget dans les cookies, charger les options depuis les cookies ou supprimer les options actuellement enregistrées.",
"auto_update":"Mise à jour automatique à l'ouverture du widget.",
"reload_widget":"Recharger le widget",
"update":"Mise à jour",
"the_graphical":"Méthode d'affichage du graphique:",
"lines":"lignes",
"points":"points",
"image":"image",
"zoom_def":"Zoom par défaut:",
"update_zoom":"Réinitialiser le zoom",
"show_grid":"Afficher la grille",
"show_axis":"Afficher les axes ",
"scale":"Afficher l'échelle ",
"thickness":"Épaisseur de la fonction:",
"offset_diagram":"Décalage du graphique:",
"accuracy_graph":"Précision des calculs du graphique:",
"show_the_style":"Style d'affichage:",
"surfaces":"surfaces",
"points":"points",
"reset_display":"Réinitialiser l'affichage",
"accuracy_func":"Précision de la fonction:",
"use_the_color":"Utilisation des couleurs:",
"positive_value":"valeur positive",
"negative_value":"valeur négative",
"general_value":"valeur générale",
"how_it_work":"Fonctionnement",
"this_widget_allow":"Ce widget vous permet de dessiner des fonctions mathématiques. Entrez une fonction dans le champ en haut du widget et cliquez sur le bouton \"Afficher\".",
"you_can_enter":"Vous pouvez saisir les fonctions mathématiques suivantes:",
"basic_operations":"Les opérations de base",
"plus":"Addition",
"minus":"Soustraction",
"multi":"Multiplication",
"division":"Division",
"mod":"Modulo",
"trigonometric":"Les fonctions trigonométriques",
"sine":"Sinus",
"cosine":"Cosinus",
"tangent":"Tangente",
"cotangent":"Cotangente",
"secant":"Secante",
"cosecant":"Cosecante",
"arc_sine":"Arcsinus",
"arc_cosine":"Arccosinus",
"arc_tangent":"Arctangente",
"arc_cotangent":"Arccotangente",
"hyperbolic_func":"Les fonctions hyperboliques",
"hyp_sine":"Sinus hyp",
"hyp_cosine":"Cosinus hyp",
"hyp_tangent":"Tangente hyp",
"hyp_cotangent":"Cotangente hyp",
"hyp_secant":"Secante hyp",
"hyp_cosecant":"Cosecante hyp",
"hyp_arc_sine":"Arcsinus hyp",
"hyp_arc_cosine":"Arccosinus hyp",
"hyp_arc_tangent":"Arctangente hyp",
"hyp_arc_cotangent":"Arccotangente hyp",
"square_roots_and_degrees":"Les racines et les puissances",
"square_root":"Racine carrée",
"degree":"Puissances",
"root":"Racines",
"variable_x":"Élève x à une puissance y",
"root_y":"Racine y d'un nombre x",
"exponential":"Les exponentielles et logarithmes",
"natural_log":"logarithme naturel",
"decimal_log":"logarithme de base",
"abs":"La valeur absolue d'un nombre",
"rounding":"Les arrondis",
"round_nearest":"arrondit à l'entier le plus proche",
"round_nearest_big":"arrondit à l'entier supérieur",
"round_nearest_small":"arrondit à l'entier inférieur",
"consts":"Constantes",
"available_const":"Quelques constantes sont aussi disponibles:",
"keys":"Touches clavier",
"moved_left":"déplacer le graphique à gauche",
"moved_top":"déplacer le graphique en haut",
"moved_right":"déplacer le graphique à droite",
"moved_botom":"déplacer le graphique en bas",
"guide":"Guide d'utilisation",
"using":"Utilisation",
"examples":"Exemples",
"other":"Autres",
"you_can_view":"Vous pouvez cliquer sur un exemple pour l'afficher. Pensez à ajuster la précision du graphique dans les options si nécessaire",
"save_graph":"Enregistrer le graphique",
"in_some_browsers":"Dans certains navigateurs, lorsque vous utilisez la méthode d'affichage \"Canvas\", vous pouvez sauvegarder le graphique en cliquant avec le bouton de droite de la souris sur celui-ci et en séléctionnant \"Enregistrer l'image\". Vous pouvez aussi sauvegarder le graphique 3D. ",
"offset":"Décalage",
"if_graph_isnt":"Si le graphique n'est pas à la bonne place (il dépasse de la zone prévue), ajustez le \"décalage du graphique\" dans le menu des options. Pour Konqueror, il faut utiliser un décalage de x=122 et y=48.",
"history":"Historique",
"current":"Actuelle",
"additional":"Supplémentaires",
"left_arrow":"flèche gauche",
"right_arrow":"flèche droite",
"top_arrow":"flèche haut",
"bottom_arrow":"flèche bas",
"or":"ou",
"funcs":"Fonction",
"widget_is_developed":"Widget réalisé par",
"if_you_want_to":"Si vous voulez rapporter un bug, avez une suggestion par rapport au widget ou voulez simplement poser une question, merci de me contacter par:",
"if_you_want_to_change":"Les images d'arrière-plan du widget on été tirées des thèmes du bureau \"plasma-desktop\" de l'environnement:",
"set_of_def":"Ensemble de définition:",
"parity":"Parité:",
"zeros":"Zéros de la fonction:",
"signe":"Signe:",
"asympt":"Asymptotes",
"min":"Min",
"ev":"paire",
"unev":"impaire",
"na":"aucune",
"curve_lower":"courbe au-dessus de l'AH",
"curve_higher":"courbe au-dessous de l'AH",
"max":"Max",
"no_min":"Aucun minimum",
"no_max":"Aucun maximum",
"tool_for":"L'outil permettant d'étudier les fonctions n'est pas fiable à 100%. Pensez à vérifier les résultats de l'étude avant d'en faire une quelconque utilisation.",
"ah_left":"AH gauche:",
"ah_right":"AH droite:",
"av":"AV:",
"options_saved":"Options sauvegardées!",
"cur_version":"Version en cours d'utilisation:",
"last_version":"Dernière version disponible en ligne:",
"using_web":"Ce widget est également utilisable dans un navigateur internet sur le site:",
"show_saved":"Options actuellement sauvegardées"
},
"sk":{
"fnc":"Funkcia: ",
"display":"Zobraziť",
"x_axis":"Os x",
"y_axis":"Os y",
"zoom":"Lupa",
"color":"Farba:",
"menus":"Menu",
"tools":"Nástroje",
"options":"Možnosti",
"help":"Pomoc",
"about":"O aplikácii",
"mouse_events":"Činnosti s myšou:",
"moving":"Presúvanie",
"tangente":"Dotyčnica",
"point":"Bod",
"choosing_color":"Výber farby:",
"value":"Hodnota:",
"saturation":"Nasýtenie:",
"red":"Červená:",
"green":"Zelená:",
"blue":"Modrá:",
"opacity":"Priehľadnosť:",
"check":"Vyskúšať",
"derivative":"Derivovaná funkcia:",
"square_under_func":"Štvorec pod funkciou:",
"from":"Od",
"to":"Do",
"calculate":"Vypočítať",
"draw":"Vyznačiť",
"point_calculate":"Vypočítať bod podľa funkcie:",
"estimate":"Odhadnúť",
"analysis_of_func":"Analýza funkcie:",
"start_to_analysis":"Spustiť analýzu",
"quit":"Koniec",
"display_test":"Zobraziť test:",
"test":"Test",
"widget":"Widget",
"widget_options":"Možnosti widgetu",
"themes_of_widget":"Farba widgetu:",
"black":"čierna",
"white":"biela",
"control_options":"Možnosti ovládania:",
"save":"Uložiť",
"load":"Spustiť",
"del":"Vymazať",
"save_a_widget_options":"Uloží nastavenia widgetu do cookies alebo spustí nastavenia z cookies alebo vymaže uložené nastavenia.",
"auto_update":"Automaticky aktualizovať pri otvorení widgetu.",
"reload_widget":"Znova spustiť widget",
"update":"Aktualizovať",
"the_graphical":"Spôsob grafického zobrazenia: ",
"lines":"čiary",
"points":"body",
"image":"obrázok",
"zoom_def":"Predvolená lupa:",
"update_zoom":"Aktualizovať lupu",
"show_grid":"Zobraziť mriežku",
"show_axis":"Zobraziť os",
"scale":"Mierka",
"thickness":"Hrúbka:",
"offset_diagram":"Posunúť diagram:",
"accuracy_graph":"Presnosť grafu:",
"show_the_style":"Zobraziť štýl:",
"surfaces":"plocha",
"points":"body",
"reset_display":"Obnoviť zobrazenie",
"accuracy_func":"Presnosť funkcie:",
"use_the_color":"Použiť farbu:",
"positive_value":"positívna hodnota",
"negative_value":"negatívna hodnota",
"general_value":"všeobecná hodnota",
"how_it_work":"Ako to funguje",
"this_widget_allow":"Tento widget vám umožňuje nakresliť graf matematickej funkcie. Zadajte funkciu do poľa v hornej časti a stlačte tlačidlo\"Zobraziť\"",
"you_can_enter":"Môžete zadať tieto matematické funkcie:",
"basic_operations":"Základné operácie",
"plus":"plus",
"minus":"mínus",
"multi":"násobenie",
"division":"delenie",
"mod":"mod",
"trigonometric":"Trigonometrické funkcie",
"sine":"sínus",
"cosine":"kosínus",
"tangent":"tangens",
"cotangent":"kotangens",
"secant":"sekant",
"cosecant":"kosekant",
"arc_sine":"arkus sínus",
"arc_cosine":"arkus kosínus",
"arc_tangent":"arkus tangens",
"arc_cotangent":"arkus kotangens",
"hyperbolic_func":"Hyperbolické funkcie",
"hyp_sine":"hyperbolický sínus",
"hyp_cosine":"hyperbolický kosínus",
"hyp_tangent":"hyperbolický tangens",
"hyp_cotangent":"hyperbolický kotangens",
"hyp_secant":"hyperbolický sekant",
"hyp_cosecant":"hyperbolický kosecant",
"hyp_arc_sine":"hyperbolický arkus sínus",
"hyp_arc_cosine":"hyperbolický arkus kosínus",
"hyp_arc_tangent":"hyperbolický arkus tangens",
"hyp_arc_cotangent":"hyperbolický arkus kotangens",
"square_roots_and_degrees":"Mocminy a odmocniny",
"square_root":"Druhá odmocnina",
"degree":"Mocniny",
"root":"Odmocniny",
"variable_x":"hodnota x umocnená na y",
"root_y":"Odmocnina y z čísla x",
"exponential":"Exponenciálne funkcie a logaritmy",
"natural_log":"Prirodzený logaritmus",
"decimal_log":"Dekadický logaritmus",
"abs":"Absolútna hodnota čísla",
"rounding":"Zaokrúhľovanie",
"round_nearest":"zaokrúhlenie na najbližšie celé číslo",
"round_nearest_big":"zaokrúhlenie na najbližšie väčšie celé číslo",
"round_nearest_small":"zaokrúhlenie na najbližšie menšie celé číslo",
"consts":"Konštanty",
"available_const":"K dispozíci je aj niekoľko konštánt:",
"keys":"Klávesové skratky",
"moved_left":"graf sa posunie doľava",
"moved_top":"graf sa posunie nahor",
"moved_right":"graf sa posunie doprava",
"moved_botom":"graf sa posunie nadol",
"guide":"Používateľská príručka",
"using":"Použitie",
"examples":"Príklady",
"other":"Iné",
"you_can_view":"Tento príklad si môžete zobraziť. Nezabudnite v možnostiach nastaviť presnosť, ak to bude potrebné.",
"save_graph":"Uloženie grafu",
"in_some_browsers":"V niektorých prehliadačoch pri použití metódy zobrazenia \"Plátno\" môžete uložiť graf tak, že naň kliknete pravým tlačidlom myši a vyberiete možnosť \"Uložiť obrázok\". Môžete ukladať aj 3D-grafy.",
"offset":"Posun",
"if_graph_isnt":"Ak graf nie je na správnom mieste (je väčší ako plátno), môžete nastaviť potrebné nastavenia v menu.",
"history":"História",
"current":"Súčasná",
"additional":"Ďalšia",
"left_arrow":"šípka doľava",
"right_arrow":"šípka doprava",
"top_arrow":"šípka nahor",
"bottom_arrow":"šípka nadol",
"or":"alebo",
"funcs":"Funkcie",
"widget_is_developed":"Widget programuje",
"if_you_want_to":"Ak nás chcete informovať o chybe, napísať nám podnet alebo sa len niečo opýtať, môžete napísať na tento e-mail:",
"if_you_want_to_change":"Ak chcete zmeniť dizajn pozadia, potom môžete napísať na túto adresu:",
"set_of_def":"Definičný obor:",
"parity":"Párnosť:",
"zeros":"Núl vo funcii:",
"signe":"Znamienko:",
"asympt":"Asymptoty",
"min":"Min",
"ev":"párna",
"unev":"nepárna",
"na":"–",
"curve_lower":"Krivka je nižšie ako HA",
"curve_higher":"Krivka je vyššie ako HA",
"max":"Max",
"no_min":"Žiadne minimum",
"no_max":"Žiadne maximum",
"tool_for":"Nástroj na analýzu funkcie nie je spoľahlivý na 100 %. Nezabudnite si skontrolovať výsledky analýzy predtým, ako ich použijete.",
"ah_left":"HA vľavo:",
"ah_right":"HA vpravo:",
"av":"AV:",
"options_saved":"Nastavenia uložené!",
"cur_version":"Súčasná verzia:",
"last_version":"Najnovšia on-line verzia:",
"using_web":"Tento widget je dostupný na používanie na stránke:",
"show_saved":"Teraz budú parametre uložené"
}
};
/* ----------------- */
/* CSS */
/* ----------------- */
/* Arrière plan du widget */
body{
background-image: url('../Images/fond2.png');
background-repeat: no-repeat;
background-position: 0px 0px;
}
/* Zone d'affichage des fonctions */
#affichage{
position: absolute;
top: 52px;
left: 129px;
width: 500px;
height: 400px;
overflow:hidden;
border: 2px solid black;
border-radius: 5px;
-moz-border-radius: 5px;
-webkit-border-radius: 5px;
}
/* Texte et boutons qui sont en haut du widget */
#haut{
position: relative;
top: 13px;
left: 20px;
width: 500px;
z-index: 2;
}
/* Champ permettant d'entrer la fonction à dessiner */
#inputEq{
width: 200px;
}
/* Texte à côté du champ de la fonction à dessiner */
#texteFonction{
color: white;
font-weight: bold;
}
/* Partie gauche du widget comprenant les boutons des menus et les options rapides */
#gauche{
position: absolute;
top: 62px;
left: 18px;
width: 100px;
height: 380px;
padding: 2px;
color: white;
font-size: 80%;
background-image: url('../Images/gauche2.png');
border-color: black;
/*border-width: 2px;*/
border-width: 0px;
border-style: solid;
border-radius: 5px;
-moz-border-radius: 5px;
-webkit-border-radius: 5px;
}
/* Boutons qui sont dans la partie gauche et qui ouvrent les différents menus */
.boutonGauche{
width: 100%;
height: 32px;
text-align: center;
}
/* Partie gauche du widget lorsque l'affichage 3D est activé */
#gauche3D{
position: absolute;
left: -149px;
top: 234px;
width: 360px;
height: 32px;
padding: 2px;
padding-left: 14px;
border: 2px solid rgba(255, 255, 255, 0.4);
border-radius: 5px;
-moz-border-radius: 5px;
-webkit-border-radius: 5px;
background-color: rgba(255, 255, 255, 0.3);
-moz-transform: rotate(270deg);
-webkit-transform: rotate(270deg);
-o-transform: rotate(270deg);
display: none;
z-index: -1;
}
#gauche3D input.boutonGauche3D{
width: 90px;
height: 30px;
}
/* Style pour les menus */
.menu{
position: absolute;
top: 68px;
left: 121px;
width: 450px;
height: 350px;
padding: 10px;
overflow: hidden;
background-color: rgba(255, 255, 255, 0.7);
border-style: none;
border-width: 1px;
border-color: rgba(0,70,128, 0.9);
border-radius: 4px;
-moz-border-radius: 4px;
-webkit-border-radius: 4px;
z-index: 2;
display: none;
}
.barreBasMenu{
position: absolute;
right: 0px;
bottom: 0px;
}
.contenuMenu{
font-size: 14px;
padding: 10px;
overflow: auto;
max-height: 315px;
}
.avecBordures{
border-top: 1px solid rgba(255, 255, 255, 0.4);
height: 80%
}
.ongletMenu{
position: relative;
top: 3px;
width: 100%;
}
.ongletMenu tr td{
width: 30%;
height: 30px;
text-align: center;
font-weight: normal;
background-color: rgba(255, 255, 255, 0.7);
border: 1px solid rgba(255, 255, 255, 0.9);
border-radius: 4px;
-moz-border-radius: 4px;
-webkit-border-radius: 4px;
opacity: 0.5;
cursor: pointer;
}
.ongletMenu tr td:hover{
opacity: 1;
}
.ongletMenu tr td.ongletMenuActuel{
position:relative;
top:-1px;
opacity: 0.9;
font-weight: bold;
border-bottom : none;
border-bottom-left-radius: 0px;
border-bottom-right-radius: 0px;
-moz-border-radius-bottomleft: 0px;
-moz-border-radius-bottomright: 0px;
-webkit-border-bottom-left-radius: 0px;
-webkit-border-bottom-right-radius: 0px;
}
.miniMenu{
position: absolute;
top: 120px;
left: 170px;
width: 320px;
height: 240px;
padding: 10px;
text-align: center;
font-size: 14px;
overflow: auto;
background-color: rgba(255, 255, 255, 0.9);
border-style: solid;
border-width: 1px;
border-color: rgba(0,70,128, 0.9);
border-radius: 15px;
-moz-border-radius: 15px;
-webkit-border-radius: 15px;
z-index: 2;
display: none;
}
.alertMenu{
position: absolute;
top: 170px;
left: 220px;
width: 220px;
height: 140px;
padding: 10px;
text-align: center;
font-size: 14px;
overflow: auto;
background-color: rgba(255, 255, 255, 0.9);
border-style: solid;
border-width: 1px;
border-color: rgba(0,70,128, 0.9);
border-radius: 15px;
-moz-border-radius: 15px;
-webkit-border-radius: 15px;
z-index: 3;
display: none;
}
.miniMenu input{
width: 45%;
height: 32px;
}
.alertMenu input{
width: 45%;
height: 32px;
}
/* Menu des crédits */
#credits{
width: 80%;
margin: auto;
}
#credits tr td{
padding: 20px;
width: 100%;
height: 150px;
text-align: center;
vertical-align: middle;
background-color: rgba(255, 255, 255, 0.7);
border: 2px solid white;
border-radius: 10px;
-moz-border-radius: 10px;
-webkit-border-radius: 10px;
}
#credits tr td img{
float: left;
}
#credits tr td a{
font-size: 80%;
}
#credits tr td h3{
text-align:center;
}
/* Aperçu couleur 3D*/
#apercuCouleur3D{
border: 1px solid rgba(0, 0, 0, 0.7);
border-radius: 4px;
-moz-border-radius: 4px;
-webkit-border-radius: 4px;
}
/* Taille des champs contenant seulement 2 ou 3 caractères */
.smallInput{
width: 35px;
}
/* Choix de la saturation et de la valeur dans le ColorPicker */
#colorSV{
float: left;
width: 255px;
height: 255px;
border: 1px solid black;
background-color: red;
cursor: crosshair;
}
/* Choix de la teinte dans le ColorPicker */
#colorT{
float: left;
width: 20px;
height: 255px;
margin-left: 10px;
border: 1px solid black;
background-color: black;
cursor: crosshair;
}
/* Valeurs de la couleur dans le ColorPicker */
#colorValues{
position: relative;
left: 10px;
font-size: 80%;
}
/* Boutons qui ouvrent le ColorPicker */
/*Menu de gauche*/
#buttonColor{
float: left;
position: relative;
left: 75px;
top: -18px;
width: 20px;
height: 20px;
border: 1px white solid;
border-radius: 5px;
-moz-border-radius: 5px;
-webkit-border-radius: 5px;
background-color: rgb(193,255,0);
cursor:pointer;
}
#buttonColor:hover{
border-width: 2px;
left: 74px;
top: -19px;
}
#apercuCouleur{
position: absolute;
right: 20px;
bottom: 40px;
width: 40px;
height: 30px;
border: 1px white solid;
border-radius: 5px;
-moz-border-radius: 5px;
-webkit-border-radius: 5px;
background-color: rgb(193,255,0);
}
#apercuCouleur2{
position: absolute;
right: 65px;
bottom: 40px;
width: 40px;
height: 30px;
border: 1px white solid;
border-radius: 5px;
-moz-border-radius: 5px;
-webkit-border-radius: 5px;
background-color: rgb(193,255,0);
}
/*Fonctions supplémentaires*/
.boutonCouleur{
position: relative;
left: 2px;
top: 0px;
width: 20px;
height: 20px;
color: rgba(0,0,0,0);
border: 1px white solid;
border-radius: 5px;
-moz-border-radius: 5px;
-webkit-border-radius: 5px;
background-color: rgb(0,171,255);
cursor:pointer;
}
.boutonCouleur:hover{
border-width: 2px;
left: 1px;
top: 0px;
}
/* Texte d'information (plus petit) */
.texteSecondaire{
font-size: 11px;
color: rgba(0,0,0,0.5);
margin-left: 10px;
}
/* Style pour le texte où on peut cliquer dessus */
.survol{
cursor: pointer;
}
.survol:hover{
color: rgba(0,0,0,0.5);
}
/* Texte en gras */
.gras{
font-weight: bold;
}
/* Flèches permettant de deplacer l'affichage */
.flecheDeplacement{
color: black;
opacity: 0;
font-size: 56px;
text-align: center;
cursor: pointer;
z-index: 1;
}
.flecheDeplacement:hover{
opacity: 0.4;
}
#flecheHaut{
position: absolute;
top: 46px;
left: 345px;
width: 70px;
height: 55px;
}
#flecheBas{
position: absolute;
top: 381px;
left: 345px;
width: 70px;
height: 55px;
}
#flecheGauche{
position: absolute;
top: 216px;
left: 137px;
width: 55px;
height: 70px;
}
#flecheDroite{
position: absolute;
top: 216px;
left: 567px;
width: 55px;
height: 70px;
}
/* Bouton permettant de minimiser et maximiser le widget */
#miniMax{
position: absolute;
right: 10px;
top: 10px;
font-size: 24px;
color: rgba(0,0,0,0.4);
cursor: pointer;
}
#miniMax:hover{
color: rgba(0,0,0,1);
}
/* Boutons permettant de choisir l'action de la souris dans le menu des outils */
.choixOutil{
width: 125px;
height: 40px;
font-size: 14px;
cursor: pointer;
}
/* Point sous la souris */
#point{
position: absolute;
top: -10px;
left: -10px;
color: white;
}
/* Coordonnées du points sous la souris */
#info{
position: absolute;
top: 57px;
left: 137px;
color: white;
}
/* Outil de tangente */
#tangente{
position: absolute;
top: 52px;
left: 129px;
width: 500px;
height: 400px;
z-index: -1;
}
/* Petits boutons plus et moins dans les options */
.boutonPlus{
position: relative;
top: -7px;
left: -5px;
width: 10px;
height: 10px;
font-size: 9px;
text-align: center;
background-color: rgba(0, 140, 255, 0.2);
border: 1px rgba(0,0,0,0.5) solid;
border-radius: 3px;
-moz-border-radius: 3px;
-webkit-border-radius: 3px;
cursor: pointer;
display: inline-block;
}
.boutonMoins{
position: relative;
top: 6px;
left: -17px;
width: 10px;
height: 10px;
font-size: 9px;
text-align: center;
background-color: rgba(0, 140, 255, 0.2);
border: 1px rgba(0,0,0,0.5) solid;
border-radius: 3px;
-moz-border-radius: 3px;
-webkit-border-radius: 3px;
cursor: pointer;
display: inline-block;
}
.boutonPlus:hover{
border: 1px rgba(0,0,0,0.7) solid;
background-color: rgba(0, 140, 255, 0.5);
}
.boutonMoins:hover{
border: 1px rgba(0,0,0,0.7) solid;
background-color: rgba(0, 140, 255, 0.5);
}
/* Bouton qui sert à choisir entre l'affichage 3D et 2D */
#onglet3D{
position: absolute;
top: 30px;
left: 570px;
width: 40px;
height: 21px;
color: white;
text-align: center;
background-color: rgba(255, 255, 255, 0.4);
background-image: url("../Images/onglet1.png");
border: 1px solid black;
border-top-left-radius: 4px;
border-top-right-radius: 4px;
-moz-border-radius-topleft: 4px;
-moz-border-radius-topright: 4px;
-webkit-border-top-left-radius: 4px;
-webkit-border-top-right-radius: 4px;
cursor: pointer;
opacity: 0.4;
z-index: 3;
}
#onglet3D:hover{
opacity: 0.9;
}
/* Tableau du signe dans le menu d'étude de la fonction*/
#etudeSigne td{
min-width: 25px;
text-align: center;
}
#etudeSigne td.border{
border: 1px solid black;
border-radius: 3px;
-moz-border-radius: 3px;
-webkit-border-radius: 3px;
}
#etudeSigne td.infini{
background-color: rgba(0,0,0,0.5);
}
/* Titres des menus */
h1{
font-size: 16px;
font-weight: 600;
text-align: center;
/*font-style: italic;*/
margin-top: 15px;
margin-bottom: 25px;
}
h2{
font-size: 14px;
font-weight: normal;
font-style: italic;
margin-top: 30px;
}
h3{
font-size: 16px;
font-weight: 600;
text-align: left;
/*font-style: italic;*/
margin-top: 10px;
margin-bottom: 20px;
}
h4{
font-size: 16px;
font-weight: 600;
text-align: center;
/*font-style: italic;*/
margin-top: 15px;
margin-bottom: 10px;
}
/* Petits boutons en haut à droite du widget */
.miniBouton{
width: 12px;
height: 12px;
color: white;
font-size: 12px;
text-align: center;
background-color: rgba(255,255,255,0.5);
border: 1px solid white;
border-radius: 6px;
-moz-border-radius: 6px;
-webkit-border-radius: 6px;
cursor: pointer;
opacity: 0.5;
}
.miniBouton:hover{
opacity: 1;
}
#boutonAgrandir{
position: absolute;
left: 635px;
top: 11px;
z-index: 3;
}
#boutonFermer{
position: absolute;
left: 615px;
top: 11px;
z-index: 3;
}
/* Menu Mise à Jour */
#mAj{
text-align: center;
font-size: 14px;
}
#mAj h1{
font-size: 22px;
margin-top: 5px;
margin-bottom: 15px;
}
#mAj span object{
position: relative;
bottom: 4px;
width: 150px;
height: 27px;
overflow: hidden;
}
#mAj input{
height: 32px;
}
.boutonSauvegarde{
width: 100px;
height: 32px;
}
#cacheCookies{
position: absolute;
top: 170px;
left: 14px;
width: 93%;
height: 130px;
background-color: rgba(255,255,255,0.7);
border: 1px rgba(255,255,255,0.8) solid;
border-radius: 3px;
-moz-border-radius: 3px;
-webkit-border-radius: 3px;
text-align: center;
display: none;
}
#cacheMaJ{
position: absolute;
padding-top: 10px;
top: 270px;
left: 14px;
width: 93%;
height: 25px;
background-color: rgba(255,255,255,0.8);
border: 1px rgba(255,255,255,0.8) solid;
border-radius: 3px;
-moz-border-radius: 3px;
-webkit-border-radius: 3px;
text-align: center;
font-weight: bold;
display: none;
}
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<widget xmlns="http://www.w3.org/ns/widgets" <widget xmlns="http://www.w3.org/ns/widgets"
identifier="http://getuniboard.com/" identifier="http://getuniboard.com/"
version="1.3" version="1.6.0"
width="675" width="800"
height="490" height="600"
ub:resizable="false"> ub:resizable="true">
<name>Traceur de fonctions mathématiques</name> <name>Mathematical function plotter</name>
<content src="Grapheur.xhtml"/> <content src="Grapheur.html"/>
</widget> </widget>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html> <html>
<head> <head>
<meta charset="utf-8" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title>GraphMe - Version</title> <title>GraphMe - Version</title>
</head> </head>
<body> <body>
<span style="font-size:12px; text-align:center;">1.3.1 (2010/09/25)</span> <span style="font-size:12px; text-align:center;">2.1.0 (2018-06-04)</span>
</body> </body>
</html> </html>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment