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