mirror of
https://github.com/ONLYOFFICE/document-server-integration.git
synced 2026-02-10 18:05:10 +08:00
feat(php): loading scripts on page load
This commit is contained in:
@ -1,5 +1,6 @@
|
||||
# Change Log
|
||||
|
||||
- php: loading scripts on page load
|
||||
- java-spring: loading scripts on page load
|
||||
- java: loading scripts on page load
|
||||
- go: loading scripts on page load
|
||||
|
||||
@ -510,10 +510,6 @@ label .checkbox {
|
||||
line-height: 150%;
|
||||
}
|
||||
|
||||
#loadScripts {
|
||||
display: none;
|
||||
}
|
||||
|
||||
#iframeScripts {
|
||||
position: absolute;
|
||||
visibility: hidden;
|
||||
|
||||
@ -134,12 +134,12 @@ if (typeof jQuery != "undefined") {
|
||||
|
||||
if (!formatManager.isAutoConvertible(posExt)) {
|
||||
jq("#step2").addClass("done").removeClass("current");
|
||||
loadScripts();
|
||||
onuploaded();
|
||||
return;
|
||||
}
|
||||
|
||||
if (jq("#checkOriginalFormat").is(":checked")) {
|
||||
loadScripts();
|
||||
onuploaded();
|
||||
return;
|
||||
}
|
||||
jq("#step2").addClass("current");
|
||||
@ -205,35 +205,14 @@ if (typeof jQuery != "undefined") {
|
||||
} else {
|
||||
jq("#uploadFileName").text(response.filename);
|
||||
jq("#step2").addClass("done").removeClass("current");
|
||||
loadScripts();
|
||||
onuploaded();
|
||||
}
|
||||
}
|
||||
});
|
||||
}, 1000);
|
||||
};
|
||||
|
||||
var loadScripts = function () {
|
||||
if (!jq("#mainProgress").is(":visible")) {
|
||||
return;
|
||||
}
|
||||
jq("#step3").addClass("current");
|
||||
|
||||
if (jq("#loadScripts").is(":empty")) {
|
||||
var urlScripts = jq("#loadScripts").attr("data-docs");
|
||||
var frame = '<iframe id="iframeScripts" width=1 height=1 style="position: absolute; visibility: hidden;" ></iframe>';
|
||||
jq("#loadScripts").html(frame);
|
||||
document.getElementById("iframeScripts").onload = onloadScripts;
|
||||
jq("#loadScripts iframe").attr("src", urlScripts);
|
||||
} else {
|
||||
onloadScripts();
|
||||
}
|
||||
};
|
||||
|
||||
var onloadScripts = function () {
|
||||
if (!jq("#mainProgress").is(":visible")) {
|
||||
return;
|
||||
}
|
||||
jq("#step3").addClass("done").removeClass("current");
|
||||
var onuploaded = function () {
|
||||
jq("#beginView, #beginEmbedded").removeClass("disable");
|
||||
|
||||
var fileName = jq("#hiddenFileName").val();
|
||||
@ -289,7 +268,7 @@ if (typeof jQuery != "undefined") {
|
||||
|
||||
jq(document).on("click", "#skipPass", function () {
|
||||
jq("#blockPassword").hide();
|
||||
loadScripts();
|
||||
onuploaded();
|
||||
});
|
||||
|
||||
jq(document).on("click", "#beginEdit:not(.disable)", function () {
|
||||
|
||||
@ -187,10 +187,7 @@
|
||||
<span class="errorPass"></span>
|
||||
<br />
|
||||
</div>
|
||||
<span id="step3" class="step">3. Loading editor scripts.</span>
|
||||
<span class="step-descr">They are loaded only once, they will be cached on your computer.</span>
|
||||
<input type="hidden" name="hiddenFileName" id="hiddenFileName" />
|
||||
<br />
|
||||
<span class="progress-descr">Note the speed of all operations depends
|
||||
on your connection quality and server location.</span>
|
||||
<br />
|
||||
@ -237,7 +234,7 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<span id="loadScripts" data-docs="{dataDocs}"></span>
|
||||
<iframe id="iframeScripts" src="{dataDocs}" width=1 height=1 style="position: absolute; visibility: hidden; top: 0;" ></iframe>
|
||||
|
||||
<footer>
|
||||
<div class="center">
|
||||
|
||||
Reference in New Issue
Block a user