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);
}
}*/
}
......
......@@ -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