Commit 2dbe00b5 authored by Dmitry.Vikulov's avatar Dmitry.Vikulov Committed by Alexander.Trofimov

Add showChartSettings

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@48277 954022d7-b5bf-4e40-9824-e11837661b57
parent e342589a
...@@ -3211,9 +3211,10 @@ function DrawingObjects() { ...@@ -3211,9 +3211,10 @@ function DrawingObjects() {
var url = data["url"]; var url = data["url"];
if (sheetId == worksheet.model.getId()) { if (sheetId == worksheet.model.getId()) {
if ( api.isImageChangeUrl ) { if ( api.isImageChangeUrl || api.isShapeImageChangeUrl ) {
_this.editImageDrawingObject(url); _this.editImageDrawingObject(url, api.isImageChangeUrl);
api.isImageChangeUrl = false; api.isImageChangeUrl = false;
api.isShapeImageChangeUrl = false;
} }
else else
_this.addImageDrawingObject(url, false, null); _this.addImageDrawingObject(url, false, null);
...@@ -3732,30 +3733,45 @@ function DrawingObjects() { ...@@ -3732,30 +3733,45 @@ function DrawingObjects() {
} }
} }
_this.editImageDrawingObject = function(imageUrl) { _this.editImageDrawingObject = function(imageUrl, isImageChangeUrl) {
if ( imageUrl && (_this.controller.selectedObjects.length == 1) ) { if ( imageUrl && (_this.controller.selectedObjects.length == 1) ) {
var drawingObject = _this.controller.selectedObjects[0].drawingBase; var drawingObject = _this.controller.selectedObjects[0].drawingBase;
if ( drawingObject.graphicObject.isImage() ) {
var _image = api.ImageLoader.LoadImage(imageUrl, 1); var _image = api.ImageLoader.LoadImage(imageUrl, 1);
if (null != _image) { if (null != _image) {
addImageObject(_image); addImageObject(_image, isImageChangeUrl);
} }
else { else {
_this.asyncImageEndLoaded = function(_image) { _this.asyncImageEndLoaded = function(_image) {
addImageObject(_image); addImageObject(_image, isImageChangeUrl);
} }
} }
function addImageObject(_image) { function addImageObject(_image, isImageChangeUrl) {
if ( !_image.Image ) { if ( !_image.Image ) {
worksheet.model.workbook.handlers.trigger("asc_onError", c_oAscError.ID.UplImageUrl, c_oAscError.Level.NoCritical); worksheet.model.workbook.handlers.trigger("asc_onError", c_oAscError.ID.UplImageUrl, c_oAscError.Level.NoCritical);
} }
else { else {
if ( isImageChangeUrl ) {
if ( drawingObject.graphicObject.isImage() )
drawingObject.graphicObject.setRasterImage(_image.src); drawingObject.graphicObject.setRasterImage(_image.src);
else if ( drawingObject.graphicObject.isShape() ) {
var imageProp = new asc_CImgProperty();
imageProp.ImageUrl = src;
_this.controller.setGraphicObjectProps(shapeProp);
}
}
else { // isShapeImageChangeUrl
var shapeProp = new asc_CShapeProperty();
shapeProp.fill = new asc_CShapeFill();
shapeProp.fill.type = c_oAscFill.FILL_TYPE_BLIP;
shapeProp.fill.fill = new asc_CFillBlip();
shapeProp.fill.fill.asc_putUrl(_image.src);
_this.controller.setGraphicObjectProps(shapeProp);
}
_this.showDrawingObjects(true); _this.showDrawingObjects(true);
_this.selectGraphicObject(); _this.selectGraphicObject();
} }
...@@ -3763,7 +3779,6 @@ function DrawingObjects() { ...@@ -3763,7 +3779,6 @@ function DrawingObjects() {
} }
} }
} }
}
_this.addChartDrawingObject = function(chart, bWithoutHistory, options) { _this.addChartDrawingObject = function(chart, bWithoutHistory, options) {
...@@ -4634,6 +4649,9 @@ function DrawingObjects() { ...@@ -4634,6 +4649,9 @@ function DrawingObjects() {
worksheet._trigger("selectionChanged", worksheet.getSelectionInfo()); worksheet._trigger("selectionChanged", worksheet.getSelectionInfo());
} }
_this.showChartSettings = function() {
api.wb.handlers.trigger("asc_onShowChartDialog", true);
}
//----------------------------------------------------------------------------------- //-----------------------------------------------------------------------------------
// Graphic object mouse events // Graphic object mouse events
//----------------------------------------------------------------------------------- //-----------------------------------------------------------------------------------
......
...@@ -116,6 +116,7 @@ var ASC_DOCS_API_USE_EMBEDDED_FONTS = "@@ASC_DOCS_API_USE_EMBEDDED_FONTS"; ...@@ -116,6 +116,7 @@ var ASC_DOCS_API_USE_EMBEDDED_FONTS = "@@ASC_DOCS_API_USE_EMBEDDED_FONTS";
this.ImageLoader.put_Api(this); this.ImageLoader.put_Api(this);
this.shapeElementId = null; this.shapeElementId = null;
this.isImageChangeUrl = false; this.isImageChangeUrl = false;
this.isShapeImageChangeUrl = false;
/**************************************/ /**************************************/
...@@ -2191,6 +2192,11 @@ var ASC_DOCS_API_USE_EMBEDDED_FONTS = "@@ASC_DOCS_API_USE_EMBEDDED_FONTS"; ...@@ -2191,6 +2192,11 @@ var ASC_DOCS_API_USE_EMBEDDED_FONTS = "@@ASC_DOCS_API_USE_EMBEDDED_FONTS";
this.asc_showImageFileDialog(); this.asc_showImageFileDialog();
}, },
asc_changeShapeImageFromFile: function() {
this.isShapeImageChangeUrl = true;
this.asc_showImageFileDialog();
},
asyncImageStartLoaded: function() { asyncImageStartLoaded: function() {
}, },
...@@ -2993,6 +2999,7 @@ var ASC_DOCS_API_USE_EMBEDDED_FONTS = "@@ASC_DOCS_API_USE_EMBEDDED_FONTS"; ...@@ -2993,6 +2999,7 @@ var ASC_DOCS_API_USE_EMBEDDED_FONTS = "@@ASC_DOCS_API_USE_EMBEDDED_FONTS";
prot["asc_changeShapeType"] = prot.asc_changeShapeType; prot["asc_changeShapeType"] = prot.asc_changeShapeType;
prot["asc_setInterfaceDrawImagePlaceShape"] = prot.asc_setInterfaceDrawImagePlaceShape; prot["asc_setInterfaceDrawImagePlaceShape"] = prot.asc_setInterfaceDrawImagePlaceShape;
prot["asc_changeImageFromFile"] = prot.asc_changeImageFromFile; prot["asc_changeImageFromFile"] = prot.asc_changeImageFromFile;
prot["asc_changeShapeImageFromFile"] = prot.asc_changeShapeImageFromFile;
// Cell interface // Cell interface
prot["asc_getCellInfo"] = prot.asc_getCellInfo; prot["asc_getCellInfo"] = prot.asc_getCellInfo;
......
...@@ -160,7 +160,6 @@ CImage.prototype = ...@@ -160,7 +160,6 @@ CImage.prototype =
setRasterImage: function(img, canvas) setRasterImage: function(img, canvas)
{ {
this.blipFill = new CBlipFill(); this.blipFill = new CBlipFill();
this.blipFill.RasterImageId = img; this.blipFill.RasterImageId = img;
if(isRealObject(canvas)) if(isRealObject(canvas))
......
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