Commit 7025a284 authored by Igor.Zotov's avatar Igor.Zotov Committed by Alexander.Trofimov

рефакторинг + закомментировал функции, которые не используются в данный момент.

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@51148 954022d7-b5bf-4e40-9824-e11837661b57
parent 6564f66e
...@@ -11,15 +11,12 @@ ...@@ -11,15 +11,12 @@
/** /**
* This installs some event handlers * This installs some event handlers
*/ */
if (obj._otherProps._annotatable) { /*if (obj._otherProps._annotatable) {
var canvas = obj.canvas; var canvas = obj.canvas;
var context = obj.context; var context = obj.context;
/** //Capture the mouse events so we can set whther the mouse is down or not var canvas_onmousedown = function (e)
* Capture the mouse events so we can set whther the mouse is down or not
*/
var canvas_onmousedown = function (e)
{ {
if (e.button == 0) { if (e.button == 0) {
...@@ -50,10 +47,7 @@ ...@@ -50,10 +47,7 @@
OfficeExcel.Registry.Set('started.annotating', false); OfficeExcel.Registry.Set('started.annotating', false);
OfficeExcel.Registry.Set('chart.annotating', obj); OfficeExcel.Registry.Set('chart.annotating', obj);
/** // Fire the onannotatebegin event. It also fires an event called ononnotatestart for BC purposes OfficeExcel.FireCustomEvent(obj, 'onannotatestart');
* Fire the onannotatebegin event. It also fires an event called ononnotatestart for BC purposes
*/
OfficeExcel.FireCustomEvent(obj, 'onannotatestart');
OfficeExcel.FireCustomEvent(obj, 'onannotatebegin'); OfficeExcel.FireCustomEvent(obj, 'onannotatebegin');
} }
...@@ -62,9 +56,6 @@ ...@@ -62,9 +56,6 @@
canvas.addEventListener('mousedown', canvas_onmousedown, false); canvas.addEventListener('mousedown', canvas_onmousedown, false);
OfficeExcel.AddEventListener(canvas.id, 'mousedown', canvas_onmousedown); OfficeExcel.AddEventListener(canvas.id, 'mousedown', canvas_onmousedown);
/**
* This cancels annotating for ALL canvases
*/
var window_onmouseup = function (e) var window_onmouseup = function (e)
{ {
var obj = OfficeExcel.Registry.Get('chart.annotating'); var obj = OfficeExcel.Registry.Get('chart.annotating');
...@@ -94,18 +85,11 @@ ...@@ -94,18 +85,11 @@
// Clear the recorded annotations // Clear the recorded annotations
OfficeExcel.Registry.Set('annotate.actions', []); OfficeExcel.Registry.Set('annotate.actions', []);
/**
* Fire the annotate event
*/
OfficeExcel.FireCustomEvent(obj, 'onannotateend'); OfficeExcel.FireCustomEvent(obj, 'onannotateend');
} }
window.addEventListener('mouseup', window_onmouseup, false); window.addEventListener('mouseup', window_onmouseup, false);
OfficeExcel.AddEventListener(canvas.id, 'window_mouseup', window_onmouseup); OfficeExcel.AddEventListener(canvas.id, 'window_mouseup', window_onmouseup);
/**
* Canvas onmouseup event
*/
var canvas_onmouseup = function (e) var canvas_onmouseup = function (e)
{ {
var obj = e.target.__object__; var obj = e.target.__object__;
...@@ -115,9 +99,6 @@ ...@@ -115,9 +99,6 @@
canvas.addEventListener('mouseup', canvas_onmouseup, false); canvas.addEventListener('mouseup', canvas_onmouseup, false);
OfficeExcel.AddEventListener(canvas.id, 'mouseup', canvas_onmouseup); OfficeExcel.AddEventListener(canvas.id, 'mouseup', canvas_onmouseup);
/**
* The canvas onmousemove function
*/
var canvas_onmousemove = function (e) var canvas_onmousemove = function (e)
{ {
var e = OfficeExcel.FixEventObject(e); var e = OfficeExcel.FixEventObject(e);
...@@ -142,9 +123,6 @@ ...@@ -142,9 +123,6 @@
// Special case for HBars and Gantts with their extra wide left gutter // Special case for HBars and Gantts with their extra wide left gutter
if ( (obj.type != 'hbar' && obj.type != 'gantt') || x > obj._chartGutter._left) { if ( (obj.type != 'hbar' && obj.type != 'gantt') || x > obj._chartGutter._left) {
/**
* This is here to stop annotating in the gutter
*/
if (OfficeExcel.Registry.Get('started.annotating') == false) { if (OfficeExcel.Registry.Get('started.annotating') == false) {
context.moveTo(x, y); context.moveTo(x, y);
OfficeExcel.Registry.Set('started.annotating', true) OfficeExcel.Registry.Set('started.annotating', true)
...@@ -156,9 +134,7 @@ ...@@ -156,9 +134,7 @@
context.stroke(); context.stroke();
/**
* Fire the annotate event
*/
OfficeExcel.FireCustomEvent(obj, 'onannotate'); OfficeExcel.FireCustomEvent(obj, 'onannotate');
} }
} }
...@@ -171,7 +147,7 @@ ...@@ -171,7 +147,7 @@
OfficeExcel.AddEventListener(canvas.id, 'mousemove', canvas_onmousemove); OfficeExcel.AddEventListener(canvas.id, 'mousemove', canvas_onmousemove);
OfficeExcel.ReplayAnnotations(obj); OfficeExcel.ReplayAnnotations(obj);
} }*/
} }
...@@ -182,7 +158,7 @@ ...@@ -182,7 +158,7 @@
*/ */
OfficeExcel.Showpalette = function (e) OfficeExcel.Showpalette = function (e)
{ {
var isSafari = navigator.userAgent.indexOf('Safari') ? true : false; /*var isSafari = navigator.userAgent.indexOf('Safari') ? true : false;
e = OfficeExcel.FixEventObject(e); e = OfficeExcel.FixEventObject(e);
...@@ -228,17 +204,11 @@ ...@@ -228,17 +204,11 @@
div.innerHTML = str; div.innerHTML = str;
document.body.appendChild(div); document.body.appendChild(div);
/**
* Now the div has been added to the document, move it up and left and set the width and height
*/
div.style.width = (div.offsetWidth) + 'px'; div.style.width = (div.offsetWidth) + 'px';
div.style.height = (div.offsetHeight - (OfficeExcel.isIE9up() ? 5 : 5)) + 'px'; div.style.height = (div.offsetHeight - (OfficeExcel.isIE9up() ? 5 : 5)) + 'px';
div.style.left = Math.max(0, e.pageX - div.offsetWidth - 2) + 'px'; div.style.left = Math.max(0, e.pageX - div.offsetWidth - 2) + 'px';
div.style.top = (e.pageY - div.offsetHeight - 2) + 'px'; div.style.top = (e.pageY - div.offsetHeight - 2) + 'px';
/**
* Store the palette div in the registry
*/
OfficeExcel.Registry.Set('palette', div); OfficeExcel.Registry.Set('palette', div);
setTimeout("OfficeExcel.Registry.Get('palette').style.opacity = 0.2", 50); setTimeout("OfficeExcel.Registry.Get('palette').style.opacity = 0.2", 50);
...@@ -256,20 +226,20 @@ ...@@ -256,20 +226,20 @@
// Should this be here? Yes. This function is being used as an event handler. // Should this be here? Yes. This function is being used as an event handler.
e.stopPropagation(); e.stopPropagation();
return false; return false;*/
} }
// Clears any annotation data from global storage // Clears any annotation data from global storage
OfficeExcel.ClearAnnotations = function (id) OfficeExcel.ClearAnnotations = function (id)
{ {
var canvas = document.getElementById(id); /*var canvas = document.getElementById(id);
var obj = canvas.__object__; var obj = canvas.__object__;
if (window.localStorage && window.localStorage['__OfficeExcel_annotations_' + id + '__'] && window.localStorage['__OfficeExcel_annotations_' + id + '__'].length) { if (window.localStorage && window.localStorage['__OfficeExcel_annotations_' + id + '__'] && window.localStorage['__OfficeExcel_annotations_' + id + '__'].length) {
window.localStorage['__OfficeExcel_annotations_' + id + '__'] = []; window.localStorage['__OfficeExcel_annotations_' + id + '__'] = [];
OfficeExcel.FireCustomEvent(obj, 'onannotateclear'); OfficeExcel.FireCustomEvent(obj, 'onannotateclear');
} }*/
} }
...@@ -281,7 +251,7 @@ ...@@ -281,7 +251,7 @@
OfficeExcel.ReplayAnnotations = function (obj) OfficeExcel.ReplayAnnotations = function (obj)
{ {
// Check for support // Check for support
if (!window.localStorage) { /* if (!window.localStorage) {
return; return;
} }
...@@ -317,5 +287,5 @@ ...@@ -317,5 +287,5 @@
} }
} }
context.stroke(); context.stroke();*/
} }
\ No newline at end of file
...@@ -3094,13 +3094,12 @@ if (typeof(obj._otherProps._scale_formatter) == 'function') { ...@@ -3094,13 +3094,12 @@ if (typeof(obj._otherProps._scale_formatter) == 'function') {
* *
* @param object obj The graph object (from which we can get the context and canvas as required) * @param object obj The graph object (from which we can get the context and canvas as required)
*/ */
OfficeExcel.DrawCrosshairs = function (obj) OfficeExcel.DrawCrosshairs = function (obj)//показывает позицию на графике
{ {
if (obj._otherProps._crosshairs) { /*if (obj._otherProps._crosshairs) {
var canvas = obj.canvas; var canvas = obj.canvas;
var context = obj.context; var context = obj.context;
//canvas.onmousemove = function (e)
var crosshairs_mousemove = function (e) var crosshairs_mousemove = function (e)
{ {
var e = OfficeExcel.FixEventObject(e); var e = OfficeExcel.FixEventObject(e);
...@@ -3154,10 +3153,7 @@ if (typeof(obj._otherProps._scale_formatter) == 'function') { ...@@ -3154,10 +3153,7 @@ if (typeof(obj._otherProps._scale_formatter) == 'function') {
context.stroke(); context.stroke();
/** //Need to show the coords? if (obj._otherProps._crosshairs_coords) {
* Need to show the coords?
*/
if (obj._otherProps._crosshairs_coords) {
if (obj.type == 'scatter') { if (obj.type == 'scatter') {
var xCoord = (((x - obj._chartGutter._left) / (obj.canvas.width - gutterLeft - gutterRight)) * (obj._otherProps._xmax - obj._otherProps._xmin)) + obj._otherProps._xmin; var xCoord = (((x - obj._chartGutter._left) / (obj.canvas.width - gutterLeft - gutterRight)) * (obj._otherProps._xmax - obj._otherProps._xmin)) + obj._otherProps._xmin;
...@@ -3218,10 +3214,7 @@ if (typeof(obj._otherProps._scale_formatter) == 'function') { ...@@ -3218,10 +3214,7 @@ if (typeof(obj._otherProps._scale_formatter) == 'function') {
} }
} }
/** //Fire the oncrosshairs custom event OfficeExcel.FireCustomEvent(obj, 'oncrosshairs');
* Fire the oncrosshairs custom event
*/
OfficeExcel.FireCustomEvent(obj, 'oncrosshairs');
} else { } else {
OfficeExcel.HideCrosshairCoords(); OfficeExcel.HideCrosshairCoords();
...@@ -3229,7 +3222,7 @@ if (typeof(obj._otherProps._scale_formatter) == 'function') { ...@@ -3229,7 +3222,7 @@ if (typeof(obj._otherProps._scale_formatter) == 'function') {
} }
canvas.addEventListener('mousemove', crosshairs_mousemove, false); canvas.addEventListener('mousemove', crosshairs_mousemove, false);
OfficeExcel.AddEventListener(obj.id, 'mousemove', crosshairs_mousemove); OfficeExcel.AddEventListener(obj.id, 'mousemove', crosshairs_mousemove);
} }*/
} }
/** /**
...@@ -3237,7 +3230,7 @@ if (typeof(obj._otherProps._scale_formatter) == 'function') { ...@@ -3237,7 +3230,7 @@ if (typeof(obj._otherProps._scale_formatter) == 'function') {
*/ */
OfficeExcel.HideCrosshairCoords = function () OfficeExcel.HideCrosshairCoords = function ()
{ {
var div = OfficeExcel.Registry.Get('chart.coordinates.coords.div'); /*var div = OfficeExcel.Registry.Get('chart.coordinates.coords.div');
if ( div if ( div
&& div.style.opacity == 1 && div.style.opacity == 1
...@@ -3254,7 +3247,7 @@ if (typeof(obj._otherProps._scale_formatter) == 'function') { ...@@ -3254,7 +3247,7 @@ if (typeof(obj._otherProps._scale_formatter) == 'function') {
setTimeout(function() {OfficeExcel.Registry.Get('chart.coordinates.coords.div').style.opacity = 0.1;}, 450); setTimeout(function() {OfficeExcel.Registry.Get('chart.coordinates.coords.div').style.opacity = 0.1;}, 450);
setTimeout(function() {OfficeExcel.Registry.Get('chart.coordinates.coords.div').style.opacity = 0;}, 500); setTimeout(function() {OfficeExcel.Registry.Get('chart.coordinates.coords.div').style.opacity = 0;}, 500);
setTimeout(function() {OfficeExcel.Registry.Get('chart.coordinates.coords.div').style.display = 'none';}, 550); setTimeout(function() {OfficeExcel.Registry.Get('chart.coordinates.coords.div').style.display = 'none';}, 550);
} }*/
} }
...@@ -3399,7 +3392,7 @@ if (typeof(obj._otherProps._scale_formatter) == 'function') { ...@@ -3399,7 +3392,7 @@ if (typeof(obj._otherProps._scale_formatter) == 'function') {
*/ */
OfficeExcel.Async = function (func) OfficeExcel.Async = function (func)
{ {
return setTimeout(func, arguments[1] ? arguments[1] : 1); //return setTimeout(func, arguments[1] ? arguments[1] : 1);
} }
...@@ -3591,7 +3584,7 @@ if (typeof(obj._otherProps._scale_formatter) == 'function') { ...@@ -3591,7 +3584,7 @@ if (typeof(obj._otherProps._scale_formatter) == 'function') {
*/ */
OfficeExcel.HideZoomedCanvas = function () OfficeExcel.HideZoomedCanvas = function ()
{ {
var interval = 15; /*var interval = 15;
var frames = 10; var frames = 10;
if (typeof(__zoomedimage__) == 'object') { if (typeof(__zoomedimage__) == 'object') {
...@@ -3618,7 +3611,7 @@ if (typeof(obj._otherProps._scale_formatter) == 'function') { ...@@ -3618,7 +3611,7 @@ if (typeof(obj._otherProps._scale_formatter) == 'function') {
if (typeof(__zoomedbackground__) == 'object') { if (typeof(__zoomedbackground__) == 'object') {
setTimeout("__zoomedbackground__.style.display = 'none'", obj._zoom._fade_out ? (frames * interval) + 10 : 0); setTimeout("__zoomedbackground__.style.display = 'none'", obj._zoom._fade_out ? (frames * interval) + 10 : 0);
} }*/
} }
......
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
*/ */
OfficeExcel.Effects.Fade.In = function (obj) OfficeExcel.Effects.Fade.In = function (obj)
{ {
var canvas = obj.canvas; /*var canvas = obj.canvas;
// Initially the opacity should be zero // Initially the opacity should be zero
canvas.style.opacity = 0; canvas.style.opacity = 0;
...@@ -36,12 +36,10 @@ ...@@ -36,12 +36,10 @@
setTimeout('document.getElementById("' + canvas.id + '").style.opacity = ' + (i * 0.1), i * 50); setTimeout('document.getElementById("' + canvas.id + '").style.opacity = ' + (i * 0.1), i * 50);
} }
/** // Callback
* Callback
*/
if (typeof(arguments[2]) == 'function') { if (typeof(arguments[2]) == 'function') {
setTimeout(arguments[2], 500); setTimeout(arguments[2], 500);
} }*/
} }
...@@ -54,7 +52,7 @@ ...@@ -54,7 +52,7 @@
*/ */
OfficeExcel.Effects.Fade.Out = function (obj) OfficeExcel.Effects.Fade.Out = function (obj)
{ {
var canvas = obj.canvas; /*var canvas = obj.canvas;
// Draw the chart // Draw the chart
OfficeExcel.Clear(obj.canvas); OfficeExcel.Clear(obj.canvas);
...@@ -65,12 +63,10 @@ ...@@ -65,12 +63,10 @@
setTimeout('document.getElementById("' + canvas.id + '").style.opacity = ' + (i * 0.1), (10 - i) * 50); setTimeout('document.getElementById("' + canvas.id + '").style.opacity = ' + (i * 0.1), (10 - i) * 50);
} }
/** // Callback
* Callback
*/
if (typeof(arguments[2]) == 'function') { if (typeof(arguments[2]) == 'function') {
setTimeout(arguments[2], 500); setTimeout(arguments[2], 500);
} }*/
} }
...@@ -85,7 +81,7 @@ ...@@ -85,7 +81,7 @@
OfficeExcel.Effects.jQuery.Expand = function (obj) OfficeExcel.Effects.jQuery.Expand = function (obj)
{ {
// Check for jQuery // Check for jQuery
if (typeof(jQuery) == 'undefined') { /*if (typeof(jQuery) == 'undefined') {
alert('[ERROR] Could not find jQuery object - have you included the jQuery file?'); alert('[ERROR] Could not find jQuery object - have you included the jQuery file?');
} }
...@@ -120,12 +116,10 @@ ...@@ -120,12 +116,10 @@
top: '-=' + (obj.canvas.height / 2) + 'px' top: '-=' + (obj.canvas.height / 2) + 'px'
}, 1000); }, 1000);
/** // Callback
* Callback
*/
if (typeof(arguments[2]) == 'function') { if (typeof(arguments[2]) == 'function') {
setTimeout(arguments[2], 1000); setTimeout(arguments[2], 1000);
} }*/
} }
...@@ -137,7 +131,7 @@ ...@@ -137,7 +131,7 @@
*/ */
OfficeExcel.Effects.ReplaceCanvasWithDIV = function (canvas) OfficeExcel.Effects.ReplaceCanvasWithDIV = function (canvas)
{ {
if (!canvas.replacementDIV) { /*if (!canvas.replacementDIV) {
// Create the place holder DIV // Create the place holder DIV
var div = document.createElement('DIV'); var div = document.createElement('DIV');
div.style.width = canvas.width + 'px'; div.style.width = canvas.width + 'px';
...@@ -170,7 +164,7 @@ ...@@ -170,7 +164,7 @@
var div = canvas.replacementDIV; var div = canvas.replacementDIV;
} }
return div; return div;*/
} }
...@@ -183,7 +177,7 @@ ...@@ -183,7 +177,7 @@
*/ */
OfficeExcel.Effects.jQuery.Snap = function (obj) OfficeExcel.Effects.jQuery.Snap = function (obj)
{ {
var delay = 500; /*var delay = 500;
var div = OfficeExcel.Effects.ReplaceCanvasWithDIV(obj.canvas); var div = OfficeExcel.Effects.ReplaceCanvasWithDIV(obj.canvas);
...@@ -210,12 +204,10 @@ ...@@ -210,12 +204,10 @@
top: targetTop + 'px' top: targetTop + 'px'
}, delay); }, delay);
/** //Callback
* Callback
*/
if (typeof(arguments[2]) == 'function') { if (typeof(arguments[2]) == 'function') {
setTimeout(arguments[2], delay + 50); setTimeout(arguments[2], delay + 50);
} }*/
} }
...@@ -229,15 +221,12 @@ ...@@ -229,15 +221,12 @@
*/ */
OfficeExcel.Effects.jQuery.Reveal = function (obj) OfficeExcel.Effects.jQuery.Reveal = function (obj)
{ {
var opts = arguments[1] ? arguments[1] : null; /*var opts = arguments[1] ? arguments[1] : null;
var delay = 1000; var delay = 1000;
var canvas = obj.canvas; var canvas = obj.canvas;
var xy = OfficeExcel.getCanvasXY(obj.canvas); var xy = OfficeExcel.getCanvasXY(obj.canvas);
/**
* Hide the canvas and draw it
*/
obj.canvas.style.visibility = 'hidden'; obj.canvas.style.visibility = 'hidden';
OfficeExcel.Clear(obj.canvas); OfficeExcel.Clear(obj.canvas);
obj.Draw(); obj.Draw();
...@@ -262,9 +251,6 @@ ...@@ -262,9 +251,6 @@
document.body.appendChild(div); document.body.appendChild(div);
} }
/**
* Now the covering DIVs are in place show the canvas again
*/
obj.canvas.style.visibility = 'visible'; obj.canvas.style.visibility = 'visible';
...@@ -284,12 +270,9 @@ ...@@ -284,12 +270,9 @@
} }
, delay); , delay);
/**
* Callback
*/
if (typeof(arguments[2]) == 'function') { if (typeof(arguments[2]) == 'function') {
setTimeout(arguments[2], delay); setTimeout(arguments[2], delay);
} }*/
} }
...@@ -303,7 +286,7 @@ ...@@ -303,7 +286,7 @@
*/ */
OfficeExcel.Effects.jQuery.Conceal = function (obj) OfficeExcel.Effects.jQuery.Conceal = function (obj)
{ {
var opts = arguments[1] ? arguments[1] : null; /*var opts = arguments[1] ? arguments[1] : null;
var delay = 1000; var delay = 1000;
var canvas = obj.canvas; var canvas = obj.canvas;
var xy = OfficeExcel.getCanvasXY(obj.canvas); var xy = OfficeExcel.getCanvasXY(obj.canvas);
...@@ -347,12 +330,11 @@ ...@@ -347,12 +330,11 @@
setTimeout(function () {OfficeExcel.Clear(obj.canvas);}, delay); setTimeout(function () {OfficeExcel.Clear(obj.canvas);}, delay);
/**
* Callback //Callback
*/
if (typeof(arguments[2]) == 'function') { if (typeof(arguments[2]) == 'function') {
setTimeout(arguments[2], delay); setTimeout(arguments[2], delay);
} }*/
} }
...@@ -363,16 +345,13 @@ ...@@ -363,16 +345,13 @@
*/ */
OfficeExcel.Effects.jQuery.HBlinds.Open = function (obj) OfficeExcel.Effects.jQuery.HBlinds.Open = function (obj)
{ {
var canvas = obj.canvas; /*var canvas = obj.canvas;
var opts = arguments[1] ? arguments[1] : []; var opts = arguments[1] ? arguments[1] : [];
var delay = 1000; var delay = 1000;
var color = opts['color'] ? opts['color'] : 'white'; var color = opts['color'] ? opts['color'] : 'white';
var xy = OfficeExcel.getCanvasXY(canvas); var xy = OfficeExcel.getCanvasXY(canvas);
var height = canvas.height / 5; var height = canvas.height / 5;
/**
* First draw the chart
*/
OfficeExcel.Clear(obj.canvas); OfficeExcel.Clear(obj.canvas);
obj.Draw(); obj.Draw();
...@@ -396,12 +375,10 @@ ...@@ -396,12 +375,10 @@
setTimeout(function () {document.body.removeChild(document.getElementById('blinds_3'));}, delay); setTimeout(function () {document.body.removeChild(document.getElementById('blinds_3'));}, delay);
setTimeout(function () {document.body.removeChild(document.getElementById('blinds_4'));}, delay); setTimeout(function () {document.body.removeChild(document.getElementById('blinds_4'));}, delay);
/** //Callback
* Callback
*/
if (typeof(arguments[2]) == 'function') { if (typeof(arguments[2]) == 'function') {
setTimeout(arguments[2], delay); setTimeout(arguments[2], delay);
} }*/
} }
...@@ -412,7 +389,7 @@ ...@@ -412,7 +389,7 @@
*/ */
OfficeExcel.Effects.jQuery.HBlinds.Close = function (obj) OfficeExcel.Effects.jQuery.HBlinds.Close = function (obj)
{ {
var canvas = obj.canvas; /*var canvas = obj.canvas;
var opts = arguments[1] ? arguments[1] : []; var opts = arguments[1] ? arguments[1] : [];
var delay = 1000; var delay = 1000;
var color = opts['color'] ? opts['color'] : 'white'; var color = opts['color'] ? opts['color'] : 'white';
...@@ -440,12 +417,10 @@ ...@@ -440,12 +417,10 @@
setTimeout(function () {document.body.removeChild(document.getElementById('blinds_3'));}, delay + 100); setTimeout(function () {document.body.removeChild(document.getElementById('blinds_3'));}, delay + 100);
setTimeout(function () {document.body.removeChild(document.getElementById('blinds_4'));}, delay + 100); setTimeout(function () {document.body.removeChild(document.getElementById('blinds_4'));}, delay + 100);
/** //Callback
* Callback
*/
if (typeof(arguments[2]) == 'function') { if (typeof(arguments[2]) == 'function') {
setTimeout(arguments[2], delay); setTimeout(arguments[2], delay);
} }*/
} }
...@@ -456,16 +431,13 @@ ...@@ -456,16 +431,13 @@
*/ */
OfficeExcel.Effects.jQuery.VBlinds.Open = function (obj) OfficeExcel.Effects.jQuery.VBlinds.Open = function (obj)
{ {
var canvas = obj.canvas; /*var canvas = obj.canvas;
var opts = arguments[1] ? arguments[1] : []; var opts = arguments[1] ? arguments[1] : [];
var delay = 1000; var delay = 1000;
var color = opts['color'] ? opts['color'] : 'white'; var color = opts['color'] ? opts['color'] : 'white';
var xy = OfficeExcel.getCanvasXY(canvas); var xy = OfficeExcel.getCanvasXY(canvas);
var width = canvas.width / 10; var width = canvas.width / 10;
/**
* First draw the chart
*/
OfficeExcel.Clear(obj.canvas); OfficeExcel.Clear(obj.canvas);
obj.Draw(); obj.Draw();
...@@ -494,12 +466,10 @@ ...@@ -494,12 +466,10 @@
setTimeout(function () {document.body.removeChild(document.getElementById('blinds_8'));}, delay + 100); setTimeout(function () {document.body.removeChild(document.getElementById('blinds_8'));}, delay + 100);
setTimeout(function () {document.body.removeChild(document.getElementById('blinds_9'));}, delay + 100); setTimeout(function () {document.body.removeChild(document.getElementById('blinds_9'));}, delay + 100);
/** //Callback
* Callback
*/
if (typeof(arguments[2]) == 'function') { if (typeof(arguments[2]) == 'function') {
setTimeout(arguments[2], delay); setTimeout(arguments[2], delay);
} }*/
} }
...@@ -510,7 +480,7 @@ ...@@ -510,7 +480,7 @@
*/ */
OfficeExcel.Effects.jQuery.VBlinds.Close = function (obj) OfficeExcel.Effects.jQuery.VBlinds.Close = function (obj)
{ {
var canvas = obj.canvas; /*var canvas = obj.canvas;
var opts = arguments[1] ? arguments[1] : []; var opts = arguments[1] ? arguments[1] : [];
var delay = 1000; var delay = 1000;
var color = opts['color'] ? opts['color'] : 'white'; var color = opts['color'] ? opts['color'] : 'white';
...@@ -548,12 +518,10 @@ ...@@ -548,12 +518,10 @@
setTimeout(function () {document.body.removeChild(document.getElementById('blinds_9'));}, delay + 100); setTimeout(function () {document.body.removeChild(document.getElementById('blinds_9'));}, delay + 100);
} }
/** //Callback
* Callback
*/
if (typeof(arguments[2]) == 'function') { if (typeof(arguments[2]) == 'function') {
setTimeout(arguments[2], delay); setTimeout(arguments[2], delay);
} }*/
} }
...@@ -566,7 +534,7 @@ ...@@ -566,7 +534,7 @@
*/ */
OfficeExcel.Effects.Pie.Grow = function (obj) OfficeExcel.Effects.Pie.Grow = function (obj)
{ {
var canvas = obj.canvas; /*var canvas = obj.canvas;
var opts = arguments[1] ? arguments[1] : []; var opts = arguments[1] ? arguments[1] : [];
var color = opts['color'] ? opts['color'] : 'white'; var color = opts['color'] ? opts['color'] : 'white';
var xy = OfficeExcel.getCanvasXY(canvas); var xy = OfficeExcel.getCanvasXY(canvas);
...@@ -579,7 +547,7 @@ ...@@ -579,7 +547,7 @@
obj._otherProps._radius = 0; obj._otherProps._radius = 0;
OfficeExcel.Effects.Animate(obj, {'chart.radius': radius}, arguments[2]); // ToDo chart.radius -> _otherProps._radius?? OfficeExcel.Effects.Animate(obj, {'chart.radius': radius}, arguments[2]); // ToDo chart.radius -> _otherProps._radius??*/
} }
...@@ -593,7 +561,7 @@ ...@@ -593,7 +561,7 @@
OfficeExcel.Effects.Bar.Grow = function (obj) OfficeExcel.Effects.Bar.Grow = function (obj)
{ {
// Save the data // Save the data
obj.original_data = OfficeExcel.array_clone(obj.data); /*obj.original_data = OfficeExcel.array_clone(obj.data);
// Zero the data // Zero the data
obj.__animation_frame__ = 0; obj.__animation_frame__ = 0;
...@@ -637,9 +605,8 @@ ...@@ -637,9 +605,8 @@
} }
} }
/**
* Increment the hmargin to the target //Increment the hmargin to the target
*/
obj._otherProps._hmargin = ((1 - (obj.__animation_frame__ / numFrames)) * (obj.__hmargin__ - obj.__original_hmargin__)) + obj.__original_hmargin__; obj._otherProps._hmargin = ((1 - (obj.__animation_frame__ / numFrames)) * (obj.__hmargin__ - obj.__original_hmargin__)) + obj.__original_hmargin__;
...@@ -657,7 +624,7 @@ ...@@ -657,7 +624,7 @@
} }
} }
OfficeExcel.Effects.UpdateCanvas(Grow); OfficeExcel.Effects.UpdateCanvas(Grow);*/
} }
...@@ -700,7 +667,7 @@ ...@@ -700,7 +667,7 @@
*/ */
OfficeExcel.Effects.Fuel.Grow = function (obj) OfficeExcel.Effects.Fuel.Grow = function (obj)
{ {
var totalFrames = 30; /*var totalFrames = 30;
var currentFrame = 0; var currentFrame = 0;
var diff = obj.value - obj.currentValue; var diff = obj.value - obj.currentValue;
var increment = diff / totalFrames; var increment = diff / totalFrames;
...@@ -721,7 +688,7 @@ ...@@ -721,7 +688,7 @@
} }
} }
OfficeExcel.Effects.UpdateCanvas(Grow); OfficeExcel.Effects.UpdateCanvas(Grow);*/
} }
...@@ -736,7 +703,7 @@ ...@@ -736,7 +703,7 @@
*/ */
OfficeExcel.Effects.Animate = function (obj, map) OfficeExcel.Effects.Animate = function (obj, map)
{ {
obj.Draw(); /*obj.Draw();
OfficeExcel.Effects.__total_frames__ = (map && map['frames']) ? map['frames'] : 30; OfficeExcel.Effects.__total_frames__ = (map && map['frames']) ? map['frames'] : 30;
...@@ -801,7 +768,7 @@ ...@@ -801,7 +768,7 @@
} }
} }
Animate_Iterator(arguments[2]); Animate_Iterator(arguments[2]);*/
} }
...@@ -814,7 +781,7 @@ ...@@ -814,7 +781,7 @@
*/ */
OfficeExcel.Effects.jQuery.Slide.In = function (obj) OfficeExcel.Effects.jQuery.Slide.In = function (obj)
{ {
OfficeExcel.Clear(obj.canvas); /*OfficeExcel.Clear(obj.canvas);
obj.Draw(); obj.Draw();
var canvas = obj.canvas; var canvas = obj.canvas;
...@@ -841,12 +808,10 @@ ...@@ -841,12 +808,10 @@
$('#' + obj.id).animate({left:0,top:0}, delay); $('#' + obj.id).animate({left:0,top:0}, delay);
/** //Callback
* Callback
*/
if (typeof(arguments[2]) == 'function') { if (typeof(arguments[2]) == 'function') {
setTimeout(arguments[2], delay); setTimeout(arguments[2], delay);
} }*/
} }
...@@ -859,7 +824,7 @@ ...@@ -859,7 +824,7 @@
*/ */
OfficeExcel.Effects.jQuery.Slide.Out = function (obj) OfficeExcel.Effects.jQuery.Slide.Out = function (obj)
{ {
var canvas = obj.canvas; /*var canvas = obj.canvas;
var div = OfficeExcel.Effects.ReplaceCanvasWithDIV(obj.canvas); var div = OfficeExcel.Effects.ReplaceCanvasWithDIV(obj.canvas);
var delay = 1000; var delay = 1000;
div.style.overflow= 'hidden'; div.style.overflow= 'hidden';
...@@ -879,12 +844,10 @@ ...@@ -879,12 +844,10 @@
$('#' + obj.id).animate({left: (0 + canvas.width) + 'px'}, delay); $('#' + obj.id).animate({left: (0 + canvas.width) + 'px'}, delay);
} }
/** //Callback
* Callback
*/
if (typeof(arguments[2]) == 'function') { if (typeof(arguments[2]) == 'function') {
setTimeout(arguments[2], delay); setTimeout(arguments[2], delay);
} }*/
} }
...@@ -897,8 +860,8 @@ ...@@ -897,8 +860,8 @@
*/ */
OfficeExcel.Effects.Line.Unfold = function (obj) OfficeExcel.Effects.Line.Unfold = function (obj)
{ {
obj._otherProps._animation_factor = obj._otherProps._animation_unfold_initial; /*obj._otherProps._animation_factor = obj._otherProps._animation_unfold_initial;
OfficeExcel.Effects.Animate(obj, {'chart.animation.factor': 1}, arguments[2]); OfficeExcel.Effects.Animate(obj, {'chart.animation.factor': 1}, arguments[2]);*/
} }
...@@ -913,7 +876,7 @@ ...@@ -913,7 +876,7 @@
*/ */
OfficeExcel.Effects.Rose.Grow = function (obj) OfficeExcel.Effects.Rose.Grow = function (obj)
{ {
var numFrames = 60; /*var numFrames = 60;
var currentFrame = 0; var currentFrame = 0;
var original_margin = obj._otherProps._margin; var original_margin = obj._otherProps._margin;
var margin = (360 / obj.data.length) / 2; var margin = (360 / obj.data.length) / 2;
...@@ -944,7 +907,7 @@ ...@@ -944,7 +907,7 @@
} }
} }
OfficeExcel.Effects.UpdateCanvas(Grow_inner); OfficeExcel.Effects.UpdateCanvas(Grow_inner);*/
} }
...@@ -955,7 +918,7 @@ ...@@ -955,7 +918,7 @@
*/ */
OfficeExcel.Effects.Line.UnfoldFromCenter = function (obj) OfficeExcel.Effects.Line.UnfoldFromCenter = function (obj)
{ {
var numFrames = 30; /*var numFrames = 30;
var original_opacity = obj.canvas.style.opacity; var original_opacity = obj.canvas.style.opacity;
obj.canvas.style.opacity = 0; obj.canvas.style.opacity = 0;
...@@ -1011,7 +974,7 @@ ...@@ -1011,7 +974,7 @@
} }
} }
UnfoldFromCenter(); UnfoldFromCenter();*/
} }
...@@ -1022,7 +985,7 @@ ...@@ -1022,7 +985,7 @@
*/ */
OfficeExcel.Effects.Line.FoldToCenter = function (obj) OfficeExcel.Effects.Line.FoldToCenter = function (obj)
{ {
var totalFrames = 30; /*var totalFrames = 30;
var numFrame = totalFrames; var numFrame = totalFrames;
obj.Draw(); obj.Draw();
var center_value = obj.scale[4] / 2; var center_value = obj.scale[4] / 2;
...@@ -1056,7 +1019,7 @@ ...@@ -1056,7 +1019,7 @@
} }
} }
OfficeExcel.Effects.UpdateCanvas(FoldToCenter); OfficeExcel.Effects.UpdateCanvas(FoldToCenter);*/
} }
...@@ -1071,7 +1034,7 @@ ...@@ -1071,7 +1034,7 @@
*/ */
OfficeExcel.Effects.Odo.Grow = function (obj) OfficeExcel.Effects.Odo.Grow = function (obj)
{ {
var numFrames = 30; /*var numFrames = 30;
var origValue = Number(obj.currentValue); var origValue = Number(obj.currentValue);
var newValue = obj.value; var newValue = obj.value;
var diff = newValue - origValue; var diff = newValue - origValue;
...@@ -1096,7 +1059,7 @@ ...@@ -1096,7 +1059,7 @@
} }
//setTimeout(Grow, 100); //setTimeout(Grow, 100);
OfficeExcel.Effects.UpdateCanvas(Grow_inner); OfficeExcel.Effects.UpdateCanvas(Grow_inner);*/
} }
...@@ -1111,7 +1074,7 @@ ...@@ -1111,7 +1074,7 @@
*/ */
OfficeExcel.Effects.Meter.Grow = function (obj) OfficeExcel.Effects.Meter.Grow = function (obj)
{ {
if (!obj.currentValue) { /*if (!obj.currentValue) {
obj.currentValue = obj.min; obj.currentValue = obj.min;
} }
...@@ -1135,7 +1098,7 @@ ...@@ -1135,7 +1098,7 @@
} }
} }
OfficeExcel.Effects.UpdateCanvas(Grow_meter_inner); OfficeExcel.Effects.UpdateCanvas(Grow_meter_inner);*/
} }
...@@ -1149,7 +1112,7 @@ ...@@ -1149,7 +1112,7 @@
OfficeExcel.Effects.HBar.Grow = function (obj) OfficeExcel.Effects.HBar.Grow = function (obj)
{ {
// Save the data // Save the data
obj.original_data = OfficeExcel.array_clone(obj.data); /*obj.original_data = OfficeExcel.array_clone(obj.data);
// Zero the data // Zero the data
obj.__animation_frame__ = 0; obj.__animation_frame__ = 0;
...@@ -1173,9 +1136,9 @@ ...@@ -1173,9 +1136,9 @@
obj._otherProps._xmax = xmax; obj._otherProps._xmax = xmax;
} }
/**
* Turn off shadow blur for the duration of the animation //Turn off shadow blur for the duration of the animation
*/
if (obj._shadow._blur > 0) { if (obj._shadow._blur > 0) {
var __original_shadow_blur__ = obj._shadow._blur; var __original_shadow_blur__ = obj._shadow._blur;
obj._shadow._blur = 0; obj._shadow._blur = 0;
...@@ -1207,9 +1170,9 @@ ...@@ -1207,9 +1170,9 @@
} }
} }
/**
* Increment the vmargin to the target //Increment the vmargin to the target
*/
obj._otherProps._vmargin = ((1 - (obj.__animation_frame__ / numFrames)) * (obj.__vmargin__ - obj.__original_vmargin__)) + obj.__original_vmargin__; obj._otherProps._vmargin = ((1 - (obj.__animation_frame__ / numFrames)) * (obj.__vmargin__ - obj.__original_vmargin__)) + obj.__original_vmargin__;
...@@ -1231,7 +1194,7 @@ ...@@ -1231,7 +1194,7 @@
} }
} }
OfficeExcel.Effects.UpdateCanvas(Grow); OfficeExcel.Effects.UpdateCanvas(Grow);*/
} }
...@@ -1249,12 +1212,10 @@ ...@@ -1249,12 +1212,10 @@
*/ */
OfficeExcel.Effects.Line.jQuery.Trace = function (obj) OfficeExcel.Effects.Line.jQuery.Trace = function (obj)
{ {
OfficeExcel.Clear(obj.canvas); /*OfficeExcel.Clear(obj.canvas);
obj.Draw(); obj.Draw();
/** //Create the DIV that the second canvas will sit in
* Create the DIV that the second canvas will sit in
*/
var div = document.createElement('DIV'); var div = document.createElement('DIV');
var xy = OfficeExcel.getCanvasXY(obj.canvas); var xy = OfficeExcel.getCanvasXY(obj.canvas);
div.id = '__OfficeExcel_trace_animation_' + OfficeExcel.random(0, 4351623) + '__'; div.id = '__OfficeExcel_trace_animation_' + OfficeExcel.random(0, 4351623) + '__';
...@@ -1266,9 +1227,7 @@ ...@@ -1266,9 +1227,7 @@
div.style.overflow = 'hidden'; div.style.overflow = 'hidden';
document.body.appendChild(div); document.body.appendChild(div);
/** //Make the second canvas
* Make the second canvas
*/
var id = '__OfficeExcel_line_reveal_animation_' + OfficeExcel.random(0, 99999999) + '__'; var id = '__OfficeExcel_line_reveal_animation_' + OfficeExcel.random(0, 99999999) + '__';
var canvas2 = document.createElement('CANVAS'); var canvas2 = document.createElement('CANVAS');
canvas2.width = obj.canvas.width; canvas2.width = obj.canvas.width;
...@@ -1289,9 +1248,7 @@ ...@@ -1289,9 +1248,7 @@
} }
window.addEventListener('resize', reposition_canvas2, false) window.addEventListener('resize', reposition_canvas2, false)
/** //Make a copy of the original Line object
* Make a copy of the original Line object
*/
var obj2 = new OfficeExcel.Line(id, OfficeExcel.array_clone(obj.original_data)); var obj2 = new OfficeExcel.Line(id, OfficeExcel.array_clone(obj.original_data));
for (i in obj.properties) { for (i in obj.properties) {
...@@ -1312,9 +1269,7 @@ ...@@ -1312,9 +1269,7 @@
obj2.Draw(); obj2.Draw();
/** //This effectively hides the line
* This effectively hides the line
*/
obj._otherProps._line_visible = false; obj._otherProps._line_visible = false;
obj._otherProps._colors = ['rgba(0,0,0,0)']; obj._otherProps._colors = ['rgba(0,0,0,0)'];
if (obj._otherProps._filled) { if (obj._otherProps._filled) {
...@@ -1330,10 +1285,10 @@ ...@@ -1330,10 +1285,10 @@
}, arguments[2] ? arguments[2] : 1500, OfficeExcel.Effects.Line.Trace_callback); }, arguments[2] ? arguments[2] : 1500, OfficeExcel.Effects.Line.Trace_callback);
/**
* Get rid of the second canvas and turn the line back on // Get rid of the second canvas and turn the line back on
* on the original. // on the original.
*/
OfficeExcel.Effects.Line.Trace_callback = function () OfficeExcel.Effects.Line.Trace_callback = function ()
{ {
// Remove the window resize listener // Remove the window resize listener
...@@ -1351,7 +1306,7 @@ ...@@ -1351,7 +1306,7 @@
OfficeExcel.Clear(obj.canvas); OfficeExcel.Clear(obj.canvas);
obj.Draw(); obj.Draw();
} }*/
} }
...@@ -1367,7 +1322,7 @@ ...@@ -1367,7 +1322,7 @@
*/ */
OfficeExcel.Effects.Pie.RoundRobin = function (obj) OfficeExcel.Effects.Pie.RoundRobin = function (obj)
{ {
var callback = arguments[2] ? arguments[2] : null; /*var callback = arguments[2] ? arguments[2] : null;
var opt = arguments[1]; var opt = arguments[1];
var currentFrame = 0; var currentFrame = 0;
var numFrames = 90; var numFrames = 90;
...@@ -1392,7 +1347,7 @@ ...@@ -1392,7 +1347,7 @@
} }
} }
OfficeExcel.Effects.UpdateCanvas(RoundRobin_inner); OfficeExcel.Effects.UpdateCanvas(RoundRobin_inner);*/
} }
...@@ -1406,7 +1361,7 @@ ...@@ -1406,7 +1361,7 @@
*/ */
OfficeExcel.Effects.Pie.Implode = function (obj) OfficeExcel.Effects.Pie.Implode = function (obj)
{ {
var numFrames = 90; /*var numFrames = 90;
var distance = Math.min(obj.canvas.width, obj.canvas.height); var distance = Math.min(obj.canvas.width, obj.canvas.height);
function Implode_inner () function Implode_inner ()
...@@ -1426,7 +1381,7 @@ ...@@ -1426,7 +1381,7 @@
} }
} }
OfficeExcel.Effects.UpdateCanvas(Implode_inner); OfficeExcel.Effects.UpdateCanvas(Implode_inner);*/
} }
...@@ -1441,7 +1396,7 @@ ...@@ -1441,7 +1396,7 @@
*/ */
OfficeExcel.Effects.Gauge.Grow = function (obj) OfficeExcel.Effects.Gauge.Grow = function (obj)
{ {
var numFrames = 30; /*var numFrames = 30;
var origValue = Number(obj.currentValue); var origValue = Number(obj.currentValue);
if (obj.currentValue == null) { if (obj.currentValue == null) {
...@@ -1478,7 +1433,7 @@ ...@@ -1478,7 +1433,7 @@
} }
//setTimeout(Grow, 100); //setTimeout(Grow, 100);
OfficeExcel.Effects.UpdateCanvas(Grow); OfficeExcel.Effects.UpdateCanvas(Grow);*/
} }
...@@ -1493,7 +1448,7 @@ ...@@ -1493,7 +1448,7 @@
*/ */
OfficeExcel.Effects.Radar.Grow = function (obj) OfficeExcel.Effects.Radar.Grow = function (obj)
{ {
var totalframes = 30; /*var totalframes = 30;
var framenum = totalframes; var framenum = totalframes;
var data = OfficeExcel.array_clone(obj.data); var data = OfficeExcel.array_clone(obj.data);
var callback = arguments[2]; var callback = arguments[2];
...@@ -1523,7 +1478,7 @@ ...@@ -1523,7 +1478,7 @@
} }
} }
OfficeExcel.Effects.UpdateCanvas(Grow_inner); OfficeExcel.Effects.UpdateCanvas(Grow_inner);*/
} }
...@@ -1536,7 +1491,7 @@ ...@@ -1536,7 +1491,7 @@
*/ */
OfficeExcel.Effects.Waterfall.Grow = function (obj) OfficeExcel.Effects.Waterfall.Grow = function (obj)
{ {
var totalFrames = 45; /*var totalFrames = 45;
var numFrame = 0; var numFrame = 0;
var data = OfficeExcel.array_clone(obj.data); var data = OfficeExcel.array_clone(obj.data);
var callback = arguments[2]; var callback = arguments[2];
...@@ -1547,9 +1502,9 @@ ...@@ -1547,9 +1502,9 @@
} }
/**
* Fix the scale //Fix the scale
*/
if (obj._otherProps._ymax == null) { if (obj._otherProps._ymax == null) {
var max = OfficeExcel.getScale(obj.getMax(data))[4] var max = OfficeExcel.getScale(obj.getMax(data))[4]
obj._otherProps._ymax = max; obj._otherProps._ymax = max;
...@@ -1578,7 +1533,7 @@ ...@@ -1578,7 +1533,7 @@
} }
} }
OfficeExcel.Effects.UpdateCanvas(Grow_inner) OfficeExcel.Effects.UpdateCanvas(Grow_inner)*/
} }
...@@ -1590,7 +1545,7 @@ ...@@ -1590,7 +1545,7 @@
*/ */
OfficeExcel.Effects.Bar.Wave = function (obj) OfficeExcel.Effects.Bar.Wave = function (obj)
{ {
var callback = arguments[2] ? arguments[2] : null; /*var callback = arguments[2] ? arguments[2] : null;
var max = 0; var max = 0;
for (var i=0; i<obj.data.length; ++i) { for (var i=0; i<obj.data.length; ++i) {
...@@ -1647,7 +1602,7 @@ ...@@ -1647,7 +1602,7 @@
} }
OfficeExcel.Clear(obj.canvas); OfficeExcel.Clear(obj.canvas);
obj.Draw(); obj.Draw();*/
} }
...@@ -1658,7 +1613,7 @@ ...@@ -1658,7 +1613,7 @@
*/ */
OfficeExcel.Effects.HProgress.Grow = function (obj) OfficeExcel.Effects.HProgress.Grow = function (obj)
{ {
var canvas = obj.canvas; /*var canvas = obj.canvas;
var context = obj.context; var context = obj.context;
var diff = obj.value - Number(obj.currentValue); var diff = obj.value - Number(obj.currentValue);
var numFrames = 30; var numFrames = 30;
...@@ -1680,7 +1635,7 @@ ...@@ -1680,7 +1635,7 @@
} }
} }
OfficeExcel.Effects.UpdateCanvas(Grow_hprogress_inner); OfficeExcel.Effects.UpdateCanvas(Grow_hprogress_inner);*/
} }
...@@ -1691,7 +1646,7 @@ ...@@ -1691,7 +1646,7 @@
*/ */
OfficeExcel.Effects.VProgress.Grow = function (obj) OfficeExcel.Effects.VProgress.Grow = function (obj)
{ {
var canvas = obj.canvas; /*var canvas = obj.canvas;
var context = obj.context; var context = obj.context;
var diff = obj.value - Number(obj.currentValue); var diff = obj.value - Number(obj.currentValue);
var numFrames = 30; var numFrames = 30;
...@@ -1713,7 +1668,7 @@ ...@@ -1713,7 +1668,7 @@
} }
} }
OfficeExcel.Effects.UpdateCanvas(Grow_vprogress_inner); OfficeExcel.Effects.UpdateCanvas(Grow_vprogress_inner);*/
} }
...@@ -1726,10 +1681,8 @@ ...@@ -1726,10 +1681,8 @@
*/ */
OfficeExcel.Effects.Pie.Wave = function (obj) OfficeExcel.Effects.Pie.Wave = function (obj)
{ {
/** //Zero all the data and set the max value
* Zero all the data and set the max value /*var max = OfficeExcel.array_max(obj.data);
*/
var max = OfficeExcel.array_max(obj.data);
var scale = OfficeExcel.getScale(max); var scale = OfficeExcel.getScale(max);
obj._otherProps._ymax = scale[4]; obj._otherProps._ymax = scale[4];
...@@ -1750,15 +1703,15 @@ ...@@ -1750,15 +1703,15 @@
for (var k=0; k<=totalFrames; ++k) { for (var k=0; k<=totalFrames; ++k) {
setTimeout('OfficeExcel.Effects.Pie.Wave_inner_iterator(__OfficeExcel_pie_wave_object__, '+idx+', '+(k / totalFrames)+');', 20 * k); setTimeout('OfficeExcel.Effects.Pie.Wave_inner_iterator(__OfficeExcel_pie_wave_object__, '+idx+', '+(k / totalFrames)+');', 20 * k);
} }
} }*/
} }
OfficeExcel.Effects.Pie.Wave_inner_iterator = function (obj, idx, factor) OfficeExcel.Effects.Pie.Wave_inner_iterator = function (obj, idx, factor)
{ {
obj.data[idx] = original_pie_data[idx] * factor; /*obj.data[idx] = original_pie_data[idx] * factor;
OfficeExcel.Clear(obj.canvas); OfficeExcel.Clear(obj.canvas);
obj.Draw(); obj.Draw();*/
} }
...@@ -1769,7 +1722,7 @@ ...@@ -1769,7 +1722,7 @@
*/ */
OfficeExcel.Effects.Bar.Wave2 = function (obj) OfficeExcel.Effects.Bar.Wave2 = function (obj)
{ {
var callback = arguments[2] ? arguments[2] : null; /*var callback = arguments[2] ? arguments[2] : null;
var max = 0; var max = 0;
for (var i=0; i<obj.data.length; ++i) { for (var i=0; i<obj.data.length; ++i) {
...@@ -1789,9 +1742,8 @@ ...@@ -1789,9 +1742,8 @@
original_bar_data = OfficeExcel.array_clone(obj.data); original_bar_data = OfficeExcel.array_clone(obj.data);
__OfficeExcel_bar_wave_object__ = obj; __OfficeExcel_bar_wave_object__ = obj;
/**
* Zero all the bars //Zero all the bars
*/
for (var i=0; i<obj.data.length; ++i) { for (var i=0; i<obj.data.length; ++i) {
if (typeof(obj.data[i]) == 'number') { if (typeof(obj.data[i]) == 'number') {
obj.data[i] = 0; obj.data[i] = 0;
...@@ -1800,7 +1752,7 @@ ...@@ -1800,7 +1752,7 @@
} }
setTimeout('a = new OfficeExcel.Effects.Bar.Wave2.Iterator(__OfficeExcel_bar_wave_object__, ' + i + ', 45); a.Animate();', i * 150); setTimeout('a = new OfficeExcel.Effects.Bar.Wave2.Iterator(__OfficeExcel_bar_wave_object__, ' + i + ', 45); a.Animate();', i * 150);
} }*/
} }
...@@ -1817,7 +1769,7 @@ ...@@ -1817,7 +1769,7 @@
OfficeExcel.Effects.Bar.Wave2.Iterator.prototype.Animate = function () OfficeExcel.Effects.Bar.Wave2.Iterator.prototype.Animate = function ()
{ {
if (typeof(this.obj.data[this.idx]) == 'number') { /*if (typeof(this.obj.data[this.idx]) == 'number') {
this.obj.data[this.idx] = (this.curFrame / this.frames) * original_bar_data[this.idx]; this.obj.data[this.idx] = (this.curFrame / this.frames) * original_bar_data[this.idx];
} else if (typeof(this.obj.data[this.idx]) == 'object') { } else if (typeof(this.obj.data[this.idx]) == 'object') {
for (var j=0; j<this.obj.data[this.idx].length; ++j) { for (var j=0; j<this.obj.data[this.idx].length; ++j) {
...@@ -1833,7 +1785,7 @@ ...@@ -1833,7 +1785,7 @@
this.curFrame += 1; this.curFrame += 1;
OfficeExcel.Effects.UpdateCanvas(this.Animate.bind(this)); OfficeExcel.Effects.UpdateCanvas(this.Animate.bind(this));
} }*/
} }
...@@ -1844,7 +1796,7 @@ ...@@ -1844,7 +1796,7 @@
*/ */
OfficeExcel.Effects.Gantt.Grow = function (obj) OfficeExcel.Effects.Gantt.Grow = function (obj)
{ {
var canvas = obj.canvas; /*var canvas = obj.canvas;
var context = obj.context; var context = obj.context;
var numFrames = 30; var numFrames = 30;
var currentFrame = 0 var currentFrame = 0
...@@ -1882,7 +1834,7 @@ ...@@ -1882,7 +1834,7 @@
} }
} }
OfficeExcel.Effects.UpdateCanvas(Grow_gantt_inner); OfficeExcel.Effects.UpdateCanvas(Grow_gantt_inner);*/
} }
...@@ -1890,7 +1842,7 @@ ...@@ -1890,7 +1842,7 @@
* This is a compatibility hack provided for Opera and Safari which * This is a compatibility hack provided for Opera and Safari which
* don't support ther Javascript 1.8.5 function.bind() * don't support ther Javascript 1.8.5 function.bind()
*/ */
if (!Function.prototype.bind) { /*if (!Function.prototype.bind) {
Function.prototype.bind = function (oThis) { Function.prototype.bind = function (oThis) {
if (typeof this !== "function") { if (typeof this !== "function") {
// closest thing possible to the ECMAScript 5 internal IsCallable function // closest thing possible to the ECMAScript 5 internal IsCallable function
...@@ -1912,7 +1864,7 @@ ...@@ -1912,7 +1864,7 @@
return fBound; return fBound;
}; };
} }*/
/** /**
...@@ -1924,14 +1876,14 @@ ...@@ -1924,14 +1876,14 @@
*/ */
OfficeExcel.Effects.Rose.Explode = function (obj) OfficeExcel.Effects.Rose.Explode = function (obj)
{ {
var canvas = obj.canvas; /* var canvas = obj.canvas;
var opts = arguments[1] ? arguments[1] : []; var opts = arguments[1] ? arguments[1] : [];
var callback = arguments[2] ? arguments[2] : null; var callback = arguments[2] ? arguments[2] : null;
var frames = opts['frames'] ? opts['frames'] : 60; var frames = opts['frames'] ? opts['frames'] : 60;
obj._otherProps._exploded = 0; obj._otherProps._exploded = 0;
OfficeExcel.Effects.Animate(obj, {'frames': frames, 'chart.exploded': Math.min(canvas.width, canvas.height)}, callback); // ToDo ?? OfficeExcel.Effects.Animate(obj, {'frames': frames, 'chart.exploded': Math.min(canvas.width, canvas.height)}, callback);*/
} }
...@@ -1952,5 +1904,5 @@ ...@@ -1952,5 +1904,5 @@
obj._otherProps._exploded = Math.min(canvas.width, canvas.height); obj._otherProps._exploded = Math.min(canvas.width, canvas.height);
OfficeExcel.Effects.Animate(obj, {'frames': frames, 'chart.exploded': 0}, callback); // ToDo ?? OfficeExcel.Effects.Animate(obj, {'frames': frames, 'chart.exploded': 0}, callback);
} }
\ No newline at end of file
...@@ -22,21 +22,15 @@ ...@@ -22,21 +22,15 @@
*/ */
OfficeExcel.Tooltip = function (canvas, text, x, y, idx) OfficeExcel.Tooltip = function (canvas, text, x, y, idx)
{ {
/** //chart.tooltip.override allows you to totally take control of rendering the tooltip yourself
* chart.tooltip.override allows you to totally take control of rendering the tooltip yourself /*if (typeof(canvas.__object__._tooltip._override) == 'function') {
*/
if (typeof(canvas.__object__._tooltip._override) == 'function') {
return canvas.__object__._tooltip._override(canvas, text, x, y, idx); return canvas.__object__._tooltip._override(canvas, text, x, y, idx);
} }
/** //This facilitates the "id:xxx" format
* This facilitates the "id:xxx" format
*/
text = OfficeExcel.getTooltipTextFromDIV(text); text = OfficeExcel.getTooltipTextFromDIV(text);
/** //First clear any exising timers
* First clear any exising timers
*/
var timers = OfficeExcel.Registry.Get('chart.tooltip.timers'); var timers = OfficeExcel.Registry.Get('chart.tooltip.timers');
if (timers && timers.length) { if (timers && timers.length) {
...@@ -46,9 +40,7 @@ ...@@ -46,9 +40,7 @@
} }
OfficeExcel.Registry.Set('chart.tooltip.timers', []); OfficeExcel.Registry.Set('chart.tooltip.timers', []);
/** //Hide the context menu if it's currently shown
* Hide the context menu if it's currently shown
*/
if (canvas.__object__._otherProps._contextmenu) { if (canvas.__object__._otherProps._contextmenu) {
OfficeExcel.HideContext(); OfficeExcel.HideContext();
} }
...@@ -77,15 +69,11 @@ ...@@ -77,15 +69,11 @@
tooltipObj.innerHTML = text; tooltipObj.innerHTML = text;
tooltipObj.__text__ = text; tooltipObj.__text__ = text;
/** //Now that the new content has been set, re-set the width & height
* Now that the new content has been set, re-set the width & height
*/
OfficeExcel.Registry.Get('chart.tooltip').style.width = OfficeExcel.getTooltipWidth(text, canvas.__object__) + 'px'; OfficeExcel.Registry.Get('chart.tooltip').style.width = OfficeExcel.getTooltipWidth(text, canvas.__object__) + 'px';
OfficeExcel.Registry.Get('chart.tooltip').style.height = OfficeExcel.Registry.Get('chart.tooltip').offsetHeight + 'px'; OfficeExcel.Registry.Get('chart.tooltip').style.height = OfficeExcel.Registry.Get('chart.tooltip').offsetHeight + 'px';
/** // Now (25th September 2011) use jQuery if it's available
* Now (25th September 2011) use jQuery if it's available
*/
if (typeof(jQuery) == 'function' && typeof($) == 'function') { if (typeof(jQuery) == 'function' && typeof($) == 'function') {
$('#' + tooltipObj.id).animate({ $('#' + tooltipObj.id).animate({
opacity: 1, opacity: 1,
...@@ -120,23 +108,17 @@ ...@@ -120,23 +108,17 @@
alert('[TOOLTIPS] The "snap" effect is only supported on the Line, Rscatter, Scatter and Radar charts (tried to use it with type: ' + canvas.__object__.type); alert('[TOOLTIPS] The "snap" effect is only supported on the Line, Rscatter, Scatter and Radar charts (tried to use it with type: ' + canvas.__object__.type);
} }
/** //Fire the tooltip event
* Fire the tooltip event
*/
OfficeExcel.FireCustomEvent(canvas.__object__, 'ontooltip'); OfficeExcel.FireCustomEvent(canvas.__object__, 'ontooltip');
return; return;
} }
/** //Hide any currently shown tooltip
* Hide any currently shown tooltip
*/
OfficeExcel.HideTooltip(); OfficeExcel.HideTooltip();
/** //Show a tool tip
* Show a tool tip
*/
var tooltipObj = document.createElement('DIV'); var tooltipObj = document.createElement('DIV');
tooltipObj.className = canvas.__object__._tooltip._css_class; tooltipObj.className = canvas.__object__._tooltip._css_class;
tooltipObj.style.display = 'none'; tooltipObj.style.display = 'none';
...@@ -170,9 +152,7 @@ ...@@ -170,9 +152,7 @@
if (typeof(idx) == 'number') { if (typeof(idx) == 'number') {
tooltipObj.__index__ = idx; tooltipObj.__index__ = idx;
/** //Just for the line chart
* Just for the line chart
*/
if (canvas.__object__.type == 'line') { if (canvas.__object__.type == 'line') {
var index2 = idx; var index2 = idx;
...@@ -195,16 +175,12 @@ ...@@ -195,16 +175,12 @@
y = y + 2; y = y + 2;
} }
/** //Set the width on the tooltip so it doesn't resize if the window is resized
* Set the width on the tooltip so it doesn't resize if the window is resized
*/
tooltipObj.style.width = width + 'px'; tooltipObj.style.width = width + 'px';
//tooltipObj.style.height = 0; // Initially set the tooltip height to nothing //tooltipObj.style.height = 0; // Initially set the tooltip height to nothing
/** //If the mouse is towards the right of the browser window and the tooltip would go outside of the window,
* If the mouse is towards the right of the browser window and the tooltip would go outside of the window, // move it left
* move it left
*/
if ( (x + width) > document.body.offsetWidth ) { if ( (x + width) > document.body.offsetWidth ) {
x = x - width - 7; x = x - width - 7;
var placementLeft = true; var placementLeft = true;
...@@ -357,16 +333,12 @@ ...@@ -357,16 +333,12 @@
// When the animation is finished, set the tooltip HTML // When the animation is finished, set the tooltip HTML
OfficeExcel.Registry.Get('chart.tooltip.timers').push(setTimeout("if (OfficeExcel.Registry.Get('chart.tooltip')) { OfficeExcel.Registry.Get('chart.tooltip').innerHTML = OfficeExcel.Registry.Get('chart.tooltip').__text__; }", 250)); OfficeExcel.Registry.Get('chart.tooltip.timers').push(setTimeout("if (OfficeExcel.Registry.Get('chart.tooltip')) { OfficeExcel.Registry.Get('chart.tooltip').innerHTML = OfficeExcel.Registry.Get('chart.tooltip').__text__; }", 250));
/** //This resets the pointer
* This resets the pointer
*/
OfficeExcel.Registry.Get('chart.tooltip.timers').push(setTimeout("if (OfficeExcel.Registry.Get('chart.tooltip')) { OfficeExcel.Registry.Get('chart.tooltip').style.cursor = 'default'; }", 275)); OfficeExcel.Registry.Get('chart.tooltip.timers').push(setTimeout("if (OfficeExcel.Registry.Get('chart.tooltip')) { OfficeExcel.Registry.Get('chart.tooltip').style.cursor = 'default'; }", 275));
} else if (effect == 'snap') { } else if (effect == 'snap') {
/******************************************************* //Move the tooltip
* Move the tooltip
*******************************************************/
for (var i=1; i<=10; ++i) { for (var i=1; i<=10; ++i) {
OfficeExcel.Registry.Get('chart.tooltip.timers').push(setTimeout("if (OfficeExcel.Registry.Get('chart.tooltip')) { OfficeExcel.Registry.Get('chart.tooltip').style.left = '" + (x * 0.1 * i) + "px'; }", 15 * i)); OfficeExcel.Registry.Get('chart.tooltip.timers').push(setTimeout("if (OfficeExcel.Registry.Get('chart.tooltip')) { OfficeExcel.Registry.Get('chart.tooltip').style.left = '" + (x * 0.1 * i) + "px'; }", 15 * i));
OfficeExcel.Registry.Get('chart.tooltip.timers').push(setTimeout("if (OfficeExcel.Registry.Get('chart.tooltip')) { OfficeExcel.Registry.Get('chart.tooltip').style.top = '" + (y * 0.1 * i) + "px'; }", 15 * i)); OfficeExcel.Registry.Get('chart.tooltip.timers').push(setTimeout("if (OfficeExcel.Registry.Get('chart.tooltip')) { OfficeExcel.Registry.Get('chart.tooltip').style.top = '" + (y * 0.1 * i) + "px'; }", 15 * i));
...@@ -393,9 +365,7 @@ ...@@ -393,9 +365,7 @@
setTimeout("if (OfficeExcel.Registry.Get('chart.tooltip')) { OfficeExcel.Registry.Get('chart.tooltip').style.opacity = 1;}", effect == 'none' ? 50 : 250); setTimeout("if (OfficeExcel.Registry.Get('chart.tooltip')) { OfficeExcel.Registry.Get('chart.tooltip').style.opacity = 1;}", effect == 'none' ? 50 : 250);
/** //If the tooltip it self is clicked, cancel it
* If the tooltip it self is clicked, cancel it
*/
tooltipObj.onmousedown = function (e) tooltipObj.onmousedown = function (e)
{ {
e = OfficeExcel.FixEventObject(e) e = OfficeExcel.FixEventObject(e)
...@@ -410,9 +380,7 @@ ...@@ -410,9 +380,7 @@
} }
} }
/** //Install the function for hiding the tooltip.
* Install the function for hiding the tooltip.
*/
document.body.onmousedown = function (event) document.body.onmousedown = function (event)
{ {
var tooltip = OfficeExcel.Registry.Get('chart.tooltip'); var tooltip = OfficeExcel.Registry.Get('chart.tooltip');
...@@ -427,9 +395,7 @@ ...@@ -427,9 +395,7 @@
} }
} }
/** //If the window is resized, hide the tooltip
* If the window is resized, hide the tooltip
*/
window.onresize = function () window.onresize = function ()
{ {
var tooltip = OfficeExcel.Registry.Get('chart.tooltip'); var tooltip = OfficeExcel.Registry.Get('chart.tooltip');
...@@ -448,15 +414,12 @@ ...@@ -448,15 +414,12 @@
} }
} }
/**
* Keep a reference to the tooltip //Keep a reference to the tooltip
*/
OfficeExcel.Registry.Set('chart.tooltip', tooltipObj); OfficeExcel.Registry.Set('chart.tooltip', tooltipObj);
/** //Fire the tooltip event
* Fire the tooltip event OfficeExcel.FireCustomEvent(canvas.__object__, 'ontooltip');*/
*/
OfficeExcel.FireCustomEvent(canvas.__object__, 'ontooltip');
} }
...@@ -466,7 +429,7 @@ ...@@ -466,7 +429,7 @@
OfficeExcel.getTooltipTextFromDIV = function (text) OfficeExcel.getTooltipTextFromDIV = function (text)
{ {
// This regex is duplicated firher down on roughly line 888 // This regex is duplicated firher down on roughly line 888
var result = /^id:(.*)/.exec(text); /*var result = /^id:(.*)/.exec(text);
if (result && result[1] && document.getElementById(result[1])) { if (result && result[1] && document.getElementById(result[1])) {
text = document.getElementById(result[1]).innerHTML; text = document.getElementById(result[1]).innerHTML;
...@@ -474,7 +437,7 @@ ...@@ -474,7 +437,7 @@
text = ''; text = '';
} }
return text; return text;*/
} }
...@@ -484,7 +447,7 @@ ...@@ -484,7 +447,7 @@
OfficeExcel.parseTooltipText = function (tooltips, idx) OfficeExcel.parseTooltipText = function (tooltips, idx)
{ {
// Get the tooltip text // Get the tooltip text
if (typeof(tooltips) == 'function') { /*if (typeof(tooltips) == 'function') {
var text = tooltips(idx); var text = tooltips(idx);
} else if (typeof(tooltips) == 'object' && tooltips && typeof(tooltips[idx]) == 'function') { } else if (typeof(tooltips) == 'object' && tooltips && typeof(tooltips[idx]) == 'function') {
...@@ -503,7 +466,7 @@ ...@@ -503,7 +466,7 @@
text = ''; text = '';
} }
return OfficeExcel.getTooltipTextFromDIV(text); return OfficeExcel.getTooltipTextFromDIV(text);*/
} }
...@@ -512,7 +475,7 @@ ...@@ -512,7 +475,7 @@
*/ */
OfficeExcel.getTooltipWidth = function (text, obj) OfficeExcel.getTooltipWidth = function (text, obj)
{ {
var div = document.createElement('DIV'); /*var div = document.createElement('DIV');
div.className = obj._tooltip._css_class; div.className = obj._tooltip._css_class;
div.style.paddingLeft = OfficeExcel.tooltips.padding; div.style.paddingLeft = OfficeExcel.tooltips.padding;
div.style.paddingRight = OfficeExcel.tooltips.padding; div.style.paddingRight = OfficeExcel.tooltips.padding;
...@@ -526,7 +489,7 @@ ...@@ -526,7 +489,7 @@
div.innerHTML = OfficeExcel.getTooltipTextFromDIV(text); div.innerHTML = OfficeExcel.getTooltipTextFromDIV(text);
document.body.appendChild(div); document.body.appendChild(div);
return div.offsetWidth; return div.offsetWidth;*/
} }
...@@ -535,14 +498,14 @@ ...@@ -535,14 +498,14 @@
*/ */
OfficeExcel.HideTooltip = function () OfficeExcel.HideTooltip = function ()
{ {
var tooltip = OfficeExcel.Registry.Get('chart.tooltip'); /*var tooltip = OfficeExcel.Registry.Get('chart.tooltip');
if (tooltip) { if (tooltip) {
tooltip.parentNode.removeChild(tooltip); tooltip.parentNode.removeChild(tooltip);
tooltip.style.display = 'none'; tooltip.style.display = 'none';
tooltip.style.visibility = 'hidden'; tooltip.style.visibility = 'hidden';
OfficeExcel.Registry.Set('chart.tooltip', null); OfficeExcel.Registry.Set('chart.tooltip', null);
} }*/
} }
...@@ -556,10 +519,8 @@ ...@@ -556,10 +519,8 @@
*/ */
OfficeExcel.InstallBarTooltipEventListeners = function (obj) OfficeExcel.InstallBarTooltipEventListeners = function (obj)
{ {
/** //Install the window onclick handler
* Install the window onclick handler /*var window_onclick_func = function (){OfficeExcel.Redraw();};
*/
var window_onclick_func = function (){OfficeExcel.Redraw();};
window.addEventListener('click', window_onclick_func, false); window.addEventListener('click', window_onclick_func, false);
OfficeExcel.AddEventListener('window_' + obj.id, 'click', window_onclick_func); OfficeExcel.AddEventListener('window_' + obj.id, 'click', window_onclick_func);
...@@ -579,15 +540,11 @@ ...@@ -579,15 +540,11 @@
var barCoords = obj.getBar(e); var barCoords = obj.getBar(e);
/** //If there are bar coords AND the bar has height
* If there are bar coords AND the bar has height
*/
if (barCoords && barCoords[4] > 0 && OfficeExcel.parseTooltipText(obj._tooltip._tooltips, barCoords[5])) { if (barCoords && barCoords[4] > 0 && OfficeExcel.parseTooltipText(obj._tooltip._tooltips, barCoords[5])) {
/** //Get the tooltip text
* Get the tooltip text
*/
var text = OfficeExcel.parseTooltipText(obj._tooltip._tooltips, barCoords[5]); var text = OfficeExcel.parseTooltipText(obj._tooltip._tooltips, barCoords[5]);
if (text) { if (text) {
...@@ -596,9 +553,7 @@ ...@@ -596,9 +553,7 @@
canvas.style.cursor = 'default'; canvas.style.cursor = 'default';
} }
/** //Hide the currently displayed tooltip if the index is the same
* Hide the currently displayed tooltip if the index is the same
*/
if ( OfficeExcel.Registry.Get('chart.tooltip') if ( OfficeExcel.Registry.Get('chart.tooltip')
&& OfficeExcel.Registry.Get('chart.tooltip').__canvas__.id != obj.id && OfficeExcel.Registry.Get('chart.tooltip').__canvas__.id != obj.id
&& obj._tooltip._event == 'onmousemove') { && obj._tooltip._event == 'onmousemove') {
...@@ -607,9 +562,7 @@ ...@@ -607,9 +562,7 @@
OfficeExcel.HideTooltip(); OfficeExcel.HideTooltip();
} }
/** //This facilitates the tooltips using the onmousemove event
* This facilitates the tooltips using the onmousemove event
*/
if ( obj._tooltip._event == 'onmousemove' if ( obj._tooltip._event == 'onmousemove'
&& ( && (
...@@ -617,9 +570,8 @@ ...@@ -617,9 +570,8 @@
|| !OfficeExcel.Registry.Get('chart.tooltip') || !OfficeExcel.Registry.Get('chart.tooltip')
) )
&& text) { && text) {
/**
* Show a tooltip if it's defined //Show a tooltip if it's defined
*/
OfficeExcel.Redraw(obj); OfficeExcel.Redraw(obj);
if (obj._tooltip._highlight) { if (obj._tooltip._highlight) {
...@@ -656,9 +608,7 @@ ...@@ -656,9 +608,7 @@
/** //Install the onclick event handler for the tooltips
* Install the onclick event handler for the tooltips
*/
if (obj._tooltip._event == 'onclick') { if (obj._tooltip._event == 'onclick') {
var canvas_onclick = function (e) var canvas_onclick = function (e)
...@@ -679,25 +629,18 @@ ...@@ -679,25 +629,18 @@
var barCoords = obj.getBar(e); var barCoords = obj.getBar(e);
/**
* Redraw the graph first, in effect resetting the graph to as it was when it was first drawn //Redraw the graph first, in effect resetting the graph to as it was when it was first drawn
* This "deselects" any already selected bar //This "deselects" any already selected bar
*/
OfficeExcel.Redraw(); OfficeExcel.Redraw();
/** //Loop through the bars determining if the mouse is over a bar
* Loop through the bars determining if the mouse is over a bar
*/
if (barCoords) { if (barCoords) {
/** //Get the tooltip text
* Get the tooltip text
*/
var text = OfficeExcel.parseTooltipText(obj._tooltip._tooltips, barCoords[5]); var text = OfficeExcel.parseTooltipText(obj._tooltip._tooltips, barCoords[5]);
/** //Show a tooltip if it's defined
* Show a tooltip if it's defined
*/
if (text && text != 'undefined') { if (text && text != 'undefined') {
if (obj._tooltip._highlight) { if (obj._tooltip._highlight) {
...@@ -714,14 +657,12 @@ ...@@ -714,14 +657,12 @@
} }
} }
/** //Stop the event bubbling
* Stop the event bubbling
*/
e.stopPropagation(); e.stopPropagation();
} }
OfficeExcel.AddEventListener(obj.id, 'click', canvas_onclick); OfficeExcel.AddEventListener(obj.id, 'click', canvas_onclick);
obj.canvas.addEventListener('click', canvas_onclick, false); obj.canvas.addEventListener('click', canvas_onclick, false);
} }*/
} }
...@@ -733,7 +674,7 @@ ...@@ -733,7 +674,7 @@
*/ */
OfficeExcel.InstallLineTooltipEventListeners = function (obj) OfficeExcel.InstallLineTooltipEventListeners = function (obj)
{ {
var canvas_onclick_func = function (e) /*var canvas_onclick_func = function (e)
{ {
e = OfficeExcel.FixEventObject(e); e = OfficeExcel.FixEventObject(e);
...@@ -778,9 +719,7 @@ ...@@ -778,9 +719,7 @@
canvas.style.cursor = 'default'; canvas.style.cursor = 'default';
} }
/** //If the tooltip is the same one as is currently visible (going by the array index), don't do squat and return.
* If the tooltip is the same one as is currently visible (going by the array index), don't do squat and return.
*/
if ( OfficeExcel.Registry.Get('chart.tooltip') if ( OfficeExcel.Registry.Get('chart.tooltip')
&& OfficeExcel.Registry.Get('chart.tooltip').__index__ == idx && OfficeExcel.Registry.Get('chart.tooltip').__index__ == idx
...@@ -791,9 +730,7 @@ ...@@ -791,9 +730,7 @@
return; return;
} }
/** //Redraw the graph
* Redraw the graph
*/
if (obj._tooltip._highlight || obj.__bar__) { if (obj._tooltip._highlight || obj.__bar__) {
OfficeExcel.Redraw(); OfficeExcel.Redraw();
...@@ -811,25 +748,20 @@ ...@@ -811,25 +748,20 @@
if (typeof(obj._tooltip._override) != 'function') { if (typeof(obj._tooltip._override) != 'function') {
OfficeExcel.Registry.Get('chart.tooltip').__index__ = Number(idx); OfficeExcel.Registry.Get('chart.tooltip').__index__ = Number(idx);
/** //This converts idx into the index that is not greater than the
* This converts idx into the index that is not greater than the //number of items in the data array
* number of items in the data array
*/
while (idx >= obj.data[0].length) { while (idx >= obj.data[0].length) {
idx -= obj.data[0].length idx -= obj.data[0].length
} }
OfficeExcel.Registry.Get('chart.tooltip').__index2__ = idx; OfficeExcel.Registry.Get('chart.tooltip').__index2__ = idx;
/** //Set the source event
* Set the source event
*/
OfficeExcel.Registry.Get('chart.tooltip').__event__ = 'mousemove'; OfficeExcel.Registry.Get('chart.tooltip').__event__ = 'mousemove';
/** //Highlight the graph
* Highlight the graph
*/
if (obj._tooltip._highlight) { if (obj._tooltip._highlight) {
context.beginPath(); context.beginPath();
...@@ -847,9 +779,7 @@ ...@@ -847,9 +779,7 @@
} }
} }
/** //Not over a hotspot?
* Not over a hotspot?
*/
canvas.style.cursor = 'default'; canvas.style.cursor = 'default';
} }
obj.canvas.addEventListener('click', canvas_onclick_func, false); obj.canvas.addEventListener('click', canvas_onclick_func, false);
...@@ -905,7 +835,7 @@ ...@@ -905,7 +835,7 @@
} }
obj.canvas.addEventListener('mousemove', canvas_onmousemove_func, false); obj.canvas.addEventListener('mousemove', canvas_onmousemove_func, false);
OfficeExcel.AddEventListener(obj.id, 'mousemove', canvas_onmousemove_func); OfficeExcel.AddEventListener(obj.id, 'mousemove', canvas_onmousemove_func);
} }*/
} }
...@@ -916,7 +846,7 @@ ...@@ -916,7 +846,7 @@
*/ */
OfficeExcel.PreLoadTooltipImages = function (obj) OfficeExcel.PreLoadTooltipImages = function (obj)
{ {
var tooltips = obj._tooltip._tooltips; /*var tooltips = obj._tooltip._tooltips;
if (obj.type == 'rscatter') { if (obj.type == 'rscatter') {
tooltips = []; tooltips = [];
...@@ -955,6 +885,6 @@ ...@@ -955,6 +885,6 @@
// Now remove the div // Now remove the div
document.body.removeChild(div); document.body.removeChild(div);
} }*/
} }
\ No newline at end of file
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
*/ */
OfficeExcel.ZoomArea = function (obj) OfficeExcel.ZoomArea = function (obj)
{ {
if (obj._zoom._mode == 'area') { /*if (obj._zoom._mode == 'area') {
var canvas = obj.canvas; var canvas = obj.canvas;
var context = obj.context; var context = obj.context;
...@@ -45,9 +45,7 @@ ...@@ -45,9 +45,7 @@
} }
} }
/** //Create the indicator DIV
* Create the indicator DIV
*/
var canvasXY = OfficeExcel.getCanvasXY(canvas); var canvasXY = OfficeExcel.getCanvasXY(canvas);
var areaDiv = document.createElement('DIV'); var areaDiv = document.createElement('DIV');
areaDiv.__canvas__ = canvas; areaDiv.__canvas__ = canvas;
...@@ -214,9 +212,7 @@ ...@@ -214,9 +212,7 @@
div.appendChild(img); div.appendChild(img);
/** //This facilitates expanding the zoomed area once visible (the double click)
* This facilitates expanding the zoomed area once visible (the double click)
*/
div.ondblclick = function (event) div.ondblclick = function (event)
{ {
var event = OfficeExcel.FixEventObject(event); var event = OfficeExcel.FixEventObject(event);
...@@ -276,9 +272,7 @@ ...@@ -276,9 +272,7 @@
div.ondblclick = null; div.ondblclick = null;
} }
/** //Make the zoomed bit draggable
* Make the zoomed bit draggable
*/
div.onmousedown = function (e) div.onmousedown = function (e)
{ {
e = OfficeExcel.FixEventObject(e); e = OfficeExcel.FixEventObject(e);
...@@ -305,9 +299,8 @@ ...@@ -305,9 +299,8 @@
OfficeExcel.Registry.Set('chart.mousedown', img); OfficeExcel.Registry.Set('chart.mousedown', img);
OfficeExcel.Registry.Set('chart.button', 2); OfficeExcel.Registry.Set('chart.button', 2);
/**
* Don't show a context menu when the zoomed area is right-clicked on //Don't show a context menu when the zoomed area is right-clicked on
*/
window.oncontextmenu = function (e) window.oncontextmenu = function (e)
{ {
e = OfficeExcel.FixEventObject(e); e = OfficeExcel.FixEventObject(e);
...@@ -431,9 +424,7 @@ ...@@ -431,9 +424,7 @@
OfficeExcel.Registry.Set('chart.zoomed.area.mousedown', null); OfficeExcel.Registry.Set('chart.zoomed.area.mousedown', null);
} }
/** //Fire the zoom event
* Fire the zoom event
*/
OfficeExcel.FireCustomEvent(obj, 'onzoom'); OfficeExcel.FireCustomEvent(obj, 'onzoom');
} }
...@@ -443,7 +434,7 @@ ...@@ -443,7 +434,7 @@
OfficeExcel.Registry.Set('chart.zoomed.area.mousedown', null); OfficeExcel.Registry.Set('chart.zoomed.area.mousedown', null);
OfficeExcel.Registry.Set('chart.zoomed.area.div', null); OfficeExcel.Registry.Set('chart.zoomed.area.div', null);
} }
} }*/
} }
...@@ -469,7 +460,7 @@ ...@@ -469,7 +460,7 @@
*/ */
OfficeExcel.ZoomWindow = function (canvas) OfficeExcel.ZoomWindow = function (canvas)
{ {
canvas.onmousemove = function (e) /*canvas.onmousemove = function (e)
{ {
e = OfficeExcel.FixEventObject(e); e = OfficeExcel.FixEventObject(e);
...@@ -478,9 +469,7 @@ ...@@ -478,9 +469,7 @@
var context = obj.context; var context = obj.context;
var coords = OfficeExcel.getMouseXY(e); var coords = OfficeExcel.getMouseXY(e);
/** //Create the DIV
* Create the DIV
*/
if (!OfficeExcel.Registry.Get('chart.zoomed.div')) { if (!OfficeExcel.Registry.Get('chart.zoomed.div')) {
var div = document.createElement('div'); var div = document.createElement('div');
...@@ -514,9 +503,7 @@ ...@@ -514,9 +503,7 @@
div.__object__ = obj; div.__object__ = obj;
document.body.appendChild(div); document.body.appendChild(div);
/** //Get the canvas as an image
* Get the canvas as an image
*/
var img = document.createElement('img'); var img = document.createElement('img');
img.width = obj.canvas.width * obj._zoom._factor; img.width = obj.canvas.width * obj._zoom._factor;
img.height = obj.canvas.height * obj._zoom._factor; img.height = obj.canvas.height * obj._zoom._factor;
...@@ -541,23 +528,18 @@ ...@@ -541,23 +528,18 @@
// Make sure the image is up-to-date // Make sure the image is up-to-date
img.src = canvas.toDataURL(); img.src = canvas.toDataURL();
/**
* Ensure the div is visible //Ensure the div is visible
*/
if (div && div.style.opacity < 1) { if (div && div.style.opacity < 1) {
setTimeout("OfficeExcel.Registry.Get('chart.zoomed.div').style.opacity = 1", 400); setTimeout("OfficeExcel.Registry.Get('chart.zoomed.div').style.opacity = 1", 400);
} }
/** //Get the canvas x/y coords
* Get the canvas x/y coords
*/
var c = OfficeExcel.getCanvasXY(obj.canvas); var c = OfficeExcel.getCanvasXY(obj.canvas);
var x = c[0]; var x = c[0];
var y = c[1]; var y = c[1];
/** //Position the div and img
* Position the div and img
*/
var offset = 7; var offset = 7;
if (obj._zoom._thumbnail_fixed) { if (obj._zoom._thumbnail_fixed) {
...@@ -582,25 +564,21 @@ ...@@ -582,25 +564,21 @@
img.style.top = (t + (obj._zoom._factor)) + 'px'; img.style.top = (t + (obj._zoom._factor)) + 'px';
} }
/** //Fire the onzoom event
* Fire the onzoom event OfficeExcel.FireCustomEvent(obj, 'onzoom');*/
*/
OfficeExcel.FireCustomEvent(obj, 'onzoom');
} }
/** /**
* The onmouseover event. Evidently. Fades the zoom window in * The onmouseover event. Evidently. Fades the zoom window in
*/ */
canvas.onmouseover = function (e) /*canvas.onmouseover = function (e)
{ {
var div = OfficeExcel.Registry.Get('chart.zoomed.div'); var div = OfficeExcel.Registry.Get('chart.zoomed.div');
// ??? // ???
if (!div) return; if (!div) return;
/** //Allow for fixed positioning
* Allow for fixed positioning
*/
if (div && OfficeExcel.Registry.Get('chart.zoomed.div').__object__._zoom._thumbnail_fixed) { if (div && OfficeExcel.Registry.Get('chart.zoomed.div').__object__._zoom._thumbnail_fixed) {
return return
} }
...@@ -679,7 +657,7 @@ ...@@ -679,7 +657,7 @@
} }
} }
} }
} }*/
/** /**
...@@ -689,20 +667,17 @@ ...@@ -689,20 +667,17 @@
*/ */
OfficeExcel.Zoom = function (e) OfficeExcel.Zoom = function (e)
{ {
e = OfficeExcel.FixEventObject(e); /*e = OfficeExcel.FixEventObject(e);
/** //Show the zoom window
* Show the zoom window
*/
//if ((e.target.__canvas__ && e.target.__canvas__.__object__._zoom._mode == 'thumbnail') || (e.target.parentNode.__canvas__ && e.target.parentNode.__canvas__.__object__._zoom._mode == 'thumbnail') ) { //if ((e.target.__canvas__ && e.target.__canvas__.__object__._zoom._mode == 'thumbnail') || (e.target.parentNode.__canvas__ && e.target.parentNode.__canvas__.__object__._zoom._mode == 'thumbnail') ) {
// return OfficeExcel.ZoomWindow(e); // return OfficeExcel.ZoomWindow(e);
//} //}
if (e && e.target && e.target.__canvas__) { if (e && e.target && e.target.__canvas__) {
var canvas = e.target.__canvas__; var canvas = e.target.__canvas__;
/*******************************************************
* This is here to facilitate zooming by just a single left click //This is here to facilitate zooming by just a single left click
*******************************************************/
} else if (e && e.target && e.target.__object__) { } else if (e && e.target && e.target.__object__) {
var canvas = e.target.__object__.canvas; var canvas = e.target.__object__.canvas;
e.stopPropagation(); // Hmmmm e.stopPropagation(); // Hmmmm
...@@ -832,34 +807,6 @@ ...@@ -832,34 +807,6 @@
} }
} }
/**
* The onmouseout event. Hides the zoom window. Fades the zoom out
*
canvas.onmouseout = function (e)
{
if (OfficeExcel.Registry.Get('chart.zoomed.div') && OfficeExcel.Registry.Get('chart.zoomed.div').__object__._zoom._fade_out) {
OfficeExcel.Registry.Get('chart.zoomed.div').style.opacity = 0.8;
setTimeout("OfficeExcel.Registry.Get('chart.zoomed.div').style.opacity = 0.6", 100);
setTimeout("OfficeExcel.Registry.Get('chart.zoomed.div').style.opacity = 0.4", 200);
setTimeout("OfficeExcel.Registry.Get('chart.zoomed.div').style.opacity = 0.2", 300);
setTimeout("OfficeExcel.Registry.Get('chart.zoomed.div').style.opacity = 0", 400);
// Get rid of the zoom window
setTimeout("OfficeExcel.Registry.Get('chart.zoomed.div').style.left = '-400px'", 400);
setTimeout("OfficeExcel.Registry.Get('chart.zoomed.div').style.top = '-400px'", 400);
} else {
// Get rid of the zoom window
if (OfficeExcel.Registry.Get('chart.zoomed.div')) {
setTimeout("OfficeExcel.Registry.Get('chart.zoomed.div').style.left = '-400px'", 1);
setTimeout("OfficeExcel.Registry.Get('chart.zoomed.div').style.top = '-400px'", 1);
}
}
}
*/
// The background // The background
if (obj._zoom._background) { if (obj._zoom._background) {
...@@ -901,8 +848,7 @@ ...@@ -901,8 +848,7 @@
} }
} }
/**
* Fire the onzoom event //Fire the onzoom event
*/ OfficeExcel.FireCustomEvent(obj, 'onzoom');*/
OfficeExcel.FireCustomEvent(obj, 'onzoom');
} }
\ 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