は、同様の問題が1つのHTMLにJSを統合したいと考えていましたが、<body>
部分の内側クラス自体を作成することを忘れないでください:ヘッダーは次のようになります。私はそれがエッジランタイム自体でいくつかの微調整で動作するようにはできませんでした。残念ながら、adobeがあなたに与えるcdnの速度を台無しにするでしょう。しかしそうでなければ、アプローチは@Klajbarによって与えられた答えに似ています。 エッジランタイムの内部をチェックして他のファイルとの互換性を保証できる場合は、エッジランタイムが必要です
私が行ったのは、loadCompositionに変数を追加し、f.load(a + "_edge .js ")をif文で実行して、変数がなくても実行されることを確認します。それはあなたがランタイムは、まずloadCompositionブロック、そして_edge.jsコードをロードされている同じHTML、にコードを含めることができます行うの後は修正edge.runtime.js例
//added inline as last variable
loadComposition: function(a, b, c, g, m,inline) {
function n(a, g) {
W(function() {
var m =
d("." + b),
k = /px|^0$/,
n = c.scaleToFit,
e = c.centerStage,
h = c.minW,
f = c.maxW,
l = c.width,
s = c.height,
y = m[0] || document.getElementsByTagName("body")[0];
"absolute" != y.style.position && "relative" != y.style.position && (y.style.position = "relative");
s && (y.style.height = s);
l && (y.style.width = l);
/^height$|^width$|^both$/.test(n) && (h = k.test(h) ? parseInt(h, 10) : void 0, f = k.test(f) ? parseInt(f, 10) : void 0, v(d(y), n, h, f, !1, c.bScaleToParent));
/^vertical$|^horizontal$|^both$/.test(e) && t(y, e);
a && L(H[b], null, a.dom, a.style, m[0], g + b);
m.removeClass("edgeLoad-" +
b)
})
}
/** removed some code here just for legibility **/
//if statement to override loading js files
if(!inline){
ba ? (window.edge_authoring_mode ||
(g ? (f.definePreloader(g), e()) : f.load(a + "_edgePreload.js", e)), a && (c && c.bootstrapLoading ? ka.push(a) : window.edge_authoring_mode && c.sym ? f.load(a +
"_edge.js?symbol=" + c.sym) : f.load(a + "_edge.js"))) : window.edge_authoring_mode ||
(m ? (f.defineDownLevelStage(m), h()) : f.load(a + "_edgePreload.js", h))
f.load(a + "_edge.js");
}
から 抜粋。 例:
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=Edge"/>
<title>Untitled</title>
<script>
//modified edge.runtime.js file
</script>
<style>
.edgeLoad-EDGE-24658395 { visibility:hidden; }
</style>
<script>
AdobeEdge.loadComposition('jem%26fix_afrens_930x180_uge14', 'EDGE-24658395', {
scaleToFit: "none",
centerStage: "none",
minW: "0px",
maxW: "undefined",
width: "930px",
height: "180px"
}, {"dom":{}}, {"style":{"${symbolSelector}":{"isStage":"true","rect":["undefined","undefined","960px","180px"]}},"dom":{}},true);
//notice appeded boolean value as the end to enable the override.
</script>
<!--Adobe Edge Runtime End-->
<script id="test">
// contents of _edge.js file
</script>
</head>
<body style="margin:0;padding:0;">
<div id="Stage" class="EDGE-24658395">
</div>
</body>
</html>
私はロードのためだけの1 _edge.jsを、それを使用して、プリロードのものを含む選択した場合、テストしていません。
私が欲しいものではありません、まだJS別の外部ファイルこと。 EdgeはAdobeEdge.loadComposition( 'test'、...)を使用して、Edgeが公開時に作成するファイルtest_edge.jsを読み込みます。このファイルもHTMLファイルに埋め込みます。私のHTMLファイルに埋め込まれるファイル。私が最後にしたいのは、画像のbase24、edge.6.0.0.min.js、test_edge.jsコード – jiggy1965
のすべてを含む単一のhtmlファイルです。 私はこれがあなたの望むものであることを願っています – Klajbar
これは既に試みましたが動作しませんAdobeEdge.loadCompositionは、特にインラインコンテンツではなく、test_edge.jsファイルを探します。 '_edge.js'の部分がなくても、それは難しいのですが、何とかloadCompostionに外部ファイルの代わりにtest_edge.jsのインラインコンテンツをロードする必要があります。 – jiggy1965