+
+ Use the color:
+ red:
+
+
+ green:
+
+
+ blue:
+
+
+ General value: (from 0 to 255)
+
+
+
+
+
+
+
+
+
+
+
Using
+
Examples
+
Other
+
+
+
+
How it work.
+
This widget allow to draw mathematical function. Enter function in the field in the top part of widget and press "Show".
+
You can enter following mathematical function:
+
Basic operations
+
+
Plus -> +
+
Minus -> -
+
Multiplication -> *
+
Division -> /
+
Mod -> %
+
+
Trigonometric functions
+
+
Sine -> sin(x)
+
Cosine -> cos(x)
+
Tangent -> tan(x)
+
Cotangent -> cot(x)
+
Secant -> sec(x)
+
Cosecant -> csc(x)
+
+
+
Arc sine -> arcsin(x)orasin(x)
+
Arc cosine -> arccos(x)oracos(x)
+
Arc tangent -> arctan(x)oratan(x)
+
Arc cotangent -> arccot(x)oracot(x)
+
+
Hyperbolic functions
+
+
Hyperbolic sine -> sinh(x)
+
Hyperbolic cosine -> cosh(x)
+
Hyperbolic tangent -> tanh(x)
+
Hyperbolic cotangent -> coth(x)
+
Hyperbolic secant -> sech(x)
+
Hyperbolic cosecant -> csch(x)
+
+
+
Hyperbolic arc sine -> arcsinh(x)orasinh(x)
+
Hyperbolic arc cosine -> arccosh(x)oracosh(x)
+
Hyperbolic arc tangent -> arctanh(x)oratanh(x)
+
Hyperbolic arc cotangent -> arccoth(x)oracoth(x)
+
+
Square roots and degrees
+
+
Square root -> sqrt(x)
+
Degree -> pow(x, y)Variable x to the power y
+
Root -> root(x, y)Root y of x
+
+
Exponential and logarithm
+
+
ex -> exp(x)
+
Natural logarithm -> ln(x)
+
Decimal logarithm -> log(x)
+
+
Absolute number value
+
+
|x| -> abs(x)
+
+
Rounding
+
+
round(x) -> rounding to the nearest whole number
+
ceil(x) -> rounding to the nearest whole number in a big way
+
floor(x) -> rounding to the nearest whole number the smaller side
+
+
+
+
Constants
+
Also are available some constants:
+
+
pi = 4 * atan(1) ≈ 3,141592653589793
+
e = exp(1) ≈ 2.718281828459045
+
+
+
+
+
Keyboard keys
+
+ esc -> reset widget
+ ctrl + left arrow -> graph will be moved left
+ ctrl + top arrow -> graph will be moved top
+ ctrl + right arrow -> graph will be moved right
+ ctrl + bottom arrow -> graph will be moved bottom
+
+
+
+
+
+
+
+
+
+
+
+
Using
+
Examples
+
Other
+
+
+
+ (You can view example. Do not forget to set accuracy in options if necessary.)
+
+ 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.
+
+
Offset
+ If graph isn't in the right place (larger than canvas) then can you set necessary parameters graph displaying in settings menu.
+
+ 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.
+
+
+
2. Installation
+
+ 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 http://getuniboard.com/.
+
+
+
3. Review widget
+
Display GraphMe in browsers
+
+ 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:
+
+
+
Mozilla Firefox (3.5) : Everything works fine.
+
Internet Explorer (8.0) : Cannot open a widget, because .xhtml format is not recognized.
+
Internet Explorer (pré-version 9.0) : Widget works but just using SVG. Canvas not supported yet.
+
Konqueror (4.3.4) : Widget can be opened but there is some problems with displaying. It still occur when choosed display method "canvas".
+
Opera (10.51) : Widget quite useful.
+
Google Chrome (4.1) : Everything works very nice! 3D-display is faster as compared with other browsers.
+
+
+ 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.
+
+
Display GraphMe in Sankore
+
+
+
4. View presentation
+
+
Place for functions display.
+
Button for beginning the work.
+
Button for adding new function or for getting access to functions history.
+
Display.
+
Parameters that define the part of graph that will be displayed.
+
Buttons for zoom.
+
Button for color changing.
+
Buttons for access to menu.
+
Tab-button that toggles 2D and 3D modes.
+
Button for maximize the widget.
+
+
+
+
5. Drawing the function
+
+ To draw mathematical function just enter it at the top of widget and press button "Display". You can use different functions and predefined constants.
+
pow(x, y). Variable x to the power y. For examle: x² → pow(x, 2) (x+3)⁵ → pow((x+3), 5)
+
root(x, y). Root y of x
+
+
Exponential and logarithm
+
+
exp(x)
+
ln(x) is natural logarithm.
+
log(x) is decimal logarithm.
+
+
Rounding
+
+
round(x) → rounding to the nearest whole number
+
ceil(x) → rounding to the nearest whole number in a big way
+
floor(x) → rounding to the nearest whole number the smaller side
+
+
Other predefined function
+
+
abs(x) → Absolute number value
+
random() → Return random number between 0 and 1
+
+
Also are available some constants:
+
+
pi = 4 * atan(1) ≈ 3.141592653589793
+
e = exp(1) ≈ 2.718281828459045
+
+
+ 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.
+
+
+ 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.
+
+
+
6. Offset function
+
+ 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.
+
+
+
+ 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).
+
+
+ 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.
+
+
+ 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.
+
+
7. The options menu
+
+ 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:
+
+
+
Changing a background image and color. In Sankore changing background theme used for displaying widget on black and white background.
+
Display-method used for defining displaying function. There are 6 possibilities:
+
+
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.
+
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.
+
"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.
+
"Canvas" (point) also uses a canvas but draws a points instead of lines.
+
XPM format is little known so it's compatible just with a minority of browsers.
+
Display method "Uniboard" allows to draw directly on the page using Sankore drawing.
+
+
+
+
Default zoom button returns display into original state. It helps alsoto return to the origin.
+
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.
+
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.
+
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).
+
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).
+
In the last tab you can change such options 3D, as the accuracy of the calculations and the color of the function.
+
+
8. The tools menu.
+
+ This menu allows you to choose first action of the mouse on the graph. There is a choice of three options:
+
+
+
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.
+
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.
+
The third tool is the tangent. This tool draws the tangent to the function at the point where is a mouse cursor.
+
+
+ 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".
+
+
+ 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.
+
+
+ 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.
+
+
9. Drawing some functions
+
+ To draw multiple functions simultaneously, click the small "+" button which is located to the right of "View" (point 1). Then, a menu appears.
+
+
+
+ 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.
+
+
+ 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.
+
+
+ "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.
+
+
10. GraphMe update
+
+ The latest version of the widget can be downloaded from the following page: http://gyb.educanet2.ch/tm-widgets/.ws_gen/?15. To update GraphMe, you can also click on "Update" in the options menu.
+
+
11. Contact
+
+ 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: yannick.vessaz@gmail.com.
+
+
+
\ No newline at end of file
diff --git a/resources/library/applications/Grapheur.wgt/Images/.directory b/resources/library/applications/Grapheur.wgt/Images/.directory
new file mode 100644
index 00000000..9883dc67
--- /dev/null
+++ b/resources/library/applications/Grapheur.wgt/Images/.directory
@@ -0,0 +1,4 @@
+[Dolphin]
+ShowPreview=true
+Timestamp=2010,9,5,0,30,37
+ViewMode=0
diff --git a/resources/library/applications/Grapheur.wgt/Images/GraphMe.png b/resources/library/applications/Grapheur.wgt/Images/GraphMe.png
new file mode 100644
index 00000000..e9a1740b
Binary files /dev/null and b/resources/library/applications/Grapheur.wgt/Images/GraphMe.png differ
diff --git a/resources/library/applications/Grapheur.wgt/Images/Guide_AjouterWidget.png b/resources/library/applications/Grapheur.wgt/Images/Guide_AjouterWidget.png
new file mode 100644
index 00000000..d500ab64
Binary files /dev/null and b/resources/library/applications/Grapheur.wgt/Images/Guide_AjouterWidget.png differ
diff --git a/resources/library/applications/Grapheur.wgt/Images/Guide_Deplacement.png b/resources/library/applications/Grapheur.wgt/Images/Guide_Deplacement.png
new file mode 100644
index 00000000..bb954e7f
Binary files /dev/null and b/resources/library/applications/Grapheur.wgt/Images/Guide_Deplacement.png differ
diff --git a/resources/library/applications/Grapheur.wgt/Images/Guide_Navigateur.png b/resources/library/applications/Grapheur.wgt/Images/Guide_Navigateur.png
new file mode 100644
index 00000000..7947c9ec
Binary files /dev/null and b/resources/library/applications/Grapheur.wgt/Images/Guide_Navigateur.png differ
diff --git a/resources/library/applications/Grapheur.wgt/Images/Guide_Options.png b/resources/library/applications/Grapheur.wgt/Images/Guide_Options.png
new file mode 100644
index 00000000..fb028187
Binary files /dev/null and b/resources/library/applications/Grapheur.wgt/Images/Guide_Options.png differ
diff --git a/resources/library/applications/Grapheur.wgt/Images/Guide_Plus.png b/resources/library/applications/Grapheur.wgt/Images/Guide_Plus.png
new file mode 100644
index 00000000..f32b1399
Binary files /dev/null and b/resources/library/applications/Grapheur.wgt/Images/Guide_Plus.png differ
diff --git a/resources/library/applications/Grapheur.wgt/Images/Guide_Presentation.png b/resources/library/applications/Grapheur.wgt/Images/Guide_Presentation.png
new file mode 100644
index 00000000..071a50af
Binary files /dev/null and b/resources/library/applications/Grapheur.wgt/Images/Guide_Presentation.png differ
diff --git a/resources/library/applications/Grapheur.wgt/Images/Guide_Uniboard.png b/resources/library/applications/Grapheur.wgt/Images/Guide_Uniboard.png
new file mode 100644
index 00000000..6139040b
Binary files /dev/null and b/resources/library/applications/Grapheur.wgt/Images/Guide_Uniboard.png differ
diff --git a/resources/library/applications/Grapheur.wgt/Images/fond1.png b/resources/library/applications/Grapheur.wgt/Images/fond1.png
new file mode 100644
index 00000000..8084981e
Binary files /dev/null and b/resources/library/applications/Grapheur.wgt/Images/fond1.png differ
diff --git a/resources/library/applications/Grapheur.wgt/Images/fond2.png b/resources/library/applications/Grapheur.wgt/Images/fond2.png
new file mode 100644
index 00000000..b6e1e839
Binary files /dev/null and b/resources/library/applications/Grapheur.wgt/Images/fond2.png differ
diff --git a/resources/library/applications/Grapheur.wgt/Images/fond3.png b/resources/library/applications/Grapheur.wgt/Images/fond3.png
new file mode 100644
index 00000000..fb2b708e
Binary files /dev/null and b/resources/library/applications/Grapheur.wgt/Images/fond3.png differ
diff --git a/resources/library/applications/Grapheur.wgt/Images/fond4.png b/resources/library/applications/Grapheur.wgt/Images/fond4.png
new file mode 100644
index 00000000..0b945c39
Binary files /dev/null and b/resources/library/applications/Grapheur.wgt/Images/fond4.png differ
diff --git a/resources/library/applications/Grapheur.wgt/Images/fond5.png b/resources/library/applications/Grapheur.wgt/Images/fond5.png
new file mode 100644
index 00000000..740163a9
Binary files /dev/null and b/resources/library/applications/Grapheur.wgt/Images/fond5.png differ
diff --git a/resources/library/applications/Grapheur.wgt/Images/gauche1.png b/resources/library/applications/Grapheur.wgt/Images/gauche1.png
new file mode 100644
index 00000000..ef1fb6ed
Binary files /dev/null and b/resources/library/applications/Grapheur.wgt/Images/gauche1.png differ
diff --git a/resources/library/applications/Grapheur.wgt/Images/gauche2.png b/resources/library/applications/Grapheur.wgt/Images/gauche2.png
new file mode 100644
index 00000000..080a17f7
Binary files /dev/null and b/resources/library/applications/Grapheur.wgt/Images/gauche2.png differ
diff --git a/resources/library/applications/Grapheur.wgt/Images/gauche3.png b/resources/library/applications/Grapheur.wgt/Images/gauche3.png
new file mode 100644
index 00000000..2fd7dedc
Binary files /dev/null and b/resources/library/applications/Grapheur.wgt/Images/gauche3.png differ
diff --git a/resources/library/applications/Grapheur.wgt/Images/onglet1.png b/resources/library/applications/Grapheur.wgt/Images/onglet1.png
new file mode 100644
index 00000000..1439a8c0
Binary files /dev/null and b/resources/library/applications/Grapheur.wgt/Images/onglet1.png differ
diff --git a/resources/library/applications/Grapheur.wgt/Images/onglet2.png b/resources/library/applications/Grapheur.wgt/Images/onglet2.png
new file mode 100644
index 00000000..5f1dd669
Binary files /dev/null and b/resources/library/applications/Grapheur.wgt/Images/onglet2.png differ
diff --git a/resources/library/applications/Grapheur.wgt/JavaScript/Affichage3D.js b/resources/library/applications/Grapheur.wgt/JavaScript/Affichage3D.js
new file mode 100644
index 00000000..b6ff0e70
--- /dev/null
+++ b/resources/library/applications/Grapheur.wgt/JavaScript/Affichage3D.js
@@ -0,0 +1,332 @@
+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(){
+ if(fonction3D){ // Si activé alors on le désative
+ 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'
+ 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){
+ initialise3D()
+ if(document.getElementById("selectAffichage3D").value == "points"){
+ var coordX, coordY, coordZ
+ for(var x=gauche3D; x 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
+ }
+
+ ctx.save()
+ ctx.translate(centreX, centreY)
+ ctx.scale(valeurZoom3D, valeurZoom3D)
+ ctx.fillStyle = "rgba("+couleur[rouge3D]+","+couleur[vert3D]+", "+couleur[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)
+function polygone3D(x1, y1, z1, x2, y2, z2, x3, y3, z3, x4, y4, z4){
+ ctx.save()
+ 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 couleur = new Array()
+ couleur[0] = Math.round((5+z1)*echelle3D)
+ couleur[1] = Math.round(510 - (5+z1)*echelle3D)
+ couleur[2] = 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
+ }
+
+ ctx.fillStyle = "rgba("+couleur[rouge3D]+","+couleur[vert3D]+", "+couleur[bleu3D]+", "+opacity+")"
+ ctx.closePath()
+ ctx.fill()
+ ctx.restore()
+}
+
+// Dessine les axes
+function axes(){
+ for(var i=-5; i<5; i+=precisionDroite3D){
+ point3D(0, 0, i)
+ }
+ for(var i=-5.5; i<5.5; i+=precisionDroite3D){
+ point3D(i, 0, 0)
+ }
+ for(var i=-5.5; i<5.5; i+=precisionDroite3D){
+ point3D(0, i, 0)
+ }
+}
+
+function cube(x, y, z, r){
+ // Face de devant
+ for(var i=0; i 255){
+ couleurGenerale = 255
+ }
+ switch(document.getElementById("selectRouge3D").value){
+ case "plus":
+ rouge3D = 0
+ rouge = 255
+ sensRouge = -1
+ break
+ case "moins":
+ rouge3D = 1
+ rouge = 0
+ sensRouge = 1
+ break
+ case "tout":
+ rouge3D = 2
+ rouge = couleurGenerale
+ sensRouge = 0
+ break
+ }
+ switch(document.getElementById("selectVert3D").value){
+ case "plus":
+ vert3D = 0
+ vert = 255
+ sensVert = -1
+ break
+ case "moins":
+ vert3D = 1
+ vert = 0
+ sensVert = 1
+ break
+ case "tout":
+ vert3D = 2
+ vert = couleurGenerale
+ sensVert = 0
+ break
+ }
+ switch(document.getElementById("selectBleu3D").value){
+ case "plus":
+ bleu3D = 0
+ bleu = 255
+ sensBleu = -1
+ break
+ case "moins":
+ bleu3D = 1
+ bleu = 0
+ sensBleu = 1
+ break
+ case "tout":
+ bleu3D = 2
+ bleu = couleurGenerale
+ sensBleu = 0
+ break
+ }
+ document.getElementById("apercuCouleur3D").innerHTML = "."
+ for(var i=0; i."
+ }
+}
+
+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
diff --git a/resources/library/applications/Grapheur.wgt/JavaScript/AffichageStandard.js b/resources/library/applications/Grapheur.wgt/JavaScript/AffichageStandard.js
new file mode 100644
index 00000000..b5ab2aad
--- /dev/null
+++ b/resources/library/applications/Grapheur.wgt/JavaScript/AffichageStandard.js
@@ -0,0 +1,432 @@
+// ------------------ 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'
+ }
+ graphique = ''
+ graphique = graphique + ''
+ image = ' '
+ 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; ihauteur)){
+ 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'
+ ctx = document.getElementById('canvas').getContext('2d')
+ var undefined = true
+ // Autres fonctions
+ for(var i=0; ihauteur)){
+ 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')
+ }
+
\ No newline at end of file
diff --git a/resources/library/applications/Grapheur.wgt/JavaScript/AffichageXPM.js b/resources/library/applications/Grapheur.wgt/JavaScript/AffichageXPM.js
new file mode 100644
index 00000000..6c1e8d1e
--- /dev/null
+++ b/resources/library/applications/Grapheur.wgt/JavaScript/AffichageXPM.js
@@ -0,0 +1,65 @@
+// -------------------- 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; xhauteur-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"
+ document.getElementById("affichage").innerHTML = image
+ }
\ No newline at end of file
diff --git a/resources/library/applications/Grapheur.wgt/JavaScript/ColorPicker.js b/resources/library/applications/Grapheur.wgt/JavaScript/ColorPicker.js
new file mode 100644
index 00000000..a90b82e6
--- /dev/null
+++ b/resources/library/applications/Grapheur.wgt/JavaScript/ColorPicker.js
@@ -0,0 +1,108 @@
+
+// -------------------- Color Picker --------------------
+
+var idColor = ""
+
+// 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 element = document.getElementById('colorT')
+ var posDiv = 0
+ while(element){
+ posDiv = posDiv + element.offsetTop
+ element = element.offsetParent
+ }
+ T = (e.clientY - posDiv -0) / 256*360
+ r,g,b = 0
+ while (true){
+ if (T<60){
+ r = 255
+ g = T/60*255
+ b = 0
+ break
+ }
+ if (T<=120){
+ r = (255-(T%60/60*255))%256
+ g = 255
+ b = 0
+ break
+ }
+ if (T<180){
+ r = 0
+ g = 255
+ b = T%60/60*255
+ break
+ }
+ if (T<=240){
+ r = 0
+ g = (255-(T%60/60*255))%256
+ b = 255
+ break
+ }
+ if (T<300){
+ r = T%60/60*255
+ g = 0
+ b = 255
+ break
+ }
+ if (T<360){
+ r = 255
+ g = 0
+ b = (255-(T%60/60*255))%256
+ break
+ }
+ r = 255
+ g = 0
+ b = 0
+ break
+ }
+ 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)
+}
diff --git a/resources/library/applications/Grapheur.wgt/JavaScript/Etude.js b/resources/library/applications/Grapheur.wgt/JavaScript/Etude.js
new file mode 100644
index 00000000..fea7d280
--- /dev/null
+++ b/resources/library/applications/Grapheur.wgt/JavaScript/Etude.js
@@ -0,0 +1,356 @@
+
+// -------------------- 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; i0){
+ 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; i0){
+ 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; i0){
+ 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; i0){
+ 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[i]+""
+ if(listeZeros[i]!=undefined){
+ x = listeZeros[i]
+ if(isFinite(eval(fct))){
+ texte += "
"+listeZeros[i]+"
"
+ }
+ else{
+ texte += "
"+listeZeros[i]+"
"
+ listeIndefini.push(listeZeros[i])
+ aSupprimer.push(i)
+ }
+ }
+ }
+ document.getElementById("etudeSigne").innerHTML = texte
+ for(var i=0; i" + sankoreLang[lang].curve_higher + ""
+ }
+ else if(limGauche[0]>limRound){
+ document.getElementById("etudeAHG").innerHTML = "y = "+limRound +" " + sankoreLang[lang].curve_lower + ""
+ }
+ 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]" + sankoreLang[lang].curve_lower + ""
+ }
+ else if(limDroite[0]>limRound){
+ document.getElementById("etudeAHD").innerHTML = "y = "+limRound +" " + sankoreLang[lang].curve_higher + ""
+ }
+ else{
+ document.getElementById("etudeAHD").innerHTML = "y = "+limRound
+ }
+ }
+ else{
+ document.getElementById("etudeAHD").innerHTML = sankoreLang[lang].na;
+ }
+ // Verticales
+ var texteAV = ""
+ for(var i=0; i"
+ }
+ document.getElementById("etudeAV").innerHTML = texteAV
+}
+
+function courbure(){
+ var texteMin = "";
+ var texteMax = "";
+ var texteI = "";
+ var nbrI = 0;
+ var i;
+ for(i=0; i0){
+ texteMin += " " + sankoreLang[lang].min + "("+Math.round(etudeX[i]*10000)/10000+";"+etudeY[i]+")";
+ }
+ else if(etudeD[i-1]>0 && etudeD[i+1]<0){
+ texteMax += " " + sankoreLang[lang].max + "("+Math.round(etudeX[i]*10000)/10000+";"+etudeY[i]+")";
+ }
+ else{
+ nbrI++;
+ texteI += ' I'+nbrI+"("+Math.round(etudeX[i]*10000)/10000+";"+etudeY[i]+")";
+ }
+ }
+ }
+ if(texteMin==""){
+ texteMin = " " + sankoreLang[lang].no_min;
+ }
+ if(texteMax==""){
+ texteMax = " " + sankoreLang[lang].no_max;
+ }
+ if(texteI==""){
+ texteI = " Aucun I";
+ }
+ document.getElementById("etudeMin").innerHTML = texteMin;
+ document.getElementById("etudeMax").innerHTML = texteMax;
+}
\ No newline at end of file
diff --git a/resources/library/applications/Grapheur.wgt/JavaScript/Interface.js b/resources/library/applications/Grapheur.wgt/JavaScript/Interface.js
new file mode 100644
index 00000000..34a1bef2
--- /dev/null
+++ b/resources/library/applications/Grapheur.wgt/JavaScript/Interface.js
@@ -0,0 +1,213 @@
+
+// -------------------- Fonctions de l'interface --------------------
+
+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()
+ }
+ else {
+ if (menuActuel !== ""){
+ cacherMenu()
+ }
+ menuActuel = id
+ document.getElementById(id).style.display = "block"
+ }
+}
+
+// Permet de cacher le menu actuellement affiché
+function cacherMenu(){
+ document.getElementById(menuActuel).style.display = "none"
+ menuActuel = ""
+}
+
+// ---- Minimiser ou Maximiser le widget (pour sankore) ----
+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
+ }
+}
+
+// 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(){
+ var theme = document.getElementById("selectTheme").value
+ switch(theme){
+ case "noir":
+ document.body.style.backgroundImage = "url(Images/fond2.png)"
+ document.getElementById("gauche").style.backgroundImage = "url(Images/gauche2.png)"
+ document.getElementById("onglet3D").style.backgroundImage = "url(Images/onglet1.png)"
+ document.getElementById("texteFonction").style.color = "white"
+ 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 "bleu":
+ document.body.style.backgroundImage = "url(Images/fond4.png)"
+ document.getElementById("gauche").style.backgroundImage = "url(Images/gauche3.png)"
+ document.getElementById("onglet3D").style.backgroundImage = "url(Images/onglet2.png)"
+ document.getElementById("texteFonction").style.color = "white"
+ 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
+ }
+}
+
+// Affiche un message d'erreur
+function error(err){
+ alert(" Error has occurred on the page ...\n\n Description: " + err.description + "\n\n Click 'OK' to continue.\n\n")
+}
+
+
+function agrandirAffichage(){
+ if (pleinEcran){
+ pleinEcran = false
+ if(fonction3D){
+ document.getElementById('gauche3D').style.display = "block"
+ 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"
+ }
+ 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{
+ pleinEcran = true
+ if(fonction3D){
+ document.getElementById('gauche3D').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()
+}
+
+// Redémarre le widget
+function reset(){
+ window.location.reload()
+}
+
+// Ferme le widget
+function close(){
+ window.close()
+}
+
+// Actions de mise à jour du widget
+function miseAjour(){
+ afficherMenu("mAj")
+ choixOutil("deplacement")
+ document.getElementById("thisVersion").innerHTML = ''
+ document.getElementById("newVersion").innerHTML = ''
+}
+
+function checkboxMaJ(){
+ if(document.location.href=='http://gyb.educanet2.ch/tm-widgets/yannick/GraphMe.wgt/Grapheur.xhtml'){
+ 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(){
+ if(document.location.href=='http://gyb.educanet2.ch/tm-widgets/yannick/GraphMe.wgt/Grapheur.xhtml'){
+ document.getElementById("cacheMaJ").style.display = "block"
+ document.getElementById("checkMaJ").checked = true
+ }
+ else{
+ if(document.getElementById("checkMaJ").checked){
+ afficherMenu('demandeMaJ')
+ }
+ }
+}
+
+// Afficher une page web à la place dans la zone d'affichage
+function navigateur(lien){
+ cacherMenu()
+ agrandirAffichage()
+ document.getElementById("affichage").innerHTML = ''
+}
\ No newline at end of file
diff --git a/resources/library/applications/Grapheur.wgt/JavaScript/Outils.js b/resources/library/applications/Grapheur.wgt/JavaScript/Outils.js
new file mode 100644
index 00000000..0915a333
--- /dev/null
+++ b/resources/library/applications/Grapheur.wgt/JavaScript/Outils.js
@@ -0,0 +1,308 @@
+
+// -------------------- 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"
+ function execute(fonction) {
+ if(check(fonction)){
+ x = document.getElementById("inputX").value
+ document.getElementById("outputX").innerHTML = " f(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'
+ texteFctSupp += ' .... '
+ }
+ document.getElementById("fonctionsSupp").innerHTML = texteFctSupp
+ actualiserGraph()
+}
+
+function actualiserHistorique(){
+ var texteHistorique = ""
+ for(var i=0; i'+historique[i]+' '
+ }
+ 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'){
+ document.getElementById("point").style.display = "block"
+ }
+ else{
+ document.getElementById("point").style.display = "none"
+ }
+
+ if(outil == 'tangente'){
+ document.getElementById("tangente").innerHTML = ''
+ ctxT = document.getElementById('canvasT').getContext('2d')
+ }
+ else{
+ document.getElementById("tangente").innerHTML = ""
+ ctxT = null
+ }
+}
+
+// Fonctions servant à gérer les événements de la souris
+function sourisDown(){
+ mouseDown = true
+ posSourisXinit = posSourisX
+ posSourisYinit = posSourisY
+}
+function sourisUp(){
+ mouseDown = false
+}
+function sourisMove(event){
+ posSourisX = event.clientX
+ posSourisY = event.clientY
+ if(mouseDown){
+ if(outil == "deplacement"){
+ var valeurX = (posSourisX-posSourisXinit)/multiplicateurX
+ var valeurY = (posSourisYinit-posSourisY)/multiplicateurY
+ if(Math.round(Math.abs(valeurX)) > 0){
+ deplacerX(-Math.round(2*valeurX)/2)
+ posSourisXinit = posSourisX
+ }
+ if(Math.round(Math.abs(valeurY)) > 0){
+ deplacerY(-Math.round(2*valeurY)/2)
+ posSourisYinit = posSourisY
+ }
+ //decalageX = posSourisX-posSourisXinit
+ //decalageY = posSourisY-posSourisYinit
+ //actualiserGraph()
+ }
+ }
+ if(outil == "point"){
+ var position = Math.round((posSourisX-132)*(borneXDroite-borneXGauche)/(precision*500))
+ var positionX = pointX[position]
+ var positionY = pointY[position]
+ if(!isNaN(positionX) && !isNaN(positionY)){
+ document.getElementById("info").innerHTML = "("+Math.round((positionX/multiplicateurX+borneXGauche)*100)/100+";"+Math.round(-(positionY/multiplicateurY-borneYDroite)*100)/100+")"
+ document.getElementById("point").style.left = (positionX+130-4)+"px"
+ document.getElementById("point").style.top = (positionY+53-10)+"px"
+ }
+ }
+ if(outil == "tangente"){
+ 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()
+ }
+ }
+ //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
+function keyPress(event){
+ switch(event.keyCode){
+ case 27:
+ reset()
+ break
+ case 37:
+ if(event.ctrlKey){
+ deplacerX(-1)
+ }
+ break
+ case 38:
+ if(event.ctrlKey){
+ deplacerY(1)
+ }
+ break
+ case 39:
+ if(event.ctrlKey){
+ deplacerX(1)
+ }
+ break
+ case 40:
+ if(event.ctrlKey){
+ deplacerY(-1)
+ }
+ break
+ default:
+ //alert(event.keyCode+" ; "+event.ctrlKey)
+ }
+}
+
+
+// ---- Fonctions de test ----
+function testSVG(){
+ document.getElementById("affichage").innerHTML = ' '
+}
+function testCanvas(){
+ document.getElementById("affichage").innerHTML = ''
+ 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 = ''
+}
+
+
+// ---- Aire sous la fonction (intégrale) ----
+function AireSousFct(fct, a, b, n){
+ var aire, largeurRect, gaucheRect, droiteRect, millieuRect, hauteurRect, aireRect;
+ var f = function(x){
+ return eval(fct);
+ };
+ aire = 0;
+ largeurRect = (b-a)/n;
+ for(var i=0; i)[^>]*$|^#([\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=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;G1||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-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("",""]||!O.indexOf("",""]||O.match(/^<(thead|tbody|tfoot|colg|cap)/)&&[1,"