Commit da388bc8 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@56006 954022d7-b5bf-4e40-9824-e11837661b57
parent 27bac741
......@@ -1586,48 +1586,10 @@
return false;
},
_editorPasteExec: function (worksheet, node, isText,onlyFromLocalStorage)
{
if(node == undefined)
return;
var aResult, binaryResult, textNode, pasteFragment = node, t = this;
if(isOnlyLocalBufferSafari && navigator.userAgent.toLowerCase().indexOf('safari') > -1 && navigator.userAgent.toLowerCase().indexOf('mac'))
onlyFromLocalStorage = true;
//если находимся внутри шейпа
if(worksheet.objectRender.controller.curState.textObject && worksheet.objectRender.controller.curState.textObject.txBody)
{
if(onlyFromLocalStorage)
_pasteFromLocalStorage: function(worksheet, node, onlyFromLocalStorage)
{
if(t.lStorage && t.lStorage.htmlInShape)
worksheet.objectRender.controller.curState.textObject.txBody.insertHtml(t.lStorage.htmlInShape);
}
else
worksheet.objectRender.controller.curState.textObject.txBody.insertHtml(node);
window.GlobalPasteFlag = false;
window.GlobalPasteFlagCounter = 0;
return;
}
var textNode, t = this;
//****binary****
if(copyPasteUseBinary)
{
binaryResult = this._pasteFromBinary(worksheet, node, onlyFromLocalStorage);
if(binaryResult === true)
return;
else if(binaryResult !== false && binaryResult != undefined)
{
pasteFragment = binaryResult;
node = binaryResult;
};
};
//local storage
if(activateLocalStorage)
{
//в случае вставки по нажатию на правую кнопку мыши
if(onlyFromLocalStorage)
{
......@@ -1639,22 +1601,21 @@
{
window.GlobalPasteFlag = false;
window.GlobalPasteFlagCounter = 0;
return;
return true;
}
}
else
{
if(t.lStorage.htmlInShape)
{
node = t.lStorage.htmlInShape;
pasteFragment = node;
return t.lStorage.htmlInShape;
}
else
{
worksheet.setSelectionInfo('paste',t,false,true);
window.GlobalPasteFlag = false;
window.GlobalPasteFlagCounter = 0;
return;
return true;
}
}
}
......@@ -1670,25 +1631,84 @@
{
window.GlobalPasteFlag = false;
window.GlobalPasteFlagCounter = 0;
return;
return true;
}
}
else
{
if(t.lStorage.htmlInShape)
{
node = t.lStorage.htmlInShape;
pasteFragment = node;
return t.lStorage.htmlInShape;
}
else
{
worksheet.setSelectionInfo('paste',t,false,true);
window.GlobalPasteFlag = false;
window.GlobalPasteFlagCounter = 0;
return;
return true;
}
}
};
return false;
},
_pasteInShape: function(worksheet, node)
{
if(onlyFromLocalStorage)
{
if(t.lStorage && t.lStorage.htmlInShape)
worksheet.objectRender.controller.curState.textObject.txBody.insertHtml(t.lStorage.htmlInShape);
}
else
worksheet.objectRender.controller.curState.textObject.txBody.insertHtml(node);
window.GlobalPasteFlag = false;
window.GlobalPasteFlagCounter = 0;
},
_editorPasteExec: function (worksheet, node, isText,onlyFromLocalStorage)
{
if(node == undefined)
return;
var aResult, binaryResult, pasteFragment = node, t = this, localStorageResult;
if(isOnlyLocalBufferSafari && navigator.userAgent.toLowerCase().indexOf('safari') > -1 && navigator.userAgent.toLowerCase().indexOf('mac'))
onlyFromLocalStorage = true;
//если находимся внутри шейпа
if(worksheet.objectRender.controller.curState.textObject && worksheet.objectRender.controller.curState.textObject.txBody)
{
this._pasteInShape(worksheet, node, onlyFromLocalStorage);
return;
};
//****binary****
if(copyPasteUseBinary)
{
binaryResult = this._pasteFromBinary(worksheet, node, onlyFromLocalStorage);
if(binaryResult === true)
return;
else if(binaryResult !== false && binaryResult != undefined)
{
pasteFragment = binaryResult;
node = binaryResult;
};
};
//local storage
if(activateLocalStorage)
{
localStorageResult = this._pasteFromLocalStorage();
if(localStorageResult === true)
return;
else if(localStorageResult !== false && localStorageResult != undefined)
{
pasteFragment = localStorageResult;
node = localStorageResult;
};
};
//parse HTML
......
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