Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
sdkjs
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boris Kocherov
sdkjs
Commits
a4234ff0
Commit
a4234ff0
authored
May 31, 2016
by
Oleg Korshul
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
новая схема работы с апи билдера
parent
0957160f
Changes
5
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
16124 additions
and
15825 deletions
+16124
-15825
common/apiBase.js
common/apiBase.js
+915
-750
common/plugins.js
common/plugins.js
+53
-2
common/wordcopypaste.js
common/wordcopypaste.js
+73
-0
slide/api.js
slide/api.js
+6424
-6425
word/api.js
word/api.js
+8659
-8648
No files found.
common/apiBase.js
View file @
a4234ff0
This diff is collapsed.
Click to expand it.
common/plugins.js
View file @
a4234ff0
...
...
@@ -306,8 +306,27 @@
{
try
{
var
_script
=
"
(function(){ var Api = window.g_asc_plugins.api;
\n
"
+
value
+
"
})();
"
;
eval
(
_script
);
if
(
window
.
g_asc_plugins
.
api
.
asc_canPaste
())
{
var
_script
=
"
(function(){ var Api = window.g_asc_plugins.api;
\n
"
+
value
+
"
})();
"
;
eval
(
_script
);
var
oLogicDocument
=
window
.
g_asc_plugins
.
api
.
WordControl
?
window
.
g_asc_plugins
.
api
.
WordControl
.
m_oLogicDocument
:
null
;
if
(
pluginData
.
getAttribute
(
"
recalculate
"
)
==
true
)
{
var
_fonts
=
oLogicDocument
.
Document_Get_AllFontNames
();
var
_imagesArray
=
oLogicDocument
.
Get_AllImageUrls
();
var
_images
=
{};
for
(
var
i
=
0
;
i
<
_imagesArray
.
length
;
i
++
)
{
_images
[
_imagesArray
[
i
]]
=
_imagesArray
[
i
];
}
AscCommon
.
Check_LoadingDataBeforePrepaste
(
window
.
g_asc_plugins
.
api
,
_fonts
,
_images
,
function
()
{
window
.
g_asc_plugins
.
api
.
asc_Recalculate
();
});
}
}
}
catch
(
err
)
{
...
...
@@ -495,6 +514,38 @@ function TEST_PLUGINS()
{
text
:
"
Cancel
"
,
primary
:
false
}
]
}
]
},
{
"
name
"
:
"
cbr
"
,
"
guid
"
:
"
asc.{5F9D4EB4-AF61-46EF-AE25-46C96E75E1DD}
"
,
"
variations
"
:
[
{
"
description
"
:
"
cbr
"
,
"
url
"
:
"
cbr/index.html
"
,
"
icons
"
:
[
"
cbr/icon.png
"
,
"
cbr/icon@2x.png
"
],
// "isViewer" : true,
"
isViewer
"
:
false
,
"
EditorsSupport
"
:
[
"
word
"
,
"
cell
"
,
"
slide
"
],
// "isVisual" : true,
// "isModal" : true,
"
isVisual
"
:
false
,
"
isModal
"
:
false
,
"
isInsideMode
"
:
false
,
"
initDataType
"
:
"
none
"
,
"
initData
"
:
""
,
// "isUpdateOleOnResize" : true,
"
isUpdateOleOnResize
"
:
false
,
// "buttons" : [ { "text": "Ok", "primary": true },
// { "text": "Cancel", "primary": false } ]
"
buttons
"
:
[]
}
]
}
];
...
...
common/wordcopypaste.js
View file @
a4234ff0
...
...
@@ -7817,8 +7817,81 @@ function CreateImageFromBinary(bin, nW, nH)
return
para_drawing
;
}
function
Check_LoadingDataBeforePrepaste
(
_api
,
_fonts
,
_images
,
_callback
)
{
var
aPrepeareFonts
=
[];
for
(
var
font_family
in
_fonts
)
{
aPrepeareFonts
.
push
(
new
CFont
(
font_family
,
0
,
""
,
0
));
};
var
aImagesToDownload
=
[];
var
_mapLocal
=
{};
for
(
var
image
in
_images
)
{
var
src
=
_images
[
image
];
if
(
undefined
!==
window
[
"
Native
"
]
&&
undefined
!==
window
[
"
Native
"
][
"
GetImageUrl
"
])
{
_images
[
image
]
=
window
[
"
Native
"
][
"
GetImageUrl
"
](
_images
[
image
]);
}
else
if
(
0
==
src
.
indexOf
(
"
file:
"
))
{
if
(
window
[
"
AscDesktopEditor
"
]
!==
undefined
)
{
if
(
window
[
"
AscDesktopEditor
"
][
"
LocalFileGetImageUrl
"
]
!==
undefined
)
{
aImagesToDownload
.
push
(
src
);
}
else
{
var
_base64
=
window
[
"
AscDesktopEditor
"
][
"
GetImageBase64
"
](
src
);
if
(
_base64
!=
""
)
{
aImagesToDownload
.
push
(
_base64
);
_mapLocal
[
_base64
]
=
src
;
}
else
{
_images
[
image
]
=
"
local
"
;
}
}
}
else
_images
[
image
]
=
"
local
"
;
}
else
if
(
!
g_oDocumentUrls
.
getImageLocal
(
src
))
aImagesToDownload
.
push
(
src
);
}
if
(
aImagesToDownload
.
length
>
0
)
{
AscCommon
.
sendImgUrls
(
_api
,
aImagesToDownload
,
function
(
data
)
{
var
image_map
=
{};
for
(
var
i
=
0
,
length
=
Math
.
min
(
data
.
length
,
aImagesToDownload
.
length
);
i
<
length
;
++
i
)
{
var
elem
=
data
[
i
];
var
sFrom
=
aImagesToDownload
[
i
];
if
(
null
!=
elem
.
url
)
{
var
name
=
g_oDocumentUrls
.
imagePath2Local
(
elem
.
path
);
_images
[
sFrom
]
=
name
;
image_map
[
i
]
=
name
;
}
else
{
image_map
[
i
]
=
sFrom
;
}
}
_api
.
pre_Paste
(
aPrepeareFonts
,
image_map
,
_callback
);
});
}
else
_api
.
pre_Paste
(
aPrepeareFonts
,
_images
,
_callback
);
}
//---------------------------------------------------------export---------------------------------------------------
window
[
'
AscCommon
'
]
=
window
[
'
AscCommon
'
]
||
{};
window
[
"
AscCommon
"
].
Check_LoadingDataBeforePrepaste
=
Check_LoadingDataBeforePrepaste
;
window
[
"
AscCommon
"
].
CDocumentReaderMode
=
CDocumentReaderMode
;
window
[
"
AscCommon
"
].
GetObjectsForImageDownload
=
GetObjectsForImageDownload
;
window
[
"
AscCommon
"
].
ResetNewUrls
=
ResetNewUrls
;
...
...
slide/api.js
View file @
a4234ff0
This diff is collapsed.
Click to expand it.
word/api.js
View file @
a4234ff0
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment