window.Asc.plugin.button = function (id) {
var _info = window.Asc.plugin.info;
var _method = (_info.objectId === undefined) ? "asc_addOleObject" : "asc_editOleObject";
_info.width = _info.width ? _info.width : 70;
_info.height = _info.height ? _info.height : 70;
_info.widthPix = (_info.mmToPx * _info.width) >> 0;
_info.heightPix = (_info.mmToPx * _info.height) >> 0;
_info.imgSrc = window.g_board.getResult(_info.widthPix, _info.heightPix).image;
_info.data = window.g_board.getData();
var _code = "Api." + _method + "(" + JSON.stringify(_info) + ");";
this.callCommand("close", _code);
};
function createScriptFromArray (aSelected) {
var sScript = '';
if (aSelected.length > 0) {
switch (window.Asc.plugin.info.editorType) {
case 'word': {
sScript += 'var oDocument = Api.GetDocument();';
sScript += '\noDocument.CreateNewHistoryPoint();';
sScript += '\nvar oParagraph, oRun, arrInsertResult = [], oImage;';
sScript += '\noDocument.InsertContent(arrInsertResult);';
break;
}
}
}
return sScript;
}
window.Asc.plugin.init = function () {
var plugin_uuid = window.Asc.plugin.info.guid;
};
window.Asc.plugin.init = function () {
var sScript = 'var oDocument = Api.GetDocument();';
sScript += 'oDocument.CreateNewHistoryPoint();';
sScript += 'oParagraph = Api.CreateParagraph();';
sScript += 'oParagraph.AddText(\'Hello word!\');';
sScript += 'oDocument.InsertContent([oParagraph]);';
window.Asc.plugin.info.recalculate = true;
this.callCommand("close", sScript);
};
if (window.Asc.plugin.info.resize === true) {
return window.Asc.plugin.button(0);
}